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ErD,EAAG,UAAU,eAAe,eAAgB,GAC5C,WAAW,OAAS,EACpB,WAAW,aAAe,CAC5B,CACA,OA9kBoB,EA8kBA,EAtlBF,EAAC,EAAI,EAAM,EAAQ,KACnC,GAAI,GAAwB,iBAAT,GAAqC,mBAAT,EAC7C,IAAK,IAAI,KAAO,EAAkB,GAC3B,EAAa,KAAK,EAAI,IAAQ,IAAQ,GACzC,EAAU,EAAI,EAAK,CAAE,IAAK,IAAM,EAAK,GAAM,aAAc,EAAO,EAAiB,EAAM,KAAS,EAAK,aAE3G,OAAO,CAAE,EAEiB,CAAY,EAAU,CAAC,EAAG,aAAc,CAAE,OAAO,IAAS,EA+kBvF,EAjmBY,EAkmBE","file":"/npm/poline@0.13.0/dist/index.umd.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/poline@0.13.0/dist/index.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function(root, factory) {\n      if (typeof define === 'function' && define.amd) {\n      \tdefine([], factory);\n      } else if (typeof module === 'object' && module.exports) {\n      \tmodule.exports = factory();\n      } else {\n      \troot.poline = factory();\n      }\n    }\n    (typeof self !== 'undefined' ? self : this, function() {\n\"use strict\";\nvar poline = (() => {\n  var __defProp = Object.defineProperty;\n  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n  var __getOwnPropNames = Object.getOwnPropertyNames;\n  var __hasOwnProp = Object.prototype.hasOwnProperty;\n  var __pow = Math.pow;\n  var __export = (target, all) => {\n    for (var name in all)\n      __defProp(target, name, { get: all[name], enumerable: true });\n  };\n  var __copyProps = (to, from, except, desc) => {\n    if (from && typeof from === \"object\" || typeof from === \"function\") {\n      for (let key of __getOwnPropNames(from))\n        if (!__hasOwnProp.call(to, key) && key !== except)\n          __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n    }\n    return to;\n  };\n  var __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n  // src/index.ts\n  var src_exports = {};\n  __export(src_exports, {\n    ColorPoint: () => ColorPoint,\n    Poline: () => Poline,\n    hslToPoint: () => hslToPoint,\n    pointToHSL: () => pointToHSL,\n    positionFunctions: () => positionFunctions,\n    randomHSLPair: () => randomHSLPair,\n    randomHSLTriple: () => randomHSLTriple\n  });\n  var pointToHSL = (xyz, invertedLightness) => {\n    const [x, y, z] = xyz;\n    const cx = 0.5;\n    const cy = 0.5;\n    const radians = Math.atan2(y - cy, x - cx);\n    let deg = radians * (180 / Math.PI);\n    deg = (360 + deg) % 360;\n    const s = z;\n    const dist = Math.sqrt(Math.pow(y - cy, 2) + Math.pow(x - cx, 2));\n    const l = dist / cx;\n    return [deg, s, invertedLightness ? 1 - l : l];\n  };\n  var hslToPoint = (hsl, invertedLightness) => {\n    const [h, s, l] = hsl;\n    const cx = 0.5;\n    const cy = 0.5;\n    const radians = h / (180 / Math.PI);\n    const dist = (invertedLightness ? 1 - l : l) * cx;\n    const x = cx + dist * Math.cos(radians);\n    const y = cy + dist * Math.sin(radians);\n    const z = s;\n    return [x, y, z];\n  };\n  var randomHSLPair = (startHue = Math.random() * 360, saturations = [Math.random(), Math.random()], lightnesses = [0.75 + Math.random() * 0.2, 0.3 + Math.random() * 0.2]) => [\n    [startHue, saturations[0], lightnesses[0]],\n    [(startHue + 60 + Math.random() * 180) % 360, saturations[1], lightnesses[1]]\n  ];\n  var randomHSLTriple = (startHue = Math.random() * 360, saturations = [Math.random(), Math.random(), Math.random()], lightnesses = [\n    0.75 + Math.random() * 0.2,\n    Math.random() * 0.2,\n    0.75 + Math.random() * 0.2\n  ]) => [\n    [startHue, saturations[0], lightnesses[0]],\n    [(startHue + 60 + Math.random() * 180) % 360, saturations[1], lightnesses[1]],\n    [(startHue + 60 + Math.random() * 180) % 360, saturations[2], lightnesses[2]]\n  ];\n  var vectorOnLine = (t, p1, p2, invert = false, fx = (t2, invert2) => invert2 ? 1 - t2 : t2, fy = (t2, invert2) => invert2 ? 1 - t2 : t2, fz = (t2, invert2) => invert2 ? 1 - t2 : t2) => {\n    const tModifiedX = fx(t, invert);\n    const tModifiedY = fy(t, invert);\n    const tModifiedZ = fz(t, invert);\n    const x = (1 - tModifiedX) * p1[0] + tModifiedX * p2[0];\n    const y = (1 - tModifiedY) * p1[1] + tModifiedY * p2[1];\n    const z = (1 - tModifiedZ) * p1[2] + tModifiedZ * p2[2];\n    return [x, y, z];\n  };\n  var vectorsOnLine = (p1, p2, numPoints = 4, invert = false, fx = (t, invert2) => invert2 ? 1 - t : t, fy = (t, invert2) => invert2 ? 1 - t : t, fz = (t, invert2) => invert2 ? 1 - t : t) => {\n    const points = [];\n    for (let i = 0; i < numPoints; i++) {\n      const [x, y, z] = vectorOnLine(\n        i / (numPoints - 1),\n        p1,\n        p2,\n        invert,\n        fx,\n        fy,\n        fz\n      );\n      points.push([x, y, z]);\n    }\n    return points;\n  };\n  var linearPosition = (t) => {\n    return t;\n  };\n  var exponentialPosition = (t, reverse = false) => {\n    if (reverse) {\n      return 1 - __pow(1 - t, 2);\n    }\n    return __pow(t, 2);\n  };\n  var quadraticPosition = (t, reverse = false) => {\n    if (reverse) {\n      return 1 - __pow(1 - t, 3);\n    }\n    return __pow(t, 3);\n  };\n  var cubicPosition = (t, reverse = false) => {\n    if (reverse) {\n      return 1 - __pow(1 - t, 4);\n    }\n    return __pow(t, 4);\n  };\n  var quarticPosition = (t, reverse = false) => {\n    if (reverse) {\n      return 1 - __pow(1 - t, 5);\n    }\n    return __pow(t, 5);\n  };\n  var sinusoidalPosition = (t, reverse = false) => {\n    if (reverse) {\n      return 1 - Math.sin((1 - t) * Math.PI / 2);\n    }\n    return Math.sin(t * Math.PI / 2);\n  };\n  var asinusoidalPosition = (t, reverse = false) => {\n    if (reverse) {\n      return 1 - Math.asin(1 - t) / (Math.PI / 2);\n    }\n    return Math.asin(t) / (Math.PI / 2);\n  };\n  var arcPosition = (t, reverse = false) => {\n    if (reverse) {\n      return 1 - Math.sqrt(1 - __pow(t, 2));\n    }\n    return 1 - Math.sqrt(1 - t);\n  };\n  var smoothStepPosition = (t) => {\n    return __pow(t, 2) * (3 - 2 * t);\n  };\n  var positionFunctions = {\n    linearPosition,\n    exponentialPosition,\n    quadraticPosition,\n    cubicPosition,\n    quarticPosition,\n    sinusoidalPosition,\n    asinusoidalPosition,\n    arcPosition,\n    smoothStepPosition\n  };\n  var distance = (p1, p2, hueMode = false) => {\n    const a1 = p1[0];\n    const a2 = p2[0];\n    let diffA = 0;\n    if (hueMode && a1 !== null && a2 !== null) {\n      diffA = Math.min(Math.abs(a1 - a2), 360 - Math.abs(a1 - a2));\n      diffA = diffA / 360;\n    } else {\n      diffA = a1 === null || a2 === null ? 0 : a1 - a2;\n    }\n    const a = diffA;\n    const b = p1[1] === null || p2[1] === null ? 0 : p2[1] - p1[1];\n    const c = p1[2] === null || p2[2] === null ? 0 : p2[2] - p1[2];\n    return Math.sqrt(a * a + b * b + c * c);\n  };\n  var ColorPoint = class {\n    constructor({\n      xyz,\n      color,\n      invertedLightness = false\n    } = {}) {\n      this.x = 0;\n      this.y = 0;\n      this.z = 0;\n      this.color = [0, 0, 0];\n      this._invertedLightness = false;\n      this._invertedLightness = invertedLightness;\n      this.positionOrColor({ xyz, color, invertedLightness });\n    }\n    positionOrColor({\n      xyz,\n      color,\n      invertedLightness = false\n    }) {\n      this._invertedLightness = invertedLightness;\n      if (xyz && color || !xyz && !color) {\n        throw new Error(\"Point must be initialized with either x,y,z or hsl\");\n      } else if (xyz) {\n        this.x = xyz[0];\n        this.y = xyz[1];\n        this.z = xyz[2];\n        this.color = pointToHSL([this.x, this.y, this.z], invertedLightness);\n      } else if (color) {\n        this.color = color;\n        [this.x, this.y, this.z] = hslToPoint(color, invertedLightness);\n      }\n    }\n    set position([x, y, z]) {\n      this.x = x;\n      this.y = y;\n      this.z = z;\n      this.color = pointToHSL(\n        [this.x, this.y, this.z],\n        this._invertedLightness\n      );\n    }\n    get position() {\n      return [this.x, this.y, this.z];\n    }\n    set hsl([h, s, l]) {\n      this.color = [h, s, l];\n      [this.x, this.y, this.z] = hslToPoint(\n        this.color,\n        this._invertedLightness\n      );\n    }\n    get hsl() {\n      return this.color;\n    }\n    get hslCSS() {\n      const [h, s, l] = this.color;\n      return `hsl(${h.toFixed(2)}, ${(s * 100).toFixed(2)}%, ${(l * 100).toFixed(\n        2\n      )}%)`;\n    }\n    get oklchCSS() {\n      const [h, s, l] = this.color;\n      return `oklch(${(l * 100).toFixed(2)}% ${(s * 0.4).toFixed(3)} ${h.toFixed(\n        2\n      )})`;\n    }\n    get lchCSS() {\n      const [h, s, l] = this.color;\n      return `lch(${(l * 100).toFixed(2)}% ${(s * 150).toFixed(2)} ${h.toFixed(\n        2\n      )})`;\n    }\n    set invertedLightness(val) {\n      this._invertedLightness = val;\n      this.color = pointToHSL(\n        [this.x, this.y, this.z],\n        this._invertedLightness\n      );\n    }\n    get invertedLightness() {\n      return this._invertedLightness;\n    }\n    shiftHue(angle) {\n      this.color[0] = (360 + (this.color[0] + angle)) % 360;\n      [this.x, this.y, this.z] = hslToPoint(\n        this.color,\n        this._invertedLightness\n      );\n    }\n  };\n  var Poline = class {\n    constructor({\n      anchorColors = randomHSLPair(),\n      numPoints = 4,\n      positionFunction = sinusoidalPosition,\n      positionFunctionX,\n      positionFunctionY,\n      positionFunctionZ,\n      closedLoop,\n      invertedLightness\n    } = {\n      anchorColors: randomHSLPair(),\n      numPoints: 4,\n      positionFunction: sinusoidalPosition,\n      closedLoop: false\n    }) {\n      this._positionFunctionX = sinusoidalPosition;\n      this._positionFunctionY = sinusoidalPosition;\n      this._positionFunctionZ = sinusoidalPosition;\n      this.connectLastAndFirstAnchor = false;\n      this._animationFrame = null;\n      this._invertedLightness = false;\n      if (!anchorColors || anchorColors.length < 2) {\n        throw new Error(\"Must have at least two anchor colors\");\n      }\n      this._anchorPoints = anchorColors.map(\n        (point) => new ColorPoint({ color: point, invertedLightness })\n      );\n      this._numPoints = numPoints + 2;\n      this._positionFunctionX = positionFunctionX || positionFunction || sinusoidalPosition;\n      this._positionFunctionY = positionFunctionY || positionFunction || sinusoidalPosition;\n      this._positionFunctionZ = positionFunctionZ || positionFunction || sinusoidalPosition;\n      this.connectLastAndFirstAnchor = closedLoop || false;\n      this._invertedLightness = invertedLightness || false;\n      this.updateAnchorPairs();\n    }\n    get numPoints() {\n      return this._numPoints - 2;\n    }\n    set numPoints(numPoints) {\n      if (numPoints < 1) {\n        throw new Error(\"Must have at least one point\");\n      }\n      this._numPoints = numPoints + 2;\n      this.updateAnchorPairs();\n    }\n    set positionFunction(positionFunction) {\n      if (Array.isArray(positionFunction)) {\n        if (positionFunction.length !== 3) {\n          throw new Error(\"Position function array must have 3 elements\");\n        }\n        if (typeof positionFunction[0] !== \"function\" || typeof positionFunction[1] !== \"function\" || typeof positionFunction[2] !== \"function\") {\n          throw new Error(\"Position function array must have 3 functions\");\n        }\n        this._positionFunctionX = positionFunction[0];\n        this._positionFunctionY = positionFunction[1];\n        this._positionFunctionZ = positionFunction[2];\n      } else {\n        this._positionFunctionX = positionFunction;\n        this._positionFunctionY = positionFunction;\n        this._positionFunctionZ = positionFunction;\n      }\n      this.updateAnchorPairs();\n    }\n    get positionFunction() {\n      if (this._positionFunctionX === this._positionFunctionY && this._positionFunctionX === this._positionFunctionZ) {\n        return this._positionFunctionX;\n      }\n      return [\n        this._positionFunctionX,\n        this._positionFunctionY,\n        this._positionFunctionZ\n      ];\n    }\n    set positionFunctionX(positionFunctionX) {\n      this._positionFunctionX = positionFunctionX;\n      this.updateAnchorPairs();\n    }\n    get positionFunctionX() {\n      return this._positionFunctionX;\n    }\n    set positionFunctionY(positionFunctionY) {\n      this._positionFunctionY = positionFunctionY;\n      this.updateAnchorPairs();\n    }\n    get positionFunctionY() {\n      return this._positionFunctionY;\n    }\n    set positionFunctionZ(positionFunctionZ) {\n      this._positionFunctionZ = positionFunctionZ;\n      this.updateAnchorPairs();\n    }\n    get positionFunctionZ() {\n      return this._positionFunctionZ;\n    }\n    get anchorPoints() {\n      return this._anchorPoints;\n    }\n    set anchorPoints(anchorPoints) {\n      this._anchorPoints = anchorPoints;\n      this.updateAnchorPairs();\n    }\n    updateAnchorPairs() {\n      this._anchorPairs = [];\n      const anchorPointsLength = this.connectLastAndFirstAnchor ? this.anchorPoints.length : this.anchorPoints.length - 1;\n      for (let i = 0; i < anchorPointsLength; i++) {\n        const pair = [\n          this.anchorPoints[i],\n          this.anchorPoints[(i + 1) % this.anchorPoints.length]\n        ];\n        this._anchorPairs.push(pair);\n      }\n      this.points = this._anchorPairs.map((pair, i) => {\n        const p1position = pair[0] ? pair[0].position : [0, 0, 0];\n        const p2position = pair[1] ? pair[1].position : [0, 0, 0];\n        const shouldInvertEase = this.shouldInvertEaseForSegment(i);\n        return vectorsOnLine(\n          p1position,\n          p2position,\n          this._numPoints,\n          shouldInvertEase ? true : false,\n          this.positionFunctionX,\n          this.positionFunctionY,\n          this.positionFunctionZ\n        ).map(\n          (p) => new ColorPoint({ xyz: p, invertedLightness: this._invertedLightness })\n        );\n      });\n    }\n    addAnchorPoint({\n      xyz,\n      color,\n      insertAtIndex\n    }) {\n      const newAnchor = new ColorPoint({\n        xyz,\n        color,\n        invertedLightness: this._invertedLightness\n      });\n      if (insertAtIndex !== void 0) {\n        this.anchorPoints.splice(insertAtIndex, 0, newAnchor);\n      } else {\n        this.anchorPoints.push(newAnchor);\n      }\n      this.updateAnchorPairs();\n      return newAnchor;\n    }\n    removeAnchorPoint({\n      point,\n      index\n    }) {\n      if (!point && index === void 0) {\n        throw new Error(\"Must provide a point or index\");\n      }\n      if (this.anchorPoints.length < 3) {\n        throw new Error(\"Must have at least two anchor points\");\n      }\n      let apid;\n      if (index !== void 0) {\n        apid = index;\n      } else if (point) {\n        apid = this.anchorPoints.indexOf(point);\n      }\n      if (apid > -1 && apid < this.anchorPoints.length) {\n        this.anchorPoints.splice(apid, 1);\n        this.updateAnchorPairs();\n      } else {\n        throw new Error(\"Point not found\");\n      }\n    }\n    updateAnchorPoint({\n      point,\n      pointIndex,\n      xyz,\n      color\n    }) {\n      if (pointIndex !== void 0) {\n        point = this.anchorPoints[pointIndex];\n      }\n      if (!point) {\n        throw new Error(\"Must provide a point or pointIndex\");\n      }\n      if (!xyz && !color) {\n        throw new Error(\"Must provide a new xyz position or color\");\n      }\n      if (xyz)\n        point.position = xyz;\n      if (color)\n        point.hsl = color;\n      this.updateAnchorPairs();\n      return point;\n    }\n    getClosestAnchorPoint({\n      xyz,\n      hsl,\n      maxDistance = 1\n    }) {\n      if (!xyz && !hsl) {\n        throw new Error(\"Must provide a xyz or hsl\");\n      }\n      let distances;\n      if (xyz) {\n        distances = this.anchorPoints.map(\n          (anchor) => distance(anchor.position, xyz)\n        );\n      } else if (hsl) {\n        distances = this.anchorPoints.map(\n          (anchor) => distance(anchor.hsl, hsl, true)\n        );\n      }\n      const minDistance = Math.min(...distances);\n      if (minDistance > maxDistance) {\n        return null;\n      }\n      const closestAnchorIndex = distances.indexOf(minDistance);\n      return this.anchorPoints[closestAnchorIndex] || null;\n    }\n    set closedLoop(newStatus) {\n      this.connectLastAndFirstAnchor = newStatus;\n      this.updateAnchorPairs();\n    }\n    get closedLoop() {\n      return this.connectLastAndFirstAnchor;\n    }\n    set invertedLightness(newStatus) {\n      this._invertedLightness = newStatus;\n      this.anchorPoints.forEach((p) => p.invertedLightness = newStatus);\n      this.updateAnchorPairs();\n    }\n    get invertedLightness() {\n      return this._invertedLightness;\n    }\n    /**\n     * Returns a flattened array of all points across all segments,\n     * removing duplicated anchor points at segment boundaries.\n     *\n     * Since anchor points exist at both the end of one segment and\n     * the beginning of the next, this method keeps only one instance of each.\n     * The filter logic keeps the first point (index 0) and then filters out\n     * points whose indices are multiples of the segment size (_numPoints),\n     * which are the anchor points at the start of each segment (except the first).\n     *\n     * This approach ensures we get all unique points in the correct order\n     * while avoiding duplicated anchor points.\n     *\n     * @returns {ColorPoint[]} A flat array of unique ColorPoint instances\n     */\n    get flattenedPoints() {\n      return this.points.flat().filter((p, i) => i != 0 ? i % this._numPoints : true);\n    }\n    get colors() {\n      const colors = this.flattenedPoints.map((p) => p.color);\n      if (this.connectLastAndFirstAnchor && this._anchorPoints.length !== 2) {\n        colors.pop();\n      }\n      return colors;\n    }\n    cssColors(mode = \"hsl\") {\n      const methods = {\n        hsl: (p) => p.hslCSS,\n        oklch: (p) => p.oklchCSS,\n        lch: (p) => p.lchCSS\n      };\n      const cssColors = this.flattenedPoints.map(methods[mode]);\n      if (this.connectLastAndFirstAnchor) {\n        cssColors.pop();\n      }\n      return cssColors;\n    }\n    get colorsCSS() {\n      return this.cssColors(\"hsl\");\n    }\n    get colorsCSSlch() {\n      return this.cssColors(\"lch\");\n    }\n    get colorsCSSoklch() {\n      return this.cssColors(\"oklch\");\n    }\n    shiftHue(hShift = 20) {\n      this.anchorPoints.forEach((p) => p.shiftHue(hShift));\n      this.updateAnchorPairs();\n    }\n    /**\n     * Returns a color at a specific position along the entire color line (0-1)\n     * Treats all segments as one continuous path, respecting easing functions\n     * @param t Position along the line (0-1), where 0 is start and 1 is end\n     * @returns ColorPoint at the specified position\n     * @example\n     * getColorAt(0) // Returns color at the very beginning\n     * getColorAt(0.5) // Returns color at the middle of the entire journey\n     * getColorAt(1) // Returns color at the very end\n     */\n    getColorAt(t) {\n      var _a;\n      if (t < 0 || t > 1) {\n        throw new Error(\"Position must be between 0 and 1\");\n      }\n      if (this.anchorPoints.length === 0) {\n        throw new Error(\"No anchor points available\");\n      }\n      const totalSegments = this.connectLastAndFirstAnchor ? this.anchorPoints.length : this.anchorPoints.length - 1;\n      const effectiveSegments = this.connectLastAndFirstAnchor && this.anchorPoints.length === 2 ? 2 : totalSegments;\n      const segmentPosition = t * effectiveSegments;\n      const segmentIndex = Math.floor(segmentPosition);\n      const localT = segmentPosition - segmentIndex;\n      const actualSegmentIndex = segmentIndex >= effectiveSegments ? effectiveSegments - 1 : segmentIndex;\n      const actualLocalT = segmentIndex >= effectiveSegments ? 1 : localT;\n      const pair = this._anchorPairs[actualSegmentIndex];\n      if (!pair || pair.length < 2 || !pair[0] || !pair[1]) {\n        return new ColorPoint({\n          color: ((_a = this.anchorPoints[0]) == null ? void 0 : _a.color) || [0, 0, 0],\n          invertedLightness: this._invertedLightness\n        });\n      }\n      const p1position = pair[0].position;\n      const p2position = pair[1].position;\n      const shouldInvertEase = this.shouldInvertEaseForSegment(actualSegmentIndex);\n      const xyz = vectorOnLine(\n        actualLocalT,\n        p1position,\n        p2position,\n        shouldInvertEase,\n        this._positionFunctionX,\n        this._positionFunctionY,\n        this._positionFunctionZ\n      );\n      return new ColorPoint({\n        xyz,\n        invertedLightness: this._invertedLightness\n      });\n    }\n    /**\n     * Determines whether easing should be inverted for a given segment\n     * @param segmentIndex The index of the segment\n     * @returns Whether easing should be inverted\n     */\n    shouldInvertEaseForSegment(segmentIndex) {\n      return !!(segmentIndex % 2 || this.connectLastAndFirstAnchor && this.anchorPoints.length === 2 && segmentIndex === 0);\n    }\n  };\n  var { p5 } = globalThis;\n  if (p5 && p5.VERSION && p5.VERSION.startsWith(\"1.\")) {\n    console.info(\"p5 < 1.x detected, adding poline to p5 prototype\");\n    const poline = new Poline();\n    p5.prototype.poline = poline;\n    const polineColors = () => poline.colors.map(\n      (c) => `hsl(${Math.round(c[0])},${c[1] * 100}%,${c[2] * 100}%)`\n    );\n    p5.prototype.registerMethod(\"polineColors\", polineColors);\n    globalThis.poline = poline;\n    globalThis.polineColors = polineColors;\n  }\n  return __toCommonJS(src_exports);\n})();\nreturn poline; }));\n"]}