holostaff-widget 3.0.11 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CanvasRenderer-Bs-lFIBH.js → CanvasRenderer-Cz4YJgbF.js} +5 -5
- package/dist/{CanvasRenderer-Bs-lFIBH.js.map → CanvasRenderer-Cz4YJgbF.js.map} +1 -1
- package/dist/{Filter-u3cO1RLf.js → Filter-r_wRj921.js} +2 -2
- package/dist/{Filter-u3cO1RLf.js.map → Filter-r_wRj921.js.map} +1 -1
- package/dist/{GpuStencilModesToPixi-CvK8tsvK.js → GpuStencilModesToPixi-C4z4dtLL.js} +3 -3
- package/dist/{GpuStencilModesToPixi-CvK8tsvK.js.map → GpuStencilModesToPixi-C4z4dtLL.js.map} +1 -1
- package/dist/{RenderTargetSystem-D0UXSH3i.js → RenderTargetSystem-DqFlSDxk.js} +3 -3
- package/dist/{RenderTargetSystem-D0UXSH3i.js.map → RenderTargetSystem-DqFlSDxk.js.map} +1 -1
- package/dist/{WebGLRenderer-C4i0snFE.js → WebGLRenderer-DeUC_ifJ.js} +5 -5
- package/dist/{WebGLRenderer-C4i0snFE.js.map → WebGLRenderer-DeUC_ifJ.js.map} +1 -1
- package/dist/{WebGPURenderer-5XhUvJYL.js → WebGPURenderer-aCCkwhoj.js} +6 -6
- package/dist/{WebGPURenderer-5XhUvJYL.js.map → WebGPURenderer-aCCkwhoj.js.map} +1 -1
- package/dist/{browserAll-C8-HGWQr.js → browserAll-6XH0ST9E.js} +3 -3
- package/dist/{browserAll-C8-HGWQr.js.map → browserAll-6XH0ST9E.js.map} +1 -1
- package/dist/{getTextureBatchBindGroup-Drt1kYWV.js → getTextureBatchBindGroup-r8tDtgr9.js} +3 -3
- package/dist/{getTextureBatchBindGroup-Drt1kYWV.js.map → getTextureBatchBindGroup-r8tDtgr9.js.map} +1 -1
- package/dist/hs-widget.es.js +1 -1
- package/dist/hs-widget.umd.js +1 -1
- package/dist/hs-widget.umd.js.map +1 -1
- package/dist/{index-Bh9xbhFo.js → index-jYI_9I27.js} +10 -7
- package/dist/{index-Bh9xbhFo.js.map → index-jYI_9I27.js.map} +1 -1
- package/dist/{webworkerAll-D2tTDfqq.js → webworkerAll-Cb_C1p1P.js} +3 -3
- package/dist/{webworkerAll-D2tTDfqq.js.map → webworkerAll-Cb_C1p1P.js.map} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasRenderer-Bs-lFIBH.js","sources":["../node_modules/earcut/src/earcut.js","../node_modules/pixi.js/lib/utils/utils.mjs","../node_modules/parse-svg-path/index.js","../node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGPath.mjs","../node_modules/pixi.js/lib/maths/shapes/Circle.mjs","../node_modules/pixi.js/lib/maths/shapes/Ellipse.mjs","../node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.mjs","../node_modules/pixi.js/lib/maths/shapes/Polygon.mjs","../node_modules/pixi.js/lib/maths/shapes/RoundedRectangle.mjs","../node_modules/pixi.js/lib/rendering/renderers/shared/geometry/utils/buildUvs.mjs","../node_modules/pixi.js/lib/rendering/renderers/shared/geometry/utils/transformVertices.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/BatchableGraphics.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildCircle.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/const.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/utils/getOrientationOfPoints.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildLine.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildPixelLine.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/utils/triangulateWithHoles.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildPolygon.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildRectangle.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildTriangle.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/fill/FillGradient.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/utils/generateTextureFillMatrix.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/utils/buildContextBatches.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/GraphicsContextSystem.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildAdaptiveBezier.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildAdaptiveQuadratic.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArc.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArcTo.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArcToSvg.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/path/roundShape.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/path/ShapePath.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/path/GraphicsPath.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGFloatAttribute.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGDefinitions.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/utils/extractSvgUrlId.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGStyle.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/utils/fillOperations.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/utils/pathOperations.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/SVGParser.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/utils/convertFillInputToFillStyle.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/utils/getMaxMiterRatio.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/GraphicsContext.mjs","../node_modules/pixi.js/lib/scene/graphics/canvas/CanvasGraphicsContextSystem.mjs","../node_modules/pixi.js/lib/scene/graphics/canvas/CanvasGraphicsPipe.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/GraphicsPipe.mjs","../node_modules/pixi.js/lib/scene/graphics/init.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/Graphics.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/utils/canUseNewCanvasBlendModes.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/utils/canvasUtils.mjs","../node_modules/pixi.js/lib/rendering/batcher/canvas/CanvasBatchAdaptor.mjs","../node_modules/pixi.js/lib/rendering/mask/color/CanvasColorMaskPipe.mjs","../node_modules/pixi.js/lib/rendering/mask/stencil/CanvasStencilMaskPipe.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/utils/mapCanvasBlendModesToPixi.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/CanvasContextSystem.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/CanvasLimitsSystem.mjs","../node_modules/pixi.js/lib/scene/graphics/canvas/CanvasGraphicsAdaptor.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/renderTarget/CanvasRenderTargetAdaptor.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/renderTarget/CanvasRenderTargetSystem.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/texture/CanvasTextureSystem.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/CanvasRenderer.mjs"],"sourcesContent":["\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","\nmodule.exports = parse\n\n/**\n * expected argument lengths\n * @type {Object}\n */\n\nvar length = {a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0}\n\n/**\n * segment pattern\n * @type {RegExp}\n */\n\nvar segment = /([astvzqmhlc])([^astvzqmhlc]*)/ig\n\n/**\n * parse an svg path data string. Generates an Array\n * of commands where each command is an Array of the\n * form `[command, arg1, arg2, ...]`\n *\n * @param {String} path\n * @return {Array}\n */\n\nfunction parse(path) {\n\tvar data = []\n\tpath.replace(segment, function(_, command, args){\n\t\tvar type = command.toLowerCase()\n\t\targs = parseValues(args)\n\n\t\t// overloaded moveTo\n\t\tif (type == 'm' && args.length > 2) {\n\t\t\tdata.push([command].concat(args.splice(0, 2)))\n\t\t\ttype = 'l'\n\t\t\tcommand = command == 'm' ? 'l' : 'L'\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (args.length == length[type]) {\n\t\t\t\targs.unshift(command)\n\t\t\t\treturn data.push(args)\n\t\t\t}\n\t\t\tif (args.length < length[type]) throw new Error('malformed path data')\n\t\t\tdata.push([command].concat(args.splice(0, length[type])))\n\t\t}\n\t})\n\treturn data\n}\n\nvar number = /-?[0-9]*\\.?[0-9]+(?:e[-+]?\\d+)?/ig\n\nfunction parseValues(args) {\n\tvar numbers = args.match(number)\n\treturn numbers ? numbers.map(Number) : []\n}\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","\"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 m.scale(1 / scale, 1 / scale);\n m.translate(ox, oy);\n if (this.textureSpace === \"local\") {\n m.scale(defaultSize, defaultSize);\n }\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 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 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\";\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(texture, 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 this.texture = texture;\n this.transform.scale(\n 1 / texture.frame.width,\n 1 / texture.frame.height\n );\n if (repetition) {\n texture.source.style.addressModeU = repetitionMap[repetition].addressModeU;\n texture.source.style.addressModeV = repetitionMap[repetition].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 const texture = this.texture;\n this.transform.copyFrom(transform);\n this.transform.invert();\n this.transform.scale(\n 1 / texture.frame.width,\n 1 / texture.frame.height\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 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 { 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","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 { 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 { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { groupD8 } from '../../../maths/matrix/groupD8.mjs';\nimport { Matrix } from '../../../maths/matrix/Matrix.mjs';\nimport { bgr2rgb } from '../../../scene/container/container-mixins/getGlobalMixin.mjs';\nimport { multiplyHexColors } from '../../../scene/container/utils/multiplyHexColors.mjs';\nimport { canvasUtils } from '../../renderers/canvas/utils/canvasUtils.mjs';\n\n\"use strict\";\nconst _CanvasBatchAdaptor = class _CanvasBatchAdaptor {\n static _getPatternRepeat(addressModeU, addressModeV) {\n const repeatU = addressModeU && addressModeU !== \"clamp-to-edge\";\n const repeatV = addressModeV && addressModeV !== \"clamp-to-edge\";\n if (repeatU && repeatV) return \"repeat\";\n if (repeatU) return \"repeat-x\";\n if (repeatV) return \"repeat-y\";\n return \"no-repeat\";\n }\n start(batchPipe, geometry, shader) {\n void batchPipe;\n void geometry;\n void shader;\n }\n execute(batchPipe, batch) {\n const elements = batch.elements;\n if (!elements || !elements.length) return;\n const renderer = batchPipe.renderer;\n const contextSystem = renderer.canvasContext;\n const context = contextSystem.activeContext;\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n if (!element.packAsQuad) continue;\n const quad = element;\n const texture = quad.texture;\n const source = texture ? canvasUtils.getCanvasSource(texture) : null;\n if (!source) continue;\n const textureStyle = texture.source.style;\n const smoothProperty = contextSystem.smoothProperty;\n const shouldSmooth = textureStyle.scaleMode !== \"nearest\";\n if (context[smoothProperty] !== shouldSmooth) {\n context[smoothProperty] = shouldSmooth;\n }\n contextSystem.setBlendMode(batch.blendMode);\n const globalColor = renderer.globalUniforms.globalUniformData?.worldColor ?? 4294967295;\n const argb = quad.color;\n const globalAlpha = (globalColor >>> 24 & 255) / 255;\n const quadAlpha = (argb >>> 24 & 255) / 255;\n const filterAlpha = renderer.filter?.alphaMultiplier ?? 1;\n const alpha = globalAlpha * quadAlpha * filterAlpha;\n if (alpha <= 0) continue;\n context.globalAlpha = alpha;\n const globalTint = globalColor & 16777215;\n const quadTint = argb & 16777215;\n const tint = bgr2rgb(multiplyHexColors(quadTint, globalTint));\n const frame = texture.frame;\n const repeatU = textureStyle.addressModeU ?? textureStyle.addressMode;\n const repeatV = textureStyle.addressModeV ?? textureStyle.addressMode;\n const repeat = _CanvasBatchAdaptor._getPatternRepeat(repeatU, repeatV);\n const resolution = texture.source._resolution ?? texture.source.resolution ?? 1;\n const isFromCachedRenderGroup = quad.renderable?.renderGroup?.isCachedAsTexture;\n const sx = frame.x * resolution;\n const sy = frame.y * resolution;\n const sw = frame.width * resolution;\n const sh = frame.height * resolution;\n const bounds = quad.bounds;\n const isRootTarget = renderer.renderTarget.renderTarget.isRoot;\n const dx = bounds.minX;\n const dy = bounds.minY;\n const dw = bounds.maxX - bounds.minX;\n const dh = bounds.maxY - bounds.minY;\n const rotate = texture.rotate;\n const uvs = texture.uvs;\n const uvMin = Math.min(uvs.x0, uvs.x1, uvs.x2, uvs.x3, uvs.y0, uvs.y1, uvs.y2, uvs.y3);\n const uvMax = Math.max(uvs.x0, uvs.x1, uvs.x2, uvs.x3, uvs.y0, uvs.y1, uvs.y2, uvs.y3);\n const needsRepeat = repeat !== \"no-repeat\" && (uvMin < 0 || uvMax > 1);\n const willUseProcessedCanvas = !needsRepeat && (tint !== 16777215 || rotate);\n const applyRotateTransform = rotate && !willUseProcessedCanvas;\n if (applyRotateTransform) {\n _CanvasBatchAdaptor._tempPatternMatrix.copyFrom(quad.transform);\n groupD8.matrixAppendRotationInv(\n _CanvasBatchAdaptor._tempPatternMatrix,\n rotate,\n dx,\n dy,\n dw,\n dh\n );\n contextSystem.setContextTransform(\n _CanvasBatchAdaptor._tempPatternMatrix,\n quad.roundPixels === 1,\n void 0,\n isFromCachedRenderGroup && isRootTarget\n );\n } else {\n contextSystem.setContextTransform(\n quad.transform,\n quad.roundPixels === 1,\n void 0,\n isFromCachedRenderGroup && isRootTarget\n );\n }\n const drawX = applyRotateTransform ? 0 : dx;\n const drawY = applyRotateTransform ? 0 : dy;\n const drawW = dw;\n const drawH = dh;\n if (needsRepeat) {\n let patternSource = source;\n const canTint = tint !== 16777215 && !rotate;\n const fitsFrame = frame.width <= texture.source.width && frame.height <= texture.source.height;\n if (canTint && fitsFrame) {\n patternSource = canvasUtils.getTintedCanvas({ texture }, tint);\n }\n const pattern = context.createPattern(patternSource, repeat);\n if (!pattern) continue;\n const denomX = drawW;\n const denomY = drawH;\n if (denomX === 0 || denomY === 0) continue;\n const invDx = 1 / denomX;\n const invDy = 1 / denomY;\n const a = (uvs.x1 - uvs.x0) * invDx;\n const b = (uvs.y1 - uvs.y0) * invDx;\n const c = (uvs.x3 - uvs.x0) * invDy;\n const d = (uvs.y3 - uvs.y0) * invDy;\n const tx = uvs.x0 - a * drawX - c * drawY;\n const ty = uvs.y0 - b * drawX - d * drawY;\n const pixelWidth = texture.source.pixelWidth;\n const pixelHeight = texture.source.pixelHeight;\n _CanvasBatchAdaptor._tempPatternMatrix.set(\n a * pixelWidth,\n b * pixelHeight,\n c * pixelWidth,\n d * pixelHeight,\n tx * pixelWidth,\n ty * pixelHeight\n );\n canvasUtils.applyPatternTransform(pattern, _CanvasBatchAdaptor._tempPatternMatrix);\n context.fillStyle = pattern;\n context.fillRect(drawX, drawY, drawW, drawH);\n } else {\n const needsProcessing = tint !== 16777215 || rotate;\n const processedSource = needsProcessing ? canvasUtils.getTintedCanvas({ texture }, tint) : source;\n const isProcessed = processedSource !== source;\n context.drawImage(\n processedSource,\n isProcessed ? 0 : sx,\n isProcessed ? 0 : sy,\n isProcessed ? processedSource.width : sw,\n isProcessed ? processedSource.height : sh,\n drawX,\n drawY,\n drawW,\n drawH\n );\n }\n }\n }\n};\n_CanvasBatchAdaptor._tempPatternMatrix = new Matrix();\n/** @ignore */\n_CanvasBatchAdaptor.extension = {\n type: [\n ExtensionType.CanvasPipesAdaptor\n ],\n name: \"batch\"\n};\nlet CanvasBatchAdaptor = _CanvasBatchAdaptor;\n\nexport { CanvasBatchAdaptor };\n//# sourceMappingURL=CanvasBatchAdaptor.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\n\n\"use strict\";\nclass CanvasColorMaskPipe {\n constructor(renderer) {\n this._colorStack = [];\n this._colorStackIndex = 0;\n this._currentColor = 0;\n this._renderer = renderer;\n }\n buildStart() {\n this._colorStack[0] = 15;\n this._colorStackIndex = 1;\n this._currentColor = 15;\n }\n push(mask, _container, instructionSet) {\n this._renderer.renderPipes.batch.break(instructionSet);\n const colorStack = this._colorStack;\n colorStack[this._colorStackIndex] = colorStack[this._colorStackIndex - 1] & mask.mask;\n const currentColor = this._colorStack[this._colorStackIndex];\n if (currentColor !== this._currentColor) {\n this._currentColor = currentColor;\n instructionSet.add({\n renderPipeId: \"colorMask\",\n colorMask: currentColor,\n canBundle: false\n });\n }\n this._colorStackIndex++;\n }\n pop(_mask, _container, instructionSet) {\n this._renderer.renderPipes.batch.break(instructionSet);\n const colorStack = this._colorStack;\n this._colorStackIndex--;\n const currentColor = colorStack[this._colorStackIndex - 1];\n if (currentColor !== this._currentColor) {\n this._currentColor = currentColor;\n instructionSet.add({\n renderPipeId: \"colorMask\",\n colorMask: currentColor,\n canBundle: false\n });\n }\n }\n execute(_instruction) {\n }\n destroy() {\n this._renderer = null;\n this._colorStack = null;\n }\n}\n/** @ignore */\nCanvasColorMaskPipe.extension = {\n type: [\n ExtensionType.CanvasPipes\n ],\n name: \"colorMask\"\n};\n\nexport { CanvasColorMaskPipe };\n//# sourceMappingURL=CanvasColorMaskPipe.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { Graphics } from '../../../scene/graphics/shared/Graphics.mjs';\nimport { warn } from '../../../utils/logging/warn.mjs';\n\n\"use strict\";\nfunction buildRoundedRectPath(context, x, y, width, height, radius) {\n radius = Math.max(0, Math.min(radius, Math.min(width, height) / 2));\n context.moveTo(x + radius, y);\n context.lineTo(x + width - radius, y);\n context.quadraticCurveTo(x + width, y, x + width, y + radius);\n context.lineTo(x + width, y + height - radius);\n context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n context.lineTo(x + radius, y + height);\n context.quadraticCurveTo(x, y + height, x, y + height - radius);\n context.lineTo(x, y + radius);\n context.quadraticCurveTo(x, y, x + radius, y);\n}\nfunction buildShapePath(context, shape) {\n switch (shape.type) {\n case \"rectangle\": {\n const rect = shape;\n context.rect(rect.x, rect.y, rect.width, rect.height);\n break;\n }\n case \"roundedRectangle\": {\n const rect = shape;\n buildRoundedRectPath(context, rect.x, rect.y, rect.width, rect.height, rect.radius);\n break;\n }\n case \"circle\": {\n const circle = shape;\n context.moveTo(circle.x + circle.radius, circle.y);\n context.arc(circle.x, circle.y, circle.radius, 0, Math.PI * 2);\n break;\n }\n case \"ellipse\": {\n const ellipse = shape;\n if (context.ellipse) {\n context.moveTo(ellipse.x + ellipse.halfWidth, ellipse.y);\n context.ellipse(ellipse.x, ellipse.y, ellipse.halfWidth, ellipse.halfHeight, 0, 0, Math.PI * 2);\n } else {\n context.save();\n context.translate(ellipse.x, ellipse.y);\n context.scale(ellipse.halfWidth, ellipse.halfHeight);\n context.moveTo(1, 0);\n context.arc(0, 0, 1, 0, Math.PI * 2);\n context.restore();\n }\n break;\n }\n case \"triangle\": {\n const tri = shape;\n context.moveTo(tri.x, tri.y);\n context.lineTo(tri.x2, tri.y2);\n context.lineTo(tri.x3, tri.y3);\n context.closePath();\n break;\n }\n case \"polygon\":\n default: {\n const poly = shape;\n const points = poly.points;\n if (!points?.length) break;\n context.moveTo(points[0], points[1]);\n for (let i = 2; i < points.length; i += 2) {\n context.lineTo(points[i], points[i + 1]);\n }\n if (poly.closePath) {\n context.closePath();\n }\n break;\n }\n }\n}\nfunction addHolePaths(context, holes) {\n if (!holes?.length) return false;\n for (let i = 0; i < holes.length; i++) {\n const hole = holes[i];\n if (!hole?.shape) continue;\n const transform = hole.transform;\n const hasTransform = transform && !transform.isIdentity();\n if (hasTransform) {\n context.save();\n context.transform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);\n }\n buildShapePath(context, hole.shape);\n if (hasTransform) {\n context.restore();\n }\n }\n return true;\n}\nclass CanvasStencilMaskPipe {\n constructor(renderer) {\n this._warnedMaskTypes = /* @__PURE__ */ new Set();\n this._canvasMaskStack = [];\n this._renderer = renderer;\n }\n push(mask, _container, instructionSet) {\n this._renderer.renderPipes.batch.break(instructionSet);\n instructionSet.add({\n renderPipeId: \"stencilMask\",\n action: \"pushMaskBegin\",\n mask,\n inverse: _container._maskOptions.inverse,\n canBundle: false\n });\n }\n pop(_mask, _container, instructionSet) {\n this._renderer.renderPipes.batch.break(instructionSet);\n instructionSet.add({\n renderPipeId: \"stencilMask\",\n action: \"popMaskEnd\",\n mask: _mask,\n inverse: _container._maskOptions.inverse,\n canBundle: false\n });\n }\n execute(instruction) {\n if (instruction.action !== \"pushMaskBegin\" && instruction.action !== \"popMaskEnd\") {\n return;\n }\n const canvasRenderer = this._renderer;\n const contextSystem = canvasRenderer.canvasContext;\n const context = contextSystem?.activeContext;\n if (!context) return;\n if (instruction.action === \"popMaskEnd\") {\n const didClip = this._canvasMaskStack.pop();\n if (didClip) {\n context.restore();\n }\n return;\n }\n if (instruction.inverse) {\n this._warnOnce(\n \"inverse\",\n \"CanvasRenderer: inverse masks are not supported on Canvas2D; ignoring inverse flag.\"\n );\n }\n const maskContainer = instruction.mask.mask;\n if (!(maskContainer instanceof Graphics)) {\n this._warnOnce(\n \"nonGraphics\",\n \"CanvasRenderer: only Graphics masks are supported in Canvas2D; skipping mask.\"\n );\n this._canvasMaskStack.push(false);\n return;\n }\n const graphics = maskContainer;\n const instructions = graphics.context?.instructions;\n if (!instructions?.length) {\n this._canvasMaskStack.push(false);\n return;\n }\n context.save();\n contextSystem.setContextTransform(\n graphics.groupTransform,\n (canvasRenderer._roundPixels | graphics._roundPixels) === 1\n );\n context.beginPath();\n let drewPath = false;\n let hasHoles = false;\n for (let i = 0; i < instructions.length; i++) {\n const instructionData = instructions[i];\n const action = instructionData.action;\n if (action !== \"fill\" && action !== \"stroke\") continue;\n const data = instructionData.data;\n const shapePath = data?.path?.shapePath;\n if (!shapePath?.shapePrimitives?.length) continue;\n const shapePrimitives = shapePath.shapePrimitives;\n for (let j = 0; j < shapePrimitives.length; j++) {\n const primitive = shapePrimitives[j];\n if (!primitive?.shape) continue;\n const transform = primitive.transform;\n const hasTransform = transform && !transform.isIdentity();\n if (hasTransform) {\n context.save();\n context.transform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);\n }\n buildShapePath(context, primitive.shape);\n hasHoles = addHolePaths(context, primitive.holes) || hasHoles;\n drewPath = true;\n if (hasTransform) {\n context.restore();\n }\n }\n }\n if (!drewPath) {\n context.restore();\n this._canvasMaskStack.push(false);\n return;\n }\n if (hasHoles) {\n context.clip(\"evenodd\");\n } else {\n context.clip();\n }\n this._canvasMaskStack.push(true);\n }\n destroy() {\n this._renderer = null;\n this._warnedMaskTypes = null;\n this._canvasMaskStack = null;\n }\n _warnOnce(key, message) {\n if (this._warnedMaskTypes.has(key)) return;\n this._warnedMaskTypes.add(key);\n warn(message);\n }\n}\nCanvasStencilMaskPipe.extension = {\n type: [\n ExtensionType.CanvasPipes\n ],\n name: \"stencilMask\"\n};\n\nexport { CanvasStencilMaskPipe };\n//# sourceMappingURL=CanvasStencilMaskPipe.mjs.map\n","import { canUseNewCanvasBlendModes } from './canUseNewCanvasBlendModes.mjs';\n\n\"use strict\";\nconst FALLBACK_BLEND = \"source-over\";\nfunction mapCanvasBlendModesToPixi() {\n const supportsAdvanced = canUseNewCanvasBlendModes();\n const map = /* @__PURE__ */ Object.create(null);\n map.inherit = FALLBACK_BLEND;\n map.none = FALLBACK_BLEND;\n map.normal = \"source-over\";\n map.add = \"lighter\";\n map.multiply = supportsAdvanced ? \"multiply\" : FALLBACK_BLEND;\n map.screen = supportsAdvanced ? \"screen\" : FALLBACK_BLEND;\n map.overlay = supportsAdvanced ? \"overlay\" : FALLBACK_BLEND;\n map.darken = supportsAdvanced ? \"darken\" : FALLBACK_BLEND;\n map.lighten = supportsAdvanced ? \"lighten\" : FALLBACK_BLEND;\n map[\"color-dodge\"] = supportsAdvanced ? \"color-dodge\" : FALLBACK_BLEND;\n map[\"color-burn\"] = supportsAdvanced ? \"color-burn\" : FALLBACK_BLEND;\n map[\"hard-light\"] = supportsAdvanced ? \"hard-light\" : FALLBACK_BLEND;\n map[\"soft-light\"] = supportsAdvanced ? \"soft-light\" : FALLBACK_BLEND;\n map.difference = supportsAdvanced ? \"difference\" : FALLBACK_BLEND;\n map.exclusion = supportsAdvanced ? \"exclusion\" : FALLBACK_BLEND;\n map.saturation = supportsAdvanced ? \"saturation\" : FALLBACK_BLEND;\n map.color = supportsAdvanced ? \"color\" : FALLBACK_BLEND;\n map.luminosity = supportsAdvanced ? \"luminosity\" : FALLBACK_BLEND;\n map[\"linear-burn\"] = supportsAdvanced ? \"color-burn\" : FALLBACK_BLEND;\n map[\"linear-dodge\"] = supportsAdvanced ? \"color-dodge\" : FALLBACK_BLEND;\n map[\"linear-light\"] = supportsAdvanced ? \"hard-light\" : FALLBACK_BLEND;\n map[\"pin-light\"] = supportsAdvanced ? \"hard-light\" : FALLBACK_BLEND;\n map[\"vivid-light\"] = supportsAdvanced ? \"hard-light\" : FALLBACK_BLEND;\n map[\"hard-mix\"] = FALLBACK_BLEND;\n map.negation = supportsAdvanced ? \"difference\" : FALLBACK_BLEND;\n map[\"normal-npm\"] = map.normal;\n map[\"add-npm\"] = map.add;\n map[\"screen-npm\"] = map.screen;\n map.erase = \"destination-out\";\n map.subtract = FALLBACK_BLEND;\n map.divide = FALLBACK_BLEND;\n map.min = FALLBACK_BLEND;\n map.max = FALLBACK_BLEND;\n return map;\n}\n\nexport { mapCanvasBlendModesToPixi };\n//# sourceMappingURL=mapCanvasBlendModesToPixi.mjs.map\n","import { Color } from '../../../color/Color.mjs';\nimport { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { Matrix } from '../../../maths/matrix/Matrix.mjs';\nimport { mapCanvasBlendModesToPixi } from './utils/mapCanvasBlendModesToPixi.mjs';\n\n\"use strict\";\nconst tempMatrix = new Matrix();\nclass CanvasContextSystem {\n /**\n * @param renderer - The owning CanvasRenderer.\n */\n constructor(renderer) {\n /** Resolution of the active context. */\n this.activeResolution = 1;\n /** The image smoothing property to toggle for this browser. */\n this.smoothProperty = \"imageSmoothingEnabled\";\n /** Map of Pixi blend modes to canvas composite operations. */\n this.blendModes = mapCanvasBlendModesToPixi();\n /** Current canvas blend mode. */\n this._activeBlendMode = \"normal\";\n /** Optional projection transform for render targets. */\n this._projTransform = null;\n /** True when external blend mode control is in use. */\n this._outerBlend = false;\n /** Tracks unsupported blend mode warnings to avoid spam. */\n this._warnedBlendModes = /* @__PURE__ */ new Set();\n this._renderer = renderer;\n }\n resolutionChange(resolution) {\n this.activeResolution = resolution;\n }\n /** Initializes the root context and smoothing flag selection. */\n init() {\n const alpha = this._renderer.background.alpha < 1;\n this.rootContext = this._renderer.canvas.getContext(\n \"2d\",\n { alpha }\n );\n this.activeContext = this.rootContext;\n this.activeResolution = this._renderer.resolution;\n if (!this.rootContext.imageSmoothingEnabled) {\n const rc = this.rootContext;\n if (rc.webkitImageSmoothingEnabled) {\n this.smoothProperty = \"webkitImageSmoothingEnabled\";\n } else if (rc.mozImageSmoothingEnabled) {\n this.smoothProperty = \"mozImageSmoothingEnabled\";\n } else if (rc.oImageSmoothingEnabled) {\n this.smoothProperty = \"oImageSmoothingEnabled\";\n } else if (rc.msImageSmoothingEnabled) {\n this.smoothProperty = \"msImageSmoothingEnabled\";\n }\n }\n }\n /**\n * Sets the current transform on the active context.\n * @param transform - Transform to apply.\n * @param roundPixels - Whether to round translation to integers.\n * @param localResolution - Optional local resolution multiplier.\n * @param skipGlobalTransform - If true, skip applying the global world transform matrix.\n */\n setContextTransform(transform, roundPixels, localResolution, skipGlobalTransform) {\n const globalTransform = skipGlobalTransform ? Matrix.IDENTITY : this._renderer.globalUniforms.globalUniformData?.worldTransformMatrix || Matrix.IDENTITY;\n let mat = tempMatrix;\n mat.copyFrom(globalTransform);\n mat.append(transform);\n const proj = this._projTransform;\n const contextResolution = this.activeResolution;\n localResolution = localResolution || contextResolution;\n if (proj) {\n const finalMat = Matrix.shared;\n finalMat.copyFrom(mat);\n finalMat.prepend(proj);\n mat = finalMat;\n }\n if (roundPixels) {\n this.activeContext.setTransform(\n mat.a * localResolution,\n mat.b * localResolution,\n mat.c * localResolution,\n mat.d * localResolution,\n mat.tx * contextResolution | 0,\n mat.ty * contextResolution | 0\n );\n } else {\n this.activeContext.setTransform(\n mat.a * localResolution,\n mat.b * localResolution,\n mat.c * localResolution,\n mat.d * localResolution,\n mat.tx * contextResolution,\n mat.ty * contextResolution\n );\n }\n }\n /**\n * Clears the current render target, optionally filling with a color.\n * @param clearColor - Color to fill after clearing.\n * @param alpha - Alpha override for the clear color.\n */\n clear(clearColor, alpha) {\n const context = this.activeContext;\n const renderer = this._renderer;\n context.clearRect(0, 0, renderer.width, renderer.height);\n if (clearColor) {\n const color = Color.shared.setValue(clearColor);\n context.globalAlpha = alpha ?? color.alpha;\n context.fillStyle = color.toHex();\n context.fillRect(0, 0, renderer.width, renderer.height);\n context.globalAlpha = 1;\n }\n }\n /**\n * Sets the active blend mode.\n * @param blendMode - Pixi blend mode.\n */\n setBlendMode(blendMode) {\n if (this._activeBlendMode === blendMode) return;\n this._activeBlendMode = blendMode;\n this._outerBlend = false;\n const mappedBlend = this.blendModes[blendMode];\n if (!mappedBlend) {\n if (!this._warnedBlendModes.has(blendMode)) {\n console.warn(\n `CanvasRenderer: blend mode \"${blendMode}\" is not supported in Canvas2D; falling back to \"source-over\".`\n );\n this._warnedBlendModes.add(blendMode);\n }\n this.activeContext.globalCompositeOperation = \"source-over\";\n return;\n }\n this.activeContext.globalCompositeOperation = mappedBlend;\n }\n /** Releases context references. */\n destroy() {\n this.rootContext = null;\n this.activeContext = null;\n this._warnedBlendModes.clear();\n }\n}\n/** @ignore */\nCanvasContextSystem.extension = {\n type: [\n ExtensionType.CanvasSystem\n ],\n name: \"canvasContext\"\n};\n\nexport { CanvasContextSystem };\n//# sourceMappingURL=CanvasContextSystem.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\n\n\"use strict\";\nclass CanvasLimitsSystem {\n constructor() {\n this.maxTextures = 16;\n this.maxBatchableTextures = 16;\n this.maxUniformBindings = 0;\n }\n init() {\n }\n}\n/** @ignore */\nCanvasLimitsSystem.extension = {\n type: [\n ExtensionType.CanvasSystem\n ],\n name: \"limits\"\n};\n\nexport { CanvasLimitsSystem };\n//# sourceMappingURL=CanvasLimitsSystem.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { groupD8 } from '../../../maths/matrix/groupD8.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 { bgr2rgb } from '../../container/container-mixins/getGlobalMixin.mjs';\nimport { multiplyHexColors } from '../../container/utils/multiplyHexColors.mjs';\nimport { buildLine } from '../shared/buildCommands/buildLine.mjs';\nimport { FillGradient } from '../shared/fill/FillGradient.mjs';\nimport { FillPattern } from '../shared/fill/FillPattern.mjs';\nimport { shapeBuilders } from '../shared/utils/buildContextBatches.mjs';\nimport { generateTextureMatrix } from '../shared/utils/generateTextureFillMatrix.mjs';\n\n\"use strict\";\nconst emptyCanvasStyle = \"#808080\";\nconst tempMatrix = new Matrix();\nconst tempTextureMatrix = new Matrix();\nconst tempGradientMatrix = new Matrix();\nconst tempPatternMatrix = new Matrix();\nfunction fillTriangles(context, vertices, indices) {\n context.beginPath();\n for (let i = 0; i < indices.length; i += 3) {\n const i0 = indices[i] * 2;\n const i1 = indices[i + 1] * 2;\n const i2 = indices[i + 2] * 2;\n context.moveTo(vertices[i0], vertices[i0 + 1]);\n context.lineTo(vertices[i1], vertices[i1 + 1]);\n context.lineTo(vertices[i2], vertices[i2 + 1]);\n context.closePath();\n }\n context.fill();\n}\nfunction colorToHex(color) {\n const clamped = color & 16777215;\n return `#${clamped.toString(16).padStart(6, \"0\")}`;\n}\nfunction buildRoundedRectPath(context, x, y, width, height, radius) {\n radius = Math.max(0, Math.min(radius, Math.min(width, height) / 2));\n context.moveTo(x + radius, y);\n context.lineTo(x + width - radius, y);\n context.quadraticCurveTo(x + width, y, x + width, y + radius);\n context.lineTo(x + width, y + height - radius);\n context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n context.lineTo(x + radius, y + height);\n context.quadraticCurveTo(x, y + height, x, y + height - radius);\n context.lineTo(x, y + radius);\n context.quadraticCurveTo(x, y, x + radius, y);\n}\nfunction buildShapePath(context, shape) {\n switch (shape.type) {\n case \"rectangle\": {\n const rect = shape;\n context.rect(rect.x, rect.y, rect.width, rect.height);\n break;\n }\n case \"roundedRectangle\": {\n const rect = shape;\n buildRoundedRectPath(context, rect.x, rect.y, rect.width, rect.height, rect.radius);\n break;\n }\n case \"circle\": {\n const circle = shape;\n context.arc(circle.x, circle.y, circle.radius, 0, Math.PI * 2);\n break;\n }\n case \"ellipse\": {\n const ellipse = shape;\n if (context.ellipse) {\n context.ellipse(ellipse.x, ellipse.y, ellipse.halfWidth, ellipse.halfHeight, 0, 0, Math.PI * 2);\n } else {\n context.save();\n context.translate(ellipse.x, ellipse.y);\n context.scale(ellipse.halfWidth, ellipse.halfHeight);\n context.arc(0, 0, 1, 0, Math.PI * 2);\n context.restore();\n }\n break;\n }\n case \"triangle\": {\n const tri = shape;\n context.moveTo(tri.x, tri.y);\n context.lineTo(tri.x2, tri.y2);\n context.lineTo(tri.x3, tri.y3);\n context.closePath();\n break;\n }\n case \"polygon\":\n default: {\n const poly = shape;\n const points = poly.points;\n if (!points?.length) break;\n context.moveTo(points[0], points[1]);\n for (let i = 2; i < points.length; i += 2) {\n context.lineTo(points[i], points[i + 1]);\n }\n if (poly.closePath) {\n context.closePath();\n }\n break;\n }\n }\n}\nfunction addHolePaths(context, holes) {\n if (!holes?.length) return false;\n for (let i = 0; i < holes.length; i++) {\n const hole = holes[i];\n if (!hole?.shape) continue;\n const transform = hole.transform;\n const hasTransform = transform && !transform.isIdentity();\n if (hasTransform) {\n context.save();\n context.transform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);\n }\n buildShapePath(context, hole.shape);\n if (hasTransform) {\n context.restore();\n }\n }\n return true;\n}\nfunction getCanvasStyle(style, tint, textureMatrix, currentTransform) {\n const fill = style.fill;\n if (fill instanceof FillGradient) {\n fill.buildGradient();\n const gradientTexture = fill.texture;\n if (gradientTexture) {\n const pattern = canvasUtils.getTintedPattern(gradientTexture, tint);\n const patternMatrix = textureMatrix ? tempPatternMatrix.copyFrom(textureMatrix).scale(gradientTexture.source.pixelWidth, gradientTexture.source.pixelHeight) : tempPatternMatrix.copyFrom(fill.transform);\n if (currentTransform && !style.textureSpace) {\n patternMatrix.append(currentTransform);\n }\n canvasUtils.applyPatternTransform(pattern, patternMatrix);\n return pattern;\n }\n }\n if (fill instanceof FillPattern) {\n const pattern = canvasUtils.getTintedPattern(fill.texture, tint);\n canvasUtils.applyPatternTransform(pattern, fill.transform);\n return pattern;\n }\n const texture = style.texture;\n if (texture && texture !== Texture.WHITE) {\n if (!texture.source.resource) {\n return emptyCanvasStyle;\n }\n const pattern = canvasUtils.getTintedPattern(texture, tint);\n const patternMatrix = textureMatrix ? tempPatternMatrix.copyFrom(textureMatrix).scale(texture.source.pixelWidth, texture.source.pixelHeight) : style.matrix;\n canvasUtils.applyPatternTransform(pattern, patternMatrix);\n return pattern;\n }\n return colorToHex(tint);\n}\nclass CanvasGraphicsAdaptor {\n constructor() {\n this.shader = null;\n }\n contextChange(renderer) {\n void renderer;\n }\n execute(graphicsPipe, renderable) {\n const renderer = graphicsPipe.renderer;\n const contextSystem = renderer.canvasContext;\n const context = contextSystem.activeContext;\n const baseTransform = renderable.groupTransform;\n const globalColor = renderer.globalUniforms.globalUniformData?.worldColor ?? 4294967295;\n const groupColorAlpha = renderable.groupColorAlpha;\n const globalAlpha = (globalColor >>> 24 & 255) / 255;\n const groupAlphaValue = (groupColorAlpha >>> 24 & 255) / 255;\n const filterAlpha = renderer.filter?.alphaMultiplier ?? 1;\n const groupAlpha = globalAlpha * groupAlphaValue * filterAlpha;\n if (groupAlpha <= 0) return;\n const globalTint = globalColor & 16777215;\n const groupTintBGR = groupColorAlpha & 16777215;\n const groupTint = bgr2rgb(multiplyHexColors(groupTintBGR, globalTint));\n const roundPixels = renderer._roundPixels | renderable._roundPixels;\n context.save();\n contextSystem.setContextTransform(baseTransform, roundPixels === 1);\n contextSystem.setBlendMode(renderable.groupBlendMode);\n const instructions = renderable.context.instructions;\n for (let i = 0; i < instructions.length; i++) {\n const instruction = instructions[i];\n if (instruction.action === \"texture\") {\n const data2 = instruction.data;\n const texture = data2.image;\n const source = texture ? canvasUtils.getCanvasSource(texture) : null;\n if (!source) continue;\n const alpha2 = data2.alpha * groupAlpha;\n if (alpha2 <= 0) continue;\n const tint2 = multiplyHexColors(data2.style, groupTint);\n context.globalAlpha = alpha2;\n let drawSource = source;\n if (tint2 !== 16777215) {\n drawSource = canvasUtils.getTintedCanvas({ texture }, tint2);\n }\n const frame = texture.frame;\n const resolution = texture.source._resolution ?? texture.source.resolution ?? 1;\n let sx = frame.x * resolution;\n let sy = frame.y * resolution;\n const sw = frame.width * resolution;\n const sh = frame.height * resolution;\n if (drawSource !== source) {\n sx = 0;\n sy = 0;\n }\n const transform = data2.transform;\n const hasTransform = transform && !transform.isIdentity();\n const rotate = texture.rotate;\n if (hasTransform || rotate) {\n tempMatrix.copyFrom(baseTransform);\n if (hasTransform) {\n tempMatrix.append(transform);\n }\n if (rotate) {\n groupD8.matrixAppendRotationInv(tempMatrix, rotate, data2.dx, data2.dy, data2.dw, data2.dh);\n }\n contextSystem.setContextTransform(tempMatrix, roundPixels === 1);\n } else {\n contextSystem.setContextTransform(baseTransform, roundPixels === 1);\n }\n context.drawImage(\n drawSource,\n sx,\n sy,\n drawSource === source ? sw : drawSource.width,\n drawSource === source ? sh : drawSource.height,\n rotate ? 0 : data2.dx,\n rotate ? 0 : data2.dy,\n data2.dw,\n data2.dh\n );\n if (hasTransform || rotate) {\n contextSystem.setContextTransform(baseTransform, roundPixels === 1);\n }\n continue;\n }\n const data = instruction.data;\n const shapePath = data?.path?.shapePath;\n if (!shapePath?.shapePrimitives?.length) continue;\n const style = data.style;\n const tint = multiplyHexColors(style.color, groupTint);\n const alpha = style.alpha * groupAlpha;\n if (alpha <= 0) continue;\n const isStroke = instruction.action === \"stroke\";\n context.globalAlpha = alpha;\n if (isStroke) {\n const strokeStyle = style;\n context.lineWidth = strokeStyle.width;\n context.lineCap = strokeStyle.cap;\n context.lineJoin = strokeStyle.join;\n context.miterLimit = strokeStyle.miterLimit;\n }\n const shapePrimitives = shapePath.shapePrimitives;\n if (!isStroke && data.hole?.shapePath?.shapePrimitives?.length) {\n const lastShape = shapePrimitives[shapePrimitives.length - 1];\n lastShape.holes = data.hole.shapePath.shapePrimitives;\n }\n for (let j = 0; j < shapePrimitives.length; j++) {\n const primitive = shapePrimitives[j];\n if (!primitive?.shape) continue;\n const transform = primitive.transform;\n const hasTransform = transform && !transform.isIdentity();\n const hasTexture = style.texture && style.texture !== Texture.WHITE;\n const textureTransform = style.textureSpace === \"global\" ? transform : null;\n const textureMatrix = hasTexture ? generateTextureMatrix(tempTextureMatrix, style, primitive.shape, textureTransform) : null;\n const currentTransform = hasTransform ? tempGradientMatrix.copyFrom(baseTransform).append(transform) : baseTransform;\n const canvasStyle = getCanvasStyle(\n style,\n tint,\n textureMatrix,\n currentTransform\n );\n if (hasTransform) {\n context.save();\n context.transform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);\n }\n if (isStroke) {\n const strokeStyle = style;\n const useStrokeGeometry = strokeStyle.alignment !== 0.5 && !strokeStyle.pixelLine;\n if (useStrokeGeometry) {\n const points = [];\n const vertices = [];\n const indices = [];\n const shapeBuilder = shapeBuilders[primitive.shape.type];\n if (shapeBuilder?.build(primitive.shape, points)) {\n const close = primitive.shape.closePath ?? true;\n buildLine(points, strokeStyle, false, close, vertices, indices);\n context.fillStyle = canvasStyle;\n fillTriangles(context, vertices, indices);\n } else {\n context.strokeStyle = canvasStyle;\n context.beginPath();\n buildShapePath(context, primitive.shape);\n context.stroke();\n }\n } else {\n context.strokeStyle = canvasStyle;\n context.beginPath();\n buildShapePath(context, primitive.shape);\n context.stroke();\n }\n } else {\n context.fillStyle = canvasStyle;\n context.beginPath();\n buildShapePath(context, primitive.shape);\n const hasHoles = addHolePaths(context, primitive.holes);\n if (hasHoles) {\n context.fill(\"evenodd\");\n } else {\n context.fill();\n }\n }\n if (hasTransform) {\n context.restore();\n }\n }\n }\n context.restore();\n }\n destroy() {\n this.shader = null;\n }\n}\n/** @ignore */\nCanvasGraphicsAdaptor.extension = {\n type: [\n ExtensionType.CanvasPipesAdaptor\n ],\n name: \"graphics\"\n};\n\nexport { CanvasGraphicsAdaptor };\n//# sourceMappingURL=CanvasGraphicsAdaptor.mjs.map\n","import { Color } from '../../../../color/Color.mjs';\nimport { DOMAdapter } from '../../../../environment/adapter.mjs';\nimport { CanvasSource } from '../../shared/texture/sources/CanvasSource.mjs';\n\n\"use strict\";\nclass CanvasRenderTargetAdaptor {\n /**\n * Initializes the adaptor.\n * @param renderer - Canvas renderer instance.\n * @param renderTargetSystem - The render target system.\n * @advanced\n */\n init(renderer, renderTargetSystem) {\n this._renderer = renderer;\n this._renderTargetSystem = renderTargetSystem;\n }\n /**\n * Creates a GPU render target for canvas.\n * @param renderTarget - Render target to initialize.\n * @advanced\n */\n initGpuRenderTarget(renderTarget) {\n const colorTexture = renderTarget.colorTexture;\n const { canvas, context } = this._ensureCanvas(colorTexture);\n return {\n canvas,\n context,\n width: canvas.width,\n height: canvas.height\n };\n }\n /**\n * Resizes the backing canvas for a render target.\n * @param renderTarget - Render target to resize.\n * @advanced\n */\n resizeGpuRenderTarget(renderTarget) {\n const colorTexture = renderTarget.colorTexture;\n const { canvas } = this._ensureCanvas(colorTexture);\n canvas.width = renderTarget.pixelWidth;\n canvas.height = renderTarget.pixelHeight;\n }\n /**\n * Starts a render pass on the canvas target.\n * @param renderTarget - Target to render to.\n * @param clear - Clear mode.\n * @param clearColor - Optional clear color.\n * @param viewport - Optional viewport.\n * @advanced\n */\n startRenderPass(renderTarget, clear, clearColor, viewport) {\n const gpuRenderTarget = this._renderTargetSystem.getGpuRenderTarget(renderTarget);\n this._renderer.canvasContext.activeContext = gpuRenderTarget.context;\n this._renderer.canvasContext.activeResolution = renderTarget.resolution;\n if (clear) {\n this.clear(renderTarget, clear, clearColor, viewport);\n }\n }\n /**\n * Clears the render target.\n * @param renderTarget - Target to clear.\n * @param _clear - Clear mode (unused).\n * @param clearColor - Optional clear color.\n * @param viewport - Optional viewport rectangle.\n * @advanced\n */\n clear(renderTarget, _clear, clearColor, viewport) {\n const gpuRenderTarget = this._renderTargetSystem.getGpuRenderTarget(renderTarget);\n const context = gpuRenderTarget.context;\n const bounds = viewport || { x: 0, y: 0, width: renderTarget.pixelWidth, height: renderTarget.pixelHeight };\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.clearRect(bounds.x, bounds.y, bounds.width, bounds.height);\n if (clearColor) {\n const color = Color.shared.setValue(clearColor);\n if (color.alpha > 0) {\n context.globalAlpha = color.alpha;\n context.fillStyle = color.toHex();\n context.fillRect(bounds.x, bounds.y, bounds.width, bounds.height);\n context.globalAlpha = 1;\n }\n }\n }\n /**\n * Finishes the render pass (no-op for canvas).\n * @advanced\n */\n finishRenderPass() {\n }\n /**\n * Copies a render target into a texture source.\n * @param {RenderTarget} sourceRenderSurfaceTexture - Source render target.\n * @param {Texture} destinationTexture - Destination texture.\n * @param {object} originSrc - Source origin.\n * @param {number} originSrc.x - Source x origin.\n * @param {number} originSrc.y - Source y origin.\n * @param {object} size - Copy size.\n * @param {number} size.width - Copy width.\n * @param {number} size.height - Copy height.\n * @param {object} [originDest] - Destination origin.\n * @param {number} originDest.x - Destination x origin.\n * @param {number} originDest.y - Destination y origin.\n * @advanced\n */\n copyToTexture(sourceRenderSurfaceTexture, destinationTexture, originSrc, size, originDest) {\n const sourceGpuTarget = this._renderTargetSystem.getGpuRenderTarget(sourceRenderSurfaceTexture);\n const sourceCanvas = sourceGpuTarget.canvas;\n const destSource = destinationTexture.source;\n const { context } = this._ensureCanvas(destSource);\n const dx = originDest?.x ?? 0;\n const dy = originDest?.y ?? 0;\n context.drawImage(\n sourceCanvas,\n originSrc.x,\n originSrc.y,\n size.width,\n size.height,\n dx,\n dy,\n size.width,\n size.height\n );\n destSource.update();\n return destinationTexture;\n }\n /**\n * Destroys a GPU render target (no-op for canvas).\n * @param _gpuRenderTarget - Target to destroy.\n * @advanced\n */\n destroyGpuRenderTarget(_gpuRenderTarget) {\n }\n _ensureCanvas(source) {\n let canvas = source.resource;\n if (!canvas || !CanvasSource.test(canvas)) {\n canvas = DOMAdapter.get().createCanvas(source.pixelWidth, source.pixelHeight);\n source.resource = canvas;\n }\n if (canvas.width !== source.pixelWidth || canvas.height !== source.pixelHeight) {\n canvas.width = source.pixelWidth;\n canvas.height = source.pixelHeight;\n }\n const context = canvas.getContext(\"2d\");\n return { canvas, context };\n }\n}\n\nexport { CanvasRenderTargetAdaptor };\n//# sourceMappingURL=CanvasRenderTargetAdaptor.mjs.map\n","import { ExtensionType } from '../../../../extensions/Extensions.mjs';\nimport { RenderTargetSystem } from '../../shared/renderTarget/RenderTargetSystem.mjs';\nimport { CanvasRenderTargetAdaptor } from './CanvasRenderTargetAdaptor.mjs';\n\n\"use strict\";\nclass CanvasRenderTargetSystem extends RenderTargetSystem {\n constructor(renderer) {\n super(renderer);\n this.adaptor = new CanvasRenderTargetAdaptor();\n this.adaptor.init(renderer, this);\n }\n}\n/** @ignore */\nCanvasRenderTargetSystem.extension = {\n type: [ExtensionType.CanvasSystem],\n name: \"renderTarget\"\n};\n\nexport { CanvasRenderTargetSystem };\n//# sourceMappingURL=CanvasRenderTargetSystem.mjs.map\n","import { DOMAdapter } from '../../../../environment/adapter.mjs';\nimport { ExtensionType } from '../../../../extensions/Extensions.mjs';\nimport { canvasUtils } from '../utils/canvasUtils.mjs';\n\n\"use strict\";\nclass CanvasTextureSystem {\n /**\n * @param renderer - The owning CanvasRenderer.\n */\n constructor(renderer) {\n void renderer;\n }\n /** Initializes the system (no-op for canvas). */\n init() {\n }\n /**\n * Initializes a texture source (no-op for canvas).\n * @param _source - Texture source.\n */\n initSource(_source) {\n }\n /**\n * Creates a canvas containing the texture's frame.\n * @param texture - Texture to render.\n */\n generateCanvas(texture) {\n const canvas = DOMAdapter.get().createCanvas();\n const context = canvas.getContext(\"2d\");\n const source = canvasUtils.getCanvasSource(texture);\n if (!source) {\n return canvas;\n }\n const frame = texture.frame;\n const resolution = texture.source._resolution ?? texture.source.resolution ?? 1;\n const sx = frame.x * resolution;\n const sy = frame.y * resolution;\n const sw = frame.width * resolution;\n const sh = frame.height * resolution;\n canvas.width = Math.ceil(sw);\n canvas.height = Math.ceil(sh);\n context.drawImage(\n source,\n sx,\n sy,\n sw,\n sh,\n 0,\n 0,\n sw,\n sh\n );\n return canvas;\n }\n /**\n * Reads pixel data from a texture.\n * @param texture - Texture to read.\n */\n getPixels(texture) {\n const canvas = this.generateCanvas(texture);\n const context = canvas.getContext(\"2d\", { willReadFrequently: true });\n const imageData = context.getImageData(0, 0, canvas.width, canvas.height);\n return {\n pixels: imageData.data,\n width: canvas.width,\n height: canvas.height\n };\n }\n /** Destroys the system (no-op for canvas). */\n destroy() {\n }\n}\n/** @ignore */\nCanvasTextureSystem.extension = {\n type: [\n ExtensionType.CanvasSystem\n ],\n name: \"texture\"\n};\n\nexport { CanvasTextureSystem };\n//# sourceMappingURL=CanvasTextureSystem.mjs.map\n","import { extensions, ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { CustomRenderPipe } from '../../../scene/container/CustomRenderPipe.mjs';\nimport { RenderGroupPipe } from '../../../scene/container/RenderGroupPipe.mjs';\nimport { CanvasGraphicsAdaptor } from '../../../scene/graphics/canvas/CanvasGraphicsAdaptor.mjs';\nimport { SpritePipe } from '../../../scene/sprite/SpritePipe.mjs';\nimport { CanvasBatchAdaptor } from '../../batcher/canvas/CanvasBatchAdaptor.mjs';\nimport { BatcherPipe } from '../../batcher/shared/BatcherPipe.mjs';\nimport { AlphaMaskPipe } from '../../mask/alpha/AlphaMaskPipe.mjs';\nimport { CanvasColorMaskPipe } from '../../mask/color/CanvasColorMaskPipe.mjs';\nimport { CanvasStencilMaskPipe } from '../../mask/stencil/CanvasStencilMaskPipe.mjs';\nimport { BlendModePipe } from '../shared/blendModes/BlendModePipe.mjs';\nimport { AbstractRenderer } from '../shared/system/AbstractRenderer.mjs';\nimport { SharedSystems } from '../shared/system/SharedSystems.mjs';\nimport { RendererType } from '../types.mjs';\nimport { CanvasContextSystem } from './CanvasContextSystem.mjs';\nimport { CanvasLimitsSystem } from './CanvasLimitsSystem.mjs';\nimport { CanvasRenderTargetSystem } from './renderTarget/CanvasRenderTargetSystem.mjs';\nimport { CanvasTextureSystem } from './texture/CanvasTextureSystem.mjs';\n\n\"use strict\";\nconst DefaultCanvasSystems = [\n ...SharedSystems,\n CanvasContextSystem,\n CanvasLimitsSystem,\n CanvasTextureSystem,\n CanvasRenderTargetSystem\n];\nconst DefaultCanvasPipes = [\n BlendModePipe,\n BatcherPipe,\n SpritePipe,\n RenderGroupPipe,\n AlphaMaskPipe,\n CanvasStencilMaskPipe,\n CanvasColorMaskPipe,\n CustomRenderPipe\n];\nconst DefaultCanvasAdapters = [\n CanvasBatchAdaptor,\n CanvasGraphicsAdaptor\n];\nconst systems = [];\nconst renderPipes = [];\nconst renderPipeAdaptors = [];\nextensions.handleByNamedList(ExtensionType.CanvasSystem, systems);\nextensions.handleByNamedList(ExtensionType.CanvasPipes, renderPipes);\nextensions.handleByNamedList(ExtensionType.CanvasPipesAdaptor, renderPipeAdaptors);\nextensions.add(...DefaultCanvasSystems, ...DefaultCanvasPipes, ...DefaultCanvasAdapters);\nclass CanvasRenderer extends AbstractRenderer {\n constructor() {\n const systemConfig = {\n name: \"canvas\",\n type: RendererType.CANVAS,\n systems,\n renderPipes,\n renderPipeAdaptors\n };\n super(systemConfig);\n }\n}\n\nexport { CanvasRenderer };\n//# sourceMappingURL=CanvasRenderer.mjs.map\n"],"names":["earcut","data","holeIndices","dim","hasHoles","outerLen","outerNode","linkedList","triangles","minX","minY","invSize","eliminateHoles","maxX","maxY","i","x","y","earcutLinked","start","end","clockwise","last","signedArea","insertNode","equals","removeNode","filterPoints","p","again","area","ear","pass","indexCurve","stop","prev","next","isEarHashed","isEar","cureLocalIntersections","splitEarcut","a","b","c","ax","bx","cx","ay","by","cy","x0","y0","x1","y1","pointInTriangleExceptFirst","minZ","zOrder","maxZ","n","intersects","locallyInside","isValidDiagonal","splitPolygon","queue","len","list","getLeftmost","compareXYSlope","eliminateHole","result","aSlope","bSlope","hole","bridge","findHoleBridge","bridgeReverse","hx","hy","qx","m","mx","my","tanMin","pointInTriangle","tan","sectorContainsSector","sortLinked","numMerges","inSize","e","tail","q","pSize","qSize","leftmost","px","py","intersectsPolygon","middleInside","r","p1","p2","q1","q2","o1","sign","o2","o3","o4","onSegment","num","inside","a2","createNode","b2","an","bp","sum","j","earcutModule","parseSvgPath","parse","length","segment","path","_","command","args","type","parseValues","number","numbers","parseSVGPath","svgPath","commands","subpaths","currentSubPath","lastX","lastY","warn","Circle","radius","r2","dx","dy","width","alignment","outerWidth","distance","out","Rectangle","circle","Ellipse","halfWidth","halfHeight","normx","normy","strokeWidth","strokeOuterWidth","strokeInnerWidth","innerHorizontal","innerVertical","outerHorizontal","outerVertical","normalizedX","normalizedY","innerEllipse","outerEllipse","ellipse","squaredDistanceToLineSegment","x2","y2","d","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","deprecation","isCornerWithinStroke","pX","pY","cornerX","cornerY","strokeWidthInner","strokeWidthOuter","RoundedRectangle","height","rectangle","radius2","innerX","innerY","innerWidth","innerHeight","rightBound","bottomBound","buildUvs","vertices","verticesStride","verticesOffset","uvs","uvsOffset","uvsStride","size","matrix","index","tx","ty","buildSimpleUvs","transformVertices","offset","stride","identityMatrix","Matrix","BatchableGraphics","rgb","bgr","renderable","multiplyHexColors","_a","gpuBuffer","buildCircle","ExtensionType","shape","rx","ry","roundedRect","j1","j2","j3","j4","y22","x02","y02","x12","x22","y12","indices","indicesOffset","centerX","centerY","count","centerIndex","buildEllipse","buildRoundedRectangle","closePointEps","curveEps","getOrientationOfPoints","square","nx","ny","innerWeight","outerWeight","verts","ix","iy","ox","oy","exx","eyy","eix","eiy","eox","eoy","round","sx","sy","ex","ey","cx2p0x","cy2p0y","angle0","angle1","startAngle","angleDiff","absAngleDiff","segCount","angleInc","angle","buildLine","lineStyle","flipAlignment","closed","eps","style","orientation","firstPoint","Point","lastPoint","closedShape","closedPath","midPointX","midPointY","indexCount","indexStart","widthSquared","miterLimitSquared","perpX","perpY","perp1x","perp1y","dist","ratio","dx0","dy0","dx1","dy1","cross","c1","c2","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","uid","options","ensureGradientOptions","definedProps","color","Color","flip","temp","colorStops","defaultSize","canvas","context","getCanvas","gradient","addColorStops","Texture","ImageSource","r0","r1","scale","FillGradient","DOMAdapter","tempTextureMatrix","generateTextureMatrix","textureMatrix","bounds","mTx","mTy","a1","b1","d1","sourceStyle","shapeBuilders","extensions","buildContextBatches","gpuContext","geometryData","batches","instruction","addTextureToGeometryData","isStroke","shapePath","addShapePathToGeometryData","build","rect","indexOffset","vertOffset","texture","textureUvs","graphicsBatch","BigPool","topology","close","otherPoints","getHoleArrays","holePoints","holePrimitives","holeArrays","k","holePrimitive","GpuGraphicsContext","batch","GraphicsContextRenderData","InstructionSet","maxTextures","DefaultBatcher","v8_3_4","_GraphicsContextSystem","renderer","GCManagedHash","hasContext","batchMode","graphicsData","vertexSize","indexSize","batcher","geometry","drawBatches","getTextureBatchBindGroup","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","d2","d3","buildAdaptiveQuadratic","buildArc","steps","f","t","cs","sn","buildArcTo","fromX","mm","dd","cc","tt","k1","k2","qy","endAngle","TAU","mapToEllipse","cosPhi","sinPhi","out2","xp","yp","approxUnitArc","ang1","ang2","vectorAngle","ux","uy","vx","vy","getArcCenter","largeArcFlag","sweepFlag","pxp","pyp","rxSq","rySq","pxpSq","pypSq","radicant","centerXp","centerYp","vx1","vy1","vx2","vy2","buildArcToSvg","xAxisRotation","lambda","segments","outCurvePoint","curve","roundedShapeArc","g","vecFrom","pp","sharpCorner","pRadius","p3","v1","v2","radDirection","drawDirection","halfAngle","cRadius","lenOut","cX","cY","roundedShapeQuadraticCurve","pointLerp","numPoints","thisPoint","nextPoint","lastEdgeLength","lastOffsetDistance","nextEdgeLength","nextOffsetDistance","tempRectangle","ShapePath","graphicsPath2D","Bounds","fromY","counterclockwise","currentPoly","transform","shapePrimitives","mainShape","shapePrimitive","mainPolygon","w","h","sides","rotation","delta","corner","sideLength","internalAngle","useQuadratic","fillet","maxFillet","inset","right","bottom","dir","chamfer","radiusX","radiusY","lastShape","tempX","boundsRect","GraphicsPath","instructions","signed","currentX","currentY","cpx1","cpy1","innerRadius","deep","newGraphicsPath2D","cpx2","cpy2","adjustTransform","lastInstruction","currentMatrix","parseSVGFloatAttribute","svg","id","defaultValue","value","parseSVGDefinitions","session","definitions","definition","child","parseLinearGradient","parseRadialGradient","gradientUnit","_child","extractSvgUrlId","url","match","styleAttributes","parseSVGStyle","strokeStyle","fillStyle","key","attribute","parseAttribute","styleParts","stylePart","id2","checkForNestedPattern","subpathsWithArea","areas","s","largestArea","secondArea","smallestArea","largestToSecondRatio","secondToSmallestRatio","extractSubpaths","pathData","part","calculatePathArea","coords","xs","ys","appendSVGPath","graphicsPath","tempPath","SVGParser","graphicsContext","div","children","renderChildren","f1","s1","noStyle","pointsString","fillRule","hasExplicitEvenodd","hasMultipleSubpaths","subpath","isMainShape","newPath","isHole","useEvenoddForGraphicsPath","repetitionMap","FillPattern","repetition","isColorLike","isFillPattern","isFillGradient","isTexture","handleColorLike","fill","defaultStyle","handleTexture","handleFillPattern","handleFillGradient","handleFillObject","toFillStyle","objectStyle","toStrokeStyle","miterLimit","cap","join","pixelLine","rest","getMaxMiterRatio","maxRatio","prevIdx","nextIdx","len0Sq","len1Sq","clampedCos","sinHalfAngle","miterRatio","tmpPoint","tempMatrix","_GraphicsContext","EventEmitter","clone","tint","dw","dh","alpha","v8_0_0","holePath","transformedX","transformedY","cpx","cpy","state","action","outerPadding","_bounds","point","hasHit","shapes","transformedPoint","holeShapes","destroyTextureSource","GraphicsContext","CanvasGraphicsContext","CanvasGraphicsContextRenderData","_CanvasGraphicsContextSystem","gpuData","renderData","CanvasGraphicsContextSystem","CanvasGraphicsPipe","adaptor","State","_graphics","graphics","instructionSet","GraphicsGpuData","GraphicsPipe","wasBatched","shader","localUniforms","color32BitToUniform","batchPipe","roundPixels","batchClone","Graphics","ViewContainer","now","method","canUseNewCanvasBlendModesValue","createColoredCanvas","canUseNewCanvasBlendModes","magenta","yellow","imageData","canvasUtils","source","resource","isPMA","resourceWidth","resourceHeight","needsResize","cached","bytes","alphaInv","sprite","stringColor","cache","cachedCanvas","resourceId","pattern","invert","patternAny","DOMMatrixCtor","domMatrix","crop","resolution","rotate","isVertical","groupD8","outWidth","outHeight","srcWidth","srcHeight","inv","_CanvasBatchAdaptor","addressModeU","addressModeV","repeatU","repeatV","elements","contextSystem","element","quad","textureStyle","smoothProperty","shouldSmooth","globalColor","argb","globalAlpha","quadAlpha","filterAlpha","_b","globalTint","quadTint","bgr2rgb","frame","repeat","isFromCachedRenderGroup","_d","_c","sw","sh","isRootTarget","uvMin","uvMax","needsRepeat","applyRotateTransform","drawX","drawY","drawW","drawH","patternSource","canTint","fitsFrame","denomX","denomY","invDx","invDy","pixelWidth","pixelHeight","processedSource","isProcessed","CanvasBatchAdaptor","CanvasColorMaskPipe","mask","_container","colorStack","currentColor","_mask","_instruction","buildRoundedRectPath","buildShapePath","tri","poly","addHolePaths","hasTransform","CanvasStencilMaskPipe","canvasRenderer","maskContainer","drewPath","instructionData","primitive","message","FALLBACK_BLEND","mapCanvasBlendModesToPixi","supportsAdvanced","map","CanvasContextSystem","rc","localResolution","skipGlobalTransform","globalTransform","mat","proj","contextResolution","finalMat","clearColor","blendMode","mappedBlend","CanvasLimitsSystem","emptyCanvasStyle","tempGradientMatrix","tempPatternMatrix","fillTriangles","i0","i1","i2","colorToHex","getCanvasStyle","currentTransform","gradientTexture","patternMatrix","CanvasGraphicsAdaptor","graphicsPipe","baseTransform","groupColorAlpha","groupAlphaValue","groupAlpha","groupTintBGR","groupTint","data2","alpha2","tint2","drawSource","_g","_f","_e","hasTexture","textureTransform","canvasStyle","shapeBuilder","CanvasRenderTargetAdaptor","renderTargetSystem","renderTarget","colorTexture","clear","viewport","gpuRenderTarget","_clear","sourceRenderSurfaceTexture","destinationTexture","originSrc","originDest","sourceCanvas","destSource","_gpuRenderTarget","CanvasSource","CanvasRenderTargetSystem","RenderTargetSystem","CanvasTextureSystem","_source","DefaultCanvasSystems","SharedSystems","DefaultCanvasPipes","BlendModePipe","BatcherPipe","SpritePipe","RenderGroupPipe","AlphaMaskPipe","CustomRenderPipe","DefaultCanvasAdapters","systems","renderPipes","renderPipeAdaptors","CanvasRenderer","AbstractRenderer","systemConfig","RendererType"],"mappings":";;;;AACe,SAASA,GAAOC,GAAMC,GAAaC,IAAM,GAAG;AAEvD,QAAMC,IAAWF,KAAeA,EAAY,QACtCG,IAAWD,IAAWF,EAAY,CAAC,IAAIC,IAAMF,EAA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N;AACI,UAAMG,CAAY;AAAA,EACpB;AACF;","x_google_ignoreList":[0,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]}
|
|
1
|
+
{"version":3,"file":"CanvasRenderer-Cz4YJgbF.js","sources":["../node_modules/earcut/src/earcut.js","../node_modules/pixi.js/lib/utils/utils.mjs","../node_modules/parse-svg-path/index.js","../node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGPath.mjs","../node_modules/pixi.js/lib/maths/shapes/Circle.mjs","../node_modules/pixi.js/lib/maths/shapes/Ellipse.mjs","../node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.mjs","../node_modules/pixi.js/lib/maths/shapes/Polygon.mjs","../node_modules/pixi.js/lib/maths/shapes/RoundedRectangle.mjs","../node_modules/pixi.js/lib/rendering/renderers/shared/geometry/utils/buildUvs.mjs","../node_modules/pixi.js/lib/rendering/renderers/shared/geometry/utils/transformVertices.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/BatchableGraphics.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildCircle.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/const.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/utils/getOrientationOfPoints.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildLine.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildPixelLine.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/utils/triangulateWithHoles.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildPolygon.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildRectangle.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildTriangle.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/fill/FillGradient.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/utils/generateTextureFillMatrix.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/utils/buildContextBatches.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/GraphicsContextSystem.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildAdaptiveBezier.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildAdaptiveQuadratic.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArc.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArcTo.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArcToSvg.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/path/roundShape.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/path/ShapePath.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/path/GraphicsPath.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGFloatAttribute.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGDefinitions.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/utils/extractSvgUrlId.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/parseSVGStyle.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/utils/fillOperations.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/utils/pathOperations.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/svg/SVGParser.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/fill/FillPattern.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/utils/convertFillInputToFillStyle.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/utils/getMaxMiterRatio.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/GraphicsContext.mjs","../node_modules/pixi.js/lib/scene/graphics/canvas/CanvasGraphicsContextSystem.mjs","../node_modules/pixi.js/lib/scene/graphics/canvas/CanvasGraphicsPipe.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/GraphicsPipe.mjs","../node_modules/pixi.js/lib/scene/graphics/init.mjs","../node_modules/pixi.js/lib/scene/graphics/shared/Graphics.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/utils/canUseNewCanvasBlendModes.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/utils/canvasUtils.mjs","../node_modules/pixi.js/lib/rendering/batcher/canvas/CanvasBatchAdaptor.mjs","../node_modules/pixi.js/lib/rendering/mask/color/CanvasColorMaskPipe.mjs","../node_modules/pixi.js/lib/rendering/mask/stencil/CanvasStencilMaskPipe.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/utils/mapCanvasBlendModesToPixi.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/CanvasContextSystem.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/CanvasLimitsSystem.mjs","../node_modules/pixi.js/lib/scene/graphics/canvas/CanvasGraphicsAdaptor.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/renderTarget/CanvasRenderTargetAdaptor.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/renderTarget/CanvasRenderTargetSystem.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/texture/CanvasTextureSystem.mjs","../node_modules/pixi.js/lib/rendering/renderers/canvas/CanvasRenderer.mjs"],"sourcesContent":["\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","\nmodule.exports = parse\n\n/**\n * expected argument lengths\n * @type {Object}\n */\n\nvar length = {a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0}\n\n/**\n * segment pattern\n * @type {RegExp}\n */\n\nvar segment = /([astvzqmhlc])([^astvzqmhlc]*)/ig\n\n/**\n * parse an svg path data string. Generates an Array\n * of commands where each command is an Array of the\n * form `[command, arg1, arg2, ...]`\n *\n * @param {String} path\n * @return {Array}\n */\n\nfunction parse(path) {\n\tvar data = []\n\tpath.replace(segment, function(_, command, args){\n\t\tvar type = command.toLowerCase()\n\t\targs = parseValues(args)\n\n\t\t// overloaded moveTo\n\t\tif (type == 'm' && args.length > 2) {\n\t\t\tdata.push([command].concat(args.splice(0, 2)))\n\t\t\ttype = 'l'\n\t\t\tcommand = command == 'm' ? 'l' : 'L'\n\t\t}\n\n\t\twhile (true) {\n\t\t\tif (args.length == length[type]) {\n\t\t\t\targs.unshift(command)\n\t\t\t\treturn data.push(args)\n\t\t\t}\n\t\t\tif (args.length < length[type]) throw new Error('malformed path data')\n\t\t\tdata.push([command].concat(args.splice(0, length[type])))\n\t\t}\n\t})\n\treturn data\n}\n\nvar number = /-?[0-9]*\\.?[0-9]+(?:e[-+]?\\d+)?/ig\n\nfunction parseValues(args) {\n\tvar numbers = args.match(number)\n\treturn numbers ? numbers.map(Number) : []\n}\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","\"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 m.scale(1 / scale, 1 / scale);\n m.translate(ox, oy);\n if (this.textureSpace === \"local\") {\n m.scale(defaultSize, defaultSize);\n }\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 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 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\";\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(texture, 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 this.texture = texture;\n this.transform.scale(\n 1 / texture.frame.width,\n 1 / texture.frame.height\n );\n if (repetition) {\n texture.source.style.addressModeU = repetitionMap[repetition].addressModeU;\n texture.source.style.addressModeV = repetitionMap[repetition].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 const texture = this.texture;\n this.transform.copyFrom(transform);\n this.transform.invert();\n this.transform.scale(\n 1 / texture.frame.width,\n 1 / texture.frame.height\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 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 { 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","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 { 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 { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { groupD8 } from '../../../maths/matrix/groupD8.mjs';\nimport { Matrix } from '../../../maths/matrix/Matrix.mjs';\nimport { bgr2rgb } from '../../../scene/container/container-mixins/getGlobalMixin.mjs';\nimport { multiplyHexColors } from '../../../scene/container/utils/multiplyHexColors.mjs';\nimport { canvasUtils } from '../../renderers/canvas/utils/canvasUtils.mjs';\n\n\"use strict\";\nconst _CanvasBatchAdaptor = class _CanvasBatchAdaptor {\n static _getPatternRepeat(addressModeU, addressModeV) {\n const repeatU = addressModeU && addressModeU !== \"clamp-to-edge\";\n const repeatV = addressModeV && addressModeV !== \"clamp-to-edge\";\n if (repeatU && repeatV) return \"repeat\";\n if (repeatU) return \"repeat-x\";\n if (repeatV) return \"repeat-y\";\n return \"no-repeat\";\n }\n start(batchPipe, geometry, shader) {\n void batchPipe;\n void geometry;\n void shader;\n }\n execute(batchPipe, batch) {\n const elements = batch.elements;\n if (!elements || !elements.length) return;\n const renderer = batchPipe.renderer;\n const contextSystem = renderer.canvasContext;\n const context = contextSystem.activeContext;\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n if (!element.packAsQuad) continue;\n const quad = element;\n const texture = quad.texture;\n const source = texture ? canvasUtils.getCanvasSource(texture) : null;\n if (!source) continue;\n const textureStyle = texture.source.style;\n const smoothProperty = contextSystem.smoothProperty;\n const shouldSmooth = textureStyle.scaleMode !== \"nearest\";\n if (context[smoothProperty] !== shouldSmooth) {\n context[smoothProperty] = shouldSmooth;\n }\n contextSystem.setBlendMode(batch.blendMode);\n const globalColor = renderer.globalUniforms.globalUniformData?.worldColor ?? 4294967295;\n const argb = quad.color;\n const globalAlpha = (globalColor >>> 24 & 255) / 255;\n const quadAlpha = (argb >>> 24 & 255) / 255;\n const filterAlpha = renderer.filter?.alphaMultiplier ?? 1;\n const alpha = globalAlpha * quadAlpha * filterAlpha;\n if (alpha <= 0) continue;\n context.globalAlpha = alpha;\n const globalTint = globalColor & 16777215;\n const quadTint = argb & 16777215;\n const tint = bgr2rgb(multiplyHexColors(quadTint, globalTint));\n const frame = texture.frame;\n const repeatU = textureStyle.addressModeU ?? textureStyle.addressMode;\n const repeatV = textureStyle.addressModeV ?? textureStyle.addressMode;\n const repeat = _CanvasBatchAdaptor._getPatternRepeat(repeatU, repeatV);\n const resolution = texture.source._resolution ?? texture.source.resolution ?? 1;\n const isFromCachedRenderGroup = quad.renderable?.renderGroup?.isCachedAsTexture;\n const sx = frame.x * resolution;\n const sy = frame.y * resolution;\n const sw = frame.width * resolution;\n const sh = frame.height * resolution;\n const bounds = quad.bounds;\n const isRootTarget = renderer.renderTarget.renderTarget.isRoot;\n const dx = bounds.minX;\n const dy = bounds.minY;\n const dw = bounds.maxX - bounds.minX;\n const dh = bounds.maxY - bounds.minY;\n const rotate = texture.rotate;\n const uvs = texture.uvs;\n const uvMin = Math.min(uvs.x0, uvs.x1, uvs.x2, uvs.x3, uvs.y0, uvs.y1, uvs.y2, uvs.y3);\n const uvMax = Math.max(uvs.x0, uvs.x1, uvs.x2, uvs.x3, uvs.y0, uvs.y1, uvs.y2, uvs.y3);\n const needsRepeat = repeat !== \"no-repeat\" && (uvMin < 0 || uvMax > 1);\n const willUseProcessedCanvas = !needsRepeat && (tint !== 16777215 || rotate);\n const applyRotateTransform = rotate && !willUseProcessedCanvas;\n if (applyRotateTransform) {\n _CanvasBatchAdaptor._tempPatternMatrix.copyFrom(quad.transform);\n groupD8.matrixAppendRotationInv(\n _CanvasBatchAdaptor._tempPatternMatrix,\n rotate,\n dx,\n dy,\n dw,\n dh\n );\n contextSystem.setContextTransform(\n _CanvasBatchAdaptor._tempPatternMatrix,\n quad.roundPixels === 1,\n void 0,\n isFromCachedRenderGroup && isRootTarget\n );\n } else {\n contextSystem.setContextTransform(\n quad.transform,\n quad.roundPixels === 1,\n void 0,\n isFromCachedRenderGroup && isRootTarget\n );\n }\n const drawX = applyRotateTransform ? 0 : dx;\n const drawY = applyRotateTransform ? 0 : dy;\n const drawW = dw;\n const drawH = dh;\n if (needsRepeat) {\n let patternSource = source;\n const canTint = tint !== 16777215 && !rotate;\n const fitsFrame = frame.width <= texture.source.width && frame.height <= texture.source.height;\n if (canTint && fitsFrame) {\n patternSource = canvasUtils.getTintedCanvas({ texture }, tint);\n }\n const pattern = context.createPattern(patternSource, repeat);\n if (!pattern) continue;\n const denomX = drawW;\n const denomY = drawH;\n if (denomX === 0 || denomY === 0) continue;\n const invDx = 1 / denomX;\n const invDy = 1 / denomY;\n const a = (uvs.x1 - uvs.x0) * invDx;\n const b = (uvs.y1 - uvs.y0) * invDx;\n const c = (uvs.x3 - uvs.x0) * invDy;\n const d = (uvs.y3 - uvs.y0) * invDy;\n const tx = uvs.x0 - a * drawX - c * drawY;\n const ty = uvs.y0 - b * drawX - d * drawY;\n const pixelWidth = texture.source.pixelWidth;\n const pixelHeight = texture.source.pixelHeight;\n _CanvasBatchAdaptor._tempPatternMatrix.set(\n a * pixelWidth,\n b * pixelHeight,\n c * pixelWidth,\n d * pixelHeight,\n tx * pixelWidth,\n ty * pixelHeight\n );\n canvasUtils.applyPatternTransform(pattern, _CanvasBatchAdaptor._tempPatternMatrix);\n context.fillStyle = pattern;\n context.fillRect(drawX, drawY, drawW, drawH);\n } else {\n const needsProcessing = tint !== 16777215 || rotate;\n const processedSource = needsProcessing ? canvasUtils.getTintedCanvas({ texture }, tint) : source;\n const isProcessed = processedSource !== source;\n context.drawImage(\n processedSource,\n isProcessed ? 0 : sx,\n isProcessed ? 0 : sy,\n isProcessed ? processedSource.width : sw,\n isProcessed ? processedSource.height : sh,\n drawX,\n drawY,\n drawW,\n drawH\n );\n }\n }\n }\n};\n_CanvasBatchAdaptor._tempPatternMatrix = new Matrix();\n/** @ignore */\n_CanvasBatchAdaptor.extension = {\n type: [\n ExtensionType.CanvasPipesAdaptor\n ],\n name: \"batch\"\n};\nlet CanvasBatchAdaptor = _CanvasBatchAdaptor;\n\nexport { CanvasBatchAdaptor };\n//# sourceMappingURL=CanvasBatchAdaptor.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\n\n\"use strict\";\nclass CanvasColorMaskPipe {\n constructor(renderer) {\n this._colorStack = [];\n this._colorStackIndex = 0;\n this._currentColor = 0;\n this._renderer = renderer;\n }\n buildStart() {\n this._colorStack[0] = 15;\n this._colorStackIndex = 1;\n this._currentColor = 15;\n }\n push(mask, _container, instructionSet) {\n this._renderer.renderPipes.batch.break(instructionSet);\n const colorStack = this._colorStack;\n colorStack[this._colorStackIndex] = colorStack[this._colorStackIndex - 1] & mask.mask;\n const currentColor = this._colorStack[this._colorStackIndex];\n if (currentColor !== this._currentColor) {\n this._currentColor = currentColor;\n instructionSet.add({\n renderPipeId: \"colorMask\",\n colorMask: currentColor,\n canBundle: false\n });\n }\n this._colorStackIndex++;\n }\n pop(_mask, _container, instructionSet) {\n this._renderer.renderPipes.batch.break(instructionSet);\n const colorStack = this._colorStack;\n this._colorStackIndex--;\n const currentColor = colorStack[this._colorStackIndex - 1];\n if (currentColor !== this._currentColor) {\n this._currentColor = currentColor;\n instructionSet.add({\n renderPipeId: \"colorMask\",\n colorMask: currentColor,\n canBundle: false\n });\n }\n }\n execute(_instruction) {\n }\n destroy() {\n this._renderer = null;\n this._colorStack = null;\n }\n}\n/** @ignore */\nCanvasColorMaskPipe.extension = {\n type: [\n ExtensionType.CanvasPipes\n ],\n name: \"colorMask\"\n};\n\nexport { CanvasColorMaskPipe };\n//# sourceMappingURL=CanvasColorMaskPipe.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { Graphics } from '../../../scene/graphics/shared/Graphics.mjs';\nimport { warn } from '../../../utils/logging/warn.mjs';\n\n\"use strict\";\nfunction buildRoundedRectPath(context, x, y, width, height, radius) {\n radius = Math.max(0, Math.min(radius, Math.min(width, height) / 2));\n context.moveTo(x + radius, y);\n context.lineTo(x + width - radius, y);\n context.quadraticCurveTo(x + width, y, x + width, y + radius);\n context.lineTo(x + width, y + height - radius);\n context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n context.lineTo(x + radius, y + height);\n context.quadraticCurveTo(x, y + height, x, y + height - radius);\n context.lineTo(x, y + radius);\n context.quadraticCurveTo(x, y, x + radius, y);\n}\nfunction buildShapePath(context, shape) {\n switch (shape.type) {\n case \"rectangle\": {\n const rect = shape;\n context.rect(rect.x, rect.y, rect.width, rect.height);\n break;\n }\n case \"roundedRectangle\": {\n const rect = shape;\n buildRoundedRectPath(context, rect.x, rect.y, rect.width, rect.height, rect.radius);\n break;\n }\n case \"circle\": {\n const circle = shape;\n context.moveTo(circle.x + circle.radius, circle.y);\n context.arc(circle.x, circle.y, circle.radius, 0, Math.PI * 2);\n break;\n }\n case \"ellipse\": {\n const ellipse = shape;\n if (context.ellipse) {\n context.moveTo(ellipse.x + ellipse.halfWidth, ellipse.y);\n context.ellipse(ellipse.x, ellipse.y, ellipse.halfWidth, ellipse.halfHeight, 0, 0, Math.PI * 2);\n } else {\n context.save();\n context.translate(ellipse.x, ellipse.y);\n context.scale(ellipse.halfWidth, ellipse.halfHeight);\n context.moveTo(1, 0);\n context.arc(0, 0, 1, 0, Math.PI * 2);\n context.restore();\n }\n break;\n }\n case \"triangle\": {\n const tri = shape;\n context.moveTo(tri.x, tri.y);\n context.lineTo(tri.x2, tri.y2);\n context.lineTo(tri.x3, tri.y3);\n context.closePath();\n break;\n }\n case \"polygon\":\n default: {\n const poly = shape;\n const points = poly.points;\n if (!points?.length) break;\n context.moveTo(points[0], points[1]);\n for (let i = 2; i < points.length; i += 2) {\n context.lineTo(points[i], points[i + 1]);\n }\n if (poly.closePath) {\n context.closePath();\n }\n break;\n }\n }\n}\nfunction addHolePaths(context, holes) {\n if (!holes?.length) return false;\n for (let i = 0; i < holes.length; i++) {\n const hole = holes[i];\n if (!hole?.shape) continue;\n const transform = hole.transform;\n const hasTransform = transform && !transform.isIdentity();\n if (hasTransform) {\n context.save();\n context.transform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);\n }\n buildShapePath(context, hole.shape);\n if (hasTransform) {\n context.restore();\n }\n }\n return true;\n}\nclass CanvasStencilMaskPipe {\n constructor(renderer) {\n this._warnedMaskTypes = /* @__PURE__ */ new Set();\n this._canvasMaskStack = [];\n this._renderer = renderer;\n }\n push(mask, _container, instructionSet) {\n this._renderer.renderPipes.batch.break(instructionSet);\n instructionSet.add({\n renderPipeId: \"stencilMask\",\n action: \"pushMaskBegin\",\n mask,\n inverse: _container._maskOptions.inverse,\n canBundle: false\n });\n }\n pop(_mask, _container, instructionSet) {\n this._renderer.renderPipes.batch.break(instructionSet);\n instructionSet.add({\n renderPipeId: \"stencilMask\",\n action: \"popMaskEnd\",\n mask: _mask,\n inverse: _container._maskOptions.inverse,\n canBundle: false\n });\n }\n execute(instruction) {\n if (instruction.action !== \"pushMaskBegin\" && instruction.action !== \"popMaskEnd\") {\n return;\n }\n const canvasRenderer = this._renderer;\n const contextSystem = canvasRenderer.canvasContext;\n const context = contextSystem?.activeContext;\n if (!context) return;\n if (instruction.action === \"popMaskEnd\") {\n const didClip = this._canvasMaskStack.pop();\n if (didClip) {\n context.restore();\n }\n return;\n }\n if (instruction.inverse) {\n this._warnOnce(\n \"inverse\",\n \"CanvasRenderer: inverse masks are not supported on Canvas2D; ignoring inverse flag.\"\n );\n }\n const maskContainer = instruction.mask.mask;\n if (!(maskContainer instanceof Graphics)) {\n this._warnOnce(\n \"nonGraphics\",\n \"CanvasRenderer: only Graphics masks are supported in Canvas2D; skipping mask.\"\n );\n this._canvasMaskStack.push(false);\n return;\n }\n const graphics = maskContainer;\n const instructions = graphics.context?.instructions;\n if (!instructions?.length) {\n this._canvasMaskStack.push(false);\n return;\n }\n context.save();\n contextSystem.setContextTransform(\n graphics.groupTransform,\n (canvasRenderer._roundPixels | graphics._roundPixels) === 1\n );\n context.beginPath();\n let drewPath = false;\n let hasHoles = false;\n for (let i = 0; i < instructions.length; i++) {\n const instructionData = instructions[i];\n const action = instructionData.action;\n if (action !== \"fill\" && action !== \"stroke\") continue;\n const data = instructionData.data;\n const shapePath = data?.path?.shapePath;\n if (!shapePath?.shapePrimitives?.length) continue;\n const shapePrimitives = shapePath.shapePrimitives;\n for (let j = 0; j < shapePrimitives.length; j++) {\n const primitive = shapePrimitives[j];\n if (!primitive?.shape) continue;\n const transform = primitive.transform;\n const hasTransform = transform && !transform.isIdentity();\n if (hasTransform) {\n context.save();\n context.transform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);\n }\n buildShapePath(context, primitive.shape);\n hasHoles = addHolePaths(context, primitive.holes) || hasHoles;\n drewPath = true;\n if (hasTransform) {\n context.restore();\n }\n }\n }\n if (!drewPath) {\n context.restore();\n this._canvasMaskStack.push(false);\n return;\n }\n if (hasHoles) {\n context.clip(\"evenodd\");\n } else {\n context.clip();\n }\n this._canvasMaskStack.push(true);\n }\n destroy() {\n this._renderer = null;\n this._warnedMaskTypes = null;\n this._canvasMaskStack = null;\n }\n _warnOnce(key, message) {\n if (this._warnedMaskTypes.has(key)) return;\n this._warnedMaskTypes.add(key);\n warn(message);\n }\n}\nCanvasStencilMaskPipe.extension = {\n type: [\n ExtensionType.CanvasPipes\n ],\n name: \"stencilMask\"\n};\n\nexport { CanvasStencilMaskPipe };\n//# sourceMappingURL=CanvasStencilMaskPipe.mjs.map\n","import { canUseNewCanvasBlendModes } from './canUseNewCanvasBlendModes.mjs';\n\n\"use strict\";\nconst FALLBACK_BLEND = \"source-over\";\nfunction mapCanvasBlendModesToPixi() {\n const supportsAdvanced = canUseNewCanvasBlendModes();\n const map = /* @__PURE__ */ Object.create(null);\n map.inherit = FALLBACK_BLEND;\n map.none = FALLBACK_BLEND;\n map.normal = \"source-over\";\n map.add = \"lighter\";\n map.multiply = supportsAdvanced ? \"multiply\" : FALLBACK_BLEND;\n map.screen = supportsAdvanced ? \"screen\" : FALLBACK_BLEND;\n map.overlay = supportsAdvanced ? \"overlay\" : FALLBACK_BLEND;\n map.darken = supportsAdvanced ? \"darken\" : FALLBACK_BLEND;\n map.lighten = supportsAdvanced ? \"lighten\" : FALLBACK_BLEND;\n map[\"color-dodge\"] = supportsAdvanced ? \"color-dodge\" : FALLBACK_BLEND;\n map[\"color-burn\"] = supportsAdvanced ? \"color-burn\" : FALLBACK_BLEND;\n map[\"hard-light\"] = supportsAdvanced ? \"hard-light\" : FALLBACK_BLEND;\n map[\"soft-light\"] = supportsAdvanced ? \"soft-light\" : FALLBACK_BLEND;\n map.difference = supportsAdvanced ? \"difference\" : FALLBACK_BLEND;\n map.exclusion = supportsAdvanced ? \"exclusion\" : FALLBACK_BLEND;\n map.saturation = supportsAdvanced ? \"saturation\" : FALLBACK_BLEND;\n map.color = supportsAdvanced ? \"color\" : FALLBACK_BLEND;\n map.luminosity = supportsAdvanced ? \"luminosity\" : FALLBACK_BLEND;\n map[\"linear-burn\"] = supportsAdvanced ? \"color-burn\" : FALLBACK_BLEND;\n map[\"linear-dodge\"] = supportsAdvanced ? \"color-dodge\" : FALLBACK_BLEND;\n map[\"linear-light\"] = supportsAdvanced ? \"hard-light\" : FALLBACK_BLEND;\n map[\"pin-light\"] = supportsAdvanced ? \"hard-light\" : FALLBACK_BLEND;\n map[\"vivid-light\"] = supportsAdvanced ? \"hard-light\" : FALLBACK_BLEND;\n map[\"hard-mix\"] = FALLBACK_BLEND;\n map.negation = supportsAdvanced ? \"difference\" : FALLBACK_BLEND;\n map[\"normal-npm\"] = map.normal;\n map[\"add-npm\"] = map.add;\n map[\"screen-npm\"] = map.screen;\n map.erase = \"destination-out\";\n map.subtract = FALLBACK_BLEND;\n map.divide = FALLBACK_BLEND;\n map.min = FALLBACK_BLEND;\n map.max = FALLBACK_BLEND;\n return map;\n}\n\nexport { mapCanvasBlendModesToPixi };\n//# sourceMappingURL=mapCanvasBlendModesToPixi.mjs.map\n","import { Color } from '../../../color/Color.mjs';\nimport { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { Matrix } from '../../../maths/matrix/Matrix.mjs';\nimport { mapCanvasBlendModesToPixi } from './utils/mapCanvasBlendModesToPixi.mjs';\n\n\"use strict\";\nconst tempMatrix = new Matrix();\nclass CanvasContextSystem {\n /**\n * @param renderer - The owning CanvasRenderer.\n */\n constructor(renderer) {\n /** Resolution of the active context. */\n this.activeResolution = 1;\n /** The image smoothing property to toggle for this browser. */\n this.smoothProperty = \"imageSmoothingEnabled\";\n /** Map of Pixi blend modes to canvas composite operations. */\n this.blendModes = mapCanvasBlendModesToPixi();\n /** Current canvas blend mode. */\n this._activeBlendMode = \"normal\";\n /** Optional projection transform for render targets. */\n this._projTransform = null;\n /** True when external blend mode control is in use. */\n this._outerBlend = false;\n /** Tracks unsupported blend mode warnings to avoid spam. */\n this._warnedBlendModes = /* @__PURE__ */ new Set();\n this._renderer = renderer;\n }\n resolutionChange(resolution) {\n this.activeResolution = resolution;\n }\n /** Initializes the root context and smoothing flag selection. */\n init() {\n const alpha = this._renderer.background.alpha < 1;\n this.rootContext = this._renderer.canvas.getContext(\n \"2d\",\n { alpha }\n );\n this.activeContext = this.rootContext;\n this.activeResolution = this._renderer.resolution;\n if (!this.rootContext.imageSmoothingEnabled) {\n const rc = this.rootContext;\n if (rc.webkitImageSmoothingEnabled) {\n this.smoothProperty = \"webkitImageSmoothingEnabled\";\n } else if (rc.mozImageSmoothingEnabled) {\n this.smoothProperty = \"mozImageSmoothingEnabled\";\n } else if (rc.oImageSmoothingEnabled) {\n this.smoothProperty = \"oImageSmoothingEnabled\";\n } else if (rc.msImageSmoothingEnabled) {\n this.smoothProperty = \"msImageSmoothingEnabled\";\n }\n }\n }\n /**\n * Sets the current transform on the active context.\n * @param transform - Transform to apply.\n * @param roundPixels - Whether to round translation to integers.\n * @param localResolution - Optional local resolution multiplier.\n * @param skipGlobalTransform - If true, skip applying the global world transform matrix.\n */\n setContextTransform(transform, roundPixels, localResolution, skipGlobalTransform) {\n const globalTransform = skipGlobalTransform ? Matrix.IDENTITY : this._renderer.globalUniforms.globalUniformData?.worldTransformMatrix || Matrix.IDENTITY;\n let mat = tempMatrix;\n mat.copyFrom(globalTransform);\n mat.append(transform);\n const proj = this._projTransform;\n const contextResolution = this.activeResolution;\n localResolution = localResolution || contextResolution;\n if (proj) {\n const finalMat = Matrix.shared;\n finalMat.copyFrom(mat);\n finalMat.prepend(proj);\n mat = finalMat;\n }\n if (roundPixels) {\n this.activeContext.setTransform(\n mat.a * localResolution,\n mat.b * localResolution,\n mat.c * localResolution,\n mat.d * localResolution,\n mat.tx * contextResolution | 0,\n mat.ty * contextResolution | 0\n );\n } else {\n this.activeContext.setTransform(\n mat.a * localResolution,\n mat.b * localResolution,\n mat.c * localResolution,\n mat.d * localResolution,\n mat.tx * contextResolution,\n mat.ty * contextResolution\n );\n }\n }\n /**\n * Clears the current render target, optionally filling with a color.\n * @param clearColor - Color to fill after clearing.\n * @param alpha - Alpha override for the clear color.\n */\n clear(clearColor, alpha) {\n const context = this.activeContext;\n const renderer = this._renderer;\n context.clearRect(0, 0, renderer.width, renderer.height);\n if (clearColor) {\n const color = Color.shared.setValue(clearColor);\n context.globalAlpha = alpha ?? color.alpha;\n context.fillStyle = color.toHex();\n context.fillRect(0, 0, renderer.width, renderer.height);\n context.globalAlpha = 1;\n }\n }\n /**\n * Sets the active blend mode.\n * @param blendMode - Pixi blend mode.\n */\n setBlendMode(blendMode) {\n if (this._activeBlendMode === blendMode) return;\n this._activeBlendMode = blendMode;\n this._outerBlend = false;\n const mappedBlend = this.blendModes[blendMode];\n if (!mappedBlend) {\n if (!this._warnedBlendModes.has(blendMode)) {\n console.warn(\n `CanvasRenderer: blend mode \"${blendMode}\" is not supported in Canvas2D; falling back to \"source-over\".`\n );\n this._warnedBlendModes.add(blendMode);\n }\n this.activeContext.globalCompositeOperation = \"source-over\";\n return;\n }\n this.activeContext.globalCompositeOperation = mappedBlend;\n }\n /** Releases context references. */\n destroy() {\n this.rootContext = null;\n this.activeContext = null;\n this._warnedBlendModes.clear();\n }\n}\n/** @ignore */\nCanvasContextSystem.extension = {\n type: [\n ExtensionType.CanvasSystem\n ],\n name: \"canvasContext\"\n};\n\nexport { CanvasContextSystem };\n//# sourceMappingURL=CanvasContextSystem.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\n\n\"use strict\";\nclass CanvasLimitsSystem {\n constructor() {\n this.maxTextures = 16;\n this.maxBatchableTextures = 16;\n this.maxUniformBindings = 0;\n }\n init() {\n }\n}\n/** @ignore */\nCanvasLimitsSystem.extension = {\n type: [\n ExtensionType.CanvasSystem\n ],\n name: \"limits\"\n};\n\nexport { CanvasLimitsSystem };\n//# sourceMappingURL=CanvasLimitsSystem.mjs.map\n","import { ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { groupD8 } from '../../../maths/matrix/groupD8.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 { bgr2rgb } from '../../container/container-mixins/getGlobalMixin.mjs';\nimport { multiplyHexColors } from '../../container/utils/multiplyHexColors.mjs';\nimport { buildLine } from '../shared/buildCommands/buildLine.mjs';\nimport { FillGradient } from '../shared/fill/FillGradient.mjs';\nimport { FillPattern } from '../shared/fill/FillPattern.mjs';\nimport { shapeBuilders } from '../shared/utils/buildContextBatches.mjs';\nimport { generateTextureMatrix } from '../shared/utils/generateTextureFillMatrix.mjs';\n\n\"use strict\";\nconst emptyCanvasStyle = \"#808080\";\nconst tempMatrix = new Matrix();\nconst tempTextureMatrix = new Matrix();\nconst tempGradientMatrix = new Matrix();\nconst tempPatternMatrix = new Matrix();\nfunction fillTriangles(context, vertices, indices) {\n context.beginPath();\n for (let i = 0; i < indices.length; i += 3) {\n const i0 = indices[i] * 2;\n const i1 = indices[i + 1] * 2;\n const i2 = indices[i + 2] * 2;\n context.moveTo(vertices[i0], vertices[i0 + 1]);\n context.lineTo(vertices[i1], vertices[i1 + 1]);\n context.lineTo(vertices[i2], vertices[i2 + 1]);\n context.closePath();\n }\n context.fill();\n}\nfunction colorToHex(color) {\n const clamped = color & 16777215;\n return `#${clamped.toString(16).padStart(6, \"0\")}`;\n}\nfunction buildRoundedRectPath(context, x, y, width, height, radius) {\n radius = Math.max(0, Math.min(radius, Math.min(width, height) / 2));\n context.moveTo(x + radius, y);\n context.lineTo(x + width - radius, y);\n context.quadraticCurveTo(x + width, y, x + width, y + radius);\n context.lineTo(x + width, y + height - radius);\n context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n context.lineTo(x + radius, y + height);\n context.quadraticCurveTo(x, y + height, x, y + height - radius);\n context.lineTo(x, y + radius);\n context.quadraticCurveTo(x, y, x + radius, y);\n}\nfunction buildShapePath(context, shape) {\n switch (shape.type) {\n case \"rectangle\": {\n const rect = shape;\n context.rect(rect.x, rect.y, rect.width, rect.height);\n break;\n }\n case \"roundedRectangle\": {\n const rect = shape;\n buildRoundedRectPath(context, rect.x, rect.y, rect.width, rect.height, rect.radius);\n break;\n }\n case \"circle\": {\n const circle = shape;\n context.arc(circle.x, circle.y, circle.radius, 0, Math.PI * 2);\n break;\n }\n case \"ellipse\": {\n const ellipse = shape;\n if (context.ellipse) {\n context.ellipse(ellipse.x, ellipse.y, ellipse.halfWidth, ellipse.halfHeight, 0, 0, Math.PI * 2);\n } else {\n context.save();\n context.translate(ellipse.x, ellipse.y);\n context.scale(ellipse.halfWidth, ellipse.halfHeight);\n context.arc(0, 0, 1, 0, Math.PI * 2);\n context.restore();\n }\n break;\n }\n case \"triangle\": {\n const tri = shape;\n context.moveTo(tri.x, tri.y);\n context.lineTo(tri.x2, tri.y2);\n context.lineTo(tri.x3, tri.y3);\n context.closePath();\n break;\n }\n case \"polygon\":\n default: {\n const poly = shape;\n const points = poly.points;\n if (!points?.length) break;\n context.moveTo(points[0], points[1]);\n for (let i = 2; i < points.length; i += 2) {\n context.lineTo(points[i], points[i + 1]);\n }\n if (poly.closePath) {\n context.closePath();\n }\n break;\n }\n }\n}\nfunction addHolePaths(context, holes) {\n if (!holes?.length) return false;\n for (let i = 0; i < holes.length; i++) {\n const hole = holes[i];\n if (!hole?.shape) continue;\n const transform = hole.transform;\n const hasTransform = transform && !transform.isIdentity();\n if (hasTransform) {\n context.save();\n context.transform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);\n }\n buildShapePath(context, hole.shape);\n if (hasTransform) {\n context.restore();\n }\n }\n return true;\n}\nfunction getCanvasStyle(style, tint, textureMatrix, currentTransform) {\n const fill = style.fill;\n if (fill instanceof FillGradient) {\n fill.buildGradient();\n const gradientTexture = fill.texture;\n if (gradientTexture) {\n const pattern = canvasUtils.getTintedPattern(gradientTexture, tint);\n const patternMatrix = textureMatrix ? tempPatternMatrix.copyFrom(textureMatrix).scale(gradientTexture.source.pixelWidth, gradientTexture.source.pixelHeight) : tempPatternMatrix.copyFrom(fill.transform);\n if (currentTransform && !style.textureSpace) {\n patternMatrix.append(currentTransform);\n }\n canvasUtils.applyPatternTransform(pattern, patternMatrix);\n return pattern;\n }\n }\n if (fill instanceof FillPattern) {\n const pattern = canvasUtils.getTintedPattern(fill.texture, tint);\n canvasUtils.applyPatternTransform(pattern, fill.transform);\n return pattern;\n }\n const texture = style.texture;\n if (texture && texture !== Texture.WHITE) {\n if (!texture.source.resource) {\n return emptyCanvasStyle;\n }\n const pattern = canvasUtils.getTintedPattern(texture, tint);\n const patternMatrix = textureMatrix ? tempPatternMatrix.copyFrom(textureMatrix).scale(texture.source.pixelWidth, texture.source.pixelHeight) : style.matrix;\n canvasUtils.applyPatternTransform(pattern, patternMatrix);\n return pattern;\n }\n return colorToHex(tint);\n}\nclass CanvasGraphicsAdaptor {\n constructor() {\n this.shader = null;\n }\n contextChange(renderer) {\n void renderer;\n }\n execute(graphicsPipe, renderable) {\n const renderer = graphicsPipe.renderer;\n const contextSystem = renderer.canvasContext;\n const context = contextSystem.activeContext;\n const baseTransform = renderable.groupTransform;\n const globalColor = renderer.globalUniforms.globalUniformData?.worldColor ?? 4294967295;\n const groupColorAlpha = renderable.groupColorAlpha;\n const globalAlpha = (globalColor >>> 24 & 255) / 255;\n const groupAlphaValue = (groupColorAlpha >>> 24 & 255) / 255;\n const filterAlpha = renderer.filter?.alphaMultiplier ?? 1;\n const groupAlpha = globalAlpha * groupAlphaValue * filterAlpha;\n if (groupAlpha <= 0) return;\n const globalTint = globalColor & 16777215;\n const groupTintBGR = groupColorAlpha & 16777215;\n const groupTint = bgr2rgb(multiplyHexColors(groupTintBGR, globalTint));\n const roundPixels = renderer._roundPixels | renderable._roundPixels;\n context.save();\n contextSystem.setContextTransform(baseTransform, roundPixels === 1);\n contextSystem.setBlendMode(renderable.groupBlendMode);\n const instructions = renderable.context.instructions;\n for (let i = 0; i < instructions.length; i++) {\n const instruction = instructions[i];\n if (instruction.action === \"texture\") {\n const data2 = instruction.data;\n const texture = data2.image;\n const source = texture ? canvasUtils.getCanvasSource(texture) : null;\n if (!source) continue;\n const alpha2 = data2.alpha * groupAlpha;\n if (alpha2 <= 0) continue;\n const tint2 = multiplyHexColors(data2.style, groupTint);\n context.globalAlpha = alpha2;\n let drawSource = source;\n if (tint2 !== 16777215) {\n drawSource = canvasUtils.getTintedCanvas({ texture }, tint2);\n }\n const frame = texture.frame;\n const resolution = texture.source._resolution ?? texture.source.resolution ?? 1;\n let sx = frame.x * resolution;\n let sy = frame.y * resolution;\n const sw = frame.width * resolution;\n const sh = frame.height * resolution;\n if (drawSource !== source) {\n sx = 0;\n sy = 0;\n }\n const transform = data2.transform;\n const hasTransform = transform && !transform.isIdentity();\n const rotate = texture.rotate;\n if (hasTransform || rotate) {\n tempMatrix.copyFrom(baseTransform);\n if (hasTransform) {\n tempMatrix.append(transform);\n }\n if (rotate) {\n groupD8.matrixAppendRotationInv(tempMatrix, rotate, data2.dx, data2.dy, data2.dw, data2.dh);\n }\n contextSystem.setContextTransform(tempMatrix, roundPixels === 1);\n } else {\n contextSystem.setContextTransform(baseTransform, roundPixels === 1);\n }\n context.drawImage(\n drawSource,\n sx,\n sy,\n drawSource === source ? sw : drawSource.width,\n drawSource === source ? sh : drawSource.height,\n rotate ? 0 : data2.dx,\n rotate ? 0 : data2.dy,\n data2.dw,\n data2.dh\n );\n if (hasTransform || rotate) {\n contextSystem.setContextTransform(baseTransform, roundPixels === 1);\n }\n continue;\n }\n const data = instruction.data;\n const shapePath = data?.path?.shapePath;\n if (!shapePath?.shapePrimitives?.length) continue;\n const style = data.style;\n const tint = multiplyHexColors(style.color, groupTint);\n const alpha = style.alpha * groupAlpha;\n if (alpha <= 0) continue;\n const isStroke = instruction.action === \"stroke\";\n context.globalAlpha = alpha;\n if (isStroke) {\n const strokeStyle = style;\n context.lineWidth = strokeStyle.width;\n context.lineCap = strokeStyle.cap;\n context.lineJoin = strokeStyle.join;\n context.miterLimit = strokeStyle.miterLimit;\n }\n const shapePrimitives = shapePath.shapePrimitives;\n if (!isStroke && data.hole?.shapePath?.shapePrimitives?.length) {\n const lastShape = shapePrimitives[shapePrimitives.length - 1];\n lastShape.holes = data.hole.shapePath.shapePrimitives;\n }\n for (let j = 0; j < shapePrimitives.length; j++) {\n const primitive = shapePrimitives[j];\n if (!primitive?.shape) continue;\n const transform = primitive.transform;\n const hasTransform = transform && !transform.isIdentity();\n const hasTexture = style.texture && style.texture !== Texture.WHITE;\n const textureTransform = style.textureSpace === \"global\" ? transform : null;\n const textureMatrix = hasTexture ? generateTextureMatrix(tempTextureMatrix, style, primitive.shape, textureTransform) : null;\n const currentTransform = hasTransform ? tempGradientMatrix.copyFrom(baseTransform).append(transform) : baseTransform;\n const canvasStyle = getCanvasStyle(\n style,\n tint,\n textureMatrix,\n currentTransform\n );\n if (hasTransform) {\n context.save();\n context.transform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);\n }\n if (isStroke) {\n const strokeStyle = style;\n const useStrokeGeometry = strokeStyle.alignment !== 0.5 && !strokeStyle.pixelLine;\n if (useStrokeGeometry) {\n const points = [];\n const vertices = [];\n const indices = [];\n const shapeBuilder = shapeBuilders[primitive.shape.type];\n if (shapeBuilder?.build(primitive.shape, points)) {\n const close = primitive.shape.closePath ?? true;\n buildLine(points, strokeStyle, false, close, vertices, indices);\n context.fillStyle = canvasStyle;\n fillTriangles(context, vertices, indices);\n } else {\n context.strokeStyle = canvasStyle;\n context.beginPath();\n buildShapePath(context, primitive.shape);\n context.stroke();\n }\n } else {\n context.strokeStyle = canvasStyle;\n context.beginPath();\n buildShapePath(context, primitive.shape);\n context.stroke();\n }\n } else {\n context.fillStyle = canvasStyle;\n context.beginPath();\n buildShapePath(context, primitive.shape);\n const hasHoles = addHolePaths(context, primitive.holes);\n if (hasHoles) {\n context.fill(\"evenodd\");\n } else {\n context.fill();\n }\n }\n if (hasTransform) {\n context.restore();\n }\n }\n }\n context.restore();\n }\n destroy() {\n this.shader = null;\n }\n}\n/** @ignore */\nCanvasGraphicsAdaptor.extension = {\n type: [\n ExtensionType.CanvasPipesAdaptor\n ],\n name: \"graphics\"\n};\n\nexport { CanvasGraphicsAdaptor };\n//# sourceMappingURL=CanvasGraphicsAdaptor.mjs.map\n","import { Color } from '../../../../color/Color.mjs';\nimport { DOMAdapter } from '../../../../environment/adapter.mjs';\nimport { CanvasSource } from '../../shared/texture/sources/CanvasSource.mjs';\n\n\"use strict\";\nclass CanvasRenderTargetAdaptor {\n /**\n * Initializes the adaptor.\n * @param renderer - Canvas renderer instance.\n * @param renderTargetSystem - The render target system.\n * @advanced\n */\n init(renderer, renderTargetSystem) {\n this._renderer = renderer;\n this._renderTargetSystem = renderTargetSystem;\n }\n /**\n * Creates a GPU render target for canvas.\n * @param renderTarget - Render target to initialize.\n * @advanced\n */\n initGpuRenderTarget(renderTarget) {\n const colorTexture = renderTarget.colorTexture;\n const { canvas, context } = this._ensureCanvas(colorTexture);\n return {\n canvas,\n context,\n width: canvas.width,\n height: canvas.height\n };\n }\n /**\n * Resizes the backing canvas for a render target.\n * @param renderTarget - Render target to resize.\n * @advanced\n */\n resizeGpuRenderTarget(renderTarget) {\n const colorTexture = renderTarget.colorTexture;\n const { canvas } = this._ensureCanvas(colorTexture);\n canvas.width = renderTarget.pixelWidth;\n canvas.height = renderTarget.pixelHeight;\n }\n /**\n * Starts a render pass on the canvas target.\n * @param renderTarget - Target to render to.\n * @param clear - Clear mode.\n * @param clearColor - Optional clear color.\n * @param viewport - Optional viewport.\n * @advanced\n */\n startRenderPass(renderTarget, clear, clearColor, viewport) {\n const gpuRenderTarget = this._renderTargetSystem.getGpuRenderTarget(renderTarget);\n this._renderer.canvasContext.activeContext = gpuRenderTarget.context;\n this._renderer.canvasContext.activeResolution = renderTarget.resolution;\n if (clear) {\n this.clear(renderTarget, clear, clearColor, viewport);\n }\n }\n /**\n * Clears the render target.\n * @param renderTarget - Target to clear.\n * @param _clear - Clear mode (unused).\n * @param clearColor - Optional clear color.\n * @param viewport - Optional viewport rectangle.\n * @advanced\n */\n clear(renderTarget, _clear, clearColor, viewport) {\n const gpuRenderTarget = this._renderTargetSystem.getGpuRenderTarget(renderTarget);\n const context = gpuRenderTarget.context;\n const bounds = viewport || { x: 0, y: 0, width: renderTarget.pixelWidth, height: renderTarget.pixelHeight };\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.clearRect(bounds.x, bounds.y, bounds.width, bounds.height);\n if (clearColor) {\n const color = Color.shared.setValue(clearColor);\n if (color.alpha > 0) {\n context.globalAlpha = color.alpha;\n context.fillStyle = color.toHex();\n context.fillRect(bounds.x, bounds.y, bounds.width, bounds.height);\n context.globalAlpha = 1;\n }\n }\n }\n /**\n * Finishes the render pass (no-op for canvas).\n * @advanced\n */\n finishRenderPass() {\n }\n /**\n * Copies a render target into a texture source.\n * @param {RenderTarget} sourceRenderSurfaceTexture - Source render target.\n * @param {Texture} destinationTexture - Destination texture.\n * @param {object} originSrc - Source origin.\n * @param {number} originSrc.x - Source x origin.\n * @param {number} originSrc.y - Source y origin.\n * @param {object} size - Copy size.\n * @param {number} size.width - Copy width.\n * @param {number} size.height - Copy height.\n * @param {object} [originDest] - Destination origin.\n * @param {number} originDest.x - Destination x origin.\n * @param {number} originDest.y - Destination y origin.\n * @advanced\n */\n copyToTexture(sourceRenderSurfaceTexture, destinationTexture, originSrc, size, originDest) {\n const sourceGpuTarget = this._renderTargetSystem.getGpuRenderTarget(sourceRenderSurfaceTexture);\n const sourceCanvas = sourceGpuTarget.canvas;\n const destSource = destinationTexture.source;\n const { context } = this._ensureCanvas(destSource);\n const dx = originDest?.x ?? 0;\n const dy = originDest?.y ?? 0;\n context.drawImage(\n sourceCanvas,\n originSrc.x,\n originSrc.y,\n size.width,\n size.height,\n dx,\n dy,\n size.width,\n size.height\n );\n destSource.update();\n return destinationTexture;\n }\n /**\n * Destroys a GPU render target (no-op for canvas).\n * @param _gpuRenderTarget - Target to destroy.\n * @advanced\n */\n destroyGpuRenderTarget(_gpuRenderTarget) {\n }\n _ensureCanvas(source) {\n let canvas = source.resource;\n if (!canvas || !CanvasSource.test(canvas)) {\n canvas = DOMAdapter.get().createCanvas(source.pixelWidth, source.pixelHeight);\n source.resource = canvas;\n }\n if (canvas.width !== source.pixelWidth || canvas.height !== source.pixelHeight) {\n canvas.width = source.pixelWidth;\n canvas.height = source.pixelHeight;\n }\n const context = canvas.getContext(\"2d\");\n return { canvas, context };\n }\n}\n\nexport { CanvasRenderTargetAdaptor };\n//# sourceMappingURL=CanvasRenderTargetAdaptor.mjs.map\n","import { ExtensionType } from '../../../../extensions/Extensions.mjs';\nimport { RenderTargetSystem } from '../../shared/renderTarget/RenderTargetSystem.mjs';\nimport { CanvasRenderTargetAdaptor } from './CanvasRenderTargetAdaptor.mjs';\n\n\"use strict\";\nclass CanvasRenderTargetSystem extends RenderTargetSystem {\n constructor(renderer) {\n super(renderer);\n this.adaptor = new CanvasRenderTargetAdaptor();\n this.adaptor.init(renderer, this);\n }\n}\n/** @ignore */\nCanvasRenderTargetSystem.extension = {\n type: [ExtensionType.CanvasSystem],\n name: \"renderTarget\"\n};\n\nexport { CanvasRenderTargetSystem };\n//# sourceMappingURL=CanvasRenderTargetSystem.mjs.map\n","import { DOMAdapter } from '../../../../environment/adapter.mjs';\nimport { ExtensionType } from '../../../../extensions/Extensions.mjs';\nimport { canvasUtils } from '../utils/canvasUtils.mjs';\n\n\"use strict\";\nclass CanvasTextureSystem {\n /**\n * @param renderer - The owning CanvasRenderer.\n */\n constructor(renderer) {\n void renderer;\n }\n /** Initializes the system (no-op for canvas). */\n init() {\n }\n /**\n * Initializes a texture source (no-op for canvas).\n * @param _source - Texture source.\n */\n initSource(_source) {\n }\n /**\n * Creates a canvas containing the texture's frame.\n * @param texture - Texture to render.\n */\n generateCanvas(texture) {\n const canvas = DOMAdapter.get().createCanvas();\n const context = canvas.getContext(\"2d\");\n const source = canvasUtils.getCanvasSource(texture);\n if (!source) {\n return canvas;\n }\n const frame = texture.frame;\n const resolution = texture.source._resolution ?? texture.source.resolution ?? 1;\n const sx = frame.x * resolution;\n const sy = frame.y * resolution;\n const sw = frame.width * resolution;\n const sh = frame.height * resolution;\n canvas.width = Math.ceil(sw);\n canvas.height = Math.ceil(sh);\n context.drawImage(\n source,\n sx,\n sy,\n sw,\n sh,\n 0,\n 0,\n sw,\n sh\n );\n return canvas;\n }\n /**\n * Reads pixel data from a texture.\n * @param texture - Texture to read.\n */\n getPixels(texture) {\n const canvas = this.generateCanvas(texture);\n const context = canvas.getContext(\"2d\", { willReadFrequently: true });\n const imageData = context.getImageData(0, 0, canvas.width, canvas.height);\n return {\n pixels: imageData.data,\n width: canvas.width,\n height: canvas.height\n };\n }\n /** Destroys the system (no-op for canvas). */\n destroy() {\n }\n}\n/** @ignore */\nCanvasTextureSystem.extension = {\n type: [\n ExtensionType.CanvasSystem\n ],\n name: \"texture\"\n};\n\nexport { CanvasTextureSystem };\n//# sourceMappingURL=CanvasTextureSystem.mjs.map\n","import { extensions, ExtensionType } from '../../../extensions/Extensions.mjs';\nimport { CustomRenderPipe } from '../../../scene/container/CustomRenderPipe.mjs';\nimport { RenderGroupPipe } from '../../../scene/container/RenderGroupPipe.mjs';\nimport { CanvasGraphicsAdaptor } from '../../../scene/graphics/canvas/CanvasGraphicsAdaptor.mjs';\nimport { SpritePipe } from '../../../scene/sprite/SpritePipe.mjs';\nimport { CanvasBatchAdaptor } from '../../batcher/canvas/CanvasBatchAdaptor.mjs';\nimport { BatcherPipe } from '../../batcher/shared/BatcherPipe.mjs';\nimport { AlphaMaskPipe } from '../../mask/alpha/AlphaMaskPipe.mjs';\nimport { CanvasColorMaskPipe } from '../../mask/color/CanvasColorMaskPipe.mjs';\nimport { CanvasStencilMaskPipe } from '../../mask/stencil/CanvasStencilMaskPipe.mjs';\nimport { BlendModePipe } from '../shared/blendModes/BlendModePipe.mjs';\nimport { AbstractRenderer } from '../shared/system/AbstractRenderer.mjs';\nimport { SharedSystems } from '../shared/system/SharedSystems.mjs';\nimport { RendererType } from '../types.mjs';\nimport { CanvasContextSystem } from './CanvasContextSystem.mjs';\nimport { CanvasLimitsSystem } from './CanvasLimitsSystem.mjs';\nimport { CanvasRenderTargetSystem } from './renderTarget/CanvasRenderTargetSystem.mjs';\nimport { CanvasTextureSystem } from './texture/CanvasTextureSystem.mjs';\n\n\"use strict\";\nconst DefaultCanvasSystems = [\n ...SharedSystems,\n CanvasContextSystem,\n CanvasLimitsSystem,\n CanvasTextureSystem,\n CanvasRenderTargetSystem\n];\nconst DefaultCanvasPipes = [\n BlendModePipe,\n BatcherPipe,\n SpritePipe,\n RenderGroupPipe,\n AlphaMaskPipe,\n CanvasStencilMaskPipe,\n CanvasColorMaskPipe,\n CustomRenderPipe\n];\nconst DefaultCanvasAdapters = [\n CanvasBatchAdaptor,\n CanvasGraphicsAdaptor\n];\nconst systems = [];\nconst renderPipes = [];\nconst renderPipeAdaptors = [];\nextensions.handleByNamedList(ExtensionType.CanvasSystem, systems);\nextensions.handleByNamedList(ExtensionType.CanvasPipes, renderPipes);\nextensions.handleByNamedList(ExtensionType.CanvasPipesAdaptor, renderPipeAdaptors);\nextensions.add(...DefaultCanvasSystems, ...DefaultCanvasPipes, ...DefaultCanvasAdapters);\nclass CanvasRenderer extends AbstractRenderer {\n constructor() {\n const systemConfig = {\n name: \"canvas\",\n type: RendererType.CANVAS,\n systems,\n renderPipes,\n renderPipeAdaptors\n };\n super(systemConfig);\n }\n}\n\nexport { CanvasRenderer };\n//# sourceMappingURL=CanvasRenderer.mjs.map\n"],"names":["earcut","data","holeIndices","dim","hasHoles","outerLen","outerNode","linkedList","triangles","minX","minY","invSize","eliminateHoles","maxX","maxY","i","x","y","earcutLinked","start","end","clockwise","last","signedArea","insertNode","equals","removeNode","filterPoints","p","again","area","ear","pass","indexCurve","stop","prev","next","isEarHashed","isEar","cureLocalIntersections","splitEarcut","a","b","c","ax","bx","cx","ay","by","cy","x0","y0","x1","y1","pointInTriangleExceptFirst","minZ","zOrder","maxZ","n","intersects","locallyInside","isValidDiagonal","splitPolygon","queue","len","list","getLeftmost","compareXYSlope","eliminateHole","result","aSlope","bSlope","hole","bridge","findHoleBridge","bridgeReverse","hx","hy","qx","m","mx","my","tanMin","pointInTriangle","tan","sectorContainsSector","sortLinked","numMerges","inSize","e","tail","q","pSize","qSize","leftmost","px","py","intersectsPolygon","middleInside","r","p1","p2","q1","q2","o1","sign","o2","o3","o4","onSegment","num","inside","a2","createNode","b2","an","bp","sum","j","earcutModule","parseSvgPath","parse","length","segment","path","_","command","args","type","parseValues","number","numbers","parseSVGPath","svgPath","commands","subpaths","currentSubPath","lastX","lastY","warn","Circle","radius","r2","dx","dy","width","alignment","outerWidth","distance","out","Rectangle","circle","Ellipse","halfWidth","halfHeight","normx","normy","strokeWidth","strokeOuterWidth","strokeInnerWidth","innerHorizontal","innerVertical","outerHorizontal","outerVertical","normalizedX","normalizedY","innerEllipse","outerEllipse","ellipse","squaredDistanceToLineSegment","x2","y2","d","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","deprecation","isCornerWithinStroke","pX","pY","cornerX","cornerY","strokeWidthInner","strokeWidthOuter","RoundedRectangle","height","rectangle","radius2","innerX","innerY","innerWidth","innerHeight","rightBound","bottomBound","buildUvs","vertices","verticesStride","verticesOffset","uvs","uvsOffset","uvsStride","size","matrix","index","tx","ty","buildSimpleUvs","transformVertices","offset","stride","identityMatrix","Matrix","BatchableGraphics","rgb","bgr","renderable","multiplyHexColors","_a","gpuBuffer","buildCircle","ExtensionType","shape","rx","ry","roundedRect","j1","j2","j3","j4","y22","x02","y02","x12","x22","y12","indices","indicesOffset","centerX","centerY","count","centerIndex","buildEllipse","buildRoundedRectangle","closePointEps","curveEps","getOrientationOfPoints","square","nx","ny","innerWeight","outerWeight","verts","ix","iy","ox","oy","exx","eyy","eix","eiy","eox","eoy","round","sx","sy","ex","ey","cx2p0x","cy2p0y","angle0","angle1","startAngle","angleDiff","absAngleDiff","segCount","angleInc","angle","buildLine","lineStyle","flipAlignment","closed","eps","style","orientation","firstPoint","Point","lastPoint","closedShape","closedPath","midPointX","midPointY","indexCount","indexStart","widthSquared","miterLimitSquared","perpX","perpY","perp1x","perp1y","dist","ratio","dx0","dy0","dx1","dy1","cross","c1","c2","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","uid","options","ensureGradientOptions","definedProps","color","Color","flip","temp","colorStops","defaultSize","canvas","context","getCanvas","gradient","addColorStops","Texture","ImageSource","r0","r1","scale","FillGradient","DOMAdapter","tempTextureMatrix","generateTextureMatrix","textureMatrix","bounds","mTx","mTy","a1","b1","d1","sourceStyle","shapeBuilders","extensions","buildContextBatches","gpuContext","geometryData","batches","instruction","addTextureToGeometryData","isStroke","shapePath","addShapePathToGeometryData","build","rect","indexOffset","vertOffset","texture","textureUvs","graphicsBatch","BigPool","topology","close","otherPoints","getHoleArrays","holePoints","holePrimitives","holeArrays","k","holePrimitive","GpuGraphicsContext","batch","GraphicsContextRenderData","InstructionSet","maxTextures","DefaultBatcher","v8_3_4","_GraphicsContextSystem","renderer","GCManagedHash","hasContext","batchMode","graphicsData","vertexSize","indexSize","batcher","geometry","drawBatches","getTextureBatchBindGroup","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","d2","d3","buildAdaptiveQuadratic","buildArc","steps","f","t","cs","sn","buildArcTo","fromX","mm","dd","cc","tt","k1","k2","qy","endAngle","TAU","mapToEllipse","cosPhi","sinPhi","out2","xp","yp","approxUnitArc","ang1","ang2","vectorAngle","ux","uy","vx","vy","getArcCenter","largeArcFlag","sweepFlag","pxp","pyp","rxSq","rySq","pxpSq","pypSq","radicant","centerXp","centerYp","vx1","vy1","vx2","vy2","buildArcToSvg","xAxisRotation","lambda","segments","outCurvePoint","curve","roundedShapeArc","g","vecFrom","pp","sharpCorner","pRadius","p3","v1","v2","radDirection","drawDirection","halfAngle","cRadius","lenOut","cX","cY","roundedShapeQuadraticCurve","pointLerp","numPoints","thisPoint","nextPoint","lastEdgeLength","lastOffsetDistance","nextEdgeLength","nextOffsetDistance","tempRectangle","ShapePath","graphicsPath2D","Bounds","fromY","counterclockwise","currentPoly","transform","shapePrimitives","mainShape","shapePrimitive","mainPolygon","w","h","sides","rotation","delta","corner","sideLength","internalAngle","useQuadratic","fillet","maxFillet","inset","right","bottom","dir","chamfer","radiusX","radiusY","lastShape","tempX","boundsRect","GraphicsPath","instructions","signed","currentX","currentY","cpx1","cpy1","innerRadius","deep","newGraphicsPath2D","cpx2","cpy2","adjustTransform","lastInstruction","currentMatrix","parseSVGFloatAttribute","svg","id","defaultValue","value","parseSVGDefinitions","session","definitions","definition","child","parseLinearGradient","parseRadialGradient","gradientUnit","_child","extractSvgUrlId","url","match","styleAttributes","parseSVGStyle","strokeStyle","fillStyle","key","attribute","parseAttribute","styleParts","stylePart","id2","checkForNestedPattern","subpathsWithArea","areas","s","largestArea","secondArea","smallestArea","largestToSecondRatio","secondToSmallestRatio","extractSubpaths","pathData","part","calculatePathArea","coords","xs","ys","appendSVGPath","graphicsPath","tempPath","SVGParser","graphicsContext","div","children","renderChildren","f1","s1","noStyle","pointsString","fillRule","hasExplicitEvenodd","hasMultipleSubpaths","subpath","isMainShape","newPath","isHole","useEvenoddForGraphicsPath","repetitionMap","FillPattern","repetition","isColorLike","isFillPattern","isFillGradient","isTexture","handleColorLike","fill","defaultStyle","handleTexture","handleFillPattern","handleFillGradient","handleFillObject","toFillStyle","objectStyle","toStrokeStyle","miterLimit","cap","join","pixelLine","rest","getMaxMiterRatio","maxRatio","prevIdx","nextIdx","len0Sq","len1Sq","clampedCos","sinHalfAngle","miterRatio","tmpPoint","tempMatrix","_GraphicsContext","EventEmitter","clone","tint","dw","dh","alpha","v8_0_0","holePath","transformedX","transformedY","cpx","cpy","state","action","outerPadding","_bounds","point","hasHit","shapes","transformedPoint","holeShapes","destroyTextureSource","GraphicsContext","CanvasGraphicsContext","CanvasGraphicsContextRenderData","_CanvasGraphicsContextSystem","gpuData","renderData","CanvasGraphicsContextSystem","CanvasGraphicsPipe","adaptor","State","_graphics","graphics","instructionSet","GraphicsGpuData","GraphicsPipe","wasBatched","shader","localUniforms","color32BitToUniform","batchPipe","roundPixels","batchClone","Graphics","ViewContainer","now","method","canUseNewCanvasBlendModesValue","createColoredCanvas","canUseNewCanvasBlendModes","magenta","yellow","imageData","canvasUtils","source","resource","isPMA","resourceWidth","resourceHeight","needsResize","cached","bytes","alphaInv","sprite","stringColor","cache","cachedCanvas","resourceId","pattern","invert","patternAny","DOMMatrixCtor","domMatrix","crop","resolution","rotate","isVertical","groupD8","outWidth","outHeight","srcWidth","srcHeight","inv","_CanvasBatchAdaptor","addressModeU","addressModeV","repeatU","repeatV","elements","contextSystem","element","quad","textureStyle","smoothProperty","shouldSmooth","globalColor","argb","globalAlpha","quadAlpha","filterAlpha","_b","globalTint","quadTint","bgr2rgb","frame","repeat","isFromCachedRenderGroup","_d","_c","sw","sh","isRootTarget","uvMin","uvMax","needsRepeat","applyRotateTransform","drawX","drawY","drawW","drawH","patternSource","canTint","fitsFrame","denomX","denomY","invDx","invDy","pixelWidth","pixelHeight","processedSource","isProcessed","CanvasBatchAdaptor","CanvasColorMaskPipe","mask","_container","colorStack","currentColor","_mask","_instruction","buildRoundedRectPath","buildShapePath","tri","poly","addHolePaths","hasTransform","CanvasStencilMaskPipe","canvasRenderer","maskContainer","drewPath","instructionData","primitive","message","FALLBACK_BLEND","mapCanvasBlendModesToPixi","supportsAdvanced","map","CanvasContextSystem","rc","localResolution","skipGlobalTransform","globalTransform","mat","proj","contextResolution","finalMat","clearColor","blendMode","mappedBlend","CanvasLimitsSystem","emptyCanvasStyle","tempGradientMatrix","tempPatternMatrix","fillTriangles","i0","i1","i2","colorToHex","getCanvasStyle","currentTransform","gradientTexture","patternMatrix","CanvasGraphicsAdaptor","graphicsPipe","baseTransform","groupColorAlpha","groupAlphaValue","groupAlpha","groupTintBGR","groupTint","data2","alpha2","tint2","drawSource","_g","_f","_e","hasTexture","textureTransform","canvasStyle","shapeBuilder","CanvasRenderTargetAdaptor","renderTargetSystem","renderTarget","colorTexture","clear","viewport","gpuRenderTarget","_clear","sourceRenderSurfaceTexture","destinationTexture","originSrc","originDest","sourceCanvas","destSource","_gpuRenderTarget","CanvasSource","CanvasRenderTargetSystem","RenderTargetSystem","CanvasTextureSystem","_source","DefaultCanvasSystems","SharedSystems","DefaultCanvasPipes","BlendModePipe","BatcherPipe","SpritePipe","RenderGroupPipe","AlphaMaskPipe","CustomRenderPipe","DefaultCanvasAdapters","systems","renderPipes","renderPipeAdaptors","CanvasRenderer","AbstractRenderer","systemConfig","RendererType"],"mappings":";;;;AACe,SAASA,GAAOC,GAAMC,GAAaC,IAAM,GAAG;AAEvD,QAAMC,IAAWF,KAAeA,EAAY,QACtCG,IAAWD,IAAWF,EAAY,CAAC,IAAIC,IAAMF,EAAK;AACxD,MAAIK,IAAYC,GAAWN,GAAM,GAAGI,GAAUF,GAAK,EAAI;AACvD,QA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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]}
|