brain0 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/bin/brain0.js +269 -0
- package/package.json +53 -0
- package/src/lib.mjs +72 -0
- package/vendor/gui/assets/BufferResource-VGpCfGWQ.js +186 -0
- package/vendor/gui/assets/BufferResource-VGpCfGWQ.js.map +1 -0
- package/vendor/gui/assets/CanvasRenderer-fCJxZSuL.js +2 -0
- package/vendor/gui/assets/CanvasRenderer-fCJxZSuL.js.map +1 -0
- package/vendor/gui/assets/Filter-DBNO82oR.js +2 -0
- package/vendor/gui/assets/Filter-DBNO82oR.js.map +1 -0
- package/vendor/gui/assets/RenderTargetSystem-DxpnxrEz.js +185 -0
- package/vendor/gui/assets/RenderTargetSystem-DxpnxrEz.js.map +1 -0
- package/vendor/gui/assets/WebGLRenderer-DyKdZImF.js +157 -0
- package/vendor/gui/assets/WebGLRenderer-DyKdZImF.js.map +1 -0
- package/vendor/gui/assets/WebGPURenderer-DkU0IC2y.js +42 -0
- package/vendor/gui/assets/WebGPURenderer-DkU0IC2y.js.map +1 -0
- package/vendor/gui/assets/browserAll-Cx9RpU85.js +15 -0
- package/vendor/gui/assets/browserAll-Cx9RpU85.js.map +1 -0
- package/vendor/gui/assets/index-QopGLZI_.js +256 -0
- package/vendor/gui/assets/index-QopGLZI_.js.map +1 -0
- package/vendor/gui/assets/webworkerAll-DTnGa_dQ.js +84 -0
- package/vendor/gui/assets/webworkerAll-DTnGa_dQ.js.map +1 -0
- package/vendor/gui/brain0-logo.svg +1 -0
- package/vendor/gui/brain0-wordmark.svg +1 -0
- package/vendor/gui/index.html +506 -0
- package/vendor/server/server.js +1907 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";82BAkEO,MAAMA,EAA0C,CACrD,YAA6BC,EAAO,GAAI,CAAX,UAAAA,CAAY,CAEzC,MAAM,MAA+B,CACnC,MAAMC,EAAM,MAAM,MA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AAWrvD,CAAK,CAAC,8BACnD21D,CAAK,GAAGC,CAAI,eAGvC,CAEA,SAASpC,GAAS/a,EAAcv0C,EAAqB,CACnD,OAAOu0C,EAAK,OAASv0C,EAAM,GAAGu0C,EAAK,MAAM,EAAGv0C,CAAG,CAAC,MAAMu0C,EAAK,MAAM,UAAYA,CAC/E,CAGA,SAASsW,GAAemG,EAAsB,CAE5C,MAAM3X,EAAQ2X,EAAK,MAAM;AAAA,CAAI,EAEvBN,EADQrX,EAAM,MAAM,EAAG,GAAS,EAEnC,IAAK0D,GAAS,CACb,IAAI+U,EAAM,MACV,OAAI/U,EAAK,WAAW,KAAK,GAAKA,EAAK,WAAW,KAAK,EAAG+U,EAAM,OACnD/U,EAAK,WAAW,GAAG,EAAG+U,EAAM,MAC5B/U,EAAK,WAAW,GAAG,EAAG+U,EAAM,MAC5B/U,EAAK,WAAW,IAAI,EAAG+U,EAAM,QAC7B/U,EAAK,WAAW,OAAO,GAAKA,EAAK,WAAW,QAAQ,KAAG+U,EAAM,QAC/D,mBAAmBA,CAAG,KAAK3G,EAAWpO,CAAI,GAAK,GAAG,SAC3D,CAAC,EACA,KAAK;AAAA,CAAI,EACN2U,EACJrY,EAAM,OAAS,IACX;AAAA,0BAA6BA,EAAM,OAAS,GAAS,qBACrD,GACN,MAAO,qBAAqBqX,CAAI,GAAGgB,CAAI,QACzC,CAEA,SAASvG,EAAW5W,EAAsB,CACxC,OAAOA,EAAK,QAAQ,UAAY5iD,GAC9BA,IAAM,IAAM,QAAUA,IAAM,IAAM,OAASA,IAAM,IAAM,OAAS,SAEpE,CAEK+3D,GAAA","names":["HttpDataSource","base","res","query","phase","phaseArg","id","ref","ExtensionType","ExtensionType2","normalizeExtension","ext","normalizeExtensionPriority","defaultPriority","extensions","extensions2","type","_b","_a","handlers","queue","onAdd","onRemove","addHandlers","removeHandlers","map","extension","item","a","b","index","list","Target","sources","source","browserExt","webworkerExt","ObservablePoint","observer","x","y","p","value","has","prefix","Events","EE","fn","context","once","addListener","emitter","event","listener","evt","clearEvent","EventEmitter","names","events","name","i","l","ee","listeners","a1","a2","a3","a4","a5","len","args","length","j","module","PI_2","RAD_TO_DEG","DEG_TO_RAD","Point","tempPoint","Matrix","c","d","tx","ty","array","transpose","out","pos","newPos","angle","cos","sin","c1","tx1","matrix","b1","d1","b2","c2","d2","pivotX","pivotY","scaleX","scaleY","rotation","skewX","skewY","transform","pivot","delta","n","identityMatrix","tempMatrix","ux","uy","vx","vy","rotationCayley","rotationMatrices","signum","init","row","_ux","_uy","_vx","_vy","k","mat","groupD8","ind","rotationSecond","rotationFirst","dx","dy","dw","dh","finalTx","finalTy","rect","sourceFrame","width","height","frameX","frameY","frameWidth","frameHeight","tempPoints","Rectangle","bounds","rectangle","strokeWidth","alignment","_x","_y","strokeWidthOuter","strokeWidthInner","outerLeft","outerRight","outerTop","outerBottom","innerLeft","innerRight","innerTop","innerBottom","other","x02","y02","x0","x1","y0","y1","lt","lb","rt","rb","s","nx","ny","n00","n10","n01","n11","mx","my","m00","m10","m01","m11","paddingX","paddingY","x2","y2","resolution","eps","uidCache","uid","warnings","v8_0_0","v8_3_4","deprecationState","deprecation","version","message","ignoreDepth","stack","deprecationMessage","useGroup","NOOP","nextPow2","v","isPow2","definedProps","obj","result","key","idHash","createResourceIdFromString","_TextureStyle","options","bigKey","TextureStyle","_TextureSource","resource","newPixelWidth","newPixelHeight","_resource","TextureSource","BufferImageSource","buffer","format","tempMat","TextureMatrix","texture","clampMargin","uvs","tex","orig","trim","texBase","frame","margin","offset","Texture","label","defaultAnchor","defaultBorders","rotate","dynamic","nX","nY","nW","nH","w2","h2","cX","cY","destroySource","updateQuadBounds","anchor","sourceWidth","sourceHeight","defaultMatrix","Bounds","minX","minY","maxX","maxY","mask","left","right","top","bottom","vertexData","beginOffset","endOffset","localX","localY","r","t","e","u","o","h","g","f","m","N","M","H","$","w","S","namesPlugin","extend","_Color","value1","value2","type1","keys1","keys2","alpha","applyToRGB","hexString","alphaString","int","match","color","colord","min","max","Color","cullingMixin","warnCount","maxWarnings","warn","GlobalResourceRegistry","pool","Pool","ClassType","initialSize","total","data","PoolGroupClass","Class","stats","BigPool","cacheAsTextureMixin","val","removeItems","arr","startIdx","removeCount","childrenHelperMixin","beginIndex","endIndex","end","range","removed","child","renderGroup","children","sameParent","currentIndex","child2","index1","index2","childMat","newMatrix","oldChild","newChild","collectRenderablesMixin","instructionSet","renderer","currentLayer","renderPipes","effect","FilterEffect","MaskEffectManagerClass","test","MaskEffectManager","effectsMixin","hasFilters","hadFilters","didChange","findMixin","deep","found","matrixPool","boundsPool","getFastGlobalBoundsMixin","factorRenderLayers","localBounds","manageEffects","viewBounds","advanced","getGlobalBounds","target","skipUpdateTransform","parentTransform","pooledMatrix","updateTransformBackwards","_getGlobalBounds","worldTransform","parentBounds","preserveBounds","renderableBounds","parent","multiplyHexColors","color1","color2","r1","g1","r2","g2","WHITE_BGR","multiplyColors","localBGRColor","parentBGRColor","bgr2rgb","getGlobalMixin","skipUpdate","current","getLocalBounds","relativeMatrix","_getLocalBounds","rootContainer","isRoot","relativeTransform","localTransform","checkChildrenDidChange","container","previousData","measureMixin","localWidth","sign","localHeight","localBoundsCacheData","onRenderMixin","func","sortMixin","sortChildren","toLocalGlobalMixin","point","position","globalMatrix","from","InstructionSet","instruction","count","TexturePoolClass","textureOptions","pixelWidth","pixelHeight","antialias","autoGenerateMipmaps","textureSource","po2Width","po2Height","antialiasFlag","mipmapFlag","renderTexture","resetStyle","destroyTextures","textures","TexturePool","RenderGroup","root","cachedParent","childrenAtDepth","renderGroupChild","childrenToUpdate","renderable","parentCacheAsTexture","assignWithIgnore","ignore","defaultSkew","defaultPivot","defaultScale","defaultOrigin","UPDATE_COLOR","UPDATE_BLEND","UPDATE_VISIBLE","Container","parentRenderGroup","size","skew","opts","localTransformChangeId","scale","origin","sx","sy","px","py","ox","oy","bgr","valueNumber","oldChildren","ViewContainer","pipe","Sprite","roundPixels","rest","skipCache","currentTexture","destroyTextureSource","tempBounds","addMaskBounds","boundsToMask","addMaskLocalBounds","localRoot","relativeMask","getMatrixRelativeToParent","AlphaMask","hitTestFn","ColorMask","StencilMask","BrowserAdapter","canvas","url","xml","currentAdapter","DOMAdapter","adapter","CanvasSource","didResize","ImageSource","UPDATE_PRIORITY","UPDATE_PRIORITY2","TickerListener","priority","ticker","redirect","previous","hard","_Ticker","time","currentTime","elapsedMS","head","fps","minFPMS","shared","system","Ticker","promise","detectVideoAlphaMode","gl","video","resolve","video2","framebuffer","pixel","_VideoSource","reject","VideoSource","convertToList","input","forceTransform","CacheClass","keys","cacheableAssets","parser","cacheableMap","key2","cacheKeys","cachedAssets","cacheMap","Cache","textureSourceFrom","hasResource","Source","resourceToTexture","textureFrom","LoaderParserPriority","LoaderParserPriority2","assertPath","path2","removeUrlParams","escapeRegExp","string","replaceAll","str","find","replace","normalizeStringPosix","allowAboveRoot","lastSegmentLength","lastSlash","dots","code","lastSlashIndex","path","matchFile","matchProtocol","customBaseUrl","customRootUrl","baseUrl","rootUrl","protocol","isAbsolute","trailingSeparator","segments","joined","arg","prevArg","hasRoot","matchedSlash","proto","origpath","start","extIdx","firstNonSlashEnd","startDot","startPart","preDotState","ret","processX","ids","depth","tags","createStringVariations","regex","vars","split","isSingleItem","Resolver","bundleId","assetId","assetBundleId","bundleIdentifier","preferOrders","prefer","basePath","rootPath","searchParams","queryValues","asset","alias","src","manifest","bundle","assets","assetNames","convertedAssets","srcs","aliases","bundleAssetId","bundleIds","keyCheck","userDefinedLoadParser","userDefinedParser","srcsToUse","src2","aliasesToUse","resolvedAssets","parseUrl","formattedAsset","singleAsset","results","preferredOrder","priorityKey","filteredAssets","preferred","preference","paramConnector","assetData","loadParser","progressSize","getUrlExtension","copySearchParams","targetUrl","sourceUrl","_Spritesheet","optionsOrTexture","arg1","cachePrefix","metaResolution","initialFrameIndex","processAll","frameIndex","maxFrames","sourceSize","animations","animName","frameName","callback","destroyBase","Spritesheet","validImages","getCacheableAssets","ignoreMultiPack","out2","spritesheetAsset","loader","imageTexture","imageFilename","imagePath","spritesheet","multiPacks","promises","itemUrl","sp","_resolvedAsset","idCounts","createIdFromString","groupId","getTestContext","maxFragmentPrecision","getMaxFragmentPrecision","addProgramDefines","isES300","isFragment","ensurePrecision","maxSupportedPrecision","precision","insertVersion","fragmentNameCache","VertexNameCache","setProgramName","nameCache","stripVersion","processes","programCache","_GlProgram","preprocessorOptions","fragment","vertex","processKey","processOptions","GlProgram","attributeFormatData","getAttributeInfoFromFormat","WGSL_TO_VERTEX_TYPES","LOCATION_REGEX","parseLocations","stripComments","extractAttributesFromGpuProgram","entryPoint","cleanSource","mainVertStart","arrowFunctionStart","functionArgsSubstring","structMatch","structName","structRegex","structBody","extractStructAndGroups","wgsl","linePattern","groupPattern","bindingPattern","namePattern","typePattern","structPattern","structMemberPattern","groups","structs","struct","members","acc","member","name2","group","ShaderStage","ShaderStage2","generateGpuLayoutGroups","layout","generateLayoutHash","removeStructAndGroupDuplicates","vertexStructsAndGroups","fragmentStructsAndGroups","structNameSet","dupeGroupKeySet","GpuProgram","gpuLayout","structsAndGroups","UNIFORM_TYPES_VALUES","UNIFORM_TYPES_MAP","getDefaultUniformValue","_UniformGroup","uniformStructures","uniforms","uniformData","arrayMatch","innerType","UniformGroup","BindGroup","resources","keyParts","currentResource","now","tick","RendererType","RendererType2","Shader","gpuProgram","glProgram","compatibleRenderers","groupMap","nameHash","uniformName","groupData","bindTick","groupIndex","bindIndex","uniformsOut","destroyPrograms","bindGroup","gpu","blendModeIds","BLEND","OFFSET","CULLING","DEPTH_TEST","WINDING","DEPTH_MASK","_State","state","State","environments","loadEnvironmentExtensions","skip","env","unsafeEval","unsafeEvalSupported","earcut","holeIndices","dim","hasHoles","outerLen","outerNode","linkedList","triangles","invSize","eliminateHoles","earcutLinked","clockwise","last","signedArea","insertNode","equals","removeNode","filterPoints","again","area","ear","pass","indexCurve","stop","prev","next","isEarHashed","isEar","cureLocalIntersections","splitEarcut","ax","bx","cx","ay","by","cy","pointInTriangleExceptFirst","minZ","zOrder","maxZ","intersects","locallyInside","isValidDiagonal","splitPolygon","getLeftmost","compareXYSlope","eliminateHole","aSlope","bSlope","hole","bridge","findHoleBridge","bridgeReverse","hx","hy","qx","tanMin","pointInTriangle","tan","sectorContainsSector","sortLinked","numMerges","inSize","tail","q","pSize","qSize","leftmost","intersectsPolygon","middleInside","p1","p2","q1","q2","o1","o2","o3","o4","onSegment","num","inside","createNode","an","bp","sum","earcutModule","CLEAR","CLEAR2","SystemRunner","a0","a6","a7","items","defaultRunners","_AbstractRenderer","config","combinedRunners","systemName","deprecated","isRGBAArray","desiredScreenWidth","desiredScreenHeight","previousResolution","clear","clearColor","mipLevel","layer","runnerIds","runnerId","systems","ClassRef","pipes","pipeAdaptors","adaptors","adaptor","PipeClass","Adaptor","runner","AbstractRenderer","_isWebGLSupported","isWebGLSupported","failIfMajorPerformanceCaveat","contextOptions","success","loseContext","_isWebGPUSupported","isWebGPUSupported","renderPriority","autoDetectRenderer","RendererClass","finalOptions","rendererType","WebGPURenderer","__vitePreload","WebGLRenderer","CanvasRenderer","VERSION","ApplicationInitHook","RendererInitHook","ResizePlugin","dom","clientWidth","clientHeight","TickerPlugin","oldTicker","_Application","plugin","rendererDestroyOptions","plugins","Application","segment","number","parse","_","cmd","command","values","parseValues","numbers","parseSVGPath","svgPath","commands","subpaths","currentSubPath","lastX","lastY","Circle","radius","outerWidth","distance","circle","Ellipse","halfWidth","halfHeight","normx","normy","strokeOuterWidth","strokeInnerWidth","innerHorizontal","innerVertical","outerHorizontal","outerVertical","normalizedX","normalizedY","innerEllipse","outerEllipse","ellipse","squaredDistanceToLineSegment","dot","lenSq","param","xx","yy","tempRect","tempRect2","Polygon","points","flat","il","polygon","thisBounds","otherBounds","xi","yi","xj","yj","strokeWidthSquared","rightWidthSquared","leftWidthSquared","iterationLength","distanceSquared","pointsDesc","currentPoint","isCornerWithinStroke","pX","pY","cornerX","cornerY","RoundedRectangle","radius2","innerX","innerY","innerWidth","innerHeight","rightBound","bottomBound","cachedGroups","getTextureBatchBindGroup","maxTextures","generateTextureBatchBindGroup","bindGroupResources","ViewableBuffer","sizeOrBuffer","fastCopy","sourceBuffer","destinationBuffer","sourceOffset","byteLength","BLEND_TO_NPM","STENCIL_MODES","STENCIL_MODES2","getAdjustedBlendModeBlend","blendMode","fragTemplate","generateIfTestSrc","maxIfs","checkMaxIfStatementsInShader","shader","fragmentSrc","maxTexturesPerBatchCache","getMaxTexturesPerBatch","BatchTextureArray","Batch","batchPool","batchPoolIndex","getBatchFromPool","returnBatchToPool","batch","BATCH_TICK","_Batcher","attributesInitialSize","indicesInitialSize","batchableObject","textureId","attributeBuffer","elements","textureBatch","firstElement","topology","f32","u32","indexBuffer","action","batchElements","element","adjustedBlendMode","breakRequired","indexStart","indexSize","newSize","newArrayBuffer","newIndexBuffer","indicesOffset","indices","indexOffset","attributeOffset","Batcher","BufferUsage","BufferUsage2","Buffer","usage","shrinkToFit","mappedAtCreation","syncGPU","oldData","sizeInBytes","ensureIsBuffer","getGeometryBounds","geometry","attributeId","attribute","byteSize","stride","ensureIsAttribute","Geometry","attributes","attributeOption","destroyBuffers","placeHolderBufferData","placeHolderIndexData","BatchGeometry","addBits","srcParts","parts","part","sanitisedPart","findHooksRx","compileHooks","programSrc","hook","extractInputs","fragmentSource","compileInputs","fragments","template","sort","mainInput","finalString","inValue","cleanedString","extractOutputs","extractVariableName","stripVariable","compileOutputs","mainStruct","mainStart","mainEnd","compiledCode","injectBits","templateSrc","fragmentParts","bitCacheMap","CACHE_UID","compileHighShader","bits","cacheId","generateCacheId","compileInputsAndOutputs","compileBits","compileHighShaderGl","vertexFragments","shaderBit","fragmentFragments","compiledVertex","compiledFragment","highFragment","vertexParts","vertexGPUTemplate","fragmentGPUTemplate","vertexGlTemplate","fragmentGlTemplate","globalUniformsBit","globalUniformsBitGl","compileHighShaderGpuProgram","compileHighShaderGlProgram","colorBit","colorBitGl","textureBatchBitGpuCache","generateBindingSrc","bindingIndex","generateSampleSrc","generateTextureBatchBit","textureBatchBitGlCache","generateSampleGlSrc","generateTextureBatchBitGl","roundPixelsBit","roundPixelsBitGl","batchSamplersUniformGroupHash","getBatchSamplersUniformGroup","batchSamplersUniformGroup","sampleValues","DefaultShader","defaultShader","_DefaultBatcher","float32View","uint32View","textureIdAndRound","wt","positions","argb","i2","w0","w1","h0","h1","DefaultBatcher","GCManagedHash","onUnload","gpuData","buildUvs","vertices","verticesStride","verticesOffset","uvsOffset","uvsStride","buildSimpleUvs","transformVertices","BatchableGraphics","rgb","gpuBuffer","buildCircle","shape","rx","ry","roundedRect","j1","j2","j3","j4","y22","x12","x22","y12","centerX","centerY","centerIndex","buildEllipse","buildRoundedRectangle","closePointEps","curveEps","getOrientationOfPoints","square","innerWeight","outerWeight","verts","ix","iy","exx","eyy","eix","eiy","eox","eoy","round","ex","ey","cx2p0x","cy2p0y","angle0","angle1","startAngle","angleDiff","absAngleDiff","segCount","angleInc","buildLine","lineStyle","flipAlignment","closed","style","orientation","firstPoint","lastPoint","closedShape","closedPath","midPointX","midPointY","indexCount","widthSquared","miterLimitSquared","perpX","perpY","perp1x","perp1y","dist","ratio","dx0","dy0","dx1","dy1","cross","pDist","imx","imy","omx","omy","smallerInsideSegmentSq","insideWeight","smallerInsideDiagonalSq","eps2","buildPixelLine","fx","fy","lx","ly","closePath","triangulateWithHoles","holes","emptyArray","buildPolygon","buildRectangle","rectData","verticesIndex","buildTriangle","emptyColorStops","_FillGradient","ensureGradientOptions","flip","temp","colorStops","defaultSize","getCanvas","gradient","addColorStops","r0","FillGradient","tempTextureMatrix","generateTextureMatrix","textureMatrix","mTx","mTy","sourceStyle","shapeBuilders","buildContextBatches","gpuContext","geometryData","batches","addTextureToGeometryData","isStroke","shapePath","addShapePathToGeometryData","build","vertOffset","textureUvs","graphicsBatch","close","otherPoints","getHoleArrays","holePoints","holePrimitives","holeArrays","holePrimitive","GpuGraphicsContext","GraphicsContextRenderData","_GraphicsContextSystem","hasContext","batchMode","graphicsData","vertexSize","batcher","drawBatches","GraphicsContextSystem","RECURSION_LIMIT","FLT_EPSILON","PATH_DISTANCE_EPSILON","buildAdaptiveBezier","sX","sY","cp1x","cp1y","cp2x","cp2y","eX","eY","smoothness","smoothing","distanceTolerance","begin","recursive","x3","y3","x4","y4","level","x23","y23","x34","y34","x123","y123","x234","y234","x1234","y1234","d3","buildAdaptiveQuadratic","buildArc","steps","cs","sn","buildArcTo","fromX","mm","dd","cc","tt","k1","k2","qy","endAngle","TAU","mapToEllipse","cosPhi","sinPhi","xp","yp","approxUnitArc","ang1","ang2","vectorAngle","getArcCenter","largeArcFlag","sweepFlag","pxp","pyp","rxSq","rySq","pxpSq","pypSq","radicant","centerXp","centerYp","vx1","vy1","vx2","vy2","buildArcToSvg","xAxisRotation","lambda","outCurvePoint","curve","roundedShapeArc","vecFrom","pp","sharpCorner","pRadius","p3","v1","v2","radDirection","drawDirection","halfAngle","cRadius","lenOut","roundedShapeQuadraticCurve","pointLerp","numPoints","thisPoint","nextPoint","lastEdgeLength","lastOffsetDistance","nextEdgeLength","nextOffsetDistance","tempRectangle","ShapePath","graphicsPath2D","fromY","counterclockwise","currentPoly","shapePrimitives","mainShape","shapePrimitive","mainPolygon","sides","corner","sideLength","internalAngle","useQuadratic","fillet","maxFillet","inset","dir","chamfer","radiusX","radiusY","lastShape","tempX","boundsRect","GraphicsPath","instructions","signed","currentX","currentY","cpx1","cpy1","innerRadius","newGraphicsPath2D","cpx2","cpy2","adjustTransform","lastInstruction","currentMatrix","parseSVGFloatAttribute","svg","defaultValue","parseSVGDefinitions","session","definitions","definition","parseLinearGradient","parseRadialGradient","gradientUnit","_child","extractSvgUrlId","styleAttributes","parseSVGStyle","strokeStyle","fillStyle","parseAttribute","styleParts","stylePart","id2","checkForNestedPattern","subpathsWithArea","areas","largestArea","secondArea","smallestArea","largestToSecondRatio","secondToSmallestRatio","extractSubpaths","pathData","calculatePathArea","coords","xs","ys","appendSVGPath","graphicsPath","tempPath","SVGParser","graphicsContext","div","renderChildren","f1","s1","noStyle","pointsString","fillRule","hasExplicitEvenodd","hasMultipleSubpaths","subpath","isMainShape","newPath","isHole","useEvenoddForGraphicsPath","isFillPatternOptions","repetitionMap","FillPattern","textureOrOptions","repetition","rep","isColorLike","isFillPattern","isFillGradient","isTexture","handleColorLike","fill","defaultStyle","handleTexture","handleFillPattern","handleFillGradient","handleFillObject","toFillStyle","objectStyle","toStrokeStyle","miterLimit","cap","join","pixelLine","getMaxMiterRatio","maxRatio","prevIdx","nextIdx","len0Sq","len1Sq","clampedCos","sinHalfAngle","miterRatio","tmpPoint","_GraphicsContext","clone","tint","holePath","transformedX","transformedY","cpx","cpy","outerPadding","_bounds","hasHit","shapes","transformedPoint","holeShapes","GraphicsContext","canUseNewCanvasBlendModesValue","createColoredCanvas","canUseNewCanvasBlendModes","magenta","yellow","imageData","canvasUtils","isPMA","resourceWidth","resourceHeight","needsResize","cached","bytes","alphaInv","sprite","stringColor","cache","cachedCanvas","resourceId","pattern","invert","patternAny","DOMMatrixCtor","domMatrix","crop","isVertical","outWidth","outHeight","srcWidth","srcHeight","inv","CanvasPoolClass","canvasOptions","minWidth","minHeight","canvasAndContext","CanvasPool","getPo2TextureFromSource","image","CanvasGraphicsContext","CanvasGraphicsContextRenderData","_CanvasGraphicsContextSystem","renderData","CanvasGraphicsContextSystem","CanvasGraphicsPipe","_graphics","graphics","color32BitToUniform","abgr","GraphicsGpuData","GraphicsPipe","wasBatched","localUniforms","batchPipe","batchClone","Graphics","method","AbstractText","styleClass","text","ensureTextOptions","_internalCanvas","_internalContext","ensureInternalCanvas","checkRow","checkColumn","getCanvasBoundingBox","output","LRU","ttl","resetTtl","bypass","evicted","lru","hasTagStyles","hasTagMarkup","createMergedStyle","baseStyle","overrides","parseTaggedText","runs","tagStyles","styleStack","tagStack","currentText","char","closeIndex","nextOpenIndex","tagContent","closingTagName","tagName","currentStyle","mergedStyle","NEWLINES","NEWLINES_SET","BREAKING_SPACES","BREAKING_SPACES_SET","COLLAPSIBLE_SPACES","BREAK_AFTER_CHARS","BREAK_AFTER_CHARS_SET","NEWLINE_SPLIT_REGEX","NEWLINE_MATCH_REGEX","isNewline","isBreakingSpace","_nextChar","isBreakAfterChar","collapseSpaces","whiteSpace","collapseNewlines","trimRight","tokenize","tokens","tokenChars","nextChar","getCharacterGroups","token","breakWords","splitFn","canBreakCharsFn","characters","lastChar","NEWLINE_TO_SPACE_REGEX","measureTaggedText","wordWrap","measureTextFn","wrapMeasureTextFn","measureFontFn","wordWrapSplitFn","run","runsByLine","currentLineRuns","wrappedRunsByLine","wordWrapTaggedLines","lineWidths","lineAscents","lineDescents","lineHeightsArr","lines","maxLineWidth","baseFont","baseFontProps","lastFont","hasDropShadow","maxRunStrokeWidth","lineRuns","lineWidth","lineAscent","lineDescent","lineText","runFont","runFontProps","runWidth","runStrokeWidth","computedLineHeight","baseHeight","baseLineHeight","letterSpacing","wordWrapWidth","shouldCollapseSpaces","adjustedWrapWidth","tokenWidthCache","measureTokenWidth","tokenStyle","cacheKey","font","styledTokens","tokenizeTaggedRuns","resultStartLength","getWordGroupWidth","startIndex","totalWidth","groupToken","groupStyle","getWordGroupTokens","currentWidth","canPrependSpaces","buildingRun","flushBuildingRun","startNewLine","lastRun","continuesFromPrevious","tokenWidth","currIsSpace","lastIsSpace","startsWordGroup","wordGroupWidth","wordGroupTokens","charGroups","charWidth","isSpace","lastTokenWasWord","isFirstTokenInRun","contextSettings","getFromCache","canBreakWordsFn","line","linesArray","shouldCollapseNewlines","currIsBreakingSpace","lastIsBreakingSpace","characterWidth","trimmedLine","_CanvasTextMetrics","lineHeight","fontProperties","taggedData","wordWrap2","textKey","measurements2","measurements","baseWidth","metricWidth","metrics","letterSpacingVal","actualBoundingBoxLeft","boundsWidth","useExperimentalLetterSpacing","_token","_char","_index","_breakWords","ascent","descent","properties","segmenter","CanvasTextMetrics","genericFontFamilies","fontStringFromTextStyle","fontSizeString","fontFamilies","fontFamily","PRECISION","getCanvasFillStyle","textMetrics","padding","offsetX","offsetY","fillPattern","fillGradient","isLinear","isLocal","isNearlyVertical","center","outerCenter","outerRadius","globalStop","countSpaces","CanvasTextGeneratorClass","measured","linePositionX","linePositionY","passesCount","halfStroke","linePositionYShift","isShadowPass","dsOffsetText","dsOffsetShadow","gradientBounds","gradientOffset","gradientMetrics","wordSpacing","spaces","_c","lineHeights","maxStrokeWidth","runDataByLine","lineIndex","runData","currentLineHeight","lineRunData","totalSpaces","runX","runIndex","runStroke","spacesSkipped","runHeight","runMetrics","spacesInRun","spacesInFillRun","strokePadding","shadowOptions","dropShadowColor","dropShadowAlpha","dropShadowBlur","dropShadowDistance","alignWidth","align","words","currentPosition2","spaceWidth","currentPosition","stringArray","previousWidth","currentChar","textStr","CanvasTextGenerator","_TextStyle","convertV7Tov8Style","fullStyle","thisKey","filterPadding","_d","cb","property","newValue","TextStyle","oldStyle","defaults","gradientFill","fillGradientStops","fills","updateTextBounds","batchableSprite","paddingOffset","paddingOffsetY","BatchableSprite","BatchableText","CanvasTextPipe","gpuText","newKey","batchableText","canvasText","AbstractTextSystem","retainCanvasContext","_resolution","_style","_textKey","textureStyle","filteredTexture","activeTexture","filters","currentRenderTarget","resultTexture","CanvasRendererTextSystem","CanvasTextSystem","Text","canvasMeasurement","DEFAULT_FORCES","MAX_SPEED","ForceLayout","snapshot","params","__publicField","node","edge","repulsion","spring","restLength","gravity","damping","dist2","force","ai","bi","speed","span","minDist","iterations","it","moved","push","TASK_COLOR","EDGE_COLOR","HIGHLIGHT_COLOR","SEVERITY_COLOR","hexToNumber","hex","fallback","parsed","nodeDisplayName","sym","seg","_PixiGraph","sw","sh","z","zoom","wx","wy","factor","severityMap","set","cutoffMs","visible","sev","selecting","focusing","pa","pb","active","dragging","downX","downY","pressedId","DRAG_THRESHOLD","endDrag","PixiGraph","el","main","stage","prompt","sendBtn","promptForm","timeline","panel","refreshBtn","refreshStatus","dataSource","graph","emptyState","selectedNodeId","lastCommitId","nodeIds","lastAsk","revealDiff","button","slot","renderDiffHtml","autoExpandDiffs","showDetailById","back","detail","backHtml","escapeHtml","renderDetail","applyAskHighlights","findings","severity","addId","showAskResults","renderAsk","renderNodeLite","lodEl","zoomPct","lodSteps","step","promptItem","taskId","commitId","finding","moreChip","wrap","expanded","showing","tlStart","tlEnd","tlNow","fmt","ms","paintTrack","frac","pct","tl","updateTimeline","cutoff","applySnapshot","snap","times","polling","started","autoresize","refreshSend","ready","submitPrompt","runDebug","debugRun","fast","intent","title","header","notice","errHtml","distHtml","gold","explain","cards","basename","verdict","pills","pill","relTime","riskInfo","iso","mo","inner","risk","score","renderHeader","latest","gist","truncate","firstLine","renderCommit","msg","nf","body","prompts","promptsHtml","meta","when","reads","readSecrets","readsHtml","isExternal","secretPaths","shortLabel","segs","secretChips","externalChips","repoChips","rows","chipsRow","files","filesHtml","kind","stat","diff","note","intentsHtml","isLeaf","versions","renderVersion","autoload","auto","fileRow","chips","more","paths","counts","label_of","cls"],"ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229],"sources":["../../src/datasource.ts","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/extensions/Extensions.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/environment-browser/browserExt.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/environment-webworker/webworkerExt.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/point/ObservablePoint.mjs","../../../../node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.js","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/misc/const.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/point/Point.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/matrix/Matrix.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/matrix/groupD8.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/shapes/Rectangle.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/data/uid.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/logging/deprecation.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/misc/NOOP.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/misc/pow2.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/utils/definedProps.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/texture/TextureStyle.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/texture/sources/TextureSource.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/texture/sources/BufferImageSource.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/texture/TextureMatrix.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/texture/Texture.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/data/updateQuadBounds.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/bounds/Bounds.mjs","../../../../node_modules/.pnpm/@pixi+colord@2.9.6/node_modules/@pixi/colord/index.mjs","../../../../node_modules/.pnpm/@pixi+colord@2.9.6/node_modules/@pixi/colord/plugins/names.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/color/Color.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/culling/cullingMixin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/logging/warn.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/pool/GlobalResourceRegistry.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/pool/Pool.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/pool/PoolGroup.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/container-mixins/cacheAsTextureMixin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/data/removeItems.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/container-mixins/childrenHelperMixin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/container-mixins/collectRenderablesMixin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/filters/FilterEffect.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/mask/MaskEffectManager.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/container-mixins/effectsMixin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/container-mixins/findMixin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/bounds/utils/matrixAndBoundsPool.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/container-mixins/getFastGlobalBoundsMixin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/bounds/getGlobalBounds.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/utils/multiplyHexColors.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/utils/multiplyColors.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/container-mixins/getGlobalMixin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/bounds/getLocalBounds.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/utils/checkChildrenDidChange.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/container-mixins/measureMixin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/container-mixins/onRenderMixin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/container-mixins/sortMixin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/container-mixins/toLocalGlobalMixin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/instructions/InstructionSet.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/texture/TexturePool.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/RenderGroup.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/utils/assignWithIgnore.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/container/Container.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/view/ViewContainer.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/sprite/Sprite.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMask.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/mask/color/ColorMask.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/environment-browser/BrowserAdapter.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/environment/adapter.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/texture/sources/CanvasSource.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/texture/sources/ImageSource.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/ticker/const.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/ticker/TickerListener.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/ticker/Ticker.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/texture/sources/VideoSource.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/assets/utils/convertToList.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/assets/cache/Cache.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/texture/utils/textureFrom.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/init.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/assets/loader/parsers/LoaderParser.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/path.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/assets/utils/createStringVariations.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/assets/utils/isSingleItem.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/assets/resolver/Resolver.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/assets/utils/copySearchParams.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/spritesheet/Spritesheet.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/spritesheet/spritesheetAsset.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/spritesheet/init.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/utils/createIdFromString.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/getTestContext.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/getMaxFragmentPrecision.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/preprocessors/addProgramDefines.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/preprocessors/ensurePrecision.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/preprocessors/insertVersion.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/preprocessors/setProgramName.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/preprocessors/stripVersion.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/GlProgram.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/geometry/utils/getAttributeInfoFromFormat.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gpu/shader/utils/extractAttributesFromGpuProgram.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gpu/shader/utils/extractStructAndGroups.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/shader/const.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gpu/shader/utils/generateGpuLayoutGroups.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gpu/shader/utils/generateLayoutHash.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gpu/shader/utils/removeStructAndGroupDuplicates.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gpu/shader/GpuProgram.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/shader/types.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/shader/utils/getDefaultUniformValue.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/shader/UniformGroup.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gpu/shader/BindGroup.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/types.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/shader/Shader.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/state/State.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/environment/autoDetectEnvironment.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/browser/unsafeEvalSupported.mjs","../../../../node_modules/.pnpm/earcut@3.0.2/node_modules/earcut/src/earcut.js","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/utils.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/const.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/system/SystemRunner.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/system/AbstractRenderer.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/browser/isWebGLSupported.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/browser/isWebGPUSupported.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/autoDetectRenderer.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/const.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/global/globalHooks.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/app/ResizePlugin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/app/TickerPlugin.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/app/init.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/app/Application.mjs","../../../../node_modules/.pnpm/parse-svg-path@0.2.0/node_modules/parse-svg-path/dist/index.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGPath.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/shapes/Circle.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/shapes/Ellipse.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/shapes/Polygon.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/maths/shapes/RoundedRectangle.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/batcher/gpu/getTextureBatchBindGroup.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/data/ViewableBuffer.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/buffer/utils/fastCopy.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/state/const.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/state/getAdjustedBlendModeBlend.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/batcher/gl/utils/maxRecommendedTextures.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/batcher/shared/BatchTextureArray.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/buffer/const.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/buffer/Buffer.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/geometry/utils/ensureIsBuffer.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/geometry/utils/getGeometryBounds.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/geometry/Geometry.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/batcher/shared/BatchGeometry.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/high-shader/compiler/utils/addBits.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/high-shader/compiler/utils/compileHooks.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/high-shader/compiler/utils/compileInputs.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/high-shader/compiler/utils/compileOutputs.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/high-shader/compiler/utils/injectBits.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/high-shader/compiler/compileHighShader.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/high-shader/defaultProgramTemplate.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/high-shader/shader-bits/globalUniformsBit.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/high-shader/compileHighShaderToProgram.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/high-shader/shader-bits/colorBit.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/high-shader/shader-bits/generateTextureBatchBit.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/high-shader/shader-bits/roundPixelsBit.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/getBatchSamplersUniformGroup.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/batcher/shared/DefaultShader.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/batcher/shared/DefaultBatcher.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/data/GCManagedHash.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/geometry/utils/buildUvs.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/geometry/utils/transformVertices.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/BatchableGraphics.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildCircle.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/const.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/utils/getOrientationOfPoints.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildLine.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildPixelLine.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/utils/triangulateWithHoles.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildPolygon.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildRectangle.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildTriangle.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/fill/FillGradient.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/utils/generateTextureFillMatrix.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/utils/buildContextBatches.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/GraphicsContextSystem.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildAdaptiveBezier.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildAdaptiveQuadratic.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArc.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArcTo.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArcToSvg.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/path/roundShape.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/path/ShapePath.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/path/GraphicsPath.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGFloatAttribute.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGDefinitions.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/utils/extractSvgUrlId.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGStyle.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/utils/fillOperations.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/utils/pathOperations.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/svg/SVGParser.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/utils/convertFillInputToFillStyle.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/utils/getMaxMiterRatio.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/GraphicsContext.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/canvas/utils/canUseNewCanvasBlendModes.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/canvas/utils/canvasUtils.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/shared/texture/CanvasPool.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/utils/getPo2TextureFromSource.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/canvas/CanvasGraphicsContextSystem.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/canvas/CanvasGraphicsPipe.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/gpu/colorToUniform.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/GraphicsPipe.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/init.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/shared/Graphics.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/AbstractText.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/canvas/getCanvasBoundingBox.mjs","../../../../node_modules/.pnpm/tiny-lru@11.4.7/node_modules/tiny-lru/dist/tiny-lru.js","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/canvas/utils/parseTaggedText.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/canvas/utils/textTokenization.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/canvas/utils/measureTaggedText.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/canvas/utils/wordWrap.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/canvas/CanvasTextMetrics.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/canvas/utils/fontStringFromTextStyle.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/canvas/utils/getCanvasFillStyle.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/canvas/CanvasTextGenerator.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/TextStyle.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/utils/updateTextBounds.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/sprite/BatchableSprite.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/canvas/BatchableText.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/canvas/CanvasTextPipe.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/shared/AbstractTextSystem.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/canvas/CanvasTextSystem.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/shared/GpuTextSystem.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/init.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/text/Text.mjs","../../../../node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/index.mjs","../../src/graph.ts","../../src/renderer.ts","../../src/main.ts"],"sourcesContent":["/**\n * Data source for the GUI. The browser cannot read SQLite directly, so the GUI consumes a\n * pre-built {@link GraphSnapshot} (produced server-side by `buildGraphSnapshot`) and calls\n * a small `/api/debug` endpoint that runs the internal agent. Both shapes are defined here\n * so the GUI is decoupled from how they are served.\n */\n\nimport type { GraphSnapshot, NodeDetail } from \"@brain0/shared\";\n\nexport type Severity = \"info\" | \"warn\" | \"critical\" | \"gold\";\n\nexport interface DebugFinding {\n id: string;\n kind: \"task\" | \"artifact\" | \"version\";\n reason: string;\n severity: Severity;\n verdict?: string;\n path?: string;\n external?: boolean;\n}\n\nexport interface ProviderInfo {\n name: string;\n remote: boolean;\n ok?: boolean;\n embedder?: { name: string; remote: boolean };\n redacted: boolean;\n zeroEgress: boolean;\n}\n\nexport interface DebugResponse {\n tasks: string[];\n artifacts: string[];\n explanation: string;\n intent?: \"debug\" | \"audit\";\n confidence?: number;\n findings?: DebugFinding[];\n distribution?: { green: number; yellow: number; red: number };\n goldSignals?: string[];\n topRisky?: Array<{ id: string; path: string; fused: number }>;\n provider?: ProviderInfo;\n error?: \"no-llm\" | \"llm-unreachable\";\n}\n\nexport interface DiffResponse {\n diff?: string;\n encrypted?: boolean;\n}\n\nexport interface RefreshStatus {\n state: \"idle\" | \"running\" | \"done\" | \"error\";\n phase: string;\n lines: string[];\n error?: string;\n}\n\nexport interface GraphDataSource {\n load(): Promise<GraphSnapshot>;\n debug(query: string): Promise<DebugResponse>;\n detail(id: string): Promise<NodeDetail | undefined>;\n diff(ref: string): Promise<DiffResponse>;\n refresh(): Promise<{ jobId?: string; state?: string; error?: string }>;\n refreshStatus(): Promise<RefreshStatus>;\n}\n\n/** Reads `graph.json` and proxies debug queries to a backend that hosts the agent. */\nexport class HttpDataSource implements GraphDataSource {\n constructor(private readonly base = \"\") {}\n\n async load(): Promise<GraphSnapshot> {\n const res = await fetch(`${this.base}/graph.json`);\n if (!res.ok) throw new Error(`failed to load graph: ${res.status}`);\n return (await res.json()) as GraphSnapshot;\n }\n\n async debug(query: string, phase?: \"retrieve\"): Promise<DebugResponse> {\n try {\n const phaseArg = phase ? `&phase=${phase}` : \"\";\n const res = await fetch(`${this.base}/api/debug?q=${encodeURIComponent(query)}${phaseArg}`);\n if (!res.ok) return { tasks: [], artifacts: [], explanation: \"\", error: \"llm-unreachable\" };\n return (await res.json()) as DebugResponse;\n } catch {\n // Transport failure (server down) → degrade like an unreachable backend, never throw.\n return { tasks: [], artifacts: [], explanation: \"\", error: \"llm-unreachable\" };\n }\n }\n\n async detail(id: string): Promise<NodeDetail | undefined> {\n const res = await fetch(`${this.base}/api/node?id=${encodeURIComponent(id)}`);\n if (!res.ok) return undefined;\n return (await res.json()) as NodeDetail;\n }\n\n async diff(ref: string): Promise<DiffResponse> {\n const res = await fetch(`${this.base}/api/diff?ref=${encodeURIComponent(ref)}`);\n if (!res.ok) return {};\n return (await res.json()) as DiffResponse;\n }\n\n // Trigger a live re-observe (ingest + observe + embeddings). The custom header satisfies the\n // server's same-origin/CSRF guard. A 409 (already running) is not treated as an error.\n async refresh(): Promise<{ jobId?: string; state?: string; error?: string }> {\n const res = await fetch(`${this.base}/api/refresh`, {\n method: \"POST\",\n headers: { \"x-brain0-refresh\": \"1\" },\n });\n if (!res.ok && res.status !== 409) {\n const body = (await res.json().catch(() => ({}))) as { error?: string };\n return { state: \"error\", error: body.error ?? `http ${res.status}` };\n }\n return (await res.json()) as { jobId?: string; state?: string; error?: string };\n }\n\n async refreshStatus(): Promise<RefreshStatus> {\n const res = await fetch(`${this.base}/api/refresh/status`);\n if (!res.ok) return { state: \"idle\", phase: \"\", lines: [] };\n return (await res.json()) as RefreshStatus;\n }\n}\n","\"use strict\";\nvar ExtensionType = /* @__PURE__ */ ((ExtensionType2) => {\n ExtensionType2[\"Application\"] = \"application\";\n ExtensionType2[\"WebGLPipes\"] = \"webgl-pipes\";\n ExtensionType2[\"WebGLPipesAdaptor\"] = \"webgl-pipes-adaptor\";\n ExtensionType2[\"WebGLSystem\"] = \"webgl-system\";\n ExtensionType2[\"WebGPUPipes\"] = \"webgpu-pipes\";\n ExtensionType2[\"WebGPUPipesAdaptor\"] = \"webgpu-pipes-adaptor\";\n ExtensionType2[\"WebGPUSystem\"] = \"webgpu-system\";\n ExtensionType2[\"CanvasSystem\"] = \"canvas-system\";\n ExtensionType2[\"CanvasPipesAdaptor\"] = \"canvas-pipes-adaptor\";\n ExtensionType2[\"CanvasPipes\"] = \"canvas-pipes\";\n ExtensionType2[\"Asset\"] = \"asset\";\n ExtensionType2[\"LoadParser\"] = \"load-parser\";\n ExtensionType2[\"ResolveParser\"] = \"resolve-parser\";\n ExtensionType2[\"CacheParser\"] = \"cache-parser\";\n ExtensionType2[\"DetectionParser\"] = \"detection-parser\";\n ExtensionType2[\"MaskEffect\"] = \"mask-effect\";\n ExtensionType2[\"BlendMode\"] = \"blend-mode\";\n ExtensionType2[\"TextureSource\"] = \"texture-source\";\n ExtensionType2[\"TextureUploaderWebGL\"] = \"texture-uploader-webgl\";\n ExtensionType2[\"TextureUploaderWebGPU\"] = \"texture-uploader-webgpu\";\n ExtensionType2[\"Environment\"] = \"environment\";\n ExtensionType2[\"ShapeBuilder\"] = \"shape-builder\";\n ExtensionType2[\"Batcher\"] = \"batcher\";\n return ExtensionType2;\n})(ExtensionType || {});\nconst normalizeExtension = (ext) => {\n if (typeof ext === \"function\" || typeof ext === \"object\" && ext.extension) {\n if (!ext.extension) {\n throw new Error(\"Extension class must have an extension object\");\n }\n const metadata = typeof ext.extension !== \"object\" ? { type: ext.extension } : ext.extension;\n ext = { ...metadata, ref: ext };\n }\n if (typeof ext === \"object\") {\n ext = { ...ext };\n } else {\n throw new Error(\"Invalid extension type\");\n }\n if (typeof ext.type === \"string\") {\n ext.type = [ext.type];\n }\n return ext;\n};\nconst normalizeExtensionPriority = (ext, defaultPriority) => normalizeExtension(ext).priority ?? defaultPriority;\nconst extensions = {\n /** @ignore */\n _addHandlers: {},\n /** @ignore */\n _removeHandlers: {},\n /** @ignore */\n _queue: {},\n /**\n * Remove extensions from PixiJS.\n * @param extensions - Extensions to be removed. Can be:\n * - Extension class with static `extension` property\n * - Extension format object with `type` and `ref`\n * - Multiple extensions as separate arguments\n * @returns {extensions} this for chaining\n * @example\n * ```ts\n * // Remove a single extension\n * extensions.remove(MyRendererPlugin);\n *\n * // Remove multiple extensions\n * extensions.remove(\n * MyRendererPlugin,\n * MySystemPlugin\n * );\n * ```\n * @see {@link ExtensionType} For available extension types\n * @see {@link ExtensionFormat} For extension format details\n */\n remove(...extensions2) {\n extensions2.map(normalizeExtension).forEach((ext) => {\n ext.type.forEach((type) => this._removeHandlers[type]?.(ext));\n });\n return this;\n },\n /**\n * Register new extensions with PixiJS. Extensions can be registered in multiple formats:\n * - As a class with a static `extension` property\n * - As an extension format object\n * - As multiple extensions passed as separate arguments\n * @param extensions - Extensions to add to PixiJS. Each can be:\n * - A class with static `extension` property\n * - An extension format object with `type` and `ref`\n * - Multiple extensions as separate arguments\n * @returns This extensions instance for chaining\n * @example\n * ```ts\n * // Register a simple extension\n * extensions.add(MyRendererPlugin);\n *\n * // Register multiple extensions\n * extensions.add(\n * MyRendererPlugin,\n * MySystemPlugin,\n * });\n * ```\n * @see {@link ExtensionType} For available extension types\n * @see {@link ExtensionFormat} For extension format details\n * @see {@link extensions.remove} For removing registered extensions\n */\n add(...extensions2) {\n extensions2.map(normalizeExtension).forEach((ext) => {\n ext.type.forEach((type) => {\n const handlers = this._addHandlers;\n const queue = this._queue;\n if (!handlers[type]) {\n queue[type] = queue[type] || [];\n queue[type]?.push(ext);\n } else {\n handlers[type]?.(ext);\n }\n });\n });\n return this;\n },\n /**\n * Internal method to handle extensions by name.\n * @param type - The extension type.\n * @param onAdd - Function handler when extensions are added/registered {@link StrictExtensionFormat}.\n * @param onRemove - Function handler when extensions are removed/unregistered {@link StrictExtensionFormat}.\n * @returns this for chaining.\n * @internal\n * @ignore\n */\n handle(type, onAdd, onRemove) {\n const addHandlers = this._addHandlers;\n const removeHandlers = this._removeHandlers;\n if (addHandlers[type] || removeHandlers[type]) {\n throw new Error(`Extension type ${type} already has a handler`);\n }\n addHandlers[type] = onAdd;\n removeHandlers[type] = onRemove;\n const queue = this._queue;\n if (queue[type]) {\n queue[type]?.forEach((ext) => onAdd(ext));\n delete queue[type];\n }\n return this;\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 this for chaining.\n * @ignore\n */\n handleByMap(type, map) {\n return this.handle(\n type,\n (extension) => {\n if (extension.name) {\n map[extension.name] = extension.ref;\n }\n },\n (extension) => {\n if (extension.name) {\n delete map[extension.name];\n }\n }\n );\n },\n /**\n * Handle a type, but using a list of extensions with a `name` property.\n * @param type - Type of extension to handle.\n * @param map - The array of named extensions.\n * @param defaultPriority - Fallback priority if none is defined.\n * @returns this for chaining.\n * @ignore\n */\n handleByNamedList(type, map, defaultPriority = -1) {\n return this.handle(\n type,\n (extension) => {\n const index = map.findIndex((item) => item.name === extension.name);\n if (index >= 0) return;\n map.push({ name: extension.name, value: extension.ref });\n map.sort((a, b) => normalizeExtensionPriority(b.value, defaultPriority) - normalizeExtensionPriority(a.value, defaultPriority));\n },\n (extension) => {\n const index = map.findIndex((item) => item.name === extension.name);\n if (index !== -1) {\n map.splice(index, 1);\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 * @param defaultPriority - The default priority to use if none is specified.\n * @returns this for chaining.\n * @ignore\n */\n handleByList(type, list, defaultPriority = -1) {\n return this.handle(\n type,\n (extension) => {\n if (list.includes(extension.ref)) {\n return;\n }\n list.push(extension.ref);\n list.sort((a, b) => normalizeExtensionPriority(b, defaultPriority) - normalizeExtensionPriority(a, defaultPriority));\n },\n (extension) => {\n const index = list.indexOf(extension.ref);\n if (index !== -1) {\n list.splice(index, 1);\n }\n }\n );\n },\n /**\n * Mixin the source object(s) properties into the target class's prototype.\n * Copies all property descriptors from source objects to the target's prototype.\n * @param Target - The target class to mix properties into\n * @param sources - One or more source objects containing properties to mix in\n * @example\n * ```ts\n * // Create a mixin with shared properties\n * const moveable = {\n * x: 0,\n * y: 0,\n * move(x: number, y: number) {\n * this.x += x;\n * this.y += y;\n * }\n * };\n *\n * // Create a mixin with computed properties\n * const scalable = {\n * scale: 1,\n * get scaled() {\n * return this.scale > 1;\n * }\n * };\n *\n * // Apply mixins to a class\n * extensions.mixin(Sprite, moveable, scalable);\n *\n * // Use mixed-in properties\n * const sprite = new Sprite();\n * sprite.move(10, 20);\n * console.log(sprite.x, sprite.y); // 10, 20\n * ```\n * @remarks\n * - Copies all properties including getters/setters\n * - Does not modify source objects\n * - Preserves property descriptors\n * @see {@link Object.defineProperties} For details on property descriptors\n * @see {@link Object.getOwnPropertyDescriptors} For details on property copying\n */\n mixin(Target, ...sources) {\n for (const source of sources) {\n Object.defineProperties(Target.prototype, Object.getOwnPropertyDescriptors(source));\n }\n }\n};\n\nexport { ExtensionType, extensions, normalizeExtensionPriority };\n//# sourceMappingURL=Extensions.mjs.map\n","import { ExtensionType } from '../extensions/Extensions.mjs';\n\n\"use strict\";\nconst browserExt = {\n extension: {\n type: ExtensionType.Environment,\n name: \"browser\",\n priority: -1\n },\n test: () => true,\n load: async () => {\n await import('./browserAll.mjs');\n }\n};\n\nexport { browserExt };\n//# sourceMappingURL=browserExt.mjs.map\n","import { ExtensionType } from '../extensions/Extensions.mjs';\n\n\"use strict\";\nconst webworkerExt = {\n extension: {\n type: ExtensionType.Environment,\n name: \"webworker\",\n priority: 0\n },\n test: () => typeof self !== \"undefined\" && self.WorkerGlobalScope !== void 0,\n load: async () => {\n await import('./webworkerAll.mjs');\n }\n};\n\nexport { webworkerExt };\n//# sourceMappingURL=webworkerExt.mjs.map\n","\"use strict\";\nclass ObservablePoint {\n /**\n * Creates a new `ObservablePoint`\n * @param observer - Observer to pass to listen for change events.\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(observer, x, y) {\n this._x = x || 0;\n this._y = y || 0;\n this._observer = observer;\n }\n /**\n * Creates a clone of this point.\n * @example\n * ```ts\n * // Basic cloning\n * const point = new ObservablePoint(observer, 100, 200);\n * const copy = point.clone();\n *\n * // Clone with new observer\n * const newObserver = {\n * _onUpdate: (p) => console.log(`Clone updated: (${p.x}, ${p.y})`)\n * };\n * const watched = point.clone(newObserver);\n *\n * // Verify independence\n * watched.set(300, 400); // Only triggers new observer\n * ```\n * @param observer - Optional observer to pass to the new observable point\n * @returns A copy of this observable point\n * @see {@link ObservablePoint.copyFrom} For copying into existing point\n * @see {@link Observer} For observer interface details\n */\n clone(observer) {\n return new ObservablePoint(observer ?? this._observer, this._x, this._y);\n }\n /**\n * Sets the point to a new x and y position.\n *\n * If y is omitted, both x and y will be set to x.\n * @example\n * ```ts\n * // Basic position setting\n * const point = new ObservablePoint(observer);\n * point.set(100, 200);\n *\n * // Set both x and y to same value\n * point.set(50); // x=50, y=50\n * ```\n * @param x - Position on the x axis\n * @param y - Position on the y axis, defaults to x\n * @returns The point instance itself\n * @see {@link ObservablePoint.copyFrom} For copying from another point\n * @see {@link ObservablePoint.equals} For comparing positions\n */\n set(x = 0, y = x) {\n if (this._x !== x || this._y !== y) {\n this._x = x;\n this._y = y;\n this._observer._onUpdate(this);\n }\n return this;\n }\n /**\n * Copies x and y from the given point into this point.\n * @example\n * ```ts\n * // Basic copying\n * const source = new ObservablePoint(observer, 100, 200);\n * const target = new ObservablePoint();\n * target.copyFrom(source);\n *\n * // Copy and chain operations\n * const point = new ObservablePoint()\n * .copyFrom(source)\n * .set(x + 50, y + 50);\n *\n * // Copy from any PointData\n * const data = { x: 10, y: 20 };\n * point.copyFrom(data);\n * ```\n * @param p - The point to copy from\n * @returns The point instance itself\n * @see {@link ObservablePoint.copyTo} For copying to another point\n * @see {@link ObservablePoint.clone} For creating new point copy\n */\n copyFrom(p) {\n if (this._x !== p.x || this._y !== p.y) {\n this._x = p.x;\n this._y = p.y;\n this._observer._onUpdate(this);\n }\n return this;\n }\n /**\n * Copies this point's x and y into the given point.\n * @example\n * ```ts\n * // Basic copying\n * const source = new ObservablePoint(100, 200);\n * const target = new ObservablePoint();\n * source.copyTo(target);\n * ```\n * @param p - The point to copy to. Can be any type that is or extends `PointLike`\n * @returns The point (`p`) with values updated\n * @see {@link ObservablePoint.copyFrom} For copying from another point\n * @see {@link ObservablePoint.clone} For creating new point copy\n */\n copyTo(p) {\n p.set(this._x, this._y);\n return p;\n }\n /**\n * Checks if another point is equal to this point.\n *\n * Compares x and y values using strict equality.\n * @example\n * ```ts\n * // Basic equality check\n * const p1 = new ObservablePoint(100, 200);\n * const p2 = new ObservablePoint(100, 200);\n * console.log(p1.equals(p2)); // true\n *\n * // Compare with PointData\n * const data = { x: 100, y: 200 };\n * console.log(p1.equals(data)); // true\n *\n * // Check different points\n * const p3 = new ObservablePoint(200, 300);\n * console.log(p1.equals(p3)); // false\n * ```\n * @param p - The point to check\n * @returns `true` if both `x` and `y` are equal\n * @see {@link ObservablePoint.copyFrom} For making points equal\n * @see {@link PointData} For point data interface\n */\n equals(p) {\n return p.x === this._x && p.y === this._y;\n }\n toString() {\n return `[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`;\n }\n /**\n * Position of the observable point on the x axis.\n * Triggers observer callback when value changes.\n * @example\n * ```ts\n * // Basic x position\n * const point = new ObservablePoint(observer);\n * point.x = 100; // Triggers observer\n *\n * // Use in calculations\n * const width = rightPoint.x - leftPoint.x;\n * ```\n * @default 0\n */\n get x() {\n return this._x;\n }\n set x(value) {\n if (this._x !== value) {\n this._x = value;\n this._observer._onUpdate(this);\n }\n }\n /**\n * Position of the observable point on the y axis.\n * Triggers observer callback when value changes.\n * @example\n * ```ts\n * // Basic y position\n * const point = new ObservablePoint(observer);\n * point.y = 200; // Triggers observer\n *\n * // Use in calculations\n * const height = bottomPoint.y - topPoint.y;\n * ```\n * @default 0\n */\n get y() {\n return this._y;\n }\n set y(value) {\n if (this._y !== value) {\n this._y = value;\n this._observer._onUpdate(this);\n }\n }\n}\n\nexport { ObservablePoint };\n//# sourceMappingURL=ObservablePoint.mjs.map\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","\"use strict\";\nconst PI_2 = Math.PI * 2;\nconst RAD_TO_DEG = 180 / Math.PI;\nconst DEG_TO_RAD = Math.PI / 180;\n\nexport { DEG_TO_RAD, PI_2, RAD_TO_DEG };\n//# sourceMappingURL=const.mjs.map\n","\"use strict\";\nclass Point {\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 * Position of the point on the x axis\n * @example\n * ```ts\n * // Set x position\n * const point = new Point();\n * point.x = 100;\n *\n * // Use in calculations\n * const width = rightPoint.x - leftPoint.x;\n * ```\n */\n this.x = 0;\n /**\n * Position of the point on the y axis\n * @example\n * ```ts\n * // Set y position\n * const point = new Point();\n * point.y = 200;\n *\n * // Use in calculations\n * const height = bottomPoint.y - topPoint.y;\n * ```\n */\n this.y = 0;\n this.x = x;\n this.y = y;\n }\n /**\n * Creates a clone of this point, which is a new instance with the same `x` and `y` values.\n * @example\n * ```ts\n * // Basic point cloning\n * const original = new Point(100, 200);\n * const copy = original.clone();\n *\n * // Clone and modify\n * const modified = original.clone();\n * modified.set(300, 400);\n *\n * // Verify independence\n * console.log(original); // Point(100, 200)\n * console.log(modified); // Point(300, 400)\n * ```\n * @remarks\n * - Creates new Point instance\n * - Deep copies x and y values\n * - Independent from original\n * - Useful for preserving values\n * @returns A clone of this point\n * @see {@link Point.copyFrom} For copying into existing point\n * @see {@link Point.copyTo} For copying to existing point\n */\n clone() {\n return new Point(this.x, this.y);\n }\n /**\n * Copies x and y from the given point into this point.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Point(100, 200);\n * const target = new Point();\n * target.copyFrom(source);\n *\n * // Copy and chain operations\n * const point = new Point()\n * .copyFrom(source)\n * .set(x + 50, y + 50);\n *\n * // Copy from any PointData\n * const data = { x: 10, y: 20 };\n * point.copyFrom(data);\n * ```\n * @param p - The point to copy from\n * @returns The point instance itself\n * @see {@link Point.copyTo} For copying to another point\n * @see {@link Point.clone} For creating new point copy\n */\n copyFrom(p) {\n this.set(p.x, p.y);\n return this;\n }\n /**\n * Copies this point's x and y into the given point.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Point(100, 200);\n * const target = new Point();\n * source.copyTo(target);\n * ```\n * @param p - The point to copy to. Can be any type that is or extends `PointLike`\n * @returns The point (`p`) with values updated\n * @see {@link Point.copyFrom} For copying from another point\n * @see {@link Point.clone} For creating new point copy\n */\n copyTo(p) {\n p.set(this.x, this.y);\n return p;\n }\n /**\n * Checks if another point is equal to this point.\n *\n * Compares x and y values using strict equality.\n * @example\n * ```ts\n * // Basic equality check\n * const p1 = new Point(100, 200);\n * const p2 = new Point(100, 200);\n * console.log(p1.equals(p2)); // true\n *\n * // Compare with PointData\n * const data = { x: 100, y: 200 };\n * console.log(p1.equals(data)); // true\n *\n * // Check different points\n * const p3 = new Point(200, 300);\n * console.log(p1.equals(p3)); // false\n * ```\n * @param p - The point to check\n * @returns `true` if both `x` and `y` are equal\n * @see {@link Point.copyFrom} For making points equal\n * @see {@link PointData} For point data interface\n */\n equals(p) {\n return p.x === this.x && p.y === this.y;\n }\n /**\n * Sets the point to a new x and y position.\n *\n * If y is omitted, both x and y will be set to x.\n * @example\n * ```ts\n * // Basic position setting\n * const point = new Point();\n * point.set(100, 200);\n *\n * // Set both x and y to same value\n * point.set(50); // x=50, y=50\n *\n * // Chain with other operations\n * point\n * .set(10, 20)\n * .copyTo(otherPoint);\n * ```\n * @param x - Position on the x axis\n * @param y - Position on the y axis, defaults to x\n * @returns The point instance itself\n * @see {@link Point.copyFrom} For copying from another point\n * @see {@link Point.equals} For comparing positions\n */\n set(x = 0, y = x) {\n this.x = x;\n this.y = y;\n return this;\n }\n toString() {\n return `[pixi.js/math:Point x=${this.x} y=${this.y}]`;\n }\n /**\n * A static Point object with `x` and `y` values of `0`.\n *\n * This shared instance is reset to zero values when accessed.\n *\n * > [!IMPORTANT] This point is shared and temporary. Do not store references to it.\n * @example\n * ```ts\n * // Use for temporary calculations\n * const tempPoint = Point.shared;\n * tempPoint.set(100, 200);\n * matrix.apply(tempPoint);\n *\n * // Will be reset to (0,0) on next access\n * const fresh = Point.shared; // x=0, y=0\n * ```\n * @readonly\n * @returns A fresh zeroed point for temporary use\n * @see {@link Point.constructor} For creating new points\n * @see {@link PointData} For basic point interface\n */\n static get shared() {\n tempPoint.x = 0;\n tempPoint.y = 0;\n return tempPoint;\n }\n}\nconst tempPoint = new Point();\n\nexport { Point };\n//# sourceMappingURL=Point.mjs.map\n","import { PI_2 } from '../misc/const.mjs';\nimport { Point } from '../point/Point.mjs';\n\n\"use strict\";\nclass Matrix {\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 * Array representation of the matrix.\n * Only populated when `toArray()` is called.\n * @default null\n * @see {@link Matrix.toArray} For filling this array\n */\n this.array = null;\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 * Creates a Matrix object based on the given array.\n * Populates matrix components from a flat array in column-major order.\n *\n * > [!NOTE] Array mapping order:\n * > ```\n * > array[0] = a (x scale)\n * > array[1] = b (y skew)\n * > array[2] = tx (x translation)\n * > array[3] = c (x skew)\n * > array[4] = d (y scale)\n * > array[5] = ty (y translation)\n * > ```\n * @example\n * ```ts\n * // Create matrix from array\n * const matrix = new Matrix();\n * matrix.fromArray([\n * 2, 0, 100, // a, b, tx\n * 0, 2, 100 // c, d, ty\n * ]);\n *\n * // Create matrix from typed array\n * const float32Array = new Float32Array([\n * 1, 0, 0, // Scale x1, no skew\n * 0, 1, 0 // No skew, scale x1\n * ]);\n * matrix.fromArray(float32Array);\n * ```\n * @param array - The array to populate the matrix from\n * @see {@link Matrix.toArray} For converting matrix to array\n * @see {@link Matrix.set} For setting values directly\n */\n fromArray(array) {\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 * Sets the matrix properties directly.\n * All matrix components can be set in one call.\n * @example\n * ```ts\n * // Set to identity matrix\n * matrix.set(1, 0, 0, 1, 0, 0);\n *\n * // Set to scale matrix\n * matrix.set(2, 0, 0, 2, 0, 0); // Scale 2x\n *\n * // Set to translation matrix\n * matrix.set(1, 0, 0, 1, 100, 50); // Move 100,50\n * ```\n * @param a - Scale on x axis\n * @param b - Shear on y axis\n * @param c - Shear on x axis\n * @param d - Scale on y axis\n * @param tx - Translation on x axis\n * @param ty - Translation on y axis\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.identity} For resetting to identity\n * @see {@link Matrix.fromArray} For setting from array\n */\n set(a, b, c, d, tx, ty) {\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 return this;\n }\n /**\n * Creates an array from the current Matrix object.\n *\n * > [!NOTE] The array format is:\n * > ```\n * > Non-transposed:\n * > [a, c, tx,\n * > b, d, ty,\n * > 0, 0, 1]\n * >\n * > Transposed:\n * > [a, b, 0,\n * > c, d, 0,\n * > tx,ty,1]\n * > ```\n * @example\n * ```ts\n * // Basic array conversion\n * const matrix = new Matrix(2, 0, 0, 2, 100, 100);\n * const array = matrix.toArray();\n *\n * // Using existing array\n * const float32Array = new Float32Array(9);\n * matrix.toArray(false, float32Array);\n *\n * // Get transposed array\n * const transposed = matrix.toArray(true);\n * ```\n * @param transpose - Whether to transpose the matrix\n * @param out - Optional Float32Array to store the result\n * @returns The array containing the matrix values\n * @see {@link Matrix.fromArray} For creating matrix from array\n * @see {@link Matrix.array} For cached array storage\n */\n toArray(transpose, out) {\n if (!this.array) {\n this.array = new Float32Array(9);\n }\n const array = out || this.array;\n if (transpose) {\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 } else {\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 return array;\n }\n /**\n * Get a new position with the current transformation applied.\n *\n * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)\n * @example\n * ```ts\n * // Basic point transformation\n * const matrix = new Matrix().translate(100, 50).rotate(Math.PI / 4);\n * const point = new Point(10, 20);\n * const transformed = matrix.apply(point);\n *\n * // Reuse existing point\n * const output = new Point();\n * matrix.apply(point, output);\n * ```\n * @param pos - The origin point to transform\n * @param newPos - Optional point to store the result\n * @returns The transformed point\n * @see {@link Matrix.applyInverse} For inverse transformation\n * @see {@link Point} For point operations\n */\n apply(pos, newPos) {\n newPos = newPos || new Point();\n const x = pos.x;\n const y = pos.y;\n newPos.x = this.a * x + this.c * y + this.tx;\n newPos.y = this.b * x + this.d * y + this.ty;\n return newPos;\n }\n /**\n * Get a new position with the inverse of the current transformation applied.\n *\n * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)\n * @example\n * ```ts\n * // Basic inverse transformation\n * const matrix = new Matrix().translate(100, 50).rotate(Math.PI / 4);\n * const worldPoint = new Point(150, 100);\n * const localPoint = matrix.applyInverse(worldPoint);\n *\n * // Reuse existing point\n * const output = new Point();\n * matrix.applyInverse(worldPoint, output);\n *\n * // Convert mouse position to local space\n * const mousePoint = new Point(mouseX, mouseY);\n * const localMouse = matrix.applyInverse(mousePoint);\n * ```\n * @param pos - The origin point to inverse-transform\n * @param newPos - Optional point to store the result\n * @returns The inverse-transformed point\n * @see {@link Matrix.apply} For forward transformation\n * @see {@link Matrix.invert} For getting inverse matrix\n */\n applyInverse(pos, newPos) {\n newPos = newPos || new Point();\n const a = this.a;\n const b = this.b;\n const c = this.c;\n const d = this.d;\n const tx = this.tx;\n const ty = this.ty;\n const id = 1 / (a * d + c * -b);\n const x = pos.x;\n const y = pos.y;\n newPos.x = d * id * x + -c * id * y + (ty * c - tx * d) * id;\n newPos.y = a * id * y + -b * id * x + (-ty * a + tx * b) * id;\n return newPos;\n }\n /**\n * Translates the matrix on the x and y axes.\n * Adds to the position values while preserving scale, rotation and skew.\n * @example\n * ```ts\n * // Basic translation\n * const matrix = new Matrix();\n * matrix.translate(100, 50); // Move right 100, down 50\n *\n * // Chain with other transformations\n * matrix\n * .scale(2, 2)\n * .translate(100, 0)\n * .rotate(Math.PI / 4);\n * ```\n * @param x - How much to translate on the x axis\n * @param y - How much to translate on the y axis\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.set} For setting position directly\n * @see {@link Matrix.setTransform} For complete transform setup\n */\n translate(x, y) {\n this.tx += x;\n this.ty += y;\n return this;\n }\n /**\n * Applies a scale transformation to the matrix.\n * Multiplies the scale values with existing matrix components.\n * @example\n * ```ts\n * // Basic scaling\n * const matrix = new Matrix();\n * matrix.scale(2, 3); // Scale 2x horizontally, 3x vertically\n *\n * // Chain with other transformations\n * matrix\n * .translate(100, 100)\n * .scale(2, 2) // Scales after translation\n * .rotate(Math.PI / 4);\n * ```\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 * @see {@link Matrix.setTransform} For setting scale directly\n * @see {@link Matrix.append} For combining transformations\n */\n scale(x, y) {\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 return this;\n }\n /**\n * Applies a rotation transformation to the matrix.\n *\n * Rotates around the origin (0,0) by the given angle in radians.\n * @example\n * ```ts\n * // Basic rotation\n * const matrix = new Matrix();\n * matrix.rotate(Math.PI / 4); // Rotate 45 degrees\n *\n * // Chain with other transformations\n * matrix\n * .translate(100, 100) // Move to rotation center\n * .rotate(Math.PI) // Rotate 180 degrees\n * .scale(2, 2); // Scale after rotation\n *\n * // Common angles\n * matrix.rotate(Math.PI / 2); // 90 degrees\n * matrix.rotate(Math.PI); // 180 degrees\n * matrix.rotate(Math.PI * 2); // 360 degrees\n * ```\n * @remarks\n * - Rotates around origin point (0,0)\n * - Affects position if translation was set\n * - Uses counter-clockwise rotation\n * - Order of operations matters when chaining\n * @param angle - The angle in radians\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.setTransform} For setting rotation directly\n * @see {@link Matrix.append} For combining transformations\n */\n rotate(angle) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const a1 = this.a;\n const c1 = this.c;\n const tx1 = this.tx;\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 return this;\n }\n /**\n * Appends the given Matrix to this Matrix.\n * Combines two matrices by multiplying them together: this = this * matrix\n * @example\n * ```ts\n * // Basic matrix combination\n * const matrix = new Matrix();\n * const other = new Matrix().translate(100, 0).rotate(Math.PI / 4);\n * matrix.append(other);\n * ```\n * @remarks\n * - Order matters: A.append(B) !== B.append(A)\n * - Modifies current matrix\n * - Preserves transformation order\n * - Commonly used for combining transforms\n * @param matrix - The matrix to append\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.prepend} For prepending transformations\n * @see {@link Matrix.appendFrom} For appending two external matrices\n */\n append(matrix) {\n const a1 = this.a;\n const b1 = this.b;\n const c1 = this.c;\n const d1 = this.d;\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 this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx;\n this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty;\n return this;\n }\n /**\n * Appends two matrices and sets the result to this matrix.\n * Performs matrix multiplication: this = A * B\n * @example\n * ```ts\n * // Basic matrix multiplication\n * const result = new Matrix();\n * const matrixA = new Matrix().scale(2, 2);\n * const matrixB = new Matrix().rotate(Math.PI / 4);\n * result.appendFrom(matrixA, matrixB);\n * ```\n * @remarks\n * - Order matters: A * B !== B * A\n * - Creates a new transformation from two others\n * - More efficient than append() for multiple operations\n * - Does not modify input matrices\n * @param a - The first matrix to multiply\n * @param b - The second matrix to multiply\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.append} For single matrix combination\n * @see {@link Matrix.prepend} For reverse order multiplication\n */\n appendFrom(a, b) {\n const a1 = a.a;\n const b1 = a.b;\n const c1 = a.c;\n const d1 = a.d;\n const tx = a.tx;\n const ty = a.ty;\n const a2 = b.a;\n const b2 = b.b;\n const c2 = b.c;\n const d2 = b.d;\n this.a = a1 * a2 + b1 * c2;\n this.b = a1 * b2 + b1 * d2;\n this.c = c1 * a2 + d1 * c2;\n this.d = c1 * b2 + d1 * d2;\n this.tx = tx * a2 + ty * c2 + b.tx;\n this.ty = tx * b2 + ty * d2 + b.ty;\n return this;\n }\n /**\n * Sets the matrix based on all the available properties.\n * Combines position, scale, rotation, skew and pivot in a single operation.\n * @example\n * ```ts\n * // Basic transform setup\n * const matrix = new Matrix();\n * matrix.setTransform(\n * 100, 100, // position\n * 0, 0, // pivot\n * 2, 2, // scale\n * Math.PI / 4, // rotation (45 degrees)\n * 0, 0 // skew\n * );\n * ```\n * @remarks\n * - Updates all matrix components at once\n * - More efficient than separate transform calls\n * - Uses radians for rotation and skew\n * - Pivot affects rotation center\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 * @see {@link Matrix.decompose} For extracting transform properties\n * @see {@link TransformableObject} For transform data structure\n */\n setTransform(x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) {\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 this.tx = x - (pivotX * this.a + pivotY * this.c);\n this.ty = y - (pivotX * this.b + pivotY * this.d);\n return this;\n }\n /**\n * Prepends the given Matrix to this Matrix.\n * Combines two matrices by multiplying them together: this = matrix * this\n * @example\n * ```ts\n * // Basic matrix prepend\n * const matrix = new Matrix().scale(2, 2);\n * const other = new Matrix().translate(100, 0);\n * matrix.prepend(other); // Translation happens before scaling\n * ```\n * @remarks\n * - Order matters: A.prepend(B) !== B.prepend(A)\n * - Modifies current matrix\n * - Reverses transformation order compared to append()\n * @param matrix - The matrix to prepend\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.append} For appending transformations\n * @see {@link Matrix.appendFrom} For combining external matrices\n */\n prepend(matrix) {\n const tx1 = this.tx;\n if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1) {\n const a1 = this.a;\n const c1 = this.c;\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 this.tx = tx1 * matrix.a + this.ty * matrix.c + matrix.tx;\n this.ty = tx1 * matrix.b + this.ty * matrix.d + matrix.ty;\n return this;\n }\n /**\n * Decomposes the matrix into its individual transform components.\n * Extracts position, scale, rotation and skew values from the matrix.\n * @example\n * ```ts\n * // Basic decomposition\n * const matrix = new Matrix()\n * .translate(100, 100)\n * .rotate(Math.PI / 4)\n * .scale(2, 2);\n *\n * const transform = {\n * position: new Point(),\n * scale: new Point(),\n * pivot: new Point(),\n * skew: new Point(),\n * rotation: 0\n * };\n *\n * matrix.decompose(transform);\n * console.log(transform.position); // Point(100, 100)\n * console.log(transform.rotation); // ~0.785 (PI/4)\n * console.log(transform.scale); // Point(2, 2)\n * ```\n * @remarks\n * - Handles combined transformations\n * - Accounts for pivot points\n * - Chooses between rotation/skew based on transform type\n * - Uses radians for rotation and skew\n * @param transform - The transform object to store the decomposed values\n * @returns The transform with the newly applied properties\n * @see {@link Matrix.setTransform} For composing from components\n * @see {@link TransformableObject} For transform structure\n */\n decompose(transform) {\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 const skewX = -Math.atan2(-c, d);\n const skewY = Math.atan2(b, a);\n const delta = Math.abs(skewX + skewY);\n if (delta < 1e-5 || Math.abs(PI_2 - delta) < 1e-5) {\n transform.rotation = skewY;\n transform.skew.x = transform.skew.y = 0;\n } else {\n transform.rotation = 0;\n transform.skew.x = skewX;\n transform.skew.y = skewY;\n }\n transform.scale.x = Math.sqrt(a * a + b * b);\n transform.scale.y = Math.sqrt(c * c + d * d);\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 return transform;\n }\n /**\n * Inverts this matrix.\n * Creates the matrix that when multiplied with this matrix results in an identity matrix.\n * @example\n * ```ts\n * // Basic matrix inversion\n * const matrix = new Matrix()\n * .translate(100, 50)\n * .scale(2, 2);\n *\n * matrix.invert(); // Now transforms in opposite direction\n *\n * // Verify inversion\n * const point = new Point(50, 50);\n * const transformed = matrix.apply(point);\n * const original = matrix.invert().apply(transformed);\n * // original ≈ point\n * ```\n * @remarks\n * - Modifies the current matrix\n * - Useful for reversing transformations\n * - Cannot invert matrices with zero determinant\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.identity} For resetting to identity\n * @see {@link Matrix.applyInverse} For inverse transformations\n */\n invert() {\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 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 return this;\n }\n /**\n * Checks if this matrix is an identity matrix.\n *\n * An identity matrix has no transformations applied (default state).\n * @example\n * ```ts\n * // Check if matrix is identity\n * const matrix = new Matrix();\n * console.log(matrix.isIdentity()); // true\n *\n * // Check after transformations\n * matrix.translate(100, 0);\n * console.log(matrix.isIdentity()); // false\n *\n * // Reset and verify\n * matrix.identity();\n * console.log(matrix.isIdentity()); // true\n * ```\n * @remarks\n * - Verifies a = 1, d = 1 (no scale)\n * - Verifies b = 0, c = 0 (no skew)\n * - Verifies tx = 0, ty = 0 (no translation)\n * @returns True if matrix has no transformations\n * @see {@link Matrix.identity} For resetting to identity\n * @see {@link Matrix.IDENTITY} For constant identity matrix\n */\n isIdentity() {\n return this.a === 1 && this.b === 0 && this.c === 0 && this.d === 1 && this.tx === 0 && this.ty === 0;\n }\n /**\n * Resets this Matrix to an identity (default) matrix.\n * Sets all components to their default values: scale=1, no skew, no translation.\n * @example\n * ```ts\n * // Reset transformed matrix\n * const matrix = new Matrix()\n * .scale(2, 2)\n * .rotate(Math.PI / 4);\n * matrix.identity(); // Back to default state\n *\n * // Chain after reset\n * matrix\n * .identity()\n * .translate(100, 100)\n * .scale(2, 2);\n *\n * // Compare with identity constant\n * const isDefault = matrix.equals(Matrix.IDENTITY);\n * ```\n * @remarks\n * - Sets a=1, d=1 (default scale)\n * - Sets b=0, c=0 (no skew)\n * - Sets tx=0, ty=0 (no translation)\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.IDENTITY} For constant identity matrix\n * @see {@link Matrix.isIdentity} For checking identity state\n */\n identity() {\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 return this;\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() {\n const matrix = new Matrix();\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 return matrix;\n }\n /**\n * Creates a new Matrix object with the same values as this one.\n * @param matrix\n * @example\n * ```ts\n * // Basic matrix cloning\n * const matrix = new Matrix()\n * .translate(100, 100)\n * .rotate(Math.PI / 4);\n * const copy = matrix.clone();\n *\n * // Clone and modify\n * const modified = matrix.clone()\n * .scale(2, 2);\n *\n * // Compare matrices\n * console.log(matrix.equals(copy)); // true\n * console.log(matrix.equals(modified)); // false\n * ```\n * @returns A copy of this matrix. Good for chaining method calls.\n * @see {@link Matrix.copyTo} For copying to existing matrix\n * @see {@link Matrix.copyFrom} For copying from another matrix\n */\n copyTo(matrix) {\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 return matrix;\n }\n /**\n * Changes the values of the matrix to be the same as the ones in given matrix.\n * @example\n * ```ts\n * // Basic matrix copying\n * const source = new Matrix()\n * .translate(100, 100)\n * .rotate(Math.PI / 4);\n * const target = new Matrix();\n * target.copyFrom(source);\n * ```\n * @param matrix - The matrix to copy from\n * @returns This matrix. Good for chaining method calls.\n * @see {@link Matrix.clone} For creating new matrix copy\n * @see {@link Matrix.copyTo} For copying to another matrix\n */\n copyFrom(matrix) {\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 return this;\n }\n /**\n * Checks if this matrix equals another matrix.\n * Compares all components for exact equality.\n * @example\n * ```ts\n * // Basic equality check\n * const m1 = new Matrix();\n * const m2 = new Matrix();\n * console.log(m1.equals(m2)); // true\n *\n * // Compare transformed matrices\n * const transform = new Matrix()\n * .translate(100, 100)\n * const clone = new Matrix()\n * .scale(2, 2);\n * console.log(transform.equals(clone)); // false\n * ```\n * @param matrix - The matrix to compare to\n * @returns True if matrices are identical\n * @see {@link Matrix.copyFrom} For copying matrix values\n * @see {@link Matrix.isIdentity} For identity comparison\n */\n equals(matrix) {\n return matrix.a === this.a && matrix.b === this.b && matrix.c === this.c && matrix.d === this.d && matrix.tx === this.tx && matrix.ty === this.ty;\n }\n toString() {\n return `[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`;\n }\n /**\n * A default (identity) matrix with no transformations applied.\n *\n * > [!IMPORTANT] This is a shared read-only object. Create a new Matrix if you need to modify it.\n * @example\n * ```ts\n * // Get identity matrix reference\n * const identity = Matrix.IDENTITY;\n * console.log(identity.isIdentity()); // true\n *\n * // Compare with identity\n * const matrix = new Matrix();\n * console.log(matrix.equals(Matrix.IDENTITY)); // true\n *\n * // Create new matrix instead of modifying IDENTITY\n * const transform = new Matrix()\n * .copyFrom(Matrix.IDENTITY)\n * .translate(100, 100);\n * ```\n * @readonly\n * @returns A read-only identity matrix\n * @see {@link Matrix.shared} For temporary calculations\n * @see {@link Matrix.identity} For resetting matrices\n */\n static get IDENTITY() {\n return identityMatrix.identity();\n }\n /**\n * A static Matrix that can be used to avoid creating new objects.\n * Will always ensure the matrix is reset to identity when requested.\n *\n * > [!IMPORTANT] This matrix is shared and temporary. Do not store references to it.\n * @example\n * ```ts\n * // Use for temporary calculations\n * const tempMatrix = Matrix.shared;\n * tempMatrix.translate(100, 100).rotate(Math.PI / 4);\n * const point = tempMatrix.apply({ x: 10, y: 20 });\n *\n * // Will be reset to identity on next access\n * const fresh = Matrix.shared; // Back to identity\n * ```\n * @remarks\n * - Always returns identity matrix\n * - Safe to modify temporarily\n * - Not safe to store references\n * - Useful for one-off calculations\n * @readonly\n * @returns A fresh identity matrix for temporary use\n * @see {@link Matrix.IDENTITY} For immutable identity matrix\n * @see {@link Matrix.identity} For resetting matrices\n */\n static get shared() {\n return tempMatrix.identity();\n }\n}\nconst tempMatrix = new Matrix();\nconst identityMatrix = new Matrix();\n\nexport { Matrix };\n//# sourceMappingURL=Matrix.mjs.map\n","import { Matrix } from './Matrix.mjs';\n\n\"use strict\";\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];\nconst rotationCayley = [];\nconst rotationMatrices = [];\nconst signum = Math.sign;\nfunction init() {\n for (let i = 0; i < 16; i++) {\n const row = [];\n rotationCayley.push(row);\n for (let j = 0; j < 16; 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 for (let k = 0; k < 16; k++) {\n if (ux[k] === _ux && uy[k] === _uy && vx[k] === _vx && vy[k] === _vy) {\n row.push(k);\n break;\n }\n }\n }\n }\n for (let i = 0; i < 16; i++) {\n const mat = new Matrix();\n mat.set(ux[i], uy[i], vx[i], vy[i], 0, 0);\n rotationMatrices.push(mat);\n }\n}\ninit();\nconst groupD8 = {\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 0° | East |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n E: 0,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 45°↻ | Southeast |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n SE: 1,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 90°↻ | South |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n S: 2,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 135°↻ | Southwest |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n SW: 3,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 180° | West |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n W: 4,\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -135°/225°↻ | Northwest |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n NW: 5,\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -90°/270°↻ | North |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n N: 6,\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -45°/315°↻ | Northeast |\n * @group groupD8\n * @type {GD8Symmetry}\n */\n NE: 7,\n /**\n * Reflection about Y-axis.\n * @group groupD8\n * @type {GD8Symmetry}\n */\n MIRROR_VERTICAL: 8,\n /**\n * Reflection about the main diagonal.\n * @group groupD8\n * @type {GD8Symmetry}\n */\n MAIN_DIAGONAL: 10,\n /**\n * Reflection about X-axis.\n * @group groupD8\n * @type {GD8Symmetry}\n */\n MIRROR_HORIZONTAL: 12,\n /**\n * Reflection about reverse diagonal.\n * @group groupD8\n * @type {GD8Symmetry}\n */\n REVERSE_DIAGONAL: 14,\n /**\n * @group groupD8\n * @param {GD8Symmetry} ind - sprite rotation angle.\n * @returns {GD8Symmetry} The X-component of the U-axis\n * after rotating the axes.\n */\n uX: (ind) => ux[ind],\n /**\n * @group groupD8\n * @param {GD8Symmetry} ind - sprite rotation angle.\n * @returns {GD8Symmetry} The Y-component of the U-axis\n * after rotating the axes.\n */\n uY: (ind) => uy[ind],\n /**\n * @group groupD8\n * @param {GD8Symmetry} ind - sprite rotation angle.\n * @returns {GD8Symmetry} The X-component of the V-axis\n * after rotating the axes.\n */\n vX: (ind) => vx[ind],\n /**\n * @group groupD8\n * @param {GD8Symmetry} ind - sprite rotation angle.\n * @returns {GD8Symmetry} The Y-component of the V-axis\n * after rotating the axes.\n */\n vY: (ind) => vy[ind],\n /**\n * @group groupD8\n * @param {GD8Symmetry} rotation - symmetry whose opposite\n * is needed. Only rotations have opposite symmetries while\n * reflections don't.\n * @returns {GD8Symmetry} The opposite symmetry of `rotation`\n */\n inv: (rotation) => {\n if (rotation & 8) {\n return rotation & 15;\n }\n return -rotation & 7;\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 * @group groupD8\n * @param {GD8Symmetry} rotationSecond - Second operation, which\n * is the row in the above cayley table.\n * @param {GD8Symmetry} rotationFirst - First operation, which\n * is the column in the above cayley table.\n * @returns {GD8Symmetry} Composed operation\n */\n add: (rotationSecond, rotationFirst) => rotationCayley[rotationSecond][rotationFirst],\n /**\n * Reverse of `add`.\n * @group groupD8\n * @param {GD8Symmetry} rotationSecond - Second operation\n * @param {GD8Symmetry} rotationFirst - First operation\n * @returns {GD8Symmetry} Result\n */\n sub: (rotationSecond, rotationFirst) => rotationCayley[rotationSecond][groupD8.inv(rotationFirst)],\n /**\n * Adds 180 degrees to rotation, which is a commutative\n * operation.\n * @group groupD8\n * @param {number} rotation - The number to rotate.\n * @returns {number} Rotated number\n */\n rotate180: (rotation) => rotation ^ 4,\n /**\n * Checks if the rotation angle is vertical, i.e. south\n * or north. It doesn't work for reflections.\n * @group groupD8\n * @param {GD8Symmetry} rotation - The number to check.\n * @returns {boolean} Whether or not the direction is vertical\n */\n isVertical: (rotation) => (rotation & 3) === 2,\n // rotation % 4 === 2\n /**\n * Approximates the vector `V(dx,dy)` into one of the\n * eight directions provided by `groupD8`.\n * @group groupD8\n * @param {number} dx - X-component of the vector\n * @param {number} dy - Y-component of the vector\n * @returns {GD8Symmetry} Approximation of the vector into\n * one of the eight symmetries.\n */\n byDirection: (dx, dy) => {\n if (Math.abs(dx) * 2 <= Math.abs(dy)) {\n if (dy >= 0) {\n return groupD8.S;\n }\n return groupD8.N;\n } else if (Math.abs(dy) * 2 <= Math.abs(dx)) {\n if (dx > 0) {\n return groupD8.E;\n }\n return groupD8.W;\n } else if (dy > 0) {\n if (dx > 0) {\n return groupD8.SE;\n }\n return groupD8.SW;\n } else if (dx > 0) {\n return groupD8.NE;\n }\n return groupD8.NW;\n },\n /**\n * Helps sprite to compensate texture packer rotation.\n * @group groupD8\n * @param {Matrix} matrix - sprite world matrix\n * @param {GD8Symmetry} rotation - The rotation factor to use.\n * @param {number} tx - sprite anchoring\n * @param {number} ty - sprite anchoring\n * @param {number} dw - sprite width\n * @param {number} dh - sprite height\n */\n matrixAppendRotationInv: (matrix, rotation, tx = 0, ty = 0, dw = 0, dh = 0) => {\n const mat = rotationMatrices[groupD8.inv(rotation)];\n const a = mat.a;\n const b = mat.b;\n const c = mat.c;\n const d = mat.d;\n const finalTx = tx - Math.min(0, a * dw, c * dh, a * dw + c * dh);\n const finalTy = ty - Math.min(0, b * dw, d * dh, b * dw + d * dh);\n const a1 = matrix.a;\n const b1 = matrix.b;\n const c1 = matrix.c;\n const d1 = matrix.d;\n matrix.a = a * a1 + b * c1;\n matrix.b = a * b1 + b * d1;\n matrix.c = c * a1 + d * c1;\n matrix.d = c * b1 + d * d1;\n matrix.tx = finalTx * a1 + finalTy * c1 + matrix.tx;\n matrix.ty = finalTx * b1 + finalTy * d1 + matrix.ty;\n },\n /**\n * Transforms rectangle coordinates based on texture packer rotation.\n * Used when texture atlas pages are rotated and coordinates need to be adjusted.\n * @group groupD8\n * @param {RectangleLike} rect - Rectangle with original coordinates to transform\n * @param {RectangleLike} sourceFrame - Source texture frame (includes offset and dimensions)\n * @param {GD8Symmetry} rotation - The groupD8 rotation value\n * @param {Rectangle} out - Rectangle to store the result\n * @returns {Rectangle} Transformed coordinates (includes source frame offset)\n */\n transformRectCoords: (rect, sourceFrame, rotation, out) => {\n const { x, y, width, height } = rect;\n const { x: frameX, y: frameY, width: frameWidth, height: frameHeight } = sourceFrame;\n if (rotation === groupD8.E) {\n out.set(x + frameX, y + frameY, width, height);\n return out;\n } else if (rotation === groupD8.S) {\n return out.set(\n frameWidth - y - height + frameX,\n x + frameY,\n height,\n width\n );\n } else if (rotation === groupD8.W) {\n return out.set(\n frameWidth - x - width + frameX,\n frameHeight - y - height + frameY,\n width,\n height\n );\n } else if (rotation === groupD8.N) {\n return out.set(\n y + frameX,\n frameHeight - x - width + frameY,\n height,\n width\n );\n }\n return out.set(x + frameX, y + frameY, width, height);\n }\n};\n\nexport { groupD8 };\n//# sourceMappingURL=groupD8.mjs.map\n","import { Point } from '../point/Point.mjs';\n\n\"use strict\";\nconst tempPoints = [new Point(), new Point(), new Point(), new Point()];\nclass Rectangle {\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 = 0, y = 0, width = 0, height = 0) {\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @example\n * ```ts\n * // Check shape type\n * const shape = new Rectangle(0, 0, 100, 100);\n * console.log(shape.type); // 'rectangle'\n *\n * // Use in type guards\n * if (shape.type === 'rectangle') {\n * console.log(shape.width, shape.height);\n * }\n * ```\n * @readonly\n * @default 'rectangle'\n * @see {@link SHAPE_PRIMITIVE} For all shape types\n */\n this.type = \"rectangle\";\n this.x = Number(x);\n this.y = Number(y);\n this.width = Number(width);\n this.height = Number(height);\n }\n /**\n * Returns the left edge (x-coordinate) of the rectangle.\n * @example\n * ```ts\n * // Get left edge position\n * const rect = new Rectangle(100, 100, 200, 150);\n * console.log(rect.left); // 100\n *\n * // Use in alignment calculations\n * sprite.x = rect.left + padding;\n *\n * // Compare positions\n * if (point.x > rect.left) {\n * console.log('Point is right of rectangle');\n * }\n * ```\n * @readonly\n * @returns The x-coordinate of the left edge\n * @see {@link Rectangle.right} For right edge position\n * @see {@link Rectangle.x} For direct x-coordinate access\n */\n get left() {\n return this.x;\n }\n /**\n * Returns the right edge (x + width) of the rectangle.\n * @example\n * ```ts\n * // Get right edge position\n * const rect = new Rectangle(100, 100, 200, 150);\n * console.log(rect.right); // 300\n *\n * // Align to right edge\n * sprite.x = rect.right - sprite.width;\n *\n * // Check boundaries\n * if (point.x < rect.right) {\n * console.log('Point is inside right bound');\n * }\n * ```\n * @readonly\n * @returns The x-coordinate of the right edge\n * @see {@link Rectangle.left} For left edge position\n * @see {@link Rectangle.width} For width value\n */\n get right() {\n return this.x + this.width;\n }\n /**\n * Returns the top edge (y-coordinate) of the rectangle.\n * @example\n * ```ts\n * // Get top edge position\n * const rect = new Rectangle(100, 100, 200, 150);\n * console.log(rect.top); // 100\n *\n * // Position above rectangle\n * sprite.y = rect.top - sprite.height;\n *\n * // Check vertical position\n * if (point.y > rect.top) {\n * console.log('Point is below top edge');\n * }\n * ```\n * @readonly\n * @returns The y-coordinate of the top edge\n * @see {@link Rectangle.bottom} For bottom edge position\n * @see {@link Rectangle.y} For direct y-coordinate access\n */\n get top() {\n return this.y;\n }\n /**\n * Returns the bottom edge (y + height) of the rectangle.\n * @example\n * ```ts\n * // Get bottom edge position\n * const rect = new Rectangle(100, 100, 200, 150);\n * console.log(rect.bottom); // 250\n *\n * // Stack below rectangle\n * sprite.y = rect.bottom + margin;\n *\n * // Check vertical bounds\n * if (point.y < rect.bottom) {\n * console.log('Point is above bottom edge');\n * }\n * ```\n * @readonly\n * @returns The y-coordinate of the bottom edge\n * @see {@link Rectangle.top} For top edge position\n * @see {@link Rectangle.height} For height value\n */\n get bottom() {\n return this.y + this.height;\n }\n /**\n * Determines whether the Rectangle is empty (has no area).\n * @example\n * ```ts\n * // Check zero dimensions\n * const rect = new Rectangle(100, 100, 0, 50);\n * console.log(rect.isEmpty()); // true\n * ```\n * @returns True if the rectangle has no area\n * @see {@link Rectangle.width} For width value\n * @see {@link Rectangle.height} For height value\n */\n isEmpty() {\n return this.left === this.right || this.top === this.bottom;\n }\n /**\n * A constant empty rectangle. This is a new object every time the property is accessed.\n * @example\n * ```ts\n * // Get fresh empty rectangle\n * const empty = Rectangle.EMPTY;\n * console.log(empty.isEmpty()); // true\n * ```\n * @returns A new empty rectangle instance\n * @see {@link Rectangle.isEmpty} For empty state testing\n */\n static get EMPTY() {\n return new Rectangle(0, 0, 0, 0);\n }\n /**\n * Creates a clone of this Rectangle\n * @example\n * ```ts\n * // Basic cloning\n * const original = new Rectangle(100, 100, 200, 150);\n * const copy = original.clone();\n *\n * // Clone and modify\n * const modified = original.clone();\n * modified.width *= 2;\n * modified.height += 50;\n *\n * // Verify independence\n * console.log(original.width); // 200\n * console.log(modified.width); // 400\n * ```\n * @returns A copy of the rectangle\n * @see {@link Rectangle.copyFrom} For copying into existing rectangle\n * @see {@link Rectangle.copyTo} For copying to another rectangle\n */\n clone() {\n return new Rectangle(this.x, this.y, this.width, this.height);\n }\n /**\n * Converts a Bounds object to a Rectangle object.\n * @example\n * ```ts\n * // Convert bounds to rectangle\n * const bounds = container.getBounds();\n * const rect = new Rectangle().copyFromBounds(bounds);\n * ```\n * @param bounds - The bounds to copy and convert to a rectangle\n * @returns Returns itself\n * @see {@link Bounds} For bounds object structure\n * @see {@link Rectangle.getBounds} For getting rectangle bounds\n */\n copyFromBounds(bounds) {\n this.x = bounds.minX;\n this.y = bounds.minY;\n this.width = bounds.maxX - bounds.minX;\n this.height = bounds.maxY - bounds.minY;\n return this;\n }\n /**\n * Copies another rectangle to this one.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Rectangle(100, 100, 200, 150);\n * const target = new Rectangle();\n * target.copyFrom(source);\n *\n * // Chain with other operations\n * const rect = new Rectangle()\n * .copyFrom(source)\n * .pad(10);\n * ```\n * @param rectangle - The rectangle to copy from\n * @returns Returns itself\n * @see {@link Rectangle.copyTo} For copying to another rectangle\n * @see {@link Rectangle.clone} For creating new rectangle copy\n */\n copyFrom(rectangle) {\n this.x = rectangle.x;\n this.y = rectangle.y;\n this.width = rectangle.width;\n this.height = rectangle.height;\n return this;\n }\n /**\n * Copies this rectangle to another one.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Rectangle(100, 100, 200, 150);\n * const target = new Rectangle();\n * source.copyTo(target);\n *\n * // Chain with other operations\n * const result = source\n * .copyTo(new Rectangle())\n * .getBounds();\n * ```\n * @param rectangle - The rectangle to copy to\n * @returns Returns given parameter\n * @see {@link Rectangle.copyFrom} For copying from another rectangle\n * @see {@link Rectangle.clone} For creating new rectangle copy\n */\n copyTo(rectangle) {\n rectangle.copyFrom(this);\n return rectangle;\n }\n /**\n * Checks whether the x and y coordinates given are contained within this Rectangle\n * @example\n * ```ts\n * // Basic containment check\n * const rect = new Rectangle(100, 100, 200, 150);\n * const isInside = rect.contains(150, 125); // true\n * // Check edge cases\n * console.log(rect.contains(100, 100)); // true (on edge)\n * console.log(rect.contains(300, 250)); // false (outside)\n * ```\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 * @see {@link Rectangle.containsRect} For rectangle containment\n * @see {@link Rectangle.strokeContains} For checking stroke intersection\n */\n contains(x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n if (x >= this.x && x < this.x + this.width) {\n if (y >= this.y && y < this.y + this.height) {\n return true;\n }\n }\n return false;\n }\n /**\n * Checks whether the x and y coordinates given are contained within this rectangle including the stroke.\n * @example\n * ```ts\n * // Basic stroke check\n * const rect = new Rectangle(100, 100, 200, 150);\n * const isOnStroke = rect.strokeContains(150, 100, 4); // 4px line width\n *\n * // Check with different alignments\n * const innerStroke = rect.strokeContains(150, 100, 4, 1); // Inside\n * const centerStroke = rect.strokeContains(150, 100, 4, 0.5); // Centered\n * const outerStroke = rect.strokeContains(150, 100, 4, 0); // Outside\n * ```\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @param strokeWidth - The width of the line to check\n * @param alignment - The alignment of the stroke (1 = inner, 0.5 = centered, 0 = outer)\n * @returns Whether the x/y coordinates are within this rectangle's stroke\n * @see {@link Rectangle.contains} For checking fill containment\n * @see {@link Rectangle.getBounds} For getting stroke bounds\n */\n strokeContains(x, y, strokeWidth, alignment = 0.5) {\n const { width, height } = this;\n if (width <= 0 || height <= 0) return false;\n const _x = this.x;\n const _y = this.y;\n const strokeWidthOuter = strokeWidth * (1 - alignment);\n const strokeWidthInner = strokeWidth - strokeWidthOuter;\n const outerLeft = _x - strokeWidthOuter;\n const outerRight = _x + width + strokeWidthOuter;\n const outerTop = _y - strokeWidthOuter;\n const outerBottom = _y + height + strokeWidthOuter;\n const innerLeft = _x + strokeWidthInner;\n const innerRight = _x + width - strokeWidthInner;\n const innerTop = _y + strokeWidthInner;\n const innerBottom = _y + height - strokeWidthInner;\n return x >= outerLeft && x <= outerRight && y >= outerTop && y <= outerBottom && !(x > innerLeft && x < innerRight && y > innerTop && y < innerBottom);\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 /**\n * Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.\n *\n * Returns true only if the area of the intersection is greater than 0.\n * This means that rectangles sharing only a side are not considered intersecting.\n * @example\n * ```ts\n * // Basic intersection check\n * const rect1 = new Rectangle(0, 0, 100, 100);\n * const rect2 = new Rectangle(50, 50, 100, 100);\n * console.log(rect1.intersects(rect2)); // true\n *\n * // With transformation matrix\n * const matrix = new Matrix();\n * matrix.rotate(Math.PI / 4); // 45 degrees\n * console.log(rect1.intersects(rect2, matrix)); // Checks with rotation\n *\n * // Edge cases\n * const zeroWidth = new Rectangle(0, 0, 0, 100);\n * console.log(rect1.intersects(zeroWidth)); // false (no area)\n * ```\n * @remarks\n * - Returns true only if intersection area is > 0\n * - Rectangles sharing only a side are not intersecting\n * - Zero-area rectangles cannot intersect anything\n * - Supports optional transformation matrix\n * @param other - The Rectangle to intersect with `this`\n * @param transform - Optional transformation matrix of `other`\n * @returns True if the transformed `other` Rectangle intersects with `this`\n * @see {@link Rectangle.containsRect} For containment testing\n * @see {@link Rectangle.contains} For point testing\n */\n intersects(other, transform) {\n if (!transform) {\n const x02 = this.x < other.x ? other.x : this.x;\n const x12 = this.right > other.right ? other.right : this.right;\n if (x12 <= x02) {\n return false;\n }\n const y02 = this.y < other.y ? other.y : this.y;\n const y12 = this.bottom > other.bottom ? other.bottom : this.bottom;\n return y12 > y02;\n }\n const x0 = this.left;\n const x1 = this.right;\n const y0 = this.top;\n const y1 = this.bottom;\n if (x1 <= x0 || y1 <= y0) {\n return false;\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 if (rt.x <= lt.x || lb.y <= lt.y) {\n return false;\n }\n const s = Math.sign(transform.a * transform.d - transform.b * transform.c);\n if (s === 0) {\n return false;\n }\n transform.apply(lt, lt);\n transform.apply(lb, lb);\n transform.apply(rt, rt);\n transform.apply(rb, rb);\n if (Math.max(lt.x, lb.x, rt.x, rb.x) <= x0 || Math.min(lt.x, lb.x, rt.x, rb.x) >= x1 || Math.max(lt.y, lb.y, rt.y, rb.y) <= y0 || Math.min(lt.y, lb.y, rt.y, rb.y) >= y1) {\n return false;\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 if (Math.max(n00, n10, n01, n11) <= nx * lt.x + ny * lt.y || Math.min(n00, n10, n01, n11) >= nx * rb.x + ny * rb.y) {\n return false;\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 if (Math.max(m00, m10, m01, m11) <= mx * lt.x + my * lt.y || Math.min(m00, m10, m01, m11) >= mx * rb.x + my * rb.y) {\n return false;\n }\n return true;\n }\n /**\n * Pads the rectangle making it grow in all directions.\n *\n * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.\n * @example\n * ```ts\n * // Basic padding\n * const rect = new Rectangle(100, 100, 200, 150);\n * rect.pad(10); // Adds 10px padding on all sides\n *\n * // Different horizontal and vertical padding\n * const uiRect = new Rectangle(0, 0, 100, 50);\n * uiRect.pad(20, 10); // 20px horizontal, 10px vertical\n * ```\n * @remarks\n * - Adjusts x/y by subtracting padding\n * - Increases width/height by padding * 2\n * - Common in UI layout calculations\n * - Chainable with other methods\n * @param paddingX - The horizontal padding amount\n * @param paddingY - The vertical padding amount\n * @returns Returns itself\n * @see {@link Rectangle.enlarge} For growing to include another rectangle\n * @see {@link Rectangle.fit} For shrinking to fit within another rectangle\n */\n pad(paddingX = 0, paddingY = paddingX) {\n this.x -= paddingX;\n this.y -= paddingY;\n this.width += paddingX * 2;\n this.height += paddingY * 2;\n return this;\n }\n /**\n * Fits this rectangle around the passed one.\n * @example\n * ```ts\n * // Basic fitting\n * const container = new Rectangle(0, 0, 100, 100);\n * const content = new Rectangle(25, 25, 200, 200);\n * content.fit(container); // Clips to container bounds\n * ```\n * @param rectangle - The rectangle to fit around\n * @returns Returns itself\n * @see {@link Rectangle.enlarge} For growing to include another rectangle\n * @see {@link Rectangle.pad} For adding padding around the rectangle\n */\n fit(rectangle) {\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 this.x = x1;\n this.width = Math.max(x2 - x1, 0);\n this.y = y1;\n this.height = Math.max(y2 - y1, 0);\n return this;\n }\n /**\n * Enlarges rectangle so that its corners lie on a grid defined by resolution.\n * @example\n * ```ts\n * // Basic grid alignment\n * const rect = new Rectangle(10.2, 10.6, 100.8, 100.4);\n * rect.ceil(); // Aligns to whole pixels\n *\n * // Custom resolution grid\n * const uiRect = new Rectangle(5.3, 5.7, 50.2, 50.8);\n * uiRect.ceil(0.5); // Aligns to half pixels\n *\n * // Use with precision value\n * const preciseRect = new Rectangle(20.001, 20.999, 100.001, 100.999);\n * preciseRect.ceil(1, 0.01); // Handles small decimal variations\n * ```\n * @param resolution - The grid size to align to (1 = whole pixels)\n * @param eps - Small number to prevent floating point errors\n * @returns Returns itself\n * @see {@link Rectangle.fit} For constraining to bounds\n * @see {@link Rectangle.enlarge} For growing dimensions\n */\n ceil(resolution = 1, eps = 1e-3) {\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 this.x = Math.floor((this.x + eps) * resolution) / resolution;\n this.y = Math.floor((this.y + eps) * resolution) / resolution;\n this.width = x2 - this.x;\n this.height = y2 - this.y;\n return this;\n }\n /**\n * Scales the rectangle's dimensions and position by the specified factors.\n * @example\n * ```ts\n * const rect = new Rectangle(50, 50, 100, 100);\n *\n * // Scale uniformly\n * rect.scale(0.5, 0.5);\n * // rect is now: x=25, y=25, width=50, height=50\n *\n * // non-uniformly\n * rect.scale(0.5, 1);\n * // rect is now: x=25, y=50, width=50, height=100\n * ```\n * @param x - The factor by which to scale the horizontal properties (x, width).\n * @param y - The factor by which to scale the vertical properties (y, height).\n * @returns Returns itself\n */\n scale(x, y = x) {\n this.x *= x;\n this.y *= y;\n this.width *= x;\n this.height *= y;\n return this;\n }\n /**\n * Enlarges this rectangle to include the passed rectangle.\n * @example\n * ```ts\n * // Basic enlargement\n * const rect = new Rectangle(50, 50, 100, 100);\n * const other = new Rectangle(0, 0, 200, 75);\n * rect.enlarge(other);\n * // rect is now: x=0, y=0, width=200, height=150\n *\n * // Use for bounding box calculation\n * const bounds = new Rectangle();\n * objects.forEach((obj) => {\n * bounds.enlarge(obj.getBounds());\n * });\n * ```\n * @param rectangle - The rectangle to include\n * @returns Returns itself\n * @see {@link Rectangle.fit} For shrinking to fit within another rectangle\n * @see {@link Rectangle.pad} For adding padding around the rectangle\n */\n enlarge(rectangle) {\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 this.x = x1;\n this.width = x2 - x1;\n this.y = y1;\n this.height = y2 - y1;\n return this;\n }\n /**\n * Returns the framing rectangle of the rectangle as a Rectangle object\n * @example\n * ```ts\n * // Basic bounds retrieval\n * const rect = new Rectangle(100, 100, 200, 150);\n * const bounds = rect.getBounds();\n *\n * // Reuse existing rectangle\n * const out = new Rectangle();\n * rect.getBounds(out);\n * ```\n * @param out - Optional rectangle to store the result\n * @returns The framing rectangle\n * @see {@link Rectangle.copyFrom} For direct copying\n * @see {@link Rectangle.clone} For creating new copy\n */\n getBounds(out) {\n out || (out = new Rectangle());\n out.copyFrom(this);\n return out;\n }\n /**\n * Determines whether another Rectangle is fully contained within this Rectangle.\n *\n * Rectangles that occupy the same space are considered to be containing each other.\n *\n * Rectangles without area (width or height equal to zero) can't contain anything,\n * not even other arealess rectangles.\n * @example\n * ```ts\n * // Check if one rectangle contains another\n * const container = new Rectangle(0, 0, 100, 100);\n * const inner = new Rectangle(25, 25, 50, 50);\n *\n * console.log(container.containsRect(inner)); // true\n *\n * // Check overlapping rectangles\n * const partial = new Rectangle(75, 75, 50, 50);\n * console.log(container.containsRect(partial)); // false\n *\n * // Zero-area rectangles\n * const empty = new Rectangle(0, 0, 0, 100);\n * console.log(container.containsRect(empty)); // false\n * ```\n * @param other - The Rectangle to check for containment\n * @returns True if other is fully contained within this Rectangle\n * @see {@link Rectangle.contains} For point containment\n * @see {@link Rectangle.intersects} For overlap testing\n */\n containsRect(other) {\n if (this.width <= 0 || this.height <= 0) return false;\n const x1 = other.x;\n const y1 = other.y;\n const x2 = other.x + other.width;\n const y2 = other.y + other.height;\n return x1 >= this.x && x1 < this.x + this.width && y1 >= this.y && y1 < this.y + this.height && x2 >= this.x && x2 < this.x + this.width && y2 >= this.y && y2 < this.y + this.height;\n }\n /**\n * Sets the position and dimensions of the rectangle.\n * @example\n * ```ts\n * // Basic usage\n * const rect = new Rectangle();\n * rect.set(100, 100, 200, 150);\n *\n * // Chain with other operations\n * const bounds = new Rectangle()\n * .set(0, 0, 100, 100)\n * .pad(10);\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 * @returns Returns itself for method chaining\n * @see {@link Rectangle.copyFrom} For copying from another rectangle\n * @see {@link Rectangle.clone} For creating a new copy\n */\n set(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n return this;\n }\n toString() {\n return `[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`;\n }\n}\n\nexport { Rectangle };\n//# sourceMappingURL=Rectangle.mjs.map\n","\"use strict\";\nconst uidCache = {\n default: -1\n};\nfunction uid(name = \"default\") {\n if (uidCache[name] === void 0) {\n uidCache[name] = -1;\n }\n return ++uidCache[name];\n}\nfunction resetUids() {\n for (const key in uidCache) {\n delete uidCache[key];\n }\n}\n\nexport { resetUids, uid };\n//# sourceMappingURL=uid.mjs.map\n","\"use strict\";\nconst warnings = /* @__PURE__ */ new Set();\nconst v8_0_0 = \"8.0.0\";\nconst v8_3_4 = \"8.3.4\";\nconst deprecationState = {\n quiet: false,\n noColor: false\n};\nconst deprecation = ((version, message, ignoreDepth = 3) => {\n if (deprecationState.quiet || warnings.has(message)) return;\n let stack = new Error().stack;\n const deprecationMessage = `${message}\nDeprecated since v${version}`;\n const useGroup = typeof console.groupCollapsed === \"function\" && !deprecationState.noColor;\n if (typeof stack === \"undefined\") {\n console.warn(\"PixiJS Deprecation Warning: \", deprecationMessage);\n } else {\n stack = stack.split(\"\\n\").splice(ignoreDepth).join(\"\\n\");\n if (useGroup) {\n console.groupCollapsed(\n \"%cPixiJS Deprecation Warning: %c%s\",\n \"color:#614108;background:#fffbe6\",\n \"font-weight:normal;color:#614108;background:#fffbe6\",\n deprecationMessage\n );\n console.warn(stack);\n console.groupEnd();\n } else {\n console.warn(\"PixiJS Deprecation Warning: \", deprecationMessage);\n console.warn(stack);\n }\n }\n warnings.add(message);\n});\nObject.defineProperties(deprecation, {\n quiet: {\n get: () => deprecationState.quiet,\n set: (value) => {\n deprecationState.quiet = value;\n },\n enumerable: true,\n configurable: false\n },\n noColor: {\n get: () => deprecationState.noColor,\n set: (value) => {\n deprecationState.noColor = value;\n },\n enumerable: true,\n configurable: false\n }\n});\n\nexport { deprecation, v8_0_0, v8_3_4 };\n//# sourceMappingURL=deprecation.mjs.map\n","\"use strict\";\nconst NOOP = () => {\n};\n\nexport { NOOP };\n//# sourceMappingURL=NOOP.mjs.map\n","\"use strict\";\nfunction nextPow2(v) {\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 return v + 1;\n}\nfunction isPow2(v) {\n return !(v & v - 1) && !!v;\n}\nfunction log2(v) {\n let r = (v > 65535 ? 1 : 0) << 4;\n v >>>= r;\n let shift = (v > 255 ? 1 : 0) << 3;\n v >>>= shift;\n r |= shift;\n shift = (v > 15 ? 1 : 0) << 2;\n v >>>= shift;\n r |= shift;\n shift = (v > 3 ? 1 : 0) << 1;\n v >>>= shift;\n r |= shift;\n return r | v >> 1;\n}\n\nexport { isPow2, log2, nextPow2 };\n//# sourceMappingURL=pow2.mjs.map\n","\"use strict\";\nfunction definedProps(obj) {\n const result = {};\n for (const key in obj) {\n if (obj[key] !== void 0) {\n result[key] = obj[key];\n }\n }\n return result;\n}\n\nexport { definedProps };\n//# sourceMappingURL=definedProps.mjs.map\n","import EventEmitter from 'eventemitter3';\nimport { uid } from '../../../../utils/data/uid.mjs';\nimport { deprecation, v8_0_0 } from '../../../../utils/logging/deprecation.mjs';\n\n\"use strict\";\nconst idHash = /* @__PURE__ */ Object.create(null);\nfunction createResourceIdFromString(value) {\n const id = idHash[value];\n if (id === void 0) {\n idHash[value] = uid(\"resource\");\n }\n return id;\n}\nconst _TextureStyle = class _TextureStyle extends EventEmitter {\n /**\n * @param options - options for the style\n */\n constructor(options = {}) {\n super();\n /** @internal */\n this._resourceType = \"textureSampler\";\n /** @internal */\n this._touched = 0;\n /**\n * Specifies the maximum anisotropy value clamp used by the sampler.\n * Note: Most implementations support {@link TextureStyle#maxAnisotropy} values in range\n * between 1 and 16, inclusive. The used value of {@link TextureStyle#maxAnisotropy} will\n * be clamped to the maximum value that the platform supports.\n * @internal\n */\n this._maxAnisotropy = 1;\n /**\n * Has the style been destroyed?\n * @readonly\n */\n this.destroyed = false;\n options = { ..._TextureStyle.defaultOptions, ...options };\n this.addressMode = options.addressMode;\n this.addressModeU = options.addressModeU ?? this.addressModeU;\n this.addressModeV = options.addressModeV ?? this.addressModeV;\n this.addressModeW = options.addressModeW ?? this.addressModeW;\n this.scaleMode = options.scaleMode;\n this.magFilter = options.magFilter ?? this.magFilter;\n this.minFilter = options.minFilter ?? this.minFilter;\n this.mipmapFilter = options.mipmapFilter ?? this.mipmapFilter;\n this.lodMinClamp = options.lodMinClamp;\n this.lodMaxClamp = options.lodMaxClamp;\n this.compare = options.compare;\n this.maxAnisotropy = options.maxAnisotropy ?? 1;\n }\n set addressMode(value) {\n this.addressModeU = value;\n this.addressModeV = value;\n this.addressModeW = value;\n }\n /** setting this will set wrapModeU,wrapModeV and wrapModeW all at once! */\n get addressMode() {\n return this.addressModeU;\n }\n set wrapMode(value) {\n deprecation(v8_0_0, \"TextureStyle.wrapMode is now TextureStyle.addressMode\");\n this.addressMode = value;\n }\n get wrapMode() {\n return this.addressMode;\n }\n set scaleMode(value) {\n this.magFilter = value;\n this.minFilter = value;\n this.mipmapFilter = value;\n }\n /** setting this will set magFilter,minFilter and mipmapFilter all at once! */\n get scaleMode() {\n return this.magFilter;\n }\n /** Specifies the maximum anisotropy value clamp used by the sampler. */\n set maxAnisotropy(value) {\n this._maxAnisotropy = Math.min(value, 16);\n if (this._maxAnisotropy > 1) {\n this.scaleMode = \"linear\";\n }\n }\n get maxAnisotropy() {\n return this._maxAnisotropy;\n }\n // TODO - move this to WebGL?\n get _resourceId() {\n return this._sharedResourceId || this._generateResourceId();\n }\n update() {\n this._sharedResourceId = null;\n this.emit(\"change\", this);\n }\n _generateResourceId() {\n const bigKey = `${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;\n this._sharedResourceId = createResourceIdFromString(bigKey);\n return this._resourceId;\n }\n /** Destroys the style */\n destroy() {\n this.destroyed = true;\n this.emit(\"destroy\", this);\n this.emit(\"change\", this);\n this.removeAllListeners();\n }\n};\n/** default options for the style */\n_TextureStyle.defaultOptions = {\n addressMode: \"clamp-to-edge\",\n scaleMode: \"linear\"\n};\nlet TextureStyle = _TextureStyle;\n\nexport { TextureStyle };\n//# sourceMappingURL=TextureStyle.mjs.map\n","import EventEmitter from 'eventemitter3';\nimport { isPow2 } from '../../../../../maths/misc/pow2.mjs';\nimport { definedProps } from '../../../../../scene/container/utils/definedProps.mjs';\nimport { uid } from '../../../../../utils/data/uid.mjs';\nimport { TextureStyle } from '../TextureStyle.mjs';\n\n\"use strict\";\nconst _TextureSource = class _TextureSource extends EventEmitter {\n /**\n * @param options - options for creating a new TextureSource\n */\n constructor(options = {}) {\n super();\n this.options = options;\n /** @internal */\n this._gpuData = /* @__PURE__ */ Object.create(null);\n /** @internal */\n this._gcLastUsed = -1;\n /** unique id for this Texture source */\n this.uid = uid(\"textureSource\");\n /**\n * The resource type used by this TextureSource. This is used by the bind groups to determine\n * how to handle this resource.\n * @internal\n */\n this._resourceType = \"textureSource\";\n /**\n * i unique resource id, used by the bind group systems.\n * This can change if the texture is resized or its resource changes\n * @internal\n */\n this._resourceId = uid(\"resource\");\n /**\n * this is how the backends know how to upload this texture to the GPU\n * It changes depending on the resource type. Classes that extend TextureSource\n * should override this property.\n * @internal\n */\n this.uploadMethodId = \"unknown\";\n /** @internal */\n this._resolution = 1;\n /** the pixel width of this texture source. This is the REAL pure number, not accounting resolution */\n this.pixelWidth = 1;\n /** the pixel height of this texture source. This is the REAL pure number, not accounting resolution */\n this.pixelHeight = 1;\n /**\n * the width of this texture source, accounting for resolution\n * eg pixelWidth 200, resolution 2, then width will be 100\n */\n this.width = 1;\n /**\n * the height of this texture source, accounting for resolution\n * eg pixelHeight 200, resolution 2, then height will be 100\n */\n this.height = 1;\n /**\n * The number of samples of a multisample texture. This is always 1 for non-multisample textures.\n * To enable multisample for a texture, set antialias to true\n * @internal\n */\n this.sampleCount = 1;\n /**\n * The number of mip levels to generate for this texture.\n * this is overridden if autoGenerateMipmaps is true. it is read only!\n */\n this.mipLevelCount = 1;\n /**\n * Should we auto generate mipmaps for this texture? This will automatically generate mipmaps\n * for this texture when uploading to the GPU. Mipmapped textures take up more memory, but\n * can look better when scaled down.\n *\n * For performance reasons, it is recommended to NOT use this with RenderTextures, as they are often updated every frame.\n * If you do, make sure to call `updateMipmaps` after you update the texture.\n */\n this.autoGenerateMipmaps = false;\n /** the format that the texture data has */\n this.format = \"rgba8unorm\";\n /** how many dimensions does this texture have? currently v8 only supports 2d */\n this.dimension = \"2d\";\n /** how this texture is viewed/sampled by shaders (WebGPU view dimension) */\n this.viewDimension = \"2d\";\n /** how many array layers this texture has (WebGPU depthOrArrayLayers) */\n this.arrayLayerCount = 1;\n /**\n * Only really affects RenderTextures.\n * Should we use antialiasing for this texture. It will look better, but may impact performance as a\n * Blit operation will be required to resolve the texture.\n */\n this.antialias = false;\n /**\n * Treat the underlying GPU texture as transient — see {@link TextureSourceOptions.transient}.\n * Internal flag, populated from options.\n * @internal\n */\n this.transient = false;\n /**\n * Used by automatic texture Garbage Collection, stores last GC tick when it was bound\n * @protected\n */\n this._touched = 0;\n /**\n * Used by the batcher to build texture batches. faster to have the variable here!\n * @protected\n */\n this._batchTick = -1;\n /**\n * A temporary batch location for the texture batching. Here for performance reasons only!\n * @protected\n */\n this._textureBindLocation = -1;\n options = { ..._TextureSource.defaultOptions, ...options };\n this.label = options.label ?? \"\";\n this.resource = options.resource;\n this.autoGarbageCollect = options.autoGarbageCollect;\n this._resolution = options.resolution;\n if (options.width) {\n this.pixelWidth = options.width * this._resolution;\n } else {\n this.pixelWidth = this.resource ? this.resourceWidth ?? 1 : 1;\n }\n if (options.height) {\n this.pixelHeight = options.height * this._resolution;\n } else {\n this.pixelHeight = this.resource ? this.resourceHeight ?? 1 : 1;\n }\n this.width = this.pixelWidth / this._resolution;\n this.height = this.pixelHeight / this._resolution;\n this.format = options.format;\n this.dimension = options.dimensions;\n this.viewDimension = options.viewDimension ?? options.dimensions;\n this.arrayLayerCount = options.arrayLayerCount;\n this.mipLevelCount = options.mipLevelCount;\n this.autoGenerateMipmaps = options.autoGenerateMipmaps;\n this.sampleCount = options.sampleCount;\n this.antialias = options.antialias;\n this.transient = options.transient ?? false;\n this.alphaMode = options.alphaMode;\n this.style = new TextureStyle(definedProps(options));\n this.destroyed = false;\n this._refreshPOT();\n }\n /** returns itself */\n get source() {\n return this;\n }\n /** the style of the texture */\n get style() {\n return this._style;\n }\n set style(value) {\n if (this.style === value) return;\n this._style?.off(\"change\", this._onStyleChange, this);\n this._style = value;\n this._style?.on(\"change\", this._onStyleChange, this);\n this._onStyleChange();\n }\n /** Specifies the maximum anisotropy value clamp used by the sampler. */\n set maxAnisotropy(value) {\n this._style.maxAnisotropy = value;\n }\n get maxAnisotropy() {\n return this._style.maxAnisotropy;\n }\n /** setting this will set wrapModeU, wrapModeV and wrapModeW all at once! */\n get addressMode() {\n return this._style.addressMode;\n }\n set addressMode(value) {\n this._style.addressMode = value;\n }\n /** setting this will set wrapModeU, wrapModeV and wrapModeW all at once! */\n get repeatMode() {\n return this._style.addressMode;\n }\n set repeatMode(value) {\n this._style.addressMode = value;\n }\n /** Specifies the sampling behavior when the sample footprint is smaller than or equal to one texel. */\n get magFilter() {\n return this._style.magFilter;\n }\n set magFilter(value) {\n this._style.magFilter = value;\n }\n /** Specifies the sampling behavior when the sample footprint is larger than one texel. */\n get minFilter() {\n return this._style.minFilter;\n }\n set minFilter(value) {\n this._style.minFilter = value;\n }\n /** Specifies behavior for sampling between mipmap levels. */\n get mipmapFilter() {\n return this._style.mipmapFilter;\n }\n set mipmapFilter(value) {\n this._style.mipmapFilter = value;\n }\n /** Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture. */\n get lodMinClamp() {\n return this._style.lodMinClamp;\n }\n set lodMinClamp(value) {\n this._style.lodMinClamp = value;\n }\n /** Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture. */\n get lodMaxClamp() {\n return this._style.lodMaxClamp;\n }\n set lodMaxClamp(value) {\n this._style.lodMaxClamp = value;\n }\n _onStyleChange() {\n this.emit(\"styleChange\", this);\n }\n /** call this if you have modified the texture outside of the constructor */\n update() {\n if (this.resource) {\n const resolution = this._resolution;\n const didResize = this.resize(this.resourceWidth / resolution, this.resourceHeight / resolution);\n if (didResize) return;\n }\n this.emit(\"update\", this);\n }\n /** Destroys this texture source */\n destroy() {\n this.destroyed = true;\n this.unload();\n this.emit(\"destroy\", this);\n if (this._style) {\n this._style.destroy();\n this._style = null;\n }\n this.uploadMethodId = null;\n this.resource = null;\n this.removeAllListeners();\n }\n /**\n * This will unload the Texture source from the GPU. This will free up the GPU memory\n * As soon as it is required fore rendering, it will be re-uploaded.\n */\n unload() {\n this._resourceId = uid(\"resource\");\n this.emit(\"change\", this);\n this.emit(\"unload\", this);\n for (const key in this._gpuData) {\n this._gpuData[key]?.destroy?.();\n }\n this._gpuData = /* @__PURE__ */ Object.create(null);\n }\n /** the width of the resource. This is the REAL pure number, not accounting resolution */\n get resourceWidth() {\n const { resource } = this;\n return resource.naturalWidth || resource.videoWidth || resource.displayWidth || resource.width;\n }\n /** the height of the resource. This is the REAL pure number, not accounting resolution */\n get resourceHeight() {\n const { resource } = this;\n return resource.naturalHeight || resource.videoHeight || resource.displayHeight || resource.height;\n }\n /**\n * the resolution of the texture. Changing this number, will not change the number of pixels in the actual texture\n * but will the size of the texture when rendered.\n *\n * changing the resolution of this texture to 2 for example will make it appear twice as small when rendered (as pixel\n * density will have increased)\n */\n get resolution() {\n return this._resolution;\n }\n set resolution(resolution) {\n if (this._resolution === resolution) return;\n this._resolution = resolution;\n this.width = this.pixelWidth / resolution;\n this.height = this.pixelHeight / resolution;\n }\n /**\n * Resize the texture, this is handy if you want to use the texture as a render texture\n * @param width - the new width of the texture\n * @param height - the new height of the texture\n * @param resolution - the new resolution of the texture\n * @returns - if the texture was resized\n */\n resize(width, height, resolution) {\n resolution || (resolution = this._resolution);\n width || (width = this.width);\n height || (height = this.height);\n const newPixelWidth = Math.round(width * resolution);\n const newPixelHeight = Math.round(height * resolution);\n this.width = newPixelWidth / resolution;\n this.height = newPixelHeight / resolution;\n this._resolution = resolution;\n if (this.pixelWidth === newPixelWidth && this.pixelHeight === newPixelHeight) {\n return false;\n }\n this._refreshPOT();\n this.pixelWidth = newPixelWidth;\n this.pixelHeight = newPixelHeight;\n this.emit(\"resize\", this);\n this._resourceId = uid(\"resource\");\n this.emit(\"change\", this);\n return true;\n }\n /**\n * Lets the renderer know that this texture has been updated and its mipmaps should be re-generated.\n * This is only important for RenderTexture instances, as standard Texture instances will have their\n * mipmaps generated on upload. You should call this method after you make any change to the texture\n *\n * The reason for this is is can be quite expensive to update mipmaps for a texture. So by default,\n * We want you, the developer to specify when this action should happen.\n *\n * Generally you don't want to have mipmaps generated on Render targets that are changed every frame,\n */\n updateMipmaps() {\n if (this.autoGenerateMipmaps && this.mipLevelCount > 1) {\n this.emit(\"updateMipmaps\", this);\n }\n }\n set wrapMode(value) {\n this._style.wrapMode = value;\n }\n get wrapMode() {\n return this._style.wrapMode;\n }\n set scaleMode(value) {\n this._style.scaleMode = value;\n }\n /** setting this will set magFilter,minFilter and mipmapFilter all at once! */\n get scaleMode() {\n return this._style.scaleMode;\n }\n /**\n * Refresh check for isPowerOfTwo texture based on size\n * @private\n */\n _refreshPOT() {\n this.isPowerOfTwo = isPow2(this.pixelWidth) && isPow2(this.pixelHeight);\n }\n static test(_resource) {\n throw new Error(\"Unimplemented\");\n }\n};\n/** The default options used when creating a new TextureSource. override these to add your own defaults */\n_TextureSource.defaultOptions = {\n resolution: 1,\n format: \"bgra8unorm\",\n alphaMode: \"premultiply-alpha-on-upload\",\n dimensions: \"2d\",\n viewDimension: \"2d\",\n arrayLayerCount: 1,\n mipLevelCount: 1,\n autoGenerateMipmaps: false,\n sampleCount: 1,\n antialias: false,\n autoGarbageCollect: false\n};\nlet TextureSource = _TextureSource;\n\nexport { TextureSource };\n//# sourceMappingURL=TextureSource.mjs.map\n","import { ExtensionType } from '../../../../../extensions/Extensions.mjs';\nimport { TextureSource } from './TextureSource.mjs';\n\n\"use strict\";\nclass BufferImageSource extends TextureSource {\n constructor(options) {\n const buffer = options.resource || new Float32Array(options.width * options.height * 4);\n let format = options.format;\n if (!format) {\n if (buffer instanceof Float32Array) {\n format = \"rgba32float\";\n } else if (buffer instanceof Int32Array) {\n format = \"rgba32uint\";\n } else if (buffer instanceof Uint32Array) {\n format = \"rgba32uint\";\n } else if (buffer instanceof Int16Array) {\n format = \"rgba16uint\";\n } else if (buffer instanceof Uint16Array) {\n format = \"rgba16uint\";\n } else if (buffer instanceof Int8Array) {\n format = \"bgra8unorm\";\n } else {\n format = \"bgra8unorm\";\n }\n }\n super({\n ...options,\n resource: buffer,\n format\n });\n this.uploadMethodId = \"buffer\";\n }\n static test(resource) {\n return resource instanceof Int8Array || resource instanceof Uint8Array || resource instanceof Uint8ClampedArray || resource instanceof Int16Array || resource instanceof Uint16Array || resource instanceof Int32Array || resource instanceof Uint32Array || resource instanceof Float32Array;\n }\n}\nBufferImageSource.extension = ExtensionType.TextureSource;\n\nexport { BufferImageSource };\n//# sourceMappingURL=BufferImageSource.mjs.map\n","import { Matrix } from '../../../../maths/matrix/Matrix.mjs';\n\n\"use strict\";\nconst tempMat = new Matrix();\nclass TextureMatrix {\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, clampMargin) {\n this.mapCoord = new Matrix();\n this.uClampFrame = new Float32Array(4);\n this.uClampOffset = new Float32Array(2);\n this._updateID = 0;\n this.clampOffset = 0;\n if (typeof clampMargin === \"undefined\") {\n this.clampMargin = texture.width < 10 ? 0 : 0.5;\n } else {\n this.clampMargin = clampMargin;\n }\n this.isSimple = false;\n this.texture = texture;\n }\n /** Texture property. */\n get texture() {\n return this._texture;\n }\n set texture(value) {\n if (this._texture !== value) {\n this._texture?.removeListener(\"update\", this.update, this);\n this._texture = value;\n this._texture.addListener(\"update\", this.update, this);\n }\n this.update();\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, out) {\n if (out === void 0) {\n out = uvs;\n }\n const mat = this.mapCoord;\n for (let i = 0; i < uvs.length; i += 2) {\n const x = uvs[i];\n const y = uvs[i + 1];\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 return out;\n }\n /**\n * Updates matrices if texture was changed\n * @returns - whether or not it was updated\n */\n update() {\n const tex = this._texture;\n this._updateID++;\n const uvs = tex.uvs;\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 const orig = tex.orig;\n const trim = tex.trim;\n if (trim) {\n tempMat.set(\n orig.width / trim.width,\n 0,\n 0,\n orig.height / trim.height,\n -trim.x / trim.width,\n -trim.y / trim.height\n );\n this.mapCoord.append(tempMat);\n }\n const texBase = tex.source;\n const frame = this.uClampFrame;\n const margin = this.clampMargin / texBase._resolution;\n const offset = this.clampOffset / texBase._resolution;\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] = this.clampOffset / texBase.pixelWidth;\n this.uClampOffset[1] = this.clampOffset / texBase.pixelHeight;\n this.isSimple = tex.frame.width === texBase.width && tex.frame.height === texBase.height && tex.rotate === 0;\n return true;\n }\n}\n\nexport { TextureMatrix };\n//# sourceMappingURL=TextureMatrix.mjs.map\n","import EventEmitter from 'eventemitter3';\nimport { groupD8 } from '../../../../maths/matrix/groupD8.mjs';\nimport { Rectangle } from '../../../../maths/shapes/Rectangle.mjs';\nimport { uid } from '../../../../utils/data/uid.mjs';\nimport { deprecation, v8_0_0 } from '../../../../utils/logging/deprecation.mjs';\nimport { NOOP } from '../../../../utils/misc/NOOP.mjs';\nimport { BufferImageSource } from './sources/BufferImageSource.mjs';\nimport { TextureSource } from './sources/TextureSource.mjs';\nimport { TextureMatrix } from './TextureMatrix.mjs';\n\n\"use strict\";\nclass Texture extends EventEmitter {\n /**\n * @param {TextureOptions} options - Options for the texture\n */\n constructor({\n source,\n label,\n frame,\n orig,\n trim,\n defaultAnchor,\n defaultBorders,\n rotate,\n dynamic\n } = {}) {\n super();\n /** unique id for this texture */\n this.uid = uid(\"texture\");\n /** A uvs object based on the given frame and the texture source */\n this.uvs = { x0: 0, y0: 0, x1: 0, y1: 0, x2: 0, y2: 0, x3: 0, y3: 0 };\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 this.frame = new Rectangle();\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 * @example\n * texture.on('update', () => {});\n */\n this.noFrame = false;\n /**\n * Set to true if you plan on modifying the uvs of this texture.\n * When this is the case, sprites and other objects using the texture will\n * make sure to listen for changes to the uvs and update their vertices accordingly.\n */\n this.dynamic = false;\n /** is it a texture? yes! used for type checking */\n this.isTexture = true;\n this.label = label;\n this.source = source?.source ?? new TextureSource();\n this.noFrame = !frame;\n if (frame) {\n this.frame.copyFrom(frame);\n } else {\n const { width, height } = this._source;\n this.frame.width = width;\n this.frame.height = height;\n }\n this.orig = orig || this.frame;\n this.trim = trim;\n this.rotate = rotate ?? 0;\n this.defaultAnchor = defaultAnchor;\n this.defaultBorders = defaultBorders;\n this.destroyed = false;\n this.dynamic = dynamic || false;\n this.updateUvs();\n }\n set source(value) {\n if (this._source) {\n this._source.off(\"resize\", this.update, this);\n }\n this._source = value;\n value.on(\"resize\", this.update, this);\n this.emit(\"update\", this);\n }\n /** the underlying source of the texture (equivalent of baseTexture in v7) */\n get source() {\n return this._source;\n }\n /** returns a TextureMatrix instance for this texture. By default, that object is not created because its heavy. */\n get textureMatrix() {\n if (!this._textureMatrix) {\n this._textureMatrix = new TextureMatrix(this);\n }\n return this._textureMatrix;\n }\n /** The width of the Texture in pixels. */\n get width() {\n return this.orig.width;\n }\n /** The height of the Texture in pixels. */\n get height() {\n return this.orig.height;\n }\n /** Call this function when you have modified the frame of this texture. */\n updateUvs() {\n const { uvs, frame } = this;\n const { width, height } = this._source;\n const nX = frame.x / width;\n const nY = frame.y / height;\n const nW = frame.width / width;\n const nH = frame.height / height;\n let rotate = this.rotate;\n if (rotate) {\n const w2 = nW / 2;\n const h2 = nH / 2;\n const cX = nX + w2;\n const cY = nY + h2;\n rotate = groupD8.add(rotate, groupD8.NW);\n uvs.x0 = cX + w2 * groupD8.uX(rotate);\n uvs.y0 = cY + h2 * groupD8.uY(rotate);\n rotate = groupD8.add(rotate, 2);\n uvs.x1 = cX + w2 * groupD8.uX(rotate);\n uvs.y1 = cY + h2 * groupD8.uY(rotate);\n rotate = groupD8.add(rotate, 2);\n uvs.x2 = cX + w2 * groupD8.uX(rotate);\n uvs.y2 = cY + h2 * groupD8.uY(rotate);\n rotate = groupD8.add(rotate, 2);\n uvs.x3 = cX + w2 * groupD8.uX(rotate);\n uvs.y3 = cY + h2 * groupD8.uY(rotate);\n } else {\n uvs.x0 = nX;\n uvs.y0 = nY;\n uvs.x1 = nX + nW;\n uvs.y1 = nY;\n uvs.x2 = nX + nW;\n uvs.y2 = nY + nH;\n uvs.x3 = nX;\n uvs.y3 = nY + nH;\n }\n }\n /**\n * Destroys this texture\n * @param destroySource - Destroy the source when the texture is destroyed.\n */\n destroy(destroySource = false) {\n if (this._source) {\n this._source.off(\"resize\", this.update, this);\n if (destroySource) {\n this._source.destroy();\n this._source = null;\n }\n }\n this._textureMatrix = null;\n this.destroyed = true;\n this.emit(\"destroy\", this);\n this.removeAllListeners();\n }\n /**\n * Call this if you have modified the `texture outside` of the constructor.\n *\n * If you have modified this texture's source, you must separately call `texture.source.update()` to see those changes.\n */\n update() {\n if (this.noFrame) {\n this.frame.width = this._source.width;\n this.frame.height = this._source.height;\n }\n this.updateUvs();\n this.emit(\"update\", this);\n }\n /** @deprecated since 8.0.0 */\n get baseTexture() {\n deprecation(v8_0_0, \"Texture.baseTexture is now Texture.source\");\n return this._source;\n }\n}\nTexture.EMPTY = new Texture({\n label: \"EMPTY\",\n source: new TextureSource({\n label: \"EMPTY\"\n })\n});\nTexture.EMPTY.destroy = NOOP;\nTexture.WHITE = new Texture({\n source: new BufferImageSource({\n resource: new Uint8Array([255, 255, 255, 255]),\n width: 1,\n height: 1,\n alphaMode: \"premultiply-alpha-on-upload\",\n label: \"WHITE\"\n }),\n label: \"WHITE\"\n});\nTexture.WHITE.destroy = NOOP;\n\nexport { Texture };\n//# sourceMappingURL=Texture.mjs.map\n","\"use strict\";\nfunction updateQuadBounds(bounds, anchor, texture) {\n const { width, height } = texture.orig;\n const trim = texture.trim;\n if (trim) {\n const sourceWidth = trim.width;\n const sourceHeight = trim.height;\n bounds.minX = trim.x - anchor._x * width;\n bounds.maxX = bounds.minX + sourceWidth;\n bounds.minY = trim.y - anchor._y * height;\n bounds.maxY = bounds.minY + sourceHeight;\n } else {\n bounds.minX = -anchor._x * width;\n bounds.maxX = bounds.minX + width;\n bounds.minY = -anchor._y * height;\n bounds.maxY = bounds.minY + height;\n }\n}\n\nexport { updateQuadBounds };\n//# sourceMappingURL=updateQuadBounds.mjs.map\n","import { Matrix } from '../../../maths/matrix/Matrix.mjs';\nimport { Rectangle } from '../../../maths/shapes/Rectangle.mjs';\n\n\"use strict\";\nconst defaultMatrix = new Matrix();\nclass Bounds {\n /**\n * Creates a new Bounds object.\n * @param minX - The minimum X coordinate of the bounds.\n * @param minY - The minimum Y coordinate of the bounds.\n * @param maxX - The maximum X coordinate of the bounds.\n * @param maxY - The maximum Y coordinate of the bounds.\n */\n constructor(minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity) {\n /**\n * The minimum X coordinate of the bounds.\n * Represents the leftmost edge of the bounding box.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * // Set left edge\n * bounds.minX = 100;\n * ```\n * @default Infinity\n */\n this.minX = Infinity;\n /**\n * The minimum Y coordinate of the bounds.\n * Represents the topmost edge of the bounding box.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * // Set top edge\n * bounds.minY = 100;\n * ```\n * @default Infinity\n */\n this.minY = Infinity;\n /**\n * The maximum X coordinate of the bounds.\n * Represents the rightmost edge of the bounding box.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * // Set right edge\n * bounds.maxX = 200;\n * // Get width\n * const width = bounds.maxX - bounds.minX;\n * ```\n * @default -Infinity\n */\n this.maxX = -Infinity;\n /**\n * The maximum Y coordinate of the bounds.\n * Represents the bottommost edge of the bounding box.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * // Set bottom edge\n * bounds.maxY = 200;\n * // Get height\n * const height = bounds.maxY - bounds.minY;\n * ```\n * @default -Infinity\n */\n this.maxY = -Infinity;\n /**\n * The transformation matrix applied to this bounds object.\n * Used when calculating bounds with transforms.\n * @example\n * ```ts\n * const bounds = new Bounds();\n *\n * // Apply translation matrix\n * bounds.matrix = new Matrix()\n * .translate(100, 100);\n *\n * // Combine transformations\n * bounds.matrix = new Matrix()\n * .translate(50, 50)\n * .rotate(Math.PI / 4)\n * .scale(2, 2);\n *\n * // Use in bounds calculations\n * bounds.addFrame(0, 0, 100, 100); // Uses current matrix\n * bounds.addFrame(0, 0, 100, 100, customMatrix); // Override matrix\n * ```\n * @advanced\n */\n this.matrix = defaultMatrix;\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n /**\n * Checks if bounds are empty, meaning either width or height is zero or negative.\n * Empty bounds occur when min values exceed max values on either axis.\n * @example\n * ```ts\n * const bounds = new Bounds();\n *\n * // Check if newly created bounds are empty\n * console.log(bounds.isEmpty()); // true, default bounds are empty\n *\n * // Add frame and check again\n * bounds.addFrame(0, 0, 100, 100);\n * console.log(bounds.isEmpty()); // false, bounds now have area\n *\n * // Clear bounds\n * bounds.clear();\n * console.log(bounds.isEmpty()); // true, bounds are empty again\n * ```\n * @returns True if bounds are empty (have no area)\n * @see {@link Bounds#clear} For resetting bounds\n * @see {@link Bounds#isValid} For checking validity\n */\n isEmpty() {\n return this.minX > this.maxX || this.minY > this.maxY;\n }\n /**\n * The bounding rectangle representation of these bounds.\n * Lazily creates and updates a Rectangle instance based on the current bounds.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n *\n * // Get rectangle representation\n * const rect = bounds.rectangle;\n * console.log(rect.x, rect.y, rect.width, rect.height);\n *\n * // Use for hit testing\n * if (bounds.rectangle.contains(mouseX, mouseY)) {\n * console.log('Mouse is inside bounds!');\n * }\n * ```\n * @see {@link Rectangle} For rectangle methods\n * @see {@link Bounds.isEmpty} For bounds validation\n */\n get rectangle() {\n if (!this._rectangle) {\n this._rectangle = new Rectangle();\n }\n const rectangle = this._rectangle;\n if (this.minX > this.maxX || this.minY > this.maxY) {\n rectangle.x = 0;\n rectangle.y = 0;\n rectangle.width = 0;\n rectangle.height = 0;\n } else {\n rectangle.copyFromBounds(this);\n }\n return rectangle;\n }\n /**\n * Clears the bounds and resets all coordinates to their default values.\n * Resets the transformation matrix back to identity.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * console.log(bounds.isEmpty()); // false\n * // Clear the bounds\n * bounds.clear();\n * console.log(bounds.isEmpty()); // true\n * ```\n * @returns This bounds object for chaining\n */\n clear() {\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = -Infinity;\n this.maxY = -Infinity;\n this.matrix = defaultMatrix;\n return this;\n }\n /**\n * Sets the bounds directly using coordinate values.\n * Provides a way to set all bounds values at once.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * bounds.set(0, 0, 100, 100);\n * ```\n * @param x0 - Left X coordinate of frame\n * @param y0 - Top Y coordinate of frame\n * @param x1 - Right X coordinate of frame\n * @param y1 - Bottom Y coordinate of frame\n * @see {@link Bounds#addFrame} For matrix-aware bounds setting\n * @see {@link Bounds#clear} For resetting bounds\n */\n set(x0, y0, x1, y1) {\n this.minX = x0;\n this.minY = y0;\n this.maxX = x1;\n this.maxY = y1;\n }\n /**\n * Adds a rectangular frame to the bounds, optionally transformed by a matrix.\n * Updates the bounds to encompass the new frame coordinates.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * bounds.addFrame(0, 0, 100, 100);\n *\n * // Add transformed frame\n * const matrix = new Matrix()\n * .translate(50, 50)\n * .rotate(Math.PI / 4);\n * bounds.addFrame(0, 0, 100, 100, matrix);\n * ```\n * @param x0 - Left X coordinate of frame\n * @param y0 - Top Y coordinate of frame\n * @param x1 - Right X coordinate of frame\n * @param y1 - Bottom Y coordinate of frame\n * @param matrix - Optional transformation matrix\n * @see {@link Bounds#addRect} For adding Rectangle objects\n * @see {@link Bounds#addBounds} For adding other Bounds\n */\n addFrame(x0, y0, x1, y1, matrix) {\n matrix || (matrix = this.matrix);\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 let minX = this.minX;\n let minY = this.minY;\n let maxX = this.maxX;\n let maxY = this.maxY;\n let x = a * x0 + c * y0 + tx;\n let y = b * x0 + d * y0 + ty;\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 x = a * x1 + c * y0 + tx;\n y = b * x1 + d * y0 + ty;\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 x = a * x0 + c * y1 + tx;\n y = b * x0 + d * y1 + ty;\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 x = a * x1 + c * y1 + tx;\n y = b * x1 + d * y1 + ty;\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 this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n /**\n * Adds a rectangle to the bounds, optionally transformed by a matrix.\n * Updates the bounds to encompass the given rectangle.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * // Add simple rectangle\n * const rect = new Rectangle(0, 0, 100, 100);\n * bounds.addRect(rect);\n *\n * // Add transformed rectangle\n * const matrix = new Matrix()\n * .translate(50, 50)\n * .rotate(Math.PI / 4);\n * bounds.addRect(rect, matrix);\n * ```\n * @param rect - The rectangle to be added\n * @param matrix - Optional transformation matrix\n * @see {@link Bounds#addFrame} For adding raw coordinates\n * @see {@link Bounds#addBounds} For adding other bounds\n */\n addRect(rect, matrix) {\n this.addFrame(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, matrix);\n }\n /**\n * Adds another bounds object to this one, optionally transformed by a matrix.\n * Expands the bounds to include the given bounds' area.\n * @example\n * ```ts\n * const bounds = new Bounds();\n *\n * // Add child bounds\n * const childBounds = sprite.getBounds();\n * bounds.addBounds(childBounds);\n *\n * // Add transformed bounds\n * const matrix = new Matrix()\n * .scale(2, 2);\n * bounds.addBounds(childBounds, matrix);\n * ```\n * @param bounds - The bounds to be added\n * @param matrix - Optional transformation matrix\n * @see {@link Bounds#addFrame} For adding raw coordinates\n * @see {@link Bounds#addRect} For adding rectangles\n */\n addBounds(bounds, matrix) {\n this.addFrame(bounds.minX, bounds.minY, bounds.maxX, bounds.maxY, matrix);\n }\n /**\n * Adds other Bounds as a mask, creating an intersection of the two bounds.\n * Only keeps the overlapping region between current bounds and mask bounds.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Create mask bounds\n * const mask = new Bounds();\n * mask.addFrame(50, 50, 150, 150);\n * // Apply mask - results in bounds of (50,50,100,100)\n * bounds.addBoundsMask(mask);\n * ```\n * @param mask - The Bounds to use as a mask\n * @see {@link Bounds#addBounds} For union operation\n * @see {@link Bounds#fit} For fitting to rectangle\n */\n addBoundsMask(mask) {\n this.minX = this.minX > mask.minX ? this.minX : mask.minX;\n this.minY = this.minY > mask.minY ? this.minY : mask.minY;\n this.maxX = this.maxX < mask.maxX ? this.maxX : mask.maxX;\n this.maxY = this.maxY < mask.maxY ? this.maxY : mask.maxY;\n }\n /**\n * Applies a transformation matrix to the bounds, updating its coordinates.\n * Transforms all corners of the bounds using the given matrix.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Apply translation\n * const translateMatrix = new Matrix()\n * .translate(50, 50);\n * bounds.applyMatrix(translateMatrix);\n * ```\n * @param matrix - The matrix to apply to the bounds\n * @see {@link Matrix} For matrix operations\n * @see {@link Bounds#addFrame} For adding transformed frames\n */\n applyMatrix(matrix) {\n const minX = this.minX;\n const minY = this.minY;\n const maxX = this.maxX;\n const maxY = this.maxY;\n const { a, b, c, d, tx, ty } = matrix;\n let x = a * minX + c * minY + tx;\n let y = b * minX + d * minY + ty;\n this.minX = x;\n this.minY = y;\n this.maxX = x;\n this.maxY = y;\n x = a * maxX + c * minY + tx;\n y = b * maxX + d * minY + ty;\n this.minX = x < this.minX ? x : this.minX;\n this.minY = y < this.minY ? y : this.minY;\n this.maxX = x > this.maxX ? x : this.maxX;\n this.maxY = y > this.maxY ? y : this.maxY;\n x = a * minX + c * maxY + tx;\n y = b * minX + d * maxY + ty;\n this.minX = x < this.minX ? x : this.minX;\n this.minY = y < this.minY ? y : this.minY;\n this.maxX = x > this.maxX ? x : this.maxX;\n this.maxY = y > this.maxY ? y : this.maxY;\n x = a * maxX + c * maxY + tx;\n y = b * maxX + d * maxY + ty;\n this.minX = x < this.minX ? x : this.minX;\n this.minY = y < this.minY ? y : this.minY;\n this.maxX = x > this.maxX ? x : this.maxX;\n this.maxY = y > this.maxY ? y : this.maxY;\n }\n /**\n * Resizes the bounds object to fit within the given rectangle.\n * Clips the bounds if they extend beyond the rectangle's edges.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 200, 200);\n * // Fit within viewport\n * const viewport = new Rectangle(50, 50, 100, 100);\n * bounds.fit(viewport);\n * // bounds are now (50, 50, 150, 150)\n * ```\n * @param rect - The rectangle to fit within\n * @returns This bounds object for chaining\n * @see {@link Bounds#addBoundsMask} For intersection\n * @see {@link Bounds#pad} For expanding bounds\n */\n fit(rect) {\n if (this.minX < rect.left) this.minX = rect.left;\n if (this.maxX > rect.right) this.maxX = rect.right;\n if (this.minY < rect.top) this.minY = rect.top;\n if (this.maxY > rect.bottom) this.maxY = rect.bottom;\n return this;\n }\n /**\n * Resizes the bounds object to include the given bounds.\n * Similar to fit() but works with raw coordinate values instead of a Rectangle.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 200, 200);\n * // Fit to specific coordinates\n * bounds.fitBounds(50, 150, 50, 150);\n * // bounds are now (50, 50, 150, 150)\n * ```\n * @param left - The left value of the bounds\n * @param right - The right value of the bounds\n * @param top - The top value of the bounds\n * @param bottom - The bottom value of the bounds\n * @returns This bounds object for chaining\n * @see {@link Bounds#fit} For fitting to Rectangle\n * @see {@link Bounds#addBoundsMask} For intersection\n */\n fitBounds(left, right, top, bottom) {\n if (this.minX < left) this.minX = left;\n if (this.maxX > right) this.maxX = right;\n if (this.minY < top) this.minY = top;\n if (this.maxY > bottom) this.maxY = bottom;\n return this;\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 * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n *\n * // Add equal padding\n * bounds.pad(10);\n * // bounds are now (-10, -10, 110, 110)\n *\n * // Add different padding for x and y\n * bounds.pad(20, 10);\n * // bounds are now (-30, -20, 130, 120)\n * ```\n * @param paddingX - The horizontal padding amount\n * @param paddingY - The vertical padding amount\n * @returns This bounds object for chaining\n * @see {@link Bounds#fit} For constraining bounds\n * @see {@link Bounds#scale} For uniform scaling\n */\n pad(paddingX, paddingY = paddingX) {\n this.minX -= paddingX;\n this.maxX += paddingX;\n this.minY -= paddingY;\n this.maxY += paddingY;\n return this;\n }\n /**\n * Ceils the bounds by rounding up max values and rounding down min values.\n * Useful for pixel-perfect calculations and avoiding fractional pixels.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * bounds.set(10.2, 10.9, 50.1, 50.8);\n *\n * // Round to whole pixels\n * bounds.ceil();\n * // bounds are now (10, 10, 51, 51)\n * ```\n * @returns This bounds object for chaining\n * @see {@link Bounds#scale} For size adjustments\n * @see {@link Bounds#fit} For constraining bounds\n */\n ceil() {\n this.minX = Math.floor(this.minX);\n this.minY = Math.floor(this.minY);\n this.maxX = Math.ceil(this.maxX);\n this.maxY = Math.ceil(this.maxY);\n return this;\n }\n /**\n * Creates a new Bounds instance with the same values.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n *\n * // Create a copy\n * const copy = bounds.clone();\n *\n * // Original and copy are independent\n * bounds.pad(10);\n * console.log(copy.width === bounds.width); // false\n * ```\n * @returns A new Bounds instance with the same values\n * @see {@link Bounds#copyFrom} For reusing existing bounds\n */\n clone() {\n return new Bounds(this.minX, this.minY, this.maxX, this.maxY);\n }\n /**\n * Scales the bounds by the given values, adjusting all edges proportionally.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n *\n * // Scale uniformly\n * bounds.scale(2);\n * // bounds are now (0, 0, 200, 200)\n *\n * // Scale non-uniformly\n * bounds.scale(0.5, 2);\n * // bounds are now (0, 0, 100, 400)\n * ```\n * @param x - The X value to scale by\n * @param y - The Y value to scale by (defaults to x)\n * @returns This bounds object for chaining\n * @see {@link Bounds#pad} For adding padding\n * @see {@link Bounds#fit} For constraining size\n */\n scale(x, y = x) {\n this.minX *= x;\n this.minY *= y;\n this.maxX *= x;\n this.maxY *= y;\n return this;\n }\n /**\n * The x position of the bounds in local space.\n * Setting this value will move the bounds while maintaining its width.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Get x position\n * console.log(bounds.x); // 0\n *\n * // Move bounds horizontally\n * bounds.x = 50;\n * console.log(bounds.minX, bounds.maxX); // 50, 150\n *\n * // Width stays the same\n * console.log(bounds.width); // Still 100\n * ```\n */\n get x() {\n return this.minX;\n }\n set x(value) {\n const width = this.maxX - this.minX;\n this.minX = value;\n this.maxX = value + width;\n }\n /**\n * The y position of the bounds in local space.\n * Setting this value will move the bounds while maintaining its height.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Get y position\n * console.log(bounds.y); // 0\n *\n * // Move bounds vertically\n * bounds.y = 50;\n * console.log(bounds.minY, bounds.maxY); // 50, 150\n *\n * // Height stays the same\n * console.log(bounds.height); // Still 100\n * ```\n */\n get y() {\n return this.minY;\n }\n set y(value) {\n const height = this.maxY - this.minY;\n this.minY = value;\n this.maxY = value + height;\n }\n /**\n * The width value of the bounds.\n * Represents the distance between minX and maxX coordinates.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Get width\n * console.log(bounds.width); // 100\n * // Resize width\n * bounds.width = 200;\n * console.log(bounds.maxX - bounds.minX); // 200\n * ```\n */\n get width() {\n return this.maxX - this.minX;\n }\n set width(value) {\n this.maxX = this.minX + value;\n }\n /**\n * The height value of the bounds.\n * Represents the distance between minY and maxY coordinates.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Get height\n * console.log(bounds.height); // 100\n * // Resize height\n * bounds.height = 150;\n * console.log(bounds.maxY - bounds.minY); // 150\n * ```\n */\n get height() {\n return this.maxY - this.minY;\n }\n set height(value) {\n this.maxY = this.minY + value;\n }\n /**\n * The left edge coordinate of the bounds.\n * Alias for minX.\n * @example\n * ```ts\n * const bounds = new Bounds(50, 0, 150, 100);\n * console.log(bounds.left); // 50\n * console.log(bounds.left === bounds.minX); // true\n * ```\n * @readonly\n */\n get left() {\n return this.minX;\n }\n /**\n * The right edge coordinate of the bounds.\n * Alias for maxX.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * console.log(bounds.right); // 100\n * console.log(bounds.right === bounds.maxX); // true\n * ```\n * @readonly\n */\n get right() {\n return this.maxX;\n }\n /**\n * The top edge coordinate of the bounds.\n * Alias for minY.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 25, 100, 125);\n * console.log(bounds.top); // 25\n * console.log(bounds.top === bounds.minY); // true\n * ```\n * @readonly\n */\n get top() {\n return this.minY;\n }\n /**\n * The bottom edge coordinate of the bounds.\n * Alias for maxY.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 200);\n * console.log(bounds.bottom); // 200\n * console.log(bounds.bottom === bounds.maxY); // true\n * ```\n * @readonly\n */\n get bottom() {\n return this.maxY;\n }\n /**\n * Whether the bounds has positive width and height.\n * Checks if both dimensions are greater than zero.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Check if bounds are positive\n * console.log(bounds.isPositive); // true\n *\n * // Negative bounds\n * bounds.maxX = bounds.minX;\n * console.log(bounds.isPositive); // false, width is 0\n * ```\n * @readonly\n * @see {@link Bounds#isEmpty} For checking empty state\n * @see {@link Bounds#isValid} For checking validity\n */\n get isPositive() {\n return this.maxX - this.minX > 0 && this.maxY - this.minY > 0;\n }\n /**\n * Whether the bounds has valid coordinates.\n * Checks if the bounds has been initialized with real values.\n * @example\n * ```ts\n * const bounds = new Bounds();\n * console.log(bounds.isValid); // false, default state\n *\n * // Set valid bounds\n * bounds.addFrame(0, 0, 100, 100);\n * console.log(bounds.isValid); // true\n * ```\n * @readonly\n * @see {@link Bounds#isEmpty} For checking empty state\n * @see {@link Bounds#isPositive} For checking dimensions\n */\n get isValid() {\n return this.minX + this.minY !== Infinity;\n }\n /**\n * Adds vertices from a Float32Array to the bounds, optionally transformed by a matrix.\n * Used for efficiently updating bounds from raw vertex data.\n * @example\n * ```ts\n * const bounds = new Bounds();\n *\n * // Add vertices from geometry\n * const vertices = new Float32Array([\n * 0, 0, // Vertex 1\n * 100, 0, // Vertex 2\n * 100, 100 // Vertex 3\n * ]);\n * bounds.addVertexData(vertices, 0, 6);\n *\n * // Add transformed vertices\n * const matrix = new Matrix()\n * .translate(50, 50)\n * .rotate(Math.PI / 4);\n * bounds.addVertexData(vertices, 0, 6, matrix);\n *\n * // Add subset of vertices\n * bounds.addVertexData(vertices, 2, 4); // Only second vertex\n * ```\n * @param vertexData - The array of vertices to add\n * @param beginOffset - Starting index in the vertex array\n * @param endOffset - Ending index in the vertex array (excluded)\n * @param matrix - Optional transformation matrix\n * @see {@link Bounds#addFrame} For adding rectangular frames\n * @see {@link Matrix} For transformation details\n */\n addVertexData(vertexData, beginOffset, endOffset, matrix) {\n let minX = this.minX;\n let minY = this.minY;\n let maxX = this.maxX;\n let maxY = this.maxY;\n matrix || (matrix = this.matrix);\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 for (let i = beginOffset; i < endOffset; i += 2) {\n const localX = vertexData[i];\n const localY = vertexData[i + 1];\n const x = a * localX + c * localY + tx;\n const y = b * localX + d * localY + 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 * Checks if a point is contained within the bounds.\n * Returns true if the point's coordinates fall within the bounds' area.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * // Basic point check\n * console.log(bounds.containsPoint(50, 50)); // true\n * console.log(bounds.containsPoint(150, 150)); // false\n *\n * // Check edges\n * console.log(bounds.containsPoint(0, 0)); // true, includes edges\n * console.log(bounds.containsPoint(100, 100)); // true, includes edges\n * ```\n * @param x - x coordinate to check\n * @param y - y coordinate to check\n * @returns True if the point is inside the bounds\n * @see {@link Bounds#isPositive} For valid bounds check\n * @see {@link Bounds#rectangle} For Rectangle representation\n */\n containsPoint(x, y) {\n if (this.minX <= x && this.minY <= y && this.maxX >= x && this.maxY >= y) {\n return true;\n }\n return false;\n }\n /**\n * Returns a string representation of the bounds.\n * Useful for debugging and logging bounds information.\n * @example\n * ```ts\n * const bounds = new Bounds(0, 0, 100, 100);\n * console.log(bounds.toString()); // \"[pixi.js:Bounds minX=0 minY=0 maxX=100 maxY=100 width=100 height=100]\"\n * ```\n * @returns A string describing the bounds\n * @see {@link Bounds#copyFrom} For copying bounds\n * @see {@link Bounds#clone} For creating a new instance\n */\n toString() {\n return `[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`;\n }\n /**\n * Copies the bounds from another bounds object.\n * Useful for reusing bounds objects and avoiding allocations.\n * @example\n * ```ts\n * const sourceBounds = new Bounds(0, 0, 100, 100);\n * // Copy bounds\n * const targetBounds = new Bounds();\n * targetBounds.copyFrom(sourceBounds);\n * ```\n * @param bounds - The bounds to copy from\n * @returns This bounds object for chaining\n * @see {@link Bounds#clone} For creating new instances\n */\n copyFrom(bounds) {\n this.minX = bounds.minX;\n this.minY = bounds.minY;\n this.maxX = bounds.maxX;\n this.maxY = bounds.maxY;\n return this;\n }\n}\n\nexport { Bounds };\n//# sourceMappingURL=Bounds.mjs.map\n","var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return\"string\"==typeof r?r.length>0:\"number\"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?\"0\"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,p=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s+([+-]?\\d*\\.?\\d+)%\\s+([+-]?\\d*\\.?\\d+)%\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,v=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,m=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},\"hex\"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},\"rgb\"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u=\"deg\"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},\"hsl\"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},\"rgb\"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},\"hsl\"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},\"hsv\"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return\"string\"==typeof r?N(r.trim(),y.string):\"object\"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):\"\",\"#\"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?\"rgba(\"+t+\", \"+n+\", \"+e+\", \"+u+\")\":\"rgb(\"+t+\", \"+n+\", \"+e+\")\";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?\"hsla(\"+t+\", \"+n+\"%, \"+e+\"%, \"+u+\")\":\"hsl(\"+t+\", \"+n+\"%, \"+e+\"%)\";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return\"number\"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return\"number\"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};export{j as Colord,w as colord,k as extend,I as getFormat,E as random};\n","export default function(e,f){var a={white:\"#ffffff\",bisque:\"#ffe4c4\",blue:\"#0000ff\",cadetblue:\"#5f9ea0\",chartreuse:\"#7fff00\",chocolate:\"#d2691e\",coral:\"#ff7f50\",antiquewhite:\"#faebd7\",aqua:\"#00ffff\",azure:\"#f0ffff\",whitesmoke:\"#f5f5f5\",papayawhip:\"#ffefd5\",plum:\"#dda0dd\",blanchedalmond:\"#ffebcd\",black:\"#000000\",gold:\"#ffd700\",goldenrod:\"#daa520\",gainsboro:\"#dcdcdc\",cornsilk:\"#fff8dc\",cornflowerblue:\"#6495ed\",burlywood:\"#deb887\",aquamarine:\"#7fffd4\",beige:\"#f5f5dc\",crimson:\"#dc143c\",cyan:\"#00ffff\",darkblue:\"#00008b\",darkcyan:\"#008b8b\",darkgoldenrod:\"#b8860b\",darkkhaki:\"#bdb76b\",darkgray:\"#a9a9a9\",darkgreen:\"#006400\",darkgrey:\"#a9a9a9\",peachpuff:\"#ffdab9\",darkmagenta:\"#8b008b\",darkred:\"#8b0000\",darkorchid:\"#9932cc\",darkorange:\"#ff8c00\",darkslateblue:\"#483d8b\",gray:\"#808080\",darkslategray:\"#2f4f4f\",darkslategrey:\"#2f4f4f\",deeppink:\"#ff1493\",deepskyblue:\"#00bfff\",wheat:\"#f5deb3\",firebrick:\"#b22222\",floralwhite:\"#fffaf0\",ghostwhite:\"#f8f8ff\",darkviolet:\"#9400d3\",magenta:\"#ff00ff\",green:\"#008000\",dodgerblue:\"#1e90ff\",grey:\"#808080\",honeydew:\"#f0fff0\",hotpink:\"#ff69b4\",blueviolet:\"#8a2be2\",forestgreen:\"#228b22\",lawngreen:\"#7cfc00\",indianred:\"#cd5c5c\",indigo:\"#4b0082\",fuchsia:\"#ff00ff\",brown:\"#a52a2a\",maroon:\"#800000\",mediumblue:\"#0000cd\",lightcoral:\"#f08080\",darkturquoise:\"#00ced1\",lightcyan:\"#e0ffff\",ivory:\"#fffff0\",lightyellow:\"#ffffe0\",lightsalmon:\"#ffa07a\",lightseagreen:\"#20b2aa\",linen:\"#faf0e6\",mediumaquamarine:\"#66cdaa\",lemonchiffon:\"#fffacd\",lime:\"#00ff00\",khaki:\"#f0e68c\",mediumseagreen:\"#3cb371\",limegreen:\"#32cd32\",mediumspringgreen:\"#00fa9a\",lightskyblue:\"#87cefa\",lightblue:\"#add8e6\",midnightblue:\"#191970\",lightpink:\"#ffb6c1\",mistyrose:\"#ffe4e1\",moccasin:\"#ffe4b5\",mintcream:\"#f5fffa\",lightslategray:\"#778899\",lightslategrey:\"#778899\",navajowhite:\"#ffdead\",navy:\"#000080\",mediumvioletred:\"#c71585\",powderblue:\"#b0e0e6\",palegoldenrod:\"#eee8aa\",oldlace:\"#fdf5e6\",paleturquoise:\"#afeeee\",mediumturquoise:\"#48d1cc\",mediumorchid:\"#ba55d3\",rebeccapurple:\"#663399\",lightsteelblue:\"#b0c4de\",mediumslateblue:\"#7b68ee\",thistle:\"#d8bfd8\",tan:\"#d2b48c\",orchid:\"#da70d6\",mediumpurple:\"#9370db\",purple:\"#800080\",pink:\"#ffc0cb\",skyblue:\"#87ceeb\",springgreen:\"#00ff7f\",palegreen:\"#98fb98\",red:\"#ff0000\",yellow:\"#ffff00\",slateblue:\"#6a5acd\",lavenderblush:\"#fff0f5\",peru:\"#cd853f\",palevioletred:\"#db7093\",violet:\"#ee82ee\",teal:\"#008080\",slategray:\"#708090\",slategrey:\"#708090\",aliceblue:\"#f0f8ff\",darkseagreen:\"#8fbc8f\",darkolivegreen:\"#556b2f\",greenyellow:\"#adff2f\",seagreen:\"#2e8b57\",seashell:\"#fff5ee\",tomato:\"#ff6347\",silver:\"#c0c0c0\",sienna:\"#a0522d\",lavender:\"#e6e6fa\",lightgreen:\"#90ee90\",orange:\"#ffa500\",orangered:\"#ff4500\",steelblue:\"#4682b4\",royalblue:\"#4169e1\",turquoise:\"#40e0d0\",yellowgreen:\"#9acd32\",salmon:\"#fa8072\",saddlebrown:\"#8b4513\",sandybrown:\"#f4a460\",rosybrown:\"#bc8f8f\",darksalmon:\"#e9967a\",lightgoldenrodyellow:\"#fafad2\",snow:\"#fffafa\",lightgrey:\"#d3d3d3\",lightgray:\"#d3d3d3\",dimgray:\"#696969\",dimgrey:\"#696969\",olivedrab:\"#6b8e23\",olive:\"#808000\"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return\"transparent\";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b=\"black\";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d=\"transparent\"===r?\"#0000\":a[r];return d?new e(d).toRgb():null},\"name\"])}\n","import { extend, colord } from '@pixi/colord';\nimport namesPlugin from '@pixi/colord/plugins/names';\n\n\"use strict\";\nextend([namesPlugin]);\nconst _Color = class _Color {\n /**\n * @param {ColorSource} value - Optional value to use, if not provided, white is used.\n */\n constructor(value = 16777215) {\n this._value = null;\n this._components = new Float32Array(4);\n this._components.fill(1);\n this._int = 16777215;\n this.value = value;\n }\n /**\n * Get the red component of the color, normalized between 0 and 1.\n * @example\n * ```ts\n * const color = new Color('red');\n * console.log(color.red); // 1\n *\n * const green = new Color('#00ff00');\n * console.log(green.red); // 0\n * ```\n */\n get red() {\n return this._components[0];\n }\n /**\n * Get the green component of the color, normalized between 0 and 1.\n * @example\n * ```ts\n * const color = new Color('lime');\n * console.log(color.green); // 1\n *\n * const red = new Color('#ff0000');\n * console.log(red.green); // 0\n * ```\n */\n get green() {\n return this._components[1];\n }\n /**\n * Get the blue component of the color, normalized between 0 and 1.\n * @example\n * ```ts\n * const color = new Color('blue');\n * console.log(color.blue); // 1\n *\n * const yellow = new Color('#ffff00');\n * console.log(yellow.blue); // 0\n * ```\n */\n get blue() {\n return this._components[2];\n }\n /**\n * Get the alpha component of the color, normalized between 0 and 1.\n * @example\n * ```ts\n * const color = new Color('red');\n * console.log(color.alpha); // 1 (fully opaque)\n *\n * const transparent = new Color('rgba(255, 0, 0, 0.5)');\n * console.log(transparent.alpha); // 0.5 (semi-transparent)\n * ```\n */\n get alpha() {\n return this._components[3];\n }\n /**\n * Sets the color value and returns the instance for chaining.\n *\n * This is a chainable version of setting the `value` property.\n * @param value - The color to set. Accepts various formats:\n * - Hex strings/numbers (e.g., '#ff0000', 0xff0000)\n * - RGB/RGBA values (arrays, objects)\n * - CSS color names\n * - HSL/HSLA values\n * - HSV/HSVA values\n * @returns The Color instance for chaining\n * @example\n * ```ts\n * // Basic usage\n * const color = new Color();\n * color.setValue('#ff0000')\n * .setAlpha(0.5)\n * .premultiply(0.8);\n *\n * // Different formats\n * color.setValue(0xff0000); // Hex number\n * color.setValue('#ff0000'); // Hex string\n * color.setValue([1, 0, 0]); // RGB array\n * color.setValue([1, 0, 0, 0.5]); // RGBA array\n * color.setValue({ r: 1, g: 0, b: 0 }); // RGB object\n *\n * // Copy from another color\n * const red = new Color('red');\n * color.setValue(red);\n * ```\n * @throws {Error} If the color value is invalid or null\n * @see {@link Color.value} For the underlying value property\n */\n setValue(value) {\n this.value = value;\n return this;\n }\n /**\n * The current color source. This property allows getting and setting the color value\n * while preserving the original format where possible.\n * @remarks\n * When setting:\n * - Setting to a `Color` instance copies its source and components\n * - Setting to other valid sources normalizes and stores the value\n * - Setting to `null` throws an Error\n * - The color remains unchanged if normalization fails\n *\n * When getting:\n * - Returns `null` if color was modified by {@link Color.multiply} or {@link Color.premultiply}\n * - Otherwise returns the original color source\n * @example\n * ```ts\n * // Setting different color formats\n * const color = new Color();\n *\n * color.value = 0xff0000; // Hex number\n * color.value = '#ff0000'; // Hex string\n * color.value = [1, 0, 0]; // RGB array\n * color.value = [1, 0, 0, 0.5]; // RGBA array\n * color.value = { r: 1, g: 0, b: 0 }; // RGB object\n *\n * // Copying from another color\n * const red = new Color('red');\n * color.value = red; // Copies red's components\n *\n * // Getting the value\n * console.log(color.value); // Returns original format\n *\n * // After modifications\n * color.multiply([0.5, 0.5, 0.5]);\n * console.log(color.value); // Returns null\n * ```\n * @throws {Error} When attempting to set `null`\n */\n set value(value) {\n if (value instanceof _Color) {\n this._value = this._cloneSource(value._value);\n this._int = value._int;\n this._components.set(value._components);\n } else if (value === null) {\n throw new Error(\"Cannot set Color#value to null\");\n } else if (this._value === null || !this._isSourceEqual(this._value, value)) {\n this._value = this._cloneSource(value);\n this._normalize(this._value);\n }\n }\n get value() {\n return this._value;\n }\n /**\n * Copy a color source internally.\n * @param value - Color source\n */\n _cloneSource(value) {\n if (typeof value === \"string\" || typeof value === \"number\" || value instanceof Number || value === null) {\n return value;\n } else if (Array.isArray(value) || ArrayBuffer.isView(value)) {\n return value.slice(0);\n } else if (typeof value === \"object\" && value !== null) {\n return { ...value };\n }\n return value;\n }\n /**\n * Equality check for color sources.\n * @param value1 - First color source\n * @param value2 - Second color source\n * @returns `true` if the color sources are equal, `false` otherwise.\n */\n _isSourceEqual(value1, value2) {\n const type1 = typeof value1;\n const type2 = typeof value2;\n if (type1 !== type2) {\n return false;\n } else if (type1 === \"number\" || type1 === \"string\" || value1 instanceof Number) {\n return value1 === value2;\n } else if (Array.isArray(value1) && Array.isArray(value2) || ArrayBuffer.isView(value1) && ArrayBuffer.isView(value2)) {\n if (value1.length !== value2.length) {\n return false;\n }\n return value1.every((v, i) => v === value2[i]);\n } else if (value1 !== null && value2 !== null) {\n const keys1 = Object.keys(value1);\n const keys2 = Object.keys(value2);\n if (keys1.length !== keys2.length) {\n return false;\n }\n return keys1.every((key) => value1[key] === value2[key]);\n }\n return value1 === value2;\n }\n /**\n * Convert to a RGBA color object with normalized components (0-1).\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Convert colors to RGBA objects\n * new Color('white').toRgba(); // returns { r: 1, g: 1, b: 1, a: 1 }\n * new Color('#ff0000').toRgba(); // returns { r: 1, g: 0, b: 0, a: 1 }\n *\n * // With transparency\n * new Color('rgba(255,0,0,0.5)').toRgba(); // returns { r: 1, g: 0, b: 0, a: 0.5 }\n * ```\n * @returns An RGBA object with normalized components\n */\n toRgba() {\n const [r, g, b, a] = this._components;\n return { r, g, b, a };\n }\n /**\n * Convert to a RGB color object with normalized components (0-1).\n *\n * Alpha component is omitted in the output.\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Convert colors to RGB objects\n * new Color('white').toRgb(); // returns { r: 1, g: 1, b: 1 }\n * new Color('#ff0000').toRgb(); // returns { r: 1, g: 0, b: 0 }\n *\n * // Alpha is ignored\n * new Color('rgba(255,0,0,0.5)').toRgb(); // returns { r: 1, g: 0, b: 0 }\n * ```\n * @returns An RGB object with normalized components\n */\n toRgb() {\n const [r, g, b] = this._components;\n return { r, g, b };\n }\n /**\n * Convert to a CSS-style rgba string representation.\n *\n * RGB components are scaled to 0-255 range, alpha remains 0-1.\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Convert colors to RGBA strings\n * new Color('white').toRgbaString(); // returns \"rgba(255,255,255,1)\"\n * new Color('#ff0000').toRgbaString(); // returns \"rgba(255,0,0,1)\"\n *\n * // With transparency\n * new Color([1, 0, 0, 0.5]).toRgbaString(); // returns \"rgba(255,0,0,0.5)\"\n * ```\n * @returns A CSS-compatible rgba string\n */\n toRgbaString() {\n const [r, g, b] = this.toUint8RgbArray();\n return `rgba(${r},${g},${b},${this.alpha})`;\n }\n /**\n * Convert to an [R, G, B] array of clamped uint8 values (0 to 255).\n * @param {number[]|Uint8Array|Uint8ClampedArray} [out] - Optional output array. If not provided,\n * a cached array will be used and returned.\n * @returns Array containing RGB components as integers between 0-255\n * @example\n * ```ts\n * // Basic usage\n * new Color('white').toUint8RgbArray(); // returns [255, 255, 255]\n * new Color('#ff0000').toUint8RgbArray(); // returns [255, 0, 0]\n *\n * // Using custom output array\n * const rgb = new Uint8Array(3);\n * new Color('blue').toUint8RgbArray(rgb); // rgb is now [0, 0, 255]\n *\n * // Using different array types\n * new Color('red').toUint8RgbArray(new Uint8ClampedArray(3)); // [255, 0, 0]\n * new Color('red').toUint8RgbArray([]); // [255, 0, 0]\n * ```\n * @remarks\n * - Output values are always clamped between 0-255\n * - Alpha component is not included in output\n * - Reuses internal cache array if no output array provided\n */\n toUint8RgbArray(out) {\n const [r, g, b] = this._components;\n if (!this._arrayRgb) {\n this._arrayRgb = [];\n }\n out || (out = this._arrayRgb);\n out[0] = Math.round(r * 255);\n out[1] = Math.round(g * 255);\n out[2] = Math.round(b * 255);\n return out;\n }\n /**\n * Convert to an [R, G, B, A] array of normalized floats (numbers from 0.0 to 1.0).\n * @param {number[]|Float32Array} [out] - Optional output array. If not provided,\n * a cached array will be used and returned.\n * @returns Array containing RGBA components as floats between 0-1\n * @example\n * ```ts\n * // Basic usage\n * new Color('white').toArray(); // returns [1, 1, 1, 1]\n * new Color('red').toArray(); // returns [1, 0, 0, 1]\n *\n * // With alpha\n * new Color('rgba(255,0,0,0.5)').toArray(); // returns [1, 0, 0, 0.5]\n *\n * // Using custom output array\n * const rgba = new Float32Array(4);\n * new Color('blue').toArray(rgba); // rgba is now [0, 0, 1, 1]\n * ```\n * @remarks\n * - Output values are normalized between 0-1\n * - Includes alpha component as the fourth value\n * - Reuses internal cache array if no output array provided\n */\n toArray(out) {\n if (!this._arrayRgba) {\n this._arrayRgba = [];\n }\n out || (out = this._arrayRgba);\n const [r, g, b, a] = this._components;\n out[0] = r;\n out[1] = g;\n out[2] = b;\n out[3] = a;\n return out;\n }\n /**\n * Convert to an [R, G, B] array of normalized floats (numbers from 0.0 to 1.0).\n * @param {number[]|Float32Array} [out] - Optional output array. If not provided,\n * a cached array will be used and returned.\n * @returns Array containing RGB components as floats between 0-1\n * @example\n * ```ts\n * // Basic usage\n * new Color('white').toRgbArray(); // returns [1, 1, 1]\n * new Color('red').toRgbArray(); // returns [1, 0, 0]\n *\n * // Using custom output array\n * const rgb = new Float32Array(3);\n * new Color('blue').toRgbArray(rgb); // rgb is now [0, 0, 1]\n * ```\n * @remarks\n * - Output values are normalized between 0-1\n * - Alpha component is omitted from output\n * - Reuses internal cache array if no output array provided\n */\n toRgbArray(out) {\n if (!this._arrayRgb) {\n this._arrayRgb = [];\n }\n out || (out = this._arrayRgb);\n const [r, g, b] = this._components;\n out[0] = r;\n out[1] = g;\n out[2] = b;\n return out;\n }\n /**\n * Convert to a hexadecimal number.\n * @returns The color as a 24-bit RGB integer\n * @example\n * ```ts\n * // Basic usage\n * new Color('white').toNumber(); // returns 0xffffff\n * new Color('red').toNumber(); // returns 0xff0000\n *\n * // Store as hex\n * const color = new Color('blue');\n * const hex = color.toNumber(); // 0x0000ff\n * ```\n */\n toNumber() {\n return this._int;\n }\n /**\n * Convert to a BGR number.\n *\n * Useful for platforms that expect colors in BGR format.\n * @returns The color as a 24-bit BGR integer\n * @example\n * ```ts\n * // Convert RGB to BGR\n * new Color(0xffcc99).toBgrNumber(); // returns 0x99ccff\n *\n * // Common use case: platform-specific color format\n * const color = new Color('orange');\n * const bgrColor = color.toBgrNumber(); // Color with swapped R/B channels\n * ```\n * @remarks\n * This swaps the red and blue channels compared to the normal RGB format:\n * - RGB 0xRRGGBB becomes BGR 0xBBGGRR\n */\n toBgrNumber() {\n const [r, g, b] = this.toUint8RgbArray();\n return (b << 16) + (g << 8) + r;\n }\n /**\n * Convert to a hexadecimal number in little endian format (e.g., BBGGRR).\n *\n * Useful for platforms that expect colors in little endian byte order.\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Convert RGB color to little endian format\n * new Color(0xffcc99).toLittleEndianNumber(); // returns 0x99ccff\n *\n * // Common use cases:\n * const color = new Color('orange');\n * const leColor = color.toLittleEndianNumber(); // Swaps byte order for LE systems\n *\n * // Multiple conversions\n * const colors = {\n * normal: 0xffcc99,\n * littleEndian: new Color(0xffcc99).toLittleEndianNumber(), // 0x99ccff\n * backToNormal: new Color(0x99ccff).toLittleEndianNumber() // 0xffcc99\n * };\n * ```\n * @remarks\n * - Swaps R and B channels in the color value\n * - RGB 0xRRGGBB becomes 0xBBGGRR\n * - Useful for systems that use little endian byte order\n * - Can be used to convert back and forth between formats\n * @returns The color as a number in little endian format (BBGGRR)\n * @see {@link Color.toBgrNumber} For BGR format without byte swapping\n */\n toLittleEndianNumber() {\n const value = this._int;\n return (value >> 16) + (value & 65280) + ((value & 255) << 16);\n }\n /**\n * Multiply with another color.\n *\n * This action is destructive and modifies the original color.\n * @param {ColorSource} value - The color to multiply by. Accepts any valid color format:\n * - Hex strings/numbers (e.g., '#ff0000', 0xff0000)\n * - RGB/RGBA arrays ([1, 0, 0], [1, 0, 0, 1])\n * - Color objects ({ r: 1, g: 0, b: 0 })\n * - CSS color names ('red', 'blue')\n * @returns this - The Color instance for chaining\n * @example\n * ```ts\n * // Basic multiplication\n * const color = new Color('#ff0000');\n * color.multiply(0x808080); // 50% darker red\n *\n * // With transparency\n * color.multiply([1, 1, 1, 0.5]); // 50% transparent\n *\n * // Chain operations\n * color\n * .multiply('#808080')\n * .multiply({ r: 1, g: 1, b: 1, a: 0.5 });\n * ```\n * @remarks\n * - Multiplies each RGB component and alpha separately\n * - Values are clamped between 0-1\n * - Original color format is lost (value becomes null)\n * - Operation cannot be undone\n */\n multiply(value) {\n const [r, g, b, a] = _Color._temp.setValue(value)._components;\n this._components[0] *= r;\n this._components[1] *= g;\n this._components[2] *= b;\n this._components[3] *= a;\n this._refreshInt();\n this._value = null;\n return this;\n }\n /**\n * Converts color to a premultiplied alpha format.\n *\n * This action is destructive and modifies the original color.\n * @param alpha - The alpha value to multiply by (0-1)\n * @param {boolean} [applyToRGB=true] - Whether to premultiply RGB channels\n * @returns {Color} The Color instance for chaining\n * @example\n * ```ts\n * // Basic premultiplication\n * const color = new Color('red');\n * color.premultiply(0.5); // 50% transparent red with premultiplied RGB\n *\n * // Alpha only (RGB unchanged)\n * color.premultiply(0.5, false); // 50% transparent, original RGB\n *\n * // Chain with other operations\n * color\n * .multiply(0x808080)\n * .premultiply(0.5)\n * .toNumber();\n * ```\n * @remarks\n * - RGB channels are multiplied by alpha when applyToRGB is true\n * - Alpha is always set to the provided value\n * - Values are clamped between 0-1\n * - Original color format is lost (value becomes null)\n * - Operation cannot be undone\n */\n premultiply(alpha, applyToRGB = true) {\n if (applyToRGB) {\n this._components[0] *= alpha;\n this._components[1] *= alpha;\n this._components[2] *= alpha;\n }\n this._components[3] = alpha;\n this._refreshInt();\n this._value = null;\n return this;\n }\n /**\n * Returns the color as a 32-bit premultiplied alpha integer.\n *\n * Format: 0xAARRGGBB\n * @param {number} alpha - The alpha value to multiply by (0-1)\n * @param {boolean} [applyToRGB=true] - Whether to premultiply RGB channels\n * @returns {number} The premultiplied color as a 32-bit integer\n * @example\n * ```ts\n * // Convert to premultiplied format\n * const color = new Color('red');\n *\n * // Full opacity (0xFFRRGGBB)\n * color.toPremultiplied(1.0); // 0xFFFF0000\n *\n * // 50% transparency with premultiplied RGB\n * color.toPremultiplied(0.5); // 0x7F7F0000\n *\n * // 50% transparency without RGB premultiplication\n * color.toPremultiplied(0.5, false); // 0x7FFF0000\n * ```\n * @remarks\n * - Returns full opacity (0xFF000000) when alpha is 1.0\n * - Returns 0 when alpha is 0.0 and applyToRGB is true\n * - RGB values are rounded during premultiplication\n */\n toPremultiplied(alpha, applyToRGB = true) {\n if (alpha === 1) {\n return (255 << 24) + this._int;\n }\n if (alpha === 0) {\n return applyToRGB ? 0 : this._int;\n }\n let r = this._int >> 16 & 255;\n let g = this._int >> 8 & 255;\n let b = this._int & 255;\n if (applyToRGB) {\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 * Convert to a hexadecimal string (6 characters).\n * @returns A CSS-compatible hex color string (e.g., \"#ff0000\")\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Basic colors\n * new Color('red').toHex(); // returns \"#ff0000\"\n * new Color('white').toHex(); // returns \"#ffffff\"\n * new Color('black').toHex(); // returns \"#000000\"\n *\n * // From different formats\n * new Color(0xff0000).toHex(); // returns \"#ff0000\"\n * new Color([1, 0, 0]).toHex(); // returns \"#ff0000\"\n * new Color({ r: 1, g: 0, b: 0 }).toHex(); // returns \"#ff0000\"\n * ```\n * @remarks\n * - Always returns a 6-character hex string\n * - Includes leading \"#\" character\n * - Alpha channel is ignored\n * - Values are rounded to nearest hex value\n */\n toHex() {\n const hexString = this._int.toString(16);\n return `#${\"000000\".substring(0, 6 - hexString.length) + hexString}`;\n }\n /**\n * Convert to a hexadecimal string with alpha (8 characters).\n * @returns A CSS-compatible hex color string with alpha (e.g., \"#ff0000ff\")\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Fully opaque colors\n * new Color('red').toHexa(); // returns \"#ff0000ff\"\n * new Color('white').toHexa(); // returns \"#ffffffff\"\n *\n * // With transparency\n * new Color('rgba(255, 0, 0, 0.5)').toHexa(); // returns \"#ff00007f\"\n * new Color([1, 0, 0, 0]).toHexa(); // returns \"#ff000000\"\n * ```\n * @remarks\n * - Returns an 8-character hex string\n * - Includes leading \"#\" character\n * - Alpha is encoded in last two characters\n * - Values are rounded to nearest hex value\n */\n toHexa() {\n const alphaValue = Math.round(this._components[3] * 255);\n const alphaString = alphaValue.toString(16);\n return this.toHex() + \"00\".substring(0, 2 - alphaString.length) + alphaString;\n }\n /**\n * Set alpha (transparency) value while preserving color components.\n *\n * Provides a chainable interface for setting alpha.\n * @param alpha - Alpha value between 0 (fully transparent) and 1 (fully opaque)\n * @returns The Color instance for chaining\n * @example\n * ```ts\n * // Basic alpha setting\n * const color = new Color('red');\n * color.setAlpha(0.5); // 50% transparent red\n *\n * // Chain with other operations\n * color\n * .setValue('#ff0000')\n * .setAlpha(0.8) // 80% opaque\n * .premultiply(0.5); // Further modify alpha\n *\n * // Reset to fully opaque\n * color.setAlpha(1);\n * ```\n * @remarks\n * - Alpha value is clamped between 0-1\n * - Can be chained with other color operations\n */\n setAlpha(alpha) {\n this._components[3] = this._clamp(alpha);\n this._value = null;\n return this;\n }\n /**\n * Normalize the input value into rgba\n * @param value - Input value\n */\n _normalize(value) {\n let r;\n let g;\n let b;\n let a;\n if ((typeof value === \"number\" || value instanceof Number) && value >= 0 && value <= 16777215) {\n const int = value;\n r = (int >> 16 & 255) / 255;\n g = (int >> 8 & 255) / 255;\n b = (int & 255) / 255;\n a = 1;\n } else if ((Array.isArray(value) || value instanceof Float32Array) && value.length >= 3 && value.length <= 4) {\n value = this._clamp(value);\n [r, g, b, a = 1] = value;\n } else if ((value instanceof Uint8Array || value instanceof Uint8ClampedArray) && value.length >= 3 && value.length <= 4) {\n value = this._clamp(value, 0, 255);\n [r, g, b, a = 255] = value;\n r /= 255;\n g /= 255;\n b /= 255;\n a /= 255;\n } else if (typeof value === \"string\" || typeof value === \"object\") {\n if (typeof value === \"string\") {\n const match = _Color.HEX_PATTERN.exec(value);\n if (match) {\n value = `#${match[2]}`;\n }\n }\n const color = colord(value);\n if (color.isValid()) {\n ({ r, g, b, a } = color.rgba);\n r /= 255;\n g /= 255;\n b /= 255;\n }\n }\n if (r !== void 0) {\n this._components[0] = r;\n this._components[1] = g;\n this._components[2] = b;\n this._components[3] = a;\n this._refreshInt();\n } else {\n throw new Error(`Unable to convert color ${value}`);\n }\n }\n /** Refresh the internal color rgb number */\n _refreshInt() {\n this._clamp(this._components);\n const [r, g, b] = this._components;\n this._int = (r * 255 << 16) + (g * 255 << 8) + (b * 255 | 0);\n }\n /**\n * Clamps values to a range. Will override original values\n * @param value - Value(s) to clamp\n * @param min - Minimum value\n * @param max - Maximum value\n */\n _clamp(value, min = 0, max = 1) {\n if (typeof value === \"number\") {\n return Math.min(Math.max(value, min), max);\n }\n value.forEach((v, i) => {\n value[i] = Math.min(Math.max(v, min), max);\n });\n return value;\n }\n /**\n * Check if a value can be interpreted as a valid color format.\n * Supports all color formats that can be used with the Color class.\n * @param value - Value to check\n * @returns True if the value can be used as a color\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // CSS colors and hex values\n * Color.isColorLike('red'); // true\n * Color.isColorLike('#ff0000'); // true\n * Color.isColorLike(0xff0000); // true\n *\n * // Arrays (RGB/RGBA)\n * Color.isColorLike([1, 0, 0]); // true\n * Color.isColorLike([1, 0, 0, 0.5]); // true\n *\n * // TypedArrays\n * Color.isColorLike(new Float32Array([1, 0, 0])); // true\n * Color.isColorLike(new Uint8Array([255, 0, 0])); // true\n * Color.isColorLike(new Uint8ClampedArray([255, 0, 0])); // true\n *\n * // Object formats\n * Color.isColorLike({ r: 1, g: 0, b: 0 }); // true (RGB)\n * Color.isColorLike({ r: 1, g: 0, b: 0, a: 0.5 }); // true (RGBA)\n * Color.isColorLike({ h: 0, s: 100, l: 50 }); // true (HSL)\n * Color.isColorLike({ h: 0, s: 100, l: 50, a: 0.5 }); // true (HSLA)\n * Color.isColorLike({ h: 0, s: 100, v: 100 }); // true (HSV)\n * Color.isColorLike({ h: 0, s: 100, v: 100, a: 0.5 });// true (HSVA)\n *\n * // Color instances\n * Color.isColorLike(new Color('red')); // true\n *\n * // Invalid values\n * Color.isColorLike(null); // false\n * Color.isColorLike(undefined); // false\n * Color.isColorLike({}); // false\n * Color.isColorLike([]); // false\n * Color.isColorLike('not-a-color'); // false\n * ```\n * @remarks\n * Checks for the following formats:\n * - Numbers (0x000000 to 0xffffff)\n * - CSS color strings\n * - RGB/RGBA arrays and objects\n * - HSL/HSLA objects\n * - HSV/HSVA objects\n * - TypedArrays (Float32Array, Uint8Array, Uint8ClampedArray)\n * - Color instances\n * @see {@link ColorSource} For supported color format types\n * @see {@link Color.setValue} For setting color values\n * @category utility\n */\n static isColorLike(value) {\n return typeof value === \"number\" || typeof value === \"string\" || value instanceof Number || value instanceof _Color || Array.isArray(value) || value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Float32Array || value.r !== void 0 && value.g !== void 0 && value.b !== void 0 || value.r !== void 0 && value.g !== void 0 && value.b !== void 0 && value.a !== void 0 || value.h !== void 0 && value.s !== void 0 && value.l !== void 0 || value.h !== void 0 && value.s !== void 0 && value.l !== void 0 && value.a !== void 0 || value.h !== void 0 && value.s !== void 0 && value.v !== void 0 || value.h !== void 0 && value.s !== void 0 && value.v !== void 0 && value.a !== void 0;\n }\n};\n/**\n * Static shared Color instance used for utility operations. This is a singleton color object\n * that can be reused to avoid creating unnecessary Color instances.\n * > [!IMPORTANT] You should be careful when using this shared instance, as it is mutable and can be\n * > changed by any code that uses it.\n * >\n * > It is best used for one-off color operations or temporary transformations.\n * > For persistent colors, create your own Color instance instead.\n * @example\n * ```ts\n * import { Color } from 'pixi.js';\n *\n * // Use shared instance for one-off color operations\n * Color.shared.setValue(0xff0000);\n * const redHex = Color.shared.toHex(); // \"#ff0000\"\n * const redRgb = Color.shared.toRgbArray(); // [1, 0, 0]\n *\n * // Temporary color transformations\n * const colorNumber = Color.shared\n * .setValue('#ff0000') // Set to red\n * .setAlpha(0.5) // Make semi-transparent\n * .premultiply(0.8) // Apply premultiplication\n * .toNumber(); // Convert to number\n *\n * // Chain multiple operations\n * const result = Color.shared\n * .setValue(someColor)\n * .multiply(tintColor)\n * .toPremultiplied(alpha);\n * ```\n * @remarks\n * - This is a shared instance - be careful about multiple code paths using it simultaneously\n * - Use for temporary color operations to avoid allocating new Color instances\n * - The value is preserved between operations, so reset if needed\n * - For persistent colors, create your own Color instance instead\n */\n_Color.shared = new _Color();\n/**\n * Temporary Color object for static uses internally.\n * As to not conflict with Color.shared.\n * @ignore\n */\n_Color._temp = new _Color();\n/** Pattern for hex strings */\n// eslint-disable-next-line @typescript-eslint/naming-convention\n_Color.HEX_PATTERN = /^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;\nlet Color = _Color;\n\nexport { Color };\n//# sourceMappingURL=Color.mjs.map\n","\"use strict\";\nconst cullingMixin = {\n cullArea: null,\n cullable: false,\n cullableChildren: true\n};\n\nexport { cullingMixin };\n//# sourceMappingURL=cullingMixin.mjs.map\n","\"use strict\";\nlet warnCount = 0;\nconst maxWarnings = 500;\nfunction warn(...args) {\n if (warnCount === maxWarnings) return;\n warnCount++;\n if (warnCount === maxWarnings) {\n console.warn(\"PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS.\");\n } else {\n console.warn(\"PixiJS Warning: \", ...args);\n }\n}\n\nexport { warn };\n//# sourceMappingURL=warn.mjs.map\n","\"use strict\";\nconst GlobalResourceRegistry = {\n /**\n * Set of registered pools and cleanable objects.\n * @private\n */\n _registeredResources: /* @__PURE__ */ new Set(),\n /**\n * Registers a pool or cleanable object for cleanup.\n * @param {Cleanable} pool - The pool or object to register.\n */\n register(pool) {\n this._registeredResources.add(pool);\n },\n /**\n * Unregisters a pool or cleanable object from cleanup.\n * @param {Cleanable} pool - The pool or object to unregister.\n */\n unregister(pool) {\n this._registeredResources.delete(pool);\n },\n /** Clears all registered pools and cleanable objects. This will call clear() on each registered item. */\n release() {\n this._registeredResources.forEach((pool) => pool.clear());\n },\n /**\n * Gets the number of registered pools and cleanable objects.\n * @returns {number} The count of registered items.\n */\n get registeredCount() {\n return this._registeredResources.size;\n },\n /**\n * Checks if a specific pool or cleanable object is registered.\n * @param {Cleanable} pool - The pool or object to check.\n * @returns {boolean} True if the item is registered, false otherwise.\n */\n isRegistered(pool) {\n return this._registeredResources.has(pool);\n },\n /**\n * Removes all registrations without clearing the pools.\n * Useful if you want to reset the collector without affecting the pools.\n */\n reset() {\n this._registeredResources.clear();\n }\n};\n\nexport { GlobalResourceRegistry };\n//# sourceMappingURL=GlobalResourceRegistry.mjs.map\n","\"use strict\";\nclass Pool {\n /**\n * Constructs a new Pool.\n * @param ClassType - The constructor of the items in the pool.\n * @param {number} [initialSize] - The initial size of the pool.\n */\n constructor(ClassType, initialSize) {\n this._pool = [];\n this._count = 0;\n this._index = 0;\n this._classType = ClassType;\n if (initialSize) {\n this.prepopulate(initialSize);\n }\n }\n /**\n * Prepopulates the pool with a given number of items.\n * @param total - The number of items to add to the pool.\n */\n prepopulate(total) {\n for (let i = 0; i < total; i++) {\n this._pool[this._index++] = new this._classType();\n }\n this._count += total;\n }\n /**\n * Gets an item from the pool. Calls the item's `init` method if it exists.\n * If there are no items left in the pool, a new one will be created.\n * @param {I} [data] - Optional data to pass to the item's constructor.\n * @returns {T} The item from the pool.\n */\n get(data) {\n let item;\n if (this._index > 0) {\n item = this._pool[--this._index];\n } else {\n item = new this._classType();\n this._count++;\n }\n item.init?.(data);\n return item;\n }\n /**\n * Returns an item to the pool. Calls the item's `reset` method if it exists.\n * @param {T} item - The item to return to the pool.\n */\n return(item) {\n item.reset?.();\n this._pool[this._index++] = item;\n }\n /**\n * Gets the number of items in the pool.\n * @readonly\n */\n get totalSize() {\n return this._count;\n }\n /**\n * Gets the number of items in the pool that are free to use without needing to create more.\n * @readonly\n */\n get totalFree() {\n return this._index;\n }\n /**\n * Gets the number of items in the pool that are currently in use.\n * @readonly\n */\n get totalUsed() {\n return this._count - this._index;\n }\n /** clears the pool */\n clear() {\n if (this._pool.length > 0 && this._pool[0].destroy) {\n for (let i = 0; i < this._index; i++) {\n this._pool[i].destroy();\n }\n }\n this._pool.length = 0;\n this._count = 0;\n this._index = 0;\n }\n}\n\nexport { Pool };\n//# sourceMappingURL=Pool.mjs.map\n","import { GlobalResourceRegistry } from './GlobalResourceRegistry.mjs';\nimport { Pool } from './Pool.mjs';\n\n\"use strict\";\nclass PoolGroupClass {\n constructor() {\n /**\n * A map to store the pools by their class type.\n * @private\n */\n this._poolsByClass = /* @__PURE__ */ new Map();\n }\n /**\n * Prepopulates a specific pool with a given number of items.\n * @template T The type of items in the pool. Must extend PoolItem.\n * @param {PoolItemConstructor<T>} Class - The constructor of the items in the pool.\n * @param {number} total - The number of items to add to the pool.\n */\n prepopulate(Class, total) {\n const classPool = this.getPool(Class);\n classPool.prepopulate(total);\n }\n /**\n * Gets an item from a specific pool.\n * @template T The type of items in the pool. Must extend PoolItem.\n * @param {PoolItemConstructor<T>} Class - The constructor of the items in the pool.\n * @param {unknown} [data] - Optional data to pass to the item's constructor.\n * @returns {T} The item from the pool.\n */\n get(Class, data) {\n const pool = this.getPool(Class);\n return pool.get(data);\n }\n /**\n * Returns an item to its respective pool.\n * @param {PoolItem} item - The item to return to the pool.\n */\n return(item) {\n const pool = this.getPool(item.constructor);\n pool.return(item);\n }\n /**\n * Gets a specific pool based on the class type.\n * @template T The type of items in the pool. Must extend PoolItem.\n * @param {PoolItemConstructor<T>} ClassType - The constructor of the items in the pool.\n * @returns {Pool<T>} The pool of the given class type.\n */\n getPool(ClassType) {\n if (!this._poolsByClass.has(ClassType)) {\n this._poolsByClass.set(ClassType, new Pool(ClassType));\n }\n return this._poolsByClass.get(ClassType);\n }\n /** gets the usage stats of each pool in the system */\n stats() {\n const stats = {};\n this._poolsByClass.forEach((pool) => {\n const name = stats[pool._classType.name] ? pool._classType.name + pool._classType.ID : pool._classType.name;\n stats[name] = {\n free: pool.totalFree,\n used: pool.totalUsed,\n size: pool.totalSize\n };\n });\n return stats;\n }\n /** Clears all pools in the group. This will reset all pools and free their resources. */\n clear() {\n this._poolsByClass.forEach((pool) => pool.clear());\n this._poolsByClass.clear();\n }\n}\nconst BigPool = new PoolGroupClass();\nGlobalResourceRegistry.register(BigPool);\n\nexport { BigPool, PoolGroupClass };\n//# sourceMappingURL=PoolGroup.mjs.map\n","import { deprecation } from '../../../utils/logging/deprecation.mjs';\n\n\"use strict\";\nconst cacheAsTextureMixin = {\n get isCachedAsTexture() {\n return !!this.renderGroup?.isCachedAsTexture;\n },\n cacheAsTexture(val) {\n if (typeof val === \"boolean\" && val === false) {\n this.disableRenderGroup();\n } else {\n this.enableRenderGroup();\n this.renderGroup.enableCacheAsTexture(val === true ? {} : val);\n }\n },\n updateCacheTexture() {\n this.renderGroup?.updateCacheTexture();\n },\n get cacheAsBitmap() {\n return this.isCachedAsTexture;\n },\n set cacheAsBitmap(val) {\n deprecation(\"v8.6.0\", \"cacheAsBitmap is deprecated, use cacheAsTexture instead.\");\n this.cacheAsTexture(val);\n }\n};\n\nexport { cacheAsTextureMixin };\n//# sourceMappingURL=cacheAsTextureMixin.mjs.map\n","\"use strict\";\nfunction removeItems(arr, startIdx, removeCount) {\n const length = arr.length;\n let i;\n if (startIdx >= length || removeCount === 0) {\n return;\n }\n removeCount = startIdx + removeCount > length ? length - startIdx : removeCount;\n const len = length - removeCount;\n for (i = startIdx; i < len; ++i) {\n arr[i] = arr[i + removeCount];\n }\n arr.length = len;\n}\n\nexport { removeItems };\n//# sourceMappingURL=removeItems.mjs.map\n","import { removeItems } from '../../../utils/data/removeItems.mjs';\nimport { deprecation, v8_0_0 } from '../../../utils/logging/deprecation.mjs';\n\n\"use strict\";\nconst childrenHelperMixin = {\n allowChildren: true,\n removeChildren(beginIndex = 0, endIndex) {\n const end = endIndex ?? this.children.length;\n const range = end - beginIndex;\n const removed = [];\n if (range > 0 && range <= end) {\n for (let i = end - 1; i >= beginIndex; i--) {\n const child = this.children[i];\n if (!child) continue;\n removed.push(child);\n child.parent = null;\n }\n removeItems(this.children, beginIndex, end);\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n if (renderGroup) {\n renderGroup.removeChildren(removed);\n }\n for (let i = 0; i < removed.length; ++i) {\n const child = removed[i];\n child.parentRenderLayer?.detach(child);\n this.emit(\"childRemoved\", child, this, i);\n removed[i].emit(\"removed\", this);\n }\n if (removed.length > 0) {\n this._didViewChangeTick++;\n }\n return removed;\n } else if (range === 0 && this.children.length === 0) {\n return removed;\n }\n throw new RangeError(\"removeChildren: numeric values are outside the acceptable range.\");\n },\n removeChildAt(index) {\n const child = this.getChildAt(index);\n return this.removeChild(child);\n },\n getChildAt(index) {\n if (index < 0 || index >= this.children.length) {\n throw new Error(`getChildAt: Index (${index}) does not exist.`);\n }\n return this.children[index];\n },\n setChildIndex(child, index) {\n if (index < 0 || index >= this.children.length) {\n throw new Error(`The index ${index} supplied is out of bounds ${this.children.length}`);\n }\n this.getChildIndex(child);\n this.addChildAt(child, index);\n },\n getChildIndex(child) {\n const index = this.children.indexOf(child);\n if (index === -1) {\n throw new Error(\"The supplied Container must be a child of the caller\");\n }\n return index;\n },\n addChildAt(child, index) {\n if (!this.allowChildren) {\n deprecation(v8_0_0, \"addChildAt: Only Containers will be allowed to add children in v8.0.0\");\n }\n const { children } = this;\n if (index < 0 || index > children.length) {\n throw new Error(`${child}addChildAt: The index ${index} supplied is out of bounds ${children.length}`);\n }\n const sameParent = child.parent === this;\n if (child.parent) {\n const currentIndex = child.parent.children.indexOf(child);\n if (sameParent) {\n if (currentIndex === index) {\n return child;\n }\n child.parent.children.splice(currentIndex, 1);\n } else {\n child.removeFromParent();\n }\n }\n if (index === children.length) {\n children.push(child);\n } else {\n children.splice(index, 0, child);\n }\n child.parent = this;\n child.didChange = true;\n child._updateFlags = 15;\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n if (renderGroup) {\n renderGroup.addChild(child);\n }\n if (this.sortableChildren) this.sortDirty = true;\n if (sameParent) {\n return child;\n }\n this.emit(\"childAdded\", child, this, index);\n child.emit(\"added\", this);\n return child;\n },\n swapChildren(child, child2) {\n if (child === child2) {\n return;\n }\n const index1 = this.getChildIndex(child);\n const index2 = this.getChildIndex(child2);\n this.children[index1] = child2;\n this.children[index2] = child;\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n if (renderGroup) {\n renderGroup.structureDidChange = true;\n }\n this._didContainerChangeTick++;\n },\n removeFromParent() {\n this.parent?.removeChild(this);\n },\n reparentChild(...child) {\n if (child.length === 1) {\n return this.reparentChildAt(child[0], this.children.length);\n }\n child.forEach((c) => this.reparentChildAt(c, this.children.length));\n return child[0];\n },\n reparentChildAt(child, index) {\n if (child.parent === this) {\n this.setChildIndex(child, index);\n return child;\n }\n const childMat = child.worldTransform.clone();\n child.removeFromParent();\n this.addChildAt(child, index);\n const newMatrix = this.worldTransform.clone();\n newMatrix.invert();\n childMat.prepend(newMatrix);\n child.setFromMatrix(childMat);\n return child;\n },\n replaceChild(oldChild, newChild) {\n oldChild.updateLocalTransform();\n this.addChildAt(newChild, this.getChildIndex(oldChild));\n newChild.setFromMatrix(oldChild.localTransform);\n newChild.updateLocalTransform();\n this.removeChild(oldChild);\n }\n};\n\nexport { childrenHelperMixin };\n//# sourceMappingURL=childrenHelperMixin.mjs.map\n","\"use strict\";\nconst collectRenderablesMixin = {\n collectRenderables(instructionSet, renderer, currentLayer) {\n if (this.parentRenderLayer && this.parentRenderLayer !== currentLayer || this.globalDisplayStatus < 7 || !this.includeInBuild) return;\n if (this.sortableChildren) {\n this.sortChildren();\n }\n if (this.isSimple) {\n this.collectRenderablesSimple(instructionSet, renderer, currentLayer);\n } else if (this.renderGroup) {\n renderer.renderPipes.renderGroup.addRenderGroup(this.renderGroup, instructionSet);\n } else {\n this.collectRenderablesWithEffects(instructionSet, renderer, currentLayer);\n }\n },\n collectRenderablesSimple(instructionSet, renderer, currentLayer) {\n const children = this.children;\n const length = children.length;\n for (let i = 0; i < length; i++) {\n children[i].collectRenderables(instructionSet, renderer, currentLayer);\n }\n },\n collectRenderablesWithEffects(instructionSet, renderer, currentLayer) {\n const { renderPipes } = renderer;\n for (let i = 0; i < this.effects.length; i++) {\n const effect = this.effects[i];\n const pipe = renderPipes[effect.pipe];\n pipe.push(effect, this, instructionSet);\n }\n this.collectRenderablesSimple(instructionSet, renderer, currentLayer);\n for (let i = this.effects.length - 1; i >= 0; i--) {\n const effect = this.effects[i];\n const pipe = renderPipes[effect.pipe];\n pipe.pop(effect, this, instructionSet);\n }\n }\n};\n\nexport { collectRenderablesMixin };\n//# sourceMappingURL=collectRenderablesMixin.mjs.map\n","\"use strict\";\nclass FilterEffect {\n constructor() {\n /** the pipe that knows how to handle this effect */\n this.pipe = \"filter\";\n /** the priority of this effect */\n this.priority = 1;\n }\n destroy() {\n for (let i = 0; i < this.filters.length; i++) {\n this.filters[i].destroy();\n }\n this.filters = null;\n this.filterArea = null;\n }\n}\n\nexport { FilterEffect };\n//# sourceMappingURL=FilterEffect.mjs.map\n","import { extensions, ExtensionType } from '../../extensions/Extensions.mjs';\nimport { BigPool } from '../../utils/pool/PoolGroup.mjs';\n\n\"use strict\";\nclass MaskEffectManagerClass {\n constructor() {\n /** @private */\n this._effectClasses = [];\n this._tests = [];\n this._initialized = false;\n }\n init() {\n if (this._initialized) return;\n this._initialized = true;\n this._effectClasses.forEach((test) => {\n this.add({\n test: test.test,\n maskClass: test\n });\n });\n }\n add(test) {\n this._tests.push(test);\n }\n getMaskEffect(item) {\n if (!this._initialized) this.init();\n for (let i = 0; i < this._tests.length; i++) {\n const test = this._tests[i];\n if (test.test(item)) {\n return BigPool.get(test.maskClass, item);\n }\n }\n return item;\n }\n returnMaskEffect(effect) {\n BigPool.return(effect);\n }\n}\nconst MaskEffectManager = new MaskEffectManagerClass();\nextensions.handleByList(ExtensionType.MaskEffect, MaskEffectManager._effectClasses);\n\nexport { MaskEffectManager, MaskEffectManagerClass };\n//# sourceMappingURL=MaskEffectManager.mjs.map\n","import { FilterEffect } from '../../../filters/FilterEffect.mjs';\nimport { MaskEffectManager } from '../../../rendering/mask/MaskEffectManager.mjs';\n\n\"use strict\";\nconst effectsMixin = {\n _maskEffect: null,\n _maskOptions: {\n inverse: false,\n channel: \"red\"\n },\n _filterEffect: null,\n effects: [],\n _markStructureAsChanged() {\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n if (renderGroup) {\n renderGroup.structureDidChange = true;\n }\n },\n addEffect(effect) {\n const index = this.effects.indexOf(effect);\n if (index !== -1) return;\n this.effects.push(effect);\n this.effects.sort((a, b) => a.priority - b.priority);\n this._markStructureAsChanged();\n this._updateIsSimple();\n },\n removeEffect(effect) {\n const index = this.effects.indexOf(effect);\n if (index === -1) return;\n this.effects.splice(index, 1);\n this._markStructureAsChanged();\n this._updateIsSimple();\n },\n set mask(value) {\n const effect = this._maskEffect;\n if (effect?.mask === value) return;\n if (effect) {\n this.removeEffect(effect);\n MaskEffectManager.returnMaskEffect(effect);\n this._maskEffect = null;\n }\n if (value === null || value === void 0) return;\n this._maskEffect = MaskEffectManager.getMaskEffect(value);\n this.addEffect(this._maskEffect);\n },\n get mask() {\n return this._maskEffect?.mask;\n },\n setMask(options) {\n this._maskOptions = {\n ...this._maskOptions,\n ...options\n };\n if (options.mask) {\n this.mask = options.mask;\n }\n this._markStructureAsChanged();\n },\n set filters(value) {\n if (!Array.isArray(value) && value) value = [value];\n const effect = this._filterEffect || (this._filterEffect = new FilterEffect());\n value = value;\n const hasFilters = value?.length > 0;\n const hadFilters = effect.filters?.length > 0;\n const didChange = hasFilters !== hadFilters;\n value = Array.isArray(value) ? value.slice(0) : value;\n effect.filters = Object.freeze(value);\n if (didChange) {\n if (hasFilters) {\n this.addEffect(effect);\n } else {\n this.removeEffect(effect);\n effect.filters = value ?? null;\n }\n }\n },\n get filters() {\n return this._filterEffect?.filters;\n },\n set filterArea(value) {\n this._filterEffect || (this._filterEffect = new FilterEffect());\n this._filterEffect.filterArea = value;\n },\n get filterArea() {\n return this._filterEffect?.filterArea;\n }\n};\n\nexport { effectsMixin };\n//# sourceMappingURL=effectsMixin.mjs.map\n","import { deprecation, v8_0_0 } from '../../../utils/logging/deprecation.mjs';\n\n\"use strict\";\nconst findMixin = {\n label: null,\n get name() {\n deprecation(v8_0_0, \"Container.name property has been removed, use Container.label instead\");\n return this.label;\n },\n set name(value) {\n deprecation(v8_0_0, \"Container.name property has been removed, use Container.label instead\");\n this.label = value;\n },\n getChildByName(name, deep = false) {\n return this.getChildByLabel(name, deep);\n },\n getChildByLabel(label, deep = false) {\n const children = this.children;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (child.label === label || label instanceof RegExp && label.test(child.label)) return child;\n }\n if (deep) {\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const found = child.getChildByLabel(label, true);\n if (found) {\n return found;\n }\n }\n }\n return null;\n },\n getChildrenByLabel(label, deep = false, out = []) {\n const children = this.children;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (child.label === label || label instanceof RegExp && label.test(child.label)) {\n out.push(child);\n }\n }\n if (deep) {\n for (let i = 0; i < children.length; i++) {\n children[i].getChildrenByLabel(label, true, out);\n }\n }\n return out;\n }\n};\n\nexport { findMixin };\n//# sourceMappingURL=findMixin.mjs.map\n","import { Matrix } from '../../../../maths/matrix/Matrix.mjs';\nimport { BigPool } from '../../../../utils/pool/PoolGroup.mjs';\nimport { Bounds } from '../Bounds.mjs';\n\n\"use strict\";\nconst matrixPool = BigPool.getPool(Matrix);\nconst boundsPool = BigPool.getPool(Bounds);\n\nexport { boundsPool, matrixPool };\n//# sourceMappingURL=matrixAndBoundsPool.mjs.map\n","import { Matrix } from '../../../maths/matrix/Matrix.mjs';\nimport { Bounds } from '../bounds/Bounds.mjs';\nimport { boundsPool } from '../bounds/utils/matrixAndBoundsPool.mjs';\n\n\"use strict\";\nconst tempMatrix = new Matrix();\nconst getFastGlobalBoundsMixin = {\n getFastGlobalBounds(factorRenderLayers, bounds) {\n bounds || (bounds = new Bounds());\n bounds.clear();\n this._getGlobalBoundsRecursive(!!factorRenderLayers, bounds, this.parentRenderLayer);\n if (!bounds.isValid) {\n bounds.set(0, 0, 0, 0);\n }\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n bounds.applyMatrix(renderGroup.worldTransform);\n return bounds;\n },\n _getGlobalBoundsRecursive(factorRenderLayers, bounds, currentLayer) {\n let localBounds = bounds;\n if (factorRenderLayers && this.parentRenderLayer && this.parentRenderLayer !== currentLayer) return;\n if (this.localDisplayStatus !== 7 || !this.measurable) {\n return;\n }\n const manageEffects = !!this.effects.length;\n if (this.renderGroup || manageEffects) {\n localBounds = boundsPool.get().clear();\n }\n if (this.boundsArea) {\n bounds.addRect(this.boundsArea, this.worldTransform);\n } else {\n if (this.renderPipeId) {\n const viewBounds = this.bounds;\n localBounds.addFrame(\n viewBounds.minX,\n viewBounds.minY,\n viewBounds.maxX,\n viewBounds.maxY,\n this.groupTransform\n );\n }\n const children = this.children;\n for (let i = 0; i < children.length; i++) {\n children[i]._getGlobalBoundsRecursive(factorRenderLayers, localBounds, currentLayer);\n }\n }\n if (manageEffects) {\n let advanced = false;\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n for (let i = 0; i < this.effects.length; i++) {\n if (this.effects[i].addBounds) {\n if (!advanced) {\n advanced = true;\n localBounds.applyMatrix(renderGroup.worldTransform);\n }\n this.effects[i].addBounds(localBounds, true);\n }\n }\n if (advanced) {\n localBounds.applyMatrix(renderGroup.worldTransform.copyTo(tempMatrix).invert());\n }\n bounds.addBounds(localBounds);\n boundsPool.return(localBounds);\n } else if (this.renderGroup) {\n bounds.addBounds(localBounds, this.relativeGroupTransform);\n boundsPool.return(localBounds);\n }\n }\n};\n\nexport { getFastGlobalBoundsMixin };\n//# sourceMappingURL=getFastGlobalBoundsMixin.mjs.map\n","import { Matrix } from '../../../maths/matrix/Matrix.mjs';\nimport { matrixPool, boundsPool } from './utils/matrixAndBoundsPool.mjs';\n\n\"use strict\";\nfunction getGlobalBounds(target, skipUpdateTransform, bounds) {\n bounds.clear();\n let parentTransform;\n let pooledMatrix;\n if (target.parent) {\n if (!skipUpdateTransform) {\n pooledMatrix = matrixPool.get().identity();\n parentTransform = updateTransformBackwards(target, pooledMatrix);\n } else {\n parentTransform = target.parent.worldTransform;\n }\n } else {\n parentTransform = Matrix.IDENTITY;\n }\n _getGlobalBounds(target, bounds, parentTransform, skipUpdateTransform);\n if (pooledMatrix) {\n matrixPool.return(pooledMatrix);\n }\n if (!bounds.isValid) {\n bounds.set(0, 0, 0, 0);\n }\n return bounds;\n}\nfunction _getGlobalBounds(target, bounds, parentTransform, skipUpdateTransform) {\n if (!target.visible || !target.measurable) return;\n let worldTransform;\n if (!skipUpdateTransform) {\n target.updateLocalTransform();\n worldTransform = matrixPool.get();\n worldTransform.appendFrom(target.localTransform, parentTransform);\n } else {\n worldTransform = target.worldTransform;\n }\n const parentBounds = bounds;\n const preserveBounds = !!target.effects.length;\n if (preserveBounds) {\n bounds = boundsPool.get().clear();\n }\n if (target.boundsArea) {\n bounds.addRect(target.boundsArea, worldTransform);\n } else {\n const renderableBounds = target.bounds;\n if (renderableBounds && !renderableBounds.isEmpty()) {\n bounds.matrix = worldTransform;\n bounds.addBounds(renderableBounds);\n }\n for (let i = 0; i < target.children.length; i++) {\n _getGlobalBounds(target.children[i], bounds, worldTransform, skipUpdateTransform);\n }\n }\n if (preserveBounds) {\n for (let i = 0; i < target.effects.length; i++) {\n target.effects[i].addBounds?.(bounds);\n }\n parentBounds.addBounds(bounds, Matrix.IDENTITY);\n boundsPool.return(bounds);\n }\n if (!skipUpdateTransform) {\n matrixPool.return(worldTransform);\n }\n}\nfunction updateTransformBackwards(target, parentTransform) {\n const parent = target.parent;\n if (parent) {\n updateTransformBackwards(parent, parentTransform);\n parent.updateLocalTransform();\n parentTransform.append(parent.localTransform);\n }\n return parentTransform;\n}\n\nexport { getGlobalBounds, updateTransformBackwards };\n//# sourceMappingURL=getGlobalBounds.mjs.map\n","\"use strict\";\nfunction multiplyHexColors(color1, color2) {\n if (color1 === 16777215 || !color2) return color2;\n if (color2 === 16777215 || !color1) return color1;\n const r1 = color1 >> 16 & 255;\n const g1 = color1 >> 8 & 255;\n const b1 = color1 & 255;\n const r2 = color2 >> 16 & 255;\n const g2 = color2 >> 8 & 255;\n const b2 = color2 & 255;\n const r = r1 * r2 / 255 | 0;\n const g = g1 * g2 / 255 | 0;\n const b = b1 * b2 / 255 | 0;\n return (r << 16) + (g << 8) + b;\n}\n\nexport { multiplyHexColors };\n//# sourceMappingURL=multiplyHexColors.mjs.map\n","import { multiplyHexColors } from './multiplyHexColors.mjs';\n\n\"use strict\";\nconst WHITE_BGR = 16777215;\nfunction multiplyColors(localBGRColor, parentBGRColor) {\n if (localBGRColor === WHITE_BGR) {\n return parentBGRColor;\n }\n if (parentBGRColor === WHITE_BGR) {\n return localBGRColor;\n }\n return multiplyHexColors(localBGRColor, parentBGRColor);\n}\n\nexport { multiplyColors };\n//# sourceMappingURL=multiplyColors.mjs.map\n","import { Matrix } from '../../../maths/matrix/Matrix.mjs';\nimport { updateTransformBackwards } from '../bounds/getGlobalBounds.mjs';\nimport { matrixPool } from '../bounds/utils/matrixAndBoundsPool.mjs';\nimport { multiplyColors } from '../utils/multiplyColors.mjs';\n\n\"use strict\";\nfunction bgr2rgb(color) {\n return ((color & 255) << 16) + (color & 65280) + (color >> 16 & 255);\n}\nconst getGlobalMixin = {\n getGlobalAlpha(skipUpdate) {\n if (skipUpdate) {\n if (this.renderGroup) {\n return this.renderGroup.worldAlpha;\n }\n if (this.parentRenderGroup) {\n return this.parentRenderGroup.worldAlpha * this.alpha;\n }\n return this.alpha;\n }\n let alpha = this.alpha;\n let current = this.parent;\n while (current) {\n alpha *= current.alpha;\n current = current.parent;\n }\n return alpha;\n },\n getGlobalTransform(matrix = new Matrix(), skipUpdate) {\n if (skipUpdate) {\n return matrix.copyFrom(this.worldTransform);\n }\n this.updateLocalTransform();\n const parentTransform = updateTransformBackwards(this, matrixPool.get().identity());\n matrix.appendFrom(this.localTransform, parentTransform);\n matrixPool.return(parentTransform);\n return matrix;\n },\n getGlobalTint(skipUpdate) {\n if (skipUpdate) {\n if (this.renderGroup) {\n return bgr2rgb(this.renderGroup.worldColor);\n }\n if (this.parentRenderGroup) {\n return bgr2rgb(\n multiplyColors(this.localColor, this.parentRenderGroup.worldColor)\n );\n }\n return this.tint;\n }\n let color = this.localColor;\n let parent = this.parent;\n while (parent) {\n color = multiplyColors(color, parent.localColor);\n parent = parent.parent;\n }\n return bgr2rgb(color);\n }\n};\n\nexport { bgr2rgb, getGlobalMixin };\n//# sourceMappingURL=getGlobalMixin.mjs.map\n","import { Matrix } from '../../../maths/matrix/Matrix.mjs';\nimport { matrixPool, boundsPool } from './utils/matrixAndBoundsPool.mjs';\n\n\"use strict\";\nfunction getLocalBounds(target, bounds, relativeMatrix) {\n bounds.clear();\n relativeMatrix || (relativeMatrix = Matrix.IDENTITY);\n _getLocalBounds(target, bounds, relativeMatrix, target, true);\n if (!bounds.isValid) {\n bounds.set(0, 0, 0, 0);\n }\n return bounds;\n}\nfunction _getLocalBounds(target, bounds, parentTransform, rootContainer, isRoot) {\n let relativeTransform;\n if (!isRoot) {\n if (!target.visible || !target.measurable) return;\n target.updateLocalTransform();\n const localTransform = target.localTransform;\n relativeTransform = matrixPool.get();\n relativeTransform.appendFrom(localTransform, parentTransform);\n } else {\n relativeTransform = matrixPool.get();\n relativeTransform = parentTransform.copyTo(relativeTransform);\n }\n const parentBounds = bounds;\n const preserveBounds = !!target.effects.length;\n if (preserveBounds) {\n bounds = boundsPool.get().clear();\n }\n if (target.boundsArea) {\n bounds.addRect(target.boundsArea, relativeTransform);\n } else {\n if (target.renderPipeId) {\n bounds.matrix = relativeTransform;\n bounds.addBounds(target.bounds);\n }\n const children = target.children;\n for (let i = 0; i < children.length; i++) {\n _getLocalBounds(children[i], bounds, relativeTransform, rootContainer, false);\n }\n }\n if (preserveBounds) {\n for (let i = 0; i < target.effects.length; i++) {\n target.effects[i].addLocalBounds?.(bounds, rootContainer);\n }\n parentBounds.addBounds(bounds, Matrix.IDENTITY);\n boundsPool.return(bounds);\n }\n matrixPool.return(relativeTransform);\n}\n\nexport { getLocalBounds };\n//# sourceMappingURL=getLocalBounds.mjs.map\n","\"use strict\";\nfunction checkChildrenDidChange(container, previousData) {\n const children = container.children;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const uid = child.uid;\n const didChange = (child._didViewChangeTick & 65535) << 16 | child._didContainerChangeTick & 65535;\n const index = previousData.index;\n if (previousData.data[index] !== uid || previousData.data[index + 1] !== didChange) {\n previousData.data[previousData.index] = uid;\n previousData.data[previousData.index + 1] = didChange;\n previousData.didChange = true;\n }\n previousData.index = index + 2;\n if (child.children.length) {\n checkChildrenDidChange(child, previousData);\n }\n }\n return previousData.didChange;\n}\n\nexport { checkChildrenDidChange };\n//# sourceMappingURL=checkChildrenDidChange.mjs.map\n","import { Matrix } from '../../../maths/matrix/Matrix.mjs';\nimport { Bounds } from '../bounds/Bounds.mjs';\nimport { getGlobalBounds } from '../bounds/getGlobalBounds.mjs';\nimport { getLocalBounds } from '../bounds/getLocalBounds.mjs';\nimport { checkChildrenDidChange } from '../utils/checkChildrenDidChange.mjs';\n\n\"use strict\";\nconst tempMatrix = new Matrix();\nconst measureMixin = {\n _localBoundsCacheId: -1,\n _localBoundsCacheData: null,\n _setWidth(value, localWidth) {\n const sign = Math.sign(this.scale.x) || 1;\n if (localWidth !== 0) {\n this.scale.x = value / localWidth * sign;\n } else {\n this.scale.x = sign;\n }\n },\n _setHeight(value, localHeight) {\n const sign = Math.sign(this.scale.y) || 1;\n if (localHeight !== 0) {\n this.scale.y = value / localHeight * sign;\n } else {\n this.scale.y = sign;\n }\n },\n getLocalBounds() {\n if (!this._localBoundsCacheData) {\n this._localBoundsCacheData = {\n data: [],\n index: 1,\n didChange: false,\n localBounds: new Bounds()\n };\n }\n const localBoundsCacheData = this._localBoundsCacheData;\n localBoundsCacheData.index = 1;\n localBoundsCacheData.didChange = false;\n if (localBoundsCacheData.data[0] !== this._didViewChangeTick) {\n localBoundsCacheData.didChange = true;\n localBoundsCacheData.data[0] = this._didViewChangeTick;\n }\n checkChildrenDidChange(this, localBoundsCacheData);\n if (localBoundsCacheData.didChange) {\n getLocalBounds(this, localBoundsCacheData.localBounds, tempMatrix);\n }\n return localBoundsCacheData.localBounds;\n },\n getBounds(skipUpdate, bounds) {\n return getGlobalBounds(this, skipUpdate, bounds || new Bounds());\n }\n};\n\nexport { measureMixin };\n//# sourceMappingURL=measureMixin.mjs.map\n","\"use strict\";\nconst onRenderMixin = {\n _onRender: null,\n set onRender(func) {\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n if (!func) {\n if (this._onRender) {\n renderGroup?.removeOnRender(this);\n }\n this._onRender = null;\n return;\n }\n if (!this._onRender) {\n renderGroup?.addOnRender(this);\n }\n this._onRender = func;\n },\n get onRender() {\n return this._onRender;\n }\n};\n\nexport { onRenderMixin };\n//# sourceMappingURL=onRenderMixin.mjs.map\n","\"use strict\";\nconst sortMixin = {\n _zIndex: 0,\n sortDirty: false,\n sortableChildren: false,\n get zIndex() {\n return this._zIndex;\n },\n set zIndex(value) {\n if (this._zIndex === value) return;\n this._zIndex = value;\n this.depthOfChildModified();\n },\n depthOfChildModified() {\n if (this.parent) {\n this.parent.sortableChildren = true;\n this.parent.sortDirty = true;\n }\n if (this.parentRenderGroup) {\n this.parentRenderGroup.structureDidChange = true;\n }\n },\n sortChildren() {\n if (!this.sortDirty) return;\n this.sortDirty = false;\n this.children.sort(sortChildren);\n }\n};\nfunction sortChildren(a, b) {\n return a._zIndex - b._zIndex;\n}\n\nexport { sortMixin };\n//# sourceMappingURL=sortMixin.mjs.map\n","import { Point } from '../../../maths/point/Point.mjs';\nimport { matrixPool } from '../bounds/utils/matrixAndBoundsPool.mjs';\n\n\"use strict\";\nconst toLocalGlobalMixin = {\n getGlobalPosition(point = new Point(), skipUpdate = false) {\n if (this.parent) {\n this.parent.toGlobal(this._position, point, skipUpdate);\n } else {\n point.x = this._position.x;\n point.y = this._position.y;\n }\n return point;\n },\n toGlobal(position, point, skipUpdate = false) {\n const globalMatrix = this.getGlobalTransform(matrixPool.get(), skipUpdate);\n point = globalMatrix.apply(position, point);\n matrixPool.return(globalMatrix);\n return point;\n },\n toLocal(position, from, point, skipUpdate) {\n if (from) {\n position = from.toGlobal(position, point, skipUpdate);\n }\n const globalMatrix = this.getGlobalTransform(matrixPool.get(), skipUpdate);\n point = globalMatrix.applyInverse(position, point);\n matrixPool.return(globalMatrix);\n return point;\n }\n};\n\nexport { toLocalGlobalMixin };\n//# sourceMappingURL=toLocalGlobalMixin.mjs.map\n","import { uid } from '../../../../utils/data/uid.mjs';\n\n\"use strict\";\nclass InstructionSet {\n constructor() {\n /** a unique id for this instruction set used through the renderer */\n this.uid = uid(\"instructionSet\");\n /** the array of instructions */\n this.instructions = [];\n /** the actual size of the array (any instructions passed this should be ignored) */\n this.instructionSize = 0;\n this.renderables = [];\n /** used by the garbage collector to track when the instruction set was last used */\n this.gcTick = 0;\n }\n /** reset the instruction set so it can be reused set size back to 0 */\n reset() {\n this.instructionSize = 0;\n }\n /**\n * Destroy the instruction set, clearing the instructions and renderables.\n * @internal\n */\n destroy() {\n this.instructions.length = 0;\n this.renderables.length = 0;\n this.renderPipes = null;\n this.gcTick = 0;\n }\n /**\n * Add an instruction to the set\n * @param instruction - add an instruction to the set\n */\n add(instruction) {\n this.instructions[this.instructionSize++] = instruction;\n }\n /**\n * Log the instructions to the console (for debugging)\n * @internal\n */\n log() {\n this.instructions.length = this.instructionSize;\n console.table(this.instructions, [\"type\", \"action\"]);\n }\n}\n\nexport { InstructionSet };\n//# sourceMappingURL=InstructionSet.mjs.map\n","import { nextPow2 } from '../../../../maths/misc/pow2.mjs';\nimport { GlobalResourceRegistry } from '../../../../utils/pool/GlobalResourceRegistry.mjs';\nimport { TextureSource } from './sources/TextureSource.mjs';\nimport { Texture } from './Texture.mjs';\nimport { TextureStyle } from './TextureStyle.mjs';\n\n\"use strict\";\nlet count = 0;\nclass TexturePoolClass {\n /**\n * @param textureOptions - options that will be passed to BaseRenderTexture constructor\n * @param {SCALE_MODE} [textureOptions.scaleMode] - See {@link SCALE_MODE} for possible values.\n */\n constructor(textureOptions) {\n this._poolKeyHash = /* @__PURE__ */ Object.create(null);\n this._texturePool = {};\n this.textureOptions = textureOptions || {};\n this.enableFullScreen = false;\n this.textureStyle = new TextureStyle(this.textureOptions);\n }\n /**\n * Creates texture with params that were specified in pool constructor.\n * @param pixelWidth - Width of texture in pixels.\n * @param pixelHeight - Height of texture in pixels.\n * @param antialias\n * @param autoGenerateMipmaps - Whether to automatically generate mipmaps for this texture\n */\n createTexture(pixelWidth, pixelHeight, antialias, autoGenerateMipmaps) {\n const textureSource = new TextureSource({\n ...this.textureOptions,\n width: pixelWidth,\n height: pixelHeight,\n resolution: 1,\n antialias,\n autoGarbageCollect: false,\n autoGenerateMipmaps\n });\n return new Texture({\n source: textureSource,\n label: `texturePool_${count++}`\n });\n }\n /**\n * Gets a Power-of-Two render texture or fullScreen texture\n * @param frameWidth - The minimum width of the render texture.\n * @param frameHeight - The minimum height of the render texture.\n * @param resolution - The resolution of the render texture.\n * @param antialias\n * @param autoGenerateMipmaps - Whether to automatically generate mipmaps. Defaults to false.\n * @returns The new render texture.\n */\n getOptimalTexture(frameWidth, frameHeight, resolution = 1, antialias, autoGenerateMipmaps = false) {\n let po2Width = Math.ceil(frameWidth * resolution - 1e-6);\n let po2Height = Math.ceil(frameHeight * resolution - 1e-6);\n po2Width = nextPow2(po2Width);\n po2Height = nextPow2(po2Height);\n const antialiasFlag = antialias ? 1 : 0;\n const mipmapFlag = autoGenerateMipmaps ? 1 : 0;\n const key = (po2Width << 17) + (po2Height << 2) + (mipmapFlag << 1) + antialiasFlag;\n if (!this._texturePool[key]) {\n this._texturePool[key] = [];\n }\n let texture = this._texturePool[key].pop();\n if (!texture) {\n texture = this.createTexture(po2Width, po2Height, antialias, autoGenerateMipmaps);\n }\n texture.source._resolution = resolution;\n texture.source.width = po2Width / resolution;\n texture.source.height = po2Height / resolution;\n texture.source.pixelWidth = po2Width;\n texture.source.pixelHeight = po2Height;\n texture.frame.x = 0;\n texture.frame.y = 0;\n texture.frame.width = frameWidth;\n texture.frame.height = frameHeight;\n texture.updateUvs();\n this._poolKeyHash[texture.uid] = key;\n return texture;\n }\n /**\n * Gets a pooled texture matching the dimensions and resolution of the given texture.\n *\n * This is a convenience wrapper around {@link TexturePoolClass#getOptimalTexture|getOptimalTexture}\n * that copies width, height, and resolution from an existing texture. Useful when a filter needs\n * a temporary texture the same size as its input (e.g., for multi-pass blur).\n * @param texture - The texture whose dimensions to match.\n * @param antialias - Whether to use antialias on the pooled texture. Defaults to `false`.\n * @returns A pooled texture with power-of-two backing dimensions at the source resolution.\n */\n getSameSizeTexture(texture, antialias = false) {\n const source = texture.source;\n return this.getOptimalTexture(texture.width, texture.height, source._resolution, antialias);\n }\n /**\n * Returns a texture to the pool so it can be reused by future\n * {@link TexturePoolClass#getOptimalTexture|getOptimalTexture}\n * or {@link TexturePoolClass#getSameSizeTexture|getSameSizeTexture} calls.\n *\n * If you modified the texture's style after obtaining it (e.g., changed filtering or wrapping),\n * pass `resetStyle = true` to restore the pool's default {@link TexturePoolClass#textureStyle|textureStyle}.\n * This prevents style changes from leaking into subsequent consumers of the same pooled texture.\n * @param renderTexture - The texture to return to the pool.\n * @param resetStyle - When `true`, replaces the texture source's style with the pool default. Defaults to `false`.\n */\n returnTexture(renderTexture, resetStyle = false) {\n const key = this._poolKeyHash[renderTexture.uid];\n if (resetStyle) {\n renderTexture.source.style = this.textureStyle;\n }\n this._texturePool[key].push(renderTexture);\n }\n /**\n * Clears the pool.\n * @param destroyTextures - Destroy all stored textures.\n */\n clear(destroyTextures) {\n destroyTextures = destroyTextures !== false;\n if (destroyTextures) {\n for (const i in this._texturePool) {\n const textures = this._texturePool[i];\n if (textures) {\n for (let j = 0; j < textures.length; j++) {\n textures[j].destroy(true);\n }\n }\n }\n }\n this._texturePool = {};\n }\n}\nconst TexturePool = new TexturePoolClass();\nGlobalResourceRegistry.register(TexturePool);\n\nexport { TexturePool, TexturePoolClass };\n//# sourceMappingURL=TexturePool.mjs.map\n","import { Matrix } from '../../maths/matrix/Matrix.mjs';\nimport { InstructionSet } from '../../rendering/renderers/shared/instructions/InstructionSet.mjs';\nimport { TexturePool } from '../../rendering/renderers/shared/texture/TexturePool.mjs';\n\n\"use strict\";\nclass RenderGroup {\n constructor() {\n this.renderPipeId = \"renderGroup\";\n this.root = null;\n this.canBundle = false;\n this.renderGroupParent = null;\n this.renderGroupChildren = [];\n this.worldTransform = new Matrix();\n this.worldColorAlpha = 4294967295;\n this.worldColor = 16777215;\n this.worldAlpha = 1;\n // these updates are transform changes..\n this.childrenToUpdate = /* @__PURE__ */ Object.create(null);\n this.updateTick = 0;\n this.gcTick = 0;\n // these update are renderable changes..\n this.childrenRenderablesToUpdate = { list: [], index: 0 };\n // other\n this.structureDidChange = true;\n this.instructionSet = new InstructionSet();\n this._onRenderContainers = [];\n /**\n * Indicates if the cached texture needs to be updated.\n * @default true\n */\n this.textureNeedsUpdate = true;\n /**\n * Indicates if the container should be cached as a texture.\n * @default false\n */\n this.isCachedAsTexture = false;\n this._matrixDirty = 7;\n }\n init(root) {\n this.root = root;\n if (root._onRender) this.addOnRender(root);\n root.didChange = true;\n const children = root.children;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n child._updateFlags = 15;\n this.addChild(child);\n }\n }\n enableCacheAsTexture(options = {}) {\n this.textureOptions = options;\n this.isCachedAsTexture = true;\n this.textureNeedsUpdate = true;\n }\n disableCacheAsTexture() {\n this.isCachedAsTexture = false;\n if (this.texture) {\n TexturePool.returnTexture(this.texture, true);\n this.texture = null;\n }\n }\n updateCacheTexture() {\n this.textureNeedsUpdate = true;\n const cachedParent = this._parentCacheAsTextureRenderGroup;\n if (cachedParent && !cachedParent.textureNeedsUpdate) {\n cachedParent.updateCacheTexture();\n }\n }\n reset() {\n this.renderGroupChildren.length = 0;\n for (const i in this.childrenToUpdate) {\n const childrenAtDepth = this.childrenToUpdate[i];\n childrenAtDepth.list.fill(null);\n childrenAtDepth.index = 0;\n }\n this.childrenRenderablesToUpdate.index = 0;\n this.childrenRenderablesToUpdate.list.fill(null);\n this.root = null;\n this.updateTick = 0;\n this.structureDidChange = true;\n this._onRenderContainers.length = 0;\n this.renderGroupParent = null;\n this.disableCacheAsTexture();\n }\n get localTransform() {\n return this.root.localTransform;\n }\n addRenderGroupChild(renderGroupChild) {\n if (renderGroupChild.renderGroupParent) {\n renderGroupChild.renderGroupParent._removeRenderGroupChild(renderGroupChild);\n }\n renderGroupChild.renderGroupParent = this;\n this.renderGroupChildren.push(renderGroupChild);\n }\n _removeRenderGroupChild(renderGroupChild) {\n const index = this.renderGroupChildren.indexOf(renderGroupChild);\n if (index > -1) {\n this.renderGroupChildren.splice(index, 1);\n }\n renderGroupChild.renderGroupParent = null;\n }\n addChild(child) {\n this.structureDidChange = true;\n child.parentRenderGroup = this;\n child.updateTick = -1;\n if (child.parent === this.root) {\n child.relativeRenderGroupDepth = 1;\n } else {\n child.relativeRenderGroupDepth = child.parent.relativeRenderGroupDepth + 1;\n }\n child.didChange = true;\n this.onChildUpdate(child);\n if (child.renderGroup) {\n this.addRenderGroupChild(child.renderGroup);\n return;\n }\n if (child._onRender) this.addOnRender(child);\n const children = child.children;\n for (let i = 0; i < children.length; i++) {\n this.addChild(children[i]);\n }\n }\n removeChild(child) {\n this.structureDidChange = true;\n if (child._onRender) {\n if (!child.renderGroup) {\n this.removeOnRender(child);\n }\n }\n child.parentRenderGroup = null;\n if (child.renderGroup) {\n this._removeRenderGroupChild(child.renderGroup);\n return;\n }\n const children = child.children;\n for (let i = 0; i < children.length; i++) {\n this.removeChild(children[i]);\n }\n }\n removeChildren(children) {\n for (let i = 0; i < children.length; i++) {\n this.removeChild(children[i]);\n }\n }\n onChildUpdate(child) {\n let childrenToUpdate = this.childrenToUpdate[child.relativeRenderGroupDepth];\n if (!childrenToUpdate) {\n childrenToUpdate = this.childrenToUpdate[child.relativeRenderGroupDepth] = {\n index: 0,\n list: []\n };\n }\n childrenToUpdate.list[childrenToUpdate.index++] = child;\n }\n updateRenderable(renderable) {\n if (renderable.globalDisplayStatus < 7) return;\n this.instructionSet.renderPipes[renderable.renderPipeId].updateRenderable(renderable);\n renderable.didViewUpdate = false;\n }\n onChildViewUpdate(child) {\n this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++] = child;\n }\n get isRenderable() {\n return this.root.localDisplayStatus === 7 && this.worldAlpha > 0;\n }\n /**\n * adding a container to the onRender list will make sure the user function\n * passed in to the user defined 'onRender` callBack\n * @param container - the container to add to the onRender list\n */\n addOnRender(container) {\n this._onRenderContainers.push(container);\n }\n removeOnRender(container) {\n this._onRenderContainers.splice(this._onRenderContainers.indexOf(container), 1);\n }\n runOnRender(renderer) {\n for (let i = 0; i < this._onRenderContainers.length; i++) {\n this._onRenderContainers[i]._onRender(renderer);\n }\n }\n destroy() {\n this.disableCacheAsTexture();\n this.renderGroupParent = null;\n this.root = null;\n this.childrenRenderablesToUpdate = null;\n this.childrenToUpdate = null;\n this.renderGroupChildren = null;\n this._onRenderContainers = null;\n this.instructionSet = null;\n }\n getChildren(out = []) {\n const children = this.root.children;\n for (let i = 0; i < children.length; i++) {\n this._getChildren(children[i], out);\n }\n return out;\n }\n _getChildren(container, out = []) {\n out.push(container);\n if (container.renderGroup) return out;\n const children = container.children;\n for (let i = 0; i < children.length; i++) {\n this._getChildren(children[i], out);\n }\n return out;\n }\n invalidateMatrices() {\n this._matrixDirty = 7;\n }\n /**\n * Returns the inverse of the world transform matrix.\n * @returns {Matrix} The inverse of the world transform matrix.\n */\n get inverseWorldTransform() {\n if ((this._matrixDirty & 1) === 0) return this._inverseWorldTransform;\n this._matrixDirty &= ~1;\n this._inverseWorldTransform || (this._inverseWorldTransform = new Matrix());\n return this._inverseWorldTransform.copyFrom(this.worldTransform).invert();\n }\n /**\n * Returns the inverse of the texture offset transform matrix.\n * @returns {Matrix} The inverse of the texture offset transform matrix.\n */\n get textureOffsetInverseTransform() {\n if ((this._matrixDirty & 2) === 0) return this._textureOffsetInverseTransform;\n this._matrixDirty &= ~2;\n this._textureOffsetInverseTransform || (this._textureOffsetInverseTransform = new Matrix());\n return this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(\n -this._textureBounds.x,\n -this._textureBounds.y\n );\n }\n /**\n * Returns the inverse of the parent texture transform matrix.\n * This is used to properly transform coordinates when rendering into cached textures.\n * @returns {Matrix} The inverse of the parent texture transform matrix.\n */\n get inverseParentTextureTransform() {\n if ((this._matrixDirty & 4) === 0) return this._inverseParentTextureTransform;\n this._matrixDirty &= ~4;\n const parentCacheAsTexture = this._parentCacheAsTextureRenderGroup;\n if (parentCacheAsTexture) {\n this._inverseParentTextureTransform || (this._inverseParentTextureTransform = new Matrix());\n return this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(parentCacheAsTexture.inverseWorldTransform).translate(\n -parentCacheAsTexture._textureBounds.x,\n -parentCacheAsTexture._textureBounds.y\n );\n }\n return this.worldTransform;\n }\n /**\n * Returns a matrix that transforms coordinates to the correct coordinate space of the texture being rendered to.\n * This is the texture offset inverse transform of the closest parent RenderGroup that is cached as a texture.\n * @returns {Matrix | null} The transform matrix for the cached texture coordinate space,\n * or null if no parent is cached as texture.\n */\n get cacheToLocalTransform() {\n if (this.isCachedAsTexture) {\n return this.textureOffsetInverseTransform;\n }\n if (!this._parentCacheAsTextureRenderGroup) return null;\n return this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform;\n }\n}\n\nexport { RenderGroup };\n//# sourceMappingURL=RenderGroup.mjs.map\n","\"use strict\";\nfunction assignWithIgnore(target, options, ignore = {}) {\n for (const key in options) {\n if (!ignore[key] && options[key] !== void 0) {\n target[key] = options[key];\n }\n }\n}\n\nexport { assignWithIgnore };\n//# sourceMappingURL=assignWithIgnore.mjs.map\n","import EventEmitter from 'eventemitter3';\nimport { Color } from '../../color/Color.mjs';\nimport { cullingMixin } from '../../culling/cullingMixin.mjs';\nimport { extensions } from '../../extensions/Extensions.mjs';\nimport { Matrix } from '../../maths/matrix/Matrix.mjs';\nimport { RAD_TO_DEG, DEG_TO_RAD } from '../../maths/misc/const.mjs';\nimport { ObservablePoint } from '../../maths/point/ObservablePoint.mjs';\nimport { uid } from '../../utils/data/uid.mjs';\nimport { deprecation, v8_0_0 } from '../../utils/logging/deprecation.mjs';\nimport { warn } from '../../utils/logging/warn.mjs';\nimport { BigPool } from '../../utils/pool/PoolGroup.mjs';\nimport { cacheAsTextureMixin } from './container-mixins/cacheAsTextureMixin.mjs';\nimport { childrenHelperMixin } from './container-mixins/childrenHelperMixin.mjs';\nimport { collectRenderablesMixin } from './container-mixins/collectRenderablesMixin.mjs';\nimport { effectsMixin } from './container-mixins/effectsMixin.mjs';\nimport { findMixin } from './container-mixins/findMixin.mjs';\nimport { getFastGlobalBoundsMixin } from './container-mixins/getFastGlobalBoundsMixin.mjs';\nimport { bgr2rgb, getGlobalMixin } from './container-mixins/getGlobalMixin.mjs';\nimport { measureMixin } from './container-mixins/measureMixin.mjs';\nimport { onRenderMixin } from './container-mixins/onRenderMixin.mjs';\nimport { sortMixin } from './container-mixins/sortMixin.mjs';\nimport { toLocalGlobalMixin } from './container-mixins/toLocalGlobalMixin.mjs';\nimport { RenderGroup } from './RenderGroup.mjs';\nimport { assignWithIgnore } from './utils/assignWithIgnore.mjs';\n\n\"use strict\";\nconst defaultSkew = new ObservablePoint(null);\nconst defaultPivot = new ObservablePoint(null);\nconst defaultScale = new ObservablePoint(null, 1, 1);\nconst defaultOrigin = new ObservablePoint(null);\nconst UPDATE_COLOR = 1;\nconst UPDATE_BLEND = 2;\nconst UPDATE_VISIBLE = 4;\nconst UPDATE_TRANSFORM = 8;\nclass Container extends EventEmitter {\n constructor(options = {}) {\n super();\n /**\n * unique id for this container\n * @internal\n */\n this.uid = uid(\"renderable\");\n /** @private */\n this._updateFlags = 15;\n // the render group this container owns\n /** @private */\n this.renderGroup = null;\n // the render group this container belongs to\n /** @private */\n this.parentRenderGroup = null;\n // the index of the container in the render group\n /** @private */\n this.parentRenderGroupIndex = 0;\n // set to true if the container has changed. It is reset once the changes have been applied\n // by the transform system\n // its here to stop ensure that when things change, only one update gets registers with the transform system\n /** @private */\n this.didChange = false;\n // same as above, but for the renderable\n /** @private */\n this.didViewUpdate = false;\n // how deep is the container relative to its render group..\n // unless the element is the root render group - it will be relative to its parent\n /** @private */\n this.relativeRenderGroupDepth = 0;\n /**\n * The array of children of this container. Each child must be a Container or extend from it.\n *\n * The array is read-only, but its contents can be modified using Container methods.\n * @example\n * ```ts\n * // Access children\n * const firstChild = container.children[0];\n * const lastChild = container.children[container.children.length - 1];\n * ```\n * @readonly\n * @see {@link Container#addChild} For adding children\n * @see {@link Container#removeChild} For removing children\n */\n this.children = [];\n /**\n * The display object container that contains this display object.\n * This represents the parent-child relationship in the display tree.\n * @example\n * ```ts\n * // Basic parent access\n * const parent = sprite.parent;\n *\n * // Walk up the tree\n * let current = sprite;\n * while (current.parent) {\n * console.log('Level up:', current.parent.constructor.name);\n * current = current.parent;\n * }\n * ```\n * @readonly\n * @see {@link Container#addChild} For adding to a parent\n * @see {@link Container#removeChild} For removing from parent\n */\n this.parent = null;\n // used internally for changing up the render order.. mainly for masks and filters\n // TODO setting this should cause a rebuild??\n /** @private */\n this.includeInBuild = true;\n /** @private */\n this.measurable = true;\n /** @private */\n this.isSimple = true;\n /**\n * The RenderLayer this container belongs to, if any.\n * If it belongs to a RenderLayer, it will be rendered from the RenderLayer's position in the scene.\n * @readonly\n * @advanced\n */\n this.parentRenderLayer = null;\n // / /////////////Transform related props//////////////\n // used by the transform system to check if a container needs to be updated that frame\n // if the tick matches the current transform system tick, it is not updated again\n /** @internal */\n this.updateTick = -1;\n /**\n * Current transform of the object based on local factors: position, scale, other stuff.\n * This matrix represents the local transformation without any parent influence.\n * @example\n * ```ts\n * // Basic transform access\n * const localMatrix = sprite.localTransform;\n * console.log(localMatrix.toString());\n * ```\n * @readonly\n * @see {@link Container#worldTransform} For global transform\n * @see {@link Container#groupTransform} For render group transform\n */\n this.localTransform = new Matrix();\n /**\n * The relative group transform is a transform relative to the render group it belongs too. It will include all parent\n * transforms and up to the render group (think of it as kind of like a stage - but the stage can be nested).\n * If this container is is self a render group matrix will be relative to its parent render group\n * @readonly\n * @advanced\n */\n this.relativeGroupTransform = new Matrix();\n /**\n * The group transform is a transform relative to the render group it belongs too.\n * If this container is render group then this will be an identity matrix. other wise it\n * will be the same as the relativeGroupTransform.\n * Use this value when actually rendering things to the screen\n * @readonly\n * @advanced\n */\n this.groupTransform = this.relativeGroupTransform;\n /**\n * Whether this object has been destroyed. If true, the object should no longer be used.\n * After an object is destroyed, all of its functionality is disabled and references are removed.\n * @example\n * ```ts\n * // Cleanup with destroy\n * sprite.destroy();\n * console.log(sprite.destroyed); // true\n * ```\n * @default false\n * @see {@link Container#destroy} For destroying objects\n */\n this.destroyed = false;\n // transform data..\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n * @internal\n */\n this._position = new ObservablePoint(this, 0, 0);\n /**\n * The scale factor of the object.\n * @internal\n */\n this._scale = defaultScale;\n /**\n * The pivot point of the container that it rotates around.\n * @internal\n */\n this._pivot = defaultPivot;\n /**\n * The origin point around which the container rotates and scales.\n * Unlike pivot, changing origin will not move the container's position.\n * @private\n */\n this._origin = defaultOrigin;\n /**\n * The skew amount, on the x and y axis.\n * @internal\n */\n this._skew = defaultSkew;\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 * @internal\n */\n this._cx = 1;\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 * @internal\n */\n this._sx = 0;\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 * @internal\n */\n this._cy = 0;\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 * @internal\n */\n this._sy = 1;\n /**\n * The rotation amount.\n * @internal\n */\n this._rotation = 0;\n // / COLOR related props //////////////\n // color stored as ABGR\n /** @internal */\n this.localColor = 16777215;\n /** @internal */\n this.localAlpha = 1;\n /** @internal */\n this.groupAlpha = 1;\n // A\n /** @internal */\n this.groupColor = 16777215;\n // BGR\n /** @internal */\n this.groupColorAlpha = 4294967295;\n // ABGR\n // / BLEND related props //////////////\n /** @internal */\n this.localBlendMode = \"inherit\";\n /** @internal */\n this.groupBlendMode = \"normal\";\n // / VISIBILITY related props //////////////\n // visibility\n // 0b11\n // first bit is visible, second bit is renderable\n /**\n * This property holds three bits: culled, visible, renderable\n * the third bit represents culling (0 = culled, 1 = not culled) 0b100\n * the second bit represents visibility (0 = not visible, 1 = visible) 0b010\n * the first bit represents renderable (0 = not renderable, 1 = renderable) 0b001\n * @internal\n */\n this.localDisplayStatus = 7;\n // 0b11 | 0b10 | 0b01 | 0b00\n /** @internal */\n this.globalDisplayStatus = 7;\n /**\n * A value that increments each time the containe is modified\n * eg children added, removed etc\n * @ignore\n */\n this._didContainerChangeTick = 0;\n /**\n * A value that increments each time the container view is modified\n * eg texture swap, geometry change etc\n * @ignore\n */\n this._didViewChangeTick = 0;\n /**\n * property that tracks if the container transform has changed\n * @ignore\n */\n this._didLocalTransformChangeId = -1;\n this.effects = [];\n assignWithIgnore(this, options, {\n children: true,\n parent: true,\n effects: true\n });\n options.children?.forEach((child) => this.addChild(child));\n options.parent?.addChild(this);\n }\n /**\n * Mixes all enumerable properties and methods from a source object to Container.\n * @param source - The source of properties and methods to mix in.\n * @deprecated since 8.8.0\n */\n static mixin(source) {\n deprecation(\"8.8.0\", \"Container.mixin is deprecated, please use extensions.mixin instead.\");\n extensions.mixin(Container, source);\n }\n // = 'default';\n /**\n * We now use the _didContainerChangeTick and _didViewChangeTick to track changes\n * @deprecated since 8.2.6\n * @ignore\n */\n set _didChangeId(value) {\n this._didViewChangeTick = value >> 12 & 4095;\n this._didContainerChangeTick = value & 4095;\n }\n /** @ignore */\n get _didChangeId() {\n return this._didContainerChangeTick & 4095 | (this._didViewChangeTick & 4095) << 12;\n }\n /**\n * Adds one or more children to the container.\n * The children will be rendered as part of this container's display list.\n * @example\n * ```ts\n * // Add a single child\n * container.addChild(sprite);\n *\n * // Add multiple children\n * container.addChild(background, player, foreground);\n *\n * // Add with type checking\n * const sprite = container.addChild<Sprite>(new Sprite(texture));\n * sprite.tint = 'red';\n * ```\n * @param children - The Container(s) to add to the container\n * @returns The first child that was added\n * @see {@link Container#removeChild} For removing children\n * @see {@link Container#addChildAt} For adding at specific index\n */\n addChild(...children) {\n if (!this.allowChildren) {\n deprecation(v8_0_0, \"addChild: Only Containers will be allowed to add children in v8.0.0\");\n }\n if (children.length > 1) {\n for (let i = 0; i < children.length; i++) {\n this.addChild(children[i]);\n }\n return children[0];\n }\n const child = children[0];\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n if (child.parent === this) {\n this.children.splice(this.children.indexOf(child), 1);\n this.children.push(child);\n if (renderGroup) {\n renderGroup.structureDidChange = true;\n }\n return child;\n }\n if (child.parent) {\n child.parent.removeChild(child);\n }\n this.children.push(child);\n if (this.sortableChildren) this.sortDirty = true;\n child.parent = this;\n child.didChange = true;\n child._updateFlags = 15;\n if (renderGroup) {\n renderGroup.addChild(child);\n }\n this.emit(\"childAdded\", child, this, this.children.length - 1);\n child.emit(\"added\", this);\n this._didViewChangeTick++;\n if (child._zIndex !== 0) {\n child.depthOfChildModified();\n }\n return child;\n }\n /**\n * Removes one or more children from the container.\n * When removing multiple children, events will be triggered for each child in sequence.\n * @example\n * ```ts\n * // Remove a single child\n * const removed = container.removeChild(sprite);\n *\n * // Remove multiple children\n * const bg = container.removeChild(background, player, userInterface);\n *\n * // Remove with type checking\n * const sprite = container.removeChild<Sprite>(childSprite);\n * sprite.texture = newTexture;\n * ```\n * @param children - The Container(s) to remove\n * @returns The first child that was removed\n * @see {@link Container#addChild} For adding children\n * @see {@link Container#removeChildren} For removing multiple children\n */\n removeChild(...children) {\n if (children.length > 1) {\n for (let i = 0; i < children.length; i++) {\n this.removeChild(children[i]);\n }\n return children[0];\n }\n const child = children[0];\n const index = this.children.indexOf(child);\n if (index > -1) {\n this._didViewChangeTick++;\n this.children.splice(index, 1);\n if (this.renderGroup) {\n this.renderGroup.removeChild(child);\n } else if (this.parentRenderGroup) {\n this.parentRenderGroup.removeChild(child);\n }\n if (child.parentRenderLayer) {\n child.parentRenderLayer.detach(child);\n }\n child.parent = null;\n this.emit(\"childRemoved\", child, this, index);\n child.emit(\"removed\", this);\n }\n return child;\n }\n /** @ignore */\n _onUpdate(point) {\n if (point) {\n if (point === this._skew) {\n this._updateSkew();\n }\n }\n this._didContainerChangeTick++;\n if (this.didChange) return;\n this.didChange = true;\n if (this.parentRenderGroup) {\n this.parentRenderGroup.onChildUpdate(this);\n }\n }\n set isRenderGroup(value) {\n if (!!this.renderGroup === value) return;\n if (value) {\n this.enableRenderGroup();\n } else {\n this.disableRenderGroup();\n }\n }\n /**\n * Returns true if this container is a render group.\n * This means that it will be rendered as a separate pass, with its own set of instructions\n * @advanced\n */\n get isRenderGroup() {\n return !!this.renderGroup;\n }\n /**\n * Calling this enables a render group for this container.\n * This means it will be rendered as a separate set of instructions.\n * The transform of the container will also be handled on the GPU rather than the CPU.\n * @advanced\n */\n enableRenderGroup() {\n if (this.renderGroup) return;\n const parentRenderGroup = this.parentRenderGroup;\n parentRenderGroup?.removeChild(this);\n this.renderGroup = BigPool.get(RenderGroup, this);\n this.groupTransform = Matrix.IDENTITY;\n parentRenderGroup?.addChild(this);\n this._updateIsSimple();\n }\n /**\n * This will disable the render group for this container.\n * @advanced\n */\n disableRenderGroup() {\n if (!this.renderGroup) return;\n const parentRenderGroup = this.parentRenderGroup;\n parentRenderGroup?.removeChild(this);\n BigPool.return(this.renderGroup);\n this.renderGroup = null;\n this.groupTransform = this.relativeGroupTransform;\n parentRenderGroup?.addChild(this);\n this._updateIsSimple();\n }\n /** @ignore */\n _updateIsSimple() {\n this.isSimple = !this.renderGroup && this.effects.length === 0;\n }\n /**\n * Current transform of the object based on world (parent) factors.\n *\n * This matrix represents the absolute transformation in the scene graph.\n * @example\n * ```ts\n * // Get world position\n * const worldPos = container.worldTransform;\n * console.log(`World position: (${worldPos.tx}, ${worldPos.ty})`);\n * ```\n * @readonly\n * @see {@link Container#localTransform} For local space transform\n */\n get worldTransform() {\n this._worldTransform || (this._worldTransform = new Matrix());\n if (this.renderGroup) {\n this._worldTransform.copyFrom(this.renderGroup.worldTransform);\n } else if (this.parentRenderGroup) {\n this._worldTransform.appendFrom(this.relativeGroupTransform, this.parentRenderGroup.worldTransform);\n }\n return this._worldTransform;\n }\n /**\n * The position of the container on the x axis relative to the local coordinates of the parent.\n *\n * An alias to position.x\n * @example\n * ```ts\n * // Basic position\n * container.x = 100;\n * ```\n */\n get x() {\n return this._position.x;\n }\n set x(value) {\n this._position.x = value;\n }\n /**\n * The position of the container on the y axis relative to the local coordinates of the parent.\n *\n * An alias to position.y\n * @example\n * ```ts\n * // Basic position\n * container.y = 200;\n * ```\n */\n get y() {\n return this._position.y;\n }\n set y(value) {\n this._position.y = value;\n }\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n * @example\n * ```ts\n * // Basic position setting\n * container.position.set(100, 200);\n * container.position.set(100); // Sets both x and y to 100\n * // Using point data\n * container.position = { x: 50, y: 75 };\n * ```\n * @since 4.0.0\n */\n get position() {\n return this._position;\n }\n set position(value) {\n this._position.copyFrom(value);\n }\n /**\n * The rotation of the object in radians.\n *\n * > [!NOTE] 'rotation' and 'angle' have the same effect on a display object;\n * > rotation is in radians, angle is in degrees.\n * @example\n * ```ts\n * // Basic rotation\n * container.rotation = Math.PI / 4; // 45 degrees\n *\n * // Convert from degrees\n * const degrees = 45;\n * container.rotation = degrees * Math.PI / 180;\n *\n * // Rotate around center\n * container.pivot.set(container.width / 2, container.height / 2);\n * container.rotation = Math.PI; // 180 degrees\n *\n * // Rotate around center with origin\n * container.origin.set(container.width / 2, container.height / 2);\n * container.rotation = Math.PI; // 180 degrees\n * ```\n */\n get rotation() {\n return this._rotation;\n }\n set rotation(value) {\n if (this._rotation !== value) {\n this._rotation = value;\n this._onUpdate(this._skew);\n }\n }\n /**\n * The angle of the object in degrees.\n *\n * > [!NOTE] 'rotation' and 'angle' have the same effect on a display object;\n * > rotation is in radians, angle is in degrees.\n * @example\n * ```ts\n * // Basic angle rotation\n * sprite.angle = 45; // 45 degrees\n *\n * // Rotate around center\n * sprite.pivot.set(sprite.width / 2, sprite.height / 2);\n * sprite.angle = 180; // Half rotation\n *\n * // Rotate around center with origin\n * sprite.origin.set(sprite.width / 2, sprite.height / 2);\n * sprite.angle = 180; // Half rotation\n *\n * // Reset rotation\n * sprite.angle = 0;\n * ```\n */\n get angle() {\n return this.rotation * RAD_TO_DEG;\n }\n set angle(value) {\n this.rotation = value * DEG_TO_RAD;\n }\n /**\n * The center of rotation, scaling, and skewing for this display object in its local space.\n * The `position` is the projection of `pivot` in the parent's local space.\n *\n * By default, the pivot is the origin (0, 0).\n * @example\n * ```ts\n * // Rotate around center\n * container.pivot.set(container.width / 2, container.height / 2);\n * container.rotation = Math.PI; // Rotates around center\n * ```\n * @since 4.0.0\n */\n get pivot() {\n if (this._pivot === defaultPivot) {\n this._pivot = new ObservablePoint(this, 0, 0);\n }\n return this._pivot;\n }\n set pivot(value) {\n if (this._pivot === defaultPivot) {\n this._pivot = new ObservablePoint(this, 0, 0);\n if (this._origin !== defaultOrigin) {\n warn(`Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.`);\n }\n }\n typeof value === \"number\" ? this._pivot.set(value) : this._pivot.copyFrom(value);\n }\n /**\n * The skew factor for the object in radians. Skewing is a transformation that distorts\n * the object by rotating it differently at each point, creating a non-uniform shape.\n * @example\n * ```ts\n * // Basic skewing\n * container.skew.set(0.5, 0); // Skew horizontally\n * container.skew.set(0, 0.5); // Skew vertically\n *\n * // Skew with point data\n * container.skew = { x: 0.3, y: 0.3 }; // Diagonal skew\n *\n * // Reset skew\n * container.skew.set(0, 0);\n *\n * // Animate skew\n * app.ticker.add(() => {\n * // Create wave effect\n * container.skew.x = Math.sin(Date.now() / 1000) * 0.3;\n * });\n *\n * // Combine with rotation\n * container.rotation = Math.PI / 4; // 45 degrees\n * container.skew.set(0.2, 0.2); // Skew the rotated object\n * ```\n * @since 4.0.0\n * @type {ObservablePoint} Point-like object with x/y properties in radians\n * @default {x: 0, y: 0}\n */\n get skew() {\n if (this._skew === defaultSkew) {\n this._skew = new ObservablePoint(this, 0, 0);\n }\n return this._skew;\n }\n set skew(value) {\n if (this._skew === defaultSkew) {\n this._skew = new ObservablePoint(this, 0, 0);\n }\n this._skew.copyFrom(value);\n }\n /**\n * The scale factors of this object along the local coordinate axes.\n *\n * The default scale is (1, 1).\n * @example\n * ```ts\n * // Basic scaling\n * container.scale.set(2, 2); // Scales to double size\n * container.scale.set(2); // Scales uniformly to double size\n * container.scale = 2; // Scales uniformly to double size\n * // Scale to a specific width and height\n * container.setSize(200, 100); // Sets width to 200 and height to 100\n * ```\n * @since 4.0.0\n */\n get scale() {\n if (this._scale === defaultScale) {\n this._scale = new ObservablePoint(this, 1, 1);\n }\n return this._scale;\n }\n set scale(value) {\n if (this._scale === defaultScale) {\n this._scale = new ObservablePoint(this, 0, 0);\n }\n if (typeof value === \"string\") {\n value = parseFloat(value);\n }\n typeof value === \"number\" ? this._scale.set(value) : this._scale.copyFrom(value);\n }\n /**\n * @experimental\n * The origin point around which the container rotates and scales without affecting its position.\n * Unlike pivot, changing the origin will not move the container's position.\n * @example\n * ```ts\n * // Rotate around center point\n * container.origin.set(container.width / 2, container.height / 2);\n * container.rotation = Math.PI; // Rotates around center\n *\n * // Reset origin\n * container.origin.set(0, 0);\n * ```\n */\n get origin() {\n if (this._origin === defaultOrigin) {\n this._origin = new ObservablePoint(this, 0, 0);\n }\n return this._origin;\n }\n set origin(value) {\n if (this._origin === defaultOrigin) {\n this._origin = new ObservablePoint(this, 0, 0);\n if (this._pivot !== defaultPivot) {\n warn(`Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.`);\n }\n }\n typeof value === \"number\" ? this._origin.set(value) : this._origin.copyFrom(value);\n }\n /**\n * The width of the Container, setting this will actually modify the scale to achieve the value set.\n * > [!NOTE] Changing the width will adjust the scale.x property of the container while maintaining its aspect ratio.\n * > [!NOTE] If you want to set both width and height at the same time, use {@link Container#setSize}\n * as it is more optimized by not recalculating the local bounds twice.\n * @example\n * ```ts\n * // Basic width setting\n * container.width = 100;\n * // Optimized width setting\n * container.setSize(100, 100);\n * ```\n */\n get width() {\n return Math.abs(this.scale.x * this.getLocalBounds().width);\n }\n set width(value) {\n const localWidth = this.getLocalBounds().width;\n this._setWidth(value, localWidth);\n }\n /**\n * The height of the Container,\n * > [!NOTE] Changing the height will adjust the scale.y property of the container while maintaining its aspect ratio.\n * > [!NOTE] If you want to set both width and height at the same time, use {@link Container#setSize}\n * as it is more optimized by not recalculating the local bounds twice.\n * @example\n * ```ts\n * // Basic height setting\n * container.height = 200;\n * // Optimized height setting\n * container.setSize(100, 200);\n * ```\n */\n get height() {\n return Math.abs(this.scale.y * this.getLocalBounds().height);\n }\n set height(value) {\n const localHeight = this.getLocalBounds().height;\n this._setHeight(value, localHeight);\n }\n /**\n * Retrieves the size of the container as a [Size]{@link Size} object.\n *\n * This is faster than get the width and height separately.\n * @example\n * ```ts\n * // Basic size retrieval\n * const size = container.getSize();\n * console.log(`Size: ${size.width}x${size.height}`);\n *\n * // Reuse existing size object\n * const reuseSize = { width: 0, height: 0 };\n * container.getSize(reuseSize);\n * ```\n * @param out - Optional object to store the size in.\n * @returns The size of the container.\n */\n getSize(out) {\n if (!out) {\n out = {};\n }\n const bounds = this.getLocalBounds();\n out.width = Math.abs(this.scale.x * bounds.width);\n out.height = Math.abs(this.scale.y * bounds.height);\n return out;\n }\n /**\n * Sets the size of the container to the specified width and height.\n * This is more efficient than setting width and height separately as it only recalculates bounds once.\n * @example\n * ```ts\n * // Basic size setting\n * container.setSize(100, 200);\n *\n * // Set uniform size\n * container.setSize(100); // Sets both width and height to 100\n * ```\n * @param value - This can be either a number or a [Size]{@link Size} object.\n * @param height - The height to set. Defaults to the value of `width` if not provided.\n */\n setSize(value, height) {\n const size = this.getLocalBounds();\n if (typeof value === \"object\") {\n height = value.height ?? value.width;\n value = value.width;\n } else {\n height ?? (height = value);\n }\n value !== void 0 && this._setWidth(value, size.width);\n height !== void 0 && this._setHeight(height, size.height);\n }\n /** Called when the skew or the rotation changes. */\n _updateSkew() {\n const rotation = this._rotation;\n const skew = this._skew;\n this._cx = Math.cos(rotation + skew._y);\n this._sx = Math.sin(rotation + skew._y);\n this._cy = -Math.sin(rotation - skew._x);\n this._sy = Math.cos(rotation - skew._x);\n }\n /**\n * Updates the transform properties of the container.\n * Allows partial updates of transform properties for optimized manipulation.\n * @example\n * ```ts\n * // Basic transform update\n * container.updateTransform({\n * x: 100,\n * y: 200,\n * rotation: Math.PI / 4\n * });\n *\n * // Scale and rotate around center\n * sprite.updateTransform({\n * pivotX: sprite.width / 2,\n * pivotY: sprite.height / 2,\n * scaleX: 2,\n * scaleY: 2,\n * rotation: Math.PI\n * });\n *\n * // Update position only\n * button.updateTransform({\n * x: button.x + 10, // Move right\n * y: button.y // Keep same y\n * });\n * ```\n * @param opts - Transform options to update\n * @param opts.x - The x position\n * @param opts.y - The y position\n * @param opts.scaleX - The x-axis scale factor\n * @param opts.scaleY - The y-axis scale factor\n * @param opts.rotation - The rotation in radians\n * @param opts.skewX - The x-axis skew factor\n * @param opts.skewY - The y-axis skew factor\n * @param opts.pivotX - The x-axis pivot point\n * @param opts.pivotY - The y-axis pivot point\n * @returns This container, for chaining\n * @see {@link Container#setFromMatrix} For matrix-based transforms\n * @see {@link Container#position} For direct position access\n */\n updateTransform(opts) {\n this.position.set(\n typeof opts.x === \"number\" ? opts.x : this.position.x,\n typeof opts.y === \"number\" ? opts.y : this.position.y\n );\n this.scale.set(\n typeof opts.scaleX === \"number\" ? opts.scaleX : this.scale.x,\n typeof opts.scaleY === \"number\" ? opts.scaleY : this.scale.y\n );\n this.rotation = typeof opts.rotation === \"number\" ? opts.rotation : this.rotation;\n this.skew.set(\n typeof opts.skewX === \"number\" ? opts.skewX : this.skew.x,\n typeof opts.skewY === \"number\" ? opts.skewY : this.skew.y\n );\n this.pivot.set(\n typeof opts.pivotX === \"number\" ? opts.pivotX : this.pivot.x,\n typeof opts.pivotY === \"number\" ? opts.pivotY : this.pivot.y\n );\n this.origin.set(\n typeof opts.originX === \"number\" ? opts.originX : this.origin.x,\n typeof opts.originY === \"number\" ? opts.originY : this.origin.y\n );\n return this;\n }\n /**\n * Updates the local transform properties by decomposing the given matrix.\n * Extracts position, scale, rotation, and skew from a transformation matrix.\n * @example\n * ```ts\n * // Basic matrix transform\n * const matrix = new Matrix()\n * .translate(100, 100)\n * .rotate(Math.PI / 4)\n * .scale(2, 2);\n *\n * container.setFromMatrix(matrix);\n *\n * // Copy transform from another container\n * const source = new Container();\n * source.position.set(100, 100);\n * source.rotation = Math.PI / 2;\n *\n * target.setFromMatrix(source.localTransform);\n *\n * // Reset transform\n * container.setFromMatrix(Matrix.IDENTITY);\n * ```\n * @param matrix - The matrix to use for updating the transform\n * @see {@link Container#updateTransform} For property-based updates\n * @see {@link Matrix#decompose} For matrix decomposition details\n */\n setFromMatrix(matrix) {\n matrix.decompose(this);\n }\n /** Updates the local transform. */\n updateLocalTransform() {\n const localTransformChangeId = this._didContainerChangeTick;\n if (this._didLocalTransformChangeId === localTransformChangeId) return;\n this._didLocalTransformChangeId = localTransformChangeId;\n const lt = this.localTransform;\n const scale = this._scale;\n const pivot = this._pivot;\n const origin = this._origin;\n const position = this._position;\n const sx = scale._x;\n const sy = scale._y;\n const px = pivot._x;\n const py = pivot._y;\n const ox = -origin._x;\n const oy = -origin._y;\n lt.a = this._cx * sx;\n lt.b = this._sx * sx;\n lt.c = this._cy * sy;\n lt.d = this._sy * sy;\n lt.tx = position._x - (px * lt.a + py * lt.c) + (ox * lt.a + oy * lt.c) - ox;\n lt.ty = position._y - (px * lt.b + py * lt.d) + (ox * lt.b + oy * lt.d) - oy;\n }\n // / ///// color related stuff\n set alpha(value) {\n if (value === this.localAlpha) return;\n this.localAlpha = value;\n this._updateFlags |= UPDATE_COLOR;\n this._onUpdate();\n }\n /**\n * The opacity of the object relative to its parent's opacity.\n * Value ranges from 0 (fully transparent) to 1 (fully opaque).\n * @example\n * ```ts\n * // Basic transparency\n * sprite.alpha = 0.5; // 50% opacity\n *\n * // Inherited opacity\n * container.alpha = 0.5;\n * const child = new Sprite(texture);\n * child.alpha = 0.5;\n * container.addChild(child);\n * // child's effective opacity is 0.25 (0.5 * 0.5)\n * ```\n * @default 1\n * @see {@link Container#visible} For toggling visibility\n * @see {@link Container#renderable} For render control\n */\n get alpha() {\n return this.localAlpha;\n }\n set tint(value) {\n const tempColor = Color.shared.setValue(value ?? 16777215);\n const bgr = tempColor.toBgrNumber();\n if (bgr === this.localColor) return;\n this.localColor = bgr;\n this._updateFlags |= UPDATE_COLOR;\n this._onUpdate();\n }\n /**\n * The tint applied to the sprite.\n *\n * This can be any valid {@link ColorSource}.\n * @example\n * ```ts\n * // Basic color tinting\n * container.tint = 0xff0000; // Red tint\n * container.tint = 'red'; // Same as above\n * container.tint = '#00ff00'; // Green\n * container.tint = 'rgb(0,0,255)'; // Blue\n *\n * // Remove tint\n * container.tint = 0xffffff; // White = no tint\n * container.tint = null; // Also removes tint\n * ```\n * @default 0xFFFFFF\n * @see {@link Container#alpha} For transparency\n * @see {@link Container#visible} For visibility control\n */\n get tint() {\n return bgr2rgb(this.localColor);\n }\n // / //////////////// blend related stuff\n set blendMode(value) {\n if (this.localBlendMode === value) return;\n if (this.parentRenderGroup) {\n this.parentRenderGroup.structureDidChange = true;\n }\n this._updateFlags |= UPDATE_BLEND;\n this.localBlendMode = value;\n this._onUpdate();\n }\n /**\n * The blend mode to be applied to the sprite. Controls how pixels are blended when rendering.\n *\n * Setting to 'normal' will reset to default blending.\n * > [!NOTE] More blend modes are available after importing the `pixi.js/advanced-blend-modes` sub-export.\n * @example\n * ```ts\n * // Basic blend modes\n * sprite.blendMode = 'add'; // Additive blending\n * sprite.blendMode = 'multiply'; // Multiply colors\n * sprite.blendMode = 'screen'; // Screen blend\n *\n * // Reset blend mode\n * sprite.blendMode = 'normal'; // Normal blending\n * ```\n * @default 'normal'\n * @see {@link Container#alpha} For transparency\n * @see {@link Container#tint} For color adjustments\n */\n get blendMode() {\n return this.localBlendMode;\n }\n // / ///////// VISIBILITY / RENDERABLE /////////////////\n /**\n * The visibility of the object. If false the object will not be drawn,\n * and the transform will not be updated.\n * @example\n * ```ts\n * // Basic visibility toggle\n * sprite.visible = false; // Hide sprite\n * sprite.visible = true; // Show sprite\n * ```\n * @default true\n * @see {@link Container#renderable} For render-only control\n * @see {@link Container#alpha} For transparency\n */\n get visible() {\n return !!(this.localDisplayStatus & 2);\n }\n set visible(value) {\n const valueNumber = value ? 2 : 0;\n if ((this.localDisplayStatus & 2) === valueNumber) return;\n if (this.parentRenderGroup) {\n this.parentRenderGroup.structureDidChange = true;\n }\n this._updateFlags |= UPDATE_VISIBLE;\n this.localDisplayStatus ^= 2;\n this._onUpdate();\n this.emit(\"visibleChanged\", value);\n }\n /** @ignore */\n get culled() {\n return !(this.localDisplayStatus & 4);\n }\n /** @ignore */\n set culled(value) {\n const valueNumber = value ? 0 : 4;\n if ((this.localDisplayStatus & 4) === valueNumber) return;\n if (this.parentRenderGroup) {\n this.parentRenderGroup.structureDidChange = true;\n }\n this._updateFlags |= UPDATE_VISIBLE;\n this.localDisplayStatus ^= 4;\n this._onUpdate();\n }\n /**\n * Controls whether this object can be rendered. If false the object will not be drawn,\n * but the transform will still be updated. This is different from visible, which skips\n * transform updates.\n * @example\n * ```ts\n * // Basic render control\n * sprite.renderable = false; // Skip rendering\n * sprite.renderable = true; // Enable rendering\n * ```\n * @default true\n * @see {@link Container#visible} For skipping transform updates\n * @see {@link Container#alpha} For transparency\n */\n get renderable() {\n return !!(this.localDisplayStatus & 1);\n }\n set renderable(value) {\n const valueNumber = value ? 1 : 0;\n if ((this.localDisplayStatus & 1) === valueNumber) return;\n this._updateFlags |= UPDATE_VISIBLE;\n this.localDisplayStatus ^= 1;\n if (this.parentRenderGroup) {\n this.parentRenderGroup.structureDidChange = true;\n }\n this._onUpdate();\n }\n /**\n * Whether or not the object should be rendered.\n * @advanced\n */\n get isRenderable() {\n return this.localDisplayStatus === 7 && this.groupAlpha > 0;\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 * @example\n * ```ts\n * container.destroy();\n * container.destroy(true);\n * container.destroy({ children: true });\n * container.destroy({ children: true, texture: true, textureSource: true });\n * ```\n */\n destroy(options = false) {\n if (this.destroyed) return;\n this.destroyed = true;\n let oldChildren;\n if (this.children.length) {\n oldChildren = this.removeChildren(0, this.children.length);\n }\n this.removeFromParent();\n this.parent = null;\n this._maskEffect = null;\n this._filterEffect = null;\n this.effects = null;\n this._position = null;\n this._scale = null;\n this._pivot = null;\n this._origin = null;\n this._skew = null;\n this.emit(\"destroyed\", this);\n this.removeAllListeners();\n const destroyChildren = typeof options === \"boolean\" ? options : options?.children;\n if (destroyChildren && oldChildren) {\n for (let i = 0; i < oldChildren.length; ++i) {\n oldChildren[i].destroy(options);\n }\n }\n this.renderGroup?.destroy();\n this.renderGroup = null;\n }\n}\nextensions.mixin(\n Container,\n childrenHelperMixin,\n getFastGlobalBoundsMixin,\n toLocalGlobalMixin,\n onRenderMixin,\n measureMixin,\n effectsMixin,\n findMixin,\n sortMixin,\n cullingMixin,\n cacheAsTextureMixin,\n getGlobalMixin,\n collectRenderablesMixin\n);\n\nexport { Container, UPDATE_BLEND, UPDATE_COLOR, UPDATE_TRANSFORM, UPDATE_VISIBLE };\n//# sourceMappingURL=Container.mjs.map\n","import { Bounds } from '../container/bounds/Bounds.mjs';\nimport { Container } from '../container/Container.mjs';\n\n\"use strict\";\nclass ViewContainer extends Container {\n constructor(options) {\n super(options);\n /** @internal */\n this.canBundle = true;\n /** @internal */\n this.allowChildren = false;\n /** @internal */\n this._roundPixels = 0;\n /** @internal */\n this._lastUsed = -1;\n /** @internal */\n this._gpuData = /* @__PURE__ */ Object.create(null);\n /** If set to true, the resource will be garbage collected automatically when it is not used. */\n this.autoGarbageCollect = true;\n /** @internal */\n this._gcLastUsed = -1;\n this._bounds = new Bounds(0, 1, 0, 0);\n this._boundsDirty = true;\n this.autoGarbageCollect = options.autoGarbageCollect ?? true;\n }\n /**\n * The local bounds of the view in its own coordinate space.\n * Bounds are automatically updated when the view's content changes.\n * @example\n * ```ts\n * // Get bounds dimensions\n * const bounds = view.bounds;\n * console.log(`Width: ${bounds.maxX - bounds.minX}`);\n * console.log(`Height: ${bounds.maxY - bounds.minY}`);\n * ```\n * @returns The rectangular bounds of the view\n * @see {@link Bounds} For bounds operations\n */\n get bounds() {\n if (!this._boundsDirty) return this._bounds;\n this.updateBounds();\n this._boundsDirty = false;\n return this._bounds;\n }\n /**\n * Whether or not to round the x/y position of the sprite.\n * @example\n * ```ts\n * // Enable pixel rounding for crisp rendering\n * view.roundPixels = true;\n * ```\n * @default false\n */\n get roundPixels() {\n return !!this._roundPixels;\n }\n set roundPixels(value) {\n this._roundPixels = value ? 1 : 0;\n }\n /**\n * Checks if the object contains the given point in local coordinates.\n * Uses the view's bounds for hit testing.\n * @example\n * ```ts\n * // Basic point check\n * const localPoint = { x: 50, y: 25 };\n * const contains = view.containsPoint(localPoint);\n * console.log('Point is inside:', contains);\n * ```\n * @param point - The point to check in local coordinates\n * @returns True if the point is within the view's bounds\n * @see {@link ViewContainer#bounds} For the bounds used in hit testing\n * @see {@link Container#toLocal} For converting global coordinates to local\n */\n containsPoint(point) {\n const bounds = this.bounds;\n const { x, y } = point;\n return x >= bounds.minX && x <= bounds.maxX && y >= bounds.minY && y <= bounds.maxY;\n }\n /** @private */\n onViewUpdate() {\n this._didViewChangeTick++;\n this._boundsDirty = true;\n if (this.didViewUpdate) return;\n this.didViewUpdate = true;\n const renderGroup = this.renderGroup || this.parentRenderGroup;\n if (renderGroup) {\n renderGroup.onChildViewUpdate(this);\n }\n }\n /** Unloads the GPU data from the view. */\n unload() {\n this.emit(\"unload\", this);\n for (const key in this._gpuData) {\n this._gpuData[key]?.destroy();\n }\n this._gpuData = /* @__PURE__ */ Object.create(null);\n this.onViewUpdate();\n }\n destroy(options) {\n this.unload();\n super.destroy(options);\n this._bounds = null;\n }\n /**\n * Collects renderables for the view container.\n * @param instructionSet - The instruction set to collect renderables for.\n * @param renderer - The renderer to collect renderables for.\n * @param currentLayer - The current render layer.\n * @internal\n */\n collectRenderablesSimple(instructionSet, renderer, currentLayer) {\n const { renderPipes } = renderer;\n renderPipes.blendMode.pushBlendMode(this, this.groupBlendMode, instructionSet);\n const rp = renderPipes;\n const pipe = rp[this.renderPipeId];\n if (pipe?.addRenderable) {\n pipe.addRenderable(this, instructionSet);\n }\n this.didViewUpdate = false;\n const children = this.children;\n const length = children.length;\n for (let i = 0; i < length; i++) {\n children[i].collectRenderables(instructionSet, renderer, currentLayer);\n }\n renderPipes.blendMode.popBlendMode(instructionSet);\n }\n}\n\nexport { ViewContainer };\n//# sourceMappingURL=ViewContainer.mjs.map\n","import { ObservablePoint } from '../../maths/point/ObservablePoint.mjs';\nimport { Texture } from '../../rendering/renderers/shared/texture/Texture.mjs';\nimport { updateQuadBounds } from '../../utils/data/updateQuadBounds.mjs';\nimport { deprecation } from '../../utils/logging/deprecation.mjs';\nimport { ViewContainer } from '../view/ViewContainer.mjs';\n\n\"use strict\";\nclass Sprite extends ViewContainer {\n /**\n * @param options - The options for creating the sprite.\n */\n constructor(options = Texture.EMPTY) {\n if (options instanceof Texture) {\n options = { texture: options };\n }\n const { texture = Texture.EMPTY, anchor, roundPixels, width, height, ...rest } = options;\n super({\n label: \"Sprite\",\n ...rest\n });\n /** @internal */\n this.renderPipeId = \"sprite\";\n /** @internal */\n this.batched = true;\n this._visualBounds = { minX: 0, maxX: 1, minY: 0, maxY: 0 };\n this._anchor = new ObservablePoint(\n {\n _onUpdate: () => {\n this.onViewUpdate();\n }\n }\n );\n if (anchor) {\n this.anchor = anchor;\n } else if (texture.defaultAnchor) {\n this.anchor = texture.defaultAnchor;\n }\n this.texture = texture;\n this.allowChildren = false;\n this.roundPixels = roundPixels ?? false;\n if (width !== void 0) this.width = width;\n if (height !== void 0) this.height = height;\n }\n /**\n * Creates a new sprite based on a source texture, image, video, or canvas element.\n * This is a convenience method that automatically creates and manages textures.\n * @example\n * ```ts\n * // Create from path or URL\n * const sprite = Sprite.from('assets/image.png');\n *\n * // Create from existing texture\n * const sprite = Sprite.from(texture);\n *\n * // Create from canvas\n * const canvas = document.createElement('canvas');\n * const sprite = Sprite.from(canvas, true); // Skip caching new texture\n * ```\n * @param source - The source to create the sprite from. Can be a path to an image, a texture,\n * or any valid texture source (canvas, video, etc.)\n * @param skipCache - Whether to skip adding to the texture cache when creating a new texture\n * @returns A new sprite based on the source\n * @see {@link Texture.from} For texture creation details\n * @see {@link Assets} For asset loading and management\n */\n static from(source, skipCache = false) {\n if (source instanceof Texture) {\n return new Sprite(source);\n }\n return new Sprite(Texture.from(source, skipCache));\n }\n set texture(value) {\n value || (value = Texture.EMPTY);\n const currentTexture = this._texture;\n if (currentTexture === value) return;\n if (currentTexture && currentTexture.dynamic) currentTexture.off(\"update\", this.onViewUpdate, this);\n if (value.dynamic) value.on(\"update\", this.onViewUpdate, this);\n this._texture = value;\n if (this._width) {\n this._setWidth(this._width, this._texture.orig.width);\n }\n if (this._height) {\n this._setHeight(this._height, this._texture.orig.height);\n }\n this.onViewUpdate();\n }\n /**\n * The texture that is displayed by the sprite. When changed, automatically updates\n * the sprite dimensions and manages texture event listeners.\n * @example\n * ```ts\n * // Create sprite with texture\n * const sprite = new Sprite({\n * texture: Texture.from('sprite.png')\n * });\n *\n * // Update texture\n * sprite.texture = Texture.from('newSprite.png');\n *\n * // Use texture from spritesheet\n * const sheet = await Assets.load('spritesheet.json');\n * sprite.texture = sheet.textures['frame1.png'];\n *\n * // Reset to empty texture\n * sprite.texture = Texture.EMPTY;\n * ```\n * @see {@link Texture} For texture creation and management\n * @see {@link Assets} For asset loading\n */\n get texture() {\n return this._texture;\n }\n /**\n * The bounds of the sprite, taking into account the texture's trim area.\n * @example\n * ```ts\n * const texture = new Texture({\n * source: new TextureSource({ width: 300, height: 300 }),\n * frame: new Rectangle(196, 66, 58, 56),\n * trim: new Rectangle(4, 4, 58, 56),\n * orig: new Rectangle(0, 0, 64, 64),\n * rotate: 2,\n * });\n * const sprite = new Sprite(texture);\n * const visualBounds = sprite.visualBounds;\n * // console.log(visualBounds); // { minX: -4, maxX: 62, minY: -4, maxY: 60 }\n */\n get visualBounds() {\n updateQuadBounds(this._visualBounds, this._anchor, this._texture);\n return this._visualBounds;\n }\n /**\n * @deprecated\n * @ignore\n */\n get sourceBounds() {\n deprecation(\"8.6.1\", \"Sprite.sourceBounds is deprecated, use visualBounds instead.\");\n return this.visualBounds;\n }\n /** @private */\n updateBounds() {\n const anchor = this._anchor;\n const texture = this._texture;\n const bounds = this._bounds;\n const { width, height } = texture.orig;\n bounds.minX = -anchor._x * width;\n bounds.maxX = bounds.minX + width;\n bounds.minY = -anchor._y * height;\n bounds.maxY = bounds.minY + height;\n }\n /**\n * Destroys this sprite renderable and optionally its texture.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @example\n * sprite.destroy();\n * sprite.destroy(true);\n * sprite.destroy({ texture: true, textureSource: true });\n */\n destroy(options = false) {\n super.destroy(options);\n const destroyTexture = typeof options === \"boolean\" ? options : options?.texture;\n if (destroyTexture) {\n const destroyTextureSource = typeof options === \"boolean\" ? options : options?.textureSource;\n this._texture.destroy(destroyTextureSource);\n }\n this._texture = null;\n this._visualBounds = null;\n this._bounds = null;\n this._anchor = null;\n }\n /**\n * The anchor sets the origin point of the sprite. The default value is taken from the {@link 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 * - Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.\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 * ```ts\n * // Center the anchor point\n * sprite.anchor = 0.5; // Sets both x and y to 0.5\n * sprite.position.set(400, 300); // Sprite will be centered at this position\n *\n * // Set specific x/y anchor points\n * sprite.anchor = {\n * x: 1, // Right edge\n * y: 0 // Top edge\n * };\n *\n * // Using individual coordinates\n * sprite.anchor.set(0.5, 1); // Center-bottom\n *\n * // For rotation around center\n * sprite.anchor.set(0.5);\n * sprite.rotation = Math.PI / 4; // 45 degrees around center\n *\n * // For scaling from center\n * sprite.anchor.set(0.5);\n * sprite.scale.set(2); // Scales from center point\n * ```\n */\n get anchor() {\n return this._anchor;\n }\n set anchor(value) {\n typeof value === \"number\" ? this._anchor.set(value) : this._anchor.copyFrom(value);\n }\n /**\n * The width of the sprite, setting this will actually modify the scale to achieve the value set.\n * @example\n * ```ts\n * // Set width directly\n * sprite.width = 200;\n * console.log(sprite.scale.x); // Scale adjusted to match width\n *\n * // Set width while preserving aspect ratio\n * const ratio = sprite.height / sprite.width;\n * sprite.width = 300;\n * sprite.height = 300 * ratio;\n *\n * // For better performance when setting both width and height\n * sprite.setSize(300, 400); // Avoids recalculating bounds twice\n *\n * // Reset to original texture size\n * sprite.width = sprite.texture.orig.width;\n * ```\n */\n get width() {\n return Math.abs(this.scale.x) * this._texture.orig.width;\n }\n set width(value) {\n this._setWidth(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 * @example\n * ```ts\n * // Set height directly\n * sprite.height = 150;\n * console.log(sprite.scale.y); // Scale adjusted to match height\n *\n * // Set height while preserving aspect ratio\n * const ratio = sprite.width / sprite.height;\n * sprite.height = 200;\n * sprite.width = 200 * ratio;\n *\n * // For better performance when setting both width and height\n * sprite.setSize(300, 400); // Avoids recalculating bounds twice\n *\n * // Reset to original texture size\n * sprite.height = sprite.texture.orig.height;\n * ```\n */\n get height() {\n return Math.abs(this.scale.y) * this._texture.orig.height;\n }\n set height(value) {\n this._setHeight(value, this._texture.orig.height);\n this._height = value;\n }\n /**\n * Retrieves the size of the Sprite as a [Size]{@link Size} object based on the texture dimensions and scale.\n * This is faster than getting width and height separately as it only calculates the bounds once.\n * @example\n * ```ts\n * // Basic size retrieval\n * const sprite = new Sprite(Texture.from('sprite.png'));\n * const size = sprite.getSize();\n * console.log(`Size: ${size.width}x${size.height}`);\n *\n * // Reuse existing size object\n * const reuseSize = { width: 0, height: 0 };\n * sprite.getSize(reuseSize);\n * ```\n * @param out - Optional object to store the size in, to avoid allocating a new object\n * @returns The size of the Sprite\n * @see {@link Sprite#width} For getting just the width\n * @see {@link Sprite#height} For getting just the height\n * @see {@link Sprite#setSize} For setting both width and height\n */\n getSize(out) {\n out || (out = {});\n out.width = Math.abs(this.scale.x) * this._texture.orig.width;\n out.height = Math.abs(this.scale.y) * this._texture.orig.height;\n return out;\n }\n /**\n * Sets the size of the Sprite to the specified width and height.\n * This is faster than setting width and height separately as it only recalculates bounds once.\n * @example\n * ```ts\n * // Basic size setting\n * const sprite = new Sprite(Texture.from('sprite.png'));\n * sprite.setSize(100, 200); // Width: 100, Height: 200\n *\n * // Set uniform size\n * sprite.setSize(100); // Sets both width and height to 100\n *\n * // Set size with object\n * sprite.setSize({\n * width: 200,\n * height: 300\n * });\n *\n * // Reset to texture size\n * sprite.setSize(\n * sprite.texture.orig.width,\n * sprite.texture.orig.height\n * );\n * ```\n * @param value - This can be either a number or a {@link Size} object\n * @param height - The height to set. Defaults to the value of `width` if not provided\n * @see {@link Sprite#width} For setting width only\n * @see {@link Sprite#height} For setting height only\n * @see {@link Sprite#texture} For the source dimensions\n */\n setSize(value, height) {\n if (typeof value === \"object\") {\n height = value.height ?? value.width;\n value = value.width;\n } else {\n height ?? (height = value);\n }\n value !== void 0 && this._setWidth(value, this._texture.orig.width);\n height !== void 0 && this._setHeight(height, this._texture.orig.height);\n }\n}\n\nexport { Sprite };\n//# sourceMappingURL=Sprite.mjs.map\n","import { Bounds } from '../../../scene/container/bounds/Bounds.mjs';\nimport { getGlobalBounds } from '../../../scene/container/bounds/getGlobalBounds.mjs';\n\n\"use strict\";\nconst tempBounds = new Bounds();\nfunction addMaskBounds(mask, bounds, skipUpdateTransform) {\n const boundsToMask = tempBounds;\n mask.measurable = true;\n getGlobalBounds(mask, skipUpdateTransform, boundsToMask);\n bounds.addBoundsMask(boundsToMask);\n mask.measurable = false;\n}\n\nexport { addMaskBounds };\n//# sourceMappingURL=addMaskBounds.mjs.map\n","import { getLocalBounds } from '../../../scene/container/bounds/getLocalBounds.mjs';\nimport { boundsPool, matrixPool } from '../../../scene/container/bounds/utils/matrixAndBoundsPool.mjs';\nimport { warn } from '../../../utils/logging/warn.mjs';\n\n\"use strict\";\nfunction addMaskLocalBounds(mask, bounds, localRoot) {\n const boundsToMask = boundsPool.get();\n mask.measurable = true;\n const tempMatrix = matrixPool.get().identity();\n const relativeMask = getMatrixRelativeToParent(mask, localRoot, tempMatrix);\n getLocalBounds(mask, boundsToMask, relativeMask);\n mask.measurable = false;\n bounds.addBoundsMask(boundsToMask);\n matrixPool.return(tempMatrix);\n boundsPool.return(boundsToMask);\n}\nfunction getMatrixRelativeToParent(target, root, matrix) {\n if (!target) {\n warn(\"Mask bounds, renderable is not inside the root container\");\n return matrix;\n }\n if (target !== root) {\n getMatrixRelativeToParent(target.parent, root, matrix);\n target.updateLocalTransform();\n matrix.append(target.localTransform);\n }\n return matrix;\n}\n\nexport { addMaskLocalBounds };\n//# sourceMappingURL=addMaskLocalBounds.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { Sprite } from '../../../scene/sprite/Sprite.mjs';\nimport { addMaskBounds } from '../utils/addMaskBounds.mjs';\nimport { addMaskLocalBounds } from '../utils/addMaskLocalBounds.mjs';\n\n\"use strict\";\nclass AlphaMask {\n constructor(options) {\n this.priority = 0;\n this.inverse = false;\n this.channel = \"red\";\n this.pipe = \"alphaMask\";\n if (options?.mask) {\n this.init(options.mask);\n }\n }\n init(mask) {\n this.mask = mask;\n this.renderMaskToTexture = !(mask instanceof Sprite);\n this.mask.renderable = this.renderMaskToTexture;\n this.mask.includeInBuild = !this.renderMaskToTexture;\n this.mask.measurable = false;\n }\n reset() {\n if (this.mask === null) return;\n this.mask.measurable = true;\n this.mask = null;\n }\n addBounds(bounds, skipUpdateTransform) {\n if (!this.inverse) {\n addMaskBounds(this.mask, bounds, skipUpdateTransform);\n }\n }\n addLocalBounds(bounds, localRoot) {\n addMaskLocalBounds(this.mask, bounds, localRoot);\n }\n containsPoint(point, hitTestFn) {\n const mask = this.mask;\n return hitTestFn(mask, point);\n }\n destroy() {\n this.reset();\n }\n static test(mask) {\n return mask instanceof Sprite;\n }\n}\nAlphaMask.extension = ExtensionType.MaskEffect;\n\nexport { AlphaMask };\n//# sourceMappingURL=AlphaMask.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\n\n\"use strict\";\nclass ColorMask {\n constructor(options) {\n this.priority = 0;\n this.pipe = \"colorMask\";\n if (options?.mask) {\n this.init(options.mask);\n }\n }\n init(mask) {\n this.mask = mask;\n }\n destroy() {\n }\n static test(mask) {\n return typeof mask === \"number\";\n }\n}\nColorMask.extension = ExtensionType.MaskEffect;\n\nexport { ColorMask };\n//# sourceMappingURL=ColorMask.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { Container } from '../../../scene/container/Container.mjs';\nimport { addMaskBounds } from '../utils/addMaskBounds.mjs';\nimport { addMaskLocalBounds } from '../utils/addMaskLocalBounds.mjs';\n\n\"use strict\";\nclass StencilMask {\n constructor(options) {\n this.priority = 0;\n this.pipe = \"stencilMask\";\n if (options?.mask) {\n this.init(options.mask);\n }\n }\n init(mask) {\n this.mask = mask;\n this.mask.includeInBuild = false;\n this.mask.measurable = false;\n }\n reset() {\n if (this.mask === null) return;\n this.mask.measurable = true;\n this.mask.includeInBuild = true;\n this.mask = null;\n }\n addBounds(bounds, skipUpdateTransform) {\n addMaskBounds(this.mask, bounds, skipUpdateTransform);\n }\n addLocalBounds(bounds, localRoot) {\n addMaskLocalBounds(this.mask, bounds, localRoot);\n }\n containsPoint(point, hitTestFn) {\n const mask = this.mask;\n return hitTestFn(mask, point);\n }\n destroy() {\n this.reset();\n }\n static test(mask) {\n return mask instanceof Container;\n }\n}\nStencilMask.extension = ExtensionType.MaskEffect;\n\nexport { StencilMask };\n//# sourceMappingURL=StencilMask.mjs.map\n","\"use strict\";\nconst BrowserAdapter = {\n createCanvas: (width, height) => {\n const canvas = document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n return canvas;\n },\n createImage: () => new Image(),\n getCanvasRenderingContext2D: () => CanvasRenderingContext2D,\n getWebGLRenderingContext: () => WebGLRenderingContext,\n getNavigator: () => navigator,\n getBaseUrl: () => document.baseURI ?? window.location.href,\n getFontFaceSet: () => document.fonts,\n fetch: (url, options) => fetch(url, options),\n parseXML: (xml) => {\n const parser = new DOMParser();\n return parser.parseFromString(xml, \"text/xml\");\n }\n};\n\nexport { BrowserAdapter };\n//# sourceMappingURL=BrowserAdapter.mjs.map\n","import { BrowserAdapter } from '../environment-browser/BrowserAdapter.mjs';\n\n\"use strict\";\nlet currentAdapter = BrowserAdapter;\nconst DOMAdapter = {\n /**\n * Returns the current adapter.\n * @returns {environment.Adapter} The current adapter.\n */\n get() {\n return currentAdapter;\n },\n /**\n * Sets the current adapter.\n * @param adapter - The new adapter.\n */\n set(adapter) {\n currentAdapter = adapter;\n }\n};\n\nexport { DOMAdapter };\n//# sourceMappingURL=adapter.mjs.map\n","import { DOMAdapter } from '../../../../../environment/adapter.mjs';\nimport { ExtensionType } from '../../../../../extensions/Extensions.mjs';\nimport { TextureSource } from './TextureSource.mjs';\n\n\"use strict\";\nclass CanvasSource extends TextureSource {\n constructor(options) {\n if (!options.resource) {\n options.resource = DOMAdapter.get().createCanvas();\n }\n if (!options.width) {\n options.width = options.resource.width;\n if (!options.autoDensity) {\n options.width /= options.resolution;\n }\n }\n if (!options.height) {\n options.height = options.resource.height;\n if (!options.autoDensity) {\n options.height /= options.resolution;\n }\n }\n super(options);\n this.uploadMethodId = \"image\";\n this.autoDensity = options.autoDensity;\n this.resizeCanvas();\n this.transparent = !!options.transparent;\n }\n resizeCanvas() {\n if (this.autoDensity && \"style\" in this.resource) {\n this.resource.style.width = `${this.width}px`;\n this.resource.style.height = `${this.height}px`;\n }\n if (this.resource.width !== this.pixelWidth || this.resource.height !== this.pixelHeight) {\n this.resource.width = this.pixelWidth;\n this.resource.height = this.pixelHeight;\n }\n }\n resize(width = this.width, height = this.height, resolution = this._resolution) {\n const didResize = super.resize(width, height, resolution);\n if (didResize) {\n this.resizeCanvas();\n }\n return didResize;\n }\n static test(resource) {\n return globalThis.HTMLCanvasElement && resource instanceof HTMLCanvasElement || globalThis.OffscreenCanvas && resource instanceof OffscreenCanvas;\n }\n /**\n * Returns the 2D rendering context for the canvas.\n * Caches the context after creating it.\n * @returns The 2D rendering context of the canvas.\n */\n get context2D() {\n return this._context2D || (this._context2D = this.resource.getContext(\"2d\"));\n }\n}\nCanvasSource.extension = ExtensionType.TextureSource;\n\nexport { CanvasSource };\n//# sourceMappingURL=CanvasSource.mjs.map\n","import { ExtensionType } from '../../../../../extensions/Extensions.mjs';\nimport { TextureSource } from './TextureSource.mjs';\n\n\"use strict\";\nclass ImageSource extends TextureSource {\n constructor(options) {\n super(options);\n this.uploadMethodId = \"image\";\n this.autoGarbageCollect = true;\n }\n static test(resource) {\n return globalThis.HTMLImageElement && resource instanceof HTMLImageElement || typeof ImageBitmap !== \"undefined\" && resource instanceof ImageBitmap || globalThis.VideoFrame && resource instanceof VideoFrame;\n }\n}\nImageSource.extension = ExtensionType.TextureSource;\n\nexport { ImageSource };\n//# sourceMappingURL=ImageSource.mjs.map\n","\"use strict\";\nvar UPDATE_PRIORITY = /* @__PURE__ */ ((UPDATE_PRIORITY2) => {\n UPDATE_PRIORITY2[UPDATE_PRIORITY2[\"INTERACTION\"] = 50] = \"INTERACTION\";\n UPDATE_PRIORITY2[UPDATE_PRIORITY2[\"HIGH\"] = 25] = \"HIGH\";\n UPDATE_PRIORITY2[UPDATE_PRIORITY2[\"NORMAL\"] = 0] = \"NORMAL\";\n UPDATE_PRIORITY2[UPDATE_PRIORITY2[\"LOW\"] = -25] = \"LOW\";\n UPDATE_PRIORITY2[UPDATE_PRIORITY2[\"UTILITY\"] = -50] = \"UTILITY\";\n return UPDATE_PRIORITY2;\n})(UPDATE_PRIORITY || {});\n\nexport { UPDATE_PRIORITY };\n//# sourceMappingURL=const.mjs.map\n","\"use strict\";\nclass TickerListener {\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, context = null, priority = 0, once = false) {\n /** The next item in chain. */\n this.next = null;\n /** The previous item in chain. */\n this.previous = null;\n /** `true` if this listener has been destroyed already. */\n this._destroyed = false;\n this._fn = fn;\n this._context = context;\n this.priority = priority;\n this._once = once;\n }\n /**\n * Simple compare function to figure out if a function and context match.\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, context = null) {\n return this._fn === fn && this._context === context;\n }\n /**\n * Emit by calling the current function.\n * @param ticker - The ticker emitting.\n * @returns Next ticker\n */\n emit(ticker) {\n if (this._fn) {\n if (this._context) {\n this._fn.call(this._context, ticker);\n } else {\n this._fn(ticker);\n }\n }\n const redirect = this.next;\n if (this._once) {\n this.destroy(true);\n }\n if (this._destroyed) {\n this.next = null;\n }\n return redirect;\n }\n /**\n * Connect to the list.\n * @param previous - Input node, previous listener\n */\n connect(previous) {\n this.previous = previous;\n if (previous.next) {\n previous.next.previous = this;\n }\n this.next = previous.next;\n previous.next = this;\n }\n /**\n * Destroy and don't use after this.\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) {\n this._destroyed = true;\n this._fn = null;\n this._context = null;\n if (this.previous) {\n this.previous.next = this.next;\n }\n if (this.next) {\n this.next.previous = this.previous;\n }\n const redirect = this.next;\n this.next = hard ? null : redirect;\n this.previous = null;\n return redirect;\n }\n}\n\nexport { TickerListener };\n//# sourceMappingURL=TickerListener.mjs.map\n","import { UPDATE_PRIORITY } from './const.mjs';\nimport { TickerListener } from './TickerListener.mjs';\n\n\"use strict\";\nconst _Ticker = class _Ticker {\n constructor() {\n /**\n * Whether or not this ticker should invoke the method {@link Ticker#start|start}\n * automatically when a listener is added.\n * @example\n * ```ts\n * // Default behavior (manual start)\n * const ticker = new Ticker();\n * ticker.autoStart = false;\n * ticker.add(() => {\n * // Won't run until ticker.start() is called\n * });\n *\n * // Auto-start behavior\n * const autoTicker = new Ticker();\n * autoTicker.autoStart = true;\n * autoTicker.add(() => {\n * // Runs immediately when added\n * });\n * ```\n * @default false\n * @see {@link Ticker#start} For manually starting the ticker\n * @see {@link Ticker#stop} For manually stopping the ticker\n */\n this.autoStart = false;\n /**\n * Scalar representing the delta time factor.\n * This is a dimensionless value representing the fraction of a frame at the target framerate.\n * At 60 FPS, this value is typically around 1.0.\n *\n * This is NOT in milliseconds - it's a scalar multiplier for frame-independent animations.\n * For actual milliseconds, use {@link Ticker#deltaMS}.\n * @example\n * ```ts\n * // Frame-independent animation using deltaTime scalar\n * ticker.add((ticker) => {\n * // Rotate sprite by 0.1 radians per frame, scaled by deltaTime\n * sprite.rotation += 0.1 * ticker.deltaTime;\n * });\n * ```\n */\n this.deltaTime = 1;\n /**\n * The last time update was invoked, in milliseconds since epoch.\n * Similar to performance.now() timestamp format.\n *\n * Used internally for calculating time deltas between frames.\n * @example\n * ```ts\n * ticker.add((ticker) => {\n * const currentTime = performance.now();\n * const timeSinceLastFrame = currentTime - ticker.lastTime;\n * console.log(`Time since last frame: ${timeSinceLastFrame}ms`);\n * });\n * ```\n */\n this.lastTime = -1;\n /**\n * Factor of current {@link Ticker#deltaTime|deltaTime}.\n * Used to scale time for slow motion or fast-forward effects.\n * @example\n * ```ts\n * // Basic speed adjustment\n * ticker.speed = 0.5; // Half speed (slow motion)\n * ticker.speed = 2.0; // Double speed (fast forward)\n *\n * // Temporary speed changes\n * function slowMotion() {\n * const normalSpeed = ticker.speed;\n * ticker.speed = 0.2;\n * setTimeout(() => {\n * ticker.speed = normalSpeed;\n * }, 1000);\n * }\n * ```\n */\n this.speed = 1;\n /**\n * Whether or not this ticker has been started.\n *\n * `true` if {@link Ticker#start|start} has been called.\n * `false` if {@link Ticker#stop|Stop} has been called.\n *\n * While `false`, this value may change to `true` in the\n * event of {@link Ticker#autoStart|autoStart} being `true`\n * and a listener is added.\n * @example\n * ```ts\n * // Check ticker state\n * const ticker = new Ticker();\n * console.log(ticker.started); // false\n *\n * // Start and verify\n * ticker.start();\n * console.log(ticker.started); // true\n * ```\n */\n this.started = false;\n /** Internal current frame request ID */\n this._requestId = null;\n /**\n * Internal value managed by minFPS property setter and getter.\n * This is the maximum allowed milliseconds between updates.\n */\n this._maxElapsedMS = 100;\n /**\n * Internal value managed by maxFPS property setter and getter.\n * This is the minimum allowed milliseconds between updates.\n */\n this._minElapsedMS = 0;\n /** If enabled, deleting is disabled.*/\n this._protected = false;\n /** The last time keyframe was executed. Maintains a relatively fixed interval with the previous value. */\n this._lastFrame = -1;\n this._head = new TickerListener(null, null, Infinity);\n this.deltaMS = 1 / _Ticker.targetFPMS;\n this.elapsedMS = 1 / _Ticker.targetFPMS;\n this._tick = (time) => {\n this._requestId = null;\n if (this.started) {\n this.update(time);\n if (this.started && this._requestId === null && this._head.next) {\n this._requestId = requestAnimationFrame(this._tick);\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 */\n _requestIfNeeded() {\n if (this._requestId === null && this._head.next) {\n this.lastTime = performance.now();\n this._lastFrame = this.lastTime;\n this._requestId = requestAnimationFrame(this._tick);\n }\n }\n /** Conditionally cancels a pending animation frame. */\n _cancelIfNeeded() {\n if (this._requestId !== null) {\n cancelAnimationFrame(this._requestId);\n this._requestId = null;\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 */\n _startIfPossible() {\n if (this.started) {\n this._requestIfNeeded();\n } else if (this.autoStart) {\n this.start();\n }\n }\n /**\n * Register a handler for tick events.\n * @param fn - The listener function to add. Receives the Ticker instance as parameter\n * @param context - The context for the listener\n * @param priority - The priority of the listener\n * @example\n * ```ts\n * // Access time properties through the ticker parameter\n * ticker.add((ticker) => {\n * // Use deltaTime (dimensionless scalar) for frame-independent animations\n * sprite.rotation += 0.1 * ticker.deltaTime;\n *\n * // Use deltaMS (milliseconds) for time-based calculations\n * const progress = ticker.deltaMS / animationDuration;\n *\n * // Use elapsedMS for raw timing measurements\n * console.log(`Raw frame time: ${ticker.elapsedMS}ms`);\n * });\n * ```\n */\n add(fn, context, priority = UPDATE_PRIORITY.NORMAL) {\n return this._addListener(new TickerListener(fn, context, priority));\n }\n /**\n * Add a handler for the tick event which is only executed once on the next frame.\n * @example\n * ```ts\n * // Basic one-time update\n * ticker.addOnce(() => {\n * console.log('Runs next frame only');\n * });\n *\n * // With specific context\n * const game = {\n * init(ticker) {\n * this.loadResources();\n * console.log('Game initialized');\n * }\n * };\n * ticker.addOnce(game.init, game);\n *\n * // With priority\n * ticker.addOnce(\n * () => {\n * // High priority one-time setup\n * physics.init();\n * },\n * undefined,\n * UPDATE_PRIORITY.HIGH\n * );\n * ```\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 (default: UPDATE_PRIORITY.NORMAL)\n * @returns This instance of a ticker\n * @see {@link Ticker#add} For continuous updates\n * @see {@link Ticker#remove} For removing handlers\n */\n addOnce(fn, context, priority = UPDATE_PRIORITY.NORMAL) {\n return this._addListener(new TickerListener(fn, context, priority, true));\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 _addListener(listener) {\n let current = this._head.next;\n let previous = this._head;\n if (!current) {\n listener.connect(previous);\n } else {\n while (current) {\n if (listener.priority > current.priority) {\n listener.connect(previous);\n break;\n }\n previous = current;\n current = current.next;\n }\n if (!listener.previous) {\n listener.connect(previous);\n }\n }\n this._startIfPossible();\n return this;\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 * @example\n * ```ts\n * // Basic removal\n * const onTick = () => {\n * sprite.rotation += 0.1;\n * };\n * ticker.add(onTick);\n * ticker.remove(onTick);\n *\n * // Remove with context\n * const game = {\n * update(ticker) {\n * this.physics.update(ticker.deltaTime);\n * }\n * };\n * ticker.add(game.update, game);\n * ticker.remove(game.update, game);\n *\n * // Remove all matching handlers\n * // (if same function was added multiple times)\n * ticker.add(onTick);\n * ticker.add(onTick);\n * ticker.remove(onTick); // Removes all instances\n * ```\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 * @see {@link Ticker#add} For adding handlers\n * @see {@link Ticker#addOnce} For one-time handlers\n */\n remove(fn, context) {\n let listener = this._head.next;\n while (listener) {\n if (listener.match(fn, context)) {\n listener = listener.destroy();\n } else {\n listener = listener.next;\n }\n }\n if (!this._head.next) {\n this._cancelIfNeeded();\n }\n return this;\n }\n /**\n * The number of listeners on this ticker, calculated by walking through linked list.\n * @example\n * ```ts\n * // Check number of active listeners\n * const ticker = new Ticker();\n * console.log(ticker.count); // 0\n *\n * // Add some listeners\n * ticker.add(() => {});\n * ticker.add(() => {});\n * console.log(ticker.count); // 2\n *\n * // Check after cleanup\n * ticker.destroy();\n * console.log(ticker.count); // 0\n * ```\n * @readonly\n * @see {@link Ticker#add} For adding listeners\n * @see {@link Ticker#remove} For removing listeners\n */\n get count() {\n if (!this._head) {\n return 0;\n }\n let count = 0;\n let current = this._head;\n while (current = current.next) {\n count++;\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 * @example\n * ```ts\n * // Basic manual start\n * const ticker = new Ticker();\n * ticker.add(() => {\n * // Animation code here\n * });\n * ticker.start();\n * ```\n * @see {@link Ticker#stop} For stopping the ticker\n * @see {@link Ticker#autoStart} For automatic starting\n * @see {@link Ticker#started} For checking ticker state\n */\n start() {\n if (!this.started) {\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 * @example\n * ```ts\n * // Basic stop\n * const ticker = new Ticker();\n * ticker.stop();\n * ```\n * @see {@link Ticker#start} For starting the ticker\n * @see {@link Ticker#started} For checking ticker state\n * @see {@link Ticker#destroy} For cleaning up the ticker\n */\n stop() {\n if (this.started) {\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 * @example\n * ```ts\n * // Clean up with active listeners\n * const ticker = new Ticker();\n * ticker.add(() => {});\n * ticker.destroy(); // Removes all listeners\n * ```\n * @see {@link Ticker#stop} For stopping without destroying\n * @see {@link Ticker#remove} For removing specific listeners\n */\n destroy() {\n if (!this._protected) {\n this.stop();\n let listener = this._head.next;\n while (listener) {\n listener = listener.destroy(true);\n }\n this._head.destroy();\n this._head = null;\n }\n }\n /**\n * Triggers an update.\n *\n * An update entails setting the\n * current {@link Ticker#elapsedMS|elapsedMS},\n * the current {@link Ticker#deltaTime|deltaTime},\n * invoking all listeners with current deltaTime,\n * and then finally setting {@link Ticker#lastTime|lastTime}\n * with the value of currentTime that was provided.\n *\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 * @example\n * ```ts\n * // Basic manual update\n * const ticker = new Ticker();\n * ticker.update(performance.now());\n * ```\n * @param currentTime - The current time of execution (defaults to performance.now())\n * @see {@link Ticker#deltaTime} For frame delta value\n * @see {@link Ticker#elapsedMS} For raw elapsed time\n */\n update(currentTime = performance.now()) {\n let elapsedMS;\n if (currentTime > this.lastTime) {\n elapsedMS = this.elapsedMS = currentTime - this.lastTime;\n if (elapsedMS > this._maxElapsedMS) {\n elapsedMS = this._maxElapsedMS;\n }\n elapsedMS *= this.speed;\n if (this._minElapsedMS) {\n const delta = currentTime - this._lastFrame | 0;\n if (delta < this._minElapsedMS) {\n return;\n }\n this._lastFrame = currentTime - delta % this._minElapsedMS;\n }\n this.deltaMS = elapsedMS;\n this.deltaTime = this.deltaMS * _Ticker.targetFPMS;\n const head = this._head;\n let listener = head.next;\n while (listener) {\n listener = listener.emit(this);\n }\n if (!head.next) {\n this._cancelIfNeeded();\n }\n } else {\n this.deltaTime = this.deltaMS = this.elapsedMS = 0;\n }\n this.lastTime = currentTime;\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 Ticker#speed|speed}, which is specific\n * > to scaling {@link Ticker#deltaTime|deltaTime}.\n * @example\n * ```ts\n * // Basic FPS monitoring\n * ticker.add(() => {\n * console.log(`Current FPS: ${Math.round(ticker.FPS)}`);\n * });\n * ```\n * @readonly\n */\n get FPS() {\n return 1e3 / this.elapsedMS;\n }\n /**\n * Manages the maximum amount of milliseconds allowed to\n * elapse between invoking {@link Ticker#update|update}.\n *\n * This value is used to cap {@link Ticker#deltaTime|deltaTime},\n * but does not effect the measured value of {@link Ticker#FPS|FPS}.\n *\n * When setting this property it is clamped to a value between\n * `0` and `Ticker.targetFPMS * 1000` (typically 60).\n *\n * If `maxFPS` is currently set (non-zero) and `minFPS` is set above it,\n * `maxFPS` is automatically raised to match. This keeps the two limits consistent.\n * @example\n * ```ts\n * // Set minimum acceptable frame rate\n * const ticker = new Ticker();\n * ticker.minFPS = 30; // Never go below 30 FPS\n *\n * // Use with maxFPS for frame rate clamping\n * ticker.minFPS = 30;\n * ticker.maxFPS = 60;\n *\n * // minFPS above maxFPS pushes maxFPS up\n * ticker.minFPS = 50; // maxFPS is raised to 50\n * ```\n * @default 10\n */\n get minFPS() {\n return 1e3 / this._maxElapsedMS;\n }\n set minFPS(fps) {\n const minFPMS = Math.min(Math.max(0, fps) / 1e3, _Ticker.targetFPMS);\n this._maxElapsedMS = 1 / minFPMS;\n if (this._minElapsedMS && fps > this.maxFPS) {\n this.maxFPS = fps;\n }\n }\n /**\n * Manages the minimum amount of milliseconds required to\n * elapse between invoking {@link Ticker#update|update}.\n *\n * This will effect the measured value of {@link Ticker#FPS|FPS}.\n *\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 *\n * If `maxFPS` is set below the current `minFPS`, `minFPS` is automatically lowered to match.\n * This keeps the two limits consistent.\n * @example\n * ```ts\n * // Cap the frame rate\n * const ticker = new Ticker();\n * ticker.maxFPS = 60; // Never go above 60 FPS\n *\n * // Use with minFPS for frame rate clamping\n * ticker.minFPS = 30;\n * ticker.maxFPS = 60;\n *\n * // maxFPS below minFPS pushes minFPS down\n * ticker.maxFPS = 20; // minFPS is now also 20\n * ```\n * @default 0\n */\n get maxFPS() {\n if (this._minElapsedMS) {\n return Math.round(1e3 / this._minElapsedMS);\n }\n return 0;\n }\n set maxFPS(fps) {\n if (fps === 0) {\n this._minElapsedMS = 0;\n } else {\n if (fps < this.minFPS) {\n this.minFPS = fps;\n }\n this._minElapsedMS = 1 / (fps / 1e3);\n }\n }\n /**\n * The shared ticker instance used by {@link AnimatedSprite} and by\n * {@link VideoSource} to update animation frames / video textures.\n *\n * It may also be used by {@link Application} if created with the `sharedTicker` option property set to true.\n *\n * The property {@link Ticker#autoStart|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 * import { Ticker } from 'pixi.js';\n *\n * const ticker = Ticker.shared;\n * // Set this to prevent starting this ticker when listeners are added.\n * // By default this is true only for the Ticker.shared instance.\n * ticker.autoStart = false;\n *\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 *\n * // Call this when you are ready for a running shared ticker.\n * ticker.start();\n * @example\n * import { autoDetectRenderer, Container } from 'pixi.js';\n *\n * // You may use the shared ticker to render...\n * const renderer = autoDetectRenderer();\n * const stage = new Container();\n * document.body.appendChild(renderer.view);\n * ticker.add((time) => renderer.render(stage));\n *\n * // Or you can just update it manually.\n * ticker.autoStart = false;\n * ticker.stop();\n * const animate = (time) => {\n * ticker.update(time);\n * renderer.render(stage);\n * requestAnimationFrame(animate);\n * };\n * animate(performance.now());\n * @type {Ticker}\n * @readonly\n */\n static get shared() {\n if (!_Ticker._shared) {\n const shared = _Ticker._shared = new _Ticker();\n shared.autoStart = true;\n shared._protected = true;\n }\n return _Ticker._shared;\n }\n /**\n * The system ticker instance used by {@link PrepareBase} for core timing\n * functionality that shouldn't usually need to be paused, unlike the `shared`\n * ticker which drives visual animations and rendering which may want to be paused.\n *\n * The property {@link Ticker#autoStart|autoStart} is set to `true` for this instance.\n * @type {Ticker}\n * @readonly\n * @advanced\n */\n static get system() {\n if (!_Ticker._system) {\n const system = _Ticker._system = new _Ticker();\n system.autoStart = true;\n system._protected = true;\n }\n return _Ticker._system;\n }\n};\n/**\n * Target frame rate in frames per millisecond.\n * Used for converting deltaTime to a scalar time delta.\n * @example\n * ```ts\n * // Default is 0.06 (60 FPS)\n * console.log(Ticker.targetFPMS); // 0.06\n *\n * // Calculate target frame duration\n * const frameDuration = 1 / Ticker.targetFPMS; // ≈ 16.67ms\n *\n * // Use in custom timing calculations\n * const deltaTime = elapsedMS * Ticker.targetFPMS;\n * ```\n * @remarks\n * - Default is 0.06 (equivalent to 60 FPS)\n * - Used in deltaTime calculations\n * - Affects all ticker instances\n * @default 0.06\n * @see {@link Ticker#deltaTime} For time scaling\n * @see {@link Ticker#FPS} For actual frame rate\n */\n_Ticker.targetFPMS = 0.06;\nlet Ticker = _Ticker;\n\nexport { Ticker };\n//# sourceMappingURL=Ticker.mjs.map\n","import { DOMAdapter } from '../../environment/adapter.mjs';\n\n\"use strict\";\nlet promise;\nasync function detectVideoAlphaMode() {\n promise ?? (promise = (async () => {\n const canvas = DOMAdapter.get().createCanvas(1, 1);\n const gl = canvas.getContext(\"webgl\");\n if (!gl) {\n return \"premultiply-alpha-on-upload\";\n }\n const video = await new Promise((resolve) => {\n const video2 = document.createElement(\"video\");\n video2.onloadeddata = () => resolve(video2);\n video2.onerror = () => resolve(null);\n video2.autoplay = false;\n video2.crossOrigin = \"anonymous\";\n video2.preload = \"auto\";\n video2.src = \"data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=\";\n video2.load();\n });\n if (!video) {\n return \"premultiply-alpha-on-upload\";\n }\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n const framebuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER,\n gl.COLOR_ATTACHMENT0,\n gl.TEXTURE_2D,\n texture,\n 0\n );\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);\n const pixel = new Uint8Array(4);\n gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);\n gl.deleteFramebuffer(framebuffer);\n gl.deleteTexture(texture);\n gl.getExtension(\"WEBGL_lose_context\")?.loseContext();\n return pixel[0] <= pixel[3] ? \"premultiplied-alpha\" : \"premultiply-alpha-on-upload\";\n })());\n return promise;\n}\n\nexport { detectVideoAlphaMode };\n//# sourceMappingURL=detectVideoAlphaMode.mjs.map\n","import { ExtensionType } from '../../../../../extensions/Extensions.mjs';\nimport { Ticker } from '../../../../../ticker/Ticker.mjs';\nimport { detectVideoAlphaMode } from '../../../../../utils/browser/detectVideoAlphaMode.mjs';\nimport { TextureSource } from './TextureSource.mjs';\n\n\"use strict\";\nconst _VideoSource = class _VideoSource extends TextureSource {\n constructor(options) {\n super(options);\n // Public\n /** Whether or not the video is ready to play. */\n this.isReady = false;\n /** The upload method for this texture. */\n this.uploadMethodId = \"video\";\n options = {\n ..._VideoSource.defaultOptions,\n ...options\n };\n this._autoUpdate = true;\n this._isConnectedToTicker = false;\n this._updateFPS = options.updateFPS || 0;\n this._msToNextUpdate = 0;\n this.autoPlay = options.autoPlay !== false;\n this.alphaMode = options.alphaMode ?? \"premultiply-alpha-on-upload\";\n this._videoFrameRequestCallback = this._videoFrameRequestCallback.bind(this);\n this._videoFrameRequestCallbackHandle = null;\n this._load = null;\n this._resolve = null;\n this._reject = null;\n this._onCanPlay = this._onCanPlay.bind(this);\n this._onCanPlayThrough = this._onCanPlayThrough.bind(this);\n this._onError = this._onError.bind(this);\n this._onPlayStart = this._onPlayStart.bind(this);\n this._onPlayStop = this._onPlayStop.bind(this);\n this._onSeeked = this._onSeeked.bind(this);\n this._onLoadedMetadata = this._onLoadedMetadata.bind(this);\n if (options.autoLoad !== false) {\n void this.load();\n }\n }\n /** Update the video frame if the source is not destroyed and meets certain conditions. */\n updateFrame() {\n if (this.destroyed) {\n return;\n }\n if (this._updateFPS) {\n const elapsedMS = Ticker.shared.elapsedMS * this.resource.playbackRate;\n this._msToNextUpdate = Math.floor(this._msToNextUpdate - elapsedMS);\n }\n if (!this._updateFPS || this._msToNextUpdate <= 0) {\n this._msToNextUpdate = this._updateFPS ? Math.floor(1e3 / this._updateFPS) : 0;\n }\n if (this.isValid) {\n this.update();\n }\n }\n /** Callback to update the video frame and potentially request the next frame update. */\n _videoFrameRequestCallback() {\n this.updateFrame();\n if (this.destroyed) {\n this._videoFrameRequestCallbackHandle = null;\n } else {\n this._videoFrameRequestCallbackHandle = this.resource.requestVideoFrameCallback(\n this._videoFrameRequestCallback\n );\n }\n }\n /**\n * Checks if the resource has valid dimensions.\n * @returns {boolean} True if width and height are set, otherwise false.\n */\n get isValid() {\n return !!this.resource.videoWidth && !!this.resource.videoHeight;\n }\n /**\n * Start preloading the video resource.\n * @returns {Promise<this>} Handle the validate event\n */\n async load() {\n if (this._load) {\n return this._load;\n }\n const source = this.resource;\n const options = this.options;\n if ((source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA) && source.width && source.height) {\n source.complete = true;\n }\n source.addEventListener(\"play\", this._onPlayStart);\n source.addEventListener(\"pause\", this._onPlayStop);\n source.addEventListener(\"seeked\", this._onSeeked);\n if (!this._isSourceReady()) {\n if (!options.preload) {\n source.addEventListener(\"canplay\", this._onCanPlay);\n }\n source.addEventListener(\"canplaythrough\", this._onCanPlayThrough);\n source.addEventListener(\"error\", this._onError, true);\n } else {\n this._mediaReady();\n }\n if (!this.isValid) {\n source.addEventListener(\"loadedmetadata\", this._onLoadedMetadata);\n }\n this.alphaMode = await detectVideoAlphaMode();\n this._load = new Promise((resolve, reject) => {\n if (this.isValid) {\n resolve(this);\n } else {\n this._resolve = resolve;\n this._reject = reject;\n if (options.preloadTimeoutMs !== void 0) {\n this._preloadTimeout = setTimeout(() => {\n this._onError(new ErrorEvent(`Preload exceeded timeout of ${options.preloadTimeoutMs}ms`));\n });\n }\n source.load();\n }\n });\n return this._load;\n }\n /**\n * Handle video error events.\n * @param event - The error event\n */\n _onError(event) {\n this.resource.removeEventListener(\"error\", this._onError, true);\n this.emit(\"error\", event);\n if (this._reject) {\n this._reject(event);\n this._reject = null;\n this._resolve = null;\n }\n }\n /**\n * Checks if the underlying source is playing.\n * @returns True if playing.\n */\n _isSourcePlaying() {\n const source = this.resource;\n return !source.paused && !source.ended;\n }\n /**\n * Checks if the underlying source is ready for playing.\n * @returns True if ready.\n */\n _isSourceReady() {\n const source = this.resource;\n return source.readyState > 2;\n }\n /** Runs the update loop when the video is ready to play. */\n _onPlayStart() {\n this._configureAutoUpdate();\n }\n /** Stops the update loop when a pause event is triggered. */\n _onPlayStop() {\n this._configureAutoUpdate();\n }\n /** Handles behavior when the video completes seeking to the current playback position. */\n _onSeeked() {\n if (this._autoUpdate && !this._isSourcePlaying()) {\n this._msToNextUpdate = 0;\n this.updateFrame();\n this._msToNextUpdate = 0;\n }\n }\n /** When intrinsic size becomes known after play / canplay (common with MediaStream). */\n _onLoadedMetadata() {\n if (!this.isValid) {\n return;\n }\n this._mediaReady();\n }\n _onCanPlay() {\n const source = this.resource;\n source.removeEventListener(\"canplay\", this._onCanPlay);\n this._mediaReady();\n }\n _onCanPlayThrough() {\n const source = this.resource;\n source.removeEventListener(\"canplaythrough\", this._onCanPlayThrough);\n if (this._preloadTimeout) {\n clearTimeout(this._preloadTimeout);\n this._preloadTimeout = void 0;\n }\n this._mediaReady();\n }\n /** Fired when the video is loaded and ready to play. */\n _mediaReady() {\n const source = this.resource;\n if (this.isValid) {\n this.isReady = true;\n this.resize(source.videoWidth, source.videoHeight);\n }\n this._msToNextUpdate = 0;\n this.updateFrame();\n this._msToNextUpdate = 0;\n if (this._resolve && this.isValid) {\n this._resolve(this);\n this._resolve = null;\n this._reject = null;\n }\n if (this._isSourcePlaying()) {\n this._onPlayStart();\n } else if (this.autoPlay) {\n void this.resource.play();\n }\n }\n /** Cleans up resources and event listeners associated with this texture. */\n destroy() {\n this._configureAutoUpdate();\n const source = this.resource;\n if (source) {\n source.removeEventListener(\"play\", this._onPlayStart);\n source.removeEventListener(\"pause\", this._onPlayStop);\n source.removeEventListener(\"seeked\", this._onSeeked);\n source.removeEventListener(\"canplay\", this._onCanPlay);\n source.removeEventListener(\"canplaythrough\", this._onCanPlayThrough);\n source.removeEventListener(\"loadedmetadata\", this._onLoadedMetadata);\n source.removeEventListener(\"error\", this._onError, true);\n source.pause();\n source.src = \"\";\n source.load();\n }\n super.destroy();\n }\n /** Should the base texture automatically update itself, set to true by default. */\n get autoUpdate() {\n return this._autoUpdate;\n }\n set autoUpdate(value) {\n if (value !== this._autoUpdate) {\n this._autoUpdate = value;\n this._configureAutoUpdate();\n }\n }\n /**\n * How many times a second to update the texture from the video.\n * 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() {\n return this._updateFPS;\n }\n set updateFPS(value) {\n if (value !== this._updateFPS) {\n this._updateFPS = value;\n this._configureAutoUpdate();\n }\n }\n /**\n * Configures the updating mechanism based on the current state and settings.\n *\n * This method decides between using the browser's native video frame callback or a custom ticker\n * for updating the video frame. It ensures optimal performance and responsiveness\n * based on the video's state, playback status, and the desired frames-per-second setting.\n *\n * - If `_autoUpdate` is enabled and the video source is playing:\n * - It will prefer the native video frame callback if available and no specific FPS is set.\n * - Otherwise, it will use a custom ticker for manual updates.\n * - If `_autoUpdate` is disabled or the video isn't playing, any active update mechanisms are halted.\n */\n _configureAutoUpdate() {\n if (this._autoUpdate && this._isSourcePlaying()) {\n if (!this._updateFPS && this.resource.requestVideoFrameCallback) {\n if (this._isConnectedToTicker) {\n Ticker.shared.remove(this.updateFrame, this);\n this._isConnectedToTicker = false;\n this._msToNextUpdate = 0;\n }\n if (this._videoFrameRequestCallbackHandle === null) {\n this._videoFrameRequestCallbackHandle = this.resource.requestVideoFrameCallback(\n this._videoFrameRequestCallback\n );\n }\n } else {\n if (this._videoFrameRequestCallbackHandle !== null) {\n this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle);\n this._videoFrameRequestCallbackHandle = null;\n }\n if (!this._isConnectedToTicker) {\n Ticker.shared.add(this.updateFrame, this);\n this._isConnectedToTicker = true;\n this._msToNextUpdate = 0;\n }\n }\n } else {\n if (this._videoFrameRequestCallbackHandle !== null) {\n this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle);\n this._videoFrameRequestCallbackHandle = null;\n }\n if (this._isConnectedToTicker) {\n Ticker.shared.remove(this.updateFrame, this);\n this._isConnectedToTicker = false;\n this._msToNextUpdate = 0;\n }\n }\n }\n static test(resource) {\n return globalThis.HTMLVideoElement && resource instanceof HTMLVideoElement;\n }\n};\n_VideoSource.extension = ExtensionType.TextureSource;\n/** The default options for video sources. */\n_VideoSource.defaultOptions = {\n ...TextureSource.defaultOptions,\n /** If true, the video will start loading immediately. */\n autoLoad: true,\n /** If true, the video will start playing as soon as it is loaded. */\n autoPlay: true,\n /** The number of times a second to update the texture from the video. Leave at 0 to update at every render. */\n updateFPS: 0,\n /** If true, the video will be loaded with the `crossorigin` attribute. */\n crossorigin: true,\n /** If true, the video will loop when it ends. */\n loop: false,\n /** If true, the video will be muted. */\n muted: true,\n /** If true, the video will play inline. */\n playsinline: true,\n /** If true, the video will be preloaded. */\n preload: false\n};\n/**\n * Map of video MIME types that can't be directly derived from file extensions.\n * @readonly\n */\n_VideoSource.MIME_TYPES = {\n ogv: \"video/ogg\",\n mov: \"video/quicktime\",\n m4v: \"video/mp4\"\n};\nlet VideoSource = _VideoSource;\n\nexport { VideoSource };\n//# sourceMappingURL=VideoSource.mjs.map\n","\"use strict\";\nconst convertToList = (input, transform, forceTransform = false) => {\n if (!Array.isArray(input)) {\n input = [input];\n }\n if (!transform) {\n return input;\n }\n return input.map((item) => {\n if (typeof item === \"string\" || forceTransform) {\n return transform(item);\n }\n return item;\n });\n};\n\nexport { convertToList };\n//# sourceMappingURL=convertToList.mjs.map\n","import { warn } from '../../utils/logging/warn.mjs';\nimport { convertToList } from '../utils/convertToList.mjs';\n\n\"use strict\";\nclass CacheClass {\n constructor() {\n this._parsers = [];\n this._cache = /* @__PURE__ */ new Map();\n this._cacheMap = /* @__PURE__ */ new Map();\n }\n /** Clear all entries. */\n reset() {\n this._cacheMap.clear();\n this._cache.clear();\n }\n /**\n * Check if the key exists\n * @param key - The key to check\n */\n has(key) {\n return this._cache.has(key);\n }\n /**\n * Fetch entry by key\n * @param key - The key of the entry to get\n */\n get(key) {\n const result = this._cache.get(key);\n if (!result) {\n warn(`[Assets] Asset id ${key} was not found in the Cache`);\n }\n return result;\n }\n /**\n * Set a value by key or keys name\n * @param key - The key or keys to set\n * @param value - The value to store in the cache or from which cacheable assets will be derived.\n */\n set(key, value) {\n const keys = convertToList(key);\n let cacheableAssets;\n for (let i = 0; i < this.parsers.length; i++) {\n const parser = this.parsers[i];\n if (parser.test(value)) {\n cacheableAssets = parser.getCacheableAssets(keys, value);\n break;\n }\n }\n const cacheableMap = new Map(Object.entries(cacheableAssets || {}));\n if (!cacheableAssets) {\n keys.forEach((key2) => {\n cacheableMap.set(key2, value);\n });\n }\n const cacheKeys = [...cacheableMap.keys()];\n const cachedAssets = {\n cacheKeys,\n keys\n };\n keys.forEach((key2) => {\n this._cacheMap.set(key2, cachedAssets);\n });\n cacheKeys.forEach((key2) => {\n const val = cacheableAssets ? cacheableAssets[key2] : value;\n if (this._cache.has(key2) && this._cache.get(key2) !== val) {\n warn(\"[Cache] already has key:\", key2);\n }\n this._cache.set(key2, cacheableMap.get(key2));\n });\n }\n /**\n * Remove entry by key\n *\n * This function will also remove any associated alias from the cache also.\n * @param key - The key of the entry to remove\n */\n remove(key) {\n if (!this._cacheMap.has(key)) {\n warn(`[Assets] Asset id ${key} was not found in the Cache`);\n return;\n }\n const cacheMap = this._cacheMap.get(key);\n const cacheKeys = cacheMap.cacheKeys;\n cacheKeys.forEach((key2) => {\n this._cache.delete(key2);\n });\n cacheMap.keys.forEach((key2) => {\n this._cacheMap.delete(key2);\n });\n }\n /**\n * All loader parsers registered\n * @advanced\n */\n get parsers() {\n return this._parsers;\n }\n}\nconst Cache = new CacheClass();\n\nexport { Cache };\n//# sourceMappingURL=Cache.mjs.map\n","import { Cache } from '../../../../../assets/cache/Cache.mjs';\nimport { extensions, ExtensionType } from '../../../../../extensions/Extensions.mjs';\nimport { TextureSource } from '../sources/TextureSource.mjs';\nimport { Texture } from '../Texture.mjs';\n\n\"use strict\";\nconst sources = [];\nextensions.handleByList(ExtensionType.TextureSource, sources);\nfunction autoDetectSource(options = {}) {\n return textureSourceFrom(options);\n}\nfunction textureSourceFrom(options = {}) {\n const hasResource = options && options.resource;\n const res = hasResource ? options.resource : options;\n const opts = hasResource ? options : { resource: options };\n for (let i = 0; i < sources.length; i++) {\n const Source = sources[i];\n if (Source.test(res)) {\n return new Source(opts);\n }\n }\n throw new Error(`Could not find a source type for resource: ${opts.resource}`);\n}\nfunction resourceToTexture(options = {}, skipCache = false) {\n const hasResource = options && options.resource;\n const resource = hasResource ? options.resource : options;\n const opts = hasResource ? options : { resource: options };\n if (!skipCache && Cache.has(resource)) {\n return Cache.get(resource);\n }\n const texture = new Texture({ source: textureSourceFrom(opts) });\n texture.on(\"destroy\", () => {\n if (Cache.has(resource)) {\n Cache.remove(resource);\n }\n });\n if (!skipCache) {\n Cache.set(resource, texture);\n }\n return texture;\n}\nfunction textureFrom(id, skipCache = false) {\n if (typeof id === \"string\") {\n return Cache.get(id);\n } else if (id instanceof TextureSource) {\n return new Texture({ source: id });\n }\n return resourceToTexture(id, skipCache);\n}\nTexture.from = textureFrom;\nTextureSource.from = textureSourceFrom;\n\nexport { autoDetectSource, resourceToTexture, textureFrom };\n//# sourceMappingURL=textureFrom.mjs.map\n","import { extensions } from '../extensions/Extensions.mjs';\nimport { AlphaMask } from './mask/alpha/AlphaMask.mjs';\nimport { ColorMask } from './mask/color/ColorMask.mjs';\nimport { StencilMask } from './mask/stencil/StencilMask.mjs';\nimport { BufferImageSource } from './renderers/shared/texture/sources/BufferImageSource.mjs';\nimport { CanvasSource } from './renderers/shared/texture/sources/CanvasSource.mjs';\nimport { ImageSource } from './renderers/shared/texture/sources/ImageSource.mjs';\nimport { VideoSource } from './renderers/shared/texture/sources/VideoSource.mjs';\nimport './renderers/shared/texture/utils/textureFrom.mjs';\nimport './mask/MaskEffectManager.mjs';\n\n\"use strict\";\nextensions.add(\n AlphaMask,\n ColorMask,\n StencilMask,\n VideoSource,\n ImageSource,\n CanvasSource,\n BufferImageSource\n);\n//# sourceMappingURL=init.mjs.map\n","\"use strict\";\nvar LoaderParserPriority = /* @__PURE__ */ ((LoaderParserPriority2) => {\n LoaderParserPriority2[LoaderParserPriority2[\"Low\"] = 0] = \"Low\";\n LoaderParserPriority2[LoaderParserPriority2[\"Normal\"] = 1] = \"Normal\";\n LoaderParserPriority2[LoaderParserPriority2[\"High\"] = 2] = \"High\";\n return LoaderParserPriority2;\n})(LoaderParserPriority || {});\n\nexport { LoaderParserPriority };\n//# sourceMappingURL=LoaderParser.mjs.map\n","import { DOMAdapter } from '../environment/adapter.mjs';\n\n\"use strict\";\nfunction assertPath(path2) {\n if (typeof path2 !== \"string\") {\n throw new TypeError(`Path must be a string. Received ${JSON.stringify(path2)}`);\n }\n}\nfunction removeUrlParams(url) {\n const re = url.split(\"?\")[0];\n return re.split(\"#\")[0];\n}\nfunction escapeRegExp(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\nfunction replaceAll(str, find, replace) {\n return str.replace(new RegExp(escapeRegExp(find), \"g\"), replace);\n}\nfunction normalizeStringPosix(path2, allowAboveRoot) {\n let res = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let code = -1;\n for (let i = 0; i <= path2.length; ++i) {\n if (i < path2.length) {\n code = path2.charCodeAt(i);\n } else if (code === 47) {\n break;\n } else {\n code = 47;\n }\n if (code === 47) {\n if (lastSlash === i - 1 || dots === 1) {\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(\"/\");\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(\"/\");\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0) {\n res += \"/..\";\n } else {\n res = \"..\";\n }\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) {\n res += `/${path2.slice(lastSlash + 1, i)}`;\n } else {\n res = path2.slice(lastSlash + 1, i);\n }\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\nconst path = {\n /**\n * Converts a path to posix format.\n * @param path - The path to convert to posix\n * @example\n * ```ts\n * // Convert a Windows path to POSIX format\n * path.toPosix('C:\\\\Users\\\\User\\\\Documents\\\\file.txt');\n * // -> 'C:/Users/User/Documents/file.txt'\n * ```\n */\n toPosix(path2) {\n return replaceAll(path2, \"\\\\\", \"/\");\n },\n /**\n * Checks if the path is a URL e.g. http://, https://\n * @param path - The path to check\n * @example\n * ```ts\n * // Check if a path is a URL\n * path.isUrl('http://www.example.com');\n * // -> true\n * path.isUrl('C:/Users/User/Documents/file.txt');\n * // -> false\n * ```\n */\n isUrl(path2) {\n return /^https?:/.test(this.toPosix(path2));\n },\n /**\n * Checks if the path is a data URL\n * @param path - The path to check\n * @example\n * ```ts\n * // Check if a path is a data URL\n * path.isDataUrl('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...');\n * // -> true\n * ```\n */\n isDataUrl(path2) {\n return /^data:([a-z]+\\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\\-._~:@\\/?%\\s<>]*?)$/i.test(path2);\n },\n /**\n * Checks if the path is a blob URL\n * @param path - The path to check\n * @example\n * ```ts\n * // Check if a path is a blob URL\n * path.isBlobUrl('blob:http://www.example.com/12345678-1234-1234-1234-123456789012');\n * // -> true\n * ```\n */\n isBlobUrl(path2) {\n return path2.startsWith(\"blob:\");\n },\n /**\n * Checks if the path has a protocol e.g. http://, https://, file:///, data:, blob:, C:/\n * This will return true for windows file paths\n * @param path - The path to check\n * @example\n * ```ts\n * // Check if a path has a protocol\n * path.hasProtocol('http://www.example.com');\n * // -> true\n * path.hasProtocol('C:/Users/User/Documents/file.txt');\n * // -> true\n * ```\n */\n hasProtocol(path2) {\n return /^[^/:]+:/.test(this.toPosix(path2));\n },\n /**\n * Returns the protocol of the path e.g. http://, https://, file:///, data:, blob:, C:/\n * @param path - The path to get the protocol from\n * @example\n * ```ts\n * // Get the protocol from a URL\n * path.getProtocol('http://www.example.com/path/to/resource');\n * // -> 'http://'\n * // Get the protocol from a file path\n * path.getProtocol('C:/Users/User/Documents/file.txt');\n * // -> 'C:/'\n * ```\n */\n getProtocol(path2) {\n assertPath(path2);\n path2 = this.toPosix(path2);\n const matchFile = /^file:\\/\\/\\//.exec(path2);\n if (matchFile) {\n return matchFile[0];\n }\n const matchProtocol = /^[^/:]+:\\/{0,2}/.exec(path2);\n if (matchProtocol) {\n return matchProtocol[0];\n }\n return \"\";\n },\n /**\n * Converts URL to an absolute path.\n * When loading from a Web Worker, we must use absolute paths.\n * If the URL is already absolute we return it as is\n * If it's not, we convert it\n * @param url - The URL to test\n * @param customBaseUrl - The base URL to use\n * @param customRootUrl - The root URL to use\n * @example\n * ```ts\n * // Convert a relative URL to an absolute path\n * path.toAbsolute('images/texture.png', 'http://example.com/assets/');\n * // -> 'http://example.com/assets/images/texture.png'\n * ```\n */\n toAbsolute(url, customBaseUrl, customRootUrl) {\n assertPath(url);\n if (this.isDataUrl(url) || this.isBlobUrl(url)) return url;\n const baseUrl = removeUrlParams(this.toPosix(customBaseUrl ?? DOMAdapter.get().getBaseUrl()));\n const rootUrl = removeUrlParams(this.toPosix(customRootUrl ?? this.rootname(baseUrl)));\n url = this.toPosix(url);\n if (url.startsWith(\"/\")) {\n return path.join(rootUrl, url.slice(1));\n }\n const absolutePath = this.isAbsolute(url) ? url : this.join(baseUrl, url);\n return absolutePath;\n },\n /**\n * Normalizes the given path, resolving '..' and '.' segments\n * @param path - The path to normalize\n * @example\n * ```ts\n * // Normalize a path with relative segments\n * path.normalize('http://www.example.com/foo/bar/../baz');\n * // -> 'http://www.example.com/foo/baz'\n * // Normalize a file path with relative segments\n * path.normalize('C:\\\\Users\\\\User\\\\Documents\\\\..\\\\file.txt');\n * // -> 'C:/Users/User/file.txt'\n * ```\n */\n normalize(path2) {\n assertPath(path2);\n if (path2.length === 0) return \".\";\n if (this.isDataUrl(path2) || this.isBlobUrl(path2)) return path2;\n path2 = this.toPosix(path2);\n let protocol = \"\";\n const isAbsolute = path2.startsWith(\"/\");\n if (this.hasProtocol(path2)) {\n protocol = this.rootname(path2);\n path2 = path2.slice(protocol.length);\n }\n const trailingSeparator = path2.endsWith(\"/\");\n path2 = normalizeStringPosix(path2, false);\n if (path2.length > 0 && trailingSeparator) path2 += \"/\";\n if (isAbsolute) return `/${path2}`;\n return protocol + path2;\n },\n /**\n * Determines if path is an absolute path.\n * Absolute paths can be urls, data urls, or paths on disk\n * @param path - The path to test\n * @example\n * ```ts\n * // Check if a path is absolute\n * path.isAbsolute('http://www.example.com/foo/bar');\n * // -> true\n * path.isAbsolute('C:/Users/User/Documents/file.txt');\n * // -> true\n * ```\n */\n isAbsolute(path2) {\n assertPath(path2);\n path2 = this.toPosix(path2);\n if (this.hasProtocol(path2)) return true;\n return path2.startsWith(\"/\");\n },\n /**\n * Joins all given path segments together using the platform-specific separator as a delimiter,\n * then normalizes the resulting path\n * @param segments - The segments of the path to join\n * @example\n * ```ts\n * // Join multiple path segments\n * path.join('assets', 'images', 'sprite.png');\n * // -> 'assets/images/sprite.png'\n * // Join with relative segments\n * path.join('assets', 'images', '../textures', 'sprite.png');\n * // -> 'assets/textures/sprite.png'\n * ```\n */\n join(...segments) {\n if (segments.length === 0) {\n return \".\";\n }\n let joined;\n for (let i = 0; i < segments.length; ++i) {\n const arg = segments[i];\n assertPath(arg);\n if (arg.length > 0) {\n if (joined === void 0) joined = arg;\n else {\n const prevArg = segments[i - 1] ?? \"\";\n if (this.joinExtensions.includes(this.extname(prevArg).toLowerCase())) {\n joined += `/../${arg}`;\n } else {\n joined += `/${arg}`;\n }\n }\n }\n }\n if (joined === void 0) {\n return \".\";\n }\n return this.normalize(joined);\n },\n /**\n * Returns the directory name of a path\n * @param path - The path to parse\n * @example\n * ```ts\n * // Get the directory name of a path\n * path.dirname('http://www.example.com/foo/bar/baz.png');\n * // -> 'http://www.example.com/foo/bar'\n * // Get the directory name of a file path\n * path.dirname('C:/Users/User/Documents/file.txt');\n * // -> 'C:/Users/User/Documents'\n * ```\n */\n dirname(path2) {\n assertPath(path2);\n if (path2.length === 0) return \".\";\n path2 = this.toPosix(path2);\n let code = path2.charCodeAt(0);\n const hasRoot = code === 47;\n let end = -1;\n let matchedSlash = true;\n const proto = this.getProtocol(path2);\n const origpath = path2;\n path2 = path2.slice(proto.length);\n for (let i = path2.length - 1; i >= 1; --i) {\n code = path2.charCodeAt(i);\n if (code === 47) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n matchedSlash = false;\n }\n }\n if (end === -1) return hasRoot ? \"/\" : this.isUrl(origpath) ? proto + path2 : proto;\n if (hasRoot && end === 1) return \"//\";\n return proto + path2.slice(0, end);\n },\n /**\n * Returns the root of the path e.g. /, C:/, file:///, http://domain.com/\n * @param path - The path to parse\n * @example\n * ```ts\n * // Get the root of a URL\n * path.rootname('http://www.example.com/foo/bar/baz.png');\n * // -> 'http://www.example.com/'\n * // Get the root of a file path\n * path.rootname('C:/Users/User/Documents/file.txt');\n * // -> 'C:/'\n * ```\n */\n rootname(path2) {\n assertPath(path2);\n path2 = this.toPosix(path2);\n let root = \"\";\n if (path2.startsWith(\"/\")) root = \"/\";\n else {\n root = this.getProtocol(path2);\n }\n if (this.isUrl(path2)) {\n const index = path2.indexOf(\"/\", root.length);\n if (index !== -1) {\n root = path2.slice(0, index);\n } else root = path2;\n if (!root.endsWith(\"/\")) root += \"/\";\n }\n return root;\n },\n /**\n * Returns the last portion of a path\n * @param path - The path to test\n * @param ext - Optional extension to remove\n * @example\n * ```ts\n * // Get the basename of a URL\n * path.basename('http://www.example.com/foo/bar/baz.png');\n * // -> 'baz.png'\n * // Get the basename of a file path\n * path.basename('C:/Users/User/Documents/file.txt');\n * // -> 'file.txt'\n * ```\n */\n basename(path2, ext) {\n assertPath(path2);\n if (ext) assertPath(ext);\n path2 = removeUrlParams(this.toPosix(path2));\n let start = 0;\n let end = -1;\n let matchedSlash = true;\n let i;\n if (ext !== void 0 && ext.length > 0 && ext.length <= path2.length) {\n if (ext.length === path2.length && ext === path2) return \"\";\n let extIdx = ext.length - 1;\n let firstNonSlashEnd = -1;\n for (i = path2.length - 1; i >= 0; --i) {\n const code = path2.charCodeAt(i);\n if (code === 47) {\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else {\n if (firstNonSlashEnd === -1) {\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n end = i;\n }\n } else {\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n if (start === end) end = firstNonSlashEnd;\n else if (end === -1) end = path2.length;\n return path2.slice(start, end);\n }\n for (i = path2.length - 1; i >= 0; --i) {\n if (path2.charCodeAt(i) === 47) {\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n matchedSlash = false;\n end = i + 1;\n }\n }\n if (end === -1) return \"\";\n return path2.slice(start, end);\n },\n /**\n * Returns the extension of the path, from the last occurrence of the . (period) character to end of string in the last\n * portion of the path. If there is no . in the last portion of the path, or if there are no . characters other than\n * the first character of the basename of path, an empty string is returned.\n * @param path - The path to parse\n * @example\n * ```ts\n * // Get the extension of a URL\n * path.extname('http://www.example.com/foo/bar/baz.png');\n * // -> '.png'\n * // Get the extension of a file path\n * path.extname('C:/Users/User/Documents/file.txt');\n * // -> '.txt'\n * ```\n */\n extname(path2) {\n assertPath(path2);\n path2 = removeUrlParams(this.toPosix(path2));\n let startDot = -1;\n let startPart = 0;\n let end = -1;\n let matchedSlash = true;\n let preDotState = 0;\n for (let i = path2.length - 1; i >= 0; --i) {\n const code = path2.charCodeAt(i);\n if (code === 47) {\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46) {\n if (startDot === -1) startDot = i;\n else if (preDotState !== 1) preDotState = 1;\n } else if (startDot !== -1) {\n preDotState = -1;\n }\n }\n if (startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return \"\";\n }\n return path2.slice(startDot, end);\n },\n /**\n * Parses a path into an object containing the 'root', `dir`, `base`, `ext`, and `name` properties.\n * @param path - The path to parse\n * @example\n * ```ts\n * // Parse a URL\n * const parsed = path.parse('http://www.example.com/foo/bar/baz.png');\n * // -> {\n * // root: 'http://www.example.com/',\n * // dir: 'http://www.example.com/foo/bar',\n * // base: 'baz.png',\n * // ext: '.png',\n * // name: 'baz'\n * // }\n * // Parse a file path\n * const parsedFile = path.parse('C:/Users/User/Documents/file.txt');\n * // -> {\n * // root: 'C:/',\n * // dir: 'C:/Users/User/Documents',\n * // base: 'file.txt',\n * // ext: '.txt',\n * // name: 'file'\n * // }\n * ```\n */\n parse(path2) {\n assertPath(path2);\n const ret = { root: \"\", dir: \"\", base: \"\", ext: \"\", name: \"\" };\n if (path2.length === 0) return ret;\n path2 = removeUrlParams(this.toPosix(path2));\n let code = path2.charCodeAt(0);\n const isAbsolute = this.isAbsolute(path2);\n let start;\n const protocol = \"\";\n ret.root = this.rootname(path2);\n if (isAbsolute || this.hasProtocol(path2)) {\n start = 1;\n } else {\n start = 0;\n }\n let startDot = -1;\n let startPart = 0;\n let end = -1;\n let matchedSlash = true;\n let i = path2.length - 1;\n let preDotState = 0;\n for (; i >= start; --i) {\n code = path2.charCodeAt(i);\n if (code === 47) {\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46) {\n if (startDot === -1) startDot = i;\n else if (preDotState !== 1) preDotState = 1;\n } else if (startDot !== -1) {\n preDotState = -1;\n }\n }\n if (startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n if (end !== -1) {\n if (startPart === 0 && isAbsolute) ret.base = ret.name = path2.slice(1, end);\n else ret.base = ret.name = path2.slice(startPart, end);\n }\n } else {\n if (startPart === 0 && isAbsolute) {\n ret.name = path2.slice(1, startDot);\n ret.base = path2.slice(1, end);\n } else {\n ret.name = path2.slice(startPart, startDot);\n ret.base = path2.slice(startPart, end);\n }\n ret.ext = path2.slice(startDot, end);\n }\n ret.dir = this.dirname(path2);\n if (protocol) ret.dir = protocol + ret.dir;\n return ret;\n },\n sep: \"/\",\n delimiter: \":\",\n joinExtensions: [\".html\"]\n};\n\nexport { path };\n//# sourceMappingURL=path.mjs.map\n","\"use strict\";\nfunction processX(base, ids, depth, result, tags) {\n const id = ids[depth];\n for (let i = 0; i < id.length; i++) {\n const value = id[i];\n if (depth < ids.length - 1) {\n processX(base.replace(result[depth], value), ids, depth + 1, result, tags);\n } else {\n tags.push(base.replace(result[depth], value));\n }\n }\n}\nfunction createStringVariations(string) {\n const regex = /\\{(.*?)\\}/g;\n const result = string.match(regex);\n const tags = [];\n if (result) {\n const ids = [];\n result.forEach((vars) => {\n const split = vars.substring(1, vars.length - 1).split(\",\");\n ids.push(split);\n });\n processX(string, ids, 0, result, tags);\n } else {\n tags.push(string);\n }\n return tags;\n}\n\nexport { createStringVariations };\n//# sourceMappingURL=createStringVariations.mjs.map\n","\"use strict\";\nconst isSingleItem = (item) => !Array.isArray(item);\n\nexport { isSingleItem };\n//# sourceMappingURL=isSingleItem.mjs.map\n","import { warn } from '../../utils/logging/warn.mjs';\nimport { path } from '../../utils/path.mjs';\nimport { convertToList } from '../utils/convertToList.mjs';\nimport { createStringVariations } from '../utils/createStringVariations.mjs';\nimport { isSingleItem } from '../utils/isSingleItem.mjs';\n\n\"use strict\";\nclass Resolver {\n constructor() {\n this._defaultBundleIdentifierOptions = {\n connector: \"-\",\n createBundleAssetId: (bundleId, assetId) => `${bundleId}${this._bundleIdConnector}${assetId}`,\n extractAssetIdFromBundle: (bundleId, assetBundleId) => assetBundleId.replace(`${bundleId}${this._bundleIdConnector}`, \"\")\n };\n /** The character that is used to connect the bundleId and the assetId when generating a bundle asset id key */\n this._bundleIdConnector = this._defaultBundleIdentifierOptions.connector;\n /**\n * A function that generates a bundle asset id key from a bundleId and an assetId\n * @param bundleId - the bundleId\n * @param assetId - the assetId\n * @returns the bundle asset id key\n */\n this._createBundleAssetId = this._defaultBundleIdentifierOptions.createBundleAssetId;\n /**\n * A function that generates an assetId from a bundle asset id key. This is the reverse of generateBundleAssetId\n * @param bundleId - the bundleId\n * @param assetBundleId - the bundle asset id key\n * @returns the assetId\n */\n this._extractAssetIdFromBundle = this._defaultBundleIdentifierOptions.extractAssetIdFromBundle;\n this._assetMap = {};\n this._preferredOrder = [];\n this._parsers = [];\n this._resolverHash = {};\n this._bundles = {};\n }\n /**\n * Override how the resolver deals with generating bundle ids.\n * must be called before any bundles are added\n * @param bundleIdentifier - the bundle identifier options\n */\n setBundleIdentifier(bundleIdentifier) {\n this._bundleIdConnector = bundleIdentifier.connector ?? this._bundleIdConnector;\n this._createBundleAssetId = bundleIdentifier.createBundleAssetId ?? this._createBundleAssetId;\n this._extractAssetIdFromBundle = bundleIdentifier.extractAssetIdFromBundle ?? this._extractAssetIdFromBundle;\n if (this._extractAssetIdFromBundle(\"foo\", this._createBundleAssetId(\"foo\", \"bar\")) !== \"bar\") {\n throw new Error(\"[Resolver] GenerateBundleAssetId are not working correctly\");\n }\n }\n /**\n * Let the resolver know which assets you prefer to use when resolving assets.\n * Multiple prefer user defined rules can be added.\n * @example\n * resolver.prefer({\n * // first look for something with the correct format, and then then correct resolution\n * priority: ['format', 'resolution'],\n * params:{\n * format:'webp', // prefer webp images\n * resolution: 2, // prefer a resolution of 2\n * }\n * })\n * resolver.add('foo', ['bar@2x.webp', 'bar@2x.png', 'bar.webp', 'bar.png']);\n * resolver.resolveUrl('foo') // => 'bar@2x.webp'\n * @param preferOrders - the prefer options\n */\n prefer(...preferOrders) {\n preferOrders.forEach((prefer) => {\n this._preferredOrder.push(prefer);\n if (!prefer.priority) {\n prefer.priority = Object.keys(prefer.params);\n }\n });\n this._resolverHash = {};\n }\n /**\n * Set the base path to prepend to all urls when resolving\n * @example\n * resolver.basePath = 'https://home.com/';\n * resolver.add('foo', 'bar.ong');\n * resolver.resolveUrl('foo', 'bar.png'); // => 'https://home.com/bar.png'\n * @param basePath - the base path to use\n */\n set basePath(basePath) {\n this._basePath = basePath;\n }\n get basePath() {\n return this._basePath;\n }\n /**\n * Set the root path for root-relative URLs. By default the `basePath`'s root is used. If no `basePath` is set, then the\n * default value for browsers is `window.location.origin`\n * @example\n * // Application hosted on https://home.com/some-path/index.html\n * resolver.basePath = 'https://home.com/some-path/';\n * resolver.rootPath = 'https://home.com/';\n * resolver.add('foo', '/bar.png');\n * resolver.resolveUrl('foo', '/bar.png'); // => 'https://home.com/bar.png'\n * @param rootPath - the root path to use\n */\n set rootPath(rootPath) {\n this._rootPath = rootPath;\n }\n get rootPath() {\n return this._rootPath;\n }\n /**\n * All the active URL parsers that help the parser to extract information and create\n * an asset object-based on parsing the URL itself.\n *\n * Can be added using the extensions API\n * @example\n * resolver.add('foo', [\n * {\n * resolution: 2,\n * format: 'png',\n * src: 'image@2x.png',\n * },\n * {\n * resolution:1,\n * format:'png',\n * src: 'image.png',\n * },\n * ]);\n *\n * // With a url parser the information such as resolution and file format could extracted from the url itself:\n * extensions.add({\n * extension: ExtensionType.ResolveParser,\n * test: loadTextures.test, // test if url ends in an image\n * parse: (value: string) =>\n * ({\n * resolution: parseFloat(Resolver.RETINA_PREFIX.exec(value)?.[1] ?? '1'),\n * format: value.split('.').pop(),\n * src: value,\n * }),\n * });\n *\n * // Now resolution and format can be extracted from the url\n * resolver.add('foo', [\n * 'image@2x.png',\n * 'image.png',\n * ]);\n */\n get parsers() {\n return this._parsers;\n }\n /** Used for testing, this resets the resolver to its initial state */\n reset() {\n this.setBundleIdentifier(this._defaultBundleIdentifierOptions);\n this._assetMap = {};\n this._preferredOrder = [];\n this._resolverHash = {};\n this._rootPath = null;\n this._basePath = null;\n this._manifest = null;\n this._bundles = {};\n this._defaultSearchParams = null;\n }\n /**\n * Sets the default URL search parameters for the URL resolver. The urls can be specified as a string or an object.\n * @param searchParams - the default url parameters to append when resolving urls\n */\n setDefaultSearchParams(searchParams) {\n if (typeof searchParams === \"string\") {\n this._defaultSearchParams = searchParams;\n } else {\n const queryValues = searchParams;\n this._defaultSearchParams = Object.keys(queryValues).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(queryValues[key])}`).join(\"&\");\n }\n }\n /**\n * Returns the aliases for a given asset\n * @param asset - the asset to get the aliases for\n */\n getAlias(asset) {\n const { alias, src } = asset;\n const aliasesToUse = convertToList(\n alias || src,\n (value) => {\n if (typeof value === \"string\") return value;\n if (Array.isArray(value)) return value.map((v) => v?.src ?? v);\n if (value?.src) return value.src;\n return value;\n },\n true\n );\n return aliasesToUse;\n }\n /**\n * Removes the specified alias for an asset.\n *\n * This only removes the alias mapping. It does **not** remove, unload, or destroy the\n * underlying asset. If the asset is already cached, it stays in memory until you call\n * `Assets.unload`.\n *\n * If `asset` is provided, the alias is only removed when the resolver's current mapping for\n * that alias matches the given `ResolvedAsset`. This lets you avoid accidentally removing an\n * alias that has been reassigned.\n *\n * Silently returns if the alias does not exist or the asset does not match.\n * @param alias - the alias to remove\n * @param asset - only remove the alias if it is currently assigned to this asset\n * @example\n * ```ts\n * resolver.add({ alias: 'hero', src: 'hero.png' });\n *\n * // Simple removal\n * resolver.removeAlias('hero');\n *\n * // Conditional removal — only if alias currently maps to a specific asset\n * const resolved = resolver.resolve('hero');\n * resolver.removeAlias('hero', resolved);\n * ```\n */\n removeAlias(alias, asset) {\n if (!this._assetMap[alias]) {\n return;\n }\n if (asset && asset !== this._resolverHash[alias]) {\n return;\n }\n delete this._resolverHash[alias];\n delete this._assetMap[alias];\n }\n /**\n * Add a manifest to the asset resolver. This is a nice way to add all the asset information in one go.\n * generally a manifest would be built using a tool.\n * @param manifest - the manifest to add to the resolver\n */\n addManifest(manifest) {\n if (this._manifest) {\n warn(\"[Resolver] Manifest already exists, this will be overwritten\");\n }\n this._manifest = manifest;\n manifest.bundles.forEach((bundle) => {\n this.addBundle(bundle.name, bundle.assets);\n });\n }\n /**\n * This adds a bundle of assets in one go so that you can resolve them as a group.\n * For example you could add a bundle for each screen in you pixi app\n * @example\n * resolver.addBundle('animals', [\n * { alias: 'bunny', src: 'bunny.png' },\n * { alias: 'chicken', src: 'chicken.png' },\n * { alias: 'thumper', src: 'thumper.png' },\n * ]);\n * // or\n * resolver.addBundle('animals', {\n * bunny: 'bunny.png',\n * chicken: 'chicken.png',\n * thumper: 'thumper.png',\n * });\n *\n * const resolvedAssets = await resolver.resolveBundle('animals');\n * @param bundleId - The id of the bundle to add\n * @param assets - A record of the asset or assets that will be chosen from when loading via the specified key\n */\n addBundle(bundleId, assets) {\n const assetNames = [];\n let convertedAssets = assets;\n if (!Array.isArray(assets)) {\n convertedAssets = Object.entries(assets).map(([alias, src]) => {\n if (typeof src === \"string\" || Array.isArray(src)) {\n return { alias, src };\n }\n return { alias, ...src };\n });\n }\n convertedAssets.forEach((asset) => {\n const srcs = asset.src;\n const aliases = asset.alias;\n let ids;\n if (typeof aliases === \"string\") {\n const bundleAssetId = this._createBundleAssetId(bundleId, aliases);\n assetNames.push(bundleAssetId);\n ids = [aliases, bundleAssetId];\n } else {\n const bundleIds = aliases.map((name) => this._createBundleAssetId(bundleId, name));\n assetNames.push(...bundleIds);\n ids = [...aliases, ...bundleIds];\n }\n this.add({\n ...asset,\n ...{\n alias: ids,\n src: srcs\n }\n });\n });\n this._bundles[bundleId] = assetNames;\n }\n /**\n * Tells the resolver what keys are associated with witch asset.\n * The most important thing the resolver does\n * @example\n * // Single key, single asset:\n * resolver.add({alias: 'foo', src: 'bar.png');\n * resolver.resolveUrl('foo') // => 'bar.png'\n *\n * // Multiple keys, single asset:\n * resolver.add({alias: ['foo', 'boo'], src: 'bar.png'});\n * resolver.resolveUrl('foo') // => 'bar.png'\n * resolver.resolveUrl('boo') // => 'bar.png'\n *\n * // Multiple keys, multiple assets:\n * resolver.add({alias: ['foo', 'boo'], src: ['bar.png', 'bar.webp']});\n * resolver.resolveUrl('foo') // => 'bar.png'\n *\n * // Add custom data attached to the resolver\n * Resolver.add({\n * alias: 'bunnyBooBooSmooth',\n * src: 'bunny{png,webp}',\n * data: { scaleMode:SCALE_MODES.NEAREST }, // Base texture options\n * });\n *\n * resolver.resolve('bunnyBooBooSmooth') // => { src: 'bunny.png', data: { scaleMode: SCALE_MODES.NEAREST } }\n * @param aliases - the UnresolvedAsset or array of UnresolvedAssets to add to the resolver\n */\n add(aliases) {\n const assets = [];\n if (Array.isArray(aliases)) {\n assets.push(...aliases);\n } else {\n assets.push(aliases);\n }\n let keyCheck;\n keyCheck = (key) => {\n if (this.hasKey(key)) {\n warn(`[Resolver] already has key: ${key} overwriting`);\n }\n };\n const assetArray = convertToList(assets);\n assetArray.forEach((asset) => {\n const { src } = asset;\n let {\n data,\n format,\n loadParser: userDefinedLoadParser,\n parser: userDefinedParser\n } = asset;\n const srcsToUse = convertToList(src).map((src2) => {\n if (typeof src2 === \"string\") {\n return createStringVariations(src2);\n }\n return Array.isArray(src2) ? src2 : [src2];\n });\n const aliasesToUse = this.getAlias(asset);\n Array.isArray(aliasesToUse) ? aliasesToUse.forEach(keyCheck) : keyCheck(aliasesToUse);\n const resolvedAssets = [];\n const parseUrl = (url) => {\n const parser = this._parsers.find((p) => p.test(url));\n return {\n src: url,\n ...parser?.parse(url)\n };\n };\n srcsToUse.forEach((srcs) => {\n srcs.forEach((src2) => {\n let formattedAsset = {};\n if (typeof src2 !== \"object\") {\n formattedAsset = parseUrl(src2);\n } else {\n data = src2.data ?? data;\n format = src2.format ?? format;\n if (src2.loadParser || src2.parser) {\n userDefinedLoadParser = src2.loadParser ?? userDefinedLoadParser;\n userDefinedParser = src2.parser ?? userDefinedParser;\n }\n formattedAsset = {\n ...parseUrl(src2.src),\n ...src2\n };\n }\n if (!aliasesToUse) {\n throw new Error(`[Resolver] alias is undefined for this asset: ${formattedAsset.src}`);\n }\n formattedAsset = this._buildResolvedAsset(formattedAsset, {\n aliases: aliasesToUse,\n data,\n format,\n loadParser: userDefinedLoadParser,\n parser: userDefinedParser,\n progressSize: asset.progressSize\n });\n resolvedAssets.push(formattedAsset);\n });\n });\n aliasesToUse.forEach((alias) => {\n this._assetMap[alias] = resolvedAssets;\n });\n });\n }\n // TODO: this needs an overload like load did in Assets\n /**\n * If the resolver has had a manifest set via setManifest, this will return the assets urls for\n * a given bundleId or bundleIds.\n * @example\n * // Manifest Example\n * const manifest = {\n * bundles: [\n * {\n * name: 'load-screen',\n * assets: [\n * {\n * alias: 'background',\n * src: 'sunset.png',\n * },\n * {\n * alias: 'bar',\n * src: 'load-bar.{png,webp}',\n * },\n * ],\n * },\n * {\n * name: 'game-screen',\n * assets: [\n * {\n * alias: 'character',\n * src: 'robot.png',\n * },\n * {\n * alias: 'enemy',\n * src: 'bad-guy.png',\n * },\n * ],\n * },\n * ]\n * };\n *\n * resolver.setManifest(manifest);\n * const resolved = resolver.resolveBundle('load-screen');\n * @param bundleIds - The bundle ids to resolve\n * @returns All the bundles assets or a hash of assets for each bundle specified\n */\n resolveBundle(bundleIds) {\n const singleAsset = isSingleItem(bundleIds);\n bundleIds = convertToList(bundleIds);\n const out = {};\n bundleIds.forEach((bundleId) => {\n const assetNames = this._bundles[bundleId];\n if (assetNames) {\n const results = this.resolve(assetNames);\n const assets = {};\n for (const key in results) {\n const asset = results[key];\n assets[this._extractAssetIdFromBundle(bundleId, key)] = asset;\n }\n out[bundleId] = assets;\n }\n });\n return singleAsset ? out[bundleIds[0]] : out;\n }\n /**\n * Does exactly what resolve does, but returns just the URL rather than the whole asset object\n * @param key - The key or keys to resolve\n * @returns - The URLs associated with the key(s)\n */\n resolveUrl(key) {\n const result = this.resolve(key);\n if (typeof key !== \"string\") {\n const out = {};\n for (const i in result) {\n out[i] = result[i].src;\n }\n return out;\n }\n return result.src;\n }\n resolve(keys) {\n const singleAsset = isSingleItem(keys);\n keys = convertToList(keys);\n const result = {};\n keys.forEach((key) => {\n if (!this._resolverHash[key]) {\n if (this._assetMap[key]) {\n let assets = this._assetMap[key];\n const preferredOrder = this._getPreferredOrder(assets);\n preferredOrder?.priority.forEach((priorityKey) => {\n preferredOrder.params[priorityKey].forEach((value) => {\n const filteredAssets = assets.filter((asset) => {\n if (asset[priorityKey]) {\n return asset[priorityKey] === value;\n }\n return false;\n });\n if (filteredAssets.length) {\n assets = filteredAssets;\n }\n });\n });\n this._resolverHash[key] = assets[0];\n } else {\n this._resolverHash[key] = this._buildResolvedAsset({\n alias: [key],\n src: key\n }, {});\n }\n }\n result[key] = this._resolverHash[key];\n });\n return singleAsset ? result[keys[0]] : result;\n }\n /**\n * Checks if an asset with a given key exists in the resolver\n * @param key - The key of the asset\n */\n hasKey(key) {\n return !!this._assetMap[key];\n }\n /**\n * Checks if a bundle with the given key exists in the resolver\n * @param key - The key of the bundle\n */\n hasBundle(key) {\n return !!this._bundles[key];\n }\n /**\n * Internal function for figuring out what prefer criteria an asset should use.\n * @param assets\n */\n _getPreferredOrder(assets) {\n for (let i = 0; i < assets.length; i++) {\n const asset = assets[i];\n const preferred = this._preferredOrder.find((preference) => preference.params.format.includes(asset.format));\n if (preferred) {\n return preferred;\n }\n }\n return this._preferredOrder[0];\n }\n /**\n * Appends the default url parameters to the url\n * @param url - The url to append the default parameters to\n * @returns - The url with the default parameters appended\n */\n _appendDefaultSearchParams(url) {\n if (!this._defaultSearchParams) return url;\n const paramConnector = /\\?/.test(url) ? \"&\" : \"?\";\n return `${url}${paramConnector}${this._defaultSearchParams}`;\n }\n _buildResolvedAsset(formattedAsset, data) {\n const { aliases, data: assetData, loadParser, parser, format, progressSize } = data;\n if (this._basePath || this._rootPath) {\n formattedAsset.src = path.toAbsolute(formattedAsset.src, this._basePath, this._rootPath);\n }\n formattedAsset.alias = aliases ?? formattedAsset.alias ?? [formattedAsset.src];\n formattedAsset.src = this._appendDefaultSearchParams(formattedAsset.src);\n formattedAsset.data = { ...assetData || {}, ...formattedAsset.data };\n formattedAsset.loadParser = loadParser ?? formattedAsset.loadParser;\n formattedAsset.parser = parser ?? formattedAsset.parser;\n formattedAsset.format = format ?? formattedAsset.format ?? getUrlExtension(formattedAsset.src);\n if (progressSize !== void 0) {\n formattedAsset.progressSize = progressSize;\n }\n return formattedAsset;\n }\n}\n/**\n * The prefix that denotes a URL is for a retina asset.\n * @default /@([0-9\\.]+)x/\n * @example `@2x`\n */\nResolver.RETINA_PREFIX = /@([0-9\\.]+)x/;\nfunction getUrlExtension(url) {\n return url.split(\".\").pop().split(\"?\").shift().split(\"#\").shift();\n}\n\nexport { Resolver, getUrlExtension };\n//# sourceMappingURL=Resolver.mjs.map\n","\"use strict\";\nconst copySearchParams = (targetUrl, sourceUrl) => {\n const searchParams = sourceUrl.split(\"?\")[1];\n if (searchParams) {\n targetUrl += `?${searchParams}`;\n }\n return targetUrl;\n};\n\nexport { copySearchParams };\n//# sourceMappingURL=copySearchParams.mjs.map\n","import { Rectangle } from '../maths/shapes/Rectangle.mjs';\nimport { TextureSource } from '../rendering/renderers/shared/texture/sources/TextureSource.mjs';\nimport { Texture } from '../rendering/renderers/shared/texture/Texture.mjs';\n\n\"use strict\";\nconst _Spritesheet = class _Spritesheet {\n constructor(optionsOrTexture, arg1) {\n /** For multi-packed spritesheets, this contains a reference to all the other spritesheets it depends on. */\n this.linkedSheets = [];\n let options = optionsOrTexture;\n if (optionsOrTexture?.source instanceof TextureSource) {\n options = {\n texture: optionsOrTexture,\n data: arg1\n };\n }\n const { texture, data, cachePrefix = \"\" } = options;\n this.cachePrefix = cachePrefix;\n this._texture = texture instanceof Texture ? texture : null;\n this.textureSource = texture.source;\n this.textures = {};\n this.animations = {};\n this.data = data;\n const metaResolution = parseFloat(data.meta.scale);\n if (metaResolution) {\n this.resolution = metaResolution;\n texture.source.resolution = this.resolution;\n } else {\n this.resolution = texture.source._resolution;\n }\n this._frames = this.data.frames;\n this._frameKeys = Object.keys(this._frames);\n this._batchIndex = 0;\n this._callback = null;\n }\n /**\n * Parse spritesheet from loaded data. This is done asynchronously\n * to prevent creating too many Texture within a single process.\n */\n parse() {\n return new Promise((resolve) => {\n this._callback = resolve;\n this._batchIndex = 0;\n if (this._frameKeys.length <= _Spritesheet.BATCH_SIZE) {\n this._processFrames(0);\n this._processAnimations();\n this._parseComplete();\n } else {\n this._nextBatch();\n }\n });\n }\n /**\n * Parse spritesheet from loaded data. This is done synchronously\n * and is only suitable for smaller spritesheets (less than ~1000 frames)\n * or may cause too many Texture within a single process. However, synchronous parsing may be\n * more convenient since the called does not need to be asynchronous and is safe for\n * small-to-medium sized spritesheets.\n *\n * Other than being synchronous, `parseSync` is otherwise identical to `.parse()`.\n */\n parseSync() {\n this._processFrames(0, true);\n this._processAnimations();\n return this.textures;\n }\n /**\n * Process a batch of frames\n * @param initialFrameIndex - The index of frame to start.\n * @param processAll - if true will process all frames in a single batch, ignoring BATCH_SIZE - this\n * is used for synchronous parsing.\n */\n _processFrames(initialFrameIndex, processAll = false) {\n let frameIndex = initialFrameIndex;\n const maxFrames = processAll ? Infinity : _Spritesheet.BATCH_SIZE;\n while (frameIndex - initialFrameIndex < maxFrames && frameIndex < this._frameKeys.length) {\n const i = this._frameKeys[frameIndex];\n const data = this._frames[i];\n const rect = data.frame;\n if (rect) {\n let frame = null;\n let trim = null;\n const sourceSize = data.trimmed !== false && data.sourceSize ? data.sourceSize : data.frame;\n const orig = new Rectangle(\n 0,\n 0,\n Math.floor(sourceSize.w) / this.resolution,\n Math.floor(sourceSize.h) / this.resolution\n );\n if (data.rotated) {\n frame = new Rectangle(\n Math.floor(rect.x) / this.resolution,\n Math.floor(rect.y) / this.resolution,\n Math.floor(rect.h) / this.resolution,\n Math.floor(rect.w) / this.resolution\n );\n } else {\n frame = new Rectangle(\n Math.floor(rect.x) / this.resolution,\n Math.floor(rect.y) / this.resolution,\n Math.floor(rect.w) / this.resolution,\n Math.floor(rect.h) / this.resolution\n );\n }\n if (data.trimmed !== false && data.spriteSourceSize) {\n trim = new Rectangle(\n Math.floor(data.spriteSourceSize.x) / this.resolution,\n Math.floor(data.spriteSourceSize.y) / this.resolution,\n Math.floor(rect.w) / this.resolution,\n Math.floor(rect.h) / this.resolution\n );\n }\n this.textures[i] = new Texture({\n source: this.textureSource,\n frame,\n orig,\n trim,\n rotate: data.rotated ? 2 : 0,\n defaultAnchor: data.anchor,\n defaultBorders: data.borders,\n label: i.toString()\n });\n }\n frameIndex++;\n }\n }\n /** Parse animations config. */\n _processAnimations() {\n const animations = this.data.animations || {};\n for (const animName in animations) {\n this.animations[animName] = [];\n for (let i = 0; i < animations[animName].length; i++) {\n const frameName = animations[animName][i];\n this.animations[animName].push(this.textures[frameName]);\n }\n }\n }\n /** The parse has completed. */\n _parseComplete() {\n const callback = this._callback;\n this._callback = null;\n this._batchIndex = 0;\n callback.call(this, this.textures);\n }\n /** Begin the next batch of textures. */\n _nextBatch() {\n this._processFrames(this._batchIndex * _Spritesheet.BATCH_SIZE);\n this._batchIndex++;\n setTimeout(() => {\n if (this._batchIndex * _Spritesheet.BATCH_SIZE < this._frameKeys.length) {\n this._nextBatch();\n } else {\n this._processAnimations();\n this._parseComplete();\n }\n }, 0);\n }\n /**\n * Destroy Spritesheet and don't use after this.\n * @param {boolean} [destroyBase=false] - Whether to destroy the base texture as well\n */\n destroy(destroyBase = false) {\n for (const i in this.textures) {\n this.textures[i].destroy();\n }\n this._frames = null;\n this._frameKeys = null;\n this.data = null;\n this.textures = null;\n if (destroyBase) {\n this._texture?.destroy();\n this.textureSource.destroy();\n }\n this._texture = null;\n this.textureSource = null;\n this.linkedSheets = [];\n }\n};\n/**\n * The maximum number of Textures to build per process.\n * @advanced\n */\n_Spritesheet.BATCH_SIZE = 1e3;\nlet Spritesheet = _Spritesheet;\n\nexport { Spritesheet };\n//# sourceMappingURL=Spritesheet.mjs.map\n","import { LoaderParserPriority } from '../assets/loader/parsers/LoaderParser.mjs';\nimport { Resolver } from '../assets/resolver/Resolver.mjs';\nimport { copySearchParams } from '../assets/utils/copySearchParams.mjs';\nimport { ExtensionType } from '../extensions/Extensions.mjs';\nimport { Texture } from '../rendering/renderers/shared/texture/Texture.mjs';\nimport { path } from '../utils/path.mjs';\nimport { Spritesheet } from './Spritesheet.mjs';\n\n\"use strict\";\nconst validImages = [\n \"jpg\",\n \"png\",\n \"jpeg\",\n \"avif\",\n \"webp\",\n \"basis\",\n \"etc2\",\n \"bc7\",\n \"bc6h\",\n \"bc5\",\n \"bc4\",\n \"bc3\",\n \"bc2\",\n \"bc1\",\n \"eac\",\n \"astc\"\n];\nfunction getCacheableAssets(keys, asset, ignoreMultiPack) {\n const out = {};\n keys.forEach((key) => {\n out[key] = asset;\n });\n Object.keys(asset.textures).forEach((key) => {\n out[`${asset.cachePrefix}${key}`] = asset.textures[key];\n });\n if (!ignoreMultiPack) {\n const basePath = path.dirname(keys[0]);\n asset.linkedSheets.forEach((item, i) => {\n const out2 = getCacheableAssets([`${basePath}/${asset.data.meta.related_multi_packs[i]}`], item, true);\n Object.assign(out, out2);\n });\n }\n return out;\n}\nconst spritesheetAsset = {\n extension: ExtensionType.Asset,\n /** Handle the caching of the related Spritesheet Textures */\n cache: {\n test: (asset) => asset instanceof Spritesheet,\n getCacheableAssets: (keys, asset) => getCacheableAssets(keys, asset, false)\n },\n /** Resolve the resolution of the asset. */\n resolver: {\n extension: {\n type: ExtensionType.ResolveParser,\n name: \"resolveSpritesheet\"\n },\n test: (value) => {\n const tempURL = value.split(\"?\")[0];\n const split = tempURL.split(\".\");\n const extension = split.pop();\n const format = split.pop();\n return extension === \"json\" && validImages.includes(format);\n },\n parse: (value) => {\n const split = value.split(\".\");\n return {\n resolution: parseFloat(Resolver.RETINA_PREFIX.exec(value)?.[1] ?? \"1\"),\n format: split[split.length - 2],\n src: value\n };\n }\n },\n /**\n * Loader plugin that parses sprite sheets!\n * once the JSON has been loaded this checks to see if the JSON is spritesheet data.\n * If it is, we load the spritesheets image and parse the data into Spritesheet\n * All textures in the sprite sheet are then added to the cache\n */\n loader: {\n /** used for deprecation purposes */\n name: \"spritesheetLoader\",\n id: \"spritesheet\",\n extension: {\n type: ExtensionType.LoadParser,\n priority: LoaderParserPriority.Normal,\n name: \"spritesheetLoader\"\n },\n async testParse(asset, options) {\n return path.extname(options.src).toLowerCase() === \".json\" && !!asset.frames;\n },\n async parse(asset, options, loader) {\n const {\n texture: imageTexture,\n // if user need to use preloaded texture\n imageFilename,\n // if user need to use custom filename (not from jsonFile.meta.image)\n textureOptions,\n // if user need to set texture options on texture\n cachePrefix\n // if user need to use custom cache prefix\n } = options?.data ?? {};\n let basePath = path.dirname(options.src);\n if (basePath && basePath.lastIndexOf(\"/\") !== basePath.length - 1) {\n basePath += \"/\";\n }\n let texture;\n if (imageTexture instanceof Texture) {\n texture = imageTexture;\n } else {\n const imagePath = copySearchParams(basePath + (imageFilename ?? asset.meta.image), options.src);\n const assets = await loader.load([{ src: imagePath, data: textureOptions }]);\n texture = assets[imagePath];\n }\n const spritesheet = new Spritesheet({\n texture: texture.source,\n data: asset,\n cachePrefix\n });\n await spritesheet.parse();\n const multiPacks = asset?.meta?.related_multi_packs;\n if (Array.isArray(multiPacks)) {\n const promises = [];\n for (const item of multiPacks) {\n if (typeof item !== \"string\") {\n continue;\n }\n let itemUrl = basePath + item;\n if (options.data?.ignoreMultiPack) {\n continue;\n }\n itemUrl = copySearchParams(itemUrl, options.src);\n promises.push(loader.load({\n src: itemUrl,\n data: {\n textureOptions,\n ignoreMultiPack: true\n }\n }));\n }\n const res = await Promise.all(promises);\n spritesheet.linkedSheets = res;\n res.forEach((item) => {\n item.linkedSheets = [spritesheet].concat(spritesheet.linkedSheets.filter((sp) => sp !== item));\n });\n }\n return spritesheet;\n },\n async unload(spritesheet, _resolvedAsset, loader) {\n await loader.unload(spritesheet.textureSource._sourceOrigin);\n spritesheet.destroy(false);\n }\n }\n};\n\nexport { spritesheetAsset };\n//# sourceMappingURL=spritesheetAsset.mjs.map\n","import { extensions } from '../extensions/Extensions.mjs';\nimport { spritesheetAsset } from './spritesheetAsset.mjs';\n\n\"use strict\";\nextensions.add(spritesheetAsset);\n//# sourceMappingURL=init.mjs.map\n","\"use strict\";\nconst idCounts = /* @__PURE__ */ Object.create(null);\nconst idHash = /* @__PURE__ */ Object.create(null);\nfunction createIdFromString(value, groupId) {\n let id = idHash[value];\n if (id === void 0) {\n if (idCounts[groupId] === void 0) {\n idCounts[groupId] = 1;\n }\n idHash[value] = id = idCounts[groupId]++;\n }\n return id;\n}\n\nexport { createIdFromString };\n//# sourceMappingURL=createIdFromString.mjs.map\n","import { DOMAdapter } from '../../../../../environment/adapter.mjs';\n\n\"use strict\";\nlet context;\nfunction getTestContext() {\n if (!context || context?.isContextLost()) {\n const canvas = DOMAdapter.get().createCanvas();\n context = canvas.getContext(\"webgl\", {});\n }\n return context;\n}\n\nexport { getTestContext };\n//# sourceMappingURL=getTestContext.mjs.map\n","import { getTestContext } from './getTestContext.mjs';\n\n\"use strict\";\nlet maxFragmentPrecision;\nfunction getMaxFragmentPrecision() {\n if (!maxFragmentPrecision) {\n maxFragmentPrecision = \"mediump\";\n const gl = getTestContext();\n if (gl) {\n if (gl.getShaderPrecisionFormat) {\n const shaderFragment = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);\n maxFragmentPrecision = shaderFragment.precision ? \"highp\" : \"mediump\";\n }\n }\n }\n return maxFragmentPrecision;\n}\n\nexport { getMaxFragmentPrecision };\n//# sourceMappingURL=getMaxFragmentPrecision.mjs.map\n","\"use strict\";\nfunction addProgramDefines(src, isES300, isFragment) {\n if (isES300) return src;\n if (isFragment) {\n src = src.replace(\"out vec4 finalColor;\", \"\");\n return `\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in varying\n #define finalColor gl_FragColor\n #define texture texture2D\n #endif\n ${src}\n `;\n }\n return `\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in attribute\n #define out varying\n #endif\n ${src}\n `;\n}\n\nexport { addProgramDefines };\n//# sourceMappingURL=addProgramDefines.mjs.map\n","\"use strict\";\nfunction ensurePrecision(src, options, isFragment) {\n const maxSupportedPrecision = isFragment ? options.maxSupportedFragmentPrecision : options.maxSupportedVertexPrecision;\n if (src.substring(0, 9) !== \"precision\") {\n let precision = isFragment ? options.requestedFragmentPrecision : options.requestedVertexPrecision;\n if (precision === \"highp\" && maxSupportedPrecision !== \"highp\") {\n precision = \"mediump\";\n }\n return `precision ${precision} float;\n${src}`;\n } else if (maxSupportedPrecision !== \"highp\" && src.substring(0, 15) === \"precision highp\") {\n return src.replace(\"precision highp\", \"precision mediump\");\n }\n return src;\n}\n\nexport { ensurePrecision };\n//# sourceMappingURL=ensurePrecision.mjs.map\n","\"use strict\";\nfunction insertVersion(src, isES300) {\n if (!isES300) return src;\n return `#version 300 es\n${src}`;\n}\n\nexport { insertVersion };\n//# sourceMappingURL=insertVersion.mjs.map\n","\"use strict\";\nconst fragmentNameCache = {};\nconst VertexNameCache = {};\nfunction setProgramName(src, { name = `pixi-program` }, isFragment = true) {\n name = name.replace(/\\s+/g, \"-\");\n name += isFragment ? \"-fragment\" : \"-vertex\";\n const nameCache = isFragment ? fragmentNameCache : VertexNameCache;\n if (nameCache[name]) {\n nameCache[name]++;\n name += `-${nameCache[name]}`;\n } else {\n nameCache[name] = 1;\n }\n if (src.indexOf(\"#define SHADER_NAME\") !== -1) return src;\n const shaderName = `#define SHADER_NAME ${name}`;\n return `${shaderName}\n${src}`;\n}\n\nexport { setProgramName };\n//# sourceMappingURL=setProgramName.mjs.map\n","\"use strict\";\nfunction stripVersion(src, isES300) {\n if (!isES300) return src;\n return src.replace(\"#version 300 es\", \"\");\n}\n\nexport { stripVersion };\n//# sourceMappingURL=stripVersion.mjs.map\n","import { createIdFromString } from '../../shared/utils/createIdFromString.mjs';\nimport { getMaxFragmentPrecision } from './program/getMaxFragmentPrecision.mjs';\nimport { addProgramDefines } from './program/preprocessors/addProgramDefines.mjs';\nimport { ensurePrecision } from './program/preprocessors/ensurePrecision.mjs';\nimport { insertVersion } from './program/preprocessors/insertVersion.mjs';\nimport { setProgramName } from './program/preprocessors/setProgramName.mjs';\nimport { stripVersion } from './program/preprocessors/stripVersion.mjs';\n\n\"use strict\";\nconst processes = {\n // strips any version headers..\n stripVersion,\n // adds precision string if not already present\n ensurePrecision,\n // add some defines if WebGL1 to make it more compatible with WebGL2 shaders\n addProgramDefines,\n // add the program name to the shader\n setProgramName,\n // add the version string to the shader header\n insertVersion\n};\nconst programCache = /* @__PURE__ */ Object.create(null);\nconst _GlProgram = class _GlProgram {\n /**\n * Creates a shiny new GlProgram. Used by WebGL renderer.\n * @param options - The options for the program.\n */\n constructor(options) {\n options = { ..._GlProgram.defaultOptions, ...options };\n const isES300 = options.fragment.indexOf(\"#version 300 es\") !== -1;\n const preprocessorOptions = {\n stripVersion: isES300,\n ensurePrecision: {\n requestedFragmentPrecision: options.preferredFragmentPrecision,\n requestedVertexPrecision: options.preferredVertexPrecision,\n maxSupportedVertexPrecision: \"highp\",\n maxSupportedFragmentPrecision: getMaxFragmentPrecision()\n },\n setProgramName: {\n name: options.name\n },\n addProgramDefines: isES300,\n insertVersion: isES300\n };\n let fragment = options.fragment;\n let vertex = options.vertex;\n Object.keys(processes).forEach((processKey) => {\n const processOptions = preprocessorOptions[processKey];\n fragment = processes[processKey](fragment, processOptions, true);\n vertex = processes[processKey](vertex, processOptions, false);\n });\n this.fragment = fragment;\n this.vertex = vertex;\n this.transformFeedbackVaryings = options.transformFeedbackVaryings;\n this._key = createIdFromString(`${this.vertex}:${this.fragment}`, \"gl-program\");\n }\n /** destroys the program */\n destroy() {\n this.fragment = null;\n this.vertex = null;\n this._attributeData = null;\n this._uniformData = null;\n this._uniformBlockData = null;\n this.transformFeedbackVaryings = null;\n programCache[this._cacheKey] = null;\n }\n /**\n * Helper function that creates a program for a given source.\n * It will check the program cache if the program has already been created.\n * If it has that one will be returned, if not a new one will be created and cached.\n * @param options - The options for the program.\n * @returns A program using the same source\n */\n static from(options) {\n const key = `${options.vertex}:${options.fragment}`;\n if (!programCache[key]) {\n programCache[key] = new _GlProgram(options);\n programCache[key]._cacheKey = key;\n }\n return programCache[key];\n }\n};\n/** The default options used by the program. */\n_GlProgram.defaultOptions = {\n preferredVertexPrecision: \"highp\",\n preferredFragmentPrecision: \"mediump\"\n};\nlet GlProgram = _GlProgram;\n\nexport { GlProgram };\n//# sourceMappingURL=GlProgram.mjs.map\n","\"use strict\";\nconst attributeFormatData = {\n uint8x2: { size: 2, stride: 2, normalised: false },\n uint8x4: { size: 4, stride: 4, normalised: false },\n sint8x2: { size: 2, stride: 2, normalised: false },\n sint8x4: { size: 4, stride: 4, normalised: false },\n unorm8x2: { size: 2, stride: 2, normalised: true },\n unorm8x4: { size: 4, stride: 4, normalised: true },\n snorm8x2: { size: 2, stride: 2, normalised: true },\n snorm8x4: { size: 4, stride: 4, normalised: true },\n uint16x2: { size: 2, stride: 4, normalised: false },\n uint16x4: { size: 4, stride: 8, normalised: false },\n sint16x2: { size: 2, stride: 4, normalised: false },\n sint16x4: { size: 4, stride: 8, normalised: false },\n unorm16x2: { size: 2, stride: 4, normalised: true },\n unorm16x4: { size: 4, stride: 8, normalised: true },\n snorm16x2: { size: 2, stride: 4, normalised: true },\n snorm16x4: { size: 4, stride: 8, normalised: true },\n float16x2: { size: 2, stride: 4, normalised: false },\n float16x4: { size: 4, stride: 8, normalised: false },\n float32: { size: 1, stride: 4, normalised: false },\n float32x2: { size: 2, stride: 8, normalised: false },\n float32x3: { size: 3, stride: 12, normalised: false },\n float32x4: { size: 4, stride: 16, normalised: false },\n uint32: { size: 1, stride: 4, normalised: false },\n uint32x2: { size: 2, stride: 8, normalised: false },\n uint32x3: { size: 3, stride: 12, normalised: false },\n uint32x4: { size: 4, stride: 16, normalised: false },\n sint32: { size: 1, stride: 4, normalised: false },\n sint32x2: { size: 2, stride: 8, normalised: false },\n sint32x3: { size: 3, stride: 12, normalised: false },\n sint32x4: { size: 4, stride: 16, normalised: false }\n};\nfunction getAttributeInfoFromFormat(format) {\n return attributeFormatData[format] ?? attributeFormatData.float32;\n}\n\nexport { getAttributeInfoFromFormat };\n//# sourceMappingURL=getAttributeInfoFromFormat.mjs.map\n","import { getAttributeInfoFromFormat } from '../../../shared/geometry/utils/getAttributeInfoFromFormat.mjs';\n\n\"use strict\";\nconst WGSL_TO_VERTEX_TYPES = {\n f32: \"float32\",\n \"vec2<f32>\": \"float32x2\",\n \"vec3<f32>\": \"float32x3\",\n \"vec4<f32>\": \"float32x4\",\n vec2f: \"float32x2\",\n vec3f: \"float32x3\",\n vec4f: \"float32x4\",\n i32: \"sint32\",\n \"vec2<i32>\": \"sint32x2\",\n \"vec3<i32>\": \"sint32x3\",\n \"vec4<i32>\": \"sint32x4\",\n vec2i: \"sint32x2\",\n vec3i: \"sint32x3\",\n vec4i: \"sint32x4\",\n u32: \"uint32\",\n \"vec2<u32>\": \"uint32x2\",\n \"vec3<u32>\": \"uint32x3\",\n \"vec4<u32>\": \"uint32x4\",\n vec2u: \"uint32x2\",\n vec3u: \"uint32x3\",\n vec4u: \"uint32x4\",\n bool: \"uint32\",\n \"vec2<bool>\": \"uint32x2\",\n \"vec3<bool>\": \"uint32x3\",\n \"vec4<bool>\": \"uint32x4\"\n};\nconst LOCATION_REGEX = /@location\\((\\d+)\\)\\s+([a-zA-Z0-9_]+)\\s*:\\s*([a-zA-Z0-9_<>]+)(?:,|\\s|\\)|$)/g;\nfunction parseLocations(str, results) {\n let match;\n while ((match = LOCATION_REGEX.exec(str)) !== null) {\n const format = WGSL_TO_VERTEX_TYPES[match[3]] ?? \"float32\";\n results[match[2]] = {\n location: parseInt(match[1], 10),\n format,\n stride: getAttributeInfoFromFormat(format).stride,\n offset: 0,\n instance: false,\n start: 0\n };\n }\n LOCATION_REGEX.lastIndex = 0;\n}\nfunction stripComments(source) {\n return source.replace(/\\/\\/.*$/gm, \"\").replace(/\\/\\*[\\s\\S]*?\\*\\//g, \"\");\n}\nfunction extractAttributesFromGpuProgram({ source, entryPoint }) {\n const results = {};\n const cleanSource = stripComments(source);\n const mainVertStart = cleanSource.indexOf(`fn ${entryPoint}(`);\n if (mainVertStart === -1) {\n return results;\n }\n const arrowFunctionStart = cleanSource.indexOf(\"->\", mainVertStart);\n if (arrowFunctionStart === -1) {\n return results;\n }\n const functionArgsSubstring = cleanSource.substring(mainVertStart, arrowFunctionStart);\n parseLocations(functionArgsSubstring, results);\n if (Object.keys(results).length === 0) {\n const structMatch = functionArgsSubstring.match(/\\(\\s*\\w+\\s*:\\s*(\\w+)/);\n if (structMatch) {\n const structName = structMatch[1];\n const structRegex = new RegExp(`struct\\\\s+${structName}\\\\s*\\\\{([^}]+)\\\\}`, \"s\");\n const structBody = cleanSource.match(structRegex);\n if (structBody) {\n parseLocations(structBody[1], results);\n }\n }\n }\n return results;\n}\n\nexport { extractAttributesFromGpuProgram };\n//# sourceMappingURL=extractAttributesFromGpuProgram.mjs.map\n","\"use strict\";\nfunction extractStructAndGroups(wgsl) {\n const linePattern = /(^|[^/])@(group|binding)\\(\\d+\\)[^;]+;/g;\n const groupPattern = /@group\\((\\d+)\\)/;\n const bindingPattern = /@binding\\((\\d+)\\)/;\n const namePattern = /var(<[^>]+>)? (\\w+)/;\n const typePattern = /:\\s*([\\w<>]+)/;\n const structPattern = /struct\\s+(\\w+)\\s*{([^}]+)}/g;\n const structMemberPattern = /(\\w+)\\s*:\\s*([\\w\\<\\>]+)/g;\n const structName = /struct\\s+(\\w+)/;\n const groups = wgsl.match(linePattern)?.map((item) => ({\n group: parseInt(item.match(groupPattern)[1], 10),\n binding: parseInt(item.match(bindingPattern)[1], 10),\n name: item.match(namePattern)[2],\n isUniform: item.match(namePattern)[1] === \"<uniform>\",\n type: item.match(typePattern)[1]\n }));\n if (!groups) {\n return {\n groups: [],\n structs: []\n };\n }\n const structs = wgsl.match(structPattern)?.map((struct) => {\n const name = struct.match(structName)[1];\n const members = struct.match(structMemberPattern).reduce((acc, member) => {\n const [name2, type] = member.split(\":\");\n acc[name2.trim()] = type.trim();\n return acc;\n }, {});\n if (!members) {\n return null;\n }\n return { name, members };\n }).filter(({ name }) => groups.some(\n (group) => (\n // Handle both direct type matches and generic types like array<StructName>\n group.type === name || group.type.includes(`<${name}>`)\n )\n )) ?? [];\n return {\n groups,\n structs\n };\n}\n\nexport { extractStructAndGroups };\n//# sourceMappingURL=extractStructAndGroups.mjs.map\n","\"use strict\";\nvar ShaderStage = /* @__PURE__ */ ((ShaderStage2) => {\n ShaderStage2[ShaderStage2[\"VERTEX\"] = 1] = \"VERTEX\";\n ShaderStage2[ShaderStage2[\"FRAGMENT\"] = 2] = \"FRAGMENT\";\n ShaderStage2[ShaderStage2[\"COMPUTE\"] = 4] = \"COMPUTE\";\n return ShaderStage2;\n})(ShaderStage || {});\n\nexport { ShaderStage };\n//# sourceMappingURL=const.mjs.map\n","import { ShaderStage } from '../../../shared/shader/const.mjs';\n\n\"use strict\";\nfunction generateGpuLayoutGroups({ groups }) {\n const layout = [];\n for (let i = 0; i < groups.length; i++) {\n const group = groups[i];\n if (!layout[group.group]) {\n layout[group.group] = [];\n }\n if (group.isUniform) {\n layout[group.group].push({\n binding: group.binding,\n visibility: ShaderStage.VERTEX | ShaderStage.FRAGMENT,\n buffer: {\n type: \"uniform\"\n }\n });\n } else if (group.type === \"sampler\") {\n layout[group.group].push({\n binding: group.binding,\n visibility: ShaderStage.FRAGMENT,\n sampler: {\n type: \"filtering\"\n }\n });\n } else if (group.type === \"texture_2d\" || group.type.startsWith(\"texture_2d<\")) {\n layout[group.group].push({\n binding: group.binding,\n visibility: ShaderStage.FRAGMENT,\n texture: {\n sampleType: \"float\",\n viewDimension: \"2d\",\n multisampled: false\n }\n });\n } else if (group.type === \"texture_2d_array\" || group.type.startsWith(\"texture_2d_array<\")) {\n layout[group.group].push({\n binding: group.binding,\n visibility: ShaderStage.FRAGMENT,\n texture: {\n sampleType: \"float\",\n viewDimension: \"2d-array\",\n multisampled: false\n }\n });\n } else if (group.type === \"texture_cube\" || group.type.startsWith(\"texture_cube<\")) {\n layout[group.group].push({\n binding: group.binding,\n visibility: ShaderStage.FRAGMENT,\n texture: {\n sampleType: \"float\",\n viewDimension: \"cube\",\n multisampled: false\n }\n });\n }\n }\n for (let i = 0; i < layout.length; i++) {\n layout[i] || (layout[i] = []);\n }\n return layout;\n}\n\nexport { generateGpuLayoutGroups };\n//# sourceMappingURL=generateGpuLayoutGroups.mjs.map\n","\"use strict\";\nfunction generateLayoutHash({ groups }) {\n const layout = [];\n for (let i = 0; i < groups.length; i++) {\n const group = groups[i];\n if (!layout[group.group]) {\n layout[group.group] = {};\n }\n layout[group.group][group.name] = group.binding;\n }\n return layout;\n}\n\nexport { generateLayoutHash };\n//# sourceMappingURL=generateLayoutHash.mjs.map\n","\"use strict\";\nfunction removeStructAndGroupDuplicates(vertexStructsAndGroups, fragmentStructsAndGroups) {\n const structNameSet = /* @__PURE__ */ new Set();\n const dupeGroupKeySet = /* @__PURE__ */ new Set();\n const structs = [...vertexStructsAndGroups.structs, ...fragmentStructsAndGroups.structs].filter((struct) => {\n if (structNameSet.has(struct.name)) {\n return false;\n }\n structNameSet.add(struct.name);\n return true;\n });\n const groups = [...vertexStructsAndGroups.groups, ...fragmentStructsAndGroups.groups].filter((group) => {\n const key = `${group.name}-${group.binding}`;\n if (dupeGroupKeySet.has(key)) {\n return false;\n }\n dupeGroupKeySet.add(key);\n return true;\n });\n return { structs, groups };\n}\n\nexport { removeStructAndGroupDuplicates };\n//# sourceMappingURL=removeStructAndGroupDuplicates.mjs.map\n","import { createIdFromString } from '../../shared/utils/createIdFromString.mjs';\nimport { extractAttributesFromGpuProgram } from './utils/extractAttributesFromGpuProgram.mjs';\nimport { extractStructAndGroups } from './utils/extractStructAndGroups.mjs';\nimport { generateGpuLayoutGroups } from './utils/generateGpuLayoutGroups.mjs';\nimport { generateLayoutHash } from './utils/generateLayoutHash.mjs';\nimport { removeStructAndGroupDuplicates } from './utils/removeStructAndGroupDuplicates.mjs';\n\n\"use strict\";\nconst programCache = /* @__PURE__ */ Object.create(null);\nclass GpuProgram {\n /**\n * Create a new GpuProgram\n * @param options - The options for the gpu program\n */\n constructor(options) {\n /** @internal */\n this._layoutKey = 0;\n /** @internal */\n this._attributeLocationsKey = 0;\n const { fragment, vertex, layout, gpuLayout, name } = options;\n this.name = name;\n this.fragment = fragment;\n this.vertex = vertex;\n if (fragment.source === vertex.source) {\n const structsAndGroups = extractStructAndGroups(fragment.source);\n this.structsAndGroups = structsAndGroups;\n } else {\n const vertexStructsAndGroups = extractStructAndGroups(vertex.source);\n const fragmentStructsAndGroups = extractStructAndGroups(fragment.source);\n this.structsAndGroups = removeStructAndGroupDuplicates(vertexStructsAndGroups, fragmentStructsAndGroups);\n }\n this.layout = layout ?? generateLayoutHash(this.structsAndGroups);\n this.gpuLayout = gpuLayout ?? generateGpuLayoutGroups(this.structsAndGroups);\n this.autoAssignGlobalUniforms = !!(this.layout[0]?.globalUniforms !== void 0);\n this.autoAssignLocalUniforms = !!(this.layout[1]?.localUniforms !== void 0);\n this._generateProgramKey();\n }\n // TODO maker this pure\n _generateProgramKey() {\n const { vertex, fragment } = this;\n const bigKey = vertex.source + fragment.source + vertex.entryPoint + fragment.entryPoint;\n this._layoutKey = createIdFromString(bigKey, \"program\");\n }\n get attributeData() {\n this._attributeData ?? (this._attributeData = extractAttributesFromGpuProgram(this.vertex));\n return this._attributeData;\n }\n /** destroys the program */\n destroy() {\n this.gpuLayout = null;\n this.layout = null;\n this.structsAndGroups = null;\n this.fragment = null;\n this.vertex = null;\n programCache[this._cacheKey] = null;\n }\n /**\n * Helper function that creates a program for a given source.\n * It will check the program cache if the program has already been created.\n * If it has that one will be returned, if not a new one will be created and cached.\n * @param options - The options for the program.\n * @returns A program using the same source\n */\n static from(options) {\n const key = `${options.vertex.source}:${options.fragment.source}:${options.fragment.entryPoint}:${options.vertex.entryPoint}`;\n if (!programCache[key]) {\n programCache[key] = new GpuProgram(options);\n programCache[key]._cacheKey = key;\n }\n return programCache[key];\n }\n}\n\nexport { GpuProgram };\n//# sourceMappingURL=GpuProgram.mjs.map\n","\"use strict\";\nconst UNIFORM_TYPES_VALUES = [\n \"f32\",\n \"i32\",\n \"vec2<f32>\",\n \"vec3<f32>\",\n \"vec4<f32>\",\n \"mat2x2<f32>\",\n \"mat3x3<f32>\",\n \"mat4x4<f32>\",\n \"mat3x2<f32>\",\n \"mat4x2<f32>\",\n \"mat2x3<f32>\",\n \"mat4x3<f32>\",\n \"mat2x4<f32>\",\n \"mat3x4<f32>\",\n \"vec2<i32>\",\n \"vec3<i32>\",\n \"vec4<i32>\"\n];\nconst UNIFORM_TYPES_MAP = UNIFORM_TYPES_VALUES.reduce((acc, type) => {\n acc[type] = true;\n return acc;\n}, {});\n\nexport { UNIFORM_TYPES_MAP, UNIFORM_TYPES_VALUES };\n//# sourceMappingURL=types.mjs.map\n","\"use strict\";\nfunction getDefaultUniformValue(type, size) {\n switch (type) {\n case \"f32\":\n return 0;\n case \"vec2<f32>\":\n return new Float32Array(2 * size);\n case \"vec3<f32>\":\n return new Float32Array(3 * size);\n case \"vec4<f32>\":\n return new Float32Array(4 * size);\n case \"mat2x2<f32>\":\n return new Float32Array([\n 1,\n 0,\n 0,\n 1\n ]);\n case \"mat3x3<f32>\":\n return new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 1\n ]);\n case \"mat4x4<f32>\":\n return new Float32Array([\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1\n ]);\n }\n return null;\n}\n\nexport { getDefaultUniformValue };\n//# sourceMappingURL=getDefaultUniformValue.mjs.map\n","import { uid } from '../../../../utils/data/uid.mjs';\nimport { createIdFromString } from '../utils/createIdFromString.mjs';\nimport { UNIFORM_TYPES_MAP, UNIFORM_TYPES_VALUES } from './types.mjs';\nimport { getDefaultUniformValue } from './utils/getDefaultUniformValue.mjs';\n\n\"use strict\";\nconst _UniformGroup = class _UniformGroup {\n /**\n * Create a new Uniform group\n * @param uniformStructures - The structures of the uniform group\n * @param options - The optional parameters of this uniform group\n */\n constructor(uniformStructures, options) {\n /**\n * used internally to know if a uniform group was used in the last render pass\n * @internal\n */\n this._touched = 0;\n /** a unique id for this uniform group used through the renderer */\n this.uid = uid(\"uniform\");\n /**\n * a resource type, used to identify how to handle it when its in a bind group / shader resource\n * @internal\n */\n this._resourceType = \"uniformGroup\";\n /**\n * the resource id used internally by the renderer to build bind group keys\n * @internal\n */\n this._resourceId = uid(\"resource\");\n /** used ito identify if this is a uniform group */\n this.isUniformGroup = true;\n /**\n * used to flag if this Uniform groups data is different from what it has stored in its buffer / on the GPU\n * @internal\n */\n this._dirtyId = 0;\n // implementing the interface - UniformGroup are not destroyed\n this.destroyed = false;\n options = { ..._UniformGroup.defaultOptions, ...options };\n this.uniformStructures = uniformStructures;\n const uniforms = {};\n for (const i in uniformStructures) {\n const uniformData = uniformStructures[i];\n uniformData.name = i;\n uniformData.size = uniformData.size ?? 1;\n if (!UNIFORM_TYPES_MAP[uniformData.type]) {\n const arrayMatch = uniformData.type.match(/^array<(\\w+(?:<\\w+>)?),\\s*(\\d+)>$/);\n if (arrayMatch) {\n const [, innerType, size] = arrayMatch;\n throw new Error(\n `Uniform type ${uniformData.type} is not supported. Use type: '${innerType}', size: ${size} instead.`\n );\n }\n throw new Error(`Uniform type ${uniformData.type} is not supported. Supported uniform types are: ${UNIFORM_TYPES_VALUES.join(\", \")}`);\n }\n uniformData.value ?? (uniformData.value = getDefaultUniformValue(uniformData.type, uniformData.size));\n uniforms[i] = uniformData.value;\n }\n this.uniforms = uniforms;\n this._dirtyId = 1;\n this.ubo = options.ubo;\n this.isStatic = options.isStatic;\n this._signature = createIdFromString(Object.keys(uniforms).map(\n (i) => `${i}-${uniformStructures[i].type}`\n ).join(\"-\"), \"uniform-group\");\n }\n /** Call this if you want the uniform groups data to be uploaded to the GPU only useful if `isStatic` is true. */\n update() {\n this._dirtyId++;\n }\n};\n/** The default options used by the uniform group. */\n_UniformGroup.defaultOptions = {\n /** if true the UniformGroup is handled as an Uniform buffer object. */\n ubo: false,\n /** if true, then you are responsible for when the data is uploaded to the GPU by calling `update()` */\n isStatic: false\n};\nlet UniformGroup = _UniformGroup;\n\nexport { UniformGroup };\n//# sourceMappingURL=UniformGroup.mjs.map\n","\"use strict\";\nclass BindGroup {\n /**\n * Create a new instance eof the Bind Group.\n * @param resources - The resources that are bound together for use by a shader.\n */\n constructor(resources) {\n /** The resources that are bound together for use by a shader. */\n this.resources = /* @__PURE__ */ Object.create(null);\n this._dirty = true;\n let index = 0;\n for (const i in resources) {\n const resource = resources[i];\n this.setResource(resource, index++);\n }\n this._updateKey();\n }\n /**\n * Updates the key if its flagged as dirty. This is used internally to\n * match this bind group to a WebGPU BindGroup.\n * @internal\n */\n _updateKey() {\n if (!this._dirty) return;\n this._dirty = false;\n const keyParts = [];\n let index = 0;\n for (const i in this.resources) {\n keyParts[index++] = this.resources[i]._resourceId;\n }\n this._key = keyParts.join(\"|\");\n }\n /**\n * Set a resource at a given index. this function will\n * ensure that listeners will be removed from the current resource\n * and added to the new resource.\n * @param resource - The resource to set.\n * @param index - The index to set the resource at.\n */\n setResource(resource, index) {\n const currentResource = this.resources[index];\n if (resource === currentResource) return;\n currentResource?.off?.(\"change\", this.onResourceChange, this);\n resource.on?.(\"change\", this.onResourceChange, this);\n this.resources[index] = resource;\n this._dirty = true;\n }\n /**\n * Returns the resource at the current specified index.\n * @param index - The index of the resource to get.\n * @returns - The resource at the specified index.\n */\n getResource(index) {\n return this.resources[index];\n }\n /**\n * Used internally to 'touch' each resource, to ensure that the GC\n * knows that all resources in this bind group are still being used.\n * @param now - The current time in milliseconds.\n * @param tick - The current tick.\n * @internal\n */\n _touch(now, tick) {\n const resources = this.resources;\n for (const i in resources) {\n resources[i]._gcLastUsed = now;\n resources[i]._touched = tick;\n }\n }\n /** Destroys this bind group and removes all listeners. */\n destroy() {\n const resources = this.resources;\n for (const i in resources) {\n const resource = resources[i];\n resource?.off?.(\"change\", this.onResourceChange, this);\n }\n this.resources = null;\n }\n onResourceChange(resource) {\n this._dirty = true;\n if (resource.destroyed) {\n this.destroy();\n } else {\n this._updateKey();\n }\n }\n}\n\nexport { BindGroup };\n//# sourceMappingURL=BindGroup.mjs.map\n","\"use strict\";\nvar RendererType = /* @__PURE__ */ ((RendererType2) => {\n RendererType2[RendererType2[\"WEBGL\"] = 1] = \"WEBGL\";\n RendererType2[RendererType2[\"WEBGPU\"] = 2] = \"WEBGPU\";\n RendererType2[RendererType2[\"CANVAS\"] = 4] = \"CANVAS\";\n RendererType2[RendererType2[\"BOTH\"] = 3] = \"BOTH\";\n return RendererType2;\n})(RendererType || {});\n\nexport { RendererType };\n//# sourceMappingURL=types.mjs.map\n","import EventEmitter from 'eventemitter3';\nimport { uid } from '../../../../utils/data/uid.mjs';\nimport { GlProgram } from '../../gl/shader/GlProgram.mjs';\nimport { BindGroup } from '../../gpu/shader/BindGroup.mjs';\nimport { GpuProgram } from '../../gpu/shader/GpuProgram.mjs';\nimport { RendererType } from '../../types.mjs';\nimport { UniformGroup } from './UniformGroup.mjs';\n\n\"use strict\";\nclass Shader extends EventEmitter {\n constructor(options) {\n super();\n /** A unique identifier for the shader */\n this.uid = uid(\"shader\");\n /**\n * A record of the uniform groups and resources used by the shader.\n * This is used by WebGL renderer to sync uniform data.\n * @internal\n */\n this._uniformBindMap = /* @__PURE__ */ Object.create(null);\n this._ownedBindGroups = [];\n /** @internal */\n this._destroyed = false;\n let {\n gpuProgram,\n glProgram,\n groups,\n resources,\n compatibleRenderers,\n groupMap\n } = options;\n this.gpuProgram = gpuProgram;\n this.glProgram = glProgram;\n if (compatibleRenderers === void 0) {\n compatibleRenderers = 0;\n if (gpuProgram) compatibleRenderers |= RendererType.WEBGPU;\n if (glProgram) compatibleRenderers |= RendererType.WEBGL;\n }\n this.compatibleRenderers = compatibleRenderers;\n const nameHash = {};\n if (!resources && !groups) {\n resources = {};\n }\n if (resources && groups) {\n throw new Error(\"[Shader] Cannot have both resources and groups\");\n } else if (!gpuProgram && groups && !groupMap) {\n throw new Error(\"[Shader] No group map or WebGPU shader provided - consider using resources instead.\");\n } else if (!gpuProgram && groups && groupMap) {\n for (const i in groupMap) {\n for (const j in groupMap[i]) {\n const uniformName = groupMap[i][j];\n nameHash[uniformName] = {\n group: i,\n binding: j,\n name: uniformName\n };\n }\n }\n } else if (gpuProgram && groups && !groupMap) {\n const groupData = gpuProgram.structsAndGroups.groups;\n groupMap = {};\n groupData.forEach((data) => {\n groupMap[data.group] = groupMap[data.group] || {};\n groupMap[data.group][data.binding] = data.name;\n nameHash[data.name] = data;\n });\n } else if (resources) {\n groups = {};\n groupMap = {};\n if (gpuProgram) {\n const groupData = gpuProgram.structsAndGroups.groups;\n groupData.forEach((data) => {\n groupMap[data.group] = groupMap[data.group] || {};\n groupMap[data.group][data.binding] = data.name;\n nameHash[data.name] = data;\n });\n }\n let bindTick = 0;\n for (const i in resources) {\n if (nameHash[i]) continue;\n if (!groups[99]) {\n groups[99] = new BindGroup();\n this._ownedBindGroups.push(groups[99]);\n }\n nameHash[i] = { group: 99, binding: bindTick, name: i };\n groupMap[99] = groupMap[99] || {};\n groupMap[99][bindTick] = i;\n bindTick++;\n }\n for (const i in resources) {\n const name = i;\n let value = resources[i];\n if (!value.source && !value._resourceType) {\n value = new UniformGroup(value);\n }\n const data = nameHash[name];\n if (data) {\n if (!groups[data.group]) {\n groups[data.group] = new BindGroup();\n this._ownedBindGroups.push(groups[data.group]);\n }\n groups[data.group].setResource(value, data.binding);\n }\n }\n }\n this.groups = groups;\n this._uniformBindMap = groupMap;\n this.resources = this._buildResourceAccessor(groups, nameHash);\n }\n /**\n * Sometimes a resource group will be provided later (for example global uniforms)\n * In such cases, this method can be used to let the shader know about the group.\n * @param name - the name of the resource group\n * @param groupIndex - the index of the group (should match the webGPU shader group location)\n * @param bindIndex - the index of the bind point (should match the webGPU shader bind point)\n */\n addResource(name, groupIndex, bindIndex) {\n var _a, _b;\n (_a = this._uniformBindMap)[groupIndex] || (_a[groupIndex] = {});\n (_b = this._uniformBindMap[groupIndex])[bindIndex] || (_b[bindIndex] = name);\n if (!this.groups[groupIndex]) {\n this.groups[groupIndex] = new BindGroup();\n this._ownedBindGroups.push(this.groups[groupIndex]);\n }\n }\n _buildResourceAccessor(groups, nameHash) {\n const uniformsOut = {};\n for (const i in nameHash) {\n const data = nameHash[i];\n Object.defineProperty(uniformsOut, data.name, {\n get() {\n return groups[data.group].getResource(data.binding);\n },\n set(value) {\n groups[data.group].setResource(value, data.binding);\n }\n });\n }\n return uniformsOut;\n }\n /**\n * Use to destroy the shader when its not longer needed.\n * It will destroy the resources and remove listeners.\n * @param destroyPrograms - if the programs should be destroyed as well.\n * Make sure its not being used by other shaders!\n */\n destroy(destroyPrograms = false) {\n if (this._destroyed) return;\n this._destroyed = true;\n this.emit(\"destroy\", this);\n if (destroyPrograms) {\n this.gpuProgram?.destroy();\n this.glProgram?.destroy();\n }\n this.gpuProgram = null;\n this.glProgram = null;\n this.removeAllListeners();\n this._uniformBindMap = null;\n this._ownedBindGroups.forEach((bindGroup) => {\n bindGroup.destroy();\n });\n this._ownedBindGroups = null;\n this.resources = null;\n this.groups = null;\n }\n static from(options) {\n const { gpu, gl, ...rest } = options;\n let gpuProgram;\n let glProgram;\n if (gpu) {\n gpuProgram = GpuProgram.from(gpu);\n }\n if (gl) {\n glProgram = GlProgram.from(gl);\n }\n return new Shader({\n gpuProgram,\n glProgram,\n ...rest\n });\n }\n}\n\nexport { Shader };\n//# sourceMappingURL=Shader.mjs.map\n","\"use strict\";\nconst blendModeIds = {\n normal: 0,\n add: 1,\n multiply: 2,\n screen: 3,\n overlay: 4,\n erase: 5,\n \"normal-npm\": 6,\n \"add-npm\": 7,\n \"screen-npm\": 8,\n min: 9,\n max: 10\n};\nconst BLEND = 0;\nconst OFFSET = 1;\nconst CULLING = 2;\nconst DEPTH_TEST = 3;\nconst WINDING = 4;\nconst DEPTH_MASK = 5;\nconst _State = class _State {\n constructor() {\n this.data = 0;\n this.blendMode = \"normal\";\n this.polygonOffset = 0;\n this.blend = true;\n this.depthMask = true;\n }\n /**\n * Activates blending of the computed fragment color values.\n * @default true\n */\n get blend() {\n return !!(this.data & 1 << BLEND);\n }\n set blend(value) {\n if (!!(this.data & 1 << BLEND) !== value) {\n this.data ^= 1 << BLEND;\n }\n }\n /**\n * Activates adding an offset to depth values of polygon's fragments\n * @default false\n */\n get offsets() {\n return !!(this.data & 1 << OFFSET);\n }\n set offsets(value) {\n if (!!(this.data & 1 << OFFSET) !== value) {\n this.data ^= 1 << OFFSET;\n }\n }\n /** The culling settings for this state none - No culling back - Back face culling front - Front face culling */\n set cullMode(value) {\n if (value === \"none\") {\n this.culling = false;\n return;\n }\n this.culling = true;\n this.clockwiseFrontFace = value === \"front\";\n }\n get cullMode() {\n if (!this.culling) {\n return \"none\";\n }\n return this.clockwiseFrontFace ? \"front\" : \"back\";\n }\n /**\n * Activates culling of polygons.\n * @default false\n */\n get culling() {\n return !!(this.data & 1 << CULLING);\n }\n set culling(value) {\n if (!!(this.data & 1 << CULLING) !== value) {\n this.data ^= 1 << CULLING;\n }\n }\n /**\n * Activates depth comparisons and updates to the depth buffer.\n * @default false\n */\n get depthTest() {\n return !!(this.data & 1 << DEPTH_TEST);\n }\n set depthTest(value) {\n if (!!(this.data & 1 << DEPTH_TEST) !== value) {\n this.data ^= 1 << DEPTH_TEST;\n }\n }\n /**\n * Enables or disables writing to the depth buffer.\n * @default true\n */\n get depthMask() {\n return !!(this.data & 1 << DEPTH_MASK);\n }\n set depthMask(value) {\n if (!!(this.data & 1 << DEPTH_MASK) !== value) {\n this.data ^= 1 << DEPTH_MASK;\n }\n }\n /**\n * Specifies whether or not front or back-facing polygons can be culled.\n * @default false\n */\n get clockwiseFrontFace() {\n return !!(this.data & 1 << WINDING);\n }\n set clockwiseFrontFace(value) {\n if (!!(this.data & 1 << WINDING) !== value) {\n this.data ^= 1 << WINDING;\n }\n }\n /**\n * The blend mode to be applied when this state is set. Apply a value of `normal` to reset the blend mode.\n * Setting this mode to anything other than NO_BLEND will automatically switch blending on.\n * @default 'normal'\n */\n get blendMode() {\n return this._blendMode;\n }\n set blendMode(value) {\n this.blend = value !== \"none\";\n this._blendMode = value;\n this._blendModeId = blendModeIds[value] || 0;\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() {\n return this._polygonOffset;\n }\n set polygonOffset(value) {\n this.offsets = !!value;\n this._polygonOffset = value;\n }\n toString() {\n return `[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`;\n }\n /**\n * A quickly getting an instance of a State that is configured for 2d rendering.\n * @returns a new State with values set for 2d rendering\n */\n static for2d() {\n const state = new _State();\n state.depthTest = false;\n state.blend = true;\n return state;\n }\n};\n_State.default2d = _State.for2d();\nlet State = _State;\n\nexport { State };\n//# sourceMappingURL=State.mjs.map\n","import { extensions, ExtensionType } from '../extensions/Extensions.mjs';\n\n\"use strict\";\nconst environments = [];\nextensions.handleByNamedList(ExtensionType.Environment, environments);\nasync function loadEnvironmentExtensions(skip) {\n if (skip) return;\n for (let i = 0; i < environments.length; i++) {\n const env = environments[i];\n if (env.value.test()) {\n await env.value.load();\n return;\n }\n }\n}\nasync function autoDetectEnvironment(add) {\n return loadEnvironmentExtensions(!add);\n}\n\nexport { autoDetectEnvironment, loadEnvironmentExtensions };\n//# sourceMappingURL=autoDetectEnvironment.mjs.map\n","\"use strict\";\nlet unsafeEval;\nfunction unsafeEvalSupported() {\n if (typeof unsafeEval === \"boolean\") {\n return unsafeEval;\n }\n try {\n const func = new Function(\"param1\", \"param2\", \"param3\", \"return param1[param2] === param3;\");\n unsafeEval = func({ a: \"b\" }, \"a\", \"b\") === true;\n } catch (_e) {\n unsafeEval = false;\n }\n return unsafeEval;\n}\n\nexport { unsafeEvalSupported };\n//# sourceMappingURL=unsafeEvalSupported.mjs.map\n","\nexport default function earcut(data, holeIndices, dim = 2) {\n\n const hasHoles = holeIndices && holeIndices.length;\n const outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n let outerNode = linkedList(data, 0, outerLen, dim, true);\n const triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n let minX, minY, 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 = data[0];\n minY = data[1];\n let maxX = minX;\n let maxY = minY;\n\n for (let i = dim; i < outerLen; i += dim) {\n const x = data[i];\n const 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 let last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (let i = start; i < end; i += dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);\n } else {\n for (let i = end - dim; i >= start; i -= dim) last = insertNode(i / dim | 0, 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 let 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 let stop = ear;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n const prev = ear.prev;\n const next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n triangles.push(prev.i, ear.i, next.i); // cut off the triangle\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);\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 const 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 const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox\n const x0 = Math.min(ax, bx, cx),\n y0 = Math.min(ay, by, cy),\n x1 = Math.max(ax, bx, cx),\n y1 = Math.max(ay, by, cy);\n\n let p = c.next;\n while (p !== a) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n pointInTriangleExceptFirst(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 const 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 const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox\n const x0 = Math.min(ax, bx, cx),\n y0 = Math.min(ay, by, cy),\n x1 = Math.max(ax, bx, cx),\n y1 = Math.max(ay, by, cy);\n\n // z-order range for the current triangle bbox;\n const minZ = zOrder(x0, y0, minX, minY, invSize),\n maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n let 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 pointInTriangleExceptFirst(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 pointInTriangleExceptFirst(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 pointInTriangleExceptFirst(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 pointInTriangleExceptFirst(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) {\n let p = start;\n do {\n const 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, p.i, b.i);\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 let a = start;\n do {\n let 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 let 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 const queue = [];\n\n for (let i = 0, len = holeIndices.length; i < len; i++) {\n const start = holeIndices[i] * dim;\n const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n const 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(compareXYSlope);\n\n // process holes from left to right\n for (let i = 0; i < queue.length; i++) {\n outerNode = eliminateHole(queue[i], outerNode);\n }\n\n return outerNode;\n}\n\nfunction compareXYSlope(a, b) {\n let result = a.x - b.x;\n // when the left-most point of 2 holes meet at a vertex, sort the holes counterclockwise so that when we find\n // the bridge to the outer shell is always the point that they meet at.\n if (result === 0) {\n result = a.y - b.y;\n if (result === 0) {\n const aSlope = (a.next.y - a.y) / (a.next.x - a.x);\n const bSlope = (b.next.y - b.y) / (b.next.x - b.x);\n result = aSlope - bSlope;\n }\n }\n return result;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and link it\nfunction eliminateHole(hole, outerNode) {\n const bridge = findHoleBridge(hole, outerNode);\n if (!bridge) {\n return outerNode;\n }\n\n const 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 let p = outerNode;\n const hx = hole.x;\n const hy = hole.y;\n let qx = -Infinity;\n let 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 // unless they intersect at a vertex, then choose the vertex\n if (equals(hole, p)) return p;\n do {\n if (equals(hole, p.next)) return p.next;\n else if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n const 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 const stop = m;\n const mx = m.x;\n const my = m.y;\n let tanMin = Infinity;\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 const 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 let 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 let numMerges;\n let inSize = 1;\n\n do {\n let p = list;\n let e;\n list = null;\n let tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n let q = p;\n let pSize = 0;\n for (let i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n let 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 let 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 point lies within a convex triangle but false if its equal to the first point of the triangle\nfunction pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {\n return !(ax === px && ay === py) && pointInTriangle(ax, ay, bx, by, cx, cy, px, 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) && // doesn'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 const o1 = sign(area(p1, q1, p2));\n const o2 = sign(area(p1, q1, q2));\n const o3 = sign(area(p2, q2, p1));\n const 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 let 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 let p = a;\n let inside = false;\n const px = (a.x + b.x) / 2;\n const 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 const a2 = createNode(a.i, a.x, a.y),\n b2 = createNode(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 const p = createNode(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 createNode(i, x, y) {\n return {\n i, // vertex index in coordinates array\n x, y, // vertex coordinates\n prev: null, // previous and next vertex nodes in a polygon ring\n next: null,\n z: 0, // z-order curve value\n prevZ: null, // previous and next nodes in z-order\n nextZ: null,\n steiner: false // indicates whether this is a steiner point\n };\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nexport function deviation(data, holeIndices, dim, triangles) {\n const hasHoles = holeIndices && holeIndices.length;\n const outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n let polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (let i = 0, len = holeIndices.length; i < len; i++) {\n const start = holeIndices[i] * dim;\n const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n let trianglesArea = 0;\n for (let i = 0; i < triangles.length; i += 3) {\n const a = triangles[i] * dim;\n const b = triangles[i + 1] * dim;\n const 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 let sum = 0;\n for (let 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\nexport function flatten(data) {\n const vertices = [];\n const holes = [];\n const dimensions = data[0][0].length;\n let holeIndex = 0;\n let prevLen = 0;\n\n for (const ring of data) {\n for (const p of ring) {\n for (let d = 0; d < dimensions; d++) vertices.push(p[d]);\n }\n if (prevLen) {\n holeIndex += prevLen;\n holes.push(holeIndex);\n }\n prevLen = ring.length;\n }\n return {vertices, holes, dimensions};\n}\n","import earcutModule from 'earcut';\nexport { default as EventEmitter } from 'eventemitter3';\n\n\"use strict\";\nconst earcut = earcutModule.default || earcutModule;\n\nexport { earcut };\n//# sourceMappingURL=utils.mjs.map\n","\"use strict\";\nvar CLEAR = /* @__PURE__ */ ((CLEAR2) => {\n CLEAR2[CLEAR2[\"NONE\"] = 0] = \"NONE\";\n CLEAR2[CLEAR2[\"COLOR\"] = 16384] = \"COLOR\";\n CLEAR2[CLEAR2[\"STENCIL\"] = 1024] = \"STENCIL\";\n CLEAR2[CLEAR2[\"DEPTH\"] = 256] = \"DEPTH\";\n CLEAR2[CLEAR2[\"COLOR_DEPTH\"] = 16640] = \"COLOR_DEPTH\";\n CLEAR2[CLEAR2[\"COLOR_STENCIL\"] = 17408] = \"COLOR_STENCIL\";\n CLEAR2[CLEAR2[\"DEPTH_STENCIL\"] = 1280] = \"DEPTH_STENCIL\";\n CLEAR2[CLEAR2[\"ALL\"] = 17664] = \"ALL\";\n return CLEAR2;\n})(CLEAR || {});\n\nexport { CLEAR };\n//# sourceMappingURL=const.mjs.map\n","\"use strict\";\nclass SystemRunner {\n /**\n * @param name - The function name that will be executed on the listeners added to this Runner.\n */\n constructor(name) {\n this.items = [];\n this._name = name;\n }\n /* 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 /* jsdoc/check-param-names */\n emit(a0, a1, a2, a3, a4, a5, a6, a7) {\n const { name, items } = this;\n for (let i = 0, len = items.length; i < len; i++) {\n items[i][name](a0, a1, a2, a3, a4, a5, a6, a7);\n }\n return this;\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 * ```ts\n * import { Runner } from 'pixi.js';\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 add(item) {\n if (item[this._name]) {\n this.remove(item);\n this.items.push(item);\n }\n return this;\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 remove(item) {\n const index = this.items.indexOf(item);\n if (index !== -1) {\n this.items.splice(index, 1);\n }\n return this;\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 contains(item) {\n return this.items.indexOf(item) !== -1;\n }\n /** Remove all listeners from the Runner */\n removeAll() {\n this.items.length = 0;\n return this;\n }\n /** Remove all references, don't use after this. */\n destroy() {\n this.removeAll();\n this.items = null;\n this._name = null;\n }\n /**\n * `true` if there are no this Runner contains no listeners\n * @readonly\n */\n get empty() {\n return this.items.length === 0;\n }\n /**\n * The name of the runner.\n * @readonly\n */\n get name() {\n return this._name;\n }\n}\n\nexport { SystemRunner };\n//# sourceMappingURL=SystemRunner.mjs.map\n","import { Color } from '../../../../color/Color.mjs';\nimport { loadEnvironmentExtensions } from '../../../../environment/autoDetectEnvironment.mjs';\nimport { Container } from '../../../../scene/container/Container.mjs';\nimport { unsafeEvalSupported } from '../../../../utils/browser/unsafeEvalSupported.mjs';\nimport { uid } from '../../../../utils/data/uid.mjs';\nimport { deprecation, v8_0_0 } from '../../../../utils/logging/deprecation.mjs';\nimport { GlobalResourceRegistry } from '../../../../utils/pool/GlobalResourceRegistry.mjs';\nimport '../../../../utils/utils.mjs';\nimport { CLEAR } from '../../gl/const.mjs';\nimport { SystemRunner } from './SystemRunner.mjs';\nimport EventEmitter from 'eventemitter3';\n\n\"use strict\";\nconst defaultRunners = [\n \"init\",\n \"destroy\",\n \"contextChange\",\n \"resolutionChange\",\n \"resetState\",\n \"renderEnd\",\n \"renderStart\",\n \"render\",\n \"update\",\n \"postrender\",\n \"prerender\"\n];\nconst _AbstractRenderer = class _AbstractRenderer extends EventEmitter {\n /**\n * Set up a system with a collection of SystemClasses and runners.\n * Systems are attached dynamically to this class when added.\n * @param config - the config for the system manager\n */\n constructor(config) {\n super();\n /** The current tick of the renderer. */\n this.tick = 0;\n /** @internal */\n this.uid = uid(\"renderer\");\n /** @internal */\n this.runners = /* @__PURE__ */ Object.create(null);\n /** @internal */\n this.renderPipes = /* @__PURE__ */ Object.create(null);\n this._initOptions = {};\n this._systemsHash = /* @__PURE__ */ Object.create(null);\n this.type = config.type;\n this.name = config.name;\n this.config = config;\n const combinedRunners = [...defaultRunners, ...this.config.runners ?? []];\n this._addRunners(...combinedRunners);\n this._unsafeEvalCheck();\n }\n /**\n * Initialize the renderer.\n * @param options - The options to use to create the renderer.\n */\n async init(options = {}) {\n const skip = options.skipExtensionImports === true ? true : options.manageImports === false;\n await loadEnvironmentExtensions(skip);\n this._addSystems(this.config.systems);\n this._addPipes(this.config.renderPipes, this.config.renderPipeAdaptors);\n for (const systemName in this._systemsHash) {\n const system = this._systemsHash[systemName];\n const defaultSystemOptions = system.constructor.defaultOptions;\n options = { ...defaultSystemOptions, ...options };\n }\n options = { ..._AbstractRenderer.defaultOptions, ...options };\n this._roundPixels = options.roundPixels ? 1 : 0;\n for (let i = 0; i < this.runners.init.items.length; i++) {\n await this.runners.init.items[i].init(options);\n }\n this._initOptions = options;\n }\n render(args, deprecated) {\n this.tick++;\n let options = args;\n if (options instanceof Container) {\n options = { container: options };\n if (deprecated) {\n deprecation(v8_0_0, \"passing a second argument is deprecated, please use render options instead\");\n options.target = deprecated.renderTexture;\n }\n }\n options.target || (options.target = this.view.renderTarget);\n if (options.target === this.view.renderTarget) {\n this._lastObjectRendered = options.container;\n options.clearColor ?? (options.clearColor = this.background.colorRgba);\n options.clear ?? (options.clear = this.background.clearBeforeRender);\n }\n if (options.clearColor) {\n const isRGBAArray = Array.isArray(options.clearColor) && options.clearColor.length === 4;\n options.clearColor = isRGBAArray ? options.clearColor : Color.shared.setValue(options.clearColor).toArray();\n }\n if (!options.transform) {\n options.container.updateLocalTransform();\n options.transform = options.container.localTransform;\n }\n if (!options.container.visible) {\n return;\n }\n options.container.enableRenderGroup();\n this.runners.prerender.emit(options);\n this.runners.renderStart.emit(options);\n this.runners.render.emit(options);\n this.runners.renderEnd.emit(options);\n this.runners.postrender.emit(options);\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 * @param resolution - The resolution / device pixel ratio of the renderer.\n */\n resize(desiredScreenWidth, desiredScreenHeight, resolution) {\n const previousResolution = this.view.resolution;\n this.view.resize(desiredScreenWidth, desiredScreenHeight, resolution);\n this.emit(\"resize\", this.view.screen.width, this.view.screen.height, this.view.resolution);\n if (resolution !== void 0 && resolution !== previousResolution) {\n this.runners.resolutionChange.emit(resolution);\n }\n }\n /**\n * Clears the render target.\n * @param options - The options to use when clearing the render target.\n * @param options.target - The render target to clear.\n * @param options.clearColor - The color to clear with.\n * @param options.clear - The clear mode to use.\n * @advanced\n */\n clear(options = {}) {\n const renderer = this;\n options.target || (options.target = renderer.renderTarget.renderTarget);\n options.clearColor || (options.clearColor = this.background.colorRgba);\n options.clear ?? (options.clear = CLEAR.ALL);\n const { clear, clearColor, target, mipLevel, layer } = options;\n Color.shared.setValue(clearColor ?? this.background.colorRgba);\n renderer.renderTarget.clear(target, clear, Color.shared.toArray(), mipLevel ?? 0, layer ?? 0);\n }\n /** The resolution / device pixel ratio of the renderer. */\n get resolution() {\n return this.view.resolution;\n }\n set resolution(value) {\n this.view.resolution = value;\n this.runners.resolutionChange.emit(value);\n }\n /**\n * Same as view.width, actual number of pixels in the canvas by horizontal.\n * @type {number}\n * @readonly\n * @default 800\n */\n get width() {\n return this.view.texture.frame.width;\n }\n /**\n * Same as view.height, actual number of pixels in the canvas by vertical.\n * @default 600\n */\n get height() {\n return this.view.texture.frame.height;\n }\n // NOTE: this was `view` in v7\n /**\n * The canvas element that everything is drawn to.\n * @type {environment.ICanvas}\n */\n get canvas() {\n return this.view.canvas;\n }\n /**\n * the last object rendered by the renderer. Useful for other plugins like interaction managers\n * @readonly\n */\n get lastObjectRendered() {\n return this._lastObjectRendered;\n }\n /**\n * Flag if we are rendering to the screen vs renderTexture\n * @readonly\n * @default true\n */\n get renderingToScreen() {\n const renderer = this;\n return renderer.renderTarget.renderingToScreen;\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 */\n get screen() {\n return this.view.screen;\n }\n /**\n * Create a bunch of runners based of a collection of ids\n * @param runnerIds - the runner ids to add\n */\n _addRunners(...runnerIds) {\n runnerIds.forEach((runnerId) => {\n this.runners[runnerId] = new SystemRunner(runnerId);\n });\n }\n _addSystems(systems) {\n let i;\n for (i in systems) {\n const val = systems[i];\n this._addSystem(val.value, val.name);\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, name) {\n const system = new ClassRef(this);\n if (this[name]) {\n throw new Error(`Whoops! The name \"${name}\" is already in use`);\n }\n this[name] = system;\n this._systemsHash[name] = system;\n for (const i in this.runners) {\n this.runners[i].add(system);\n }\n return this;\n }\n _addPipes(pipes, pipeAdaptors) {\n const adaptors = pipeAdaptors.reduce((acc, adaptor) => {\n acc[adaptor.name] = adaptor.value;\n return acc;\n }, {});\n pipes.forEach((pipe) => {\n const PipeClass = pipe.value;\n const name = pipe.name;\n const Adaptor = adaptors[name];\n this.renderPipes[name] = new PipeClass(\n this,\n Adaptor ? new Adaptor() : null\n );\n this.runners.destroy.add(this.renderPipes[name]);\n });\n }\n destroy(options = false) {\n this.runners.destroy.items.reverse();\n this.runners.destroy.emit(options);\n if (options === true || typeof options === \"object\" && options.releaseGlobalResources) {\n GlobalResourceRegistry.release();\n }\n Object.values(this.runners).forEach((runner) => {\n runner.destroy();\n });\n this._systemsHash = null;\n this.renderPipes = null;\n this.removeAllListeners();\n }\n /**\n * Generate a texture from a container.\n * @param options - options or container target to use when generating the texture\n * @returns a texture\n */\n generateTexture(options) {\n return this.textureGenerator.generateTexture(options);\n }\n /**\n * Whether the renderer will round coordinates to whole pixels when rendering.\n * Can be overridden on a per scene item basis.\n */\n get roundPixels() {\n return !!this._roundPixels;\n }\n /**\n * Overridable function by `pixi.js/unsafe-eval` to silence\n * throwing an error if platform doesn't support unsafe-evals.\n * @private\n * @ignore\n */\n _unsafeEvalCheck() {\n if (!unsafeEvalSupported()) {\n throw new Error(\"Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.\");\n }\n }\n /**\n * Resets the rendering state of the renderer.\n * This is useful when you want to use the WebGL context directly and need to ensure PixiJS's internal state\n * stays synchronized. When modifying the WebGL context state externally, calling this method before the next Pixi\n * render will reset all internal caches and ensure it executes correctly.\n *\n * This is particularly useful when combining PixiJS with other rendering engines like Three.js:\n * ```js\n * // Reset Three.js state\n * threeRenderer.resetState();\n *\n * // Render a Three.js scene\n * threeRenderer.render(threeScene, threeCamera);\n *\n * // Reset PixiJS state since Three.js modified the WebGL context\n * pixiRenderer.resetState();\n *\n * // Now render Pixi content\n * pixiRenderer.render(pixiScene);\n * ```\n * @advanced\n */\n resetState() {\n this.runners.resetState.emit();\n }\n};\n/** The default options for the renderer. */\n_AbstractRenderer.defaultOptions = {\n /**\n * Default resolution / device pixel ratio of the renderer.\n * @default 1\n */\n resolution: 1,\n /**\n * Should the `failIfMajorPerformanceCaveat` flag be enabled as a context option used in the `isWebGLSupported`\n * function. If set to true, a WebGL renderer can fail to be created if the browser thinks there could be\n * performance issues when using WebGL.\n *\n * In PixiJS v6 this has changed from true to false by default, to allow WebGL to work in as many\n * scenarios as possible. However, some users may have a poor experience, for example, if a user has a gpu or\n * 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 Canvas renderer as a fallback in case high performance WebGL is\n * not supported.\n *\n * 2: Call `isWebGLSupported` (which if found in the utils package) in your code before attempting to create a\n * PixiJS renderer, and show an error message to the user if the function returns false, explaining that their\n * device & browser 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 * @default false\n */\n failIfMajorPerformanceCaveat: false,\n /**\n * Should round pixels be forced when rendering?\n * @default false\n */\n roundPixels: false\n};\nlet AbstractRenderer = _AbstractRenderer;\n\nexport { AbstractRenderer };\n//# sourceMappingURL=AbstractRenderer.mjs.map\n","import { DOMAdapter } from '../../environment/adapter.mjs';\nimport { AbstractRenderer } from '../../rendering/renderers/shared/system/AbstractRenderer.mjs';\n\n\"use strict\";\nlet _isWebGLSupported;\nfunction isWebGLSupported(failIfMajorPerformanceCaveat) {\n if (_isWebGLSupported !== void 0) return _isWebGLSupported;\n _isWebGLSupported = (() => {\n const contextOptions = {\n stencil: true,\n failIfMajorPerformanceCaveat: failIfMajorPerformanceCaveat ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat\n };\n try {\n if (!DOMAdapter.get().getWebGLRenderingContext()) {\n return false;\n }\n const canvas = DOMAdapter.get().createCanvas();\n let gl = canvas.getContext(\"webgl\", contextOptions);\n const success = !!gl?.getContextAttributes()?.stencil;\n if (gl) {\n const loseContext = gl.getExtension(\"WEBGL_lose_context\");\n if (loseContext) {\n loseContext.loseContext();\n }\n }\n gl = null;\n return success;\n } catch (_e) {\n return false;\n }\n })();\n return _isWebGLSupported;\n}\n\nexport { isWebGLSupported };\n//# sourceMappingURL=isWebGLSupported.mjs.map\n","import { DOMAdapter } from '../../environment/adapter.mjs';\n\n\"use strict\";\nlet _isWebGPUSupported;\nasync function isWebGPUSupported(options = {}) {\n if (_isWebGPUSupported !== void 0) return _isWebGPUSupported;\n _isWebGPUSupported = await (async () => {\n const gpu = DOMAdapter.get().getNavigator().gpu;\n if (!gpu) {\n return false;\n }\n try {\n const adapter = await gpu.requestAdapter(options);\n await adapter.requestDevice();\n return true;\n } catch (_e) {\n return false;\n }\n })();\n return _isWebGPUSupported;\n}\n\nexport { isWebGPUSupported };\n//# sourceMappingURL=isWebGPUSupported.mjs.map\n","import { isWebGLSupported } from '../../utils/browser/isWebGLSupported.mjs';\nimport { isWebGPUSupported } from '../../utils/browser/isWebGPUSupported.mjs';\nimport { AbstractRenderer } from './shared/system/AbstractRenderer.mjs';\n\n\"use strict\";\nconst renderPriority = [\"webgl\", \"webgpu\", \"canvas\"];\nasync function autoDetectRenderer(options) {\n let preferredOrder = [];\n if (options.preference) {\n if (Array.isArray(options.preference)) {\n preferredOrder = options.preference.slice();\n } else {\n preferredOrder.push(options.preference);\n renderPriority.forEach((item) => {\n if (item !== options.preference) {\n preferredOrder.push(item);\n }\n });\n }\n } else {\n preferredOrder = renderPriority.slice();\n }\n let RendererClass;\n let finalOptions = {};\n for (let i = 0; i < preferredOrder.length; i++) {\n const rendererType = preferredOrder[i];\n if (rendererType === \"webgpu\" && await isWebGPUSupported()) {\n const { WebGPURenderer } = await import('./gpu/WebGPURenderer.mjs');\n RendererClass = WebGPURenderer;\n finalOptions = { ...options, ...options.webgpu };\n break;\n } else if (rendererType === \"webgl\" && isWebGLSupported(\n options.failIfMajorPerformanceCaveat ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat\n )) {\n const { WebGLRenderer } = await import('./gl/WebGLRenderer.mjs');\n RendererClass = WebGLRenderer;\n finalOptions = { ...options, ...options.webgl };\n break;\n } else if (rendererType === \"canvas\") {\n const { CanvasRenderer } = await import('./canvas/CanvasRenderer.mjs');\n RendererClass = CanvasRenderer;\n finalOptions = { ...options, ...options.canvasOptions };\n break;\n }\n }\n delete finalOptions.webgpu;\n delete finalOptions.webgl;\n delete finalOptions.canvasOptions;\n if (!RendererClass) {\n throw new Error(\"No available renderer for the current environment\");\n }\n const renderer = new RendererClass();\n await renderer.init(finalOptions);\n return renderer;\n}\n\nexport { autoDetectRenderer };\n//# sourceMappingURL=autoDetectRenderer.mjs.map\n","export { default as EventEmitter } from 'eventemitter3';\n\n\"use strict\";\nconst DATA_URI = /^\\s*data:(?:([\\w-]+)\\/([\\w+.-]+))?(?:;charset=([\\w-]+))?(?:;(base64))?,(.*)/i;\nconst VERSION = \"8.19.0\";\n\nexport { DATA_URI, VERSION };\n//# sourceMappingURL=const.mjs.map\n","import { ExtensionType } from '../../extensions/Extensions.mjs';\nimport { VERSION } from '../const.mjs';\n\n\"use strict\";\nclass ApplicationInitHook {\n static init() {\n globalThis.__PIXI_APP_INIT__?.(this, VERSION);\n }\n static destroy() {\n }\n}\n/** @ignore */\nApplicationInitHook.extension = ExtensionType.Application;\nclass RendererInitHook {\n constructor(renderer) {\n this._renderer = renderer;\n }\n init() {\n globalThis.__PIXI_RENDERER_INIT__?.(this._renderer, VERSION);\n }\n destroy() {\n this._renderer = null;\n }\n}\n/** @ignore */\nRendererInitHook.extension = {\n type: [\n ExtensionType.WebGLSystem,\n ExtensionType.WebGPUSystem\n ],\n name: \"initHook\",\n priority: -10\n};\n\nexport { ApplicationInitHook, RendererInitHook };\n//# sourceMappingURL=globalHooks.mjs.map\n","import { ExtensionType } from '../extensions/Extensions.mjs';\n\n\"use strict\";\nclass ResizePlugin {\n /**\n * Initialize the plugin with scope of application instance\n * @private\n * @param {object} [options] - See application options\n */\n static init(options) {\n Object.defineProperty(\n this,\n \"resizeTo\",\n {\n configurable: true,\n set(dom) {\n globalThis.removeEventListener(\"resize\", this.queueResize);\n this._resizeTo = dom;\n if (dom) {\n globalThis.addEventListener(\"resize\", this.queueResize);\n this.resize();\n }\n },\n get() {\n return this._resizeTo;\n }\n }\n );\n this.queueResize = () => {\n if (!this._resizeTo) {\n return;\n }\n this._cancelResize();\n this._resizeId = requestAnimationFrame(() => this.resize());\n };\n this._cancelResize = () => {\n if (this._resizeId) {\n cancelAnimationFrame(this._resizeId);\n this._resizeId = null;\n }\n };\n this.resize = () => {\n if (!this._resizeTo) {\n return;\n }\n this._cancelResize();\n let width;\n let height;\n if (this._resizeTo === globalThis.window) {\n width = globalThis.innerWidth;\n height = globalThis.innerHeight;\n } else {\n const { clientWidth, clientHeight } = this._resizeTo;\n width = clientWidth;\n height = clientHeight;\n }\n this.renderer.resize(width, height);\n this.render();\n };\n this._resizeId = null;\n this._resizeTo = null;\n this.resizeTo = options.resizeTo || null;\n }\n /**\n * Clean up the ticker, scoped to application\n * @private\n */\n static destroy() {\n globalThis.removeEventListener(\"resize\", this.queueResize);\n this._cancelResize();\n this._cancelResize = null;\n this.queueResize = null;\n this.resizeTo = null;\n this.resize = null;\n }\n}\n/** @ignore */\nResizePlugin.extension = ExtensionType.Application;\n\nexport { ResizePlugin };\n//# sourceMappingURL=ResizePlugin.mjs.map\n","import { ExtensionType } from '../extensions/Extensions.mjs';\nimport { UPDATE_PRIORITY } from '../ticker/const.mjs';\nimport { Ticker } from '../ticker/Ticker.mjs';\n\n\"use strict\";\nclass TickerPlugin {\n /**\n * Initialize the plugin with scope of application instance\n * @private\n * @param {object} [options] - See application options\n */\n static init(options) {\n options = Object.assign({\n autoStart: true,\n sharedTicker: false\n }, options);\n Object.defineProperty(\n this,\n \"ticker\",\n {\n configurable: true,\n set(ticker) {\n if (this._ticker) {\n this._ticker.remove(this.render, this);\n }\n this._ticker = ticker;\n if (ticker) {\n ticker.add(this.render, this, UPDATE_PRIORITY.LOW);\n }\n },\n get() {\n return this._ticker;\n }\n }\n );\n this.stop = () => {\n this._ticker.stop();\n };\n this.start = () => {\n this._ticker.start();\n };\n this._ticker = null;\n this.ticker = options.sharedTicker ? Ticker.shared : new Ticker();\n if (options.autoStart) {\n this.start();\n }\n }\n /**\n * Clean up the ticker, scoped to application.\n * @private\n */\n static destroy() {\n if (this._ticker) {\n const oldTicker = this._ticker;\n this.ticker = null;\n oldTicker.destroy();\n }\n }\n}\n/** @ignore */\nTickerPlugin.extension = ExtensionType.Application;\n\nexport { TickerPlugin };\n//# sourceMappingURL=TickerPlugin.mjs.map\n","import { extensions } from '../extensions/Extensions.mjs';\nimport { ResizePlugin } from './ResizePlugin.mjs';\nimport { TickerPlugin } from './TickerPlugin.mjs';\n\n\"use strict\";\nextensions.add(ResizePlugin);\nextensions.add(TickerPlugin);\n//# sourceMappingURL=init.mjs.map\n","import { extensions, ExtensionType } from '../extensions/Extensions.mjs';\nimport { autoDetectRenderer } from '../rendering/renderers/autoDetectRenderer.mjs';\nimport { Container } from '../scene/container/Container.mjs';\nimport { ApplicationInitHook } from '../utils/global/globalHooks.mjs';\nimport { deprecation, v8_0_0 } from '../utils/logging/deprecation.mjs';\nimport './init.mjs';\n\n\"use strict\";\nconst _Application = class _Application {\n constructor(...args) {\n /**\n * The root display container for your application.\n * All visual elements should be added to this container or its children.\n * @example\n * ```js\n * // Create a sprite and add it to the stage\n * const sprite = Sprite.from('image.png');\n * app.stage.addChild(sprite);\n *\n * // Create a container for grouping objects\n * const container = new Container();\n * app.stage.addChild(container);\n * ```\n */\n this.stage = new Container();\n if (args[0] !== void 0) {\n deprecation(v8_0_0, \"Application constructor options are deprecated, please use Application.init() instead.\");\n }\n }\n /**\n * Initializes the PixiJS application with the specified options.\n *\n * This method must be called after creating a new Application instance.\n * @param options - Configuration options for the application and renderer\n * @returns A promise that resolves when initialization is complete\n * @example\n * ```js\n * const app = new Application();\n *\n * // Initialize with custom options\n * await app.init({\n * width: 800,\n * height: 600,\n * backgroundColor: 0x1099bb,\n * preference: 'webgl', // or 'webgpu'\n * });\n * ```\n */\n async init(options) {\n options = { ...options };\n this.stage || (this.stage = new Container());\n this.renderer = await autoDetectRenderer(options);\n _Application._plugins.forEach((plugin) => {\n plugin.init.call(this, options);\n });\n }\n /**\n * Renders the current stage to the screen.\n *\n * When using the default setup with {@link TickerPlugin} (enabled by default), you typically don't need to call\n * this method directly as rendering is handled automatically.\n *\n * Only use this method if you've disabled the {@link TickerPlugin} or need custom\n * render timing control.\n * @example\n * ```js\n * // Example 1: Default setup (TickerPlugin handles rendering)\n * const app = new Application();\n * await app.init();\n * // No need to call render() - TickerPlugin handles it\n *\n * // Example 2: Custom rendering loop (if TickerPlugin is disabled)\n * const app = new Application();\n * await app.init({ autoStart: false }); // Disable automatic rendering\n *\n * function animate() {\n * app.render();\n * requestAnimationFrame(animate);\n * }\n * animate();\n * ```\n */\n render() {\n this.renderer.render({ container: this.stage });\n }\n /**\n * Reference to the renderer's canvas element. This is the HTML element\n * that displays your application's graphics.\n * @readonly\n * @type {HTMLCanvasElement}\n * @example\n * ```js\n * // Create a new application\n * const app = new Application();\n * // Initialize the application\n * await app.init({...});\n * // Add canvas to the page\n * document.body.appendChild(app.canvas);\n *\n * // Access the canvas directly\n * console.log(app.canvas); // HTMLCanvasElement\n * ```\n */\n get canvas() {\n return this.renderer.canvas;\n }\n /**\n * Reference to the renderer's canvas element.\n * @type {HTMLCanvasElement}\n * @deprecated since 8.0.0\n * @see {@link Application#canvas}\n */\n get view() {\n deprecation(v8_0_0, \"Application.view is deprecated, please use Application.canvas instead.\");\n return this.renderer.canvas;\n }\n /**\n * Reference to the renderer's screen rectangle. This represents the visible area of your application.\n *\n * It's commonly used for:\n * - Setting filter areas for full-screen effects\n * - Defining hit areas for screen-wide interaction\n * - Determining the visible bounds of your application\n * @readonly\n * @example\n * ```js\n * // Use as filter area for a full-screen effect\n * const blurFilter = new BlurFilter();\n * sprite.filterArea = app.screen;\n *\n * // Use as hit area for screen-wide interaction\n * const screenSprite = new Sprite();\n * screenSprite.hitArea = app.screen;\n *\n * // Get screen dimensions\n * console.log(app.screen.width, app.screen.height);\n * ```\n * @see {@link Rectangle} For all available properties and methods\n */\n get screen() {\n return this.renderer.screen;\n }\n /**\n * Get the html div element that holds all DOM Container elements.\n * @readonly\n * @type {HTMLDivElement}\n */\n get domContainerRoot() {\n return this.renderer.renderPipes.dom?._domElement;\n }\n /**\n * Destroys the application and all of its resources.\n *\n * This method should be called when you want to completely\n * clean up the application and free all associated memory.\n * @param rendererDestroyOptions - Options for destroying the renderer:\n * - `false` or `undefined`: Preserves the canvas element (default)\n * - `true`: Removes the canvas element\n * - `{ removeView: boolean }`: Object with removeView property to control canvas removal\n * @param options - Options for destroying the application:\n * - `false` or `undefined`: Basic cleanup (default)\n * - `true`: Complete cleanup including children\n * - Detailed options object:\n * - `children`: Remove children\n * - `texture`: Destroy textures\n * - `textureSource`: Destroy texture sources\n * - `context`: Destroy WebGL context\n * @example\n * ```js\n * // Basic cleanup\n * app.destroy();\n *\n * // Remove canvas and do complete cleanup\n * app.destroy(true, true);\n *\n * // Remove canvas with explicit options\n * app.destroy({ removeView: true }, true);\n *\n * // Detailed cleanup with specific options\n * app.destroy(\n * { removeView: true },\n * {\n * children: true,\n * texture: true,\n * textureSource: true,\n * context: true\n * }\n * );\n * ```\n * > [!WARNING] After calling destroy, the application instance should no longer be used.\n * > All properties will be null and further operations will throw errors.\n */\n destroy(rendererDestroyOptions = false, options = false) {\n const plugins = _Application._plugins.slice(0);\n plugins.reverse();\n plugins.forEach((plugin) => {\n plugin.destroy.call(this);\n });\n this.stage.destroy(options);\n this.stage = null;\n this.renderer.destroy(rendererDestroyOptions);\n this.renderer = null;\n }\n};\n/**\n * Collection of installed plugins.\n * @internal\n */\n_Application._plugins = [];\nlet Application = _Application;\nextensions.handleByList(ExtensionType.Application, Application._plugins);\nextensions.add(ApplicationInitHook);\n\nexport { Application };\n//# sourceMappingURL=Application.mjs.map\n","//#region src/index.ts\n/** Number of numeric arguments each SVG path command expects (lowercase keys). */\nconst length = {\n\ta: 7,\n\tc: 6,\n\th: 1,\n\tl: 2,\n\tm: 2,\n\tq: 4,\n\ts: 4,\n\tt: 2,\n\tv: 1,\n\tz: 0\n};\n/** Matches a single path command letter followed by its raw argument string. */\nconst segment = /([astvzqmhlc])([^astvzqmhlc]*)/gi;\n/** Matches a single numeric token, including negatives, decimals, and scientific notation. */\nconst number = /-?[0-9]*\\.?[0-9]+(?:e[-+]?\\d+)?/gi;\n/**\n* Parse an SVG path `d` attribute string into an array of commands.\n*\n* Each command is a tuple of `[letter, ...args]`. Relative commands use\n* lowercase letters; absolute commands use uppercase. An implicit `lineto`\n* is inserted after the first coordinate pair of a `moveto` with extra args,\n* per the SVG spec.\n*\n* @param path - The raw SVG path data string (e.g. `\"M0,0 L10,10 Z\"`).\n* @returns Array of parsed commands.\n* @throws {Error} if a command has fewer arguments than expected.\n*/\nfunction parse(path) {\n\tconst data = [];\n\tpath.replace(segment, (_, cmd, args) => {\n\t\tlet type = cmd.toLowerCase();\n\t\tlet command = cmd;\n\t\tconst values = parseValues(args);\n\t\tif (type === \"m\" && values.length > 2) {\n\t\t\tdata.push([command, ...values.splice(0, 2)]);\n\t\t\ttype = \"l\";\n\t\t\tcommand = command === \"m\" ? \"l\" : \"L\";\n\t\t}\n\t\twhile (true) {\n\t\t\tif (values.length === length[type]) {\n\t\t\t\tdata.push([command, ...values]);\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\tif (values.length < length[type]) throw new Error(\"malformed path data\");\n\t\t\tdata.push([command, ...values.splice(0, length[type])]);\n\t\t}\n\t});\n\treturn data;\n}\n/** Extract all numeric tokens from a raw argument string. */\nfunction parseValues(args) {\n\tconst numbers = args.match(number);\n\treturn numbers ? numbers.map(Number) : [];\n}\n//#endregion\nexport { parse as default };\n","import parse from 'parse-svg-path';\nimport { warn } from '../../../../utils/logging/warn.mjs';\n\n\"use strict\";\nfunction parseSVGPath(svgPath, path) {\n const commands = parse(svgPath);\n const subpaths = [];\n let currentSubPath = null;\n let lastX = 0;\n let lastY = 0;\n for (let i = 0; i < commands.length; i++) {\n const command = commands[i];\n const type = command[0];\n const data = command;\n switch (type) {\n case \"M\":\n lastX = data[1];\n lastY = data[2];\n path.moveTo(lastX, lastY);\n break;\n case \"m\":\n lastX += data[1];\n lastY += data[2];\n path.moveTo(lastX, lastY);\n break;\n case \"H\":\n lastX = data[1];\n path.lineTo(lastX, lastY);\n break;\n case \"h\":\n lastX += data[1];\n path.lineTo(lastX, lastY);\n break;\n case \"V\":\n lastY = data[1];\n path.lineTo(lastX, lastY);\n break;\n case \"v\":\n lastY += data[1];\n path.lineTo(lastX, lastY);\n break;\n case \"L\":\n lastX = data[1];\n lastY = data[2];\n path.lineTo(lastX, lastY);\n break;\n case \"l\":\n lastX += data[1];\n lastY += data[2];\n path.lineTo(lastX, lastY);\n break;\n case \"C\":\n lastX = data[5];\n lastY = data[6];\n path.bezierCurveTo(\n data[1],\n data[2],\n // First control point\n data[3],\n data[4],\n // Second control point\n lastX,\n lastY\n // End point\n );\n break;\n case \"c\":\n path.bezierCurveTo(\n lastX + data[1],\n lastY + data[2],\n // First control point\n lastX + data[3],\n lastY + data[4],\n // Second control point\n lastX + data[5],\n lastY + data[6]\n // End point\n );\n lastX += data[5];\n lastY += data[6];\n break;\n case \"S\":\n lastX = data[3];\n lastY = data[4];\n path.bezierCurveToShort(\n data[1],\n data[2],\n // Control point\n lastX,\n lastY\n // End point\n );\n break;\n case \"s\":\n path.bezierCurveToShort(\n lastX + data[1],\n lastY + data[2],\n // Control point\n lastX + data[3],\n lastY + data[4]\n // End point\n );\n lastX += data[3];\n lastY += data[4];\n break;\n case \"Q\":\n lastX = data[3];\n lastY = data[4];\n path.quadraticCurveTo(\n data[1],\n data[2],\n // Control point\n lastX,\n lastY\n // End point\n );\n break;\n case \"q\":\n path.quadraticCurveTo(\n lastX + data[1],\n lastY + data[2],\n // Control point\n lastX + data[3],\n lastY + data[4]\n // End point\n );\n lastX += data[3];\n lastY += data[4];\n break;\n case \"T\":\n lastX = data[1];\n lastY = data[2];\n path.quadraticCurveToShort(\n lastX,\n lastY\n // End point\n );\n break;\n case \"t\":\n lastX += data[1];\n lastY += data[2];\n path.quadraticCurveToShort(\n lastX,\n lastY\n // End point\n );\n break;\n case \"A\":\n lastX = data[6];\n lastY = data[7];\n path.arcToSvg(\n data[1],\n // rx\n data[2],\n // ry\n data[3],\n // x-axis-rotation\n data[4],\n // large-arc-flag\n data[5],\n // sweep-flag\n lastX,\n lastY\n // End point\n );\n break;\n case \"a\":\n lastX += data[6];\n lastY += data[7];\n path.arcToSvg(\n data[1],\n // rx\n data[2],\n // ry\n data[3],\n // x-axis-rotation\n data[4],\n // large-arc-flag\n data[5],\n // sweep-flag\n lastX,\n lastY\n // End point\n );\n break;\n case \"Z\":\n // Close Path\n case \"z\":\n path.closePath();\n if (subpaths.length > 0) {\n currentSubPath = subpaths.pop();\n if (currentSubPath) {\n lastX = currentSubPath.startX;\n lastY = currentSubPath.startY;\n } else {\n lastX = 0;\n lastY = 0;\n }\n }\n currentSubPath = null;\n break;\n default:\n warn(`Unknown SVG path command: ${type}`);\n }\n if (type !== \"Z\" && type !== \"z\") {\n if (currentSubPath === null) {\n currentSubPath = { startX: lastX, startY: lastY };\n subpaths.push(currentSubPath);\n }\n }\n }\n return path;\n}\n\nexport { parseSVGPath };\n//# sourceMappingURL=parseSVGPath.mjs.map\n","import { Rectangle } from './Rectangle.mjs';\n\n\"use strict\";\nclass Circle {\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 * The type of the object, mainly used to avoid `instanceof` checks.\n * @example\n * ```ts\n * // Check shape type\n * const shape = new Circle(0, 0, 50);\n * console.log(shape.type); // 'circle'\n *\n * // Use in type guards\n * if (shape.type === 'circle') {\n * console.log(shape.radius);\n * }\n * ```\n * @remarks\n * - Used for shape type checking\n * - More efficient than instanceof\n * - Read-only property\n * @readonly\n * @default 'circle'\n * @see {@link SHAPE_PRIMITIVE} For all shape types\n * @see {@link ShapePrimitive} For shape interface\n */\n this.type = \"circle\";\n this.x = x;\n this.y = y;\n this.radius = radius;\n }\n /**\n * Creates a clone of this Circle instance.\n * @example\n * ```ts\n * // Basic circle cloning\n * const original = new Circle(100, 100, 50);\n * const copy = original.clone();\n *\n * // Clone and modify\n * const modified = original.clone();\n * modified.radius = 75;\n *\n * // Verify independence\n * console.log(original.radius); // 50\n * console.log(modified.radius); // 75\n * ```\n * @returns A copy of the Circle\n * @see {@link Circle.copyFrom} For copying into existing circle\n * @see {@link Circle.copyTo} For copying to another circle\n */\n clone() {\n return new Circle(this.x, this.y, this.radius);\n }\n /**\n * Checks whether the x and y coordinates given are contained within this circle.\n *\n * Uses the distance formula to determine if a point is inside the circle's radius.\n *\n * Commonly used for hit testing in PixiJS events and graphics.\n * @example\n * ```ts\n * // Basic containment check\n * const circle = new Circle(100, 100, 50);\n * const isInside = circle.contains(120, 120);\n *\n * // Check mouse position\n * const circle = new Circle(0, 0, 100);\n * container.hitArea = circle;\n * container.on('pointermove', (e) => {\n * // only called if pointer is within circle\n * });\n * ```\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 * @see {@link Circle.strokeContains} For checking stroke intersection\n * @see {@link Circle.getBounds} For getting bounding box\n */\n contains(x, y) {\n if (this.radius <= 0) return false;\n const r2 = this.radius * this.radius;\n let dx = this.x - x;\n let dy = this.y - y;\n dx *= dx;\n dy *= dy;\n return dx + dy <= r2;\n }\n /**\n * Checks whether the x and y coordinates given are contained within this circle including the stroke.\n * @example\n * ```ts\n * // Basic stroke check\n * const circle = new Circle(100, 100, 50);\n * const isOnStroke = circle.strokeContains(150, 100, 4); // 4px line width\n *\n * // Check with different alignments\n * const innerStroke = circle.strokeContains(150, 100, 4, 1); // Inside\n * const centerStroke = circle.strokeContains(150, 100, 4, 0.5); // Centered\n * const outerStroke = circle.strokeContains(150, 100, 4, 0); // Outside\n * ```\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @param width - The width of the line to check\n * @param alignment - The alignment of the stroke, 0.5 by default\n * @returns Whether the x/y coordinates are within this Circle's stroke\n * @see {@link Circle.contains} For checking fill containment\n * @see {@link Circle.getBounds} For getting stroke bounds\n */\n strokeContains(x, y, width, alignment = 0.5) {\n if (this.radius === 0) return false;\n const dx = this.x - x;\n const dy = this.y - y;\n const radius = this.radius;\n const outerWidth = (1 - alignment) * width;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return distance <= radius + outerWidth && distance > radius - (width - outerWidth);\n }\n /**\n * Returns the framing rectangle of the circle as a Rectangle object.\n * @example\n * ```ts\n * // Basic bounds calculation\n * const circle = new Circle(100, 100, 50);\n * const bounds = circle.getBounds();\n * // bounds: x=50, y=50, width=100, height=100\n *\n * // Reuse existing rectangle\n * const rect = new Rectangle();\n * circle.getBounds(rect);\n * ```\n * @param out - Optional Rectangle object to store the result\n * @returns The framing rectangle\n * @see {@link Rectangle} For rectangle properties\n * @see {@link Circle.contains} For point containment\n */\n getBounds(out) {\n out || (out = new Rectangle());\n out.x = this.x - this.radius;\n out.y = this.y - this.radius;\n out.width = this.radius * 2;\n out.height = this.radius * 2;\n return out;\n }\n /**\n * Copies another circle to this one.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Circle(100, 100, 50);\n * const target = new Circle();\n * target.copyFrom(source);\n * ```\n * @param circle - The circle to copy from\n * @returns Returns itself\n * @see {@link Circle.copyTo} For copying to another circle\n * @see {@link Circle.clone} For creating new circle copy\n */\n copyFrom(circle) {\n this.x = circle.x;\n this.y = circle.y;\n this.radius = circle.radius;\n return this;\n }\n /**\n * Copies this circle to another one.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Circle(100, 100, 50);\n * const target = new Circle();\n * source.copyTo(target);\n * ```\n * @param circle - The circle to copy to\n * @returns Returns given parameter\n * @see {@link Circle.copyFrom} For copying from another circle\n * @see {@link Circle.clone} For creating new circle copy\n */\n copyTo(circle) {\n circle.copyFrom(this);\n return circle;\n }\n toString() {\n return `[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`;\n }\n}\n\nexport { Circle };\n//# sourceMappingURL=Circle.mjs.map\n","import { Rectangle } from './Rectangle.mjs';\n\n\"use strict\";\nclass Ellipse {\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 * The type of the object, mainly used to avoid `instanceof` checks\n * @example\n * ```ts\n * // Check shape type\n * const shape = new Ellipse(0, 0, 50, 25);\n * console.log(shape.type); // 'ellipse'\n *\n * // Use in type guards\n * if (shape.type === 'ellipse') {\n * console.log(shape.halfWidth, shape.halfHeight);\n * }\n * ```\n * @readonly\n * @default 'ellipse'\n * @see {@link SHAPE_PRIMITIVE} For all shape types\n */\n this.type = \"ellipse\";\n this.x = x;\n this.y = y;\n this.halfWidth = halfWidth;\n this.halfHeight = halfHeight;\n }\n /**\n * Creates a clone of this Ellipse instance.\n * @example\n * ```ts\n * // Basic cloning\n * const original = new Ellipse(100, 100, 50, 25);\n * const copy = original.clone();\n *\n * // Clone and modify\n * const modified = original.clone();\n * modified.halfWidth *= 2;\n * modified.halfHeight *= 2;\n *\n * // Verify independence\n * console.log(original.halfWidth); // 50\n * console.log(modified.halfWidth); // 100\n * ```\n * @returns A copy of the ellipse\n * @see {@link Ellipse.copyFrom} For copying into existing ellipse\n * @see {@link Ellipse.copyTo} For copying to another ellipse\n */\n clone() {\n return new Ellipse(this.x, this.y, this.halfWidth, this.halfHeight);\n }\n /**\n * Checks whether the x and y coordinates given are contained within this ellipse.\n * Uses normalized coordinates and the ellipse equation to determine containment.\n * @example\n * ```ts\n * // Basic containment check\n * const ellipse = new Ellipse(100, 100, 50, 25);\n * const isInside = ellipse.contains(120, 110);\n * ```\n * @remarks\n * - Uses ellipse equation (x²/a² + y²/b² ≤ 1)\n * - Returns false if dimensions are 0 or negative\n * - Normalized to center (0,0) for calculation\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 * @see {@link Ellipse.strokeContains} For checking stroke intersection\n * @see {@link Ellipse.getBounds} For getting containing rectangle\n */\n contains(x, y) {\n if (this.halfWidth <= 0 || this.halfHeight <= 0) {\n return false;\n }\n let normx = (x - this.x) / this.halfWidth;\n let normy = (y - this.y) / this.halfHeight;\n normx *= normx;\n normy *= normy;\n return normx + normy <= 1;\n }\n /**\n * Checks whether the x and y coordinates given are contained within this ellipse including stroke.\n * @example\n * ```ts\n * // Basic stroke check\n * const ellipse = new Ellipse(100, 100, 50, 25);\n * const isOnStroke = ellipse.strokeContains(150, 100, 4); // 4px line width\n *\n * // Check with different alignments\n * const innerStroke = ellipse.strokeContains(150, 100, 4, 1); // Inside\n * const centerStroke = ellipse.strokeContains(150, 100, 4, 0.5); // Centered\n * const outerStroke = ellipse.strokeContains(150, 100, 4, 0); // Outside\n * ```\n * @remarks\n * - Uses normalized ellipse equations\n * - Considers stroke alignment\n * - Returns false if dimensions are 0\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @param strokeWidth - The width of the line to check\n * @param alignment - The alignment of the stroke (1 = inner, 0.5 = centered, 0 = outer)\n * @returns Whether the x/y coords are within this ellipse's stroke\n * @see {@link Ellipse.contains} For checking fill containment\n * @see {@link Ellipse.getBounds} For getting stroke bounds\n */\n strokeContains(x, y, strokeWidth, alignment = 0.5) {\n const { halfWidth, halfHeight } = this;\n if (halfWidth <= 0 || halfHeight <= 0) {\n return false;\n }\n const strokeOuterWidth = strokeWidth * (1 - alignment);\n const strokeInnerWidth = strokeWidth - strokeOuterWidth;\n const innerHorizontal = halfWidth - strokeInnerWidth;\n const innerVertical = halfHeight - strokeInnerWidth;\n const outerHorizontal = halfWidth + strokeOuterWidth;\n const outerVertical = halfHeight + strokeOuterWidth;\n const normalizedX = x - this.x;\n const normalizedY = y - this.y;\n const innerEllipse = normalizedX * normalizedX / (innerHorizontal * innerHorizontal) + normalizedY * normalizedY / (innerVertical * innerVertical);\n const outerEllipse = normalizedX * normalizedX / (outerHorizontal * outerHorizontal) + normalizedY * normalizedY / (outerVertical * outerVertical);\n return innerEllipse > 1 && outerEllipse <= 1;\n }\n /**\n * Returns the framing rectangle of the ellipse as a Rectangle object.\n * @example\n * ```ts\n * // Basic bounds calculation\n * const ellipse = new Ellipse(100, 100, 50, 25);\n * const bounds = ellipse.getBounds();\n * // bounds: x=50, y=75, width=100, height=50\n *\n * // Reuse existing rectangle\n * const rect = new Rectangle();\n * ellipse.getBounds(rect);\n * ```\n * @remarks\n * - Creates Rectangle if none provided\n * - Top-left is (x-halfWidth, y-halfHeight)\n * - Width is halfWidth * 2\n * - Height is halfHeight * 2\n * @param out - Optional Rectangle object to store the result\n * @returns The framing rectangle\n * @see {@link Rectangle} For rectangle properties\n * @see {@link Ellipse.contains} For checking if a point is inside\n */\n getBounds(out) {\n out || (out = new Rectangle());\n out.x = this.x - this.halfWidth;\n out.y = this.y - this.halfHeight;\n out.width = this.halfWidth * 2;\n out.height = this.halfHeight * 2;\n return out;\n }\n /**\n * Copies another ellipse to this one.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Ellipse(100, 100, 50, 25);\n * const target = new Ellipse();\n * target.copyFrom(source);\n * ```\n * @param ellipse - The ellipse to copy from\n * @returns Returns itself\n * @see {@link Ellipse.copyTo} For copying to another ellipse\n * @see {@link Ellipse.clone} For creating new ellipse copy\n */\n copyFrom(ellipse) {\n this.x = ellipse.x;\n this.y = ellipse.y;\n this.halfWidth = ellipse.halfWidth;\n this.halfHeight = ellipse.halfHeight;\n return this;\n }\n /**\n * Copies this ellipse to another one.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Ellipse(100, 100, 50, 25);\n * const target = new Ellipse();\n * source.copyTo(target);\n * ```\n * @param ellipse - The ellipse to copy to\n * @returns Returns given parameter\n * @see {@link Ellipse.copyFrom} For copying from another ellipse\n * @see {@link Ellipse.clone} For creating new ellipse copy\n */\n copyTo(ellipse) {\n ellipse.copyFrom(this);\n return ellipse;\n }\n toString() {\n return `[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`;\n }\n}\n\nexport { Ellipse };\n//# sourceMappingURL=Ellipse.mjs.map\n","\"use strict\";\nfunction squaredDistanceToLineSegment(x, y, x1, y1, x2, y2) {\n const a = x - x1;\n const b = y - y1;\n const c = x2 - x1;\n const d = y2 - y1;\n const dot = a * c + b * d;\n const lenSq = c * c + d * d;\n let param = -1;\n if (lenSq !== 0) {\n param = dot / lenSq;\n }\n let xx;\n let yy;\n if (param < 0) {\n xx = x1;\n yy = y1;\n } else if (param > 1) {\n xx = x2;\n yy = y2;\n } else {\n xx = x1 + param * c;\n yy = y1 + param * d;\n }\n const dx = x - xx;\n const dy = y - yy;\n return dx * dx + dy * dy;\n}\n\nexport { squaredDistanceToLineSegment };\n//# sourceMappingURL=squaredDistanceToLineSegment.mjs.map\n","import { deprecation } from '../../utils/logging/deprecation.mjs';\nimport { squaredDistanceToLineSegment } from '../misc/squaredDistanceToLineSegment.mjs';\nimport { Rectangle } from './Rectangle.mjs';\n\n\"use strict\";\nlet tempRect;\nlet tempRect2;\nclass Polygon {\n /**\n * @param 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 Polygon(new Point(), new 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) {\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @example\n * ```ts\n * // Check shape type\n * const shape = new Polygon([0, 0, 100, 0, 50, 100]);\n * console.log(shape.type); // 'polygon'\n *\n * // Use in type guards\n * if (shape.type === 'polygon') {\n * // TypeScript knows this is a Polygon\n * console.log(shape.points.length);\n * }\n * ```\n * @readonly\n * @default 'polygon'\n * @see {@link SHAPE_PRIMITIVE} For all shape types\n */\n this.type = \"polygon\";\n let flat = Array.isArray(points[0]) ? points[0] : points;\n if (typeof flat[0] !== \"number\") {\n const p = [];\n for (let i = 0, il = flat.length; i < il; i++) {\n p.push(flat[i].x, flat[i].y);\n }\n flat = p;\n }\n this.points = flat;\n this.closePath = true;\n }\n /**\n * Determines whether the polygon's points are arranged in a clockwise direction.\n * Uses the shoelace formula (surveyor's formula) to calculate the signed area.\n *\n * A positive area indicates clockwise winding, while negative indicates counter-clockwise.\n *\n * The formula sums up the cross products of adjacent vertices:\n * For each pair of adjacent points (x1,y1) and (x2,y2), we calculate (x1*y2 - x2*y1)\n * The final sum divided by 2 gives the signed area - positive for clockwise.\n * @example\n * ```ts\n * // Check polygon winding\n * const polygon = new Polygon([0, 0, 100, 0, 50, 100]);\n * console.log(polygon.isClockwise()); // Check direction\n *\n * // Use in path construction\n * const hole = new Polygon([25, 25, 75, 25, 75, 75, 25, 75]);\n * if (hole.isClockwise() === shape.isClockwise()) {\n * hole.points.reverse(); // Reverse for proper hole winding\n * }\n * ```\n * @returns `true` if the polygon's points are arranged clockwise, `false` if counter-clockwise\n */\n isClockwise() {\n let area = 0;\n const points = this.points;\n const length = points.length;\n for (let i = 0; i < length; i += 2) {\n const x1 = points[i];\n const y1 = points[i + 1];\n const x2 = points[(i + 2) % length];\n const y2 = points[(i + 3) % length];\n area += (x2 - x1) * (y2 + y1);\n }\n return area < 0;\n }\n /**\n * Checks if this polygon completely contains another polygon.\n * Used for detecting holes in shapes, like when parsing SVG paths.\n * @example\n * ```ts\n * // Basic containment check\n * const outerSquare = new Polygon([0,0, 100,0, 100,100, 0,100]); // A square\n * const innerSquare = new Polygon([25,25, 75,25, 75,75, 25,75]); // A smaller square inside\n *\n * outerSquare.containsPolygon(innerSquare); // Returns true\n * innerSquare.containsPolygon(outerSquare); // Returns false\n * ```\n * @remarks\n * - Uses bounds check for quick rejection\n * - Tests all points for containment\n * @param polygon - The polygon to test for containment\n * @returns True if this polygon completely contains the other polygon\n * @see {@link Polygon.contains} For single point testing\n * @see {@link Polygon.getBounds} For bounds calculation\n */\n containsPolygon(polygon) {\n const thisBounds = this.getBounds(tempRect);\n const otherBounds = polygon.getBounds(tempRect2);\n if (!thisBounds.containsRect(otherBounds)) {\n return false;\n }\n const points = polygon.points;\n for (let i = 0; i < points.length; i += 2) {\n const x = points[i];\n const y = points[i + 1];\n if (!this.contains(x, y)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Creates a clone of this polygon.\n * @example\n * ```ts\n * // Basic cloning\n * const original = new Polygon([0, 0, 100, 0, 50, 100]);\n * const copy = original.clone();\n *\n * // Clone and modify\n * const modified = original.clone();\n * modified.points[0] = 10; // Modify first x coordinate\n * ```\n * @returns A copy of the polygon\n * @see {@link Polygon.copyFrom} For copying into existing polygon\n * @see {@link Polygon.copyTo} For copying to another polygon\n */\n clone() {\n const points = this.points.slice();\n const polygon = new Polygon(points);\n polygon.closePath = this.closePath;\n return polygon;\n }\n /**\n * Checks whether the x and y coordinates passed to this function are contained within this polygon.\n * Uses raycasting algorithm for point-in-polygon testing.\n * @example\n * ```ts\n * // Basic containment check\n * const polygon = new Polygon([0, 0, 100, 0, 50, 100]);\n * const isInside = polygon.contains(25, 25); // true\n * ```\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 * @see {@link Polygon.strokeContains} For checking stroke intersection\n * @see {@link Polygon.containsPolygon} For polygon-in-polygon testing\n */\n contains(x, y) {\n let inside = false;\n const length = this.points.length / 2;\n for (let i = 0, j = length - 1; i < length; j = i++) {\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 if (intersect) {\n inside = !inside;\n }\n }\n return inside;\n }\n /**\n * Checks whether the x and y coordinates given are contained within this polygon including the stroke.\n * @example\n * ```ts\n * // Basic stroke check\n * const polygon = new Polygon([0, 0, 100, 0, 50, 100]);\n * const isOnStroke = polygon.strokeContains(25, 25, 4); // 4px line width\n *\n * // Check with different alignments\n * const innerStroke = polygon.strokeContains(25, 25, 4, 1); // Inside\n * const centerStroke = polygon.strokeContains(25, 25, 4, 0.5); // Centered\n * const outerStroke = polygon.strokeContains(25, 25, 4, 0); // Outside\n * ```\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @param strokeWidth - The width of the line to check\n * @param alignment - The alignment of the stroke (1 = inner, 0.5 = centered, 0 = outer)\n * @returns Whether the x/y coordinates are within this polygon's stroke\n * @see {@link Polygon.contains} For checking fill containment\n * @see {@link Polygon.getBounds} For getting stroke bounds\n */\n strokeContains(x, y, strokeWidth, alignment = 0.5) {\n const strokeWidthSquared = strokeWidth * strokeWidth;\n const rightWidthSquared = strokeWidthSquared * (1 - alignment);\n const leftWidthSquared = strokeWidthSquared - rightWidthSquared;\n const { points } = this;\n const iterationLength = points.length - (this.closePath ? 0 : 2);\n for (let i = 0; i < iterationLength; i += 2) {\n const x1 = points[i];\n const y1 = points[i + 1];\n const x2 = points[(i + 2) % points.length];\n const y2 = points[(i + 3) % points.length];\n const distanceSquared = squaredDistanceToLineSegment(x, y, x1, y1, x2, y2);\n const sign = Math.sign((x2 - x1) * (y - y1) - (y2 - y1) * (x - x1));\n if (distanceSquared <= (sign < 0 ? leftWidthSquared : rightWidthSquared)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Returns the framing rectangle of the polygon as a Rectangle object.\n * @example\n * ```ts\n * // Basic bounds calculation\n * const polygon = new Polygon([0, 0, 100, 0, 50, 100]);\n * const bounds = polygon.getBounds();\n * // bounds: x=0, y=0, width=100, height=100\n *\n * // Reuse existing rectangle\n * const rect = new Rectangle();\n * polygon.getBounds(rect);\n * ```\n * @param out - Optional rectangle to store the result\n * @returns The framing rectangle\n * @see {@link Rectangle} For rectangle properties\n * @see {@link Polygon.contains} For checking if a point is inside\n */\n getBounds(out) {\n out || (out = new Rectangle());\n const points = this.points;\n let minX = Infinity;\n let maxX = -Infinity;\n let minY = Infinity;\n let maxY = -Infinity;\n for (let i = 0, n = points.length; i < n; i += 2) {\n const x = points[i];\n const y = points[i + 1];\n minX = x < minX ? x : minX;\n maxX = x > maxX ? x : maxX;\n minY = y < minY ? y : minY;\n maxY = y > maxY ? y : maxY;\n }\n out.x = minX;\n out.width = maxX - minX;\n out.y = minY;\n out.height = maxY - minY;\n return out;\n }\n /**\n * Copies another polygon to this one.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Polygon([0, 0, 100, 0, 50, 100]);\n * const target = new Polygon();\n * target.copyFrom(source);\n * ```\n * @param polygon - The polygon to copy from\n * @returns Returns itself\n * @see {@link Polygon.copyTo} For copying to another polygon\n * @see {@link Polygon.clone} For creating new polygon copy\n */\n copyFrom(polygon) {\n this.points = polygon.points.slice();\n this.closePath = polygon.closePath;\n return this;\n }\n /**\n * Copies this polygon to another one.\n * @example\n * ```ts\n * // Basic copying\n * const source = new Polygon([0, 0, 100, 0, 50, 100]);\n * const target = new Polygon();\n * source.copyTo(target);\n * ```\n * @param polygon - The polygon to copy to\n * @returns Returns given parameter\n * @see {@link Polygon.copyFrom} For copying from another polygon\n * @see {@link Polygon.clone} For creating new polygon copy\n */\n copyTo(polygon) {\n polygon.copyFrom(this);\n return polygon;\n }\n toString() {\n return `[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((pointsDesc, currentPoint) => `${pointsDesc}, ${currentPoint}`, \"\")}]`;\n }\n /**\n * Get the last X coordinate of the polygon.\n * @example\n * ```ts\n * // Basic coordinate access\n * const polygon = new Polygon([0, 0, 100, 200, 300, 400]);\n * console.log(polygon.lastX); // 300\n * ```\n * @readonly\n * @returns The x-coordinate of the last vertex\n * @see {@link Polygon.lastY} For last Y coordinate\n * @see {@link Polygon.points} For raw points array\n */\n get lastX() {\n return this.points[this.points.length - 2];\n }\n /**\n * Get the last Y coordinate of the polygon.\n * @example\n * ```ts\n * // Basic coordinate access\n * const polygon = new Polygon([0, 0, 100, 200, 300, 400]);\n * console.log(polygon.lastY); // 400\n * ```\n * @readonly\n * @returns The y-coordinate of the last vertex\n * @see {@link Polygon.lastX} For last X coordinate\n * @see {@link Polygon.points} For raw points array\n */\n get lastY() {\n return this.points[this.points.length - 1];\n }\n /**\n * Get the last X coordinate of the polygon.\n * @readonly\n * @deprecated since 8.11.0, use {@link Polygon.lastX} instead.\n */\n get x() {\n deprecation(\"8.11.0\", \"Polygon.lastX is deprecated, please use Polygon.lastX instead.\");\n return this.points[this.points.length - 2];\n }\n /**\n * Get the last Y coordinate of the polygon.\n * @readonly\n * @deprecated since 8.11.0, use {@link Polygon.lastY} instead.\n */\n get y() {\n deprecation(\"8.11.0\", \"Polygon.y is deprecated, please use Polygon.lastY instead.\");\n return this.points[this.points.length - 1];\n }\n /**\n * Get the first X coordinate of the polygon.\n * @example\n * ```ts\n * // Basic coordinate access\n * const polygon = new Polygon([0, 0, 100, 200, 300, 400]);\n * console.log(polygon.x); // 0\n * ```\n * @readonly\n * @returns The x-coordinate of the first vertex\n * @see {@link Polygon.startY} For first Y coordinate\n * @see {@link Polygon.points} For raw points array\n */\n get startX() {\n return this.points[0];\n }\n /**\n * Get the first Y coordinate of the polygon.\n * @example\n * ```ts\n * // Basic coordinate access\n * const polygon = new Polygon([0, 0, 100, 200, 300, 400]);\n * console.log(polygon.y); // 0\n * ```\n * @readonly\n * @returns The y-coordinate of the first vertex\n * @see {@link Polygon.startX} For first X coordinate\n * @see {@link Polygon.points} For raw points array\n */\n get startY() {\n return this.points[1];\n }\n}\n\nexport { Polygon };\n//# sourceMappingURL=Polygon.mjs.map\n","import { Rectangle } from './Rectangle.mjs';\n\n\"use strict\";\nconst isCornerWithinStroke = (pX, pY, cornerX, cornerY, radius, strokeWidthInner, strokeWidthOuter) => {\n const dx = pX - cornerX;\n const dy = pY - cornerY;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return distance >= radius - strokeWidthInner && distance <= radius + strokeWidthOuter;\n};\nclass RoundedRectangle {\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 * The type of the object, mainly used to avoid `instanceof` checks\n * @example\n * ```ts\n * // Check shape type\n * const shape = new RoundedRectangle(0, 0, 100, 100, 20);\n * console.log(shape.type); // 'roundedRectangle'\n *\n * // Use in type guards\n * if (shape.type === 'roundedRectangle') {\n * console.log(shape.radius);\n * }\n * ```\n * @readonly\n * @default 'roundedRectangle'\n * @see {@link SHAPE_PRIMITIVE} For all shape types\n */\n this.type = \"roundedRectangle\";\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.radius = radius;\n }\n /**\n * Returns the framing rectangle of the rounded rectangle as a Rectangle object\n * @example\n * ```ts\n * // Basic bounds calculation\n * const rect = new RoundedRectangle(100, 100, 200, 150, 20);\n * const bounds = rect.getBounds();\n * // bounds: x=100, y=100, width=200, height=150\n *\n * // Reuse existing rectangle\n * const out = new Rectangle();\n * rect.getBounds(out);\n * ```\n * @remarks\n * - Rectangle matches outer dimensions\n * - Ignores corner radius\n * @param out - Optional rectangle to store the result\n * @returns The framing rectangle\n * @see {@link Rectangle} For rectangle properties\n * @see {@link RoundedRectangle.contains} For checking if a point is inside\n */\n getBounds(out) {\n out || (out = new Rectangle());\n out.x = this.x;\n out.y = this.y;\n out.width = this.width;\n out.height = this.height;\n return out;\n }\n /**\n * Creates a clone of this Rounded Rectangle.\n * @example\n * ```ts\n * // Basic cloning\n * const original = new RoundedRectangle(100, 100, 200, 150, 20);\n * const copy = original.clone();\n *\n * // Clone and modify\n * const modified = original.clone();\n * modified.radius = 30;\n * modified.width *= 2;\n *\n * // Verify independence\n * console.log(original.radius); // 20\n * console.log(modified.radius); // 30\n * ```\n * @returns A copy of the rounded rectangle\n * @see {@link RoundedRectangle.copyFrom} For copying into existing rectangle\n * @see {@link RoundedRectangle.copyTo} For copying to another rectangle\n */\n clone() {\n return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);\n }\n /**\n * Copies another rectangle to this one.\n * @example\n * ```ts\n * // Basic copying\n * const source = new RoundedRectangle(100, 100, 200, 150, 20);\n * const target = new RoundedRectangle();\n * target.copyFrom(source);\n *\n * // Chain with other operations\n * const rect = new RoundedRectangle()\n * .copyFrom(source)\n * .getBounds(rect);\n * ```\n * @param rectangle - The rectangle to copy from\n * @returns Returns itself\n * @see {@link RoundedRectangle.copyTo} For copying to another rectangle\n * @see {@link RoundedRectangle.clone} For creating new rectangle copy\n */\n copyFrom(rectangle) {\n this.x = rectangle.x;\n this.y = rectangle.y;\n this.width = rectangle.width;\n this.height = rectangle.height;\n return this;\n }\n /**\n * Copies this rectangle to another one.\n * @example\n * ```ts\n * // Basic copying\n * const source = new RoundedRectangle(100, 100, 200, 150, 20);\n * const target = new RoundedRectangle();\n * source.copyTo(target);\n *\n * // Chain with other operations\n * const result = source\n * .copyTo(new RoundedRectangle())\n * .getBounds();\n * ```\n * @param rectangle - The rectangle to copy to\n * @returns Returns given parameter\n * @see {@link RoundedRectangle.copyFrom} For copying from another rectangle\n * @see {@link RoundedRectangle.clone} For creating new rectangle copy\n */\n copyTo(rectangle) {\n rectangle.copyFrom(this);\n return rectangle;\n }\n /**\n * Checks whether the x and y coordinates given are contained within this Rounded Rectangle\n * @example\n * ```ts\n * // Basic containment check\n * const rect = new RoundedRectangle(100, 100, 200, 150, 20);\n * const isInside = rect.contains(150, 125); // true\n * // Check corner radius\n * const corner = rect.contains(100, 100); // false if within corner curve\n * ```\n * @remarks\n * - Returns false if width/height is 0 or negative\n * - Handles rounded corners with radius check\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 * @see {@link RoundedRectangle.strokeContains} For checking stroke intersection\n * @see {@link RoundedRectangle.getBounds} For getting containing rectangle\n */\n contains(x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n if (x >= this.x && x <= this.x + this.width) {\n if (y >= this.y && y <= this.y + this.height) {\n const radius = Math.max(0, Math.min(this.radius, Math.min(this.width, this.height) / 2));\n if (y >= this.y + radius && y <= this.y + this.height - radius || x >= this.x + radius && x <= this.x + this.width - radius) {\n return true;\n }\n let dx = x - (this.x + radius);\n let dy = y - (this.y + radius);\n const radius2 = radius * radius;\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n dx = x - (this.x + this.width - radius);\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n dy = y - (this.y + this.height - radius);\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n dx = x - (this.x + radius);\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Checks whether the x and y coordinates given are contained within this rectangle including the stroke.\n * @example\n * ```ts\n * // Basic stroke check\n * const rect = new RoundedRectangle(100, 100, 200, 150, 20);\n * const isOnStroke = rect.strokeContains(150, 100, 4); // 4px line width\n *\n * // Check with different alignments\n * const innerStroke = rect.strokeContains(150, 100, 4, 1); // Inside\n * const centerStroke = rect.strokeContains(150, 100, 4, 0.5); // Centered\n * const outerStroke = rect.strokeContains(150, 100, 4, 0); // Outside\n * ```\n * @param pX - The X coordinate of the point to test\n * @param pY - The Y coordinate of the point to test\n * @param strokeWidth - The width of the line to check\n * @param alignment - The alignment of the stroke (1 = inner, 0.5 = centered, 0 = outer)\n * @returns Whether the x/y coordinates are within this rectangle's stroke\n * @see {@link RoundedRectangle.contains} For checking fill containment\n * @see {@link RoundedRectangle.getBounds} For getting stroke bounds\n */\n strokeContains(pX, pY, strokeWidth, alignment = 0.5) {\n const { x, y, width, height, radius } = this;\n const strokeWidthOuter = strokeWidth * (1 - alignment);\n const strokeWidthInner = strokeWidth - strokeWidthOuter;\n const innerX = x + radius;\n const innerY = y + radius;\n const innerWidth = width - radius * 2;\n const innerHeight = height - radius * 2;\n const rightBound = x + width;\n const bottomBound = y + height;\n if ((pX >= x - strokeWidthOuter && pX <= x + strokeWidthInner || pX >= rightBound - strokeWidthInner && pX <= rightBound + strokeWidthOuter) && pY >= innerY && pY <= innerY + innerHeight) {\n return true;\n }\n if ((pY >= y - strokeWidthOuter && pY <= y + strokeWidthInner || pY >= bottomBound - strokeWidthInner && pY <= bottomBound + strokeWidthOuter) && pX >= innerX && pX <= innerX + innerWidth) {\n return true;\n }\n return (\n // Top-left\n pX < innerX && pY < innerY && isCornerWithinStroke(\n pX,\n pY,\n innerX,\n innerY,\n radius,\n strokeWidthInner,\n strokeWidthOuter\n ) || pX > rightBound - radius && pY < innerY && isCornerWithinStroke(\n pX,\n pY,\n rightBound - radius,\n innerY,\n radius,\n strokeWidthInner,\n strokeWidthOuter\n ) || pX > rightBound - radius && pY > bottomBound - radius && isCornerWithinStroke(\n pX,\n pY,\n rightBound - radius,\n bottomBound - radius,\n radius,\n strokeWidthInner,\n strokeWidthOuter\n ) || pX < innerX && pY > bottomBound - radius && isCornerWithinStroke(\n pX,\n pY,\n innerX,\n bottomBound - radius,\n radius,\n strokeWidthInner,\n strokeWidthOuter\n )\n );\n }\n toString() {\n return `[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`;\n }\n}\n\nexport { RoundedRectangle };\n//# sourceMappingURL=RoundedRectangle.mjs.map\n","import { BindGroup } from '../../renderers/gpu/shader/BindGroup.mjs';\nimport { Texture } from '../../renderers/shared/texture/Texture.mjs';\n\n\"use strict\";\nconst cachedGroups = {};\nfunction getTextureBatchBindGroup(textures, size, maxTextures) {\n let uid = 2166136261;\n for (let i = 0; i < size; i++) {\n uid ^= textures[i].uid;\n uid = Math.imul(uid, 16777619);\n uid >>>= 0;\n }\n return cachedGroups[uid] || generateTextureBatchBindGroup(textures, size, uid, maxTextures);\n}\nfunction generateTextureBatchBindGroup(textures, size, key, maxTextures) {\n const bindGroupResources = {};\n let bindIndex = 0;\n for (let i = 0; i < maxTextures; i++) {\n const texture = i < size ? textures[i] : Texture.EMPTY.source;\n bindGroupResources[bindIndex++] = texture.source;\n bindGroupResources[bindIndex++] = texture.style;\n }\n const bindGroup = new BindGroup(bindGroupResources);\n cachedGroups[key] = bindGroup;\n return bindGroup;\n}\n\nexport { getTextureBatchBindGroup };\n//# sourceMappingURL=getTextureBatchBindGroup.mjs.map\n","\"use strict\";\nclass ViewableBuffer {\n constructor(sizeOrBuffer) {\n if (typeof sizeOrBuffer === \"number\") {\n this.rawBinaryData = new ArrayBuffer(sizeOrBuffer);\n } else if (sizeOrBuffer instanceof Uint8Array) {\n this.rawBinaryData = sizeOrBuffer.buffer;\n } else {\n this.rawBinaryData = sizeOrBuffer;\n }\n this.uint32View = new Uint32Array(this.rawBinaryData);\n this.float32View = new Float32Array(this.rawBinaryData);\n this.size = this.rawBinaryData.byteLength;\n }\n /** View on the raw binary data as a `Int8Array`. */\n get int8View() {\n if (!this._int8View) {\n this._int8View = new Int8Array(this.rawBinaryData);\n }\n return this._int8View;\n }\n /** View on the raw binary data as a `Uint8Array`. */\n get uint8View() {\n if (!this._uint8View) {\n this._uint8View = new Uint8Array(this.rawBinaryData);\n }\n return this._uint8View;\n }\n /** View on the raw binary data as a `Int16Array`. */\n get int16View() {\n if (!this._int16View) {\n this._int16View = new Int16Array(this.rawBinaryData);\n }\n return this._int16View;\n }\n /** View on the raw binary data as a `Int32Array`. */\n get int32View() {\n if (!this._int32View) {\n this._int32View = new Int32Array(this.rawBinaryData);\n }\n return this._int32View;\n }\n /** View on the raw binary data as a `Float64Array`. */\n get float64View() {\n if (!this._float64Array) {\n this._float64Array = new Float64Array(this.rawBinaryData);\n }\n return this._float64Array;\n }\n /** View on the raw binary data as a `BigUint64Array`. */\n get bigUint64View() {\n if (!this._bigUint64Array) {\n this._bigUint64Array = new BigUint64Array(this.rawBinaryData);\n }\n return this._bigUint64Array;\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) {\n return this[`${type}View`];\n }\n /** Destroys all buffer references. Do not use after calling this. */\n destroy() {\n this.rawBinaryData = null;\n this.uint32View = null;\n this.float32View = null;\n this.uint16View = null;\n this._int8View = null;\n this._uint8View = null;\n this._int16View = null;\n this._int32View = null;\n this._float64Array = null;\n this._bigUint64Array = null;\n }\n /**\n * Returns the size of the given type in bytes.\n * @param type - One of `int8`, `uint8`, `int16`,\n * `uint16`, `int32`, `uint32`, and `float32`.\n * @returns - size of the type in bytes\n */\n static sizeOf(type) {\n switch (type) {\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\nexport { ViewableBuffer };\n//# sourceMappingURL=ViewableBuffer.mjs.map\n","\"use strict\";\nfunction fastCopy(sourceBuffer, destinationBuffer, sourceOffset, byteLength) {\n sourceOffset ?? (sourceOffset = 0);\n byteLength ?? (byteLength = Math.min(sourceBuffer.byteLength - sourceOffset, destinationBuffer.byteLength));\n if (!(sourceOffset & 7) && !(byteLength & 7)) {\n const len = byteLength / 8;\n new Float64Array(destinationBuffer, 0, len).set(new Float64Array(sourceBuffer, sourceOffset, len));\n } else if (!(sourceOffset & 3) && !(byteLength & 3)) {\n const len = byteLength / 4;\n new Float32Array(destinationBuffer, 0, len).set(new Float32Array(sourceBuffer, sourceOffset, len));\n } else {\n new Uint8Array(destinationBuffer).set(new Uint8Array(sourceBuffer, sourceOffset, byteLength));\n }\n}\n\nexport { fastCopy };\n//# sourceMappingURL=fastCopy.mjs.map\n","\"use strict\";\nconst BLEND_TO_NPM = {\n normal: \"normal-npm\",\n add: \"add-npm\",\n screen: \"screen-npm\"\n};\nvar STENCIL_MODES = /* @__PURE__ */ ((STENCIL_MODES2) => {\n STENCIL_MODES2[STENCIL_MODES2[\"DISABLED\"] = 0] = \"DISABLED\";\n STENCIL_MODES2[STENCIL_MODES2[\"RENDERING_MASK_ADD\"] = 1] = \"RENDERING_MASK_ADD\";\n STENCIL_MODES2[STENCIL_MODES2[\"MASK_ACTIVE\"] = 2] = \"MASK_ACTIVE\";\n STENCIL_MODES2[STENCIL_MODES2[\"INVERSE_MASK_ACTIVE\"] = 3] = \"INVERSE_MASK_ACTIVE\";\n STENCIL_MODES2[STENCIL_MODES2[\"RENDERING_MASK_REMOVE\"] = 4] = \"RENDERING_MASK_REMOVE\";\n STENCIL_MODES2[STENCIL_MODES2[\"NONE\"] = 5] = \"NONE\";\n return STENCIL_MODES2;\n})(STENCIL_MODES || {});\n\nexport { BLEND_TO_NPM, STENCIL_MODES };\n//# sourceMappingURL=const.mjs.map\n","import { BLEND_TO_NPM } from './const.mjs';\n\n\"use strict\";\nfunction getAdjustedBlendModeBlend(blendMode, textureSource) {\n if (textureSource.alphaMode === \"no-premultiply-alpha\") {\n return BLEND_TO_NPM[blendMode] || blendMode;\n }\n return blendMode;\n}\n\nexport { getAdjustedBlendModeBlend };\n//# sourceMappingURL=getAdjustedBlendModeBlend.mjs.map\n","\"use strict\";\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\");\nfunction generateIfTestSrc(maxIfs) {\n let src = \"\";\n for (let i = 0; i < maxIfs; ++i) {\n if (i > 0) {\n src += \"\\nelse \";\n }\n if (i < maxIfs - 1) {\n src += `if(test == ${i}.0){}`;\n }\n }\n return src;\n}\nfunction checkMaxIfStatementsInShader(maxIfs, gl) {\n if (maxIfs === 0) {\n throw new Error(\"Invalid value of `0` passed to `checkMaxIfStatementsInShader`\");\n }\n const shader = gl.createShader(gl.FRAGMENT_SHADER);\n try {\n while (true) {\n const fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));\n gl.shaderSource(shader, fragmentSrc);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n maxIfs = maxIfs / 2 | 0;\n } else {\n break;\n }\n }\n } finally {\n gl.deleteShader(shader);\n }\n return maxIfs;\n}\n\nexport { checkMaxIfStatementsInShader };\n//# sourceMappingURL=checkMaxIfStatementsInShader.mjs.map\n","import { getTestContext } from '../../../renderers/gl/shader/program/getTestContext.mjs';\nimport { checkMaxIfStatementsInShader } from './checkMaxIfStatementsInShader.mjs';\n\n\"use strict\";\nlet maxTexturesPerBatchCache = null;\nfunction getMaxTexturesPerBatch() {\n if (maxTexturesPerBatchCache) return maxTexturesPerBatchCache;\n const gl = getTestContext();\n maxTexturesPerBatchCache = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n maxTexturesPerBatchCache = checkMaxIfStatementsInShader(\n maxTexturesPerBatchCache,\n gl\n );\n gl.getExtension(\"WEBGL_lose_context\")?.loseContext();\n return maxTexturesPerBatchCache;\n}\n\nexport { getMaxTexturesPerBatch };\n//# sourceMappingURL=maxRecommendedTextures.mjs.map\n","\"use strict\";\nclass BatchTextureArray {\n constructor() {\n /** Respective locations for textures. */\n this.ids = /* @__PURE__ */ Object.create(null);\n this.textures = [];\n this.count = 0;\n }\n /** Clear the textures and their locations. */\n clear() {\n for (let i = 0; i < this.count; i++) {\n const t = this.textures[i];\n this.textures[i] = null;\n this.ids[t.uid] = null;\n }\n this.count = 0;\n }\n}\n\nexport { BatchTextureArray };\n//# sourceMappingURL=BatchTextureArray.mjs.map\n","import { uid } from '../../../utils/data/uid.mjs';\nimport { ViewableBuffer } from '../../../utils/data/ViewableBuffer.mjs';\nimport { deprecation } from '../../../utils/logging/deprecation.mjs';\nimport { GlobalResourceRegistry } from '../../../utils/pool/GlobalResourceRegistry.mjs';\nimport { fastCopy } from '../../renderers/shared/buffer/utils/fastCopy.mjs';\nimport { getAdjustedBlendModeBlend } from '../../renderers/shared/state/getAdjustedBlendModeBlend.mjs';\nimport { getMaxTexturesPerBatch } from '../gl/utils/maxRecommendedTextures.mjs';\nimport { BatchTextureArray } from './BatchTextureArray.mjs';\n\n\"use strict\";\nclass Batch {\n constructor() {\n this.renderPipeId = \"batch\";\n this.action = \"startBatch\";\n // TODO - eventually this could be useful for flagging batches as dirty and then only rebuilding those ones\n // public elementStart = 0;\n // public elementSize = 0;\n // for drawing..\n this.start = 0;\n this.size = 0;\n this.textures = new BatchTextureArray();\n this.blendMode = \"normal\";\n this.topology = \"triangle-strip\";\n this.canBundle = true;\n }\n destroy() {\n this.textures = null;\n this.gpuBindGroup = null;\n this.bindGroup = null;\n this.batcher = null;\n this.elements = null;\n }\n}\nconst batchPool = [];\nlet batchPoolIndex = 0;\nGlobalResourceRegistry.register({\n clear: () => {\n if (batchPool.length > 0) {\n for (const item of batchPool) {\n if (item) item.destroy();\n }\n }\n batchPool.length = 0;\n batchPoolIndex = 0;\n }\n});\nfunction getBatchFromPool() {\n return batchPoolIndex > 0 ? batchPool[--batchPoolIndex] : new Batch();\n}\nfunction returnBatchToPool(batch) {\n batch.elements = null;\n batchPool[batchPoolIndex++] = batch;\n}\nlet BATCH_TICK = 0;\nconst _Batcher = class _Batcher {\n constructor(options) {\n /** unique id for this batcher */\n this.uid = uid(\"batcher\");\n /** Indicates whether the batch data has been modified and needs updating. */\n this.dirty = true;\n /** The current index of the batch being processed. */\n this.batchIndex = 0;\n /** An array of all batches created during the current rendering process. */\n this.batches = [];\n this._elements = [];\n options = { ..._Batcher.defaultOptions, ...options };\n if (!options.maxTextures) {\n deprecation(\"v8.8.0\", \"maxTextures is a required option for Batcher now, please pass it in the options\");\n options.maxTextures = getMaxTexturesPerBatch();\n }\n const { maxTextures, attributesInitialSize, indicesInitialSize } = options;\n this.attributeBuffer = new ViewableBuffer(attributesInitialSize * 4);\n this.indexBuffer = new Uint16Array(indicesInitialSize);\n this.maxTextures = maxTextures;\n }\n begin() {\n this.elementSize = 0;\n this.elementStart = 0;\n this.indexSize = 0;\n this.attributeSize = 0;\n for (let i = 0; i < this.batchIndex; i++) {\n returnBatchToPool(this.batches[i]);\n }\n this.batchIndex = 0;\n this._batchIndexStart = 0;\n this._batchIndexSize = 0;\n this.dirty = true;\n }\n add(batchableObject) {\n this._elements[this.elementSize++] = batchableObject;\n batchableObject._indexStart = this.indexSize;\n batchableObject._attributeStart = this.attributeSize;\n batchableObject._batcher = this;\n this.indexSize += batchableObject.indexSize;\n this.attributeSize += batchableObject.attributeSize * this.vertexSize;\n }\n checkAndUpdateTexture(batchableObject, texture) {\n const textureId = batchableObject._batch.textures.ids[texture._source.uid];\n if (!textureId && textureId !== 0) return false;\n batchableObject._textureId = textureId;\n batchableObject.texture = texture;\n return true;\n }\n updateElement(batchableObject) {\n this.dirty = true;\n const attributeBuffer = this.attributeBuffer;\n if (batchableObject.packAsQuad) {\n this.packQuadAttributes(\n batchableObject,\n attributeBuffer.float32View,\n attributeBuffer.uint32View,\n batchableObject._attributeStart,\n batchableObject._textureId\n );\n } else {\n this.packAttributes(\n batchableObject,\n attributeBuffer.float32View,\n attributeBuffer.uint32View,\n batchableObject._attributeStart,\n batchableObject._textureId\n );\n }\n }\n /**\n * breaks the batcher. This happens when a batch gets too big,\n * or we need to switch to a different type of rendering (a filter for example)\n * @param instructionSet\n */\n break(instructionSet) {\n const elements = this._elements;\n if (!elements[this.elementStart]) return;\n let batch = getBatchFromPool();\n let textureBatch = batch.textures;\n textureBatch.clear();\n const firstElement = elements[this.elementStart];\n let blendMode = getAdjustedBlendModeBlend(firstElement.blendMode, firstElement.texture._source);\n let topology = firstElement.topology;\n if (this.attributeSize * 4 > this.attributeBuffer.size) {\n this._resizeAttributeBuffer(this.attributeSize * 4);\n }\n if (this.indexSize > this.indexBuffer.length) {\n this._resizeIndexBuffer(this.indexSize);\n }\n const f32 = this.attributeBuffer.float32View;\n const u32 = this.attributeBuffer.uint32View;\n const indexBuffer = this.indexBuffer;\n let size = this._batchIndexSize;\n let start = this._batchIndexStart;\n let action = \"startBatch\";\n let batchElements = [];\n const maxTextures = this.maxTextures;\n for (let i = this.elementStart; i < this.elementSize; ++i) {\n const element = elements[i];\n elements[i] = null;\n const texture = element.texture;\n const source = texture._source;\n const adjustedBlendMode = getAdjustedBlendModeBlend(element.blendMode, source);\n const breakRequired = blendMode !== adjustedBlendMode || topology !== element.topology;\n if (source._batchTick === BATCH_TICK && !breakRequired) {\n element._textureId = source._textureBindLocation;\n size += element.indexSize;\n if (element.packAsQuad) {\n this.packQuadAttributes(\n element,\n f32,\n u32,\n element._attributeStart,\n element._textureId\n );\n this.packQuadIndex(\n indexBuffer,\n element._indexStart,\n element._attributeStart / this.vertexSize\n );\n } else {\n this.packAttributes(\n element,\n f32,\n u32,\n element._attributeStart,\n element._textureId\n );\n this.packIndex(\n element,\n indexBuffer,\n element._indexStart,\n element._attributeStart / this.vertexSize\n );\n }\n element._batch = batch;\n batchElements.push(element);\n continue;\n }\n source._batchTick = BATCH_TICK;\n if (textureBatch.count >= maxTextures || breakRequired) {\n this._finishBatch(\n batch,\n start,\n size - start,\n textureBatch,\n blendMode,\n topology,\n instructionSet,\n action,\n batchElements\n );\n action = \"renderBatch\";\n start = size;\n blendMode = adjustedBlendMode;\n topology = element.topology;\n batch = getBatchFromPool();\n textureBatch = batch.textures;\n textureBatch.clear();\n batchElements = [];\n ++BATCH_TICK;\n }\n element._textureId = source._textureBindLocation = textureBatch.count;\n textureBatch.ids[source.uid] = textureBatch.count;\n textureBatch.textures[textureBatch.count++] = source;\n element._batch = batch;\n batchElements.push(element);\n size += element.indexSize;\n if (element.packAsQuad) {\n this.packQuadAttributes(\n element,\n f32,\n u32,\n element._attributeStart,\n element._textureId\n );\n this.packQuadIndex(\n indexBuffer,\n element._indexStart,\n element._attributeStart / this.vertexSize\n );\n } else {\n this.packAttributes(\n element,\n f32,\n u32,\n element._attributeStart,\n element._textureId\n );\n this.packIndex(\n element,\n indexBuffer,\n element._indexStart,\n element._attributeStart / this.vertexSize\n );\n }\n }\n if (textureBatch.count > 0) {\n this._finishBatch(\n batch,\n start,\n size - start,\n textureBatch,\n blendMode,\n topology,\n instructionSet,\n action,\n batchElements\n );\n start = size;\n ++BATCH_TICK;\n }\n this.elementStart = this.elementSize;\n this._batchIndexStart = start;\n this._batchIndexSize = size;\n }\n _finishBatch(batch, indexStart, indexSize, textureBatch, blendMode, topology, instructionSet, action, elements) {\n batch.gpuBindGroup = null;\n batch.bindGroup = null;\n batch.action = action;\n batch.batcher = this;\n batch.textures = textureBatch;\n batch.blendMode = blendMode;\n batch.topology = topology;\n batch.start = indexStart;\n batch.size = indexSize;\n batch.elements = elements;\n ++BATCH_TICK;\n this.batches[this.batchIndex++] = batch;\n instructionSet.add(batch);\n }\n finish(instructionSet) {\n this.break(instructionSet);\n }\n /**\n * Resizes the attribute buffer to the given size (1 = 1 float32)\n * @param size - the size in vertices to ensure (not bytes!)\n */\n ensureAttributeBuffer(size) {\n if (size * 4 <= this.attributeBuffer.size) return;\n this._resizeAttributeBuffer(size * 4);\n }\n /**\n * Resizes the index buffer to the given size (1 = 1 float32)\n * @param size - the size in vertices to ensure (not bytes!)\n */\n ensureIndexBuffer(size) {\n if (size <= this.indexBuffer.length) return;\n this._resizeIndexBuffer(size);\n }\n _resizeAttributeBuffer(size) {\n const newSize = Math.max(size, this.attributeBuffer.size * 2);\n const newArrayBuffer = new ViewableBuffer(newSize);\n fastCopy(this.attributeBuffer.rawBinaryData, newArrayBuffer.rawBinaryData);\n this.attributeBuffer = newArrayBuffer;\n }\n _resizeIndexBuffer(size) {\n const indexBuffer = this.indexBuffer;\n let newSize = Math.max(size, indexBuffer.length * 1.5);\n newSize += newSize % 2;\n const newIndexBuffer = newSize > 65535 ? new Uint32Array(newSize) : new Uint16Array(newSize);\n if (newIndexBuffer.BYTES_PER_ELEMENT !== indexBuffer.BYTES_PER_ELEMENT) {\n for (let i = 0; i < indexBuffer.length; i++) {\n newIndexBuffer[i] = indexBuffer[i];\n }\n } else {\n fastCopy(indexBuffer.buffer, newIndexBuffer.buffer);\n }\n this.indexBuffer = newIndexBuffer;\n }\n packQuadIndex(indexBuffer, index, indicesOffset) {\n indexBuffer[index] = indicesOffset + 0;\n indexBuffer[index + 1] = indicesOffset + 1;\n indexBuffer[index + 2] = indicesOffset + 2;\n indexBuffer[index + 3] = indicesOffset + 0;\n indexBuffer[index + 4] = indicesOffset + 2;\n indexBuffer[index + 5] = indicesOffset + 3;\n }\n packIndex(element, indexBuffer, index, indicesOffset) {\n const indices = element.indices;\n const size = element.indexSize;\n const indexOffset = element.indexOffset;\n const attributeOffset = element.attributeOffset;\n for (let i = 0; i < size; i++) {\n indexBuffer[index++] = indicesOffset + indices[i + indexOffset] - attributeOffset;\n }\n }\n /**\n * Destroys the batch and its resources.\n * @param options - destruction options\n * @param options.shader - whether to destroy the associated shader\n */\n destroy(options = {}) {\n if (this.batches === null) return;\n for (let i = 0; i < this.batchIndex; i++) {\n returnBatchToPool(this.batches[i]);\n }\n this.batches = null;\n this.geometry.destroy(true);\n this.geometry = null;\n if (options.shader) {\n this.shader?.destroy();\n this.shader = null;\n }\n for (let i = 0; i < this._elements.length; i++) {\n if (this._elements[i]) this._elements[i]._batch = null;\n }\n this._elements = null;\n this.indexBuffer = null;\n this.attributeBuffer.destroy();\n this.attributeBuffer = null;\n }\n};\n_Batcher.defaultOptions = {\n maxTextures: null,\n attributesInitialSize: 4,\n indicesInitialSize: 6\n};\nlet Batcher = _Batcher;\n\nexport { Batch, Batcher };\n//# sourceMappingURL=Batcher.mjs.map\n","\"use strict\";\nvar BufferUsage = /* @__PURE__ */ ((BufferUsage2) => {\n BufferUsage2[BufferUsage2[\"MAP_READ\"] = 1] = \"MAP_READ\";\n BufferUsage2[BufferUsage2[\"MAP_WRITE\"] = 2] = \"MAP_WRITE\";\n BufferUsage2[BufferUsage2[\"COPY_SRC\"] = 4] = \"COPY_SRC\";\n BufferUsage2[BufferUsage2[\"COPY_DST\"] = 8] = \"COPY_DST\";\n BufferUsage2[BufferUsage2[\"INDEX\"] = 16] = \"INDEX\";\n BufferUsage2[BufferUsage2[\"VERTEX\"] = 32] = \"VERTEX\";\n BufferUsage2[BufferUsage2[\"UNIFORM\"] = 64] = \"UNIFORM\";\n BufferUsage2[BufferUsage2[\"STORAGE\"] = 128] = \"STORAGE\";\n BufferUsage2[BufferUsage2[\"INDIRECT\"] = 256] = \"INDIRECT\";\n BufferUsage2[BufferUsage2[\"QUERY_RESOLVE\"] = 512] = \"QUERY_RESOLVE\";\n BufferUsage2[BufferUsage2[\"STATIC\"] = 1024] = \"STATIC\";\n return BufferUsage2;\n})(BufferUsage || {});\n\nexport { BufferUsage };\n//# sourceMappingURL=const.mjs.map\n","import EventEmitter from 'eventemitter3';\nimport { uid } from '../../../../utils/data/uid.mjs';\nimport { BufferUsage } from './const.mjs';\n\n\"use strict\";\nclass Buffer extends EventEmitter {\n /**\n * Creates a new Buffer with the given options\n * @param options - the options for the buffer\n */\n constructor(options) {\n let { data, size } = options;\n const { usage, label, shrinkToFit } = options;\n super();\n /**\n * emits when the underlying buffer has changed shape (i.e. resized)\n * letting the renderer know that it needs to discard the old buffer on the GPU and create a new one\n * @event change\n */\n /**\n * emits when the underlying buffer data has been updated. letting the renderer know\n * that it needs to update the buffer on the GPU\n * @event update\n */\n /**\n * emits when the buffer is destroyed. letting the renderer know that it needs to destroy the buffer on the GPU\n * @event destroy\n */\n /** @internal */\n this._gpuData = /* @__PURE__ */ Object.create(null);\n /** @internal */\n this._gcLastUsed = -1;\n /** If set to true, the buffer will be garbage collected automatically when it is not used. */\n this.autoGarbageCollect = true;\n /** a unique id for this uniform group used through the renderer */\n this.uid = uid(\"buffer\");\n /**\n * a resource type, used to identify how to handle it when its in a bind group / shader resource\n * @internal\n */\n this._resourceType = \"buffer\";\n /**\n * the resource id used internally by the renderer to build bind group keys\n * @internal\n */\n this._resourceId = uid(\"resource\");\n /**\n * used internally to know if a uniform group was used in the last render pass\n * @internal\n */\n this._touched = 0;\n /** @internal */\n this._updateID = 1;\n this._dataInt32 = null;\n /**\n * should the GPU buffer be shrunk when the data becomes smaller?\n * changing this will cause the buffer to be destroyed and a new one created on the GPU\n * this can be expensive, especially if the buffer is already big enough!\n * setting this to false will prevent the buffer from being shrunk. This will yield better performance\n * if you are constantly setting data that is changing size often.\n * @default true\n */\n this.shrinkToFit = true;\n /**\n * Has the buffer been destroyed?\n * @readonly\n */\n this.destroyed = false;\n if (data instanceof Array) {\n data = new Float32Array(data);\n }\n this._data = data;\n size ?? (size = data?.byteLength);\n const mappedAtCreation = !!data;\n this.descriptor = {\n size,\n usage,\n mappedAtCreation,\n label\n };\n this.shrinkToFit = shrinkToFit ?? true;\n }\n /** the data in the buffer */\n get data() {\n return this._data;\n }\n set data(value) {\n this.setDataWithSize(value, value.length, true);\n }\n get dataInt32() {\n if (!this._dataInt32) {\n this._dataInt32 = new Int32Array(this.data.buffer);\n }\n return this._dataInt32;\n }\n /** whether the buffer is static or not */\n get static() {\n return !!(this.descriptor.usage & BufferUsage.STATIC);\n }\n set static(value) {\n if (value) {\n this.descriptor.usage |= BufferUsage.STATIC;\n } else {\n this.descriptor.usage &= ~BufferUsage.STATIC;\n }\n }\n /**\n * Sets the data in the buffer to the given value. This will immediately update the buffer on the GPU.\n * If you only want to update a subset of the buffer, you can pass in the size of the data.\n * @param value - the data to set\n * @param size - the size of the data in bytes\n * @param syncGPU - should the buffer be updated on the GPU immediately?\n */\n setDataWithSize(value, size, syncGPU) {\n this._updateID++;\n this._updateSize = size * value.BYTES_PER_ELEMENT;\n if (this._data === value) {\n if (syncGPU) this.emit(\"update\", this);\n return;\n }\n const oldData = this._data;\n this._data = value;\n this._dataInt32 = null;\n if (!oldData || oldData.length !== value.length) {\n if (!this.shrinkToFit && oldData && value.byteLength < oldData.byteLength) {\n if (syncGPU) this.emit(\"update\", this);\n } else {\n this.descriptor.size = value.byteLength;\n this._resourceId = uid(\"resource\");\n this.emit(\"change\", this);\n }\n return;\n }\n if (syncGPU) this.emit(\"update\", this);\n }\n /**\n * updates the buffer on the GPU to reflect the data in the buffer.\n * By default it will update the entire buffer. If you only want to update a subset of the buffer,\n * you can pass in the size of the buffer to update.\n * @param sizeInBytes - the new size of the buffer in bytes\n */\n update(sizeInBytes) {\n this._updateSize = sizeInBytes ?? this._updateSize;\n this._updateID++;\n this.emit(\"update\", this);\n }\n /** Unloads the buffer from the GPU */\n unload() {\n this.emit(\"unload\", this);\n for (const key in this._gpuData) {\n this._gpuData[key]?.destroy();\n }\n this._gpuData = /* @__PURE__ */ Object.create(null);\n }\n /** Destroys the buffer */\n destroy() {\n this.destroyed = true;\n this.unload();\n this.emit(\"destroy\", this);\n this.emit(\"change\", this);\n this._data = null;\n this.descriptor = null;\n this.removeAllListeners();\n }\n}\n\nexport { Buffer };\n//# sourceMappingURL=Buffer.mjs.map\n","import { Buffer } from '../../buffer/Buffer.mjs';\nimport { BufferUsage } from '../../buffer/const.mjs';\n\n\"use strict\";\nfunction ensureIsBuffer(buffer, index) {\n if (!(buffer instanceof Buffer)) {\n let usage = index ? BufferUsage.INDEX : BufferUsage.VERTEX;\n if (buffer instanceof Array) {\n if (index) {\n buffer = new Uint32Array(buffer);\n usage = BufferUsage.INDEX | BufferUsage.COPY_DST;\n } else {\n buffer = new Float32Array(buffer);\n usage = BufferUsage.VERTEX | BufferUsage.COPY_DST;\n }\n }\n buffer = new Buffer({\n data: buffer,\n label: index ? \"index-mesh-buffer\" : \"vertex-mesh-buffer\",\n usage\n });\n }\n return buffer;\n}\n\nexport { ensureIsBuffer };\n//# sourceMappingURL=ensureIsBuffer.mjs.map\n","\"use strict\";\nfunction getGeometryBounds(geometry, attributeId, bounds) {\n const attribute = geometry.getAttribute(attributeId);\n if (!attribute) {\n bounds.minX = 0;\n bounds.minY = 0;\n bounds.maxX = 0;\n bounds.maxY = 0;\n return bounds;\n }\n const data = attribute.buffer.data;\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n const byteSize = data.BYTES_PER_ELEMENT;\n const offset = (attribute.offset || 0) / byteSize;\n const stride = (attribute.stride || 2 * 4) / byteSize;\n for (let i = offset; i < data.length; i += stride) {\n const x = data[i];\n const y = data[i + 1];\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n }\n bounds.minX = minX;\n bounds.minY = minY;\n bounds.maxX = maxX;\n bounds.maxY = maxY;\n return bounds;\n}\n\nexport { getGeometryBounds };\n//# sourceMappingURL=getGeometryBounds.mjs.map\n","import EventEmitter from 'eventemitter3';\nimport { Bounds } from '../../../../scene/container/bounds/Bounds.mjs';\nimport { uid } from '../../../../utils/data/uid.mjs';\nimport { Buffer } from '../buffer/Buffer.mjs';\nimport { ensureIsBuffer } from './utils/ensureIsBuffer.mjs';\nimport { getGeometryBounds } from './utils/getGeometryBounds.mjs';\n\n\"use strict\";\nfunction ensureIsAttribute(attribute) {\n if (attribute instanceof Buffer || Array.isArray(attribute) || attribute.BYTES_PER_ELEMENT) {\n attribute = {\n buffer: attribute\n };\n }\n attribute.buffer = ensureIsBuffer(attribute.buffer, false);\n return attribute;\n}\nclass Geometry extends EventEmitter {\n /**\n * Create a new instance of a geometry\n * @param options - The options for the geometry.\n */\n constructor(options = {}) {\n super();\n /** @internal */\n this._gpuData = /* @__PURE__ */ Object.create(null);\n /** If set to true, the resource will be garbage collected automatically when it is not used. */\n this.autoGarbageCollect = true;\n /** @internal */\n this._gcLastUsed = -1;\n /** The unique id of the geometry. */\n this.uid = uid(\"geometry\");\n /**\n * the layout key will be generated by WebGPU all geometries that have the same structure\n * will have the same layout key. This is used to cache the pipeline layout\n * @internal\n */\n this._layoutKey = 0;\n /** the instance count of the geometry to draw */\n this.instanceCount = 1;\n this._bounds = new Bounds();\n this._boundsDirty = true;\n const { attributes, indexBuffer, topology } = options;\n this.buffers = [];\n this.attributes = {};\n if (attributes) {\n for (const i in attributes) {\n this.addAttribute(i, attributes[i]);\n }\n }\n this.instanceCount = options.instanceCount ?? 1;\n if (indexBuffer) {\n this.addIndex(indexBuffer);\n }\n this.topology = topology || \"triangle-list\";\n }\n onBufferUpdate() {\n this._boundsDirty = true;\n this.emit(\"update\", this);\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) {\n return this.attributes[id];\n }\n /**\n * Returns the index buffer\n * @returns - The index buffer.\n */\n getIndex() {\n return this.indexBuffer;\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) {\n return this.getAttribute(id).buffer;\n }\n /**\n * Used to figure out how many vertices there are in this geometry\n * @returns the number of vertices in the geometry\n */\n getSize() {\n for (const i in this.attributes) {\n const attribute = this.attributes[i];\n const buffer = attribute.buffer;\n return buffer.data.length / (attribute.stride / 4 || attribute.size);\n }\n return 0;\n }\n /**\n * Adds an attribute to the geometry.\n * @param name - The name of the attribute to add.\n * @param attributeOption - The attribute option to add.\n */\n addAttribute(name, attributeOption) {\n const attribute = ensureIsAttribute(attributeOption);\n const bufferIndex = this.buffers.indexOf(attribute.buffer);\n if (bufferIndex === -1) {\n this.buffers.push(attribute.buffer);\n attribute.buffer.on(\"update\", this.onBufferUpdate, this);\n attribute.buffer.on(\"change\", this.onBufferUpdate, this);\n }\n this.attributes[name] = attribute;\n }\n /**\n * Adds an index buffer to the geometry.\n * @param indexBuffer - The index buffer to add. Can be a Buffer, TypedArray, or an array of numbers.\n */\n addIndex(indexBuffer) {\n this.indexBuffer = ensureIsBuffer(indexBuffer, true);\n this.buffers.push(this.indexBuffer);\n }\n /** Returns the bounds of the geometry. */\n get bounds() {\n if (!this._boundsDirty) return this._bounds;\n this._boundsDirty = false;\n return getGeometryBounds(this, \"aPosition\", this._bounds);\n }\n /** Unloads the geometry from the GPU. */\n unload() {\n this.emit(\"unload\", this);\n for (const key in this._gpuData) {\n this._gpuData[key]?.destroy();\n }\n this._gpuData = /* @__PURE__ */ Object.create(null);\n }\n /**\n * destroys the geometry.\n * @param destroyBuffers - destroy the buffers associated with this geometry\n */\n destroy(destroyBuffers = false) {\n this.emit(\"destroy\", this);\n this.removeAllListeners();\n if (destroyBuffers) {\n this.buffers.forEach((buffer) => buffer.destroy());\n }\n this.unload();\n this.indexBuffer?.destroy();\n this.attributes = null;\n this.buffers = null;\n this.indexBuffer = null;\n this._bounds = null;\n }\n}\n\nexport { Geometry };\n//# sourceMappingURL=Geometry.mjs.map\n","import { Buffer } from '../../renderers/shared/buffer/Buffer.mjs';\nimport { BufferUsage } from '../../renderers/shared/buffer/const.mjs';\nimport { Geometry } from '../../renderers/shared/geometry/Geometry.mjs';\n\n\"use strict\";\nconst placeHolderBufferData = new Float32Array(1);\nconst placeHolderIndexData = new Uint32Array(1);\nclass BatchGeometry extends Geometry {\n constructor() {\n const vertexSize = 6;\n const attributeBuffer = new Buffer({\n data: placeHolderBufferData,\n label: \"attribute-batch-buffer\",\n usage: BufferUsage.VERTEX | BufferUsage.COPY_DST,\n shrinkToFit: false\n });\n const indexBuffer = new Buffer({\n data: placeHolderIndexData,\n label: \"index-batch-buffer\",\n usage: BufferUsage.INDEX | BufferUsage.COPY_DST,\n // | BufferUsage.STATIC,\n shrinkToFit: false\n });\n const stride = vertexSize * 4;\n super({\n attributes: {\n aPosition: {\n buffer: attributeBuffer,\n format: \"float32x2\",\n stride,\n offset: 0\n },\n aUV: {\n buffer: attributeBuffer,\n format: \"float32x2\",\n stride,\n offset: 2 * 4\n },\n aColor: {\n buffer: attributeBuffer,\n format: \"unorm8x4\",\n stride,\n offset: 4 * 4\n },\n aTextureIdAndRound: {\n buffer: attributeBuffer,\n format: \"uint16x2\",\n stride,\n offset: 5 * 4\n }\n },\n indexBuffer\n });\n }\n}\n\nexport { BatchGeometry };\n//# sourceMappingURL=BatchGeometry.mjs.map\n","import { warn } from '../../../../utils/logging/warn.mjs';\n\n\"use strict\";\nfunction addBits(srcParts, parts, name) {\n if (srcParts) {\n for (const i in srcParts) {\n const id = i.toLocaleLowerCase();\n const part = parts[id];\n if (part) {\n let sanitisedPart = srcParts[i];\n if (i === \"header\") {\n sanitisedPart = sanitisedPart.replace(/@in\\s+[^;]+;\\s*/g, \"\").replace(/@out\\s+[^;]+;\\s*/g, \"\");\n }\n if (name) {\n part.push(`//----${name}----//`);\n }\n part.push(sanitisedPart);\n } else {\n warn(`${i} placement hook does not exist in shader`);\n }\n }\n }\n}\n\nexport { addBits };\n//# sourceMappingURL=addBits.mjs.map\n","\"use strict\";\nconst findHooksRx = /\\{\\{(.*?)\\}\\}/g;\nfunction compileHooks(programSrc) {\n const parts = {};\n const partMatches = programSrc.match(findHooksRx)?.map((hook) => hook.replace(/[{()}]/g, \"\")) ?? [];\n partMatches.forEach((hook) => {\n parts[hook] = [];\n });\n return parts;\n}\n\nexport { compileHooks };\n//# sourceMappingURL=compileHooks.mjs.map\n","\"use strict\";\nfunction extractInputs(fragmentSource, out) {\n let match;\n const regex = /@in\\s+([^;]+);/g;\n while ((match = regex.exec(fragmentSource)) !== null) {\n out.push(match[1]);\n }\n}\nfunction compileInputs(fragments, template, sort = false) {\n const results = [];\n extractInputs(template, results);\n fragments.forEach((fragment) => {\n if (fragment.header) {\n extractInputs(fragment.header, results);\n }\n });\n const mainInput = results;\n if (sort) {\n mainInput.sort();\n }\n const finalString = mainInput.map((inValue, i) => ` @location(${i}) ${inValue},`).join(\"\\n\");\n let cleanedString = template.replace(/@in\\s+[^;]+;\\s*/g, \"\");\n cleanedString = cleanedString.replace(\"{{in}}\", `\n${finalString}\n`);\n return cleanedString;\n}\n\nexport { compileInputs };\n//# sourceMappingURL=compileInputs.mjs.map\n","\"use strict\";\nfunction extractOutputs(fragmentSource, out) {\n let match;\n const regex = /@out\\s+([^;]+);/g;\n while ((match = regex.exec(fragmentSource)) !== null) {\n out.push(match[1]);\n }\n}\nfunction extractVariableName(value) {\n const regex = /\\b(\\w+)\\s*:/g;\n const match = regex.exec(value);\n return match ? match[1] : \"\";\n}\nfunction stripVariable(value) {\n const regex = /@.*?\\s+/g;\n return value.replace(regex, \"\");\n}\nfunction compileOutputs(fragments, template) {\n const results = [];\n extractOutputs(template, results);\n fragments.forEach((fragment) => {\n if (fragment.header) {\n extractOutputs(fragment.header, results);\n }\n });\n let index = 0;\n const mainStruct = results.sort().map((inValue) => {\n if (inValue.indexOf(\"builtin\") > -1) {\n return inValue;\n }\n return `@location(${index++}) ${inValue}`;\n }).join(\",\\n\");\n const mainStart = results.sort().map((inValue) => ` var ${stripVariable(inValue)};`).join(\"\\n\");\n const mainEnd = `return VSOutput(\n ${results.sort().map((inValue) => ` ${extractVariableName(inValue)}`).join(\",\\n\")});`;\n let compiledCode = template.replace(/@out\\s+[^;]+;\\s*/g, \"\");\n compiledCode = compiledCode.replace(\"{{struct}}\", `\n${mainStruct}\n`);\n compiledCode = compiledCode.replace(\"{{start}}\", `\n${mainStart}\n`);\n compiledCode = compiledCode.replace(\"{{return}}\", `\n${mainEnd}\n`);\n return compiledCode;\n}\n\nexport { compileOutputs };\n//# sourceMappingURL=compileOutputs.mjs.map\n","\"use strict\";\nfunction injectBits(templateSrc, fragmentParts) {\n let out = templateSrc;\n for (const i in fragmentParts) {\n const parts = fragmentParts[i];\n const toInject = parts.join(\"\\n\");\n if (toInject.length) {\n out = out.replace(`{{${i}}}`, `//-----${i} START-----//\n${parts.join(\"\\n\")}\n//----${i} FINISH----//`);\n } else {\n out = out.replace(`{{${i}}}`, \"\");\n }\n }\n return out;\n}\n\nexport { injectBits };\n//# sourceMappingURL=injectBits.mjs.map\n","import { addBits } from './utils/addBits.mjs';\nimport { compileHooks } from './utils/compileHooks.mjs';\nimport { compileInputs } from './utils/compileInputs.mjs';\nimport { compileOutputs } from './utils/compileOutputs.mjs';\nimport { injectBits } from './utils/injectBits.mjs';\n\n\"use strict\";\nconst cacheMap = /* @__PURE__ */ Object.create(null);\nconst bitCacheMap = /* @__PURE__ */ new Map();\nlet CACHE_UID = 0;\nfunction compileHighShader({\n template,\n bits\n}) {\n const cacheId = generateCacheId(template, bits);\n if (cacheMap[cacheId]) return cacheMap[cacheId];\n const { vertex, fragment } = compileInputsAndOutputs(template, bits);\n cacheMap[cacheId] = compileBits(vertex, fragment, bits);\n return cacheMap[cacheId];\n}\nfunction compileHighShaderGl({\n template,\n bits\n}) {\n const cacheId = generateCacheId(template, bits);\n if (cacheMap[cacheId]) return cacheMap[cacheId];\n cacheMap[cacheId] = compileBits(template.vertex, template.fragment, bits);\n return cacheMap[cacheId];\n}\nfunction compileInputsAndOutputs(template, bits) {\n const vertexFragments = bits.map((shaderBit) => shaderBit.vertex).filter((v) => !!v);\n const fragmentFragments = bits.map((shaderBit) => shaderBit.fragment).filter((v) => !!v);\n let compiledVertex = compileInputs(vertexFragments, template.vertex, true);\n compiledVertex = compileOutputs(vertexFragments, compiledVertex);\n const compiledFragment = compileInputs(fragmentFragments, template.fragment, true);\n return {\n vertex: compiledVertex,\n fragment: compiledFragment\n };\n}\nfunction generateCacheId(template, bits) {\n return bits.map((highFragment) => {\n if (!bitCacheMap.has(highFragment)) {\n bitCacheMap.set(highFragment, CACHE_UID++);\n }\n return bitCacheMap.get(highFragment);\n }).sort((a, b) => a - b).join(\"-\") + template.vertex + template.fragment;\n}\nfunction compileBits(vertex, fragment, bits) {\n const vertexParts = compileHooks(vertex);\n const fragmentParts = compileHooks(fragment);\n bits.forEach((shaderBit) => {\n addBits(shaderBit.vertex, vertexParts, shaderBit.name);\n addBits(shaderBit.fragment, fragmentParts, shaderBit.name);\n });\n return {\n vertex: injectBits(vertex, vertexParts),\n fragment: injectBits(fragment, fragmentParts)\n };\n}\n\nexport { compileHighShader, compileHighShaderGl };\n//# sourceMappingURL=compileHighShader.mjs.map\n","\"use strict\";\nconst vertexGPUTemplate = (\n /* wgsl */\n `\n @in aPosition: vec2<f32>;\n @in aUV: vec2<f32>;\n\n @out @builtin(position) vPosition: vec4<f32>;\n @out vUV : vec2<f32>;\n @out vColor : vec4<f32>;\n\n {{header}}\n\n struct VSOutput {\n {{struct}}\n };\n\n @vertex\n fn main( {{in}} ) -> VSOutput {\n\n var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;\n var modelMatrix = mat3x3<f32>(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n var position = aPosition;\n var uv = aUV;\n\n {{start}}\n\n vColor = vec4<f32>(1., 1., 1., 1.);\n\n {{main}}\n\n vUV = uv;\n\n var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= globalUniforms.uWorldColorAlpha;\n\n {{end}}\n\n {{return}}\n };\n`\n);\nconst fragmentGPUTemplate = (\n /* wgsl */\n `\n @in vUV : vec2<f32>;\n @in vColor : vec4<f32>;\n\n {{header}}\n\n @fragment\n fn main(\n {{in}}\n ) -> @location(0) vec4<f32> {\n\n {{start}}\n\n var outColor:vec4<f32>;\n\n {{main}}\n\n var finalColor:vec4<f32> = outColor * vColor;\n\n {{end}}\n\n return finalColor;\n };\n`\n);\nconst vertexGlTemplate = (\n /* glsl */\n `\n in vec2 aPosition;\n in vec2 aUV;\n\n out vec4 vColor;\n out vec2 vUV;\n\n {{header}}\n\n void main(void){\n\n mat3 worldTransformMatrix = uWorldTransformMatrix;\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n vec2 position = aPosition;\n vec2 uv = aUV;\n\n {{start}}\n\n vColor = vec4(1.);\n\n {{main}}\n\n vUV = uv;\n\n mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= uWorldColorAlpha;\n\n {{end}}\n }\n`\n);\nconst fragmentGlTemplate = (\n /* glsl */\n `\n\n in vec4 vColor;\n in vec2 vUV;\n\n out vec4 finalColor;\n\n {{header}}\n\n void main(void) {\n\n {{start}}\n\n vec4 outColor;\n\n {{main}}\n\n finalColor = outColor * vColor;\n\n {{end}}\n }\n`\n);\n\nexport { fragmentGPUTemplate, fragmentGlTemplate, vertexGPUTemplate, vertexGlTemplate };\n//# sourceMappingURL=defaultProgramTemplate.mjs.map\n","\"use strict\";\nconst globalUniformsBit = {\n name: \"global-uniforms-bit\",\n vertex: {\n header: (\n /* wgsl */\n `\n struct GlobalUniforms {\n uProjectionMatrix:mat3x3<f32>,\n uWorldTransformMatrix:mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n }\n\n @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;\n `\n )\n }\n};\nconst globalUniformsUBOBitGl = {\n name: \"global-uniforms-ubo-bit\",\n vertex: {\n header: (\n /* glsl */\n `\n uniform globalUniforms {\n mat3 uProjectionMatrix;\n mat3 uWorldTransformMatrix;\n vec4 uWorldColorAlpha;\n vec2 uResolution;\n };\n `\n )\n }\n};\nconst globalUniformsBitGl = {\n name: \"global-uniforms-bit\",\n vertex: {\n header: (\n /* glsl */\n `\n uniform mat3 uProjectionMatrix;\n uniform mat3 uWorldTransformMatrix;\n uniform vec4 uWorldColorAlpha;\n uniform vec2 uResolution;\n `\n )\n }\n};\n\nexport { globalUniformsBit, globalUniformsBitGl, globalUniformsUBOBitGl };\n//# sourceMappingURL=globalUniformsBit.mjs.map\n","import { GlProgram } from '../renderers/gl/shader/GlProgram.mjs';\nimport { GpuProgram } from '../renderers/gpu/shader/GpuProgram.mjs';\nimport { compileHighShader, compileHighShaderGl } from './compiler/compileHighShader.mjs';\nimport { vertexGPUTemplate, fragmentGPUTemplate, fragmentGlTemplate, vertexGlTemplate } from './defaultProgramTemplate.mjs';\nimport { globalUniformsBit, globalUniformsBitGl } from './shader-bits/globalUniformsBit.mjs';\n\n\"use strict\";\nfunction compileHighShaderGpuProgram({ bits, name }) {\n const source = compileHighShader({\n template: {\n fragment: fragmentGPUTemplate,\n vertex: vertexGPUTemplate\n },\n bits: [\n globalUniformsBit,\n ...bits\n ]\n });\n return GpuProgram.from({\n name,\n vertex: {\n source: source.vertex,\n entryPoint: \"main\"\n },\n fragment: {\n source: source.fragment,\n entryPoint: \"main\"\n }\n });\n}\nfunction compileHighShaderGlProgram({ bits, name }) {\n return new GlProgram({\n name,\n ...compileHighShaderGl({\n template: {\n vertex: vertexGlTemplate,\n fragment: fragmentGlTemplate\n },\n bits: [\n globalUniformsBitGl,\n ...bits\n ]\n })\n });\n}\n\nexport { compileHighShaderGlProgram, compileHighShaderGpuProgram };\n//# sourceMappingURL=compileHighShaderToProgram.mjs.map\n","\"use strict\";\nconst colorBit = {\n name: \"color-bit\",\n vertex: {\n header: (\n /* wgsl */\n `\n @in aColor: vec4<f32>;\n `\n ),\n main: (\n /* wgsl */\n `\n vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);\n `\n )\n }\n};\nconst colorBitGl = {\n name: \"color-bit\",\n vertex: {\n header: (\n /* glsl */\n `\n in vec4 aColor;\n `\n ),\n main: (\n /* glsl */\n `\n vColor *= vec4(aColor.rgb * aColor.a, aColor.a);\n `\n )\n }\n};\n\nexport { colorBit, colorBitGl };\n//# sourceMappingURL=colorBit.mjs.map\n","\"use strict\";\nconst textureBatchBitGpuCache = {};\nfunction generateBindingSrc(maxTextures) {\n const src = [];\n if (maxTextures === 1) {\n src.push(\"@group(1) @binding(0) var textureSource1: texture_2d<f32>;\");\n src.push(\"@group(1) @binding(1) var textureSampler1: sampler;\");\n } else {\n let bindingIndex = 0;\n for (let i = 0; i < maxTextures; i++) {\n src.push(`@group(1) @binding(${bindingIndex++}) var textureSource${i + 1}: texture_2d<f32>;`);\n src.push(`@group(1) @binding(${bindingIndex++}) var textureSampler${i + 1}: sampler;`);\n }\n }\n return src.join(\"\\n\");\n}\nfunction generateSampleSrc(maxTextures) {\n const src = [];\n if (maxTextures === 1) {\n src.push(\"outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);\");\n } else {\n src.push(\"switch vTextureId {\");\n for (let i = 0; i < maxTextures; i++) {\n if (i === maxTextures - 1) {\n src.push(` default:{`);\n } else {\n src.push(` case ${i}:{`);\n }\n src.push(` outColor = textureSampleGrad(textureSource${i + 1}, textureSampler${i + 1}, vUV, uvDx, uvDy);`);\n src.push(` break;}`);\n }\n src.push(`}`);\n }\n return src.join(\"\\n\");\n}\nfunction generateTextureBatchBit(maxTextures) {\n if (!textureBatchBitGpuCache[maxTextures]) {\n textureBatchBitGpuCache[maxTextures] = {\n name: \"texture-batch-bit\",\n vertex: {\n header: `\n @in aTextureIdAndRound: vec2<u32>;\n @out @interpolate(flat) vTextureId : u32;\n `,\n main: `\n vTextureId = aTextureIdAndRound.y;\n `,\n end: `\n if(aTextureIdAndRound.x == 1)\n {\n vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n `\n },\n fragment: {\n header: `\n @in @interpolate(flat) vTextureId: u32;\n\n ${generateBindingSrc(maxTextures)}\n `,\n main: `\n var uvDx = dpdx(vUV);\n var uvDy = dpdy(vUV);\n\n ${generateSampleSrc(maxTextures)}\n `\n }\n };\n }\n return textureBatchBitGpuCache[maxTextures];\n}\nconst textureBatchBitGlCache = {};\nfunction generateSampleGlSrc(maxTextures) {\n const src = [];\n for (let i = 0; i < maxTextures; i++) {\n if (i > 0) {\n src.push(\"else\");\n }\n if (i < maxTextures - 1) {\n src.push(`if(vTextureId < ${i}.5)`);\n }\n src.push(\"{\");\n src.push(`\toutColor = texture(uTextures[${i}], vUV);`);\n src.push(\"}\");\n }\n return src.join(\"\\n\");\n}\nfunction generateTextureBatchBitGl(maxTextures) {\n if (!textureBatchBitGlCache[maxTextures]) {\n textureBatchBitGlCache[maxTextures] = {\n name: \"texture-batch-bit\",\n vertex: {\n header: `\n in vec2 aTextureIdAndRound;\n out float vTextureId;\n\n `,\n main: `\n vTextureId = aTextureIdAndRound.y;\n `,\n end: `\n if(aTextureIdAndRound.x == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n `\n },\n fragment: {\n header: `\n in float vTextureId;\n\n uniform sampler2D uTextures[${maxTextures}];\n\n `,\n main: `\n\n ${generateSampleGlSrc(maxTextures)}\n `\n }\n };\n }\n return textureBatchBitGlCache[maxTextures];\n}\n\nexport { generateTextureBatchBit, generateTextureBatchBitGl };\n//# sourceMappingURL=generateTextureBatchBit.mjs.map\n","\"use strict\";\nconst roundPixelsBit = {\n name: \"round-pixels-bit\",\n vertex: {\n header: (\n /* wgsl */\n `\n fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n `\n )\n }\n};\nconst roundPixelsBitGl = {\n name: \"round-pixels-bit\",\n vertex: {\n header: (\n /* glsl */\n `\n vec2 roundPixels(vec2 position, vec2 targetSize)\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n `\n )\n }\n};\n\nexport { roundPixelsBit, roundPixelsBitGl };\n//# sourceMappingURL=roundPixelsBit.mjs.map\n","import { UniformGroup } from '../../shared/shader/UniformGroup.mjs';\n\n\"use strict\";\nconst batchSamplersUniformGroupHash = {};\nfunction getBatchSamplersUniformGroup(maxTextures) {\n let batchSamplersUniformGroup = batchSamplersUniformGroupHash[maxTextures];\n if (batchSamplersUniformGroup) return batchSamplersUniformGroup;\n const sampleValues = new Int32Array(maxTextures);\n for (let i = 0; i < maxTextures; i++) {\n sampleValues[i] = i;\n }\n batchSamplersUniformGroup = batchSamplersUniformGroupHash[maxTextures] = new UniformGroup({\n uTextures: { value: sampleValues, type: `i32`, size: maxTextures }\n }, { isStatic: true });\n return batchSamplersUniformGroup;\n}\n\nexport { getBatchSamplersUniformGroup };\n//# sourceMappingURL=getBatchSamplersUniformGroup.mjs.map\n","import { compileHighShaderGlProgram, compileHighShaderGpuProgram } from '../../high-shader/compileHighShaderToProgram.mjs';\nimport { colorBitGl, colorBit } from '../../high-shader/shader-bits/colorBit.mjs';\nimport { generateTextureBatchBitGl, generateTextureBatchBit } from '../../high-shader/shader-bits/generateTextureBatchBit.mjs';\nimport { roundPixelsBitGl, roundPixelsBit } from '../../high-shader/shader-bits/roundPixelsBit.mjs';\nimport { getBatchSamplersUniformGroup } from '../../renderers/gl/shader/getBatchSamplersUniformGroup.mjs';\nimport { Shader } from '../../renderers/shared/shader/Shader.mjs';\n\n\"use strict\";\nclass DefaultShader extends Shader {\n constructor(maxTextures) {\n const glProgram = compileHighShaderGlProgram({\n name: \"batch\",\n bits: [\n colorBitGl,\n generateTextureBatchBitGl(maxTextures),\n roundPixelsBitGl\n ]\n });\n const gpuProgram = compileHighShaderGpuProgram({\n name: \"batch\",\n bits: [\n colorBit,\n generateTextureBatchBit(maxTextures),\n roundPixelsBit\n ]\n });\n super({\n glProgram,\n gpuProgram,\n resources: {\n batchSamplers: getBatchSamplersUniformGroup(maxTextures)\n }\n });\n this.maxTextures = maxTextures;\n }\n}\n\nexport { DefaultShader };\n//# sourceMappingURL=DefaultShader.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { Batcher } from './Batcher.mjs';\nimport { BatchGeometry } from './BatchGeometry.mjs';\nimport { DefaultShader } from './DefaultShader.mjs';\n\n\"use strict\";\nlet defaultShader = null;\nconst _DefaultBatcher = class _DefaultBatcher extends Batcher {\n constructor(options) {\n super(options);\n this.geometry = new BatchGeometry();\n this.name = _DefaultBatcher.extension.name;\n /** The size of one attribute. 1 = 32 bit. x, y, u, v, color, textureIdAndRound -> total = 6 */\n this.vertexSize = 6;\n defaultShader ?? (defaultShader = new DefaultShader(options.maxTextures));\n this.shader = defaultShader;\n }\n /**\n * Packs the attributes of a DefaultBatchableMeshElement into the provided views.\n * @param element - The DefaultBatchableMeshElement to pack.\n * @param float32View - The Float32Array view to pack into.\n * @param uint32View - The Uint32Array view to pack into.\n * @param index - The starting index in the views.\n * @param textureId - The texture ID to use.\n */\n packAttributes(element, float32View, uint32View, index, textureId) {\n const textureIdAndRound = textureId << 16 | element.roundPixels & 65535;\n const wt = element.transform;\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 { positions, uvs } = element;\n const argb = element.color;\n const offset = element.attributeOffset;\n const end = offset + element.attributeSize;\n for (let i = offset; i < end; i++) {\n const i2 = i * 2;\n const x = positions[i2];\n const y = positions[i2 + 1];\n float32View[index++] = a * x + c * y + tx;\n float32View[index++] = d * y + b * x + ty;\n float32View[index++] = uvs[i2];\n float32View[index++] = uvs[i2 + 1];\n uint32View[index++] = argb;\n uint32View[index++] = textureIdAndRound;\n }\n }\n /**\n * Packs the attributes of a DefaultBatchableQuadElement into the provided views.\n * @param element - The DefaultBatchableQuadElement to pack.\n * @param float32View - The Float32Array view to pack into.\n * @param uint32View - The Uint32Array view to pack into.\n * @param index - The starting index in the views.\n * @param textureId - The texture ID to use.\n */\n packQuadAttributes(element, float32View, uint32View, index, textureId) {\n const texture = element.texture;\n const wt = element.transform;\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 bounds = element.bounds;\n const w0 = bounds.maxX;\n const w1 = bounds.minX;\n const h0 = bounds.maxY;\n const h1 = bounds.minY;\n const uvs = texture.uvs;\n const argb = element.color;\n const textureIdAndRound = textureId << 16 | element.roundPixels & 65535;\n float32View[index + 0] = a * w1 + c * h1 + tx;\n float32View[index + 1] = d * h1 + b * w1 + ty;\n float32View[index + 2] = uvs.x0;\n float32View[index + 3] = uvs.y0;\n uint32View[index + 4] = argb;\n uint32View[index + 5] = textureIdAndRound;\n float32View[index + 6] = a * w0 + c * h1 + tx;\n float32View[index + 7] = d * h1 + b * w0 + ty;\n float32View[index + 8] = uvs.x1;\n float32View[index + 9] = uvs.y1;\n uint32View[index + 10] = argb;\n uint32View[index + 11] = textureIdAndRound;\n float32View[index + 12] = a * w0 + c * h0 + tx;\n float32View[index + 13] = d * h0 + b * w0 + ty;\n float32View[index + 14] = uvs.x2;\n float32View[index + 15] = uvs.y2;\n uint32View[index + 16] = argb;\n uint32View[index + 17] = textureIdAndRound;\n float32View[index + 18] = a * w1 + c * h0 + tx;\n float32View[index + 19] = d * h0 + b * w1 + ty;\n float32View[index + 20] = uvs.x3;\n float32View[index + 21] = uvs.y3;\n uint32View[index + 22] = argb;\n uint32View[index + 23] = textureIdAndRound;\n }\n /**\n * Updates the maximum number of textures that can be used in the shader.\n * @param maxTextures - The maximum number of textures that can be used in the shader.\n * @internal\n */\n _updateMaxTextures(maxTextures) {\n if (this.shader.maxTextures === maxTextures) return;\n defaultShader = new DefaultShader(maxTextures);\n this.shader = defaultShader;\n }\n destroy() {\n this.shader = null;\n super.destroy();\n }\n};\n/** @ignore */\n_DefaultBatcher.extension = {\n type: [\n ExtensionType.Batcher\n ],\n name: \"default\"\n};\nlet DefaultBatcher = _DefaultBatcher;\n\nexport { DefaultBatcher };\n//# sourceMappingURL=DefaultBatcher.mjs.map\n","\"use strict\";\nclass GCManagedHash {\n constructor(options) {\n // Exposed directly for GC system access\n this.items = /* @__PURE__ */ Object.create(null);\n const { renderer, type, onUnload, priority, name } = options;\n this._renderer = renderer;\n renderer.gc.addResourceHash(this, \"items\", type, priority ?? 0);\n this._onUnload = onUnload;\n this.name = name;\n }\n /**\n * Add an item to the hash. No-op if already added.\n * @param item\n * @returns true if the item was added, false if it was already in the hash\n */\n add(item) {\n if (this.items[item.uid]) return false;\n this.items[item.uid] = item;\n item.once(\"unload\", this.remove, this);\n item._gcLastUsed = this._renderer.gc.now;\n return true;\n }\n remove(item, ...args) {\n if (!this.items[item.uid]) return;\n const gpuData = item._gpuData[this._renderer.uid];\n if (!gpuData) return;\n this._onUnload?.(item, ...args);\n gpuData.destroy();\n item._gpuData[this._renderer.uid] = null;\n this.items[item.uid] = null;\n }\n removeAll(...args) {\n Object.values(this.items).forEach((item) => item && this.remove(item, ...args));\n }\n destroy(...args) {\n this.removeAll(...args);\n this.items = /* @__PURE__ */ Object.create(null);\n this._renderer = null;\n this._onUnload = null;\n }\n}\n\nexport { GCManagedHash };\n//# sourceMappingURL=GCManagedHash.mjs.map\n","\"use strict\";\nfunction buildUvs(vertices, verticesStride, verticesOffset, uvs, uvsOffset, uvsStride, size, matrix = null) {\n let index = 0;\n verticesOffset *= verticesStride;\n uvsOffset *= uvsStride;\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 while (index < size) {\n const x = vertices[verticesOffset];\n const y = vertices[verticesOffset + 1];\n uvs[uvsOffset] = a * x + c * y + tx;\n uvs[uvsOffset + 1] = b * x + d * y + ty;\n uvsOffset += uvsStride;\n verticesOffset += verticesStride;\n index++;\n }\n}\nfunction buildSimpleUvs(uvs, uvsOffset, uvsStride, size) {\n let index = 0;\n uvsOffset *= uvsStride;\n while (index < size) {\n uvs[uvsOffset] = 0;\n uvs[uvsOffset + 1] = 0;\n uvsOffset += uvsStride;\n index++;\n }\n}\n\nexport { buildSimpleUvs, buildUvs };\n//# sourceMappingURL=buildUvs.mjs.map\n","\"use strict\";\nfunction transformVertices(vertices, m, offset, stride, size) {\n const a = m.a;\n const b = m.b;\n const c = m.c;\n const d = m.d;\n const tx = m.tx;\n const ty = m.ty;\n offset || (offset = 0);\n stride || (stride = 2);\n size || (size = vertices.length / stride - offset);\n let index = offset * stride;\n for (let i = 0; i < size; i++) {\n const x = vertices[index];\n const y = vertices[index + 1];\n vertices[index] = a * x + c * y + tx;\n vertices[index + 1] = b * x + d * y + ty;\n index += stride;\n }\n}\n\nexport { transformVertices };\n//# sourceMappingURL=transformVertices.mjs.map\n","import { Matrix } from '../../../maths/matrix/Matrix.mjs';\nimport { multiplyHexColors } from '../../container/utils/multiplyHexColors.mjs';\n\n\"use strict\";\nconst identityMatrix = new Matrix();\nclass BatchableGraphics {\n constructor() {\n this.packAsQuad = false;\n this.batcherName = \"default\";\n this.topology = \"triangle-list\";\n this.applyTransform = true;\n this.roundPixels = 0;\n this._batcher = null;\n this._batch = null;\n }\n get uvs() {\n return this.geometryData.uvs;\n }\n get positions() {\n return this.geometryData.vertices;\n }\n get indices() {\n return this.geometryData.indices;\n }\n get blendMode() {\n if (this.renderable && this.applyTransform) {\n return this.renderable.groupBlendMode;\n }\n return \"normal\";\n }\n get color() {\n const rgb = this.baseColor;\n const bgr = rgb >> 16 | rgb & 65280 | (rgb & 255) << 16;\n const renderable = this.renderable;\n if (renderable) {\n return multiplyHexColors(bgr, renderable.groupColor) + (this.alpha * renderable.groupAlpha * 255 << 24);\n }\n return bgr + (this.alpha * 255 << 24);\n }\n get transform() {\n return this.renderable?.groupTransform || identityMatrix;\n }\n copyTo(gpuBuffer) {\n gpuBuffer.indexOffset = this.indexOffset;\n gpuBuffer.indexSize = this.indexSize;\n gpuBuffer.attributeOffset = this.attributeOffset;\n gpuBuffer.attributeSize = this.attributeSize;\n gpuBuffer.baseColor = this.baseColor;\n gpuBuffer.alpha = this.alpha;\n gpuBuffer.texture = this.texture;\n gpuBuffer.geometryData = this.geometryData;\n gpuBuffer.topology = this.topology;\n }\n reset() {\n this.applyTransform = true;\n this.renderable = null;\n this.topology = \"triangle-list\";\n }\n destroy() {\n this.renderable = null;\n this.texture = null;\n this.geometryData = null;\n this._batcher = null;\n this._batch = null;\n }\n}\n\nexport { BatchableGraphics };\n//# sourceMappingURL=BatchableGraphics.mjs.map\n","import { ExtensionType } from '../../../../extensions/Extensions.mjs';\n\n\"use strict\";\nconst buildCircle = {\n extension: {\n type: ExtensionType.ShapeBuilder,\n name: \"circle\"\n },\n build(shape, points) {\n let x;\n let y;\n let dx;\n let dy;\n let rx;\n let ry;\n if (shape.type === \"circle\") {\n const circle = shape;\n rx = ry = circle.radius;\n if (rx <= 0) {\n return false;\n }\n x = circle.x;\n y = circle.y;\n dx = dy = 0;\n } else if (shape.type === \"ellipse\") {\n const ellipse = shape;\n rx = ellipse.halfWidth;\n ry = ellipse.halfHeight;\n if (rx <= 0 || ry <= 0) {\n return false;\n }\n x = ellipse.x;\n y = ellipse.y;\n dx = dy = 0;\n } else {\n const roundedRect = shape;\n const halfWidth = roundedRect.width / 2;\n const halfHeight = roundedRect.height / 2;\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 if (dx < 0 || dy < 0) {\n return false;\n }\n const n = Math.ceil(2.3 * Math.sqrt(rx + ry));\n const m = n * 8 + (dx ? 4 : 0) + (dy ? 4 : 0);\n if (m === 0) {\n return false;\n }\n if (n === 0) {\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 return true;\n }\n let j1 = 0;\n let j2 = n * 4 + (dx ? 2 : 0) + 2;\n let j3 = j2;\n let j4 = m;\n let x0 = dx + rx;\n let y0 = dy;\n let x1 = x + x0;\n let x2 = x - x0;\n let y1 = y + y0;\n points[j1++] = x1;\n points[j1++] = y1;\n points[--j2] = y1;\n points[--j2] = x2;\n if (dy) {\n const y22 = y - y0;\n points[j3++] = x2;\n points[j3++] = y22;\n points[--j4] = y22;\n points[--j4] = x1;\n }\n for (let i = 1; i < n; i++) {\n const a = Math.PI / 2 * (i / n);\n const x02 = dx + Math.cos(a) * rx;\n const y02 = dy + Math.sin(a) * ry;\n const x12 = x + x02;\n const x22 = x - x02;\n const y12 = y + y02;\n const y22 = y - y02;\n points[j1++] = x12;\n points[j1++] = y12;\n points[--j2] = y12;\n points[--j2] = x22;\n points[j3++] = x22;\n points[j3++] = y22;\n points[--j4] = y22;\n points[--j4] = x12;\n }\n x0 = dx;\n y0 = dy + ry;\n x1 = x + x0;\n x2 = x - x0;\n y1 = y + y0;\n const y2 = y - y0;\n points[j1++] = x1;\n points[j1++] = y1;\n points[--j4] = y2;\n points[--j4] = x1;\n if (dx) {\n points[j1++] = x2;\n points[j1++] = y1;\n points[--j4] = y2;\n points[--j4] = x2;\n }\n return true;\n },\n triangulate(points, vertices, verticesStride, verticesOffset, indices, indicesOffset) {\n if (points.length === 0) {\n return;\n }\n let centerX = 0;\n let centerY = 0;\n for (let i = 0; i < points.length; i += 2) {\n centerX += points[i];\n centerY += points[i + 1];\n }\n centerX /= points.length / 2;\n centerY /= points.length / 2;\n let count = verticesOffset;\n vertices[count * verticesStride] = centerX;\n vertices[count * verticesStride + 1] = centerY;\n const centerIndex = count++;\n for (let i = 0; i < points.length; i += 2) {\n vertices[count * verticesStride] = points[i];\n vertices[count * verticesStride + 1] = points[i + 1];\n if (i > 0) {\n indices[indicesOffset++] = count;\n indices[indicesOffset++] = centerIndex;\n indices[indicesOffset++] = count - 1;\n }\n count++;\n }\n indices[indicesOffset++] = centerIndex + 1;\n indices[indicesOffset++] = centerIndex;\n indices[indicesOffset++] = count - 1;\n }\n};\nconst buildEllipse = { ...buildCircle, extension: { ...buildCircle.extension, name: \"ellipse\" } };\nconst buildRoundedRectangle = { ...buildCircle, extension: { ...buildCircle.extension, name: \"roundedRectangle\" } };\n\nexport { buildCircle, buildEllipse, buildRoundedRectangle };\n//# sourceMappingURL=buildCircle.mjs.map\n","\"use strict\";\nconst closePointEps = 1e-4;\nconst curveEps = 1e-4;\n\nexport { closePointEps, curveEps };\n//# sourceMappingURL=const.mjs.map\n","\"use strict\";\nfunction getOrientationOfPoints(points) {\n const m = points.length;\n if (m < 6) {\n return 1;\n }\n let area = 0;\n for (let i = 0, x1 = points[m - 2], y1 = points[m - 1]; i < m; i += 2) {\n const x2 = points[i];\n const y2 = points[i + 1];\n area += (x2 - x1) * (y2 + y1);\n x1 = x2;\n y1 = y2;\n }\n if (area < 0) {\n return -1;\n }\n return 1;\n}\n\nexport { getOrientationOfPoints };\n//# sourceMappingURL=getOrientationOfPoints.mjs.map\n","import { Point } from '../../../../maths/point/Point.mjs';\nimport { closePointEps, curveEps } from '../const.mjs';\nimport { getOrientationOfPoints } from '../utils/getOrientationOfPoints.mjs';\n\n\"use strict\";\nfunction square(x, y, nx, ny, innerWeight, outerWeight, clockwise, verts) {\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 let exx;\n let eyy;\n if (clockwise) {\n exx = ny;\n eyy = -nx;\n } else {\n exx = -ny;\n eyy = nx;\n }\n const eix = ix + exx;\n const eiy = iy + eyy;\n const eox = ox + exx;\n const eoy = oy + eyy;\n verts.push(eix, eiy);\n verts.push(eox, eoy);\n return 2;\n}\nfunction round(cx, cy, sx, sy, ex, ey, verts, clockwise) {\n const cx2p0x = sx - cx;\n const cy2p0y = sy - cy;\n let angle0 = Math.atan2(cx2p0x, cy2p0y);\n let angle1 = Math.atan2(ex - cx, ey - cy);\n if (clockwise && angle0 < angle1) {\n angle0 += Math.PI * 2;\n } else if (!clockwise && angle0 > angle1) {\n angle1 += Math.PI * 2;\n }\n let startAngle = angle0;\n const angleDiff = angle1 - angle0;\n const absAngleDiff = Math.abs(angleDiff);\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 startAngle += angleInc;\n if (clockwise) {\n verts.push(cx, cy);\n verts.push(sx, sy);\n for (let i = 1, angle = startAngle; i < segCount; i++, angle += angleInc) {\n verts.push(cx, cy);\n verts.push(\n cx + Math.sin(angle) * radius,\n cy + Math.cos(angle) * radius\n );\n }\n verts.push(cx, cy);\n verts.push(ex, ey);\n } else {\n verts.push(sx, sy);\n verts.push(cx, cy);\n for (let i = 1, angle = startAngle; i < segCount; i++, angle += angleInc) {\n verts.push(\n cx + Math.sin(angle) * radius,\n cy + Math.cos(angle) * radius\n );\n verts.push(cx, cy);\n }\n verts.push(ex, ey);\n verts.push(cx, cy);\n }\n return segCount * 2;\n}\nfunction buildLine(points, lineStyle, flipAlignment, closed, vertices, indices) {\n const eps = closePointEps;\n if (points.length === 0) {\n return;\n }\n const style = lineStyle;\n let alignment = style.alignment;\n if (lineStyle.alignment !== 0.5) {\n let orientation = getOrientationOfPoints(points);\n if (flipAlignment) orientation *= -1;\n alignment = (alignment - 0.5) * orientation + 0.5;\n }\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 = closed;\n const closedPath = Math.abs(firstPoint.x - lastPoint.x) < eps && Math.abs(firstPoint.y - lastPoint.y) < eps;\n if (closedShape) {\n points = points.slice();\n if (closedPath) {\n points.pop();\n points.pop();\n lastPoint.set(points[points.length - 2], points[points.length - 1]);\n }\n const midPointX = (firstPoint.x + lastPoint.x) * 0.5;\n const midPointY = (lastPoint.y + firstPoint.y) * 0.5;\n points.unshift(midPointX, midPointY);\n points.push(midPointX, midPointY);\n }\n const verts = vertices;\n const length = points.length / 2;\n let indexCount = points.length;\n const indexStart = verts.length / 2;\n const width = style.width / 2;\n const widthSquared = width * width;\n const miterLimitSquared = style.miterLimit * style.miterLimit;\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 let perpX = -(y0 - y1);\n let perpY = x0 - x1;\n let perp1x = 0;\n let perp1y = 0;\n let dist = Math.sqrt(perpX * perpX + perpY * perpY);\n perpX /= dist;\n perpY /= dist;\n perpX *= width;\n perpY *= width;\n const ratio = alignment;\n const innerWeight = (1 - ratio) * 2;\n const outerWeight = ratio * 2;\n if (!closedShape) {\n if (style.cap === \"round\") {\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 } else if (style.cap === \"square\") {\n indexCount += square(x0, y0, perpX, perpY, innerWeight, outerWeight, true, verts);\n }\n }\n verts.push(\n x0 - perpX * innerWeight,\n y0 - perpY * innerWeight\n );\n verts.push(\n x0 + perpX * outerWeight,\n y0 + perpY * outerWeight\n );\n for (let i = 1; i < length - 1; ++i) {\n x0 = points[(i - 1) * 2];\n y0 = points[(i - 1) * 2 + 1];\n x1 = points[i * 2];\n y1 = points[i * 2 + 1];\n x2 = points[(i + 1) * 2];\n y2 = points[(i + 1) * 2 + 1];\n perpX = -(y0 - y1);\n perpY = x0 - x1;\n dist = Math.sqrt(perpX * perpX + perpY * perpY);\n perpX /= dist;\n perpY /= dist;\n perpX *= width;\n perpY *= width;\n perp1x = -(y1 - y2);\n perp1y = x1 - x2;\n dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y);\n perp1x /= dist;\n perp1y /= dist;\n perp1x *= width;\n perp1y *= width;\n const dx0 = x1 - x0;\n const dy0 = y0 - y1;\n const dx1 = x1 - x2;\n const dy1 = y2 - y1;\n const dot = dx0 * dx1 + dy0 * dy1;\n const cross = dy0 * dx1 - dy1 * dx0;\n const clockwise = cross < 0;\n if (Math.abs(cross) < 1e-3 * Math.abs(dot)) {\n verts.push(\n x1 - perpX * innerWeight,\n y1 - perpY * innerWeight\n );\n verts.push(\n x1 + perpX * outerWeight,\n y1 + perpY * outerWeight\n );\n if (dot >= 0) {\n if (style.join === \"round\") {\n indexCount += round(\n x1,\n y1,\n x1 - perpX * innerWeight,\n y1 - perpY * innerWeight,\n x1 - perp1x * innerWeight,\n y1 - perp1y * innerWeight,\n verts,\n false\n ) + 4;\n } else {\n indexCount += 2;\n }\n verts.push(\n x1 - perp1x * outerWeight,\n y1 - perp1y * outerWeight\n );\n verts.push(\n x1 + perp1x * innerWeight,\n y1 + perp1y * innerWeight\n );\n }\n continue;\n }\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 const imx = x1 + (px - x1) * innerWeight;\n const imy = y1 + (py - y1) * innerWeight;\n const omx = x1 - (px - x1) * outerWeight;\n const omy = y1 - (py - y1) * outerWeight;\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 if (insideMiterOk) {\n if (style.join === \"bevel\" || pDist / widthSquared > miterLimitSquared) {\n if (clockwise) {\n verts.push(imx, imy);\n verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight);\n verts.push(imx, imy);\n verts.push(x1 + perp1x * outerWeight, y1 + perp1y * outerWeight);\n } else {\n verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight);\n verts.push(omx, omy);\n verts.push(x1 - perp1x * innerWeight, y1 - perp1y * innerWeight);\n verts.push(omx, omy);\n }\n indexCount += 2;\n } else if (style.join === \"round\") {\n if (clockwise) {\n verts.push(imx, imy);\n verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight);\n indexCount += round(\n x1,\n y1,\n x1 + perpX * outerWeight,\n y1 + perpY * outerWeight,\n x1 + perp1x * outerWeight,\n y1 + perp1y * outerWeight,\n verts,\n true\n ) + 4;\n verts.push(imx, imy);\n verts.push(x1 + perp1x * outerWeight, y1 + perp1y * outerWeight);\n } else {\n verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight);\n verts.push(omx, omy);\n indexCount += round(\n x1,\n y1,\n x1 - perpX * innerWeight,\n y1 - perpY * innerWeight,\n x1 - perp1x * innerWeight,\n y1 - perp1y * innerWeight,\n verts,\n false\n ) + 4;\n verts.push(x1 - perp1x * innerWeight, y1 - perp1y * innerWeight);\n verts.push(omx, omy);\n }\n } else {\n verts.push(imx, imy);\n verts.push(omx, omy);\n }\n } else {\n verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight);\n verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight);\n if (style.join === \"round\") {\n if (clockwise) {\n indexCount += round(\n x1,\n y1,\n x1 + perpX * outerWeight,\n y1 + perpY * outerWeight,\n x1 + perp1x * outerWeight,\n y1 + perp1y * outerWeight,\n verts,\n true\n ) + 2;\n } else {\n indexCount += round(\n x1,\n y1,\n x1 - perpX * innerWeight,\n y1 - perpY * innerWeight,\n x1 - perp1x * innerWeight,\n y1 - perp1y * innerWeight,\n verts,\n false\n ) + 2;\n }\n } else if (style.join === \"miter\" && pDist / widthSquared <= miterLimitSquared) {\n if (clockwise) {\n verts.push(omx, omy);\n verts.push(omx, omy);\n } else {\n verts.push(imx, imy);\n verts.push(imx, imy);\n }\n indexCount += 2;\n }\n verts.push(x1 - perp1x * innerWeight, y1 - perp1y * innerWeight);\n verts.push(x1 + perp1x * outerWeight, y1 + perp1y * outerWeight);\n indexCount += 2;\n }\n }\n x0 = points[(length - 2) * 2];\n y0 = points[(length - 2) * 2 + 1];\n x1 = points[(length - 1) * 2];\n y1 = points[(length - 1) * 2 + 1];\n perpX = -(y0 - y1);\n perpY = x0 - x1;\n dist = Math.sqrt(perpX * perpX + perpY * perpY);\n perpX /= dist;\n perpY /= dist;\n perpX *= width;\n perpY *= width;\n verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight);\n verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight);\n if (!closedShape) {\n if (style.cap === \"round\") {\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 } else if (style.cap === \"square\") {\n indexCount += square(x1, y1, perpX, perpY, innerWeight, outerWeight, false, verts);\n }\n }\n const eps2 = curveEps * curveEps;\n for (let i = indexStart; i < indexCount + indexStart - 2; ++i) {\n x0 = verts[i * 2];\n y0 = verts[i * 2 + 1];\n x1 = verts[(i + 1) * 2];\n y1 = verts[(i + 1) * 2 + 1];\n x2 = verts[(i + 2) * 2];\n y2 = verts[(i + 2) * 2 + 1];\n if (Math.abs(x0 * (y1 - y2) + x1 * (y2 - y0) + x2 * (y0 - y1)) < eps2) {\n continue;\n }\n indices.push(i, i + 1, i + 2);\n }\n}\n\nexport { buildLine };\n//# sourceMappingURL=buildLine.mjs.map\n","import { closePointEps } from '../const.mjs';\n\n\"use strict\";\nfunction buildPixelLine(points, closed, vertices, indices) {\n const eps = closePointEps;\n if (points.length === 0) {\n return;\n }\n const fx = points[0];\n const fy = points[1];\n const lx = points[points.length - 2];\n const ly = points[points.length - 1];\n const closePath = closed || Math.abs(fx - lx) < eps && Math.abs(fy - ly) < eps;\n const verts = vertices;\n const length = points.length / 2;\n const indexStart = verts.length / 2;\n for (let i = 0; i < length; i++) {\n verts.push(points[i * 2]);\n verts.push(points[i * 2 + 1]);\n }\n for (let i = 0; i < length - 1; i++) {\n indices.push(indexStart + i, indexStart + i + 1);\n }\n if (closePath) {\n indices.push(indexStart + length - 1, indexStart);\n }\n}\n\nexport { buildPixelLine };\n//# sourceMappingURL=buildPixelLine.mjs.map\n","import { earcut } from '../../../../utils/utils.mjs';\n\n\"use strict\";\nfunction triangulateWithHoles(points, holes, vertices, verticesStride, verticesOffset, indices, indicesOffset) {\n const triangles = earcut(points, holes, 2);\n if (!triangles) {\n return;\n }\n for (let i = 0; i < triangles.length; i += 3) {\n indices[indicesOffset++] = triangles[i] + verticesOffset;\n indices[indicesOffset++] = triangles[i + 1] + verticesOffset;\n indices[indicesOffset++] = triangles[i + 2] + verticesOffset;\n }\n let index = verticesOffset * verticesStride;\n for (let i = 0; i < points.length; i += 2) {\n vertices[index] = points[i];\n vertices[index + 1] = points[i + 1];\n index += verticesStride;\n }\n}\n\nexport { triangulateWithHoles };\n//# sourceMappingURL=triangulateWithHoles.mjs.map\n","import { ExtensionType } from '../../../../extensions/Extensions.mjs';\nimport { triangulateWithHoles } from '../utils/triangulateWithHoles.mjs';\n\n\"use strict\";\nconst emptyArray = [];\nconst buildPolygon = {\n extension: {\n type: ExtensionType.ShapeBuilder,\n name: \"polygon\"\n },\n build(shape, points) {\n for (let i = 0; i < shape.points.length; i++) {\n points[i] = shape.points[i];\n }\n return true;\n },\n triangulate(points, vertices, verticesStride, verticesOffset, indices, indicesOffset) {\n triangulateWithHoles(points, emptyArray, vertices, verticesStride, verticesOffset, indices, indicesOffset);\n }\n};\n\nexport { buildPolygon };\n//# sourceMappingURL=buildPolygon.mjs.map\n","import { ExtensionType } from '../../../../extensions/Extensions.mjs';\n\n\"use strict\";\nconst buildRectangle = {\n extension: {\n type: ExtensionType.ShapeBuilder,\n name: \"rectangle\"\n },\n build(shape, points) {\n const rectData = shape;\n const x = rectData.x;\n const y = rectData.y;\n const width = rectData.width;\n const height = rectData.height;\n if (!(width > 0 && height > 0)) {\n return false;\n }\n points[0] = x;\n points[1] = y;\n points[2] = x + width;\n points[3] = y;\n points[4] = x + width;\n points[5] = y + height;\n points[6] = x;\n points[7] = y + height;\n return true;\n },\n triangulate(points, vertices, verticesStride, verticesOffset, indices, indicesOffset) {\n let count = 0;\n verticesOffset *= verticesStride;\n vertices[verticesOffset + count] = points[0];\n vertices[verticesOffset + count + 1] = points[1];\n count += verticesStride;\n vertices[verticesOffset + count] = points[2];\n vertices[verticesOffset + count + 1] = points[3];\n count += verticesStride;\n vertices[verticesOffset + count] = points[6];\n vertices[verticesOffset + count + 1] = points[7];\n count += verticesStride;\n vertices[verticesOffset + count] = points[4];\n vertices[verticesOffset + count + 1] = points[5];\n count += verticesStride;\n const verticesIndex = verticesOffset / verticesStride;\n indices[indicesOffset++] = verticesIndex;\n indices[indicesOffset++] = verticesIndex + 1;\n indices[indicesOffset++] = verticesIndex + 2;\n indices[indicesOffset++] = verticesIndex + 1;\n indices[indicesOffset++] = verticesIndex + 3;\n indices[indicesOffset++] = verticesIndex + 2;\n }\n};\n\nexport { buildRectangle };\n//# sourceMappingURL=buildRectangle.mjs.map\n","import { ExtensionType } from '../../../../extensions/Extensions.mjs';\n\n\"use strict\";\nconst buildTriangle = {\n extension: {\n type: ExtensionType.ShapeBuilder,\n name: \"triangle\"\n },\n build(shape, points) {\n points[0] = shape.x;\n points[1] = shape.y;\n points[2] = shape.x2;\n points[3] = shape.y2;\n points[4] = shape.x3;\n points[5] = shape.y3;\n return true;\n },\n triangulate(points, vertices, verticesStride, verticesOffset, indices, indicesOffset) {\n let count = 0;\n verticesOffset *= verticesStride;\n vertices[verticesOffset + count] = points[0];\n vertices[verticesOffset + count + 1] = points[1];\n count += verticesStride;\n vertices[verticesOffset + count] = points[2];\n vertices[verticesOffset + count + 1] = points[3];\n count += verticesStride;\n vertices[verticesOffset + count] = points[4];\n vertices[verticesOffset + count + 1] = points[5];\n const verticesIndex = verticesOffset / verticesStride;\n indices[indicesOffset++] = verticesIndex;\n indices[indicesOffset++] = verticesIndex + 1;\n indices[indicesOffset++] = verticesIndex + 2;\n }\n};\n\nexport { buildTriangle };\n//# sourceMappingURL=buildTriangle.mjs.map\n","import { Color } from '../../../../color/Color.mjs';\nimport { DOMAdapter } from '../../../../environment/adapter.mjs';\nimport { Matrix } from '../../../../maths/matrix/Matrix.mjs';\nimport { ImageSource } from '../../../../rendering/renderers/shared/texture/sources/ImageSource.mjs';\nimport { Texture } from '../../../../rendering/renderers/shared/texture/Texture.mjs';\nimport { uid } from '../../../../utils/data/uid.mjs';\nimport { deprecation } from '../../../../utils/logging/deprecation.mjs';\nimport { definedProps } from '../../../container/utils/definedProps.mjs';\n\n\"use strict\";\nconst emptyColorStops = [{ offset: 0, color: \"white\" }, { offset: 1, color: \"black\" }];\nconst _FillGradient = class _FillGradient {\n constructor(...args) {\n /**\n * Unique identifier for this gradient instance\n * @internal\n */\n this.uid = uid(\"fillGradient\");\n /**\n * Internal tick counter to track changes in the gradient.\n * This is used to invalidate the gradient when the texture changes.\n * @internal\n */\n this._tick = 0;\n /** Type of gradient - currently only supports 'linear' */\n this.type = \"linear\";\n /** Array of color stops defining the gradient */\n this.colorStops = [];\n let options = ensureGradientOptions(args);\n const defaults = options.type === \"radial\" ? _FillGradient.defaultRadialOptions : _FillGradient.defaultLinearOptions;\n options = { ...defaults, ...definedProps(options) };\n this._textureSize = options.textureSize;\n this._wrapMode = options.wrapMode;\n if (options.type === \"radial\") {\n this.center = options.center;\n this.outerCenter = options.outerCenter ?? this.center;\n this.innerRadius = options.innerRadius;\n this.outerRadius = options.outerRadius;\n this.scale = options.scale;\n this.rotation = options.rotation;\n } else {\n this.start = options.start;\n this.end = options.end;\n }\n this.textureSpace = options.textureSpace;\n this.type = options.type;\n options.colorStops.forEach((stop) => {\n this.addColorStop(stop.offset, stop.color);\n });\n }\n /**\n * Adds a color stop to the gradient\n * @param offset - Position of the stop (0-1)\n * @param color - Color of the stop\n * @returns This gradient instance for chaining\n */\n addColorStop(offset, color) {\n this.colorStops.push({ offset, color: Color.shared.setValue(color).toHexa() });\n return this;\n }\n /**\n * Builds the internal texture and transform for the gradient.\n * Called automatically when the gradient is first used.\n * @internal\n */\n buildLinearGradient() {\n if (this.texture) return;\n let { x: x0, y: y0 } = this.start;\n let { x: x1, y: y1 } = this.end;\n let dx = x1 - x0;\n let dy = y1 - y0;\n const flip = dx < 0 || dy < 0;\n if (this._wrapMode === \"clamp-to-edge\") {\n if (dx < 0) {\n const temp = x0;\n x0 = x1;\n x1 = temp;\n dx *= -1;\n }\n if (dy < 0) {\n const temp = y0;\n y0 = y1;\n y1 = temp;\n dy *= -1;\n }\n }\n const colorStops = this.colorStops.length ? this.colorStops : emptyColorStops;\n const defaultSize = this._textureSize;\n const { canvas, context } = getCanvas(defaultSize, 1);\n const gradient = !flip ? context.createLinearGradient(0, 0, this._textureSize, 0) : context.createLinearGradient(this._textureSize, 0, 0, 0);\n addColorStops(gradient, colorStops);\n context.fillStyle = gradient;\n context.fillRect(0, 0, defaultSize, 1);\n this.texture = new Texture({\n source: new ImageSource({\n resource: canvas,\n addressMode: this._wrapMode\n })\n });\n const dist = Math.sqrt(dx * dx + dy * dy);\n const angle = Math.atan2(dy, dx);\n const m = new Matrix();\n m.scale(dist / defaultSize, 1);\n m.rotate(angle);\n m.translate(x0, y0);\n if (this.textureSpace === \"local\") {\n m.scale(defaultSize, defaultSize);\n }\n this.transform = m;\n }\n /**\n * Builds the internal texture and transform for the gradient.\n * Called automatically when the gradient is first used.\n * @internal\n */\n buildGradient() {\n if (!this.texture) this._tick++;\n if (this.type === \"linear\") {\n this.buildLinearGradient();\n } else {\n this.buildRadialGradient();\n }\n }\n /**\n * Builds the internal texture and transform for the radial gradient.\n * Called automatically when the gradient is first used.\n * @internal\n */\n buildRadialGradient() {\n if (this.texture) return;\n const colorStops = this.colorStops.length ? this.colorStops : emptyColorStops;\n const defaultSize = this._textureSize;\n const { canvas, context } = getCanvas(defaultSize, defaultSize);\n const { x: x0, y: y0 } = this.center;\n const { x: x1, y: y1 } = this.outerCenter;\n const r0 = this.innerRadius;\n const r1 = this.outerRadius;\n const ox = x1 - r1;\n const oy = y1 - r1;\n const scale = defaultSize / (r1 * 2);\n const cx = (x0 - ox) * scale;\n const cy = (y0 - oy) * scale;\n const gradient = context.createRadialGradient(\n cx,\n cy,\n r0 * scale,\n (x1 - ox) * scale,\n (y1 - oy) * scale,\n r1 * scale\n );\n addColorStops(gradient, colorStops);\n context.fillStyle = colorStops[colorStops.length - 1].color;\n context.fillRect(0, 0, defaultSize, defaultSize);\n context.fillStyle = gradient;\n context.translate(cx, cy);\n context.rotate(this.rotation);\n context.scale(1, this.scale);\n context.translate(-cx, -cy);\n context.fillRect(0, 0, defaultSize, defaultSize);\n this.texture = new Texture({\n source: new ImageSource({\n resource: canvas,\n addressMode: this._wrapMode\n })\n });\n const m = new Matrix();\n if (this.textureSpace === \"local\") {\n m.scale(2 * r1, 2 * r1);\n } else {\n m.scale(1 / scale, 1 / scale);\n }\n m.translate(ox, oy);\n this.transform = m;\n }\n /** Destroys the gradient, releasing resources. This will also destroy the internal texture. */\n destroy() {\n this.texture?.destroy(true);\n this.texture = null;\n this.transform = null;\n this.colorStops = [];\n this.start = null;\n this.end = null;\n this.center = null;\n this.outerCenter = null;\n }\n /**\n * Returns a unique key for this gradient instance.\n * This key is used for caching and texture management.\n * @returns {string} Unique key for the gradient\n */\n get styleKey() {\n return `fill-gradient-${this.uid}-${this._tick}`;\n }\n};\n/** Default options for creating a gradient fill */\n_FillGradient.defaultLinearOptions = {\n start: { x: 0, y: 0 },\n end: { x: 0, y: 1 },\n colorStops: [],\n textureSpace: \"local\",\n type: \"linear\",\n textureSize: 256,\n wrapMode: \"clamp-to-edge\"\n};\n/** Default options for creating a radial gradient fill */\n_FillGradient.defaultRadialOptions = {\n center: { x: 0.5, y: 0.5 },\n innerRadius: 0,\n outerRadius: 0.5,\n colorStops: [],\n scale: 1,\n rotation: 0,\n textureSpace: \"local\",\n type: \"radial\",\n textureSize: 256,\n wrapMode: \"clamp-to-edge\"\n};\nlet FillGradient = _FillGradient;\nfunction addColorStops(gradient, colorStops) {\n for (let i = 0; i < colorStops.length; i++) {\n const stop = colorStops[i];\n gradient.addColorStop(stop.offset, stop.color);\n }\n}\nfunction getCanvas(width, height) {\n const canvas = DOMAdapter.get().createCanvas(width, height);\n const context = canvas.getContext(\"2d\");\n return { canvas, context };\n}\nfunction ensureGradientOptions(args) {\n let options = args[0] ?? {};\n if (typeof options === \"number\" || args[1]) {\n deprecation(\"8.5.2\", `use options object instead`);\n options = {\n type: \"linear\",\n start: { x: args[0], y: args[1] },\n end: { x: args[2], y: args[3] },\n textureSpace: args[4],\n textureSize: args[5] ?? FillGradient.defaultLinearOptions.textureSize\n };\n }\n return options;\n}\n\nexport { FillGradient };\n//# sourceMappingURL=FillGradient.mjs.map\n","import { Matrix } from '../../../../maths/matrix/Matrix.mjs';\nimport { Rectangle } from '../../../../maths/shapes/Rectangle.mjs';\nimport { FillGradient } from '../fill/FillGradient.mjs';\n\n\"use strict\";\nconst tempTextureMatrix = new Matrix();\nconst tempRect = new Rectangle();\nfunction generateTextureMatrix(out, style, shape, matrix) {\n const textureMatrix = style.matrix ? out.copyFrom(style.matrix).invert() : out.identity();\n if (style.textureSpace === \"local\") {\n const bounds = shape.getBounds(tempRect);\n if (style.width) {\n bounds.pad(style.width);\n }\n const { x: tx, y: ty } = bounds;\n const sx = 1 / bounds.width;\n const sy = 1 / bounds.height;\n const mTx = -tx * sx;\n const mTy = -ty * sy;\n const a1 = textureMatrix.a;\n const b1 = textureMatrix.b;\n const c1 = textureMatrix.c;\n const d1 = textureMatrix.d;\n textureMatrix.a *= sx;\n textureMatrix.b *= sx;\n textureMatrix.c *= sy;\n textureMatrix.d *= sy;\n textureMatrix.tx = mTx * a1 + mTy * c1 + textureMatrix.tx;\n textureMatrix.ty = mTx * b1 + mTy * d1 + textureMatrix.ty;\n } else {\n textureMatrix.translate(style.texture.frame.x, style.texture.frame.y);\n textureMatrix.scale(1 / style.texture.source.width, 1 / style.texture.source.height);\n }\n const sourceStyle = style.texture.source.style;\n if (!(style.fill instanceof FillGradient) && sourceStyle.addressMode === \"clamp-to-edge\") {\n sourceStyle.addressMode = \"repeat\";\n sourceStyle.update();\n }\n if (matrix) {\n textureMatrix.append(tempTextureMatrix.copyFrom(matrix).invert());\n }\n return textureMatrix;\n}\n\nexport { generateTextureMatrix };\n//# sourceMappingURL=generateTextureFillMatrix.mjs.map\n","import { extensions, ExtensionType } from '../../../../extensions/Extensions.mjs';\nimport { Matrix } from '../../../../maths/matrix/Matrix.mjs';\nimport { Rectangle } from '../../../../maths/shapes/Rectangle.mjs';\nimport { buildUvs, buildSimpleUvs } from '../../../../rendering/renderers/shared/geometry/utils/buildUvs.mjs';\nimport { transformVertices } from '../../../../rendering/renderers/shared/geometry/utils/transformVertices.mjs';\nimport { Texture } from '../../../../rendering/renderers/shared/texture/Texture.mjs';\nimport { BigPool } from '../../../../utils/pool/PoolGroup.mjs';\nimport { BatchableGraphics } from '../BatchableGraphics.mjs';\nimport { buildCircle, buildEllipse, buildRoundedRectangle } from '../buildCommands/buildCircle.mjs';\nimport { buildLine } from '../buildCommands/buildLine.mjs';\nimport { buildPixelLine } from '../buildCommands/buildPixelLine.mjs';\nimport { buildPolygon } from '../buildCommands/buildPolygon.mjs';\nimport { buildRectangle } from '../buildCommands/buildRectangle.mjs';\nimport { buildTriangle } from '../buildCommands/buildTriangle.mjs';\nimport { generateTextureMatrix } from './generateTextureFillMatrix.mjs';\nimport { triangulateWithHoles } from './triangulateWithHoles.mjs';\n\n\"use strict\";\nconst shapeBuilders = {};\nextensions.handleByMap(ExtensionType.ShapeBuilder, shapeBuilders);\nextensions.add(buildRectangle, buildPolygon, buildTriangle, buildCircle, buildEllipse, buildRoundedRectangle);\nconst tempRect = new Rectangle();\nconst tempTextureMatrix = new Matrix();\nfunction buildContextBatches(context, gpuContext) {\n const { geometryData, batches } = gpuContext;\n batches.length = 0;\n geometryData.indices.length = 0;\n geometryData.vertices.length = 0;\n geometryData.uvs.length = 0;\n for (let i = 0; i < context.instructions.length; i++) {\n const instruction = context.instructions[i];\n if (instruction.action === \"texture\") {\n addTextureToGeometryData(instruction.data, batches, geometryData);\n } else if (instruction.action === \"fill\" || instruction.action === \"stroke\") {\n const isStroke = instruction.action === \"stroke\";\n const shapePath = instruction.data.path.shapePath;\n const style = instruction.data.style;\n const hole = instruction.data.hole;\n if (isStroke && hole) {\n addShapePathToGeometryData(hole.shapePath, style, true, batches, geometryData);\n }\n if (hole) {\n shapePath.shapePrimitives[shapePath.shapePrimitives.length - 1].holes = hole.shapePath.shapePrimitives;\n }\n addShapePathToGeometryData(shapePath, style, isStroke, batches, geometryData);\n }\n }\n}\nfunction addTextureToGeometryData(data, batches, geometryData) {\n const points = [];\n const build = shapeBuilders.rectangle;\n const rect = tempRect;\n rect.x = data.dx;\n rect.y = data.dy;\n rect.width = data.dw;\n rect.height = data.dh;\n const matrix = data.transform;\n if (!build.build(rect, points)) {\n return;\n }\n const { vertices, uvs, indices } = geometryData;\n const indexOffset = indices.length;\n const vertOffset = vertices.length / 2;\n if (matrix) {\n transformVertices(points, matrix);\n }\n build.triangulate(points, vertices, 2, vertOffset, indices, indexOffset);\n const texture = data.image;\n const textureUvs = texture.uvs;\n uvs.push(\n textureUvs.x0,\n textureUvs.y0,\n textureUvs.x1,\n textureUvs.y1,\n textureUvs.x3,\n textureUvs.y3,\n textureUvs.x2,\n textureUvs.y2\n );\n const graphicsBatch = BigPool.get(BatchableGraphics);\n graphicsBatch.indexOffset = indexOffset;\n graphicsBatch.indexSize = indices.length - indexOffset;\n graphicsBatch.attributeOffset = vertOffset;\n graphicsBatch.attributeSize = vertices.length / 2 - vertOffset;\n graphicsBatch.baseColor = data.style;\n graphicsBatch.alpha = data.alpha;\n graphicsBatch.texture = texture;\n graphicsBatch.geometryData = geometryData;\n batches.push(graphicsBatch);\n}\nfunction addShapePathToGeometryData(shapePath, style, isStroke, batches, geometryData) {\n const { vertices, uvs, indices } = geometryData;\n shapePath.shapePrimitives.forEach(({ shape, transform: matrix, holes }) => {\n const points = [];\n const build = shapeBuilders[shape.type];\n if (!build.build(shape, points)) {\n return;\n }\n const indexOffset = indices.length;\n const vertOffset = vertices.length / 2;\n let topology = \"triangle-list\";\n if (matrix) {\n transformVertices(points, matrix);\n }\n if (!isStroke) {\n if (holes) {\n const holeIndices = [];\n const otherPoints = points.slice();\n const holeArrays = getHoleArrays(holes);\n holeArrays.forEach((holePoints) => {\n holeIndices.push(otherPoints.length / 2);\n otherPoints.push(...holePoints);\n });\n triangulateWithHoles(otherPoints, holeIndices, vertices, 2, vertOffset, indices, indexOffset);\n } else {\n build.triangulate(points, vertices, 2, vertOffset, indices, indexOffset);\n }\n } else {\n const close = shape.closePath ?? true;\n const lineStyle = style;\n if (!lineStyle.pixelLine) {\n buildLine(points, lineStyle, false, close, vertices, indices);\n } else {\n buildPixelLine(points, close, vertices, indices);\n topology = \"line-list\";\n }\n }\n const uvsOffset = uvs.length / 2;\n const texture = style.texture;\n if (texture !== Texture.WHITE) {\n const textureMatrix = generateTextureMatrix(tempTextureMatrix, style, shape, matrix);\n buildUvs(vertices, 2, vertOffset, uvs, uvsOffset, 2, vertices.length / 2 - vertOffset, textureMatrix);\n } else {\n buildSimpleUvs(uvs, uvsOffset, 2, vertices.length / 2 - vertOffset);\n }\n const graphicsBatch = BigPool.get(BatchableGraphics);\n graphicsBatch.indexOffset = indexOffset;\n graphicsBatch.indexSize = indices.length - indexOffset;\n graphicsBatch.attributeOffset = vertOffset;\n graphicsBatch.attributeSize = vertices.length / 2 - vertOffset;\n graphicsBatch.baseColor = style.color;\n graphicsBatch.alpha = style.alpha;\n graphicsBatch.texture = texture;\n graphicsBatch.geometryData = geometryData;\n graphicsBatch.topology = topology;\n batches.push(graphicsBatch);\n });\n}\nfunction getHoleArrays(holePrimitives) {\n const holeArrays = [];\n for (let k = 0; k < holePrimitives.length; k++) {\n const holePrimitive = holePrimitives[k].shape;\n const holePoints = [];\n const holeBuilder = shapeBuilders[holePrimitive.type];\n if (holeBuilder.build(holePrimitive, holePoints)) {\n holeArrays.push(holePoints);\n }\n }\n return holeArrays;\n}\n\nexport { buildContextBatches, shapeBuilders };\n//# sourceMappingURL=buildContextBatches.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { getTextureBatchBindGroup } from '../../../rendering/batcher/gpu/getTextureBatchBindGroup.mjs';\nimport { DefaultBatcher } from '../../../rendering/batcher/shared/DefaultBatcher.mjs';\nimport { InstructionSet } from '../../../rendering/renderers/shared/instructions/InstructionSet.mjs';\nimport { GCManagedHash } from '../../../utils/data/GCManagedHash.mjs';\nimport { deprecation, v8_3_4 } from '../../../utils/logging/deprecation.mjs';\nimport { BigPool } from '../../../utils/pool/PoolGroup.mjs';\nimport { buildContextBatches } from './utils/buildContextBatches.mjs';\n\n\"use strict\";\nclass GpuGraphicsContext {\n constructor() {\n this.batches = [];\n this.geometryData = {\n vertices: [],\n uvs: [],\n indices: []\n };\n }\n reset() {\n if (this.batches) {\n this.batches.forEach((batch) => {\n BigPool.return(batch);\n });\n }\n if (this.graphicsData) {\n BigPool.return(this.graphicsData);\n }\n this.isBatchable = false;\n this.context = null;\n this.batches.length = 0;\n this.geometryData.indices.length = 0;\n this.geometryData.vertices.length = 0;\n this.geometryData.uvs.length = 0;\n this.graphicsData = null;\n }\n destroy() {\n this.reset();\n this.batches = null;\n this.geometryData = null;\n }\n}\nclass GraphicsContextRenderData {\n constructor() {\n this.instructions = new InstructionSet();\n }\n init(options) {\n const maxTextures = options.maxTextures;\n this.batcher ? this.batcher._updateMaxTextures(maxTextures) : this.batcher = new DefaultBatcher({ maxTextures });\n this.instructions.reset();\n }\n /**\n * @deprecated since version 8.0.0\n * Use `batcher.geometry` instead.\n * @see {Batcher#geometry}\n */\n get geometry() {\n deprecation(v8_3_4, \"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead.\");\n return this.batcher.geometry;\n }\n destroy() {\n this.batcher.destroy();\n this.instructions.destroy();\n this.batcher = null;\n this.instructions = null;\n }\n}\nconst _GraphicsContextSystem = class _GraphicsContextSystem {\n constructor(renderer) {\n this._renderer = renderer;\n this._managedContexts = new GCManagedHash({ renderer, type: \"resource\", name: \"graphicsContext\" });\n }\n /**\n * Runner init called, update the default options\n * @ignore\n */\n init(options) {\n _GraphicsContextSystem.defaultOptions.bezierSmoothness = options?.bezierSmoothness ?? _GraphicsContextSystem.defaultOptions.bezierSmoothness;\n }\n /**\n * Returns the render data for a given GraphicsContext.\n * @param context - The GraphicsContext to get the render data for.\n * @internal\n */\n getContextRenderData(context) {\n return context._gpuData[this._renderer.uid].graphicsData || this._initContextRenderData(context);\n }\n /**\n * Updates the GPU context for a given GraphicsContext.\n * If the context is dirty, it will rebuild the batches and geometry data.\n * @param context - The GraphicsContext to update.\n * @returns The updated GpuGraphicsContext.\n * @internal\n */\n updateGpuContext(context) {\n const hasContext = !!context._gpuData[this._renderer.uid];\n const gpuContext = context._gpuData[this._renderer.uid] || this._initContext(context);\n if (context.dirty || !hasContext) {\n if (hasContext) {\n gpuContext.reset();\n }\n buildContextBatches(context, gpuContext);\n const batchMode = context.batchMode;\n if (context.customShader || batchMode === \"no-batch\") {\n gpuContext.isBatchable = false;\n } else if (batchMode === \"auto\") {\n gpuContext.isBatchable = gpuContext.geometryData.vertices.length < 400;\n } else {\n gpuContext.isBatchable = true;\n }\n context.dirty = false;\n }\n return gpuContext;\n }\n /**\n * Returns the GpuGraphicsContext for a given GraphicsContext.\n * If it does not exist, it will initialize a new one.\n * @param context - The GraphicsContext to get the GpuGraphicsContext for.\n * @returns The GpuGraphicsContext for the given GraphicsContext.\n * @internal\n */\n getGpuContext(context) {\n return context._gpuData[this._renderer.uid] || this._initContext(context);\n }\n _initContextRenderData(context) {\n const graphicsData = BigPool.get(GraphicsContextRenderData, {\n maxTextures: this._renderer.limits.maxBatchableTextures\n });\n const gpuContext = context._gpuData[this._renderer.uid];\n const { batches, geometryData } = gpuContext;\n gpuContext.graphicsData = graphicsData;\n const vertexSize = geometryData.vertices.length;\n const indexSize = geometryData.indices.length;\n for (let i = 0; i < batches.length; i++) {\n batches[i].applyTransform = false;\n }\n const batcher = graphicsData.batcher;\n batcher.ensureAttributeBuffer(vertexSize);\n batcher.ensureIndexBuffer(indexSize);\n batcher.begin();\n for (let i = 0; i < batches.length; i++) {\n const batch = batches[i];\n batcher.add(batch);\n }\n batcher.finish(graphicsData.instructions);\n const geometry = batcher.geometry;\n geometry.indexBuffer.setDataWithSize(batcher.indexBuffer, batcher.indexSize, true);\n geometry.buffers[0].setDataWithSize(batcher.attributeBuffer.float32View, batcher.attributeSize, true);\n const drawBatches = batcher.batches;\n for (let i = 0; i < drawBatches.length; i++) {\n const batch = drawBatches[i];\n batch.bindGroup = getTextureBatchBindGroup(\n batch.textures.textures,\n batch.textures.count,\n this._renderer.limits.maxBatchableTextures\n );\n }\n return graphicsData;\n }\n _initContext(context) {\n const gpuContext = new GpuGraphicsContext();\n gpuContext.context = context;\n context._gpuData[this._renderer.uid] = gpuContext;\n this._managedContexts.add(context);\n return gpuContext;\n }\n destroy() {\n this._managedContexts.destroy();\n this._renderer = null;\n }\n};\n/** @ignore */\n_GraphicsContextSystem.extension = {\n type: [\n ExtensionType.WebGLSystem,\n ExtensionType.WebGPUSystem\n ],\n name: \"graphicsContext\"\n};\n/** The default options for the GraphicsContextSystem. */\n_GraphicsContextSystem.defaultOptions = {\n /**\n * A value from 0 to 1 that controls the smoothness of bezier curves (the higher the smoother)\n * @default 0.5\n */\n bezierSmoothness: 0.5\n};\nlet GraphicsContextSystem = _GraphicsContextSystem;\n\nexport { GpuGraphicsContext, GraphicsContextRenderData, GraphicsContextSystem };\n//# sourceMappingURL=GraphicsContextSystem.mjs.map\n","import { GraphicsContextSystem } from '../GraphicsContextSystem.mjs';\n\n\"use strict\";\nconst RECURSION_LIMIT = 8;\nconst FLT_EPSILON = 11920929e-14;\nconst PATH_DISTANCE_EPSILON = 1;\nconst curveAngleToleranceEpsilon = 0.01;\nconst mAngleTolerance = 0;\nconst mCuspLimit = 0;\nfunction buildAdaptiveBezier(points, sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, smoothness) {\n const scale = 1;\n const smoothing = Math.min(\n 0.99,\n // a value of 1.0 actually inverts smoothing, so we cap it at 0.99\n Math.max(0, smoothness ?? GraphicsContextSystem.defaultOptions.bezierSmoothness)\n );\n let distanceTolerance = (PATH_DISTANCE_EPSILON - smoothing) / scale;\n distanceTolerance *= distanceTolerance;\n begin(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance);\n return points;\n}\nfunction begin(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance) {\n recursive(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance, 0);\n points.push(eX, eY);\n}\nfunction recursive(x1, y1, x2, y2, x3, y3, x4, y4, points, distanceTolerance, level) {\n if (level > RECURSION_LIMIT) {\n return;\n }\n const pi = Math.PI;\n const x12 = (x1 + x2) / 2;\n const y12 = (y1 + y2) / 2;\n const x23 = (x2 + x3) / 2;\n const y23 = (y2 + y3) / 2;\n const x34 = (x3 + x4) / 2;\n const y34 = (y3 + y4) / 2;\n const x123 = (x12 + x23) / 2;\n const y123 = (y12 + y23) / 2;\n const x234 = (x23 + x34) / 2;\n const y234 = (y23 + y34) / 2;\n const x1234 = (x123 + x234) / 2;\n const y1234 = (y123 + y234) / 2;\n if (level > 0) {\n let dx = x4 - x1;\n let dy = y4 - y1;\n const d2 = Math.abs((x2 - x4) * dy - (y2 - y4) * dx);\n const d3 = Math.abs((x3 - x4) * dy - (y3 - y4) * dx);\n let da1;\n let da2;\n if (d2 > FLT_EPSILON && d3 > FLT_EPSILON) {\n if ((d2 + d3) * (d2 + d3) <= distanceTolerance * (dx * dx + dy * dy)) {\n if (mAngleTolerance < curveAngleToleranceEpsilon) {\n points.push(x1234, y1234);\n return;\n }\n const a23 = Math.atan2(y3 - y2, x3 - x2);\n da1 = Math.abs(a23 - Math.atan2(y2 - y1, x2 - x1));\n da2 = Math.abs(Math.atan2(y4 - y3, x4 - x3) - a23);\n if (da1 >= pi) da1 = 2 * pi - da1;\n if (da2 >= pi) da2 = 2 * pi - da2;\n if (da1 + da2 < mAngleTolerance) {\n points.push(x1234, y1234);\n return;\n }\n if (mCuspLimit !== 0) {\n if (da1 > mCuspLimit) {\n points.push(x2, y2);\n return;\n }\n if (da2 > mCuspLimit) {\n points.push(x3, y3);\n return;\n }\n }\n }\n } else if (d2 > FLT_EPSILON) {\n if (d2 * d2 <= distanceTolerance * (dx * dx + dy * dy)) {\n if (mAngleTolerance < curveAngleToleranceEpsilon) {\n points.push(x1234, y1234);\n return;\n }\n da1 = Math.abs(Math.atan2(y3 - y2, x3 - x2) - Math.atan2(y2 - y1, x2 - x1));\n if (da1 >= pi) da1 = 2 * pi - da1;\n if (da1 < mAngleTolerance) {\n points.push(x2, y2);\n points.push(x3, y3);\n return;\n }\n if (mCuspLimit !== 0) {\n if (da1 > mCuspLimit) {\n points.push(x2, y2);\n return;\n }\n }\n }\n } else if (d3 > FLT_EPSILON) {\n if (d3 * d3 <= distanceTolerance * (dx * dx + dy * dy)) {\n if (mAngleTolerance < curveAngleToleranceEpsilon) {\n points.push(x1234, y1234);\n return;\n }\n da1 = Math.abs(Math.atan2(y4 - y3, x4 - x3) - Math.atan2(y3 - y2, x3 - x2));\n if (da1 >= pi) da1 = 2 * pi - da1;\n if (da1 < mAngleTolerance) {\n points.push(x2, y2);\n points.push(x3, y3);\n return;\n }\n if (mCuspLimit !== 0) {\n if (da1 > mCuspLimit) {\n points.push(x3, y3);\n return;\n }\n }\n }\n } else {\n dx = x1234 - (x1 + x4) / 2;\n dy = y1234 - (y1 + y4) / 2;\n if (dx * dx + dy * dy <= distanceTolerance) {\n points.push(x1234, y1234);\n return;\n }\n }\n }\n recursive(x1, y1, x12, y12, x123, y123, x1234, y1234, points, distanceTolerance, level + 1);\n recursive(x1234, y1234, x234, y234, x34, y34, x4, y4, points, distanceTolerance, level + 1);\n}\n\nexport { buildAdaptiveBezier };\n//# sourceMappingURL=buildAdaptiveBezier.mjs.map\n","import { GraphicsContextSystem } from '../GraphicsContextSystem.mjs';\n\n\"use strict\";\nconst RECURSION_LIMIT = 8;\nconst FLT_EPSILON = 11920929e-14;\nconst PATH_DISTANCE_EPSILON = 1;\nconst curveAngleToleranceEpsilon = 0.01;\nconst mAngleTolerance = 0;\nfunction buildAdaptiveQuadratic(points, sX, sY, cp1x, cp1y, eX, eY, smoothness) {\n const scale = 1;\n const smoothing = Math.min(\n 0.99,\n // a value of 1.0 actually inverts smoothing, so we cap it at 0.99\n Math.max(0, smoothness ?? GraphicsContextSystem.defaultOptions.bezierSmoothness)\n );\n let distanceTolerance = (PATH_DISTANCE_EPSILON - smoothing) / scale;\n distanceTolerance *= distanceTolerance;\n begin(sX, sY, cp1x, cp1y, eX, eY, points, distanceTolerance);\n return points;\n}\nfunction begin(sX, sY, cp1x, cp1y, eX, eY, points, distanceTolerance) {\n recursive(points, sX, sY, cp1x, cp1y, eX, eY, distanceTolerance, 0);\n points.push(eX, eY);\n}\nfunction recursive(points, x1, y1, x2, y2, x3, y3, distanceTolerance, level) {\n if (level > RECURSION_LIMIT) {\n return;\n }\n const pi = Math.PI;\n const x12 = (x1 + x2) / 2;\n const y12 = (y1 + y2) / 2;\n const x23 = (x2 + x3) / 2;\n const y23 = (y2 + y3) / 2;\n const x123 = (x12 + x23) / 2;\n const y123 = (y12 + y23) / 2;\n let dx = x3 - x1;\n let dy = y3 - y1;\n const d = Math.abs((x2 - x3) * dy - (y2 - y3) * dx);\n if (d > FLT_EPSILON) {\n if (d * d <= distanceTolerance * (dx * dx + dy * dy)) {\n if (mAngleTolerance < curveAngleToleranceEpsilon) {\n points.push(x123, y123);\n return;\n }\n let da = Math.abs(Math.atan2(y3 - y2, x3 - x2) - Math.atan2(y2 - y1, x2 - x1));\n if (da >= pi) da = 2 * pi - da;\n if (da < mAngleTolerance) {\n points.push(x123, y123);\n return;\n }\n }\n } else {\n dx = x123 - (x1 + x3) / 2;\n dy = y123 - (y1 + y3) / 2;\n if (dx * dx + dy * dy <= distanceTolerance) {\n points.push(x123, y123);\n return;\n }\n }\n recursive(points, x1, y1, x12, y12, x123, y123, distanceTolerance, level + 1);\n recursive(points, x123, y123, x23, y23, x3, y3, distanceTolerance, level + 1);\n}\n\nexport { buildAdaptiveQuadratic };\n//# sourceMappingURL=buildAdaptiveQuadratic.mjs.map\n","\"use strict\";\nfunction buildArc(points, x, y, radius, start, end, clockwise, steps) {\n let dist = Math.abs(start - end);\n if (!clockwise && start > end) {\n dist = 2 * Math.PI - dist;\n } else if (clockwise && end > start) {\n dist = 2 * Math.PI - dist;\n }\n steps || (steps = Math.max(6, Math.floor(6 * Math.pow(radius, 1 / 3) * (dist / Math.PI))));\n steps = Math.max(steps, 3);\n let f = dist / steps;\n let t = start;\n f *= clockwise ? -1 : 1;\n for (let i = 0; i < steps + 1; i++) {\n const cs = Math.cos(t);\n const sn = Math.sin(t);\n const nx = x + cs * radius;\n const ny = y + sn * radius;\n points.push(nx, ny);\n t += f;\n }\n}\n\nexport { buildArc };\n//# sourceMappingURL=buildArc.mjs.map\n","import { buildArc } from './buildArc.mjs';\n\n\"use strict\";\nfunction buildArcTo(points, x1, y1, x2, y2, radius) {\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\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 if (mm < 1e-8 || radius === 0) {\n if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) {\n points.push(x1, y1);\n }\n return;\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 buildArc(\n points,\n cx + x1,\n cy + y1,\n radius,\n startAngle,\n endAngle,\n b1 * a2 > b2 * a1\n );\n}\n\nexport { buildArcTo };\n//# sourceMappingURL=buildArcTo.mjs.map\n","import { buildAdaptiveBezier } from './buildAdaptiveBezier.mjs';\n\n\"use strict\";\nconst TAU = Math.PI * 2;\nconst out = {\n centerX: 0,\n centerY: 0,\n ang1: 0,\n ang2: 0\n};\nconst mapToEllipse = ({ x, y }, rx, ry, cosPhi, sinPhi, centerX, centerY, out2) => {\n x *= rx;\n y *= ry;\n const xp = cosPhi * x - sinPhi * y;\n const yp = sinPhi * x + cosPhi * y;\n out2.x = xp + centerX;\n out2.y = yp + centerY;\n return out2;\n};\nfunction approxUnitArc(ang1, ang2) {\n const a1 = ang2 === -1.5707963267948966 ? -0.551915024494 : 4 / 3 * Math.tan(ang2 / 4);\n const a = ang2 === 1.5707963267948966 ? 0.551915024494 : a1;\n const x1 = Math.cos(ang1);\n const y1 = Math.sin(ang1);\n const x2 = Math.cos(ang1 + ang2);\n const y2 = Math.sin(ang1 + ang2);\n return [\n {\n x: x1 - y1 * a,\n y: y1 + x1 * a\n },\n {\n x: x2 + y2 * a,\n y: y2 - x2 * a\n },\n {\n x: x2,\n y: y2\n }\n ];\n}\nconst vectorAngle = (ux, uy, vx, vy) => {\n const sign = ux * vy - uy * vx < 0 ? -1 : 1;\n let dot = ux * vx + uy * vy;\n if (dot > 1) {\n dot = 1;\n }\n if (dot < -1) {\n dot = -1;\n }\n return sign * Math.acos(dot);\n};\nconst getArcCenter = (px, py, cx, cy, rx, ry, largeArcFlag, sweepFlag, sinPhi, cosPhi, pxp, pyp, out2) => {\n const rxSq = Math.pow(rx, 2);\n const rySq = Math.pow(ry, 2);\n const pxpSq = Math.pow(pxp, 2);\n const pypSq = Math.pow(pyp, 2);\n let radicant = rxSq * rySq - rxSq * pypSq - rySq * pxpSq;\n if (radicant < 0) {\n radicant = 0;\n }\n radicant /= rxSq * pypSq + rySq * pxpSq;\n radicant = Math.sqrt(radicant) * (largeArcFlag === sweepFlag ? -1 : 1);\n const centerXp = radicant * rx / ry * pyp;\n const centerYp = radicant * -ry / rx * pxp;\n const centerX = cosPhi * centerXp - sinPhi * centerYp + (px + cx) / 2;\n const centerY = sinPhi * centerXp + cosPhi * centerYp + (py + cy) / 2;\n const vx1 = (pxp - centerXp) / rx;\n const vy1 = (pyp - centerYp) / ry;\n const vx2 = (-pxp - centerXp) / rx;\n const vy2 = (-pyp - centerYp) / ry;\n const ang1 = vectorAngle(1, 0, vx1, vy1);\n let ang2 = vectorAngle(vx1, vy1, vx2, vy2);\n if (sweepFlag === 0 && ang2 > 0) {\n ang2 -= TAU;\n }\n if (sweepFlag === 1 && ang2 < 0) {\n ang2 += TAU;\n }\n out2.centerX = centerX;\n out2.centerY = centerY;\n out2.ang1 = ang1;\n out2.ang2 = ang2;\n};\nfunction buildArcToSvg(points, px, py, cx, cy, rx, ry, xAxisRotation = 0, largeArcFlag = 0, sweepFlag = 0) {\n if (rx === 0 || ry === 0) {\n return;\n }\n const sinPhi = Math.sin(xAxisRotation * TAU / 360);\n const cosPhi = Math.cos(xAxisRotation * TAU / 360);\n const pxp = cosPhi * (px - cx) / 2 + sinPhi * (py - cy) / 2;\n const pyp = -sinPhi * (px - cx) / 2 + cosPhi * (py - cy) / 2;\n if (pxp === 0 && pyp === 0) {\n return;\n }\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n const lambda = Math.pow(pxp, 2) / Math.pow(rx, 2) + Math.pow(pyp, 2) / Math.pow(ry, 2);\n if (lambda > 1) {\n rx *= Math.sqrt(lambda);\n ry *= Math.sqrt(lambda);\n }\n getArcCenter(\n px,\n py,\n cx,\n cy,\n rx,\n ry,\n largeArcFlag,\n sweepFlag,\n sinPhi,\n cosPhi,\n pxp,\n pyp,\n out\n );\n let { ang1, ang2 } = out;\n const { centerX, centerY } = out;\n let ratio = Math.abs(ang2) / (TAU / 4);\n if (Math.abs(1 - ratio) < 1e-7) {\n ratio = 1;\n }\n const segments = Math.max(Math.ceil(ratio), 1);\n ang2 /= segments;\n let lastX = points[points.length - 2];\n let lastY = points[points.length - 1];\n const outCurvePoint = { x: 0, y: 0 };\n for (let i = 0; i < segments; i++) {\n const curve = approxUnitArc(ang1, ang2);\n const { x: x1, y: y1 } = mapToEllipse(curve[0], rx, ry, cosPhi, sinPhi, centerX, centerY, outCurvePoint);\n const { x: x2, y: y2 } = mapToEllipse(curve[1], rx, ry, cosPhi, sinPhi, centerX, centerY, outCurvePoint);\n const { x, y } = mapToEllipse(curve[2], rx, ry, cosPhi, sinPhi, centerX, centerY, outCurvePoint);\n buildAdaptiveBezier(\n points,\n lastX,\n lastY,\n x1,\n y1,\n x2,\n y2,\n x,\n y\n );\n lastX = x;\n lastY = y;\n ang1 += ang2;\n }\n}\n\nexport { buildArcToSvg };\n//# sourceMappingURL=buildArcToSvg.mjs.map\n","\"use strict\";\nfunction roundedShapeArc(g, points, radius) {\n const vecFrom = (p, pp) => {\n const x = pp.x - p.x;\n const y = pp.y - p.y;\n const len = Math.sqrt(x * x + y * y);\n const nx = x / len;\n const ny = y / len;\n return { len, nx, ny };\n };\n const sharpCorner = (i, p) => {\n if (i === 0) {\n g.moveTo(p.x, p.y);\n } else {\n g.lineTo(p.x, p.y);\n }\n };\n let p1 = points[points.length - 1];\n for (let i = 0; i < points.length; i++) {\n const p2 = points[i % points.length];\n const pRadius = p2.radius ?? radius;\n if (pRadius <= 0) {\n sharpCorner(i, p2);\n p1 = p2;\n continue;\n }\n const p3 = points[(i + 1) % points.length];\n const v1 = vecFrom(p2, p1);\n const v2 = vecFrom(p2, p3);\n if (v1.len < 1e-4 || v2.len < 1e-4) {\n sharpCorner(i, p2);\n p1 = p2;\n continue;\n }\n let angle = Math.asin(v1.nx * v2.ny - v1.ny * v2.nx);\n let radDirection = 1;\n let drawDirection = false;\n if (v1.nx * v2.nx - v1.ny * -v2.ny < 0) {\n if (angle < 0) {\n angle = Math.PI + angle;\n } else {\n angle = Math.PI - angle;\n radDirection = -1;\n drawDirection = true;\n }\n } else if (angle > 0) {\n radDirection = -1;\n drawDirection = true;\n }\n const halfAngle = angle / 2;\n let cRadius;\n let lenOut = Math.abs(\n Math.cos(halfAngle) * pRadius / Math.sin(halfAngle)\n );\n if (lenOut > Math.min(v1.len / 2, v2.len / 2)) {\n lenOut = Math.min(v1.len / 2, v2.len / 2);\n cRadius = Math.abs(lenOut * Math.sin(halfAngle) / Math.cos(halfAngle));\n } else {\n cRadius = pRadius;\n }\n const cX = p2.x + v2.nx * lenOut + -v2.ny * cRadius * radDirection;\n const cY = p2.y + v2.ny * lenOut + v2.nx * cRadius * radDirection;\n const startAngle = Math.atan2(v1.ny, v1.nx) + Math.PI / 2 * radDirection;\n const endAngle = Math.atan2(v2.ny, v2.nx) - Math.PI / 2 * radDirection;\n if (i === 0) {\n g.moveTo(\n cX + Math.cos(startAngle) * cRadius,\n cY + Math.sin(startAngle) * cRadius\n );\n }\n g.arc(cX, cY, cRadius, startAngle, endAngle, drawDirection);\n p1 = p2;\n }\n}\nfunction roundedShapeQuadraticCurve(g, points, radius, smoothness) {\n const distance = (p1, p2) => Math.sqrt((p1.x - p2.x) ** 2 + (p1.y - p2.y) ** 2);\n const pointLerp = (p1, p2, t) => ({\n x: p1.x + (p2.x - p1.x) * t,\n y: p1.y + (p2.y - p1.y) * t\n });\n const numPoints = points.length;\n for (let i = 0; i < numPoints; i++) {\n const thisPoint = points[(i + 1) % numPoints];\n const pRadius = thisPoint.radius ?? radius;\n if (pRadius <= 0) {\n if (i === 0) {\n g.moveTo(thisPoint.x, thisPoint.y);\n } else {\n g.lineTo(thisPoint.x, thisPoint.y);\n }\n continue;\n }\n const lastPoint = points[i];\n const nextPoint = points[(i + 2) % numPoints];\n const lastEdgeLength = distance(lastPoint, thisPoint);\n let start;\n if (lastEdgeLength < 1e-4) {\n start = thisPoint;\n } else {\n const lastOffsetDistance = Math.min(lastEdgeLength / 2, pRadius);\n start = pointLerp(\n thisPoint,\n lastPoint,\n lastOffsetDistance / lastEdgeLength\n );\n }\n const nextEdgeLength = distance(nextPoint, thisPoint);\n let end;\n if (nextEdgeLength < 1e-4) {\n end = thisPoint;\n } else {\n const nextOffsetDistance = Math.min(nextEdgeLength / 2, pRadius);\n end = pointLerp(\n thisPoint,\n nextPoint,\n nextOffsetDistance / nextEdgeLength\n );\n }\n if (i === 0) {\n g.moveTo(start.x, start.y);\n } else {\n g.lineTo(start.x, start.y);\n }\n g.quadraticCurveTo(thisPoint.x, thisPoint.y, end.x, end.y, smoothness);\n }\n}\n\nexport { roundedShapeArc, roundedShapeQuadraticCurve };\n//# sourceMappingURL=roundShape.mjs.map\n","import { Circle } from '../../../../maths/shapes/Circle.mjs';\nimport { Ellipse } from '../../../../maths/shapes/Ellipse.mjs';\nimport { Polygon } from '../../../../maths/shapes/Polygon.mjs';\nimport { Rectangle } from '../../../../maths/shapes/Rectangle.mjs';\nimport { RoundedRectangle } from '../../../../maths/shapes/RoundedRectangle.mjs';\nimport { Bounds } from '../../../container/bounds/Bounds.mjs';\nimport { buildAdaptiveBezier } from '../buildCommands/buildAdaptiveBezier.mjs';\nimport { buildAdaptiveQuadratic } from '../buildCommands/buildAdaptiveQuadratic.mjs';\nimport { buildArc } from '../buildCommands/buildArc.mjs';\nimport { buildArcTo } from '../buildCommands/buildArcTo.mjs';\nimport { buildArcToSvg } from '../buildCommands/buildArcToSvg.mjs';\nimport { roundedShapeQuadraticCurve, roundedShapeArc } from './roundShape.mjs';\n\n\"use strict\";\nconst tempRectangle = new Rectangle();\nclass ShapePath {\n constructor(graphicsPath2D) {\n /** The list of shape primitives that make up the path. */\n this.shapePrimitives = [];\n this._currentPoly = null;\n this._bounds = new Bounds();\n this._graphicsPath2D = graphicsPath2D;\n this.signed = graphicsPath2D.checkForHoles;\n }\n /**\n * Sets the starting point for a new sub-path. Any subsequent drawing commands are considered part of this path.\n * @param x - The x-coordinate for the starting point.\n * @param y - The y-coordinate for the starting point.\n * @returns The instance of the current object for chaining.\n */\n moveTo(x, y) {\n this.startPoly(x, y);\n return this;\n }\n /**\n * Connects the current point to a new point with a straight line. This method updates the current path.\n * @param x - The x-coordinate of the new point to connect to.\n * @param y - The y-coordinate of the new point to connect to.\n * @returns The instance of the current object for chaining.\n */\n lineTo(x, y) {\n this._ensurePoly();\n const points = this._currentPoly.points;\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\n if (fromX !== x || fromY !== y) {\n points.push(x, y);\n }\n return this;\n }\n /**\n * Adds an arc to the path. The arc is centered at (x, y)\n * position with radius `radius` starting at `startAngle` and ending at `endAngle`.\n * @param x - The x-coordinate of the arc's center.\n * @param y - The y-coordinate of the arc's center.\n * @param radius - The radius of the arc.\n * @param startAngle - The starting angle of the arc, in radians.\n * @param endAngle - The ending angle of the arc, in radians.\n * @param counterclockwise - Specifies whether the arc should be drawn in the anticlockwise direction. False by default.\n * @returns The instance of the current object for chaining.\n */\n arc(x, y, radius, startAngle, endAngle, counterclockwise) {\n this._ensurePoly(false);\n const points = this._currentPoly.points;\n buildArc(points, x, y, radius, startAngle, endAngle, counterclockwise);\n return this;\n }\n /**\n * Adds an arc to the path with the arc tangent to the line joining two specified points.\n * The arc radius is specified by `radius`.\n * @param x1 - The x-coordinate of the first point.\n * @param y1 - The y-coordinate of the first point.\n * @param x2 - The x-coordinate of the second point.\n * @param y2 - The y-coordinate of the second point.\n * @param radius - The radius of the arc.\n * @returns The instance of the current object for chaining.\n */\n arcTo(x1, y1, x2, y2, radius) {\n this._ensurePoly();\n const points = this._currentPoly.points;\n buildArcTo(points, x1, y1, x2, y2, radius);\n return this;\n }\n /**\n * Adds an SVG-style arc to the path, allowing for elliptical arcs based on the SVG spec.\n * @param rx - The x-radius of the ellipse.\n * @param ry - The y-radius of the ellipse.\n * @param xAxisRotation - The rotation of the ellipse's x-axis relative\n * to the x-axis of the coordinate system, in degrees.\n * @param largeArcFlag - Determines if the arc should be greater than or less than 180 degrees.\n * @param sweepFlag - Determines if the arc should be swept in a positive angle direction.\n * @param x - The x-coordinate of the arc's end point.\n * @param y - The y-coordinate of the arc's end point.\n * @returns The instance of the current object for chaining.\n */\n arcToSvg(rx, ry, xAxisRotation, largeArcFlag, sweepFlag, x, y) {\n const points = this._currentPoly.points;\n buildArcToSvg(\n points,\n this._currentPoly.lastX,\n this._currentPoly.lastY,\n x,\n y,\n rx,\n ry,\n xAxisRotation,\n largeArcFlag,\n sweepFlag\n );\n return this;\n }\n /**\n * Adds a cubic Bezier curve to the path.\n * It requires three points: the first two are control points and the third one is the end point.\n * The starting point is the last point in the current path.\n * @param cp1x - The x-coordinate of the first control point.\n * @param cp1y - The y-coordinate of the first control point.\n * @param cp2x - The x-coordinate of the second control point.\n * @param cp2y - The y-coordinate of the second control point.\n * @param x - The x-coordinate of the end point.\n * @param y - The y-coordinate of the end point.\n * @param smoothness - Optional parameter to adjust the smoothness of the curve.\n * @returns The instance of the current object for chaining.\n */\n bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, smoothness) {\n this._ensurePoly();\n const currentPoly = this._currentPoly;\n buildAdaptiveBezier(\n this._currentPoly.points,\n currentPoly.lastX,\n currentPoly.lastY,\n cp1x,\n cp1y,\n cp2x,\n cp2y,\n x,\n y,\n smoothness\n );\n return this;\n }\n /**\n * Adds a quadratic curve to the path. It requires two points: the control point and the end point.\n * The starting point is the last point in the current path.\n * @param cp1x - The x-coordinate of the control point.\n * @param cp1y - The y-coordinate of the control point.\n * @param x - The x-coordinate of the end point.\n * @param y - The y-coordinate of the end point.\n * @param smoothing - Optional parameter to adjust the smoothness of the curve.\n * @returns The instance of the current object for chaining.\n */\n quadraticCurveTo(cp1x, cp1y, x, y, smoothing) {\n this._ensurePoly();\n const currentPoly = this._currentPoly;\n buildAdaptiveQuadratic(\n this._currentPoly.points,\n currentPoly.lastX,\n currentPoly.lastY,\n cp1x,\n cp1y,\n x,\n y,\n smoothing\n );\n return this;\n }\n /**\n * Closes the current path by drawing a straight line back to the start.\n * If the shape is already closed or there are no points in the path, this method does nothing.\n * @returns The instance of the current object for chaining.\n */\n closePath() {\n this.endPoly(true);\n return this;\n }\n /**\n * Adds another path to the current path. This method allows for the combination of multiple paths into one.\n * @param path - The `GraphicsPath` object representing the path to add.\n * @param transform - An optional `Matrix` object to apply a transformation to the path before adding it.\n * @returns The instance of the current object for chaining.\n */\n addPath(path, transform) {\n this.endPoly();\n if (transform && !transform.isIdentity()) {\n path = path.clone(true);\n path.transform(transform);\n }\n const shapePrimitives = this.shapePrimitives;\n const start = shapePrimitives.length;\n for (let i = 0; i < path.instructions.length; i++) {\n const instruction = path.instructions[i];\n this[instruction.action](...instruction.data);\n }\n if (path.checkForHoles && shapePrimitives.length - start > 1) {\n let mainShape = null;\n for (let i = start; i < shapePrimitives.length; i++) {\n const shapePrimitive = shapePrimitives[i];\n if (shapePrimitive.shape.type === \"polygon\") {\n const polygon = shapePrimitive.shape;\n const mainPolygon = mainShape?.shape;\n if (mainPolygon && mainPolygon.containsPolygon(polygon)) {\n mainShape.holes || (mainShape.holes = []);\n mainShape.holes.push(shapePrimitive);\n shapePrimitives.copyWithin(i, i + 1);\n shapePrimitives.length--;\n i--;\n } else {\n mainShape = shapePrimitive;\n }\n }\n }\n }\n return this;\n }\n /**\n * Finalizes the drawing of the current path. Optionally, it can close the path.\n * @param closePath - A boolean indicating whether to close the path after finishing. False by default.\n */\n finish(closePath = false) {\n this.endPoly(closePath);\n }\n /**\n * Draws a rectangle shape. This method adds a new rectangle path to the current drawing.\n * @param x - The x-coordinate of the top-left corner of the rectangle.\n * @param y - The y-coordinate of the top-left corner of the rectangle.\n * @param w - The width of the rectangle.\n * @param h - The height of the rectangle.\n * @param transform - An optional `Matrix` object to apply a transformation to the rectangle.\n * @returns The instance of the current object for chaining.\n */\n rect(x, y, w, h, transform) {\n this.drawShape(new Rectangle(x, y, w, h), transform);\n return this;\n }\n /**\n * Draws a circle shape. This method adds a new circle path to the current drawing.\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 * @param transform - An optional `Matrix` object to apply a transformation to the circle.\n * @returns The instance of the current object for chaining.\n */\n circle(x, y, radius, transform) {\n this.drawShape(new Circle(x, y, radius), transform);\n return this;\n }\n /**\n * Draws a polygon shape. This method allows for the creation of complex polygons by specifying a sequence of points.\n * @param points - An array of numbers, or or an array of PointData objects eg [{x,y}, {x,y}, {x,y}]\n * representing the x and y coordinates of the polygon's vertices, in sequence.\n * @param close - A boolean indicating whether to close the polygon path. True by default.\n * @param transform - An optional `Matrix` object to apply a transformation to the polygon.\n * @returns The instance of the current object for chaining.\n */\n poly(points, close, transform) {\n const polygon = new Polygon(points);\n polygon.closePath = close;\n this.drawShape(polygon, transform);\n return this;\n }\n /**\n * Draws a regular polygon with a specified number of sides. All sides and angles are equal.\n * @param x - The x-coordinate of the center of the polygon.\n * @param y - The y-coordinate of the center of the polygon.\n * @param radius - The radius of the circumscribed circle of the polygon.\n * @param sides - The number of sides of the polygon. Must be 3 or more.\n * @param rotation - The rotation angle of the polygon, in radians. Zero by default.\n * @param transform - An optional `Matrix` object to apply a transformation to the polygon.\n * @returns The instance of the current object for chaining.\n */\n regularPoly(x, y, radius, sides, rotation = 0, transform) {\n sides = Math.max(sides | 0, 3);\n const startAngle = -1 * Math.PI / 2 + rotation;\n const delta = Math.PI * 2 / sides;\n const polygon = [];\n for (let i = 0; i < sides; i++) {\n const angle = startAngle - i * delta;\n polygon.push(\n x + radius * Math.cos(angle),\n y + radius * Math.sin(angle)\n );\n }\n this.poly(polygon, true, transform);\n return this;\n }\n /**\n * Draws a polygon with rounded corners.\n * Similar to `regularPoly` but with the ability to round the corners of the polygon.\n * @param x - The x-coordinate of the center of the polygon.\n * @param y - The y-coordinate of the center of the polygon.\n * @param radius - The radius of the circumscribed circle of the polygon.\n * @param sides - The number of sides of the polygon. Must be 3 or more.\n * @param corner - The radius of the rounding of the corners.\n * @param rotation - The rotation angle of the polygon, in radians. Zero by default.\n * @param smoothness - Optional parameter to adjust the smoothness of the rounding.\n * @returns The instance of the current object for chaining.\n */\n roundPoly(x, y, radius, sides, corner, rotation = 0, smoothness) {\n sides = Math.max(sides | 0, 3);\n if (corner <= 0) {\n return this.regularPoly(x, y, radius, sides, rotation);\n }\n const sideLength = radius * Math.sin(Math.PI / sides) - 1e-3;\n corner = Math.min(corner, sideLength);\n const startAngle = -1 * Math.PI / 2 + rotation;\n const delta = Math.PI * 2 / sides;\n const internalAngle = (sides - 2) * Math.PI / sides / 2;\n for (let i = 0; i < sides; i++) {\n const angle = i * delta + startAngle;\n const x0 = x + radius * Math.cos(angle);\n const y0 = y + radius * Math.sin(angle);\n const a1 = angle + Math.PI + internalAngle;\n const a2 = angle - Math.PI - internalAngle;\n const x1 = x0 + corner * Math.cos(a1);\n const y1 = y0 + corner * Math.sin(a1);\n const x3 = x0 + corner * Math.cos(a2);\n const y3 = y0 + corner * Math.sin(a2);\n if (i === 0) {\n this.moveTo(x1, y1);\n } else {\n this.lineTo(x1, y1);\n }\n this.quadraticCurveTo(x0, y0, x3, y3, smoothness);\n }\n return this.closePath();\n }\n /**\n * Draws a shape with rounded corners. This function supports custom radius for each corner of the shape.\n * Optionally, corners can be rounded using a quadratic curve instead of an arc, providing a different aesthetic.\n * @param points - An array of `RoundedPoint` representing the corners of the shape to draw.\n * A minimum of 3 points is required.\n * @param radius - The default radius for the corners.\n * This radius is applied to all corners unless overridden in `points`.\n * @param useQuadratic - If set to true, rounded corners are drawn using a quadraticCurve\n * method instead of an arc method. Defaults to false.\n * @param smoothness - Specifies the smoothness of the curve when `useQuadratic` is true.\n * Higher values make the curve smoother.\n * @returns The instance of the current object for chaining.\n */\n roundShape(points, radius, useQuadratic = false, smoothness) {\n if (points.length < 3) {\n return this;\n }\n if (useQuadratic) {\n roundedShapeQuadraticCurve(this, points, radius, smoothness);\n } else {\n roundedShapeArc(this, points, radius);\n }\n return this.closePath();\n }\n /**\n * Draw Rectangle with fillet corners. This is much like rounded rectangle\n * however it support negative numbers as well for the corner radius.\n * @param x - Upper left corner of rect\n * @param y - Upper right corner of rect\n * @param width - Width of rect\n * @param height - Height of rect\n * @param fillet - accept negative or positive values\n */\n filletRect(x, y, width, height, fillet) {\n if (fillet === 0) {\n return this.rect(x, y, width, height);\n }\n const maxFillet = Math.min(width, height) / 2;\n const inset = Math.min(maxFillet, Math.max(-maxFillet, fillet));\n const right = x + width;\n const bottom = y + height;\n const dir = inset < 0 ? -inset : 0;\n const size = Math.abs(inset);\n return this.moveTo(x, y + size).arcTo(x + dir, y + dir, x + size, y, size).lineTo(right - size, y).arcTo(right - dir, y + dir, right, y + size, size).lineTo(right, bottom - size).arcTo(right - dir, bottom - dir, x + width - size, bottom, size).lineTo(x + size, bottom).arcTo(x + dir, bottom - dir, x, bottom - size, size).closePath();\n }\n /**\n * Draw Rectangle with chamfer corners. These are angled corners.\n * @param x - Upper left corner of rect\n * @param y - Upper right corner of rect\n * @param width - Width of rect\n * @param height - Height of rect\n * @param chamfer - non-zero real number, size of corner cutout\n * @param transform\n */\n chamferRect(x, y, width, height, chamfer, transform) {\n if (chamfer <= 0) {\n return this.rect(x, y, width, height);\n }\n const inset = Math.min(chamfer, Math.min(width, height) / 2);\n const right = x + width;\n const bottom = y + height;\n const points = [\n x + inset,\n y,\n right - inset,\n y,\n right,\n y + inset,\n right,\n bottom - inset,\n right - inset,\n bottom,\n x + inset,\n bottom,\n x,\n bottom - inset,\n x,\n y + inset\n ];\n for (let i = points.length - 1; i >= 2; i -= 2) {\n if (points[i] === points[i - 2] && points[i - 1] === points[i - 3]) {\n points.splice(i - 1, 2);\n }\n }\n return this.poly(points, true, transform);\n }\n /**\n * Draws an ellipse at the specified location and with the given x and y radii.\n * An optional transformation can be applied, allowing for rotation, scaling, and translation.\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 radiusX - The horizontal radius of the ellipse.\n * @param radiusY - The vertical radius of the ellipse.\n * @param transform - An optional `Matrix` object to apply a transformation to the ellipse. This can include rotations.\n * @returns The instance of the current object for chaining.\n */\n ellipse(x, y, radiusX, radiusY, transform) {\n this.drawShape(new Ellipse(x, y, radiusX, radiusY), transform);\n return this;\n }\n /**\n * Draws a rectangle with rounded corners.\n * The corner radius can be specified to determine how rounded the corners should be.\n * An optional transformation can be applied, which allows for rotation, scaling, and translation of the rectangle.\n * @param x - The x-coordinate of the top-left corner of the rectangle.\n * @param y - The y-coordinate of the top-left corner of the rectangle.\n * @param w - The width of the rectangle.\n * @param h - The height of the rectangle.\n * @param radius - The radius of the rectangle's corners. If not specified, corners will be sharp.\n * @param transform - An optional `Matrix` object to apply a transformation to the rectangle.\n * @returns The instance of the current object for chaining.\n */\n roundRect(x, y, w, h, radius, transform) {\n this.drawShape(new RoundedRectangle(x, y, w, h, radius), transform);\n return this;\n }\n /**\n * Draws a given shape on the canvas.\n * This is a generic method that can draw any type of shape specified by the `ShapePrimitive` parameter.\n * An optional transformation matrix can be applied to the shape, allowing for complex transformations.\n * @param shape - The shape to draw, defined as a `ShapePrimitive` object.\n * @param matrix - An optional `Matrix` for transforming the shape. This can include rotations,\n * scaling, and translations.\n * @returns The instance of the current object for chaining.\n */\n drawShape(shape, matrix) {\n this.endPoly();\n this.shapePrimitives.push({ shape, transform: matrix });\n return this;\n }\n /**\n * Starts a new polygon path from the specified starting point.\n * This method initializes a new polygon or ends the current one if it exists.\n * @param x - The x-coordinate of the starting point of the new polygon.\n * @param y - The y-coordinate of the starting point of the new polygon.\n * @returns The instance of the current object for chaining.\n */\n startPoly(x, y) {\n let currentPoly = this._currentPoly;\n if (currentPoly) {\n this.endPoly();\n }\n currentPoly = new Polygon();\n currentPoly.points.push(x, y);\n this._currentPoly = currentPoly;\n return this;\n }\n /**\n * Ends the current polygon path. If `closePath` is set to true,\n * the path is closed by connecting the last point to the first one.\n * This method finalizes the current polygon and prepares it for drawing or adding to the shape primitives.\n * @param closePath - A boolean indicating whether to close the polygon by connecting the last point\n * back to the starting point. False by default.\n * @returns The instance of the current object for chaining.\n */\n endPoly(closePath = false) {\n const shape = this._currentPoly;\n if (shape && shape.points.length > 2) {\n shape.closePath = closePath;\n this.shapePrimitives.push({ shape });\n }\n this._currentPoly = null;\n return this;\n }\n _ensurePoly(start = true) {\n if (this._currentPoly) return;\n this._currentPoly = new Polygon();\n if (start) {\n const lastShape = this.shapePrimitives[this.shapePrimitives.length - 1];\n if (lastShape) {\n let lx = lastShape.shape.x;\n let ly = lastShape.shape.y;\n if (lastShape.transform && !lastShape.transform.isIdentity()) {\n const t = lastShape.transform;\n const tempX = lx;\n lx = t.a * lx + t.c * ly + t.tx;\n ly = t.b * tempX + t.d * ly + t.ty;\n }\n this._currentPoly.points.push(lx, ly);\n } else {\n this._currentPoly.points.push(0, 0);\n }\n }\n }\n /** Builds the path. */\n buildPath() {\n const path = this._graphicsPath2D;\n this.shapePrimitives.length = 0;\n this._currentPoly = null;\n for (let i = 0; i < path.instructions.length; i++) {\n const instruction = path.instructions[i];\n this[instruction.action](...instruction.data);\n }\n this.finish();\n }\n /** Gets the bounds of the path. */\n get bounds() {\n const bounds = this._bounds;\n bounds.clear();\n const shapePrimitives = this.shapePrimitives;\n for (let i = 0; i < shapePrimitives.length; i++) {\n const shapePrimitive = shapePrimitives[i];\n const boundsRect = shapePrimitive.shape.getBounds(tempRectangle);\n if (shapePrimitive.transform) {\n bounds.addRect(boundsRect, shapePrimitive.transform);\n } else {\n bounds.addRect(boundsRect);\n }\n }\n return bounds;\n }\n}\n\nexport { ShapePath };\n//# sourceMappingURL=ShapePath.mjs.map\n","import { Point } from '../../../../maths/point/Point.mjs';\nimport { uid } from '../../../../utils/data/uid.mjs';\nimport { warn } from '../../../../utils/logging/warn.mjs';\nimport { parseSVGPath } from '../svg/parseSVGPath.mjs';\nimport { ShapePath } from './ShapePath.mjs';\n\n\"use strict\";\nclass GraphicsPath {\n /**\n * Creates a `GraphicsPath` instance optionally from an SVG path string or an array of `PathInstruction`.\n * @param instructions - An SVG path string or an array of `PathInstruction` objects.\n * @param signed\n */\n constructor(instructions, signed = false) {\n this.instructions = [];\n /** unique id for this graphics path */\n this.uid = uid(\"graphicsPath\");\n this._dirty = true;\n this.checkForHoles = signed;\n if (typeof instructions === \"string\") {\n parseSVGPath(instructions, this);\n } else {\n this.instructions = instructions?.slice() ?? [];\n }\n }\n /**\n * Provides access to the internal shape path, ensuring it is up-to-date with the current instructions.\n * @returns The `ShapePath` instance associated with this `GraphicsPath`.\n */\n get shapePath() {\n if (!this._shapePath) {\n this._shapePath = new ShapePath(this);\n }\n if (this._dirty) {\n this._dirty = false;\n this._shapePath.buildPath();\n }\n return this._shapePath;\n }\n /**\n * Adds another `GraphicsPath` to this path, optionally applying a transformation.\n * @param path - The `GraphicsPath` to add.\n * @param transform - An optional transformation to apply to the added path.\n * @returns The instance of the current object for chaining.\n */\n addPath(path, transform) {\n path = path.clone();\n this.instructions.push({ action: \"addPath\", data: [path, transform] });\n this._dirty = true;\n return this;\n }\n arc(...args) {\n this.instructions.push({ action: \"arc\", data: args });\n this._dirty = true;\n return this;\n }\n arcTo(...args) {\n this.instructions.push({ action: \"arcTo\", data: args });\n this._dirty = true;\n return this;\n }\n arcToSvg(...args) {\n this.instructions.push({ action: \"arcToSvg\", data: args });\n this._dirty = true;\n return this;\n }\n bezierCurveTo(...args) {\n this.instructions.push({ action: \"bezierCurveTo\", data: args });\n this._dirty = true;\n return this;\n }\n /**\n * Adds a cubic Bezier curve to the path.\n * It requires two points: the second control point and the end point. The first control point is assumed to be\n * The starting point is the last point in the current path.\n * @param cp2x - The x-coordinate of the second control point.\n * @param cp2y - The y-coordinate of the second control point.\n * @param x - The x-coordinate of the end point.\n * @param y - The y-coordinate of the end point.\n * @param smoothness - Optional parameter to adjust the smoothness of the curve.\n * @returns The instance of the current object for chaining.\n */\n bezierCurveToShort(cp2x, cp2y, x, y, smoothness) {\n const last = this.instructions[this.instructions.length - 1];\n const lastPoint = this.getLastPoint(Point.shared);\n let cp1x = 0;\n let cp1y = 0;\n if (!last || last.action !== \"bezierCurveTo\") {\n cp1x = lastPoint.x;\n cp1y = lastPoint.y;\n } else {\n cp1x = last.data[2];\n cp1y = last.data[3];\n const currentX = lastPoint.x;\n const currentY = lastPoint.y;\n cp1x = currentX + (currentX - cp1x);\n cp1y = currentY + (currentY - cp1y);\n }\n this.instructions.push({ action: \"bezierCurveTo\", data: [cp1x, cp1y, cp2x, cp2y, x, y, smoothness] });\n this._dirty = true;\n return this;\n }\n /**\n * Closes the current path by drawing a straight line back to the start.\n * If the shape is already closed or there are no points in the path, this method does nothing.\n * @returns The instance of the current object for chaining.\n */\n closePath() {\n this.instructions.push({ action: \"closePath\", data: [] });\n this._dirty = true;\n return this;\n }\n ellipse(...args) {\n this.instructions.push({ action: \"ellipse\", data: args });\n this._dirty = true;\n return this;\n }\n lineTo(...args) {\n this.instructions.push({ action: \"lineTo\", data: args });\n this._dirty = true;\n return this;\n }\n moveTo(...args) {\n this.instructions.push({ action: \"moveTo\", data: args });\n return this;\n }\n quadraticCurveTo(...args) {\n this.instructions.push({ action: \"quadraticCurveTo\", data: args });\n this._dirty = true;\n return this;\n }\n /**\n * Adds a quadratic curve to the path. It uses the previous point as the control point.\n * @param x - The x-coordinate of the end point.\n * @param y - The y-coordinate of the end point.\n * @param smoothness - Optional parameter to adjust the smoothness of the curve.\n * @returns The instance of the current object for chaining.\n */\n quadraticCurveToShort(x, y, smoothness) {\n const last = this.instructions[this.instructions.length - 1];\n const lastPoint = this.getLastPoint(Point.shared);\n let cpx1 = 0;\n let cpy1 = 0;\n if (!last || last.action !== \"quadraticCurveTo\") {\n cpx1 = lastPoint.x;\n cpy1 = lastPoint.y;\n } else {\n cpx1 = last.data[0];\n cpy1 = last.data[1];\n const currentX = lastPoint.x;\n const currentY = lastPoint.y;\n cpx1 = currentX + (currentX - cpx1);\n cpy1 = currentY + (currentY - cpy1);\n }\n this.instructions.push({ action: \"quadraticCurveTo\", data: [cpx1, cpy1, x, y, smoothness] });\n this._dirty = true;\n return this;\n }\n /**\n * Draws a rectangle shape. This method adds a new rectangle path to the current drawing.\n * @param x - The x-coordinate of the top-left corner of the rectangle.\n * @param y - The y-coordinate of the top-left corner of the rectangle.\n * @param w - The width of the rectangle.\n * @param h - The height of the rectangle.\n * @param transform - An optional `Matrix` object to apply a transformation to the rectangle.\n * @returns The instance of the current object for chaining.\n */\n rect(x, y, w, h, transform) {\n this.instructions.push({ action: \"rect\", data: [x, y, w, h, transform] });\n this._dirty = true;\n return this;\n }\n /**\n * Draws a circle shape. This method adds a new circle path to the current drawing.\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 * @param transform - An optional `Matrix` object to apply a transformation to the circle.\n * @returns The instance of the current object for chaining.\n */\n circle(x, y, radius, transform) {\n this.instructions.push({ action: \"circle\", data: [x, y, radius, transform] });\n this._dirty = true;\n return this;\n }\n roundRect(...args) {\n this.instructions.push({ action: \"roundRect\", data: args });\n this._dirty = true;\n return this;\n }\n poly(...args) {\n this.instructions.push({ action: \"poly\", data: args });\n this._dirty = true;\n return this;\n }\n regularPoly(...args) {\n this.instructions.push({ action: \"regularPoly\", data: args });\n this._dirty = true;\n return this;\n }\n roundPoly(...args) {\n this.instructions.push({ action: \"roundPoly\", data: args });\n this._dirty = true;\n return this;\n }\n roundShape(...args) {\n this.instructions.push({ action: \"roundShape\", data: args });\n this._dirty = true;\n return this;\n }\n filletRect(...args) {\n this.instructions.push({ action: \"filletRect\", data: args });\n this._dirty = true;\n return this;\n }\n chamferRect(...args) {\n this.instructions.push({ action: \"chamferRect\", data: args });\n this._dirty = true;\n return this;\n }\n /**\n * Draws a star shape centered at a specified location. This method allows for the creation\n * of stars with a variable number of points, outer radius, optional inner radius, and rotation.\n * The star is drawn as a closed polygon with alternating outer and inner vertices to create the star's points.\n * An optional transformation can be applied to scale, rotate, or translate the star as needed.\n * @param x - The x-coordinate of the center of the star.\n * @param y - The y-coordinate of the center of the star.\n * @param points - The number of points of the star.\n * @param radius - The outer radius of the star (distance from the center to the outer points).\n * @param innerRadius - Optional. The inner radius of the star\n * (distance from the center to the inner points between the outer points).\n * If not provided, defaults to half of the `radius`.\n * @param rotation - Optional. The rotation of the star in radians, where 0 is aligned with the y-axis.\n * Defaults to 0, meaning one point is directly upward.\n * @param transform - An optional `Matrix` object to apply a transformation to the star.\n * This can include rotations, scaling, and translations.\n * @returns The instance of the current object for chaining further drawing commands.\n */\n // eslint-disable-next-line max-len\n star(x, y, points, radius, innerRadius, rotation, transform) {\n innerRadius || (innerRadius = radius / 2);\n const startAngle = -1 * Math.PI / 2 + rotation;\n const len = points * 2;\n const delta = Math.PI * 2 / len;\n const polygon = [];\n for (let i = 0; i < len; i++) {\n const r = i % 2 ? innerRadius : radius;\n const angle = i * delta + startAngle;\n polygon.push(\n x + r * Math.cos(angle),\n y + r * Math.sin(angle)\n );\n }\n this.poly(polygon, true, transform);\n return this;\n }\n /**\n * Creates a copy of the current `GraphicsPath` instance. This method supports both shallow and deep cloning.\n * A shallow clone copies the reference of the instructions array, while a deep clone creates a new array and\n * copies each instruction individually, ensuring that modifications to the instructions of the cloned `GraphicsPath`\n * do not affect the original `GraphicsPath` and vice versa.\n * @param deep - A boolean flag indicating whether the clone should be deep.\n * @returns A new `GraphicsPath` instance that is a clone of the current instance.\n */\n clone(deep = false) {\n const newGraphicsPath2D = new GraphicsPath();\n newGraphicsPath2D.checkForHoles = this.checkForHoles;\n if (!deep) {\n newGraphicsPath2D.instructions = this.instructions.slice();\n } else {\n for (let i = 0; i < this.instructions.length; i++) {\n const instruction = this.instructions[i];\n newGraphicsPath2D.instructions.push({ action: instruction.action, data: instruction.data.slice() });\n }\n }\n return newGraphicsPath2D;\n }\n clear() {\n this.instructions.length = 0;\n this._dirty = true;\n return this;\n }\n /**\n * Applies a transformation matrix to all drawing instructions within the `GraphicsPath`.\n * This method enables the modification of the path's geometry according to the provided\n * transformation matrix, which can include translations, rotations, scaling, and skewing.\n *\n * Each drawing instruction in the path is updated to reflect the transformation,\n * ensuring the visual representation of the path is consistent with the applied matrix.\n *\n * Note: The transformation is applied directly to the coordinates and control points of the drawing instructions,\n * not to the path as a whole. This means the transformation's effects are baked into the individual instructions,\n * allowing for fine-grained control over the path's appearance.\n * @param matrix - A `Matrix` object representing the transformation to apply.\n * @returns The instance of the current object for chaining further operations.\n */\n transform(matrix) {\n if (matrix.isIdentity()) return this;\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 let x = 0;\n let y = 0;\n let cpx1 = 0;\n let cpy1 = 0;\n let cpx2 = 0;\n let cpy2 = 0;\n let rx = 0;\n let ry = 0;\n for (let i = 0; i < this.instructions.length; i++) {\n const instruction = this.instructions[i];\n const data = instruction.data;\n switch (instruction.action) {\n case \"moveTo\":\n case \"lineTo\":\n x = data[0];\n y = data[1];\n data[0] = a * x + c * y + tx;\n data[1] = b * x + d * y + ty;\n break;\n case \"bezierCurveTo\":\n cpx1 = data[0];\n cpy1 = data[1];\n cpx2 = data[2];\n cpy2 = data[3];\n x = data[4];\n y = data[5];\n data[0] = a * cpx1 + c * cpy1 + tx;\n data[1] = b * cpx1 + d * cpy1 + ty;\n data[2] = a * cpx2 + c * cpy2 + tx;\n data[3] = b * cpx2 + d * cpy2 + ty;\n data[4] = a * x + c * y + tx;\n data[5] = b * x + d * y + ty;\n break;\n case \"quadraticCurveTo\":\n cpx1 = data[0];\n cpy1 = data[1];\n x = data[2];\n y = data[3];\n data[0] = a * cpx1 + c * cpy1 + tx;\n data[1] = b * cpx1 + d * cpy1 + ty;\n data[2] = a * x + c * y + tx;\n data[3] = b * x + d * y + ty;\n break;\n case \"arcToSvg\":\n x = data[5];\n y = data[6];\n rx = data[0];\n ry = data[1];\n data[0] = a * rx + c * ry;\n data[1] = b * rx + d * ry;\n data[5] = a * x + c * y + tx;\n data[6] = b * x + d * y + ty;\n break;\n case \"circle\":\n data[4] = adjustTransform(data[3], matrix);\n break;\n case \"rect\":\n data[4] = adjustTransform(data[4], matrix);\n break;\n case \"ellipse\":\n data[8] = adjustTransform(data[8], matrix);\n break;\n case \"roundRect\":\n data[5] = adjustTransform(data[5], matrix);\n break;\n case \"addPath\":\n data[0].transform(matrix);\n break;\n case \"poly\":\n data[2] = adjustTransform(data[2], matrix);\n break;\n case \"regularPoly\":\n case \"chamferRect\":\n data[5] = adjustTransform(data[5], matrix);\n break;\n case \"closePath\":\n break;\n default:\n warn(\"unknown transform action\", instruction.action);\n break;\n }\n }\n this._dirty = true;\n return this;\n }\n get bounds() {\n return this.shapePath.bounds;\n }\n /**\n * Retrieves the last point from the current drawing instructions in the `GraphicsPath`.\n * This method is useful for operations that depend on the path's current endpoint,\n * such as connecting subsequent shapes or paths. It supports various drawing instructions,\n * ensuring the last point's position is accurately determined regardless of the path's complexity.\n *\n * If the last instruction is a `closePath`, the method iterates backward through the instructions\n * until it finds an actionable instruction that defines a point (e.g., `moveTo`, `lineTo`,\n * `quadraticCurveTo`, etc.). For compound paths added via `addPath`, it recursively retrieves\n * the last point from the nested path.\n * @param out - A `Point` object where the last point's coordinates will be stored.\n * This object is modified directly to contain the result.\n * @returns The `Point` object containing the last point's coordinates.\n */\n getLastPoint(out) {\n let index = this.instructions.length - 1;\n let lastInstruction = this.instructions[index];\n if (!lastInstruction) {\n out.x = 0;\n out.y = 0;\n return out;\n }\n while (lastInstruction.action === \"closePath\") {\n index--;\n if (index < 0) {\n out.x = 0;\n out.y = 0;\n return out;\n }\n lastInstruction = this.instructions[index];\n }\n switch (lastInstruction.action) {\n case \"moveTo\":\n case \"lineTo\":\n out.x = lastInstruction.data[0];\n out.y = lastInstruction.data[1];\n break;\n case \"quadraticCurveTo\":\n out.x = lastInstruction.data[2];\n out.y = lastInstruction.data[3];\n break;\n case \"bezierCurveTo\":\n out.x = lastInstruction.data[4];\n out.y = lastInstruction.data[5];\n break;\n case \"arc\":\n case \"arcToSvg\":\n out.x = lastInstruction.data[5];\n out.y = lastInstruction.data[6];\n break;\n case \"addPath\":\n lastInstruction.data[0].getLastPoint(out);\n break;\n }\n return out;\n }\n}\nfunction adjustTransform(currentMatrix, transform) {\n if (currentMatrix) {\n return currentMatrix.prepend(transform);\n }\n return transform.clone();\n}\n\nexport { GraphicsPath };\n//# sourceMappingURL=GraphicsPath.mjs.map\n","\"use strict\";\nfunction parseSVGFloatAttribute(svg, id, defaultValue) {\n const value = svg.getAttribute(id);\n return value ? Number(value) : defaultValue;\n}\n\nexport { parseSVGFloatAttribute };\n//# sourceMappingURL=parseSVGFloatAttribute.mjs.map\n","import { Color } from '../../../../color/Color.mjs';\nimport { warn } from '../../../../utils/logging/warn.mjs';\nimport { FillGradient } from '../fill/FillGradient.mjs';\nimport { parseSVGFloatAttribute } from './parseSVGFloatAttribute.mjs';\n\n\"use strict\";\nfunction parseSVGDefinitions(svg, session) {\n const definitions = svg.querySelectorAll(\"defs\");\n for (let i = 0; i < definitions.length; i++) {\n const definition = definitions[i];\n for (let j = 0; j < definition.children.length; j++) {\n const child = definition.children[j];\n switch (child.nodeName.toLowerCase()) {\n case \"lineargradient\":\n session.defs[child.id] = parseLinearGradient(child);\n break;\n case \"radialgradient\":\n session.defs[child.id] = parseRadialGradient(child);\n break;\n default:\n break;\n }\n }\n }\n}\nfunction parseLinearGradient(child) {\n const x0 = parseSVGFloatAttribute(child, \"x1\", 0);\n const y0 = parseSVGFloatAttribute(child, \"y1\", 0);\n const x1 = parseSVGFloatAttribute(child, \"x2\", 1);\n const y1 = parseSVGFloatAttribute(child, \"y2\", 0);\n const gradientUnit = child.getAttribute(\"gradientUnits\") || \"objectBoundingBox\";\n const gradient = new FillGradient(\n x0,\n y0,\n x1,\n y1,\n gradientUnit === \"objectBoundingBox\" ? \"local\" : \"global\"\n );\n for (let k = 0; k < child.children.length; k++) {\n const stop = child.children[k];\n const offset = parseSVGFloatAttribute(stop, \"offset\", 0);\n const color = Color.shared.setValue(stop.getAttribute(\"stop-color\")).toNumber();\n gradient.addColorStop(offset, color);\n }\n return gradient;\n}\nfunction parseRadialGradient(_child) {\n warn(\"[SVG Parser] Radial gradients are not yet supported\");\n return new FillGradient(0, 0, 1, 0);\n}\n\nexport { parseSVGDefinitions };\n//# sourceMappingURL=parseSVGDefinitions.mjs.map\n","\"use strict\";\nfunction extractSvgUrlId(url) {\n const match = url.match(/url\\s*\\(\\s*['\"]?\\s*#([^'\"\\s)]+)\\s*['\"]?\\s*\\)/i);\n return match ? match[1] : \"\";\n}\n\nexport { extractSvgUrlId };\n//# sourceMappingURL=extractSvgUrlId.mjs.map\n","import { Color } from '../../../../color/Color.mjs';\nimport { extractSvgUrlId } from './utils/extractSvgUrlId.mjs';\n\n\"use strict\";\nconst styleAttributes = {\n // Fill properties\n fill: { type: \"paint\", default: 0 },\n // Fill color/gradient\n \"fill-opacity\": { type: \"number\", default: 1 },\n // Fill transparency\n // Stroke properties\n stroke: { type: \"paint\", default: 0 },\n // Stroke color/gradient\n \"stroke-width\": { type: \"number\", default: 1 },\n // Width of stroke\n \"stroke-opacity\": { type: \"number\", default: 1 },\n // Stroke transparency\n \"stroke-linecap\": { type: \"string\", default: \"butt\" },\n // End cap style: butt, round, square\n \"stroke-linejoin\": { type: \"string\", default: \"miter\" },\n // Join style: miter, round, bevel\n \"stroke-miterlimit\": { type: \"number\", default: 10 },\n // Limit on miter join sharpness\n \"stroke-dasharray\": { type: \"string\", default: \"none\" },\n // Dash pattern\n \"stroke-dashoffset\": { type: \"number\", default: 0 },\n // Offset for dash pattern\n // Global properties\n opacity: { type: \"number\", default: 1 }\n // Overall opacity\n};\nfunction parseSVGStyle(svg, session) {\n const style = svg.getAttribute(\"style\");\n const strokeStyle = {};\n const fillStyle = {};\n const result = {\n strokeStyle,\n fillStyle,\n useFill: false,\n useStroke: false\n };\n for (const key in styleAttributes) {\n const attribute = svg.getAttribute(key);\n if (attribute) {\n parseAttribute(session, result, key, attribute.trim());\n }\n }\n if (style) {\n const styleParts = style.split(\";\");\n for (let i = 0; i < styleParts.length; i++) {\n const stylePart = styleParts[i].trim();\n const [key, value] = stylePart.split(\":\");\n if (styleAttributes[key]) {\n parseAttribute(session, result, key, value.trim());\n }\n }\n }\n return {\n strokeStyle: result.useStroke ? strokeStyle : null,\n fillStyle: result.useFill ? fillStyle : null,\n useFill: result.useFill,\n useStroke: result.useStroke\n };\n}\nfunction parseAttribute(session, result, id, value) {\n switch (id) {\n case \"stroke\":\n if (value !== \"none\") {\n if (value.startsWith(\"url(\")) {\n const id2 = extractSvgUrlId(value);\n result.strokeStyle.fill = session.defs[id2];\n } else {\n result.strokeStyle.color = Color.shared.setValue(value).toNumber();\n }\n result.useStroke = true;\n }\n break;\n case \"stroke-width\":\n result.strokeStyle.width = Number(value);\n break;\n case \"fill\":\n if (value !== \"none\") {\n if (value.startsWith(\"url(\")) {\n const id2 = extractSvgUrlId(value);\n result.fillStyle.fill = session.defs[id2];\n } else {\n result.fillStyle.color = Color.shared.setValue(value).toNumber();\n }\n result.useFill = true;\n }\n break;\n case \"fill-opacity\":\n result.fillStyle.alpha = Number(value);\n break;\n case \"stroke-opacity\":\n result.strokeStyle.alpha = Number(value);\n break;\n case \"opacity\":\n result.fillStyle.alpha = Number(value);\n result.strokeStyle.alpha = Number(value);\n break;\n }\n}\n\nexport { parseSVGStyle, styleAttributes };\n//# sourceMappingURL=parseSVGStyle.mjs.map\n","\"use strict\";\nfunction checkForNestedPattern(subpathsWithArea) {\n if (subpathsWithArea.length <= 2) {\n return true;\n }\n const areas = subpathsWithArea.map((s) => s.area).sort((a, b) => b - a);\n const [largestArea, secondArea] = areas;\n const smallestArea = areas[areas.length - 1];\n const largestToSecondRatio = largestArea / secondArea;\n const secondToSmallestRatio = secondArea / smallestArea;\n if (largestToSecondRatio > 3 && secondToSmallestRatio < 2) {\n return false;\n }\n return true;\n}\nfunction getFillInstructionData(context, index = 0) {\n const instruction = context.instructions[index];\n if (!instruction || instruction.action !== \"fill\") {\n throw new Error(`Expected fill instruction at index ${index}, got ${instruction?.action || \"undefined\"}`);\n }\n return instruction.data;\n}\n\nexport { checkForNestedPattern, getFillInstructionData };\n//# sourceMappingURL=fillOperations.mjs.map\n","import { GraphicsPath } from '../../path/GraphicsPath.mjs';\n\n\"use strict\";\nfunction extractSubpaths(pathData) {\n const parts = pathData.split(/(?=[Mm])/);\n const subpaths = parts.filter((part) => part.trim().length > 0);\n return subpaths;\n}\nfunction calculatePathArea(pathData) {\n const coords = pathData.match(/[-+]?[0-9]*\\.?[0-9]+/g);\n if (!coords || coords.length < 4) return 0;\n const numbers = coords.map(Number);\n const xs = [];\n const ys = [];\n for (let i = 0; i < numbers.length; i += 2) {\n if (i + 1 < numbers.length) {\n xs.push(numbers[i]);\n ys.push(numbers[i + 1]);\n }\n }\n if (xs.length === 0 || ys.length === 0) return 0;\n const minX = Math.min(...xs);\n const maxX = Math.max(...xs);\n const minY = Math.min(...ys);\n const maxY = Math.max(...ys);\n const area = (maxX - minX) * (maxY - minY);\n return area;\n}\nfunction appendSVGPath(pathData, graphicsPath) {\n const tempPath = new GraphicsPath(pathData, false);\n for (const instruction of tempPath.instructions) {\n graphicsPath.instructions.push(instruction);\n }\n}\n\nexport { appendSVGPath, calculatePathArea, extractSubpaths };\n//# sourceMappingURL=pathOperations.mjs.map\n","import { warn } from '../../../../utils/logging/warn.mjs';\nimport { GraphicsPath } from '../path/GraphicsPath.mjs';\nimport { parseSVGDefinitions } from './parseSVGDefinitions.mjs';\nimport { parseSVGFloatAttribute } from './parseSVGFloatAttribute.mjs';\nimport { parseSVGStyle } from './parseSVGStyle.mjs';\nimport { checkForNestedPattern } from './utils/fillOperations.mjs';\nimport { extractSubpaths, calculatePathArea, appendSVGPath } from './utils/pathOperations.mjs';\n\n\"use strict\";\nfunction SVGParser(svg, graphicsContext) {\n if (typeof svg === \"string\") {\n const div = document.createElement(\"div\");\n div.innerHTML = svg.trim();\n svg = div.querySelector(\"svg\");\n }\n const session = {\n context: graphicsContext,\n defs: {},\n path: new GraphicsPath()\n };\n parseSVGDefinitions(svg, session);\n const children = svg.children;\n const { fillStyle, strokeStyle } = parseSVGStyle(svg, session);\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (child.nodeName.toLowerCase() === \"defs\") continue;\n renderChildren(child, session, fillStyle, strokeStyle);\n }\n return graphicsContext;\n}\nfunction renderChildren(svg, session, fillStyle, strokeStyle) {\n const children = svg.children;\n const { fillStyle: f1, strokeStyle: s1 } = parseSVGStyle(svg, session);\n if (f1 && fillStyle) {\n fillStyle = { ...fillStyle, ...f1 };\n } else if (f1) {\n fillStyle = f1;\n }\n if (s1 && strokeStyle) {\n strokeStyle = { ...strokeStyle, ...s1 };\n } else if (s1) {\n strokeStyle = s1;\n }\n const noStyle = !fillStyle && !strokeStyle;\n if (noStyle) {\n fillStyle = { color: 0 };\n }\n let x;\n let y;\n let x1;\n let y1;\n let x2;\n let y2;\n let cx;\n let cy;\n let r;\n let rx;\n let ry;\n let points;\n let pointsString;\n let d;\n let graphicsPath;\n let width;\n let height;\n switch (svg.nodeName.toLowerCase()) {\n case \"path\": {\n d = svg.getAttribute(\"d\");\n const fillRule = svg.getAttribute(\"fill-rule\");\n const subpaths = extractSubpaths(d);\n const hasExplicitEvenodd = fillRule === \"evenodd\";\n const hasMultipleSubpaths = subpaths.length > 1;\n const shouldProcessHoles = hasExplicitEvenodd && hasMultipleSubpaths;\n if (shouldProcessHoles) {\n const subpathsWithArea = subpaths.map((subpath) => ({\n path: subpath,\n area: calculatePathArea(subpath)\n }));\n subpathsWithArea.sort((a, b) => b.area - a.area);\n const useMultipleHolesApproach = subpaths.length > 3 || !checkForNestedPattern(subpathsWithArea);\n if (useMultipleHolesApproach) {\n for (let i = 0; i < subpathsWithArea.length; i++) {\n const subpath = subpathsWithArea[i];\n const isMainShape = i === 0;\n session.context.beginPath();\n const newPath = new GraphicsPath(void 0, true);\n appendSVGPath(subpath.path, newPath);\n session.context.path(newPath);\n if (isMainShape) {\n if (fillStyle) session.context.fill(fillStyle);\n if (strokeStyle) session.context.stroke(strokeStyle);\n } else {\n session.context.cut();\n }\n }\n } else {\n for (let i = 0; i < subpathsWithArea.length; i++) {\n const subpath = subpathsWithArea[i];\n const isHole = i % 2 === 1;\n session.context.beginPath();\n const newPath = new GraphicsPath(void 0, true);\n appendSVGPath(subpath.path, newPath);\n session.context.path(newPath);\n if (isHole) {\n session.context.cut();\n } else {\n if (fillStyle) session.context.fill(fillStyle);\n if (strokeStyle) session.context.stroke(strokeStyle);\n }\n }\n }\n } else {\n const useEvenoddForGraphicsPath = fillRule ? fillRule === \"evenodd\" : true;\n graphicsPath = new GraphicsPath(d, useEvenoddForGraphicsPath);\n session.context.path(graphicsPath);\n if (fillStyle) session.context.fill(fillStyle);\n if (strokeStyle) session.context.stroke(strokeStyle);\n }\n break;\n }\n case \"circle\":\n cx = parseSVGFloatAttribute(svg, \"cx\", 0);\n cy = parseSVGFloatAttribute(svg, \"cy\", 0);\n r = parseSVGFloatAttribute(svg, \"r\", 0);\n session.context.ellipse(cx, cy, r, r);\n if (fillStyle) session.context.fill(fillStyle);\n if (strokeStyle) session.context.stroke(strokeStyle);\n break;\n case \"rect\":\n x = parseSVGFloatAttribute(svg, \"x\", 0);\n y = parseSVGFloatAttribute(svg, \"y\", 0);\n width = parseSVGFloatAttribute(svg, \"width\", 0);\n height = parseSVGFloatAttribute(svg, \"height\", 0);\n rx = parseSVGFloatAttribute(svg, \"rx\", 0);\n ry = parseSVGFloatAttribute(svg, \"ry\", 0);\n if (rx || ry) {\n session.context.roundRect(x, y, width, height, rx || ry);\n } else {\n session.context.rect(x, y, width, height);\n }\n if (fillStyle) session.context.fill(fillStyle);\n if (strokeStyle) session.context.stroke(strokeStyle);\n break;\n case \"ellipse\":\n cx = parseSVGFloatAttribute(svg, \"cx\", 0);\n cy = parseSVGFloatAttribute(svg, \"cy\", 0);\n rx = parseSVGFloatAttribute(svg, \"rx\", 0);\n ry = parseSVGFloatAttribute(svg, \"ry\", 0);\n session.context.beginPath();\n session.context.ellipse(cx, cy, rx, ry);\n if (fillStyle) session.context.fill(fillStyle);\n if (strokeStyle) session.context.stroke(strokeStyle);\n break;\n case \"line\":\n x1 = parseSVGFloatAttribute(svg, \"x1\", 0);\n y1 = parseSVGFloatAttribute(svg, \"y1\", 0);\n x2 = parseSVGFloatAttribute(svg, \"x2\", 0);\n y2 = parseSVGFloatAttribute(svg, \"y2\", 0);\n session.context.beginPath();\n session.context.moveTo(x1, y1);\n session.context.lineTo(x2, y2);\n if (strokeStyle) session.context.stroke(strokeStyle);\n break;\n case \"polygon\":\n pointsString = svg.getAttribute(\"points\");\n points = pointsString.match(/-?\\d+/g).map((n) => parseInt(n, 10));\n session.context.poly(points, true);\n if (fillStyle) session.context.fill(fillStyle);\n if (strokeStyle) session.context.stroke(strokeStyle);\n break;\n case \"polyline\":\n pointsString = svg.getAttribute(\"points\");\n points = pointsString.match(/-?\\d+/g).map((n) => parseInt(n, 10));\n session.context.poly(points, false);\n if (strokeStyle) session.context.stroke(strokeStyle);\n break;\n // Group elements - just process children\n case \"g\":\n case \"svg\":\n break;\n default: {\n warn(`[SVG parser] <${svg.nodeName}> elements unsupported`);\n break;\n }\n }\n if (noStyle) {\n fillStyle = null;\n }\n for (let i = 0; i < children.length; i++) {\n renderChildren(children[i], session, fillStyle, strokeStyle);\n }\n}\n\nexport { SVGParser };\n//# sourceMappingURL=SVGParser.mjs.map\n","import { Matrix } from '../../../../maths/matrix/Matrix.mjs';\nimport { uid } from '../../../../utils/data/uid.mjs';\n\n\"use strict\";\nfunction isFillPatternOptions(value) {\n return value.texture !== void 0;\n}\nconst repetitionMap = {\n repeat: {\n addressModeU: \"repeat\",\n addressModeV: \"repeat\"\n },\n \"repeat-x\": {\n addressModeU: \"repeat\",\n addressModeV: \"clamp-to-edge\"\n },\n \"repeat-y\": {\n addressModeU: \"clamp-to-edge\",\n addressModeV: \"repeat\"\n },\n \"no-repeat\": {\n addressModeU: \"clamp-to-edge\",\n addressModeV: \"clamp-to-edge\"\n }\n};\nclass FillPattern {\n constructor(textureOrOptions, repetition) {\n /**\n * unique id for this fill pattern\n * @internal\n */\n this.uid = uid(\"fillPattern\");\n /**\n * Internal tick counter to track changes in the pattern.\n * This is used to invalidate the pattern when the texture or transform changes.\n * @internal\n */\n this._tick = 0;\n /** The transform matrix applied to the pattern */\n this.transform = new Matrix();\n const options = isFillPatternOptions(textureOrOptions) ? textureOrOptions : { texture: textureOrOptions, repetition };\n this.texture = options.texture;\n this.textureSpace = options.textureSpace ?? \"global\";\n const rep = options.repetition;\n if (rep) {\n this.texture.source.style.addressModeU = repetitionMap[rep].addressModeU;\n this.texture.source.style.addressModeV = repetitionMap[rep].addressModeV;\n }\n }\n /**\n * Sets the transform for the pattern\n * @param transform - The transform matrix to apply to the pattern.\n * If not provided, the pattern will use the default transform.\n */\n setTransform(transform) {\n if (transform) {\n if (this.transform.equals(transform)) return;\n this.transform.copyFrom(transform);\n } else {\n if (this.transform.isIdentity()) return;\n this.transform.identity();\n }\n this._tick++;\n }\n /** Internal texture used to render the gradient */\n get texture() {\n return this._texture;\n }\n set texture(value) {\n if (this._texture === value) return;\n this._texture = value;\n this._tick++;\n }\n /**\n * Returns a unique key for this instance.\n * This key is used for caching.\n * @returns {string} Unique key for the instance\n */\n get styleKey() {\n return `fill-pattern-${this.uid}-${this._tick}`;\n }\n /** Destroys the fill pattern, releasing resources. This will also destroy the internal texture. */\n destroy() {\n this.texture.destroy(true);\n this.texture = null;\n }\n}\n\nexport { FillPattern };\n//# sourceMappingURL=FillPattern.mjs.map\n","import { Color } from '../../../../color/Color.mjs';\nimport { Texture } from '../../../../rendering/renderers/shared/texture/Texture.mjs';\nimport { FillGradient } from '../fill/FillGradient.mjs';\nimport { FillPattern } from '../fill/FillPattern.mjs';\n\n\"use strict\";\nfunction isColorLike(value) {\n return Color.isColorLike(value);\n}\nfunction isFillPattern(value) {\n return value instanceof FillPattern;\n}\nfunction isFillGradient(value) {\n return value instanceof FillGradient;\n}\nfunction isTexture(value) {\n return value instanceof Texture;\n}\nfunction handleColorLike(fill, value, defaultStyle) {\n const temp = Color.shared.setValue(value ?? 0);\n fill.color = temp.toNumber();\n fill.alpha = temp.alpha === 1 ? defaultStyle.alpha : temp.alpha;\n fill.texture = Texture.WHITE;\n return { ...defaultStyle, ...fill };\n}\nfunction handleTexture(fill, value, defaultStyle) {\n fill.texture = value;\n return { ...defaultStyle, ...fill };\n}\nfunction handleFillPattern(fill, value, defaultStyle) {\n fill.fill = value;\n fill.color = 16777215;\n fill.texture = value.texture;\n fill.matrix = value.transform;\n fill.textureSpace = value.textureSpace;\n return { ...defaultStyle, ...fill };\n}\nfunction handleFillGradient(fill, value, defaultStyle) {\n value.buildGradient();\n fill.fill = value;\n fill.color = 16777215;\n fill.texture = value.texture;\n fill.matrix = value.transform;\n fill.textureSpace = value.textureSpace;\n return { ...defaultStyle, ...fill };\n}\nfunction handleFillObject(value, defaultStyle) {\n const style = { ...defaultStyle, ...value };\n const color = Color.shared.setValue(style.color);\n style.alpha *= color.alpha;\n style.color = color.toNumber();\n return style;\n}\nfunction toFillStyle(value, defaultStyle) {\n if (value === void 0 || value === null) {\n return null;\n }\n const fill = {};\n const objectStyle = value;\n if (isColorLike(value)) {\n return handleColorLike(fill, value, defaultStyle);\n } else if (isTexture(value)) {\n return handleTexture(fill, value, defaultStyle);\n } else if (isFillPattern(value)) {\n return handleFillPattern(fill, value, defaultStyle);\n } else if (isFillGradient(value)) {\n return handleFillGradient(fill, value, defaultStyle);\n } else if (objectStyle.fill && isFillPattern(objectStyle.fill)) {\n return handleFillPattern(objectStyle, objectStyle.fill, defaultStyle);\n } else if (objectStyle.fill && isFillGradient(objectStyle.fill)) {\n return handleFillGradient(objectStyle, objectStyle.fill, defaultStyle);\n }\n return handleFillObject(objectStyle, defaultStyle);\n}\nfunction toStrokeStyle(value, defaultStyle) {\n const { width, alignment, miterLimit, cap, join, pixelLine, ...rest } = defaultStyle;\n const fill = toFillStyle(value, rest);\n if (!fill) {\n return null;\n }\n return {\n width,\n alignment,\n miterLimit,\n cap,\n join,\n pixelLine,\n ...fill\n };\n}\n\nexport { toFillStyle, toStrokeStyle };\n//# sourceMappingURL=convertFillInputToFillStyle.mjs.map\n","\"use strict\";\nfunction getMaxMiterRatio(path, miterLimit) {\n let maxRatio = 1;\n const shapePrimitives = path.shapePath.shapePrimitives;\n for (let i = 0; i < shapePrimitives.length; i++) {\n const shape = shapePrimitives[i].shape;\n if (shape.type !== \"polygon\") continue;\n const points = shape.points;\n const n = points.length;\n if (n < 6) continue;\n const closed = shape.closePath;\n for (let j = 0; j < n; j += 2) {\n if (!closed && (j === 0 || j === n - 2)) continue;\n const prevIdx = (j - 2 + n) % n;\n const nextIdx = (j + 2) % n;\n const x0 = points[prevIdx];\n const y0 = points[prevIdx + 1];\n const x1 = points[j];\n const y1 = points[j + 1];\n const x2 = points[nextIdx];\n const y2 = points[nextIdx + 1];\n const dx0 = x0 - x1;\n const dy0 = y0 - y1;\n const dx1 = x2 - x1;\n const dy1 = y2 - y1;\n const len0Sq = dx0 * dx0 + dy0 * dy0;\n const len1Sq = dx1 * dx1 + dy1 * dy1;\n if (len0Sq < 1e-12 || len1Sq < 1e-12) continue;\n const dot = dx0 * dx1 + dy0 * dy1;\n const cosAngle = dot / Math.sqrt(len0Sq * len1Sq);\n let clampedCos = cosAngle;\n if (clampedCos < -1) clampedCos = -1;\n else if (clampedCos > 1) clampedCos = 1;\n const sinHalfAngle = Math.sqrt((1 - clampedCos) * 0.5);\n if (sinHalfAngle < 1e-6) continue;\n const miterRatio = Math.min(1 / sinHalfAngle, miterLimit);\n if (miterRatio > maxRatio) maxRatio = miterRatio;\n }\n }\n return maxRatio;\n}\n\nexport { getMaxMiterRatio };\n//# sourceMappingURL=getMaxMiterRatio.mjs.map\n","import EventEmitter from 'eventemitter3';\nimport { Color } from '../../../color/Color.mjs';\nimport { Matrix } from '../../../maths/matrix/Matrix.mjs';\nimport { Point } from '../../../maths/point/Point.mjs';\nimport { Texture } from '../../../rendering/renderers/shared/texture/Texture.mjs';\nimport { uid } from '../../../utils/data/uid.mjs';\nimport { deprecation, v8_0_0 } from '../../../utils/logging/deprecation.mjs';\nimport { Bounds } from '../../container/bounds/Bounds.mjs';\nimport { GraphicsPath } from './path/GraphicsPath.mjs';\nimport { SVGParser } from './svg/SVGParser.mjs';\nimport { toFillStyle, toStrokeStyle } from './utils/convertFillInputToFillStyle.mjs';\nimport { getMaxMiterRatio } from './utils/getMaxMiterRatio.mjs';\n\n\"use strict\";\nconst tmpPoint = new Point();\nconst tempMatrix = new Matrix();\nconst _GraphicsContext = class _GraphicsContext extends EventEmitter {\n constructor() {\n super(...arguments);\n /** @internal */\n this._gpuData = /* @__PURE__ */ Object.create(null);\n /** If set to true, the resource will be garbage collected automatically when it is not used. */\n this.autoGarbageCollect = true;\n /** @internal */\n this._gcLastUsed = -1;\n /**\n * unique id for this graphics context\n * @internal\n */\n this.uid = uid(\"graphicsContext\");\n /**\n * Indicates whether content is updated and have to be re-rendered.\n * @internal\n */\n this.dirty = true;\n /** The batch mode for this graphics context. It can be 'auto', 'batch', or 'no-batch'. */\n this.batchMode = \"auto\";\n /** @internal */\n this.instructions = [];\n /** Whether the graphics context has been destroyed. */\n this.destroyed = false;\n this._activePath = new GraphicsPath();\n this._transform = new Matrix();\n this._fillStyle = { ..._GraphicsContext.defaultFillStyle };\n this._strokeStyle = { ..._GraphicsContext.defaultStrokeStyle };\n this._stateStack = [];\n this._tick = 0;\n this._bounds = new Bounds();\n this._boundsDirty = true;\n }\n /**\n * Creates a new GraphicsContext object that is a clone of this instance, copying all properties,\n * including the current drawing state, transformations, styles, and instructions.\n * @returns A new GraphicsContext instance with the same properties and state as this one.\n */\n clone() {\n const clone = new _GraphicsContext();\n clone.batchMode = this.batchMode;\n clone.instructions = this.instructions.slice();\n clone._activePath = this._activePath.clone();\n clone._transform = this._transform.clone();\n clone._fillStyle = { ...this._fillStyle };\n clone._strokeStyle = { ...this._strokeStyle };\n clone._stateStack = this._stateStack.slice();\n clone._bounds = this._bounds.clone();\n clone._boundsDirty = true;\n return clone;\n }\n /**\n * The current fill style of the graphics context. This can be a color, gradient, pattern, or a more complex style defined by a FillStyle object.\n */\n get fillStyle() {\n return this._fillStyle;\n }\n set fillStyle(value) {\n this._fillStyle = toFillStyle(value, _GraphicsContext.defaultFillStyle);\n }\n /**\n * The current stroke style of the graphics context. Similar to fill styles, stroke styles can encompass colors, gradients, patterns, or more detailed configurations via a StrokeStyle object.\n */\n get strokeStyle() {\n return this._strokeStyle;\n }\n set strokeStyle(value) {\n this._strokeStyle = toStrokeStyle(value, _GraphicsContext.defaultStrokeStyle);\n }\n /**\n * Sets the current fill style of the graphics context. The fill style can be a color, gradient,\n * pattern, or a more complex style defined by a FillStyle object.\n * @param style - The fill style to apply. This can be a simple color, a gradient or pattern object,\n * or a FillStyle or ConvertedFillStyle object.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n setFillStyle(style) {\n this._fillStyle = toFillStyle(style, _GraphicsContext.defaultFillStyle);\n return this;\n }\n /**\n * Sets the current stroke style of the graphics context. Similar to fill styles, stroke styles can\n * encompass colors, gradients, patterns, or more detailed configurations via a StrokeStyle object.\n * @param style - The stroke style to apply. Can be defined as a color, a gradient or pattern,\n * or a StrokeStyle or ConvertedStrokeStyle object.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n setStrokeStyle(style) {\n this._strokeStyle = toFillStyle(style, _GraphicsContext.defaultStrokeStyle);\n return this;\n }\n texture(texture, tint, dx, dy, dw, dh) {\n this.instructions.push({\n action: \"texture\",\n data: {\n image: texture,\n dx: dx || 0,\n dy: dy || 0,\n dw: dw || texture.frame.width,\n dh: dh || texture.frame.height,\n transform: this._transform.clone(),\n alpha: this._fillStyle.alpha,\n style: tint || tint === 0 ? Color.shared.setValue(tint).toNumber() : 16777215\n }\n });\n this.onUpdate();\n return this;\n }\n /**\n * Resets the current path. Any previous path and its commands are discarded and a new path is\n * started. This is typically called before beginning a new shape or series of drawing commands.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n beginPath() {\n this._activePath = new GraphicsPath();\n return this;\n }\n fill(style, alpha) {\n let path;\n const lastInstruction = this.instructions[this.instructions.length - 1];\n if (this._tick === 0 && lastInstruction?.action === \"stroke\") {\n path = lastInstruction.data.path;\n } else {\n path = this._activePath.clone();\n }\n if (!path) return this;\n if (style != null) {\n if (alpha !== void 0 && typeof style === \"number\") {\n deprecation(v8_0_0, \"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead\");\n style = { color: style, alpha };\n }\n this._fillStyle = toFillStyle(style, _GraphicsContext.defaultFillStyle);\n }\n this.instructions.push({\n action: \"fill\",\n // TODO copy fill style!\n data: { style: this.fillStyle, path }\n });\n this.onUpdate();\n this._initNextPathLocation();\n this._tick = 0;\n return this;\n }\n _initNextPathLocation() {\n const { x, y } = this._activePath.getLastPoint(Point.shared);\n this._activePath.clear();\n this._activePath.moveTo(x, y);\n }\n /**\n * Strokes the current path with the current stroke style. This method can take an optional\n * FillInput parameter to define the stroke's appearance, including its color, width, and other properties.\n * @param style - (Optional) The stroke style to apply. Can be defined as a simple color or a more complex style object. If omitted, uses the current stroke style.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n stroke(style) {\n let path;\n const lastInstruction = this.instructions[this.instructions.length - 1];\n if (this._tick === 0 && lastInstruction?.action === \"fill\") {\n path = lastInstruction.data.path;\n } else {\n path = this._activePath.clone();\n }\n if (!path) return this;\n if (style != null) {\n this._strokeStyle = toStrokeStyle(style, _GraphicsContext.defaultStrokeStyle);\n }\n this.instructions.push({\n action: \"stroke\",\n // TODO copy fill style!\n data: { style: this.strokeStyle, path }\n });\n this.onUpdate();\n this._initNextPathLocation();\n this._tick = 0;\n return this;\n }\n /**\n * Applies a cutout to the last drawn shape. This is used to create holes or complex shapes by\n * subtracting a path from the previously drawn path. If a hole is not completely in a shape, it will\n * fail to cut correctly!\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n cut() {\n for (let i = 0; i < 2; i++) {\n const lastInstruction = this.instructions[this.instructions.length - 1 - i];\n const holePath = this._activePath.clone();\n if (lastInstruction) {\n if (lastInstruction.action === \"stroke\" || lastInstruction.action === \"fill\") {\n if (lastInstruction.data.hole) {\n lastInstruction.data.hole.addPath(holePath);\n } else {\n lastInstruction.data.hole = holePath;\n break;\n }\n }\n }\n }\n this._initNextPathLocation();\n return this;\n }\n /**\n * Adds an arc to the current path, which is centered at (x, y) with the specified radius,\n * starting and ending angles, and direction.\n * @param x - The x-coordinate of the arc's center.\n * @param y - The y-coordinate of the arc's center.\n * @param radius - The arc's radius.\n * @param startAngle - The starting angle, in radians.\n * @param endAngle - The ending angle, in radians.\n * @param counterclockwise - (Optional) Specifies whether the arc is drawn counterclockwise (true) or clockwise (false). Defaults to false.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n arc(x, y, radius, startAngle, endAngle, counterclockwise) {\n this._tick++;\n const t = this._transform;\n this._activePath.arc(\n t.a * x + t.c * y + t.tx,\n t.b * x + t.d * y + t.ty,\n radius,\n startAngle,\n endAngle,\n counterclockwise\n );\n return this;\n }\n /**\n * Adds an arc to the current path with the given control points and radius, connected to the previous point\n * by a straight line if necessary.\n * @param x1 - The x-coordinate of the first control point.\n * @param y1 - The y-coordinate of the first control point.\n * @param x2 - The x-coordinate of the second control point.\n * @param y2 - The y-coordinate of the second control point.\n * @param radius - The arc's radius.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n arcTo(x1, y1, x2, y2, radius) {\n this._tick++;\n const t = this._transform;\n this._activePath.arcTo(\n t.a * x1 + t.c * y1 + t.tx,\n t.b * x1 + t.d * y1 + t.ty,\n t.a * x2 + t.c * y2 + t.tx,\n t.b * x2 + t.d * y2 + t.ty,\n radius\n );\n return this;\n }\n /**\n * Adds an SVG-style arc to the path, allowing for elliptical arcs based on the SVG spec.\n * @param rx - The x-radius of the ellipse.\n * @param ry - The y-radius of the ellipse.\n * @param xAxisRotation - The rotation of the ellipse's x-axis relative\n * to the x-axis of the coordinate system, in degrees.\n * @param largeArcFlag - Determines if the arc should be greater than or less than 180 degrees.\n * @param sweepFlag - Determines if the arc should be swept in a positive angle direction.\n * @param x - The x-coordinate of the arc's end point.\n * @param y - The y-coordinate of the arc's end point.\n * @returns The instance of the current object for chaining.\n */\n arcToSvg(rx, ry, xAxisRotation, largeArcFlag, sweepFlag, x, y) {\n this._tick++;\n const t = this._transform;\n this._activePath.arcToSvg(\n rx,\n ry,\n xAxisRotation,\n // should we rotate this with transform??\n largeArcFlag,\n sweepFlag,\n t.a * x + t.c * y + t.tx,\n t.b * x + t.d * y + t.ty\n );\n return this;\n }\n /**\n * Adds a cubic Bezier curve to the path.\n * It requires three points: the first two are control points and the third one is the end point.\n * The starting point is the last point in the current path.\n * @param cp1x - The x-coordinate of the first control point.\n * @param cp1y - The y-coordinate of the first control point.\n * @param cp2x - The x-coordinate of the second control point.\n * @param cp2y - The y-coordinate of the second control point.\n * @param x - The x-coordinate of the end point.\n * @param y - The y-coordinate of the end point.\n * @param smoothness - Optional parameter to adjust the smoothness of the curve.\n * @returns The instance of the current object for chaining.\n */\n bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, smoothness) {\n this._tick++;\n const t = this._transform;\n this._activePath.bezierCurveTo(\n t.a * cp1x + t.c * cp1y + t.tx,\n t.b * cp1x + t.d * cp1y + t.ty,\n t.a * cp2x + t.c * cp2y + t.tx,\n t.b * cp2x + t.d * cp2y + t.ty,\n t.a * x + t.c * y + t.tx,\n t.b * x + t.d * y + t.ty,\n smoothness\n );\n return this;\n }\n /**\n * Closes the current path by drawing a straight line back to the start.\n * If the shape is already closed or there are no points in the path, this method does nothing.\n * @returns The instance of the current object for chaining.\n */\n closePath() {\n this._tick++;\n this._activePath?.closePath();\n return this;\n }\n /**\n * Draws an ellipse at the specified location and with the given x and y radii.\n * An optional transformation can be applied, allowing for rotation, scaling, and translation.\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 radiusX - The horizontal radius of the ellipse.\n * @param radiusY - The vertical radius of the ellipse.\n * @returns The instance of the current object for chaining.\n */\n ellipse(x, y, radiusX, radiusY) {\n this._tick++;\n this._activePath.ellipse(x, y, radiusX, radiusY, this._transform.clone());\n return this;\n }\n /**\n * Draws a circle shape. This method adds a new circle path to the current drawing.\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 The instance of the current object for chaining.\n */\n circle(x, y, radius) {\n this._tick++;\n this._activePath.circle(x, y, radius, this._transform.clone());\n return this;\n }\n /**\n * Adds another `GraphicsPath` to this path, optionally applying a transformation.\n * @param path - The `GraphicsPath` to add.\n * @returns The instance of the current object for chaining.\n */\n path(path) {\n this._tick++;\n this._activePath.addPath(path, this._transform.clone());\n return this;\n }\n /**\n * Connects the current point to a new point with a straight line. This method updates the current path.\n * @param x - The x-coordinate of the new point to connect to.\n * @param y - The y-coordinate of the new point to connect to.\n * @returns The instance of the current object for chaining.\n */\n lineTo(x, y) {\n this._tick++;\n const t = this._transform;\n this._activePath.lineTo(\n t.a * x + t.c * y + t.tx,\n t.b * x + t.d * y + t.ty\n );\n return this;\n }\n /**\n * Sets the starting point for a new sub-path. Any subsequent drawing commands are considered part of this path.\n * @param x - The x-coordinate for the starting point.\n * @param y - The y-coordinate for the starting point.\n * @returns The instance of the current object for chaining.\n */\n moveTo(x, y) {\n this._tick++;\n const t = this._transform;\n const instructions = this._activePath.instructions;\n const transformedX = t.a * x + t.c * y + t.tx;\n const transformedY = t.b * x + t.d * y + t.ty;\n if (instructions.length === 1 && instructions[0].action === \"moveTo\") {\n instructions[0].data[0] = transformedX;\n instructions[0].data[1] = transformedY;\n return this;\n }\n this._activePath.moveTo(\n transformedX,\n transformedY\n );\n return this;\n }\n /**\n * Adds a quadratic curve to the path. It requires two points: the control point and the end point.\n * The starting point is the last point in the current path.\n * @param cpx - The x-coordinate of the control point.\n * @param cpy - The y-coordinate of the control point.\n * @param x - The x-coordinate of the end point.\n * @param y - The y-coordinate of the end point.\n * @param smoothness - Optional parameter to adjust the smoothness of the curve.\n * @returns The instance of the current object for chaining.\n */\n quadraticCurveTo(cpx, cpy, x, y, smoothness) {\n this._tick++;\n const t = this._transform;\n this._activePath.quadraticCurveTo(\n t.a * cpx + t.c * cpy + t.tx,\n t.b * cpx + t.d * cpy + t.ty,\n t.a * x + t.c * y + t.tx,\n t.b * x + t.d * y + t.ty,\n smoothness\n );\n return this;\n }\n /**\n * Draws a rectangle shape. This method adds a new rectangle path to the current drawing.\n * @param x - The x-coordinate of the top-left corner of the rectangle.\n * @param y - The y-coordinate of the top-left corner of the rectangle.\n * @param w - The width of the rectangle.\n * @param h - The height of the rectangle.\n * @returns The instance of the current object for chaining.\n */\n rect(x, y, w, h) {\n this._tick++;\n this._activePath.rect(x, y, w, h, this._transform.clone());\n return this;\n }\n /**\n * Draws a rectangle with rounded corners.\n * The corner radius can be specified to determine how rounded the corners should be.\n * An optional transformation can be applied, which allows for rotation, scaling, and translation of the rectangle.\n * @param x - The x-coordinate of the top-left corner of the rectangle.\n * @param y - The y-coordinate of the top-left corner of the rectangle.\n * @param w - The width of the rectangle.\n * @param h - The height of the rectangle.\n * @param radius - The radius of the rectangle's corners. If not specified, corners will be sharp.\n * @returns The instance of the current object for chaining.\n */\n roundRect(x, y, w, h, radius) {\n this._tick++;\n this._activePath.roundRect(x, y, w, h, radius, this._transform.clone());\n return this;\n }\n /**\n * Draws a polygon shape by specifying a sequence of points. This method allows for the creation of complex polygons,\n * which can be both open and closed. An optional transformation can be applied, enabling the polygon to be scaled,\n * rotated, or translated as needed.\n * @param points - An array of numbers, or an array of PointData objects eg [{x,y}, {x,y}, {x,y}]\n * representing the x and y coordinates, of the polygon's vertices, in sequence.\n * @param close - A boolean indicating whether to close the polygon path. True by default.\n */\n poly(points, close) {\n this._tick++;\n this._activePath.poly(points, close, this._transform.clone());\n return this;\n }\n /**\n * Draws a regular polygon with a specified number of sides. All sides and angles are equal.\n * @param x - The x-coordinate of the center of the polygon.\n * @param y - The y-coordinate of the center of the polygon.\n * @param radius - The radius of the circumscribed circle of the polygon.\n * @param sides - The number of sides of the polygon. Must be 3 or more.\n * @param rotation - The rotation angle of the polygon, in radians. Zero by default.\n * @param transform - An optional `Matrix` object to apply a transformation to the polygon.\n * @returns The instance of the current object for chaining.\n */\n regularPoly(x, y, radius, sides, rotation = 0, transform) {\n this._tick++;\n this._activePath.regularPoly(x, y, radius, sides, rotation, transform);\n return this;\n }\n /**\n * Draws a polygon with rounded corners.\n * Similar to `regularPoly` but with the ability to round the corners of the polygon.\n * @param x - The x-coordinate of the center of the polygon.\n * @param y - The y-coordinate of the center of the polygon.\n * @param radius - The radius of the circumscribed circle of the polygon.\n * @param sides - The number of sides of the polygon. Must be 3 or more.\n * @param corner - The radius of the rounding of the corners.\n * @param rotation - The rotation angle of the polygon, in radians. Zero by default.\n * @returns The instance of the current object for chaining.\n */\n roundPoly(x, y, radius, sides, corner, rotation) {\n this._tick++;\n this._activePath.roundPoly(x, y, radius, sides, corner, rotation);\n return this;\n }\n /**\n * Draws a shape with rounded corners. This function supports custom radius for each corner of the shape.\n * Optionally, corners can be rounded using a quadratic curve instead of an arc, providing a different aesthetic.\n * @param points - An array of `RoundedPoint` representing the corners of the shape to draw.\n * A minimum of 3 points is required.\n * @param radius - The default radius for the corners.\n * This radius is applied to all corners unless overridden in `points`.\n * @param useQuadratic - If set to true, rounded corners are drawn using a quadraticCurve\n * method instead of an arc method. Defaults to false.\n * @param smoothness - Specifies the smoothness of the curve when `useQuadratic` is true.\n * Higher values make the curve smoother.\n * @returns The instance of the current object for chaining.\n */\n roundShape(points, radius, useQuadratic, smoothness) {\n this._tick++;\n this._activePath.roundShape(points, radius, useQuadratic, smoothness);\n return this;\n }\n /**\n * Draw Rectangle with fillet corners. This is much like rounded rectangle\n * however it support negative numbers as well for the corner radius.\n * @param x - Upper left corner of rect\n * @param y - Upper right corner of rect\n * @param width - Width of rect\n * @param height - Height of rect\n * @param fillet - accept negative or positive values\n */\n filletRect(x, y, width, height, fillet) {\n this._tick++;\n this._activePath.filletRect(x, y, width, height, fillet);\n return this;\n }\n /**\n * Draw Rectangle with chamfer corners. These are angled corners.\n * @param x - Upper left corner of rect\n * @param y - Upper right corner of rect\n * @param width - Width of rect\n * @param height - Height of rect\n * @param chamfer - non-zero real number, size of corner cutout\n * @param transform\n */\n chamferRect(x, y, width, height, chamfer, transform) {\n this._tick++;\n this._activePath.chamferRect(x, y, width, height, chamfer, transform);\n return this;\n }\n /**\n * Draws a star shape centered at a specified location. This method allows for the creation\n * of stars with a variable number of points, outer radius, optional inner radius, and rotation.\n * The star is drawn as a closed polygon with alternating outer and inner vertices to create the star's points.\n * An optional transformation can be applied to scale, rotate, or translate the star as needed.\n * @param x - The x-coordinate of the center of the star.\n * @param y - The y-coordinate of the center of the star.\n * @param points - The number of points of the star.\n * @param radius - The outer radius of the star (distance from the center to the outer points).\n * @param innerRadius - Optional. The inner radius of the star\n * (distance from the center to the inner points between the outer points).\n * If not provided, defaults to half of the `radius`.\n * @param rotation - Optional. The rotation of the star in radians, where 0 is aligned with the y-axis.\n * Defaults to 0, meaning one point is directly upward.\n * @returns The instance of the current object for chaining further drawing commands.\n */\n star(x, y, points, radius, innerRadius = 0, rotation = 0) {\n this._tick++;\n this._activePath.star(x, y, points, radius, innerRadius, rotation, this._transform.clone());\n return this;\n }\n /**\n * Parses and renders an SVG string into the graphics context. This allows for complex shapes and paths\n * defined in SVG format to be drawn within the graphics context.\n * @param svg - The SVG string to be parsed and rendered.\n */\n svg(svg) {\n this._tick++;\n SVGParser(svg, this);\n return this;\n }\n /**\n * Restores the most recently saved graphics state by popping the top of the graphics state stack.\n * This includes transformations, fill styles, and stroke styles.\n */\n restore() {\n const state = this._stateStack.pop();\n if (state) {\n this._transform = state.transform;\n this._fillStyle = state.fillStyle;\n this._strokeStyle = state.strokeStyle;\n }\n return this;\n }\n /** Saves the current graphics state, including transformations, fill styles, and stroke styles, onto a stack. */\n save() {\n this._stateStack.push({\n transform: this._transform.clone(),\n fillStyle: { ...this._fillStyle },\n strokeStyle: { ...this._strokeStyle }\n });\n return this;\n }\n /**\n * Returns the current transformation matrix of the graphics context.\n * @returns The current transformation matrix.\n */\n getTransform() {\n return this._transform;\n }\n /**\n * Resets the current transformation matrix to the identity matrix, effectively removing any transformations (rotation, scaling, translation) previously applied.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n resetTransform() {\n this._transform.identity();\n return this;\n }\n /**\n * Applies a rotation transformation to the graphics context around the current origin.\n * @param angle - The angle of rotation in radians.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n rotate(angle) {\n this._transform.rotate(angle);\n return this;\n }\n /**\n * Applies a scaling transformation to the graphics context, scaling drawings by x horizontally and by y vertically.\n * @param x - The scale factor in the horizontal direction.\n * @param y - (Optional) The scale factor in the vertical direction. If not specified, the x value is used for both directions.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n scale(x, y = x) {\n this._transform.scale(x, y);\n return this;\n }\n setTransform(a, b, c, d, dx, dy) {\n if (a instanceof Matrix) {\n this._transform.set(a.a, a.b, a.c, a.d, a.tx, a.ty);\n return this;\n }\n this._transform.set(a, b, c, d, dx, dy);\n return this;\n }\n transform(a, b, c, d, dx, dy) {\n if (a instanceof Matrix) {\n this._transform.append(a);\n return this;\n }\n tempMatrix.set(a, b, c, d, dx, dy);\n this._transform.append(tempMatrix);\n return this;\n }\n /**\n * Applies a translation transformation to the graphics context, moving the origin by the specified amounts.\n * @param x - The amount to translate in the horizontal direction.\n * @param y - (Optional) The amount to translate in the vertical direction. If not specified, the x value is used for both directions.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n translate(x, y = x) {\n this._transform.translate(x, y);\n return this;\n }\n /**\n * Clears all drawing commands from the graphics context, effectively resetting it. This includes clearing the path,\n * and optionally resetting transformations to the identity matrix.\n * @returns The instance of the current GraphicsContext for method chaining.\n */\n clear() {\n this._activePath.clear();\n this.instructions.length = 0;\n this.resetTransform();\n this.onUpdate();\n return this;\n }\n onUpdate() {\n this._boundsDirty = true;\n this.dirty = true;\n this.emit(\"update\", this, 16);\n }\n /** The bounds of the graphic shape. */\n get bounds() {\n if (!this._boundsDirty) return this._bounds;\n this._boundsDirty = false;\n const bounds = this._bounds;\n bounds.clear();\n for (let i = 0; i < this.instructions.length; i++) {\n const instruction = this.instructions[i];\n const action = instruction.action;\n if (action === \"fill\") {\n const data = instruction.data;\n bounds.addBounds(data.path.bounds);\n } else if (action === \"texture\") {\n const data = instruction.data;\n bounds.addFrame(data.dx, data.dy, data.dx + data.dw, data.dy + data.dh, data.transform);\n }\n if (action === \"stroke\") {\n const data = instruction.data;\n const alignment = data.style.alignment;\n let outerPadding = data.style.width * (1 - alignment);\n if (data.style.join === \"miter\") {\n outerPadding *= getMaxMiterRatio(data.path, data.style.miterLimit);\n }\n const _bounds = data.path.bounds;\n bounds.addFrame(\n _bounds.minX - outerPadding,\n _bounds.minY - outerPadding,\n _bounds.maxX + outerPadding,\n _bounds.maxY + outerPadding\n );\n }\n }\n if (!bounds.isValid) {\n bounds.set(0, 0, 0, 0);\n }\n return bounds;\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 containsPoint(point) {\n if (!this.bounds.containsPoint(point.x, point.y)) return false;\n const instructions = this.instructions;\n let hasHit = false;\n for (let k = 0; k < instructions.length; k++) {\n const instruction = instructions[k];\n const data = instruction.data;\n const path = data.path;\n if (!instruction.action || !path) continue;\n const style = data.style;\n const shapes = path.shapePath.shapePrimitives;\n for (let i = 0; i < shapes.length; i++) {\n const shape = shapes[i].shape;\n if (!style || !shape) continue;\n const transform = shapes[i].transform;\n const transformedPoint = transform ? transform.applyInverse(point, tmpPoint) : point;\n if (instruction.action === \"fill\") {\n hasHit = shape.contains(transformedPoint.x, transformedPoint.y);\n } else {\n const strokeStyle = style;\n hasHit = shape.strokeContains(transformedPoint.x, transformedPoint.y, strokeStyle.width, strokeStyle.alignment);\n }\n const holes = data.hole;\n if (holes) {\n const holeShapes = holes.shapePath?.shapePrimitives;\n if (holeShapes) {\n for (let j = 0; j < holeShapes.length; j++) {\n if (holeShapes[j].shape.contains(transformedPoint.x, transformedPoint.y)) {\n hasHit = false;\n }\n }\n }\n }\n if (hasHit) {\n return true;\n }\n }\n }\n return hasHit;\n }\n /** Unloads the GPU data from the graphics context. */\n unload() {\n this.emit(\"unload\", this);\n for (const key in this._gpuData) {\n this._gpuData[key]?.destroy();\n }\n this._gpuData = /* @__PURE__ */ Object.create(null);\n }\n /**\n * Destroys the GraphicsData object.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @example\n * context.destroy();\n * context.destroy(true);\n * context.destroy({ texture: true, textureSource: true });\n */\n destroy(options = false) {\n if (this.destroyed) return;\n this.destroyed = true;\n this._stateStack.length = 0;\n this._transform = null;\n this.unload();\n this.emit(\"destroy\", this);\n this.removeAllListeners();\n const destroyTexture = typeof options === \"boolean\" ? options : options?.texture;\n if (destroyTexture) {\n const destroyTextureSource = typeof options === \"boolean\" ? options : options?.textureSource;\n if (this._fillStyle.texture) {\n this._fillStyle.fill && \"uid\" in this._fillStyle.fill ? this._fillStyle.fill.destroy() : this._fillStyle.texture.destroy(destroyTextureSource);\n }\n if (this._strokeStyle.texture) {\n this._strokeStyle.fill && \"uid\" in this._strokeStyle.fill ? this._strokeStyle.fill.destroy() : this._strokeStyle.texture.destroy(destroyTextureSource);\n }\n }\n this._fillStyle = null;\n this._strokeStyle = null;\n this.instructions = null;\n this._activePath = null;\n this._bounds = null;\n this._stateStack = null;\n this.customShader = null;\n this._transform = null;\n }\n};\n/** The default fill style to use when none is provided. */\n_GraphicsContext.defaultFillStyle = {\n /** The color to use for the fill. */\n color: 16777215,\n /** The alpha value to use for the fill. */\n alpha: 1,\n /** The texture to use for the fill. */\n texture: Texture.WHITE,\n /** The matrix to apply. */\n matrix: null,\n /** The fill pattern to use. */\n fill: null,\n /** Whether coordinates are 'global' or 'local' */\n textureSpace: \"local\"\n};\n/** The default stroke style to use when none is provided. */\n_GraphicsContext.defaultStrokeStyle = {\n /** The width of the stroke. */\n width: 1,\n /** The color to use for the stroke. */\n color: 16777215,\n /** The alpha value to use for the stroke. */\n alpha: 1,\n /** The alignment of the stroke. */\n alignment: 0.5,\n /** The miter limit to use. */\n miterLimit: 10,\n /** The line cap style to use. */\n cap: \"butt\",\n /** The line join style to use. */\n join: \"miter\",\n /** The texture to use for the fill. */\n texture: Texture.WHITE,\n /** The matrix to apply. */\n matrix: null,\n /** The fill pattern to use. */\n fill: null,\n /** Whether coordinates are 'global' or 'local' */\n textureSpace: \"local\",\n /** If the stroke is a pixel line. */\n pixelLine: false\n};\nlet GraphicsContext = _GraphicsContext;\n\nexport { GraphicsContext };\n//# sourceMappingURL=GraphicsContext.mjs.map\n","import { DOMAdapter } from '../../../../environment/adapter.mjs';\n\n\"use strict\";\nlet canUseNewCanvasBlendModesValue;\nfunction createColoredCanvas(color) {\n const canvas = DOMAdapter.get().createCanvas(6, 1);\n const context = canvas.getContext(\"2d\");\n context.fillStyle = color;\n context.fillRect(0, 0, 6, 1);\n return canvas;\n}\nfunction canUseNewCanvasBlendModes() {\n if (canUseNewCanvasBlendModesValue !== void 0) {\n return canUseNewCanvasBlendModesValue;\n }\n try {\n const magenta = createColoredCanvas(\"#ff00ff\");\n const yellow = createColoredCanvas(\"#ffff00\");\n const canvas = DOMAdapter.get().createCanvas(6, 1);\n const context = canvas.getContext(\"2d\");\n context.globalCompositeOperation = \"multiply\";\n context.drawImage(magenta, 0, 0);\n context.drawImage(yellow, 2, 0);\n const imageData = context.getImageData(2, 0, 1, 1);\n if (!imageData) {\n canUseNewCanvasBlendModesValue = false;\n } else {\n const data = imageData.data;\n canUseNewCanvasBlendModesValue = data[0] === 255 && data[1] === 0 && data[2] === 0;\n }\n } catch (_error) {\n canUseNewCanvasBlendModesValue = false;\n }\n return canUseNewCanvasBlendModesValue;\n}\n\nexport { canUseNewCanvasBlendModes };\n//# sourceMappingURL=canUseNewCanvasBlendModes.mjs.map\n","import { Color } from '../../../../color/Color.mjs';\nimport { DOMAdapter } from '../../../../environment/adapter.mjs';\nimport { groupD8 } from '../../../../maths/matrix/groupD8.mjs';\nimport { canUseNewCanvasBlendModes } from './canUseNewCanvasBlendModes.mjs';\n\n\"use strict\";\nconst canvasUtils = {\n canvas: null,\n convertTintToImage: false,\n cacheStepsPerColorChannel: 8,\n canUseMultiply: canUseNewCanvasBlendModes(),\n tintMethod: null,\n _canvasSourceCache: /* @__PURE__ */ new WeakMap(),\n _unpremultipliedCache: /* @__PURE__ */ new WeakMap(),\n getCanvasSource: (texture) => {\n const source = texture.source;\n const resource = source?.resource;\n if (!resource) {\n return null;\n }\n const isPMA = source.alphaMode === \"premultiplied-alpha\";\n const resourceWidth = source.resourceWidth ?? source.pixelWidth;\n const resourceHeight = source.resourceHeight ?? source.pixelHeight;\n const needsResize = resourceWidth !== source.pixelWidth || resourceHeight !== source.pixelHeight;\n if (isPMA) {\n if (resource instanceof HTMLCanvasElement || typeof OffscreenCanvas !== \"undefined\" && resource instanceof OffscreenCanvas) {\n if (!needsResize) {\n return resource;\n }\n }\n const cached = canvasUtils._unpremultipliedCache.get(source);\n if (cached?.resourceId === source._resourceId) {\n return cached.canvas;\n }\n }\n if (resource instanceof Uint8Array || resource instanceof Uint8ClampedArray || resource instanceof Int8Array || resource instanceof Uint16Array || resource instanceof Int16Array || resource instanceof Uint32Array || resource instanceof Int32Array || resource instanceof Float32Array || resource instanceof ArrayBuffer) {\n const cached = canvasUtils._canvasSourceCache.get(source);\n if (cached?.resourceId === source._resourceId) {\n return cached.canvas;\n }\n const canvas = DOMAdapter.get().createCanvas(source.pixelWidth, source.pixelHeight);\n const context = canvas.getContext(\"2d\");\n const imageData = context.createImageData(source.pixelWidth, source.pixelHeight);\n const data = imageData.data;\n const bytes = resource instanceof ArrayBuffer ? new Uint8Array(resource) : new Uint8Array(resource.buffer, resource.byteOffset, resource.byteLength);\n if (source.format === \"bgra8unorm\") {\n for (let i = 0; i < data.length && i + 3 < bytes.length; i += 4) {\n data[i] = bytes[i + 2];\n data[i + 1] = bytes[i + 1];\n data[i + 2] = bytes[i];\n data[i + 3] = bytes[i + 3];\n }\n } else {\n data.set(bytes.subarray(0, data.length));\n }\n context.putImageData(imageData, 0, 0);\n canvasUtils._canvasSourceCache.set(source, { canvas, resourceId: source._resourceId });\n return canvas;\n }\n if (isPMA) {\n const canvas = DOMAdapter.get().createCanvas(source.pixelWidth, source.pixelHeight);\n const context = canvas.getContext(\"2d\", { willReadFrequently: true });\n canvas.width = source.pixelWidth;\n canvas.height = source.pixelHeight;\n context.drawImage(resource, 0, 0);\n const imageData = context.getImageData(0, 0, canvas.width, canvas.height);\n const data = imageData.data;\n for (let i = 0; i < data.length; i += 4) {\n const a = data[i + 3];\n if (a > 0) {\n const alphaInv = 255 / a;\n data[i] = Math.min(255, data[i] * alphaInv + 0.5);\n data[i + 1] = Math.min(255, data[i + 1] * alphaInv + 0.5);\n data[i + 2] = Math.min(255, data[i + 2] * alphaInv + 0.5);\n }\n }\n context.putImageData(imageData, 0, 0);\n canvasUtils._unpremultipliedCache.set(source, { canvas, resourceId: source._resourceId });\n return canvas;\n }\n if (needsResize) {\n const cached = canvasUtils._canvasSourceCache.get(source);\n if (cached?.resourceId === source._resourceId) {\n return cached.canvas;\n }\n const canvas = DOMAdapter.get().createCanvas(source.pixelWidth, source.pixelHeight);\n const context = canvas.getContext(\"2d\");\n canvas.width = source.pixelWidth;\n canvas.height = source.pixelHeight;\n context.drawImage(resource, 0, 0);\n canvasUtils._canvasSourceCache.set(source, { canvas, resourceId: source._resourceId });\n return canvas;\n }\n return resource;\n },\n getTintedCanvas: (sprite, color) => {\n const texture = sprite.texture;\n const stringColor = Color.shared.setValue(color).toHex();\n const cache = texture.tintCache || (texture.tintCache = {});\n const cachedCanvas = cache[stringColor];\n const resourceId = texture.source._resourceId;\n if (cachedCanvas?.tintId === resourceId) {\n return cachedCanvas;\n }\n const canvas = cachedCanvas && \"getContext\" in cachedCanvas ? cachedCanvas : DOMAdapter.get().createCanvas();\n canvasUtils.tintMethod(texture, color, canvas);\n canvas.tintId = resourceId;\n if (canvasUtils.convertTintToImage && canvas.toDataURL !== void 0) {\n const tintImage = DOMAdapter.get().createImage();\n tintImage.src = canvas.toDataURL();\n tintImage.tintId = resourceId;\n cache[stringColor] = tintImage;\n } else {\n cache[stringColor] = canvas;\n }\n return cache[stringColor];\n },\n getTintedPattern: (texture, color) => {\n const stringColor = Color.shared.setValue(color).toHex();\n const cache = texture.patternCache || (texture.patternCache = {});\n const resourceId = texture.source._resourceId;\n let pattern = cache[stringColor];\n if (pattern?.tintId === resourceId) {\n return pattern;\n }\n if (!canvasUtils.canvas) {\n canvasUtils.canvas = DOMAdapter.get().createCanvas();\n }\n canvasUtils.tintMethod(texture, color, canvasUtils.canvas);\n const context = canvasUtils.canvas.getContext(\"2d\");\n pattern = context.createPattern(canvasUtils.canvas, \"repeat\");\n pattern.tintId = resourceId;\n cache[stringColor] = pattern;\n return pattern;\n },\n /**\n * Applies a transform to a CanvasPattern.\n * @param pattern - The pattern to apply the transform to.\n * @param matrix - The matrix to apply.\n * @param matrix.a\n * @param matrix.b\n * @param matrix.c\n * @param matrix.d\n * @param matrix.tx\n * @param matrix.ty\n * @param invert\n */\n applyPatternTransform: (pattern, matrix, invert = true) => {\n if (!matrix) return;\n const patternAny = pattern;\n if (!patternAny.setTransform) return;\n const DOMMatrixCtor = globalThis.DOMMatrix;\n if (!DOMMatrixCtor) return;\n const domMatrix = new DOMMatrixCtor([matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty]);\n patternAny.setTransform(invert ? domMatrix.inverse() : domMatrix);\n },\n tintWithMultiply: (texture, color, canvas) => {\n const context = canvas.getContext(\"2d\");\n const crop = texture.frame.clone();\n const resolution = texture.source._resolution ?? texture.source.resolution ?? 1;\n const rotate = texture.rotate;\n crop.x *= resolution;\n crop.y *= resolution;\n crop.width *= resolution;\n crop.height *= resolution;\n const isVertical = groupD8.isVertical(rotate);\n const outWidth = isVertical ? crop.height : crop.width;\n const outHeight = isVertical ? crop.width : crop.height;\n canvas.width = Math.ceil(outWidth);\n canvas.height = Math.ceil(outHeight);\n context.save();\n context.fillStyle = Color.shared.setValue(color).toHex();\n context.fillRect(0, 0, outWidth, outHeight);\n context.globalCompositeOperation = \"multiply\";\n const source = canvasUtils.getCanvasSource(texture);\n if (!source) {\n context.restore();\n return;\n }\n if (rotate) {\n canvasUtils._applyInverseRotation(context, rotate, crop.width, crop.height);\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.globalCompositeOperation = \"destination-atop\";\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 tintWithOverlay: (texture, color, canvas) => {\n const context = canvas.getContext(\"2d\");\n const crop = texture.frame.clone();\n const resolution = texture.source._resolution ?? texture.source.resolution ?? 1;\n const rotate = texture.rotate;\n crop.x *= resolution;\n crop.y *= resolution;\n crop.width *= resolution;\n crop.height *= resolution;\n const isVertical = groupD8.isVertical(rotate);\n const outWidth = isVertical ? crop.height : crop.width;\n const outHeight = isVertical ? crop.width : crop.height;\n canvas.width = Math.ceil(outWidth);\n canvas.height = Math.ceil(outHeight);\n context.save();\n context.globalCompositeOperation = \"copy\";\n context.fillStyle = Color.shared.setValue(color).toHex();\n context.fillRect(0, 0, outWidth, outHeight);\n context.globalCompositeOperation = \"destination-atop\";\n const source = canvasUtils.getCanvasSource(texture);\n if (!source) {\n context.restore();\n return;\n }\n if (rotate) {\n canvasUtils._applyInverseRotation(context, rotate, crop.width, crop.height);\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 tintWithPerPixel: (texture, color, canvas) => {\n const context = canvas.getContext(\"2d\");\n const crop = texture.frame.clone();\n const resolution = texture.source._resolution ?? texture.source.resolution ?? 1;\n const rotate = texture.rotate;\n crop.x *= resolution;\n crop.y *= resolution;\n crop.width *= resolution;\n crop.height *= resolution;\n const isVertical = groupD8.isVertical(rotate);\n const outWidth = isVertical ? crop.height : crop.width;\n const outHeight = isVertical ? crop.width : crop.height;\n canvas.width = Math.ceil(outWidth);\n canvas.height = Math.ceil(outHeight);\n context.save();\n context.globalCompositeOperation = \"copy\";\n const source = canvasUtils.getCanvasSource(texture);\n if (!source) {\n context.restore();\n return;\n }\n if (rotate) {\n canvasUtils._applyInverseRotation(context, rotate, crop.width, crop.height);\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 const r = color >> 16 & 255;\n const g = color >> 8 & 255;\n const b = color & 255;\n const imageData = context.getImageData(0, 0, outWidth, outHeight);\n const data = imageData.data;\n for (let i = 0; i < data.length; i += 4) {\n data[i] = data[i] * r / 255;\n data[i + 1] = data[i + 1] * g / 255;\n data[i + 2] = data[i + 2] * b / 255;\n }\n context.putImageData(imageData, 0, 0);\n },\n /**\n * Applies inverse rotation transform to context for texture packer rotation compensation.\n * Supports all 16 groupD8 symmetries (rotations and reflections).\n * @param context - Canvas 2D context\n * @param rotate - The groupD8 rotation value\n * @param srcWidth - Source crop width (before rotation)\n * @param srcHeight - Source crop height (before rotation)\n */\n _applyInverseRotation: (context, rotate, srcWidth, srcHeight) => {\n const inv = groupD8.inv(rotate);\n const a = groupD8.uX(inv);\n const b = groupD8.uY(inv);\n const c = groupD8.vX(inv);\n const d = groupD8.vY(inv);\n const tx = -Math.min(0, a * srcWidth, c * srcHeight, a * srcWidth + c * srcHeight);\n const ty = -Math.min(0, b * srcWidth, d * srcHeight, b * srcWidth + d * srcHeight);\n context.transform(a, b, c, d, tx, ty);\n }\n};\ncanvasUtils.tintMethod = canvasUtils.canUseMultiply ? canvasUtils.tintWithMultiply : canvasUtils.tintWithPerPixel;\n\nexport { canvasUtils };\n//# sourceMappingURL=canvasUtils.mjs.map\n","import { DOMAdapter } from '../../../../environment/adapter.mjs';\nimport { nextPow2 } from '../../../../maths/misc/pow2.mjs';\nimport { GlobalResourceRegistry } from '../../../../utils/pool/GlobalResourceRegistry.mjs';\n\n\"use strict\";\nclass CanvasPoolClass {\n constructor(canvasOptions) {\n this._canvasPool = /* @__PURE__ */ Object.create(null);\n this.canvasOptions = canvasOptions || {};\n this.enableFullScreen = false;\n }\n /**\n * Creates texture with params that were specified in pool constructor.\n * @param pixelWidth - Width of texture in pixels.\n * @param pixelHeight - Height of texture in pixels.\n */\n _createCanvasAndContext(pixelWidth, pixelHeight) {\n const canvas = DOMAdapter.get().createCanvas();\n canvas.width = pixelWidth;\n canvas.height = pixelHeight;\n const context = canvas.getContext(\"2d\");\n return { canvas, context };\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 * @returns The new render texture.\n */\n getOptimalCanvasAndContext(minWidth, minHeight, resolution = 1) {\n minWidth = Math.ceil(minWidth * resolution - 1e-6);\n minHeight = Math.ceil(minHeight * resolution - 1e-6);\n minWidth = nextPow2(minWidth);\n minHeight = nextPow2(minHeight);\n const key = (minWidth << 17) + (minHeight << 1);\n if (!this._canvasPool[key]) {\n this._canvasPool[key] = [];\n }\n let canvasAndContext = this._canvasPool[key].pop();\n if (!canvasAndContext) {\n canvasAndContext = this._createCanvasAndContext(minWidth, minHeight);\n }\n return canvasAndContext;\n }\n /**\n * Place a render texture back into the pool.\n * @param canvasAndContext\n */\n returnCanvasAndContext(canvasAndContext) {\n const canvas = canvasAndContext.canvas;\n const { width, height } = canvas;\n const key = (width << 17) + (height << 1);\n canvasAndContext.context.resetTransform();\n canvasAndContext.context.clearRect(0, 0, width, height);\n this._canvasPool[key].push(canvasAndContext);\n }\n clear() {\n this._canvasPool = {};\n }\n}\nconst CanvasPool = new CanvasPoolClass();\nGlobalResourceRegistry.register(CanvasPool);\n\nexport { CanvasPool, CanvasPoolClass };\n//# sourceMappingURL=CanvasPool.mjs.map\n","import { TexturePool } from '../../../rendering/renderers/shared/texture/TexturePool.mjs';\nimport { Bounds } from '../../container/bounds/Bounds.mjs';\n\n\"use strict\";\nconst tempBounds = new Bounds();\nfunction getPo2TextureFromSource(image, width, height, resolution, autoGenerateMipmaps = false) {\n const bounds = tempBounds;\n bounds.minX = 0;\n bounds.minY = 0;\n bounds.maxX = image.width / resolution | 0;\n bounds.maxY = image.height / resolution | 0;\n const texture = TexturePool.getOptimalTexture(\n bounds.width,\n bounds.height,\n resolution,\n false,\n autoGenerateMipmaps\n );\n texture.source.uploadMethodId = \"image\";\n texture.source.resource = image;\n texture.source.alphaMode = \"premultiply-alpha-on-upload\";\n texture.frame.width = width / resolution;\n texture.frame.height = height / resolution;\n texture.source.emit(\"update\", texture.source);\n texture.updateUvs();\n return texture;\n}\n\nexport { getPo2TextureFromSource };\n//# sourceMappingURL=getPo2TextureFromSource.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { InstructionSet } from '../../../rendering/renderers/shared/instructions/InstructionSet.mjs';\nimport { GCManagedHash } from '../../../utils/data/GCManagedHash.mjs';\n\n\"use strict\";\nclass CanvasGraphicsContext {\n constructor() {\n /**\n * Whether this context can be batched.\n * @advanced\n */\n this.isBatchable = false;\n }\n /**\n * Reset cached canvas data.\n * @advanced\n */\n reset() {\n this.isBatchable = false;\n this.context = null;\n if (this.graphicsData) {\n this.graphicsData.destroy();\n this.graphicsData = null;\n }\n }\n /**\n * Destroy the cached data.\n * @advanced\n */\n destroy() {\n this.reset();\n }\n}\nclass CanvasGraphicsContextRenderData {\n constructor() {\n /**\n * Instructions for canvas rendering.\n * @advanced\n */\n this.instructions = new InstructionSet();\n }\n /**\n * Initialize render data.\n * @advanced\n */\n init() {\n this.instructions.reset();\n }\n /**\n * Destroy render data.\n * @advanced\n */\n destroy() {\n this.instructions.destroy();\n this.instructions = null;\n }\n}\nconst _CanvasGraphicsContextSystem = class _CanvasGraphicsContextSystem {\n constructor(renderer) {\n this._renderer = renderer;\n this._managedContexts = new GCManagedHash({ renderer, type: \"resource\", name: \"graphicsContext\" });\n }\n /**\n * Runner init called, update the default options\n * @ignore\n */\n init(options) {\n _CanvasGraphicsContextSystem.defaultOptions.bezierSmoothness = options?.bezierSmoothness ?? _CanvasGraphicsContextSystem.defaultOptions.bezierSmoothness;\n }\n /**\n * Returns the render data for a given GraphicsContext.\n * @param context - The GraphicsContext to get the render data for.\n * @internal\n */\n getContextRenderData(context) {\n const gpuContext = this.getGpuContext(context);\n return gpuContext.graphicsData || this._initContextRenderData(context);\n }\n /**\n * Updates the GPU context for a given GraphicsContext.\n * @param context - The GraphicsContext to update.\n * @returns The updated CanvasGraphicsContext.\n * @internal\n */\n updateGpuContext(context) {\n const gpuData = context._gpuData;\n const hasContext = !!gpuData[this._renderer.uid];\n const gpuContext = gpuData[this._renderer.uid] || this._initContext(context);\n if (context.dirty || !hasContext) {\n if (hasContext) {\n gpuContext.reset();\n }\n gpuContext.isBatchable = false;\n context.dirty = false;\n }\n return gpuContext;\n }\n /**\n * Returns the CanvasGraphicsContext for a given GraphicsContext.\n * If it does not exist, it will initialize a new one.\n * @param context - The GraphicsContext to get the CanvasGraphicsContext for.\n * @returns The CanvasGraphicsContext for the given GraphicsContext.\n * @internal\n */\n getGpuContext(context) {\n const gpuData = context._gpuData;\n return gpuData[this._renderer.uid] || this._initContext(context);\n }\n _initContextRenderData(context) {\n const renderData = new CanvasGraphicsContextRenderData();\n const gpuContext = this.getGpuContext(context);\n gpuContext.graphicsData = renderData;\n renderData.init();\n return renderData;\n }\n _initContext(context) {\n const gpuContext = new CanvasGraphicsContext();\n gpuContext.context = context;\n context._gpuData[this._renderer.uid] = gpuContext;\n this._managedContexts.add(context);\n return gpuContext;\n }\n destroy() {\n this._managedContexts.destroy();\n this._renderer = null;\n }\n};\n/** @ignore */\n_CanvasGraphicsContextSystem.extension = {\n type: [\n ExtensionType.CanvasSystem\n ],\n name: \"graphicsContext\"\n};\n/** The default options for the GraphicsContextSystem. */\n_CanvasGraphicsContextSystem.defaultOptions = {\n /**\n * A value from 0 to 1 that controls the smoothness of bezier curves (the higher the smoother)\n * @default 0.5\n */\n bezierSmoothness: 0.5\n};\nlet CanvasGraphicsContextSystem = _CanvasGraphicsContextSystem;\n\nexport { CanvasGraphicsContextSystem };\n//# sourceMappingURL=CanvasGraphicsContextSystem.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { State } from '../../../rendering/renderers/shared/state/State.mjs';\nimport { GCManagedHash } from '../../../utils/data/GCManagedHash.mjs';\n\n\"use strict\";\nclass CanvasGraphicsPipe {\n constructor(renderer, adaptor) {\n this.state = State.for2d();\n this.renderer = renderer;\n this._adaptor = adaptor;\n this.renderer.runners.contextChange.add(this);\n this._managedGraphics = new GCManagedHash({ renderer, type: \"renderable\", priority: -1, name: \"graphics\" });\n }\n contextChange() {\n this._adaptor.contextChange(this.renderer);\n }\n validateRenderable(_graphics) {\n return false;\n }\n addRenderable(graphics, instructionSet) {\n this._managedGraphics.add(graphics);\n this.renderer.renderPipes.batch.break(instructionSet);\n instructionSet.add(graphics);\n }\n updateRenderable(_graphics) {\n }\n execute(graphics) {\n if (!graphics.isRenderable) return;\n this._adaptor.execute(this, graphics);\n }\n destroy() {\n this._managedGraphics.destroy();\n this.renderer = null;\n this._adaptor.destroy();\n this._adaptor = null;\n }\n}\n/** @ignore */\nCanvasGraphicsPipe.extension = {\n type: [\n ExtensionType.CanvasPipes\n ],\n name: \"graphics\"\n};\n\nexport { CanvasGraphicsPipe };\n//# sourceMappingURL=CanvasGraphicsPipe.mjs.map\n","\"use strict\";\nfunction colorToUniform(rgb, alpha, out, offset) {\n out[offset++] = (rgb >> 16 & 255) / 255;\n out[offset++] = (rgb >> 8 & 255) / 255;\n out[offset++] = (rgb & 255) / 255;\n out[offset++] = alpha;\n}\nfunction color32BitToUniform(abgr, out, offset) {\n const alpha = (abgr >> 24 & 255) / 255;\n out[offset++] = (abgr & 255) / 255 * alpha;\n out[offset++] = (abgr >> 8 & 255) / 255 * alpha;\n out[offset++] = (abgr >> 16 & 255) / 255 * alpha;\n out[offset++] = alpha;\n}\n\nexport { color32BitToUniform, colorToUniform };\n//# sourceMappingURL=colorToUniform.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { State } from '../../../rendering/renderers/shared/state/State.mjs';\nimport { GCManagedHash } from '../../../utils/data/GCManagedHash.mjs';\nimport { BigPool } from '../../../utils/pool/PoolGroup.mjs';\nimport { color32BitToUniform } from '../gpu/colorToUniform.mjs';\nimport { BatchableGraphics } from './BatchableGraphics.mjs';\n\n\"use strict\";\nclass GraphicsGpuData {\n constructor() {\n this.batches = [];\n this.batched = false;\n }\n destroy() {\n this.batches.forEach((batch) => {\n BigPool.return(batch);\n });\n this.batches.length = 0;\n }\n}\nclass GraphicsPipe {\n constructor(renderer, adaptor) {\n this.state = State.for2d();\n this.renderer = renderer;\n this._adaptor = adaptor;\n this.renderer.runners.contextChange.add(this);\n this._managedGraphics = new GCManagedHash({ renderer, type: \"renderable\", priority: -1, name: \"graphics\" });\n }\n contextChange() {\n this._adaptor.contextChange(this.renderer);\n }\n validateRenderable(graphics) {\n const context = graphics.context;\n const wasBatched = !!graphics._gpuData;\n const contextSystem = this.renderer.graphicsContext;\n const gpuContext = contextSystem.updateGpuContext(context);\n if (gpuContext.isBatchable || wasBatched !== gpuContext.isBatchable) {\n return true;\n }\n return false;\n }\n addRenderable(graphics, instructionSet) {\n const contextSystem = this.renderer.graphicsContext;\n const gpuContext = contextSystem.updateGpuContext(graphics.context);\n if (graphics.didViewUpdate) {\n this._rebuild(graphics);\n }\n if (gpuContext.isBatchable) {\n this._addToBatcher(graphics, instructionSet);\n } else {\n this.renderer.renderPipes.batch.break(instructionSet);\n instructionSet.add(graphics);\n }\n }\n updateRenderable(graphics) {\n const gpuData = this._getGpuDataForRenderable(graphics);\n const batches = gpuData.batches;\n for (let i = 0; i < batches.length; i++) {\n const batch = batches[i];\n batch._batcher.updateElement(batch);\n }\n }\n execute(graphics) {\n if (!graphics.isRenderable) return;\n const renderer = this.renderer;\n const context = graphics.context;\n const contextSystem = renderer.graphicsContext;\n if (!contextSystem.getGpuContext(context).batches.length) {\n return;\n }\n const shader = context.customShader || this._adaptor.shader;\n this.state.blendMode = graphics.groupBlendMode;\n const localUniforms = shader.resources.localUniforms.uniforms;\n localUniforms.uTransformMatrix = graphics.groupTransform;\n localUniforms.uRound = renderer._roundPixels | graphics._roundPixels;\n color32BitToUniform(\n graphics.groupColorAlpha,\n localUniforms.uColor,\n 0\n );\n this._adaptor.execute(this, graphics);\n }\n _rebuild(graphics) {\n const gpuData = this._getGpuDataForRenderable(graphics);\n const contextSystem = this.renderer.graphicsContext;\n const gpuContext = contextSystem.updateGpuContext(graphics.context);\n gpuData.destroy();\n if (gpuContext.isBatchable) {\n this._updateBatchesForRenderable(graphics, gpuData);\n }\n }\n _addToBatcher(graphics, instructionSet) {\n const batchPipe = this.renderer.renderPipes.batch;\n const batches = this._getGpuDataForRenderable(graphics).batches;\n for (let i = 0; i < batches.length; i++) {\n const batch = batches[i];\n batchPipe.addToBatch(batch, instructionSet);\n }\n }\n _getGpuDataForRenderable(graphics) {\n return graphics._gpuData[this.renderer.uid] || this._initGpuDataForRenderable(graphics);\n }\n _initGpuDataForRenderable(graphics) {\n const gpuData = new GraphicsGpuData();\n graphics._gpuData[this.renderer.uid] = gpuData;\n this._managedGraphics.add(graphics);\n return gpuData;\n }\n _updateBatchesForRenderable(graphics, gpuData) {\n const context = graphics.context;\n const contextSystem = this.renderer.graphicsContext;\n const gpuContext = contextSystem.getGpuContext(context);\n const roundPixels = this.renderer._roundPixels | graphics._roundPixels;\n gpuData.batches = gpuContext.batches.map((batch) => {\n const batchClone = BigPool.get(BatchableGraphics);\n batch.copyTo(batchClone);\n batchClone.renderable = graphics;\n batchClone.roundPixels = roundPixels;\n return batchClone;\n });\n }\n destroy() {\n this._managedGraphics.destroy();\n this.renderer = null;\n this._adaptor.destroy();\n this._adaptor = null;\n this.state = null;\n }\n}\n/** @ignore */\nGraphicsPipe.extension = {\n type: [\n ExtensionType.WebGLPipes,\n ExtensionType.WebGPUPipes\n ],\n name: \"graphics\"\n};\n\nexport { GraphicsGpuData, GraphicsPipe };\n//# sourceMappingURL=GraphicsPipe.mjs.map\n","import { extensions } from '../../extensions/Extensions.mjs';\nimport { CanvasGraphicsContextSystem } from './canvas/CanvasGraphicsContextSystem.mjs';\nimport { CanvasGraphicsPipe } from './canvas/CanvasGraphicsPipe.mjs';\nimport { GraphicsContextSystem } from './shared/GraphicsContextSystem.mjs';\nimport { GraphicsPipe } from './shared/GraphicsPipe.mjs';\n\n\"use strict\";\nextensions.add(CanvasGraphicsPipe);\nextensions.add(GraphicsPipe);\nextensions.add(CanvasGraphicsContextSystem);\nextensions.add(GraphicsContextSystem);\n//# sourceMappingURL=init.mjs.map\n","import { deprecation, v8_0_0 } from '../../../utils/logging/deprecation.mjs';\nimport { ViewContainer } from '../../view/ViewContainer.mjs';\nimport { GraphicsContext } from './GraphicsContext.mjs';\nimport '../init.mjs';\n\n\"use strict\";\nclass Graphics extends ViewContainer {\n /**\n * Creates a new Graphics object.\n * @param options - Options for the Graphics.\n */\n constructor(options) {\n if (options instanceof GraphicsContext) {\n options = { context: options };\n }\n const { context, roundPixels, ...rest } = options || {};\n super({\n label: \"Graphics\",\n ...rest\n });\n /** @internal */\n this.renderPipeId = \"graphics\";\n if (!context) {\n this.context = this._ownedContext = new GraphicsContext();\n this.context.autoGarbageCollect = this.autoGarbageCollect;\n } else {\n this.context = context;\n }\n this.didViewUpdate = true;\n this.allowChildren = false;\n this.roundPixels = roundPixels ?? false;\n }\n set context(context) {\n if (context === this._context) return;\n if (this._context) {\n this._context.off(\"update\", this.onViewUpdate, this);\n this._context.off(\"unload\", this.unload, this);\n }\n this._context = context;\n this._context.on(\"update\", this.onViewUpdate, this);\n this._context.on(\"unload\", this.unload, this);\n this.onViewUpdate();\n }\n /**\n * The underlying graphics context used for drawing operations.\n * Controls how shapes and paths are rendered.\n * @example\n * ```ts\n * // Create a shared context\n * const sharedContext = new GraphicsContext();\n *\n * // Create graphics objects sharing the same context\n * const graphics1 = new Graphics();\n * const graphics2 = new Graphics();\n *\n * // Assign shared context\n * graphics1.context = sharedContext;\n * graphics2.context = sharedContext;\n *\n * // Both graphics will show the same shapes\n * sharedContext\n * .rect(0, 0, 100, 100)\n * .fill({ color: 0xff0000 });\n * ```\n * @see {@link GraphicsContext} For drawing operations\n * @see {@link GraphicsOptions} For context configuration\n */\n get context() {\n return this._context;\n }\n /**\n * The local bounds of the graphics object.\n * Returns the boundaries after all graphical operations but before any transforms.\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Draw a shape\n * graphics\n * .rect(0, 0, 100, 100)\n * .fill({ color: 0xff0000 });\n *\n * // Get bounds information\n * const bounds = graphics.bounds;\n * console.log(bounds.width); // 100\n * console.log(bounds.height); // 100\n * ```\n * @readonly\n * @see {@link Bounds} For bounds operations\n * @see {@link Container#getBounds} For transformed bounds\n */\n get bounds() {\n return this._context.bounds;\n }\n /**\n * Graphics objects do not need to update their bounds as the context handles this.\n * @private\n */\n updateBounds() {\n }\n /**\n * Checks if the object contains the given point.\n * Returns true if the point lies within the Graphics object's rendered area.\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Draw a shape\n * graphics\n * .rect(0, 0, 100, 100)\n * .fill({ color: 0xff0000 });\n *\n * // Check point intersection\n * if (graphics.containsPoint({ x: 50, y: 50 })) {\n * console.log('Point is inside rectangle!');\n * }\n * ```\n * @param point - The point to check in local coordinates\n * @returns True if the point is inside the Graphics object\n * @see {@link Graphics#bounds} For bounding box checks\n * @see {@link PointData} For point data structure\n */\n containsPoint(point) {\n return this._context.containsPoint(point);\n }\n /**\n * Destroys this graphics renderable and optionally its context.\n * @param options - Options parameter. A boolean will act as if all options\n *\n * If the context was created by this graphics and `destroy(false)` or `destroy()` is called\n * then the context will still be destroyed.\n *\n * If you want to explicitly not destroy this context that this graphics created,\n * then you should pass destroy({ context: false })\n *\n * If the context was passed in as an argument to the constructor then it will not be destroyed\n * @example\n * ```ts\n * // Destroy the graphics and its context\n * graphics.destroy();\n * graphics.destroy(true);\n * graphics.destroy({ context: true, texture: true, textureSource: true });\n * ```\n */\n destroy(options) {\n if (this._ownedContext && !options) {\n this._ownedContext.destroy(options);\n } else if (options === true || options?.context === true) {\n this._context.destroy(options);\n }\n this._ownedContext = null;\n this._context = null;\n super.destroy(options);\n }\n /**\n * @param now - The current time in milliseconds.\n * @internal\n */\n _onTouch(now) {\n this._gcLastUsed = now;\n this._context._gcLastUsed = now;\n }\n _callContextMethod(method, args) {\n this.context[method](...args);\n return this;\n }\n // --------------------------------------- GraphicsContext methods ---------------------------------------\n /**\n * Sets the current fill style of the graphics context.\n * The fill style can be a color, gradient, pattern, or a complex style object.\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Basic color fill\n * graphics\n * .setFillStyle({ color: 0xff0000 }) // Red fill\n * .rect(0, 0, 100, 100)\n * .fill();\n *\n * // Gradient fill\n * const gradient = new FillGradient({\n * end: { x: 1, y: 0 },\n * colorStops: [\n * { offset: 0, color: 0xff0000 }, // Red at start\n * { offset: 0.5, color: 0x00ff00 }, // Green at middle\n * { offset: 1, color: 0x0000ff }, // Blue at end\n * ],\n * });\n *\n * graphics\n * .setFillStyle(gradient)\n * .circle(100, 100, 50)\n * .fill();\n *\n * // Pattern fill\n * const pattern = new FillPattern(texture);\n * graphics\n * .setFillStyle({\n * fill: pattern,\n * alpha: 0.5\n * })\n * .rect(0, 0, 200, 200)\n * .fill();\n * ```\n * @param {FillInput} args - The fill style to apply\n * @returns The Graphics instance for chaining\n * @see {@link FillStyle} For fill style options\n * @see {@link FillGradient} For gradient fills\n * @see {@link FillPattern} For pattern fills\n */\n setFillStyle(...args) {\n return this._callContextMethod(\"setFillStyle\", args);\n }\n /**\n * Sets the current stroke style of the graphics context.\n * Similar to fill styles, stroke styles can encompass colors, gradients, patterns, or more detailed configurations.\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Basic color stroke\n * graphics\n * .setStrokeStyle({\n * width: 2,\n * color: 0x000000\n * })\n * .rect(0, 0, 100, 100)\n * .stroke();\n *\n * // Complex stroke style\n * graphics\n * .setStrokeStyle({\n * width: 4,\n * color: 0xff0000,\n * alpha: 0.5,\n * join: 'round',\n * cap: 'round',\n * alignment: 0.5\n * })\n * .circle(100, 100, 50)\n * .stroke();\n *\n * // Gradient stroke\n * const gradient = new FillGradient({\n * end: { x: 1, y: 0 },\n * colorStops: [\n * { offset: 0, color: 0xff0000 }, // Red at start\n * { offset: 0.5, color: 0x00ff00 }, // Green at middle\n * { offset: 1, color: 0x0000ff }, // Blue at end\n * ],\n * });\n *\n * graphics\n * .setStrokeStyle({\n * width: 10,\n * fill: gradient\n * })\n * .poly([0,0, 100,50, 0,100])\n * .stroke();\n * ```\n * @param {StrokeInput} args - The stroke style to apply\n * @returns The Graphics instance for chaining\n * @see {@link StrokeStyle} For stroke style options\n * @see {@link FillGradient} For gradient strokes\n * @see {@link FillPattern} For pattern strokes\n */\n setStrokeStyle(...args) {\n return this._callContextMethod(\"setStrokeStyle\", args);\n }\n fill(...args) {\n return this._callContextMethod(\"fill\", args);\n }\n /**\n * Strokes the current path with the current stroke style or specified style.\n * Outlines the shape using the stroke settings.\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Stroke with direct color\n * graphics\n * .circle(50, 50, 25)\n * .stroke({\n * width: 2,\n * color: 0xff0000\n * }); // 2px red stroke\n *\n * // Fill with texture\n * graphics\n * .rect(0, 0, 100, 100)\n * .stroke(myTexture); // Fill with texture\n *\n * // Stroke with gradient\n * const gradient = new FillGradient({\n * end: { x: 1, y: 0 },\n * colorStops: [\n * { offset: 0, color: 0xff0000 },\n * { offset: 0.5, color: 0x00ff00 },\n * { offset: 1, color: 0x0000ff },\n * ],\n * });\n *\n * graphics\n * .rect(0, 0, 100, 100)\n * .stroke({\n * width: 4,\n * fill: gradient,\n * alignment: 0.5,\n * join: 'round'\n * });\n * ```\n * @param {StrokeStyle} args - Optional stroke style to apply. Can be:\n * - A stroke style object with width, color, etc.\n * - A gradient\n * - A pattern\n * If omitted, uses current stroke style.\n * @returns The Graphics instance for chaining\n * @see {@link StrokeStyle} For stroke style options\n * @see {@link FillGradient} For gradient strokes\n * @see {@link setStrokeStyle} For setting default stroke style\n */\n stroke(...args) {\n return this._callContextMethod(\"stroke\", args);\n }\n texture(...args) {\n return this._callContextMethod(\"texture\", args);\n }\n /**\n * Resets the current path. Any previous path and its commands are discarded and a new path is\n * started. This is typically called before beginning a new shape or series of drawing commands.\n * @example\n * ```ts\n * const graphics = new Graphics();\n * graphics\n * .circle(150, 150, 50)\n * .fill({ color: 0x00ff00 })\n * .beginPath() // Starts a new path\n * .circle(250, 150, 50)\n * .fill({ color: 0x0000ff });\n * ```\n * @returns The Graphics instance for chaining\n * @see {@link Graphics#moveTo} For starting a new subpath\n * @see {@link Graphics#closePath} For closing the current path\n */\n beginPath() {\n return this._callContextMethod(\"beginPath\", []);\n }\n /**\n * Applies a cutout to the last drawn shape. This is used to create holes or complex shapes by\n * subtracting a path from the previously drawn path.\n *\n * If a hole is not completely in a shape, it will fail to cut correctly.\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Draw outer circle\n * graphics\n * .circle(100, 100, 50)\n * .fill({ color: 0xff0000 });\n * .circle(100, 100, 25) // Inner circle\n * .cut() // Cuts out the inner circle from the outer circle\n * ```\n */\n cut() {\n return this._callContextMethod(\"cut\", []);\n }\n arc(...args) {\n return this._callContextMethod(\"arc\", args);\n }\n arcTo(...args) {\n return this._callContextMethod(\"arcTo\", args);\n }\n arcToSvg(...args) {\n return this._callContextMethod(\"arcToSvg\", args);\n }\n bezierCurveTo(...args) {\n return this._callContextMethod(\"bezierCurveTo\", args);\n }\n /**\n * Closes the current path by drawing a straight line back to the start point.\n *\n * This is useful for completing shapes and ensuring they are properly closed for fills.\n * @example\n * ```ts\n * // Create a triangle with closed path\n * const graphics = new Graphics();\n * graphics\n * .moveTo(50, 50)\n * .lineTo(100, 100)\n * .lineTo(0, 100)\n * .closePath()\n * ```\n * @returns The Graphics instance for method chaining\n * @see {@link Graphics#beginPath} For starting a new path\n * @see {@link Graphics#fill} For filling closed paths\n * @see {@link Graphics#stroke} For stroking paths\n */\n closePath() {\n return this._callContextMethod(\"closePath\", []);\n }\n ellipse(...args) {\n return this._callContextMethod(\"ellipse\", args);\n }\n circle(...args) {\n return this._callContextMethod(\"circle\", args);\n }\n path(...args) {\n return this._callContextMethod(\"path\", args);\n }\n lineTo(...args) {\n return this._callContextMethod(\"lineTo\", args);\n }\n moveTo(...args) {\n return this._callContextMethod(\"moveTo\", args);\n }\n quadraticCurveTo(...args) {\n return this._callContextMethod(\"quadraticCurveTo\", args);\n }\n rect(...args) {\n return this._callContextMethod(\"rect\", args);\n }\n roundRect(...args) {\n return this._callContextMethod(\"roundRect\", args);\n }\n poly(...args) {\n return this._callContextMethod(\"poly\", args);\n }\n regularPoly(...args) {\n return this._callContextMethod(\"regularPoly\", args);\n }\n roundPoly(...args) {\n return this._callContextMethod(\"roundPoly\", args);\n }\n roundShape(...args) {\n return this._callContextMethod(\"roundShape\", args);\n }\n filletRect(...args) {\n return this._callContextMethod(\"filletRect\", args);\n }\n chamferRect(...args) {\n return this._callContextMethod(\"chamferRect\", args);\n }\n star(...args) {\n return this._callContextMethod(\"star\", args);\n }\n svg(...args) {\n return this._callContextMethod(\"svg\", args);\n }\n restore(...args) {\n return this._callContextMethod(\"restore\", args);\n }\n /**\n * Saves the current graphics state onto a stack. The state includes:\n * - Current transformation matrix\n * - Current fill style\n * - Current stroke style\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Save state before complex operations\n * graphics.save();\n *\n * // Create transformed and styled shape\n * graphics\n * .translateTransform(100, 100)\n * .rotateTransform(Math.PI / 4)\n * .setFillStyle({\n * color: 0xff0000,\n * alpha: 0.5\n * })\n * .rect(-25, -25, 50, 50)\n * .fill();\n *\n * // Restore to original state\n * graphics.restore();\n *\n * // Continue drawing with previous state\n * graphics\n * .circle(50, 50, 25)\n * .fill();\n * ```\n * @returns The Graphics instance for method chaining\n * @see {@link Graphics#restore} For restoring the saved state\n * @see {@link Graphics#setTransform} For setting transformations\n */\n save() {\n return this._callContextMethod(\"save\", []);\n }\n /**\n * Returns the current transformation matrix of the graphics context.\n * This matrix represents all accumulated transformations including translate, scale, and rotate.\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Apply some transformations\n * graphics\n * .translateTransform(100, 100)\n * .rotateTransform(Math.PI / 4);\n *\n * // Get the current transform matrix\n * const matrix = graphics.getTransform();\n * console.log(matrix.tx, matrix.ty); // 100, 100\n *\n * // Use the matrix for other operations\n * graphics\n * .setTransform(matrix)\n * .circle(0, 0, 50)\n * .fill({ color: 0xff0000 });\n * ```\n * @returns The current transformation matrix.\n * @see {@link Graphics#setTransform} For setting the transform matrix\n * @see {@link Matrix} For matrix operations\n */\n getTransform() {\n return this.context.getTransform();\n }\n /**\n * Resets the current transformation matrix to the identity matrix, effectively removing\n * any transformations (rotation, scaling, translation) previously applied.\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Apply transformations\n * graphics\n * .translateTransform(100, 100)\n * .scaleTransform(2, 2)\n * .circle(0, 0, 25)\n * .fill({ color: 0xff0000 });\n * // Reset transform to default state\n * graphics\n * .resetTransform()\n * .circle(50, 50, 25) // Will draw at actual coordinates\n * .fill({ color: 0x00ff00 });\n * ```\n * @returns The Graphics instance for method chaining\n * @see {@link Graphics#getTransform} For getting the current transform\n * @see {@link Graphics#setTransform} For setting a specific transform\n * @see {@link Graphics#save} For saving the current transform state\n * @see {@link Graphics#restore} For restoring a previous transform state\n */\n resetTransform() {\n return this._callContextMethod(\"resetTransform\", []);\n }\n rotateTransform(...args) {\n return this._callContextMethod(\"rotate\", args);\n }\n scaleTransform(...args) {\n return this._callContextMethod(\"scale\", args);\n }\n setTransform(...args) {\n return this._callContextMethod(\"setTransform\", args);\n }\n transform(...args) {\n return this._callContextMethod(\"transform\", args);\n }\n translateTransform(...args) {\n return this._callContextMethod(\"translate\", args);\n }\n /**\n * Clears all drawing commands from the graphics context, effectively resetting it.\n * This includes clearing the current path, fill style, stroke style, and transformations.\n *\n * > [!NOTE] Graphics objects are not designed to be continuously cleared and redrawn.\n * > Instead, they are intended to be used for static or semi-static graphics that\n * > can be redrawn as needed. Frequent clearing and redrawing may lead to performance issues.\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Draw some shapes\n * graphics\n * .circle(100, 100, 50)\n * .fill({ color: 0xff0000 })\n * .rect(200, 100, 100, 50)\n * .fill({ color: 0x00ff00 });\n *\n * // Clear all graphics\n * graphics.clear();\n *\n * // Start fresh with new shapes\n * graphics\n * .circle(150, 150, 30)\n * .fill({ color: 0x0000ff });\n * ```\n * @returns The Graphics instance for method chaining\n * @see {@link Graphics#beginPath} For starting a new path without clearing styles\n * @see {@link Graphics#save} For saving the current state\n * @see {@link Graphics#restore} For restoring a previous state\n */\n clear() {\n return this._callContextMethod(\"clear\", []);\n }\n /**\n * Gets or sets the current fill style for the graphics context. The fill style determines\n * how shapes are filled when using the fill() method.\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Basic color fill\n * graphics.fillStyle = {\n * color: 0xff0000, // Red\n * alpha: 1\n * };\n *\n * // Using gradients\n * const gradient = new FillGradient({\n * end: { x: 0, y: 1 }, // Vertical gradient\n * stops: [\n * { offset: 0, color: 0xff0000, alpha: 1 }, // Start color\n * { offset: 1, color: 0x0000ff, alpha: 1 } // End color\n * ]\n * });\n *\n * graphics.fillStyle = {\n * fill: gradient,\n * alpha: 0.8\n * };\n *\n * // Using patterns\n * graphics.fillStyle = {\n * texture: myTexture,\n * alpha: 1,\n * matrix: new Matrix()\n * .scale(0.5, 0.5)\n * .rotate(Math.PI / 4)\n * };\n * ```\n * @type {ConvertedFillStyle}\n * @see {@link FillStyle} For all available fill style options\n * @see {@link FillGradient} For creating gradient fills\n * @see {@link Graphics#fill} For applying the fill to paths\n */\n get fillStyle() {\n return this._context.fillStyle;\n }\n set fillStyle(value) {\n this._context.fillStyle = value;\n }\n /**\n * Gets or sets the current stroke style for the graphics context. The stroke style determines\n * how paths are outlined when using the stroke() method.\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Basic stroke style\n * graphics.strokeStyle = {\n * width: 2,\n * color: 0xff0000,\n * alpha: 1\n * };\n *\n * // Using with gradients\n * const gradient = new FillGradient({\n * end: { x: 0, y: 1 },\n * stops: [\n * { offset: 0, color: 0xff0000, alpha: 1 },\n * { offset: 1, color: 0x0000ff, alpha: 1 }\n * ]\n * });\n *\n * graphics.strokeStyle = {\n * width: 4,\n * fill: gradient,\n * alignment: 0.5,\n * join: 'round',\n * cap: 'round'\n * };\n *\n * // Complex stroke settings\n * graphics.strokeStyle = {\n * width: 6,\n * color: 0x00ff00,\n * alpha: 0.5,\n * join: 'miter',\n * miterLimit: 10,\n * };\n * ```\n * @see {@link StrokeStyle} For all available stroke style options\n * @see {@link Graphics#stroke} For applying the stroke to paths\n */\n get strokeStyle() {\n return this._context.strokeStyle;\n }\n set strokeStyle(value) {\n this._context.strokeStyle = value;\n }\n /**\n * Creates a new Graphics object that copies the current graphics content.\n * The clone can either share the same context (shallow clone) or have its own independent\n * context (deep clone).\n * @example\n * ```ts\n * const graphics = new Graphics();\n *\n * // Create original graphics content\n * graphics\n * .circle(100, 100, 50)\n * .fill({ color: 0xff0000 });\n *\n * // Create a shallow clone (shared context)\n * const shallowClone = graphics.clone();\n *\n * // Changes to original affect the clone\n * graphics\n * .circle(200, 100, 30)\n * .fill({ color: 0x00ff00 });\n *\n * // Create a deep clone (independent context)\n * const deepClone = graphics.clone(true);\n *\n * // Modify deep clone independently\n * deepClone\n * .translateTransform(100, 100)\n * .circle(0, 0, 40)\n * .fill({ color: 0x0000ff });\n * ```\n * @param deep - Whether to create a deep clone of the graphics object.\n * If false (default), the context will be shared between objects.\n * If true, creates an independent copy of the context.\n * @returns A new Graphics instance with either shared or copied context\n * @see {@link Graphics#context} For accessing the underlying graphics context\n * @see {@link GraphicsContext} For understanding the shared context behavior\n */\n clone(deep = false) {\n if (deep) {\n return new Graphics(this._context.clone());\n }\n this._ownedContext = null;\n const clone = new Graphics(this._context);\n return clone;\n }\n // -------- v7 deprecations ---------\n /**\n * @param width\n * @param color\n * @param alpha\n * @deprecated since 8.0.0 Use {@link Graphics#setStrokeStyle} instead\n */\n lineStyle(width, color, alpha) {\n deprecation(v8_0_0, \"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.\");\n const strokeStyle = {};\n width && (strokeStyle.width = width);\n color && (strokeStyle.color = color);\n alpha && (strokeStyle.alpha = alpha);\n this.context.strokeStyle = strokeStyle;\n return this;\n }\n /**\n * @param color\n * @param alpha\n * @deprecated since 8.0.0 Use {@link Graphics#fill} instead\n */\n beginFill(color, alpha) {\n deprecation(v8_0_0, \"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.\");\n const fillStyle = {};\n if (color !== void 0) fillStyle.color = color;\n if (alpha !== void 0) fillStyle.alpha = alpha;\n this.context.fillStyle = fillStyle;\n return this;\n }\n /**\n * @deprecated since 8.0.0 Use {@link Graphics#fill} instead\n */\n endFill() {\n deprecation(v8_0_0, \"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.\");\n this.context.fill();\n const strokeStyle = this.context.strokeStyle;\n if (strokeStyle.width !== GraphicsContext.defaultStrokeStyle.width || strokeStyle.color !== GraphicsContext.defaultStrokeStyle.color || strokeStyle.alpha !== GraphicsContext.defaultStrokeStyle.alpha) {\n this.context.stroke();\n }\n return this;\n }\n /**\n * @param {...any} args\n * @deprecated since 8.0.0 Use {@link Graphics#circle} instead\n */\n drawCircle(...args) {\n deprecation(v8_0_0, \"Graphics#drawCircle has been renamed to Graphics#circle\");\n return this._callContextMethod(\"circle\", args);\n }\n /**\n * @param {...any} args\n * @deprecated since 8.0.0 Use {@link Graphics#ellipse} instead\n */\n drawEllipse(...args) {\n deprecation(v8_0_0, \"Graphics#drawEllipse has been renamed to Graphics#ellipse\");\n return this._callContextMethod(\"ellipse\", args);\n }\n /**\n * @param {...any} args\n * @deprecated since 8.0.0 Use {@link Graphics#poly} instead\n */\n drawPolygon(...args) {\n deprecation(v8_0_0, \"Graphics#drawPolygon has been renamed to Graphics#poly\");\n return this._callContextMethod(\"poly\", args);\n }\n /**\n * @param {...any} args\n * @deprecated since 8.0.0 Use {@link Graphics#rect} instead\n */\n drawRect(...args) {\n deprecation(v8_0_0, \"Graphics#drawRect has been renamed to Graphics#rect\");\n return this._callContextMethod(\"rect\", args);\n }\n /**\n * @param {...any} args\n * @deprecated since 8.0.0 Use {@link Graphics#roundRect} instead\n */\n drawRoundedRect(...args) {\n deprecation(v8_0_0, \"Graphics#drawRoundedRect has been renamed to Graphics#roundRect\");\n return this._callContextMethod(\"roundRect\", args);\n }\n /**\n * @param {...any} args\n * @deprecated since 8.0.0 Use {@link Graphics#star} instead\n */\n drawStar(...args) {\n deprecation(v8_0_0, \"Graphics#drawStar has been renamed to Graphics#star\");\n return this._callContextMethod(\"star\", args);\n }\n}\n\nexport { Graphics };\n//# sourceMappingURL=Graphics.mjs.map\n","import { ObservablePoint } from '../../maths/point/ObservablePoint.mjs';\nimport { deprecation, v8_0_0 } from '../../utils/logging/deprecation.mjs';\nimport { ViewContainer } from '../view/ViewContainer.mjs';\n\n\"use strict\";\nclass AbstractText extends ViewContainer {\n constructor(options, styleClass) {\n const { text, resolution, style, anchor, width, height, roundPixels, ...rest } = options;\n super({\n ...rest\n });\n /** @internal */\n this.batched = true;\n /** @internal */\n this._resolution = null;\n /** @internal */\n this._autoResolution = true;\n /** @internal */\n this._didTextUpdate = true;\n this._styleClass = styleClass;\n this.text = text ?? \"\";\n this.style = style;\n this.resolution = resolution ?? null;\n this.allowChildren = false;\n this._anchor = new ObservablePoint(\n {\n _onUpdate: () => {\n this.onViewUpdate();\n }\n }\n );\n if (anchor) this.anchor = anchor;\n this.roundPixels = roundPixels ?? false;\n if (width !== void 0) this.width = width;\n if (height !== void 0) this.height = height;\n }\n /**\n * The anchor point of the text that controls the origin point for positioning and rotation.\n * Can be a number (same value for x/y) or a PointData object.\n * - (0,0) is top-left\n * - (0.5,0.5) is center\n * - (1,1) is bottom-right\n * ```ts\n * // Set anchor to center\n * const text = new Text({\n * text: 'Hello Pixi!',\n * anchor: 0.5 // Same as { x: 0.5, y: 0.5 }\n * });\n * // Set anchor to top-left\n * const text2 = new Text({\n * text: 'Hello Pixi!',\n * anchor: { x: 0, y: 0 } // Top-left corner\n * });\n * // Set anchor to bottom-right\n * const text3 = new Text({\n * text: 'Hello Pixi!',\n * anchor: { x: 1, y: 1 } // Bottom-right corner\n * });\n * ```\n * @default { x: 0, y: 0 }\n */\n get anchor() {\n return this._anchor;\n }\n set anchor(value) {\n typeof value === \"number\" ? this._anchor.set(value) : this._anchor.copyFrom(value);\n }\n /**\n * The text content to display. Use '\\n' for line breaks.\n * Accepts strings, numbers, or objects with toString() method.\n * @example\n * ```ts\n * const text = new Text({\n * text: 'Hello Pixi!',\n * });\n * const multilineText = new Text({\n * text: 'Line 1\\nLine 2\\nLine 3',\n * });\n * const numberText = new Text({\n * text: 12345, // Will be converted to '12345'\n * });\n * const objectText = new Text({\n * text: { toString: () => 'Object Text' }, // Custom toString\n * });\n *\n * // Update text dynamically\n * text.text = 'Updated Text'; // Re-renders with new text\n * text.text = 67890; // Updates to '67890'\n * text.text = { toString: () => 'Dynamic Text' }; // Uses custom toString method\n * // Clear text\n * text.text = ''; // Clears the text\n * ```\n * @default ''\n */\n set text(value) {\n value = value.toString();\n if (this._text === value) return;\n this._text = value;\n this.onViewUpdate();\n }\n get text() {\n return this._text;\n }\n /**\n * The resolution/device pixel ratio for rendering.\n * Higher values result in sharper text at the cost of performance.\n * Set to null for auto-resolution based on device.\n * @example\n * ```ts\n * const text = new Text({\n * text: 'Hello Pixi!',\n * resolution: 2 // High DPI for sharper text\n * });\n * const autoResText = new Text({\n * text: 'Auto Resolution',\n * resolution: null // Use device's pixel ratio\n * });\n * ```\n * @default null\n */\n set resolution(value) {\n this._autoResolution = value === null;\n this._resolution = value;\n this.onViewUpdate();\n }\n get resolution() {\n return this._resolution;\n }\n get style() {\n return this._style;\n }\n /**\n * The style configuration for the text.\n * Can be a TextStyle instance or a configuration object.\n * Supports canvas text styles, HTML text styles, and bitmap text styles.\n * @example\n * ```ts\n * const text = new Text({\n * text: 'Styled Text',\n * style: {\n * fontSize: 24,\n * fill: 0xff1010, // Red color\n * fontFamily: 'Arial',\n * align: 'center', // Center alignment\n * stroke: { color: '#4a1850', width: 5 }, // Purple stroke\n * dropShadow: {\n * color: '#000000', // Black shadow\n * blur: 4, // Shadow blur\n * distance: 6 // Shadow distance\n * }\n * }\n * });\n * const htmlText = new HTMLText({\n * text: 'HTML Styled Text',\n * style: {\n * fontSize: '20px',\n * fill: 'blue',\n * fontFamily: 'Verdana',\n * }\n * });\n * const bitmapText = new BitmapText({\n * text: 'Bitmap Styled Text',\n * style: {\n * fontName: 'Arial',\n * fontSize: 32,\n * }\n * })\n *\n * // Update style dynamically\n * text.style = {\n * fontSize: 30, // Change font size\n * fill: 0x00ff00, // Change color to green\n * align: 'right', // Change alignment to right\n * stroke: { color: '#000000', width: 2 }, // Add black stroke\n * }\n */\n set style(style) {\n style || (style = {});\n this._style?.off(\"update\", this.onViewUpdate, this);\n if (style instanceof this._styleClass) {\n this._style = style;\n } else {\n this._style = new this._styleClass(style);\n }\n this._style.on(\"update\", this.onViewUpdate, this);\n this.onViewUpdate();\n }\n /**\n * The width of the sprite, setting this will actually modify the scale to achieve the value set.\n * @example\n * ```ts\n * // Set width directly\n * texture.width = 200;\n * console.log(texture.scale.x); // Scale adjusted to match width\n *\n * // For better performance when setting both width and height\n * texture.setSize(300, 400); // Avoids recalculating bounds twice\n * ```\n */\n get width() {\n return Math.abs(this.scale.x) * this.bounds.width;\n }\n set width(value) {\n this._setWidth(value, this.bounds.width);\n }\n /**\n * The height of the sprite, setting this will actually modify the scale to achieve the value set.\n * @example\n * ```ts\n * // Set height directly\n * texture.height = 200;\n * console.log(texture.scale.y); // Scale adjusted to match height\n *\n * // For better performance when setting both width and height\n * texture.setSize(300, 400); // Avoids recalculating bounds twice\n * ```\n */\n get height() {\n return Math.abs(this.scale.y) * this.bounds.height;\n }\n set height(value) {\n this._setHeight(value, this.bounds.height);\n }\n /**\n * Retrieves the size of the Text as a [Size]{@link Size} object based on the texture dimensions and scale.\n * This is faster than getting width and height separately as it only calculates the bounds once.\n * @example\n * ```ts\n * // Basic size retrieval\n * const text = new Text({\n * text: 'Hello Pixi!',\n * style: { fontSize: 24 }\n * });\n * const size = text.getSize();\n * console.log(`Size: ${size.width}x${size.height}`);\n *\n * // Reuse existing size object\n * const reuseSize = { width: 0, height: 0 };\n * text.getSize(reuseSize);\n * ```\n * @param out - Optional object to store the size in, to avoid allocating a new object\n * @returns The size of the Sprite\n * @see {@link Text#width} For getting just the width\n * @see {@link Text#height} For getting just the height\n * @see {@link Text#setSize} For setting both width and height\n */\n getSize(out) {\n out || (out = {});\n out.width = Math.abs(this.scale.x) * this.bounds.width;\n out.height = Math.abs(this.scale.y) * this.bounds.height;\n return out;\n }\n /**\n * Sets the size of the Text to the specified width and height.\n * This is faster than setting width and height separately as it only recalculates bounds once.\n * @example\n * ```ts\n * // Basic size setting\n * const text = new Text({\n * text: 'Hello Pixi!',\n * style: { fontSize: 24 }\n * });\n * text.setSize(100, 200); // Width: 100, Height: 200\n *\n * // Set uniform size\n * text.setSize(100); // Sets both width and height to 100\n *\n * // Set size with object\n * text.setSize({\n * width: 200,\n * height: 300\n * });\n * ```\n * @param value - This can be either a number or a {@link Size} object\n * @param height - The height to set. Defaults to the value of `width` if not provided\n * @see {@link Text#width} For setting width only\n * @see {@link Text#height} For setting height only\n */\n setSize(value, height) {\n if (typeof value === \"object\") {\n height = value.height ?? value.width;\n value = value.width;\n } else {\n height ?? (height = value);\n }\n value !== void 0 && this._setWidth(value, this.bounds.width);\n height !== void 0 && this._setHeight(height, this.bounds.height);\n }\n /**\n * Checks if the object contains the given point in local coordinates.\n * Uses the text's bounds for hit testing.\n * @example\n * ```ts\n * // Basic point check\n * const localPoint = { x: 50, y: 25 };\n * const contains = text.containsPoint(localPoint);\n * console.log('Point is inside:', contains);\n * ```\n * @param point - The point to check in local coordinates\n * @returns True if the point is within the text's bounds\n * @see {@link Container#toLocal} For converting global coordinates to local\n */\n containsPoint(point) {\n const width = this.bounds.width;\n const height = this.bounds.height;\n const x1 = -width * this.anchor.x;\n let y1 = 0;\n if (point.x >= x1 && point.x <= x1 + width) {\n y1 = -height * this.anchor.y;\n if (point.y >= y1 && point.y <= y1 + height) return true;\n }\n return false;\n }\n /** @internal */\n onViewUpdate() {\n if (!this.didViewUpdate) this._didTextUpdate = true;\n super.onViewUpdate();\n }\n /**\n * Destroys this text renderable and optionally its style texture.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @example\n * // Destroys the text and its style\n * text.destroy({ style: true, texture: true, textureSource: true });\n * text.destroy(true);\n * text.destroy() // Destroys the text, but not its style\n */\n destroy(options = false) {\n super.destroy(options);\n this.owner = null;\n this._bounds = null;\n this._anchor = null;\n if (typeof options === \"boolean\" ? options : options?.style) {\n this._style.destroy(options);\n }\n this._style = null;\n this._text = null;\n }\n /**\n * Returns a unique key for this instance.\n * This key is used for caching.\n * @returns {string} Unique key for the instance\n */\n get styleKey() {\n return `${this._text}:${this._style.styleKey}:${this._resolution}`;\n }\n}\nfunction ensureTextOptions(args, name) {\n let options = args[0] ?? {};\n if (typeof options === \"string\" || args[1]) {\n deprecation(v8_0_0, `use new ${name}({ text: \"hi!\", style }) instead`);\n options = {\n text: options,\n style: args[1]\n };\n }\n return options;\n}\n\nexport { AbstractText, ensureTextOptions };\n//# sourceMappingURL=AbstractText.mjs.map\n","import { DOMAdapter } from '../../environment/adapter.mjs';\nimport { nextPow2 } from '../../maths/misc/pow2.mjs';\nimport { Rectangle } from '../../maths/shapes/Rectangle.mjs';\n\n\"use strict\";\nlet _internalCanvas = null;\nlet _internalContext = null;\nfunction ensureInternalCanvas(width, height) {\n if (!_internalCanvas) {\n _internalCanvas = DOMAdapter.get().createCanvas(256, 128);\n _internalContext = _internalCanvas.getContext(\"2d\", { willReadFrequently: true });\n _internalContext.globalCompositeOperation = \"copy\";\n _internalContext.globalAlpha = 1;\n }\n if (_internalCanvas.width < width || _internalCanvas.height < height) {\n _internalCanvas.width = nextPow2(width);\n _internalCanvas.height = nextPow2(height);\n }\n}\nfunction checkRow(data, width, y) {\n for (let x = 0, index = 4 * y * width; x < width; ++x, index += 4) {\n if (data[index + 3] !== 0) return false;\n }\n return true;\n}\nfunction checkColumn(data, width, x, top, bottom) {\n const stride = 4 * width;\n for (let y = top, index = top * stride + 4 * x; y <= bottom; ++y, index += stride) {\n if (data[index + 3] !== 0) return false;\n }\n return true;\n}\nfunction getCanvasBoundingBox(...args) {\n let options = args[0];\n if (!options.canvas) {\n options = { canvas: args[0], resolution: args[1] };\n }\n const { canvas } = options;\n const resolution = Math.min(options.resolution ?? 1, 1);\n const width = options.width ?? canvas.width;\n const height = options.height ?? canvas.height;\n let output = options.output;\n ensureInternalCanvas(width, height);\n if (!_internalContext) {\n throw new TypeError(\"Failed to get canvas 2D context\");\n }\n _internalContext.drawImage(\n canvas,\n 0,\n 0,\n width,\n height,\n 0,\n 0,\n width * resolution,\n height * resolution\n );\n const imageData = _internalContext.getImageData(0, 0, width, height);\n const data = imageData.data;\n let left = 0;\n let top = 0;\n let right = width - 1;\n let bottom = height - 1;\n while (top < height && checkRow(data, width, top)) ++top;\n if (top === height) return Rectangle.EMPTY;\n while (checkRow(data, width, bottom)) --bottom;\n while (checkColumn(data, width, left, top, bottom)) ++left;\n while (checkColumn(data, width, right, top, bottom)) --right;\n ++right;\n ++bottom;\n _internalContext.globalCompositeOperation = \"source-over\";\n _internalContext.strokeRect(left, top, right - left, bottom - top);\n _internalContext.globalCompositeOperation = \"copy\";\n output ?? (output = new Rectangle());\n output.set(left / resolution, top / resolution, (right - left) / resolution, (bottom - top) / resolution);\n return output;\n}\n\nexport { getCanvasBoundingBox };\n//# sourceMappingURL=getCanvasBoundingBox.mjs.map\n","/**\n * tiny-lru\n *\n * @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>\n * @license BSD-3-Clause\n * @version 11.4.7\n */\n/**\n * A high-performance Least Recently Used (LRU) cache implementation with optional TTL support.\n * Items are automatically evicted when the cache reaches its maximum size,\n * removing the least recently used items first. All core operations (get, set, delete) are O(1).\n *\n * @class LRU\n * @example\n * // Create a cache with max 100 items\n * const cache = new LRU(100);\n * cache.set('key1', 'value1');\n * console.log(cache.get('key1')); // 'value1'\n *\n * @example\n * // Create a cache with TTL\n * const cache = new LRU(100, 5000); // 5 second TTL\n * cache.set('key1', 'value1');\n * // After 5 seconds, key1 will be expired\n */\nclass LRU {\n\t/**\n\t * Creates a new LRU cache instance.\n\t * Note: Constructor does not validate parameters. Use lru() factory function for parameter validation.\n\t *\n\t * @constructor\n\t * @param {number} [max=0] - Maximum number of items to store. 0 means unlimited.\n\t * @param {number} [ttl=0] - Time to live in milliseconds. 0 means no expiration.\n\t * @param {boolean} [resetTtl=false] - Whether to reset TTL when accessing existing items via get().\n\t * @example\n\t * const cache = new LRU(1000, 60000, true); // 1000 items, 1 minute TTL, reset on access\n\t * @see {@link lru} For parameter validation\n\t * @since 1.0.0\n\t */\n\tconstructor (max = 0, ttl = 0, resetTtl = false) {\n\t\tthis.first = null;\n\t\tthis.items = Object.create(null);\n\t\tthis.last = null;\n\t\tthis.max = max;\n\t\tthis.resetTtl = resetTtl;\n\t\tthis.size = 0;\n\t\tthis.ttl = ttl;\n\t}\n\n\t/**\n\t * Removes all items from the cache.\n\t *\n\t * @method clear\n\t * @memberof LRU\n\t * @returns {LRU} The LRU instance for method chaining.\n\t * @example\n\t * cache.clear();\n\t * console.log(cache.size); // 0\n\t * @since 1.0.0\n\t */\n\tclear () {\n\t\tthis.first = null;\n\t\tthis.items = Object.create(null);\n\t\tthis.last = null;\n\t\tthis.size = 0;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes an item from the cache by key.\n\t *\n\t * @method delete\n\t * @memberof LRU\n\t * @param {string} key - The key of the item to delete.\n\t * @returns {LRU} The LRU instance for method chaining.\n\t * @example\n\t * cache.set('key1', 'value1');\n\t * cache.delete('key1');\n\t * console.log(cache.has('key1')); // false\n\t * @see {@link LRU#has}\n\t * @see {@link LRU#clear}\n\t * @since 1.0.0\n\t */\n\tdelete (key) {\n\t\tif (this.has(key)) {\n\t\t\tconst item = this.items[key];\n\n\t\t\tdelete this.items[key];\n\t\t\tthis.size--;\n\n\t\t\tif (item.prev !== null) {\n\t\t\t\titem.prev.next = item.next;\n\t\t\t}\n\n\t\t\tif (item.next !== null) {\n\t\t\t\titem.next.prev = item.prev;\n\t\t\t}\n\n\t\t\tif (this.first === item) {\n\t\t\t\tthis.first = item.next;\n\t\t\t}\n\n\t\t\tif (this.last === item) {\n\t\t\t\tthis.last = item.prev;\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns an array of [key, value] pairs for the specified keys.\n\t * Order follows LRU order (least to most recently used).\n\t *\n\t * @method entries\n\t * @memberof LRU\n\t * @param {string[]} [keys=this.keys()] - Array of keys to get entries for. Defaults to all keys.\n\t * @returns {Array<Array<*>>} Array of [key, value] pairs in LRU order.\n\t * @example\n\t * cache.set('a', 1).set('b', 2);\n\t * console.log(cache.entries()); // [['a', 1], ['b', 2]]\n\t * console.log(cache.entries(['a'])); // [['a', 1]]\n\t * @see {@link LRU#keys}\n\t * @see {@link LRU#values}\n\t * @since 11.1.0\n\t */\n\tentries (keys = this.keys()) {\n\t\tconst result = new Array(keys.length);\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tconst key = keys[i];\n\t\t\tresult[i] = [key, this.get(key)];\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Removes the least recently used item from the cache.\n\t *\n\t * @method evict\n\t * @memberof LRU\n\t * @param {boolean} [bypass=false] - Whether to force eviction even when cache is empty.\n\t * @returns {LRU} The LRU instance for method chaining.\n\t * @example\n\t * cache.set('old', 'value').set('new', 'value');\n\t * cache.evict(); // Removes 'old' item\n\t * @see {@link LRU#setWithEvicted}\n\t * @since 1.0.0\n\t */\n\tevict (bypass = false) {\n\t\tif (bypass || this.size > 0) {\n\t\t\tconst item = this.first;\n\n\t\t\tdelete this.items[item.key];\n\n\t\t\tif (--this.size === 0) {\n\t\t\t\tthis.first = null;\n\t\t\t\tthis.last = null;\n\t\t\t} else {\n\t\t\t\tthis.first = item.next;\n\t\t\t\tthis.first.prev = null;\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns the expiration timestamp for a given key.\n\t *\n\t * @method expiresAt\n\t * @memberof LRU\n\t * @param {string} key - The key to check expiration for.\n\t * @returns {number|undefined} The expiration timestamp in milliseconds, or undefined if key doesn't exist.\n\t * @example\n\t * const cache = new LRU(100, 5000); // 5 second TTL\n\t * cache.set('key1', 'value1');\n\t * console.log(cache.expiresAt('key1')); // timestamp 5 seconds from now\n\t * @see {@link LRU#get}\n\t * @see {@link LRU#has}\n\t * @since 1.0.0\n\t */\n\texpiresAt (key) {\n\t\tlet result;\n\n\t\tif (this.has(key)) {\n\t\t\tresult = this.items[key].expiry;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Retrieves a value from the cache by key. Updates the item's position to most recently used.\n\t *\n\t * @method get\n\t * @memberof LRU\n\t * @param {string} key - The key to retrieve.\n\t * @returns {*} The value associated with the key, or undefined if not found or expired.\n\t * @example\n\t * cache.set('key1', 'value1');\n\t * console.log(cache.get('key1')); // 'value1'\n\t * console.log(cache.get('nonexistent')); // undefined\n\t * @see {@link LRU#set}\n\t * @see {@link LRU#has}\n\t * @since 1.0.0\n\t */\n\tget (key) {\n\t\tconst item = this.items[key];\n\n\t\tif (item !== undefined) {\n\t\t\t// Check TTL only if enabled to avoid unnecessary Date.now() calls\n\t\t\tif (this.ttl > 0) {\n\t\t\t\tif (item.expiry <= Date.now()) {\n\t\t\t\t\tthis.delete(key);\n\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Fast LRU update without full set() overhead\n\t\t\tthis.moveToEnd(item);\n\n\t\t\treturn item.value;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Checks if a key exists in the cache.\n\t *\n\t * @method has\n\t * @memberof LRU\n\t * @param {string} key - The key to check for.\n\t * @returns {boolean} True if the key exists, false otherwise.\n\t * @example\n\t * cache.set('key1', 'value1');\n\t * console.log(cache.has('key1')); // true\n\t * console.log(cache.has('nonexistent')); // false\n\t * @see {@link LRU#get}\n\t * @see {@link LRU#delete}\n\t * @since 9.0.0\n\t */\n\thas (key) {\n\t\treturn key in this.items;\n\t}\n\n\t/**\n\t * Efficiently moves an item to the end of the LRU list (most recently used position).\n\t * This is an internal optimization method that avoids the overhead of the full set() operation\n\t * when only LRU position needs to be updated.\n\t *\n\t * @method moveToEnd\n\t * @memberof LRU\n\t * @param {Object} item - The cache item with prev/next pointers to reposition.\n\t * @private\n\t * @since 11.3.5\n\t */\n\tmoveToEnd (item) {\n\t\t// If already at the end, nothing to do\n\t\tif (this.last === item) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove item from current position in the list\n\t\tif (item.prev !== null) {\n\t\t\titem.prev.next = item.next;\n\t\t}\n\n\t\tif (item.next !== null) {\n\t\t\titem.next.prev = item.prev;\n\t\t}\n\n\t\t// Update first pointer if this was the first item\n\t\tif (this.first === item) {\n\t\t\tthis.first = item.next;\n\t\t}\n\n\t\t// Add item to the end\n\t\titem.prev = this.last;\n\t\titem.next = null;\n\n\t\tif (this.last !== null) {\n\t\t\tthis.last.next = item;\n\t\t}\n\n\t\tthis.last = item;\n\n\t\t// Handle edge case: if this was the only item, it's also first\n\t\tif (this.first === null) {\n\t\t\tthis.first = item;\n\t\t}\n\t}\n\n\t/**\n\t * Returns an array of all keys in the cache, ordered from least to most recently used.\n\t *\n\t * @method keys\n\t * @memberof LRU\n\t * @returns {string[]} Array of keys in LRU order.\n\t * @example\n\t * cache.set('a', 1).set('b', 2);\n\t * cache.get('a'); // Move 'a' to most recent\n\t * console.log(cache.keys()); // ['b', 'a']\n\t * @see {@link LRU#values}\n\t * @see {@link LRU#entries}\n\t * @since 9.0.0\n\t */\n\tkeys () {\n\t\tconst result = new Array(this.size);\n\t\tlet x = this.first;\n\t\tlet i = 0;\n\n\t\twhile (x !== null) {\n\t\t\tresult[i++] = x.key;\n\t\t\tx = x.next;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Sets a value in the cache and returns any evicted item.\n\t *\n\t * @method setWithEvicted\n\t * @memberof LRU\n\t * @param {string} key - The key to set.\n\t * @param {*} value - The value to store.\n\t * @param {boolean} [resetTtl=this.resetTtl] - Whether to reset the TTL for this operation.\n\t * @returns {Object|null} The evicted item (if any) with shape {key, value, expiry, prev, next}, or null.\n\t * @example\n\t * const cache = new LRU(2);\n\t * cache.set('a', 1).set('b', 2);\n\t * const evicted = cache.setWithEvicted('c', 3); // evicted = {key: 'a', value: 1, ...}\n\t * @see {@link LRU#set}\n\t * @see {@link LRU#evict}\n\t * @since 11.3.0\n\t */\n\tsetWithEvicted (key, value, resetTtl = this.resetTtl) {\n\t\tlet evicted = null;\n\n\t\tif (this.has(key)) {\n\t\t\tthis.set(key, value, true, resetTtl);\n\t\t} else {\n\t\t\tif (this.max > 0 && this.size === this.max) {\n\t\t\t\tevicted = {...this.first};\n\t\t\t\tthis.evict(true);\n\t\t\t}\n\n\t\t\tlet item = this.items[key] = {\n\t\t\t\texpiry: this.ttl > 0 ? Date.now() + this.ttl : this.ttl,\n\t\t\t\tkey: key,\n\t\t\t\tprev: this.last,\n\t\t\t\tnext: null,\n\t\t\t\tvalue\n\t\t\t};\n\n\t\t\tif (++this.size === 1) {\n\t\t\t\tthis.first = item;\n\t\t\t} else {\n\t\t\t\tthis.last.next = item;\n\t\t\t}\n\n\t\t\tthis.last = item;\n\t\t}\n\n\t\treturn evicted;\n\t}\n\n\t/**\n\t * Sets a value in the cache. Updates the item's position to most recently used.\n\t *\n\t * @method set\n\t * @memberof LRU\n\t * @param {string} key - The key to set.\n\t * @param {*} value - The value to store.\n\t * @param {boolean} [bypass=false] - Internal parameter for setWithEvicted method.\n\t * @param {boolean} [resetTtl=this.resetTtl] - Whether to reset the TTL for this operation.\n\t * @returns {LRU} The LRU instance for method chaining.\n\t * @example\n\t * cache.set('key1', 'value1')\n\t * .set('key2', 'value2')\n\t * .set('key3', 'value3');\n\t * @see {@link LRU#get}\n\t * @see {@link LRU#setWithEvicted}\n\t * @since 1.0.0\n\t */\n\tset (key, value, bypass = false, resetTtl = this.resetTtl) {\n\t\tlet item = this.items[key];\n\n\t\tif (bypass || item !== undefined) {\n\t\t\t// Existing item: update value and position\n\t\t\titem.value = value;\n\n\t\t\tif (bypass === false && resetTtl) {\n\t\t\t\titem.expiry = this.ttl > 0 ? Date.now() + this.ttl : this.ttl;\n\t\t\t}\n\n\t\t\t// Always move to end, but the bypass parameter affects TTL reset behavior\n\t\t\tthis.moveToEnd(item);\n\t\t} else {\n\t\t\t// New item: check for eviction and create\n\t\t\tif (this.max > 0 && this.size === this.max) {\n\t\t\t\tthis.evict(true);\n\t\t\t}\n\n\t\t\titem = this.items[key] = {\n\t\t\t\texpiry: this.ttl > 0 ? Date.now() + this.ttl : this.ttl,\n\t\t\t\tkey: key,\n\t\t\t\tprev: this.last,\n\t\t\t\tnext: null,\n\t\t\t\tvalue\n\t\t\t};\n\n\t\t\tif (++this.size === 1) {\n\t\t\t\tthis.first = item;\n\t\t\t} else {\n\t\t\t\tthis.last.next = item;\n\t\t\t}\n\n\t\t\tthis.last = item;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns an array of all values in the cache for the specified keys.\n\t * Order follows LRU order (least to most recently used).\n\t *\n\t * @method values\n\t * @memberof LRU\n\t * @param {string[]} [keys=this.keys()] - Array of keys to get values for. Defaults to all keys.\n\t * @returns {Array<*>} Array of values corresponding to the keys in LRU order.\n\t * @example\n\t * cache.set('a', 1).set('b', 2);\n\t * console.log(cache.values()); // [1, 2]\n\t * console.log(cache.values(['a'])); // [1]\n\t * @see {@link LRU#keys}\n\t * @see {@link LRU#entries}\n\t * @since 11.1.0\n\t */\n\tvalues (keys = this.keys()) {\n\t\tconst result = new Array(keys.length);\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tresult[i] = this.get(keys[i]);\n\t\t}\n\n\t\treturn result;\n\t}\n}\n\n/**\n * Factory function to create a new LRU cache instance with parameter validation.\n *\n * @function lru\n * @param {number} [max=1000] - Maximum number of items to store. Must be >= 0. Use 0 for unlimited size.\n * @param {number} [ttl=0] - Time to live in milliseconds. Must be >= 0. Use 0 for no expiration.\n * @param {boolean} [resetTtl=false] - Whether to reset TTL when accessing existing items via get().\n * @returns {LRU} A new LRU cache instance.\n * @throws {TypeError} When parameters are invalid (negative numbers or wrong types).\n * @example\n * // Create cache with factory function\n * const cache = lru(100, 5000, true);\n * cache.set('key', 'value');\n *\n * @example\n * // Error handling\n * try {\n * const cache = lru(-1); // Invalid max\n * } catch (error) {\n * console.error(error.message); // \"Invalid max value\"\n * }\n * @see {@link LRU}\n * @since 1.0.0\n */\nfunction lru (max = 1000, ttl = 0, resetTtl = false) {\n\tif (isNaN(max) || max < 0) {\n\t\tthrow new TypeError(\"Invalid max value\");\n\t}\n\n\tif (isNaN(ttl) || ttl < 0) {\n\t\tthrow new TypeError(\"Invalid ttl value\");\n\t}\n\n\tif (typeof resetTtl !== \"boolean\") {\n\t\tthrow new TypeError(\"Invalid resetTtl value\");\n\t}\n\n\treturn new LRU(max, ttl, resetTtl);\n}export{LRU,lru};","\"use strict\";\nfunction hasTagStyles(style) {\n return !!style.tagStyles && Object.keys(style.tagStyles).length > 0;\n}\nfunction hasTagMarkup(text) {\n return text.includes(\"<\");\n}\nfunction createMergedStyle(baseStyle, overrides) {\n return baseStyle.clone().assign(overrides);\n}\nfunction parseTaggedText(text, style) {\n const runs = [];\n const tagStyles = style.tagStyles;\n if (!hasTagStyles(style) || !hasTagMarkup(text)) {\n runs.push({ text, style });\n return runs;\n }\n const styleStack = [style];\n const tagStack = [];\n let currentText = \"\";\n let i = 0;\n while (i < text.length) {\n const char = text[i];\n if (char === \"<\") {\n const closeIndex = text.indexOf(\">\", i);\n if (closeIndex === -1) {\n currentText += char;\n i++;\n continue;\n }\n const nextOpenIndex = text.indexOf(\"<\", i + 1);\n if (nextOpenIndex !== -1 && nextOpenIndex < closeIndex) {\n currentText += char;\n i++;\n continue;\n }\n const tagContent = text.slice(i + 1, closeIndex);\n if (tagContent.startsWith(\"/\")) {\n const closingTagName = tagContent.slice(1).trim();\n if (tagStack.length > 0 && tagStack[tagStack.length - 1] === closingTagName) {\n if (currentText.length > 0) {\n runs.push({\n text: currentText,\n style: styleStack[styleStack.length - 1]\n });\n currentText = \"\";\n }\n styleStack.pop();\n tagStack.pop();\n i = closeIndex + 1;\n continue;\n } else {\n currentText += text.slice(i, closeIndex + 1);\n i = closeIndex + 1;\n continue;\n }\n } else {\n const tagName = tagContent.trim();\n if (tagStyles[tagName]) {\n if (currentText.length > 0) {\n runs.push({\n text: currentText,\n style: styleStack[styleStack.length - 1]\n });\n currentText = \"\";\n }\n const currentStyle = styleStack[styleStack.length - 1];\n const mergedStyle = createMergedStyle(currentStyle, tagStyles[tagName]);\n styleStack.push(mergedStyle);\n tagStack.push(tagName);\n i = closeIndex + 1;\n continue;\n } else {\n currentText += text.slice(i, closeIndex + 1);\n i = closeIndex + 1;\n continue;\n }\n }\n } else {\n currentText += char;\n i++;\n }\n }\n if (currentText.length > 0) {\n runs.push({\n text: currentText,\n style: styleStack[styleStack.length - 1]\n });\n }\n return runs;\n}\nfunction getPlainText(text, style) {\n if (!hasTagStyles(style) || !hasTagMarkup(text)) {\n return text;\n }\n const runs = parseTaggedText(text, style);\n return runs.map((run) => run.text).join(\"\");\n}\n\nexport { getPlainText, hasTagMarkup, hasTagStyles, parseTaggedText };\n//# sourceMappingURL=parseTaggedText.mjs.map\n","\"use strict\";\nconst NEWLINES = [\n 10,\n // line feed\n 13\n // carriage return\n];\nconst NEWLINES_SET = new Set(NEWLINES);\nconst BREAKING_SPACES = [\n 9,\n // character tabulation\n 32,\n // space\n 8192,\n // en quad\n 8193,\n // em quad\n 8194,\n // en space\n 8195,\n // em space\n 8196,\n // three-per-em space\n 8197,\n // four-per-em space\n 8198,\n // six-per-em space\n 8200,\n // punctuation space\n 8201,\n // thin space\n 8202,\n // hair space\n 8287,\n // medium mathematical space\n 12288\n // ideographic space\n];\nconst BREAKING_SPACES_SET = new Set(BREAKING_SPACES);\nconst COLLAPSIBLE_SPACES = [\n 9,\n // character tabulation (tab)\n 32\n // space\n];\nconst COLLAPSIBLE_SPACES_SET = new Set(COLLAPSIBLE_SPACES);\nconst BREAK_AFTER_CHARS = [\n 45,\n // hyphen-minus\n 8208,\n // unicode hyphen\n 8211,\n // en-dash\n 8212,\n // em-dash\n 173\n // soft hyphen\n];\nconst BREAK_AFTER_CHARS_SET = new Set(BREAK_AFTER_CHARS);\nconst NEWLINE_SPLIT_REGEX = /(\\r\\n|\\r|\\n)/;\nconst NEWLINE_MATCH_REGEX = /(?:\\r\\n|\\r|\\n)/;\nfunction isNewline(char) {\n if (typeof char !== \"string\") {\n return false;\n }\n return NEWLINES_SET.has(char.charCodeAt(0));\n}\nfunction isBreakingSpace(char, _nextChar) {\n if (typeof char !== \"string\") {\n return false;\n }\n return BREAKING_SPACES_SET.has(char.charCodeAt(0));\n}\nfunction isCollapsibleSpace(char) {\n if (typeof char !== \"string\") {\n return false;\n }\n return COLLAPSIBLE_SPACES_SET.has(char.charCodeAt(0));\n}\nfunction isBreakAfterChar(char) {\n if (typeof char !== \"string\") {\n return false;\n }\n return BREAK_AFTER_CHARS_SET.has(char.charCodeAt(0));\n}\nfunction collapseSpaces(whiteSpace) {\n return whiteSpace === \"normal\" || whiteSpace === \"pre-line\";\n}\nfunction collapseNewlines(whiteSpace) {\n return whiteSpace === \"normal\";\n}\nfunction trimRight(text) {\n if (typeof text !== \"string\") {\n return \"\";\n }\n let i = text.length - 1;\n while (i >= 0 && isBreakingSpace(text[i])) {\n i--;\n }\n return i < text.length - 1 ? text.slice(0, i + 1) : text;\n}\nfunction tokenize(text) {\n const tokens = [];\n const tokenChars = [];\n if (typeof text !== \"string\") {\n return tokens;\n }\n for (let i = 0; i < text.length; i++) {\n const char = text[i];\n const nextChar = text[i + 1];\n if (isBreakingSpace(char, nextChar) || isNewline(char)) {\n if (tokenChars.length > 0) {\n tokens.push(tokenChars.join(\"\"));\n tokenChars.length = 0;\n }\n if (char === \"\\r\" && nextChar === \"\\n\") {\n tokens.push(\"\\r\\n\");\n i++;\n } else {\n tokens.push(char);\n }\n continue;\n }\n tokenChars.push(char);\n if (isBreakAfterChar(char) && nextChar && !isBreakingSpace(nextChar) && !isNewline(nextChar)) {\n tokens.push(tokenChars.join(\"\"));\n tokenChars.length = 0;\n }\n }\n if (tokenChars.length > 0) {\n tokens.push(tokenChars.join(\"\"));\n }\n return tokens;\n}\nfunction getCharacterGroups(token, breakWords, splitFn, canBreakCharsFn) {\n const characters = splitFn(token);\n const groups = [];\n for (let j = 0; j < characters.length; j++) {\n let char = characters[j];\n let lastChar = char;\n let k = 1;\n while (characters[j + k]) {\n const nextChar = characters[j + k];\n if (!canBreakCharsFn(lastChar, nextChar, token, j, breakWords)) {\n char += nextChar;\n lastChar = nextChar;\n k++;\n } else {\n break;\n }\n }\n j += k - 1;\n groups.push(char);\n }\n return groups;\n}\n\nexport { BREAKING_SPACES, BREAKING_SPACES_SET, BREAK_AFTER_CHARS, BREAK_AFTER_CHARS_SET, COLLAPSIBLE_SPACES, COLLAPSIBLE_SPACES_SET, NEWLINES, NEWLINES_SET, NEWLINE_MATCH_REGEX, NEWLINE_SPLIT_REGEX, collapseNewlines, collapseSpaces, getCharacterGroups, isBreakAfterChar, isBreakingSpace, isCollapsibleSpace, isNewline, tokenize, trimRight };\n//# sourceMappingURL=textTokenization.mjs.map\n","import { parseTaggedText } from './parseTaggedText.mjs';\nimport { collapseNewlines, NEWLINE_SPLIT_REGEX, collapseSpaces, trimRight, isBreakingSpace, getCharacterGroups, tokenize, isNewline } from './textTokenization.mjs';\n\n\"use strict\";\nconst NEWLINE_TO_SPACE_REGEX = /\\r\\n|\\r|\\n/g;\nfunction measureTaggedText(text, style, wordWrap, context, measureTextFn, wrapMeasureTextFn, measureFontFn, canBreakCharsFn, wordWrapSplitFn) {\n const runs = parseTaggedText(text, style);\n const shouldCollapseNewlines = collapseNewlines(style.whiteSpace);\n if (shouldCollapseNewlines) {\n for (let i = 0; i < runs.length; i++) {\n const run = runs[i];\n runs[i] = { text: run.text.replace(NEWLINE_TO_SPACE_REGEX, \" \"), style: run.style };\n }\n }\n const runsByLine = [];\n let currentLineRuns = [];\n for (const run of runs) {\n const parts = run.text.split(NEWLINE_SPLIT_REGEX);\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i];\n if (part === \"\\r\\n\" || part === \"\\r\" || part === \"\\n\") {\n runsByLine.push(currentLineRuns);\n currentLineRuns = [];\n } else if (part.length > 0) {\n currentLineRuns.push({ text: part, style: run.style });\n }\n }\n }\n if (currentLineRuns.length > 0 || runsByLine.length === 0) {\n runsByLine.push(currentLineRuns);\n }\n const wrappedRunsByLine = wordWrap ? wordWrapTaggedLines(\n runsByLine,\n style,\n context,\n wrapMeasureTextFn,\n canBreakCharsFn,\n wordWrapSplitFn\n ) : runsByLine;\n const lineWidths = [];\n const lineAscents = [];\n const lineDescents = [];\n const lineHeightsArr = [];\n const lines = [];\n let maxLineWidth = 0;\n const baseFont = style._fontString;\n const baseFontProps = measureFontFn(baseFont);\n if (baseFontProps.fontSize === 0) {\n baseFontProps.fontSize = style.fontSize;\n baseFontProps.ascent = style.fontSize;\n }\n let lastFont = \"\";\n let hasDropShadow = !!style.dropShadow;\n let maxRunStrokeWidth = style._stroke?.width || 0;\n for (const lineRuns of wrappedRunsByLine) {\n let lineWidth = 0;\n let lineAscent = baseFontProps.ascent;\n let lineDescent = baseFontProps.descent;\n let lineText = \"\";\n for (const run of lineRuns) {\n const runFont = run.style._fontString;\n const runFontProps = measureFontFn(runFont);\n if (runFont !== lastFont) {\n context.font = runFont;\n lastFont = runFont;\n }\n const runWidth = measureTextFn(run.text, run.style.letterSpacing, context);\n lineWidth += runWidth;\n lineAscent = Math.max(lineAscent, runFontProps.ascent);\n lineDescent = Math.max(lineDescent, runFontProps.descent);\n lineText += run.text;\n const runStrokeWidth = run.style._stroke?.width || 0;\n if (runStrokeWidth > maxRunStrokeWidth) maxRunStrokeWidth = runStrokeWidth;\n if (!hasDropShadow && run.style.dropShadow) {\n hasDropShadow = true;\n }\n }\n if (lineRuns.length === 0) {\n lineAscent = baseFontProps.ascent;\n lineDescent = baseFontProps.descent;\n }\n lineWidths.push(lineWidth);\n lineAscents.push(lineAscent);\n lineDescents.push(lineDescent);\n lines.push(lineText);\n const computedLineHeight = style.lineHeight || lineAscent + lineDescent;\n lineHeightsArr.push(computedLineHeight + style.leading);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n const strokeWidth = maxRunStrokeWidth;\n const width = maxLineWidth + strokeWidth + (style.dropShadow ? style.dropShadow.distance : 0);\n let baseHeight = 0;\n for (let i = 0; i < lineHeightsArr.length; i++) {\n baseHeight += lineHeightsArr[i];\n }\n baseHeight = Math.max(baseHeight, lineHeightsArr[0] + strokeWidth);\n const height = baseHeight + (style.dropShadow ? style.dropShadow.distance : 0);\n const baseLineHeight = style.lineHeight || baseFontProps.fontSize;\n return {\n width,\n height,\n lines,\n lineWidths,\n lineHeight: baseLineHeight + style.leading,\n maxLineWidth,\n fontProperties: baseFontProps,\n runsByLine: wrappedRunsByLine,\n lineAscents,\n lineDescents,\n lineHeights: lineHeightsArr,\n hasDropShadow\n };\n}\nfunction wordWrapTaggedLines(runsByLine, style, context, measureTextFn, canBreakCharsFn, wordWrapSplitFn) {\n const { letterSpacing, whiteSpace, wordWrapWidth, breakWords } = style;\n const shouldCollapseSpaces = collapseSpaces(whiteSpace);\n const adjustedWrapWidth = wordWrapWidth + letterSpacing;\n const tokenWidthCache = {};\n let lastFont = \"\";\n const measureTokenWidth = (token, tokenStyle) => {\n const cacheKey = `${token}|${tokenStyle.styleKey}`;\n let width = tokenWidthCache[cacheKey];\n if (width === void 0) {\n const font = tokenStyle._fontString;\n if (font !== lastFont) {\n context.font = font;\n lastFont = font;\n }\n width = measureTextFn(token, tokenStyle.letterSpacing, context) + tokenStyle.letterSpacing;\n tokenWidthCache[cacheKey] = width;\n }\n return width;\n };\n const result = [];\n for (const lineRuns of runsByLine) {\n const styledTokens = tokenizeTaggedRuns(lineRuns);\n const resultStartLength = result.length;\n const getWordGroupWidth = (startIndex) => {\n let totalWidth = 0;\n let j = startIndex;\n do {\n const { token: groupToken, style: groupStyle } = styledTokens[j];\n totalWidth += measureTokenWidth(groupToken, groupStyle);\n j++;\n } while (j < styledTokens.length && styledTokens[j].continuesFromPrevious);\n return totalWidth;\n };\n const getWordGroupTokens = (startIndex) => {\n const tokens = [];\n let j = startIndex;\n do {\n tokens.push({ token: styledTokens[j].token, style: styledTokens[j].style });\n j++;\n } while (j < styledTokens.length && styledTokens[j].continuesFromPrevious);\n return tokens;\n };\n let currentLineRuns = [];\n let currentWidth = 0;\n let canPrependSpaces = !shouldCollapseSpaces;\n let buildingRun = null;\n const flushBuildingRun = () => {\n if (buildingRun && buildingRun.text.length > 0) {\n currentLineRuns.push(buildingRun);\n }\n buildingRun = null;\n };\n const startNewLine = () => {\n flushBuildingRun();\n if (currentLineRuns.length > 0) {\n const lastRun = currentLineRuns[currentLineRuns.length - 1];\n lastRun.text = trimRight(lastRun.text);\n if (lastRun.text.length === 0) {\n currentLineRuns.pop();\n }\n }\n result.push(currentLineRuns);\n currentLineRuns = [];\n currentWidth = 0;\n canPrependSpaces = false;\n };\n for (let i = 0; i < styledTokens.length; i++) {\n const { token, style: tokenStyle, continuesFromPrevious } = styledTokens[i];\n const tokenWidth = measureTokenWidth(token, tokenStyle);\n if (shouldCollapseSpaces) {\n const currIsSpace = isBreakingSpace(token);\n const lastChar = buildingRun?.text[buildingRun.text.length - 1] ?? currentLineRuns[currentLineRuns.length - 1]?.text.slice(-1) ?? \"\";\n const lastIsSpace = lastChar ? isBreakingSpace(lastChar) : false;\n if (currIsSpace && lastIsSpace) {\n continue;\n }\n }\n const startsWordGroup = !continuesFromPrevious;\n const wordGroupWidth = startsWordGroup ? getWordGroupWidth(i) : tokenWidth;\n if (wordGroupWidth > adjustedWrapWidth && startsWordGroup) {\n if (currentWidth > 0) {\n startNewLine();\n }\n if (breakWords) {\n const wordGroupTokens = getWordGroupTokens(i);\n for (let g = 0; g < wordGroupTokens.length; g++) {\n const groupToken = wordGroupTokens[g].token;\n const groupStyle = wordGroupTokens[g].style;\n const charGroups = getCharacterGroups(\n groupToken,\n breakWords,\n wordWrapSplitFn,\n canBreakCharsFn\n );\n for (const char of charGroups) {\n const charWidth = measureTokenWidth(char, groupStyle);\n if (charWidth + currentWidth > adjustedWrapWidth) {\n startNewLine();\n }\n if (!buildingRun || buildingRun.style !== groupStyle) {\n flushBuildingRun();\n buildingRun = { text: char, style: groupStyle };\n } else {\n buildingRun.text += char;\n }\n currentWidth += charWidth;\n }\n }\n i += wordGroupTokens.length - 1;\n } else {\n const wordGroupTokens = getWordGroupTokens(i);\n flushBuildingRun();\n result.push(wordGroupTokens.map((t) => ({ text: t.token, style: t.style })));\n canPrependSpaces = false;\n i += wordGroupTokens.length - 1;\n }\n } else if (wordGroupWidth + currentWidth > adjustedWrapWidth && startsWordGroup) {\n if (isBreakingSpace(token)) {\n canPrependSpaces = false;\n continue;\n }\n startNewLine();\n buildingRun = { text: token, style: tokenStyle };\n currentWidth = tokenWidth;\n } else if (continuesFromPrevious && !breakWords) {\n if (!buildingRun || buildingRun.style !== tokenStyle) {\n flushBuildingRun();\n buildingRun = { text: token, style: tokenStyle };\n } else {\n buildingRun.text += token;\n }\n currentWidth += tokenWidth;\n } else {\n const isSpace = isBreakingSpace(token);\n if (currentWidth === 0 && isSpace && !canPrependSpaces) {\n continue;\n }\n if (!buildingRun || buildingRun.style !== tokenStyle) {\n flushBuildingRun();\n buildingRun = { text: token, style: tokenStyle };\n } else {\n buildingRun.text += token;\n }\n currentWidth += tokenWidth;\n }\n }\n flushBuildingRun();\n if (currentLineRuns.length > 0) {\n const lastRun = currentLineRuns[currentLineRuns.length - 1];\n lastRun.text = trimRight(lastRun.text);\n if (lastRun.text.length === 0) {\n currentLineRuns.pop();\n }\n }\n if (currentLineRuns.length > 0 || result.length === resultStartLength) {\n result.push(currentLineRuns);\n }\n }\n return result;\n}\nfunction tokenizeTaggedRuns(runs) {\n const styledTokens = [];\n let lastTokenWasWord = false;\n for (const run of runs) {\n const tokens = tokenize(run.text);\n let isFirstTokenInRun = true;\n for (const token of tokens) {\n const isSpace = isBreakingSpace(token) || isNewline(token);\n const continuesFromPrevious = isFirstTokenInRun && lastTokenWasWord && !isSpace;\n styledTokens.push({ token, style: run.style, continuesFromPrevious });\n lastTokenWasWord = !isSpace;\n isFirstTokenInRun = false;\n }\n }\n return styledTokens;\n}\n\nexport { measureTaggedText, tokenizeTaggedRuns, wordWrapTaggedLines };\n//# sourceMappingURL=measureTaggedText.mjs.map\n","import { collapseSpaces, collapseNewlines, tokenize, isNewline, trimRight, isBreakingSpace, getCharacterGroups } from './textTokenization.mjs';\n\n\"use strict\";\nconst contextSettings = {\n // TextMetrics requires getImageData readback for measuring fonts.\n willReadFrequently: true\n};\nfunction getFromCache(key, letterSpacing, cache, context, measureTextFn) {\n let width = cache[key];\n if (typeof width !== \"number\") {\n width = measureTextFn(key, letterSpacing, context) + letterSpacing;\n cache[key] = width;\n }\n return width;\n}\nfunction wordWrap(text, style, canvas, measureTextFn, canBreakWordsFn, canBreakCharsFn, wordWrapSplitFn) {\n const context = canvas.getContext(\"2d\", contextSettings);\n context.font = style._fontString;\n let width = 0;\n let line = \"\";\n const linesArray = [];\n const cache = /* @__PURE__ */ Object.create(null);\n const { letterSpacing, whiteSpace } = style;\n const shouldCollapseSpaces = collapseSpaces(whiteSpace);\n const shouldCollapseNewlines = collapseNewlines(whiteSpace);\n let canPrependSpaces = !shouldCollapseSpaces;\n const wordWrapWidth = style.wordWrapWidth + letterSpacing;\n const tokens = tokenize(text);\n for (let i = 0; i < tokens.length; i++) {\n let token = tokens[i];\n if (isNewline(token)) {\n if (!shouldCollapseNewlines) {\n linesArray.push(trimRight(line));\n canPrependSpaces = !shouldCollapseSpaces;\n line = \"\";\n width = 0;\n continue;\n }\n token = \" \";\n }\n if (shouldCollapseSpaces) {\n const currIsBreakingSpace = isBreakingSpace(token);\n const lastIsBreakingSpace = isBreakingSpace(line[line.length - 1]);\n if (currIsBreakingSpace && lastIsBreakingSpace) {\n continue;\n }\n }\n const tokenWidth = getFromCache(token, letterSpacing, cache, context, measureTextFn);\n if (tokenWidth > wordWrapWidth) {\n if (line !== \"\") {\n linesArray.push(trimRight(line));\n line = \"\";\n width = 0;\n }\n if (canBreakWordsFn(token, style.breakWords)) {\n const charGroups = getCharacterGroups(token, style.breakWords, wordWrapSplitFn, canBreakCharsFn);\n for (const char of charGroups) {\n const characterWidth = getFromCache(char, letterSpacing, cache, context, measureTextFn);\n if (characterWidth + width > wordWrapWidth) {\n linesArray.push(trimRight(line));\n canPrependSpaces = false;\n line = \"\";\n width = 0;\n }\n line += char;\n width += characterWidth;\n }\n } else {\n if (line.length > 0) {\n linesArray.push(trimRight(line));\n line = \"\";\n width = 0;\n }\n linesArray.push(trimRight(token));\n canPrependSpaces = false;\n line = \"\";\n width = 0;\n }\n } else {\n if (tokenWidth + width > wordWrapWidth) {\n canPrependSpaces = false;\n linesArray.push(trimRight(line));\n line = \"\";\n width = 0;\n }\n if (line.length > 0 || !isBreakingSpace(token) || canPrependSpaces) {\n line += token;\n width += tokenWidth;\n }\n }\n }\n const trimmedLine = trimRight(line);\n if (trimmedLine.length > 0) {\n linesArray.push(trimmedLine);\n }\n return linesArray.join(\"\\n\");\n}\n\nexport { wordWrap };\n//# sourceMappingURL=wordWrap.mjs.map\n","import { lru } from 'tiny-lru';\nimport { DOMAdapter } from '../../../environment/adapter.mjs';\nimport { measureTaggedText } from './utils/measureTaggedText.mjs';\nimport { hasTagStyles, hasTagMarkup } from './utils/parseTaggedText.mjs';\nimport { NEWLINE_MATCH_REGEX, isBreakingSpace } from './utils/textTokenization.mjs';\nimport { wordWrap } from './utils/wordWrap.mjs';\n\n\"use strict\";\nconst contextSettings = {\n // TextMetrics requires getImageData readback for measuring fonts.\n willReadFrequently: true\n};\nconst _CanvasTextMetrics = class _CanvasTextMetrics {\n /**\n * Checking that we can use modern canvas 2D API.\n *\n * Note: This is an unstable API, Chrome < 94 use `textLetterSpacing`, later versions use `letterSpacing`.\n * @see CanvasTextMetrics.experimentalLetterSpacing\n * @see https://developer.mozilla.org/en-US/docs/Web/API/ICanvasRenderingContext2D/letterSpacing\n * @see https://developer.chrome.com/origintrials/#/view_trial/3585991203293757441\n */\n static get experimentalLetterSpacingSupported() {\n let result = _CanvasTextMetrics._experimentalLetterSpacingSupported;\n if (result === void 0) {\n const proto = DOMAdapter.get().getCanvasRenderingContext2D().prototype;\n result = _CanvasTextMetrics._experimentalLetterSpacingSupported = \"letterSpacing\" in proto || \"textLetterSpacing\" in proto;\n }\n return result;\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 fontProperties - the font properties object from TextMetrics.measureFont\n * @param taggedData - optional object containing tagged text specific data\n * @param taggedData.runsByLine - per-line style runs for tagged text\n * @param taggedData.lineAscents - per-line ascent values for tagged text\n * @param taggedData.lineDescents - per-line descent values for tagged text\n * @param taggedData.lineHeights - per-line height values for tagged text\n * @param taggedData.hasDropShadow - whether any run has a drop shadow\n */\n constructor(text, style, width, height, lines, lineWidths, lineHeight, maxLineWidth, fontProperties, taggedData) {\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 if (taggedData) {\n this.runsByLine = taggedData.runsByLine;\n this.lineAscents = taggedData.lineAscents;\n this.lineDescents = taggedData.lineDescents;\n this.lineHeights = taggedData.lineHeights;\n this.hasDropShadow = taggedData.hasDropShadow;\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 canvas - optional specification of the canvas to use for measuring.\n * @param wordWrap\n * @returns Measured width and height of the text.\n */\n static measureText(text = \" \", style, canvas = _CanvasTextMetrics._canvas, wordWrap2 = style.wordWrap) {\n const textKey = `${text}-${style.styleKey}-wordWrap-${wordWrap2}`;\n if (_CanvasTextMetrics._measurementCache.has(textKey)) {\n return _CanvasTextMetrics._measurementCache.get(textKey);\n }\n const isTagged = hasTagStyles(style) && hasTagMarkup(text);\n if (isTagged) {\n const result = measureTaggedText(\n text,\n style,\n wordWrap2,\n _CanvasTextMetrics._context,\n _CanvasTextMetrics._measureText,\n _CanvasTextMetrics._measureTextAdvance,\n _CanvasTextMetrics.measureFont,\n _CanvasTextMetrics.canBreakChars,\n _CanvasTextMetrics.wordWrapSplit\n );\n const measurements2 = new _CanvasTextMetrics(\n text,\n style,\n result.width,\n result.height,\n result.lines,\n result.lineWidths,\n result.lineHeight,\n result.maxLineWidth,\n result.fontProperties,\n {\n runsByLine: result.runsByLine,\n lineAscents: result.lineAscents,\n lineDescents: result.lineDescents,\n lineHeights: result.lineHeights,\n hasDropShadow: result.hasDropShadow\n }\n );\n _CanvasTextMetrics._measurementCache.set(textKey, measurements2);\n return measurements2;\n }\n const font = style._fontString;\n const fontProperties = _CanvasTextMetrics.measureFont(font);\n if (fontProperties.fontSize === 0) {\n fontProperties.fontSize = style.fontSize;\n fontProperties.ascent = style.fontSize;\n fontProperties.descent = 0;\n }\n const context = _CanvasTextMetrics._context;\n context.font = font;\n const outputText = wordWrap2 ? _CanvasTextMetrics._wordWrap(text, style, canvas) : text;\n const lines = outputText.split(NEWLINE_MATCH_REGEX);\n const lineWidths = new Array(lines.length);\n let maxLineWidth = 0;\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = _CanvasTextMetrics._measureText(lines[i], style.letterSpacing, context);\n lineWidths[i] = lineWidth;\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n const strokeWidth = style._stroke?.width ?? 0;\n const lineHeight = style.lineHeight || fontProperties.fontSize;\n const width = _CanvasTextMetrics._adjustWidthForStyle(maxLineWidth, style);\n const baseHeight = Math.max(lineHeight, fontProperties.fontSize + strokeWidth) + (lines.length - 1) * (lineHeight + style.leading);\n const height = _CanvasTextMetrics._adjustHeightForStyle(baseHeight, style);\n const measurements = new _CanvasTextMetrics(\n text,\n style,\n width,\n height,\n lines,\n lineWidths,\n lineHeight + style.leading,\n maxLineWidth,\n fontProperties\n );\n _CanvasTextMetrics._measurementCache.set(textKey, measurements);\n return measurements;\n }\n /**\n * Adjusts the measured width to account for stroke and drop shadow.\n * @param baseWidth - The base content width\n * @param style - The text style\n * @returns The adjusted width\n */\n static _adjustWidthForStyle(baseWidth, style) {\n const strokeWidth = style._stroke?.width || 0;\n let width = baseWidth + strokeWidth;\n if (style.dropShadow) {\n width += style.dropShadow.distance;\n }\n return width;\n }\n /**\n * Adjusts the measured height to account for drop shadow.\n * @param baseHeight - The base content height\n * @param style - The text style\n * @returns The adjusted height\n */\n static _adjustHeightForStyle(baseHeight, style) {\n let height = baseHeight;\n if (style.dropShadow) {\n height += style.dropShadow.distance;\n }\n return height;\n }\n /**\n * Measures the rendered width of a string, accounting for letter spacing and using the provided context.\n * Returns the larger of the advance width and the bounding box width.\n * @param text - The text to measure\n * @param letterSpacing - Letter spacing in pixels\n * @param context - Canvas 2D context\n * @returns The measured width of the text with spacing\n * @internal\n */\n static _measureText(text, letterSpacing, context) {\n const { metricWidth, metrics, letterSpacingVal } = _CanvasTextMetrics._measureTextCore(text, letterSpacing, context);\n const actualBoundingBoxLeft = -(metrics.actualBoundingBoxLeft ?? 0);\n const actualBoundingBoxRight = metrics.actualBoundingBoxRight ?? 0;\n let boundsWidth = actualBoundingBoxRight - actualBoundingBoxLeft;\n if (metrics.width > 0) {\n boundsWidth += letterSpacingVal;\n }\n return Math.max(metricWidth, boundsWidth);\n }\n /**\n * Measures advance width only (no bounding box). Advance widths are additive,\n * making this suitable for word wrap line-fitting where per-token widths must sum correctly.\n * @param text - The text to measure\n * @param letterSpacing - Letter spacing in pixels\n * @param context - Canvas 2D context\n * @returns The advance width of the text\n * @internal\n */\n static _measureTextAdvance(text, letterSpacing, context) {\n return _CanvasTextMetrics._measureTextCore(text, letterSpacing, context).metricWidth;\n }\n /**\n * Shared measurement core: sets up letter spacing on the context, calls\n * context.measureText, and adjusts the advance width for letter spacing.\n * @param text\n * @param letterSpacing\n * @param context\n * @internal\n */\n static _measureTextCore(text, letterSpacing, context) {\n let useExperimentalLetterSpacing = false;\n if (_CanvasTextMetrics.experimentalLetterSpacingSupported) {\n if (_CanvasTextMetrics.experimentalLetterSpacing) {\n context.letterSpacing = `${letterSpacing}px`;\n context.textLetterSpacing = `${letterSpacing}px`;\n useExperimentalLetterSpacing = true;\n } else {\n context.letterSpacing = \"0px\";\n context.textLetterSpacing = \"0px\";\n }\n }\n const metrics = context.measureText(text);\n let metricWidth = metrics.width;\n let letterSpacingVal = 0;\n if (metricWidth > 0) {\n if (useExperimentalLetterSpacing) {\n letterSpacingVal = -letterSpacing;\n } else {\n letterSpacingVal = (_CanvasTextMetrics.graphemeSegmenter(text).length - 1) * letterSpacing;\n }\n metricWidth += letterSpacingVal;\n }\n return { metricWidth, metrics, letterSpacingVal };\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 static _wordWrap(text, style, canvas = _CanvasTextMetrics._canvas) {\n return wordWrap(\n text,\n style,\n canvas,\n _CanvasTextMetrics._measureTextAdvance,\n _CanvasTextMetrics.canBreakWords,\n _CanvasTextMetrics.canBreakChars,\n _CanvasTextMetrics.wordWrapSplit\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, _nextChar) {\n return isBreakingSpace(char, _nextChar);\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, breakWords) {\n return breakWords;\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, _nextChar, _token, _index, _breakWords) {\n return true;\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 * @param token - The token to split\n * @returns The characters of the token\n * @see CanvasTextMetrics.graphemeSegmenter\n */\n static wordWrapSplit(token) {\n return _CanvasTextMetrics.graphemeSegmenter(token);\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 static measureFont(font) {\n if (_CanvasTextMetrics._fonts[font]) {\n return _CanvasTextMetrics._fonts[font];\n }\n const context = _CanvasTextMetrics._context;\n context.font = font;\n const metrics = context.measureText(_CanvasTextMetrics.METRICS_STRING + _CanvasTextMetrics.BASELINE_SYMBOL);\n const ascent = metrics.actualBoundingBoxAscent ?? 0;\n const descent = metrics.actualBoundingBoxDescent ?? 0;\n const properties = {\n ascent,\n descent,\n fontSize: ascent + descent\n };\n _CanvasTextMetrics._fonts[font] = properties;\n return properties;\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 static clearMetrics(font = \"\") {\n if (font) {\n delete _CanvasTextMetrics._fonts[font];\n } else {\n _CanvasTextMetrics._fonts = {};\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 static get _canvas() {\n if (!_CanvasTextMetrics.__canvas) {\n let canvas;\n try {\n const c = new OffscreenCanvas(0, 0);\n const context = c.getContext(\"2d\", contextSettings);\n if (context?.measureText) {\n _CanvasTextMetrics.__canvas = c;\n return c;\n }\n canvas = DOMAdapter.get().createCanvas();\n } catch (_cx) {\n canvas = DOMAdapter.get().createCanvas();\n }\n canvas.width = canvas.height = 10;\n _CanvasTextMetrics.__canvas = canvas;\n }\n return _CanvasTextMetrics.__canvas;\n }\n /**\n * TODO: this should be private, but isn't because of backward compat, will fix later.\n * @ignore\n */\n static get _context() {\n if (!_CanvasTextMetrics.__context) {\n _CanvasTextMetrics.__context = _CanvasTextMetrics._canvas.getContext(\"2d\", contextSettings);\n }\n return _CanvasTextMetrics.__context;\n }\n};\n/**\n * String used for calculate font metrics.\n * These characters are all tall to help calculate the height required for text.\n */\n_CanvasTextMetrics.METRICS_STRING = \"|\\xC9q\\xC5\";\n/** Baseline symbol for calculate font metrics. */\n_CanvasTextMetrics.BASELINE_SYMBOL = \"M\";\n/** Baseline multiplier for calculate font metrics. */\n_CanvasTextMetrics.BASELINE_MULTIPLIER = 1.4;\n/** Height multiplier for setting height of canvas to calculate font metrics. */\n_CanvasTextMetrics.HEIGHT_MULTIPLIER = 2;\n/**\n * A Unicode \"character\", or \"grapheme cluster\", can be composed of multiple Unicode code points,\n * such as letters with diacritical marks (e.g. `'\\u0065\\u0301'`, letter e with acute)\n * or emojis with modifiers (e.g. `'\\uD83E\\uDDD1\\u200D\\uD83D\\uDCBB'`, technologist).\n * The new `Intl.Segmenter` API in ES2022 can split the string into grapheme clusters correctly. If it is not available,\n * PixiJS will fallback to use the iterator of String, which can only spilt the string into code points.\n * If you want to get full functionality in environments that don't support `Intl.Segmenter` (such as Firefox),\n * you can use other libraries such as [grapheme-splitter]{@link https://www.npmjs.com/package/grapheme-splitter}\n * or [graphemer]{@link https://www.npmjs.com/package/graphemer} to create a polyfill. Since these libraries can be\n * relatively large in size to handle various Unicode grapheme clusters properly, PixiJS won't use them directly.\n */\n_CanvasTextMetrics.graphemeSegmenter = (() => {\n if (typeof Intl?.Segmenter === \"function\") {\n const segmenter = new Intl.Segmenter();\n return (s) => {\n const segments = segmenter.segment(s);\n const result = [];\n let i = 0;\n for (const segment of segments) {\n result[i++] = segment.segment;\n }\n return result;\n };\n }\n return (s) => [...s];\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 * @see CanvasTextMetrics.experimentalLetterSpacingSupported\n */\n_CanvasTextMetrics.experimentalLetterSpacing = false;\n/** Cache of {@link TextMetrics.FontMetrics} objects. */\n_CanvasTextMetrics._fonts = {};\n/** Cache for measured text metrics */\n_CanvasTextMetrics._measurementCache = lru(1e3);\nlet CanvasTextMetrics = _CanvasTextMetrics;\n\nexport { CanvasTextMetrics };\n//# sourceMappingURL=CanvasTextMetrics.mjs.map\n","\"use strict\";\nconst genericFontFamilies = [\n \"serif\",\n \"sans-serif\",\n \"monospace\",\n \"cursive\",\n \"fantasy\",\n \"system-ui\"\n];\nfunction fontStringFromTextStyle(style) {\n const fontSizeString = typeof style.fontSize === \"number\" ? `${style.fontSize}px` : style.fontSize;\n let fontFamilies = style.fontFamily;\n if (!Array.isArray(style.fontFamily)) {\n fontFamilies = style.fontFamily.split(\",\");\n }\n for (let i = fontFamilies.length - 1; i >= 0; i--) {\n let fontFamily = fontFamilies[i].trim();\n if (!/([\\\"\\'])[^\\'\\\"]+\\1/.test(fontFamily) && !genericFontFamilies.includes(fontFamily)) {\n fontFamily = `\"${fontFamily}\"`;\n }\n fontFamilies[i] = fontFamily;\n }\n return `${style.fontStyle} ${style.fontVariant} ${style.fontWeight} ${fontSizeString} ${fontFamilies.join(\",\")}`;\n}\n\nexport { fontStringFromTextStyle };\n//# sourceMappingURL=fontStringFromTextStyle.mjs.map\n","import { Color } from '../../../../color/Color.mjs';\nimport { Matrix } from '../../../../maths/matrix/Matrix.mjs';\nimport { canvasUtils } from '../../../../rendering/renderers/canvas/utils/canvasUtils.mjs';\nimport { Texture } from '../../../../rendering/renderers/shared/texture/Texture.mjs';\nimport { warn } from '../../../../utils/logging/warn.mjs';\nimport { FillGradient } from '../../../graphics/shared/fill/FillGradient.mjs';\nimport { FillPattern } from '../../../graphics/shared/fill/FillPattern.mjs';\n\n\"use strict\";\nconst PRECISION = 1e5;\nfunction getCanvasFillStyle(fillStyle, context, textMetrics, padding = 0, offsetX = 0, offsetY = 0) {\n if (fillStyle.texture === Texture.WHITE && !fillStyle.fill) {\n return Color.shared.setValue(fillStyle.color).setAlpha(fillStyle.alpha ?? 1).toHexa();\n } else if (!fillStyle.fill) {\n const pattern = context.createPattern(fillStyle.texture.source.resource, \"repeat\");\n const tempMatrix = fillStyle.matrix.copyTo(Matrix.shared);\n tempMatrix.scale(fillStyle.texture.source.pixelWidth, fillStyle.texture.source.pixelHeight);\n pattern.setTransform(tempMatrix);\n return pattern;\n } else if (fillStyle.fill instanceof FillPattern) {\n const fillPattern = fillStyle.fill;\n const pattern = context.createPattern(fillPattern.texture.source.resource, \"repeat\");\n canvasUtils.applyPatternTransform(pattern, fillPattern.transform, false);\n return pattern;\n } else if (fillStyle.fill instanceof FillGradient) {\n const fillGradient = fillStyle.fill;\n const isLinear = fillGradient.type === \"linear\";\n const isLocal = fillGradient.textureSpace === \"local\";\n let width = 1;\n let height = 1;\n if (isLocal && textMetrics) {\n width = textMetrics.width + padding;\n height = textMetrics.height + padding;\n }\n let gradient;\n let isNearlyVertical = false;\n if (isLinear) {\n const { start, end } = fillGradient;\n gradient = context.createLinearGradient(\n start.x * width + offsetX,\n start.y * height + offsetY,\n end.x * width + offsetX,\n end.y * height + offsetY\n );\n isNearlyVertical = Math.abs(end.x - start.x) < Math.abs((end.y - start.y) * 0.1);\n } else {\n const { center, innerRadius, outerCenter, outerRadius } = fillGradient;\n gradient = context.createRadialGradient(\n center.x * width + offsetX,\n center.y * height + offsetY,\n innerRadius * width,\n outerCenter.x * width + offsetX,\n outerCenter.y * height + offsetY,\n outerRadius * width\n );\n }\n if (isNearlyVertical && isLocal && textMetrics) {\n const ratio = textMetrics.lineHeight / height;\n for (let i = 0; i < textMetrics.lines.length; i++) {\n const start = (i * textMetrics.lineHeight + padding / 2) / height;\n fillGradient.colorStops.forEach((stop) => {\n let globalStop = start + stop.offset * ratio;\n globalStop = Math.max(0, Math.min(1, globalStop));\n gradient.addColorStop(\n // fix to 5 decimal places to avoid floating point precision issues\n Math.floor(globalStop * PRECISION) / PRECISION,\n Color.shared.setValue(stop.color).toHex()\n );\n });\n }\n } else {\n fillGradient.colorStops.forEach((stop) => {\n gradient.addColorStop(stop.offset, Color.shared.setValue(stop.color).toHex());\n });\n }\n return gradient;\n }\n warn(\"FillStyle not recognised\", fillStyle);\n return \"red\";\n}\n\nexport { getCanvasFillStyle };\n//# sourceMappingURL=getCanvasFillStyle.mjs.map\n","import { Color } from '../../../color/Color.mjs';\nimport { Rectangle } from '../../../maths/shapes/Rectangle.mjs';\nimport { CanvasPool } from '../../../rendering/renderers/shared/texture/CanvasPool.mjs';\nimport { getCanvasBoundingBox } from '../../../utils/canvas/getCanvasBoundingBox.mjs';\nimport { CanvasTextMetrics } from './CanvasTextMetrics.mjs';\nimport { fontStringFromTextStyle } from './utils/fontStringFromTextStyle.mjs';\nimport { getCanvasFillStyle } from './utils/getCanvasFillStyle.mjs';\n\n\"use strict\";\nconst tempRect = new Rectangle();\nfunction countSpaces(text) {\n let count = 0;\n for (let i = 0; i < text.length; i++) {\n if (text.charCodeAt(i) === 32) count++;\n }\n return count;\n}\nclass CanvasTextGeneratorClass {\n /**\n * Creates a canvas with the specified text rendered to it.\n *\n * Generates a canvas of appropriate size, renders the text with the provided style,\n * and returns both the canvas/context and a Rectangle representing the text bounds.\n *\n * When trim is enabled in the style, the frame will represent the bounds of the\n * non-transparent pixels, which can be smaller than the full canvas.\n * @param options - The options for generating the text canvas\n * @param options.text - The text to render\n * @param options.style - The style to apply to the text\n * @param options.resolution - The resolution of the canvas (defaults to 1)\n * @param options.padding\n * @returns An object containing the canvas/context and the frame (bounds) of the text\n */\n getCanvasAndContext(options) {\n const { text, style, resolution = 1 } = options;\n const padding = style._getFinalPadding();\n const measured = CanvasTextMetrics.measureText(text || \" \", style);\n const width = Math.ceil(Math.ceil(Math.max(1, measured.width) + padding * 2) * resolution);\n const height = Math.ceil(Math.ceil(Math.max(1, measured.height) + padding * 2) * resolution);\n const canvasAndContext = CanvasPool.getOptimalCanvasAndContext(width, height);\n this._renderTextToCanvas(style, padding, resolution, canvasAndContext, measured);\n const frame = style.trim ? getCanvasBoundingBox({ canvas: canvasAndContext.canvas, width, height, resolution: 1, output: tempRect }) : tempRect.set(0, 0, width, height);\n return {\n canvasAndContext,\n frame\n };\n }\n /**\n * Returns a canvas and context to the pool.\n *\n * This should be called when you're done with the canvas to allow reuse\n * and prevent memory leaks.\n * @param canvasAndContext - The canvas and context to return to the pool\n */\n returnCanvasAndContext(canvasAndContext) {\n CanvasPool.returnCanvasAndContext(canvasAndContext);\n }\n /**\n * Renders text to its canvas, and updates its texture.\n * @param style - The style of the text\n * @param padding - The padding of the text\n * @param resolution - The resolution of the text\n * @param canvasAndContext - The canvas and context to render the text to\n * @param measured - Pre-measured text metrics to avoid duplicate measurement\n */\n _renderTextToCanvas(style, padding, resolution, canvasAndContext, measured) {\n if (measured.runsByLine && measured.runsByLine.length > 0) {\n this._renderTaggedTextToCanvas(measured, style, padding, resolution, canvasAndContext);\n return;\n }\n const { canvas, context } = canvasAndContext;\n const font = fontStringFromTextStyle(style);\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 const height = canvas.height;\n context.resetTransform();\n context.scale(resolution, resolution);\n context.textBaseline = style.textBaseline;\n if (style._stroke?.width) {\n const strokeStyle = style._stroke;\n context.lineWidth = strokeStyle.width;\n context.miterLimit = strokeStyle.miterLimit;\n context.lineJoin = strokeStyle.join;\n context.lineCap = strokeStyle.cap;\n }\n context.font = font;\n let linePositionX;\n let linePositionY;\n const passesCount = style.dropShadow ? 2 : 1;\n const strokeWidth = style._stroke?.width ?? 0;\n const halfStroke = strokeWidth / 2;\n let linePositionYShift = (lineHeight - fontProperties.fontSize) / 2;\n if (lineHeight - fontProperties.fontSize < 0) {\n linePositionYShift = 0;\n }\n for (let i = 0; i < passesCount; ++i) {\n const isShadowPass = style.dropShadow && i === 0;\n const dsOffsetText = isShadowPass ? Math.ceil(Math.max(1, height) + padding * 2) : 0;\n const dsOffsetShadow = dsOffsetText * resolution;\n if (isShadowPass) {\n this._setupDropShadow(context, style, resolution, dsOffsetShadow);\n } else {\n const gradientBounds = style._gradientBounds;\n const gradientOffset = style._gradientOffset;\n if (gradientBounds) {\n const gradientMetrics = {\n width: gradientBounds.width,\n height: gradientBounds.height,\n lineHeight: gradientBounds.height,\n lines: measured.lines\n };\n this._setFillAndStrokeStyles(\n context,\n style,\n gradientMetrics,\n padding,\n halfStroke,\n gradientOffset?.x ?? 0,\n gradientOffset?.y ?? 0\n );\n } else if (gradientOffset) {\n this._setFillAndStrokeStyles(\n context,\n style,\n measured,\n padding,\n halfStroke,\n gradientOffset.x,\n gradientOffset.y\n );\n } else {\n this._setFillAndStrokeStyles(context, style, measured, padding, halfStroke);\n }\n context.shadowColor = \"rgba(0,0,0,0)\";\n }\n for (let j = 0; j < lines.length; j++) {\n linePositionX = halfStroke;\n linePositionY = halfStroke + j * lineHeight + fontProperties.ascent + linePositionYShift;\n linePositionX += this._getAlignmentOffset(lineWidths[j], maxLineWidth, style.align);\n let wordSpacing = 0;\n if (style.align === \"justify\" && style.wordWrap && j < lines.length - 1) {\n const spaces = countSpaces(lines[j]);\n if (spaces > 0) {\n wordSpacing = (maxLineWidth - lineWidths[j]) / spaces;\n }\n }\n if (style._stroke?.width) {\n this._drawLetterSpacing(\n lines[j],\n style,\n canvasAndContext,\n linePositionX + padding,\n linePositionY + padding - dsOffsetText,\n true,\n wordSpacing\n );\n }\n if (style._fill !== void 0) {\n this._drawLetterSpacing(\n lines[j],\n style,\n canvasAndContext,\n linePositionX + padding,\n linePositionY + padding - dsOffsetText,\n false,\n wordSpacing\n );\n }\n }\n }\n }\n /**\n * Renders tagged text (with per-run styles) to canvas.\n * @param measured - The measured text metrics containing runsByLine\n * @param style - The base text style\n * @param padding - The padding of the text\n * @param resolution - The resolution of the text\n * @param canvasAndContext - The canvas and context to render to\n */\n _renderTaggedTextToCanvas(measured, style, padding, resolution, canvasAndContext) {\n const { canvas, context } = canvasAndContext;\n const { runsByLine, lineWidths, maxLineWidth, lineAscents, lineHeights, hasDropShadow } = measured;\n const height = canvas.height;\n context.resetTransform();\n context.scale(resolution, resolution);\n context.textBaseline = style.textBaseline;\n const passesCount = hasDropShadow ? 2 : 1;\n let maxStrokeWidth = style._stroke?.width ?? 0;\n for (const lineRuns of runsByLine) {\n for (const run of lineRuns) {\n const w = run.style._stroke?.width ?? 0;\n if (w > maxStrokeWidth) maxStrokeWidth = w;\n }\n }\n const halfStroke = maxStrokeWidth / 2;\n const runDataByLine = [];\n for (let lineIndex = 0; lineIndex < runsByLine.length; lineIndex++) {\n const lineRuns = runsByLine[lineIndex];\n const runData = [];\n for (const run of lineRuns) {\n const font = fontStringFromTextStyle(run.style);\n context.font = font;\n runData.push({\n width: CanvasTextMetrics._measureText(run.text, run.style.letterSpacing, context),\n font\n });\n }\n runDataByLine.push(runData);\n }\n for (let pass = 0; pass < passesCount; ++pass) {\n const isShadowPass = hasDropShadow && pass === 0;\n const dsOffsetText = isShadowPass ? Math.ceil(Math.max(1, height) + padding * 2) : 0;\n const dsOffsetShadow = dsOffsetText * resolution;\n if (!isShadowPass) {\n context.shadowColor = \"rgba(0,0,0,0)\";\n }\n let currentY = halfStroke;\n for (let lineIndex = 0; lineIndex < runsByLine.length; lineIndex++) {\n const lineRuns = runsByLine[lineIndex];\n const lineWidth = lineWidths[lineIndex];\n const lineAscent = lineAscents[lineIndex];\n const currentLineHeight = lineHeights[lineIndex];\n const lineRunData = runDataByLine[lineIndex];\n let linePositionX = halfStroke;\n linePositionX += this._getAlignmentOffset(lineWidth, maxLineWidth, style.align);\n let wordSpacing = 0;\n if (style.align === \"justify\" && style.wordWrap && lineIndex < runsByLine.length - 1) {\n let totalSpaces = 0;\n for (const run of lineRuns) {\n totalSpaces += countSpaces(run.text);\n }\n if (totalSpaces > 0) {\n wordSpacing = (maxLineWidth - lineWidth) / totalSpaces;\n }\n }\n const linePositionY = currentY + lineAscent;\n let runX = linePositionX + padding;\n for (let runIndex = 0; runIndex < lineRuns.length; runIndex++) {\n const run = lineRuns[runIndex];\n const { width: runWidth, font: runFont } = lineRunData[runIndex];\n context.font = runFont;\n context.textBaseline = run.style.textBaseline;\n if (run.style._stroke?.width) {\n const runStroke = run.style._stroke;\n context.lineWidth = runStroke.width;\n context.miterLimit = runStroke.miterLimit;\n context.lineJoin = runStroke.join;\n context.lineCap = runStroke.cap;\n if (isShadowPass) {\n if (run.style.dropShadow) {\n this._setupDropShadow(\n context,\n run.style,\n resolution,\n dsOffsetShadow\n );\n } else {\n const spacesSkipped = countSpaces(run.text);\n runX += runWidth + spacesSkipped * wordSpacing;\n continue;\n }\n } else {\n const runFontProps = CanvasTextMetrics.measureFont(runFont);\n const runHeight = run.style.lineHeight || runFontProps.fontSize;\n const runMetrics = {\n width: runWidth,\n height: runHeight,\n lineHeight: runHeight,\n lines: [run.text]\n };\n context.strokeStyle = getCanvasFillStyle(\n runStroke,\n context,\n runMetrics,\n padding * 2,\n runX - padding,\n currentY\n );\n }\n this._drawLetterSpacing(\n run.text,\n run.style,\n canvasAndContext,\n runX,\n linePositionY + padding - dsOffsetText,\n true,\n wordSpacing\n );\n }\n const spacesInRun = countSpaces(run.text);\n runX += runWidth + spacesInRun * wordSpacing;\n }\n runX = linePositionX + padding;\n for (let runIndex = 0; runIndex < lineRuns.length; runIndex++) {\n const run = lineRuns[runIndex];\n const { width: runWidth, font: runFont } = lineRunData[runIndex];\n context.font = runFont;\n context.textBaseline = run.style.textBaseline;\n if (run.style._fill !== void 0) {\n if (isShadowPass) {\n if (run.style.dropShadow) {\n this._setupDropShadow(\n context,\n run.style,\n resolution,\n dsOffsetShadow\n );\n } else {\n const spacesSkipped = countSpaces(run.text);\n runX += runWidth + spacesSkipped * wordSpacing;\n continue;\n }\n } else {\n const runFontProps = CanvasTextMetrics.measureFont(runFont);\n const runHeight = run.style.lineHeight || runFontProps.fontSize;\n const runMetrics = {\n width: runWidth,\n height: runHeight,\n lineHeight: runHeight,\n lines: [run.text]\n };\n context.fillStyle = getCanvasFillStyle(\n run.style._fill,\n context,\n runMetrics,\n padding * 2,\n runX - padding,\n currentY\n );\n }\n this._drawLetterSpacing(\n run.text,\n run.style,\n canvasAndContext,\n runX,\n linePositionY + padding - dsOffsetText,\n false,\n wordSpacing\n );\n }\n const spacesInFillRun = countSpaces(run.text);\n runX += runWidth + spacesInFillRun * wordSpacing;\n }\n currentY += currentLineHeight;\n }\n }\n }\n /**\n * Sets fill and stroke styles on the canvas context for text rendering.\n * @param context - The canvas context\n * @param style - The text style\n * @param metrics - The text metrics for gradient calculation\n * @param padding - The padding value\n * @param halfStroke - Half the stroke width\n * @param offsetX - X offset for gradient positioning\n * @param offsetY - Y offset for gradient positioning\n */\n _setFillAndStrokeStyles(context, style, metrics, padding, halfStroke, offsetX = 0, offsetY = 0) {\n context.fillStyle = style._fill ? getCanvasFillStyle(style._fill, context, metrics, padding * 2, offsetX, offsetY) : null;\n if (style._stroke?.width) {\n const strokePadding = halfStroke + padding * 2;\n context.strokeStyle = getCanvasFillStyle(\n style._stroke,\n context,\n metrics,\n strokePadding,\n offsetX,\n offsetY\n );\n }\n }\n /**\n * Sets up the canvas context for drop shadow rendering.\n * @param context - The canvas context\n * @param style - The text style containing drop shadow options\n * @param resolution - The resolution multiplier\n * @param dsOffsetShadow - The shadow Y offset\n */\n _setupDropShadow(context, style, resolution, dsOffsetShadow) {\n context.fillStyle = \"black\";\n context.strokeStyle = \"black\";\n const shadowOptions = style.dropShadow;\n const dropShadowColor = shadowOptions.color;\n const dropShadowAlpha = shadowOptions.alpha;\n context.shadowColor = Color.shared.setValue(dropShadowColor).setAlpha(dropShadowAlpha).toRgbaString();\n const dropShadowBlur = shadowOptions.blur * resolution;\n const dropShadowDistance = shadowOptions.distance * resolution;\n context.shadowBlur = dropShadowBlur;\n context.shadowOffsetX = Math.cos(shadowOptions.angle) * dropShadowDistance;\n context.shadowOffsetY = Math.sin(shadowOptions.angle) * dropShadowDistance + dsOffsetShadow;\n }\n /**\n * Calculates the X offset for text alignment.\n * @param lineWidth - The width of the current line\n * @param alignWidth - The width to align against\n * @param align - The text alignment\n * @returns The X offset for this line\n */\n _getAlignmentOffset(lineWidth, alignWidth, align) {\n if (align === \"right\") {\n return alignWidth - lineWidth;\n } else if (align === \"center\") {\n return (alignWidth - lineWidth) / 2;\n }\n return 0;\n }\n /**\n * Render the text with letter-spacing.\n *\n * This method handles rendering text with the correct letter spacing, using either:\n * 1. Native letter spacing if supported by the browser\n * 2. Manual letter spacing calculation if not natively supported\n *\n * For manual letter spacing, it calculates the position of each character\n * based on its width and the desired spacing.\n * @param text - The text to draw\n * @param style - The text style to apply\n * @param canvasAndContext - The canvas and context to draw to\n * @param x - Horizontal position to draw the text\n * @param y - Vertical position to draw the text\n * @param isStroke - Whether to render the stroke (true) or fill (false)\n * @param wordSpacing - Extra spacing to add between words (for justify alignment)\n * @private\n */\n _drawLetterSpacing(text, style, canvasAndContext, x, y, isStroke = false, wordSpacing = 0) {\n const { context } = canvasAndContext;\n const letterSpacing = style.letterSpacing;\n let useExperimentalLetterSpacing = false;\n if (CanvasTextMetrics.experimentalLetterSpacingSupported) {\n if (CanvasTextMetrics.experimentalLetterSpacing) {\n context.letterSpacing = `${letterSpacing}px`;\n context.textLetterSpacing = `${letterSpacing}px`;\n useExperimentalLetterSpacing = true;\n } else {\n context.letterSpacing = \"0px\";\n context.textLetterSpacing = \"0px\";\n }\n }\n if ((letterSpacing === 0 || useExperimentalLetterSpacing) && wordSpacing === 0) {\n if (isStroke) {\n context.strokeText(text, x, y);\n } else {\n context.fillText(text, x, y);\n }\n return;\n }\n if (wordSpacing !== 0 && (letterSpacing === 0 || useExperimentalLetterSpacing)) {\n const words = text.split(\" \");\n let currentPosition2 = x;\n const spaceWidth = context.measureText(\" \").width;\n for (let i = 0; i < words.length; i++) {\n if (isStroke) {\n context.strokeText(words[i], currentPosition2, y);\n } else {\n context.fillText(words[i], currentPosition2, y);\n }\n currentPosition2 += context.measureText(words[i]).width + spaceWidth + wordSpacing;\n }\n return;\n }\n let currentPosition = x;\n const stringArray = CanvasTextMetrics.graphemeSegmenter(text);\n let previousWidth = context.measureText(text).width;\n let currentWidth = 0;\n for (let i = 0; i < stringArray.length; ++i) {\n const currentChar = stringArray[i];\n if (isStroke) {\n context.strokeText(currentChar, currentPosition, y);\n } else {\n context.fillText(currentChar, currentPosition, y);\n }\n let textStr = \"\";\n for (let j = i + 1; j < stringArray.length; ++j) {\n textStr += stringArray[j];\n }\n currentWidth = context.measureText(textStr).width;\n currentPosition += previousWidth - currentWidth + letterSpacing;\n if (currentChar === \" \") currentPosition += wordSpacing;\n previousWidth = currentWidth;\n }\n }\n}\nconst CanvasTextGenerator = new CanvasTextGeneratorClass();\n\nexport { CanvasTextGenerator };\n//# sourceMappingURL=CanvasTextGenerator.mjs.map\n","import EventEmitter from 'eventemitter3';\nimport { Color } from '../../color/Color.mjs';\nimport { uid } from '../../utils/data/uid.mjs';\nimport { deprecation, v8_0_0 } from '../../utils/logging/deprecation.mjs';\nimport { warn } from '../../utils/logging/warn.mjs';\nimport { FillGradient } from '../graphics/shared/fill/FillGradient.mjs';\nimport { FillPattern } from '../graphics/shared/fill/FillPattern.mjs';\nimport { GraphicsContext } from '../graphics/shared/GraphicsContext.mjs';\nimport { toFillStyle, toStrokeStyle } from '../graphics/shared/utils/convertFillInputToFillStyle.mjs';\nimport { fontStringFromTextStyle } from './canvas/utils/fontStringFromTextStyle.mjs';\n\n\"use strict\";\nconst _TextStyle = class _TextStyle extends EventEmitter {\n constructor(style = {}) {\n super();\n /**\n * Unique identifier for the TextStyle class.\n * This is used to track instances and ensure uniqueness.\n * @internal\n */\n this.uid = uid(\"textStyle\");\n /**\n * Internal tick counter used to track updates and changes.\n * This is incremented whenever the style is modified, allowing for efficient change detection.\n * @internal\n */\n this._tick = 0;\n this._cachedFontString = null;\n convertV7Tov8Style(style);\n const isTextStyle = style instanceof _TextStyle;\n const existingStyle = style;\n if (isTextStyle) {\n style = existingStyle._toObject();\n }\n const fullStyle = { ..._TextStyle.defaultTextStyle, ...style };\n for (const key in fullStyle) {\n const thisKey = key;\n this[thisKey] = fullStyle[key];\n }\n this._tagStyles = style.tagStyles ?? void 0;\n this.update();\n this._tick = 0;\n }\n /**\n * Alignment for multiline text, does not affect single line text.\n * @type {'left'|'center'|'right'|'justify'}\n */\n get align() {\n return this._align;\n }\n set align(value) {\n if (this._align === value) return;\n this._align = value;\n this.update();\n }\n /** Indicates if lines can be wrapped within words, it needs wordWrap to be set to true. */\n get breakWords() {\n return this._breakWords;\n }\n set breakWords(value) {\n if (this._breakWords === value) return;\n this._breakWords = value;\n this.update();\n }\n /** Set a drop shadow for the text. */\n get dropShadow() {\n return this._dropShadow;\n }\n set dropShadow(value) {\n if (this._dropShadow === value) return;\n if (value !== null && typeof value === \"object\") {\n this._dropShadow = this._createProxy({ ..._TextStyle.defaultDropShadow, ...value });\n } else {\n this._dropShadow = value ? this._createProxy({ ..._TextStyle.defaultDropShadow }) : null;\n }\n this.update();\n }\n /** The font family, can be a single font name, or a list of names where the first is the preferred font. */\n get fontFamily() {\n return this._fontFamily;\n }\n set fontFamily(value) {\n if (this._fontFamily === value) return;\n this._fontFamily = value;\n this.update();\n }\n /** The font size (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em') */\n get fontSize() {\n return this._fontSize;\n }\n set fontSize(value) {\n if (this._fontSize === value) return;\n if (typeof value === \"string\") {\n this._fontSize = parseInt(value, 10);\n } else {\n this._fontSize = value;\n }\n this.update();\n }\n /**\n * The font style.\n * @type {'normal'|'italic'|'oblique'}\n */\n get fontStyle() {\n return this._fontStyle;\n }\n set fontStyle(value) {\n if (this._fontStyle === value) return;\n this._fontStyle = value.toLowerCase();\n this.update();\n }\n /**\n * The font variant.\n * @type {'normal'|'small-caps'}\n */\n get fontVariant() {\n return this._fontVariant;\n }\n set fontVariant(value) {\n if (this._fontVariant === value) return;\n this._fontVariant = value;\n this.update();\n }\n /**\n * The font weight.\n * @type {'normal'|'bold'|'bolder'|'lighter'|'100'|'200'|'300'|'400'|'500'|'600'|'700'|'800'|'900'}\n */\n get fontWeight() {\n return this._fontWeight;\n }\n set fontWeight(value) {\n if (this._fontWeight === value) return;\n this._fontWeight = value;\n this.update();\n }\n /** The space between lines. */\n get leading() {\n return this._leading;\n }\n set leading(value) {\n if (this._leading === value) return;\n this._leading = value;\n this.update();\n }\n /** The amount of spacing between letters, default is 0. */\n get letterSpacing() {\n return this._letterSpacing;\n }\n set letterSpacing(value) {\n if (this._letterSpacing === value) return;\n this._letterSpacing = value;\n this.update();\n }\n /** The line height, a number that represents the vertical space that a letter uses. */\n get lineHeight() {\n return this._lineHeight;\n }\n set lineHeight(value) {\n if (this._lineHeight === value) return;\n this._lineHeight = value;\n this.update();\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 * > [!NOTE] This will NOT affect the positioning or bounds of the text.\n */\n get padding() {\n return this._padding;\n }\n set padding(value) {\n if (this._padding === value) return;\n this._padding = value;\n this.update();\n }\n /**\n * An optional filter or array of filters to apply to the text, allowing for advanced visual effects.\n * These filters will be applied to the text as it is created, resulting in faster rendering for static text\n * compared to applying the filter directly to the text object (which would be applied at run time).\n * @default null\n */\n get filters() {\n return this._filters;\n }\n set filters(value) {\n if (this._filters === value) return;\n this._filters = Object.freeze(value);\n this.update();\n }\n /**\n * Trim transparent borders from the text texture.\n * > [!IMPORTANT] PERFORMANCE WARNING:\n * > This is a costly operation as it requires scanning pixel alpha values.\n * > Avoid using `trim: true` for dynamic text, as it could significantly impact performance.\n */\n get trim() {\n return this._trim;\n }\n set trim(value) {\n if (this._trim === value) return;\n this._trim = value;\n this.update();\n }\n /**\n * The baseline of the text that is rendered.\n * @type {'alphabetic'|'top'|'hanging'|'middle'|'ideographic'|'bottom'}\n */\n get textBaseline() {\n return this._textBaseline;\n }\n set textBaseline(value) {\n if (this._textBaseline === value) return;\n this._textBaseline = value;\n this.update();\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 * @type {'normal'|'pre'|'pre-line'}\n */\n get whiteSpace() {\n return this._whiteSpace;\n }\n set whiteSpace(value) {\n if (this._whiteSpace === value) return;\n this._whiteSpace = value;\n this.update();\n }\n /** Indicates if word wrap should be used. */\n get wordWrap() {\n return this._wordWrap;\n }\n set wordWrap(value) {\n if (this._wordWrap === value) return;\n this._wordWrap = value;\n this.update();\n }\n /** The width at which text will wrap, it needs wordWrap to be set to true. */\n get wordWrapWidth() {\n return this._wordWrapWidth;\n }\n set wordWrapWidth(value) {\n if (this._wordWrapWidth === value) return;\n this._wordWrapWidth = value;\n this.update();\n }\n /**\n * The fill style that will be used to color the text.\n * This can be:\n * - A color string like 'red', '#00FF00', or 'rgba(255,0,0,0.5)'\n * - A hex number like 0xff0000 for red\n * - A FillStyle object with properties like { color: 0xff0000, alpha: 0.5 }\n * - A FillGradient for gradient fills\n * - A FillPattern for pattern/texture fills\n *\n * When using a FillGradient, vertical gradients (angle of 90 degrees) are applied per line of text,\n * while gradients at any other angle are spread across the entire text body as a whole.\n * @example\n * // Vertical gradient applied per line\n * const verticalGradient = new FillGradient(0, 0, 0, 1)\n * .addColorStop(0, 0xff0000)\n * .addColorStop(1, 0x0000ff);\n *\n * const text = new Text({\n * text: 'Line 1\\nLine 2',\n * style: { fill: verticalGradient }\n * });\n *\n * To manage the gradient in a global scope, set the textureSpace property of the FillGradient to 'global'.\n * @type {string|number|FillStyle|FillGradient|FillPattern}\n */\n get fill() {\n return this._originalFill;\n }\n set fill(value) {\n if (value === this._originalFill) return;\n this._originalFill = value;\n if (this._isFillStyle(value)) {\n this._originalFill = this._createProxy({ ...GraphicsContext.defaultFillStyle, ...value }, () => {\n this._fill = toFillStyle(\n { ...this._originalFill },\n GraphicsContext.defaultFillStyle\n );\n });\n }\n this._fill = toFillStyle(\n value === 0 ? \"black\" : value,\n GraphicsContext.defaultFillStyle\n );\n this.update();\n }\n /** A fillstyle that will be used on the text stroke, e.g., 'blue', '#FCFF00'. */\n get stroke() {\n return this._originalStroke;\n }\n set stroke(value) {\n if (value === this._originalStroke) return;\n this._originalStroke = value;\n if (this._isFillStyle(value)) {\n this._originalStroke = this._createProxy({ ...GraphicsContext.defaultStrokeStyle, ...value }, () => {\n this._stroke = toStrokeStyle(\n { ...this._originalStroke },\n GraphicsContext.defaultStrokeStyle\n );\n });\n }\n this._stroke = toStrokeStyle(value, GraphicsContext.defaultStrokeStyle);\n this.update();\n }\n /**\n * Custom styles to apply to specific tags within the text.\n * Allows for rich text formatting using simple tag markup like `<red>text</red>`.\n *\n * Tags are only parsed when this property has entries. If `tagStyles` is undefined,\n * `<` characters in text are treated as literal.\n * @example\n * ```ts\n * const text = new Text({\n * text: '<red>Red</red>, <blue>Blue</blue>',\n * style: {\n * fill: 'white',\n * tagStyles: {\n * red: { fill: 'red' },\n * blue: { fill: 'blue' }\n * }\n * }\n * });\n * ```\n */\n get tagStyles() {\n return this._tagStyles;\n }\n set tagStyles(value) {\n if (this._tagStyles === value) return;\n this._tagStyles = value ?? void 0;\n this.update();\n }\n update() {\n this._tick++;\n this._cachedFontString = null;\n this.emit(\"update\", this);\n }\n /** Resets all properties to the default values */\n reset() {\n const defaultStyle = _TextStyle.defaultTextStyle;\n for (const key in defaultStyle) {\n this[key] = defaultStyle[key];\n }\n }\n /**\n * Assigns partial style options to this TextStyle instance.\n * Uses public setters to ensure proper value transformation.\n * @param values - Partial style options to assign\n * @returns This TextStyle instance for chaining\n */\n assign(values) {\n for (const key in values) {\n const thisKey = key;\n this[thisKey] = values[key];\n }\n return this;\n }\n /**\n * Returns a unique key for this instance.\n * This key is used for caching.\n * @returns {string} Unique key for the instance\n */\n get styleKey() {\n return `${this.uid}-${this._tick}`;\n }\n /**\n * Returns the CSS font string for this style, cached for performance.\n * @internal\n * @returns CSS font string\n */\n get _fontString() {\n if (this._cachedFontString === null) {\n this._cachedFontString = fontStringFromTextStyle(this);\n }\n return this._cachedFontString;\n }\n /**\n * Returns an object with the same values as this TextStyle instance.\n * @returns Object with the same values as this TextStyle instance\n * @example\n * ```ts\n * const style = new TextStyle({\n * fontSize: 24,\n * fill: 0xff0000,\n * stroke: { color: 0x0000ff, width: 2 }\n * });\n * const object = style.toObject();\n * console.log(object);\n * // { fontSize: 24, fill: 0xff0000, stroke: { color: 0x0000ff, width: 2 } }\n * ```\n */\n _toObject() {\n return {\n align: this.align,\n breakWords: this.breakWords,\n dropShadow: this._dropShadow ? { ...this._dropShadow } : null,\n fill: this._fill ? { ...this._fill } : void 0,\n fontFamily: this.fontFamily,\n fontSize: this.fontSize,\n fontStyle: this.fontStyle,\n fontVariant: this.fontVariant,\n fontWeight: this.fontWeight,\n leading: this.leading,\n letterSpacing: this.letterSpacing,\n lineHeight: this.lineHeight,\n padding: this.padding,\n stroke: this._stroke ? { ...this._stroke } : void 0,\n textBaseline: this.textBaseline,\n trim: this.trim,\n whiteSpace: this.whiteSpace,\n wordWrap: this.wordWrap,\n wordWrapWidth: this.wordWrapWidth,\n filters: this._filters ? [...this._filters] : void 0,\n tagStyles: this._tagStyles ? { ...this._tagStyles } : void 0\n };\n }\n /**\n * Creates a new TextStyle object with the same values as this one.\n * @returns New cloned TextStyle object\n */\n clone() {\n return new _TextStyle(this._toObject());\n }\n /**\n * Returns the final padding for the text style, taking into account any filters applied.\n * Used internally for correct measurements\n * @internal\n * @returns {number} The final padding for the text style.\n */\n _getFinalPadding() {\n let filterPadding = 0;\n if (this._filters) {\n for (let i = 0; i < this._filters.length; i++) {\n filterPadding += this._filters[i].padding;\n }\n }\n return Math.max(this._padding, filterPadding);\n }\n /**\n * Destroys this text style.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @example\n * // Destroy the text style and its textures\n * textStyle.destroy({ texture: true, textureSource: true });\n * textStyle.destroy(true);\n */\n destroy(options = false) {\n this.removeAllListeners();\n const destroyTexture = typeof options === \"boolean\" ? options : options?.texture;\n if (destroyTexture) {\n const destroyTextureSource = typeof options === \"boolean\" ? options : options?.textureSource;\n if (this._fill?.texture) {\n this._fill.texture.destroy(destroyTextureSource);\n }\n if (this._originalFill?.texture) {\n this._originalFill.texture.destroy(destroyTextureSource);\n }\n if (this._stroke?.texture) {\n this._stroke.texture.destroy(destroyTextureSource);\n }\n if (this._originalStroke?.texture) {\n this._originalStroke.texture.destroy(destroyTextureSource);\n }\n }\n this._fill = null;\n this._stroke = null;\n this.dropShadow = null;\n this._originalStroke = null;\n this._originalFill = null;\n }\n _createProxy(value, cb) {\n return new Proxy(value, {\n set: (target, property, newValue) => {\n if (target[property] === newValue) return true;\n target[property] = newValue;\n cb?.(property, newValue);\n this.update();\n return true;\n }\n });\n }\n _isFillStyle(value) {\n return (value ?? null) !== null && !(Color.isColorLike(value) || value instanceof FillGradient || value instanceof FillPattern);\n }\n};\n/**\n * Default drop shadow settings used when enabling drop shadows on text.\n * These values are used as the base configuration when drop shadows are enabled without specific settings.\n * @example\n * ```ts\n * // Customize default settings globally\n * TextStyle.defaultDropShadow.alpha = 0.5; // 50% opacity for all shadows\n * TextStyle.defaultDropShadow.blur = 2; // 2px blur for all shadows\n * TextStyle.defaultDropShadow.color = 'blue'; // Blue shadows by default\n * ```\n */\n_TextStyle.defaultDropShadow = {\n alpha: 1,\n angle: Math.PI / 6,\n blur: 0,\n color: \"black\",\n distance: 5\n};\n/**\n * Default text style settings used when creating new text objects.\n * These values serve as the base configuration and can be customized globally.\n * @example\n * ```ts\n * // Customize default text style globally\n * TextStyle.defaultTextStyle.fontSize = 16;\n * TextStyle.defaultTextStyle.fill = 0x333333;\n * TextStyle.defaultTextStyle.fontFamily = ['Arial', 'Helvetica', 'sans-serif'];\n * ```\n */\n_TextStyle.defaultTextStyle = {\n align: \"left\",\n breakWords: false,\n dropShadow: null,\n fill: \"black\",\n fontFamily: \"Arial\",\n fontSize: 26,\n fontStyle: \"normal\",\n fontVariant: \"normal\",\n fontWeight: \"normal\",\n leading: 0,\n letterSpacing: 0,\n lineHeight: 0,\n padding: 0,\n stroke: null,\n textBaseline: \"alphabetic\",\n trim: false,\n whiteSpace: \"pre\",\n wordWrap: false,\n wordWrapWidth: 100\n};\nlet TextStyle = _TextStyle;\nfunction convertV7Tov8Style(style) {\n const oldStyle = style;\n if (typeof oldStyle.dropShadow === \"boolean\" && oldStyle.dropShadow) {\n const defaults = TextStyle.defaultDropShadow;\n style.dropShadow = {\n alpha: oldStyle.dropShadowAlpha ?? defaults.alpha,\n angle: oldStyle.dropShadowAngle ?? defaults.angle,\n blur: oldStyle.dropShadowBlur ?? defaults.blur,\n color: oldStyle.dropShadowColor ?? defaults.color,\n distance: oldStyle.dropShadowDistance ?? defaults.distance\n };\n }\n if (oldStyle.strokeThickness !== void 0) {\n deprecation(v8_0_0, \"strokeThickness is now a part of stroke\");\n const color = oldStyle.stroke;\n let obj = {};\n if (Color.isColorLike(color)) {\n obj.color = color;\n } else if (color instanceof FillGradient || color instanceof FillPattern) {\n obj.fill = color;\n } else if (Object.hasOwnProperty.call(color, \"color\") || Object.hasOwnProperty.call(color, \"fill\")) {\n obj = color;\n } else {\n throw new Error(\"Invalid stroke value.\");\n }\n style.stroke = {\n ...obj,\n width: oldStyle.strokeThickness\n };\n }\n if (Array.isArray(oldStyle.fillGradientStops)) {\n deprecation(v8_0_0, \"gradient fill is now a fill pattern: `new FillGradient(...)`\");\n if (!Array.isArray(oldStyle.fill) || oldStyle.fill.length === 0) {\n throw new Error(\"Invalid fill value. Expected an array of colors for gradient fill.\");\n }\n if (oldStyle.fill.length !== oldStyle.fillGradientStops.length) {\n warn(\"The number of fill colors must match the number of fill gradient stops.\");\n }\n const gradientFill = new FillGradient({\n start: { x: 0, y: 0 },\n end: { x: 0, y: 1 },\n textureSpace: \"local\"\n });\n const fillGradientStops = oldStyle.fillGradientStops.slice();\n const fills = oldStyle.fill.map((color) => Color.shared.setValue(color).toNumber());\n fillGradientStops.forEach((stop, index) => {\n gradientFill.addColorStop(stop, fills[index]);\n });\n style.fill = {\n fill: gradientFill\n };\n }\n}\n\nexport { TextStyle };\n//# sourceMappingURL=TextStyle.mjs.map\n","import { updateQuadBounds } from '../../../utils/data/updateQuadBounds.mjs';\n\n\"use strict\";\nfunction updateTextBounds(batchableSprite, text) {\n const { texture, bounds } = batchableSprite;\n const padding = text._style._getFinalPadding();\n updateQuadBounds(bounds, text._anchor, texture);\n const paddingOffset = text._anchor._x * padding * 2;\n const paddingOffsetY = text._anchor._y * padding * 2;\n bounds.minX -= padding - paddingOffset;\n bounds.minY -= padding - paddingOffsetY;\n bounds.maxX -= padding - paddingOffset;\n bounds.maxY -= padding - paddingOffsetY;\n}\n\nexport { updateTextBounds };\n//# sourceMappingURL=updateTextBounds.mjs.map\n","\"use strict\";\nclass BatchableSprite {\n constructor() {\n this.batcherName = \"default\";\n this.topology = \"triangle-list\";\n // batch specific..\n this.attributeSize = 4;\n this.indexSize = 6;\n this.packAsQuad = true;\n this.roundPixels = 0;\n this._attributeStart = 0;\n // location in the buffer\n this._batcher = null;\n this._batch = null;\n }\n get blendMode() {\n return this.renderable.groupBlendMode;\n }\n get color() {\n return this.renderable.groupColorAlpha;\n }\n reset() {\n this.renderable = null;\n this.texture = null;\n this._batcher = null;\n this._batch = null;\n this.bounds = null;\n }\n destroy() {\n this.reset();\n }\n}\n\nexport { BatchableSprite };\n//# sourceMappingURL=BatchableSprite.mjs.map\n","import { BatchableSprite } from '../../sprite/BatchableSprite.mjs';\n\n\"use strict\";\nclass BatchableText extends BatchableSprite {\n}\n\nexport { BatchableText };\n//# sourceMappingURL=BatchableText.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { GCManagedHash } from '../../../utils/data/GCManagedHash.mjs';\nimport { updateTextBounds } from '../utils/updateTextBounds.mjs';\nimport { BatchableText } from './BatchableText.mjs';\n\n\"use strict\";\nclass CanvasTextPipe {\n constructor(renderer) {\n this._renderer = renderer;\n renderer.runners.resolutionChange.add(this);\n this._managedTexts = new GCManagedHash({\n renderer,\n type: \"renderable\",\n onUnload: this.onTextUnload.bind(this),\n name: \"canvasText\"\n });\n }\n resolutionChange() {\n for (const key in this._managedTexts.items) {\n const text = this._managedTexts.items[key];\n if (text?._autoResolution) text.onViewUpdate();\n }\n }\n validateRenderable(text) {\n const gpuText = this._getGpuText(text);\n const newKey = text.styleKey;\n if (gpuText.currentKey !== newKey) return true;\n return text._didTextUpdate;\n }\n addRenderable(text, instructionSet) {\n const batchableText = this._getGpuText(text);\n if (text._didTextUpdate) {\n const resolution = text._autoResolution ? this._renderer.resolution : text.resolution;\n if (batchableText.currentKey !== text.styleKey || text._resolution !== resolution) {\n this._updateGpuText(text);\n }\n text._didTextUpdate = false;\n updateTextBounds(batchableText, text);\n }\n this._renderer.renderPipes.batch.addToBatch(batchableText, instructionSet);\n }\n updateRenderable(text) {\n const batchableText = this._getGpuText(text);\n batchableText._batcher.updateElement(batchableText);\n }\n _updateGpuText(text) {\n const batchableText = this._getGpuText(text);\n if (batchableText.texture) {\n this._renderer.canvasText.decreaseReferenceCount(batchableText.currentKey);\n }\n text._resolution = text._autoResolution ? this._renderer.resolution : text.resolution;\n batchableText.texture = this._renderer.canvasText.getManagedTexture(text);\n batchableText.currentKey = text.styleKey;\n }\n _getGpuText(text) {\n return text._gpuData[this._renderer.uid] || this.initGpuText(text);\n }\n initGpuText(text) {\n const batchableText = new BatchableText();\n batchableText.currentKey = \"--\";\n batchableText.renderable = text;\n batchableText.transform = text.groupTransform;\n batchableText.bounds = { minX: 0, maxX: 1, minY: 0, maxY: 0 };\n batchableText.roundPixels = this._renderer._roundPixels | text._roundPixels;\n text._gpuData[this._renderer.uid] = batchableText;\n this._managedTexts.add(text);\n return batchableText;\n }\n onTextUnload(text) {\n const gpuData = text._gpuData[this._renderer.uid];\n if (!gpuData) return;\n const { canvasText } = this._renderer;\n const refCount = canvasText.getReferenceCount(gpuData.currentKey);\n if (refCount > 0) {\n canvasText.decreaseReferenceCount(gpuData.currentKey);\n } else if (gpuData.texture) {\n canvasText.returnTexture(gpuData.texture);\n }\n }\n destroy() {\n this._managedTexts.destroy();\n this._renderer = null;\n }\n}\n/** @ignore */\nCanvasTextPipe.extension = {\n type: [\n ExtensionType.WebGLPipes,\n ExtensionType.WebGPUPipes,\n ExtensionType.CanvasPipes\n ],\n name: \"text\"\n};\n\nexport { CanvasTextPipe };\n//# sourceMappingURL=CanvasTextPipe.mjs.map\n","import { TexturePool } from '../../../rendering/renderers/shared/texture/TexturePool.mjs';\nimport { TextureStyle } from '../../../rendering/renderers/shared/texture/TextureStyle.mjs';\nimport { deprecation } from '../../../utils/logging/deprecation.mjs';\nimport { CanvasTextGenerator } from '../canvas/CanvasTextGenerator.mjs';\nimport { TextStyle } from '../TextStyle.mjs';\nimport { getPo2TextureFromSource } from '../utils/getPo2TextureFromSource.mjs';\n\n\"use strict\";\nclass AbstractTextSystem {\n constructor(renderer, retainCanvasContext) {\n this._activeTextures = {};\n this._renderer = renderer;\n this._retainCanvasContext = retainCanvasContext;\n }\n getTexture(options, _resolution, _style, _textKey) {\n if (typeof options === \"string\") {\n deprecation(\"8.0.0\", \"CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments\");\n options = {\n text: options,\n style: _style,\n resolution: _resolution\n };\n }\n if (!(options.style instanceof TextStyle)) {\n options.style = new TextStyle(options.style);\n }\n if (!(options.textureStyle instanceof TextureStyle)) {\n options.textureStyle = new TextureStyle(options.textureStyle);\n }\n if (typeof options.text !== \"string\") {\n options.text = options.text.toString();\n }\n const { text, style, textureStyle, autoGenerateMipmaps } = options;\n const resolution = options.resolution ?? this._renderer.resolution;\n const { frame, canvasAndContext } = CanvasTextGenerator.getCanvasAndContext({\n text,\n style,\n resolution\n });\n const texture = getPo2TextureFromSource(\n canvasAndContext.canvas,\n frame.width,\n frame.height,\n resolution,\n autoGenerateMipmaps\n );\n if (textureStyle) texture.source.style = textureStyle;\n if (style.trim) {\n frame.pad(style.padding);\n texture.frame.copyFrom(frame);\n texture.frame.scale(1 / resolution);\n texture.updateUvs();\n }\n if (style.filters) {\n const filteredTexture = this._applyFilters(texture, style.filters);\n this.returnTexture(texture);\n CanvasTextGenerator.returnCanvasAndContext(canvasAndContext);\n return filteredTexture;\n }\n this._renderer.texture.initSource(texture._source);\n if (!this._retainCanvasContext) {\n CanvasTextGenerator.returnCanvasAndContext(canvasAndContext);\n }\n return texture;\n }\n /**\n * Returns a texture that was created wit the above `getTexture` function.\n * Handy if you are done with a texture and want to return it to the pool.\n * @param texture - The texture to be returned.\n */\n returnTexture(texture) {\n const source = texture.source;\n const resource = source.resource;\n if (this._retainCanvasContext && resource?.getContext) {\n const context = resource.getContext(\"2d\");\n if (context) {\n CanvasTextGenerator.returnCanvasAndContext({ canvas: resource, context });\n }\n }\n source.resource = null;\n source.uploadMethodId = \"unknown\";\n source.alphaMode = \"no-premultiply-alpha\";\n TexturePool.returnTexture(texture, true);\n }\n /**\n * Renders text to its canvas, and updates its texture.\n * @deprecated since 8.10.0\n */\n renderTextToCanvas() {\n deprecation(\n \"8.10.0\",\n \"CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead\"\n );\n }\n /**\n * Gets or creates a managed texture for a Text object. This method handles texture reuse and reference counting.\n * @param text - The Text object that needs a texture\n * @returns A Texture instance that represents the rendered text\n * @remarks\n * This method performs the following:\n * 1. Sets the appropriate resolution based on auto-resolution settings\n * 2. Checks if a texture already exists for the text's style\n * 3. Creates a new texture if needed or returns an existing one\n * 4. Manages reference counting for texture reuse\n */\n getManagedTexture(text) {\n text._resolution = text._autoResolution ? this._renderer.resolution : text.resolution;\n const textKey = text.styleKey;\n if (this._activeTextures[textKey]) {\n this._increaseReferenceCount(textKey);\n return this._activeTextures[textKey].texture;\n }\n const texture = this.getTexture({\n text: text.text,\n style: text.style,\n resolution: text._resolution,\n textureStyle: text.textureStyle,\n autoGenerateMipmaps: text.autoGenerateMipmaps\n });\n this._activeTextures[textKey] = {\n texture,\n usageCount: 1\n };\n return texture;\n }\n /**\n * Decreases the reference count for a texture associated with a text key.\n * When the reference count reaches zero, the texture is returned to the pool.\n * @param textKey - The unique key identifying the text style configuration\n * @remarks\n * This method is crucial for memory management, ensuring textures are properly\n * cleaned up when they are no longer needed by any Text instances.\n */\n decreaseReferenceCount(textKey) {\n const activeTexture = this._activeTextures[textKey];\n if (!activeTexture) return;\n activeTexture.usageCount--;\n if (activeTexture.usageCount === 0) {\n this.returnTexture(activeTexture.texture);\n this._activeTextures[textKey] = null;\n }\n }\n /**\n * Gets the current reference count for a texture associated with a text key.\n * @param textKey - The unique key identifying the text style configuration\n * @returns The number of Text instances currently using this texture\n */\n getReferenceCount(textKey) {\n return this._activeTextures[textKey]?.usageCount ?? 0;\n }\n _increaseReferenceCount(textKey) {\n this._activeTextures[textKey].usageCount++;\n }\n /**\n * Applies the specified filters to the given texture.\n *\n * This method takes a texture and a list of filters, applies the filters to the texture,\n * and returns the resulting texture. It also ensures that the alpha mode of the resulting\n * texture is set to 'premultiplied-alpha'.\n * @param {Texture} texture - The texture to which the filters will be applied.\n * @param {Filter[]} filters - The filters to apply to the texture.\n * @returns {Texture} The resulting texture after all filters have been applied.\n */\n _applyFilters(texture, filters) {\n const currentRenderTarget = this._renderer.renderTarget.renderTarget;\n const resultTexture = this._renderer.filter.generateFilteredTexture({\n texture,\n filters\n });\n this._renderer.renderTarget.bind(currentRenderTarget, false);\n return resultTexture;\n }\n destroy() {\n this._renderer = null;\n for (const key in this._activeTextures) {\n if (this._activeTextures[key]) this.returnTexture(this._activeTextures[key].texture);\n }\n this._activeTextures = null;\n }\n}\n\nexport { AbstractTextSystem };\n//# sourceMappingURL=AbstractTextSystem.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { AbstractTextSystem } from '../shared/AbstractTextSystem.mjs';\n\n\"use strict\";\nclass CanvasRendererTextSystem extends AbstractTextSystem {\n constructor(renderer) {\n super(renderer, true);\n }\n}\n/** @ignore */\nCanvasRendererTextSystem.extension = {\n type: [\n ExtensionType.CanvasSystem\n ],\n name: \"canvasText\"\n};\n\nexport { CanvasRendererTextSystem };\n//# sourceMappingURL=CanvasTextSystem.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { AbstractTextSystem } from './AbstractTextSystem.mjs';\n\n\"use strict\";\nclass CanvasTextSystem extends AbstractTextSystem {\n constructor(renderer) {\n super(renderer, false);\n }\n}\n/** @ignore */\nCanvasTextSystem.extension = {\n type: [\n ExtensionType.WebGLSystem,\n ExtensionType.WebGPUSystem\n ],\n name: \"canvasText\"\n};\n\nexport { CanvasTextSystem };\n//# sourceMappingURL=GpuTextSystem.mjs.map\n","import { extensions } from '../../extensions/Extensions.mjs';\nimport { CanvasTextPipe } from './canvas/CanvasTextPipe.mjs';\nimport { CanvasRendererTextSystem } from './canvas/CanvasTextSystem.mjs';\nimport { CanvasTextSystem } from './shared/GpuTextSystem.mjs';\n\n\"use strict\";\nextensions.add(CanvasRendererTextSystem);\nextensions.add(CanvasTextSystem);\nextensions.add(CanvasTextPipe);\n//# sourceMappingURL=init.mjs.map\n","import { TextureSource } from '../../rendering/renderers/shared/texture/sources/TextureSource.mjs';\nimport { TextureStyle } from '../../rendering/renderers/shared/texture/TextureStyle.mjs';\nimport { AbstractText, ensureTextOptions } from './AbstractText.mjs';\nimport { CanvasTextGenerator } from './canvas/CanvasTextGenerator.mjs';\nimport { CanvasTextMetrics } from './canvas/CanvasTextMetrics.mjs';\nimport { TextStyle } from './TextStyle.mjs';\nimport './init.mjs';\n\n\"use strict\";\nclass Text extends AbstractText {\n constructor(...args) {\n const options = ensureTextOptions(args, \"Text\");\n super(options, TextStyle);\n /** @internal */\n this.renderPipeId = \"text\";\n if (options.textureStyle) {\n this.textureStyle = options.textureStyle instanceof TextureStyle ? options.textureStyle : new TextureStyle(options.textureStyle);\n }\n this.autoGenerateMipmaps = options.autoGenerateMipmaps ?? TextureSource.defaultOptions.autoGenerateMipmaps;\n }\n /** @private */\n updateBounds() {\n const bounds = this._bounds;\n const anchor = this._anchor;\n let width = 0;\n let height = 0;\n if (this._style.trim) {\n const { frame, canvasAndContext } = CanvasTextGenerator.getCanvasAndContext({\n text: this.text,\n style: this._style,\n resolution: 1\n });\n CanvasTextGenerator.returnCanvasAndContext(canvasAndContext);\n width = frame.width;\n height = frame.height;\n } else {\n const canvasMeasurement = CanvasTextMetrics.measureText(\n this._text,\n this._style\n );\n width = canvasMeasurement.width;\n height = canvasMeasurement.height;\n }\n bounds.minX = -anchor._x * width;\n bounds.maxX = bounds.minX + width;\n bounds.minY = -anchor._y * height;\n bounds.maxY = bounds.minY + height;\n }\n}\n\nexport { Text };\n//# sourceMappingURL=Text.mjs.map\n","import { browserExt } from './environment-browser/browserExt.mjs';\nimport { webworkerExt } from './environment-webworker/webworkerExt.mjs';\nimport { extensions } from './extensions/Extensions.mjs';\nexport { ExtensionType, normalizeExtensionPriority } from './extensions/Extensions.mjs';\nimport './rendering/init.mjs';\nimport './spritesheet/init.mjs';\nimport './accessibility/index.mjs';\nimport './advanced-blend-modes/index.mjs';\nimport './app/index.mjs';\nimport './assets/index.mjs';\nimport './color/index.mjs';\nimport './compressed-textures/index.mjs';\nimport './culling/index.mjs';\nimport './dom/index.mjs';\nimport './environment/index.mjs';\nimport './environment-browser/index.mjs';\nimport './environment-webworker/index.mjs';\nimport './events/index.mjs';\nimport './extensions/index.mjs';\nimport './filters/index.mjs';\nimport './maths/index.mjs';\nimport './prepare/index.mjs';\nimport './rendering/index.mjs';\nimport './scene/index.mjs';\nimport './spritesheet/index.mjs';\nimport './ticker/index.mjs';\nimport './utils/index.mjs';\nexport { AccessibilitySystem } from './accessibility/AccessibilitySystem.mjs';\nexport { accessibilityTarget } from './accessibility/accessibilityTarget.mjs';\nexport { ColorBlend } from './advanced-blend-modes/ColorBlend.mjs';\nexport { ColorBurnBlend } from './advanced-blend-modes/ColorBurnBlend.mjs';\nexport { ColorDodgeBlend } from './advanced-blend-modes/ColorDodgeBlend.mjs';\nexport { DarkenBlend } from './advanced-blend-modes/DarkenBlend.mjs';\nexport { DifferenceBlend } from './advanced-blend-modes/DifferenceBlend.mjs';\nexport { DivideBlend } from './advanced-blend-modes/DivideBlend.mjs';\nexport { ExclusionBlend } from './advanced-blend-modes/ExclusionBlend.mjs';\nexport { HardLightBlend } from './advanced-blend-modes/HardLightBlend.mjs';\nexport { HardMixBlend } from './advanced-blend-modes/HardMixBlend.mjs';\nexport { LightenBlend } from './advanced-blend-modes/LightenBlend.mjs';\nexport { LinearBurnBlend } from './advanced-blend-modes/LinearBurnBlend.mjs';\nexport { LinearDodgeBlend } from './advanced-blend-modes/LinearDodgeBlend.mjs';\nexport { LinearLightBlend } from './advanced-blend-modes/LinearLightBlend.mjs';\nexport { LuminosityBlend } from './advanced-blend-modes/LuminosityBlend.mjs';\nexport { NegationBlend } from './advanced-blend-modes/NegationBlend.mjs';\nexport { OverlayBlend } from './advanced-blend-modes/OverlayBlend.mjs';\nexport { PinLightBlend } from './advanced-blend-modes/PinLightBlend.mjs';\nexport { SaturationBlend } from './advanced-blend-modes/SaturationBlend.mjs';\nexport { SoftLightBlend } from './advanced-blend-modes/SoftLightBlend.mjs';\nexport { SubtractBlend } from './advanced-blend-modes/SubtractBlend.mjs';\nexport { VividLightBlend } from './advanced-blend-modes/VividLightBlend.mjs';\nexport { Application } from './app/Application.mjs';\nexport { ResizePlugin } from './app/ResizePlugin.mjs';\nexport { TickerPlugin } from './app/TickerPlugin.mjs';\nexport { Assets, AssetsClass } from './assets/Assets.mjs';\nexport { BackgroundLoader } from './assets/BackgroundLoader.mjs';\nexport { Cache } from './assets/cache/Cache.mjs';\nexport { cacheTextureArray } from './assets/cache/parsers/cacheTextureArray.mjs';\nexport { detectAvif } from './assets/detections/parsers/detectAvif.mjs';\nexport { detectDefaults } from './assets/detections/parsers/detectDefaults.mjs';\nexport { detectMp4 } from './assets/detections/parsers/detectMp4.mjs';\nexport { detectOgv } from './assets/detections/parsers/detectOgv.mjs';\nexport { detectWebm } from './assets/detections/parsers/detectWebm.mjs';\nexport { detectWebp } from './assets/detections/parsers/detectWebp.mjs';\nexport { testImageFormat } from './assets/detections/utils/testImageFormat.mjs';\nexport { testVideoFormat } from './assets/detections/utils/testVideoFormat.mjs';\nexport { Loader } from './assets/loader/Loader.mjs';\nexport { LoaderParserPriority } from './assets/loader/parsers/LoaderParser.mjs';\nexport { loadJson } from './assets/loader/parsers/loadJson.mjs';\nexport { loadTxt } from './assets/loader/parsers/loadTxt.mjs';\nexport { getFontFamilyName, loadWebFont } from './assets/loader/parsers/loadWebFont.mjs';\nexport { loadSvg } from './assets/loader/parsers/textures/loadSVG.mjs';\nexport { loadImageBitmap, loadTextures } from './assets/loader/parsers/textures/loadTextures.mjs';\nexport { crossOrigin, determineCrossOrigin, loadVideoTextures, preloadVideo } from './assets/loader/parsers/textures/loadVideoTextures.mjs';\nexport { createTexture } from './assets/loader/parsers/textures/utils/createTexture.mjs';\nexport { WorkerManager } from './assets/loader/workers/WorkerManager.mjs';\nexport { resolveJsonUrl } from './assets/resolver/parsers/resolveJsonUrl.mjs';\nexport { resolveTextureUrl } from './assets/resolver/parsers/resolveTextureUrl.mjs';\nexport { Resolver, getUrlExtension } from './assets/resolver/Resolver.mjs';\nexport { checkDataUrl } from './assets/utils/checkDataUrl.mjs';\nexport { checkExtension } from './assets/utils/checkExtension.mjs';\nexport { convertToList } from './assets/utils/convertToList.mjs';\nexport { copySearchParams } from './assets/utils/copySearchParams.mjs';\nexport { createStringVariations } from './assets/utils/createStringVariations.mjs';\nexport { isSingleItem } from './assets/utils/isSingleItem.mjs';\nexport { Color } from './color/Color.mjs';\nexport { detectBasis } from './compressed-textures/basis/detectBasis.mjs';\nexport { loadBasis } from './compressed-textures/basis/loadBasis.mjs';\nexport { createLevelBuffers } from './compressed-textures/basis/utils/createLevelBuffers.mjs';\nexport { gpuFormatToBasisTranscoderFormat } from './compressed-textures/basis/utils/gpuFormatToBasisTranscoderFormat.mjs';\nexport { basisTranscoderUrls, setBasisTranscoderPath } from './compressed-textures/basis/utils/setBasisTranscoderPath.mjs';\nexport { loadBasisOnWorker } from './compressed-textures/basis/worker/loadBasisOnWorker.mjs';\nexport { D3D10_RESOURCE_DIMENSION, D3DFMT, DDS, DXGI_FORMAT, DXGI_TO_TEXTURE_FORMAT, FOURCC_TO_TEXTURE_FORMAT, TEXTURE_FORMAT_BLOCK_SIZE } from './compressed-textures/dds/const.mjs';\nexport { loadDDS } from './compressed-textures/dds/loadDDS.mjs';\nexport { parseDDS } from './compressed-textures/dds/parseDDS.mjs';\nexport { loadKTX } from './compressed-textures/ktx/loadKTX.mjs';\nexport { parseKTX } from './compressed-textures/ktx/parseKTX.mjs';\nexport { GL_INTERNAL_FORMAT, KTX } from './compressed-textures/ktx2/const.mjs';\nexport { loadKTX2 } from './compressed-textures/ktx2/loadKTX2.mjs';\nexport { convertFormatIfRequired } from './compressed-textures/ktx2/utils/convertFormatIfRequired.mjs';\nexport { createLevelBuffersFromKTX } from './compressed-textures/ktx2/utils/createLevelBuffersFromKTX.mjs';\nexport { getTextureFormatFromKTXTexture } from './compressed-textures/ktx2/utils/getTextureFormatFromKTXTexture.mjs';\nexport { glFormatToGPUFormat } from './compressed-textures/ktx2/utils/glFormatToGPUFormat.mjs';\nexport { gpuFormatToKTXBasisTranscoderFormat } from './compressed-textures/ktx2/utils/gpuFormatToKTXBasisTranscoderFormat.mjs';\nexport { ktxTranscoderUrls, setKTXTranscoderPath } from './compressed-textures/ktx2/utils/setKTXTranscoderPath.mjs';\nexport { vkFormatToGPUFormat } from './compressed-textures/ktx2/utils/vkFormatToGPUFormat.mjs';\nexport { loadKTX2onWorker } from './compressed-textures/ktx2/worker/loadKTX2onWorker.mjs';\nexport { detectCompressed } from './compressed-textures/shared/detectCompressed.mjs';\nexport { resolveCompressedTextureUrl, validFormats } from './compressed-textures/shared/resolveCompressedTextureUrl.mjs';\nexport { Culler } from './culling/Culler.mjs';\nexport { CullerPlugin } from './culling/CullerPlugin.mjs';\nexport { cullingMixin } from './culling/cullingMixin.mjs';\nexport { CanvasObserver } from './dom/CanvasObserver.mjs';\nexport { DOMContainer } from './dom/DOMContainer.mjs';\nexport { DOMPipe } from './dom/DOMPipe.mjs';\nexport { DOMAdapter } from './environment/adapter.mjs';\nexport { autoDetectEnvironment, loadEnvironmentExtensions } from './environment/autoDetectEnvironment.mjs';\nexport { BrowserAdapter } from './environment-browser/BrowserAdapter.mjs';\nexport { WebWorkerAdapter } from './environment-webworker/WebWorkerAdapter.mjs';\nexport { EventBoundary } from './events/EventBoundary.mjs';\nexport { EventSystem } from './events/EventSystem.mjs';\nexport { EventsTicker } from './events/EventTicker.mjs';\nexport { FederatedEvent } from './events/FederatedEvent.mjs';\nexport { FederatedContainer } from './events/FederatedEventTarget.mjs';\nexport { FederatedMouseEvent } from './events/FederatedMouseEvent.mjs';\nexport { FederatedPointerEvent } from './events/FederatedPointerEvent.mjs';\nexport { FederatedWheelEvent } from './events/FederatedWheelEvent.mjs';\nexport { default as blendTemplateFrag } from './filters/blend-modes/blend-template.frag.mjs';\nexport { default as blendTemplateVert } from './filters/blend-modes/blend-template.vert.mjs';\nexport { default as blendTemplateWgsl } from './filters/blend-modes/blend-template.wgsl.mjs';\nexport { default as hslWgsl } from './filters/blend-modes/hsl.wgsl.mjs';\nexport { default as alphaFrag } from './filters/defaults/alpha/alpha.frag.mjs';\nexport { default as alphaWgsl } from './filters/defaults/alpha/alpha.wgsl.mjs';\nexport { default as blurTemplateWgsl } from './filters/defaults/blur/gpu/blur-template.wgsl.mjs';\nexport { default as colorMatrixFilterFrag } from './filters/defaults/color-matrix/colorMatrixFilter.frag.mjs';\nexport { default as colorMatrixFilterWgsl } from './filters/defaults/color-matrix/colorMatrixFilter.wgsl.mjs';\nexport { default as defaultFilterVert } from './filters/defaults/defaultFilter.vert.mjs';\nexport { default as displacementFrag } from './filters/defaults/displacement/displacement.frag.mjs';\nexport { default as displacementVert } from './filters/defaults/displacement/displacement.vert.mjs';\nexport { default as displacementWgsl } from './filters/defaults/displacement/displacement.wgsl.mjs';\nexport { default as noiseFrag } from './filters/defaults/noise/noise.frag.mjs';\nexport { default as noiseWgsl } from './filters/defaults/noise/noise.wgsl.mjs';\nexport { default as passthroughFrag } from './filters/defaults/passthrough/passthrough.frag.mjs';\nexport { default as passthroughWgsl } from './filters/defaults/passthrough/passthrough.wgsl.mjs';\nexport { default as maskFrag } from './filters/mask/mask.frag.mjs';\nexport { default as maskVert } from './filters/mask/mask.vert.mjs';\nexport { default as maskWgsl } from './filters/mask/mask.wgsl.mjs';\nexport { BlendModeFilter } from './filters/blend-modes/BlendModeFilter.mjs';\nexport { hslgl } from './filters/blend-modes/hls/GLhls.mjs';\nexport { hslgpu } from './filters/blend-modes/hls/GPUhls.mjs';\nexport { CanvasFilterSystem, isCanvasFilterCapable } from './filters/CanvasFilterSystem.mjs';\nexport { AlphaFilter } from './filters/defaults/alpha/AlphaFilter.mjs';\nexport { BlurFilter } from './filters/defaults/blur/BlurFilter.mjs';\nexport { BlurFilterPass } from './filters/defaults/blur/BlurFilterPass.mjs';\nexport { GAUSSIAN_VALUES } from './filters/defaults/blur/const.mjs';\nexport { generateBlurFragSource } from './filters/defaults/blur/gl/generateBlurFragSource.mjs';\nexport { generateBlurGlProgram } from './filters/defaults/blur/gl/generateBlurGlProgram.mjs';\nexport { generateBlurVertSource } from './filters/defaults/blur/gl/generateBlurVertSource.mjs';\nexport { generateBlurProgram } from './filters/defaults/blur/gpu/generateBlurProgram.mjs';\nexport { ColorMatrixFilter } from './filters/defaults/color-matrix/ColorMatrixFilter.mjs';\nexport { DisplacementFilter } from './filters/defaults/displacement/DisplacementFilter.mjs';\nexport { NoiseFilter } from './filters/defaults/noise/NoiseFilter.mjs';\nexport { PassthroughFilter } from './filters/defaults/passthrough/PassthroughFilter.mjs';\nexport { Filter } from './filters/Filter.mjs';\nexport { FilterEffect } from './filters/FilterEffect.mjs';\nexport { FilterPipe } from './filters/FilterPipe.mjs';\nexport { FilterSystem } from './filters/FilterSystem.mjs';\nexport { MaskFilter } from './filters/mask/MaskFilter.mjs';\nexport { groupD8 } from './maths/matrix/groupD8.mjs';\nexport { Matrix } from './maths/matrix/Matrix.mjs';\nexport { DEG_TO_RAD, PI_2, RAD_TO_DEG } from './maths/misc/const.mjs';\nexport { isPow2, log2, nextPow2 } from './maths/misc/pow2.mjs';\nexport { squaredDistanceToLineSegment } from './maths/misc/squaredDistanceToLineSegment.mjs';\nexport { ObservablePoint } from './maths/point/ObservablePoint.mjs';\nexport { Point } from './maths/point/Point.mjs';\nexport { pointInTriangle } from './maths/point/pointInTriangle.mjs';\nexport { Circle } from './maths/shapes/Circle.mjs';\nexport { Ellipse } from './maths/shapes/Ellipse.mjs';\nexport { Polygon } from './maths/shapes/Polygon.mjs';\nexport { Rectangle } from './maths/shapes/Rectangle.mjs';\nexport { RoundedRectangle } from './maths/shapes/RoundedRectangle.mjs';\nexport { Triangle } from './maths/shapes/Triangle.mjs';\nexport { PrepareBase } from './prepare/PrepareBase.mjs';\nexport { PrepareQueue } from './prepare/PrepareQueue.mjs';\nexport { PrepareSystem } from './prepare/PrepareSystem.mjs';\nexport { PrepareUpload } from './prepare/PrepareUpload.mjs';\nexport { CanvasBatchAdaptor } from './rendering/batcher/canvas/CanvasBatchAdaptor.mjs';\nexport { GlBatchAdaptor } from './rendering/batcher/gl/GlBatchAdaptor.mjs';\nexport { checkMaxIfStatementsInShader } from './rendering/batcher/gl/utils/checkMaxIfStatementsInShader.mjs';\nexport { getMaxTexturesPerBatch } from './rendering/batcher/gl/utils/maxRecommendedTextures.mjs';\nexport { generateGPULayout } from './rendering/batcher/gpu/generateGPULayout.mjs';\nexport { generateLayout } from './rendering/batcher/gpu/generateLayout.mjs';\nexport { getTextureBatchBindGroup } from './rendering/batcher/gpu/getTextureBatchBindGroup.mjs';\nexport { GpuBatchAdaptor } from './rendering/batcher/gpu/GpuBatchAdaptor.mjs';\nexport { Batch, Batcher } from './rendering/batcher/shared/Batcher.mjs';\nexport { BatcherPipe } from './rendering/batcher/shared/BatcherPipe.mjs';\nexport { BatchGeometry } from './rendering/batcher/shared/BatchGeometry.mjs';\nexport { BatchTextureArray } from './rendering/batcher/shared/BatchTextureArray.mjs';\nexport { DefaultBatcher } from './rendering/batcher/shared/DefaultBatcher.mjs';\nexport { DefaultShader } from './rendering/batcher/shared/DefaultShader.mjs';\nexport { compileHighShaderGlProgram, compileHighShaderGpuProgram } from './rendering/high-shader/compileHighShaderToProgram.mjs';\nexport { compileHighShader, compileHighShaderGl } from './rendering/high-shader/compiler/compileHighShader.mjs';\nexport { addBits } from './rendering/high-shader/compiler/utils/addBits.mjs';\nexport { compileHooks } from './rendering/high-shader/compiler/utils/compileHooks.mjs';\nexport { compileInputs } from './rendering/high-shader/compiler/utils/compileInputs.mjs';\nexport { compileOutputs } from './rendering/high-shader/compiler/utils/compileOutputs.mjs';\nexport { formatShader } from './rendering/high-shader/compiler/utils/formatShader.mjs';\nexport { injectBits } from './rendering/high-shader/compiler/utils/injectBits.mjs';\nexport { fragmentGPUTemplate, fragmentGlTemplate, vertexGPUTemplate, vertexGlTemplate } from './rendering/high-shader/defaultProgramTemplate.mjs';\nexport { colorBit, colorBitGl } from './rendering/high-shader/shader-bits/colorBit.mjs';\nexport { generateTextureBatchBit, generateTextureBatchBitGl } from './rendering/high-shader/shader-bits/generateTextureBatchBit.mjs';\nexport { globalUniformsBit, globalUniformsBitGl, globalUniformsUBOBitGl } from './rendering/high-shader/shader-bits/globalUniformsBit.mjs';\nexport { localUniformBit, localUniformBitGl, localUniformBitGroup2 } from './rendering/high-shader/shader-bits/localUniformBit.mjs';\nexport { roundPixelsBit, roundPixelsBitGl } from './rendering/high-shader/shader-bits/roundPixelsBit.mjs';\nexport { textureBit, textureBitGl } from './rendering/high-shader/shader-bits/textureBit.mjs';\nexport { AlphaMask } from './rendering/mask/alpha/AlphaMask.mjs';\nexport { AlphaMaskPipe } from './rendering/mask/alpha/AlphaMaskPipe.mjs';\nexport { CanvasColorMaskPipe } from './rendering/mask/color/CanvasColorMaskPipe.mjs';\nexport { ColorMask } from './rendering/mask/color/ColorMask.mjs';\nexport { ColorMaskPipe } from './rendering/mask/color/ColorMaskPipe.mjs';\nexport { MaskEffectManager, MaskEffectManagerClass } from './rendering/mask/MaskEffectManager.mjs';\nexport { ScissorMask } from './rendering/mask/scissor/ScissorMask.mjs';\nexport { CanvasStencilMaskPipe } from './rendering/mask/stencil/CanvasStencilMaskPipe.mjs';\nexport { StencilMask } from './rendering/mask/stencil/StencilMask.mjs';\nexport { StencilMaskPipe } from './rendering/mask/stencil/StencilMaskPipe.mjs';\nexport { addMaskBounds } from './rendering/mask/utils/addMaskBounds.mjs';\nexport { addMaskLocalBounds } from './rendering/mask/utils/addMaskLocalBounds.mjs';\nexport { autoDetectRenderer } from './rendering/renderers/autoDetectRenderer.mjs';\nexport { CanvasContextSystem } from './rendering/renderers/canvas/CanvasContextSystem.mjs';\nexport { CanvasLimitsSystem } from './rendering/renderers/canvas/CanvasLimitsSystem.mjs';\nexport { CanvasRenderer } from './rendering/renderers/canvas/CanvasRenderer.mjs';\nexport { CanvasRenderTargetAdaptor } from './rendering/renderers/canvas/renderTarget/CanvasRenderTargetAdaptor.mjs';\nexport { CanvasRenderTargetSystem } from './rendering/renderers/canvas/renderTarget/CanvasRenderTargetSystem.mjs';\nexport { CanvasTextureSystem } from './rendering/renderers/canvas/texture/CanvasTextureSystem.mjs';\nexport { canUseNewCanvasBlendModes } from './rendering/renderers/canvas/utils/canUseNewCanvasBlendModes.mjs';\nexport { canvasUtils } from './rendering/renderers/canvas/utils/canvasUtils.mjs';\nexport { mapCanvasBlendModesToPixi } from './rendering/renderers/canvas/utils/mapCanvasBlendModesToPixi.mjs';\nexport { BUFFER_TYPE } from './rendering/renderers/gl/buffer/const.mjs';\nexport { GlBuffer } from './rendering/renderers/gl/buffer/GlBuffer.mjs';\nexport { GlBufferSystem } from './rendering/renderers/gl/buffer/GlBufferSystem.mjs';\nexport { CLEAR } from './rendering/renderers/gl/const.mjs';\nexport { GlContextSystem } from './rendering/renderers/gl/context/GlContextSystem.mjs';\nexport { GlGeometryGpuData, GlGeometrySystem } from './rendering/renderers/gl/geometry/GlGeometrySystem.mjs';\nexport { getGlTypeFromFormat } from './rendering/renderers/gl/geometry/utils/getGlTypeFromFormat.mjs';\nexport { GlBackBufferSystem } from './rendering/renderers/gl/GlBackBufferSystem.mjs';\nexport { GlColorMaskSystem } from './rendering/renderers/gl/GlColorMaskSystem.mjs';\nexport { GlEncoderSystem } from './rendering/renderers/gl/GlEncoderSystem.mjs';\nexport { GlLimitsSystem } from './rendering/renderers/gl/GlLimitsSystem.mjs';\nexport { GlRenderTarget } from './rendering/renderers/gl/GlRenderTarget.mjs';\nexport { GlStencilSystem } from './rendering/renderers/gl/GlStencilSystem.mjs';\nexport { GlUboSystem } from './rendering/renderers/gl/GlUboSystem.mjs';\nexport { GlRenderTargetAdaptor } from './rendering/renderers/gl/renderTarget/GlRenderTargetAdaptor.mjs';\nexport { GlRenderTargetSystem } from './rendering/renderers/gl/renderTarget/GlRenderTargetSystem.mjs';\nexport { generateShaderSyncCode } from './rendering/renderers/gl/shader/GenerateShaderSyncCode.mjs';\nexport { getBatchSamplersUniformGroup } from './rendering/renderers/gl/shader/getBatchSamplersUniformGroup.mjs';\nexport { GlProgram } from './rendering/renderers/gl/shader/GlProgram.mjs';\nexport { GlProgramData, IGLUniformData } from './rendering/renderers/gl/shader/GlProgramData.mjs';\nexport { GlShaderSystem } from './rendering/renderers/gl/shader/GlShaderSystem.mjs';\nexport { GlUniformGroupSystem } from './rendering/renderers/gl/shader/GlUniformGroupSystem.mjs';\nexport { migrateFragmentFromV7toV8 } from './rendering/renderers/gl/shader/migrateFragmentFromV7toV8.mjs';\nexport { compileShader } from './rendering/renderers/gl/shader/program/compileShader.mjs';\nexport { defaultValue } from './rendering/renderers/gl/shader/program/defaultValue.mjs';\nexport { ensureAttributes } from './rendering/renderers/gl/shader/program/ensureAttributes.mjs';\nexport { extractAttributesFromGlProgram } from './rendering/renderers/gl/shader/program/extractAttributesFromGlProgram.mjs';\nexport { generateProgram } from './rendering/renderers/gl/shader/program/generateProgram.mjs';\nexport { getMaxFragmentPrecision } from './rendering/renderers/gl/shader/program/getMaxFragmentPrecision.mjs';\nexport { getTestContext } from './rendering/renderers/gl/shader/program/getTestContext.mjs';\nexport { getUboData } from './rendering/renderers/gl/shader/program/getUboData.mjs';\nexport { getUniformData } from './rendering/renderers/gl/shader/program/getUniformData.mjs';\nexport { logProgramError } from './rendering/renderers/gl/shader/program/logProgramError.mjs';\nexport { mapSize } from './rendering/renderers/gl/shader/program/mapSize.mjs';\nexport { mapGlToVertexFormat, mapType } from './rendering/renderers/gl/shader/program/mapType.mjs';\nexport { addProgramDefines } from './rendering/renderers/gl/shader/program/preprocessors/addProgramDefines.mjs';\nexport { ensurePrecision } from './rendering/renderers/gl/shader/program/preprocessors/ensurePrecision.mjs';\nexport { insertVersion } from './rendering/renderers/gl/shader/program/preprocessors/insertVersion.mjs';\nexport { setProgramName } from './rendering/renderers/gl/shader/program/preprocessors/setProgramName.mjs';\nexport { stripVersion } from './rendering/renderers/gl/shader/program/preprocessors/stripVersion.mjs';\nexport { WGSL_TO_STD40_SIZE, createUboElementsSTD40 } from './rendering/renderers/gl/shader/utils/createUboElementsSTD40.mjs';\nexport { createUboSyncFunctionSTD40 } from './rendering/renderers/gl/shader/utils/createUboSyncSTD40.mjs';\nexport { generateArraySyncSTD40 } from './rendering/renderers/gl/shader/utils/generateArraySyncSTD40.mjs';\nexport { generateUniformsSync } from './rendering/renderers/gl/shader/utils/generateUniformsSync.mjs';\nexport { UNIFORM_TO_ARRAY_SETTERS, UNIFORM_TO_SINGLE_SETTERS } from './rendering/renderers/gl/shader/utils/generateUniformsSyncTypes.mjs';\nexport { GlStateSystem } from './rendering/renderers/gl/state/GlStateSystem.mjs';\nexport { mapWebGLBlendModesToPixi } from './rendering/renderers/gl/state/mapWebGLBlendModesToPixi.mjs';\nexport { GL_FORMATS, GL_TARGETS, GL_TYPES, GL_WRAP_MODES } from './rendering/renderers/gl/texture/const.mjs';\nexport { GlTexture } from './rendering/renderers/gl/texture/GlTexture.mjs';\nexport { GlTextureSystem } from './rendering/renderers/gl/texture/GlTextureSystem.mjs';\nexport { glUploadBufferImageResource } from './rendering/renderers/gl/texture/uploaders/glUploadBufferImageResource.mjs';\nexport { glUploadCompressedTextureResource } from './rendering/renderers/gl/texture/uploaders/glUploadCompressedTextureResource.mjs';\nexport { createGlUploadCubeTextureResource } from './rendering/renderers/gl/texture/uploaders/glUploadCubeTextureResource.mjs';\nexport { glUploadImageResource } from './rendering/renderers/gl/texture/uploaders/glUploadImageResource.mjs';\nexport { glUploadVideoResource } from './rendering/renderers/gl/texture/uploaders/glUploadVideoResource.mjs';\nexport { applyStyleParams } from './rendering/renderers/gl/texture/utils/applyStyleParams.mjs';\nexport { getSupportedGlCompressedTextureFormats } from './rendering/renderers/gl/texture/utils/getSupportedGlCompressedTextureFormats.mjs';\nexport { mapFormatToGlFormat } from './rendering/renderers/gl/texture/utils/mapFormatToGlFormat.mjs';\nexport { mapFormatToGlInternalFormat } from './rendering/renderers/gl/texture/utils/mapFormatToGlInternalFormat.mjs';\nexport { mapFormatToGlType } from './rendering/renderers/gl/texture/utils/mapFormatToGlType.mjs';\nexport { mapViewDimensionToGlTarget } from './rendering/renderers/gl/texture/utils/mapViewDimensionToGlTarget.mjs';\nexport { compareModeToGlCompare, mipmapScaleModeToGlFilter, scaleModeToGlFilter, wrapModeToGlAddress } from './rendering/renderers/gl/texture/utils/pixiToGlMaps.mjs';\nexport { unpremultiplyAlpha } from './rendering/renderers/gl/texture/utils/unpremultiplyAlpha.mjs';\nexport { WebGLRenderer } from './rendering/renderers/gl/WebGLRenderer.mjs';\nexport { BindGroupSystem } from './rendering/renderers/gpu/BindGroupSystem.mjs';\nexport { GpuBufferData, GpuBufferSystem } from './rendering/renderers/gpu/buffer/GpuBufferSystem.mjs';\nexport { UboBatch } from './rendering/renderers/gpu/buffer/UboBatch.mjs';\nexport { GpuColorMaskSystem } from './rendering/renderers/gpu/GpuColorMaskSystem.mjs';\nexport { GpuDeviceSystem } from './rendering/renderers/gpu/GpuDeviceSystem.mjs';\nexport { GpuEncoderSystem } from './rendering/renderers/gpu/GpuEncoderSystem.mjs';\nexport { GpuLimitsSystem } from './rendering/renderers/gpu/GpuLimitsSystem.mjs';\nexport { GpuStencilSystem } from './rendering/renderers/gpu/GpuStencilSystem.mjs';\nexport { GpuUboSystem } from './rendering/renderers/gpu/GpuUboSystem.mjs';\nexport { GpuUniformBatchPipe } from './rendering/renderers/gpu/GpuUniformBatchPipe.mjs';\nexport { PipelineSystem } from './rendering/renderers/gpu/pipeline/PipelineSystem.mjs';\nexport { calculateProjection } from './rendering/renderers/gpu/renderTarget/calculateProjection.mjs';\nexport { GpuRenderTarget } from './rendering/renderers/gpu/renderTarget/GpuRenderTarget.mjs';\nexport { GpuRenderTargetAdaptor } from './rendering/renderers/gpu/renderTarget/GpuRenderTargetAdaptor.mjs';\nexport { GpuRenderTargetSystem } from './rendering/renderers/gpu/renderTarget/GpuRenderTargetSystem.mjs';\nexport { BindGroup } from './rendering/renderers/gpu/shader/BindGroup.mjs';\nexport { GpuProgram } from './rendering/renderers/gpu/shader/GpuProgram.mjs';\nexport { GpuShaderSystem } from './rendering/renderers/gpu/shader/GpuShaderSystem.mjs';\nexport { WGSL_ALIGN_SIZE_DATA, createUboElementsWGSL } from './rendering/renderers/gpu/shader/utils/createUboElementsWGSL.mjs';\nexport { createUboSyncFunctionWGSL } from './rendering/renderers/gpu/shader/utils/createUboSyncFunctionWGSL.mjs';\nexport { extractAttributesFromGpuProgram } from './rendering/renderers/gpu/shader/utils/extractAttributesFromGpuProgram.mjs';\nexport { extractStructAndGroups } from './rendering/renderers/gpu/shader/utils/extractStructAndGroups.mjs';\nexport { generateArraySyncWGSL } from './rendering/renderers/gpu/shader/utils/generateArraySyncWGSL.mjs';\nexport { generateGpuLayoutGroups } from './rendering/renderers/gpu/shader/utils/generateGpuLayoutGroups.mjs';\nexport { generateLayoutHash } from './rendering/renderers/gpu/shader/utils/generateLayoutHash.mjs';\nexport { removeStructAndGroupDuplicates } from './rendering/renderers/gpu/shader/utils/removeStructAndGroupDuplicates.mjs';\nexport { GpuBlendModesToPixi } from './rendering/renderers/gpu/state/GpuBlendModesToPixi.mjs';\nexport { GpuStateSystem } from './rendering/renderers/gpu/state/GpuStateSystem.mjs';\nexport { GpuStencilModesToPixi } from './rendering/renderers/gpu/state/GpuStencilModesToPixi.mjs';\nexport { GPUTextureGpuData, GpuTextureSystem } from './rendering/renderers/gpu/texture/GpuTextureSystem.mjs';\nexport { gpuUploadBufferImageResource } from './rendering/renderers/gpu/texture/uploaders/gpuUploadBufferImageResource.mjs';\nexport { blockDataMap, gpuUploadCompressedTextureResource } from './rendering/renderers/gpu/texture/uploaders/gpuUploadCompressedTextureResource.mjs';\nexport { createGpuUploadCubeTextureResource } from './rendering/renderers/gpu/texture/uploaders/gpuUploadCubeTextureResource.mjs';\nexport { gpuUploadImageResource } from './rendering/renderers/gpu/texture/uploaders/gpuUploadImageSource.mjs';\nexport { gpuUploadVideoResource } from './rendering/renderers/gpu/texture/uploaders/gpuUploadVideoSource.mjs';\nexport { getSupportedGPUCompressedTextureFormats } from './rendering/renderers/gpu/texture/utils/getSupportedGPUCompressedTextureFormats.mjs';\nexport { GpuMipmapGenerator } from './rendering/renderers/gpu/texture/utils/GpuMipmapGenerator.mjs';\nexport { WebGPURenderer } from './rendering/renderers/gpu/WebGPURenderer.mjs';\nexport { BackgroundSystem } from './rendering/renderers/shared/background/BackgroundSystem.mjs';\nexport { BlendModePipe } from './rendering/renderers/shared/blendModes/BlendModePipe.mjs';\nexport { Buffer } from './rendering/renderers/shared/buffer/Buffer.mjs';\nexport { BufferResource } from './rendering/renderers/shared/buffer/BufferResource.mjs';\nexport { BufferUsage } from './rendering/renderers/shared/buffer/const.mjs';\nexport { fastCopy } from './rendering/renderers/shared/buffer/utils/fastCopy.mjs';\nexport { ExtractSystem } from './rendering/renderers/shared/extract/ExtractSystem.mjs';\nexport { GenerateTextureSystem } from './rendering/renderers/shared/extract/GenerateTextureSystem.mjs';\nexport { GCSystem } from './rendering/renderers/shared/GCSystem.mjs';\nexport { DRAW_MODES } from './rendering/renderers/shared/geometry/const.mjs';\nexport { Geometry } from './rendering/renderers/shared/geometry/Geometry.mjs';\nexport { buildSimpleUvs, buildUvs } from './rendering/renderers/shared/geometry/utils/buildUvs.mjs';\nexport { ensureIsBuffer } from './rendering/renderers/shared/geometry/utils/ensureIsBuffer.mjs';\nexport { getAttributeInfoFromFormat } from './rendering/renderers/shared/geometry/utils/getAttributeInfoFromFormat.mjs';\nexport { getGeometryBounds } from './rendering/renderers/shared/geometry/utils/getGeometryBounds.mjs';\nexport { transformVertices } from './rendering/renderers/shared/geometry/utils/transformVertices.mjs';\nexport { InstructionSet } from './rendering/renderers/shared/instructions/InstructionSet.mjs';\nexport { GlobalUniformSystem } from './rendering/renderers/shared/renderTarget/GlobalUniformSystem.mjs';\nexport { isRenderingToScreen } from './rendering/renderers/shared/renderTarget/isRenderingToScreen.mjs';\nexport { RenderTarget } from './rendering/renderers/shared/renderTarget/RenderTarget.mjs';\nexport { RenderTargetSystem } from './rendering/renderers/shared/renderTarget/RenderTargetSystem.mjs';\nexport { SchedulerSystem } from './rendering/renderers/shared/SchedulerSystem.mjs';\nexport { ShaderStage } from './rendering/renderers/shared/shader/const.mjs';\nexport { Shader } from './rendering/renderers/shared/shader/Shader.mjs';\nexport { UNIFORM_TYPES_MAP, UNIFORM_TYPES_VALUES } from './rendering/renderers/shared/shader/types.mjs';\nexport { UboSystem } from './rendering/renderers/shared/shader/UboSystem.mjs';\nexport { UniformGroup } from './rendering/renderers/shared/shader/UniformGroup.mjs';\nexport { createUboSyncFunction } from './rendering/renderers/shared/shader/utils/createUboSyncFunction.mjs';\nexport { getDefaultUniformValue } from './rendering/renderers/shared/shader/utils/getDefaultUniformValue.mjs';\nexport { uboSyncFunctionsSTD40, uboSyncFunctionsWGSL } from './rendering/renderers/shared/shader/utils/uboSyncFunctions.mjs';\nexport { uniformParsers } from './rendering/renderers/shared/shader/utils/uniformParsers.mjs';\nexport { HelloSystem } from './rendering/renderers/shared/startup/HelloSystem.mjs';\nexport { BLEND_TO_NPM, STENCIL_MODES } from './rendering/renderers/shared/state/const.mjs';\nexport { getAdjustedBlendModeBlend } from './rendering/renderers/shared/state/getAdjustedBlendModeBlend.mjs';\nexport { State } from './rendering/renderers/shared/state/State.mjs';\nexport { AbstractRenderer } from './rendering/renderers/shared/system/AbstractRenderer.mjs';\nexport { SharedRenderPipes, SharedSystems } from './rendering/renderers/shared/system/SharedSystems.mjs';\nexport { SystemRunner } from './rendering/renderers/shared/system/SystemRunner.mjs';\nexport { CanvasPool, CanvasPoolClass } from './rendering/renderers/shared/texture/CanvasPool.mjs';\nexport { DEPRECATED_SCALE_MODES, DEPRECATED_WRAP_MODES, SCALE_MODES, WRAP_MODES } from './rendering/renderers/shared/texture/const.mjs';\nexport { CubeTexture } from './rendering/renderers/shared/texture/CubeTexture.mjs';\nexport { RenderableGCSystem } from './rendering/renderers/shared/texture/RenderableGCSystem.mjs';\nexport { RenderTexture } from './rendering/renderers/shared/texture/RenderTexture.mjs';\nexport { BufferImageSource } from './rendering/renderers/shared/texture/sources/BufferImageSource.mjs';\nexport { CanvasSource } from './rendering/renderers/shared/texture/sources/CanvasSource.mjs';\nexport { CompressedSource } from './rendering/renderers/shared/texture/sources/CompressedSource.mjs';\nexport { CubeTextureSource } from './rendering/renderers/shared/texture/sources/CubeTextureSource.mjs';\nexport { ExternalSource } from './rendering/renderers/shared/texture/sources/ExternalSource.mjs';\nexport { ImageSource } from './rendering/renderers/shared/texture/sources/ImageSource.mjs';\nexport { TextureSource } from './rendering/renderers/shared/texture/sources/TextureSource.mjs';\nexport { VideoSource } from './rendering/renderers/shared/texture/sources/VideoSource.mjs';\nexport { Texture } from './rendering/renderers/shared/texture/Texture.mjs';\nexport { TextureGCSystem } from './rendering/renderers/shared/texture/TextureGCSystem.mjs';\nexport { TextureMatrix } from './rendering/renderers/shared/texture/TextureMatrix.mjs';\nexport { TexturePool, TexturePoolClass } from './rendering/renderers/shared/texture/TexturePool.mjs';\nexport { TextureStyle } from './rendering/renderers/shared/texture/TextureStyle.mjs';\nexport { TextureUvs } from './rendering/renderers/shared/texture/TextureUvs.mjs';\nexport { getCanvasTexture, hasCachedCanvasTexture } from './rendering/renderers/shared/texture/utils/getCanvasTexture.mjs';\nexport { getSupportedCompressedTextureFormats } from './rendering/renderers/shared/texture/utils/getSupportedCompressedTextureFormats.mjs';\nexport { getSupportedTextureFormats, nonCompressedFormats } from './rendering/renderers/shared/texture/utils/getSupportedTextureFormats.mjs';\nexport { autoDetectSource, resourceToTexture, textureFrom } from './rendering/renderers/shared/texture/utils/textureFrom.mjs';\nexport { createIdFromString } from './rendering/renderers/shared/utils/createIdFromString.mjs';\nexport { parseFunctionBody } from './rendering/renderers/shared/utils/parseFunctionBody.mjs';\nexport { ViewSystem } from './rendering/renderers/shared/view/ViewSystem.mjs';\nexport { RendererType } from './rendering/renderers/types.mjs';\nexport { default as particlesFrag } from './scene/particle-container/shared/shader/particles.frag.mjs';\nexport { default as particlesVert } from './scene/particle-container/shared/shader/particles.vert.mjs';\nexport { default as particlesWgsl } from './scene/particle-container/shared/shader/particles.wgsl.mjs';\nexport { Bounds } from './scene/container/bounds/Bounds.mjs';\nexport { getFastGlobalBounds } from './scene/container/bounds/getFastGlobalBounds.mjs';\nexport { getGlobalBounds, updateTransformBackwards } from './scene/container/bounds/getGlobalBounds.mjs';\nexport { getLocalBounds } from './scene/container/bounds/getLocalBounds.mjs';\nexport { getGlobalRenderableBounds } from './scene/container/bounds/getRenderableBounds.mjs';\nexport { boundsPool, matrixPool } from './scene/container/bounds/utils/matrixAndBoundsPool.mjs';\nexport { cacheAsTextureMixin } from './scene/container/container-mixins/cacheAsTextureMixin.mjs';\nexport { childrenHelperMixin } from './scene/container/container-mixins/childrenHelperMixin.mjs';\nexport { collectRenderablesMixin } from './scene/container/container-mixins/collectRenderablesMixin.mjs';\nexport { effectsMixin } from './scene/container/container-mixins/effectsMixin.mjs';\nexport { findMixin } from './scene/container/container-mixins/findMixin.mjs';\nexport { getFastGlobalBoundsMixin } from './scene/container/container-mixins/getFastGlobalBoundsMixin.mjs';\nexport { bgr2rgb, getGlobalMixin } from './scene/container/container-mixins/getGlobalMixin.mjs';\nexport { measureMixin } from './scene/container/container-mixins/measureMixin.mjs';\nexport { onRenderMixin } from './scene/container/container-mixins/onRenderMixin.mjs';\nexport { sortMixin } from './scene/container/container-mixins/sortMixin.mjs';\nexport { toLocalGlobalMixin } from './scene/container/container-mixins/toLocalGlobalMixin.mjs';\nexport { Container, UPDATE_BLEND, UPDATE_COLOR, UPDATE_TRANSFORM, UPDATE_VISIBLE } from './scene/container/Container.mjs';\nexport { CustomRenderPipe } from './scene/container/CustomRenderPipe.mjs';\nexport { RenderContainer } from './scene/container/RenderContainer.mjs';\nexport { RenderGroup } from './scene/container/RenderGroup.mjs';\nexport { RenderGroupPipe } from './scene/container/RenderGroupPipe.mjs';\nexport { RenderGroupSystem } from './scene/container/RenderGroupSystem.mjs';\nexport { assignWithIgnore } from './scene/container/utils/assignWithIgnore.mjs';\nexport { checkChildrenDidChange } from './scene/container/utils/checkChildrenDidChange.mjs';\nexport { clearList } from './scene/container/utils/clearList.mjs';\nexport { collectAllRenderables } from './scene/container/utils/collectAllRenderables.mjs';\nexport { definedProps } from './scene/container/utils/definedProps.mjs';\nexport { executeInstructions } from './scene/container/utils/executeInstructions.mjs';\nexport { multiplyColors } from './scene/container/utils/multiplyColors.mjs';\nexport { multiplyHexColors } from './scene/container/utils/multiplyHexColors.mjs';\nexport { updateLocalTransform } from './scene/container/utils/updateLocalTransform.mjs';\nexport { updateRenderGroupTransform, updateRenderGroupTransforms, updateTransformAndChildren } from './scene/container/utils/updateRenderGroupTransforms.mjs';\nexport { updateWorldTransform } from './scene/container/utils/updateWorldTransform.mjs';\nexport { validateRenderables } from './scene/container/utils/validateRenderables.mjs';\nexport { CanvasGraphicsAdaptor } from './scene/graphics/canvas/CanvasGraphicsAdaptor.mjs';\nexport { CanvasGraphicsContextSystem } from './scene/graphics/canvas/CanvasGraphicsContextSystem.mjs';\nexport { CanvasGraphicsPipe } from './scene/graphics/canvas/CanvasGraphicsPipe.mjs';\nexport { GlGraphicsAdaptor } from './scene/graphics/gl/GlGraphicsAdaptor.mjs';\nexport { color32BitToUniform, colorToUniform } from './scene/graphics/gpu/colorToUniform.mjs';\nexport { GpuGraphicsAdaptor } from './scene/graphics/gpu/GpuGraphicsAdaptor.mjs';\nexport { BatchableGraphics } from './scene/graphics/shared/BatchableGraphics.mjs';\nexport { buildAdaptiveBezier } from './scene/graphics/shared/buildCommands/buildAdaptiveBezier.mjs';\nexport { buildAdaptiveQuadratic } from './scene/graphics/shared/buildCommands/buildAdaptiveQuadratic.mjs';\nexport { buildArc } from './scene/graphics/shared/buildCommands/buildArc.mjs';\nexport { buildArcTo } from './scene/graphics/shared/buildCommands/buildArcTo.mjs';\nexport { buildArcToSvg } from './scene/graphics/shared/buildCommands/buildArcToSvg.mjs';\nexport { buildCircle, buildEllipse, buildRoundedRectangle } from './scene/graphics/shared/buildCommands/buildCircle.mjs';\nexport { buildLine } from './scene/graphics/shared/buildCommands/buildLine.mjs';\nexport { buildPixelLine } from './scene/graphics/shared/buildCommands/buildPixelLine.mjs';\nexport { buildPolygon } from './scene/graphics/shared/buildCommands/buildPolygon.mjs';\nexport { buildRectangle } from './scene/graphics/shared/buildCommands/buildRectangle.mjs';\nexport { buildTriangle } from './scene/graphics/shared/buildCommands/buildTriangle.mjs';\nexport { closePointEps, curveEps } from './scene/graphics/shared/const.mjs';\nexport { FillGradient } from './scene/graphics/shared/fill/FillGradient.mjs';\nexport { FillPattern } from './scene/graphics/shared/fill/FillPattern.mjs';\nexport { Graphics } from './scene/graphics/shared/Graphics.mjs';\nexport { GraphicsContext } from './scene/graphics/shared/GraphicsContext.mjs';\nexport { GpuGraphicsContext, GraphicsContextRenderData, GraphicsContextSystem } from './scene/graphics/shared/GraphicsContextSystem.mjs';\nexport { GraphicsGpuData, GraphicsPipe } from './scene/graphics/shared/GraphicsPipe.mjs';\nexport { GraphicsPath } from './scene/graphics/shared/path/GraphicsPath.mjs';\nexport { roundedShapeArc, roundedShapeQuadraticCurve } from './scene/graphics/shared/path/roundShape.mjs';\nexport { ShapePath } from './scene/graphics/shared/path/ShapePath.mjs';\nexport { SVGDefsCollector } from './scene/graphics/shared/svg/buildSVGDefinitions.mjs';\nexport { buildSVGPath } from './scene/graphics/shared/svg/buildSVGPath.mjs';\nexport { buildSVGFillAttributes, buildSVGStrokeAttributes } from './scene/graphics/shared/svg/buildSVGStyle.mjs';\nexport { parseSVGDefinitions } from './scene/graphics/shared/svg/parseSVGDefinitions.mjs';\nexport { parseSVGFloatAttribute } from './scene/graphics/shared/svg/parseSVGFloatAttribute.mjs';\nexport { parseSVGPath } from './scene/graphics/shared/svg/parseSVGPath.mjs';\nexport { parseSVGStyle, styleAttributes } from './scene/graphics/shared/svg/parseSVGStyle.mjs';\nexport { graphicsContextToSvg } from './scene/graphics/shared/svg/SVGExporter.mjs';\nexport { SVGParser } from './scene/graphics/shared/svg/SVGParser.mjs';\nexport { extractSvgUrlId } from './scene/graphics/shared/svg/utils/extractSvgUrlId.mjs';\nexport { checkForNestedPattern, getFillInstructionData } from './scene/graphics/shared/svg/utils/fillOperations.mjs';\nexport { appendSVGPath, calculatePathArea, extractSubpaths } from './scene/graphics/shared/svg/utils/pathOperations.mjs';\nexport { buildContextBatches, shapeBuilders } from './scene/graphics/shared/utils/buildContextBatches.mjs';\nexport { buildGeometryFromPath } from './scene/graphics/shared/utils/buildGeometryFromPath.mjs';\nexport { toFillStyle, toStrokeStyle } from './scene/graphics/shared/utils/convertFillInputToFillStyle.mjs';\nexport { generateTextureMatrix } from './scene/graphics/shared/utils/generateTextureFillMatrix.mjs';\nexport { getMaxMiterRatio } from './scene/graphics/shared/utils/getMaxMiterRatio.mjs';\nexport { getOrientationOfPoints } from './scene/graphics/shared/utils/getOrientationOfPoints.mjs';\nexport { triangulateWithHoles } from './scene/graphics/shared/utils/triangulateWithHoles.mjs';\nexport { RenderLayer } from './scene/layers/RenderLayer.mjs';\nexport { PerspectiveMesh } from './scene/mesh-perspective/PerspectiveMesh.mjs';\nexport { PerspectivePlaneGeometry } from './scene/mesh-perspective/PerspectivePlaneGeometry.mjs';\nexport { applyProjectiveTransformationToPlane } from './scene/mesh-perspective/utils/applyProjectiveTransformationToPlane.mjs';\nexport { compute2DProjection } from './scene/mesh-perspective/utils/compute2DProjections.mjs';\nexport { MeshPlane } from './scene/mesh-plane/MeshPlane.mjs';\nexport { PlaneGeometry } from './scene/mesh-plane/PlaneGeometry.mjs';\nexport { MeshRope } from './scene/mesh-simple/MeshRope.mjs';\nexport { MeshSimple } from './scene/mesh-simple/MeshSimple.mjs';\nexport { RopeGeometry } from './scene/mesh-simple/RopeGeometry.mjs';\nexport { GlMeshAdaptor } from './scene/mesh/gl/GlMeshAdaptor.mjs';\nexport { GpuMeshAdapter } from './scene/mesh/gpu/GpuMeshAdapter.mjs';\nexport { BatchableMesh } from './scene/mesh/shared/BatchableMesh.mjs';\nexport { getTextureDefaultMatrix } from './scene/mesh/shared/getTextureDefaultMatrix.mjs';\nexport { Mesh } from './scene/mesh/shared/Mesh.mjs';\nexport { MeshGeometry } from './scene/mesh/shared/MeshGeometry.mjs';\nexport { MeshGpuData, MeshPipe } from './scene/mesh/shared/MeshPipe.mjs';\nexport { CanvasParticleContainerAdaptor } from './scene/particle-container/canvas/CanvasParticleContainerAdaptor.mjs';\nexport { CanvasParticleContainerPipe } from './scene/particle-container/canvas/CanvasParticleContainerPipe.mjs';\nexport { GlParticleContainerAdaptor } from './scene/particle-container/gl/GlParticleContainerAdaptor.mjs';\nexport { GlParticleContainerPipe } from './scene/particle-container/gl/GlParticleContainerPipe.mjs';\nexport { GpuParticleContainerAdaptor } from './scene/particle-container/gpu/GpuParticleContainerAdaptor.mjs';\nexport { GpuParticleContainerPipe } from './scene/particle-container/gpu/GpuParticleContainerPipe.mjs';\nexport { Particle } from './scene/particle-container/shared/Particle.mjs';\nexport { ParticleBuffer } from './scene/particle-container/shared/ParticleBuffer.mjs';\nexport { ParticleContainer } from './scene/particle-container/shared/ParticleContainer.mjs';\nexport { ParticleContainerPipe } from './scene/particle-container/shared/ParticleContainerPipe.mjs';\nexport { particleData } from './scene/particle-container/shared/particleData.mjs';\nexport { ParticleShader } from './scene/particle-container/shared/shader/ParticleShader.mjs';\nexport { createIndicesForQuads } from './scene/particle-container/shared/utils/createIndicesForQuads.mjs';\nexport { generateParticleUpdateFunction } from './scene/particle-container/shared/utils/generateParticleUpdateFunction.mjs';\nexport { AnimatedSprite } from './scene/sprite-animated/AnimatedSprite.mjs';\nexport { CanvasNineSliceSpritePipe } from './scene/sprite-nine-slice/canvas/CanvasNineSliceSpritePipe.mjs';\nexport { NineSliceGeometry } from './scene/sprite-nine-slice/NineSliceGeometry.mjs';\nexport { NineSlicePlane, NineSliceSprite } from './scene/sprite-nine-slice/NineSliceSprite.mjs';\nexport { NineSliceSpriteGpuData, NineSliceSpritePipe } from './scene/sprite-nine-slice/NineSliceSpritePipe.mjs';\nexport { CanvasTilingSpritePipe } from './scene/sprite-tiling/canvas/CanvasTilingSpritePipe.mjs';\nexport { tilingBit, tilingBitGl } from './scene/sprite-tiling/shader/tilingBit.mjs';\nexport { TilingSpriteShader } from './scene/sprite-tiling/shader/TilingSpriteShader.mjs';\nexport { TilingSprite } from './scene/sprite-tiling/TilingSprite.mjs';\nexport { TilingSpriteGpuData, TilingSpritePipe } from './scene/sprite-tiling/TilingSpritePipe.mjs';\nexport { applyMatrix } from './scene/sprite-tiling/utils/applyMatrix.mjs';\nexport { QuadGeometry } from './scene/sprite-tiling/utils/QuadGeometry.mjs';\nexport { setPositions } from './scene/sprite-tiling/utils/setPositions.mjs';\nexport { setUvs } from './scene/sprite-tiling/utils/setUvs.mjs';\nexport { BatchableSprite } from './scene/sprite/BatchableSprite.mjs';\nexport { Sprite } from './scene/sprite/Sprite.mjs';\nexport { SpritePipe } from './scene/sprite/SpritePipe.mjs';\nexport { AbstractBitmapFont } from './scene/text-bitmap/AbstractBitmapFont.mjs';\nexport { AbstractBitmapTextPipe, BitmapTextGraphics } from './scene/text-bitmap/AbstractBitmapTextPipe.mjs';\nexport { bitmapFontTextParser } from './scene/text-bitmap/asset/bitmapFontTextParser.mjs';\nexport { bitmapFontXMLParser } from './scene/text-bitmap/asset/bitmapFontXMLParser.mjs';\nexport { bitmapFontXMLStringParser } from './scene/text-bitmap/asset/bitmapFontXMLStringParser.mjs';\nexport { bitmapFontCachePlugin, loadBitmapFont } from './scene/text-bitmap/asset/loadBitmapFont.mjs';\nexport { BitmapFont } from './scene/text-bitmap/BitmapFont.mjs';\nexport { BitmapFontManager } from './scene/text-bitmap/BitmapFontManager.mjs';\nexport { BitmapText } from './scene/text-bitmap/BitmapText.mjs';\nexport { CanvasBitmapTextPipe } from './scene/text-bitmap/CanvasBitmapTextPipe.mjs';\nexport { DynamicBitmapFont } from './scene/text-bitmap/DynamicBitmapFont.mjs';\nexport { BitmapTextPipe } from './scene/text-bitmap/GpuBitmapTextPipe.mjs';\nexport { bitmapTextSplit } from './scene/text-bitmap/utils/bitmapTextSplit.mjs';\nexport { getBitmapTextLayout } from './scene/text-bitmap/utils/getBitmapTextLayout.mjs';\nexport { resolveCharacters } from './scene/text-bitmap/utils/resolveCharacters.mjs';\nexport { BatchableHTMLText } from './scene/text-html/BatchableHTMLText.mjs';\nexport { HTMLText } from './scene/text-html/HTMLText.mjs';\nexport { HTMLTextPipe } from './scene/text-html/HTMLTextPipe.mjs';\nexport { HTMLTextRenderData } from './scene/text-html/HTMLTextRenderData.mjs';\nexport { HTMLTextStyle } from './scene/text-html/HTMLTextStyle.mjs';\nexport { HTMLTextSystem } from './scene/text-html/HTMLTextSystem.mjs';\nexport { extractFontFamilies } from './scene/text-html/utils/extractFontFamilies.mjs';\nexport { FontStylePromiseCache, getFontCss } from './scene/text-html/utils/getFontCss.mjs';\nexport { getSVGUrl } from './scene/text-html/utils/getSVGUrl.mjs';\nexport { getTemporaryCanvasFromImage } from './scene/text-html/utils/getTemporaryCanvasFromImage.mjs';\nexport { loadFontAsBase64 } from './scene/text-html/utils/loadFontAsBase64.mjs';\nexport { loadFontCSS } from './scene/text-html/utils/loadFontCSS.mjs';\nexport { loadSVGImage } from './scene/text-html/utils/loadSVGImage.mjs';\nexport { measureHtmlText } from './scene/text-html/utils/measureHtmlText.mjs';\nexport { textStyleToCSS } from './scene/text-html/utils/textStyleToCSS.mjs';\nexport { AbstractSplitText } from './scene/text-split/AbstractSplitText.mjs';\nexport { SplitBitmapText } from './scene/text-split/SplitBitmapText.mjs';\nexport { SplitText } from './scene/text-split/SplitText.mjs';\nexport { AbstractText, ensureTextOptions } from './scene/text/AbstractText.mjs';\nexport { BatchableText } from './scene/text/canvas/BatchableText.mjs';\nexport { CanvasTextGenerator } from './scene/text/canvas/CanvasTextGenerator.mjs';\nexport { CanvasTextMetrics } from './scene/text/canvas/CanvasTextMetrics.mjs';\nexport { CanvasTextPipe } from './scene/text/canvas/CanvasTextPipe.mjs';\nexport { CanvasRendererTextSystem } from './scene/text/canvas/CanvasTextSystem.mjs';\nexport { fontStringFromTextStyle } from './scene/text/canvas/utils/fontStringFromTextStyle.mjs';\nexport { getCanvasFillStyle } from './scene/text/canvas/utils/getCanvasFillStyle.mjs';\nexport { measureTaggedText, tokenizeTaggedRuns, wordWrapTaggedLines } from './scene/text/canvas/utils/measureTaggedText.mjs';\nexport { getPlainText, hasTagMarkup, hasTagStyles, parseTaggedText } from './scene/text/canvas/utils/parseTaggedText.mjs';\nexport { BREAKING_SPACES, BREAKING_SPACES_SET, BREAK_AFTER_CHARS, BREAK_AFTER_CHARS_SET, COLLAPSIBLE_SPACES, COLLAPSIBLE_SPACES_SET, NEWLINES, NEWLINES_SET, NEWLINE_MATCH_REGEX, NEWLINE_SPLIT_REGEX, collapseNewlines, collapseSpaces, getCharacterGroups, isBreakAfterChar, isBreakingSpace, isCollapsibleSpace, isNewline, tokenize, trimRight } from './scene/text/canvas/utils/textTokenization.mjs';\nexport { wordWrap } from './scene/text/canvas/utils/wordWrap.mjs';\nexport { SdfShader } from './scene/text/sdfShader/SdfShader.mjs';\nexport { localUniformMSDFBit, localUniformMSDFBitGl } from './scene/text/sdfShader/shader-bits/localUniformMSDFBit.mjs';\nexport { mSDFBit, mSDFBitGl } from './scene/text/sdfShader/shader-bits/mSDFBit.mjs';\nexport { AbstractTextSystem } from './scene/text/shared/AbstractTextSystem.mjs';\nexport { CanvasTextSystem } from './scene/text/shared/GpuTextSystem.mjs';\nexport { Text } from './scene/text/Text.mjs';\nexport { TextStyle } from './scene/text/TextStyle.mjs';\nexport { canvasTextSplit } from './scene/text/utils/canvasTextSplit.mjs';\nexport { generateTextStyleKey } from './scene/text/utils/generateTextStyleKey.mjs';\nexport { getPo2TextureFromSource } from './scene/text/utils/getPo2TextureFromSource.mjs';\nexport { updateTextBounds } from './scene/text/utils/updateTextBounds.mjs';\nexport { ViewContainer } from './scene/view/ViewContainer.mjs';\nexport { Spritesheet } from './spritesheet/Spritesheet.mjs';\nexport { spritesheetAsset } from './spritesheet/spritesheetAsset.mjs';\nexport { UPDATE_PRIORITY } from './ticker/const.mjs';\nexport { Ticker } from './ticker/Ticker.mjs';\nexport { TickerListener } from './ticker/TickerListener.mjs';\nexport { detectVideoAlphaMode } from './utils/browser/detectVideoAlphaMode.mjs';\nexport { isMobile } from './utils/browser/isMobile.mjs';\nexport { isSafari } from './utils/browser/isSafari.mjs';\nexport { isWebGLSupported } from './utils/browser/isWebGLSupported.mjs';\nexport { isWebGPUSupported } from './utils/browser/isWebGPUSupported.mjs';\nexport { unsafeEvalSupported } from './utils/browser/unsafeEvalSupported.mjs';\nexport { getCanvasBoundingBox } from './utils/canvas/getCanvasBoundingBox.mjs';\nexport { DATA_URI, VERSION } from './utils/const.mjs';\nexport { default as EventEmitter } from 'eventemitter3';\nexport { cleanArray, cleanHash } from './utils/data/clean.mjs';\nexport { GCManagedHash } from './utils/data/GCManagedHash.mjs';\nexport { removeItems } from './utils/data/removeItems.mjs';\nexport { resetUids, uid } from './utils/data/uid.mjs';\nexport { updateQuadBounds } from './utils/data/updateQuadBounds.mjs';\nexport { ViewableBuffer } from './utils/data/ViewableBuffer.mjs';\nexport { ApplicationInitHook, RendererInitHook } from './utils/global/globalHooks.mjs';\nexport { deprecation, v8_0_0, v8_3_4 } from './utils/logging/deprecation.mjs';\nexport { logDebugTexture } from './utils/logging/logDebugTexture.mjs';\nexport { logRenderGroupScene, logScene } from './utils/logging/logScene.mjs';\nexport { warn } from './utils/logging/warn.mjs';\nexport { NOOP } from './utils/misc/NOOP.mjs';\nexport { Transform } from './utils/misc/Transform.mjs';\nexport { getResolutionOfUrl } from './utils/network/getResolutionOfUrl.mjs';\nexport { path } from './utils/path.mjs';\nexport { GlobalResourceRegistry } from './utils/pool/GlobalResourceRegistry.mjs';\nexport { Pool } from './utils/pool/Pool.mjs';\nexport { BigPool, PoolGroupClass } from './utils/pool/PoolGroup.mjs';\nexport { sayHello } from './utils/sayHello.mjs';\nexport { earcut } from './utils/utils.mjs';\n\n\"use strict\";\nextensions.add(browserExt, webworkerExt);\n\nexport { browserExt, extensions, webworkerExt };\n//# sourceMappingURL=index.mjs.map\n","/**\n * Pure graph logic for the GUI (no PixiJS, no DOM) so it is unit-testable: a deterministic\n * force-directed layout, the level-of-detail \"magnifying glass\" selection, and highlight\n * computation. The PixiJS renderer (renderer.ts) drives this and draws the result.\n */\n\nimport type { GraphSnapshot, GraphNode, Level } from \"@brain0/shared\";\n\nexport interface LayoutNode {\n id: string;\n x: number;\n y: number;\n vx: number;\n vy: number;\n}\n\nexport interface ForceParams {\n repulsion: number;\n spring: number;\n restLength: number;\n gravity: number;\n damping: number;\n}\n\nexport const DEFAULT_FORCES: ForceParams = {\n repulsion: 2000,\n spring: 0.02,\n restLength: 60,\n gravity: 0.01,\n damping: 0.85,\n};\n\n/**\n * Maximum per-tick displacement. Without this, large graphs (hundreds of nodes seeded close\n * together on the initial circle) accumulate enormous repulsion velocities and fly off-screen\n * within a few frames — the nodes \"appear then vanish\". Clamping the speed keeps the layout\n * bounded and convergent.\n */\nconst MAX_SPEED = 30;\n\n/**\n * A deterministic force-directed layout. Initial positions are seeded on a circle by node\n * index, so a given snapshot always lays out identically (important for stable visuals and\n * for tests).\n */\nexport class ForceLayout {\n readonly nodes: LayoutNode[];\n private readonly index: Map<string, number> = new Map();\n private readonly edges: Array<[number, number]>;\n\n constructor(\n snapshot: GraphSnapshot,\n private readonly params: ForceParams = DEFAULT_FORCES,\n ) {\n const n = Math.max(snapshot.nodes.length, 1);\n this.nodes = snapshot.nodes.map((node, i) => {\n this.index.set(node.id, i);\n const angle = (2 * Math.PI * i) / n;\n return { id: node.id, x: Math.cos(angle) * 200, y: Math.sin(angle) * 200, vx: 0, vy: 0 };\n });\n this.edges = [];\n for (const edge of snapshot.edges) {\n const a = this.index.get(edge.src);\n const b = this.index.get(edge.dst);\n if (a !== undefined && b !== undefined) this.edges.push([a, b]);\n }\n }\n\n /** Advance the simulation by one tick. */\n step(): void {\n const { repulsion, spring, restLength, gravity, damping } = this.params;\n const n = this.nodes.length;\n\n // Pairwise repulsion.\n for (let i = 0; i < n; i++) {\n const a = this.nodes[i]!;\n for (let j = i + 1; j < n; j++) {\n const b = this.nodes[j]!;\n let dx = a.x - b.x;\n let dy = a.y - b.y;\n let dist2 = dx * dx + dy * dy;\n if (dist2 < 0.01) {\n // Deterministic tiny separation for coincident nodes.\n dx = (i - j) * 0.01 + 0.01;\n dy = 0.01;\n dist2 = dx * dx + dy * dy;\n }\n const force = repulsion / dist2;\n const dist = Math.sqrt(dist2);\n const fx = (dx / dist) * force;\n const fy = (dy / dist) * force;\n a.vx += fx;\n a.vy += fy;\n b.vx -= fx;\n b.vy -= fy;\n }\n }\n\n // Spring attraction along edges.\n for (const [ai, bi] of this.edges) {\n const a = this.nodes[ai]!;\n const b = this.nodes[bi]!;\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n const dist = Math.sqrt(dx * dx + dy * dy) || 0.01;\n const force = spring * (dist - restLength);\n const fx = (dx / dist) * force;\n const fy = (dy / dist) * force;\n a.vx += fx;\n a.vy += fy;\n b.vx -= fx;\n b.vy -= fy;\n }\n\n // Gravity toward the origin + integrate with damping, with a speed clamp so the layout\n // cannot explode off-screen for large graphs.\n for (const node of this.nodes) {\n node.vx = (node.vx - node.x * gravity) * damping;\n node.vy = (node.vy - node.y * gravity) * damping;\n const speed = Math.hypot(node.vx, node.vy);\n if (speed > MAX_SPEED) {\n node.vx = (node.vx / speed) * MAX_SPEED;\n node.vy = (node.vy / speed) * MAX_SPEED;\n }\n node.x += node.vx;\n node.y += node.vy;\n }\n }\n\n /** Axis-aligned bounding box of all node positions (after layout). */\n bounds(): { minX: number; minY: number; maxX: number; maxY: number } {\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const node of this.nodes) {\n if (node.x < minX) minX = node.x;\n if (node.x > maxX) maxX = node.x;\n if (node.y < minY) minY = node.y;\n if (node.y > maxY) maxY = node.y;\n }\n if (!Number.isFinite(minX)) return { minX: 0, minY: 0, maxX: 0, maxY: 0 };\n return { minX, minY, maxX, maxY };\n }\n\n /** Run `n` ticks. */\n run(n: number): void {\n for (let i = 0; i < n; i++) this.step();\n }\n\n /**\n * Recenter the settled layout on the origin and scale it so its bounding box fits within\n * `span` pixels. Called once after settling so a fixed initial zoom frames the whole graph\n * regardless of node count, and velocities are zeroed so it stays put.\n */\n normalize(span: number): void {\n const { minX, minY, maxX, maxY } = this.bounds();\n const cx = (minX + maxX) / 2;\n const cy = (minY + maxY) / 2;\n const scale = span / Math.max(maxX - minX, maxY - minY, 1);\n for (const node of this.nodes) {\n node.x = (node.x - cx) * scale;\n node.y = (node.y - cy) * scale;\n node.vx = 0;\n node.vy = 0;\n }\n }\n\n /**\n * Collision relaxation: push apart any pair of nodes closer than `minDist`, for up to\n * `iterations` passes (stopping early once nothing overlaps). Run after settling so nodes — and\n * thus their name labels — never sit on top of each other in any view, while preserving the\n * settled structure's relative arrangement (it only translates nodes). Ends recentered.\n */\n relax(minDist: number, iterations: number): void {\n const n = this.nodes.length;\n for (let it = 0; it < iterations; it++) {\n let moved = false;\n for (let i = 0; i < n; i++) {\n const a = this.nodes[i]!;\n for (let j = i + 1; j < n; j++) {\n const b = this.nodes[j]!;\n let dx = b.x - a.x;\n let dy = b.y - a.y;\n let dist = Math.sqrt(dx * dx + dy * dy);\n if (dist < 1e-6) {\n // Deterministic separation for coincident nodes.\n dx = (j - i) * 0.01 + 0.01;\n dy = 0.01;\n dist = Math.sqrt(dx * dx + dy * dy);\n }\n if (dist < minDist) {\n const push = (minDist - dist) / 2;\n const ux = dx / dist;\n const uy = dy / dist;\n a.x -= ux * push;\n a.y -= uy * push;\n b.x += ux * push;\n b.y += uy * push;\n moved = true;\n }\n }\n }\n if (!moved) break; // converged — no overlaps remain\n }\n this.recenter();\n }\n\n /** Recenter the layout's bounding box on the origin (a translation; preserves distances). */\n recenter(): void {\n const { minX, minY, maxX, maxY } = this.bounds();\n const cx = (minX + maxX) / 2;\n const cy = (minY + maxY) / 2;\n for (const node of this.nodes) {\n node.x -= cx;\n node.y -= cy;\n }\n }\n\n position(id: string): { x: number; y: number } | undefined {\n const i = this.index.get(id);\n return i === undefined ? undefined : { x: this.nodes[i]!.x, y: this.nodes[i]!.y };\n }\n}\n\n/** The artifact level shown at a given zoom — the magnifying glass descending the lens. */\nexport function lodLevelForZoom(zoom: number): Level {\n if (zoom < 0.6) return \"repo\";\n if (zoom < 1.2) return \"module\";\n if (zoom < 2.4) return \"file\";\n return \"symbol\";\n}\n\n/** Nodes visible at a given zoom: artifacts at the current LOD level; tasks once zoomed in. */\nexport function visibleNodes(snapshot: GraphSnapshot, zoom: number): GraphNode[] {\n const level = lodLevelForZoom(zoom);\n return snapshot.nodes.filter((node) =>\n node.kind === \"task\" ? zoom >= 1.2 : node.level === level,\n );\n}\n\n/** The set of node ids to highlight given the tasks the agent surfaced. */\nexport function highlightSet(snapshot: GraphSnapshot, taskIds: string[]): Set<string> {\n const tasks = new Set(taskIds);\n const highlight = new Set<string>(taskIds);\n for (const edge of snapshot.edges) {\n if (edge.kind === \"task_modifies_artifact\" && tasks.has(edge.src)) {\n highlight.add(edge.dst);\n }\n }\n return highlight;\n}\n","/**\n * PixiJS (WebGL) renderer for the bipartite graph: force-directed layout,\n * the LOD magnifying glass on zoom, risk color (green→red), agent highlights, a timeline\n * cutoff, and selection for attribution. Pure graph math lives in graph.ts; this module\n * only draws and handles input.\n *\n * Node colors are precomputed (`colorHex`) by `buildGraphSnapshot`, so this module imports\n * only *types* from `@brain0/shared` and never its Node-only runtime.\n */\n\nimport { Application, Container, Graphics, Text, TextStyle } from \"pixi.js\";\nimport type { GraphNode, GraphSnapshot, Level } from \"@brain0/shared\";\nimport { ForceLayout } from \"./graph.js\";\n\n// Linear design system: lavender accent for intents, hairline for edges, lavender-hover for the\n// search highlight. Artifact colors stay risk-based (green→red) — data semantics, like Linear's\n// in-product priority palette.\nconst TASK_COLOR = 0x5e6ad2;\nconst EDGE_COLOR = 0x23252a;\nconst HIGHLIGHT_COLOR = 0x828fff;\n// Severity → highlight stroke color (matches the sidebar finding cards): gold/red/amber/accent.\nconst SEVERITY_COLOR: Record<string, number> = {\n gold: 0xd8b24a,\n critical: 0xd65c5c,\n warn: 0xe0a33a,\n info: HIGHLIGHT_COLOR,\n};\n\nfunction hexToNumber(hex: string | undefined, fallback: number): number {\n if (!hex) return fallback;\n const parsed = Number.parseInt(hex.replace(\"#\", \"\"), 16);\n return Number.isNaN(parsed) ? fallback : parsed;\n}\n\n/**\n * The label shown under a node: the level-appropriate name — the repo, module, file, or symbol\n * name (the last path segment, or the part after the last `::` for symbols) — or a commit's short\n * SHA. Each artifact only appears at its own LOD level, so this single name is always the right one.\n */\nfunction nodeDisplayName(node: GraphNode): string {\n if (node.kind === \"task\") return node.ref ? node.ref.slice(0, 7) : \"commit\";\n const path = node.label;\n // Modules: show the full path (e.g. \"packages/server/src\", not just \"src\") so it's clear which\n // module it is — bare last segments like \"src\" repeat across the tree and read as ambiguous.\n if (node.level === \"module\") return path;\n const sym = path.split(\"::\");\n if (sym.length > 1) return sym[sym.length - 1] || path; // symbol: after the last \"::\"\n const seg = path.split(\"/\");\n return seg[seg.length - 1] || path; // repo / file: last path segment\n}\n\nexport class PixiGraph {\n private readonly app = new Application();\n private world = new Container();\n private edges = new Graphics();\n private readonly nodeGraphics = new Map<string, Graphics>();\n // Node name labels (repo/module/file/symbol, or a commit's short SHA), shown under each node.\n private readonly labels = new Container();\n private readonly nodeLabels = new Map<string, Text>();\n private readonly artifactLabelStyle = new TextStyle({\n fontFamily: \"Inter, system-ui, sans-serif\",\n fontSize: 12,\n fill: 0x8a8f98,\n });\n private readonly commitLabelStyle = new TextStyle({\n fontFamily: \"JetBrains Mono, ui-monospace, monospace\",\n fontSize: 11,\n fill: 0x828fff,\n });\n private snapshot: GraphSnapshot = { repo: \"\", nodes: [], edges: [] };\n private layout = new ForceLayout(this.snapshot);\n private byId = new Map<string, GraphNode>();\n private zoom = 1;\n // The graph level is chosen explicitly via the view control, decoupled from zoom: once a level\n // is selected the user can zoom freely (far out ↔ very close) without ever switching level.\n private level: Level = \"file\";\n private highlights = new Set<string>();\n private highlightSeverity = new Map<string, string>();\n private selectedId: string | null = null;\n private timeCutoff = Number.POSITIVE_INFINITY;\n\n /** Callback invoked when a node is selected. */\n onSelect: (node: GraphNode) => void = () => {};\n\n /** Callback invoked when the selection is cleared (background click). */\n onDeselect: () => void = () => {};\n\n /** Callback invoked whenever the zoom or the selected level changes. */\n onViewChange: (zoom: number, level: Level) => void = () => {};\n\n async init(container: HTMLElement): Promise<void> {\n await this.app.init({\n background: \"#010102\", // Linear canvas — near-black with a faint blue tint\n resizeTo: container,\n antialias: true,\n });\n container.appendChild(this.app.canvas);\n this.app.stage.addChild(this.world);\n this.world.addChild(this.edges);\n this.edges.eventMode = \"none\"; // edges are decorative — let clicks fall through to nodes/stage\n this.world.addChild(this.labels); // name labels, above edges\n this.labels.eventMode = \"none\"; // labels never intercept clicks/drags\n this.app.stage.eventMode = \"static\";\n // Without a hitArea a container only receives pointer events where it has rendered content\n // (the nodes). Cover the whole viewport so clicks/drags on empty background register — this is\n // what makes panning on empty space and click-to-unfocus work. `app.screen` is updated in\n // place on resize, so the same reference keeps tracking the viewport.\n this.app.stage.hitArea = this.app.screen;\n\n this.installPanAndZoom(container);\n // The layout is settled once in setSnapshot (not stepped every frame), so nodes stay put\n // instead of drifting/exploding off-screen. The ticker only redraws (cheap) to reflect\n // pan/zoom/LOD/highlight changes.\n this.app.ticker.add(() => this.draw());\n }\n\n /** Number of settle iterations run once when a snapshot is set. */\n private static readonly SETTLE_ITERS = 400;\n /** Target span (world px) the settled layout is normalized to before relaxing. */\n private static readonly LAYOUT_SPAN = 1400;\n /** Minimum distance (world px) enforced between any two nodes, so labels never overlap. Deeper\n * LOD levels are seen at higher zoom, so this world gap reads as an even larger on-screen gap. */\n private static readonly MIN_NODE_DIST = 120;\n /** Cap on collision-relaxation passes (it stops early once nothing overlaps). */\n private static readonly RELAX_ITERS = 160;\n /** Free-zoom range, decoupled from the level: far-out overview ↔ very close inspection. */\n private static readonly MIN_ZOOM = 0.1;\n private static readonly MAX_ZOOM = 12;\n /** Cap on the auto-fit zoom when framing a level, so sparse levels aren't absurdly magnified. */\n private static readonly FIT_MAX_ZOOM = 2.5;\n\n setSnapshot(snapshot: GraphSnapshot): void {\n this.snapshot = snapshot;\n this.byId = new Map(snapshot.nodes.map((n) => [n.id, n]));\n this.layout = new ForceLayout(snapshot);\n // Settle the layout once, then normalize it to a fixed span so any graph size frames the\n // same way (no per-frame stepping ⇒ no drift/explosion).\n this.layout.run(PixiGraph.SETTLE_ITERS);\n this.layout.normalize(PixiGraph.LAYOUT_SPAN);\n this.layout.relax(PixiGraph.MIN_NODE_DIST, PixiGraph.RELAX_ITERS);\n\n // Rebuild node graphics. Select/deselect is resolved centrally on stage pointerup (see\n // installPanAndZoom); here each node is just made hittable and tagged with its id via `label`.\n for (const g of this.nodeGraphics.values()) g.destroy();\n this.nodeGraphics.clear();\n for (const t of this.nodeLabels.values()) t.destroy();\n this.nodeLabels.clear();\n for (const node of snapshot.nodes) {\n const g = new Graphics();\n g.eventMode = \"static\";\n g.cursor = \"pointer\";\n g.label = node.id;\n this.world.addChild(g);\n this.nodeGraphics.set(node.id, g);\n\n const text = new Text({\n text: nodeDisplayName(node),\n style: node.kind === \"task\" ? this.commitLabelStyle : this.artifactLabelStyle,\n });\n text.anchor.set(0.5, 0); // top-center, so it sits centered just below the node\n text.eventMode = \"none\";\n text.resolution = 3; // rasterize dense so the counter-scaled text stays crisp when zoomed out\n this.labels.addChild(text);\n this.nodeLabels.set(node.id, text);\n }\n this.world.addChild(this.labels); // keep labels above the freshly-added node graphics\n\n this.frameLevel();\n }\n\n /** Whether a node belongs to the current level (commits ride the file & symbol levels). */\n private visibleAtLevel(node: GraphNode): boolean {\n return node.kind === \"task\"\n ? this.level === \"file\" || this.level === \"symbol\"\n : node.level === this.level;\n }\n\n /**\n * Select the graph level to display (repo/module/file/symbol). The level is explicit and\n * decoupled from zoom — choosing one re-frames its nodes to fit the viewport; the user can then\n * zoom freely within it (far out ↔ very close) without ever crossing into another level.\n */\n setLevel(level: Level): void {\n this.level = level;\n this.frameLevel();\n }\n\n /** Fit the nodes of the current level into the viewport (the initial view and on level change). */\n private frameLevel(): void {\n const sw = this.app.screen.width;\n const sh = this.app.screen.height;\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const node of this.snapshot.nodes) {\n if (!this.visibleAtLevel(node)) continue;\n const p = this.layout.position(node.id);\n if (!p) continue;\n if (p.x < minX) minX = p.x;\n if (p.x > maxX) maxX = p.x;\n if (p.y < minY) minY = p.y;\n if (p.y > maxY) maxY = p.y;\n }\n if (!Number.isFinite(minX)) {\n // No nodes at this level: center at a neutral zoom.\n this.zoom = 1;\n this.world.scale.set(1);\n this.world.position.set(sw / 2, sh / 2);\n this.onViewChange(this.zoom, this.level);\n return;\n }\n const margin = 1.16; // breathing room around the level's bounding box\n const w = (maxX - minX) * margin || 1;\n const h = (maxY - minY) * margin || 1;\n const z = Math.min(\n PixiGraph.FIT_MAX_ZOOM,\n Math.max(PixiGraph.MIN_ZOOM, Math.min(sw / w, sh / h)),\n );\n const cx = (minX + maxX) / 2;\n const cy = (minY + maxY) / 2;\n this.zoom = z;\n this.world.scale.set(z);\n this.world.position.set(sw / 2 - cx * z, sh / 2 - cy * z);\n this.onViewChange(this.zoom, this.level);\n }\n\n /** Set the zoom (free, clamped) keeping the viewport center fixed; the level is unchanged. */\n setZoom(zoom: number): void {\n const z = Math.min(PixiGraph.MAX_ZOOM, Math.max(PixiGraph.MIN_ZOOM, zoom));\n // Keep the world point currently under the viewport center fixed, so zoom feels anchored.\n const sw = this.app.screen.width / 2;\n const sh = this.app.screen.height / 2;\n const wx = (sw - this.world.x) / this.zoom;\n const wy = (sh - this.world.y) / this.zoom;\n this.zoom = z;\n this.world.scale.set(z);\n this.world.position.set(sw - wx * z, sh - wy * z);\n this.onViewChange(this.zoom, this.level);\n }\n\n /** Multiply the current zoom (for the +/- buttons and the wheel). */\n zoomBy(factor: number): void {\n this.setZoom(this.zoom * factor);\n }\n\n /** Re-fit the current level to the viewport. */\n resetView(): void {\n this.frameLevel();\n }\n\n setHighlights(ids: Set<string>, severityMap?: Map<string, string>): void {\n this.selectedId = null;\n this.highlights = ids;\n this.highlightSeverity = severityMap ?? new Map();\n }\n\n /**\n * Select a node: highlight it plus its directly connected nodes, emphasize the incident edges,\n * and dim the rest — so a node's dependencies and change links read at a glance. Highlighted\n * neighbors are forced visible even if they sit at another LOD level. Pass `null` to clear.\n */\n setSelection(id: string | null): void {\n this.selectedId = id;\n this.highlightSeverity = new Map();\n const set = new Set<string>();\n if (id) {\n set.add(id);\n for (const edge of this.snapshot.edges) {\n if (edge.src === id) set.add(edge.dst);\n else if (edge.dst === id) set.add(edge.src);\n }\n }\n this.highlights = set;\n }\n\n /** Hide nodes/edges whose timestamp is after the cutoff (ms epoch); Infinity shows all. */\n setTimeCutoff(cutoffMs: number): void {\n this.timeCutoff = cutoffMs;\n }\n\n private nodeRadius(node: GraphNode): number {\n if (node.kind === \"task\") return 7;\n switch (node.level) {\n case \"repo\":\n return 16;\n case \"module\":\n return 12;\n case \"file\":\n return 9;\n default:\n return 6;\n }\n }\n\n private isVisible(node: GraphNode): boolean {\n if (node.timestamp && Date.parse(node.timestamp) > this.timeCutoff) return false;\n // Highlighted nodes (the selection and its neighbors, or a search chain) are always shown, so\n // dependencies stay visible even if they belong to another level.\n if (this.highlights.has(node.id)) return true;\n return this.visibleAtLevel(node);\n }\n\n private draw(): void {\n // Nodes (+ their name labels).\n for (const node of this.snapshot.nodes) {\n const g = this.nodeGraphics.get(node.id);\n const pos = this.layout.position(node.id);\n const label = this.nodeLabels.get(node.id);\n if (!g || !pos) continue;\n const visible = this.isVisible(node);\n g.visible = visible;\n if (label) label.visible = visible;\n if (!visible) continue;\n\n g.position.set(pos.x, pos.y);\n g.clear();\n const radius = this.nodeRadius(node);\n const color = node.kind === \"task\" ? TASK_COLOR : hexToNumber(node.colorHex, 0x6e7681);\n g.circle(0, 0, radius).fill(color);\n let alpha = 1;\n if (node.id === this.selectedId) {\n g.stroke({ width: 3.5, color: HIGHLIGHT_COLOR });\n } else if (this.highlights.has(node.id)) {\n const sev = this.highlightSeverity.get(node.id);\n g.stroke({ width: sev && sev !== \"info\" ? 3 : 2, color: SEVERITY_COLOR[sev ?? \"info\"] ?? HIGHLIGHT_COLOR });\n } else {\n alpha = this.highlights.size > 0 ? 0.28 : 1; // dim non-neighbors when something is selected\n }\n g.alpha = alpha;\n\n if (label) {\n // Counter-scale by 1/zoom so the text keeps a constant on-screen size at every LOD, and\n // offset by a screen-constant gap (radius is world units → ×zoom on screen; 7/zoom ⇒ 7px).\n label.scale.set(1 / this.zoom);\n label.position.set(pos.x, pos.y + radius + 7 / this.zoom);\n label.alpha = alpha;\n }\n }\n\n // Edges (only between currently visible endpoints). When something is selected/highlighted,\n // emphasize the connected edges and dim the rest.\n const selecting = this.selectedId !== null;\n const focusing = selecting || this.highlights.size > 0;\n this.edges.clear();\n for (const edge of this.snapshot.edges) {\n const a = this.byId.get(edge.src);\n const b = this.byId.get(edge.dst);\n if (!a || !b || !this.isVisible(a) || !this.isVisible(b)) continue;\n const pa = this.layout.position(edge.src);\n const pb = this.layout.position(edge.dst);\n if (!pa || !pb) continue;\n const active = selecting\n ? edge.src === this.selectedId || edge.dst === this.selectedId\n : this.highlights.has(edge.src) && this.highlights.has(edge.dst);\n this.edges.moveTo(pa.x, pa.y).lineTo(pb.x, pb.y).stroke({\n width: active ? 2 : 1,\n color: active ? HIGHLIGHT_COLOR : EDGE_COLOR,\n alpha: focusing && !active ? 0.12 : 1,\n });\n }\n }\n\n private installPanAndZoom(container: HTMLElement): void {\n let dragging = false;\n let moved = false;\n let lastX = 0;\n let lastY = 0;\n let downX = 0;\n let downY = 0;\n let pressedId: string | null = null;\n const DRAG_THRESHOLD = 4;\n\n // All pointer interaction is resolved here (the stage covers the whole viewport via hitArea):\n // a press anywhere starts a potential pan; on release, a press that didn't move is a click —\n // selecting the node under it, or clearing the selection if it was on empty background. This\n // lets the user pan by dragging from anywhere, including over nodes, at any zoom.\n this.app.stage.on(\"pointerdown\", (event) => {\n dragging = true;\n moved = false;\n lastX = downX = event.globalX;\n lastY = downY = event.globalY;\n const label = (event.target as Container | null)?.label ?? \"\";\n pressedId = this.byId.has(label) ? label : null;\n });\n this.app.stage.on(\"globalpointermove\", (event) => {\n if (!dragging) return;\n if (Math.hypot(event.globalX - downX, event.globalY - downY) > DRAG_THRESHOLD) moved = true;\n this.world.x += event.globalX - lastX;\n this.world.y += event.globalY - lastY;\n lastX = event.globalX;\n lastY = event.globalY;\n });\n const endDrag = (): void => {\n if (dragging && !moved) {\n const node = pressedId ? this.byId.get(pressedId) : undefined;\n if (node) {\n this.setSelection(node.id);\n this.onSelect(node);\n } else if (this.selectedId !== null || this.highlights.size > 0) {\n // A background click clears whatever is lit — a single selection OR a whole search/audit\n // highlight set (after a search `selectedId` is null but highlights are non-empty).\n this.setSelection(null);\n this.onDeselect();\n }\n }\n dragging = false;\n pressedId = null;\n };\n this.app.stage.on(\"pointerup\", endDrag);\n this.app.stage.on(\"pointerupoutside\", endDrag);\n\n container.addEventListener(\"wheel\", (event) => {\n event.preventDefault();\n this.zoomBy(event.deltaY < 0 ? 1.1 : 1 / 1.1);\n });\n\n // Center the world initially.\n this.world.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n }\n}\n","/**\n * GUI bootstrap: loads the graph snapshot, wires the PixiJS renderer, and connects the\n * search bar (natural-language debug via the agent), the timeline, and the attribution\n * panel.\n */\n\nimport type { DetailVersion, GraphNode, GraphSnapshot, Level, NodeDetail } from \"@brain0/shared\";\nimport { HttpDataSource, type DebugFinding, type DebugResponse } from \"./datasource.js\";\nimport { PixiGraph } from \"./renderer.js\";\n\nfunction el<T extends HTMLElement>(id: string): T {\n const node = document.getElementById(id);\n if (!node) throw new Error(`missing element #${id}`);\n return node as T;\n}\n\nasync function main(): Promise<void> {\n const stage = el<HTMLDivElement>(\"stage\");\n const prompt = el<HTMLTextAreaElement>(\"prompt\");\n const sendBtn = el<HTMLButtonElement>(\"send\");\n const promptForm = el<HTMLFormElement>(\"promptbar\");\n const timeline = el<HTMLInputElement>(\"timeline\");\n const panel = el<HTMLElement>(\"panel\");\n const refreshBtn = el<HTMLButtonElement>(\"refresh\");\n const refreshStatus = el<HTMLElement>(\"refresh-status\");\n\n const dataSource = new HttpDataSource();\n const graph = new PixiGraph();\n await graph.init(stage);\n\n // The default empty-state markup authored in index.html, restored when the selection clears.\n const emptyState = panel.innerHTML;\n let selectedNodeId: string | null = null;\n // The commit currently in view, so a prompt opened from it can offer \"← back to commit\".\n let lastCommitId: string | null = null;\n // The current snapshot's node ids — to validate which highlight ids the graph can render.\n const nodeIds = new Set<string>();\n // The last smart-chat result, so a node opened from a finding can return to the results list,\n // and clicking the empty background restores the results rather than the empty state.\n let lastAsk: { result: DebugResponse; findings: DebugFinding[] } | null = null;\n\n // Fetch + render a single diff on demand (one request, only when needed). Shared by the manual\n // \"See details\" button and the auto-expand for leaf nodes.\n const revealDiff = async (button: HTMLButtonElement): Promise<void> => {\n const ref = button.dataset.ref;\n const slot = button.parentElement?.querySelector<HTMLElement>(\".diff-slot\");\n if (!ref || !slot || slot.dataset.loaded === \"1\") return;\n button.textContent = \"loading…\";\n const result = await dataSource.diff(ref);\n slot.dataset.loaded = \"1\";\n slot.style.display = \"block\";\n slot.innerHTML = result.encrypted\n ? '<p class=\"muted\">payload encrypted — re-run ingest with --no-encrypt-payload to preview</p>'\n : result.diff\n ? renderDiffHtml(result.diff)\n : '<p class=\"muted\">diff not available — the payload is encrypted (.enc) or none was stored. Re-run: <code>brain0 ingest … --no-encrypt-payload</code></p>';\n button.textContent = \"Hide details\";\n };\n\n // Leaf artifacts (a single file/symbol) auto-load their latest diff on selection — still on\n // demand (one fetch for the clicked node), just without the extra \"See details\" click.\n const autoExpandDiffs = (): void => {\n panel\n .querySelectorAll<HTMLButtonElement>(\"button.see-details[data-autoload]\")\n .forEach((button) => void revealDiff(button));\n };\n\n // Open a node's detail by id — used for nodes that are NOT in the graph (a commit's prompts) and\n // for clicked smart-chat findings. `back` adds a \"← back to commit\" or \"← back to results\" link.\n const showDetailById = (id: string, back?: { commit?: string; results?: boolean }): void => {\n selectedNodeId = id;\n panel.scrollTop = 0;\n void dataSource\n .detail(id)\n .then((detail) => {\n if (selectedNodeId !== id) return;\n if (!detail) {\n panel.innerHTML = '<p class=\"muted\">not found</p>';\n return;\n }\n const backHtml = back?.results\n ? `<button class=\"back-link\" data-back=\"results\">← back to results</button>`\n : back?.commit\n ? `<button class=\"back-link\" data-commit=\"${escapeHtml(back.commit)}\">← back to commit</button>`\n : \"\";\n const node: GraphNode = {\n id,\n kind: detail.kind === \"artifact\" ? \"artifact\" : \"task\",\n label: detail.label,\n };\n panel.innerHTML = backHtml + renderDetail(node, detail);\n autoExpandDiffs();\n })\n .catch(() => {\n if (selectedNodeId === id) panel.innerHTML = '<p class=\"muted\">failed to load</p>';\n });\n };\n\n // Highlight the whole result set in the graph: retrieval floor ∪ LLM-chosen, validated against\n // renderable nodes (tasks + artifacts; version ids are not graph nodes), colored by severity.\n const applyAskHighlights = (result: DebugResponse, findings: DebugFinding[]): void => {\n const severity = new Map<string, string>();\n const ids = new Set<string>();\n const addId = (id: string, sev?: string): void => {\n if (!nodeIds.has(id)) return;\n ids.add(id);\n if (sev) severity.set(id, sev);\n };\n for (const id of result.tasks) addId(id);\n for (const id of result.artifacts) addId(id);\n for (const f of findings) if (f.kind !== \"version\") addId(f.id, f.severity);\n graph.setHighlights(ids, severity);\n };\n\n // Return to the smart-chat results list (re-render + re-highlight the whole set).\n const showAskResults = (): void => {\n if (!lastAsk) {\n panel.innerHTML = emptyState;\n return;\n }\n selectedNodeId = null;\n applyAskHighlights(lastAsk.result, lastAsk.findings);\n panel.scrollTop = 0;\n panel.innerHTML = renderAsk(lastAsk.result, lastAsk.findings);\n };\n\n graph.onSelect = (node: GraphNode) => {\n // The renderer already highlighted the node + its neighbors; here we fill the docked panel.\n selectedNodeId = node.id;\n if (node.kind === \"task\") lastCommitId = node.id; // graph intent nodes are commits\n // Show a lightweight header in the SAME contextual style immediately (no raw-data flash),\n // then hydrate the full detail by reference and replace in place.\n panel.scrollTop = 0;\n panel.innerHTML = `${renderNodeLite(node)}<p class=\"muted\">loading…</p>`;\n void dataSource\n .detail(node.id)\n .then((detail) => {\n // Ignore a late response if the selection changed or was cleared meanwhile.\n if (selectedNodeId !== node.id) return;\n if (detail) {\n panel.innerHTML = renderDetail(node, detail);\n autoExpandDiffs();\n } else {\n panel.innerHTML = renderNodeLite(node);\n }\n })\n .catch(() => {\n if (selectedNodeId === node.id) panel.innerHTML = renderNodeLite(node);\n });\n };\n\n // Click the empty graph background to unfocus: the renderer has already CLEARED the graph\n // illumination (single selection or a whole search set). The sidebar then returns to the search\n // results list (kept until a new query) — but the graph stays un-lit; re-light it by clicking a\n // finding (narrow) or \"← back to results\" (whole set). With no active search, restore empty state.\n graph.onDeselect = () => {\n selectedNodeId = null;\n panel.scrollTop = 0;\n panel.innerHTML = lastAsk ? renderAsk(lastAsk.result, lastAsk.findings) : emptyState;\n };\n\n // View control (bottom-right): the user picks the graph level here (explicit, decoupled from\n // zoom), and drives free zoom in/out/fit. Selecting a level shows it; zooming never changes it.\n const lodEl = el<HTMLElement>(\"lod\");\n const zoomPct = el<HTMLElement>(\"zoom-pct\");\n const lodSteps = Array.from(lodEl.querySelectorAll<HTMLElement>(\".lod-step\"));\n graph.onViewChange = (zoom, level) => {\n zoomPct.textContent = `${Math.round(zoom * 100)}%`;\n for (const step of lodSteps) step.classList.toggle(\"active\", step.dataset.level === level);\n };\n el<HTMLButtonElement>(\"zoom-in\").addEventListener(\"click\", () => graph.zoomBy(1.3));\n el<HTMLButtonElement>(\"zoom-out\").addEventListener(\"click\", () => graph.zoomBy(1 / 1.3));\n el<HTMLButtonElement>(\"zoom-fit\").addEventListener(\"click\", () => graph.resetView());\n for (const step of lodSteps) {\n step.addEventListener(\"click\", () => {\n const level = step.dataset.level as Level | undefined;\n if (level) graph.setLevel(level);\n });\n }\n\n panel.addEventListener(\"click\", (event) => {\n const target = event.target as HTMLElement;\n\n // Open a prompt behind the commit (a node that is not in the graph).\n const promptItem = target.closest<HTMLElement>(\".prompt-item\");\n if (promptItem) {\n const taskId = promptItem.dataset.task;\n if (taskId) showDetailById(taskId, lastCommitId ? { commit: lastCommitId } : undefined);\n return;\n }\n // Back: to the smart-chat results, or to the commit a prompt belongs to.\n const back = target.closest<HTMLElement>(\".back-link\");\n if (back) {\n if (back.dataset.back === \"results\") {\n showAskResults();\n return;\n }\n const commitId = back.dataset.commit;\n if (commitId) showDetailById(commitId);\n return;\n }\n // Open a debug/audit finding's node: narrow the graph to the nodes IMPACTED by this result\n // (the node + its directly connected neighbors), and offer a way back to the results list.\n const finding = target.closest<HTMLElement>(\".finding-card\");\n if (finding) {\n const id = finding.dataset.id;\n if (id) {\n if (nodeIds.has(id)) graph.setSelection(id); // highlight only this result's impacted nodes\n showDetailById(id, { results: true });\n }\n return;\n }\n\n // \"+N more\" on a chip row expands/collapses the full file list in place.\n const moreChip = target.closest<HTMLButtonElement>(\".chip-more\");\n if (moreChip) {\n const wrap = moreChip.closest(\".chips\");\n if (wrap) {\n const expanded = wrap.classList.toggle(\"expanded\");\n moreChip.textContent = expanded ? \"show less\" : `+${moreChip.dataset.count} more`;\n }\n return;\n }\n\n // \"See details\" toggles a diff: first click loads it on demand, later clicks show/hide it.\n const button = target.closest<HTMLButtonElement>(\".see-details\");\n if (!button) return;\n const slot = button.parentElement?.querySelector<HTMLElement>(\".diff-slot\");\n if (!slot) return;\n if (slot.dataset.loaded === \"1\") {\n const showing = slot.style.display !== \"none\";\n slot.style.display = showing ? \"none\" : \"block\";\n button.textContent = showing ? \"See details\" : \"Hide details\";\n return;\n }\n void revealDiff(button);\n });\n\n let snapshot;\n try {\n snapshot = await dataSource.load();\n } catch {\n panel.innerHTML =\n '<h3>No data</h3><p class=\"muted\">Run the brain0 observer and serve <code>graph.json</code> + <code>/api/debug</code>.</p>';\n return;\n }\n // Timeline scrubber: map the slider over the observed time range and hide everything after the\n // cutoff. The dated edges, the live cutoff label, and the filled track make \"how far back\" legible.\n // Wiring (fmt, paintTrack, the input listener) is set up ONCE; the per-snapshot range lives in\n // `tl` so a refresh can re-apply a new snapshot without stacking listeners or capturing a stale\n // range (the listener closes over `tl`, not over per-snapshot consts).\n const tlStart = el<HTMLElement>(\"tl-start\");\n const tlEnd = el<HTMLElement>(\"tl-end\");\n const tlNow = el<HTMLElement>(\"tl-now\");\n\n const fmt = (ms: number): string =>\n new Date(ms).toLocaleString(undefined, {\n month: \"short\",\n day: \"numeric\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n });\n\n const paintTrack = (frac: number): void => {\n const pct = Math.round(frac * 100);\n timeline.style.background = `linear-gradient(90deg, var(--accent) ${pct}%, var(--hairline-strong) ${pct}%)`;\n };\n\n const tl = { minTime: 0, maxTime: 0, hasTime: false };\n const updateTimeline = (): void => {\n const frac = Number(timeline.value) / 100;\n if (!tl.hasTime) {\n graph.setTimeCutoff(Number.POSITIVE_INFINITY);\n tlNow.textContent = \"all\";\n paintTrack(1);\n return;\n }\n const cutoff = tl.minTime + (tl.maxTime - tl.minTime) * frac;\n graph.setTimeCutoff(frac >= 1 ? Number.POSITIVE_INFINITY : cutoff);\n tlNow.textContent = frac >= 1 ? \"all\" : `≤ ${fmt(cutoff)}`;\n paintTrack(frac);\n };\n timeline.addEventListener(\"input\", updateTimeline); // registered ONCE\n\n // Apply a (possibly refreshed) snapshot: re-render the graph and recompute the timeline range.\n const applySnapshot = (snap: GraphSnapshot): void => {\n graph.setSnapshot(snap);\n nodeIds.clear();\n for (const n of snap.nodes) nodeIds.add(n.id);\n const times = snap.nodes\n .map((n) => (n.timestamp ? Date.parse(n.timestamp) : NaN))\n .filter((t) => !Number.isNaN(t));\n tl.minTime = times.length ? Math.min(...times) : 0;\n tl.maxTime = times.length ? Math.max(...times) : 0;\n tl.hasTime = times.length > 0 && tl.maxTime > tl.minTime;\n tlStart.textContent = tl.hasTime ? fmt(tl.minTime) : \"—\";\n tlEnd.textContent = tl.hasTime ? fmt(tl.maxTime) : \"—\";\n timeline.disabled = !tl.hasTime;\n updateTimeline(); // call once; no new listener\n };\n\n applySnapshot(snapshot);\n\n // Refresh button: re-run the passive observer server-side (ingest + observe + embeddings),\n // surface live status, then re-apply the new snapshot. Single-flight via the disabled button.\n let polling: number | null = null;\n refreshBtn.addEventListener(\"click\", () => {\n if (refreshBtn.disabled) return;\n refreshBtn.disabled = true;\n refreshStatus.textContent = \"refreshing…\";\n void (async () => {\n const started = await dataSource.refresh();\n if (started.state === \"error\") {\n refreshStatus.textContent = started.error ?? \"failed\";\n refreshBtn.disabled = false;\n return;\n }\n if (polling !== null) clearInterval(polling);\n polling = setInterval(() => {\n void (async () => {\n const s = await dataSource.refreshStatus();\n if (s.state === \"running\") {\n refreshStatus.textContent = s.lines.at(-1) ?? s.phase ?? \"working…\";\n } else if (s.state === \"done\") {\n if (polling !== null) clearInterval(polling);\n const snap = await dataSource.load();\n applySnapshot(snap);\n // The selected node may no longer exist after a refresh — clear the panel if so.\n if (selectedNodeId && !snap.nodes.some((n) => n.id === selectedNodeId)) {\n selectedNodeId = null;\n panel.innerHTML = emptyState;\n }\n refreshStatus.textContent = \"updated\";\n refreshBtn.disabled = false;\n } else if (s.state === \"error\") {\n if (polling !== null) clearInterval(polling);\n refreshStatus.textContent = s.error ?? \"failed\";\n refreshBtn.disabled = false;\n }\n })();\n }, 1000);\n })();\n });\n\n // Prompt box (bottom-centered, text only — no speech-to-text): natural-language debug that\n // highlights the agent's chain. Enter asks; Shift+Enter inserts a newline.\n const autoresize = (): void => {\n prompt.style.height = \"auto\";\n prompt.style.height = `${Math.min(prompt.scrollHeight, 168)}px`;\n };\n const refreshSend = (): void => {\n const ready = prompt.value.trim().length > 0;\n sendBtn.disabled = !ready;\n sendBtn.classList.toggle(\"ready\", ready);\n };\n const submitPrompt = (): void => {\n const query = prompt.value.trim();\n if (!query) return;\n void runDebug(query);\n prompt.value = \"\";\n autoresize();\n refreshSend();\n };\n prompt.addEventListener(\"input\", () => {\n autoresize();\n refreshSend();\n });\n prompt.addEventListener(\"keydown\", (event) => {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n submitPrompt();\n }\n });\n promptForm.addEventListener(\"submit\", (event) => {\n event.preventDefault();\n submitPrompt();\n });\n refreshSend();\n\n let debugRun = 0;\n async function runDebug(query: string): Promise<void> {\n panel.scrollTop = 0;\n panel.innerHTML = '<p class=\"muted\">searching…</p>';\n const run = ++debugRun;\n // Phase 1 — retrieval only (milliseconds, zero LLM): the graph lights up immediately while\n // the model still writes the explanation. Superseded runs are ignored.\n void dataSource\n .debug(query, \"retrieve\")\n .then((fast) => {\n if (run !== debugRun || fast.error) return;\n applyAskHighlights(fast, fast.findings ?? []);\n const n = fast.tasks.length + fast.artifacts.length;\n panel.innerHTML = `<p class=\"muted\">${n} related node(s) highlighted — thinking…</p>`;\n })\n .catch(() => {});\n let result: DebugResponse;\n try {\n result = await dataSource.debug(query);\n if (run !== debugRun) return; // a newer question superseded this one\n } catch {\n panel.innerHTML = '<p class=\"muted\">request failed — is the server running?</p>';\n return;\n }\n const findings = result.findings ?? [];\n lastAsk = { result, findings }; // remembered so findings/background-click return to this list\n applyAskHighlights(result, findings); // highlight the whole result set\n selectedNodeId = null; // an ask run replaces the click-selection context\n panel.innerHTML = renderAsk(result, findings);\n }\n}\n\n/** Render the smart-chat result: intent badge, egress notice, audit numbers, finding cards, prose. */\nfunction renderAsk(result: DebugResponse, findings: DebugFinding[]): string {\n const intent = result.intent ?? \"debug\";\n const title = intent === \"audit\" ? \"Audit\" : \"Debug\";\n const header =\n `<div class=\"hd\"><div class=\"hd-top\"><span class=\"badge badge-${intent}\">${intent}</span>` +\n (result.confidence !== undefined && result.confidence < 0.34 && !result.error\n ? `<span class=\"muted\" style=\"font-size:11px\">low confidence — rephrase to steer debug/audit</span>`\n : \"\") +\n `</div><div class=\"hd-title\">${title}</div></div>`;\n\n // Provider / egress notice (truthful, two-channel).\n let notice = \"\";\n const p = result.provider;\n if (p) {\n if (p.zeroEgress) notice = `<p class=\"ask-notice ok\">model: ${escapeHtml(p.name)} · local, zero egress</p>`;\n else {\n const bits: string[] = [];\n bits.push(p.remote ? `LLM ${escapeHtml(p.name)} (remote, redacted)` : `LLM ${escapeHtml(p.name)} (local)`);\n if (p.embedder?.remote) bits.push(`embeddings ${escapeHtml(p.embedder.name)} (remote, redacted)`);\n notice = `<p class=\"ask-notice warn\">${bits.join(\" · \")} — not zero-egress</p>`;\n }\n }\n\n const errHtml = result.error\n ? `<p class=\"ask-notice err\">⚠ No LLM reachable — run <code>ollama serve</code> or set an API key / <code>BRAIN0_LLM_*</code>. Showing retrieval highlights only.</p>`\n : \"\";\n\n let distHtml = \"\";\n if (intent === \"audit\" && result.distribution) {\n const d = result.distribution;\n const gold = result.goldSignals?.length ? ` · <b>${result.goldSignals.length}</b> gold (safe→dangerous)` : \"\";\n distHtml =\n `<h4>risk across the repo</h4><div class=\"dist\">` +\n `<span class=\"dist-g\">${d.green} safe</span> · <span class=\"dist-y\">${d.yellow} watch</span> · <span class=\"dist-r\">${d.red} risky</span>${gold}</div>`;\n }\n\n const explain = result.explanation\n ? `<p class=\"ask-explain\">${escapeHtml(result.explanation)}</p>`\n : \"\";\n\n let cards = \"\";\n if (findings.length) {\n const items = findings\n .map((f) => {\n const name = f.path ? basename(f.path) : f.id;\n const ext = f.external ? `<span class=\"read-ext\">external read</span>` : \"\";\n const verdict = f.verdict ? `<span class=\"f-verdict\">${escapeHtml(f.verdict)}</span>` : \"\";\n return (\n `<button class=\"finding-card sev-${f.severity}\" data-id=\"${escapeHtml(f.id)}\">` +\n `<span class=\"f-top\"><span class=\"sev-dot\"></span>${escapeHtml(f.severity)}${verdict}${ext}</span>` +\n `<span class=\"f-name\">${escapeHtml(name)}</span>` +\n `<span class=\"f-reason\">${escapeHtml(f.reason)}</span>` +\n `</button>`\n );\n })\n .join(\"\");\n cards = `<h4>findings (${findings.length})</h4><div class=\"finding-list\">${items}</div>`;\n }\n\n return `${header}${notice}${errHtml}${explain}${distHtml}${cards}`;\n}\n\n/** The contextual header built from the light graph node alone — shown instantly on click, in\n * the same style as the full detail, so there is never a raw-data flash before hydration. */\nfunction renderNodeLite(node: GraphNode): string {\n if (node.kind === \"task\") {\n // Every graph \"intent\" node is a commit now (agent prompts are revealed inside a commit).\n const pills: string[] = [];\n if (node.ref) pills.push(pill(`<span class=\"k\">commit</span> ${escapeHtml(node.ref.slice(0, 10))}`));\n if (node.author) pills.push(pill(`<span class=\"k\">by</span> ${escapeHtml(node.author)}`));\n if (node.timestamp) pills.push(pill(relTime(node.timestamp), node.timestamp));\n return (\n `<div class=\"hd\">` +\n `<div class=\"hd-top\"><span class=\"badge badge-commit\">commit</span></div>` +\n `<div class=\"hd-title\">Commit</div>` +\n `<div class=\"pills\">${pills.join(\"\")}</div>` +\n `<div class=\"hd-id\">${escapeHtml(node.id)}</div>` +\n `</div>`\n );\n }\n const name = basename(node.label);\n const pills: string[] = [];\n if (node.risk) {\n const r = riskInfo(node.risk);\n pills.push(\n pill(\n `<span class=\"dot\" style=\"background:${escapeHtml(node.colorHex ?? \"#8a8f98\")}\"></span>risk ${r.label} · ${r.score.toFixed(2)}`,\n ),\n );\n }\n return (\n `<div class=\"hd\">` +\n `<div class=\"hd-top\"><span class=\"badge badge-artifact\">${escapeHtml(node.level ?? \"code\")}</span>` +\n `<span class=\"hd-title hd-title-sm\">${escapeHtml(name)}</span></div>` +\n `<div class=\"pills\">${pills.join(\"\")}</div>` +\n `</div>`\n );\n}\n\n/** A short relative time (\"2d ago\"), falling back to the raw string if unparseable. */\nfunction relTime(iso: string): string {\n const t = Date.parse(iso);\n if (Number.isNaN(t)) return iso;\n const s = Math.max(0, Math.round((Date.now() - t) / 1000));\n if (s < 60) return \"just now\";\n const m = Math.round(s / 60);\n if (m < 60) return `${m}m ago`;\n const h = Math.round(m / 60);\n if (h < 24) return `${h}h ago`;\n const d = Math.round(h / 24);\n if (d < 30) return `${d}d ago`;\n const mo = Math.round(d / 30);\n return mo < 12 ? `${mo}mo ago` : `${Math.round(mo / 12)}y ago`;\n}\n\nfunction basename(path: string): string {\n const parts = path.split(\"/\");\n return parts[parts.length - 1] || path;\n}\n\nfunction pill(inner: string, title?: string): string {\n return `<span class=\"pill\"${title ? ` title=\"${escapeHtml(title)}\"` : \"\"}>${inner}</span>`;\n}\n\n/** Fused risk score (a-priori ⊕ a-posteriori) and a coarse label. */\nfunction riskInfo(risk: { apriori: number; aposteriori: number }): { label: string; score: number } {\n const a = Math.max(0, Math.min(1, risk.apriori));\n const p = Math.max(0, Math.min(1, risk.aposteriori));\n const score = 1 - (1 - a) * (1 - p);\n return { label: score < 0.34 ? \"low\" : score < 0.67 ? \"medium\" : \"high\", score };\n}\n\n/** A contextual header: a meaningful title + badges/pills instead of raw key:value rows. */\nfunction renderHeader(node: GraphNode, detail: NodeDetail): string {\n if (detail.kind === \"task\") {\n const latest = detail.versions[detail.versions.length - 1];\n const gist = latest?.summary?.trim();\n const title = gist ? escapeHtml(truncate(gist, 180)) : \"Coding intent\";\n const pills: string[] = [];\n if (detail.agent) pills.push(pill(`<span class=\"k\">agent</span> ${escapeHtml(detail.agent)}`));\n if (detail.author) pills.push(pill(`<span class=\"k\">by</span> ${escapeHtml(detail.author)}`));\n if (detail.createdAt) pills.push(pill(relTime(detail.createdAt), detail.createdAt));\n const n = detail.versions.length;\n pills.push(pill(`${n} turn${n === 1 ? \"\" : \"s\"}`));\n return (\n `<div class=\"hd\">` +\n `<div class=\"hd-top\"><span class=\"badge badge-task\">intent</span></div>` +\n `<div class=\"hd-title\">${title}</div>` +\n `<div class=\"pills\">${pills.join(\"\")}</div>` +\n `<div class=\"hd-id\">${escapeHtml(detail.id)}</div>` +\n `</div>`\n );\n }\n\n // Artifact: lead with the file/symbol name; full path + badges/risk underneath.\n const path = detail.path ?? detail.label;\n const name = basename(path);\n const pills: string[] = [];\n if (node.risk) {\n const r = riskInfo(node.risk);\n pills.push(\n pill(\n `<span class=\"dot\" style=\"background:${escapeHtml(node.colorHex ?? \"#8a8f98\")}\"></span>risk ${r.label} · ${r.score.toFixed(2)}`,\n `a-priori ${node.risk.apriori.toFixed(2)} · a-posteriori ${node.risk.aposteriori.toFixed(2)}`,\n ),\n );\n }\n if (detail.childCount) pills.push(pill(`${detail.childCount} children`));\n const last = detail.versions[detail.versions.length - 1];\n if (last?.timestamp) pills.push(pill(`changed ${relTime(last.timestamp)}`, last.timestamp));\n return (\n `<div class=\"hd\">` +\n `<div class=\"hd-top\"><span class=\"badge badge-artifact\">${escapeHtml(detail.level ?? \"code\")}</span>` +\n `<span class=\"hd-title hd-title-sm\">${escapeHtml(name)}</span></div>` +\n (name !== path ? `<div class=\"hd-sub\">${escapeHtml(path)}</div>` : \"\") +\n `<div class=\"pills\">${pills.join(\"\")}</div>` +\n `</div>`\n );\n}\n\n/** First line of a (possibly multi-line) commit message. */\nfunction firstLine(text: string): string {\n const i = text.indexOf(\"\\n\");\n return (i === -1 ? text : text.slice(0, i)).trim();\n}\n\n/**\n * A commit \"card\": the commit message, the prompts behind it (agent summaries, click to open),\n * and the files it changed (git-style, with a lazy diff per file). This is the intent layer the\n * graph draws — clicking a commit node lands here.\n */\nfunction renderCommit(detail: NodeDetail): string {\n const msg = detail.message?.trim();\n const title = msg ? escapeHtml(truncate(firstLine(msg), 200)) : \"Commit\";\n const pills: string[] = [];\n if (detail.author) pills.push(pill(`<span class=\"k\">by</span> ${escapeHtml(detail.author)}`));\n if (detail.source) pills.push(pill(`<span class=\"k\">commit</span> ${escapeHtml(detail.source)}`));\n if (detail.createdAt) pills.push(pill(relTime(detail.createdAt), detail.createdAt));\n const nf = detail.changedFiles?.length ?? 0;\n pills.push(pill(`${nf} file${nf === 1 ? \"\" : \"s\"}`));\n const header =\n `<div class=\"hd\">` +\n `<div class=\"hd-top\"><span class=\"badge badge-commit\">commit</span></div>` +\n `<div class=\"hd-title\">${title}</div>` +\n `<div class=\"pills\">${pills.join(\"\")}</div>` +\n `<div class=\"hd-id\">${escapeHtml(detail.id)}</div>` +\n `</div>`;\n\n // Full message body only when it adds more than the one-line gist already shown as the title.\n const body =\n msg && msg.split(\"\\n\").length > 1 ? `<pre class=\"commit-msg\">${escapeHtml(msg)}</pre>` : \"\";\n\n // Prompts behind this commit: the agent summaries that led to its changes. Click to open one.\n const prompts = detail.prompts ?? [];\n let promptsHtml: string;\n if (prompts.length) {\n const items = prompts\n .map((p) => {\n const text = p.summary?.trim() ? escapeHtml(truncate(p.summary.trim(), 240)) : \"(no summary)\";\n const meta = [p.agent, p.author]\n .filter(Boolean)\n .map((s) => escapeHtml(s))\n .join(\" · \");\n const when = p.when ? ` · ${escapeHtml(relTime(p.when))}` : \"\";\n return (\n `<button class=\"prompt-item\" data-task=\"${escapeHtml(p.taskId)}\">` +\n `<span class=\"prompt-sum\">${text}</span>` +\n `<span class=\"prompt-meta\">${meta}${when}</span>` +\n `</button>`\n );\n })\n .join(\"\");\n promptsHtml = `<h4>prompts behind this commit (${prompts.length})</h4><div class=\"prompt-list\">${items}</div>`;\n } else {\n promptsHtml = `<h4>prompts behind this commit</h4><p class=\"muted\">no agent prompt linked to these files</p>`;\n }\n\n // Files read for this commit (audit): what the sessions behind it loaded into the model's\n // context — grouped by what a reviewer scans for. Secret-bearing reads (DLP) first in red with\n // the detected kind inline, out-of-repo reads in accent (\"what left the project\"), then the\n // plain repo files collapsed behind \"+N more\". Chips: name visible, full path on hover.\n const reads = detail.reads ?? [];\n const readSecrets = detail.readSecrets ?? [];\n let readsHtml = \"\";\n if (reads.length || readSecrets.length) {\n const isExternal = (p: string): boolean => p.startsWith(\"/\") || /^[A-Za-z]:[\\\\/]/.test(p);\n const secretPaths = new Set(readSecrets.map((s) => s.path));\n const shortLabel = (p: string): string => {\n const segs = p.split(\"/\").filter(Boolean);\n return segs.length > 1 ? segs.slice(-2).join(\"/\") : p;\n };\n const secretChips = readSecrets.map((s) => ({\n text: `${basename(s.path)} · ${s.kinds[0] ?? \"secret\"}`,\n title: `${s.path} — ${s.kinds.join(\", \")}`,\n cls: \"chip-secret\",\n }));\n const externalChips = reads\n .filter((p) => isExternal(p) && !secretPaths.has(p))\n .map((p) => ({ text: shortLabel(p), title: p, cls: \"chip-external\" }));\n const repoChips = reads\n .filter((p) => !isExternal(p) && !secretPaths.has(p))\n .map((p) => ({ text: basename(p), title: p, cls: \"\" }));\n\n const rows: string[] = [];\n if (secretChips.length) {\n rows.push(\n chipsRow(\n \"⚠ read secrets\",\n \"these files' CONTENT held secrets when the agent read them (kinds only — values are never stored)\",\n secretChips,\n ),\n );\n }\n if (externalChips.length) {\n rows.push(\n chipsRow(\n \"outside the repo\",\n \"reads from outside the project tree that reached the model's context\",\n externalChips,\n ),\n );\n }\n if (repoChips.length) {\n rows.push(chipsRow(\"repo files\", \"project files loaded into the model's context\", repoChips));\n }\n const stats = [\n `${reads.length} read`,\n readSecrets.length ? `${readSecrets.length} with secrets` : \"\",\n externalChips.length ? `${externalChips.length} external` : \"\",\n ]\n .filter(Boolean)\n .join(\" · \");\n readsHtml = `<h4>files read for this commit</h4><p class=\"read-sum\">${escapeHtml(stats)}</p><div class=\"vfiles\">${rows.join(\"\")}</div>`;\n }\n\n // Files changed (git-style): path + change kind + ±lines, each with an on-demand diff.\n const files = detail.changedFiles ?? [];\n let filesHtml = \"\";\n if (files.length) {\n const rows = files\n .map((f) => {\n const kind = f.changeKind ? `<span class=\"cf-kind\">${escapeHtml(f.changeKind)}</span>` : \"\";\n const stat =\n f.linesAdded !== undefined || f.linesRemoved !== undefined\n ? `<span class=\"cf-stat\"><span class=\"add\">+${f.linesAdded ?? 0}</span> <span class=\"del\">−${f.linesRemoved ?? 0}</span></span>`\n : \"\";\n const diff = f.diffRef\n ? `<button class=\"see-details\" data-ref=\"${escapeHtml(f.diffRef)}\">See details</button>` +\n `<div class=\"diff-slot\" style=\"display:none\"></div>`\n : \"\";\n return (\n `<div class=\"cf\">` +\n `<div class=\"cf-head\"><code class=\"cf-path\">${escapeHtml(f.path)}</code>${kind}${stat}</div>` +\n diff +\n `</div>`\n );\n })\n .join(\"\");\n filesHtml = `<h4>files changed (${files.length})</h4><div class=\"cf-list\">${rows}</div>`;\n }\n\n const note = detail.note ? `<p class=\"muted\">⚠ ${escapeHtml(detail.note)}</p>` : \"\";\n return `${header}${body}${promptsHtml}${readsHtml}${filesHtml}${note}`;\n}\n\n/** The rich, hydrated detail panel for a selected node. */\nfunction renderDetail(node: GraphNode, detail: NodeDetail): string {\n if (detail.kind === \"commit\") return renderCommit(detail);\n const kind = detail.kind; // narrowed to \"task\" | \"artifact\" — commit handled above\n const header = renderHeader(node, detail);\n\n // The real authorship: which intents (agent/human tasks) changed this artifact. git only\n // records the committer; that an agent wrote it is known only through these reconciled links.\n let intentsHtml = \"\";\n if (detail.kind === \"artifact\" && detail.intents) {\n if (detail.intents.length) {\n const items = detail.intents\n .map(\n (i) =>\n `<li>${escapeHtml(i.agent || \"?\")}${i.author ? ` (${escapeHtml(i.author)})` : \"\"} — ${escapeHtml(i.when)}</li>`,\n )\n .join(\"\");\n intentsHtml = `<h4>changed by intent</h4><ul>${items}</ul>`;\n } else {\n intentsHtml = `<h4>changed by intent</h4><p class=\"muted\">no agent intent linked — recorded only as a git commit by its committer</p>`;\n }\n }\n\n // A leaf artifact (a single file or symbol) is focused enough that its latest diff is shown\n // immediately on selection — still fetched on demand. Higher levels keep the manual button.\n const isLeaf = detail.kind === \"artifact\" && (detail.level === \"file\" || detail.level === \"symbol\");\n const versions = detail.versions\n .slice(-8) // most recent few; histories can be long\n .reverse()\n .map((v, i) => renderVersion(kind, v, isLeaf && i === 0))\n .join(\"\");\n\n const note = detail.note ? `<p class=\"muted\">⚠ ${escapeHtml(detail.note)}</p>` : \"\";\n const count = detail.versions.length;\n return (\n `${header}${intentsHtml}` +\n `<h4>history (${count} version${count === 1 ? \"\" : \"s\"})</h4>${versions}${note}`\n );\n}\n\nfunction renderVersion(kind: \"task\" | \"artifact\", v: DetailVersion, autoload = false): string {\n const parts: string[] = [];\n parts.push(`<div class=\"ts\">${escapeHtml(v.timestamp)}</div>`);\n if (kind === \"artifact\") {\n const meta: string[] = [];\n if (v.changeKind) meta.push(escapeHtml(v.changeKind));\n if (v.linesAdded !== undefined || v.linesRemoved !== undefined) {\n meta.push(`+${v.linesAdded ?? 0}/-${v.linesRemoved ?? 0}`);\n }\n if (v.committer) meta.push(`committed by ${escapeHtml(v.committer)}`);\n if (v.source) meta.push(escapeHtml(v.source));\n if (meta.length) parts.push(`<div>${meta.join(\" · \")}</div>`);\n // The diff is always fetched on demand; `data-autoload` makes a leaf node load it right away.\n if (v.diffRef) {\n if (v.diffOfPath) {\n parts.push(\n `<div class=\"muted\">diff of containing file: <code>${escapeHtml(v.diffOfPath)}</code></div>`,\n );\n }\n const auto = autoload ? \" data-autoload\" : \"\";\n parts.push(\n `<button class=\"see-details\" data-ref=\"${escapeHtml(v.diffRef)}\"${auto}>See details</button>` +\n `<div class=\"diff-slot\" style=\"display:none\"></div>`,\n );\n }\n } else {\n // A turn card: the summary as readable prose, then the files as chips grouped by what they\n // MEAN — declared (announced), undeclared (changed silently — the drift that matters), and\n // phantom (announced but never observed). Hover a chip for the full path.\n if (v.summary) parts.push(`<p class=\"vsum\">${escapeHtml(truncate(v.summary, 600))}</p>`);\n const rows: string[] = [];\n if (v.declared && v.declared.length) {\n rows.push(\n fileRow(\"declared\", \"files this turn said it changed\", v.declared, \"\"),\n );\n }\n if (v.driftUndeclared && v.driftUndeclared.length) {\n rows.push(\n fileRow(\n \"⚠ changed, not declared\",\n \"the agent changed these without saying so\",\n v.driftUndeclared,\n \"undeclared\",\n ),\n );\n }\n if (v.driftPhantom && v.driftPhantom.length) {\n rows.push(\n fileRow(\n \"declared, not observed\",\n \"the agent said it changed these, but no change was seen\",\n v.driftPhantom,\n \"phantom\",\n ),\n );\n }\n if (rows.length) parts.push(`<div class=\"vfiles\">${rows.join(\"\")}</div>`);\n }\n return `<div class=\"version\">${parts.join(\"\")}</div>`;\n}\n\n/** A labeled chip row from prebuilt chips (text/title/cls), capped at 12 with \"+N more\". */\nfunction chipsRow(\n label: string,\n explain: string,\n items: Array<{ text: string; title: string; cls: string }>,\n): string {\n const MAX = 12;\n const chips = items\n .map(\n (c, i) =>\n `<span class=\"chip${c.cls ? ` ${c.cls}` : \"\"}${i >= MAX ? \" chip-hidden\" : \"\"}\" title=\"${escapeHtml(c.title)}\">${escapeHtml(c.text)}</span>`,\n )\n .join(\"\");\n const more =\n items.length > MAX\n ? `<button class=\"chip chip-more\" data-count=\"${items.length - MAX}\">+${items.length - MAX} more</button>`\n : \"\";\n return (\n `<div class=\"vf-row\">` +\n `<span class=\"vf-label\" title=\"${escapeHtml(explain)}\">${escapeHtml(label)}</span>` +\n `<span class=\"chips\">${chips}${more}</span>` +\n `</div>`\n );\n}\n\n/** One labeled chip row of the turn card (label tooltip explains what the group means). */\nfunction fileRow(label: string, explain: string, paths: string[], kind: string): string {\n const MAX = 12;\n // Disambiguate duplicate basenames (two Cargo.toml) with their parent dir.\n const counts = new Map<string, number>();\n for (const p of paths) counts.set(basename(p), (counts.get(basename(p)) ?? 0) + 1);\n const label_of = (p: string): string => {\n if ((counts.get(basename(p)) ?? 0) < 2) return basename(p);\n const segs = p.split(\"/\");\n return segs.slice(-2).join(\"/\");\n };\n const cls = kind ? ` chip-${kind}` : \"\";\n // Everything is rendered; chips beyond MAX start hidden and the \"+N more\" button toggles them.\n const chips = paths\n .map(\n (p, i) =>\n `<span class=\"chip${cls}${i >= MAX ? \" chip-hidden\" : \"\"}\" title=\"${escapeHtml(p)}\">${escapeHtml(label_of(p))}</span>`,\n )\n .join(\"\");\n const more =\n paths.length > MAX\n ? `<button class=\"chip chip-more\" data-count=\"${paths.length - MAX}\">+${paths.length - MAX} more</button>`\n : \"\";\n return (\n `<div class=\"vf-row\">` +\n `<span class=\"vf-label\" title=\"${escapeHtml(explain)}\">${escapeHtml(label)}</span>` +\n `<span class=\"chips\">${chips}${more}</span>` +\n `</div>`\n );\n}\n\nfunction truncate(text: string, max: number): string {\n return text.length > max ? `${text.slice(0, max)}… (${text.length} chars)` : text;\n}\n\n/** Render a unified diff git-style: added lines green, removed red, hunks/meta dimmed. */\nfunction renderDiffHtml(diff: string): string {\n const MAX_LINES = 4000;\n const lines = diff.split(\"\\n\");\n const shown = lines.slice(0, MAX_LINES);\n const rows = shown\n .map((line) => {\n let cls = \"ctx\";\n if (line.startsWith(\"+++\") || line.startsWith(\"---\")) cls = \"meta\";\n else if (line.startsWith(\"+\")) cls = \"add\";\n else if (line.startsWith(\"-\")) cls = \"del\";\n else if (line.startsWith(\"@@\")) cls = \"hunk\";\n else if (line.startsWith(\"diff \") || line.startsWith(\"index \")) cls = \"meta\";\n return `<span class=\"dl ${cls}\">${escapeHtml(line) || \" \"}</span>`;\n })\n .join(\"\\n\");\n const more =\n lines.length > MAX_LINES\n ? `\\n<span class=\"dl meta\">… ${lines.length - MAX_LINES} more lines</span>`\n : \"\";\n return `<pre class=\"diff\">${rows}${more}</pre>`;\n}\n\nfunction escapeHtml(text: string): string {\n return text.replace(/[&<>\"]/g, (c) =>\n c === \"&\" ? \"&\" : c === \"<\" ? \"<\" : c === \">\" ? \">\" : \""\",\n );\n}\n\nvoid main();\n"],"file":"assets/index-QopGLZI_.js"}
|