diff --git a/README.md b/README.md index dfc71a2d..4455ce2a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Welcome to the Scrawl-canvas Library -Version: `8.13.0 - 27 April 2024` +Version: `8.13.1 - 3 May 2024` Scrawl-canvas website: [scrawl-v8.rikweb.org.uk](https://scrawl-v8.rikweb.org.uk). + learning materials: [scrawl-v8.rikweb.org.uk/learn](https://scrawl-v8.rikweb.org.uk/learn). @@ -58,7 +58,7 @@ There are three main ways to include Scrawl-canvas in your project: 2. Unzip the file to a folder in your project. 3. Import the library into the script code where you will be using it. -Alternatively, a zip package of the v8.13.0 files can be downloaded from this link: [scrawl.rikweb.org.uk/downloads/scrawl-canvas_8-13-0.zip](https://scrawl.rikweb.org.uk/downloads/scrawl-canvas_8-13-0.zip) - that package only includes the minified file. +Alternatively, a zip package of the v8.13.1 files can be downloaded from this link: [scrawl.rikweb.org.uk/downloads/scrawl-canvas_8-13-1.zip](https://scrawl.rikweb.org.uk/downloads/scrawl-canvas_8-13-1.zip) - that package only includes the minified file. ```html @@ -102,7 +102,7 @@ Alternatively, a zip package of the v8.13.0 files can be downloaded from this li This will pull the requested npm package directly into your web page: ```html ``` diff --git a/demo/canvas-001.js b/demo/canvas-001.js index 9ddcbed5..7ca34dfa 100644 --- a/demo/canvas-001.js +++ b/demo/canvas-001.js @@ -215,5 +215,5 @@ console.log('canvas.get(\'baseGroup\')', canvas.get('baseGroup')); console.log('canvas.base.get(\'group\')', canvas.base.get('group')); // Kill, and packet, functionality tests -killArtefact(canvas, name('block-fill'), 4000); -killArtefact(canvas, name('wheel-fillAndDraw'), 6000); +killArtefact(scrawl, canvas, name('block-fill'), 4000); +killArtefact(scrawl, canvas, name('wheel-fillAndDraw'), 6000); diff --git a/demo/canvas-002.js b/demo/canvas-002.js index 5658713e..fc15d0d4 100644 --- a/demo/canvas-002.js +++ b/demo/canvas-002.js @@ -252,7 +252,7 @@ console.log(scrawl.library); console.log('Performing tests ...'); -killArtefact(canvas, name('mouse-pivot'), 4000, () => { +killArtefact(scrawl, canvas, name('mouse-pivot'), 4000, () => { myPivot = scrawl.findEntity(name('mouse-pivot')); @@ -267,4 +267,4 @@ killArtefact(canvas, name('mouse-pivot'), 4000, () => { }); }); -killArtefact(canvas, name('mimic-block'), 6000); +killArtefact(scrawl, canvas, name('mimic-block'), 6000); diff --git a/demo/canvas-003.js b/demo/canvas-003.js index e9d7739f..125e5e8f 100644 --- a/demo/canvas-003.js +++ b/demo/canvas-003.js @@ -186,7 +186,7 @@ console.log(scrawl.library); console.log('Performing tests ...'); -killStyle(canvas, name('mygradient'), 3000, () => { +killStyle(scrawl, canvas, name('mygradient'), 3000, () => { // Repopulate the graddy variable /** @ts-expect-error */ diff --git a/demo/canvas-009.js b/demo/canvas-009.js index 33ded274..4178e462 100644 --- a/demo/canvas-009.js +++ b/demo/canvas-009.js @@ -308,7 +308,7 @@ console.log(scrawl.library); console.log('Performing tests ...'); // We use the __canvas__ and __myTracker__ variables in our blocks' onEnter, onLeave and onUp functions. While this works fine for the blocks created in the scope of this module file's code, it will fail when we kill and resurrect a block - in the resurrected block the canvas and myTracker variables will be 'undefined'. So we need to reset the block's 'on...' functions (in this module file's code) after the block has resurrected -killArtefactAndAnchor(canvas, name('brick-in-marble'), 'wikipedia-brick-link', 2000, () => { +killArtefactAndAnchor(scrawl, canvas, name('brick-in-marble'), 'wikipedia-brick-link', 2000, () => { scrawl.findArtefact(name('brick-in-marble')).set({ @@ -342,7 +342,7 @@ killArtefactAndAnchor(canvas, name('brick-in-marble'), 'wikipedia-brick-link', 2 }); }); -killStyle(canvas, name('marble-pattern'), 3000, () => { +killStyle(scrawl, canvas, name('marble-pattern'), 3000, () => { // Reset entitys, whose fill/strokeStyles will have been set to default values when the Pattern died scrawl.findEntity(name('brick-in-marble')).set({ diff --git a/demo/canvas-011.js b/demo/canvas-011.js index 56fa74f2..97be9ede 100644 --- a/demo/canvas-011.js +++ b/demo/canvas-011.js @@ -467,5 +467,5 @@ scrawl.makeRender({ console.log(scrawl.library); console.log('Performing tests ...'); -killArtefact(canvas, name('japan_fill'), 4000); -killArtefact(canvas, name('japan_fillAndDraw'), 6000); +killArtefact(scrawl, canvas, name('japan_fill'), 4000); +killArtefact(scrawl, canvas, name('japan_fillAndDraw'), 6000); diff --git a/demo/canvas-012.js b/demo/canvas-012.js index b0d3f0cb..548675b0 100644 --- a/demo/canvas-012.js +++ b/demo/canvas-012.js @@ -12,10 +12,6 @@ const canvas = scrawl.findCanvas('mycanvas'); // Namespacing boilerplate -// + We don't need to give SC objects a `name` attribute - it's just a lot more convenient if we do. -// + In particular, namespacing SC objects names helps make clearing them up after we've finished with them a lot easier! -// + For this test demo, we forgo names and namespaces to make sure things still get generated and lodged in the library - const namespace = canvas.name; const name = (n) => `${namespace}-${n}`; @@ -93,6 +89,7 @@ const myWheel = scrawl.makeWheel({ path: arrow, pathPosition: 0, + constantSpeedAlongPath: true, addPathRotation: true, lockTo: 'path', diff --git a/demo/canvas-014.js b/demo/canvas-014.js index e2378ad8..d28c7dd5 100644 --- a/demo/canvas-014.js +++ b/demo/canvas-014.js @@ -144,6 +144,8 @@ scrawl.makeLine({ endPathPosition: 0, endLockTo: 'path', + constantSpeedAlongPath: true, + lineWidth: 5, lineCap: 'round', strokeStyle: 'black', @@ -308,7 +310,7 @@ console.log(scrawl.library); console.log('Performing tests ...'); -killArtefact(canvas, name('pin-1'), 2000, () => { +killArtefact(scrawl, canvas, name('pin-1'), 2000, () => { pins.addArtefacts(name('pin-1')); @@ -318,7 +320,7 @@ killArtefact(canvas, name('pin-1'), 2000, () => { }); }); -killArtefact(canvas, name('pin-5'), 3000, () => { +killArtefact(scrawl, canvas, name('pin-5'), 3000, () => { pins.addArtefacts(name('pin-5')); @@ -328,7 +330,7 @@ killArtefact(canvas, name('pin-5'), 3000, () => { }); }); -killArtefact(canvas, name('pin-7'), 4000, () => { +killArtefact(scrawl, canvas, name('pin-7'), 4000, () => { pins.addArtefacts(name('pin-7')); @@ -338,7 +340,7 @@ killArtefact(canvas, name('pin-7'), 4000, () => { }); }); -killArtefact(canvas, name('my-bezier'), 5000, () => { +killArtefact(scrawl, canvas, name('my-bezier'), 5000, () => { scrawl.findEntity(name('path-line')).set({ endPath: name('my-bezier'), diff --git a/demo/canvas-024.js b/demo/canvas-024.js index c6aa7511..f5035346 100644 --- a/demo/canvas-024.js +++ b/demo/canvas-024.js @@ -23,15 +23,22 @@ scrawl.importDomImage('.flowers'); // Define some filters to play with scrawl.makeFilter({ + name: name('grayscale'), method: 'grayscale', + }).clone({ + name: name('sepia'), method: 'sepia', + }).clone({ + name: name('cyan'), method: 'cyan', + }).clone({ + name: name('pixelate'), method: 'pixelate', tileWidth: 8, @@ -95,28 +102,34 @@ scrawl.makeWheel({ method: 'fillAndDraw', }).clone({ + name: name('pin-2'), startY: 300, }).clone({ + name: name('pin-3'), startY: 500, }).clone({ + name: name('pin-4'), fillStyle: 'green', startX: 500, startY: 100, }).clone({ + name: name('pin-5'), startY: 230, }).clone({ + name: name('pin-6'), startY: 370, }).clone({ + name: name('pin-7'), startY: 500, }); @@ -191,7 +204,7 @@ const myLoom = scrawl.makeLoom({ name: name('display-loom'), - // Check to see that paths can be loaded either as picture name strings, or as the entity itself + // Check to see that paths can be loaded either as name strings, or as the entity itself fromPath: name('my-quad'), toPath: myBez, @@ -247,7 +260,7 @@ scrawl.makeRender({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, '#my-image-store', piccy); +addImageDragAndDrop(scrawl, canvas, '#my-image-store', piccy); // #### More user interaction diff --git a/demo/canvas-030.js b/demo/canvas-030.js index f5ede9e4..c0d51008 100644 --- a/demo/canvas-030.js +++ b/demo/canvas-030.js @@ -94,11 +94,6 @@ const myline = scrawl.makePolyline({ startX: 0, startY: 0, - // The `precision` attribute determines the accuracy for positioning artefacts on the path when they have set their `constantPathSpeed` flag to `true` - // + Natural path speed leads to slower progression around tight corners; constant path speed attempts to even out these variations across the length of the path. - // + The default precision value is `10`; decreasing the value increases the positioning accuracy. The more accurate the positioning, the greater the computational (and memory) burden. - precision: 0.05, - pivot: name('pivot-wheel'), lockTo: 'start', @@ -121,6 +116,11 @@ const myline = scrawl.makePolyline({ // + It generates more accurate results - particularly when the Polyline is flipped, rolled and/or scaled, and when underlying pins (particularly when those pins are artefacts) update their coordinates. useAsPath: true, + // The `precision` attribute determines the accuracy for positioning artefacts on the path when they have set their `constantSpeedAlongPath` flag to `true` + // + Natural path speed leads to slower progression around tight corners; constant path speed attempts to even out these variations across the length of the path. + // + The default precision value is `10`; decreasing the value increases the positioning accuracy. The more accurate the positioning, the greater the computational (and memory) burden. + precision: 0.05, + bringToFrontOnDrag: false, }); @@ -288,4 +288,4 @@ console.log(scrawl.library); console.log('Performing tests ...'); -killPolylineArtefact(canvas, name('pin-2'), 3000, myline, () => myline.updatePinAt(name('pin-2'), 2)); +killPolylineArtefact(scrawl, canvas, name('pin-2'), 3000, myline, () => myline.updatePinAt(name('pin-2'), 2)); diff --git a/demo/canvas-033.js b/demo/canvas-033.js index c78b517f..bdc795a6 100644 --- a/demo/canvas-033.js +++ b/demo/canvas-033.js @@ -43,7 +43,6 @@ const track = scrawl.makeOval({ }, useAsPath: true, - constantPathSpeed: true, precision: 0.1 }); @@ -68,6 +67,7 @@ scrawl.makeEnhancedLabel({ layoutTemplate: name('loader-track'), useLayoutTemplateAsPath: true, + constantSpeedAlongPath: true, breakTextOnSpaces: false, diff --git a/demo/canvas-036.js b/demo/canvas-036.js index c0415ada..b5eb04dd 100644 --- a/demo/canvas-036.js +++ b/demo/canvas-036.js @@ -76,7 +76,6 @@ scrawl.makeOval({ method: 'draw', useAsPath: true, - precision: 0.1, }); @@ -97,7 +96,7 @@ const cell3 = canvas.buildCell({ constantSpeedAlongPath: true, delta: { - pathPosition: -0.001, + pathPosition: -0.001, }, backgroundColor: 'black', diff --git a/demo/canvas-039.js b/demo/canvas-039.js index 86dba7f8..da4d7ab3 100644 --- a/demo/canvas-039.js +++ b/demo/canvas-039.js @@ -84,7 +84,7 @@ scrawl.makeGroup({ // Create draggable entitys scrawl.makeWheel({ - name: name('wheel-1'), + name: name('wheel-red'), group: name('drag-group'), radius: 40, @@ -96,23 +96,24 @@ scrawl.makeWheel({ }).clone({ - name: name('wheel-2'), + name: name('wheel-blue'), start: [250, 250], fillStyle: 'blue', }).clone({ - name: name('wheel-3'), + name: name('wheel-green'), start: [350, 250], fillStyle: 'green', }).clone({ - name: name('wheel-4'), + name: name('wheel-yellow'), start: [350, 150], fillStyle: 'yellow', }); + scrawl.makeBlock({ name: name('block-1'), @@ -137,6 +138,16 @@ scrawl.makeWheel({ }); +// Test to make sure EnhancedLabel entitys can be used on non-base Cells +scrawl.makeEnhancedLabel({ + name: name('label'), + group: name('drag-group'), + layoutTemplate: name('wheel-yellow'), + text: 'Drag the dots around the canvas', + justifyLine: 'space-around', +}); + + // #### Scene animation // Function to display frames-per-second data, and other information relevant to the demo const report = reportSpeed('#reportmessage', function () { diff --git a/demo/canvas-056.js b/demo/canvas-056.js index f5ae1548..eb631cac 100644 --- a/demo/canvas-056.js +++ b/demo/canvas-056.js @@ -26,13 +26,17 @@ let densityValue = 600, rotationValue = 360, pathrollValue = false; -// We use a Polyline entity as the guide along which we shall calculate the hairs for our Shape entity. The Polyline's pins are a set of Wheel entitys which the user can drag around the canvas to reshape the Polyline -const firstPins = scrawl.makeGroup({ - name: name('first-pins'), + +// We use a Polyline entity as the guide along which we shall place our "frond" Shape entitys. The Polyline's pins are a set of Wheel entitys which the user can drag around the canvas to reshape the Polyline +const pinGroup = scrawl.makeGroup({ + + name: name('pins'), host: canvas.getBase(), + order: 1, }); +// Use a pool coordinate to help quickly calculate the positions of the pins const coord = scrawl.requestCoordinate(); for (let i = 0; i < noOfPins; i++) { @@ -40,8 +44,9 @@ for (let i = 0; i < noOfPins; i++) { coord.setFromArray([0, 200]).rotate(i * pinRotationAngle).add([300, 300]); scrawl.makeWheel({ + name: name(`pin-1-${i}`), - group: name('first-pins'), + group: pinGroup, /** @ts-expect-error */ start: [...coord], handle: ['center', 'center'], @@ -51,91 +56,87 @@ for (let i = 0; i < noOfPins; i++) { }); } +// __Always__ release a pool coordinate after we're done using it! scrawl.releaseCoordinate(coord); -const firstOutline = scrawl.makePolyline({ +const rope = scrawl.makePolyline({ - name: name('first-outline'), - pins: firstPins.get('artefacts'), + name: name('rope'), + pins: pinGroup.get('artefacts'), mapToPins: true, tension: 0.25, strokeStyle: 'green', method: 'draw', closed: true, useAsPath: true, - constantPathSpeed: true, }); -// The Shape entity starts with a minimal pathDefinition value. Note that the Shape's start and handle attributes are centered; this entity does not pivot or mimic to the Polyline entity which is why their borders are often misaligned. -const secondOutline = scrawl.makeShape({ - name: name('second-outline'), - pathDefinition: 'm0,0', - start: ['center', 'center'], - handle: ['center', 'center'], +// We'll generate the frond entitys from a template +const template = scrawl.makeShape({ + + name: name('frond-template'), + path: rope, + constantSpeedAlongPath: true, + pathDefinition: 'm0,0 l0,0', lineWidth: 4, lineCap: 'round', strokeStyle: 'darkslategray', method: 'draw', + visibility: false, +}); + + +// All frond entitys go into their own group +const fronds = scrawl.makeGroup({ + + name: name('fronds'), + host: canvas.getBase(), }); -// We recalculate the Shape entity's pathDefinition value each time the user updates a control or drags one of the Polyline entity's pins. -let currentOutline = ''; +// The flag stores a copy of the rope entitys pathDefinition string. +// + When the pathDefinition changes (user action) or we set it to an empty string, we'll regenerate all of the fronds +let flag = ''; const checkOutlines = function () { - const outline = firstOutline.get('pathDefinition'); + const def = rope.get('pathDefinition'); - if (outline !== currentOutline) { + if (def !== flag) { - currentOutline = outline; + flag = def; - // Rotations are calculated with the help of a pool Coordinate object - const coord = scrawl.requestCoordinate(); + // We'll just kill all the existing fronds and regenerate them + fronds.killArtefacts(); - // Get the number generator + // The "random" numbers will be the same values and order every time this regeneration runs const numberGenerator = scrawl.seededRandomNumberGenerator('hello-world'); - let pos, x, y, a, dx, dy; - let line = ''; - for (let i = 0; i < densityValue; i++) { - // __getPathPositionData__ returns an Object with attributes `x`, `y`, `angle`. - // + The first argument is a float Number value between `0` and `1`, representing the relative position of the required point along the path. - // + The second argument is a boolean which, when set to true, will return the `constant speed` coordinate rather than the `natural speed` coordinate. - pos = firstOutline.getPathPositionData(i / densityValue, true); - x = pos.x; - y = pos.y; + template.clone({ - if (pathrollValue) { + name: name(`frond-${i}`), + group: fronds, - a = pos.angle + 90; + pathDefinition: `m0,0 l0,${lengthValue * numberGenerator.random()}`, - coord.set(0, numberGenerator.random() * lengthValue).rotate(a + (numberGenerator.random() * rotationValue)).add([x, y]); - } - else { + visibility: true, - coord.set(0, numberGenerator.random() * lengthValue).rotate(numberGenerator.random() * rotationValue).add([x, y]); - } - [dx, dy] = coord; + pathPosition: numberGenerator.random(), + lockTo: 'path', - line += `M${x},${y}L${dx},${dy}`; + roll: rotationValue * numberGenerator.random(), + addPathRotation: pathrollValue, + }); } - - // Return the Coordinate object back to the pool - failure to do this leads to memory leaks! - scrawl.releaseCoordinate(coord); - - - secondOutline.set({ - pathDefinition: line, - }); } }; + // #### Scene animation // Function to display frames-per-second data, and other information relevant to the demo const report = reportSpeed('#reportmessage', function () { @@ -160,7 +161,7 @@ scrawl.makeRender({ // #### User interaction scrawl.makeDragZone({ zone: canvas, - collisionGroup: name('first-pins'), + collisionGroup: pinGroup, endOn: ['up', 'leave'], preventTouchDefaultWhenDragging: true, }); @@ -174,8 +175,8 @@ scrawl.addNativeListener(['input', 'change'], () => { pathrollValue = ('0' === dom.pathroll.value) ? false : true; - // Setting the `currentOutline` variable to a null string guarantees that the Shape entity's pathDefinition will be recalculated at the start of the next Display cycle - currentOutline = ''; + // Setting the `flag` variable to a null string guarantees that the frond entitys will be recalculated at the start of the next Display cycle + flag = ''; }, '.controlItem'); diff --git a/demo/canvas-057.js b/demo/canvas-057.js index a9742b9d..4cd5d7f4 100644 --- a/demo/canvas-057.js +++ b/demo/canvas-057.js @@ -263,6 +263,7 @@ scrawl.makeRender({ // #### Drag-and-Drop image loading functionality addImageDragAndDrop( + scrawl, canvas, '#my-image-store', backgroundImage, diff --git a/demo/canvas-201.js b/demo/canvas-201.js index 747283c4..bdad31ff 100644 --- a/demo/canvas-201.js +++ b/demo/canvas-201.js @@ -189,8 +189,8 @@ console.log(scrawl.library); // Kill, and packet, functionality tests console.log('Performing tests ...'); -killArtefact(canvas, name('mylabel_fill'), 4000); -killArtefact(canvas, name('mylabel_fillAndDraw'), 6000); +killArtefact(scrawl, canvas, name('mylabel_fill'), 4000); +killArtefact(scrawl, canvas, name('mylabel_fillAndDraw'), 6000); // Accessible text manipulation setTimeout(() => scrawl.library.artefact[name('mylabel_clear')].set({ textIsAccessible: true }), 8000); diff --git a/demo/canvas-208.js b/demo/canvas-208.js index 23f5590f..76a73a37 100644 --- a/demo/canvas-208.js +++ b/demo/canvas-208.js @@ -31,7 +31,6 @@ scrawl.makeSpiral({ drawFromLoop: 2, scaleOutline: false, useAsPath: true, - constantPathSpeed: true, }); const mylabel = scrawl.makeEnhancedLabel({ diff --git a/demo/canvas-211.html b/demo/canvas-211.html index f0297627..dd142f6c 100644 --- a/demo/canvas-211.html +++ b/demo/canvas-211.html @@ -172,7 +172,7 @@
← Previous - Next → + Next →

Scrawl-canvas v8 - Canvas test 211

EnhancedLabel entity - keyboard navigation; hit tests

diff --git a/demo/canvas-211.js b/demo/canvas-211.js index 60ad0c8b..6c37756d 100644 --- a/demo/canvas-211.js +++ b/demo/canvas-211.js @@ -162,7 +162,6 @@ scrawl.makeSpiral({ drawFromLoop: 2, scaleOutline: false, useAsPath: true, - constantPathSpeed: true, }); const mylabel = scrawl.makeEnhancedLabel({ diff --git a/demo/canvas-212.html b/demo/canvas-212.html new file mode 100644 index 00000000..675993ef --- /dev/null +++ b/demo/canvas-212.html @@ -0,0 +1,170 @@ + + + + + + + + Demo Canvas 212 + + + + + + + + +
+ ← Previous + Next → +
+

Scrawl-canvas v8 - Canvas test 212

+

EnhancedLabel entity - updating font parts; experiments with variable font

+ +
+
Style
+
+ +
+ +
Lock style to entity
+
+ +
+ +
Font size
+
+ +
+ +
Font variant caps
+
+ +
+ +
Font weight (bold)
+
+ +
+ +
Font style (italic/oblique)
+
+ +
+ +
Font stretch
+
+ +
+ +
Path
+
+ +
+ +
+ + + +
+
Scale
+
+ +
+ +
Roll
+
+ +
+
+ +

To note: Javascript is not running in this browser environment. Our apologies, but this demo has not yet been updated to support progressive enhancement.

+ +
+

Test purpose

+ + +

Known issues:

+ + +

Touch test: not required.

+ +

Annotated code

+
+ + + + + + diff --git a/demo/canvas-212.js b/demo/canvas-212.js new file mode 100644 index 00000000..72a51a74 --- /dev/null +++ b/demo/canvas-212.js @@ -0,0 +1,303 @@ +// # Demo Canvas 212 +// EnhancedLabel entity - updating font parts; experiments with variable font + +// [Run code](../../demo/canvas-212.html) +import * as scrawl from '../source/scrawl.js'; + +import { reportSpeed, initializeDomInputs } from './utilities.js'; + + +// #### Scene setup +// Get a handle to the Canvas wrapper +const canvas = scrawl.findCanvas('mycanvas'); + + +// Namespacing boilerplate +const namespace = canvas.name; +const name = (n) => `${namespace}-${n}`; + + +scrawl.makeGradient({ + name: name('linear-gradient'), + endX: '100%', + endY: '100%', + + colors: [ + [0, 'black'], + [99, 'black'], + [100, 'red'], + [199, 'red'], + [200, 'black'], + [299, 'black'], + [300, 'blue'], + [399, 'blue'], + [400, 'black'], + [499, 'black'], + [500, 'green'], + [599, 'green'], + [600, 'black'], + [699, 'black'], + [700, 'orange'], + [799, 'orange'], + [800, 'black'], + [899, 'black'], + [900, 'yellow'], + [999, 'yellow'], + ], + colorSpace: 'OKLAB', + precision: 5, +}); + +scrawl.makePattern({ + + name: name('water-pattern'), + imageSource: 'img/water.png', +}); + +scrawl.makeBlock({ + + name: name('block-template'), + + start: ['25%', 'center'], + handle: ['center', 'center'], + dimensions: ['40%', '80%'], + + method: 'none', +}); + +const myLabel = scrawl.makeEnhancedLabel({ + + name: name('block-label'), + + layoutTemplate: name('block-template'), + fontString: '25px "Roboto Flex"', + text: 'Lorem ipsum dolor sit amet, con­sectetur 😀 adi­piscing élit, sed do eius-mod tempor in­cididunt ut labore et dolore magna aliqua.', + + justifyLine: 'start', + textHandle: ['center', 'alphabetic'], + lockFillStyleToEntity: true, +}); + +scrawl.makeLine({ + + name: name('line'), + + start: ['55%', '90%'], + end: ['90%', '10%'], + + useAsPath: true, + useStartAsControlPoint: true, + + method: 'none', +}); + +scrawl.makeQuadratic({ + + name: name('quadratic'), + + start: ['55%', '90%'], + control: ['60%', '50%'], + end: ['90%', '10%'], + + useAsPath: true, + useStartAsControlPoint: true, + precision: 1, + + method: 'none', +}); + +scrawl.makeBezier({ + + name: name('bezier'), + + start: ['55%', '90%'], + startControl: ['80%', '60%'], + endControl: ['70%', '40%'], + end: ['90%', '10%'], + + useAsPath: true, + useStartAsControlPoint: true, + precision: 1, + + method: 'draw', +}); + +scrawl.makeOval({ + + name: name('oval'), + + start: ['75%', '50%'], + handle: ['center', 'center'], + radiusX: '15%', + radiusY: '35%', + roll: 30, + + useAsPath: true, + precision: 1, + + method: 'none', +}); + +scrawl.makeEnhancedLabel({ + + name: name('path-label'), + + layoutTemplate: name('bezier'), + fontString: '25px "Roboto Flex"', + text: 'Lorem ipsum dolor sit amet', + + useLayoutTemplateAsPath: true, + breakTextOnSpaces: false, + + textHandle: ['center', 'alphabetic'], + lockFillStyleToEntity: true, + + delta: { + pathPosition: -0.002, + }, +}); + +scrawl.makeEnhancedLabel({ + + name: name('check-label'), + + layoutTemplate: name('bezier'), + fontString: '25px serif', + text: 'Lorem ipsum dolor sit amet', + + useLayoutTemplateAsPath: true, + breakTextOnSpaces: false, + + textHandle: ['center', '-100%'], +}); + +scrawl.makeWheel({ + + name: name('start-mark'), + radius: 4, + handle: ['center', 'center'], + path: name('bezier'), + constantSpeedAlongPath: true, + lockTo: 'path', + fillStyle: 'yellow', + method: 'fillThenDraw', + delta: { + pathPosition: -0.002, + }, +}); + + +const labelGroup = scrawl.makeGroup({ + + name: name('labels-group'), + +}).addArtefacts(name('block-label'), name('path-label'), name('check-label')); + + +const pathLabelsGroup = scrawl.makeGroup({ + + name: name('path-labels-group'), + +}).addArtefacts(name('path-label'), name('check-label'), name('start-mark')); + + +const pathGroup = scrawl.makeGroup({ + + name: name('paths-group'), + +}).addArtefacts(name('line'), name('quadratic'), name('bezier'), name('oval')); + + +// #### Scene animation +// Function to display frames-per-second data, and other information relevant to the demo +const report = reportSpeed('#reportmessage', () => { + return ` +Font.details: + Font string (entity): ${myLabel.get('fontString')} + Font string (canvas): ${myLabel.get('canvasFont')} + + Font size: ${myLabel.get('fontSize')} + Font style: ${myLabel.get('fontStyle')} + Font stretch: ${myLabel.get('fontStretch')} + Font variant: ${myLabel.get('fontVariantCaps')} + Font weight: ${myLabel.get('fontWeight')} + `; +}); + + +// Create the Display cycle animation +scrawl.makeRender({ + + name: name('animation'), + target: canvas, + afterShow: report, +}); + + +// #### User interaction +// Setup form +const dom = initializeDomInputs([ + ['input', 'roll', '0'], + ['input', 'scale', '1'], + ['input', 'fontWeight', '400'], + ['input', 'fontStretch', '100'], + ['select', 'fontSize', 0], + ['select', 'fontVariantCaps', 0], + ['select', 'fontStyle', 0], + ['select', 'lockFillStyleToEntity', 1], + ['select', 'fillStyle', 0], + ['select', 'layoutTemplate', 2], +]); + + +scrawl.makeUpdater({ + + event: ['input', 'change'], + origin: '.controlItem', + + target: labelGroup, + + useNativeListener: true, + preventDefault: true, + + updates: { + fontSize: ['fontSize', 'raw'], + roll: ['roll', 'float'], + scale: ['scale', 'float'], + fontWeight: ['fontWeight', 'int'], + fontVariantCaps: ['fontVariantCaps', 'raw'], + fontStyle: ['fontStyle', 'raw'], + fontStretch: ['fontStretch', '%'], + lockFillStyleToEntity: ['lockFillStyleToEntity', 'boolean'], + fillStyle: ['fillStyle', 'raw'], + }, +}); + +scrawl.addNativeListener(['input', 'change'], (e) => { + + if (e && e.target) { + + pathGroup.setArtefacts({ method: 'none' }); + + const selected = scrawl.findEntity(name(e.target.value)); + + if (selected) { + + selected.set({ method: 'draw' }); + + pathLabelsGroup.setArtefacts({ + + // For the EnhancedLabel entitys + layoutTemplate: selected, + + // For the wheel entity + path: selected, + }); + } + } + +}, dom.layoutTemplate); + + +// #### Development and testing +console.log(scrawl.library); diff --git a/demo/delaunator-002.js b/demo/delaunator-002.js index af75b38f..a038e9f5 100644 --- a/demo/delaunator-002.js +++ b/demo/delaunator-002.js @@ -295,7 +295,7 @@ scrawl.addNativeListener(['touchmove'], (e) => { // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/dom-001.html b/demo/dom-001.html index 360b8721..0e468a64 100644 --- a/demo/dom-001.html +++ b/demo/dom-001.html @@ -54,7 +54,7 @@

import * as scrawl from 'scrawl-canvas';

... or if using the remote CDN version:

-

import * as scrawl from 'https://unpkg.com/scrawl-canvas@8.13.0';

+

import * as scrawl from 'https://unpkg.com/scrawl-canvas@8.13.1';

The import doesn't need to be called 'scrawl' - it can be whatever the user prefers.

diff --git a/demo/dom-004.js b/demo/dom-004.js index 4908ed43..6abb46aa 100644 --- a/demo/dom-004.js +++ b/demo/dom-004.js @@ -106,4 +106,4 @@ scrawl.addNativeListener('click', flyRocket, stack.domElement); console.log(scrawl.library); console.log('Performing tests ...'); -killTicker(stack, name('template_ticker'), 4000); +killTicker(scrawl, stack, name('template_ticker'), 4000); diff --git a/demo/dom-015.js b/demo/dom-015.js index ef51b8b6..72392c79 100644 --- a/demo/dom-015.js +++ b/demo/dom-015.js @@ -236,7 +236,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop([canvas, element], `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, [canvas, element], `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/dom-020.js b/demo/dom-020.js index c85ccb51..af30e810 100644 --- a/demo/dom-020.js +++ b/demo/dom-020.js @@ -20,7 +20,7 @@ scrawl.importDomImage('.flowers'); // Create the background -addCheckerboardBackground(canvas, namespace); +addCheckerboardBackground(scrawl, canvas, namespace); // Create the filter @@ -139,7 +139,7 @@ scrawl.addNativeListener('click', useEyedropper, dom.reference_selector); // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-001.html b/demo/filters-001.html index f29631be..f3b2f016 100644 --- a/demo/filters-001.html +++ b/demo/filters-001.html @@ -54,7 +54,7 @@
- ← Previous + ← Previous Next →

Scrawl-canvas v8 - Filters test 001

diff --git a/demo/filters-001.js b/demo/filters-001.js index 182fdeb8..6dd747f6 100644 --- a/demo/filters-001.js +++ b/demo/filters-001.js @@ -227,7 +227,7 @@ scrawl.addNativeListener(['input', 'change'], (e) => { // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-002.js b/demo/filters-002.js index 31cccce7..bf5b3a25 100644 --- a/demo/filters-002.js +++ b/demo/filters-002.js @@ -151,7 +151,7 @@ scrawl.addNativeListener(['input', 'change'], (e) => { // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, pictureGroup); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, pictureGroup); // #### Development and testing diff --git a/demo/filters-002a.js b/demo/filters-002a.js index 6703ad31..8121814c 100644 --- a/demo/filters-002a.js +++ b/demo/filters-002a.js @@ -183,7 +183,7 @@ scrawl.addNativeListener(['input', 'change'], (e) => { // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, pictureGroup, cacheAction); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, pictureGroup, cacheAction); // #### Development and testing diff --git a/demo/filters-003.js b/demo/filters-003.js index e6422067..27743f89 100644 --- a/demo/filters-003.js +++ b/demo/filters-003.js @@ -244,7 +244,7 @@ scrawl.addNativeListener(['input', 'change'], () => { // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, pictureGroup); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, pictureGroup); // #### Development and testing diff --git a/demo/filters-004.js b/demo/filters-004.js index 8d05e328..3d3064c4 100644 --- a/demo/filters-004.js +++ b/demo/filters-004.js @@ -125,7 +125,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-005.js b/demo/filters-005.js index 54cc67b8..30070861 100644 --- a/demo/filters-005.js +++ b/demo/filters-005.js @@ -101,7 +101,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-006.js b/demo/filters-006.js index 9e288fbf..5541b453 100644 --- a/demo/filters-006.js +++ b/demo/filters-006.js @@ -108,7 +108,7 @@ scrawl.addNativeListener( // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-007.js b/demo/filters-007.js index d2a687db..2aa24cde 100644 --- a/demo/filters-007.js +++ b/demo/filters-007.js @@ -100,7 +100,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-008.js b/demo/filters-008.js index b460643f..5060d8a0 100644 --- a/demo/filters-008.js +++ b/demo/filters-008.js @@ -188,7 +188,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-009.js b/demo/filters-009.js index 3ee81a85..b7d4f104 100644 --- a/demo/filters-009.js +++ b/demo/filters-009.js @@ -109,7 +109,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-010.js b/demo/filters-010.js index 4bb7e180..fc932891 100644 --- a/demo/filters-010.js +++ b/demo/filters-010.js @@ -21,7 +21,7 @@ scrawl.importDomImage('.flowers'); // Create the background -addCheckerboardBackground(canvas, namespace); +addCheckerboardBackground(scrawl, canvas, namespace); // Create the filter @@ -85,8 +85,7 @@ scrawl.addNativeListener(['input', 'change'], handleOpacity, '#opacity'); // #### Drag-and-Drop image loading functionality -// addImageDragAndDrop(canvas, '#my-image-store', piccy); -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-011.js b/demo/filters-011.js index ab5f8f18..50fe0928 100644 --- a/demo/filters-011.js +++ b/demo/filters-011.js @@ -21,7 +21,7 @@ scrawl.importDomImage('.flowers'); // Create the background -addCheckerboardBackground(canvas, namespace); +addCheckerboardBackground(scrawl, canvas, namespace); // Create the filter @@ -103,7 +103,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-012.js b/demo/filters-012.js index d3628aba..292bd6cc 100644 --- a/demo/filters-012.js +++ b/demo/filters-012.js @@ -173,7 +173,7 @@ scrawl.addNativeListener(['input', 'change'], updateFilters, '.filter-control'); // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-013.js b/demo/filters-013.js index fe2c3cd5..878fc56b 100644 --- a/demo/filters-013.js +++ b/demo/filters-013.js @@ -141,7 +141,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-014.js b/demo/filters-014.js index 8f1eba02..cd972678 100644 --- a/demo/filters-014.js +++ b/demo/filters-014.js @@ -21,7 +21,7 @@ scrawl.importDomImage('.flowers'); // Create the background -addCheckerboardBackground(canvas, namespace); +addCheckerboardBackground(scrawl, canvas, namespace); // Create the filter @@ -129,7 +129,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-015.js b/demo/filters-015.js index 10393438..96c42eaf 100644 --- a/demo/filters-015.js +++ b/demo/filters-015.js @@ -173,7 +173,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-016.js b/demo/filters-016.js index 60f4814f..da343924 100644 --- a/demo/filters-016.js +++ b/demo/filters-016.js @@ -88,7 +88,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-017.js b/demo/filters-017.js index e4ee2001..8bb9d1c2 100644 --- a/demo/filters-017.js +++ b/demo/filters-017.js @@ -120,7 +120,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-018.js b/demo/filters-018.js index b5b20026..c22f31e1 100644 --- a/demo/filters-018.js +++ b/demo/filters-018.js @@ -21,7 +21,7 @@ scrawl.importDomImage('.flowers'); // Create the background -addCheckerboardBackground(canvas, namespace); +addCheckerboardBackground(scrawl, canvas, namespace); // Create the filter @@ -127,7 +127,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-019.js b/demo/filters-019.js index 15b1054a..1353c9e6 100644 --- a/demo/filters-019.js +++ b/demo/filters-019.js @@ -133,7 +133,7 @@ scrawl.addNativeListener(['input', 'change'], (e) => { // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, myPictures); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, myPictures); // #### Development and testing diff --git a/demo/filters-020.js b/demo/filters-020.js index fa74a6c5..8c0a7d35 100644 --- a/demo/filters-020.js +++ b/demo/filters-020.js @@ -149,7 +149,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-021.js b/demo/filters-021.js index 359019d5..daf64bcb 100644 --- a/demo/filters-021.js +++ b/demo/filters-021.js @@ -167,7 +167,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-022.js b/demo/filters-022.js index b8754da7..09b17a5d 100644 --- a/demo/filters-022.js +++ b/demo/filters-022.js @@ -201,7 +201,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-023.js b/demo/filters-023.js index 3007e094..e0624ad8 100644 --- a/demo/filters-023.js +++ b/demo/filters-023.js @@ -108,7 +108,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-024.js b/demo/filters-024.js index 0d1aab5f..cea1e4d0 100644 --- a/demo/filters-024.js +++ b/demo/filters-024.js @@ -436,7 +436,7 @@ scrawl.addNativeListener(['input', 'change'], () => updateOutput(), '.controlIte // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(oCanvas, `#${oNamespace} .assets`, piccy); +addImageDragAndDrop(scrawl, oCanvas, `#${oNamespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-025.js b/demo/filters-025.js index e349b591..e66995f0 100644 --- a/demo/filters-025.js +++ b/demo/filters-025.js @@ -21,7 +21,7 @@ scrawl.importDomImage('.flowers'); // Create the background -addCheckerboardBackground(canvas, namespace); +addCheckerboardBackground(scrawl, canvas, namespace); // Create the filter @@ -122,7 +122,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-026.js b/demo/filters-026.js index 6c05efa1..cab11d50 100644 --- a/demo/filters-026.js +++ b/demo/filters-026.js @@ -157,7 +157,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-027.js b/demo/filters-027.js index fdae25c3..7eaa4e0c 100644 --- a/demo/filters-027.js +++ b/demo/filters-027.js @@ -139,7 +139,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop([canvas1, canvas2], `#${namespace2} .assets`, [dithered, original]); +addImageDragAndDrop(scrawl, [canvas1, canvas2], `#${namespace2} .assets`, [dithered, original]); // #### Development and testing diff --git a/demo/filters-028.js b/demo/filters-028.js index 4cd0e11c..c4551933 100644 --- a/demo/filters-028.js +++ b/demo/filters-028.js @@ -405,7 +405,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-101.js b/demo/filters-101.js index b2364122..bbe5100f 100644 --- a/demo/filters-101.js +++ b/demo/filters-101.js @@ -21,7 +21,7 @@ scrawl.importDomImage('.flowers'); // Create the background -addCheckerboardBackground(canvas, namespace); +addCheckerboardBackground(scrawl, canvas, namespace); // Create the assets @@ -206,7 +206,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, imageFilter); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, imageFilter); // #### Development and testing diff --git a/demo/filters-102.js b/demo/filters-102.js index e5884a27..02cce46d 100644 --- a/demo/filters-102.js +++ b/demo/filters-102.js @@ -21,7 +21,7 @@ scrawl.importDomImage('.flowers'); // Create the background -addCheckerboardBackground(canvas, namespace); +addCheckerboardBackground(scrawl, canvas, namespace); // Create the assets @@ -206,7 +206,7 @@ scrawl.makeUpdater({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, imageFilter); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, imageFilter); // #### Development and testing diff --git a/demo/filters-103.js b/demo/filters-103.js index f49376d0..4fb830b5 100644 --- a/demo/filters-103.js +++ b/demo/filters-103.js @@ -595,7 +595,7 @@ scrawl.findEntity(name('display')).addFilters(name('color-crt')); // #### Drag-and-Drop image loading functionality // We'll only add any user images to the first canvas, which contains an assets <div> element -addImageDragAndDrop(canvases, `#canvas-1 .assets`, pictures); +addImageDragAndDrop(scrawl, canvases, `#canvas-1 .assets`, pictures); // #### Development and testing diff --git a/demo/filters-104.js b/demo/filters-104.js index b770b0b6..b6846dee 100644 --- a/demo/filters-104.js +++ b/demo/filters-104.js @@ -254,7 +254,7 @@ const target = scrawl.makePicture({ // Add some Drag-and-Drop image loading functionality // + So users can check the filter effects against different images -addImageDragAndDrop(canvas, `#${namespace} .assets`, target); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, target); // #### Scene animation diff --git a/demo/filters-105.js b/demo/filters-105.js index 1f4afb72..3b686847 100644 --- a/demo/filters-105.js +++ b/demo/filters-105.js @@ -234,7 +234,7 @@ scrawl.addNativeListener(['change', 'input'], () => { // #### Drag-and-Drop image loading functionality -addImageDragAndDrop([plainCanvas, filteredCanvas], `#${plainNamespace} .assets`, [plainImg, filteredImg]); +addImageDragAndDrop(scrawl, [plainCanvas, filteredCanvas], `#${plainNamespace} .assets`, [plainImg, filteredImg]); // #### Development and testing diff --git a/demo/filters-501.js b/demo/filters-501.js index 412e872d..852e7696 100644 --- a/demo/filters-501.js +++ b/demo/filters-501.js @@ -127,7 +127,7 @@ scrawl.addNativeListener(['input', 'change'], updateFilter, '#filter'); // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-502.js b/demo/filters-502.js index 934130b3..5e453a14 100644 --- a/demo/filters-502.js +++ b/demo/filters-502.js @@ -81,7 +81,7 @@ scrawl.addNativeListener(['input', 'change'], updateEdgeMode, dom.edgeMode); // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-503.js b/demo/filters-503.js index 4b369214..3723588c 100644 --- a/demo/filters-503.js +++ b/demo/filters-503.js @@ -88,7 +88,7 @@ scrawl.addNativeListener(['input', 'change'], updateB, '.feFuncB'); // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-504.js b/demo/filters-504.js index f0fa04a5..ed699596 100644 --- a/demo/filters-504.js +++ b/demo/filters-504.js @@ -83,7 +83,7 @@ const updateB = () => dom.feFuncB.setAttribute('tableValues', `${dom.b1.value} $ scrawl.addNativeListener(['input', 'change'], updateB, '.feFuncB'); // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/filters-505.js b/demo/filters-505.js index 78b0239f..0d0c8310 100644 --- a/demo/filters-505.js +++ b/demo/filters-505.js @@ -94,7 +94,7 @@ scrawl.addNativeListener(['input', 'change'], dmY, dom.yChannelSelector); // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy); // #### Development and testing diff --git a/demo/index.html b/demo/index.html index d71575c6..2104829b 100644 --- a/demo/index.html +++ b/demo/index.html @@ -123,7 +123,7 @@
-

Scrawl-canvas — Demo tests
(For version 8.13.0)

+

Scrawl-canvas — Demo tests
(For version 8.13.1)

The Scrawl-canvas library makes it easier to create and use <canvas> presentations and scenes in a web page. Canvases discovered on a page, or added to it, will be enhanced by the library to help make them more responsive and accessible, and easy to interact with.

@@ -657,6 +657,12 @@

Label and EnhancedLabel entity tests


Keyboard zones +
+
+ Canvas 212 + EnhancedLabel entity - updating font parts; experiments with variable font +
+

Filters functionality tests

diff --git a/demo/particles-016.js b/demo/particles-016.js index d2d355c7..9c7bb314 100644 --- a/demo/particles-016.js +++ b/demo/particles-016.js @@ -156,7 +156,7 @@ scrawl.makeDragZone({ // #### Drag-and-Drop image loading functionality -addImageDragAndDrop(canvas, `#${namespace} .assets`, myPicture); +addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, myPicture); // #### Development and testing diff --git a/demo/thumbs/canvas-212.webp b/demo/thumbs/canvas-212.webp new file mode 100644 index 00000000..f2f9e081 Binary files /dev/null and b/demo/thumbs/canvas-212.webp differ diff --git a/demo/utilities.js b/demo/utilities.js index a7854ef4..1591fafb 100644 --- a/demo/utilities.js +++ b/demo/utilities.js @@ -1,6 +1,3 @@ -import * as scrawl from '../source/scrawl.js'; -const L = scrawl.library; - // Function to display frames-per-second data, and other information relevant to the demo const reportSpeed = function (output = '', xtra = () => '') { @@ -123,7 +120,9 @@ ${getSectionOutput('world', world, worldnames)} // Test to check that artefacts are properly killed and resurrected -const killArtefact = (canvas, name, time, finishResurrection = () => {}) => { +const killArtefact = (scrawl, canvas, name, time, finishResurrection = () => {}) => { + + const L = scrawl.library; if (canvas && canvas.base && name && time) { @@ -184,7 +183,9 @@ const killArtefact = (canvas, name, time, finishResurrection = () => {}) => { // To test styles (Gradient) kill functionality -const killStyle = (canvas, name, time, finishResurrection = () => {}) => { +const killStyle = (scrawl, canvas, name, time, finishResurrection = () => {}) => { + + const L = scrawl.library; if (canvas && canvas.base && name && time) { @@ -224,7 +225,9 @@ const killStyle = (canvas, name, time, finishResurrection = () => {}) => { }; // To test artefact + anchor kill functionality -const killArtefactAndAnchor = (canvas, name, anchorname, time, finishResurrection = () => {}) => { +const killArtefactAndAnchor = (scrawl, canvas, name, anchorname, time, finishResurrection = () => {}) => { + + const L = scrawl.library; const groupname = 'mycanvas_base'; @@ -283,7 +286,9 @@ const killArtefactAndAnchor = (canvas, name, anchorname, time, finishResurrectio }; // To test Polyline artefact kill functionality -const killPolylineArtefact = (canvas, name, time, myline, restore = () => {}) => { +const killPolylineArtefact = (scrawl, canvas, name, time, myline, restore = () => {}) => { + + const L = scrawl.library; const groupname = 'mycanvas_base'; @@ -351,7 +356,9 @@ const killPolylineArtefact = (canvas, name, time, myline, restore = () => {}) => }, time); }; -const killTicker = (stack, name, time) => { +const killTicker = (scrawl, stack, name, time) => { + + const L = scrawl.library; let packet; @@ -380,7 +387,9 @@ const killTicker = (stack, name, time) => { }, time); }; -const addImageDragAndDrop = (canvas, selector, targets, callback = () => {}) => { +const addImageDragAndDrop = (scrawl, canvas, selector, targets, callback = () => {}) => { + + const L = scrawl.library; // #### Drag-and-Drop image loading functionality const store = document.querySelector(selector); @@ -513,7 +522,7 @@ const addImageDragAndDrop = (canvas, selector, targets, callback = () => {}) => }; }; -const addCheckerboardBackground = (canvas, namespace) => { +const addCheckerboardBackground = (scrawl, canvas, namespace) => { // Namespace boilerplate const name = (item) => `${namespace}-${item}`; diff --git a/docs/demo/canvas-001.html b/docs/demo/canvas-001.html index 892c1d5f..9e80716d 100644 --- a/docs/demo/canvas-001.html +++ b/docs/demo/canvas-001.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1260,8 +1265,8 @@

Development and testing

-
killArtefact(canvas, name('block-fill'), 4000);
-killArtefact(canvas, name('wheel-fillAndDraw'), 6000);
+
killArtefact(scrawl, canvas, name('block-fill'), 4000);
+killArtefact(scrawl, canvas, name('wheel-fillAndDraw'), 6000);
diff --git a/docs/demo/canvas-002.html b/docs/demo/canvas-002.html index 91bf5f0e..2d6bb304 100644 --- a/docs/demo/canvas-002.html +++ b/docs/demo/canvas-002.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1316,7 +1321,7 @@

Development and testing

console.log('Performing tests ...'); -killArtefact(canvas, name('mouse-pivot'), 4000, () => { +killArtefact(scrawl, canvas, name('mouse-pivot'), 4000, () => { myPivot = scrawl.findEntity(name('mouse-pivot')); @@ -1331,7 +1336,7 @@

Development and testing

}); }); -killArtefact(canvas, name('mimic-block'), 6000); +killArtefact(scrawl, canvas, name('mimic-block'), 6000); diff --git a/docs/demo/canvas-003.html b/docs/demo/canvas-003.html index 72a92f1c..c783652d 100644 --- a/docs/demo/canvas-003.html +++ b/docs/demo/canvas-003.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1220,7 +1225,7 @@

Development and testing

console.log('Performing tests ...'); -killStyle(canvas, name('mygradient'), 3000, () => { +killStyle(scrawl, canvas, name('mygradient'), 3000, () => { diff --git a/docs/demo/canvas-004.html b/docs/demo/canvas-004.html index 0dd2ed3b..dad8361e 100644 --- a/docs/demo/canvas-004.html +++ b/docs/demo/canvas-004.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-005.html b/docs/demo/canvas-005.html index 69b716ea..00ad232c 100644 --- a/docs/demo/canvas-005.html +++ b/docs/demo/canvas-005.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-006.html b/docs/demo/canvas-006.html index d3086497..c810530d 100644 --- a/docs/demo/canvas-006.html +++ b/docs/demo/canvas-006.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-007.html b/docs/demo/canvas-007.html index b023f973..03f67558 100644 --- a/docs/demo/canvas-007.html +++ b/docs/demo/canvas-007.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-008.html b/docs/demo/canvas-008.html index f105d8d9..08535147 100644 --- a/docs/demo/canvas-008.html +++ b/docs/demo/canvas-008.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-009.html b/docs/demo/canvas-009.html index dff70d51..029e8827 100644 --- a/docs/demo/canvas-009.html +++ b/docs/demo/canvas-009.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1591,7 +1596,7 @@

Development and testing

-
killArtefactAndAnchor(canvas, name('brick-in-marble'), 'wikipedia-brick-link', 2000, () => {
+            
killArtefactAndAnchor(scrawl, canvas, name('brick-in-marble'), 'wikipedia-brick-link', 2000, () => {
 
     scrawl.findArtefact(name('brick-in-marble')).set({
 
@@ -1625,7 +1630,7 @@ 

Development and testing

}); }); -killStyle(canvas, name('marble-pattern'), 3000, () => {
+killStyle(scrawl, canvas, name('marble-pattern'), 3000, () => {
diff --git a/docs/demo/canvas-010.html b/docs/demo/canvas-010.html index 60b3c15c..e08baf40 100644 --- a/docs/demo/canvas-010.html +++ b/docs/demo/canvas-010.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-011.html b/docs/demo/canvas-011.html index 3f30ebd5..2af4249f 100644 --- a/docs/demo/canvas-011.html +++ b/docs/demo/canvas-011.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1500,8 +1505,8 @@

Development and testing

console.log(scrawl.library);
 
 console.log('Performing tests ...');
-killArtefact(canvas, name('japan_fill'), 4000);
-killArtefact(canvas, name('japan_fillAndDraw'), 6000);
+killArtefact(scrawl, canvas, name('japan_fill'), 4000); +killArtefact(scrawl, canvas, name('japan_fillAndDraw'), 6000); diff --git a/docs/demo/canvas-012.html b/docs/demo/canvas-012.html index 9d03b98d..0ce1e1cd 100644 --- a/docs/demo/canvas-012.html +++ b/docs/demo/canvas-012.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -926,16 +931,10 @@

Scene setup

§

Namespacing boilerplate

- -
-const namespace = canvas.name;
+            
const namespace = canvas.name;
 const name = (n) => `${namespace}-${n}`;
@@ -1099,6 +1098,7 @@

Scene setup

path: arrow, pathPosition: 0, + constantSpeedAlongPath: true, addPathRotation: true, lockTo: 'path', diff --git a/docs/demo/canvas-013.html b/docs/demo/canvas-013.html index 9369e0a4..3bb31072 100644 --- a/docs/demo/canvas-013.html +++ b/docs/demo/canvas-013.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-014.html b/docs/demo/canvas-014.html index 60235a76..4bbf55ae 100644 --- a/docs/demo/canvas-014.html +++ b/docs/demo/canvas-014.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1118,6 +1123,8 @@

Scene setup

endPathPosition: 0, endLockTo: 'path', + constantSpeedAlongPath: true, + lineWidth: 5, lineCap: 'round', strokeStyle: 'black', @@ -1394,7 +1401,7 @@

Development and testing

console.log('Performing tests ...'); -killArtefact(canvas, name('pin-1'), 2000, () => { +killArtefact(scrawl, canvas, name('pin-1'), 2000, () => { pins.addArtefacts(name('pin-1')); @@ -1404,7 +1411,7 @@

Development and testing

}); }); -killArtefact(canvas, name('pin-5'), 3000, () => { +killArtefact(scrawl, canvas, name('pin-5'), 3000, () => { pins.addArtefacts(name('pin-5')); @@ -1414,7 +1421,7 @@

Development and testing

}); }); -killArtefact(canvas, name('pin-7'), 4000, () => { +killArtefact(scrawl, canvas, name('pin-7'), 4000, () => { pins.addArtefacts(name('pin-7')); @@ -1424,7 +1431,7 @@

Development and testing

}); }); -killArtefact(canvas, name('my-bezier'), 5000, () => { +killArtefact(scrawl, canvas, name('my-bezier'), 5000, () => { scrawl.findEntity(name('path-line')).set({ endPath: name('my-bezier'), diff --git a/docs/demo/canvas-015.html b/docs/demo/canvas-015.html index 16cd1b47..118af94c 100644 --- a/docs/demo/canvas-015.html +++ b/docs/demo/canvas-015.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-016.html b/docs/demo/canvas-016.html index 8d072af2..6b08531a 100644 --- a/docs/demo/canvas-016.html +++ b/docs/demo/canvas-016.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-017.html b/docs/demo/canvas-017.html index cc3402a0..1d5d2def 100644 --- a/docs/demo/canvas-017.html +++ b/docs/demo/canvas-017.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-018.html b/docs/demo/canvas-018.html index 1cc95e35..cf26a860 100644 --- a/docs/demo/canvas-018.html +++ b/docs/demo/canvas-018.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-019.html b/docs/demo/canvas-019.html index 13239b9b..27ea3661 100644 --- a/docs/demo/canvas-019.html +++ b/docs/demo/canvas-019.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-020.html b/docs/demo/canvas-020.html index 6c613011..02580e09 100644 --- a/docs/demo/canvas-020.html +++ b/docs/demo/canvas-020.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-021.html b/docs/demo/canvas-021.html index f11c8a3b..e54bdd65 100644 --- a/docs/demo/canvas-021.html +++ b/docs/demo/canvas-021.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-022.html b/docs/demo/canvas-022.html index 546b56c9..61b4d9d2 100644 --- a/docs/demo/canvas-022.html +++ b/docs/demo/canvas-022.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-023.html b/docs/demo/canvas-023.html index cae914b3..9b82ccb9 100644 --- a/docs/demo/canvas-023.html +++ b/docs/demo/canvas-023.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-024.html b/docs/demo/canvas-024.html index 87068410..8cc02dbd 100644 --- a/docs/demo/canvas-024.html +++ b/docs/demo/canvas-024.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -962,15 +967,22 @@

Scene setup

scrawl.makeFilter({
+
     name: name('grayscale'),
     method: 'grayscale',
+
 }).clone({
+
     name: name('sepia'),
     method: 'sepia',
+
 }).clone({
+
     name: name('cyan'),
     method: 'cyan',
+
 }).clone({
+
     name: name('pixelate'),
     method: 'pixelate',
     tileWidth: 8,
@@ -1068,28 +1080,34 @@ 

Scene setup

method: 'fillAndDraw', }).clone({ + name: name('pin-2'), startY: 300, }).clone({ + name: name('pin-3'), startY: 500, }).clone({ + name: name('pin-4'), fillStyle: 'green', startX: 500, startY: 100, }).clone({ + name: name('pin-5'), startY: 230, }).clone({ + name: name('pin-6'), startY: 370, }).clone({ + name: name('pin-7'), startY: 500, });
@@ -1207,7 +1225,7 @@

Scene setup

§
-

Check to see that paths can be loaded either as picture name strings, or as the entity itself

+

Check to see that paths can be loaded either as name strings, or as the entity itself

@@ -1321,7 +1339,7 @@

Drag-and-Drop image loading f -
addImageDragAndDrop(canvas, '#my-image-store', piccy);
+
addImageDragAndDrop(scrawl, canvas, '#my-image-store', piccy);
diff --git a/docs/demo/canvas-025.html b/docs/demo/canvas-025.html index ae7f5330..564ded8f 100644 --- a/docs/demo/canvas-025.html +++ b/docs/demo/canvas-025.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-026.html b/docs/demo/canvas-026.html index b3eefe9e..8344b1a9 100644 --- a/docs/demo/canvas-026.html +++ b/docs/demo/canvas-026.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-027.html b/docs/demo/canvas-027.html index 9812de95..350de701 100644 --- a/docs/demo/canvas-027.html +++ b/docs/demo/canvas-027.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-028.html b/docs/demo/canvas-028.html index f8abccdf..18904b97 100644 --- a/docs/demo/canvas-028.html +++ b/docs/demo/canvas-028.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-029.html b/docs/demo/canvas-029.html index 3ac2b469..eb2860ac 100644 --- a/docs/demo/canvas-029.html +++ b/docs/demo/canvas-029.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-030.html b/docs/demo/canvas-030.html index d8e37457..ebe9d624 100644 --- a/docs/demo/canvas-030.html +++ b/docs/demo/canvas-030.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1109,26 +1114,7 @@

Scene setup

    startX: 0,
-    startY: 0,
- - - - -
  • -
    - -
    - § -
    -

    The precision attribute determines the accuracy for positioning artefacts on the path when they have set their constantPathSpeed flag to true

    -
      -
    • Natural path speed leads to slower progression around tight corners; constant path speed attempts to even out these variations across the length of the path.
    • -
    • The default precision value is 10; decreasing the value increases the positioning accuracy. The more accurate the positioning, the greater the computational (and memory) burden.
    • -
    - -
    - -
        precision: 0.05,
    +    startY: 0,
     
         pivot: name('pivot-wheel'),
         lockTo: 'start',
    @@ -1148,11 +1134,11 @@ 

    Scene setup

  • -
  • +
  • - § + §

    Note: the bounding box dimensions reflect the minimum/maximum coordinates of all the pins used to construct the shape. It will only reflect the actual shape of the Shape when useAsPath attribute is set to true

    @@ -1163,11 +1149,11 @@

    Scene setup

  • -
  • +
  • - § + §

    Note: when using a Polyline entity as a pivot for other artefacts, set the useAsPath flag to true

      @@ -1176,7 +1162,26 @@

      Scene setup

    -
        useAsPath: true,
    +            
        useAsPath: true,
    + +
  • + + +
  • +
    + +
    + § +
    +

    The precision attribute determines the accuracy for positioning artefacts on the path when they have set their constantSpeedAlongPath flag to true

    +
      +
    • Natural path speed leads to slower progression around tight corners; constant path speed attempts to even out these variations across the length of the path.
    • +
    • The default precision value is 10; decreasing the value increases the positioning accuracy. The more accurate the positioning, the greater the computational (and memory) burden.
    • +
    + +
    + +
        precision: 0.05,
     
         bringToFrontOnDrag: false,
     });
    @@ -1446,7 +1451,7 @@

    Development and testing

    console.log('Performing tests ...'); -killPolylineArtefact(canvas, name('pin-2'), 3000, myline, () => myline.updatePinAt(name('pin-2'), 2)); +killPolylineArtefact(scrawl, canvas, name('pin-2'), 3000, myline, () => myline.updatePinAt(name('pin-2'), 2));
  • diff --git a/docs/demo/canvas-031.html b/docs/demo/canvas-031.html index 55023eff..cf2c38c5 100644 --- a/docs/demo/canvas-031.html +++ b/docs/demo/canvas-031.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-032.html b/docs/demo/canvas-032.html index bdb24266..adf7da05 100644 --- a/docs/demo/canvas-032.html +++ b/docs/demo/canvas-032.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-033.html b/docs/demo/canvas-033.html index 8ed27f87..bc2f8800 100644 --- a/docs/demo/canvas-033.html +++ b/docs/demo/canvas-033.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -982,7 +987,6 @@

    Scene setup

    }, useAsPath: true, - constantPathSpeed: true, precision: 0.1 }); @@ -1020,6 +1024,7 @@

    Scene setup

    layoutTemplate: name('loader-track'), useLayoutTemplateAsPath: true, + constantSpeedAlongPath: true, breakTextOnSpaces: false, diff --git a/docs/demo/canvas-034.html b/docs/demo/canvas-034.html index 3fdcce61..5e61f521 100644 --- a/docs/demo/canvas-034.html +++ b/docs/demo/canvas-034.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-035.html b/docs/demo/canvas-035.html index e374829b..57d1af01 100644 --- a/docs/demo/canvas-035.html +++ b/docs/demo/canvas-035.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-036.html b/docs/demo/canvas-036.html index e3db2ebf..7782f6a5 100644 --- a/docs/demo/canvas-036.html +++ b/docs/demo/canvas-036.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1026,7 +1031,6 @@

    Scene setup

    method: 'draw', useAsPath: true, - precision: 0.1, }); @@ -1058,7 +1062,7 @@

    Scene setup

    constantSpeedAlongPath: true, delta: { - pathPosition: -0.001, + pathPosition: -0.001, }, backgroundColor: 'black', diff --git a/docs/demo/canvas-037.html b/docs/demo/canvas-037.html index ba4fe572..a428a455 100644 --- a/docs/demo/canvas-037.html +++ b/docs/demo/canvas-037.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-038.html b/docs/demo/canvas-038.html index 476ed819..fa154c8f 100644 --- a/docs/demo/canvas-038.html +++ b/docs/demo/canvas-038.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-039.html b/docs/demo/canvas-039.html index 5a44872e..66992aea 100644 --- a/docs/demo/canvas-039.html +++ b/docs/demo/canvas-039.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1049,7 +1054,7 @@

    Scene setup

    scrawl.makeWheel({
     
    -    name: name('wheel-1'),
    +    name: name('wheel-red'),
         group: name('drag-group'),
     
         radius: 40,
    @@ -1061,23 +1066,24 @@ 

    Scene setup

    }).clone({ - name: name('wheel-2'), + name: name('wheel-blue'), start: [250, 250], fillStyle: 'blue', }).clone({ - name: name('wheel-3'), + name: name('wheel-green'), start: [350, 250], fillStyle: 'green', }).clone({ - name: name('wheel-4'), + name: name('wheel-yellow'), start: [350, 150], fillStyle: 'yellow', }); + scrawl.makeBlock({ name: name('block-1'), @@ -1110,6 +1116,27 @@

    Scene setup

    §
    +

    Test to make sure EnhancedLabel entitys can be used on non-base Cells

    + +
    + +
    scrawl.makeEnhancedLabel({
    +    name: name('label'),
    +    group: name('drag-group'),
    +    layoutTemplate: name('wheel-yellow'),
    +    text: 'Drag the dots around the canvas',
    +    justifyLine: 'space-around',
    +});
    + + + + +
  • +
    + +
    + § +

    Scene animation

    Function to display frames-per-second data, and other information relevant to the demo

    @@ -1134,11 +1161,11 @@

    Scene animation

  • -
  • +
  • - § + §

    Create the Display cycle animation

    @@ -1152,11 +1179,11 @@

    Scene animation

  • -
  • +
  • - § + §

    Non-base Cells do not routinely update their local here object, has to be triggered manually

    @@ -1172,11 +1199,11 @@

    Scene animation

  • -
  • +
  • - § + §

    User interaction

    Create the drag-and-drop zone

    @@ -1197,11 +1224,11 @@

    User interaction

  • -
  • +
  • - § + §

    For this demo we will suppress touchmove functionality over the canvas

    @@ -1217,11 +1244,11 @@

    User interaction

  • -
  • +
  • - § + §

    Setup form observer functionality

    @@ -1262,11 +1289,11 @@

    User interaction

  • -
  • +
  • - § + §

    Setup form

    @@ -1290,11 +1317,11 @@

    User interaction

  • -
  • +
  • - § + §

    Development and testing

    diff --git a/docs/demo/canvas-040.html b/docs/demo/canvas-040.html index 4785be03..57d35f34 100644 --- a/docs/demo/canvas-040.html +++ b/docs/demo/canvas-040.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-041.html b/docs/demo/canvas-041.html index e4c46b25..07ceaf77 100644 --- a/docs/demo/canvas-041.html +++ b/docs/demo/canvas-041.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-042.html b/docs/demo/canvas-042.html index 8be9b381..bdeead0a 100644 --- a/docs/demo/canvas-042.html +++ b/docs/demo/canvas-042.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-043.html b/docs/demo/canvas-043.html index d5fdc703..260e6deb 100644 --- a/docs/demo/canvas-043.html +++ b/docs/demo/canvas-043.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-044.html b/docs/demo/canvas-044.html index 4f67e632..bacabc5a 100644 --- a/docs/demo/canvas-044.html +++ b/docs/demo/canvas-044.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-045.html b/docs/demo/canvas-045.html index 549e921b..94cca1e2 100644 --- a/docs/demo/canvas-045.html +++ b/docs/demo/canvas-045.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-046.html b/docs/demo/canvas-046.html index 38b27af0..437d7ac1 100644 --- a/docs/demo/canvas-046.html +++ b/docs/demo/canvas-046.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-047.html b/docs/demo/canvas-047.html index 3b734e0c..bb01ecc4 100644 --- a/docs/demo/canvas-047.html +++ b/docs/demo/canvas-047.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-048.html b/docs/demo/canvas-048.html index b756815f..0274422a 100644 --- a/docs/demo/canvas-048.html +++ b/docs/demo/canvas-048.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-049.html b/docs/demo/canvas-049.html index f9d628da..47cfb85b 100644 --- a/docs/demo/canvas-049.html +++ b/docs/demo/canvas-049.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-050.html b/docs/demo/canvas-050.html index 8f03652e..dfb6cc4c 100644 --- a/docs/demo/canvas-050.html +++ b/docs/demo/canvas-050.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-051.html b/docs/demo/canvas-051.html index 748c22b1..f46f77e2 100644 --- a/docs/demo/canvas-051.html +++ b/docs/demo/canvas-051.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-052.html b/docs/demo/canvas-052.html index bca479a4..3be0793d 100644 --- a/docs/demo/canvas-052.html +++ b/docs/demo/canvas-052.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-053.html b/docs/demo/canvas-053.html index 56312670..707915f3 100644 --- a/docs/demo/canvas-053.html +++ b/docs/demo/canvas-053.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-054.html b/docs/demo/canvas-054.html index 04d1ee67..c05d51e3 100644 --- a/docs/demo/canvas-054.html +++ b/docs/demo/canvas-054.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-055.html b/docs/demo/canvas-055.html index cf3396a7..26ac07c0 100644 --- a/docs/demo/canvas-055.html +++ b/docs/demo/canvas-055.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-056.html b/docs/demo/canvas-056.html index 66b5ad49..17218926 100644 --- a/docs/demo/canvas-056.html +++ b/docs/demo/canvas-056.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -975,25 +980,40 @@

    Scene setup

    §
    -

    We use a Polyline entity as the guide along which we shall calculate the hairs for our Shape entity. The Polyline’s pins are a set of Wheel entitys which the user can drag around the canvas to reshape the Polyline

    +

    We use a Polyline entity as the guide along which we shall place our “frond” Shape entitys. The Polyline’s pins are a set of Wheel entitys which the user can drag around the canvas to reshape the Polyline

    -
    const firstPins = scrawl.makeGroup({
    -    name: name('first-pins'),
    -    host: canvas.getBase(),
    -});
    +            
    const pinGroup = scrawl.makeGroup({
     
    +    name: name('pins'),
    +    host: canvas.getBase(),
    +    order: 1,
    +});
    + +
  • + + +
  • +
    + +
    + § +
    +

    Use a pool coordinate to help quickly calculate the positions of the pins

    -const coord = scrawl.requestCoordinate(); +
    + +
    const coord = scrawl.requestCoordinate();
     
     for (let i = 0; i < noOfPins; i++) {
     
         coord.setFromArray([0, 200]).rotate(i * pinRotationAngle).add([300, 300]);
     
         scrawl.makeWheel({
    +
             name: name(`pin-1-${i}`),
    -        group: name('first-pins'),
    +        group: pinGroup,
     /** @ts-expect-error */
             start: [...coord],
             handle: ['center', 'center'],
    @@ -1001,173 +1021,166 @@ 

    Scene setup

    fillStyle: 'red', method: 'fillThenDraw', }); -} +}
    + +
  • + + +
  • +
    + +
    + § +
    +

    Always release a pool coordinate after we’re done using it!

    -scrawl.releaseCoordinate(coord); +
    + +
    scrawl.releaseCoordinate(coord);
     
     
    -const firstOutline = scrawl.makePolyline({
    +const rope = scrawl.makePolyline({
     
    -    name: name('first-outline'),
    -    pins: firstPins.get('artefacts'),
    +    name: name('rope'),
    +    pins: pinGroup.get('artefacts'),
         mapToPins: true,
         tension: 0.25,
         strokeStyle: 'green',
         method: 'draw',
         closed: true,
         useAsPath: true,
    -    constantPathSpeed: true,
     });
  • -
  • +
  • - § + §
    -

    The Shape entity starts with a minimal pathDefinition value. Note that the Shape’s start and handle attributes are centered; this entity does not pivot or mimic to the Polyline entity which is why their borders are often misaligned.

    +

    We’ll generate the frond entitys from a template

    -
    const secondOutline = scrawl.makeShape({
    +            
    const template = scrawl.makeShape({
     
    -    name: name('second-outline'),
    -    pathDefinition: 'm0,0',
    -    start: ['center', 'center'],
    -    handle: ['center', 'center'],
    +    name: name('frond-template'),
    +    path: rope,
    +    constantSpeedAlongPath: true,
    +    pathDefinition: 'm0,0 l0,0',
         lineWidth: 4,
         lineCap: 'round',
         strokeStyle: 'darkslategray',
         method: 'draw',
    +    visibility: false,
     });
  • -
  • +
  • - § + §
    -

    We recalculate the Shape entity’s pathDefinition value each time the user updates a control or drags one of the Polyline entity’s pins.

    +

    All frond entitys go into their own group

    -
    let currentOutline = '';
    +            
    const fronds = scrawl.makeGroup({
     
    -const checkOutlines = function () {
    -
    -    const outline = firstOutline.get('pathDefinition');
    -
    -    if (outline !== currentOutline) {
    -
    -        currentOutline = outline;
    + name: name('fronds'), + host: canvas.getBase(), +});
  • -
  • +
  • - § + §
    -

    Rotations are calculated with the help of a pool Coordinate object

    +

    The flag stores a copy of the rope entitys pathDefinition string.

    +
      +
    • When the pathDefinition changes (user action) or we set it to an empty string, we’ll regenerate all of the fronds
    • +
    -
            const coord = scrawl.requestCoordinate();
    +
    let flag = '';
    +
    +const checkOutlines = function () {
    +
    +    const def = rope.get('pathDefinition');
    +
    +    if (def !== flag) {
    +
    +        flag = def;
  • -
  • +
  • - § + §
    -

    Get the number generator

    +

    We’ll just kill all the existing fronds and regenerate them

    -
            const numberGenerator = scrawl.seededRandomNumberGenerator('hello-world');
    -
    -        let pos, x, y, a, dx, dy;
    -        let line = '';
    -
    -        for (let i = 0; i < densityValue; i++) {
    +
            fronds.killArtefacts();
  • -
  • +
  • - § + §
    -

    getPathPositionData returns an Object with attributes x, y, angle.

    -
      -
    • The first argument is a float Number value between 0 and 1, representing the relative position of the required point along the path.
    • -
    • The second argument is a boolean which, when set to true, will return the constant speed coordinate rather than the natural speed coordinate.
    • -
    +

    The “random” numbers will be the same values and order every time this regeneration runs

    -
                pos = firstOutline.getPathPositionData(i / densityValue, true);
    -            x = pos.x;
    -            y = pos.y;
    +            
            const numberGenerator = scrawl.seededRandomNumberGenerator('hello-world');
     
    -            if (pathrollValue) {
    +        for (let i = 0; i < densityValue; i++) {
     
    -                a = pos.angle + 90;
    +            template.clone({
     
    -                coord.set(0, numberGenerator.random() * lengthValue).rotate(a + (numberGenerator.random() * rotationValue)).add([x, y]);
    -            }
    -            else {
    +                name: name(`frond-${i}`),
    +                group: fronds,
     
    -                coord.set(0, numberGenerator.random() * lengthValue).rotate(numberGenerator.random() * rotationValue).add([x, y]);
    -            }
    -            [dx, dy] = coord;
    +                pathDefinition: `m0,0 l0,${lengthValue * numberGenerator.random()}`,
     
    -            line += `M${x},${y}L${dx},${dy}`;
    -        }
    - -
  • - - -
  • -
    - -
    - § -
    -

    Return the Coordinate object back to the pool - failure to do this leads to memory leaks!

    - -
    - -
            scrawl.releaseCoordinate(coord);
    +                visibility: true,
     
    +                pathPosition: numberGenerator.random(),
    +                lockTo: 'path',
     
    -        secondOutline.set({
    -            pathDefinition: line,
    -        });
    +                roll: rotationValue * numberGenerator.random(),
    +                addPathRotation: pathrollValue,
    +            });
    +        }
         }
     };
  • -
  • +
  • - § + §

    Scene animation

    Function to display frames-per-second data, and other information relevant to the demo

    @@ -1185,11 +1198,11 @@

    Scene animation

  • -
  • +
  • - § + §

    Create the Display cycle animation

    @@ -1206,11 +1219,11 @@

    Scene animation

  • -
  • +
  • - § + §

    User interaction

    @@ -1218,7 +1231,7 @@

    User interaction

    scrawl.makeDragZone({
         zone: canvas,
    -    collisionGroup: name('first-pins'),
    +    collisionGroup: pinGroup,
         endOn: ['up', 'leave'],
         preventTouchDefaultWhenDragging: true,
     });
    @@ -1235,28 +1248,28 @@ 

    User interaction

  • -
  • +
  • - § + §
    -

    Setting the currentOutline variable to a null string guarantees that the Shape entity’s pathDefinition will be recalculated at the start of the next Display cycle

    +

    Setting the flag variable to a null string guarantees that the frond entitys will be recalculated at the start of the next Display cycle

    -
        currentOutline = '';
    +            
        flag = '';
     
     }, '.controlItem');
  • -
  • +
  • - § + §

    Setup form

    @@ -1272,11 +1285,11 @@

    User interaction

  • -
  • +
  • - § + §

    Development and testing

    diff --git a/docs/demo/canvas-057.html b/docs/demo/canvas-057.html index a0c68f81..a8784587 100644 --- a/docs/demo/canvas-057.html +++ b/docs/demo/canvas-057.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1388,6 +1393,7 @@

    Drag-and-Drop image loading f
    addImageDragAndDrop(
     
    +    scrawl,
         canvas,
         '#my-image-store',
         backgroundImage,
    diff --git a/docs/demo/canvas-058.html b/docs/demo/canvas-058.html
    index 46de6f37..f843ca86 100644
    --- a/docs/demo/canvas-058.html
    +++ b/docs/demo/canvas-058.html
    @@ -375,6 +375,11 @@
                     
                   
                     
    +                
    +                  ./demo/canvas-212.js
    +                
    +              
    +                
                     
                       ./demo/delaunator-001.js
                     
    diff --git a/docs/demo/canvas-059.html b/docs/demo/canvas-059.html
    index a1d13bb6..2d52014a 100644
    --- a/docs/demo/canvas-059.html
    +++ b/docs/demo/canvas-059.html
    @@ -375,6 +375,11 @@
                     
                   
                     
    +                
    +                  ./demo/canvas-212.js
    +                
    +              
    +                
                     
                       ./demo/delaunator-001.js
                     
    diff --git a/docs/demo/canvas-060.html b/docs/demo/canvas-060.html
    index 21b6c8a2..622ffcde 100644
    --- a/docs/demo/canvas-060.html
    +++ b/docs/demo/canvas-060.html
    @@ -375,6 +375,11 @@
                     
                   
                     
    +                
    +                  ./demo/canvas-212.js
    +                
    +              
    +                
                     
                       ./demo/delaunator-001.js
                     
    diff --git a/docs/demo/canvas-201.html b/docs/demo/canvas-201.html
    index 5f3b1f3c..ac4ccfbe 100644
    --- a/docs/demo/canvas-201.html
    +++ b/docs/demo/canvas-201.html
    @@ -375,6 +375,11 @@
                     
                   
                     
    +                
    +                  ./demo/canvas-212.js
    +                
    +              
    +                
                     
                       ./demo/delaunator-001.js
                     
    @@ -1209,8 +1214,8 @@ 

    Development and testing

    console.log('Performing tests ...');
    -killArtefact(canvas, name('mylabel_fill'), 4000);
    -killArtefact(canvas, name('mylabel_fillAndDraw'), 6000);
    +killArtefact(scrawl, canvas, name('mylabel_fill'), 4000); +killArtefact(scrawl, canvas, name('mylabel_fillAndDraw'), 6000);

  • diff --git a/docs/demo/canvas-202.html b/docs/demo/canvas-202.html index c0405be4..d6616b33 100644 --- a/docs/demo/canvas-202.html +++ b/docs/demo/canvas-202.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-203.html b/docs/demo/canvas-203.html index feb84fa7..8a8c59dc 100644 --- a/docs/demo/canvas-203.html +++ b/docs/demo/canvas-203.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-204.html b/docs/demo/canvas-204.html index 73a46e99..5053c922 100644 --- a/docs/demo/canvas-204.html +++ b/docs/demo/canvas-204.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-205.html b/docs/demo/canvas-205.html index ccbe1aba..84c663b8 100644 --- a/docs/demo/canvas-205.html +++ b/docs/demo/canvas-205.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-206.html b/docs/demo/canvas-206.html index 02818b38..3a50621e 100644 --- a/docs/demo/canvas-206.html +++ b/docs/demo/canvas-206.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-207.html b/docs/demo/canvas-207.html index 9d143ba8..4763566d 100644 --- a/docs/demo/canvas-207.html +++ b/docs/demo/canvas-207.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-208.html b/docs/demo/canvas-208.html index d7cc1e37..56d151a9 100644 --- a/docs/demo/canvas-208.html +++ b/docs/demo/canvas-208.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -948,7 +953,6 @@

    Scene setup

    drawFromLoop: 2, scaleOutline: false, useAsPath: true, - constantPathSpeed: true, }); const mylabel = scrawl.makeEnhancedLabel({ diff --git a/docs/demo/canvas-209.html b/docs/demo/canvas-209.html index bf5d4202..cb3c5149 100644 --- a/docs/demo/canvas-209.html +++ b/docs/demo/canvas-209.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-210.html b/docs/demo/canvas-210.html index 77a1ab77..254c4c0c 100644 --- a/docs/demo/canvas-210.html +++ b/docs/demo/canvas-210.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/canvas-211.html b/docs/demo/canvas-211.html index 5ad26d82..df7ed0f1 100644 --- a/docs/demo/canvas-211.html +++ b/docs/demo/canvas-211.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1101,7 +1106,6 @@

    Create entitys

    drawFromLoop: 2, scaleOutline: false, useAsPath: true, - constantPathSpeed: true, }); const mylabel = scrawl.makeEnhancedLabel({ diff --git a/docs/demo/canvas-212.html b/docs/demo/canvas-212.html new file mode 100644 index 00000000..dbcb9e4f --- /dev/null +++ b/docs/demo/canvas-212.html @@ -0,0 +1,1300 @@ + + + + + Demo Canvas 212 + + + + + +
    +
    + + + +
      + + + +
    • +
      + +
      + § +
      +

      Demo Canvas 212

      +

      EnhancedLabel entity - updating font parts; experiments with variable font

      + +
      + +
    • + + +
    • +
      + +
      + § +
      +

      Run code

      + +
      + +
      import * as scrawl from '../source/scrawl.js';
      +
      +import { reportSpeed, initializeDomInputs } from './utilities.js';
      + +
    • + + +
    • +
      + +
      + § +
      +

      Scene setup

      +

      Get a handle to the Canvas wrapper

      + +
      + +
      const canvas = scrawl.findCanvas('mycanvas');
      + +
    • + + +
    • +
      + +
      + § +
      +

      Namespacing boilerplate

      + +
      + +
      const namespace = canvas.name;
      +const name = (n) => `${namespace}-${n}`;
      +
      +
      +scrawl.makeGradient({
      +    name: name('linear-gradient'),
      +    endX: '100%',
      +    endY: '100%',
      +
      +    colors: [
      +        [0, 'black'],
      +        [99, 'black'],
      +        [100, 'red'],
      +        [199, 'red'],
      +        [200, 'black'],
      +        [299, 'black'],
      +        [300, 'blue'],
      +        [399, 'blue'],
      +        [400, 'black'],
      +        [499, 'black'],
      +        [500, 'green'],
      +        [599, 'green'],
      +        [600, 'black'],
      +        [699, 'black'],
      +        [700, 'orange'],
      +        [799, 'orange'],
      +        [800, 'black'],
      +        [899, 'black'],
      +        [900, 'yellow'],
      +        [999, 'yellow'],
      +    ],
      +    colorSpace: 'OKLAB',
      +    precision: 5,
      +});
      +
      +scrawl.makePattern({
      +
      +    name: name('water-pattern'),
      +    imageSource: 'img/water.png',
      +});
      +
      +scrawl.makeBlock({
      +
      +    name: name('block-template'),
      +
      +    start: ['25%', 'center'],
      +    handle: ['center', 'center'],
      +    dimensions: ['40%', '80%'],
      +
      +    method: 'none',
      +});
      +
      +const myLabel = scrawl.makeEnhancedLabel({
      +
      +    name: name('block-label'),
      +
      +    layoutTemplate: name('block-template'),
      +    fontString: '25px "Roboto Flex"',
      +    text: 'Lorem ipsum dolor sit amet, con&shy;sectetur 😀 adi&shy;piscing &eacute;lit, <span style="font-size: 120%;">sed do eius-mod tempor in&shy;cididunt</span> ut <span style="--SC-fill-style: slategray">labore et dolore</span> magna aliqua.',
      +
      +    justifyLine: 'start',
      +    textHandle: ['center', 'alphabetic'],
      +    lockFillStyleToEntity: true,
      +});
      +
      +scrawl.makeLine({
      +
      +    name: name('line'),
      +
      +    start: ['55%', '90%'],
      +    end: ['90%', '10%'],
      +
      +    useAsPath: true,
      +    useStartAsControlPoint: true,
      +
      +    method: 'none',
      +});
      +
      +scrawl.makeQuadratic({
      +
      +    name: name('quadratic'),
      +
      +    start: ['55%', '90%'],
      +    control: ['60%', '50%'],
      +    end: ['90%', '10%'],
      +
      +    useAsPath: true,
      +    useStartAsControlPoint: true,
      +    precision: 1,
      +
      +    method: 'none',
      +});
      +
      +scrawl.makeBezier({
      +
      +    name: name('bezier'),
      +
      +    start: ['55%', '90%'],
      +    startControl: ['80%', '60%'],
      +    endControl: ['70%', '40%'],
      +    end: ['90%', '10%'],
      +
      +    useAsPath: true,
      +    useStartAsControlPoint: true,
      +    precision: 1,
      +
      +    method: 'draw',
      +});
      +
      +scrawl.makeOval({
      +
      +    name: name('oval'),
      +
      +    start: ['75%', '50%'],
      +    handle: ['center', 'center'],
      +    radiusX: '15%',
      +    radiusY: '35%',
      +    roll: 30,
      +
      +    useAsPath: true,
      +    precision: 1,
      +
      +    method: 'none',
      +});
      +
      +scrawl.makeEnhancedLabel({
      +
      +    name: name('path-label'),
      +
      +    layoutTemplate: name('bezier'),
      +    fontString: '25px "Roboto Flex"',
      +    text: 'Lorem ipsum dolor sit amet',
      +
      +    useLayoutTemplateAsPath: true,
      +    breakTextOnSpaces: false,
      +
      +    textHandle: ['center', 'alphabetic'],
      +    lockFillStyleToEntity: true,
      +
      +    delta: {
      +        pathPosition: -0.002,
      +    },
      +});
      +
      +scrawl.makeEnhancedLabel({
      +
      +    name: name('check-label'),
      +
      +    layoutTemplate: name('bezier'),
      +    fontString: '25px serif',
      +    text: 'Lorem ipsum dolor sit amet',
      +
      +    useLayoutTemplateAsPath: true,
      +    breakTextOnSpaces: false,
      +
      +    textHandle: ['center', '-100%'],
      +});
      +
      +scrawl.makeWheel({
      +
      +    name: name('start-mark'),
      +    radius: 4,
      +    handle: ['center', 'center'],
      +    path: name('bezier'),
      +    constantSpeedAlongPath: true,
      +    lockTo: 'path',
      +    fillStyle: 'yellow',
      +    method: 'fillThenDraw',
      +    delta: {
      +        pathPosition: -0.002,
      +    },
      +});
      +
      +
      +const labelGroup = scrawl.makeGroup({
      +
      +    name: name('labels-group'),
      +
      +}).addArtefacts(name('block-label'), name('path-label'), name('check-label'));
      +
      +
      +const pathLabelsGroup = scrawl.makeGroup({
      +
      +    name: name('path-labels-group'),
      +
      +}).addArtefacts(name('path-label'), name('check-label'), name('start-mark'));
      +
      +
      +const pathGroup = scrawl.makeGroup({
      +
      +    name: name('paths-group'),
      +
      +}).addArtefacts(name('line'), name('quadratic'), name('bezier'), name('oval'));
      + +
    • + + +
    • +
      + +
      + § +
      +

      Scene animation

      +

      Function to display frames-per-second data, and other information relevant to the demo

      + +
      + +
      const report = reportSpeed('#reportmessage', () => {
      +    return `
      +Font.details:
      +    Font string (entity): ${myLabel.get('fontString')}
      +    Font string (canvas): ${myLabel.get('canvasFont')}
      +
      +    Font size: ${myLabel.get('fontSize')}
      +    Font style: ${myLabel.get('fontStyle')}
      +    Font stretch: ${myLabel.get('fontStretch')}
      +    Font variant: ${myLabel.get('fontVariantCaps')}
      +    Font weight: ${myLabel.get('fontWeight')}
      +    `;
      +});
      + +
    • + + +
    • +
      + +
      + § +
      +

      Create the Display cycle animation

      + +
      + +
      scrawl.makeRender({
      +
      +    name: name('animation'),
      +    target: canvas,
      +    afterShow: report,
      +});
      + +
    • + + +
    • +
      + +
      + § +
      +

      User interaction

      +

      Setup form

      + +
      + +
      const dom = initializeDomInputs([
      +    ['input', 'roll', '0'],
      +    ['input', 'scale', '1'],
      +    ['input', 'fontWeight', '400'],
      +    ['input', 'fontStretch', '100'],
      +    ['select', 'fontSize', 0],
      +    ['select', 'fontVariantCaps', 0],
      +    ['select', 'fontStyle', 0],
      +    ['select', 'lockFillStyleToEntity', 1],
      +    ['select', 'fillStyle', 0],
      +    ['select', 'layoutTemplate', 2],
      +]);
      +
      +
      +scrawl.makeUpdater({
      +
      +    event: ['input', 'change'],
      +    origin: '.controlItem',
      +
      +    target: labelGroup,
      +
      +    useNativeListener: true,
      +    preventDefault: true,
      +
      +    updates: {
      +        fontSize: ['fontSize', 'raw'],
      +        roll: ['roll', 'float'],
      +        scale: ['scale', 'float'],
      +        fontWeight: ['fontWeight', 'int'],
      +        fontVariantCaps: ['fontVariantCaps', 'raw'],
      +        fontStyle: ['fontStyle', 'raw'],
      +        fontStretch: ['fontStretch', '%'],
      +        lockFillStyleToEntity: ['lockFillStyleToEntity', 'boolean'],
      +        fillStyle: ['fillStyle', 'raw'],
      +    },
      +});
      +
      +scrawl.addNativeListener(['input', 'change'], (e) => {
      +
      +    if (e && e.target) {
      +
      +        pathGroup.setArtefacts({ method: 'none' });
      +
      +        const selected = scrawl.findEntity(name(e.target.value));
      +
      +        if (selected) {
      +
      +            selected.set({ method: 'draw' });
      +
      +            pathLabelsGroup.setArtefacts({
      + +
    • + + +
    • +
      + +
      + § +
      +

      For the EnhancedLabel entitys

      + +
      + +
                      layoutTemplate: selected,
      + +
    • + + +
    • +
      + +
      + § +
      +

      For the wheel entity

      + +
      + +
                      path: selected,
      +            });
      +        }
      +    }
      +
      +}, dom.layoutTemplate);
      + +
    • + + +
    • +
      + +
      + § +
      +

      Development and testing

      + +
      + +
      console.log(scrawl.library);
      + +
    • + +
    +
    + + diff --git a/docs/demo/delaunator-001.html b/docs/demo/delaunator-001.html index 6e17090e..8cde886b 100644 --- a/docs/demo/delaunator-001.html +++ b/docs/demo/delaunator-001.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/delaunator-002.html b/docs/demo/delaunator-002.html index 1e59e570..be1e2a65 100644 --- a/docs/demo/delaunator-002.html +++ b/docs/demo/delaunator-002.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1521,7 +1526,7 @@

    Drag-and-Drop image loading f

    -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/dom-001.html b/docs/demo/dom-001.html index afd425fc..bf3ec585 100644 --- a/docs/demo/dom-001.html +++ b/docs/demo/dom-001.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-002.html b/docs/demo/dom-002.html index f3d424a0..b355038e 100644 --- a/docs/demo/dom-002.html +++ b/docs/demo/dom-002.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-003.html b/docs/demo/dom-003.html index f4b00015..e2f2f160 100644 --- a/docs/demo/dom-003.html +++ b/docs/demo/dom-003.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-004.html b/docs/demo/dom-004.html index 43cf98ad..2a055c52 100644 --- a/docs/demo/dom-004.html +++ b/docs/demo/dom-004.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1078,7 +1083,7 @@

    Development and testing

    console.log(scrawl.library);
     
     console.log('Performing tests ...');
    -killTicker(stack, name('template_ticker'), 4000);
    +killTicker(scrawl, stack, name('template_ticker'), 4000); diff --git a/docs/demo/dom-005.html b/docs/demo/dom-005.html index c819aef0..91c16bfd 100644 --- a/docs/demo/dom-005.html +++ b/docs/demo/dom-005.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-006.html b/docs/demo/dom-006.html index 1be4c964..da59dac3 100644 --- a/docs/demo/dom-006.html +++ b/docs/demo/dom-006.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-007.html b/docs/demo/dom-007.html index 940a9995..6e48c54f 100644 --- a/docs/demo/dom-007.html +++ b/docs/demo/dom-007.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-008.html b/docs/demo/dom-008.html index 30e4d936..f0646294 100644 --- a/docs/demo/dom-008.html +++ b/docs/demo/dom-008.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-009.html b/docs/demo/dom-009.html index b96cb3ba..605ef7c4 100644 --- a/docs/demo/dom-009.html +++ b/docs/demo/dom-009.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-010.html b/docs/demo/dom-010.html index 272771fc..a5c88548 100644 --- a/docs/demo/dom-010.html +++ b/docs/demo/dom-010.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-011.html b/docs/demo/dom-011.html index f2c64520..029ccee3 100644 --- a/docs/demo/dom-011.html +++ b/docs/demo/dom-011.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-012.html b/docs/demo/dom-012.html index f6c7e55f..fb05bdb3 100644 --- a/docs/demo/dom-012.html +++ b/docs/demo/dom-012.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-013.html b/docs/demo/dom-013.html index dde38158..8f649f0c 100644 --- a/docs/demo/dom-013.html +++ b/docs/demo/dom-013.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-015.html b/docs/demo/dom-015.html index b5853070..0f3c1414 100644 --- a/docs/demo/dom-015.html +++ b/docs/demo/dom-015.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1298,7 +1303,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop([canvas, element], `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, [canvas, element], `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/dom-016.html b/docs/demo/dom-016.html index b137003b..23c8bb2d 100644 --- a/docs/demo/dom-016.html +++ b/docs/demo/dom-016.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-017.html b/docs/demo/dom-017.html index c20673d5..663ad4a3 100644 --- a/docs/demo/dom-017.html +++ b/docs/demo/dom-017.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-018.html b/docs/demo/dom-018.html index 8e9ce33c..92d38f3b 100644 --- a/docs/demo/dom-018.html +++ b/docs/demo/dom-018.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-019.html b/docs/demo/dom-019.html index d6ccebdf..219c991c 100644 --- a/docs/demo/dom-019.html +++ b/docs/demo/dom-019.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/dom-020.html b/docs/demo/dom-020.html index 5549aa42..b9c35af4 100644 --- a/docs/demo/dom-020.html +++ b/docs/demo/dom-020.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -948,7 +953,7 @@

    Scene setup

    -
    addCheckerboardBackground(canvas, namespace);
    +
    addCheckerboardBackground(scrawl, canvas, namespace);
    @@ -1155,7 +1160,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/dom-021.html b/docs/demo/dom-021.html index e756f812..6fdf2764 100644 --- a/docs/demo/dom-021.html +++ b/docs/demo/dom-021.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/filters-001.html b/docs/demo/filters-001.html index 45c0d924..2323ed65 100644 --- a/docs/demo/filters-001.html +++ b/docs/demo/filters-001.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1316,7 +1321,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-002.html b/docs/demo/filters-002.html index 6cc2b692..a5a58a84 100644 --- a/docs/demo/filters-002.html +++ b/docs/demo/filters-002.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1167,7 +1172,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, pictureGroup);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, pictureGroup);
    diff --git a/docs/demo/filters-002a.html b/docs/demo/filters-002a.html index 087dfd41..ae589b81 100644 --- a/docs/demo/filters-002a.html +++ b/docs/demo/filters-002a.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1222,7 +1227,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, pictureGroup, cacheAction);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, pictureGroup, cacheAction);
    diff --git a/docs/demo/filters-003.html b/docs/demo/filters-003.html index 021e9841..52dc091a 100644 --- a/docs/demo/filters-003.html +++ b/docs/demo/filters-003.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1238,7 +1243,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, pictureGroup);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, pictureGroup);
    diff --git a/docs/demo/filters-004.html b/docs/demo/filters-004.html index b24c9135..6f4526bc 100644 --- a/docs/demo/filters-004.html +++ b/docs/demo/filters-004.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1131,7 +1136,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-005.html b/docs/demo/filters-005.html index c185fb9d..0e402930 100644 --- a/docs/demo/filters-005.html +++ b/docs/demo/filters-005.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1106,7 +1111,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-006.html b/docs/demo/filters-006.html index 8dd97414..2d97eee7 100644 --- a/docs/demo/filters-006.html +++ b/docs/demo/filters-006.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1113,7 +1118,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-007.html b/docs/demo/filters-007.html index af366387..f8a62887 100644 --- a/docs/demo/filters-007.html +++ b/docs/demo/filters-007.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1105,7 +1110,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-008.html b/docs/demo/filters-008.html index 78a96ee6..34c7cda8 100644 --- a/docs/demo/filters-008.html +++ b/docs/demo/filters-008.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1216,7 +1221,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-009.html b/docs/demo/filters-009.html index aa277466..5bff0547 100644 --- a/docs/demo/filters-009.html +++ b/docs/demo/filters-009.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1114,7 +1119,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-010.html b/docs/demo/filters-010.html index 1e79fd3d..8e00f7a5 100644 --- a/docs/demo/filters-010.html +++ b/docs/demo/filters-010.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -960,7 +965,7 @@

    Scene setup

    -
    addCheckerboardBackground(canvas, namespace);
    +
    addCheckerboardBackground(scrawl, canvas, namespace);
    @@ -1113,11 +1118,10 @@

    User interaction

    §

    Drag-and-Drop image loading functionality

    -

    addImageDragAndDrop(canvas, ‘#my-image-store’, piccy);

    -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-011.html b/docs/demo/filters-011.html index e511f608..cb67ccd3 100644 --- a/docs/demo/filters-011.html +++ b/docs/demo/filters-011.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -960,7 +965,7 @@

    Scene setup

    -
    addCheckerboardBackground(canvas, namespace);
    +
    addCheckerboardBackground(scrawl, canvas, namespace);
    @@ -1119,7 +1124,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-012.html b/docs/demo/filters-012.html index 13907275..a4e94c76 100644 --- a/docs/demo/filters-012.html +++ b/docs/demo/filters-012.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1189,7 +1194,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-013.html b/docs/demo/filters-013.html index a3b07e02..43eac372 100644 --- a/docs/demo/filters-013.html +++ b/docs/demo/filters-013.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1156,7 +1161,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-014.html b/docs/demo/filters-014.html index 20987bfe..188768db 100644 --- a/docs/demo/filters-014.html +++ b/docs/demo/filters-014.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -960,7 +965,7 @@

    Scene setup

    -
    addCheckerboardBackground(canvas, namespace);
    +
    addCheckerboardBackground(scrawl, canvas, namespace);
    @@ -1156,7 +1161,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-015.html b/docs/demo/filters-015.html index 534c642f..f1a98316 100644 --- a/docs/demo/filters-015.html +++ b/docs/demo/filters-015.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1200,7 +1205,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-016.html b/docs/demo/filters-016.html index 2292ccc7..f8080e6b 100644 --- a/docs/demo/filters-016.html +++ b/docs/demo/filters-016.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1093,7 +1098,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-017.html b/docs/demo/filters-017.html index 8f1bf066..439c72b4 100644 --- a/docs/demo/filters-017.html +++ b/docs/demo/filters-017.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1125,7 +1130,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-018.html b/docs/demo/filters-018.html index 0015d9f7..b3de6627 100644 --- a/docs/demo/filters-018.html +++ b/docs/demo/filters-018.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -960,7 +965,7 @@

    Scene setup

    -
    addCheckerboardBackground(canvas, namespace);
    +
    addCheckerboardBackground(scrawl, canvas, namespace);
    @@ -1154,7 +1159,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-019.html b/docs/demo/filters-019.html index daa525f6..a355a597 100644 --- a/docs/demo/filters-019.html +++ b/docs/demo/filters-019.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1138,7 +1143,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, myPictures);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, myPictures);
    diff --git a/docs/demo/filters-020.html b/docs/demo/filters-020.html index 87838ab6..611c1054 100644 --- a/docs/demo/filters-020.html +++ b/docs/demo/filters-020.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1165,7 +1170,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-021.html b/docs/demo/filters-021.html index 2f3daa83..743295a5 100644 --- a/docs/demo/filters-021.html +++ b/docs/demo/filters-021.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1195,7 +1200,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-022.html b/docs/demo/filters-022.html index e5633875..98603c81 100644 --- a/docs/demo/filters-022.html +++ b/docs/demo/filters-022.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1262,7 +1267,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-023.html b/docs/demo/filters-023.html index 7ed9059f..4ad702c3 100644 --- a/docs/demo/filters-023.html +++ b/docs/demo/filters-023.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1113,7 +1118,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-024.html b/docs/demo/filters-024.html index 9e0d0eef..4e71cee2 100644 --- a/docs/demo/filters-024.html +++ b/docs/demo/filters-024.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1474,7 +1479,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(oCanvas, `#${oNamespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, oCanvas, `#${oNamespace} .assets`, piccy);
    diff --git a/docs/demo/filters-025.html b/docs/demo/filters-025.html index 7f192251..e3fbcd9f 100644 --- a/docs/demo/filters-025.html +++ b/docs/demo/filters-025.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -960,7 +965,7 @@

    Scene setup

    -
    addCheckerboardBackground(canvas, namespace);
    +
    addCheckerboardBackground(scrawl, canvas, namespace);
    @@ -1138,7 +1143,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-026.html b/docs/demo/filters-026.html index 906417ff..5a0edb14 100644 --- a/docs/demo/filters-026.html +++ b/docs/demo/filters-026.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1186,7 +1191,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-027.html b/docs/demo/filters-027.html index 19478c30..a21e3821 100644 --- a/docs/demo/filters-027.html +++ b/docs/demo/filters-027.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1154,7 +1159,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop([canvas1, canvas2], `#${namespace2} .assets`, [dithered, original]);
    +
    addImageDragAndDrop(scrawl, [canvas1, canvas2], `#${namespace2} .assets`, [dithered, original]);
    diff --git a/docs/demo/filters-028.html b/docs/demo/filters-028.html index a2188b40..6fa4c4af 100644 --- a/docs/demo/filters-028.html +++ b/docs/demo/filters-028.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1588,7 +1593,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-101.html b/docs/demo/filters-101.html index 1c5d5f43..7471464d 100644 --- a/docs/demo/filters-101.html +++ b/docs/demo/filters-101.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -960,7 +965,7 @@

    Scene setup

    -
    addCheckerboardBackground(canvas, namespace);
    +
    addCheckerboardBackground(scrawl, canvas, namespace);
    @@ -1247,7 +1252,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, imageFilter);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, imageFilter);
    diff --git a/docs/demo/filters-102.html b/docs/demo/filters-102.html index c852cee2..b903d430 100644 --- a/docs/demo/filters-102.html +++ b/docs/demo/filters-102.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -960,7 +965,7 @@

    Scene setup

    -
    addCheckerboardBackground(canvas, namespace);
    +
    addCheckerboardBackground(scrawl, canvas, namespace);
    @@ -1247,7 +1252,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, imageFilter);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, imageFilter);
    diff --git a/docs/demo/filters-103.html b/docs/demo/filters-103.html index 17e0eb97..9a4b3c60 100644 --- a/docs/demo/filters-103.html +++ b/docs/demo/filters-103.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1688,7 +1693,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvases, `#canvas-1 .assets`, pictures);
    +
    addImageDragAndDrop(scrawl, canvases, `#canvas-1 .assets`, pictures);
    diff --git a/docs/demo/filters-104.html b/docs/demo/filters-104.html index 3e05bf32..212d12a1 100644 --- a/docs/demo/filters-104.html +++ b/docs/demo/filters-104.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1352,7 +1357,7 @@

    Build the scene

    -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, target);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, target);
    diff --git a/docs/demo/filters-105.html b/docs/demo/filters-105.html index f2129f60..1dc1c4f6 100644 --- a/docs/demo/filters-105.html +++ b/docs/demo/filters-105.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1321,7 +1326,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop([plainCanvas, filteredCanvas], `#${plainNamespace} .assets`, [plainImg, filteredImg]);
    +
    addImageDragAndDrop(scrawl, [plainCanvas, filteredCanvas], `#${plainNamespace} .assets`, [plainImg, filteredImg]);
    diff --git a/docs/demo/filters-501.html b/docs/demo/filters-501.html index 29b9d915..ccfa55c5 100644 --- a/docs/demo/filters-501.html +++ b/docs/demo/filters-501.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1119,7 +1124,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-502.html b/docs/demo/filters-502.html index d960203b..45d6db92 100644 --- a/docs/demo/filters-502.html +++ b/docs/demo/filters-502.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1064,7 +1069,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-503.html b/docs/demo/filters-503.html index 4abf7d44..1bcebc90 100644 --- a/docs/demo/filters-503.html +++ b/docs/demo/filters-503.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1082,7 +1087,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-504.html b/docs/demo/filters-504.html index 1f65de2b..f67df3bb 100644 --- a/docs/demo/filters-504.html +++ b/docs/demo/filters-504.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1078,7 +1083,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/filters-505.html b/docs/demo/filters-505.html index 21da0533..1dcd8118 100644 --- a/docs/demo/filters-505.html +++ b/docs/demo/filters-505.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1077,7 +1082,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, piccy);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, piccy);
    diff --git a/docs/demo/mediapipe-001.html b/docs/demo/mediapipe-001.html index f17773df..e85ee0a7 100644 --- a/docs/demo/mediapipe-001.html +++ b/docs/demo/mediapipe-001.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/mediapipe-002.html b/docs/demo/mediapipe-002.html index 4e276682..aa316ead 100644 --- a/docs/demo/mediapipe-002.html +++ b/docs/demo/mediapipe-002.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/mediapipe-003.html b/docs/demo/mediapipe-003.html index 7fca1abb..cabe3db0 100644 --- a/docs/demo/mediapipe-003.html +++ b/docs/demo/mediapipe-003.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules-001.html b/docs/demo/modules-001.html index 04981095..b5132fd8 100644 --- a/docs/demo/modules-001.html +++ b/docs/demo/modules-001.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules-002.html b/docs/demo/modules-002.html index 07974e9c..ecf7acac 100644 --- a/docs/demo/modules-002.html +++ b/docs/demo/modules-002.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules-003.html b/docs/demo/modules-003.html index d9b6f527..9e66acb8 100644 --- a/docs/demo/modules-003.html +++ b/docs/demo/modules-003.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules-004.html b/docs/demo/modules-004.html index 699ae9c7..4a9de571 100644 --- a/docs/demo/modules-004.html +++ b/docs/demo/modules-004.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules-005.html b/docs/demo/modules-005.html index d32b9d46..8a24c1b9 100644 --- a/docs/demo/modules-005.html +++ b/docs/demo/modules-005.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules-006.html b/docs/demo/modules-006.html index a8440a6f..6f60c7ad 100644 --- a/docs/demo/modules-006.html +++ b/docs/demo/modules-006.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/canvas-minimap.html b/docs/demo/modules/canvas-minimap.html index 14aa8f41..58b0215b 100644 --- a/docs/demo/modules/canvas-minimap.html +++ b/docs/demo/modules/canvas-minimap.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/canvas-scene-editor.html b/docs/demo/modules/canvas-scene-editor.html index 13265823..c16e1a88 100644 --- a/docs/demo/modules/canvas-scene-editor.html +++ b/docs/demo/modules/canvas-scene-editor.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/demo-m006-c1.html b/docs/demo/modules/demo-m006-c1.html index 29c8c17e..122fc716 100644 --- a/docs/demo/modules/demo-m006-c1.html +++ b/docs/demo/modules/demo-m006-c1.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/demo-m006-c2.html b/docs/demo/modules/demo-m006-c2.html index 8e1e4ce6..6ab8df72 100644 --- a/docs/demo/modules/demo-m006-c2.html +++ b/docs/demo/modules/demo-m006-c2.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/demo-m006-c3.html b/docs/demo/modules/demo-m006-c3.html index 4cb2d829..b0305ede 100644 --- a/docs/demo/modules/demo-m006-c3.html +++ b/docs/demo/modules/demo-m006-c3.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/demo-m006-c4.html b/docs/demo/modules/demo-m006-c4.html index 20f5939b..9372dfa3 100644 --- a/docs/demo/modules/demo-m006-c4.html +++ b/docs/demo/modules/demo-m006-c4.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/demo-m006-utils.html b/docs/demo/modules/demo-m006-utils.html index a62b2afc..b8eca96d 100644 --- a/docs/demo/modules/demo-m006-utils.html +++ b/docs/demo/modules/demo-m006-utils.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/dom-entity-editor.html b/docs/demo/modules/dom-entity-editor.html index b1ac206c..cc2fcdd4 100644 --- a/docs/demo/modules/dom-entity-editor.html +++ b/docs/demo/modules/dom-entity-editor.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/entity-copy-paste.html b/docs/demo/modules/entity-copy-paste.html index f48c415e..ce326d6a 100644 --- a/docs/demo/modules/entity-copy-paste.html +++ b/docs/demo/modules/entity-copy-paste.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/entity-manipulation-gui.html b/docs/demo/modules/entity-manipulation-gui.html index 1f3b69f2..f03180eb 100644 --- a/docs/demo/modules/entity-manipulation-gui.html +++ b/docs/demo/modules/entity-manipulation-gui.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/entity-navigation.html b/docs/demo/modules/entity-navigation.html index 7c26e91f..0d333594 100644 --- a/docs/demo/modules/entity-navigation.html +++ b/docs/demo/modules/entity-navigation.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/entity-ring-builder.html b/docs/demo/modules/entity-ring-builder.html index d0c3d808..fdb47531 100644 --- a/docs/demo/modules/entity-ring-builder.html +++ b/docs/demo/modules/entity-ring-builder.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/london-crime-lines.html b/docs/demo/modules/london-crime-lines.html index 6c4256d0..b439663a 100644 --- a/docs/demo/modules/london-crime-lines.html +++ b/docs/demo/modules/london-crime-lines.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/london-crime-stacked-bars.html b/docs/demo/modules/london-crime-stacked-bars.html index 3966edbe..eacc3ad3 100644 --- a/docs/demo/modules/london-crime-stacked-bars.html +++ b/docs/demo/modules/london-crime-stacked-bars.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/lottie-loader.html b/docs/demo/modules/lottie-loader.html index 55e43223..62b01d4c 100644 --- a/docs/demo/modules/lottie-loader.html +++ b/docs/demo/modules/lottie-loader.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/simple-chart-frame.html b/docs/demo/modules/simple-chart-frame.html index e7e21474..0b26ccb9 100644 --- a/docs/demo/modules/simple-chart-frame.html +++ b/docs/demo/modules/simple-chart-frame.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/simple-graph-lines.html b/docs/demo/modules/simple-graph-lines.html index 16a4b829..9d5ea470 100644 --- a/docs/demo/modules/simple-graph-lines.html +++ b/docs/demo/modules/simple-graph-lines.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/simple-graph-stacked-bars.html b/docs/demo/modules/simple-graph-stacked-bars.html index 410cd666..cb429392 100644 --- a/docs/demo/modules/simple-graph-stacked-bars.html +++ b/docs/demo/modules/simple-graph-stacked-bars.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/modules/wikipedia-views-spiral-chart.html b/docs/demo/modules/wikipedia-views-spiral-chart.html index 87e3e2b4..14fcd4e3 100644 --- a/docs/demo/modules/wikipedia-views-spiral-chart.html +++ b/docs/demo/modules/wikipedia-views-spiral-chart.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/packets-001.html b/docs/demo/packets-001.html index 6f5cebf0..ceed4294 100644 --- a/docs/demo/packets-001.html +++ b/docs/demo/packets-001.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/packets-002.html b/docs/demo/packets-002.html index e5b94578..c3fdcc09 100644 --- a/docs/demo/packets-002.html +++ b/docs/demo/packets-002.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-001.html b/docs/demo/particles-001.html index dabdd958..83a12411 100644 --- a/docs/demo/particles-001.html +++ b/docs/demo/particles-001.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-002.html b/docs/demo/particles-002.html index 67a950af..98b9d9ec 100644 --- a/docs/demo/particles-002.html +++ b/docs/demo/particles-002.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-003.html b/docs/demo/particles-003.html index 296f06be..d0179aac 100644 --- a/docs/demo/particles-003.html +++ b/docs/demo/particles-003.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-004.html b/docs/demo/particles-004.html index def67121..ee0fb968 100644 --- a/docs/demo/particles-004.html +++ b/docs/demo/particles-004.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-005.html b/docs/demo/particles-005.html index 7eaf886d..b0eca07d 100644 --- a/docs/demo/particles-005.html +++ b/docs/demo/particles-005.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-006.html b/docs/demo/particles-006.html index 1589245f..9bc0eeea 100644 --- a/docs/demo/particles-006.html +++ b/docs/demo/particles-006.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-007.html b/docs/demo/particles-007.html index 02f8f31a..7c9fe8cf 100644 --- a/docs/demo/particles-007.html +++ b/docs/demo/particles-007.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-008.html b/docs/demo/particles-008.html index 6f1356c1..34511910 100644 --- a/docs/demo/particles-008.html +++ b/docs/demo/particles-008.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-009.html b/docs/demo/particles-009.html index daa754f9..9795d192 100644 --- a/docs/demo/particles-009.html +++ b/docs/demo/particles-009.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-010.html b/docs/demo/particles-010.html index 22fcbc81..86e76117 100644 --- a/docs/demo/particles-010.html +++ b/docs/demo/particles-010.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-011.html b/docs/demo/particles-011.html index 4e3941cd..6d914c6d 100644 --- a/docs/demo/particles-011.html +++ b/docs/demo/particles-011.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-012.html b/docs/demo/particles-012.html index 07d7e8c4..390fa8a6 100644 --- a/docs/demo/particles-012.html +++ b/docs/demo/particles-012.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-013.html b/docs/demo/particles-013.html index edd8b149..046af989 100644 --- a/docs/demo/particles-013.html +++ b/docs/demo/particles-013.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-014.html b/docs/demo/particles-014.html index c0c777a6..55f6ae64 100644 --- a/docs/demo/particles-014.html +++ b/docs/demo/particles-014.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-015.html b/docs/demo/particles-015.html index b8ece2fa..3db57d1c 100644 --- a/docs/demo/particles-015.html +++ b/docs/demo/particles-015.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/particles-016.html b/docs/demo/particles-016.html index 4592695a..c148e2eb 100644 --- a/docs/demo/particles-016.html +++ b/docs/demo/particles-016.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -1173,7 +1178,7 @@

    Drag-and-Drop image loading f -
    addImageDragAndDrop(canvas, `#${namespace} .assets`, myPicture);
    +
    addImageDragAndDrop(scrawl, canvas, `#${namespace} .assets`, myPicture);
    diff --git a/docs/demo/rapier-001.html b/docs/demo/rapier-001.html index e64d31d6..03cf6d41 100644 --- a/docs/demo/rapier-001.html +++ b/docs/demo/rapier-001.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets-001.html b/docs/demo/snippets-001.html index a6251b39..439f231e 100644 --- a/docs/demo/snippets-001.html +++ b/docs/demo/snippets-001.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets-002.html b/docs/demo/snippets-002.html index 8ca9c291..7ae92c79 100644 --- a/docs/demo/snippets-002.html +++ b/docs/demo/snippets-002.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets-003.html b/docs/demo/snippets-003.html index 2fc829e6..2b57ab25 100644 --- a/docs/demo/snippets-003.html +++ b/docs/demo/snippets-003.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets-004.html b/docs/demo/snippets-004.html index 5d14db0a..db6182eb 100644 --- a/docs/demo/snippets-004.html +++ b/docs/demo/snippets-004.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets-005.html b/docs/demo/snippets-005.html index 7d2a163f..26f64d54 100644 --- a/docs/demo/snippets-005.html +++ b/docs/demo/snippets-005.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets-006.html b/docs/demo/snippets-006.html index a541d485..5816e597 100644 --- a/docs/demo/snippets-006.html +++ b/docs/demo/snippets-006.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/animated-highlight-gradient-text-snippet.html b/docs/demo/snippets/animated-highlight-gradient-text-snippet.html index 89c97fab..a3755a36 100644 --- a/docs/demo/snippets/animated-highlight-gradient-text-snippet.html +++ b/docs/demo/snippets/animated-highlight-gradient-text-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/animated-hover-gradient-snippet.html b/docs/demo/snippets/animated-hover-gradient-snippet.html index a8d43e04..83f4a43c 100644 --- a/docs/demo/snippets/animated-hover-gradient-snippet.html +++ b/docs/demo/snippets/animated-hover-gradient-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/animated-word-gradient-snippet.html b/docs/demo/snippets/animated-word-gradient-snippet.html index 881f6f04..61633a68 100644 --- a/docs/demo/snippets/animated-word-gradient-snippet.html +++ b/docs/demo/snippets/animated-word-gradient-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/before-after-slider-infographic.html b/docs/demo/snippets/before-after-slider-infographic.html index 94fcee50..16f69d09 100644 --- a/docs/demo/snippets/before-after-slider-infographic.html +++ b/docs/demo/snippets/before-after-slider-infographic.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/bubbles-text-snippet.html b/docs/demo/snippets/bubbles-text-snippet.html index bc78749f..6254c76a 100644 --- a/docs/demo/snippets/bubbles-text-snippet.html +++ b/docs/demo/snippets/bubbles-text-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/green-box-snippet.html b/docs/demo/snippets/green-box-snippet.html index cc471bac..2ef406f9 100644 --- a/docs/demo/snippets/green-box-snippet.html +++ b/docs/demo/snippets/green-box-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/jazzy-button-snippet.html b/docs/demo/snippets/jazzy-button-snippet.html index c9eba253..19e54520 100644 --- a/docs/demo/snippets/jazzy-button-snippet.html +++ b/docs/demo/snippets/jazzy-button-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/page-performance-snippet-test.html b/docs/demo/snippets/page-performance-snippet-test.html index f0722e13..2acf5eca 100644 --- a/docs/demo/snippets/page-performance-snippet-test.html +++ b/docs/demo/snippets/page-performance-snippet-test.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/page-performance-snippet.html b/docs/demo/snippets/page-performance-snippet.html index 9d39b1e0..032c397c 100644 --- a/docs/demo/snippets/page-performance-snippet.html +++ b/docs/demo/snippets/page-performance-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/pan-image-snippet.html b/docs/demo/snippets/pan-image-snippet.html index dd2b48e9..ecc2e15d 100644 --- a/docs/demo/snippets/pan-image-snippet.html +++ b/docs/demo/snippets/pan-image-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/placeholder-effect-snippet.html b/docs/demo/snippets/placeholder-effect-snippet.html index 997b5551..9ecc8b5b 100644 --- a/docs/demo/snippets/placeholder-effect-snippet.html +++ b/docs/demo/snippets/placeholder-effect-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/ripple-effect-snippet.html b/docs/demo/snippets/ripple-effect-snippet.html index bd10d1f8..959fd7e9 100644 --- a/docs/demo/snippets/ripple-effect-snippet.html +++ b/docs/demo/snippets/ripple-effect-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/risograph-text-gradient-snippet.html b/docs/demo/snippets/risograph-text-gradient-snippet.html index b967b958..a6489150 100644 --- a/docs/demo/snippets/risograph-text-gradient-snippet.html +++ b/docs/demo/snippets/risograph-text-gradient-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/spotlight-text-snippet-test.html b/docs/demo/snippets/spotlight-text-snippet-test.html index 45276321..b50e207b 100644 --- a/docs/demo/snippets/spotlight-text-snippet-test.html +++ b/docs/demo/snippets/spotlight-text-snippet-test.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/spotlight-text-snippet.html b/docs/demo/snippets/spotlight-text-snippet.html index b7377a7c..18cd166b 100644 --- a/docs/demo/snippets/spotlight-text-snippet.html +++ b/docs/demo/snippets/spotlight-text-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/swirling-stripes-text-snippet.html b/docs/demo/snippets/swirling-stripes-text-snippet.html index 2aa1ddd6..dc67986e 100644 --- a/docs/demo/snippets/swirling-stripes-text-snippet.html +++ b/docs/demo/snippets/swirling-stripes-text-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/word-highlighter-snippet.html b/docs/demo/snippets/word-highlighter-snippet.html index bfce4240..ef6478ad 100644 --- a/docs/demo/snippets/word-highlighter-snippet.html +++ b/docs/demo/snippets/word-highlighter-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/snippets/worley-text-gradient-snippet.html b/docs/demo/snippets/worley-text-gradient-snippet.html index de7e36d1..fd79e929 100644 --- a/docs/demo/snippets/worley-text-gradient-snippet.html +++ b/docs/demo/snippets/worley-text-gradient-snippet.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/tensorflow-001.html b/docs/demo/tensorflow-001.html index e2cc371d..4855bb03 100644 --- a/docs/demo/tensorflow-001.html +++ b/docs/demo/tensorflow-001.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/tensorflow-002.html b/docs/demo/tensorflow-002.html index c3850054..0d66a87a 100644 --- a/docs/demo/tensorflow-002.html +++ b/docs/demo/tensorflow-002.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js diff --git a/docs/demo/utilities.html b/docs/demo/utilities.html index 280a10c7..4555e766 100644 --- a/docs/demo/utilities.html +++ b/docs/demo/utilities.html @@ -375,6 +375,11 @@ + + ./demo/canvas-212.js + + + ./demo/delaunator-001.js @@ -885,21 +890,6 @@

    utilities.js

    §
    - - - -
    import * as scrawl from '../source/scrawl.js';
    -const L = scrawl.library;
    - - - - -
  • -
    - -
    - § -

    Function to display frames-per-second data, and other information relevant to the demo

    @@ -948,11 +938,11 @@

    utilities.js

  • -
  • +
  • - § + §

    Get a full, dynamic report on the Scrawl-canvas library’s current contents

    @@ -1037,17 +1027,19 @@

    utilities.js

  • -
  • +
  • - § + §

    Test to check that artefacts are properly killed and resurrected

    -
    const killArtefact = (canvas, name, time, finishResurrection = () => {}) => {
    +            
    const killArtefact = (scrawl, canvas, name, time, finishResurrection = () => {}) => {
    +
    +    const L = scrawl.library;
     
         if (canvas && canvas.base && name && time) {
     
    @@ -1109,17 +1101,19 @@ 

    utilities.js

  • -
  • +
  • - § + §

    To test styles (Gradient) kill functionality

    -
    const killStyle = (canvas, name, time, finishResurrection = () => {}) => {
    +            
    const killStyle = (scrawl, canvas, name, time, finishResurrection = () => {}) => {
    +
    +    const L = scrawl.library;
     
         if (canvas && canvas.base && name && time) {
     
    @@ -1161,17 +1155,19 @@ 

    utilities.js

  • -
  • +
  • - § + §

    To test artefact + anchor kill functionality

    -
    const killArtefactAndAnchor = (canvas, name, anchorname, time, finishResurrection = () => {}) => {
    +            
    const killArtefactAndAnchor = (scrawl, canvas, name, anchorname, time, finishResurrection = () => {}) => {
    +
    +    const L = scrawl.library;
     
         const groupname = 'mycanvas_base';
     
    @@ -1232,17 +1228,19 @@ 

    utilities.js

  • -
  • +
  • - § + §

    To test Polyline artefact kill functionality

    -
    const killPolylineArtefact = (canvas, name, time, myline, restore = () => {}) => {
    +            
    const killPolylineArtefact = (scrawl, canvas, name, time, myline, restore = () => {}) => {
    +
    +    const L = scrawl.library;
     
         const groupname = 'mycanvas_base';
     
    @@ -1310,7 +1308,9 @@ 

    utilities.js

    }, time); }; -const killTicker = (stack, name, time) => { +const killTicker = (scrawl, stack, name, time) => { + + const L = scrawl.library; let packet; @@ -1339,16 +1339,18 @@

    utilities.js

    }, time); }; -const addImageDragAndDrop = (canvas, selector, targets, callback = () => {}) => {
    +const addImageDragAndDrop = (scrawl, canvas, selector, targets, callback = () => {}) => { + + const L = scrawl.library;
  • -
  • +
  • - § + §

    Drag-and-Drop image loading functionality

    @@ -1402,11 +1404,11 @@

    Drag-and-Drop image loading f

  • -
  • +
  • - § + §

    Create a name for our new asset

    @@ -1418,11 +1420,11 @@

    Drag-and-Drop image loading f

  • -
  • +
  • - § + §

    Add the image to the DOM and create our asset from it

    @@ -1440,11 +1442,11 @@

    Drag-and-Drop image loading f

  • -
  • +
  • - § + §

    Update our Picture entity’s asset attribute so it displays the new image

    @@ -1469,11 +1471,11 @@

    Drag-and-Drop image loading f

  • -
  • +
  • - § + §

    HOW TO: set the Picture entity’s copy dimensions to take into account any difference between the old and new image’s dimensions

      @@ -1534,16 +1536,16 @@

      Drag-and-Drop image loading f }; }; -const addCheckerboardBackground = (canvas, namespace) => {

    +const addCheckerboardBackground = (scrawl, canvas, namespace) => {
  • -
  • +
  • - § + §

    Namespace boilerplate

    @@ -1554,11 +1556,11 @@

    Drag-and-Drop image loading f

  • -
  • +
  • - § + §

    Create the background

    diff --git a/docs/index.html b/docs/index.html index fee1911a..872d04b7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -20,7 +20,7 @@ -

    Scrawl-canvas documentation (for version 8.12.0)

    +

    Scrawl-canvas documentation (for version 8.13.1)

    Scrawl-canvas modules

    @@ -138,7 +138,7 @@

    Canvas text entity artefacts

    • mixin/text.js
    • untracked-factory/text-style.js
    • -
    • factory/enhancedLabel.js
    • +
    • factory/enhanced-label.js
      • makeEnhancedLabel
      @@ -476,6 +476,11 @@

      Other modules

      Scrawl Demo files

      Test Demo Index Page

      +

      Utilities file

      +
        +
      • utilities.js The utilities file includes some functionality common across the demo files. They are not part of the Scrawl-canvas codebase
      • +
      +

      Canvas demos

      • Canvas-001 Block and Wheel entitys (make, clone, method); drag and drop block and wheel entitys
      • @@ -550,6 +555,7 @@

        Canvas demos

      • Canvas-209 EnhancedLabel - clone entity, drag-drop; shadows, gradients and patterns
      • Canvas-210 EnhancedLabel - TextUnit dynamic manipulation
      • Canvas-211 EnhancedLabel entity - keyboard navigation; hit tests
      • +
      • Canvas-212 EnhancedLabel entity - updating font parts; experiments with variable font

      Filters demos

      diff --git a/docs/source/core/library.html b/docs/source/core/library.html index c70dafd0..8b7d48f6 100644 --- a/docs/source/core/library.html +++ b/docs/source/core/library.html @@ -607,7 +607,7 @@

      Core library

    -
    export const version = '8.13.0';
    +
    export const version = '8.13.1';
  • @@ -1031,6 +1031,12 @@

    Core library

    return null; } +export function findCell (item = '') { + + if (cellnames.includes(item)) return cell[item]; + return null; +} + export function findFilter (item = '') { if (filternames.includes(item)) return filter[item]; diff --git a/docs/source/factory/enhanced-label.html b/docs/source/factory/enhanced-label.html index 3129e6e7..a4bc774e 100644 --- a/docs/source/factory/enhanced-label.html +++ b/docs/source/factory/enhanced-label.html @@ -820,7 +820,8 @@

    EnhancedLabel attributes

    -
        pathPosition: 0,
    +
        pathPosition: 0,
    +    constantSpeedAlongPath: true,
    @@ -3240,6 +3241,7 @@

    Clean functions

    layoutTemplate, lines, pathPosition, + constantSpeedAlongPath, textHandle, textOffset, textUnitFlow, @@ -3342,7 +3344,7 @@

    Clean functions

    currentPos = currentLen / length; - unit.pathData = layoutTemplate.getPathPositionData(currentPos, true); + unit.pathData = layoutTemplate.getPathPositionData(currentPos, constantSpeedAlongPath); ({x, y, angle} = unit.pathData); tempX = offsetX - handleX; @@ -3387,7 +3389,7 @@

    Clean functions

    currentPos = currentLen / length; - unit.pathData = layoutTemplate.getPathPositionData(currentPos, true); + unit.pathData = layoutTemplate.getPathPositionData(currentPos, constantSpeedAlongPath); ({x, y, angle} = unit.pathData); tempX = offsetX - handleX; @@ -3407,7 +3409,8 @@

    Clean functions

    unit.localRotation = localAlignment * _radian; - currentLen += len - kernOffset - handleX; + currentLen -= handleX; + currentLen += (len - kernOffset); } unit.set({ boxData: null }); diff --git a/docs/source/factory/loom.html b/docs/source/factory/loom.html index 6b48db4a..b426762e 100644 --- a/docs/source/factory/loom.html +++ b/docs/source/factory/loom.html @@ -803,7 +803,7 @@

    Loom attributes

        loopPathCursors: true,
    -    constantPathSpeed: true,
    + constantSpeedAlongPath: true, @@ -1918,7 +1918,7 @@

    Display cycle functionality

    fPathEnd = this.fromPathEnd, tPathStart = this.toPathStart, tPathEnd = this.toPathEnd, - pathSpeed = this.constantPathSpeed; + pathSpeed = this.constantSpeedAlongPath; let fPartial, tPartial; diff --git a/docs/source/helper/shape-path-calculation.html b/docs/source/helper/shape-path-calculation.html index 1704d3cd..ae2e1e9c 100644 --- a/docs/source/helper/shape-path-calculation.html +++ b/docs/source/helper/shape-path-calculation.html @@ -1009,21 +1009,7 @@

    Export function

    const curData = myData[i], myPts = curData.p; - if (myPts) { - - for (j = 0, jz = myPts.length; j < jz; j++) { - - myPts[j] = myPts[j].toFixed(1); - } - - localPath += `${curData.c}${curData.p.join()}`; - - for (j = 0, jz = myPts.length; j < jz; j++) { - - myPts[j] = parseFloat(myPts[j]); - } - - } + if (myPts) localPath += `${curData.c}${curData.p.join()}`; else localPath += `${curData.c}`; } @@ -1184,11 +1170,10 @@

    Export function

    for (i = 0, iz = unitLengths.length; i < iz; i++) { mySum += unitLengths[i] / myLen; - unitPartials[i] = parseFloat(mySum.toFixed(6)); + unitPartials[i] = mySum; } } - - result.length = parseFloat(myLen.toFixed(1)); + result.length = myLen; diff --git a/docs/source/mixin/path.html b/docs/source/mixin/path.html index 446ffc28..747be9f3 100644 --- a/docs/source/mixin/path.html +++ b/docs/source/mixin/path.html @@ -684,7 +684,7 @@

    Shared attributes

    §
    -

    DEPRECATION WARNING: constantSpeedAlongPath replaces the old attribute constantPathSpeed which clashes with the attribute set by the ShapeBasic mixin.

    +

    constantSpeedAlongPath - Boolean flag. When set to true, corrections will be applied to make sure the artefact moves along the path at a constant speed (rather than slowing down when it approaches a bend)

    @@ -829,7 +829,7 @@

    Prototype functions

    if (item < 0) item = _abs(item); if (item > 1) item = item % 1; - this.pathPosition = parseFloat(item.toFixed(6)); + this.pathPosition = item; this.dirtyStampPositions = true; this.dirtyStampHandlePositions = true; this.currentPathData = false; @@ -841,7 +841,7 @@

    Prototype functions

    if (pos < 0) pos += 1; if (pos > 1) pos = pos % 1; - this.pathPosition = parseFloat(pos.toFixed(6)); + this.pathPosition = pos; this.dirtyStampPositions = true; this.dirtyStampHandlePositions = true; this.currentPathData = false; @@ -906,26 +906,11 @@

    Prototype functions

    if (this.currentPathData) return this.currentPathData; - const pos = this.pathPosition, - path = this.path; + const path = this.path; - if (path) { - - - - -
  • -
    - -
    - § -
    -

    Note: the old attribute constantPathSpeed has been deprecated because the ShapeBasic mixin adds that attributes to shapes where it has different functionality. This code is temporary until Scrawl-canvas v9 is released

    + if (path) { -
    - -
                const speed = this.constantSpeedAlongPath || this.constantPathSpeed || false;
    -            const val = path.getPathPositionData(pos, speed);
    +            const val = path.getPathPositionData(this.pathPosition, this.constantSpeedAlongPath);
     
                 if (this.addPathRotation) this.dirtyRotation = true;
     
    diff --git a/docs/source/mixin/position.html b/docs/source/mixin/position.html
    index 758db571..6dcdaa00 100644
    --- a/docs/source/mixin/position.html
    +++ b/docs/source/mixin/position.html
    @@ -1988,7 +1988,6 @@ 

    Prototype functions

    delete art.addPathHandle; delete art.addPathOffset; delete art.addPathRotation; - delete art.constantPathSpeed; break; case FILTER : diff --git a/docs/source/mixin/shape-basic.html b/docs/source/mixin/shape-basic.html index fa44e2dc..9940c5ea 100644 --- a/docs/source/mixin/shape-basic.html +++ b/docs/source/mixin/shape-basic.html @@ -658,7 +658,6 @@

    Shared attributes

    useAsPath: false, precision: 10, - constantPathSpeed: false, pathDefinition: ZERO_STR, @@ -753,12 +752,6 @@

    Get, Set, deltaSet

    this.precision = item; this.updateDirty(); } - }; - - S.constantPathSpeed = function (item) { - - this.constantPathSpeed = item; - this.updateDirty(); };
  • @@ -1059,84 +1052,44 @@ if (!_isFinite(pos)) return 0; if (pos >= 1) return 0.9999; - const positions = this.unitPositions; + const { unitPositions, unitProgression, length } = this; - if (positions && positions.length) { + if (unitPositions && unitPositions.length) { - const len = this.length, - progress = this.unitProgression, - requiredProgress = pos * len; + const arraysLen = unitPositions.length; - let indexProgress, lastProgress, diffProgress, - currentPosition, indexPosition, nextPosition, diffPosition, - index = -1; + let index = 0, + steadyDistance = 0, + dynamicDistance = 0, + sectionRatio; - for (let i = 0, iz = progress.length; i < iz; i++) { + for (let i = 0; i < arraysLen; i++) { - if (requiredProgress <= progress[i]) { + sectionRatio = unitProgression[i] / length; - index = i - 1; - break; + if (pos > sectionRatio) { + + steadyDistance = unitPositions[i]; + dynamicDistance = sectionRatio; + index++; } } - if (index < 0) { - - - - -
  • -
    - -
    - § -
    -

    first segment

    + const remainingDynamicDistance = (index) ? (pos - dynamicDistance) : pos; -
    - -
                    indexProgress = progress[0];
    -                currentPosition = (requiredProgress / indexProgress) * positions[0];
    -            }
    -            else {
    - -
  • - - -
  • -
    - -
    - § -
    -

    subsequent segments - progress is pixel lengths

    + const dynamicSegmentLength = (index) + ? (unitProgression[index] - unitProgression[index - 1]) / length + : unitProgression[index] / length; -
    - -
                    indexProgress = progress[index];
    -                lastProgress = (index) ? progress[index - 1] : 0;
    -                diffProgress = indexProgress - lastProgress;
    - -
  • - - -
  • -
    - -
    - § -
    -

    … and position is in the range 0-1

    + const steadySegmentLength = (index) + ? (unitPositions[index] - unitPositions[index - 1]) + : unitPositions[index]; -
    - -
                    indexPosition = positions[index];
    -                nextPosition = positions[index + 1];
    -                diffPosition = nextPosition - indexPosition;
    +            const steadyToDynamicRatio = steadySegmentLength / dynamicSegmentLength;
     
    -                currentPosition = indexPosition + (((requiredProgress - indexProgress) / diffProgress) * diffPosition);
    -            }
    -            return currentPosition;
    +            steadyDistance += (remainingDynamicDistance * steadyToDynamicRatio);
    +
    +            return steadyDistance;
             }
             else return pos;
         };
    @@ -1144,11 +1097,11 @@
  • -
  • +
  • - § + §

    buildPathPositionObject - internal function called by getPathPositionData

    @@ -1198,11 +1151,11 @@
  • -
  • +
  • - § + §

    getPathPositionData

      @@ -1226,11 +1179,11 @@ -
    • +
    • - § + §

      … because sometimes everything doesn’t all add up to 1

      @@ -1244,11 +1197,11 @@
    • -
    • +
    • - § + §
      1. Determine the pertinent subpath to use for calculation
      2. @@ -1268,11 +1221,11 @@ -
      3. +
      4. - § + §
        1. Calculate point along the subpath the pos value represents
        2. @@ -1296,11 +1249,11 @@ -
        3. +
        4. - § + §

          Display cycle functionality

          @@ -1309,11 +1262,11 @@

          Display cycle functionality

        5. -
        6. +
        7. - § + §

          prepareStamp - the purpose of most of these actions is described in the entity mixin function that this function overwrites

          @@ -1349,11 +1302,11 @@

          Display cycle functionality

        8. -
        9. +
        10. - § + §

          prepareStampTabsHelper is defined in the mixin/hidden-dom-elements.js file - handles updates to anchor and button objects

          @@ -1365,11 +1318,11 @@

          Display cycle functionality

        11. -
        12. +
        13. - § + §

          cleanDimensions - internal helper function called by prepareStamp

            @@ -1390,11 +1343,11 @@

            Display cycle functionality

            -
          • +
          • - § + §

            cleanPathObject - internal helper function - called by prepareStamp

            @@ -1427,11 +1380,11 @@

            Display cycle functionality

          • -
          • +
          • - § + §

            calculateLocalPath - internal helper function - called by cleanPathObject

            @@ -1461,8 +1414,8 @@

            Display cycle functionality

            currentDims = this.currentDimensions, box = this.localBox; - dims[0] = parseFloat((maxX - minX).toFixed(1)); - dims[1] = parseFloat((maxY - minY).toFixed(1)); + dims[0] = maxX - minX; + dims[1] = maxY - minY; if(dims[0] !== currentDims[0] || dims[1] !== currentDims[1]) { @@ -1472,39 +1425,26 @@

            Display cycle functionality

            } box.length = 0; - box.push(parseFloat(minX.toFixed(1)), parseFloat(minY.toFixed(1)), dims[0], dims[1]); + box.push(minX, minY, dims[0], dims[1]); if (this.useAsPath) {
        14. -
        15. +
        16. - § + §

          we can do work here to flatten some of these arrays

          -
                          const {units, unitLengths, unitPartials, unitProgression, unitPositions} = res;
          - -
        17. - - -
        18. -
          - -
          - § -
          -

          console.log(unitProgression);

          +
                          const {units, unitLengths, unitPartials, unitProgression, unitPositions} = res;
           
          -            
          - -
                          const flatProgression = requestArray(),
          +                const flatProgression = requestArray(),
                               flatPositions = requestArray();
           
                           let lastLength = 0,
          @@ -1528,10 +1468,10 @@ 

          Display cycle functionality

          for (j = 0, jz = progression.length; j < jz; j++) { l = lastLength + progression[j]; - flatProgression.push(parseFloat(l.toFixed(1))); + flatProgression.push(l); p = lastPartial + (positions[j] * currentPartial); - flatPositions.push(parseFloat(p.toFixed(6))); + flatPositions.push(p); } } } @@ -1565,11 +1505,11 @@

          Display cycle functionality

        19. -
        20. +
        21. - § + §

          updatePathSubscribers

          @@ -1600,11 +1540,11 @@

          Display cycle functionality

        22. -
        23. +
        24. - § + §

          Stamp methods

          All actual drawing is achieved using the entity’s pre-calculated Path2D object.

          @@ -1614,11 +1554,11 @@

          Stamp methods

        25. -
        26. +
        27. - § + §

          draw

          @@ -1633,11 +1573,11 @@

          Stamp methods

        28. -
        29. +
        30. - § + §

          fill

          @@ -1652,11 +1592,11 @@

          Stamp methods

        31. -
        32. +
        33. - § + §

          drawAndFill

          @@ -1675,11 +1615,11 @@

          Stamp methods

        34. -
        35. +
        36. - § + §

          fillAndDraw

          @@ -1699,11 +1639,11 @@

          Stamp methods

        37. -
        38. +
        39. - § + §

          drawThenFill

          @@ -1721,11 +1661,11 @@

          Stamp methods

        40. -
        41. +
        42. - § + §

          fillThenDraw

          @@ -1743,11 +1683,11 @@

          Stamp methods

        43. -
        44. +
        45. - § + §

          clear

          @@ -1768,11 +1708,11 @@

          Stamp methods

        46. -
        47. +
        48. - § + §

          drawBoundingBox

          @@ -1798,11 +1738,11 @@

          Stamp methods

        49. -
        50. +
        51. - § + §

          getBoundingBox

          @@ -1820,11 +1760,11 @@

          Stamp methods

        52. -
        53. +
        54. - § + §

          Pad out excessively thin widths and heights

          diff --git a/docs/source/mixin/text.html b/docs/source/mixin/text.html index d14f4347..7a76b7cc 100644 --- a/docs/source/mixin/text.html +++ b/docs/source/mixin/text.html @@ -1687,7 +1687,7 @@

          Accessibility functions

              P.getCanvasTextHold = function (item) {
           
          -        if (item && item.type === T_CELL && item.controller.type && item.controller.type=== T_CANVAS && item.controller.textHold) return item.controller;
          + if (item && item.type === T_CELL && item.controller && item.controller.type && item.controller.type === T_CANVAS && item.controller.textHold) return item.controller;
      5. diff --git a/docs/source/scrawl.html b/docs/source/scrawl.html index 020d00d2..c1f3b0f8 100644 --- a/docs/source/scrawl.html +++ b/docs/source/scrawl.html @@ -22,7 +22,7 @@ §

      Scrawl-canvas

      -

      Version 8.13.0 - 27 April 2024

      +

      Version 8.13.1 - 3 May 2024

    @@ -81,6 +81,7 @@

    Export Scrawl-canvas module funct findArtefact, findAsset, findCanvas, + findCell, findElement, findEntity, findFilter, diff --git a/index.html b/index.html index a67be20c..7b2e4f3c 100644 --- a/index.html +++ b/index.html @@ -25,7 +25,7 @@

    Welcome to the Scrawl-canvas code base

  • Makes the canvas both accessible, and interactive - including the ability to easily track user interactions with different parts of the canvas.
  • -

    These test demos and documentation are for Scrawl-canvas v8.13.0

    +

    These test demos and documentation are for Scrawl-canvas v8.13.1

    Download and installation

    See GitHub for details on how to add Scrawl-canvas to a project.

    diff --git a/min/scrawl.js b/min/scrawl.js index bc0b3b6d..8e80cdae 100644 --- a/min/scrawl.js +++ b/min/scrawl.js @@ -1 +1 @@ -const t={},e=[],i={},n=[],s={},r=[],o={},a=[],l={},c=[],h={},u=[],d={},f=[],p={},g=[],m={},y=[],b={},S=[],k={},A=[],v={},C=[],P={},x={},w=[],O={},D=[],F={},R=[],T={},H=[],E={},I=[],B={},L=[],$={};function M(h=""){const u=function(t,e,i=!1){t.forEach((t=>{const n=e[t];n&&n.kill&&n.kill(i)}))};if(h){u(a.filter((t=>0===t.indexOf(h))),o);u(c.filter((t=>0===t.indexOf(h))),l);u(C.filter((t=>0===t.indexOf(h))),v,!0);u(L.filter((t=>0===t.indexOf(h))),B);u(I.filter((t=>0===t.indexOf(h))),E);u(n.filter((t=>0===t.indexOf(h))),i);u(r.filter((t=>0===t.indexOf(h))),s);u(S.filter((t=>0===t.indexOf(h))),b);u(e.filter((t=>0===t.indexOf(h))),t);u(w.filter((t=>0===t.indexOf(h))),x);u(D.filter((t=>0===t.indexOf(h))),O);u(R.filter((t=>0===t.indexOf(h))),F)}}function X(t=""){const e=`100px ${t}`;return A.includes(e)}function Y(t=""){const e=`100px ${t}`;return A.includes(e)?k[e]:null}function G(t=""){return a.includes(t)?o[t]:null}function j(t=""){return c.includes(t)?l[t]:null}function z(t=""){return y.includes(t)?m[t]:null}function N(t=""){return u.includes(t)?h[t]:null}function V(t=""){return L.includes(t)?B[t]:null}function W(t=""){return I.includes(t)?E[t]:null}function U(t=""){return L.includes(t)?B[t]:f.includes(t)?d[t]:null}function Z(t=""){return S.includes(t)?b[t]:null}function _(t=""){return C.includes(t)?v[t]:null}function K(t=""){return H.includes(t)?T[t]:null}function q(t=""){return g.includes(t)?p[t]:null}const Q={};var J=Object.freeze({__proto__:null,anchor:t,anchornames:e,animation:i,animationnames:n,animationtickers:s,animationtickersnames:r,artefact:o,artefactnames:a,asset:l,assetnames:c,canvas:h,canvasnames:u,cell:d,cellnames:f,checkFontIsLoaded:X,constructors:Q,element:p,elementnames:g,entity:m,entitynames:y,filter:b,filternames:S,findArtefact:G,findAsset:j,findCanvas:N,findElement:q,findEntity:z,findFilter:Z,findGroup:_,findPattern:U,findStack:K,findStyles:V,findTween:W,fontfamilymetadata:k,fontfamilymetadatanames:A,force:x,forcenames:w,getFontMetadata:Y,group:v,groupnames:C,palette:{},palettenames:[],particle:P,particlenames:[],purge:M,spring:O,springnames:D,stack:T,stacknames:H,styles:B,stylesnames:L,tween:E,tweennames:I,unstackedelement:$,unstackedelementnames:[],version:"8.13.0",world:F,worldnames:R});const tt=Math.abs,et=Math.acos,it=Object.assign,nt=Math.atan2,st=Math.cbrt,rt=Math.ceil,ot=window.getComputedStyle,at=Math.cos,lt=Object.create,ct=Object.entries,ht=Math.exp,ut=Math.floor,dt=Object.freeze,ft=Math.hypot,pt=180/Math.PI,gt=Array.isArray,mt=Number.isFinite,yt=Number.isSafeInteger||Number.isInteger,bt=Object.keys,St=Math.max,kt=Math.min,At=Date.now,vt=JSON.parse,Ct=Math.PI,Pt=2*Math.PI,xt=.5*Math.PI,wt=Math.pow,Ot=Math.PI/180,Dt=Math.random,Ft=Math.round,Rt=Object.seal,Tt=Object.setPrototypeOf,Ht=Math.sin,Et=Math.sqrt,It=JSON.stringify,Bt=JSON.stringify,Lt=.016,$t=Object.values,Mt="BODY",Xt="image_",Yt="video_",Gt="0",jt="2d",zt="a",Nt="b",Vt="c",Wt="d",Ut="e",Zt="f",_t="hwb",Kt="lab",qt="lch",Qt="_max",Jt="_min",te="oklab",ee="oklch",ie="VIDEO",ne="xyz",se="absolute",re=dt(["Cell","Stack"]),oe=dt(["Canvas","Stack"]),ae="add",le="addEventListener",ce="all",he="alpha-to-channels",ue="alphabetic",de="anchor",fe=dt(["anchor","anchorHref","anchorName","anchorDescription","anchorType","anchorTarget","anchorTabOrder","anchorDisabled","anchorRel","anchorReferrerPolicy","anchorPing","anchorHreflang","anchorDownload","anchorFocusAction","anchorBlurAction","anchorClickAction"]),pe="anchorType",ge="animation",me="anonymous",ye="area-alpha",be=",",Se="aria-busy",ke="aria-hidden",Ae="aria-live",ve=dt(["assertive","polite","off"]),Ce="asset",Pe=/.*\/(.*?)\./,xe="auto",we="autofocus",Oe="average-channels",De="banner",Fe=dt(["stripes","smoothed-stripes","worley-euclidean","worley-manhattan"]),Re="bezier",Te="rgb(0 0 0 / 1)",He="black-white",Ee="rgb(0 0 0 / 0)",Ie="blend",Be="block",Le="blue",$e="bluenoise",Me="blur",Xe="blurAction",Ye="border-box",Ge="bottom",je="button",ze=dt(["button","buttonName","buttonAutofocus","buttonDescription","buttonDisabled","buttonTabOrder","buttonForm","buttonFormAction","buttonFormEnctype","buttonFormMethod","buttonFormNoValidate","buttonFormTarget","buttonElementName","buttonPopoverTarget","buttonPopoverTargetAction","buttonElementType","buttonElementValue","buttonFocusAction","buttonBlurAction","buttonClickAction"]),Ne="canvas",Ve="cellGradient",We="center",Ue="change",Ze="channels-to-alpha",_e="chroma",Ke="clamp-channels",qe=dt(["down","round","up"]),Qe=/[\s\uFEFF\xA0]+/g,Je="clear",ti="click",ei="clickAction",ii="close",ni="color",si="colors-to-alpha",ri="compose",oi="contain",ai="control",li="coord",ci="copyDimensions",hi="copyStart",ui=dt(["topLeft","topRight","bottomRight","bottomLeft"]),di='[data-scrawl-corner-div="sc"]',fi="corrode",pi="cover",gi="data-scrawl-group",mi="data-scrawl-stack",yi="data-tab-order",bi="12px sans-serif",Si="any_random_string_will_do",ki="description",Ai="destination-out",vi="destination-over",Ci="dimensions",Pi="disabled",xi="displace",wi="display-p3",Oi="div",Di="down",Fi="download",Ri="draw",Ti="drawAndFill",Hi="element",Ei="elementType",Ii="elementValue",Bi="emboss",Li="emboss-work",$i="end",Mi="endControl",Xi="enter",Yi="entity",Gi="euclidian-distance",ji="euler",zi="fill",Ni="fillAndDraw",Vi="fillStyle",Wi="filter",Ui=dt(["fill","contain","cover"]),Zi="flood",_i="focus",Ki="focusAction",qi=/[0-9.,]+(%|cap|ch|cm|cqb|cqh|cqi|cqmax|cqmin|cqw|dvb|dvh|dvi|dvmax|dvmin|dvw|em|ex|ic|in|lh|lvb|lvh|lvi|lvmax|lvmin|lvw|mm|pc|pt|px|Q|rcap|rch|rem|rex|ric|rlh|svb|svh|svi|svmax|svmin|svw|vb|vh|vi|vmax|vmin|vw)/i,Qi=dt(["ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"]),Ji=dt(["Label","EnhancedLabel"]),tn=dt(["small-caps","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps"]),en=/[0-9.,]+(svh|lvh|dvh|vh|svw|lvw|dvw|vw|svmax|lvmax|dvmax|vmax|svmin|lvmin|dvmin|vmin|svb|lvb|dvb|vb|svi|lvi|dvi|vi)/i,nn="form",sn="formAction",rn="formEnctype",on="formMethod",an="formNoValidate",ln="formTarget",cn="function",hn="gaussian-blur",un="getBezierXY",dn="getQuadraticXY",fn="glitch",pn=dt(["Cell","CellFragment"]),gn=dt(["black-white","monochrome-4","monochrome-8","monochrome-16"]),mn="grayscale",yn="green",bn="gridGradient",Sn="gridPicture",kn="handle",An="hanging",vn="height",Cn="hex-grid",Pn="high",xn="href",wn="hreflang",On="HSL",Dn=dt(["HSL","HWB"]),Fn=dt(["Bezier","Line","Oval","Polygon","Polyline","Quadratic","Rectangle","Shape","Spiral","Star","Tetragon"]),Rn="HWB",Tn="ideographic",Hn=dt(["IMG","PICTURE"]),En="img",In="improved-perlin",Bn=dt(["RGB","HSL","HWB","XYZ","LAB","LCH","OKLAB","OKLCH"]),Ln="intrinsic",$n="invert-channels",Mn="italic",Xn="keydown",Yn="keyup",Gn=dt(["none","shiftOnly","altOnly","ctrlOnly","metaOnly","shiftAlt","shiftCtrl","shiftMeta","altCtrl","altMeta","ctrlMeta","shiftAltCtrl","shiftAltMeta","shiftCtrlMeta","altCtrlMeta","all"]),jn="LAB",zn=dt(["direction","fontKerning","fontSize","fontStretch","fontString","fontStyle","fontVariantCaps","fontWeight","letterSpaceValue","letterSpacing","scale","textRendering","wordSpaceValue","wordSpacing"]),Nn=dt(["fontString"]),Vn=dt(["fontString","scale"]),Wn=dt(["fontFamily","fontSize","fontStretch","fontStyle","fontVariantCaps","fontWeight"]),Un="landscape",Zn="larger",_n="largest",Kn=dt(["lineSpacing","textUnitFlow","lineAdjustment","alignment","justifyLine","flipReverse","flipUpend","alignTextUnitsToPath","lockFillStyleToEntity","lockStrokeStyleToEntity"]),qn="LCH",Qn="leave",Jn="left",ts="lineDash",es="linear",is="lock-channels-to-levels",ns="lockTo",ss=dt(["startX","startY","handleX","handleY","offsetX","offsetY","width","height"]),rs="loop",os="ltr",as="manhattan-distance",ls="map-to-gradient",cs=dt(["a","b","c","d","e","f"]),hs=dt(["repeat","repeat-x","repeat-y","no-repeat"]),us="matrix",ds="mean",fs="mimic",ps="middle",gs="modulate-channels",ms="mouse",ys="mousedown",bs="mouseenter",Ss="mouseleave",ks="mousemove",As="mouseup",vs="move",Cs="mozOsxFontSmoothing",Ps="ms",xs="multiply",ws="name",Os="never",Ds="newNumber",Fs="newsprint",Rs="newString",Ts=dt(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR","CANVAS"]),Hs=dt(["random","ordered","bluenoise"]),Es=dt(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"]),Is="none",Bs="nonzero",Ls="normal",$s="oblique",Ms="offset",Xs="OKLAB",Ys="OKLCH",Gs="~~~",js=dt(["colors","cyclic","stops"]),zs="particle",Ns="path",Vs="%",Ws="0%",Us="100%",Zs="50%",_s="perlin",Ks=dt(["line","quadratic","bezier"]),qs="ping",Qs="pivot",Js="pixelate",tr="pointerdown",er="pointerenter",ir="pointerleave",nr="pointermove",sr="pointerup",rr="points-array",or="polite",ar="popoverTarget",lr="popoverTargetAction",cr="portrait",hr="process-image",ur="0px",dr="quadratic",fr=dt(["radiusTLX","radiusTRX","radiusBRX","radiusBLX","radiusTLY","radiusTRY","radiusBRY","radiusBLY"]),pr=dt(["radiusBRX","radiusBRY","radiusBLX","radiusBLY"]),gr=dt(["radiusBLX","radiusBLY"]),mr=dt(["radiusBLX"]),yr=dt(["radiusBLY"]),br=dt(["radiusBRX","radiusBRY"]),Sr=dt(["radiusBRX"]),kr=dt(["radiusBRY"]),Ar=dt(["radiusBRX","radiusBLX"]),vr=dt(["radiusBRY","radiusBLY"]),Cr=dt(["radiusTLX","radiusTLY","radiusBLX","radiusBLY"]),Pr=dt(["radiusTLX","radiusBLX"]),xr=dt(["radiusTLY","radiusBLY"]),wr=dt(["radiusTRX","radiusTRY","radiusBRX","radiusBRY"]),Or=dt(["radiusTRX","radiusBRX"]),Dr=dt(["radiusTRY","radiusBRY"]),Fr=dt(["radiusTLX","radiusTLY","radiusTRX","radiusTRY"]),Rr=dt(["radiusTLX","radiusTLY"]),Tr=dt(["radiusTLX"]),Hr=dt(["radiusTLY"]),Er=dt(["radiusTRX","radiusTRY"]),Ir=dt(["radiusTRX"]),Br=dt(["radiusTRY"]),Lr=dt(["radiusTLX","radiusTRX"]),$r=dt(["radiusTLY","radiusTRY"]),Mr=dt(["radiusTLX","radiusTRX","radiusBRX","radiusBLX"]),Xr=dt(["radiusTLY","radiusTRY","radiusBRY","radiusBLY"]),Yr=dt(["radiusX"]),Gr=dt(["radiusX","radiusY"]),jr=dt(["radiusY"]),zr="random",Nr="random-noise",Vr="random-points",Wr=dt(["random","entity"]),Ur="rect-grid",Zr="rectangle",_r="red",Kr="reduce-palette",qr="referrerpolicy",Qr="regular",Jr="rel",to="relative",eo="remove",io="removeEventListener",no=dt(["RGB","HSL","HWB","LAB","LCH","OKLAB","OKLCH"]),so="reverse",ro="reverseByDelta",oo="RGB",ao="right",lo="role",co="root",ho="round",uo=":",fo="set-channel-to-level",po=dt(["startY","handleY","offsetY","height"]),go="simplex",mo="skyscraper",yo="smaller",bo="smallest",So="smoothFont",ko="smoothed-stripes",Ao="source",vo="source-alpha",Co="source-in",Po="source-out",xo="source-over",wo=" ",Oo="space-around",Do="space-between",Fo="srgb",Ro="start",To="startControl",Ho="startX",Eo="startY",Io=dt(["direction","fillStyle","filter","font","fontKerning","fontStretch","fontVariantCaps","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","imageSmoothingQuality","letterSpacing","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle","textAlign","textBaseline","textRendering","wordSpacing"]),Bo=dt(["fillStyle","filter","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","imageSmoothingQuality","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle"]),Lo=dt(["direction","font","fontKerning","fontStretch","fontVariantCaps","letterSpacing","textRendering","wordSpacing"]),$o=dt(["lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit"]),Mo=dt(["filter","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","imageSmoothingQuality","shadowBlur","shadowOffsetX","shadowOffsetY"]),Xo=dt(["fillStyle","shadowColor","strokeStyle"]),Yo="step-channels",Go="stripes",jo="strokeStyle",zo="styles",No=dt(["Gradient","RadialGradient","Pattern"]),Vo="subscribe",Wo="swirl",Uo=dt(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]),Zo="Bezier",_o="Canvas",Ko="Cell",qo="CellFragment",Qo="Color",Jo="Coordinate",ta="EnhancedLabel",ea="EnhancedLabelLine",ia="EnhancedLabelUnit",na="Filter",sa="GenericArray",ra="Group",oa="Image",aa="Label",la="Line",ca="Noise",ha="Palette",ua="Particle",da="ParticleHistory",fa="Picture",pa="Polyline",ga="Quadratic",ma="Quaternion",ya="RawAsset",ba="RdAsset",Sa="RenderAnimation",ka="Sprite",Aa="Stack",va="Ticker",Ca="Tween",Pa="Vector",xa="Video",wa="World",Oa="tabOrder",Da="tabindex",Fa="target",Ra=dt(["artefact","group","animation","animationtickers","world","tween","styles","filter"]),Ta=dt(["width","height","dimensions","startX","startY","start","position","handleX","handleY","handle","offsetX","offsetY","offset","roll","scale","flipReverse","flipUpend"]),Ha=/[-]/,Ea=dt(["column","column-reverse"]),Ia=dt(["row-reverse","column-reverse"]),Ba=/[\u2060]/,La=/[\u00ad]/,$a=/[ \f\n\r\t\v\u2028\u2029\u200b]/,Ma="C",Xa="h",Ya="S",Ga=/[\u200b]/,ja=dt(["canvasFont","direction","fillStyle","fontFamily","fontKerning","fontSize","fontStretch","fontString","fontStyle","fontVariantCaps","fontWeight","highlightStyle","includeHighlight","includeUnderline","letterSpaceValue","letterSpacing","lineDash","lineDashOffset","lineWidth","overlineOffset","overlineStyle","overlineWidth","strokeStyle","textRendering","underlineGap","underlineOffset","underlineStyle","underlineWidth","wordSpaceValue","wordSpacing","method"]),za="threshold",Na="tilePicture",Va="tiles",Wa="tint-channels",Ua="top",Za="touch",_a="touchcancel",Ka="touchend",qa="touchmove",Qa="touchstart",Ja=dt(["rgb(0 0 0 / 0)","rgba(0 0 0 / 0)","rgba(0,0,0,0)","rgba(0, 0, 0, 0)","transparent","#00000000","#0000"]),tl="true",el="tween",il="type",nl=dt(["Image","Sprite","Video","Canvas","Stack"]),sl=dt(["width","height","zIndex","borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"]),rl=dt(["borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"]),ol="undefined",al="unknown",ll="unnamed",cl="unset",hl="up",ul="update",dl="updateByDelta",fl="user-defined-legacy",pl="value",gl="vary-channels-by-weights",ml="video",yl="webkitFontSmoothing",bl="rgb(255 255 255 / 1)",Sl="width",kl="worley-euclidean",Al="worley-manhattan",vl=dt(["X","Y","Z","XminusY","XminusZ","YminusX","YminusZ","ZminusX","ZminusY","XaddY","XaddZ","YaddZ","XaddYminusZ","XaddZminusY","YaddZminusX","XmultiplyY","XmultiplyZ","YmultiplyZ","XmultiplyYaddZ","XmultiplyZaddY","YmultiplyZaddX","XmultiplyYminusZ","XmultiplyZminusY","YmultiplyZminusX","sum"]),Cl="XYZ",Pl="zero",xl="M0,0",wl="",Ol=dt(["all","background","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundOrigin","backgroundPosition","backgroundRepeat","border","borderBottom","borderBottomColor","borderBottomStyle","borderBottomWidth","borderCollapse","borderColor","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStyle","borderTop","borderTopColor","borderTopStyle","borderTopWidth","borderWidth","clear","color","columns","content","counterIncrement","counterReset","cursor","direction","display","emptyCells","float","font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontSynthesis","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontWeight","grid","gridArea","gridAutoColumns","gridAutoFlow","gridAutoPosition","gridAutoRows","gridColumn","gridColumnStart","gridColumnEnd","gridRow","gridRowStart","gridRowEnd","gridTemplate","gridTemplateAreas","gridTemplateRows","gridTemplateColumns","imageResolution","imeMode","inherit","inlineSize","isolation","letterSpacing","lineBreak","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginBlockStart","marginBlockEnd","marginInlineStart","marginInlineEnd","marginBottom","marginLeft","marginRight","marginTop","marks","mask","maskType","maxWidth","maxHeight","maxBlockSize","maxInlineSize","maxZoom","minWidth","minHeight","minBlockSize","minInlineSize","minZoom","mixBlendMode","objectFit","objectPosition","offsetBlockStart","offsetBlockEnd","offsetInlineStart","offsetInlineEnd","orphans","overflow","overflowWrap","overflowX","overflowY","pad","padding","paddingBlockStart","paddingBlockEnd","paddingInlineStart","paddingInlineEnd","paddingBottom","paddingLeft","paddingRight","paddingTop","pageBreakAfter","pageBreakBefore","pageBreakInside","pointerEvents","position","prefix","quotes","rubyAlign","rubyMerge","rubyPosition","scrollBehavior","scrollSnapCoordinate","scrollSnapDestination","scrollSnapPointsX","scrollSnapPointsY","scrollSnapType","scrollSnapTypeX","scrollSnapTypeY","shapeImageThreshold","shapeMargin","shapeOutside","tableLayout","textAlign","textDecoration","textIndent","textOrientation","textOverflow","textRendering","textShadow","textTransform","textUnderlinePosition","unicodeRange","unset","verticalAlign","widows","willChange","wordBreak","wordSpacing","wordWrap","zIndex"]),Dl=dt(["alignContent","alignItems","alignSelf","animation","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationTimingFunction","backfaceVisibility","backgroundImage","backgroundSize","borderBottomLeftRadius","borderBottomRightRadius","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","boxDecorationBreak","boxShadow","boxSizing","columnCount","columnFill","columnGap","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","filter","flex","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","fontFeatureSettings","fontKerning","fontLanguageOverride","hyphens","imageRendering","imageOrientation","initial","justifyContent","linearGradient","opacity","order","orientation","outline","outlineColor","outlineOffset","outlineStyle","outlineWidth","resize","tabSize","textAlignLast","textCombineUpright","textDecorationColor","textDecorationLine","textDecorationStyle","touchAction","transformStyle","transition","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","unicodeBidi","whiteSpace","writingMode"]),Fl=(t,e)=>{if(null!=e){Jn===t||Ua===t?t=Ws:ao===t||Ge===t?t=Us:We===t&&(t=Zs);const i=!(!t.substring&&!e.substring);return Wl(t)?t+=Wl(e)?e:parseFloat(e):t=parseFloat(t)+(Wl(e)?e:parseFloat(e)),i?t+Vs:t}return t},Rl=function(t,e,i){return ti?i:t},Tl=t=>{if(Wl(t))return[Ps,t];if(t.substring){const e=t.match(/^\d+\.?\d*(\D*)/);let i=e[1].toLowerCase?e[1].toLowerCase():Ps,n=parseFloat(t);if(mt(n)){switch(i){case"s":n*=1e3;break;case"%":break;default:i=Ps}return[i,n]}return[Ps,0]}},Hl=t=>mt(t)?((t%=360)<0&&(t+=360),t):0,El=t=>{if(mt(t)){if(t<-1e-6)return t;if(t>1e-6)return t}return 0},Il=()=>{},Bl=function(t){return t},Ll=function(){return this},$l=()=>Promise.resolve(!0),Ml=dt({}),Xl=()=>{function t(){return ut(65536*(1+Dt())).toString(16).substring(1)}return`${t()}${t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`},Yl=()=>performance.now().toString(36)+Dt().toString(36).substr(2),Gl=function(t,e,i){return e+t*(i-e)},jl=t=>"boolean"==typeof t,zl=t=>"[object HTMLCanvasElement]"===Object.prototype.toString.call(t),Nl=t=>!!(t&&t.querySelector&&t.dispatchEvent),Vl=t=>typeof t===cn,Wl=t=>!!mt(t),Ul=t=>"[object Object]"===Object.prototype.toString.call(t),Zl=t=>!(!t||!t.type||t.type!==ma),_l=(t,e)=>{if(Ul(t)&&Ul(e))for(const i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},Kl=(t,e)=>(Ul(t)&&Ul(e)&&ct(e).forEach((([i,n])=>{null==n?delete t[i]:t[i]=e[i]})),t),ql=(t,e)=>(gt(t)&&(gt(e)?e.forEach((e=>ql(t,e))):t.includes(e)||t.push(e)),t),Ql=(t,e)=>{if(gt(t)){const i=t.indexOf(e);i>=0&&t.splice(i,1)}return t},Jl=t=>typeof t!==ol,tc=(...t)=>t.every((t=>typeof t!==ol)),ec=(...t)=>t.find((t=>typeof t!==ol)),ic=(...t)=>!!t.find((t=>typeof t!==ol)),nc={out:t=>1-at(t*Ct/2),in:t=>Ht(t*Ct/2),easeIn:t=>{const e=1-t;return 1-e*e},easeIn3:t=>{const e=1-t;return 1-e*e*e},easeIn4:t=>{const e=1-t;return 1-e*e*e*e},easeIn5:t=>{const e=1-t;return 1-e*e*e*e*e},easeOutIn:t=>t<.5?2*t*t:1-wt(-2*t+2,2)/2,easeOutIn3:t=>t<.5?4*t*t*t:1-wt(-2*t+2,3)/2,easeOutIn4:t=>t<.5?8*t*t*t*t:1-wt(-2*t+2,4)/2,easeOutIn5:t=>t<.5?16*t*t*t*t*t:1-wt(-2*t+2,5)/2,easeInOut:t=>{const e=.5-t;return t<.5?.5+-2*e*e:.5+wt(2*(t-.5),2)/2},easeInOut3:t=>{const e=.5-t;return t<.5?.5+-4*e*e*e:.5+wt(2*(t-.5),3)/2},easeInOut4:t=>{const e=.5-t;return t<.5?.5+-8*e*e*e*e:.5+wt(2*(t-.5),4)/2},easeInOut5:t=>{const e=.5-t;return t<.5?.5+-16*e*e*e*e*e:.5+wt(2*(t-.5),5)/2},easeOut:t=>t*t,easeOut3:t=>t*t*t,easeOut4:t=>t*t*t*t,easeOut5:t=>t*t*t*t*t,none:t=>t,linear:t=>t,cosine:t=>.5*(1+at((1-t)*Ct)),hermite:t=>t*t*(2*-t+3),quintic:t=>t*t*t*(t*(6*t-15)+10),easeOutSine:t=>1-at(t*Ct/2),easeInSine:t=>Ht(t*Ct/2),easeOutInSine:t=>-(at(Ct*t)-1)/2,easeOutQuad:t=>t*t,easeInQuad:t=>1-(1-t)*(1-t),easeOutInQuad:t=>t<.5?2*t*t:1-wt(-2*t+2,2)/2,easeOutCubic:t=>t*t*t,easeInCubic:t=>1-wt(1-t,3),easeOutInCubic:t=>t<.5?4*t*t*t:1-wt(-2*t+2,3)/2,easeOutQuart:t=>t*t*t*t,easeInQuart:t=>1-wt(1-t,4),easeOutInQuart:t=>t<.5?8*t*t*t*t:1-wt(-2*t+2,4)/2,easeOutQuint:t=>t*t*t*t*t,easeInQuint:t=>1-wt(1-t,5),easeOutInQuint:t=>t<.5?16*t*t*t*t*t:1-wt(-2*t+2,5)/2,easeOutExpo:t=>0===t?0:wt(2,10*t-10),easeInExpo:t=>1===t?1:1-wt(2,-10*t),easeOutInExpo:t=>0===t||1===t?t:t<.5?wt(2,20*t-10)/2:(2-wt(2,-20*t+10))/2,easeOutCirc:t=>1-Et(1-wt(t,2)),easeInCirc:t=>Et(1-wt(t-1,2)),easeOutInCirc:t=>t<.5?(1-Et(1-wt(2*t,2)))/2:(Et(1-wt(-2*t+2,2))+1)/2,easeOutBack:t=>2.70158*t*t*t-1.70158*t*t,easeInBack:t=>1+2.70158*wt(t-1,3)+1.70158*wt(t-1,2),easeOutInBack:t=>{const e=2.5949095;return t<.5?wt(2*t,2)*(7.189819*t-e)/2:(wt(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2},easeOutElastic:t=>{const e=2*Ct/3;return 0===t||1===t?t:-wt(2,10*t-10)*Ht((10*t-10.75)*e)},easeInElastic:t=>{const e=2*Ct/3;return 0===t||1===t?t:wt(2,-10*t)*Ht((10*t-.75)*e)+1},easeOutInElastic:t=>{const e=2*Ct/4.5;return 0===t||1===t?t:t<.5?-wt(2,20*t-10)*Ht((20*t-11.125)*e)/2:wt(2,-20*t+10)*Ht((20*t-11.125)*e)/2+1},easeOutBounce:t=>{const e=7.5625,i=2.75;return(t=1-t)<1/i?1-e*t*t:t<2/i?1-(e*(t-=1.5/i)*t+.75):t<2.5/i?1-(e*(t-=2.25/i)*t+.9375):1-(e*(t-=2.625/i)*t+.984375)},easeInBounce:t=>{const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeOutInBounce:t=>{const e=7.5625,i=2.75;let n;return t<.5?(n=(t=1-2*t)<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375,(1-n)/2):(n=(t=2*t-1)<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375,(1+n)/2)}},sc=()=>lt(Object.prototype);let rc=!1;const oc=()=>rc,ac=t=>rc=t;let lc=!1;const cc=()=>lc,hc=t=>lc=t;let uc=!1;const dc=()=>uc,fc=t=>uc=t;let pc=!1;let gc=!1;const mc=()=>gc,yc=t=>gc=t;let bc=!1;const Sc=()=>bc,kc=t=>bc=t;let Ac=!1;const vc=()=>Ac,Cc=t=>Ac=t;let Pc=!1;const xc=()=>Pc,wc=t=>Pc=t;let Oc=!0;const Dc=t=>Oc=t;let Fc=!1;const Rc=t=>Fc=t;let Tc=!0;const Hc=t=>Tc=t,Ec=function(){lc=!0,uc=!0},Ic=function(){const t=[];return Tt(t,Ic.prototype),t};Q.GenericArray=Ic;const Bc=Ic.prototype=lt(Array.prototype);Bc.constructor=Ic,Bc.type=sa;const Lc=[],$c=function(){return Lc.length||Lc.push(new Ic),Lc.shift()},Mc=function(...t){t.forEach((t=>{t&&t.type===sa&&(t.length=0,Lc.push(t),Lc.length>20&&(console.log("purging genericArrayPool"),Lc.length=10))}))},Xc=[],Yc=[],Gc=t=>{ql(Yc,t),Dc(!0)},jc=t=>{Ql(Yc,t),Dc(!0)},zc=t=>Yc.includes(t),Nc=()=>{Oc&&(Dc(!1),(()=>{const t=$c();let e,n,s,r;for(s=0,r=Yc.length;s{Rc(!0),Nc()},Wc=()=>Rc(!1),Uc=function(t,e,i=Ml){if(typeof window.IntersectionObserver===cn&&t&&t.run){const n=new IntersectionObserver((e=>{let i,n,s;for(i=0,n=e.length;i{let h,u=!0;if(i.includes(t)||(u=!1),u&&n.includes(t)&&(u=!1),u&&(h=s.some((e=>new RegExp(e).test(t))),h&&(u=!1)),u)if(a.includes(t)){if(Jl(e)&&null!=e){const i=this.stringifyFunction(e);i&&i.length&&(c[t]=i)}}else o.includes(t)&&this[t]&&this[t].name?c[t]=this[t].name:r.includes(t)?(l.includes(t)||e[0]||e[1])&&(c[t]=e):(h=this.processPacketOut(t,e,l),h&&(c[t]=e))}),this),c=this.finalizePacketOut(c,t),It([this.name,this.type,this.lib,c])},t.stringifyFunction=function(t){const e=t.toString().match(/\(([\s\S]*?)\)[\s\S]*?\{([\s\S]*)\}/),i=e[1],n=e[2];return!!tc(i,n)&&`${i}${Gs}${n}`},t.processPacketOut=function(t,e,i){let n=!0;return i.includes(t)||e!==this.defs[t]||(n=!1),n},t.finalizePacketOut=function(t){return t},t.importPacket=function(t){const e=this,i=function(t){return new Promise(((i,n)=>{let s;t.substring||n(new Error("Packet url supplied for import is not a string")),"["===t[0]?(s=e.actionPacket(t),s&&s.lib?i(s):n(s)):t.includes('"name":')?n(new Error("Bad packet supplied for import")):fetch(t).then((t=>{if(!t.ok)throw new Error(`Packet import from server failed - ${t.status}: ${t.statusText} - ${t.url}`);return t.text()})).then((t=>{if(s=e.actionPacket(t),!s||!s.lib)throw s;i(s)})).catch((t=>n(t)))}))};if(gt(t)){const e=[];return t.forEach((t=>e.push(i(t)))),new Promise(((t,i)=>{Promise.all(e).then((e=>t(e))).catch((t=>i(t)))}))}if(t.substring)return i(t);Promise.reject(new Error("Argument supplied for packet import is not a string or array of strings"))},t.actionPacket=function(t){try{if(t&&t.substring){if("["===t[0]){let e,i,n,s;try{[e,i,n,s]=vt(t)}catch(t){throw new Error(`Failed to process packet due to JSON parsing error - ${t.message}`)}if(tc(e,i,n,s)){if(nl.includes(i))throw new Error("Failed to process packet - Stacks, Canvases and visual assets are excluded from the packet system");let t=J[n][e];if(t)t.set(s);else{if(s.outerHTML&&s.host){const t=document.querySelector(`#${s.host}`);if(t){const i=document.createElement("div");i.innerHTML=s.outerHTML;const n=i.firstElementChild;n&&(n.id=e,t.appendChild(n),s.domElement=n)}}if(t=new Q[i](s),!t)throw new Error("Failed to create Scrawl-canvas object from supplied packet")}if(t.packetFunctions.forEach((e=>this.actionPacketFunctions(t,e))),s.anchor&&t.anchor&&t.anchor.packetFunctions.forEach((e=>{t.anchor[e]=s.anchor[e],this.actionPacketFunctions(t.anchor,e),t.anchor.build()})),s.button&&t.button&&t.button.packetFunctions.forEach((e=>{t.button[e]=s.button[e],this.actionPacketFunctions(t.button,e),t.button.build()})),t)return t;throw new Error("Failed to process supplied packet")}throw new Error("Failed to process packet - JSON string holds incomplete data")}throw new Error("Failed to process packet - JSON string does not represent an array")}throw new Error("Failed to process packet - not a JSON string")}catch(t){return console.log(t),t}},t.actionPacketFunctions=function(t,e){const i=t[e];if(Jl(i)&&null!=i&&i.substring)if(i===Gs)t[e]=Il;else{let n,s,r;[n,s]=i.split(Gs),n=n.split(be),n=n.map((t=>t.trim())),s.includes("[native code]")?t[e]=Il:(r=new Function(...n,s),t[e]=r.bind(t))}},t.clone=function(t=Ml){const e=this.name;let i,n,s,r;this.name=t.name||wl,t.useNewTicker?(n=this.ticker,this.ticker=null,i=this.saveAsPacket(),this.ticker=n):(this.anchor&&(s=this.anchor,delete this.anchor),this.button&&(r=this.button,delete this.button),i=this.saveAsPacket(),s&&(this.anchor=s),r&&(this.button=r)),this.name=e;let o=this.actionPacket(i);return this.packetFunctions.forEach((t=>{this[t]&&(o[t]=this[t])})),o=this.postCloneAction(o,t),o.set(t),o},t.postCloneAction=function(t){return t},t.kill=function(){return this.deregister()},t.makeName=function(t){return t&&t.substring&&!J[`${this.lib}names`].includes(t)?this.name=t:this.name=Yl(),this},t.register=function(){if(!Jl(this.name))throw new Error(`core/base error - register() name not set: ${this}`);const t=J[`${this.lib}names`],e=J[this.lib];return this.isArtefact&&(ql(a,this.name),o[this.name]=this),this.isAsset&&(ql(c,this.name),l[this.name]=this),ql(t,this.name),e[this.name]=this,this},t.deregister=function(){if(!Jl(this.name))throw new Error(`core/base error - deregister() name not set: ${this}`);const t=J[`${this.lib}names`],e=J[this.lib];return this.isArtefact&&(Ql(a,this.name),delete o[this.name]),this.isAsset&&(Ql(c,this.name),delete l[this.name]),Ql(t,this.name),delete e[this.name],this}}const Animation=function(t=Ml){return this.makeName(t.name),this.order=Jl(t.order)?t.order:this.defs.order,this.fn=t.fn||$l,this.onRun=t.onRun||Il,this.onHalt=t.onHalt||Il,this.onKill=t.onKill||Il,this.maxFrameRate=t.maxFrameRate||60,this.lastRun=0,this.chokedAnimation=!0,this.register(),t.delay||this.run(),this},nh=Animation.prototype=sc();nh.type="Animation",nh.lib=ge,nh.isArtefact=!1,nh.isAsset=!1,ih(nh);nh.defs=_l(nh.defs,{order:1,maxFrameRate:60,fn:null,onRun:null,onHalt:null,onKill:null}),nh.stringifyFunction=Il,nh.processPacketOut=Il,nh.finalizePacketOut=Il,nh.saveAsPacket=function(){return`[${this.name}, ${this.type}, ${this.lib}, {}]`},nh.clone=Ll,nh.run=function(){return this.onRun(),Gc(this.name),setTimeout((()=>Ec()),20),this},nh.isRunning=function(){return zc(this.name)},nh.halt=function(){return this.onHalt(),jc(this.name),this},nh.kill=function(){return this.onKill(),jc(this.name),this.deregister(),!0};const sh=function(t){return!!t&&new Animation(t)};Q.Animation=Animation;const rh=[],oh=Rt({x:0,y:0,scrollX:0,scrollY:0,w:0,h:0,type:ms,prefersReducedMotion:!1,prefersDarkColorScheme:!1,prefersReduceTransparency:!1,prefersContrast:!1,prefersReduceData:!1,displaySupportsP3Color:!1,canvasSupportsP3Color:!1,devicePixelRatio:0,rawTouches:[]}),ah=window.matchMedia("(prefers-contrast: more)");ah.addEventListener(Ue,(()=>{const t=ah.matches;oh.prefersContrast!==t&&(oh.prefersContrast=t,pc=!0)})),oh.prefersContrast=ah.matches;const lh=window.matchMedia("(prefers-reduced-motion: reduce)");lh.addEventListener(Ue,(()=>{const t=lh.matches;oh.prefersReducedMotion!==t&&(oh.prefersReducedMotion=t,yc(!0))})),oh.prefersReducedMotion=lh.matches;const ch=window.matchMedia("(prefers-color-scheme: dark)");ch.addEventListener(Ue,(()=>{const t=ch.matches;oh.prefersDarkColorScheme!==t&&(oh.prefersDarkColorScheme=t,kc(!0))})),oh.prefersDarkColorScheme=ch.matches;const hh=window.matchMedia("(prefers-reduced-transparency: reduce)");hh.addEventListener(Ue,(()=>{const t=hh.matches;oh.prefersReduceTransparency!==t&&(oh.prefersReduceTransparency=t,Cc(!0))})),oh.prefersReduceTransparency=hh.matches;const uh=window.matchMedia("(prefers-reduced-data: reduce)");uh.addEventListener(Ue,(()=>{const t=uh.matches;oh.prefersReduceData!==t&&(oh.prefersReduceData=t,wc(!0))})),oh.prefersReduceData=uh.matches;const dh=window.matchMedia("(color-gamut: p3)");dh.addEventListener(Ue,(()=>{const t=dh.matches;oh.displaySupportsP3Color!==t&&(oh.displaySupportsP3Color=t)})),oh.displaySupportsP3Color=dh.matches;oh.canvasSupportsP3Color=(()=>{const t=document.createElement("canvas");try{return t.getContext("2d",{colorSpace:wi}).getContextAttributes().colorSpace===wi}catch{console.log("checkCanvasSupportsDisplayP3 errored")}return!1})();const fh=()=>oh.devicePixelRatio;let ph=!1;const gh=()=>ph,mh=t=>ph=t;let yh=Il;const bh=t=>yh=t,Sh=()=>{const t=window.devicePixelRatio;oh.devicePixelRatio=t,$t(h).forEach((t=>t.dirtyDimensions=!0)),$t(d).forEach((t=>t.dirtyDimensions=!0)),$t(m).forEach((t=>t.dirtyHost=!0)),ph||yh(),matchMedia(`(resolution: ${t}dppx)`).addEventListener(Ue,Sh,{once:!0})};Sh();const kh=function(){const t=document.documentElement.clientWidth,e=document.documentElement.clientHeight;oh.w===t&&oh.h===e||(oh.w=t,oh.h=e,hc(!0),fc(!0))},Ah=function(){const t=window.pageXOffset,e=window.pageYOffset;oh.scrollX===t&&oh.scrollY===e||(oh.x+=t-oh.scrollX,oh.y+=e-oh.scrollY,oh.scrollX=t,oh.scrollY=e,hc(!0))},vh=function(t){const e=Ft(t.pageX),i=Ft(t.pageY);oh.x===e&&oh.y===i||(oh.type=navigator.pointerEnabled?"pointer":ms,oh.x=e,oh.y=i,hc(!0))};let Ch=0,Ph=16;const xh=function(){return Ph},wh=function(t){mt(t)&&(Ph=t)},Oh=function(t,e=!0){if(oh.rawTouches.length=0,t.touches&&t.touches.length){oh.rawTouches.push(...t.touches);const e=t.touches[0],i=Ft(e.pageX),n=Ft(e.pageY);oh.x===i&&oh.y===n||(oh.type=Za,oh.x=i,oh.y=n)}else oh.type=Za,e&&(oh.x=0,oh.y=0);const i=At();i>Ch+Ph&&(Ch=i,Dh())},Dh=function(){for(let t=0,e=rh.length;te.activePadding&&t.x0+e.activePadding&&t.y1||t.normY<0||t.normY>1)&&(t.active=!1));const d=oh.rawTouches;if(d.length){t.touches||(t.touches=[]),t.touches.length=0;for(let e=0,i=d.length;e{Ji.includes(t.type)&&t.recalculateFont(!0)})))}}),Th=function(){Eh(io),Eh(le),ac(!0),hc(!0),Rh.run()},Hh=function(){ac(!1),hc(!1),Rh.halt(),Eh(io)},Eh=function(t){navigator.pointerEnabled||navigator.msPointerEnabled?(window[t](nr,vh,!1),window[t](sr,vh,!1),window[t](tr,vh,!1),window[t](ir,vh,!1),window[t](er,vh,!1)):(window[t](ks,vh,!1),window[t](As,vh,!1),window[t](ys,vh,!1),window[t](Ss,vh,!1),window[t](bs,vh,!1),window[t](qa,Oh,{passive:!0}),window[t](Qa,Oh,{passive:!0}),window[t](Ka,Oh,{passive:!0}),window[t](_a,Oh,{passive:!0})),window[t]("scroll",Ah,{passive:!0}),window[t]("resize",kh,!1)},Ih=function(){kh(),hc(!0),fc(!0)},Bh=function(){const{fontfamilymetadata:t,fontfamilymetadatanames:e}=J;e.forEach((e=>delete t[e])),e.length=0},Lh=[];let $h=!1;const Mh=function(t=wl){if($h||t){const e=$c();let i,n,s,r,a,l,c,h,u,d,f,p,g,m,y,b;t&&t.substring?e.push(t):($h=!1,e.push(...Lh),Lh.length=0);const S=gh(),k=fh();for(i=0,n=e.length;i{setTimeout((()=>{y.forEach((t=>{const e=m[t];Ji.includes(e.type)&&e.recalculateFont()}))}),t)},Yh=[],Gh=[],jh=t=>{ql(Yh,t),Hc(!0)},zh=t=>{Ql(Yh,t),Hc(!0)},Nh=()=>(Tc&&Vh(),Gh),Vh=function(){Hc(!1);const t=$c();let e,i,n,s;for(n=0,s=Yh.length;n>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}t=4022871197}},qh=function(t){return function(){var e,i,n=48,s=1,r=n,o=new Array(n),a=0,l=new Kh;for(e=0;e=n&&(r=0);var t=1768863*o[r]+2.3283064365386963e-10*s;return o[r]=t-(s=0|t)},h=function(t){return Math.floor(t*(c()+11102230246251565e-32*(2097152*c()|0)))};h.string=function(t){var e,i="";for(e=0;e0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,s):n.push(s),~i.indexOf(r)&&(r=e.call(this,s,r))}else i.push(r);return null==t?r:t.call(this,s,r)}}(i,s),n)),h.initState(),h.hashString(t)},h.addEntropy=function(){var t=[];for(e=0;e{mt(t)&&t>=200&&t<=1e4&&(eu=t)},nu=t=>{mt(t)&&t>=200&&t<=1e4&&(eu=t)},su=t=>Jh[t]?(tu[t]=At(),Jh[t]):null,ru=(t,e)=>{Jh[t]=e,tu[t]=At()},ou=function(t,e=[]){const i=At();return Jh[t]?(tu[t]=i,Jh[t]):(Jh[t]=e,tu[t]=i,Jh[t])};let au=200,lu=0;const cu=t=>{mt(t)&&t>=10&&t<=5e3&&(au=t)};function hu(t=Ml){t.setEngineFromState=function(t){const e=this.state,i=Io.length;let n,s,r,o;for(n=0;n{t===ts?(gt(i.lineDash)?i.lineDash.length=0:i.lineDash=[],gt(e.lineDash)?e.lineDash.length=0:e.lineDash=[]):(i[t]=n,e[t]=n)})),i.textAlign=e.textAlign=Jn,i.textBaseline=e.textBaseline=Ua,this},t.setEngine=function(t){const e=this.state,i=t.state;if(i){const n=i.getChanges(t,e),s=this.setEngineActions;if(bt(n).length){const i=this.engine;for(const r in n)s[r](n[r],i,No,t,this),e[r]=n[r]}}return t},t.setEngineActions=dt({fillStyle:function(t,e,i,n,s){if(t.substring){let i=!1;L.includes(t)?i=B[t]:f.includes(t)&&(i=d[t]),i?(n.state.fillStyle=i,e.fillStyle=i.getData(n,s)):e.fillStyle=t}else e.fillStyle=t.getData(n,s)},filter:function(t,e){e.filter=t},font:function(t,e){e.font=t},globalAlpha:function(t,e){e.globalAlpha=t},globalCompositeOperation:function(t,e){e.globalCompositeOperation=t},imageSmoothingEnabled:function(t,e){e.imageSmoothingEnabled=t},imageSmoothingQuality:function(t,e){e.imageSmoothingQuality=t},lineCap:function(t,e){e.lineCap=t},lineDash:function(t,e){e.lineDash=t,e.setLineDash&&e.setLineDash(t)},lineDashOffset:function(t,e){e.lineDashOffset=t},lineJoin:function(t,e){e.lineJoin=t},lineWidth:function(t,e){e.lineWidth=t},miterLimit:function(t,e){e.miterLimit=t},shadowBlur:function(t,e){e.shadowBlur=t},shadowColor:function(t,e){e.shadowColor=t},shadowOffsetX:function(t,e){e.shadowOffsetX=t},shadowOffsetY:function(t,e){e.shadowOffsetY=t},strokeStyle:function(t,e,i,n,s){if(t.substring){let i=!1;L.includes(t)?i=B[t]:f.includes(t)&&(i=d[t]),i?(n.state.strokeStyle=i,e.strokeStyle=i.getData(n,s)):e.strokeStyle=t}else e.strokeStyle=t.getData(n,s)},direction:function(t,e){e.direction=t},fontKerning:function(t,e){e.fontKerning=t},fontStretch:function(t,e){e.fontStretch=t},fontVariantCaps:function(t,e){e.fontVariantCaps=t},letterSpacing:function(t,e){e.letterSpacing=t},textAlign:function(t,e){e.textAlign=Jn},textBaseline:function(t,e){e.textBaseline=Ua},textRendering:function(t,e){e.textRendering=t},wordSpacing:function(t,e){e.wordSpacing=t}}),t.clearShadow=function(){return this.engine.shadowOffsetX=0,this.engine.shadowOffsetY=0,this.engine.shadowBlur=0,this.state.shadowOffsetX=0,this.state.shadowOffsetY=0,this.state.shadowBlur=0,this},t.restoreShadow=function(t){const e=t.state;return this.engine.shadowOffsetX=e.shadowOffsetX,this.engine.shadowOffsetY=e.shadowOffsetY,this.engine.shadowBlur=e.shadowBlur,this.state.shadowOffsetX=e.shadowOffsetX,this.state.shadowOffsetY=e.shadowOffsetY,this.state.shadowBlur=e.shadowBlur,this},t.setToClearShape=function(){return this.engine.fillStyle=Ee,this.engine.strokeStyle=Ee,this.engine.shadowColor=Ee,this.state.fillStyle=Ee,this.state.strokeStyle=Ee,this.state.shadowColor=Ee,this},t.saveEngine=function(){return this.engine.save(),this},t.restoreEngine=function(){return this.engine.restore(),this},t.getEntityHits=function(){const t=[],e=$c(),i=$c();return this.groupBuckets&&this.groupBuckets.forEach((t=>{t.visibility&&e.push(...t.getAllArtefactsAt(this.here))}),this),e.forEach((e=>{const n=e.artefact;n.visibility&&!i.includes(n.name)&&(i.push(n.name),t.push(n))})),Mc(i),Mc(e),t},t.rotateDestination=function(t,e,i,n){const s=n||this,r=s.mimic,o=s.pivot;let a,l,c=s.currentRotation;if(r&&r.name&&s.useMimicFlip?(a=r.flipReverse?-1:1,l=r.flipUpend?-1:1):(a=s.flipReverse?-1:1,l=s.flipUpend?-1:1),r&&r.name&&s.useMimicRotation?c=r.currentRotation:o&&o.name&&s.addPivotRotation&&(c=o.currentRotation),c){c*=Ot;const n=at(c),s=Ht(c);t.setTransform(n*a,s*a,-s*l,n*l,e,i)}else t.setTransform(a,0,0,l,e,i);return this}}sh({name:"SC-core-workstore-hygeine",order:998,fn:()=>(()=>{const t=At();if(lu{t&&t.type===qo&&(t.setDimensions(1,1),t.engine.restore(),t.state.setStateFromEngine(t.engine),fu.push(t))}))},Coordinate=function(t,e){const i=[0,0];return Tt(i,Coordinate.prototype),Rt(i),t&&i.set(t,e),i},yu=Coordinate.prototype=lt(Array.prototype);yu.constructor=Coordinate,yu.type=Jo,yu.set=function(t,e){return Jl(t)&&(t.type===Jo?this.setFromArray(t):t.type===Pa?this.setFromVector(t):t.type===ma?this.setFromVector(t.v):gt(t)?this.setFromArray(t):Jl(e)&&this.setFromArray([t,e])),this},yu.setFromArray=function(t){return this[0]=t[0],this[1]=t[1],this},yu.setFromVector=function(t){return this[0]=t.x,this[1]=t.y,this},yu.zero=function(){return this[0]=0,this[1]=0,this},yu.vectorAdd=function(t){return this[0]+=t.x,this[1]+=t.y,this},yu.vectorSubtract=function(t){return this[0]-=t.x,this[1]-=t.y,this},yu.add=function(t){return this[0]+=t[0],this[1]+=t[1],this},yu.subtract=function(t){return this[0]-=t[0],this[1]-=t[1],this},yu.multiply=function(t){return this[0]*=t[0],this[1]*=t[1],this},yu.divide=function(t){const[e,i]=t;return e&&i&&(this[0]/=e,this[1]/=i),this},yu.scalarMultiply=function(t){return this[0]*=t,this[1]*=t,this},yu.scalarDivide=function(t){return t&&t.toFixed&&(this[0]/=t,this[1]/=t),this},yu.getMagnitude=function(){return ft(...this)},yu.rotate=function(t){const[e,i]=this;let n=nt(i,e);n+=.01745329251*t;const s=ft(e,i);return this[0]=s*at(n),this[1]=s*Ht(n),this},yu.reverse=function(){return this[0]=-this[0],this[1]=-this[1],this},yu.getDotProduct=function(t){return this[0]*t[0]+this[1]*t[1]},yu.normalize=function(){const t=this.getMagnitude();return t>0&&(this[0]/=t,this[1]/=t),this};const bu=[],Su=function(t,e){bu.length||bu.push(new Coordinate);const i=bu.shift();return i.set(t,e),i},ku=function(...t){t.forEach((t=>{t&&t.type===Jo&&bu.push(t.zero())}))},Au=function(t,e){return new Coordinate(t,e)};Q.Coordinate=Coordinate;const vu=216/24389,Cu=24389/27,Pu=null!=st?st:t=>wt(t,1/3),xu=dt([.3457/.3585,1,.2958/.3585]),wu=dt([dt([1.0479298208405488,.022946793341019088,-.05019222954313557]),dt([.029627815688159344,.990434484573249,-.01707382502938514]),dt([-.009243058152591178,.015055144896577895,.7518742899580008])]),Ou=dt([dt([.9554734527042182,-.023098536874261423,.0632593086610217]),dt([-.028369706963208136,1.0099954580058226,.021041398966943008]),dt([.012314001688319899,-.020507696433477912,1.3303659366080753])]),Du=dt([dt([506752/1228815,87881/245763,12673/70218]),dt([87098/409605,175762/245763,12673/175545]),dt([7918/409605,87881/737289,1001167/1053270])]),Fu=dt([dt([12831/3959,-329/214,-1974/3959]),dt([-851781/878810,1648619/878810,36519/878810]),dt([705/12673,-2585/12673,705/667])]),Ru=dt([dt([.8190224432164319,.3619062562801221,-.12887378261216414]),dt([.0329836671980271,.9292868468965546,.03614466816999844]),dt([.048177199566046255,.26423952494422764,.6335478258136937])]),Tu=dt([dt([.2104542553,.793617785,-.0040720468]),dt([1.9779984951,-2.428592205,.4505937099]),dt([.0259040371,.7827717662,-.808675766])]),Hu=dt([dt([1.2268798733741557,-.5578149965554813,.28139105017721583]),dt([-.04057576262431372,1.1122868293970594,-.07171106666151701]),dt([-.07637294974672142,-.4214933239627914,1.5869240244272418])]),Eu=dt([dt([.9999999984505198,.39633779217376786,.2158037580607588]),dt([1.0000000088817609,-.10556134232365635,-.06385417477170591]),dt([1.0000000546724108,-.08948418209496575,-1.2914855378640917])]),Iu=document.createElement(Ne);Iu.width=1,Iu.height=1;const Bu=Iu.getContext(jt,{willReadFrequently:!0});Bu.globalAlpha=1,Bu.globalCompositeOperation=xo;const Color=function(t=Ml){return this.makeName(t.name),this.register(),this.set(this.defs),this.rgb=[],this.rgb_max=[],this.rgb_min=[],this.hsl=[],this.hsl_max=[],this.hsl_min=[],this.hwb=[],this.hwb_max=[],this.hwb_min=[],this.xyz=[],this.xyz_max=[],this.xyz_min=[],this.lab=[],this.lab_max=[],this.lab_min=[],this.lch=[],this.lch_max=[],this.lch_min=[],this.oklab=[],this.oklab_max=[],this.oklab_min=[],this.oklch=[],this.oklch_max=[],this.oklch_min=[],this.easingFunction=Bl,this.convert(Ee),this.convert(Te,Jt),this.convert(bl,Qt),this.set(t),this},Lu=Color.prototype=sc();Lu.type=Qo,Lu.lib=zo,Lu.isArtefact=!1,Lu.isAsset=!1,ih(Lu);const $u={rgb:null,rgb_max:null,rgb_min:null,hsl:null,hsl_max:null,hsl_min:null,hwb:null,hwb_max:null,hwb_min:null,xyz:null,xyz_max:null,xyz_min:null,lab:null,lab_max:null,lab_min:null,lch:null,lch_max:null,lch_min:null,oklab:null,oklab_max:null,oklab_min:null,oklch:null,oklch_max:null,oklch_min:null,easing:es,easingFunction:null,colorSpace:oo,returnColorAs:oo};Lu.defs=_l(Lu.defs,$u),Lu.packetFunctions=ql(Lu.packetFunctions,["easingFunction"]),Lu.kill=function(){const t=this.name;return $t(m).forEach((e=>{const i=e.state;if(i){const e=i.fillStyle,n=i.strokeStyle,s=i.shadowColor;Ul(e)&&e.name===t&&(i.fillStyle=i.defs.fillStyle),Ul(n)&&n.name===t&&(i.strokeStyle=i.defs.strokeStyle),Ul(s)&&s.name===t&&(i.shadowColor=i.defs.shadowColor)}})),this.deregister(),this},Lu.get=function(t){if(Jl(t)){if(t.toFixed)return this.getRangeColor(t);if("min"===t)return this.getMinimumColor();if("max"===t)return this.getMaximumColor();if(t===zr)return this.generateRandomColor(),this.getCurrentColor();{const e=this.getters[t];if(e)return e.call(this);{const e=this.defs[t];if(typeof e!==ol){const i=this[t];return typeof i!==ol?i:e}return}}}return this.getCurrentColor()},Lu.set=function(t=Ml){const e=bt(t),i=e.length;if(i){const n=this.setters,s=this.defs;let r,o,a,l;for(o=0;o255&&(t=255),e>255&&(e=255),i>255&&(i=255),this.setColor(`rgb(${t} ${e} ${i})`)},Lu.checkColor=function(t){if(t.substring){let e=oo;return t.includes("hsl")?e=On:t.includes(_t)?e=Rn:t.includes(te)?e=Xs:t.includes(ee)?e=Ys:t.includes(Kt)?e=jn:t.includes(qt)?e=qn:t.includes(ne)&&(e=Cl),oo===e||On===e?t:(this.colorSpace=e,this.returnColorAs=e,this.convert(t),this.returnColor())}return Ee},Lu.getRangeColor=function(t,e=!1){if(Jl(t)&&t.toFixed){let i=this.colorSpace;e&&(Dn.includes(i)?i=oo:qn===i?i=jn:Ys===i&&(i=Xs));const n=this.calculateRangeColorValues(t,e),s=this.buildColorString(...n,i);this.setColor(s)}return this.getCurrentColor()},Lu.calculateRangeColorValues=function(t,e=!1){const{colorSpace:i,easing:n,easingFunction:s}=this;let r,o,a,l,c,h=i.toLowerCase();e&&(Dn.includes(i)?h="rgb":qn===i?h=Kt:Ys===i&&(h=te));const[u,d,f,p]=this[`${h}_min`],[g,m,y,b]=this[`${h}_max`];let S=s;!e&&n!==cn&&nc[n]&&(S=nc[n]);const k=e?t:S(t);switch(h){case"hsl":case _t:return c=g-u,o=u===g?u:Gl(k,c>180||c<-180?c>0?u+360:u-360:u,g),r=p===b?p:Gl(k,p,b),a=d===m?d:Gl(k,d,m),l=f===y?f:Gl(k,f,y),[o,a,l,r];case qt:case ee:return c=y-f,l=f===y?f:Gl(k,c>180||c<-180?c>0?f+360:f-360:f,y),r=p===b?p:Gl(k,p,b),a=d===m?d:Gl(k,d,m),o=u===g?u:Gl(k,u,g),[o,a,l,r];default:return r=p===b?p:Gl(k,p,b),o=u===g?u:Gl(k,u,g),a=d===m?d:Gl(k,d,m),l=f===y?f:Gl(k,f,y),[o,a,l,r]}},Lu.getAlphaValue=function(t){let e=1;return null!=t&&(e=t.includes(Vs)?parseFloat(t)/100:parseFloat(t)),mt(e)?e>1?e=1:e<0&&(e=0):e=1,e},Lu.getHueValue=function(t){return t===Is?0:(t=t.includes("deg")?parseFloat(t):t.includes("rad")?parseFloat(t)/Ot:t.includes("grad")?parseFloat(t)/400*360:t.includes("turn")?360*parseFloat(t):parseFloat(t),mt(t)?Hl(t):0)},Lu.getColorValuesFromString=function(t,e){const i=(t=(t=(t=(t=t.replace(e,wl)).replace("(",wl)).replace(")",wl)).replace("/",wl)).split(wo).filter((t=>null!=t&&t!==wl));return null!=i[0]&&i[0]!==Is||(i[0]=Gt),null!=i[1]&&i[1]!==Is||(i[1]=Gt),null!=i[2]&&i[2]!==Is||(i[2]=Gt),i},Lu.extractFromHwbColorString=function(t){const{getAlphaValue:e,getHueValue:i,getColorValuesFromString:n}=this;let s,r,o;const a=n(t,_t),l=i(a[0]),c=parseFloat(a[1]),h=parseFloat(a[2]),u=e(a[3]);return[s,r,o]=this.convertHWBtoRGB(l,c,h),s=ut(255*s),s>255&&(s=255),s<0&&(s=0),r=ut(255*r),r>255&&(r=255),r<0&&(r=0),o=ut(255*o),o>255&&(o=255),o<0&&(o=0),[u,s,r,o]},Lu.extractFromXyzColorString=function(t){const{getAlphaValue:e,getColorValuesFromString:i}=this,n=i(t,ne),s=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return[e(n[3]),s,r,o]},Lu.extractFromLabColorString=function(t){const{getAlphaValue:e,getColorValuesFromString:i}=this;let n,s,r;const o=i(t,Kt);n=parseFloat(o[0]),n>100&&(n=100),n<0&&(n=0),s=o[1].includes(Vs)?1.25*parseFloat(o[1]):parseFloat(o[1]),s>160&&(s=160),s<-160&&(s=-160),r=o[2].includes(Vs)?1.25*parseFloat(o[2]):parseFloat(o[2]),r>160&&(r=160),r<-160&&(r=-160);return[e(o[3]),n,s,r]},Lu.extractFromOklabColorString=function(t){const{getAlphaValue:e,getColorValuesFromString:i}=this;let n,s,r;const o=i(t,te);n=o[0].includes(Vs)?parseFloat(o[0])/100:parseFloat(o[0]),n>1&&(n=1),n<0&&(n=0),s=o[1].includes(Vs)?parseFloat(o[1])/100*.4:parseFloat(o[1]),s>.5&&(s=.5),s<-.5&&(s=-.5),r=o[2].includes(Vs)?parseFloat(o[2])/100*.4:parseFloat(o[2]),r>.5&&(r=.5),r<-.5&&(r=-.5);return[e(o[3]),n,s,r]},Lu.extractFromLchColorString=function(t){const{getAlphaValue:e,getHueValue:i,getColorValuesFromString:n}=this;let s,r;const o=n(t,qt);s=parseFloat(o[0]),s>100&&(s=100),s<0&&(s=0),r=o[1].includes(Vs)?1.5*parseFloat(o[1]):parseFloat(o[1]),r>230&&(r=230),r<0&&(r=0);const a=i(o[2]);return[e(o[3]),s,r,a]},Lu.extractFromOklchColorString=function(t){const{getAlphaValue:e,getHueValue:i,getColorValuesFromString:n}=this;let s,r;const o=n(t,ee);s=s=o[0].includes(Vs)?parseFloat(o[0])/100:parseFloat(o[0]),s>1&&(s=1),s<0&&(s=0),r=o[1].includes(Vs)?parseFloat(o[1])/100*.4:parseFloat(o[1]),r>.4&&(r=.4),r<0&&(r=0);const a=i(o[2]);return[e(o[3]),s,r,a]},Lu.convert=function(t,e=wl){t=t.toLowerCase();const i=this[`rgb${e}`],n=this[`hsl${e}`],s=this[`hwb${e}`],r=this[`xyz${e}`],o=this[`lab${e}`],a=this[`lch${e}`],l=this[`oklab${e}`],c=this[`oklch${e}`];if(!i)return this;let h,u,d,f;return i.length=0,n.length=0,s.length=0,r.length=0,o.length=0,a.length=0,l.length=0,c.length=0,t.includes(_t)&&!Xu?([h,u,d,f]=this.extractFromHwbColorString(t),i.push(u,d,f,h),n.push(...this.convertRGBtoHSL(u,d,f),h),s.push(...this.convertRGBHtoHWB(i[0],i[1],i[2],n[0]),h),r.push(...this.convertRGBtoXYZ(u,d,f),h),o.push(...this.convertXYZtoLAB(r[0],r[1],r[2]),h),a.push(...this.convertLABtoLCH(o[0],o[1],o[2]),h),l.push(...this.convertXYZtoOKLAB(r[0],r[1],r[2]),h),c.push(...this.convertOKLABtoOKLCH(l[0],l[1],l[2]),h)):t.includes(ne)?([h,u,d,f]=this.extractFromXyzColorString(t),i.push(...this.convertXYZtoRGB(u,d,f),h),n.push(...this.convertRGBtoHSL(i[0],i[1],i[2]),h),s.push(...this.convertRGBHtoHWB(i[0],i[1],i[2],n[0]),h),r.push(u,d,f,h),o.push(...this.convertXYZtoLAB(u,d,f),h),a.push(...this.convertLABtoLCH(o[0],o[1],o[2]),h),l.push(...this.convertXYZtoOKLAB(r[0],r[1],r[2]),h),c.push(...this.convertOKLABtoOKLCH(l[0],l[1],l[2]),h)):t.includes(te)&&!ju?([h,u,d,f]=this.extractFromOklabColorString(t),l.push(u,d,f,h),c.push(...this.convertOKLABtoOKLCH(u,d,f),h),r.push(...this.convertOKLABtoXYZ(u,d,f),h),o.push(...this.convertXYZtoLAB(r[0],r[1],r[2]),h),a.push(...this.convertLABtoLCH(o[0],o[1],o[2]),h),i.push(...this.convertXYZtoRGB(r[0],r[1],r[2]),h),n.push(...this.convertRGBtoHSL(i[0],i[1],i[2]),h),s.push(...this.convertRGBHtoHWB(i[0],i[1],i[2],n[0]),h)):t.includes(ee)&&!zu?([h,u,d,f]=this.extractFromOklchColorString(t),c.push(u,d,f,h),l.push(...this.convertOKLCHtoOKLAB(u,d,f),h),r.push(...this.convertOKLABtoXYZ(l[0],l[1],l[2]),h),o.push(...this.convertXYZtoLAB(r[0],r[1],r[2]),h),a.push(...this.convertLABtoLCH(o[0],o[1],o[2]),h),i.push(...this.convertXYZtoRGB(r[0],r[1],r[2]),h),n.push(...this.convertRGBtoHSL(i[0],i[1],i[2]),h),s.push(...this.convertRGBHtoHWB(i[0],i[1],i[2],n[0]),h)):t.includes(Kt)&&!Yu?([h,u,d,f]=this.extractFromLabColorString(t),o.push(u,d,f,h),r.push(...this.convertLABtoXYZ(u,d,f),h),i.push(...this.convertXYZtoRGB(r[0],r[1],r[2]),h),n.push(...this.convertRGBtoHSL(i[0],i[1],i[2]),h),s.push(...this.convertRGBHtoHWB(i[0],i[1],i[2],n[0]),h),a.push(...this.convertLABtoLCH(u,d,f),h),l.push(...this.convertXYZtoOKLAB(r[0],r[1],r[2]),h),c.push(...this.convertOKLABtoOKLCH(l[0],l[1],l[2]),h)):t.includes(qt)&&!Gu?([h,u,d,f]=this.extractFromLchColorString(t),a.push(u,d,f,h),o.push(...this.convertLCHtoLAB(u,d,f),h),r.push(...this.convertLABtoXYZ(o[0],o[1],o[2]),h),i.push(...this.convertXYZtoRGB(r[0],r[1],r[2]),h),n.push(...this.convertRGBtoHSL(i[0],i[1],i[2]),h),s.push(...this.convertRGBHtoHWB(i[0],i[1],i[2],n[0]),h),l.push(...this.convertXYZtoOKLAB(r[0],r[1],r[2]),h),c.push(...this.convertOKLABtoOKLCH(l[0],l[1],l[2]),h)):([u,d,f,h]=this.getColorFromCanvas(t),i.push(u,d,f,h),n.push(...this.convertRGBtoHSL(u,d,f),h),s.push(...this.convertRGBHtoHWB(u,d,f,n[0]),h),r.push(...this.convertRGBtoXYZ(u,d,f),h),o.push(...this.convertXYZtoLAB(r[0],r[1],r[2]),h),a.push(...this.convertLABtoLCH(o[0],o[1],o[2]),h),l.push(...this.convertXYZtoOKLAB(r[0],r[1],r[2]),h),c.push(...this.convertOKLABtoOKLCH(l[0],l[1],l[2]),h)),this},Lu.extractRGBfromColor=function(t){let e,i,n,s;return(t=t.toLowerCase()).includes(_t)&&!Xu?([e,i,n,s]=this.extractFromHwbColorString(t),[i,n,s,e]):t.includes(ne)?([e,i,n,s]=this.extractFromXyzColorString(t),[...this.convertXYZtoRGB(i,n,s),e]):t.includes(te)&&!ju?([e,i,n,s]=this.extractFromOklabColorString(t),[...this.convertXYZtoRGB(...this.convertOKLABtoXYZ(i,n,s)),e]):t.includes(ee)&&!zu?([e,i,n,s]=this.extractFromOklchColorString(t),[...this.convertXYZtoRGB(...this.convertOKLABtoXYZ(...this.convertOKLCHtoOKLAB(i,n,s))),e]):t.includes(Kt)&&!Yu?([e,i,n,s]=this.extractFromLabColorString(t),[...this.convertXYZtoRGB(...this.convertLABtoXYZ(i,n,s)),e]):t.includes(qt)&&!Gu?([e,i,n,s]=this.extractFromLchColorString(t),[...this.convertXYZtoRGB(...this.convertLABtoXYZ(...this.convertLCHtoLAB(i,n,s))),e]):this.getColorFromCanvas(t)},Lu.convertRGBtoHex=function(t,e,i){if(t.substring&&(t=parseInt(t,10)),e.substring&&(e=parseInt(e,10)),i.substring&&(i=parseInt(i,10)),mt(t)&&mt(e)&&mt(i)){return`#${(Gt+t.toString(16)).slice(-2)}${(Gt+e.toString(16)).slice(-2)}${(Gt+i.toString(16)).slice(-2)}`}return"#000000"},Lu.getColorFromCanvas=function(t){let e=0,i=0,n=0,s=0;Bu.clearRect(0,0,1,1),Bu.fillStyle=t,Bu.fillRect(0,0,1,1);const r=Bu.getImageData(0,0,1,1);return r&&r.data&&([e,i,n,s]=r.data,s/=255),[e,i,n,s]},Lu.convertRGBtoHSL=function(t,e,i){const n=St(t/=255,e/=255,i/=255),s=kt(t,e,i),r=(s+n)/2,o=n-s;let a=0,l=0;if(0!==o){switch(l=0===r||1===r?0:(n-r)/kt(r,1-r),n){case t:a=(e-i)/o+(e=1){const t=e/(e+i);return[t,t,t]}const n=this.convertHSLtoRGB(t,100,50);for(let t=0;t<3;t++)n[t]*=1-e-i,n[t]+=e;return n},Lu.multiplyMatrices=function(t,e){const i=t.length;gt(t[0])||(t=[t]),gt(e[0])||(e=e.map((t=>[t])));const n=e[0].length,s=e[0].map(((t,i)=>e.map((t=>t[i]))));let r=t.map((t=>s.map((e=>gt(t)?t.reduce(((t,i,n)=>t+i*(e[n]||0)),0):e.reduce(((e,i)=>e+i*t),0)))));return 1===i&&(r=r[0]),1===n?r.map((t=>t[0])):r},Lu.lin_sRGB=function(t){return t.map((t=>{const e=t<0?-1:1,i=tt(t);return i<.04045?t/12.92:e*wt((i+.055)/1.055,2.4)}))},Lu.convertRGBtoXYZ=function(t,e,i){const n=$c();n.push(t/255,e/255,i/255);const s=$c();s.push(...this.lin_sRGB(n));const r=$c();r.push(...Du);const o=this.multiplyMatrices(r,s);return Mc(n),Mc(s),Mc(r),o},Lu.convertRGBtoOKLAB=function(t,e,i){const n=$c();n.push(t/255,e/255,i/255);const[s,r,o]=this.lin_sRGB(n),a=.2119034982*s+.6806995451*r+.1073969566*o,l=.0883024619*s+.2817188376*r+.6299787005*o,c=Pu(.4122214708*s+.5363325363*r+.0514459929*o),h=Pu(a),u=Pu(l);return Mc(n),[.2104542553*c+.793617785*h-.0040720468*u,1.9779984951*c-2.428592205*h+.4505937099*u,.0259040371*c+.7827717662*h-.808675766*u]},Lu.gam_sRGB=function(t){return t.map((t=>{const e=t<0?-1:1,i=tt(t);return i>.0031308?e*(1.055*wt(i,1/2.4)-.055):12.92*t}))},Lu.convertXYZtoRGB=function(t,e,i){const n=$c();n.push(...Fu);const s=$c();s.push(t,e,i);const r=this.multiplyMatrices(n,s),o=this.gam_sRGB(r);return Mc(n),Mc(s),[Ft(255*o[0]),Ft(255*o[1]),Ft(255*o[2])]},Lu.convertXYZtoLAB=function(t,e,i){const n=$c();n.push(...wu);const s=$c();s.push(t,e,i);const r=this.multiplyMatrices(n,s).map(((t,e)=>t/xu[e])).map((t=>t>vu?Pu(t):(Cu*t+16)/116));return Mc(n),Mc(s),[116*r[1]-16,500*(r[0]-r[1]),200*(r[1]-r[2])]},Lu.convertLABtoXYZ=function(t,e,i){const n=(t+16)/116,s=e/500+n,r=n-i/200,o=$c();o.push(wt(s,3)>vu?wt(s,3):(116*s-16)/Cu,t>8?wt((t+16)/116,3):t/Cu,wt(r,3)>vu?wt(r,3):(116*r-16)/Cu);const a=$c();a.push(...Ou);const l=$c();l.push(...o.map(((t,e)=>t*xu[e])));const c=this.multiplyMatrices(a,l);return Mc(o),Mc(a),Mc(l),c},Lu.convertLABtoLCH=function(t,e,i){const n=nt(i,e)*pt;return[t,Et(wt(e,2)+wt(i,2)),n>=0?n:n+360]},Lu.convertLCHtoLAB=function(t,e,i){return[t,e*at(i*Ot),e*Ht(i*Ot)]},Lu.convertXYZtoOKLAB=function(t,e,i){const n=$c();n.push(...Ru);const s=$c();s.push(t,e,i);const r=$c();r.push(...Tu);const o=this.multiplyMatrices(n,s),a=this.multiplyMatrices(r,o.map((t=>Pu(t))));return Mc(n),Mc(s),Mc(r),a},Lu.convertOKLABtoXYZ=function(t,e,i){const n=$c();n.push(...Eu);const s=$c();s.push(t,e,i);const r=$c();r.push(...Hu);const o=this.multiplyMatrices(n,s),a=this.multiplyMatrices(r,o.map((t=>t**3)));return Mc(n),Mc(s),Mc(r),a},Lu.convertOKLABtoOKLCH=function(t,e,i){const n=nt(i,e)*pt;return[t,Et(e**2+i**2),n>=0?n:n+360]},Lu.convertOKLCHtoOKLAB=function(t,e,i){return[t,e*at(i*Ot),e*Ht(i*Ot)]},Lu.calculateColorBlend=function(t,e,i,n,s,r){const o=this.convertRGBtoHSL(t,e,i),a=this.convertRGBtoHSL(n,s,r),l=this.convertHSLtoRGB(o[0],o[1],a[2]);return[Ft(255*l[0]),Ft(255*l[1]),Ft(255*l[2])]},Lu.calculateHueBlend=function(t,e,i,n,s,r){const o=this.convertRGBtoHSL(t,e,i),a=this.convertRGBtoHSL(n,s,r),l=this.convertHSLtoRGB(o[0],a[1],a[2]);return[Ft(255*l[0]),Ft(255*l[1]),Ft(255*l[2])]},Lu.calculateSaturationBlend=function(t,e,i,n,s,r){const o=this.convertRGBtoHSL(t,e,i),a=this.convertRGBtoHSL(n,s,r),l=this.convertHSLtoRGB(a[0],o[1],a[2]);return[Ft(255*l[0]),Ft(255*l[1]),Ft(255*l[2])]},Lu.calculateLuminosityBlend=function(t,e,i,n,s,r){const o=this.convertRGBtoHSL(t,e,i),a=this.convertRGBtoHSL(n,s,r),l=this.convertHSLtoRGB(a[0],a[1],o[2]);return[Ft(255*l[0]),Ft(255*l[1]),Ft(255*l[2])]};let Xu=!1,Yu=!1,Gu=!1,ju=!1,zu=!1,Nu=!1;!function(){let t,e=0,i=0,n=0,s="#ffffff00";Bu.fillStyle="hwb(90 10% 10%)",Bu.fillRect(0,0,1,1),t=Bu.getImageData(0,0,1,1),t&&t.data&&([e,i,n]=t.data),(e||i||n)&&(Xu=!0),Xu&&s===Bu.fillStyle?Xu=!1:s=Bu.fillStyle,Bu.fillStyle="lab(29.2345% 39.3825 20.0664)",Bu.clearRect(0,0,1,1),Bu.fillRect(0,0,1,1),t=Bu.getImageData(0,0,1,1),t&&t.data&&([e,i,n]=t.data),(e||i||n)&&(Yu=!0),Yu&&s===Bu.fillStyle?Yu=!1:s=Bu.fillStyle,Bu.fillStyle="lch(52.2345% 72.2 56.2)",Bu.clearRect(0,0,1,1),Bu.fillRect(0,0,1,1),t=Bu.getImageData(0,0,1,1),t&&t.data&&([e,i,n]=t.data),(e||i||n)&&(Gu=!0),Gu&&s===Bu.fillStyle?Gu=!1:s=Bu.fillStyle,Bu.fillStyle="oklab(59.686% 0.1009 0.1192)",Bu.clearRect(0,0,1,1),Bu.fillRect(0,0,1,1),t=Bu.getImageData(0,0,1,1),t&&t.data&&([e,i,n]=t.data),(e||i||n)&&(ju=!0),ju&&s===Bu.fillStyle?ju=!1:s=Bu.fillStyle,Bu.fillStyle="oklch(59.686% 0.15619 49.7694)",Bu.clearRect(0,0,1,1),Bu.fillRect(0,0,1,1),t=Bu.getImageData(0,0,1,1),t&&t.data&&([e,i,n]=t.data),(e||i||n)&&(zu=!0),zu&&s===Bu.fillStyle?zu=!1:s=Bu.fillStyle,Bu.fillStyle="color(display-p3 0 1 0)",Bu.clearRect(0,0,1,1),Bu.fillRect(0,0,1,1),t=Bu.getImageData(0,0,1,1),t&&t.data&&([e,i,n]=t.data),(e||i||n)&&(Nu=!0),Nu&&s===Bu.fillStyle?Nu=!1:s=Bu.fillStyle}();const Vu=function(t){return!!t&&new Color(t)};Q.Color=Color;const Wu=new Float32Array([.37,.69,.62,.78,.06,.84,.27,.14,.46,1,.58,.28,.62,.8,.3,.7,.93,.53,.76,.24,.15,.51,.79,.28,.99,.16,.22,.45,.03,.73,.34,.96,.5,.3,.07,.84,.51,.27,.89,.8,.66,.25,.54,.94,.08,.66,.36,.85,.69,.93,.26,.79,.68,.36,.23,.5,.83,.34,.64,.91,.73,.8,.95,.59,.1,.76,.82,.03,.62,.47,.09,.55,.33,.22,.45,.04,.76,.52,.69,.24,.78,.12,.59,.37,.03,.82,.93,.69,.42,.34,.89,.62,.27,1,.53,.09,.38,.71,.13,.52,.19,.66,.33,.42,.63,.28,.36,.61,.73,.06,.56,.97,.35,.72,.91,.3,.98,.53,.2,.08,.5,.22,.87,.93,.08,.44,.91,.56,.12,.99,.01,.49,.37,.68,.89,.55,.3,.84,.17,.67,.1,.48,.89,.23,.47,.06,.29,.61,.67,.91,.2,.47,.64,.05,.77,.94,.62,.09,.58,.12,.77,.47,.93,.39,.73,.09,.47,.58,.15,.39,.02,.64,.32,.77,.98,.03,.28,.44,.11,.01,.73,.44,.88,.02,.76,.53,.41,.05,.25,.36,.02,.31,.52,.39,.28,.57,.91,.7,.98,0,.76,.94,.66,.85,.33,.18,.88,.01,.99,.46,.69,.94,.32,.51,.45,.07,.55,.22,.11,.8,.42,.17,.87,.47,.81,.23,.88,.43,.6,.11,.75,.06,.88,.72,.47,.92,.13,.31,.84,.47,.27,.16,.5,.09,.78,.44,.34,.56,.95,.69,.36,.13,.64,.29,.04,.87,.41,.53,.31,.87,.22,.6,.09,.77,.22,.72,.4,.88,.37,.75,.06,.58,.65,.86,.99,.42,.37,.58,.04,.74,.35,.57,.83,.39,.5,.91,.42,.27,.69,.02,.8,.22,.63,.97,.04,.34,.69,.97,.51,.83,.45,.24,.56,.49,.64,.81,.99,.55,.31,.17,.62,.1,.69,.15,.86,.2,.52,.67,.77,.19,.7,.85,.45,.18,.12,.4,.3,.82,.37,.53,.07,.27,.56,.64,.44,.34,.56,.25,.2,.08,.76,.64,.15,.78,.95,.72,.87,.51,.36,.02,.74,.3,.07,.64,.34,0,.82,.28,.97,.22,.5,.81,.02,.25,.41,.69,.2,.03,.76,.42,.69,.85,.59,.14,.91,.76,.28,.06,.61,.47,.73,.8,.55,.25,.61,.82,.19,.72,.13,.98,.41,.03,.64,.96,.12,.52,.27,.17,.97,.42,.13,.35,.2,.78,.11,.86,.82,.24,.95,.49,.14,.25,.17,.69,.85,.21,.95,.58,.35,.15,.44,.29,.78,.84,.2,.28,.88,.09,.2,.92,.13,.75,.17,.37,.23,.52,.89,.82,.47,1,.39,.29,.75,.59,.96,.14,.42,.92,.63,.04,1,.67,.78,.5,.24,.61,.17,.71,.92,.41,.11,.96,.74,.07,.83,.66,.89,.4,.85,.23,.55,.36,.27,.19,.04,.67,.94,.58,.63,.2,.97,.75,.55,.92,.72,.46,.55,.69,.34,.17,.67,.56,.88,.96,.52,.62,.94,.88,.21,.04,.37,.25,.72,.02,.81,.16,.91,.4,.21,1,.16,.7,.94,.1,.78,.55,.45,.7,.51,.86,.29,.48,.05,.93,.59,.81,.72,.29,.83,.59,.73,0,.49,.3,.64,.39,.11,.71,.32,.97,.78,.34,.05,.37,.49,.12,.9,.68,.56,.92,.49,.14,.55,.76,.6,.34,.72,.64,.4,.03,.88,.6,.71,.13,.65,.05,.27,.56,.22,.94,.47,.09,.33,.84,.47,.27,.09,.57,.23,.34,.07,.95,.56,.87,.11,.46,.2,.77,.87,.5,.18,.29,.79,.14,.61,.51,.29,.99,.01,.91,.65,.47,.58,.3,.23,.13,.83,.4,.49,.15,.25,.36,.17,.84,.13,.41,.07,1,.44,.77,.09,.35,.73,.3,.11,.34,.57,.47,.93,.63,.41,.53,.49,.32,.86,.55,.02,.84,.51,.34,.26,.04,.39,.92,.33,.25,.84,.17,.35,.8,.43,.67,.31,.03,.51,.47,.08,.94,.25,.55,.91,.71,.15,.45,.58,.89,.67,.02,.47,.57,.62,.82,.73,.53,.27,.81,.07,.19,.65,.4,.92,0,.44,.16,1,.53,.8,.33,.96,.29,.07,.44,.94,.34,.74,.84,.67,0,.84,.64,.71,.04,.55,.89,.39,.72,.53,.82,.42,.65,.02,.36,.94,.29,.63,0,.37,.25,.67,.93,.51,.37,.04,.74,.12,.68,.44,.81,.11,.38,.78,.99,.45,.71,.89,.33,.59,.91,.69,.51,.05,.64,.27,.89,.61,.84,.31,.24,.5,.04,.18,.44,.8,.66,.14,.75,.82,.11,.18,.99,.65,.12,.77,.25,.62,.32,.09,.75,.65,.47,.58,.16,.05,.65,.08,.94,.56,.73,.25,.84,.14,.38,.87,.64,.16,.78,.4,.64,.2,.33,.99,.02,.86,.2,.53,.42,.86,.1,.94,.14,.23,.99,.03,.4,.88,.72,.24,.07,.8,.32,.69,.83,.04,.25,.68,.22,.48,.55,.76,.86,.39,.17,.53,.09,.42,.34,.5,.26,.23,1,.18,.77,.31,.94,.15,.88,.29,.73,.21,.8,.69,.53,.95,.76,.56,.11,.6,.05,.44,.23,.96,.82,.56,.35,.21,.72,.52,.88,.16,.82,.08,.52,.27,.8,.1,.02,.84,.3,.78,.98,.43,.73,.19,.52,.14,.89,.65,.79,.6,.92,.52,.07,.98,.27,.51,.3,.78,.88,.23,.42,.7,.1,.91,.77,.43,.96,.22,.87,.71,.8,.95,.55,.76,.45,.15,.02,.99,.54,.2,.73,.96,.24,.55,.36,.05,.95,.13,.75,.55,.77,.25,.36,.13,.8,.19,.29,.71,.36,.45,.65,.33,.61,.51,.37,1,.56,.46,.89,.23,.5,.4,.91,.58,.07,.83,.65,.12,.25,.61,.79,.14,.97,.63,.78,.12,.89,.43,.38,.61,.69,0,.45,.19,.6,.02,.92,.5,.42,.09,.24,.42,.16,.89,.48,.99,.76,.66,.87,.27,.45,.16,.62,.89,.25,.04,.33,.22,.62,.37,0,.67,.18,.45,.75,.62,.42,.18,.57,.01,.36,.8,.05,.68,.4,1,.27,.86,.4,.22,.37,.83,.44,.68,.05,.56,.35,.06,.59,.94,.49,.38,.58,.16,.53,.13,.29,.36,.51,.2,.26,.36,.89,.69,.31,.42,.63,.91,.5,.04,.31,.85,.72,.47,.83,.61,.36,.48,.07,.93,.64,.72,1,.6,.49,.89,.54,.08,.76,.92,.16,.09,.82,.29,.14,.61,.18,.75,.65,.11,.29,.78,.15,.42,.36,.99,.01,.49,.69,.31,.89,.25,.18,.94,.58,.7,.85,.09,.5,.22,.85,.69,.39,.33,.78,.15,.58,.85,.04,.72,.35,.84,.28,.4,.16,.33,.56,.01,.69,.96,.06,.47,.83,.56,.69,.93,.54,.74,.94,.86,.53,.98,.38,.24,.95,.11,.67,.86,.51,.3,.96,.46,.57,.34,.05,.15,.71,.31,.77,.03,.6,.2,.94,.72,.45,.82,.17,.31,.8,.2,.05,.69,.84,.76,.01,1,.09,.84,.44,.62,.11,.22,.5,.81,.05,.29,.45,.77,.68,.09,.91,.2,.28,0,.89,.18,.69,.32,.51,.44,.03,.35,.25,.67,.03,.84,.2,.56,.46,.89,.23,.69,.78,.95,.37,.09,.55,.87,.44,.73,.95,.52,.82,.23,.73,.91,.44,.04,.55,.46,.73,.41,.03,.31,.14,.78,.36,.97,.56,.8,.11,.99,.52,.27,.91,.64,.95,.49,.19,.66,.03,.55,.85,.13,.62,.8,.41,.29,.75,.39,.13,.99,.45,.05,.27,.47,.12,.41,.63,.29,.15,.84,.54,.32,.74,.22,.13,.64,.85,.08,.16,.75,.51,.47,.64,.95,.58,.14,.91,.51,.39,.13,.25,.97,.69,.01,.56,.87,.28,.93,.38,.62,.44,.67,.57,.7,.01,.8,.98,.6,.89,.73,.16,.71,.12,.59,.36,.54,.15,.57,.67,.45,.25,.95,.83,.11,.22,.84,.09,.77,.92,.16,.41,.96,.35,.25,.75,.65,0,.44,.53,.06,.28,.83,.99,.23,0,.59,.24,.05,.63,.28,.55,.36,.16,.83,.72,.31,.08,.66,.81,.53,.22,.9,.62,.28,.05,.45,.64,.22,.71,.07,.35,.45,.31,.1,.77,.6,.95,.24,.73,.49,.99,.22,.1,.55,.91,.63,.24,.74,.41,.79,.16,.81,.33,.22,.04,.81,.67,.48,.04,.8,.44,.99,.41,.78,.25,.6,.94,.28,.82,.91,.2,.11,.44,.73,.34,.79,.06,.85,.63,.51,.42,.9,.73,.44,.64,.05,.49,.24,.9,.2,.33,.93,.15,.48,.34,.19,0,.45,.34,.97,.84,.21,.95,.26,.41,.82,.98,.72,.54,.34,.62,.39,.57,.93,.69,.53,.44,.8,.64,.53,.71,.11,.94,.37,.58,.87,.2,.73,.47,.42,.67,.34,.49,.91,.38,.72,.13,.89,.77,.08,.96,.64,.19,1,.85,.47,.25,.96,.71,.47,.12,.76,.16,.91,.3,.51,.85,.8,.15,.75,.55,.89,.36,.46,.07,.89,.43,.04,.36,.87,.48,.85,.17,.02,.52,.31,.09,.87,.64,.97,.58,.71,.91,.51,.1,.9,.59,.27,.16,.62,.57,.01,.49,.38,.73,.42,0,.6,.38,.86,.28,.64,.24,1,.56,.3,.76,.18,.1,.35,.23,.14,.98,.31,.8,.72,.15,.84,.53,.25,.4,.73,.85,.55,.67,.91,.25,.55,.51,.03,.69,.88,.75,.03,.34,.09,.16,.78,.05,.75,.88,.28,.2,.37,.13,.3,.22,.04,.87,.44,.54,.15,.25,1,.32,.64,.93,.25,.13,.64,.8,.16,.55,.97,.41,.48,.24,.61,.4,.27,.53,.12,.36,.16,.6,.36,.05,.4,.58,.82,.37,.69,.95,0,.56,.39,.66,.23,0,.81,.18,.69,.32,.8,.28,.67,.62,.26,.73,.58,.27,.67,.83,.94,.55,.2,.36,.5,.08,.84,.42,.35,.2,.74,.38,.93,.71,.08,.3,.97,.83,.19,.88,.15,.67,.24,.8,.07,.51,.84,.02,.18,.69,.45,.04,.91,.58,.8,.47,.71,.6,.08,.56,.41,.04,.36,.77,.09,.9,.58,.05,.31,.39,.09,.75,.63,.31,.82,.45,.12,.61,.51,.22,.63,.93,.51,.2,.47,.32,.06,.66,.59,.97,.9,.69,.58,.16,.31,.82,.06,.76,.41,.1,.82,.02,.58,.89,.05,.28,.84,.08,.3,.77,.02,.67,.33,.81,.02,.67,.75,.57,.91,.8,.09,.85,.67,.99,.25,.51,.13,.45,.25,.12,.88,.46,.95,.6,.28,.98,.49,.16,.57,.18,.95,.81,.16,.04,.98,.44,.35,.77,.04,.61,.7,.29,.01,.67,.16,.27,.99,.63,.47,0,.2,.83,.47,.88,.13,.66,.54,.08,.98,.5,.32,.56,.97,.69,.4,.61,.48,.94,.37,.83,.6,.29,.94,.03,.87,.37,.16,.91,.65,.49,.97,.45,.64,.67,.22,.13,1,.84,.49,.16,.94,.07,.42,.19,.28,.94,.36,.89,.46,.83,.29,.7,.91,.14,.42,.8,.73,.07,.47,.75,.38,.97,.63,.69,.91,.47,.69,.56,.14,.47,.76,.52,.97,.44,.75,.5,.64,.19,.84,.99,.13,.5,.91,.86,.32,.05,.23,.42,.52,.3,.17,.33,.04,.89,.61,.73,.34,.93,.75,.15,.31,.7,.41,.07,.64,.84,.75,.41,.08,.48,.32,.39,.7,.11,.87,.14,.47,.27,.95,.77,.47,.93,.62,.53,.77,.12,.31,.96,.67,.49,.38,.73,.24,.4,.33,.6,.78,.39,.85,.15,.44,.2,.11,.89,.78,.09,.24,.73,.14,.45,.67,.22,.53,.83,.27,.75,.3,.2,.85,0,.28,.83,.37,.52,.78,.71,.6,.22,.37,.89,.66,.78,.57,.03,.68,.74,.17,.38,.03,.59,.81,.63,.98,.52,.22,.35,.27,.12,.85,.01,.25,.35,.19,.6,.3,.92,.8,.35,.3,.17,.36,.7,.23,.1,.88,.38,.55,.28,.72,.57,.17,.38,.47,.98,.72,.63,.89,.75,.55,.93,.64,.08,.78,.82,.19,.62,.53,.37,.05,.84,.49,.94,.23,.35,.01,.99,.53,.66,.76,.95,.57,.23,.64,.31,.89,.4,.12,.86,.16,.41,.31,.81,.03,.86,.56,.81,.25,.11,.58,.19,.8,.93,.05,.84,.25,.11,.73,.02,.67,.93,.36,.55,.31,.66,.2,.51,.41,.86,.06,.33,.63,.42,.01,.98,.59,.1,.7,.57,.18,.44,.92,.64,.27,.42,.04,.81,.54,.71,.25,.99,.49,.82,.11,.25,.55,.66,.95,.12,.24,.38,.03,.28,.88,.57,.92,.42,.53,.59,.77,.44,.12,.88,.02,.24,.7,.09,.86,.67,.03,.93,.58,.33,.95,.6,.06,.44,.9,.08,.24,.63,.14,.79,.28,.16,.02,.39,.12,.8,.44,.36,.28,.49,.42,.02,.24,.91,.66,.13,.59,.2,.73,.47,.6,.3,.21,.89,.26,.07,.48,.79,.01,.95,.52,.66,.07,.55,.73,.89,.07,.2,.49,.38,.61,.17,.4,.78,.97,.01,.62,.48,.69,.22,.47,.97,.59,.52,.8,.26,.72,.05,.42,.89,.8,.03,1,.76,.17,.93,.78,.09,.69,.45,.89,.39,.82,.34,.98,.75,.1,.04,.34,.17,.9,.32,.11,.49,.05,.15,.33,.38,.61,.97,.07,.85,.34,.44,.77,.54,.73,.17,.69,.8,.05,.65,.19,.93,.09,.83,.51,.97,.36,.53,.43,.62,.97,.51,.81,.16,.45,.03,.75,.27,.16,.8,.35,.67,.77,.85,.53,.11,.56,.36,.96,.6,.24,.48,.69,.23,.91,.12,1,.69,.8,.55,.44,.98,.31,.8,.08,.89,.69,.84,.39,.12,.62,.18,.88,.31,.7,.56,.2,.78,.35,.62,.24,.58,.97,.65,.7,.95,.04,.49,.91,.33,.68,.47,.29,.38,.95,.16,.67,.37,.29,.19,.89,.49,.61,.16,.95,.56,.48,.27,.62,.34,.56,.48,.28,.92,.55,.15,.77,.05,.63,.24,.12,.49,.59,.84,.97,.53,.75,.64,.97,.44,.86,.62,.91,.22,.79,.44,.31,.72,.52,.19,.93,.09,.88,.49,.41,.11,.98,.31,.72,.28,.41,.58,.3,.74,.66,.15,.84,.05,.2,.41,.27,.62,.87,.82,.53,.67,.47,.86,.58,.04,.42,.94,.33,.69,.88,.45,.83,.67,.05,.86,.98,.01,.66,.57,.3,.85,.05,.22,.27,.71,.03,.37,.53,.27,.16,.03,.57,.69,.82,.42,.53,.99,.36,.09,.83,.28,.98,.02,.46,.15,.33,.43,.18,.28,.75,.24,.82,.08,.22,.89,.85,.13,.76,.58,.07,.89,.77,.07,.42,.04,.83,.22,.7,.34,.13,.9,.7,.06,.25,.74,.11,.83,.35,.25,.52,.43,.94,.53,.86,.72,.31,.2,.7,.56,.36,.27,.2,.58,.36,.74,.1,.5,.69,.16,.93,.04,.78,.6,.28,.65,.34,.96,.23,.62,.36,.47,.88,.06,.72,.95,.21,.04,.79,.27,.91,.59,.33,.77,.1,.69,.31,.21,.36,.12,.95,.31,.2,1,.28,.48,.03,.24,.76,.07,.19,.34,.76,.15,.33,.55,.39,.76,.16,.48,.37,.94,.51,.84,.62,.92,.67,.42,.94,.79,.45,.97,.36,.03,.75,.13,.24,.46,.73,.14,.4,.85,.69,.5,.83,.76,.09,.89,.45,.68,.56,.4,.64,.52,.05,.23,.53,.34,.81,.44,.24,.67,.56,.98,.37,.52,.78,.02,.4,.21,.81,.45,.87,.59,.4,.2,.66,1,.08,.29,.2,.67,.01,.39,.27,.79,.45,.09,0,.78,.94,.07,.8,.28,.66,.02,.88,.39,.58,.23,.42,.91,.13,.38,.82,.03,.56,.77,.16,.82,.54,.16,.61,.33,.12,.63,.44,.37,.48,.73,0,.91,.56,1,.44,.07,.92,.63,0,.77,.52,.12,.8,.18,.59,.4,.99,.29,.56,.52,.94,.42,.62,.84,.08,.95,.25,.6,.74,.65,.11,.16,.45,.21,.06,.76,.32,.49,.18,.07,.66,.27,.61,.86,.66,.91,.48,.61,.89,.19,.75,.29,.04,.91,.54,.6,.34,.01,.99,.14,.31,.72,.81,.41,.99,.62,.05,.49,.96,.73,.33,.13,.67,.27,.88,.59,.94,.65,.16,.37,.99,.05,.81,.53,0,.73,.6,.85,.8,.36,.47,.09,.94,.64,.13,.91,.84,.47,.67,.53,.22,.42,.96,.55,.34,.76,.12,.48,.69,.04,.75,.53,.47,.2,.71,.9,.26,0,.67,.85,.42,.91,.78,.55,.87,.19,.11,.97,.66,.37,.48,.16,.65,.8,.56,.27,.72,.4,.61,.47,.71,.92,.67,.83,.15,.64,.92,.05,.47,.12,.28,.73,.2,.51,.82,.42,0,.32,.77,.56,.29,.8,.98,.59,.11,.63,.27,.87,.54,.92,.19,.42,.02,.8,.18,.07,.53,.32,.13,.99,.63,.38,.24,.15,.84,.77,.18,.85,.49,.93,.59,.16,.69,.27,.84,.12,.59,.18,.89,.45,.83,.19,.44,.11,.75,.5,.56,.09,.31,.65,.25,.92,.44,.35,.7,.13,.55,.97,.76,.59,.86,.55,.36,.25,.62,.17,.32,.11,.61,.85,.13,.45,.23,.64,.84,.99,.34,.86,.29,.98,.78,.09,.63,.31,.5,1,.38,.22,.08,.49,.26,.02,.99,.71,.59,.31,.22,.13,.84,.24,.04,.35,.84,.44,.17,.89,.05,.86,.38,.25,.07,.53,.45,.36,.25,.7,.8,.66,.91,.5,.36,.06,.69,.89,.2,.82,1,.39,.7,.09,.36,.19,.91,.72,.37,.78,.16,.47,.81,.34,.56,.29,.95,.37,.8,.67,.44,.58,.2,.49,.71,.96,.29,.49,.71,.44,.25,.11,.34,.01,.46,.91,.22,.37,.55,.28,.01,.79,.59,.05,.98,.36,.29,.23,.85,.78,.71,.47,.11,.76,.87,.22,.96,.39,.28,.09,.23,.17,.31,.05,.46,1,.69,.39,.88,.77,.98,.36,.05,.73,.94,.06,.18,.44,.57,.1,.17,.59,.25,.35,.94,.42,.08,.59,.74,.33,.95,.61,.81,.41,.33,.08,.52,.79,.45,.91,.72,.58,.95,.75,.49,.17,.99,.33,.23,.65,.15,.55,.31,.84,0,.76,.87,.17,.38,.22,0,.87,.99,.63,.3,.11,.54,.5,.05,.24,.86,.52,.64,.47,.4,0,1,.61,.33,.69,.08,.98,.52,.12,.71,.43,.25,.92,.02,.86,.35,.78,.05,.65,.41,.1,.63,.05,.77,.65,.96,.4,.81,.66,.09,.78,.71,.86,.42,.35,.22,.72,.52,.86,.71,.04,.97,.4,.19,.95,.15,.37,.57,.06,.79,.46,.65,.72,.51,.93,.69,.82,.74,.07,.57,.28,.03,.43,.72,.56,.3,.81,.52,.4,.7,.28,.81,.66,.42,.91,.67,.12,.82,.55,.87,.18,.45,.77,.09,.69,.16,.77,.65,.24,.92,.39,.64,.08,.51,.32,.41,.23,.09,.7,.58,.8,.49,.1,.79,.96,.72,.2,.95,.53,.09,.61,.98,.52,.33,.54,.15,.78,.39,.94,.73,.17,.66,.6,.12,.92,.77,.27,.83,.57,.11,.23,.43,.03,.87,.25,.75,.63,.84,.08,.61,.76,.15,.53,.94,.27,.08,.91,.53,.22,.94,.36,.9,.5,.21,.56,.16,.56,.34,.97,.49,.1,.62,.67,.93,.49,.14,.62,.2,.58,.12,.34,.63,.55,.84,.68,.3,.51,.2,.91,.02,.89,.38,.45,.13,.27,.41,.18,.79,.94,.52,.11,.25,.19,.66,.89,.14,.59,.88,.02,.49,.21,.78,.51,0,.47,.75,.21,.03,.7,.84,.27,.54,.38,.22,.91,.56,.84,.02,.73,.18,.28,.83,.02,.92,.64,.88,.29,.04,.44,.75,.93,.45,.39,.61,.11,.67,.42,.28,.47,.82,.06,.75,.69,.43,.23,.04,.58,.33,.45,.96,.32,.41,.22,.05,.32,.16,.91,.49,.81,.95,.65,.55,.38,.21,.47,.17,1,.31,.49,.22,.69,.42,.69,.56,.84,.34,.73,.82,.56,.13,.3,.84,.73,.89,.29,.44,.03,.24,.92,.21,.84,.06,.28,.38,.81,.42,.94,.48,.82,.27,.01,.44,.23,.94,.05,.56,.33,.62,.3,.05,.8,.98,.61,.51,.86,.14,.36,.62,.81,.94,.48,.08,.4,.22,.31,.95,.73,.35,.99,.06,.3,.87,.62,.37,.27,.92,.36,.12,.64,.02,.88,.47,.29,.13,.44,.36,.88,.49,.99,.6,.7,.12,.47,.8,.36,.95,.65,.28,.19,.02,.27,.86,.49,.27,.77,.92,.15,.63,.43,.29,.12,.84,.94,.48,.8,.86,.06,.77,.37,.58,.8,.98,.62,.75,.68,.27,.18,.35,.73,.14,.9,.8,.01,.35,.56,.89,.36,.08,.84,.3,.12,.21,.44,.16,0,.29,.47,.17,.71,.04,.27,.06,.94,.62,.83,.69,.53,.36,.15,.56,.77,.97,0,.25,.75,.09,.67,.76,.89,.09,.72,.59,.83,.69,.23,.84,.16,.72,.56,.33,0,.25,.91,.67,.47,.22,.74,.38,.59,.96,.7,.77,.55,.11,.62,.14,.82,.58,.27,.72,.15,.98,.58,.67,.52,.43,.99,.57,.76,.95,.03,.61,.78,.18,.58,.09,.23,.42,.36,.2,.55,.25,.6,.18,.13,.55,.84,.63,.7,.06,.18,.84,.35,.04,.7,.2,.88,.97,.36,.62,.08,.64,.19,.27,.1,.63,.89,.01,.71,.53,.47,.04,.4,.58,.78,.51,.08,.26,.68,.49,.6,.83,.7,.11,.67,.57,.97,.64,.76,.48,1,.6,.76,.66,.88,.99,.61,.4,.47,.69,.51,.17,.13,.32,.58,.78,1,.45,.33,.59,.88,.52,.31,1,.37,.14,.59,.96,.42,.32,.12,.99,.42,.54,.95,.49,.18,.83,.64,.73,.37,.09,.84,.03,.3,.16,.84,.34,.01,.84,.17,.44,.29,.54,.39,.66,.89,.43,.11,.83,.06,.78,.2,.88,.3,.15,.41,.33,.73,.51,.97,.67,.31,.92,.65,.75,.84,.98,.74,0,.9,.49,.77,.36,.89,.4,.52,.96,.75,.42,.58,1,.5,.33,.01,.67,.18,.53,.33,.7,.39,.55,.93,.22,.51,.15,.28,.35,.23,.89,.13,.96,0,.88,.44,.99,.33,.09,.95,.28,.21,.45,.78,.16,.33,0,.91,.36,.82,.08,.4,.53,.09,.35,.53,.78,.93,.34,.84,.76,.43,.87,.08,.27,.02,.66,.22,.69,.1,.16,.64,.55,.22,.47,.31,.51,.18,.78,.46,.09,.8,.03,.67,.26,.4,.88,.12,.45,.28,.58,.97,.48,.79,.65,.11,.5,.27,.47,.94,.67,.86,.94,.19,.06,.8,.2,.53,.33,.47,.41,.09,.71,.81,.23,.71,.1,.83,.25,.14,.37,.81,.03,.51,.11,.33,.06,.42,.82,.31,.69,1,.08,.25,.12,.81,.33,.09,.65,.24,.09,.75,.86,.58,.47,.78,.27,.89,.06,1,.47,.79,.68,.42,.86,.95,.06,.83,.77,.55,.31,.23,.67,.63,.8,.2,.73,.41,.65,.04,.98,.84,.27,.47,.53,.09,.24,.69,.31,.94,.2,.24,.85,.03,.16,.22,.1,.38,.01,.66,.95,.48,.73,.88,.4,.12,.89,.45,.8,.4,.85,.03,.89,.8,.66,.01,.88,.25,.58,.18,.36,.75,.91,.08,.52,.76,.97,.18,.75,.24,.42,.55,1,.22,.77,.63,.38,.05,.58,.23,.02,.75,.48,.35,.59,.93,.74,.24,.96,.62,.02,.52,.46,.88,.22,.56,.42,.05,.86,.58,.45,.18,.88,.27,.63,.58,.41,.09,.21,.44,.58,.73,.47,.2,.92,.56,.37,.91,.46,.17,.26,.38,.95,.09,.83,.42,.74,.15,.6,.31,.04,.33,.73,.56,.46,.66,.18,.44,.73,.48,.16,.38,.51,.03,.59,.13,.88,.52,.35,.14,.62,.95,.8,.73,.44,.57,.15,.76,.59,.73,.44,.78,.89,.66,.6,1,.27,.55,.22,.36,.16,.53,.63,.84,.35,.28,.95,.05,.7,.61,.13,.7,.25,.95,.55,.69,.92,.49,.86,.14,.31,.58,.22,.33,.04,.55,.68,.12,.88,.06,.35,.45,.93,.83,.15,.7,.32,.77,.42,.69,.98,.12,.86,0,.66,.16,.82,.44,.33,.93,.58,.05,.99,.64,.75,.93,.26,.71,.34,1,.69,.51,.92,.7,.16,.95,.64,.81,.02,.86,.68,.59,.28,.02,.84,.69,.31,.82,.63,.06,.69,.16,.56,.63,.36,.22,.87,.09,.97,.18,.62,.11,.32,1,.02,.64,.94,.84,.11,.91,.22,.84,.93,.45,.73,.31,.58,.71,.05,.38,.29,.19,.97,.87,0,.46,.93,.11,.39,.57,.28,.49,.73,.45,.8,.06,.72,.84,.78,.31,.92,.05,.57,.73,.53,.24,.33,.98,.49,.41,.34,.06,.44,.31,.71,.07,.64,.44,.81,.7,.95,.65,.42,.91,.81,.33,.62,.16,.72,.59,.28,.09,.51,.97,.88,.12,.53,.28,.61,.25,.4,.52,.3,.58,.89,.22,.76,.18,.38,.7,.29,.36,.47,.18,.55,.11,.22,.8,.39,.14,.05,.24,.86,.53,.33,.51,.27,.37,.11,.98,.4,.75,.14,.49,.02,.92,.54,.73,.31,.96,.45,.02,.84,.49,.67,.44,.53,.84,.89,.25,.52,.8,.39,.25,.06,.77,.29,.67,.61,.42,.34,.25,.8,.07,.18,.91,.49,.87,.67,.12,.62,.33,.52,.81,.32,.66,.19,.96,.06,.35,.08,.2,.9,.64,.48,.13,.05,.44,.22,.5,.18,.65,.13,.45,.78,.16,.25,.76,.92,.63,.84,.15,.38,.22,.98,.27,.53,.01,.16,.79,.62,.27,.06,.41,.53,.94,.26,.03,.87,.42,.24,.6,.35,.21,.83,.56,.04,.78,.7,.97,.07,.37,.11,.53,.65,.08,.85,.5,.12,.8,.01,.87,.41,.75,.63,.01,.56,.77,.36,.45,.8,.04,.69,.14,.95,.44,.83,.16,.53,.67,.24,.99,.61,.41,.23,.12,.38,.78,.21,.3,.92,.11,.8,.27,.72,.37,.45,.04,.73,.87,.16,.6,.51,.34,.56,.02,.76,.12,.69,0,.63,1,.42,.77,.24,.56,.02,.46,.84,.27,.69,.07,.23,.84,.48,.76,.68,.85,.94,.53,.16,.31,.38,.98,.6,.67,.76,.96,.08,.88,.38,.95,.67,.56,.87,.06,.2,.52,.11,.77,.47,.55,.69,.09,.91,.39,.48,.24,.13,.45,.91,.19,.84,.75,.48,.78,.55,.66,.75,.02,.44,.65,.96,.16,.91,.34,.45,.19,.84,.7,.78,.41,.28,.93,.42,.74,.24,.91,.6,.68,.31,.84,.95,.48,.29,.86,.94,.61,.29,.41,.72,.87,.2,.58,.77,.3,.05,.88,.44,.35,.19,.77,.96,.49,.91,.62,.53,.7,.38,.58,.31,.95,.06,.16,.65,.93,.21,.42,.67,.95,.21,.89,.46,.97,.27,.49,.95,.88,.17,.51,.36,.84,.16,.31,.7,.96,.2,.75,.42,.15,.98,.55,.01,.31,.22,.42,.6,.25,.76,.44,.89,.23,.55,.16,.33,.85,.28,.71,.59,.03,.3,.09,.63,.34,.58,.7,.23,.96,0,.33,.82,.18,.74,.31,.87,.98,.56,.77,.7,.58,.06,.3,.12,.98,.19,.13,.95,.31,.8,.09,.49,.39,.76,.08,.55,.28,.62,.46,1,.13,.84,.57,.03,.64,.34,.52,.09,.22,.46,.16,.07,.24,.66,.18,.12,.7,.21,.99,.07,.34,.62,.04,.73,.38,.94,.62,.81,.09,.69,.07,.66,.27,0,.83,.09,.99,.66,.05,.19,.75,.61,.5,.78,.31,.56,.08,.48,.33,.82,.12,.71,.16,.86,.2,.36,.55,.45,.28,.69,.09,.61,.94,.78,.37,.53,.05,.9,.57,.71,.36,.88,.63,.09,.48,.82,.02,.72,.67,.11,.74,.84,.4,0,.62,.47,.36,.2,.82,.49,.92,.41,.82,1,.45,.31,.88,.66,.14,.94,.45,.58,.64,.07,.69,.37,.02,.33,.96,.43,.67,.56,.35,.4,.84,.5,.56,.71,.9,.26,.67,.23,.64,.82,.93,.04,.23,.34,.07,.49,.31,.96,.17,.83,.39,.73,.99,.8,.36,.55,.92,.73,.44,.53,.02,.85,.56,.47,.79,.26,.97,.49,.22,.12,.57,.28,.38,.87,.53,.84,.44,.57,.35,.24,.14,.77,.47,.91,.41,.25,1,.35,.13,.73,.96,.61,0,.73,.24,.59,.42,.62,.75,.08,.82,.1,.74,.96,.01,.5,.42,.17,.09,.3,.63,.45,.81,.28,.11,.44,.77,1,.71,.36,.18,.96,.49,.03,.29,.93,.52,.7,.89,.13,.54,.99,.76,.13,.69,.25,.17,0,.77,.09,.59,.55,.42,.71,.24,.05,.93,.19,.44,.82,.14,.51,.23,.82,.16,.91,.61,.04,.7,.24,.05,.17,.34,.55,.03,.98,.5,.13,.39,.71,.57,.91,.64,.75,.21,.7,.11,.45,.92,.26,.04,.51,.63,.87,.02,.33,.8,.93,.39,.31,.65,.15,.43,.87,.11,.67,.35,.85,.72,.01,.95,.45,.31,.13,.19,.75,.68,.86,.44,.26,.58,.86,.09,.55,.83,.02,.88,.53,.38,.16,.9,.53,.37,.95,.09,.3,.55,.67,.33,.23,.86,.4,.62,.25,.85,.58,.66,.98,.86,.12,.19,.66,.94,.2,.53,.16,.06,.58,.87,.33,.54,.86,.36,.17,.11,.45,.23,.79,.07,.42,.27,.48,.36,.88,.55,.66,.4,.22,.84,.18,.29,.87,.5,.33,.78,.51,.27,.95,.62,.88,.09,.4,.77,.27,.47,.8,.91,.32,.64,.98,.41,.84,.78,.42,.31,.88,.1,.77,.43,.18,.85,.55,.39,.88,.78,.56,.15,.64,.3,.75,.18,.69,.42,.21,.6,.15,.74,.25,.89,.05,.71,.3,.56,.92,.44,.78,.2,.5,.69,.22,.64,1,.38,.93,.05,.53,.95,.35,.02,.69,.33,.15,.67,.45,.27,.81,.23,.84,.31,.66,.05,.83,.49,.89,.01,.44,1,.6,.48,.14,.91,.32,.74,.03,.45,.24,.72,.35,.41,.51,.04,.74,.33,.84,.27,.75,.44,.24,.16,.61,.76,.64,.99,.75,.31,.94,.65,.85,.05,.64,.96,.07,.32,.57,.92,.49,.92,.7,.05,.99,.11,.6,.88,.04,.72,.11,.47,.75,.64,.53,0,.71,.22,.08,.53,.43,.76,.5,.13,.61,.06,.18,.58,.67,.25,.53,.3,.81,.02,.11,.43,.29,.04,.34,.85,.6,.44,.91,.12,.27,.5,.99,.06,.69,.45,.52,.94,.61,.79,.39,.19,.01,.61,.07,.39,.96,.16,.76,.04,.6,.78,.28,.49,.11,.64,.21,.8,.5,.96,.39,.77,.62,.08,.42,.68,.11,.49,.42,.78,.19,.71,.23,.93,.8,.18,.7,.05,.55,.77,.2,.95,.36,.82,.49,.02,.94,.57,.88,.84,.59,.41,.93,.5,.63,.02,.8,.89,.39,.47,.28,.55,.03,.6,.38,.16,.54,.31,.72,.19,.79,.84,.27,.75,.06,.34,.81,.56,.37,.75,.19,.45,.39,.85,.59,.22,.36,.27,.94,.34,.97,.59,.86,.17,.97,.03,.22,.88,.29,.7,.95,.82,.34,.92,.06,.97,.49,.34,.93,.77,.64,.96,.51,.21,.82,.02,.99,.35,.56,.88,.76,.36,.27,.87,0,.35,.12,.22,.67,1,.81,.26,.65,.89,.29,.53,.36,.86,.45,.08,.22,.67,.83,.4,.73,.91,.23,.12,.58,.89,.2,1,.55,.76,.94,.59,.15,1,.63,.35,.57,.13,.28,.41,.87,.24,.35,.69,.07,.5,.11,.89,.6,.21,.7,.08,.3,.15,.26,.04,.67,.13,.39,.98,.7,.09,.67,.05,.89,.15,.84,.48,.71,.12,.77,.95,.57,.03,.44,.58,.12,.17,.43,.63,.11,.22,.66,.31,.94,.69,.24,.33,.95,.05,.78,.13,.85,.18,.49,.42,.3,.66,.37,.59,.78,.68,.36,.52,.24,.03,.45,.15,.59,.65,.21,.7,.59,.15,.23,.67,.08,.36,.7,.23,.47,.63,.73,.04,.17,.53,.64,.8,.19,.44,.83,.57,.46,.32,.5,.75,.11,.47,.8,.03,.7,.25,.91,.51,.73,.97,.33,.05,.56,.08,.42,.78,.27,.02,.49,.3,.14,.33,.03,.88,.25,.32,0,.45,.75,.64,.51,.09,.64,.96,.45,.84,.6,.42,.66,.16,.28,.78,.43,.84,.64,.47,.73,.96,.22,.83,.29,.17,.52,.34,.22,.96,.31,.78,.36,.22,.96,.28,.44,.22,.67,.4,.98,.48,.67,.86,.97,.51,.86,.95,.45,.55,.08,.79,.15,.55,.67,.5,.91,.59,.45,.66,.09,.81,.73,.13,.84,.27,.08,.46,.91,.12,.64,.55,.75,.83,.4,.87,.27,.08,.96,.33,.83,.43,.91,.78,.14,.52,.84,.09,.22,.43,.84,.97,.09,.31,.73,.99,.66,.03,.87,.08,.16,.95,.35,.22,.58,.78,.42,.19,.65,.33,.16,.42,.58,.18,.95,.35,.66,.62,.85,.36,.75,.92,.84,.64,.47,.38,.74,.55,.89,.81,.16,.98,.38,.78,.57,.11,.31,.19,.87,.25,.98,.73,.39,.55,.11,.99,.18,.38,.89,.53,.45,.76,.58,.87,.46,.78,.58,.73,.5,.42,.67,.08,.63,.87,.5,.09,.91,.14,.29,.21,.36,.77,.24,.3,.74,.15,.03,.83,.27,.63,.99,0,.41,.26,.73,.04,.25,.56,.9,0,.22,.55,.48,.94,.64,.33,.17,.83,.4,.99,.21,.33,.11,.73,.53,.43,.78,.48,.09,.55,.31,.59,.95,.31,.75,.4,.92,.67,.33,.24,.43,.61,.53,.15,.41,.28,.94,.71,.61,.38,.83,.7,.09,.98,.51,.11,.94,.8,.03,.87,.27,.75,.86,.48,.15,.99,.07,.44,.68,.11,.56,.22,.86,.18,.64,.8,.08,.39,.27,.05,.84,.23,.91,.73,.5,.01,.76,.33,.09,.46,.02,.91,.27,.49,.73,.01,.56,.09,.31,.7,.02,.24,.1,.93,.39,.01,.62,.11,.89,.55,.73,.02,.81,.35,.77,.62,.83,.73,.01,.55,.06,.38,.48,.67,.35,.89,.42,.49,.33,.77,.88,.18,.46,.98,.38,.76,.29,.63,1,.4,.76,.2,.01,.98,.58,.77,.05,.3,.68,.5,0,.94,.19,.65,.05,.88,.37,.73,0,.18,.47,.07,.65,.27,.86,.13,.51,.71,.87,.03,.92,.24,.77,.49,.34,.2,.78,.02,.49,.91,.16,.32,.75,.59,.28,.39,.55,.95,.65,.46,0,.7,.31,.23,.8,.2,.53,.25,.39,0,.51,.95,.11,.22,.5,.94,.62,.69,.47,.33,.16,.41,.96,.64,.54,.91,.59,.8,.69,.87,.62,.31,.67,.8,.28,.85,.15,.48,1,.6,.66,.29,.15,.86,.2,.99,.27,.33,.16,.4,.66,.19,.58,.07,.54,.94,.45,.63,.81,.59,.04,.25,.57,.76,.08,.18,.59,.8,.09,.29,.64,.81,.15,.53,.86,.45,.32,.05,.89,.66,.42,.72,.24,.48,.35,.88,.61,.81,.45,.58,.84,.36,.25,.63,.22,.99,.66,.84,.36,.91,.56,.15,.45,.59,.02,.79,.2,.47,.37,.82,.59,.06,.86,.44,.56,.31,.53,.25,.62,.44,.01,.82,.2,.69,.48,.09,.37,.21,.82,.42,.9,.58,.45,.93,.64,.87,.98,.75,.7,.29,.44,.58,.31,.72,.18,.55,.88,0,.61,.27,.82,.19,.38,.13,.27,.45,.19,.34,.15,.08,.4,.96,.23,.64,.91,.41,.2,.81,.42,.92,.75,.49,.35,.75,.52,.45,.89,.96,.29,.45,.94,.24,.33,.13,.27,.99,.19,.9,.79,.96,.22,.71,.86,.94,.24,.45,.69,.91,.58,.33,.07,.69,.18,.12,.71,.59,.14,.52,.3,.83,.15,.86,.62,.09,.16,.97,.23,.29,.91,.12,.78,.94,.44,.15,.53,.8,.24,.72,.05,.96,.81,.29,.37,1,.64,.27,.07,.69,.15,.97,.64,.11,.8,.98,.07,.88,.73,.37,.89,.55,1,.06,.77,.15,.88,.55,.07,.63,.11,.34,.75,.05,.33,.12,.46,.36,.05,.62,.82,.97,.03,.87,.11,.28,.42,.78,.93,.7,.06,.45,.67,.9,.63,.07,.97,.53,.77,.92,.48,.12,.36,.53,.8,.04,.7,.34,.06,.53,.23,.66,.59,.08,.82,.69,.05,.55,.09,.86,.69,.43,.78,.86,.7,.38,.14,.33,.63,.52,.4,.13,.31,.67,.04,.39,.52,.21,.02,.75,.92,.61,.42,.95,.8,.25,.86,.34,.94,.05,.45,.69,.22,.75,.44,.38,.71,.05,.66,.46,.53,.7,.03,.57,.29,.11,.61,.42,.52,.19,.69,.92,.07,.55,.85,.41,.95,.79,.45,.3,.4,.24,.69,.15,.42,.79,.2,.11,.67,.14,.28,.42,.61,.31,.69,.98,.3,.76,.94,.52,.85,.09,.59,.7,.19,.57,.91,.23,.15,.75,.37,.47,.79,.99,.62,.09,.5,.36,.56,.86,.01,.25,.75,.39,.81,.65,.22,.58,.87,.72,.02,.62,.44,.28,.92,.5,.12,.85,.33,.04,.94,.4,.14,.23,.6,.8,.24,.73,.02,.16,.6,.5,.04,.55,.72,.44,.07,.86,0,.6,.47,.54,.84,.95,.14,.86,.41,.48,.24,.29,.54,.01,.65,.48,.09,.74,.2,.61,.37,1,.31,.91,.55,.06,.86,.58,.4,.21,.09,.31,.82,.4,.87,.49,.93,.76,.33,.11,.44,.64,.22,.14,.73,.32,.12,.58,.5,.01,.86,.93,.51,.36,.6,.3,.56,.95,.34,.48,.85,.73,.92,.24,.81,.41,.57,.15,.22,.68,.27,.41,.78,.95,.29,.84,.68,.49,.41,.09,.65,.58,.24,.05,.38,.84,.23,.13,.97,.3,.77,.51,.96,.31,.1,.46,.03,.39,.29,.18,.82,.97,.3,.17,.67,.76,.6,.99,.44,.8,.26,.89,.31,.73,.38,.92,.34,.52,.39,.99,.3,.91,.23,.67,.94,.28,.17,.73,.36,1,.77,.27,.07,.75,.28,.61,.99,.8,.11,.84,.91,.36,.22,.98,.38,.68,.56,.78,.11,.53,0,.66,.25,.76,.17,.49,.99,.81,.89,.6,.25,.95,.75,.05,.17,.27,.84,.56,.88,.35,.84,.45,.52,.62,.2,.86,.27,.73,.59,.17,.75,.05,.92,.71,.09,.51,.75,.63,.09,.36,.02,.5,.13,.04,.49,.87,.38,.02,.99,.54,.23,.5,.39,.02,.13,.8,.27,.9,.51,.19,.85,.69,.54,.17,.76,.64,.43,.6,.18,.45,.13,.58,.91,.27,.8,.99,.67,.51,.72,.08,.88,.56,.08,.39,.28,.2,.7,.09,.56,.64,.51,1,.08,.48,.13,.63,.87,.54,.09,.8,.35,.1,.58,.81,.48,.92,.57,.22,.15,.9,.42,.48,.68,.09,.36,.17,.64,.58,.73,.16,.78,.55,.29,.03,.93,.27,.85,.72,.17,.81,.45,.92,.31,.64,0,.28,.72,.16,.53,.08,.36,.69,.59,1,.01,.49,.16,.76,.06,.27,.95,.02,.99,.68,.36,.11,.67,.08,.47,.81,.26,.44,.86,.02,.25,.91,.19,.56,.84,.65,.95,.73,.31,.8,.62,.45,.72,.16,.87,.09,.76,.61,.99,.34,.71,.95,.03,.73,.3,.42,.94,.58,.88,.33,.09,.94,.85,.34,.66,.87,.18,.72,.62,.16,.08,.42,.24,.34,.47,.69,.85,.96,.02,.5,.89,.36,.17,.75,.01,.82,.2,.67,.96,.04,.75,.27,.15,.63,.47,.89,.39,.23,.65,.35,.83,.04,.66,.79,.32,.18,.55,.77,.25,.53,.39,.05,.33,.45,.09,.62,.89,.48,.14,.44,.33,.95,.41,.6,.35,.11,.7,.22,.84,.38,.47,.44,.66,.82,.22,.45,.54,.38,.86,.69,.28,.95,.55,.68,.81,.39,.16,.77,.42,.91,.84,.42,.32,.64,.13,.19,.98,.61,.39,.8,.69,.3,.46,.26,.37,.6,.22,.95,.05,.31,.89,.59,.36,.66,.88,.43,.22,.56,.45,.17,.61,.34,.91,.12,.07,.24,.47,.8,.56,.05,.69,.23,.06,.53,.4,.48,.36,.84,.56,.91,.64,.97,.13,.2,.43,.24,.79,.62,.72,.4,.97,.47,.24,.58,.42,.3,.81,.22,.45,.69,.36,.84,.71,.15,1,.02,.52,.11,.29,.43,.49,.11,.61,.95,.86,.01,.92,.71,.88,.97,.27,.69,.93,.84,.17,.35,.78,.65,.05,.51,.14,.88,.04,.73,.96,.43,.58,.13,.96,.04,.86,.31,.94,.14,.77,.23,.09,.64,.2,.47,.37,.12,.6,.31,.49,.09,.56,.3,.22,.52,.97,.87,.56,.74,.38,.28,.12,.53,.98,.14,.75,.09,.87,.17,.55,.69,.12,.52,.8,.19,.05,.29,.51,.15,.73,.03,.86,.38,.11,.8,.47,.66,.77,.41,.01,.71,.18,.27,.49,.79,1,.75,.25,0,.95,.2,.76,.33,.03,.8,.59,.75,.55,.34,.89,.15,.55,.22,.07,.78,.33,.94,.72,.59,.35,.55,.85,.03,.98,.5,.05,.31,.6,.76,.18,.69,.88,.75,.97,.24,.71,.37,.14,.43,.32,.6,.12,.22,.75,.5,.02,.24,.44,.7,.56,.89,.21,.69,.76,.28,.62,.22,.53,.07,.82,.67,.25,.75,.59,.4,.49,.91,.72,.32,.42,.94,.8,.02,.91,.71,.2,.84,.91,.63,.03,1,.8,.06,.16,.72,.01,.48,.78,.66,.89,.43,.03,.36,.93,.67,.81,.01,.44,.92,.24,.65,.4,.47,.74,.96,.23,.8,.92,.32,.65,.25,.58,.97,.19,.28,.61,.86,.99,.36,.61,.94,.41,.58,.31,.15,.95,.68,.44,.09,.48,.72,.16,.4,.29,.91,.03,.67,.47,.07,.3,.91,.68,.6,.85,.12,.05,.77,.08,.93,.29,.13,.57,.2,.75,.26,.44,.85,.95,.41,.63,.15,.55,.84,.04,.46,.75,.53,.83,.05,.47,.56,.82,.36,.59,.75,.13,.95,.08,.28,.85,.55,.08,.99,.48,.88,.37,.75,.3,.91,.2,.36,.07,.64,.17,.01,.62,.85,.55,.15,.58,.34,.85,.44,.07,.55,.26,.73,.38,.6,.45,.67,.37,.27,.43,.1,.94,.19,.07,.73,.63,.21,.53,.58,.3,.48,.77,.37,.84,.15,.96,.08,.89,.69,.37,.57,.07,.48,.78,.88,.7,.43,.05,.94,.55,.14,.22,.5,.76,.11,.88,.04,.46,.64,.53,.82,.29,.61,.91,.24,.84,.52,.65,.11,.95,.19,.56,.99,.83,.42,.02,.52,.19,.39,.51,.84,.15,.47,.62,.8,.42,.89,.65,.95,.37,.08,.22,.48,.01,.27,.36,.19,.64,.28,1,.18,.24,.67,.96,.36,.06,.16,.97,.31,.52,.78,.38,.48,.16,.4,.83,.36,.19,.65,.12,.18,.45,.61,.5,.95,.82,.23,.78,.45,.27,.05,.96,.39,.69,.23,.53,.17,.77,.98,.36,.14,.84,.2,.12,.73,.58,.99,.81,.62,.32,.24,.56,.81,.27,.87,.41,.05,.92,.25,.62,.08,.76,.56,.33,.62,.42,0,.16,.63,.39,.97,.19,.16,.03,.53,.33,.74,.39,.69,.09,.84,.44,.17,.67,.73,.2,.36,.09,.89,.16,.69,.37,.06,.58,.97,.24,.36,.8,.4,.26,.77,.36,.16,.75,.31,.98,.65,.27,.97,.41,.68,.25,.73,.32,.12,.51,.02,.72,.58,.88,.82,.67,.93,.42,.91,.8,.11,.58,.89,.38,.76,.31,.71,.92,.64,.44,.84,.2,.62,.02,.99,.72,.64,.45,.03,.71,.8,.6,1,.02,.72,.09,.42,.71,.32,.98,.88,.37,.73,.18,.51,.77,.03,1,.62,.41,0,.67,.47,.94,.52,.32,.89,.48,.23,.14,.89,.52,.78,.39,1,.49,.12,.77,.18,.68,.13,1,.2,.52,.05,.27,.78,.22,.54,.82,.92,.11,.27,.53,.37,.77,.89,.24,.85,.03,.47,.31,.96,.57,.25,.34,.97,.85,.27,.76,.59,.03,.5,.99,.74,.44,0,.73,.47,.6,.71,.01,.49,.66,.59,.25,.88,.45,.1,.71,.21,.55,0,.9,.09,1,.48,.18,.82,.63,.29,.34,.11,.53,.75,.05,.7,.49,.33,.69,0,.84,.44,.09,.19,.5,.27,.04,.69,.15,.5,.66,.33,.24,.12,.91,.56,.26,.42,.91,.51,.3,.38,.89,.16,.54,.02,.41,.58,.66,.11,.81,.28,.88,.13,.66,.82,.29,.87,.57,.09,.77,.26,.03,.93,.09,.41,.66,.02,.47,.67,.05,.16,.31,.72,.96,.61,.36,.84,.55,.42,.67,.93,.89,.7,.13,1,.35,.47,.68,.75,.6,.94,.45,.63,.16,.58,.78,.9,.63,.73,.03,.81,.53,.59,.03,.49,.98,.41,.23,.8,.34,.16,.82,.2,.93,.3,.14,.86,.95,.21,.11,.94,.78,.06,.55,.81,.36,.9,.74,.37,.83,.28,.59,.69,.25,.92,.4,.17,.65,1,.18,.59,.29,.14,.58,.97,.27,.51,.15,.58,.95,.63,.41,.88,.77,.34,.92,.42,.81,.88,.59,.79,.31,.96,.15,.06,.35,.23,.86,.67,.78,.25,.63,.84,.11,.21,.51,.97,.59,.44,.2,.38,.48,.34,.13,.52,.2,.89,.39,.63,.7,.55,.18,.73,.86,.3,.96,.21,.89,.44,.64,.55,.02,.47,.25,.73,.05,.8,.35,.18,.47,.38,.51,.74,.27,.07,.86,.31,.02,.83,.09,.28,.98,.11,.41,.19,.26,.13,.39,.89,.22,.42,.12,.67,.32,.72,.11,.91,.64,.27,.38,.66,.51,.8,.05,.34,.45,.55,.85,.33,.4,.17,.7,.59,.13,.09,.63,.16,.51,.42,.03,.76,.39,.52,.05,.78,.45,.23,.39,.85,.47,.22,.87,.09,.36,.77,.71,.33,.01,.8,.55,.11,.58,1,.05,.27,.19,.09,.52,.05,.69,.47,.82,.71,.63,.75,.56,.04,.21,.99,.47,.31,.75,.8,.27,.33,0,.72,.91,.56,.93,.05,.74,.96,.3,.72,.07,.36,.97,.42,.8,.35,.59,.51,.13,.35,.6,.81,.08,.25,.83,.33,.9,.51,.29,.1,.88,.59,.03,.84,.07,.62,.42,.78,.15,.53,.24,.39,.67,.48,.71,.36,.67,.53,.87,.5,.67,.09,.62,.93,.8,.87,.2,.62,.47,.84,.53,.07,.59,.88,.12,.27,.58,.93,.67,.27,.03,.7,.48,.91,.28,.96,.42,.49,.31,.97,.78,.64,.22,.85,.12,.97,.71,.53,.87,.73,.04,.92,.67,.78,.42,.63,.2,.91,.44,1,.22,.76,.34,.25,.16,.45,.63,.55,.75,.36,.95,.42,.22,.36,.89,.52,.07,.95,.13,.47,.36,.58,.07,.9,.68,.05,.91,.42,.15,.64,.08,.78,.19,.69,.6,.4,.8,.53,.17,.83,.22,.05,.64,.27,.98,.07,.73,.78,.52,.93,.31,.75,.96,.17,.11,.64,.97,.4,.71,.25,.66,.31,.95,.22,.92,.55,.64,.98,.77,.9,.17,.03,.83,.24,.94,.02,.79,.34,1,.77,.29,.07,.36,.55,.09,.9,.36,0,.21,.79,.44,.94,.36,.72,.64,.41,.15,.78,.89,.57,.12,.63,.02,.23,.77,.88,.7,.25,.1,.94,.34,.56,.65,.31,.22,.08,.32,.63,.13,.55,.28,0,.95,.73,.51,.05,.27,.66,.47,.09,.94,.65,.73,.83,.31,.92,.69,.12,.84,.63,.73,.09,.25,.39,.2,.44,.3,.91,.82,.75,.16,.45,.37,.61,.53,.75,.87,.5,.33,.28,.42,.84,.23,.12,.03,.45,.93,.59,.5,.88,.11,.55,.16,.83,.41,.25,.16,.02,.38,.59,.49,.68,.42,.8,.56,.19,.77,.97,.53,.16,.77,.48,.02,.31,.38,.12,.44,.59,.34,.96,.58,.47,.74,.11,.6,.22,.45,.16,.58,.71,.25,.45,.77,.28,.56,.74,1,.69,.33,.03,.17,.47,.99,.2,.09,.51,.36,.22,.76,.86,.51,.37,.66,.2,.03,.45,.37,.68,.06,.89,.46,.4,.8,.93,.49,.69,.19,.8,.36,.49,.16,.34,.82,.61,.12,.86,.56,.38,.9,.49,.03,.38,.09,.2,.57,.47,.27,.15,.92,.57,1,.76,.6,.84,.7,.64,.08,.32,.55,.97,.22,.14,.28,1,.2,.67,.83,.98,0,.55,.48,.88,.64,.27,.76,.13,.32,.4,.71,.89,.47,.68,.57,.97,.66,.84,.71,.12,.22,.86,.01,.28,.33,.14,.49,.08,.44,.87,.36,.59,.82,.71,.95,.05,.25,.62,.12,.78,.22,.13,.42,.31,.71,.86,.04,.39,.9,.48,.97,.64,.05,.95,.18,.42,.28,.14,.86,.63,.76,.84,.01,.87,.76,.65,.97,.05,.44,.31,1,.1,.83,.56,.91,.59,.84,.55,.27,.16,.75,0,.58,.15,.37,.91,.42,.98,.65,.87,.58,.1,.42,.98,.35,.76,.18,.69,.14,.31,.6,.95,.78,.42,0,.99,.81,.3,.49,.04,.45,.15,.3,.02,.49,.23,.4,.69,.85,0,.67,.83,.48,.08,.39,.11,.45,.58,.15,.79,.34,.71,1,.38,.2,.67,.96,.78,.27,.2,.37,0,.29,.09,.34,.55,.45,1,.36,.6,.76,.92,.69,.88,.64,.37,.81,.21,.69,.11,.4,.18,.5,.67,.86,.74,.5,.36,.69,.87,.65,.98,.18,.52,.95,.66,.8,.2,.11,.83,.33,.69,.5,.86,.65,.55,.39,.23,.5,.27,.39,.55,.33,.25,.47,.82,.2,.61,.71,.16,.3,.73,.34,.14,.2,.76,.99,.62,.25,.95,.67,.27,.05,.78,.09,.3,.05,.24,.7,.92,.22,.69,.49,.03,.31,.8,.44,.85,.2,.71,.51,.87,.34,.67,.07,.4,.87,.71,.82,.67,.95,.55,.78,.12,1,.19,.49,.78,.28,.94,.73,.56,.8,.25,.36,.73,.66,.91,.29,.17,.04,.81,.58,.08,.46,.03,.55,.87,.75,.95,.8,.5,.86,.2,.04,.78,.31,.08,.51,.18,.44,.84,.03,.27,.67,.05,1,.26,.9,.86,.34,.22,.97,.42,.06,.92,.27,.02,.77,.49,.26,.57,.1,.3,0,.59,.27,.41,.54,.21,.82,.11,.02,.48,.78,.92,.07,.61,.7,.11,.92,.59,.15,.72,.9,.05,.58,.48,.42,.06,.97,.64,.44,.02,.37,.51,.83,.13,.54,.83,.22,.56,.63,.75,.46,.81,.55,.4,.13,.85,.25,.92,.62,.95,.08,.56,.36,.12,.25,.59,.17,.75,.53,.61,.12,.37,.29,.22,.07,.88,.35,.58,.89,.03,.56,.38,.11,.45,.33,.03,.64,.95,.84,.03,.21,.42,.06,.61,.52,.43,.87,.33,.89,.64,.14,.42,.09,.6,.2,.4,.74,.92,.28,.64,.83,.91,.39,.13,.59,.25,.53,.93,.79,.57,.45,.51,.65,.08,.61,.57,.16,.29,.82,.16,.55,.61,.35,.06,.84,.42,.69,.34,.76,.52,.85,.91,.02,.75,.38,.6,.31,.95,.11,.67,.35,.97,.45,.19,.85,.03,.38,.55,.28,.35,.94,.75,.89,.25,.49,.8,.31,.91,.71,.06,.42,.35,.74,.45,.86,.97,.52,.19,.14,.98,.31,.05,.77,.47,.57,.06,.41,.51,.25,.91,.64,.8,.08,.45,.94,.84,.24,.93,.2,.96,.52,.59,.41,.18,.46,.27,.75,.65,.31,.95,.62,.18,.75,.89,.48,.15,.53,.31,.95,.56,.76,.94,.7,.13,.23,.73,.53,.25,.97,.69,.31,.51,.65,.16,.05,.59,.53,.13,.22,.67,.56,.79,.99,.09,.75,.17,.39,.12,.33,.77,.03,.73,.4,.8,.01,.72,.47,.67,1,.45,.89,.16,.76,.92,.2,.82,.95,.45,.09,.67,.47,.97,.25,.89,.73,.19,.43,.74,.17,.86,.24,.73,.49,.77,1,.65,.08,.79,.23,.14,.62,0,.59,.73,.09,.23,.55,.87,.18,.59,.93,.13,.4,.33,.28,.69,.41,.84,.63,.25,.95,.67,.35,.75,.2,.67,.76,0,.48,.99,.73,.3,.14,.37,.05,.47,.78,.65,0,.76,.95,.72,.84,.09,.51,.43,.14,.87,.52,.81,.22,.31,.11,.42,.76,.63,.09,.49,.24,.35,.78,.29,.94,.04,.8,.38,.19,.75,.88,.11,.98,.78,.38,.69,.97,.43,.47,.03,.34,.27,.66,.44,.32,.48,.7,.89,.2,.96,.44,.23,.92,.44,.88,.64,.35,.24,.12,.7,.21,.53,.38,.03,.64,.47,.16,.25,.71,.31,.18,.59,.14,.45,.53,.84,.29,.57,.01,.52,.64,.09,.37,.28,.21,.88,.44,.51,.69,.38,.84,.95,.34,.16,.85,.64,.47,.76,.96,.3,.64,.02,.77,.07,.82,.95,.01,.57,.18,.73,.43,.09,.16,.99,.84,.12,.37,.32,.18,.41,.87,.52,.7,.64,.56,.27,.41,.1,.33,.85,.48,.04,.63,.2,.97,.8,.25,.7,.01,.47,.99,.68,.58,.89,.24,.39,.78,.87,.13,.4,0,.55,.64,.45,.11,.6,.48,.03,.54,.34,.44,.27,.87,.31,0,.82,.75,.94,.88,.2,.78,.02,.92,.85,.08,.59,.82,.1,.67,.29,.11,.51,.19,.09,.95,.78,.4,.07,.81,.95,.68,.31,.55,.07,.88,.37,.55,.09,.78,.85,.41,.07,.69,.05,1,.39,.79,.31,.81,.92,.69,.58,.12,.63,.16,.95,.05,.29,.47,.18,.53,.42,.98,.37,.13,.32,.07,.22,.49,.71,.17,.56,.65,.46,.35,.89,.08,.51,.87,.81,.54,.29,.47,.92,.59,.87,.67,.56,.04,.22,.94,.09,.82,.98,.72,.89,.58,.15,.26,.31,.55,.89,.35,.04,.59,.93,.38,.09,.56,.36,.02,.72,.96,.05,.69,.19,.98,.58,.82,.89,.2,.73,.31,.92,.85,.28,.95,.22,.81,.64,.09,.55,.18,.36,.26,.6,.13,.72,.47,.55,.63,.22,.28,.52,.35,.72,.53,.88,.59,.98,.69,.29,.55,.89,.52,.31,.61,.46,.25,.12,1,.75,.27,.67,.89,.99,.52,.3,.64,.93,.32,.2,.61,.89,.47,.23,.13,.42,.05,.86,.75,.41,.32,.72,.91,.59,.75,.11,.69,.78,.27,.02,.51,.73,.8,.57,.92,.45,.28,1,.11,.22,.78,.28,.67,.39,.24,0,.36,.65,.09,.53,.04,.8,.27,.17,.62,.34,.77,.42,.31,.15,.66,.2,.45,.98,.7,.39,.77,.13,.67,.47,.16,.33,.67,.28,.76,.84,.2,.48,.14,.56,.35,.51,.67,.29,.47,.09,.38,1,.56,.05,.64,.42,.7,.58,.05,.71,.5,.93,.77,.64,.11,.53,.4,.05,.95,.36,.14,.69,.99,.41,0,.47,.17,.79,.02,.35,.75,.44,.14,.02,.73,.2,.85,.09,.76,.91,.4,.49,.79,.02,.45,.34,.19,0,.72,.88,.48,.77,.26,.08,.71,.59,.99,.55,.27,.49,.94,0,.81,.27,.56,.16,.81,.24,.91,.08,.62,.84,.93,.68,.43,.06,.37,.84,.23,.87,.44,.73,.53,.16,1,.76,.6,.95,.71,.83,.24,.73,.33,.45,.92,.71,.82,.48,.1,.92,.55,0,.5,.34,.06,.78,.53,.03,.95,.43,.28,.95,.55,.78,.89,.61,.17,.43,.94,.33,.81,.22,.45,.91,.09,.74,.16,.69,.26,.83,.51,.15,.23,.78,.14,.36,.89,.16,.41,.22,.88,.44,1,.84,.67,.25,.85,.29,.79,.44,.16,.77,.86,.96,.27,.39,.83,.05,.25,.84,.5,.63,.98,.36,.64,.42,.58,.19,.68,.34,.22,.62,.16,.76,.68,.42,.25,.56,.13,.37,.53,.92,.05,.36,.84,.72,.17,.35,.56,.2,.64,.49,.08,.35,.99,.41,.47,.31,.67,.21,.33,.15,.27,.98,.12,.64,.03,.58,.37,.05,.91,.64,.44,.11,.33,.18,.48,.42,.15,.99,.17,.51,.09,.39,1,.27,.2,.73,.61,.27,.95,.84,.64,.28,.9,.66,.15,.84,.6,.73,.04,.22,.13,.5,.97,.08,.52,.67,.61,.86,.73,.03,.4,.84,.94,.63,.42,.05,.76,.3,.87,.53,.02,.47,.99,.3,.69,.03,.57,.29,.07,.33,.16,.5,.73,.07,.58,.89,.09,.64,.3,.58,.15,.67,.45,.56,.64,.94,.31,.7,.25,.13,.93,0,.29,.84,.04,.94,.11,.86,.56,.95,.09,.89,.8,.04,.97,.67,.82,.3,.42,.65,.23,.02,.8,.91,.7,.12,.76,.87,.42,.71,.64,.03,.57,.87,.44,.11,.56,.48,.85,.63,.75,.51,.8,.93,.7,.31,.83,.25,.06,.8,.55,.84,.04,.91,.56,.77,.67,.86,.22,.02,.56,.67,.06,.39,.84,.69,.12,.77,.41,.09,.21,.35,.49,.24,.09,.4,.86,.47,.33,.81,.6,.25,.79,.04,.37,.09,.98,.3,.57,.23,.33,.54,.14,.92,.63,.38,.96,.6,.74,.82,.25,.55,.8,.73,.13,.48,.69,.78,.91,.63,.44,.2,.93,.35,.7,.23,.52,.07,.75,.91,.33,.97,.09,.16,.78,.09,.4,.55,.8,.51,.73,.39,.62,.53,.79,.27,.38,.3,.61,.51,.35,.28,.58,.21,.07,.73,.19,.87,.5,.41,.63,.3,.45,1,.38,.05,.95,.2,.28,.84,.75,.15,1,.69,.78,.89,.04,.31,.38,.16,.29,.45,.13,.19,.48,.57,.39,.94,.65,.23,.69,.34,.27,.05,.45,.61,.31,.73,.89,.49,.79,.97,.45,.33,.2,.58,.47,.71,.82,.58,.98,.72,.34,.64,.96,.55,.7,.02,.39,.72,.2,.89,.29,.48,.17,.67,.79,.51,.01,.89,.8,.19,.69,.47,.09,.33,.22,.42,.64,.09,.34,.96,.38,.86,.22,.56,.01,.36,.83,.65,.03,.48,.37,.81,1,.41,.84,.2,.6,.27,.71,.38,.58,.84,.45,.89,.22,.33,.96,.1,.23,.45,.99,.7,.49,.06,.8,.16,.45,.72,.91,.4,.49,.96,.56,.11,.68,.94,.11,.58,.06,.23,.54,.3,.8,.45,.53,.1,.23,.36,.3,.01,.39,.22,.72,.47,.93,.7,.05,.55,.91,.66,.77,.85,.17,.31,.45,.75,.09,.6,.92,.4,.15,.95,.83,.44,.13,.35,.16,.22,.03,.53,.92,.04,.96,.31,.14,.41,0,.8,.46,.2,.11,.27,.92,.16,.32,.99,.45,.57,.72,.8,.6,.39,.11,.96,.64,.36,.3,.59,.25,.02,.85,.15,.69,.94,.04,.86,.19,.5,.66,.27,.97,.41,.11,.29,1,.15,.28,.56,.85,.19,.03,.58,.37,.11,.53,0,.87,.48,.23,1,.04,.71,.62,.13,.67,.91,.58,.31,.16,.01,.64,.91,.24,1,.2,.85,.11,.32,.78,.62,.28,.89,.33,.2,.48,.71,.88,.82,.67,.61,.14,.9,.68,.96,.72,.51,.81,.92,.64,.33,.07,.56,.2,.83,.63,.41,.24,.98,.1,.34,.71,.04,1,.36,.88,.44,.82,.69,.2,.55,.05,.67,.29,.65,.87,.58,.68,.85,.37,.65,.23,.87,.62,.69,.93,.14,.58,.89,.67,.42,.78,.61,.86,.65,.12,.34,.94,0,.22,.91,.47,.2,.08,.75,.43,.95,.53,.77,.9,.56,.49,.28,.77,.59,.43,.91,.1,.05,.62,.74,.88,.6,.51,.77,.69,.96,.11,.61,.73,.28,.69,.96,.79,.42,.81,.67,.12,.31,.53,.11,.26,.84,.47,.03,.79,.71,.88,.38,.2,.75,.42,.58,.68,.01,.56,.83,.14,.03,.37,.71,.06,.78,.98,.25,.36,.17,.41,.74,.02,.25,.34,.4,.63,.07,.6,.11,.53,.86,.78,.99,.14,.35,.75,.83,.33,.03,.52,.43,.89,.59,.08,.53,.26,.17,.02,.49,.91,.33,.18,.93,.46,.95,.07,.42,.76,.15,.27,.81,.44,.18,.53,.23,.37,.28,.52,.82,.04,.25,.52,.09,.47,.04,.24,.78,.42,.09,.88,.31,.71,.83,.62,.85,.16,.07,.35,.63,.42,.25,.97,.36,.67,.12,.23,.7,.33,.81,.53,.33,.2,.25,.05,.89,.41,.22,.46,.33,.92,.49,.23,.16,.63,.07,.34,.95,.59,.76,.36,.94,.78,.41,.55,.2,.28,.51,.11,.6,.83,.53,.07,.31,.77,.39,.65,.51,.25,1,.47,.82,.53,.41,.12,.54,.63,.05,.95,.49,.87,.56,.08,.87,.18,.31,.85,.47,.25,.17,.66,.44,.53,.88,.05,.15,.48,.68,.79,.27,.65,.22,.84,.77,.63,.97,.31,.58,.75,.41,.8,.56,.22,.75,.52,.3,.97,.1,.49,.73,.59,.03,.76,.95,.09,.67,.75,.4,.33,1,.73,.35,.79,.94,.55,.67,.17,.51,.63,.56,.06,.36,.28,.48,.69,.99,.83,.12,.19,.71,0,.1,.84,.54,1,.39,.76,.16,.47,.94,.67,.78,.48,.31,.07,.64,.77,.15,.87,.06,.76,.39,.92,.55,.24,.18,.04,.67,.5,.23,.7,.01,.34,.95,.81,.41,.93,.47,.27,.88,.14,.49,.96,.27,.2,.92,.75,.66,.11,.22,.58,.3,.87,.75,.45,.82,.28,.2,.36,.8,.64,.47,.77,.94,.2,.73,.97,.38,.01,.31,.22,.66,.27,.97,.6,.86,.18,.97,.11,.5,.33,.4,.13,.47,.67,.84,.09,.27,.66,.11,.38,0,.82,.2,.56,.4,.89,.05,.98,.32,.39,.82,.44,.2,.92,.09,.16,.58,.89,.2,.26,.4,.86,.32,.98,.83,.38,.78,.17,.99,.53,0,.24,.57,.31,.47,.88,.6,.8,.47,.2,.31,.8,.01,.58,.93,.29,.06,.11,.64,.39,.85,.58,.95,.35,.56,.66,.4,.58,.83,.3,.47,.75,.84,.42,.91,.83,.17,.57,.88,.64,.07,.72,.15,.65,.05,.34,.62,.73,.9,.09,.82,.45,.05,.58,.36,.87,.92,.67,.01,.67,.22,.09,.92,.58,.7,.11,.99,.16,.27,0,.66,.4,.05,.67,.56,.82,.75,.93,.5,.38,.77,.11,.28,.55,.37,.77,.67,.93,.03,.73,.9,.21,.38,.04,.98,.48,.86,.69,.91,.34,.65,.88,.6,.25,.69,.2,.55,.89,.62,0,.56,.85,.63,.49,.69,0,.56,.12,.71,.49,.08,.22,.72,.27,.12,.89,.43,.75,.91,.38,.79,.08,.67,.93,.33,.38,.95,.74,.61,.08,.49,.2,.65,.84,.42,.55,.99,.13,.72,.2,.01,.83,.24,.09,.99,.19,.03,.69,.09,.88,.58,.28,.07,.31,.45,1,.08,.5,.25,.56,.86,.23,.75,.99,.19,.41,.24,.67,.6,.13,.86,.41,.28,.06,.43,.17,.97,.37,.89,.33,.51,.01,.42,.76,.31,.5,.92,.55,.84,.35,.49,.11,.9,.47,.15,.09,.57,.2,.91,.42,.72,.05,.45,.06,.28,.85,.56,.35,.05,.55,.93,.44,.58,.16,.29,.53,.14,.23,.45,.05,.15,.35,.84,.47,.11,.28,.16,.73,.33,.41,.24,.8,.37,.97,.44,.63,.76,.05,.35,.59,.45,.03,.49,.67,.31,.11,.62,.16,.73,.52,.22,.06,.53,.16,.23,.67,.44,.95,.87,.37,.14,.72,.31,.78,.24,.88,.51,.28,.67,.46,.77,.31,.7,.5,.59,.95,.15,.36,.71,.48,.81,.13,.73,.2,.38,.78,.92,.43,.32,.51,.07,.8,.56,.01,.53,.36,.31,.97,.77,.19,.64,.8,.52,.73,.27,.47,.62,.8,.25,.67,.88,.19,.61,.73,.39,.24,.11,.61,.86,.2,.31,.25,.61,.82,.72,.01,.51,.25,.64,.85,.92,.62,.53,.15,.22,.67,.8,.28,.76,.7,.24,.77,.93,.44,.63,1,.78,.71,.95,.45,.77,.66,.95,.78,.69,.51,.99,.13,.91,.28,.07,.8,.33,.92,.18,.97,.81,.66,.94,.84,.58,.94,.2,.8,.47,.9,.34,.97,.84,.3,.69,.56,.86,.04,.36,.16,.26,.56,.98,.52,.19,.59,0,.34,.45,.95,.12,.57,.91,.16,.87,.35,.27,.78,.44,.22,0,.97,.6,.68,.53,.85,.29,.66,.12,.18,.97,.6,.48,.38,.29,.85,.95,.76,.47,.05,.68,.49,.93,.13,.57,.34,.84,.08,.55,.14,.41,.96,.34,.54,.1,.91,.03,.67,.95,.29,.79,.66,1,.54,.4,.95,.31,.66,.81,.98,.35,.08,.22,.79,.41,1,.44,.91,.49,.17,.11,.52,.87,.02,.37,.73,.06,.2,.51,.3,.11,.55,.02,.28,.4,.06,.34,.24,.82,.04,.58,.71,.53,.2,.11,.68,.38,.25,.53,.14,.31,.08,.4,.73,.06,.53,.27,.03,.4,.11,.61,.45,.99,.76,.11,.48,.83,.77,.69,.07,.8,.05,.94,.47,.81,.7,.09,.63,.85,.37,.05,.62,.41,.8,.05,.91,.52,.63,.83,.17,.34,.25,.95,.04,.59,.81,.47,.01,.67,.83,.14,.92,.72,.63,.1,.16,.83,.2,.55,.36,.02,.87,.23,.97,.03,.69,.92,.73,.06,.82,.14,.27,.83,.44,.32,.8,.16,.48,.41,.02,.8,.07,.73,.13,.44,.61,.09,.16,.7,.5,.31,.66,.02,.76,.29,.09,.62,.95,.41,.31,.64,.09,.48,.28,.84,.6,.38,.88,.63,.23,.97,.59,.18,.87,.56,.43,.62,.78,.47,.15,.88,.43,.84,.57,.49,.08,.88,.42,.76,.28,.17,.65,.37,1,.84,.69,.56,.77,.17,.36,0,.25,.41,.92,.55,.31,.47,.61,.38,.35,.64,.27,.89,.55,.22,.78,.34,.49,.73,.22,.47,.12,.57,.65,.32,.75,.93,.41,.06,.87,.41,.15,.34,.9,.53,.35,.75,.28,.2,.44,.07,.26,.42,.58,.91,.65,.29,.83,.3,.7,.42,.64,.2,.38,.31,.22,.51,.63,.7,.59,.97,.19,.63,.51,.91,.08,.56,.23,.35,.62,.18,.29,.9,.36,.49,.27,.78,.42,.96,.55,.15,.87,.69,.36,0,.85,.67,.25,.99,.58,.84,.68,.17,.91,.09,.8,.35,.73,.13,.85,.53,.71,.98,.09,.19,.37,.97,.31,.61,.75,0,.28,.95,.73,.59,.2,.52,.81,.95,.78,.42,.13,.6,.09,.22,.95,.51,.69,.89,.8,.16,.66,.22,.01,.91,.16,.85,.22,.74,.1,.16,.39,.95,.02,.27,.18,1,.85,.69,.97,.18,.4,.04,.13,.25,.53,.73,.66,.78,.48,.2,.71,.26,.99,.1,.58,.89,.66,.97,.51,.78,.34,.03,.43,.11,.96,.61,.17,.47,.81,.51,.89,.66,.44,1,.19,.3,.38,.47,.06,.78,.25,.38,.75,.64,.95,.88,.49,.85,.56,.78,.02,.86,.94,.57,.12,.85,.2,.47,.28,.58,.78,.2,.47,.58,.13,.75,.18,.39,.96,.34,.5,.44,.04,.53,.9,.47,.38,.24,0,.77,.29,.85,.67,.03,.25,.12,.97,.45,.69,.16,.35,.04,.99,.7,.1,.56,0,.25,.51,.76,.33,.88,.64,.28,.08,.6,.47,.33,.64,.99,.38,.69,.25,.94,.45,.58,.85,.49,.66,.6,.75,.89,.55,.64,.03,.31,.33,.88,.71,.49,.96,.61,.45,.08,.31,.58,.1,.91,.62,.05,.84,.42,.52,.34,.02,.73,.16,.88,.29,.99,.75,.51,.77,.39,.06,.91,.1,.59,.05,.77,.11,.56,.87,.01,.92,.75,.14,.87,.56,.01,.84,.31,.16,.42,.69,.05,.96,.24,.67,.41,.18,.64,.05,.73,.34,.64,.93,.09,.51,.98,.29,.8,.06,.89,.45,.01,.55,.12,.75,.7,.27,.18,.69,.05,.62,.81,.34,.47,.16,.5,.93,.55,.8,.65,.36,.51,.24,.79,.84,.65,.46,.25,.35,.46,.89,.71,.92,.2,.45,.39,.04,.82,.91,.22,.53,.85,.07,.73,.09,.58,.51,.73,.02,.37,.99,.3,.06,.35,.45,.14,.43,.36,.1,.53,.62,.78,.23,.85,.16,.69,.89,.21,1,.83,.38,.75,.45,.31,.18,.64,.8,.16,.54,.39,.6,.09,.49,.64,.14,.2,.86,.55,.25,.76,.28,.36,.16,.91,.26,.35,.78,.69,.23,.6,.32,.66,.42,1,.22,.47,.78,.1,.25,.33,.42,.16,.75,.53,.33,.99,.25,.39,.91,.01,.8,.41,.19,.88,.33,.71,.41,.54,.27,.73,.64,.25,.94,.62,.84,.99,.4,.29,.12,.96,.64,.92,.59,.73,.09,.42,.2,.91,.06,.86,.11,.4,.53,.32,.12,.91,.72,.62,.13,.33,.65,.03,.97,.72,.53,.16,.35,.72,.12,.95,.29,.48,.88,.81,.19,.32,.63,.07,.69,.2,.81,.87,.23,.72,.8,.91,.76,.45,.16,.06,.43,.58,.3,.38,.79,.02,.34,.69,.23,0,.96,.56,.73,.87,.09,.95,.3,.85,.94,.24,.7,.83,.35,.59,.08,.32,.69,.98,.66,.83,.45,.69,.6,.42,.51,.07,.47,.54,.95,.08,.28,.7,.08,.58,.54,.95,.71,.81,.62,.89,.28,.8,.01,.45,.83,.52,.6,.7,.31,.45,.75,.64,.03,.13,.61,.92,.34,.87,.8,.08,.41,.15,.35,.55,.78,.89,.73,.53,.21,.09,.37,.25,.31,.84,.48,.71,.29,.56,.96,.62,.03,.93,.78,.37,.06,.86,.21,.42,.84,.57,.27,.12,.9,.62,.44,.78,.02,.4,.59,.23,.43,.34,.09,.95,.81,.53,.91,.42,.61,.52,.95,.08,.31,.58,.2,.92,.85,.64,1,0,.75,.11,.51,.63,.48,.16,.9,.52,.13,.37,.25,.47,.23,.63,.7,.45,.11,.56,.39,.01,.25,.95,.42,.9,.49,.01,.4,.22,.54,.95,.02,.21,.97,.14,.82,.36,.18,.83,.49,.91,.75,.34,.87,.19,.01,.59,.49,.1,.96,.62,.12,.7,.77,.1,.2,.14,.99,.08,.23,.56,.48,.95,.22,.65,.09,.18,.49,.29,.89,.53,.01,.22,.09,.49,.17,.27,.42,.88,.8,.66,.98,.02,.6,.14,.43,.75,.2,.27,.49,.71,.2,.52,.27,.8,.55,.97,.08,.38,.78,.69,.47,.25,.99,.31,.67,.9,.78,.16,.94,.64,.77,.26,.45,.11,.25,.77,0,.16,.38,.64,.02,.5,.24,.68,.27,.35,.5,.22,.86,.93,.25,.74,.96,.31,.6,.78,.64,.84,.93,.04,.41,.76,.08,.26,.78,.17,.93,.88,.5,.73,.79,.18,.64,.14,.56,.89,.11,.31,.73,.86,.64,.28,.9,.76,0,.62,.37,.16,.25,.44,.65,.41,.28,.94,.2,.38,.47,.24,.91,.42,.27,.95,.37,.48,.57,.83,.91,.37,.8,.42,.84,.31,.55,1,.67,.44,.59,.96,.72,.63,.34,.94,.67,.56,.75,.01,.49,.14,.45,.77,.27,.95,.05,.82,.67,.36,.84,.09,.59,.98,.65,.44,.16,.7,.49,.62,.16,.33,.02,.84,.09,.55,.19,.51,.06,.69,.53,.01,.4,.58,.69,.85,.33,.48,.98,.29,.72,.83,.34,.96,.73,.4,.09,.55,.84,.67,.45,.58,.4,.19,.05,.86,.42,.21,.08,.31,.7,.58,.99,.53,.87,.36,.49,.73,.33,.64,.12,.22,.04,.38,.28,.85,.76,.45,.25,.67,.17,.47,.35,.71,.59,.44,.25,.72,.97,.58,.02,.81,.13,.91,.73,.42,.84,.05,.71,.86,.2,.55,.06,.62,.87,.78,.67,.32,.02,.7,.27,.16,.05,.75,.4,.07,.82,.2,.1,.28,.78,.44,.89,.05,.38,.1,.97,.34,.62,.92,.18,.36,.88,.66,.39,.49,.12,.91,.42,.78,.25,.31,.02,.9,.09,.28,.78,.24,.97,.87,.52,.39,.66,.79,.45,.95,.31,.24,.61,.84,.09,.89,.17,.37,.74,.09,.67,.44,.85,.55,.48,.14,.8,.62,.04,.94,.18,.29,.08,.15,.66,.83,.53,.12,.69,.45,.9,.15,.5,.12,.33,.19,.67,.01,.97,.63,.08,.44,.55,.84,.67,.99,.53,.71,.33,.04,.99,.8,.4,.54,.04,.23,.09,.94,.12,.33,.45,.86,.69,.53,.33,.04,.61,.15,.53,.78,.02,.38,.64,1,.35,.71,.05,.26,.11,.42,.19,.64,.98,.55,.69,.9,.51,.25,.63,.75,.91,.36,.16,.85,.26,.6,.8,.45,.86,.22,.71,.3,.56,.73,.13,.53,.2,.33,1,.03,.62,.16,.89,.47,.76,.62,.35,.93,.45,.04,.59,.44,.74,.18,.92,.27,.13,.85,.37,.75,.97,.3,.21,.52,1,.05,.59,.91,.54,.12,.27,.2,.08,.89,.31,.44,.91,.77,.38,.72,.89,.97,.33,.77,.36,.27,.78,.98,.56,.37,.75,.81,.24,.84,.44,.56,.2,.83,.25,.39,.95,.31,.6,.42,.07,.94,.2,.65,.49,.61,.12,.86,.75,.98,.46,.66,.53,.81,.22,.09,.28,.95,.77,.56,.99,.26,.65,.33,.57,.29,.12,.79,.51,.16,.45,.89,.95,.58,.5,.88,.11,.33,.45,.21,.95,.13,.34,.55,.01,.49,.66,.08,.53,.2,.72,.31,.16,.54,.08,.82,.05,.47,.94,.25,.69,.8,.58,.24,.71,.37,.55,.12,.82,.22,.56,.84,.67,.15,.89,.29,.07,.71,.35,.01,.71,.58,.05,.48,.12,.43,.71,.35,.78,.45,.28,.18,.83,.34,.95,.78,.58,.67,.17,.52,.25,.13,.58,.46,.24,.53,.02,.46,.93,.62,.15,.34,.04,.86,.42,.64,.04,.72,.92,.12,.3,.72,.89,.05,.75,.19,.1,.8,.25,.47,.13,.88,.36,.24,.95,.31,.42,.78,.18,.38,.84,.05,.62,.75,.38,.17,.47,.22,.34,.81,.11,.95,.89,.45,.75,.04,.9,.58,.65,.2,.36,.73,.07,.77,.4,.8,.59,.01,.66,.83,.44,.96,.71,.33,.58,.99,.75,.43,.93,.01,.67,.88,.42,.98,.42,.63,.83,0,.44,.87,.07,.46,.93,.66,.29,.96,.4,.51,.02,.28,.39,.72,.51,.22,.8,.55,.98,.48,.6,.89,.19,.67,.9,.79,.6,.06,.65,.23,.94,.7,.42,.62,.02,.72,.39,1,.05,.87,.7,.35,.82,.06,.63,.82,.69,.2,.87,.07,.52,.73,.22,.61,.11,.96,.27,.55,.37,.8,.47,.52,.15,.6,.82,.48,.37,.91,.61,.68,.55,.78,.03,.7,.17,.64,.08,.61,.25,.9,.51,.3,1,.43,.58,.84,.66,.08,.45,.85,.5,.19,.43,.61,.83,.23,.31,.42,.1,.82,.52,.85,.3,.23,.64,.17,.89,.28,.71,.37,.05,.2,.82,.88,.23,.05,.33,.13,.49,.78,.36,.58,.21,.76,.25,.13,.35,.6,.75,.15,.63,.31,.19,.77,.03,.85,.14,.71,.78,.17,.99,.32,.64,.92,.47,.15,.83,.22,.41,.29,.8,.53,.04,.27,.15,.87,.53,.83,.12,.47,.06,.91,.5,.27,.47,.35,.22,.59,.48,.96,.19,.92,.44,.35,.11,.58,.25,.44,.67,.84,.29,.91,.2,.34,.49,.76,.08,.23,.99,.05,.69,.43,.28,.89,.21,.73,0,.32,.4,.96,.3,.46,.84,.53,.92,.34,.05,.71,.15,.67,.24,.89,.02,.13,.78,.91,.63,0,.29,.74,.06,.15,.36,.53,.67,.96,.76,.28,.04,.15,.45,.96,.5,.93,.11,.41,.79,.5,.59,.29,.12,.41,.48,.64,.9,.84,.61,.27,.95,.12,.31,.67,.53,.91,.18,.97,.29,.39,.94,.81,.07,.45,.58,.24,.63,.31,.91,.47,.55,.09,.01,.37,.65,.31,.05,.75,.07,.95,.16,.35,.42,.98,.74,.31,.41,.02,.77,.57,.31,.77,.15,.86,.09,.75,.82,.41,.01,.67,.11,.27,.73,.16,.78,.91,.39,.75,.97,.01,.36,.78,.53,.69,.83,.15,.65,.61,.39,.85,.32,.95,.03,.65,.55,.44,.86,.18,.84,.08,.58,.76,.38,.13,.69,.43,.81,.56,.41,.09,.49,.82,.56,.31,.27,.4,.72,.35,.56,.91,.23,.69,.98,.11,.86,.16,.5,.69,.63,.89,.58,.67,.01,.35,.53,.23,.97,.16,.91,.76,.65,.95,.16,.8,.28,.55,.18,.05,.69,.47,.84,.02,.73,.37,.8,.64,.51,.11,.69,.53,.89,.35,.5,.74,.95,.37,.06,.67,.86,.75,.81,.23,.97,.58,.89,.53,.69,.47,.65,.84,.59,.5,.66,.19,.47,.91,.27,.68,.98,.22,.38,.64,.93,.53,.92,.14,.72,.38,.85,.55,.9,.48,.65,.31,.55,.16,.11,.58,.48,.66,.14,.97,.03,.43,.95,.29,.74,.19,.78,.56,.4,.15,.79,.09,1,.24,.66,.52,.2,.94,.02,.25,.84,.5,.2,.97,.86,.76,.35,.19,.64,.97,.52,.08,.99,.22,.8,.66,.36,.5,.78,.45,.61,0,.37,.22,1,.4,.34,.13,.75,.83,.62,.67,.05,.47,.2,.55,.31,.5,0,.7,.37,.07,.46,.91,.38,.8,.16,.95,.58,.1,.44,.06,.89,.22,.37,.25,.72,.15,.87,.01,.41,.54,.15,.28,.22,.42,.53,.12,.71,.19,.44,.35,.13,.89,.27,.05,.22,.11,.82,.05,.96,.6,.37,.11,.44,.81,.6,.3,.05,.2,.62,.27,.78,.31,.46,.6,.24,.01,1,.05,.84,.34,.8,.26,.92,.06,.41,.24,.33,.56,.9,0,.52,.11,.48,.24,.71,.92,.29,.48,.59,.35,.74,.44,.88,.31,.68,.55,.98,.09,.3,.63,0,.25,.94,.71,.04,.44,.75,.6,.16,.45,.12,.86,.56,.03,.19,.27,.34,.89,.56,.84,.08,.78,.2,.86,.27,.45,.16,.88,.3,.84,.69,.39,.08,.84,.56,.22,.98,.74,.85,.65,.25,.55,.34,.27,.44,.23,.7,.31,.77,.56,.84,.03,.62,.3,.99,.2,.69,.82,.93,.46,.62,.98,.3,.89,.46,.05,.64,.99,.21,.78,.58,.93,.76,.89,.34,.54,.69,.24,.87,.17,.54,0,.88,.73,.51,.42,.37,.07,.52,.98,.15,.09,.77,.37,.42,.2,.72,.48,.63,.86,.18,.7,.83,.62,.75,.22,.8,.35,.64,.84,.98,.06,.62,.83,.4,.2,.69,.05,.82,.11,.15,.61,.8,.29,.74,.38,.15,.68,.53,.44,.61,.15,.88,.35,.22,.83,.67,.89,.52,.31,.95,.88,.73,.93,.64,.73,.19,.43,.53,.03,.66,.59,.98,.04,.75,.51,.36,.01,.81,.99,.26,.77,.93,.42,.11,.52,.33,.12,1,.05,.62,.74,.92,.84,.6,1,.15,.45,.75,.96,.44,.51,.66,.1,.25,.59,.16,.8,.71,.04,.17,.58,.76,.85,.29,.73,.51,.01,.31,.4,.52,.43,.29,.79,.14,.43,.75,.64,.96,.47,.24,.14,.98,.81,.87,.69,.91,.22,.82,.72,.93,.53,.82,.6,.1,.95,.04,.44,.3,.58,.36,.91,.06,.5,.7,.12,.41,.27,.67,.33,.17,.53,.02,.88,.94,.55,.29,.97,.5,.39,.05,.46,.05,.64,.78,.92,.23,.06,.83,.31,.55,.11,.91,.29,.01,.35,.73,.08,.66,.15,.55,.4,.05,.13,.96,.29,.72,.92,.47,.31,.53,.4,.13,.96,.61,.58,.44,.16,.12,.62,.36,.18,.67,.8,.28,.6,.42,.69,.83,.13,.51,.05,.27,.4,.02,.64,.28,.11,.18,.81,.76,.33,.47,.73,.39,.09,.33,.84,.39,.67,.24,.36,.07,.4,.81,.63,.18,.72,.07,.17,.64,.99,.01,.51,.31,.08,.74,.34,.42,.69,.08,.31,.59,0,.45,.58,.4,.04,.33,.67,.16,.92,.41,.23,.53,.75,.98,.01,.51,.16,.94,.27,.58,1,.17,.53,.8,.89,.42,.75,.23,.65,.13,.45,.23,.64,.91,.73,.19,.95,.88,.5,.35,.89,.41,.74,.38,.96,.68,.78,.48,.39,.55,.94,.22,.42,.27,.84,.36,.24,.51,.66,.85,.57,.36,.16,.89,.07,.24,.81,.73,.28,.09,.23,.91,.52,.72,.47,.29,.9,.56,.03,.95,.2,.87,.08,.33,.37,.18,.66,.83,.53,.92,.88,.33,.58,.92,.05,.36,.91,.83,.02,.97,.24,.52,.59,.94,.02,.45,.98,.6,.16,.93,.45,.85,.98,.67,.82,.25,.6,.37,.84,.94,.26,.61,.2,.91,.76,.55,.22,.75,.28,.13,.33,.65,.26,.49,.14,.27,.77,.73,.33,.67,.15,.8,.23,.66,.4,.76,.45,.03,.85,.72,.09,.38,.03,.58,.99,.31,.81,.37,.77,.71,0,.36,.25,.82,.59,.22,.14,.56,.03,.19,.67,.13,.47,.2,.04,.65,.71,.14,.81,.61,.48,.76,.08,.61,.99,.76,.47,.22,.01,.62,.25,.69,.77,.61,.93,.45,.53,.85,.76,.33,.67,.95,.02,.82,.08,.48,.37,.72,.45,.78,.53,.95,.47,.89,.76,.31,.11,.7,.5,.22,.67,.47,.55,.23,.62,.15,.52,.64,.89,.75,.13,.28,.8,.17,.71,.87,.55,.24,.08,.36,.26,.55,.03,.47,.91,.72,.19,.56,.05,.83,.52,.11,.86,.16,.39,1,.81,.68,.87,.95,.75,.84,.98,.45,0,.57,.09,.85,.36,.45,.58,.87,.09,.66,.22,.36,.64,.31,.51,.96,.22,.7,.11,.49,.59,.07,.53,.16,.86,.56,.11,.69,.34,.43,.7,.28,.99,.6,.83,.25,.58,.93,.33,.18,.99,.27,.04,.86,.18,.32,.57,.03,.88,.3,.09,.41,.89,.8,.46,.41,.12,.34,.19,0,.67,.14,.42,.05,.22,.37,.6,.25,.69,1,.22,.65,.05,.34,.14,.65,.22,.01,.58,.44,.25,.15,.8,.08,.84,.29,.73,.09,.44,.96,.21,.33,.42,.17,.48,.93,.63,.33,.52,.11,.29,.67,.73,.6,.14,.87,.41,.76,.31,.11,.45,.71,.4,.99,.44,.3,.6,.47,.64,.44,.1,.51,.18,.02,.44,.09,.62,.35,.88,.49,.94,.2,.96,.07,.73,.26,.33,.97,.83,.58,.9,.24,.75,.61,.8,.29,.41,.91,.19,.87,1,.41,.3,.94,.45,.49,.97,0,.78,.85,.36,.1,.49,.9,.02,.74,.55,.81,.47,.37,.69,.52,.98,.71,.93,.45,.18,.69,.6,.95,.75,.09,.52,1,.84,.66,.5,.89,.38,.8,.5,1,.8,.13,.44,.86,.77,.12,.42,.85,.91,.26,.56,.85,.71,.29,.94,.55,.96,.36,.6,.4,1,.14,.91,.8,.29,.69,.56,.05,.81,.67,.06,.56,.42,.07,.84,.77,.37,.47,.9,.79,.32,.51,.94,.2,.06,.62,.89,.25,.78,.14,.73,0,.68,.95,.05,.24,.92,.35,.62,.37,.55,.22,.7,.19,.65,.25,.6,.43,.29,.63,.12,.91,.54,.18,0,.49,.14,.06,.46,.35,.16,.65,.85,0,.67,.35,.25,.58,.66,.05,.88,.17,.75,.08,.64,.45,.54,.76,.31,.71,.42,.37,.88,.08,.62,.91,.3,.1,.41,.64,.12,.25,.55,.84,.16,.34,.54,.19,.29,.02,.56,.25,.96,.06,.3,.62,.25,.69,.58,.93,.53,.18,.33,.53,.58,.16,.78,.38,.98,.08,.42,.79,.16,.04,.85,.73,.28,.52,0,.64,.39,.51,.05,.77,.88,.47,1,.36,.79,.22,.71,.96,.25,.16,1,.01,.19,.45,.04,.71,.65,.34,.58,.97,.51,.33,.07,.59,.36,.89,.2,.34,.77,.58,.83,.48,.75,.88,.28,.79,.94,.42,.05,.8,.16,.72,.55,.78,.48,.82,.44,.62,.75,.4,.8,1,.7,.04,.93,.49,.56,.24,.44,.75,.12,.8,.09,.76,.24,.61,.33,.91,.25,.21,.15,.92,.06,.22,.17,.64,.28,.13,.22,.73,.55,.85,.22,.47,.88,.39,.77,.48,.05,.42,.64,.85,.73,.92,.17,.39,.75,.58,.8,.94,.1,.35,.04,.3,.64,.73,.01,.92,.28,.08,.48,.7,.03,.61,.52,.35,.69,.65,.45,.07,.89,.66,.77,.25,.55,.18,.94,.35,.14,.27,.11,.63,.29,.92,.03,.61,.45,.69,.59,.81,.29,.63,.98,.16,.25,.84,.78,.12,.42,.83,.65,.95,.27,.45,.8,.53,.14,.7,.02,.22,.14,.98,.7,.06,.53,.34,.75,1,.09,.34,.88,.02,.24,.37,.05,.29,.95,.25,.67,.41,.53,.21,.84,.37,.09,.78,.63,.93,.52,.91,.47,.34,.55,.82,.38,.48,.59,.96,.4,.68,.61,.84,.99,.78,.53,.68,.93,.4,.16,.04,.78,.53,.72,.01,.98,.27,.92,.79,.23,.05,.6,.32,.78,.64,.08,.45,.2,.16,.53,.77,.45,.83,.09,.39,.69,.45,.83,.64,.72,.24,.31,.89,.23,.11,1,.22,.34,.56,.12,.18,.36,.95,.11,.83,.62,.41,.56,.67,.85,.4,.15,.48,.86,.35,.21,.49,.12,.36,.73,.52,.84,.07,.53,.45,0,.28,.73,.19,.48,.11,.56,.85,.07,.41,.28,.97,.36,.65,.43,.1,.58,.47,.16,.91,.58,.44,.52,.84,.4,.17,.99,.67,.87,.72,.56,.09,.18,.88,.31,.75,.27,.63,1,.33,.15,.05,.28,.39,.19,.64,.99,.14,.05,.87,.71,.02,.82,.28,.37,.55,.44,.07,.34,.83,.02,.49,.97,.64,.27,.19,.33,.11,.62,.68,.12,.58,.98,.44,.38,.12,.47,.87,.25,.51,.85,.67,.42,.9,.23,.98,.61,.25,.89,.2,.97,.36,.13,.54,.95,.43,.77,.84,.51,.37,.94,.82,.45,.86,.5,.69,.31,.47,.02,.73,.95,.2,.51,.78,.7,.56,.09,.66,.78,.95,.88,.07,.92,.22,.41,.33,.76,.9,.38,.98,.63,.05,.93,.3,.76,.16,.61,.67,.89,.46,.56,.85,.78,.23,.35,.87,.64,.25,.11,.2,.69,.25,.64,.74,.59,.5,.15,.22,.46,.91,.35,.6,.06,.81,.47,.05,.72,.42,.89,.56,.67,.84,.01,.73,.27,.44,.65,.17,.33,.78,.1,.52,.73,.03,.2,.94,.42,.59,.26,.66,.76,.38,.91,.95,.6,.84,.22,.41,.36,.52,.17,.76,.88,.53,.23,.97,.03,.71,.36,.95,.02,.32,.72,.15,.49,.76,.11,.56,.03,.44,.78,.86,.18,.66,.06,.27,.59,.01,.75,.16,.28,.94,.04,.6,.77,.9,.23,.83,.3,.09,.89,0,.24,.97,.82,.27,.03,.42,.3,.64,.45,.13,.69,.97,.6,.19,.66,.22,.52,.87,.42,.69,.39,.99,.3,.06,.75,.18,.1,.3,.49,.95,.71,.02,.81,.4,.73,.86,.05,.95,.11,.42,.29,.08,.93,.41,.83,0,.76,.52,.98,.13,.58,.89,.19,.53,.82,.33,.22,.76,.52,.95,.09,.78,.91,.56,.29,.47,.64,.95,.18,.88,.72,.63,.12,.9,.2,.33,.08,.45,.11,.68,.42,.53,.79,.9,.71,.02,.84,.27,.04,.69,.83,.57,.31,.75,.12,.25,.78,.63,.55,.05,.42,.87,.33,.52,.71,.24,.61,.3,.02,.57,.74,.47,.87,.09,.66,.51,.71,.56,.08,.4,.16,.53,.12,.6,.41,.68,.45,.31,.63,.36,.44,.18,.59,.7,.23,.53,.77,.86,.27,.05,.5,.09,.31,.78,.11,.34,.8,.02,.21,.64,.49,.92,.24,.82,.62,.03,.89,.17,.61,.22,.53,.95,.34,.63,.48,.36,.55,.82,.89,.25,.76,.56,.65,.27,.71,.45,.22,.34,.69,.4,.11,.25,.66,.08,.95,.42,.16,.33,.6,.5,.22,.76,.98,.16,.85,.24,.42,.33,.49,.28,.76,.53,.86,.72,.56,.8,.23,.77,.07,.29,.16,.1,.96,.6,.32,.64,.92,.35,.07,.19,.39,.95,.59,.49,.19,.37,.81,.27,.94,.64,.18,.82,.91,.09,.98,.47,.41,.92,.35,.25,.96,.34,.78,.11,.37,.23,.82,.96,.27,.87,.35,.7,.49,.17,.8,.93,.56,.06,.75,.94,.49,.84,.99,.15,.04,.59,.37,.8,.9,.42,.71,.94,.48,.58,.25,.9,.55,.12,.78,.36,.44,.55,.99,.39,.66,.46,.12,.75,.44,.06,.18,.78,.28,.9,.2,.06,.7,.36,.61,.07,.33,.18,.95,.06,.64,.85,.28,.78,.97,.47,.73,.04,.47,.61,.86,.25,.7,.36,.04,.42,.09,.58,.37,.05,.67,.78,.89,.09,.36,.05,.42,.94,.02,.51,.86,.27,.63,.99,.55,.44,.25,.75,.46,.15,.43,.5,.61,.8,.46,.85,.56,.07,.86,1,.51,.11,.74,.46,.02,.6,.38,.15,.75,.65,.22,.8,.15,.69,.42,.17,.87,.44,.61,.91,.32,.64,.67,.45,.09,1,.89,.03,.27,.73,.14,.22,.87,.52,.13,.06,.35,.67,.42,.95,.2,.64,.24,.56,.03,.83,.17,.66,.05,.73,.45,.86,.27,0,.69,.13,.33,.71,.27,.77,.37,.31,.91,.67,.59,.93,.11,.75,.6,.42,.95,.5,.16,1,.85,.6,.38,.82,.17,.94,.53,.02,.61,.36,.88,.3,.8,.12,.55,.91,.07,.81,.63,.89,.69,.49,.71,.94,.54,0,.59,.24,1,.68,.17,.63,.29,.38,.15,.92,.37,0,.83,.67,.4,.06,.87,.2,1,.78,.24,.93,.05,.14,.28,.68,.43,.7,.16,.6,.36,.23,.97,.29,.69,.45,.34,.88,.08,.84,.54,0,.63,.58,.27,.99,.03,.75,.15,.5,0,.55,.76,.21,.62,.54,.85,.41,.49,.8,.31,.66,.25,.38,.6,.91,.3,.51,.71,.12,.31,.99,.63,.38,.27,.89,.42,.33,1,.19,.61,.94,.75,.57,.22,.92,.08,.55,1,.83,.1,.48,.25,.4,.01,.52,.68,.22,.1,.78,.4,.73,.45,.12,.52,.75,.49,.11,.45,.2,.84,.13,.58,.24,.98,.36,.66,.2,.45,.97,.16,.27,.85,.3,.19,.81,.37,.16,.45,.84,.56,.8,.47,.22,.97,.69,.6,.21,.71,.5,.78,.19,.94,.53,.81,.69,.55,.13,.28,.66,.38,.74,.98,.33,.24,0,.3,.91,.86,.58,.76,.12,.83,.55,.05,.27,.57,.44,.29,.75,.92,.09,.5,.72,.23,.54,.42,.87,.17,.82,.31,.05,.42,.33,.11,.6,.98,.07,.62,.42,.89,.7,.82,.21,.79,.07,.41,.87,.76,.45,.2,.09,.96,.55,.77,.14,.69,.39,.56,.11,.39,.8,.05,.87,.45,.69,.02,.62,.2,.75,.86,.69,.47,.99,.34,.85,.28,.57,.01,.21,.27,.91,.04,.31,.24,.62,.79,.33,.93,.39,.7,.18,.49,.72,0,.27,.77,.5,.35,.56,.03,.44,.08,.62,.27,.97,.73,.33,.11,.27,.72,.34,.83,.06,.46,.09,.81,.33,.12,.28,.63,.09,.36,.3,.01,.41,.89,.49,.56,.21,.61,.78,.89,.58,.75,.47,.17,.06,.5,.41,.96,.2,.79,.92,.73,.11,.98,.33,.83,.19,.67,.37,.81,.27,.06,.99,.71,.37,.94,.65,.79,.95,.19,.7,.35,.23,.91,.03,.17,.53,.02,.47,.15,.59,.93,.02,.53,.15,.84,.73,.51,.22,.01,.82,.49,.05,.26,.84,.47,.3,.52,.6,.16,.23,.4,.51,.95,.36,.04,.31,.82,.17,.09,.93,.64,.53,.89,.82,.63,.77,.68,.95,.87,.4,.72,.05,.65,.53,.92,.05,.8,.33,.6,.95,.43,.06,.73,.62,.95,.78,.91,.53,.11,.88,.68,.19,.41,.94,.03,.58,.13,.89,.55,.96,.61,.41,.94,.84,.47,.22,.97,.65,.83,.71,.18,.95,.03,.82,.11,.45,.09,.52,.79,.4,.67,.33,.89,.65,.01,.31,.62,.51,.38,.19,.61,.47,.23,.41,.88,.04,.95,.57,.64,.36,.26,.53,.12,.5,.27,.71,.46,.07,.84,.58,.46,.73,.98,.33,.85,.25,.95,.66,.37,.22,.68,.28,.43,.65,.34,.6,.94,.31,.62,.9,.69,.94,.16,.66,.96,.35,.78,.94,.72,.29,.16,.58,.91,.64,.22,.55,.4,.75,.44,.2,.69,.32,.08,.44,.36,.18,.58,.14,.99,.5,.25,.09,.29,.64,.44,.92,.13,.84,.64,.22,.86,.13,.36,.25,.69,.32,.42,.55,.06,.5,.62,.91,.66,.51,.8,.42,.31,.77,.13,.23,.7,.56,.01,.78,.44,.15,.5,.26,.61,.44,.33,.93,.5,.37,.2,.96,.25,.04,1,.22,.78,.44,.73,.16,.87,.42,.04,.78,.89,.05,.77,.56,.31,.47,.13,.7,.44,.84,.1,.61,.8,.17,.08,.88,.53,.92,.15,.3,.8,.39,.12,.65,.44,.56,.74,.3,.5,.82,.59,.91,.96,.02,.81,.11,.45,.4,.19,.78,.44,.33,.2,.02,.74,.25,.09,.49,.05,.88,.8,.43,.11,.49,.77,.86,.61,.03,.26,.12,.99,.46,.56,.15,.86,.51,.05,.83,.35,.18,.76,.86,.39,.8,.2,.24,.56,.37,.16,.48,.32,.69,.45,.17,.84,.02,.73,.24,.82,.3,.76,.17,.25,.39,.19,.67,.27,.64,.51,.07,.73,.34,.64,.89,.7,.57,.06,.9,.77,.08,.7,.24,.66,.86,.71,.33,.65,.13,.71,.6,.09,.25,.36,.59,.97,.67,.25,.55,.27,.69,.13,.97,.62,.8,.25,.9,.18,.01,.74,.91,.41,.96,.56,.35,.25,.41,.66,.01,.52,.19,.6,.76,.07,.39,.1,.89,.16,.1,.38,.06,.49,.17,.26,.87,.71,1,.11,.54,.04,.6,.8,.55,.87,.42,.58,.84,.63,.33,.55,.67,.25,.99,.03,.29,.47,.95,.8,.37,.86,.07,.65,.95,.27,.75,.45,.29,.62,.91,.56,.67,.13,.99,.53,.69,.05,.89,.72,1,.81,.08,.93,.55,.6,.98,.49,.89,.36,.97,0,.47,.88,.08,1,.83,.03,.92,.87,.42,1,.18,.11,.3,.19,.38,.99,.34,.2,.53,.87,.16,.59,.28,.02,.55,.86,.49,.4,.88,.53,.95,.82,.48,.07,.14,.82,.94,.43,.5,.37,.19,.72,.01,.53,.38,.77,.56,.49,.22,.28,.68,.64,.02,.78,.74,.6,.98,.86,.69,.26,.87,.94,.2,.69,.45,.98,.79,.72,.64,.32,.76,.53,.66,.06,.57,.31,.85,.27,.72,.39,.99,.06,.67,.15,.38,.22,.95,.07,.19,.74,.43,.35,.13,.7,.19,.53,.58,.73,.24,.39,.73,.02,.87,.64,.22,.7,.02,.44,.22,.35,.74,.06,.33,.76,.47,.27,.02,.58,.42,.75,.06,.34,.14,.27,.62,.09,.67,.41,.59,.73,.33,.55,.49,.37,.57,.33,.27,.79,.52,.4,.93,.5,.81,.09,.47,.69,.38,.8,.42,.1,.99,.8,.44,.16,.93,.29,.33,.18,.02,.67,.22,.3,.52,.34,.63,0,.75,.84,.25,.94,.43,.09,.98,.33,.64,.94,.35,.05,.83,.47,.22,.94,.12,.44,.31,.08,.41,.15,.46,.31,.81,.61,.03,.53,.27,.47,.22,.84,.92,.44,.36,.23,.77,.16,.66,.92,.11,.18,.47,.3,.52,.91,.05,.75,.47,.37,.85,.9,.6,.55,.83,.89,.33,.64,.03,.29,.94,.5,.18,.6,.35,.1,.95,.8,.47,.09,.95,.61,.44,.58,.91,.41,.61,.2,.36,.64,.25,.89,.28,.81,.71,.42,.8,.18,.53,.27,.93,.21,.8,.65,.09,.16,.78,.12,.65,.01,.61,.85,.71,.04,.62,.75,.88,.56,.01,.28,.91,.5,.67,.36,.22,.75,.05,.8,.55,.73,.64,.37,.93,.76,.88,.7,.16,.22,.9,.58,.15,.53,.84,.67,.6,.16,.25,.86,.14,.55,.76,.14,.52,.85,.28,.17,.48,.77,.91,.55,.01,.65,.48,.24,.34,.67,.14,.9,.01,.56,.11,.14,.83,.95,.45,.88,.4,.49,.83,.64,.78,.24,.84,.6,.8,.27,.58,.71,0,.29,.14,.23,.69,.41,.09,1,.45,.13,.63,.81,.29,.98,.55,.4,.14,.51,.33,.89,.27,.78,0,.2,.83,.12,.53,.96,.8,.13,.5,.19,.63,.46,.9,.06,.51,.92,.74,.83,.14,.05,.43,.94,.25,.71,.95,.2,.38,.94,.47,.24,.16,.55,.31,.28,.13,.16,.96,.74,.61,.21,.06,.53,.96,.6,.67,.09,.47,.99,.12,.83,.43,.58,.04,.42,1,.31,.47,.09,.34,.65,.29,.21,.81,.45,.05,.79,.67,.41,.99,.33,.71,.37,.56,.67,.84,.25,.63,.35,.98,.77,.11,.88,.95,.78,.51,.4,.75,.61,.29,.71,.49,.01,.28,.6,.05,.23,.58,.36,.01,.95,.12,.34,.44,.97,.13,.89,.51,.63,.8,.99,.03,.49,.26,.78,.87,.35,.71,.05,.44,.08,.78,.67,.24,.98,.73,.16,.51,.67,.97,.39,.24,.88,.05,.73,.44,.85,.7,.98,0,.54,.21,.67,.33,.03,.25,.47,.36,.67,.52,.29,.87,.42,.49,.55,.71,.82,.07,.34,.7,.89,.45,.94,.66,.41,.52,.09,.34,.77,.25,.88,.11,.32,.41,.19,.89,.25,.31,.51,.19,.09,.24,.66,.53,.78,.69,.92,.82,.49,.05,.73,.36,.95,.52,.59,.19,.89,.07,.25,.64,.01,.9,.09,1,.03,.72,.19,.83,.38,.17,.58,.39,.04,.85,.18,.99,.34,.8,.9,.21,.64,.75,.13,.79,.99,.08,.91,.42,.65,.54,.74,.03,.19,.67,.35,.25,.43,.11,.33,.76,.62,.15,.72,.51,.21,.56,.84,.91,.49,.31,.86,.61,.08,.6,.41,.72,.11,.3,.44,.65,.71,.35,.29,.61,.09,.4,.33,.75,.13,.95,.84,.6,.44,.99,.63,.91,.61,.83,.16,0,.63,.08,.89,.15,.29,.56,.75,.96,0,.22,.53,.82,.71,.23,.84,.55,.96,.62,.44,.72,.47,.84,.56,.73,.64,0,.8,.69,.95,.87,.47,.12,.37,.03,.25,.41,.98,.13,.91,.57,0,.72,.29,.35,.47,.58,.81,.92,.49,.75,.34,.39,.47,.54,.3,.05,.69,.45,.74,.2,.62,.29,.69,.08,.23,.47,.41,.07,.53,.92,.37,.43,.69,.28,.51,.73,.18,.27,.87,.49,.61,.82,.05,.96,.72,.46,.87,.57,.37,.96,.29,.09,.94,.42,.13,.25,.73,.18,.02,.45,.36,.82,.05,.23,.56,.84,.78,.54,.09,.49,.92,.16,.24,.9,.47,.84,.44,.25,.36,.15,.78,.11,.31,.04,.17,.37,.97,.67,.32,.8,.25,.44,.93,.19,.49,.39,.63,.77,.08,.35,.04,.94,.45,.15,.01,.37,.18,.83,.03,.95,.35,.08,.42,.89,.55,.36,.58,.28,.81,.19,.87,.6,.7,.19,.58,.68,.33,.19,.42,.92,.1,.84,.73,.16,.42,.23,.11,.55,.18,.61,.86,.14,.95,.58,.93,.28,.07,.98,.47,.13,.45,.53,.88,.15,.66,.98,.33,.23,.84,.17,.65,.87,.13,.58,1,.36,.08,.92,.4,.3,.53,.83,.16,.65,.27,.2,.03,.83,.66,.49,0,.75,.67,.33,.59,.95,.58,.92,.28,.78,.99,.48,.89,.15,.04,.99,.22,.81,.41,.67,.77,.05,.58,.18,.64,.04,.72,.89,.67,.42,.81,.55,.73,.25,.51,.77,.18]),Uu=new Float32Array([0,.5,.13,.63,.03,.53,.16,.66,.75,.25,.88,.38,.78,.28,.91,.41,.19,.69,.06,.56,.22,.72,.09,.59,.94,.44,.81,.31,.97,.47,.84,.34,.05,.55,.17,.67,.02,.52,.14,.64,.8,.3,.92,.42,.77,.27,.89,.39,.23,.73,.11,.61,.2,.7,.08,.58,.98,.48,.86,.36,.95,.45,.83,.33]),Zu=dt([new Uint8Array([0,0,0,0]),new Uint8Array([0,0,0,180]),new Uint8Array([180,0,0,0]),new Uint8Array([180,0,0,180]),new Uint8Array([0,180,180,180]),new Uint8Array([180,180,180,0]),new Uint8Array([180,180,180,180]),new Uint8Array([180,180,180,255]),new Uint8Array([255,180,180,180]),new Uint8Array([255,180,180,255]),new Uint8Array([180,255,255,255]),new Uint8Array([255,255,255,180]),new Uint8Array([255,255,255,255])]),_u=new Uint8Array([0,255,0]),Ku=new Uint8Array([0,255,255]),qu=Vu({name:"SC-core-color-engine"}),FilterEngine=function(){return this.cache=null,this.actions=[],this},Qu=FilterEngine.prototype=sc();Qu.type="FilterEngine",Qu.action=function(t){const{identifier:e,filters:i,image:n}=t,{actions:s,theBigActionsObject:r}=this;let o,a,l,c;const h=su(e);if(h)return h;for(s.length=0,o=0,a=i.length;o0?255:0;return r},Qu.buildImageGrid=function(t){const{cache:e}=this;t||(t=e.source);const{width:i,height:n}=t;if(i&&n){const t=`grid-${i}-${n}`,e=su(t);if(e)return e;const s=[];let r,o,a,l=0;for(a=0;a0;l-=e)for(c=0;c0;h-=e)h0;l-=e)for(c=0;c0;h-=e)h=c&&(t=c-i-1),e+(n=mt(n)?n:1)>=h&&(e=h-n-1),t<1&&(t=1),e<1&&(e=1),t+i>=c&&(i=c-t-1),e+n>=h&&(n=h-e-1);const o=t+i,a=e+n;(s=mt(s)?s:0)<0&&(s=0),s>=o&&(s=o-1),(r=mt(r)?r:0)<0&&(r=0),r>=a&&(r=a-1);const l=`alphatileset-${c}-${h}-${t}-${e}-${i}-${n}-${s}-${r}`,u=su(l);if(u)return u;const d=[];let f,p,g,m,y,b,S,k,A;for(m=r-a,y=h;m=0&&k=0&&b=0&&k=0&&e=0&&k=0&&e=0&&k=0&&e=o&&(t=o-1),(e=mt(e)?e:1)<1&&(e=1),e>=a&&(e=a-1),(i=mt(i)?i:0)<0&&(i=0),i>=t&&(i=t-1),(n=mt(n)?n:0)<0&&(n=0),n>=e&&(n=e-1);const s=`simple-tileset-${o}-${a}-${t}-${e}-${i}-${n}`,r=su(s);if(r)return r;const l=[];let c,h,u,d,f,p,g,m,y;for(u=n-e,d=a;u=0&&g=0&&f=h&&(f=h-1),r.substring?p=Ft(parseFloat(r)/100*u):mt(r)&&(p=r),p<0?p=0:p>=u&&(p=u-1),mt(o)&&(g=o);let y=`${m}-tileset-${h}-${u}-${l}-${c}-${d}-${f}-${p}-${g}`;m===rr?y+=`-${t.join(be)}`:m===Vr&&(y+=`-${t}-${a}`);const b=su(y);if(b)return b;if(m===Ur&&1===l&&1===c)return ou(y);const S=Su(),k=[f,p],A=[0,0];let v,C=[];const P=[],x=[];let w,O,D,F,R,T,H,E,I=wl;m===Cn&&c/d<1.05&&(c=1.05*d);const B=ut(l/2),L=ut(c/2),$=2*d,M=Ft(c/d*d);let X,Y,G,j,z,N,V,W,U,Z=0,_=0;switch(m){case Ur:if(I=`rect-grid-points-${h}-${u}-${l}-${c}-${f}-${p}`,v=su(I),!v){const t=[];for(H=p-2*u+L,E=p+2*u+L;H-l&&R-c&&H=0&&D=0&&wd)continue;j=w*h+D,x[j]||(x[j]=[]),x[j].push(Z)}Z++}if(!P.length)return P;for(w=0;w{[R,H,G]=P[t],U=S.zero().add(A).subtract([R,H]).getMagnitude(),(z<0||U=0&&C[z].push(V);return ku(S),C=C.filter((t=>null!=t)),dt(C),ru(y,C),C}return[]},Qu.buildHorizontalBlur=function(t,e){mt(e)||(e=0);const i=t.length,n=t[0].length,s=`blur-h-${n}-${i}-${e}`,r=su(s);if(r)return r;const o=[];let a,l,c,h,u;for(l=0;l=0&&c=0&&c=t&&(i=t-1),null==n||n<0?n=0:n>=e&&(n=e-1);const c=`matrix-${o}-${a}-${t}-${e}-${i}-${n}`,h=su(c);if(h)return h;const u=l.length,d=[],f=[];let p,g,m,y,b,S,k,A,v;for(m=-n,y=e-n;m=u&&(v-=u),A.push(dt(v));f.push(dt(A))}return dt(f),ru(c,f),f},Qu.checkChannelLevelsParameters=function(t){const e=function(t,e=!1){if(t.toFixed)return t<0?[_u]:t>255?[Ku]:mt(t)?[[0,255,t]]:e?[Ku]:[_u];if(t.substring&&(t=t.split(be)),gt(t)){if(!t.length)return t;if(gt(t[0]))return t;if((t=t.map((t=>parseInt(t,10)))).sort(((t,e)=>t-e)),1==t.length)return[[0,255,t[0]]];const e=[];let i,n,s,r;for(s=0,r=t.length;s0)for(r=1-i,o=0,a=n.length;o{for(m=f[e%4],y=0,b=t.length;y=0&&i=0&&n255*(t+e*(1-t)),[r,o,a]=this.getInputAndOutputLines(t),{width:l,height:c,data:h}=r,{data:u}=o,{width:d,height:f,data:p}=a,{opacity:g=1,blend:m=wl,offsetX:y=0,offsetY:b=0,lineOut:S}=t,k=(t,e)=>1===e?255:0===t?0:255*(1-kt(1,(1-e)/t)),A=(t,e)=>0===e?0:1===t?255:255*kt(1,e/(1-t)),v=(t,e)=>t255*tt(t-e),P=(t,e)=>255*(t+e-2*e*t),x=(t,e)=>t<=.5?t*e*255:255*(e+(t-e*t)),w=(t,e)=>t>e?t:e,O=(t,e)=>255*(t+e),D=(t,e)=>t*e*255,F=(t,e)=>t>=.5?t*e*255:255*(e+(t-e*t)),R=(t,e)=>255*(e+(t-e*t)),T=(t,e)=>{const i=e<=.25?((16*e-12)*e+4)*e:Et(e);return t<=.5?255*(e-(1-2*t)*e*(1-e)):255*(e+(2*t-1)*(i-e))},H=(t,e,i,n)=>e*t+n*i*(1-e);let E,I,B,L,$,M,X,Y,G,j,z,N,V,W,U,Z,_,K,q,Q,J;switch(m){case"color-burn":for(I=0;I=t&&f<=n&&p>=e&&p<=s&&g>=i&&g<=r){S=!0;break}}s[c]=f,s[h]=p,s[u]=g,s[d]=S?0:n[d]}l?this.processResults(i,e,1-o):this.processResults(this.cache.work,i,o)},[Ke]:function(t){const[e,i]=this.getInputAndOutputLines(t),n=e.data,s=i.data,r=n.length,{opacity:o=1,lowRed:a=0,lowGreen:l=0,lowBlue:c=0,highRed:h=255,highGreen:u=255,highBlue:d=255,lineOut:f}=t,p=h-a,g=u-l,m=d-c;let y,b,S,k,A,v,C,P,x;for(x=0;xm?255:(n-g)/y*255},[i,n]=this.getInputAndOutputLines(t),s=i.data,r=n.data,o=s.length,{opacity:a=1,red:l=0,green:c=255,blue:h=0,opaqueAt:u=1,transparentAt:d=0,lineOut:f}=t,p=St((l+c+h)/3,(255-l+(255-c)+(255-h))/3),g=d*p,m=u*p,y=m-g;let b,S,k,A,v,C,P,x;for(x=0;x=0&&i=0&&ne*t*n+n*i*(1-e),S=(t,e,i)=>e*t*i,k=(t,e,i)=>e*t*(1-i),A=(t,e,i,n)=>e*t*(1-n)+n*i*e,v=(t,e,i,n)=>e*t*(1-n)+n*i,C=(t,e,i)=>e*t*i,P=(t,e,i)=>i*t*(1-e),x=(t,e,i,n)=>e*t*(1-n)+n*i*(1-e),w=(t,e,i,n)=>e*t+n*i*(1-e);let O,D,F,R,T,H,E,I,B,L,$,M;switch(p){case"source-only":s.data.set(l);break;case"source-atop":for(L=0;L=0&&(D=O+1,F=D+1,R=F+1,H=T+1,E=H+1,I=E+1,$=l[R]/255,M=d[I]/255,c[O]=b(l[O],$,d[T],M),c[D]=b(l[D],$,d[H],M),c[F]=b(l[F],$,d[E],M),c[R]=255*($*M+M*(1-$)));break;case Co:for(L=0;L=0&&(D=O+1,F=D+1,R=F+1,I=T+3,$=l[R]/255,M=d[I]/255,c[O]=S(l[O],$,M),c[D]=S(l[D],$,M),c[F]=S(l[F],$,M),c[R]=$*M*255);break;case Po:for(L=0;L=0&&e(T,O,d);break;case"destination-atop":for(L=0;L=0&&(D=O+1,F=D+1,R=F+1,H=T+1,E=H+1,I=E+1,$=l[R]/255,M=d[I]/255,c[O]=C(d[T],$,M),c[D]=C(d[H],$,M),c[F]=C(d[E],$,M),c[R]=$*M*255);break;case Ai:for(L=0;L=0&&(D=O+1,F=D+1,R=F+1,H=T+1,E=H+1,I=E+1,$=l[R]/255,M=d[I]/255,c[O]=P(d[T],$,M),c[D]=P(d[H],$,M),c[F]=P(d[E],$,M),c[R]=M*(1-$)*255);break;case Je:break;case"xor":for(L=0;Lr&&(r=n);switch(d){case"lowest":return o;case"highest":return r;default:return ut(o+(r-o)/2)}},[i,n]=this.getInputAndOutputLines(t),s=i.data,r=n.data,o=s.length,{opacity:a=1,includeRed:l=!1,includeGreen:c=!1,includeBlue:h=!1,includeAlpha:u=!0,operation:d=ds,lineOut:f}=t;let p=t.width;(!mt(p)||p<1)&&(p=3),p=ut(p);let g=t.height;(!mt(g)||g<1)&&(g=3),g=ut(g);let m=t.offsetX;(!mt(m)||m<1)&&(m=1),m=ut(m);let y=t.offsetY;(!mt(y)||y<1)&&(y=1),y=ut(y);const b=this.buildMatrixGrid(p,g,m,y,i),S=ut(o/4);let k,A,v,C,P;for(P=0;P=0&&i=0&&n=0?(x=ut(C+(127-d[F+v])/127*m),w=ut(P+(127-d[F+R])/127*y),k?O=x<0||x>=o||w<0||w>=a?-1:4*(w*o+x):(x<0&&(x=0),x>=o&&(x=o-1),w<0&&(w=0),w>=a&&(w=a-1),O=4*(w*o+x)),e(O,D,l)):e(D,D,l);A?this.processResults(s,n,1-f):this.processResults(this.cache.work,s,f)},[Bi]:function(t){const e=function(t,e,i){let n=0;for(let s=0,r=e.length;s=C-l&&O<=C+l&&D>=P-l&&D<=P+l&&F>=x-l&&F<=x+l&&(c?r[v]=0:(r[S]=127,r[k]=127,r[A]=127))));u?this.processResults(n,i,1-a):this.processResults(this.cache.work,n,a)},[Zi]:function(t){const[e,i]=this.getInputAndOutputLines(t),n=e.data,s=i.data,r=n.length,{opacity:o=1,red:a=0,green:l=0,blue:c=0,alpha:h=255,excludeAlpha:u=!1,lineOut:d}=t;let f,p,g;for(f=0;f>8&255,c=o>>16&255,h=o>>24&255,C=a*n[6],P=l*n[6],x=c*n[6],w=h*n[6],S=C,k=P,A=x,v=w,H=n[0],E=n[1],I=n[4],B=n[5],T=0;T>8&255,f=o>>16&255,p=o>>24&255,g=u*H+a*E+S*I+C*B,m=d*H+l*E+k*I+P*B,y=f*H+c*E+A*I+x*B,b=p*H+h*E+v*I+w*B,C=S,P=k,x=A,w=v,S=g,k=m,A=y,v=b,a=u,l=d,c=f,h=p,i[F]=S,i[F+1]=k,i[F+2]=A,i[F+3]=v,F+=4,O++;for(O--,F-=4,D+=r*(s-1),o=t[O],a=255&o,l=o>>8&255,c=o>>16&255,h=o>>24&255,C=a*n[7],P=l*n[7],x=c*n[7],w=h*n[7],S=C,k=P,A=x,v=w,u=a,d=l,f=c,p=h,H=n[2],E=n[3],T=s-1;T>=0;T--)g=u*H+a*E+S*I+C*B,m=d*H+l*E+k*I+P*B,y=f*H+c*E+A*I+x*B,b=p*H+h*E+v*I+w*B,C=S,P=k,x=A,w=v,S=g,k=m,A=y,v=b,a=u,l=d,c=f,h=p,o=t[O],u=255&o,d=o>>8&255,f=o>>16&255,p=o>>24&255,o=(i[F]+S<<0)+(i[F+1]+k<<8)+(i[F+2]+A<<16)+(i[F+3]+v<<24),e[D]=o,O--,F-=4,D-=r}},[h,u]=this.getInputAndOutputLines(t),d=h.data,f=u.data,{width:p,height:g}=h,{opacity:m=1,radius:y=1,lineOut:b}=t,S=new Uint8ClampedArray(d),k=new Uint32Array(S.buffer),A=new Uint32Array(k.length),v=new Float32Array(4*St(p,g)),C=function(t){t<.5&&(t=.5);const c=ht(.527076)/t,h=ht(-c),u=ht(-2*c),d=(1-h)*(1-h)/(1+2*c*h-u);return e=d,i=d*(c-1)*h,n=d*(c+1)*h,s=-d*u,r=2*h,o=-u,a=(e+i)/(1-r-o),l=(n+s)/(1-r-o),new Float32Array([e,i,n,s,r,o,a,l])}(y);c(k,A,v,C,p,g),c(A,k,v,C,g,p),f.set(S),b?this.processResults(u,h,1-m):this.processResults(this.cache.work,u,m)},[fn]:function(t){const[e,i]=this.getInputAndOutputLines(t),n=e.data,s=i.data,r=n.length,o=e.width,a=e.height,{opacity:l=1,useMixedChannel:c=!0,seed:h=Si,level:u=0,offsetMin:d=0,offsetMax:f=0,offsetRedMin:p=0,offsetRedMax:g=0,offsetGreenMin:m=0,offsetGreenMax:y=0,offsetBlueMin:b=0,offsetBlueMax:S=0,offsetAlphaMin:k=0,offsetAlphaMax:A=0,transparentEdges:v=!1,lineOut:C}=t;let P=ut(t.step);P<1&&(P=1);const x=this.getRandomNumbers({seed:h,length:5*a}),w=f-d,O=g-p,D=y-m,F=S-b,R=A-k;let T=-1;const H=[];let E,I,B,L,$,M,X,Y,G,j,z,N,V,W,U,Z,_,K,q,Q,J,tt,et,it,nt;for(E=0;EZ||etZ||itZ||ntZ?0:n[nt]):s[N]=n[nt];C?this.processResults(i,e,1-l):this.processResults(this.cache.work,i,l)},[mn]:function(t){const[e,i]=this.getInputAndOutputLines(t),n=e.data,s=i.data,r=n.length,{opacity:o=1,lineOut:a}=t,l=this.getGrayscaleValue;let c,h,u,d,f,p;for(f=0;f=n&&t<=s)return r}};this.checkChannelLevelsParameters(t);const[i,n]=this.getInputAndOutputLines(t),s=i.data,r=n.data,o=s.length,{opacity:a=1,red:l=[0],green:c=[0],blue:h=[0],alpha:u=[255],lineOut:d}=t;let f,p,g,m,y;for(y=0;yfunction(t,e,i){d.length=0,f.length=0;let n,s,r,o,l,c,p=0;const g=i.length;for(n=0;n=0&&g=0&&m=0&&g=0&&m=0&&y=0&&b=0&&S=0&&k=0&&A=0&&ve+t[i+n]),0);s=ut(s/i.length);for(let t=0,r=i.length;t{d?e(r,o,t,0):i(r,o,t,0),f?e(r,o,t,1):i(r,o,t,1),p?e(r,o,t,2):i(r,o,t,2),g?e(r,o,t,3):i(r,o,t,3)})),m?this.processResults(s,n,1-a):this.processResults(this.cache.work,s,a)},[hr]:function(t){const{assetData:e,lineOut:i}=t;if(i&&i.substring&&i.length){let{width:t,height:n,data:s}=e;if(t&&n&&s){const{width:e,height:r}=this.cache.source;if(e!==t||r!==n){const i=new ImageData(e,r).data;let o,a,l,c,h=(e-t)/2,u=(r-n)/2;for(h<0&&(h=0),u<0&&(u=0),a=0;a=r)?(s[P]=n[P],s[x]=n[x],s[w]=n[w],s[O]=n[O]):(T<0?T+=r:T>=r&&(T-=r),!b||n[O]&&n[T+3]?(s[P]=p?n[T]:n[P],T++,s[x]=g?n[T]:n[x],T++,s[w]=m?n[T]:n[w],T++,s[O]=y?n[T]:n[O]):(s[P]=n[P],s[x]=n[x],s[w]=n[w],s[O]=n[O]))):(s[P]=n[P],s[x]=n[x],s[w]=n[w],s[O]=n[O])}S?this.processResults(i,e,1-a):this.processResults(this.cache.work,i,a)},[Kr]:function(t){this.predefinedPalette||(this.predefinedPalette={});const e=gn;this.colorSpaceIndices();const{rgbIndices:i,labIndices:n,indicesMemoRecord:s,predefinedPalette:r,getGrayscaleValue:o,tfx:a,tfx2:l,labIndicesMultiplier:c}=this;let h;const u=(t,e)=>{if(t||(t=e.join(be)),t&&r[t])return r[t];const o=[];return e.forEach((t=>{qu.convert(t);const[e,r,h]=qu.rgb,u=e*l+r*a+h;if(o.push(u),!s[u]){s[u]=1;const[t,o,a]=qu.convertRGBtoOKLAB(e,r,h);let l=3*u;i[l]=e,n[l]=t*c,l++,i[l]=r,n[l]=o*c,l++,i[l]=h,n[l]=a*c}})),r[t]=o.sort(((t,e)=>t-e)),o};r[He]||(u(He,["#000","#fff"]),u("monochrome-4",["#222","#777","#bbb","#fff"]),u("monochrome-8",["#000","#333","#555","#777","#999","#bbb","#ddd","#fff"]),u("monochrome-16",["#000","#111","#222","#333","#444","#555","#666","#777","#888","#999","#aaa","#bbb","#ccc","#ddd","#eee","#fff"]));const d=function(t,e){const n=e.length;if(!n)return 0;if(1===n)return e[0];const s=i[3*t];let r,o,a;const l=[];for(let t=0;tt[1]-e[1]));const[c,h]=l[0],[u,d]=l[1],f=h+d,p=f-h;return V[G]*ft[1]-e[1]));const[b,S]=y[0],[k,A]=y[1];let v=V[G];const C=S+A;return v*=C,ve[1]-t[1])),f=0,p=r.length;f=s)break}else{for(m=i[g],g++,y=i[g],g++,b=i[g],v=!0,a=0,l=o.length;a=s)break}else o.push(t[0])}return o}(_,w,C):[],N.length||(N=r[He]),R=0;R$){const t=M;M=$,$=t}let X=$-M;if(0===X&&(X=.1),C=g-$,C<0&&(C=0),x=g+$,x>u&&(x=u),P=A-$,P<0&&(P=0),w=A+$,w>=d&&(w=d),C0&&P0){let e=f,u=f;Vl(e)?u=`ude-${e(0)}-${e(.1)}-${e(.2)}-${e(.3)}-${e(.4)}-${e(.5)}-${e(.6)}-${e(.7)}-${e(.8)}-${e(.9)}-${e(1)}`:e=null!=nc[e]?nc[e]:nc.linear;const d=ou(`swirl-${i}-${n}-${s}-${o}-${c}-${u}-${a}-${l}`);if(!d.length){const i=Su(),n=Su();for(i.setFromArray([g,A]),O=P;O$?R=m:F=a&&(I-=a),B<0?B+=l:B>=l&&(B-=l),R=4*t[B][I]):(L=1-(F-M)/X,L=e(L),n.rotate(c*L).add(i),I=ut(n[0]),B=ut(n[1]),I<0?I+=a:I>=a&&(I-=a),B<0?B+=l:B>=l&&(B-=l),R=4*t[B][I]),d.push(R);ku(n),ku(i)}let p=-1;for(O=P;Oe+t[4*i+n]),0);s=ut(s/i.length);for(let t=0,r=i.length;t{y?e(r,o,t,0):i(r,o,t,0),b?e(r,o,t,1):i(r,o,t,1),S?e(r,o,t,2):i(r,o,t,2),k?e(r,o,t,3):i(r,o,t,3)})):this.transferDataUnchanged(o,r,a),A?this.processResults(s,n,1-l):this.processResults(this.cache.work,s,l)},[Wa]:function(t){const[e,i]=this.getInputAndOutputLines(t),n=e.data,s=i.data,r=n.length,{opacity:o=1,redInRed:a=1,redInGreen:l=0,redInBlue:c=0,greenInRed:h=0,greenInGreen:u=1,greenInBlue:d=0,blueInRed:f=0,blueInGreen:p=0,blueInBlue:g=1,lineOut:m}=t;let y,b,S,k,A,v,C,P;for(A=0;A{const e=b[t];e&&(e.dirtyFilterIdentifier=!1)})),L.forEach((t=>{const e=B[t];e&&(e.dirtyFilterIdentifier=!1)}))}}),Q.FilterEngine=FilterEngine;const Ju=new FilterEngine;function td(t=Ml){t.defs=_l(t.defs,{sourceLoaded:!1,source:null,subscribers:null}),t.packetExclusions=ql(t.packetExclusions,["sourceLoaded","source","subscribers"]),t.finalizePacketOut=function(t){return this.subscribers&&this.subscribers.length&&(t.subscribers=this.subscribers.map((t=>t.name))),t},t.kill=function(t=!1){return t&&this.source&&this.source.remove(),this.deregister()};const e=t.setters;e.source=function(t){t&&this.sourceLoaded&&this.notifySubscribers()},e.subscribers=Il,t.assetConstructor=function(t){return this.makeName(t.name),this.register(),this.subscribers=[],this.set(this.defs),this.set(t),t.subscribe&&this.subscribers.push(t.subscribe),this},t.subscribe=function(t){if(t&&t.name){const e=t.name;this.subscribers.every((t=>t.name!==e))&&this.subscribeAction(t)}},t.subscribeAction=function(t){t&&(this.subscribers.push(t),t.asset=this,t.source=this.source,this.notifySubscriber(t))},t.unsubscribe=function(t){if(t&&t.name){const e=t.name,i=this.subscribers.findIndex((t=>t.name===e));i>=0&&(t.source=null,t.asset=null,t.sourceNaturalHeight=0,t.sourceNaturalWidth=0,t.sourceLoaded=!1,this.subscribers.splice(i,1))}},t.notifySubscribers=function(){this.subscribers.forEach((t=>this.notifySubscriber(t)),this)},t.notifySubscriber=function(t){t.sourceNaturalWidth=this.sourceNaturalWidth,t.sourceNaturalHeight=this.sourceNaturalHeight,t.sourceLoaded=this.sourceLoaded,t.source=this.source,t.dirtyImage=!0,t.dirtyCopyStart=!0,t.dirtyCopyDimensions=!0,t.dirtyImageSubscribers=!0,t.dirtyFilterIdentifier=!0}}const ImageAsset=function(t=Ml){return this.assetConstructor(t)},ed=ImageAsset.prototype=sc();ed.type=oa,ed.lib=Ce,ed.isArtefact=!1,ed.isAsset=!0,ih(ed),td(ed);ed.defs=_l(ed.defs,{intrinsicDimensions:null}),ed.saveAsPacket=function(){return[this.name,this.type,this.lib,{}]},ed.stringifyFunction=Il,ed.processPacketOut=Il,ed.finalizePacketOut=Il,ed.clone=Ll;const id=ed.getters,nd=ed.setters;id.width=function(){return this.sourceNaturalWidth||this.source.naturalWidth||0},id.height=function(){return this.sourceNaturalHeight||this.source.naturalHeight||0},nd.source=function(t){t&&(Hn.includes(t.tagName.toUpperCase())&&(this.source=t,this.sourceNaturalWidth=t.naturalWidth,this.sourceNaturalHeight=t.naturalHeight,this.sourceLoaded=t.complete),this.sourceLoaded&&this.notifySubscribers())},nd.currentSrc=function(t){this.currentSrc=t,this.currentFile=this.currentSrc.split("/").pop()},ed.checkSource=function(t,e){const i=this.source;let n=Hi;if(this.sourceLoaded){let s=this.intrinsicDimensions[this.currentFile];switch(this.currentSrc!==i.currentSrc?(this.set({currentSrc:i.currentSrc}),s=this.intrinsicDimensions[this.currentFile],n=s?Ln:Pl):s&&(n=Ln),n){case Pl:this.sourceNaturalWidth=0,this.sourceNaturalHeight=0,this.notifySubscribers();break;case Ln:this.sourceNaturalWidth===s[0]&&this.sourceNaturalHeight===s[1]||(this.sourceNaturalWidth=s[0],this.sourceNaturalHeight=s[1],this.notifySubscribers());break;default:this.sourceNaturalWidth===i.naturalWidth&&this.sourceNaturalHeight===i.naturalHeight&&this.sourceNaturalWidth===t&&this.sourceNaturalHeight===e||(this.sourceNaturalWidth=i.naturalWidth,this.sourceNaturalHeight=i.naturalHeight,this.notifySubscribers())}}};const sd=[],rd=[],od=function(...t){const e=[];return t.forEach((t=>{let i,n,s,r,o=!1,a=!1;if(t.substring){const e=Pe.exec(t);i=e&&e[1]?e[1]:wl,n=t,s=wl,r=!1,a=!0}else(t=!!Ul(t)&&t)&&t.src&&(i=t.name||wl,n=t.src,s=t.className||wl,r=t.visibility||!1,t.parent&&(o=document.querySelector(t.parent)),a=!0);if(a){const t=ud({name:i,intrinsicDimensions:{}}),a=document.createElement(En);a.name=i,a.className=s,a.crossorigin=me,a.style.display=r?Be:Is,o&&o.appendChild(a),a.onload=()=>{t.set({source:a})},a.src=n,t.set({source:a}),e.push(i)}else e.push(!1)})),e},ad=function(t){document.querySelectorAll(t).forEach((t=>{let e;if(Hn.includes(t.tagName.toUpperCase())){if(t.id||t.name)e=t.id||t.name;else{const i=Pe.exec(t.src);e=i&&i[1]?i[1]:wl}let i=t.dataset.dimensions||{};i.substring&&(i=vt(i));const n=ud({name:e,source:t,intrinsicDimensions:i,currentSrc:t.currentSrc});t.onload=()=>{n.set({source:t})}}}))},ld=function(t,e=!1){let i=t.substring?d[t]||h[t]:t;i.type===_o&&(i=i.base),i.type===Ko&&(i.stashOutput=!0,e&&(i.stashOutputAsAsset=e))},cd=function(t,e=!1){let i;t&&!t.substring?t.type===ra?i=t:t.type===Ko?i=v[t.name]:t.type===_o&&(i=v[t.base.name]):t&&t.substring&&(i=v[t]),i&&(i.stashOutput=!0,e&&(i.stashOutputAsAsset=e))},hd=function(t,e=!1){const i=t.substring?o[t]:t;i.isArtefact&&(i.stashOutput=!0,e&&(i.stashOutputAsAsset=e))},ud=function(t){return!!t&&new ImageAsset(t)};function dd(t=Ml){t.defs=_l(t.defs,{filters:null,isStencil:!1,memoizeFilterOutput:!1});const e=t.setters;e.filters=function(t){gt(this.filters)||(this.filters=[]),t&&(gt(t)?(this.filters=t,this.dirtyFilters=!0,this.dirtyImageSubscribers=!0):t.substring&&(ql(this.filters,t),this.dirtyFilters=!0,this.dirtyImageSubscribers=!0),this.dirtyFilterIdentifier=!0)},e.memoizeFilterOutput=function(t){this.memoizeFilterOutput=t,this.updateFilterIdentifier(!!t)},t.updateFilterIdentifier=function(t){this.dirtyFilterIdentifier=!1,this.state&&(this.state.dirtyFilterIdentifier=!1),this.memoizeFilterOutput&&t?this.filterIdentifier=Xl():this.filterIdentifier=wl},t.cleanFilters=function(){this.dirtyFilters=!1,this.dirtyFiltersCache=!0,this.filters||(this.filters=[]),this.currentFilters||(this.currentFilters=[]);const{filters:t,currentFilters:e}=this;if(t.length){const i=$c();let n,s,r,o,a,l;for(n=0,s=t.length;n{t&&t.type===na&&(t=t.name),ql(this.filters,t)}),this),this.dirtyFilters=!0,this.dirtyImageSubscribers=!0,this.dirtyFilterIdentifier=!0,this},t.removeFilters=function(...t){return gt(this.filters)||(this.filters=[]),t.forEach((t=>{t&&t.type===na&&(t=t.name),Ql(this.filters,t)}),this),this.dirtyFilters=!0,this.dirtyImageSubscribers=!0,this.dirtyFilterIdentifier=!0,this},t.clearFilters=function(){return gt(this.filters)||(this.filters=[]),this.filters.length=0,this.dirtyFilters=!0,this.dirtyImageSubscribers=!0,this.dirtyFilterIdentifier=!0,this},t.hasFilters=function(){return!!this.filters.length},t.preprocessFilters=function(t){let e,i,n,s,r,o,a,c,h,u,d,f,p,g,m,y;for(e=0,i=t.length;er&&(d=r-2,p=1),f>o&&(f=o-2,g=1),p>r&&(p=r-1,d=0),g>o&&(g=o-1,f=0),d+p>r&&(d=r-p-1),f+g>o&&(f=o-g-1);const t=gu(),e=t.engine,i=t.element;i.width=m,i.height=y,e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation=xo,e.globalAlpha=1;const a=s.source||s.element;e.drawImage(a,~~d,~~f,~~p,~~g,0,0,~~m,~~y),u.assetData=e.getImageData(0,0,~~m,~~y),mu(t)}n&&(u.assetData={width:1,height:1,data:new Uint8ClampedArray(4)})}h.dirtyFilterIdentifier&&(this.dirtyFilterIdentifier=!0)}const b=this.state;if(b)if(b.dirtyFilterIdentifier)this.dirtyFilterIdentifier=!0;else{const{fillStyle:t,strokeStyle:e}=b;(B[t]&&B[t].dirtyFilterIdentifier||B[e]&&B[e].dirtyFilterIdentifier)&&(this.dirtyFilterIdentifier=!0)}(this.dirtyFilterIdentifier||this.state&&this.state.dirtyFilterIdentifier)&&this.updateFilterIdentifier(!0)}}Q.ImageAsset=ImageAsset;const Group=function(t=Ml){return this.makeName(t.name),this.register(),this.artefacts=[],this.artefactCalculateBuckets=[],this.artefactStampBuckets=[],this.set(this.defs),this.onEntityHover=Il,this.onEntityNoHover=Il,this.isHovering=null,this.set(t),this},fd=Group.prototype=sc();fd.type=ra,fd.lib="group",fd.isArtefact=!1,fd.isAsset=!1,ih(fd),dd(fd);fd.defs=_l(fd.defs,{artefacts:null,order:0,visibility:!0,regionRadius:0,checkForEntityHover:!1,onEntityHover:null,onEntityNoHover:null}),fd.packetExclusions=ql(fd.packetExclusions,["artefactCalculateBuckets","artefactStampBuckets","batchResort"]),fd.packetFunctions=ql(fd.packetFunctions,["onEntityHover","onEntityNoHover"]),fd.postCloneAction=function(t,e){let i;return e.host?e.host.substring?i=o[e.host]:e.host.type&&re.includes(e.host.type)&&(i=e.host):this.currentHost?i=this.currentHost:this.host&&(this.host.substring?i=o[this.host]:this.host.type&&re.includes(this.host.type)&&(i=this.host)),i&&(i.addGroups(t.name),t.host||(t.host=i.name)),this.onEntityHover&&(t.onEntityHover=this.onEntityHover),this.onEntityNoHover&&(t.onEntityNoHover=this.onEntityNoHover),t},fd.kill=function(t=!1){t&&this.artefactCalculateBuckets.forEach((t=>t.kill()));const e=this.name;return $t(o).forEach((t=>{gt(t.groups)&&t.groups.includes(e)&&(Ql(t.groups,e),t.batchResort=!0)})),$t(d).forEach((t=>{gt(t.groups)&&t.groups.includes(e)&&(Ql(t.groups,e),t.batchResort=!0)})),this.deregister()},fd.killArtefacts=function(){return this.artefactCalculateBuckets.forEach((t=>t.kill())),this};const pd=fd.getters,gd=fd.setters;pd.artefacts=function(){return[].concat(this.artefacts)},gd.artefacts=function(t){this.artefacts||(this.artefacts=[]),this.artefacts.length=0,this.addArtefacts(t)},gd.host=function(t){const e=this.getHost(t);e&&e.addGroups&&(this.host=t,e.addGroups(this.name),this.dirtyHost=!0)},gd.order=function(t){const e=this.getHost(this.host);this.order=t,e&&e.set({batchResort:!0})},gd.noFilters=function(t){this.noFilters=t,this.dirtyFilterIdentifier=!0},fd.getArtefactNames=function(){return[...this.artefacts]},fd.getHost=function(t){if(t){if(t.type&&re.includes(t.type))return t;if(t.substring)return o[t]||d[t]}const e=this.currentHost;return e&&e.substring?o[e]||d[e]:e},fd.forceStamp=function(){const t=this.visibility;this.visibility=!0,this.stamp(),this.visibility=t},fd.stamp=function(){if(this.dirtyHost||!this.currentHost){this.dirtyHost=!1;const t=this.getHost(this.host);t?this.currentHost=t:this.dirtyHost=!0}if(this.visibility){const{currentHost:t,stashOutput:e,noFilters:i,filters:n}=this;if(t){this.sortArtefacts();let s=null;e||!i&&n&&n.length?s=gu(t.element.width,t.element.height):t.engine&&t.engine.save(),this.prepareStamp(s),this.stampAction(s),s?mu(s):t.engine&&(t.engine.restore(),t.setEngineFromState(t.engine))}}},fd.sortArtefacts=function(){if(this.batchResort){this.batchResort=!1;const t=$c(),e=$c(),{artefacts:i,artefactCalculateBuckets:n,artefactStampBuckets:s}=this;let r,a,l,c,h,u;for(l=0,c=i.length;l{i.lib===Yi&&(i.currentHost&&i.currentHost.name===e.name||(i.currentHost=e,t||(i.dirtyHost=!0))),i.noDeltaUpdates||i.updateByDelta(),i.prepareStamp()}))},fd.stampAction=function(t){const{dirtyFilters:e,currentFilters:i,artefactStampBuckets:n,noFilters:s,filters:r,stashOutput:o,currentHost:a}=this;if(!e&&i||this.cleanFilters(),n.forEach((t=>{t&&t.stamp&&t.stamp()})),t)if(!s&&r&&r.length){const e=this.applyFilters(t);o&&this.stashAction(e)}else if(o){const e=t.element,i=t.engine,n=!(!a||!a.engine)&&a.engine;if(n){n.save(),n.globalCompositeOperation=xo,n.globalAlpha=1,n.setTransform(1,0,0,1,0,0),n.drawImage(e,0,0),n.restore();const t=i.getImageData(0,0,e.width,e.height);this.stashAction(t)}}},fd.applyFilters=function(t){const e=this.currentHost,i=fh();if(!e||!t)return!1;const n=e.element,s=e.engine,r=t.element,o=t.engine;this.isStencil&&(o.save(),o.globalCompositeOperation=Co,o.globalAlpha=1,o.setTransform(1,0,0,1,0,0),o.drawImage(n,0,0),o.restore(),this.dirtyFilterIdentifier=!0),o.setTransform(1,0,0,1,0,0);const a=o.getImageData(0,0,r.width,r.height);this.preprocessFilters(this.currentFilters);const l=Ju.action({identifier:this.filterIdentifier,image:a,filters:this.currentFilters});return l&&(o.globalCompositeOperation=xo,o.globalAlpha=1,o.setTransform(i,0,0,i,0,0),o.putImageData(l,0,0)),s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(r,0,0),s.restore(),l},fd.stashAction=function(t){if(!t)return!1;if(this.stashOutput){this.stashOutput=!1;const[e,i,n,s]=this.getCellCoverage(t),r=gu(),o=r.engine,a=r.element;if(a.width=n,a.height=s,o.putImageData(t,-e,-i),this.stashedImageData=o.getImageData(0,0,n,s),this.stashOutputAsAsset){const t=this.stashOutputAsAsset.substring?this.stashOutputAsAsset:`${this.name}-groupimage`;if(this.stashOutputAsAsset=!1,this.stashedImage)this.stashedImage.src=a.toDataURL();else{const e=this.currentHost,i=e?e.getController():null;if(i){const e=this,n=document.createElement(En);n.id=t,n.alt=`A cached image of the ${this.name} Group of entitys`,n.onload=function(){i.canvasHold.appendChild(n),e.stashedImage=n,ad(`#${t}`)},n.src=a.toDataURL()}}}mu(r)}},fd.getCellCoverage=function(t){const{width:e,height:i,data:n}=t;let s,r,o,a,l=0,c=0,h=e,u=i,d=3;for(o=0,a=e*i;os&&(h=s),lr&&(u=r),c{t&&(t.substring?ql(this.artefacts,t):t.name&&ql(this.artefacts,t.name))}),this),this.batchResort=!0,this},fd.getArtefact=function(t){return this.artefacts.includes(t)&&o[t]||!1},fd.removeArtefacts=function(...t){return t.forEach((t=>{t&&(t.substring?Ql(this.artefacts,t):t.name&&Ql(this.artefacts,t.name))}),this),this.batchResort=!0,this},fd.moveArtefactsIntoGroup=function(...t){let e,i;return t.forEach((t=>{t&&(i=t.substring?o[t]:t,i&&i.isArtefact&&(e=i.group?i.group:!!i.host&&v[i.host]),e&&(e.removeArtefacts(t),e.batchResort=!0),ql(this.artefacts,t))}),this),this.batchResort=!0,this},fd.clearArtefacts=function(){return this.artefacts.length=0,this.artefactCalculateBuckets.length=0,this.artefactStampBuckets.length=0,this.batchResort=!0,this},fd.updateArtefacts=function(t){return this.cascadeAction(t,"setDelta"),this},fd.setArtefacts=function(t){return this.cascadeAction(t,"set"),this},fd.updateByDelta=function(){return this.cascadeAction(!1,dl),this},fd.reverseByDelta=function(){return this.cascadeAction(!1,ro),this},fd.addArtefactClasses=function(t){return this.cascadeAction(t,"addClasses"),this},fd.removeArtefactClasses=function(t){return this.cascadeAction(t,"removeClasses"),this},fd.cascadeAction=function(t,e){let i;return this.artefacts.forEach((n=>{i=o[n],i&&i[e]&&i[e](t)})),this},fd.setDeltaValues=function(t=Ml){return this.artefactCalculateBuckets.forEach((e=>e.setDeltaValues(t))),this},fd.addFiltersToEntitys=function(...t){let e;return this.artefacts.forEach((i=>{e=m[i],e&&e.addFilters&&e.addFilters(t)})),this},fd.removeFiltersFromEntitys=function(...t){let e;return this.artefacts.forEach((i=>{e=m[i],e&&e.removeFilters&&e.removeFilters(t)})),this},fd.clearFiltersFromEntitys=function(){let t;return this.artefacts.forEach((e=>{t=m[e],t&&t.clearFilters&&t.clearFilters()})),this},fd.recalculateFonts=function(){let t;return this.artefacts.forEach((e=>{t=m[e],t&&t.recalculateFont&&t.recalculateFont()})),this},fd.getArtefactAt=function(t){this.sortArtefacts();const e=this.artefactStampBuckets;let i,n;for(let s=e.length-1;s>=0;s--)if(i=e[s],i&&(n=i.checkHit(t),n))return n;return!1},fd.getAllArtefactsAt=function(t){this.sortArtefacts();const e=this.artefactStampBuckets,i=$c(),n=[];let s,r,o;for(let a=e.length-1;a>=0;a--)s=e[a],s&&(r=s.checkHit(t),r&&r.artefact&&(o=r.artefact,i.includes(o.name)||(i.push(o.name),n.push(r))));if(Mc(i),this.checkForEntityHover){const t=!!n.length;this.isHovering!==t&&(this.isHovering=t,t?this.onEntityHover():this.onEntityNoHover())}return n};const md=function(t){return!!t&&new Group(t)};function yd(t=Ml){t.defs=_l(t.defs,{group:null,visibility:!0,calculateOrder:0,stampOrder:0,start:null,handle:null,offset:null,dimensions:null,pivoted:null,mimicked:null,particle:null,lockTo:null,bringToFrontOnDrag:!0,ignoreDragForX:!1,ignoreDragForY:!1,scale:1,roll:0,noUserInteraction:!1,noPositionDependencies:!1,noCanvasEngineUpdates:!1,noFilters:!1,noPathUpdates:!1,purge:null}),t.packetExclusions=ql(t.packetExclusions,["pathObject","mimicked","pivoted"]),t.packetExclusionsByRegex=ql(t.packetExclusionsByRegex,["^(local|dirty|current)","Subscriber$"]),t.packetCoordinates=ql(t.packetCoordinates,["start","handle","offset"]),t.packetObjects=ql(t.packetObjects,["group"]),t.processPacketOut=function(t,e,i){let n=!0;if(t===ns)e[0]===Ro&&e[1]===Ro&&(n=!!i.includes(ns));else this.lib===Yi?n=this.processEntityPacketOut(t,e,i):this.isArtefact&&(n=this.processDOMPacketOut(t,e,i));return n},t.handlePacketAnchor=function(t,e){if(this.anchor){const i=vt(this.anchor.saveAsPacket(e))[3];t.anchor=i}if(this.button){const i=vt(this.button.saveAsPacket(e))[3];t.button=i}return t},t.kill=function(t=!1,e=!1){const i=this.name;return $t(v).forEach((t=>{t.artefacts.includes(i)&&t.removeArtefacts(i)})),this.anchor&&this.demolishAnchor(),this.button&&this.demolishButton(),$t(o).forEach((t=>{t.name!==i&&(t.pivot&&t.pivot.name===i&&t.set({pivot:!1}),t.mimic&&t.mimic.name===i&&t.set({mimic:!1}),t.path&&t.path.name===i&&t.set({path:!1}),t.generateAlongPath&&t.generateAlongPath.name===i&&t.set({generateAlongPath:!1}),t.generateInArea&&t.generateInArea.name===i&&t.set({generateInArea:!1}),t.artefact&&t.artefact.name===i&&t.set({artefact:!1}),gt(t.pins)&&t.pins.forEach(((e,n)=>{Ul(e)&&e.name===i&&t.removePinAt(n)})))})),$t(E).forEach((t=>{t.checkForTarget(i)&&t.removeFromTargets(this)})),this.factoryKill(t,e),this.deregister(),this},t.factoryKill=Il;const e=t.getters,i=t.setters,n=t.deltaSetters;e.positionX=function(){return this.currentStampPosition[0]},e.positionY=function(){return this.currentStampPosition[1]},e.position=function(){return[].concat(this.currentStampPosition)},e.startX=function(){return this.currentStart[0]},e.startY=function(){return this.currentStart[1]},e.start=function(){return[].concat(this.currentStart)},i.startX=function(t){null!=t&&(this.start[0]=t,this.dirtyStart=!0)},i.startY=function(t){null!=t&&(this.start[1]=t,this.dirtyStart=!0)},i.start=function(t,e){this.setCoordinateHelper(Ro,t,e),this.dirtyStart=!0},n.startX=function(t){const e=this.start;e[0]=Fl(e[0],t),this.dirtyStart=!0},n.startY=function(t){const e=this.start;e[1]=Fl(e[1],t),this.dirtyStart=!0},n.start=function(t,e){this.setDeltaCoordinateHelper(Ro,t,e),this.dirtyStart=!0},e.handleX=function(){return this.currentHandle[0]},e.handleY=function(){return this.currentHandle[1]},e.handle=function(){return[].concat(this.currentHandle)},i.handleX=function(t){null!=t&&(this.handle[0]=t,this.dirtyHandle=!0)},i.handleY=function(t){null!=t&&(this.handle[1]=t,this.dirtyHandle=!0)},i.handle=function(t,e){this.setCoordinateHelper(kn,t,e),this.dirtyHandle=!0},n.handleX=function(t){const e=this.handle;e[0]=Fl(e[0],t),this.dirtyHandle=!0},n.handleY=function(t){const e=this.handle;e[1]=Fl(e[1],t),this.dirtyHandle=!0},n.handle=function(t,e){this.setDeltaCoordinateHelper(kn,t,e),this.dirtyHandle=!0},e.offsetX=function(){return this.currentOffset[0]},e.offsetY=function(){return this.currentOffset[1]},e.offset=function(){return[].concat(this.currentOffset)},i.offsetX=function(t){null!=t&&(this.offset[0]=t,this.dirtyOffset=!0)},i.offsetY=function(t){null!=t&&(this.offset[1]=t,this.dirtyOffset=!0)},i.offset=function(t,e){this.setCoordinateHelper(Ms,t,e),this.dirtyOffset=!0},n.offsetX=function(t){const e=this.offset;e[0]=Fl(e[0],t),this.dirtyOffset=!0},n.offsetY=function(t){const e=this.offset;e[1]=Fl(e[1],t),this.dirtyOffset=!0},n.offset=function(t,e){this.setDeltaCoordinateHelper(Ms,t,e),this.dirtyOffset=!0},e.width=function(){return this.currentDimensions[0]},e.height=function(){return this.currentDimensions[1]},e.dimensions=function(){return[].concat(this.currentDimensions)},i.width=function(t){null!=t&&(this.dimensions[0]=t,this.dirtyDimensions=!0)},i.height=function(t){null!=t&&(this.dimensions[1]=t,this.dirtyDimensions=!0)},i.dimensions=function(t,e){this.setCoordinateHelper(Ci,t,e),this.dirtyDimensions=!0},n.width=function(t){const e=this.dimensions;e[0]=Fl(e[0],t),this.dirtyDimensions=!0},n.height=function(t){const e=this.dimensions;e[1]=Fl(e[1],t),this.dirtyDimensions=!0},n.dimensions=function(t,e){this.setDeltaCoordinateHelper(Ci,t,e),this.dirtyDimensions=!0},e.order=function(){return this.stampOrder},i.order=function(t){this.calculateOrder=t,this.stampOrder=t},i.particle=function(t){jl(t)&&!t?(this.particle=null,this.lockTo[0]===zs&&(this.lockTo[0]=Ro),this.lockTo[1]===zs&&(this.lockTo[1]=Ro),this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0):(this.particle=t,this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0)},i.lockTo=function(t){gt(t)?(this.lockTo[0]=t[0],this.lockTo[1]=t[1]):(this.lockTo[0]=t,this.lockTo[1]=t),this.dirtyLock=!0,this.dirtyStampPositions=!0},i.lockXTo=function(t){this.lockTo[0]=t,this.dirtyLock=!0,this.dirtyStampPositions=!0},i.lockYTo=function(t){this.lockTo[1]=t,this.dirtyLock=!0,this.dirtyStampPositions=!0},e.roll=function(){return this.currentRotation},i.roll=function(t){this.roll=t,this.dirtyRotation=!0},n.roll=function(t){this.roll+=t,this.dirtyRotation=!0},e.scale=function(){return this.currentScale},i.scale=function(t){this.scale=t,this.dirtyScale=!0},n.scale=function(t){this.scale+=t,this.dirtyScale=!0},i.host=function(t){if(t){const e=o[t];e&&e.here?this.host=e.name:this.host=t}else this.host=wl;this.dirtyDimensions=!0,this.dirtyHandle=!0,this.dirtyStart=!0,this.dirtyOffset=!0},i.group=function(t){if(t)if(this.group&&this.group.type===ra&&this.group.removeArtefacts(this.name),t.substring){const e=v[t];this.group=e||t}else this.group=t;this.group&&this.group.type===ra&&this.group.addArtefacts(this.name)},i.noFilters=function(t){this.noFilters=t,this.dirtyFilterIdentifier=!0},t.purgeArtefact=function(t){return t.substring&&(t=t===ce?[Qs,fs,Ns,Wi]:[t]),gt(t)&&t.forEach((t=>function(t,e){switch(e){case Qs:delete t.pivot,delete t.pivotCorner,delete t.pivotPin,delete t.pivotIndex,delete t.addPivotHandle,delete t.addPivotOffset,delete t.addPivotRotation;break;case fs:delete t.mimic,delete t.useMimicDimensions,delete t.useMimicScale,delete t.useMimicStart,delete t.useMimicHandle,delete t.useMimicOffset,delete t.useMimicRotation,delete t.useMimicFlip,delete t.addOwnDimensionsToMimic,delete t.addOwnScaleToMimic,delete t.addOwnStartToMimic,delete t.addOwnHandleToMimic,delete t.addOwnOffsetToMimic,delete t.addOwnRotationToMimic;break;case Ns:delete t.path,delete t.pathPosition,delete t.addPathHandle,delete t.addPathOffset,delete t.addPathRotation,delete t.constantPathSpeed;break;case Wi:delete t.filter,delete t.filters,delete t.isStencil}}(this,t))),this},t.initializePositions=function(){this.dimensions=Au(),this.start=Au(),this.handle=Au(),this.offset=Au(),this.currentDimensions=Au(),this.currentStart=Au(),this.currentHandle=Au(),this.currentOffset=Au(),this.currentDragOffset=Au(),this.currentDragCache=Au(),this.currentStartCache=Au(),this.currentStampPosition=Au(),this.currentStampHandlePosition=Au(),this.delta={},this.deltaConstraints={},this.lockTo=[Ro,Ro],this.pivoted=[],this.mimicked=[],this.dirtyScale=!0,this.dirtyDimensions=!0,this.dirtyLock=!0,this.dirtyStart=!0,this.dirtyOffset=!0,this.dirtyHandle=!0,this.dirtyRotation=!0,this.isBeingDragged=!1,this.initializeDomPositions()},t.initializeDomPositions=Il,t.setCoordinateHelper=function(t,e,i){const n=this[t];gt(e)?(n[0]=e[0],n[1]=e[1]):Ul(e)?ic(e.x,e.y)?(n[0]=ec(e.x,n[0]),n[1]=ec(e.y,n[1])):(n[0]=ec(e.width,e.w,n[0]),n[1]=ec(e.height,e.h,n[1])):(n[0]=e,n[1]=i)},t.setDeltaCoordinateHelper=function(t,e,i){const n=this[t],s=n[0],r=n[1];gt(e)?(n[0]=Fl(s,e[0]),n[1]=Fl(r,e[1])):Ul(e)?ic(e.x,e.y)?(n[0]=Fl(s,ec(e.x,0)),n[1]=Fl(r,ec(e.y,0))):(n[0]=Fl(s,ec(e.width,e.w,0)),n[1]=Fl(r,ec(e.height,e.h,0))):(n[0]=Fl(s,e),n[1]=Fl(r,i))},t.getHost=function(){if(this.currentHost)return this.currentHost;if(this.host){const t=o[this.host];if(t)return this.currentHost=t,this.dirtyHost=!0,this.currentHost}return oh},t.getHere=function(){const t=this.getHost();if(t){if(t.here&&bt(t.here))return t.here;if(t.currentDimensions){const e=t.currentDimensions;if(e)return{w:e[0],h:e[1]}}}return oh},t.cleanPosition=function(t,e,i){for(let n=0;n<2;n++){const s=e[n],r=i[n];s.toFixed?t[n]=s:s===Jn||s===Ua?t[n]=0:s===ao||s===Ge?t[n]=r:s===We?t[n]=r/2:mt(parseFloat(s))?t[n]=parseFloat(s)/100*r:t[n]=0}this.dirtyFilterIdentifier=!0},t.cleanScale=function(){this.dirtyScale=!1;const t=this.scale,e=this.mimic,i=this.currentScale;let n=0;e&&this.useMimicScale?e.currentScale?(n=e.currentScale,this.addOwnScaleToMimic&&(n+=t)):(n=t,this.dirtyMimicScale=!0):n=t,this.currentScale=n,this.dirtyDimensions=!0,this.dirtyHandle=!0,i!==this.currentScale&&(this.dirtyPositionSubscribers=!0),this.mimicked&&this.mimicked.length&&(this.dirtyMimicScale=!0),this.dirtyFilterIdentifier=!0},t.cleanDimensions=function(){this.dirtyDimensions=!1;const t=this.getHost(),e=this.currentDimensions;if(t){let i,n,s;i=t.currentDimensions?t.currentDimensions:[t.w,t.h],[n,s]=this.dimensions;const[r,o]=e;n.substring&&(n=parseFloat(n)/100*i[0]),s.substring&&(s=s===xe?0:parseFloat(s)/100*i[1]);const a=this.mimic;i=a&&a.name&&this.useMimicDimensions?a.currentDimensions:null,i?(e[0]=this.addOwnDimensionsToMimic?i[0]+n:i[0],e[1]=this.addOwnDimensionsToMimic?i[1]+s:i[1]):(e[0]=n,e[1]=s),this.cleanDimensionsAdditionalActions(),this.dirtyStart=!0,this.dirtyHandle=!0,this.dirtyOffset=!0,r===e[0]&&o===e[1]||(this.dirtyPositionSubscribers=!0),this.mimicked&&this.mimicked.length&&(this.dirtyMimicDimensions=!0),this.dirtyFilterIdentifier=!0}else this.dirtyDimensions=!0},t.cleanDimensionsAdditionalActions=Il,t.cleanLock=function(){this.dirtyLock=!1,this.dirtyStart=!0,this.dirtyHandle=!0},t.cleanStart=function(){const t=this.getHost();let e=0,i=0;t&&(this.dirtyStart=!1,tc(t.w,t.h)?(e=t.w,i=t.h):t.currentDimensions?[e,i]=t.currentDimensions:this.dirtyStart=!0),this.dirtyStart||(this.cleanPosition(this.currentStart,this.start,[e,i]),this.dirtyStampPositions=!0)},t.cleanOffset=function(){const t=this.getHost();let e=0,i=0;t&&(this.dirtyOffset=!1,tc(t.w,t.h)?(e=t.w,i=t.h):t.currentDimensions?[e,i]=t.currentDimensions:this.dirtyOffset=!0),this.dirtyOffset||(this.cleanPosition(this.currentOffset,this.offset,[e,i]),this.dirtyStampPositions=!0,this.mimicked&&this.mimicked.length&&(this.dirtyMimicOffset=!0))},t.cleanHandle=function(){this.dirtyHandle=!1,this.cleanPosition(this.currentHandle,this.handle,this.currentDimensions),this.dirtyStampHandlePositions=!0,this.mimicked&&this.mimicked.length&&(this.dirtyMimicHandle=!0)},t.cleanRotation=function(){this.dirtyRotation=!1;const t=this.roll,e=this.currentRotation,i=this.path,n=this.mimic,s=this.pivot,r=this.lockTo;let o=0;if(i&&r.includes(Ns)){if(o=t,this.addPathRotation){const t=this.getPathData();t&&(o+=t.angle)}}else n&&this.useMimicRotation&&r.includes(fs)?Jl(n.currentRotation)?(o=n.currentRotation,this.addOwnRotationToMimic&&(o+=t)):this.dirtyMimicRotation=!0:(o=t,s&&this.addPivotRotation&&r.includes(Qs)&&(s.type===ta?o+=s.getUnitAlignment(this.pivotIndex):Jl(s.currentRotation)?o+=s.currentRotation:this.dirtyPivotRotation=!0));this.currentRotation=o,o!==e&&(this.dirtyPositionSubscribers=!0),this.mimicked&&this.mimicked.length&&(this.dirtyMimicRotation=!0),this.dirtyFilterIdentifier=!0},t.cleanStampPositions=function(){this.dirtyStampPositions=!1;const{currentDragOffset:t,currentOffset:e,currentStampPosition:i,currentStart:n,currentStartCache:s}=this,[r,o]=i;if(this.noPositionDependencies)i[0]=n[0],i[1]=n[1];else{const{addOwnOffsetToMimic:r,addOwnStartToMimic:o,addPathOffset:a,addPivotOffset:l,ignoreDragForX:c,ignoreDragForY:h,isBeingDragged:u,lockTo:d,mimic:f,path:p,pivot:g,pivotCorner:m,pivotPin:y,pivotIndex:b,useMimicOffset:S,useMimicStart:k}=this;let A,v=this.particle;const C=function(t){return(t!==Qs||g)&&(t!==Ns||p)&&(t!==fs||f)&&(t!==zs||P)?t:Ro},x={[Ro]:function(t){t.setFromArray(n).add(e)},[Ns]:function(t){F?(t.setFromVector(F),a||t.subtract(p.currentOffset)):t.setFromArray(n).add(e)},[Qs]:function(t){m&&g.getCornerCoordinate?t.setFromArray(g.getCornerCoordinate(m)):g.type===pa?t.setFromArray(g.getPinAt(y)):g.type===ta?b<0?t.setFromArray(g.layoutTemplate.currentStampPosition):(A=g.getUnitStartAt(b),null!=A?t.setFromArray(A):t.setFromArray(n).add(e)):t.setFromArray(g.currentStampPosition),l||t.subtract(g.currentOffset),t.add(e)},[fs]:function(t){k||S?(t.setFromArray(f.currentStampPosition),k&&o&&t.add(n),S&&r&&t.add(e),k||t.subtract(f.currentStart).add(n),S||t.subtract(f.currentOffset).add(e)):t.setFromArray(n).add(e)},[zs]:function(t){v.substring&&(v=P[v]),v?t.setFromVector(v.position):t.setFromArray(n).add(e)},[ms]:function(i){i.setFromVector(D),u&&(s.setFromArray(i),i.add(t)),i.add(e)}},w=Su();let O,D,F,R=!1;if(u)w[0]=c?C(d[0]):ms,w[1]=h?C(d[1]):ms,R=!0,this.getCornerCoordinate&&this.cleanPathObject();else for(let t=0;t<2;t++)O=C(d[t]),O===ms&&(R=!0),Ro!==O&&(this.dirtyFilterIdentifier=!0),w[t]=O;R&&(D=this.getHere()),w.includes(Ns)&&(F=this.getPathData());const[T,H]=w,E=Su(),I=Su();x[T](E),T===H?I.setFromArray(E):x[H](I),i[0]=E[0],i[1]=I[1],ku(w,E,I)}r===i[0]&&o===i[1]||(this.dirtyPositionSubscribers=!0)},t.cleanStampHandlePositions=function(){this.dirtyStampHandlePositions=!1;const t=this.currentStampHandlePosition,e=this.currentHandle,[i,n]=t;if(this.noPositionDependencies)t[0]=e[0],t[1]=e[1];else{const i=this.lockTo,n=this.pivot,s=this.path,r=this.mimic;let o,a;for(let l=0;l<2;l++){switch(o=i[l],o!==Qs||n||(o=Ro),o!==Ns||s||(o=Ro),o!==fs||r||(o=Ro),a=e[l],Ro!==o&&(this.dirtyFilterIdentifier=!0),o){case Qs:this.addPivotHandle&&(a+=n.currentHandle[l]);break;case Ns:this.addPathHandle&&(a+=s.currentHandle[l]);break;case fs:this.useMimicHandle&&(a=r.currentHandle[l],this.addOwnHandleToMimic&&(a+=e[l]))}t[l]=a}}this.cleanStampHandlePositionsAdditionalActions(),i===t[0]&&n===t[1]||(this.dirtyPositionSubscribers=!0)},t.cleanStampHandlePositionsAdditionalActions=Il,t.checkHit=function(t=[]){if(this.noUserInteraction)return!1;this.pathObject&&!this.dirtyPathObject||this.cleanPathObject();const e=gt(t)?t:[t];let i=0,n=0;const s=gu(),r=s.engine,o=this.currentStampPosition,a=this.pathObject,l=this.winding;return e.some((t=>{if(gt(t))i=t[0],n=t[1];else{if(!tc(t,t.x,t.y))return!1;i=t.x,n=t.y}return!(!mt(i)||!mt(n))&&(s.rotateDestination(r,...o,this),r.isPointInPath(a,i,n,l))}),this)?(mu(s),this.checkHitReturn(i,n)):(mu(s),!1)},t.checkHitReturn=function(t,e){return{x:t,y:e,artefact:this}},t.pickupArtefact=function(t=Ml){const{x:e,y:i}=t;if(tc(e,i)){const{bringToFrontOnDrag:t,currentDragOffset:n,currentStart:s,group:r,lockTo:o,mimic:a,pivot:l}=this;this.isBeingDragged=!0,this.currentDragCache.set(this.currentDragOffset),this.relativeCoordinates=[...this.start],o[0]===Ro?n[0]=s[0]-e:o[0]===Qs&&l?n[0]=l.get(Ho)-e:o[0]===fs&&a&&(n[0]=a.get(Ho)-e),o[1]===Ro?n[1]=s[1]-i:o[1]===Qs&&l?n[1]=l.get(Eo)-i:o[1]===fs&&a&&(n[1]=a.get(Eo)-i),t&&(this.stampOrder+=9999,r.batchResort=!0),Jl(this.dirtyPathObject)&&(this.dirtyPathObject=!0)}return this},t.dropArtefact=function(){const{bringToFrontOnDrag:t,currentDragCache:e,currentDragOffset:i,currentHost:n,currentStartCache:s,group:r,ignoreDragForX:o,ignoreDragForY:a,relativeCoordinates:l,start:c}=this;let h,u,d,f,p,g;return o||(c[0]=s[0]+i[0]),a||(c[1]=s[1]+i[1]),this.dirtyStart=!0,n&&([d,f]=n.get(Ci),[h,u]=c,[p,g]=l,!o&&p.substring&&(c[0]=h/d*100+"%"),!a&&g.substring&&(c[1]=u/f*100+"%")),delete this.relativeCoordinates,i.set(e),t&&(this.stampOrder-=9999,this.stampOrder<0&&(this.stampOrder=0),r.batchResort=!0),Jl(this.dirtyPathObject)&&(this.dirtyPathObject=!0),this.isBeingDragged=!1,this},t.updatePositionSubscribers=function(){this.dirtyPositionSubscribers=!1,this.pivoted&&this.pivoted.length&&this.updatePivotSubscribers(),this.mimicked&&this.mimicked.length&&this.updateMimicSubscribers(),this.pathed&&this.pathed.length&&this.updatePathSubscribers()},t.updatePivotSubscribers=Il,t.updateMimicSubscribers=Il,t.updatePathSubscribers=Il,t.updateImageSubscribers=Il}function bd(t=Ml){t.defs=_l(t.defs,{delta:null,noDeltaUpdates:!1,deltaConstraints:null,checkDeltaConstraints:!1,performDeltaChecks:!1});const e=t.setters;e.delta=function(t=Ml){t&&(this.delta=Kl(this.delta,t))},e.deltaConstraints=function(t=Ml){t&&(this.deltaConstraints=Kl(this.deltaConstraints,t))},t.updateByDelta=function(){return this.setDelta(this.delta),this.checkDeltaConstraints&&this.performDeltaConstraintsChecks(),this},t.reverseByDelta=function(){const t={},e=this.delta,i=bt(e),n=i.length;let s,r,o;for(s=0;s=0?(r<2?d=this.start:r<4?d=this.handle:r<6?d=this.offset:r<8&&(d=this.dimensions),po.includes(s)&&(f=1),p=d[f]):p=this.get(s),m=parseFloat(a),y=parseFloat(l),b=parseFloat(p),h=wl,by&&(h=c,u=1),h)switch(h){case so:t[s]=-parseFloat(t[s])+Vs,this.set({[s]:b+parseFloat(t[s])+Vs});break;case rs:u?this.set({[s]:b-(y-m)+Vs}):this.set({[s]:b+(y-m)+Vs})}}else if(p=this.get(s),h=wl,pl&&(h=c,u=1),h)switch(h){case so:t[s]=-t[s],this.set({[s]:p+t[s]});break;case rs:u?this.set({[s]:p-(l-a)}):this.set({[s]:p+(l-a)})}}else this.performDeltaChecks=!0},t.setDeltaValues=function(t=Ml){const e=this.delta,i=bt(t),n=i.length;let s,r,o,a,l,c;for(s=0;s{t=o[e],t||(t=l[e],t&&t.type===Ko||(t=!1)),t&&(t.dirtyStart=!0,t.addPivotHandle&&(t.dirtyHandle=!0),t.addPivotOffset&&(t.dirtyOffset=!0),t.addPivotRotation&&(t.dirtyRotation=!0),t.type===pa?t.dirtyPins=!0:t.type!==la&&t.type!==ga&&t.type!==Zo||t.dirtyPins.push(this.name))}),this)}}function kd(t=Ml){const e={mimic:wl,useMimicDimensions:!1,useMimicScale:!1,useMimicStart:!1,useMimicHandle:!1,useMimicOffset:!1,useMimicRotation:!1,useMimicFlip:!1,addOwnDimensionsToMimic:!1,addOwnScaleToMimic:!1,addOwnStartToMimic:!1,addOwnHandleToMimic:!1,addOwnOffsetToMimic:!1,addOwnRotationToMimic:!1};t.defs=_l(t.defs,e),t.packetObjects=ql(t.packetObjects,["mimic"]);const i=t.setters;i.mimic=function(t){if(jl(t)&&!t)this.mimic=null,this.lockTo[0]===fs&&(this.lockTo[0]=Ro),this.lockTo[1]===fs&&(this.lockTo[1]=Ro),this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0;else{const e=this.mimic,i=this.name;let n=t.substring?o[t]:t;n||(n=l[t],n&&n.type!==Ko&&(n=!1)),n&&n.name&&(e&&e.name!==n.name&&Ql(e.mimicked,i),ql(n.mimicked,i),this.mimic=n,this.useMimicDimensions&&(this.dirtyDimensions=!0),this.useMimicScale&&(this.dirtyScale=!0),this.useMimicStart&&(this.dirtyStart=!0),this.useMimicHandle&&(this.dirtyHandle=!0),this.useMimicOffset&&(this.dirtyOffset=!0),this.useMimicRotation&&(this.dirtyRotation=!0))}},i.useMimicDimensions=function(t){this.useMimicDimensions=t,this.dirtyDimensions=!0},i.useMimicScale=function(t){this.useMimicScale=t,this.dirtyScale=!0},i.useMimicStart=function(t){this.useMimicStart=t,this.dirtyStart=!0},i.useMimicHandle=function(t){this.useMimicHandle=t,this.dirtyHandle=!0},i.useMimicOffset=function(t){this.useMimicOffset=t,this.dirtyOffset=!0},i.useMimicRotation=function(t){this.useMimicRotation=t,this.dirtyRotation=!0},i.addOwnDimensionsToMimic=function(t){this.addOwnDimensionsToMimic=t,this.dirtyDimensions=!0},i.addOwnScaleToMimic=function(t){this.addOwnScaleToMimic=t,this.dirtyScale=!0},i.addOwnStartToMimic=function(t){this.addOwnStartToMimic=t,this.dirtyStart=!0},i.addOwnHandleToMimic=function(t){this.addOwnHandleToMimic=t,this.dirtyHandle=!0},i.addOwnOffsetToMimic=function(t){this.addOwnOffsetToMimic=t,this.dirtyOffset=!0},i.addOwnRotationToMimic=function(t){this.addOwnRotationToMimic=t,this.dirtyRotation=!0},t.updateMimicSubscribers=function(){const t=this.dirtyMimicHandle,e=this.dirtyMimicOffset,i=this.dirtyMimicRotation,n=this.dirtyMimicScale,s=this.dirtyMimicDimensions;let r;this.mimicked.forEach((a=>{r=o[a],r||(r=l[a],r&&r.type===Ko||(r=!1)),r&&(r.useMimicStart&&(r.dirtyStart=!0),t&&r.useMimicHandle&&(r.dirtyHandle=!0),e&&r.useMimicOffset&&(r.dirtyOffset=!0),i&&r.useMimicRotation&&(r.dirtyRotation=!0),n&&r.useMimicScale&&(r.dirtyScale=!0),s&&r.useMimicDimensions&&(r.dirtyDimensions=!0))})),this.dirtyMimicHandle=!1,this.dirtyMimicOffset=!1,this.dirtyMimicRotation=!1,this.dirtyMimicScale=!1,this.dirtyMimicDimensions=!1}}function Ad(t=Ml){const e={path:wl,pathPosition:0,addPathHandle:!1,addPathOffset:!0,addPathRotation:!1,constantSpeedAlongPath:!1};t.defs=_l(t.defs,e),t.packetObjects=ql(t.packetObjects,["path"]);const i=t.setters,n=t.deltaSetters;i.path=function(t){if(jl(t)&&!t)this.path=null,this.lockTo[0]===Ns&&(this.lockTo[0]=Ro),this.lockTo[1]===Ns&&(this.lockTo[1]=Ro),this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0;else{const e=this.path,i=t.substring?o[t]:t,n=this.name;i&&i.name&&i.useAsPath&&(e&&e.name!==i.name&&Ql(e.pathed,n),ql(i.pathed,n),this.path=i,this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0)}},i.pathPosition=function(t){t<0&&(t=tt(t)),t>1&&(t%=1),this.pathPosition=parseFloat(t.toFixed(6)),this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0,this.currentPathData=!1},n.pathPosition=function(t){let e=this.pathPosition+t;e<0&&(e+=1),e>1&&(e%=1),this.pathPosition=parseFloat(e.toFixed(6)),this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0,this.currentPathData=!1},i.addPathHandle=function(t){this.addPathHandle=t,this.dirtyHandle=!0},i.addPathOffset=function(t){this.addPathOffset=t,this.dirtyOffset=!0},i.addPathRotation=function(t){this.addPathRotation=t,this.dirtyRotation=!0},t.getPathData=function(){if(this.currentPathData)return this.currentPathData;const t=this.pathPosition,e=this.path;if(e){const i=this.constantSpeedAlongPath||this.constantPathSpeed||!1,n=e.getPathPositionData(t,i);return this.addPathRotation&&(this.dirtyRotation=!0),this.currentPathData=n,n}return!1}}function vd(t=Ml){t.getCanvasNavElement=function(){const t=this.currentHost;if(t){if(t.type===_o)return t.navigation;if(t.type===Ko){const e=t.currentHost?t.currentHost:h[t.host];if(e&&e.type===_o)return e.navigation}}return null},t.getCanvasWrapper=function(){const t=this.currentHost;if(t){if(t.type===_o)return t;if(t.type===Ko){const e=t.currentHost?t.currentHost:h[t.host];if(e&&e.type===_o)return e}}return null},t.prepareStampTabsHelper=function(){this.anchor&&this.rebuildAnchor(),this.button&&this.rebuildButton()},t.modifyConstructorInputForAnchorButton=function(t){const e=bt(t);let i=!1;for(let t=0,n=fe.length;tt.onEnter()),!1),t&&i&&o&&i.removeEventListener(Me,(()=>t.onLeave()),!1),n&&i&&n.removeChild(i),e&&(e.dirtyNavigationTabOrder=!0),t&&(t.anchor=null),this.deregister()},Cd.set=function(t=Ml){let e,i,n,s;const r=bt(t),o=r.length;if(o){const a=this.setters,l=this.defs;for(e=0;et.onEnter()),!1),s&&b.removeEventListener(Me,(()=>t.onLeave()),!1),e.removeChild(b),this.domElement=null),a||(b=document.createElement(zt),b.id=d,l&&b.setAttribute(Fi,l),h&&b.setAttribute(xn,h),u&&b.setAttribute(wn,u),f&&b.setAttribute(qs,f),p&&b.setAttribute(qr,p),g&&b.setAttribute(Jr,g),y&&b.setAttribute(Fa,y),n&&b.setAttribute(il,n),b.setAttribute(yi,m),r&&Vl(r)&&b.addEventListener(ti,r,!1),o&&(b.textContent=o),c&&b.addEventListener(_i,(()=>t.onEnter()),!1),s&&b.addEventListener(Me,(()=>t.onLeave()),!1),this.domElement=b,e.appendChild(b)),i.dirtyNavigationTabOrder=!0}}},Cd.rebuild=function(){this.dirtyAnchor&&(this.build(),this.dirtyAnchor=!1)},Cd.click=function(){if(this.hasBeenRecentlyClicked)return!1;{const t=new MouseEvent(ti,{view:window,bubbles:!0,cancelable:!0});this.hasBeenRecentlyClicked=!0;const e=this;return setTimeout((()=>e.hasBeenRecentlyClicked=!1),200),this.domElement.dispatchEvent(t)}};const xd=function(t){return!!t&&new Anchor(t)};function wd(t=Ml){t.defs=_l(t.defs,{anchor:null}),t.demolishAnchor=function(){this.anchor&&this.anchor.demolish()};const e=t.getters,i=t.setters;e.anchorName=function(){return this.anchorGetHelper(ws)},e.anchorDescription=function(){return this.anchorGetHelper(ki)},i.anchorDescription=function(t){this.anchorSetHelper(ki,t)},e.anchorType=function(){return this.anchorGetHelper(pe)},i.anchorType=function(t){this.anchorSetHelper(pe,t)},e.anchorTarget=function(){return this.anchorGetHelper(Fa)},i.anchorTarget=function(t){this.anchorSetHelper(Fa,t)},e.anchorTabOrder=function(){return this.anchorGetHelper(Oa)},i.anchorTabOrder=function(t){this.anchorSetHelper(Oa,t)},e.anchorDisabled=function(){return this.anchorGetHelper(Pi)},i.anchorDisabled=function(t){this.anchorSetHelper(Pi,t)},e.anchorRel=function(){return this.anchorGetHelper(Jr)},i.anchorRel=function(t){this.anchorSetHelper(Jr,t)},e.anchorReferrerPolicy=function(){return this.anchorGetHelper(qr)},i.anchorReferrerPolicy=function(t){this.anchorSetHelper(qr,t)},e.anchorPing=function(){return this.anchorGetHelper(qs)},i.anchorPing=function(t){this.anchorSetHelper(qs,t)},e.anchorHreflang=function(){return this.anchorGetHelper(wn)},i.anchorHreflang=function(t){this.anchorSetHelper(wn,t)},e.anchorHref=function(){return this.anchorGetHelper(xn)},i.anchorHref=function(t){this.anchorSetHelper(xn,t)},e.anchorDownload=function(){return this.anchorGetHelper(Fi)},i.anchorDownload=function(t){this.anchorSetHelper(Fi,t)},i.anchorFocusAction=function(t){this.anchorSetHelper(Ki,t)},i.anchorBlurAction=function(t){this.anchorSetHelper(Xe,t)},i.anchorClickAction=function(t){this.anchorSetHelper(ei,t)},i.anchor=function(t){this.anchor?this.anchor.set(t):this.buildAnchor(t)},t.anchorGetHelper=function(t){return this.anchor?this.anchor.get(t):null},t.anchorSetHelper=function(t,e){this.anchor||this.buildAnchor({[t]:e}),this.anchor&&this.anchor.set({[t]:e})},t.buildAnchor=function(t={}){this.anchor&&this.anchor.demolish(),t.anchorName||(t.anchorName=`${this.name}-anchor`),t.description||(t.description=`Anchor link for ${this.name} ${this.type}`),t.host=this,t.controller=this.getCanvasWrapper(),t.hold=this.getCanvasNavElement(),this.anchor=xd(t)},t.rebuildAnchor=function(){this.anchor&&this.anchor.rebuild()},t.clickAnchor=function(){this.anchor&&this.anchor.click()}}Q.Anchor=Anchor;const Button=function(t=Ml){return this.makeName(t.name),this.register(),this.set(this.defs),this.host=t.host,this.controller=t.controller,this.hold=t.hold,this.set(t),this.dirtyButton=!0,this},Od=Button.prototype=sc();Od.type="Button",Od.lib=de,Od.isArtefact=!1,Od.isAsset=!1,ih(Od);const Dd={host:null,description:wl,tabOrder:0,autofocus:!1,disabled:!1,form:wl,formAction:wl,formEnctype:wl,formMethod:wl,formNoValidate:!1,formTarget:wl,popoverTarget:wl,popoverTargetAction:wl,elementType:je,elementValue:wl,clickAction:null,focusAction:!0,blurAction:!0};Od.defs=_l(Od.defs,Dd),Od.packetExclusions=ql(Od.packetExclusions,["domElement"]),Od.packetObjects=ql(Od.packetObjects,["host"]),Od.packetFunctions=ql(Od.packetFunctions,["clickAction"]),Od.demolish=function(){const{host:t,controller:e,domElement:i,hold:n,clickAction:s,focusAction:r,blurAction:o}=this;i&&s&&i.removeEventListener(ti,s,!1),t&&i&&r&&i.removeEventListener(_i,(()=>t.onEnter()),!1),t&&i&&o&&i.removeEventListener(Me,(()=>t.onLeave()),!1),n&&i&&n.removeChild(i),e&&(e.dirtyNavigationTabOrder=!0),t&&(t.button=null),this.deregister()},Od.set=function(t=Ml){let e,i,n,s;const r=bt(t),o=r.length;if(o){const a=this.setters,l=this.defs;for(e=0;et.onEnter()),!1),s&&A.removeEventListener(Me,(()=>t.onLeave()),!1),e.removeChild(A),this.domElement=null),a||(A=document.createElement(je),A.id=y,n&&A.setAttribute(we,wl),a&&A.setAttribute(Pi,wl),u&&A.setAttribute(nn,u),d&&A.setAttribute("formaction",d),f&&A.setAttribute("formenctype",f),p&&A.setAttribute("formmethod",p),g&&A.setAttribute("formnovalidate",wl),m&&A.setAttribute(Fa,m),b&&A.setAttribute("popovertarget",b),S&&A.setAttribute("popovertargetaction",S),null!=c&&A.setAttribute(pl,c),l?A.setAttribute(il,l):A.setAttribute(il,je),A.setAttribute(yi,k),r&&Vl(r)&&A.addEventListener(ti,r,!1),o&&(A.textContent=o),h&&A.addEventListener(_i,(()=>t.onEnter()),!1),s&&A.addEventListener(Me,(()=>t.onLeave()),!1),this.domElement=A,e.appendChild(A)),i.dirtyNavigationTabOrder=!0}}},Od.rebuild=function(){this.dirtyButton&&(this.build(),this.dirtyButton=!1)},Od.click=function(){if(this.hasBeenRecentlyClicked)return!1;{const t=new MouseEvent(ti,{view:window,bubbles:!0,cancelable:!0});this.hasBeenRecentlyClicked=!0;const e=this;return setTimeout((()=>e.hasBeenRecentlyClicked=!1),200),this.domElement.dispatchEvent(t)}};const Fd=function(t){return!!t&&new Button(t)};function Rd(t=Ml){t.defs=_l(t.defs,{button:null}),t.demolishButton=function(){this.button&&this.button.demolish()};const e=t.getters,i=t.setters;e.buttonName=function(){return this.buttonGetHelper(ws)},e.buttonAutofocus=function(){return this.buttonGetHelper(we)},i.buttonAutofocus=function(t){this.buttonSetHelper(we,t)},e.buttonDescription=function(){return this.buttonGetHelper(ki)},i.buttonDescription=function(t){this.buttonSetHelper(ki,t)},e.buttonDisabled=function(){return this.buttonGetHelper(Pi)},i.buttonDisabled=function(t){this.buttonSetHelper(Pi,t)},e.buttonTabOrder=function(){return this.buttonGetHelper(Oa)},i.buttonTabOrder=function(t){this.buttonSetHelper(Oa,t)},e.buttonForm=function(){return this.buttonGetHelper(nn)},i.buttonForm=function(t){this.buttonSetHelper(nn,t)},e.buttonFormAction=function(){return this.buttonGetHelper(sn)},i.buttonFormAction=function(t){this.buttonSetHelper(sn,t)},e.buttonFormEnctype=function(){return this.buttonGetHelper(rn)},i.buttonFormEnctype=function(t){this.buttonSetHelper(rn,t)},e.buttonFormMethod=function(){return this.buttonGetHelper(on)},i.buttonFormMethod=function(t){this.buttonSetHelper(on,t)},e.buttonFormNoValidate=function(){return this.buttonGetHelper(an)},i.buttonFormNoValidate=function(t){this.buttonSetHelper(an,t)},e.buttonFormTarget=function(){return this.buttonGetHelper(ln)},i.buttonFormTarget=function(t){this.buttonSetHelper(ln,t)},e.buttonPopoverTarget=function(){return this.buttonGetHelper(ar)},i.buttonPopoverTarget=function(t){this.buttonSetHelper(ar,t)},e.buttonPopoverTargetAction=function(){return this.buttonGetHelper(lr)},i.buttonPopoverTargetAction=function(t){this.buttonSetHelper(lr,t)},e.buttonElementType=function(){return this.buttonGetHelper(Ei)},i.buttonElementType=function(t){this.buttonSetHelper(Ei,t)},e.buttonElementValue=function(){return this.buttonGetHelper(Ii)},i.buttonElementValue=function(t){this.buttonSetHelper(Ii,t)},i.buttonFocusAction=function(t){this.buttonSetHelper(Ki,t)},i.buttonBlurAction=function(t){this.buttonSetHelper(Xe,t)},i.buttonClickAction=function(t){this.buttonSetHelper(ei,t)},i.button=function(t){this.button?this.button.set(t):this.buildButton(t)},t.buttonGetHelper=function(t){return this.button?this.button.get(t):null},t.buttonSetHelper=function(t,e){this.button||this.buildButton({[t]:e}),this.button&&this.button.set({[t]:e})},t.buildButton=function(t={}){this.button&&this.button.demolish(),t.buttonName||(t.buttonName=`${this.name}-button`),t.description||(t.description=`Button for ${this.name} ${this.type}`),t.host=this,t.controller=this.getCanvasWrapper(),t.hold=this.getCanvasNavElement(),this.button=Fd(t)},t.rebuildButton=function(){this.button&&this.button.rebuild()},t.clickButton=function(){this.button&&this.button.click()}}function Td(t=Ml){t.defs=_l(t.defs,{groups:null,groupBuckets:null,batchResort:!0});const e=t.getters,i=t.setters;e.groups=function(){return[].concat(this.groups)},i.groups=function(t){this.groups.length=0,this.addGroups(t)},t.sortGroups=function(){if(this.batchResort){this.batchResort=!1;const{groups:t,groupBuckets:e}=this,i=$c();let n,s,r,o,a,l;for(n=0,s=t.length;n{t.substring?ql(e,t):v[t]&&ql(e,t.name)}),this),this.batchResort=!0,this},t.removeGroups=function(...t){const e=this.groups;return t.forEach((t=>{t.substring?Ql(e,t):v[t]&&Ql(e,t.name)}),this),this.batchResort=!0,this},t.cascadeAction=function(t,e){let i;return this.groups.forEach((n=>{i=v[n],i&&i[e](t)}),this),this},t.updateArtefacts=function(t){return this.cascadeAction(t,"updateArtefacts"),this},t.setArtefacts=function(t){return this.cascadeAction(t,"setArtefacts"),this},t.addArtefactClasses=function(t){return this.cascadeAction(t,"addArtefactClasses"),this},t.removeArtefactClasses=function(t){return this.cascadeAction(t,"removeArtefactClasses"),this},t.updateByDelta=function(){return this.cascadeAction(!1,dl),this},t.reverseByDelta=function(){return this.cascadeAction(!1,ro),this},t.getArtefactAt=function(t){if(t=ec(t,this.here,!1)){let e,i;for(let n=this.groups.length-1;n>=0;n--)if(e=v[this.groups[n]],e&&(i=e.getArtefactAt(t),i))return i}return!1},t.getAllArtefactsAt=function(t){const e=[];if(t=ec(t,this.here,!1)){let i,n;for(let s=this.groups.length-1;s>=0;s--)i=v[this.groups[s]],i&&(n=i.getAllArtefactsAt(t),n&&e.push(...n))}return e}}function Hd(t=Ml){const e={repeat:"repeat",patternMatrix:null};t.defs=_l(t.defs,e);const i=t.setters,n=t.getters;i.repeat=function(t){hs.includes(t)?this.repeat=t:this.repeat=this.defs.repeat},t.checkMatrixExists=function(){this.patternMatrix||(this.patternMatrix=new DOMMatrix)},t.updateMatrixNumber=function(t,e){this.checkMatrixExists(),t=t.substring?parseFloat(t):t;const i=cs.includes(e);Wl(t)&&i&&(this.patternMatrix[e]=t)},i.matrixA=function(t){this.updateMatrixNumber(t,zt)},i.matrixB=function(t){this.updateMatrixNumber(t,Nt)},i.matrixC=function(t){this.updateMatrixNumber(t,Vt)},i.matrixD=function(t){this.updateMatrixNumber(t,Wt)},i.matrixE=function(t){this.updateMatrixNumber(t,Ut)},i.matrixF=function(t){this.updateMatrixNumber(t,Zt)},i.stretchX=function(t){this.updateMatrixNumber(t,zt)},i.skewY=function(t){this.updateMatrixNumber(t,Nt)},i.skewX=function(t){this.updateMatrixNumber(t,Vt)},i.stretchY=function(t){this.updateMatrixNumber(t,Wt)},i.shiftX=function(t){this.updateMatrixNumber(t,Ut)},i.shiftY=function(t){this.updateMatrixNumber(t,Zt)},t.retrieveMatrixNumber=function(t){return this.checkMatrixExists(),this.patternMatrix[t]},n.matrixA=function(){return this.retrieveMatrixNumber(zt)},n.matrixB=function(){return this.retrieveMatrixNumber(Nt)},n.matrixC=function(){return this.retrieveMatrixNumber(Vt)},n.matrixD=function(){return this.retrieveMatrixNumber(Wt)},n.matrixE=function(){return this.retrieveMatrixNumber(Ut)},n.matrixF=function(){return this.retrieveMatrixNumber(Zt)},n.stretchX=function(){return this.retrieveMatrixNumber(zt)},n.skewY=function(){return this.retrieveMatrixNumber(Nt)},n.skewX=function(){return this.retrieveMatrixNumber(Vt)},n.stretchY=function(){return this.retrieveMatrixNumber(Wt)},n.shiftX=function(){return this.retrieveMatrixNumber(Ut)},n.shiftY=function(){return this.retrieveMatrixNumber(Zt)},i.patternMatrix=function(t){if(gt(t)){const e=this.updateMatrixNumber;e(t[0],zt),e(t[1],Nt),e(t[2],Vt),e(t[3],Wt),e(t[4],Ut),e(t[5],Zt)}},t.buildStyle=function(t){if(t){t.substring&&(t=d[t]);let e=this.source,i=this.sourceLoaded;const n=this.repeat,s=t.engine;if(this.type!==Ko&&this.type!==ca||(e=this.element,i=!0),s&&i){const t=s.createPattern(e,n);return t.setTransform(this.patternMatrix),t}}return Ee}}Q.Button=Button;const Cell=function(t=Ml){this.makeName(t.name),this.register(),this.initializePositions(),this.initializeCascade(),this.modifyConstructorInputForAnchorButton(t);let e=t.element;return delete t.element,zl(e)||(e=document.createElement(Ne),e.id=this.name,e.width=300,e.height=150),this.set(this.defs),this.set(t),this.installElement(e,t.canvasColorSpace),this.state.setStateFromEngine(this.engine),md({name:this.name,host:this.name}),this.subscribers=[],this.sourceNaturalDimensions=Au(),this.dirtyDimensionsOverride=!0,this.sourceLoaded=!0,this.here={},this},Ed=Cell.prototype=sc();Ed.type=Ko,Ed.lib="cell",Ed.isArtefact=!1,Ed.isAsset=!0,ih(Ed),hu(Ed),td(Ed),yd(Ed),bd(Ed),Sd(Ed),kd(Ed),Ad(Ed),vd(Ed),wd(Ed),Rd(Ed),Td(Ed),Hd(Ed),dd(Ed);const Id={cleared:!0,compiled:!0,shown:!0,compileOrder:0,showOrder:0,backgroundColor:wl,clearAlpha:0,alpha:1,composite:xo,scale:1,flipReverse:!1,flipUpend:!1,filter:Is,isBase:!1,controller:null,includeInCascadeEventActions:!1,willReadFrequently:!0,setRelativeDimensionsUsingBase:!1};Ed.defs=_l(Ed.defs,Id),delete Ed.defs.source,delete Ed.defs.sourceLoaded,Ed.stringifyFunction=Il,Ed.processPacketOut=Il,Ed.finalizePacketOut=Il,Ed.saveAsPacket=function(){return`[${this.name}, ${this.type}, ${this.lib}, {}]`},Ed.clone=Ll,Ed.factoryKill=function(){const t=this.name;$t(h).forEach((e=>{e.cells.includes(t)&&e.removeCell(t),e.base&&e.base.name===t&&e.set({visibility:!1})})),$t(o).forEach((e=>{if(e.name!==t){const i=e.state;if(i){const e=i.fillStyle,n=i.strokeStyle;e.name&&e.name===t&&(i.fillStyle=i.defs.fillStyle),n.name&&n.name===t&&(i.strokeStyle=i.defs.strokeStyle)}}})),v[t]&&v[t].kill()};const Bd=Ed.getters,Ld=Ed.setters,$d=Ed.deltaSetters;Ed.get=function(t){const e=this.getters[t];if(e)return e.call(this);{let e,i=this.defs[t];const n=this.state;return null!=i?(e=this[t],null!=e?e:i):(i=n.defs[t],null!=i?(e=n[t],null!=e?e:i):void 0)}},Bd.width=function(){return this.currentDimensions[0]||this.element.getAttribute(Sl)},Ld.width=function(t){null!=t&&(this.dimensions[0]=t,this.dirtyDimensions=!0,this.dirtyDimensionsOverride=!0)},Bd.height=function(){return this.currentDimensions[1]||this.element.getAttribute(vn)},Ld.height=function(t){null!=t&&(this.dimensions[1]=t,this.dirtyDimensions=!0,this.dirtyDimensionsOverride=!0)},Bd.dimensions=function(){return[this.currentDimensions[0]||this.element.getAttribute(Sl),this.currentDimensions[1]||this.element.getAttribute(vn)]},Ld.dimensions=function(t,e){this.setCoordinateHelper(Ci,t,e),this.dirtyDimensions=!0,this.dirtyDimensionsOverride=!0},Ld.source=function(){},Ld.engine=function(){},Ld.state=function(){},Ld.element=function(t){zl(t)&&this.installElement(t)},Ld.backgroundColor=function(t){Ja.includes(t)&&(t=wl),this.backgroundColor=t},Ld.cleared=function(t){this.cleared=t,this.updateControllerCells()},Ld.compiled=function(t){this.compiled=t,this.updateControllerCells()},Ld.shown=function(t){this.shown=t,this.updateControllerCells()},Ld.compileOrder=function(t){this.compileOrder=t,this.updateControllerCells()},Ld.showOrder=function(t){this.showOrder=t,this.updateControllerCells()},Ld.setRelativeDimensionsUsingBase=function(t){this.setRelativeDimensionsUsingBase=!!t,this.dirtyDimensions=!0},Ld.stashX=function(t){this.stashCoordinates||(this.stashCoordinates=[0,0]),this.stashCoordinates[0]=t},Ld.stashY=function(t){this.stashCoordinates||(this.stashCoordinates=[0,0]),this.stashCoordinates[1]=t},Ld.stashWidth=function(t){if(!this.stashDimensions){const t=this.currentDimensions;this.stashDimensions=[t[0],t[1]]}this.stashDimensions[0]=t},Ld.stashHeight=function(t){if(!this.stashDimensions){const t=this.currentDimensions;this.stashDimensions=[t[0],t[1]]}this.stashDimensions[1]=t},$d.stashX=function(t){this.stashCoordinates||(this.stashCoordinates=[0,0]);const e=this.stashCoordinates;e[0]=Fl(e[0],t)},$d.stashY=function(t){this.stashCoordinates||(this.stashCoordinates=[0,0]);const e=this.stashCoordinates;e[1]=Fl(e[1],t)},$d.stashWidth=function(t){if(!this.stashDimensions){const t=this.currentDimensions;this.stashDimensions=[t[0],t[1]]}const e=this.stashDimensions;e[0]=Fl(e[0],t)},$d.stashHeight=function(t){if(!this.stashDimensions){const t=this.currentDimensions;this.stashDimensions=[t[0],t[1]]}const e=this.stashDimensions;e[1]=Fl(e[1],t)},Ld.clearAlpha=function(t){t.toFixed&&(t>1?t=1:t<0&&(t=0),this.clearAlpha=t)},$d.clearAlpha=function(t){t.toFixed&&((t+=this.clearAlpha)>1?t=1:t<0&&(t=0),this.clearAlpha=t)},Ld.smoothFont=function(t){const{element:e}=this;if(e){const{style:i}=e;i&&(t?(i[yl]=xe,i[Cs]=xe,i[So]=xe):(i[yl]=Is,i[Cs]=mn,i[So]=Os))}},Ld.checkForEntityHover=function(t){v[this.name].set({checkForEntityHover:t})},Ld.onEntityHover=function(t){v[this.name].set({onEntityHover:t})},Ld.onEntityNoHover=function(t){v[this.name].set({onEntityNoHover:t})},Bd.group=function(){return v[this.name]},Ed.checkSource=function(t,e){this.currentDimensions[0]===t&&this.currentDimensions[1]===e||this.notifySubscribers()},Ed.getData=function(t,e){return this.checkSource(this.sourceNaturalDimensions[0],this.sourceNaturalDimensions[1]),this.buildStyle(e)},Ed.updateArtefacts=function(t=Ml){const e=this.groupBuckets;let i,n,s,r,o,a;for(s=0,r=e.length;s=1?e[n]=ut(o[n]*(t/100)):e[n]=1):mt(t)&&t>=1?e[n]=ut(t):e[n]=1}const[c,h]=e;t.width=c,t.height=h,this.setEngineFromState(this.engine),n&&s&&s.updateBaseHere(),this.groupBuckets&&this.updateArtefacts({dirtyDimensions:!0})}}}},Ed.notifySubscriber=function(t){t.sourceNaturalDimensions||(t.sourceNaturalDimensions=[]),t.sourceNaturalWidth=this.currentDimensions[0],t.sourceNaturalHeight=this.currentDimensions[1],t.sourceLoaded=!0,t.dirtyImage=!0,t.dirtyCopyStart=!0,t.dirtyCopyDimensions=!0},Ed.subscribeAction=function(t={}){this.subscribers.push(t),t.asset=this,t.source=this.element,this.notifySubscriber(t)},Ed.installElement=function(t,e=Fo){return this.element=t,this.engine=this.element.getContext(jt,{willReadFrequently:this.willReadFrequently,colorSpace:e}),this.state=_h({engine:this.engine}),this},Ed.updateControllerCells=function(){const t=this.getController();t&&(t.dirtyCells=!0)},Ed.getController=function(){const{controller:t,currentHost:e}=this;return t||(e?e.getHost():null)},Ed.getHost=function(){if(this.currentHost)return this.currentHost;if(this.host){const t=l[this.host]||o[this.host];return t&&(this.currentHost=t),!!t&&this.currentHost}return!1},Ed.updateBaseHere=function(t,e){if(this.isBase){this.here||(this.here={});const i=this.here,n=this.currentDimensions;let s=t.active;const r=t.localListener?t.originalWidth:t.w,o=t.localListener?t.originalHeight:t.h;if(n[0]!==r||n[1]!==o){this.basePaste||(this.basePaste=[]);const a=this.basePaste[0],l=n[0],c=n[1],h=r,u=o,d=t.x,f=t.y,p=l/h||1,g=c/u||1;let m,y;switch(i.w=l,i.h=c,e){case oi:case pi:a?(m=(h-l/g)/2,i.x=Ft((d-m)*g),i.y=Ft(f*g)):(y=(u-c/p)/2,i.x=Ft(d*p),i.y=Ft((f-y)*p));break;case zi:i.x=Ft(d*p),i.y=Ft(f*g);break;default:m=(h-l)/2,y=(u-c)/2,i.x=Ft(d-m),i.y=Ft(f-y)}(i.x<0||i.x>l)&&(s=!1),(i.y<0||i.y>c)&&(s=!1),i.active=s}else i.x=t.x,i.y=t.y,i.w=r,i.h=o,i.active=s;t.baseActive=s}},Ed.clear=function(){const{element:t,engine:e,backgroundColor:i,clearAlpha:n}=this;this.prepareStamp();const s=ut(t.width),r=ut(t.height);if(i)e.save(),e.fillStyle=i,e.globalCompositeOperation=xo,e.globalAlpha=1,e.fillRect(0,0,s,r),e.restore();else if(n){e.save();const i=gu(s,r),{engine:o,element:a}=i;o.drawImage(t,0,0,s,r,0,0,s,r),e.clearRect(0,0,s,r),e.globalAlpha=n,e.drawImage(a,0,0,s,r,0,0,s,r),e.restore(),mu(i)}else e.clearRect(0,0,s,r)},Ed.compile=function(){this.sortGroups(),this.cleared||this.prepareStamp(),!this.dirtyFilters&&this.currentFilters||this.cleanFilters();const t=this.groupBuckets,e=t.length;for(let i,n=0;ns?(p[0]=ut((i-d*s)/2),p[1]=0,p[2]=ut(d*s),p[3]=ut(f*s)):(p[0]=0,p[1]=ut((n-f*t)/2),p[2]=ut(d*t),p[3]=ut(f*t));break;case pi:t=i/(d||1),s=n/(f||1),t0&&(this.paste||(this.paste=[]),p=this.paste,this.noDeltaUpdates||this.setDelta(this.delta),this.cleared||this.compiled||this.prepareStamp(),e.globalCompositeOperation=r,e.globalAlpha=o,this.setImageSmoothing(e),p[0]=ut(-h[0]*s),p[1]=ut(-h[1]*s),p[2]=ut(d*s),p[3]=ut(f*s),this.rotateDestination(e,...u),e.drawImage(l,0,0,d,f,...p));e.restore()}},Ed.applyFilters=function(){const t=this.engine,e=t.getImageData(0,0,this.currentDimensions[0],this.currentDimensions[1]);this.preprocessFilters(this.currentFilters);const i=Ju.action({identifier:this.filterIdentifier,image:e,filters:this.currentFilters});i&&t.putImageData(i,0,0)},Ed.stashOutputAction=function(){if(this.stashOutput){this.stashOutput=!1;const{currentDimensions:t,stashCoordinates:e,stashDimensions:i,engine:n}=this,[s,r]=t;let o=e?e[0]:0,a=e?e[1]:0,l=i?i[0]:s,c=i?i[1]:r;if((l.substring||c.substring||o.substring||a.substring||o||a||l!==s||c!==r)&&(l.substring&&(l=parseFloat(l)/100*s),(!mt(l)||l<=0)&&(l=1),l>s&&(l=s),c.substring&&(c=parseFloat(c)/100*r),(!mt(c)||c<=0)&&(c=1),c>r&&(c=r),o.substring&&(o=parseFloat(o)/100*s),(!mt(o)||o<0)&&(o=0),o+l>s&&(o=s-l),a.substring&&(a=parseFloat(a)/100*r),(!mt(a)||a<0)&&(a=0),a+c>r&&(a=r-c)),n.save(),n.setTransform(1,0,0,1,0,0),this.stashedImageData=n.getImageData(o,a,l,c),n.restore(),this.stashOutputAsAsset){const t=this.stashOutputAsAsset.substring?this.stashOutputAsAsset:`${this.name}-image`;this.stashOutputAsAsset=!1;const e=gu(),i=e.element;if(i.width=l,i.height=c,e.engine.putImageData(this.stashedImageData,0,0),this.stashedImage)this.stashedImage.src=i.toDataURL();else{const e=this.getController();if(e){const n=this,s=document.createElement(En);s.id=t,s.alt=`A cached image of the ${this.name} Cell`,s.onload=function(){e.canvasHold.appendChild(s),n.stashedImage=s,ad(`#${t}`)},s.src=i.toDataURL()}}mu(e)}}},Ed.prepareStamp=function(){(this.dirtyScale||this.dirtyDimensions||this.dirtyStart||this.dirtyOffset||this.dirtyHandle)&&(this.dirtyPathObject=!0),this.dirtyScale&&this.cleanScale(),this.dirtyDimensions&&(this.cleanDimensions(),this.dirtyAssetSubscribers=!0),this.dirtyLock&&this.cleanLock(),this.dirtyStart&&this.cleanStart(),this.dirtyOffset&&this.cleanOffset(),this.dirtyHandle&&this.cleanHandle(),this.dirtyRotation&&this.cleanRotation(),(this.isBeingDragged||this.lockTo.includes(ms))&&(this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtyStampHandlePositions&&this.cleanStampHandlePositions(),this.dirtyPathObject&&this.cleanPathObject(),this.dirtyPositionSubscribers&&this.updatePositionSubscribers(),this.dirtyAssetSubscribers&&(this.dirtyAssetSubscribers=!1,this.notifySubscribers()),this.prepareStampTabsHelper()},Ed.cleanPathObject=function(){if(this.dirtyPathObject=!1,!this.noPathUpdates||!this.pathObject){const t=this.pathObject=new Path2D,e=this.currentStampHandlePosition,i=this.currentScale,n=this.currentDimensions,s=-e[0]*i,r=-e[1]*i,o=n[0]*i,a=n[1]*i;t.rect(s,r,o,a)}},Ed.updateHere=function(){const t=this.currentHost;if(t){this.here||(this.here={});const e=this.here,[i,n]=this.currentDimensions;e.w=i,e.h=n,e.x=-1e4,e.y=-1e4,e.active=!1;const s=t.here;if(s&&s.active){const{x:t,y:i}=s;this.pathObject&&!this.dirtyPathObject||this.cleanPathObject();const n=gu(),r=n.engine,[o,a]=this.currentStampPosition;n.rotateDestination(r,o,a,this);const l=r.isPointInPath(this.pathObject,t,i);if(mu(n),e.active=l,l){const[n,s]=this.currentStampHandlePosition,{flipUpend:r,flipReverse:l,scale:c}=this;let h=this.roll;if(c){let u=(t-o)/c,d=(i-a)/c;if(l&&(u=-u),r&&(d=-d),h){(l&&!r||!l&&r)&&(h=-h);const t=Su(u,d);t.rotate(-h),[u,d]=t,ku(t)}u+=n,d+=s,e.x=u,e.y=d}}}}};Q.Cell=Cell;const Md=t=>{const{canvasSupportsP3Color:e,displaySupportsP3Color:i}=oh;return t&&e&&i?wi:Fo},Vector=function(t,e,i){return this.x=0,this.y=0,this.z=0,Jl(t)&&this.set(t,e,i),this},Xd=Vector.prototype=sc();Xd.type=Pa,Xd.getXYCoordinate=function(){return[this.x,this.y]},Xd.getXYZCoordinate=function(){return[this.x,this.y,this.z]},Xd.setX=function(t){if(!Jl(t))throw new Error(`${this.name} Vector error - setX() arguments error: ${t}`);return this.x=t,this},Xd.setY=function(t){if(!Jl(t))throw new Error(`${this.name} Vector error - setY() arguments error: ${t}`);return this.y=t,this},Xd.setZ=function(t){if(!Jl(t))throw new Error(`${this.name} Vector error - setZ() arguments error: ${t}`);return this.z=t,this},Xd.setXY=function(t,e){if(!tc(t,e))throw new Error(`${this.name} Vector error - setXY() arguments error: ${t}, ${e}`);return this.x=t,this.y=e,this},Xd.set=function(t,e,i){return Ul(t)?this.setFromVector(t):gt(t)?this.setFromArray(t):tc(t,e)?this.setFromArray([t,e,i]):this},Xd.setFromArray=function(t){if(!gt(t))throw new Error(`${this.name} Vector error - setFromArray() arguments error: ${t}`);const[e,i,n]=t;return Wl(e)&&(this.x=e),Wl(i)&&(this.y=i),Wl(n)&&(this.z=n),this},Xd.setFromVector=function(t){if(!Ul(t))throw new Error(`${this.name} Vector error - setFromVector() arguments error: ${Bt(t)}`);const{x:e,y:i,z:n}=t;return Wl(e)&&(this.x=e),Wl(i)&&(this.y=i),Wl(n)&&(this.z=n),this},Xd.zero=function(){return this.x=0,this.y=0,this.z=0,this},Xd.vectorAdd=function(t=Ml){if(gt(t))return this.vectorAddArray(t);const{x:e,y:i,z:n}=t;return Wl(e)&&(this.x+=e),Wl(i)&&(this.y+=i),Wl(n)&&(this.z+=n),this},Xd.vectorAddArray=function(t=[]){const[e,i,n]=t;return Wl(e)&&(this.x+=e),Wl(i)&&(this.y+=i),Wl(n)&&(this.z+=n),this},Xd.vectorSubtract=function(t=Ml){if(gt(t))return this.vectorSubtractArray(t);const{x:e,y:i,z:n}=t;return Wl(e)&&(this.x-=e),Wl(i)&&(this.y-=i),Wl(n)&&(this.z-=n),this},Xd.vectorSubtractArray=function(t){const[e,i,n]=t;return Wl(e)&&(this.x-=e),Wl(i)&&(this.y-=i),Wl(n)&&(this.z-=n),this},Xd.scalarMultiply=function(t){if(!Wl(t))throw new Error(`${this.name} Vector error - scalarMultiply() argument not a number: ${t}`);return this.x*=t,this.y*=t,this.z*=t,this},Xd.vectorMultiply=function(t=Ml){if(gt(t))return this.vectorMultiplyArray(t);const{x:e,y:i,z:n}=t;return Wl(e)&&(this.x*=e),Wl(i)&&(this.y*=i),Wl(n)&&(this.z*=n),this},Xd.vectorMultiplyArray=function(t){const[e,i,n]=t;return Wl(e)&&(this.x*=e),Wl(i)&&(this.y*=i),Wl(n)&&(this.z*=n),this},Xd.scalarDivide=function(t){if(!Wl(t))throw new Error(`${this.name} Vector error - scalarDivide() argument not a number: ${t}`);if(!t)throw new Error(`${this.name} Vector error - scalarDivide() division by zero: ${t}`);return this.x/=t,this.y/=t,this.z/=t,this},Xd.getMagnitude=function(){return Et(this.x*this.x+this.y*this.y+this.z*this.z)},Xd.rotate=function(t){if(!Wl(t))throw new Error(`${this.name} Vector error - rotate() argument not a number: ${t}`);let e=nt(this.y,this.x);e+=.01745329251*t;const i=this.getMagnitude();return this.x=i*at(e),this.y=i*Ht(e),this},Xd.reverse=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},Xd.normalize=function(){const t=this.getMagnitude();return t>0&&(this.x/=t,this.y/=t,this.z/=t),this};const Yd=[],Gd=function(t,e,i){Yd.length||Yd.push(new Vector);const n=Yd.shift();return n.set(t,e,i),n},jd=function(...t){t.forEach((t=>{t&&t.type===Pa&&Yd.push(t.zero())}))},zd=function(t,e,i){return new Vector(t,e,i)};Q.Vector=Vector;const Quaternion=function(t=Ml){return this.n=t.n||1,this.v=zd(),Rt(this),this.set(t),this},Nd=Quaternion.prototype=sc();Nd.type=ma,Nd.set=function(t=Ml){if(Zl(t))return this.setFromQuaternion(t);if(ic(t.pitch,t.yaw,t.roll))return this.setFromEuler(t);const e=this.v,i=!(!Jl(t.vector)&&!Jl(t.v))&&(t.vector||t.v),n=!(!Jl(t.scalar)&&!Jl(t.n))&&(t.scalar||t.n||0),s=i?i.x||0:t.x||!1,r=i?i.y||0:t.y||!1,o=i?i.z||0:t.z||!1;return this.n=Wl(n)?n:this.n,e.x=Wl(s)?s:e.x,e.y=Wl(r)?r:e.y,e.z=Wl(o)?o:e.z,this},Nd.setFromQuaternion=function(t){if(!Zl(t))throw new Error(`${this.name} Quaternion error - setFromQuaternion() bad argument: ${t}`);const e=this.v,i=t.v;return this.n=t.n,e.x=i.x,e.y=i.y,e.z=i.z,this},Nd.setFromEuler=function(t=Ml){const e=this.v,i=(t.pitch||t.x||0)*Ot,n=(t.yaw||t.y||0)*Ot,s=(t.roll||t.z||0)*Ot,r=at(i/2),o=at(n/2),a=at(s/2),l=Ht(i/2),c=Ht(n/2),h=Ht(s/2);return e.x=l*o*a+r*c*h,e.y=r*c*a+l*o*h,e.z=r*o*h-l*c*a,this.n=r*o*a-l*c*h,this},Nd.zero=function(){const t=this.v;return this.n=1,t.x=0,t.y=0,t.z=0,this},Nd.getMagnitude=function(){const t=this.v;return Et(this.n*this.n+t.x*t.x+t.y*t.y+t.z*t.z)},Nd.normalize=function(){const t=this.getMagnitude(),e=this.v;if(!t)throw new Error(`${this.name} Quaternion error - normalize() division by zero: ${t}`);return this.n=El(this.n/t),e.x=El(e.x/t),e.y=El(e.y/t),e.z=El(e.z/t),this},Nd.quaternionMultiply=function(t){if(!Zl(t))throw new Error(`${this.name} Quaternion error - quaternionMultiply() bad argument: ${t}`);const e=this.v,i=t.v,n=this.n,s=e.x,r=e.y,o=e.z,a=t.n,l=i.x,c=i.y,h=i.z;return this.n=n*a-s*l-r*c-o*h,e.x=n*l+s*a+r*h-o*c,e.y=n*c+r*a+o*l-s*h,e.z=n*h+o*a+s*c-r*l,this},Nd.getAngle=function(t){let e;return t=!!Jl(t)&&t,e=2*et(this.n),t&&(e*=1/Ot),El(e)},Nd.quaternionRotate=function(t){if(!Zl(t))throw new Error(`${this.name} Quaternion error - quaternionRotate() bad argument: ${t}`);const e=Wd(t),i=Wd(this);return this.setFromQuaternion(e.quaternionMultiply(i)),Ud(e),Ud(i),this};const Vd=[],Wd=function(t){Vd.length||Vd.push(Zd());const e=Vd.shift();return e.set(t),e},Ud=function(...t){t.forEach((t=>{t&&t.type===ma&&Vd.push(t.zero())}))},Zd=function(t){return new Quaternion(t)};function _d(t=Ml){yd(t),bd(t),Sd(t),kd(t),Ad(t),vd(t),wd(t),Rd(t);const e={domElement:wl,pitch:0,yaw:0,offsetZ:0,css:null,classes:wl,position:se,smoothFont:!0,checkForResize:!1,trackHere:wl,activePadding:5,includeInTabNavigation:!1,moreContrastAction:null,otherContrastAction:null,reduceMotionAction:null,noPreferenceMotionAction:null,colorSchemeLightAction:null,colorSchemeDarkAction:null,reduceTransparencyAction:null,noPreferenceTransparencyAction:null,reduceDataAction:null,noPreferenceDataAction:null};t.defs=_l(t.defs,e),t.packetExclusions=ql(t.packetExclusions,["domElement","pathCorners","rotation"]),t.packetFunctions=ql(t.packetFunctions,["onEnter","onLeave","onDown","onUp"]),t.processDOMPacketOut=function(t,e,i){return this.processFactoryPacketOut(t,e,i)},t.processFactoryPacketOut=function(t,e,i){let n=!0;return i.includes(t)||e!==this.defs[t]||(n=!1),n},t.finalizePacketOut=function(t,e){if(Nl(this.domElement)){const e=this.domElement,i=e.cloneNode(!0);i.querySelectorAll(di).forEach((t=>i.removeChild(t))),t.outerHTML=i.outerHTML,t.host=e.parentElement.id}return t=this.handlePacketAnchor(t,e)},t.postCloneAction=function(t){return this.onEnter&&(t.onEnter=this.onEnter),this.onLeave&&(t.onLeave=this.onLeave),this.onDown&&(t.onDown=this.onDown),this.onUp&&(t.onUp=this.onUp),t};const i=t.setters,n=t.deltaSetters;i.trackHere=function(t){var e;Jl(t)&&(t?(ql(rh,this.name),"local"===t&&(Ul(e=this)&&(e.localMouseListener&&e.localMouseListener(),e.here||(e.here={}),e.here.originalWidth=e.currentDimensions[0],e.here.originalHeight=e.currentDimensions[1],e.localMouseListener=Zc(vs,(function(t){e.here&&(e.here.x=Ft(parseFloat(t.offsetX)),e.here.y=Ft(parseFloat(t.offsetY)))}),e.domElement)))):(Ql(rh,this.name),function(t){Ul(t)&&(t.localMouseListener&&t.localMouseListener(),t.localMouseListener=!1)}(this)),this.trackHere=t)},i.position=function(t){this.position=t,this.dirtyPosition=!0},i.smoothFont=function(t){this.smoothFont=t,this.dirtySmoothFont=!0},i.visibility=function(t){this.visibility=t,this.dirtyVisibility=!0},i.offsetZ=function(t){this.offsetZ=t,this.dirtyOffsetZ=!0},n.offsetZ=function(t){this.offsetZ+=t,this.dirtyOffsetZ=!0},i.roll=function(t){this.roll=Hl(t),this.dirtyRotation=!0},n.roll=function(t){this.roll=Hl(this.roll+t),this.dirtyRotation=!0},i.pitch=function(t){this.pitch=Hl(t),this.dirtyRotation=!0},n.pitch=function(t){this.pitch=Hl(this.pitch+t),this.dirtyRotation=!0},i.yaw=function(t){this.yaw=Hl(t),this.dirtyRotation=!0},n.yaw=function(t){this.yaw=Hl(this.yaw+t),this.dirtyRotation=!0},i.css=function(t){this.css=this.css?_l(this.css,t):t,this.dirtyCss=!0},i.classes=function(t){this.classes=t,this.dirtyClasses=!0},i.domAttributes=function(t){this.updateDomAttributes(t)},i.includeInTabNavigation=function(t){const e=this.domElement;e&&(this.includeInTabNavigation=t,t?e.setAttribute(Da,0):e.setAttribute(Da,-1))},t.updateDomAttributes=function(t,e){const i=this.domElement;return i&&(t.substring&&Jl(e)?Jl(e)&&e?i.setAttribute(t,e):i.removeAttribute(t):Ul(t)&&ct(t).forEach((([t,e])=>{Jl(e)&&e?i.setAttribute(t,e):i.removeAttribute(t)}))),this},t.initializeDomLayout=function(t){this.modifyConstructorInputForAnchorButton(t);const e=t.domElement;if(e){const i=e.style;if(i.boxSizing=Ye,t.setInitialDimensions){const n=e.getBoundingClientRect();this.currentDimensions[0]=n.width,this.currentDimensions[1]=n.height,t.width=n.width,t.height=n.height,e.className&&(t.classes=e.className);let s=!1;if(t&&t.host&&(s=t.host,s.substring&&o[s]&&(s=o[s])),s&&s.domElement){const e=s.domElement.getBoundingClientRect();e&&(t.startX=n.left-e.left,t.startY=n.top-e.top)}if(this.type===Aa){const e=parseFloat(i.perspective),{perspective:n,perspectiveX:s,perspectiveY:r,perspectiveZ:o}=t;tc(n,o)||(t.perspectiveZ=mt(e)?e:0);const a=i.perspectiveOrigin;if(a.length){const[e,i]=a.split(wo);tc(n,s)||(t.perspectiveX=e),tc(n,r)||(t.perspectiveY=i)}}}}},t.addClasses=function(t){if(t.substring){const e=`${this.classes} ${t}`.trim().replace(Qe,wo);e!==this.classes&&(this.classes=e,this.dirtyClasses=!0)}return this},t.removeClasses=function(t){if(t.substring){const e=t.split();let i,n=this.classes;e.forEach((t=>{i=new RegExp(" ?"+t+" ?"),n=n.replace(i,wo),n=n.trim(),n=n.replace(Qe,wo)})),n!==this.classes&&(this.classes=n,this.dirtyClasses=!0)}return this},t.addPathCorners=function(){const t=this.domElement;if(t&&!this.noUserInteraction&&!Ts.includes(t.tagName)){const e=function(){const t=document.createElement(Oi),e=t.style;return e.width=0,e.height=0,e.position=se,e.margin=0,e.border=0,e.padding=0,t.setAttribute("data-scrawl-corner-div","sc"),t.setAttribute(ke,tl),t},i=this.pathCorners,n=e(),s=e(),r=e(),o=e();n.style.top=Ws,n.style.left=Ws,s.style.top=Ws,s.style.left=Us,r.style.top=Us,r.style.left=Us,o.style.top=Us,o.style.left=Ws,t.appendChild(n),t.appendChild(s),t.appendChild(r),t.appendChild(o),i.push(n),i.push(s),i.push(r),i.push(o),this.currentCornersData||(this.currentCornersData=[])}return this},t.checkCornerPositions=function(t){const e=this.pathCorners;if(4===e.length){const i=this.getHere(),n=oh.scrollX-(i.offsetX||0),s=oh.scrollY-(i.offsetY||0),r=[];let o,a;const l=function(t){a=t[0],a?(r.push(Ft(a.left+n)),r.push(Ft(a.top+s))):r.push(0,0)};switch(t){case"topLeft":return o=e[0].getClientRects(),l(o),r;case"topRight":return o=e[1].getClientRects(),l(o),r;case"bottomRight":return o=e[2].getClientRects(),l(o),r;case"bottomLeft":return o=e[3].getClientRects(),l(o),r;default:return e.forEach((t=>{Nl(t)&&(o=t.getClientRects(),l(o))})),r}}},t.getCornerCoordinate=function(t){return ui.includes(t)?this.checkCornerPositions(t):[].concat(this.currentStampPosition)},t.cleanPathObject=function(){if(this.dirtyPathObject=!1,this.domElement&&!this.noUserInteraction)if(this.pathCorners.length||this.addPathCorners(),this.pathCorners.length){this.currentCornersData||(this.currentCornersData=[]);const t=this.currentCornersData;t.length=0,t.push(...this.checkCornerPositions());const e=this.pathObject=new Path2D;e.moveTo(t[0],t[1]),e.lineTo(t[2],t[3]),e.lineTo(t[4],t[5]),e.lineTo(t[6],t[7]),e.closePath()}else{const t=this.pathObject=new Path2D;t.moveTo(0,0),t.lineTo(10,0),t.lineTo(0,10),t.lineTo(-10,0),t.closePath()}},t.checkHit=function(t=[]){if(this.noUserInteraction)return!1;this.pathObject&&!this.dirtyPathObject||this.cleanPathObject();const e=gt(t)?t:[t],i=gu(),n=i.engine;let s,r;return e.some((t=>{if(gt(t))s=t[0],r=t[1];else{if(!tc(t,t.x,t.y))return!1;s=t.x,r=t.y}return!(!mt(s)||!mt(r))&&n.isPointInPath(this.pathObject,s,r)}),this)?(mu(i),{x:s,y:r,artefact:this}):(mu(i),!1)},t.cleanRotation=function(){this.dirtyRotation=!1,this.rotation&&Zl(this.rotation)||(this.rotation=Zd()),this.currentRotation&&Zl(this.rotation)||(this.currentRotation=Zd());const t=this.rotation;t.setFromEuler({pitch:this.pitch||0,yaw:this.yaw||0,roll:this.roll||0}),1!==t.getMagnitude()&&t.normalize();const e=Wd(),i=this.path,n=this.mimic,s=this.pivot,r=this.lockTo;i&&r.includes(Ns)?e.set(t):n&&this.useMimicRotation&&r.includes(fs)?Jl(n.currentRotation)?(e.set(n.currentRotation),this.addOwnRotationToMimic&&e.quaternionRotate(t)):this.dirtyMimicRotation=!0:(e.set(t),s&&this.addPivotRotation&&r.includes(Qs)&&(Jl(s.currentRotation)?e.quaternionRotate(s.currentRotation):this.dirtyPivotRotation=!0)),this.currentRotation.set(e),Ud(e),this.dirtyPositionSubscribers=!0,this.mimicked&&this.mimicked.length&&(this.dirtyMimicRotation=!0)},t.cleanOffsetZ=function(){this.dirtyOffsetZ=!1},t.cleanContent=function(){this.dirtyContent=!1,this.domElement&&(this.dirtyDimensions=!0)},t.cleanDisplayShape=Il,t.cleanDisplayArea=Il,t.prepareStamp=function(){(this.dirtyScale||this.dirtyDimensions||this.dirtyStart||this.dirtyOffset||this.dirtyHandle||this.dirtyRotation)&&(this.dirtyPathObject=!0),this.dirtyContent&&this.cleanContent(),this.dirtyScale&&this.cleanScale(),this.dirtyDimensions&&this.cleanDimensions(),this.dirtyDisplayArea&&this.cleanDisplayArea(),this.dirtyDisplayShape&&this.cleanDisplayShape(),this.dirtyLock&&this.cleanLock(),this.dirtyStart&&this.cleanStart(),this.dirtyOffset&&this.cleanOffset(),this.dirtyOffsetZ&&this.cleanOffsetZ(),this.dirtyHandle&&this.cleanHandle(),this.dirtyRotation&&this.cleanRotation(),(this.isBeingDragged||this.lockTo.includes(ms)||this.lockTo.includes(zs))&&(this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0),this.pivoted.length&&(this.dirtyStampPositions=!0),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtyStampHandlePositions&&this.cleanStampHandlePositions(),this.dirtyPathObject&&this.cleanPathObject(),this.prepareStampTabsHelper()},t.stamp=function(){if(!this.domElement)return!1;const[t,e]=this.currentStampPosition,[i,n]=this.currentStampHandlePosition,s=this.currentScale,r=this.currentRotation,o=`${i}px ${n}px 0`;let a=`translate(${t-i}px,${e-n}px)`;if(this.yaw||this.pitch||this.roll||this.pivot&&this.addPivotRotation||this.mimic&&this.useMimicRotation||this.path&&this.addPathRotation){const t=r.v;a+=` rotate3d(${t.x},${t.y},${t.z},${r.getAngle(!1)}rad)`}this.offsetZ&&(a+=` translateZ(${this.offsetZ}px)`),1!==s&&(a+=` scale(${s},${s})`),a!==this.currentTransformString&&(this.currentTransformString=a,this.dirtyTransform=!0),o!==this.currentTransformOriginString&&(this.currentTransformOriginString=o,this.dirtyTransformOrigin=!0),(this.dirtyTransform||this.dirtyPerspective||this.dirtyPosition||this.dirtyDomDimensions||this.dirtyTransformOrigin||this.dirtyVisibility||this.dirtySmoothFont||this.dirtyCss||this.dirtyClasses||this.domShowRequired)&&(this.domShowRequired=!1,function(t=wl){t&&t.substring&&ql(Lh,t)}(this.name),((t=!0)=>{$h=t})(!0),hc(!0)),this.dirtyPositionSubscribers&&this.updatePositionSubscribers(),(this.dirtyMimicRotation||this.dirtyPivotRotation)&&(this.dirtyMimicRotation=!1,this.dirtyPivotRotation=!1,this.dirtyRotation=!0),this.dirtyMimicScale&&(this.dirtyMimicScale=!1,this.dirtyScale=!0)},t.initializeAccessibility=function(){this.reduceMotionAction=Il,this.noPreferenceMotionAction=Il,this.colorSchemeLightAction=Il,this.colorSchemeDarkAction=Il,this.reduceTransparencyAction=Il,this.noPreferenceTransparencyAction=Il,this.reduceDataAction=Il,this.noPreferenceDataAction=Il,this.moreContrastAction=Il,this.otherContrastAction=Il},i.moreContrastAction=function(t){Vl(t)&&(this.moreContrastAction=t)},t.setMoreContrastAction=function(t){Vl(t)&&(this.moreContrastAction=t)},i.otherContrastAction=function(t){Vl(t)&&(this.otherContrastAction=t)},t.setOtherContrastAction=function(t){Vl(t)&&(this.otherContrastAction=t)},t.contrastActions=function(){const t=this.here;if(Jl(t)){const e=t.prefersContrast;Jl(e)&&(e?this.moreContrastAction():this.otherContrastAction())}},i.reduceMotionAction=function(t){Vl(t)&&(this.reduceMotionAction=t)},t.setReduceMotionAction=function(t){Vl(t)&&(this.reduceMotionAction=t)},i.noPreferenceMotionAction=function(t){Vl(t)&&(this.noPreferenceMotionAction=t)},t.setNoPreferenceMotionAction=function(t){Vl(t)&&(this.noPreferenceMotionAction=t)},t.reducedMotionActions=function(){const t=this.here;if(Jl(t)){const e=t.prefersReducedMotion;Jl(e)&&(e?this.reduceMotionAction():this.noPreferenceMotionAction())}},i.colorSchemeLightAction=function(t){Vl(t)&&(this.colorSchemeLightAction=t)},t.setColorSchemeLightAction=function(t){Vl(t)&&(this.colorSchemeLightAction=t)},i.colorSchemeDarkAction=function(t){Vl(t)&&(this.colorSchemeDarkAction=t)},t.setColorSchemeDarkAction=function(t){Vl(t)&&(this.colorSchemeDarkAction=t)},t.colorSchemeActions=function(){const t=this.here;if(Jl(t)){const e=t.prefersDarkColorScheme;Jl(e)&&(e?this.colorSchemeDarkAction():this.colorSchemeLightAction())}},i.reduceTransparencyAction=function(t){Vl(t)&&(this.reduceTransparencyAction=t)},t.setReduceTransparencyAction=function(t){Vl(t)&&(this.reduceTransparencyAction=t)},i.noPreferenceTransparencyAction=function(t){Vl(t)&&(this.noPreferenceTransparencyAction=t)},t.setNoPreferenceTransparencyAction=function(t){Vl(t)&&(this.noPreferenceTransparencyAction=t)},t.reducedTransparencyActions=function(){const t=this.here;if(Jl(t)){const e=t.prefersReduceTransparency;Jl(e)&&(e?this.reduceTransparencyAction():this.noPreferenceTransparencyAction())}},i.reduceDataAction=function(t){Vl(t)&&(this.reduceDataAction=t)},t.setReduceDataAction=function(t){Vl(t)&&(this.reduceDataAction=t)},i.noPreferenceDataAction=function(t){Vl(t)&&(this.noPreferenceDataAction=t)},t.setNoPreferenceDataAction=function(t){Vl(t)&&(this.noPreferenceDataAction=t)},t.reducedDataActions=function(){const t=this.here;if(Jl(t)){const e=t.prefersReduceData;Jl(e)&&(e?this.reduceDataAction():this.noPreferenceDataAction())}},t.checkAccessibilityValues=function(){this.contrastActions(),this.reducedMotionActions(),this.colorSchemeActions(),this.reducedTransparencyActions(),this.reducedDataActions()},t.apply=function(){Ih(),this.prepareStamp(),this.stamp(),Mh(this.name),this.dirtyPathObject=!0,this.cleanPathObject()}}function Kd(t=Ml){t.defs=_l(t.defs,{breakToBanner:3,breakToLandscape:1.5,breakToPortrait:.65,breakToSkyscraper:.35,actionBannerShape:null,actionLandscapeShape:null,actionRectangleShape:null,actionPortraitShape:null,actionSkyscraperShape:null,breakToSmallest:2e4,breakToSmaller:8e4,breakToLarger:18e4,breakToLargest:32e4,actionSmallestArea:null,actionSmallerArea:null,actionRegularArea:null,actionLargerArea:null,actionLargestArea:null}),t.packetFunctions=ql(t.packetFunctions,["actionBannerShape","actionLandscapeShape","actionRectangleShape","actionPortraitShape","actionSkyscraperShape","actionSmallestArea","actionSmallerArea","actionRegularArea","actionLargerArea","actionLargestArea"]);const e=t.getters,i=t.setters;e.displayShape=function(){return this.currentDisplayShape},e.displayShapeBreakpoints=function(){return{breakToBanner:this.breakToBanner,breakToLandscape:this.breakToLandscape,breakToPortrait:this.breakToPortrait,breakToSkyscraper:this.breakToSkyscraper,breakToSmallest:this.breakToSmallest,breakToSmaller:this.breakToSmaller,breakToLarger:this.breakToLarger,breakToLargest:this.breakToLargest}},i.displayShapeBreakpoints=function(t=Ml){for(const[e,i]of ct(t))if(Wl(i))switch(e){case"breakToBanner":this.breakToBanner=i;break;case"breakToLandscape":this.breakToLandscape=i;break;case"breakToPortrait":this.breakToPortrait=i;break;case"breakToSkyscraper":this.breakToSkyscraper=i;break;case"breakToSmallest":this.breakToSmallest=i;break;case"breakToSmaller":this.breakToSmaller=i;break;case"breakToLarger":this.breakToLarger=i;break;case"breakToLargest":this.breakToLargest=i}this.dirtyDisplayShape=!0,this.dirtyDisplayArea=!0},t.setDisplayShapeBreakpoints=i.displayShapeBreakpoints,i.breakToBanner=function(t){Wl(t)&&(this.breakToBanner=t),this.dirtyDisplayShape=!0},i.breakToLandscape=function(t){Wl(t)&&(this.breakToLandscape=t),this.dirtyDisplayShape=!0},i.breakToPortrait=function(t){Wl(t)&&(this.breakToPortrait=t),this.dirtyDisplayShape=!0},i.breakToSkyscraper=function(t){Wl(t)&&(this.breakToSkyscraper=t),this.dirtyDisplayShape=!0},i.breakToSmallest=function(t){Wl(t)&&(this.breakToSmallest=t),this.dirtyDisplayArea=!0},i.breakToSmaller=function(t){Wl(t)&&(this.breakToSmaller=t),this.dirtyDisplayArea=!0},i.breakToLarger=function(t){Wl(t)&&(this.breakToLarger=t),this.dirtyDisplayArea=!0},i.breakToLargest=function(t){Wl(t)&&(this.breakToLargest=t),this.dirtyDisplayArea=!0},i.actionBannerShape=function(t){Vl(t)&&(this.actionBannerShape=t),this.dirtyDisplayShape=!0},t.setActionBannerShape=i.actionBannerShape,i.actionLandscapeShape=function(t){Vl(t)&&(this.actionLandscapeShape=t),this.dirtyDisplayShape=!0},t.setActionLandscapeShape=i.actionLandscapeShape,i.actionRectangleShape=function(t){Vl(t)&&(this.actionRectangleShape=t),this.dirtyDisplayShape=!0},t.setActionRectangleShape=i.actionRectangleShape,i.actionPortraitShape=function(t){Vl(t)&&(this.actionPortraitShape=t),this.dirtyDisplayShape=!0},t.setActionPortraitShape=i.actionPortraitShape,i.actionSkyscraperShape=function(t){Vl(t)&&(this.actionSkyscraperShape=t),this.dirtyDisplayShape=!0},t.setActionSkyscraperShape=i.actionSkyscraperShape,i.actionSmallestArea=function(t){Vl(t)&&(this.actionSmallestArea=t),this.dirtyDisplayArea=!0},t.setActionSmallestArea=i.actionSmallestArea,i.actionSmallerArea=function(t){Vl(t)&&(this.actionSmallerArea=t),this.dirtyDisplayArea=!0},t.setActionSmallerArea=i.actionSmallerArea,i.actionRegularArea=function(t){Vl(t)&&(this.actionRegularArea=t),this.dirtyDisplayArea=!0},t.setActionRegularArea=i.actionRegularArea,i.actionLargerArea=function(t){Vl(t)&&(this.actionLargerArea=t),this.dirtyDisplayArea=!0},t.setActionLargerArea=i.actionLargerArea,i.actionLargestArea=function(t){Vl(t)&&(this.actionLargestArea=t),this.dirtyDisplayArea=!0},t.setActionLargestArea=i.actionLargestArea,t.initializeDisplayShapeActions=function(){this.actionBannerShape=Il,this.actionLandscapeShape=Il,this.actionRectangleShape=Il,this.actionPortraitShape=Il,this.actionSkyscraperShape=Il,this.currentDisplayShape=wl,this.dirtyDisplayShape=!0,this.actionSmallestArea=Il,this.actionSmallerArea=Il,this.actionRegularArea=Il,this.actionLargerArea=Il,this.actionLargestArea=Il,this.currentDisplayArea=wl,this.dirtyDisplayArea=!0},t.cleanDisplayShape=function(){this.dirtyDisplayShape=!1;const[t,e]=this.currentDimensions;if(t>0&&e>0){const i=t/e,n=this.currentDisplayShape,s=this.breakToBanner,r=this.breakToLandscape,o=this.breakToPortrait,a=this.breakToSkyscraper;return i>s?n!==De&&(this.currentDisplayShape=De,this.actionBannerShape(),!0):i>r?n!==Un&&(this.currentDisplayShape=Un,this.actionLandscapeShape(),!0):i0&&e>0){const i=t*e,n=this.currentDisplayArea,s=this.breakToLargest,r=this.breakToLarger,o=this.breakToSmaller,a=this.breakToSmallest;return i>s?n!==_n&&(this.currentDisplayArea=_n,this.actionLargestArea(),!0):i>r?n!==Zn&&(this.currentDisplayArea=Zn,this.actionLargerArea(),!0):i{const i=parseInt(t.getAttribute(yi),10),n=parseInt(e.getAttribute(yi),10);return in?1:0})),t.forEach((t=>e.appendChild(t))),e.setAttribute(Se,"false")},qd.reorderTextElements=function(){this.dirtyTextTabOrder=!1;const t=[],e=this.textHold;for(e.setAttribute(Se,"true");e.firstChild;)t.push(e.removeChild(e.firstChild));t.sort(((t,e)=>{const i=parseInt(t.getAttribute(yi),10),n=parseInt(e.getAttribute(yi),10);return in?1:0})),t.forEach((t=>e.appendChild(t))),e.setAttribute(Se,"false")},qd.render=function(){this.clear(),this.compile(),this.show()},qd.cleanCells=function(){this.dirtyCells=!1;const t=$c(),e=$c(),i=$c(),{cells:n,cellBatchesClear:s,cellBatchesCompile:r,cellBatchesShow:o}=this;let a,l,c,h,u;for(h=0,u=n.length;he.appendChild(t))),this.dirtyContent=!0}},uf.content=function(t){const e=this.domElement;if(Nl(e)){const i=e.querySelectorAll(di);e.innerHTML=t,i.forEach((t=>e.appendChild(t))),this.dirtyContent=!0}},hf.cleanDimensionsAdditionalActions=function(){this.dirtyDomDimensions=!0},hf.addCanvas=function(t=Ml){if(this.canvas)return this.canvas;{const e=document.createElement(Ne),i=this.domElement;e.id=`${this.name}-canvas`;const n=i.getBoundingClientRect();i.parentNode.insertBefore(e,this.domElement);const s=nf({name:`${this.name}-canvas`,domElement:e,position:se,width:n.width,height:n.height,mimic:this.name,lockTo:fs,useMimicDimensions:!0,useMimicScale:!0,useMimicStart:!0,useMimicHandle:!0,useMimicOffset:!0,useMimicRotation:!0,addOwnDimensionsToMimic:!1,addOwnScaleToMimic:!1,addOwnStartToMimic:!1,addOwnHandleToMimic:!1,addOwnOffsetToMimic:!1,addOwnRotationToMimic:!1});return s.set(t),this.canvas=s,s}};const df=function(t){return!!t&&new Element(t)};Q.Element=Element;const Stack=function(t=Ml){this.makeName(t.name),this.register(),this.initializePositions(),this.initializeCascade(),this.dimensions[0]=300,this.dimensions[1]=150,this.pathCorners=[],this.css={},this.here={},this.perspective={x:Zs,y:Zs,z:0},this.dirtyPerspective=!0,this.initializeDomLayout(t);const e=md({name:this.name,host:this.name});this.addGroups(e.name),this.set(this.defs),this.initializeDisplayShapeActions(),this.initializeAccessibility(),this.set(t);const i=this.domElement;if(i){i.dataset.isResponsive&&(this.isResponsive=!0),i.getAttribute(gi)===co&&jh(this.name)}return this},ff=Stack.prototype=sc();ff.type=Aa,ff.lib="stack",ff.isArtefact=!0,ff.isAsset=!1,ih(ff),Td(ff),_d(ff),Kd(ff);const pf={position:to,perspective:null,trackHere:Vo,isResponsive:!1,containElementsInHeight:!1};ff.defs=_l(ff.defs,pf),ff.stringifyFunction=Il,ff.processPacketOut=Il,ff.finalizePacketOut=Il,ff.saveAsPacket=function(){return`[${this.name}, ${this.type}, ${this.lib}, {}]`},ff.clone=Ll,ff.factoryKill=function(){const t=this.name;zh(t),Ql(rh,t),v[t]&&v[t].kill(),$t(o).forEach((e=>{e.host===t&&e.kill()})),this.domElement.remove()};const gf=ff.getters,mf=ff.setters,yf=ff.deltaSetters;gf.perspectiveX=function(){return this.perspective.x},gf.perspectiveY=function(){return this.perspective.y},gf.perspectiveZ=function(){return this.perspective.z},mf.perspectiveX=function(t){this.perspective.x=t,this.dirtyPerspective=!0},mf.perspectiveY=function(t){this.perspective.y=t,this.dirtyPerspective=!0},mf.perspectiveZ=function(t){this.perspective.z=t,this.dirtyPerspective=!0},mf.perspective=function(t=Ml){this.perspective.x=Jl(t.x)?t.x:this.perspective.x,this.perspective.y=Jl(t.y)?t.y:this.perspective.y,this.perspective.z=Jl(t.z)?t.z:this.perspective.z,this.dirtyPerspective=!0},yf.perspectiveX=function(t){this.perspective.x=Fl(this.perspective.x,t),this.dirtyPerspective=!0},yf.perspectiveY=function(t){this.perspective.y=Fl(this.perspective.y,t),this.dirtyPerspective=!0},gf.group=function(){return v[this.name]},ff.updateArtefacts=function(t=Ml){this.groupBuckets.forEach((e=>{e.artefactCalculateBuckets.forEach((e=>{t.dirtyScale&&(e.dirtyScale=!0),t.dirtyDimensions&&(e.dirtyDimensions=!0),t.dirtyLock&&(e.dirtyLock=!0),t.dirtyStart&&(e.dirtyStart=!0),t.dirtyOffset&&(e.dirtyOffset=!0),t.dirtyHandle&&(e.dirtyHandle=!0),t.dirtyRotation&&(e.dirtyRotation=!0),t.dirtyPathObject&&(e.dirtyPathObject=!0)}))}))},ff.cleanDimensionsAdditionalActions=function(){this.groupBuckets&&this.updateArtefacts({dirtyDimensions:!0,dirtyPath:!0,dirtyStart:!0,dirtyHandle:!0}),this.dirtyDomDimensions=!0,this.dirtyPath=!0,this.dirtyStart=!0,this.dirtyHandle=!0,this.dirtyDisplayShape=!0,this.dirtyDisplayArea=!0},ff.cleanPerspective=function(){this.dirtyPerspective=!1;const t=this.perspective;this.domPerspectiveString=`perspective-origin: ${t.x} ${t.y}; perspective: ${t.z}px;`,this.domShowRequired=!0,this.groupBuckets&&this.updateArtefacts({dirtyHandle:!0,dirtyPathObject:!0})},ff.checkResponsive=function(){this.isResponsive&&this.trackHere&&(this.currentVportWidth||(this.currentVportWidth=oh.w),this.currentVportHeight||(this.currentVportHeight=oh.h),this.dirtyHeight&&this.containElementsInHeight&&(this.dirtyHeight=!1),this.currentVportWidth!==oh.w&&(this.currentVportWidth=oh.w,this.containElementsInHeight&&(this.dirtyHeight=!0)),this.currentVportHeight!==oh.h&&(this.currentVportHeight=oh.h))},ff.clear=function(){this.checkResponsive()},ff.compile=function(){this.sortGroups(),this.prepareStamp(),this.stamp(),this.groupBuckets.forEach((t=>t.stamp()))},ff.show=function(){Mh()},ff.render=function(){this.compile(),this.show()},ff.addExistingDomElements=function(t){if(Jl(t)){let e,i,n,s;const r=t.substring?document.querySelectorAll(t):[].concat(t);for(n=0,s=r.length;n{null!=t.getAttribute(mi)||zl(t)||"SCRIPT"==t.tagName?t.setAttribute(gi,e):(n=t.getBoundingClientRect(),s=ot(t),r=parseFloat(s.marginTop)+parseFloat(s.borderTopWidth)+parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)+parseFloat(s.borderBottomWidth)+parseFloat(s.marginBottom),a=a||n.top-i.top,o={name:t.id||t.getAttribute(ws),domElement:t,group:e,host:e,position:se,width:n.width,height:n.height,startX:n.left-i.left,startY:a,classes:t.className?t.className:wl},a+=r+n.height,df(o))}))},Af=function(t=Ml){let e,i,n,s,r,a=se;e=t.element&&t.element.substring?document.querySelector(t.element):Nl(t.element)?t.element:document.createElement(Oi),t.host&&t.host.substring?(i=document.querySelector(t.host),i||(i=document.body)):i=Nl(t.host)?t.host:Jl(e.parentElement)?e.parentElement:document.body,Jl(t.width)&&(e.style.width=t.width.toFixed?`${t.width}px`:t.width),Jl(t.height)&&(e.style.height=t.height.toFixed?`${t.height}px`:t.height),r=t.name||e.id||e.getAttribute(ws)||wl,r||(r=Yl()),e.id=r,e.setAttribute(mi,mi),i&&null!=i.getAttribute(mi)?(n=o[i.id],s=n?n.name:co):s=co,e.setAttribute(gi,s),s===co&&(a=to),e.parentElement&&i.id===e.parentElement.id||i.appendChild(e);const l=bf({name:r,domElement:e,group:s,host:s,position:a,setInitialDimensions:!0});return kf(e,r),Array.from(e.childNodes).forEach((t=>{var e;t.id&&(e=t.id,Yh.includes(e))&&zh(t.id)})),delete t.name,delete t.element,delete t.host,delete t.width,delete t.height,l.set(t),l},vf=function(t){const e=document.querySelector(`#${t}`),i=T[t];if(i){if(null!=e.dataset.scrawlGroup)return i;M(t)}if(e){return Sf(e)}},Cf=function(){!function(t="[data-scrawl-stack]"){document.querySelectorAll(t).forEach((t=>Sf(t)))}(),function(t="[data-scrawl-canvas]"){let e;document.querySelectorAll(t).forEach(((t,i)=>{e=sf(t),i||lf(e)}))}(),Vc(),Ih(),Ah(),hc(!0),Th()},Pf=function(t){return t.length?t:Nh()},xf=function(t,e){let i,n,s;for(i=0,n=t.length;i{const n=it({},t);n.name=`${n.name}_${i.name}`,n.target=i,e.push(new RenderAnimation(n))})),e}e=t.target&&t.target.substring?o[t.target]:t.target}else e={clear:wf,compile:Of,show:Df,checkAccessibilityValues:Il};this.makeName(t.name),this.order=Jl(t.order)?t.order:this.defs.order,this.onRun=t.onRun||Il,this.onHalt=t.onHalt||Il,this.onKill=t.onKill||Il,this.maxFrameRate=t.maxFrameRate||60,this.lastRun=0,this.chokedAnimation=!0,this.target=e,this.commence=t.commence||Il,this.afterClear=t.afterClear||Il,this.afterCompile=t.afterCompile||Il,this.afterShow=t.afterShow||Il,this.afterCreated=t.afterCreated||Il,this.error=t.error||Il,this.readyToInitialize=!0,this.fn=function(){this.noTarget?(this.commence(),this.afterClear(),this.afterCompile(),this.afterShow(),this.readyToInitialize&&(this.afterCreated(this),this.readyToInitialize=!1)):this.isRunning()&&(this.commence(),this.target.clear(),this.afterClear(),this.target.compile(),this.afterCompile(),this.target.show(),this.afterShow(),this.readyToInitialize&&(this.target.checkAccessibilityValues(),this.afterCreated(this),this.readyToInitialize=!1))},this.register();const i=t.observer||!1;return i&&setTimeout((()=>{jl(i)?this.observer=Uc(this,this.target):this.observer=Uc(this,this.target,i)}),0),t.delay||this.run(),this},Rf=RenderAnimation.prototype=sc();Rf.type=Sa,Rf.lib=ge,Rf.isArtefact=!1,Rf.isAsset=!1,ih(Rf);Rf.defs=_l(Rf.defs,{order:1,maxFrameRate:60,onRun:null,onHalt:null,onKill:null,commence:null,afterClear:null,afterCompile:null,afterShow:null,afterCreated:null,error:null,target:null}),Rf.stringifyFunction=Il,Rf.processPacketOut=Il,Rf.finalizePacketOut=Il,Rf.saveAsPacket=function(){return`[${this.name}, ${this.type}, ${this.lib}, {}]`},Rf.clone=Ll,Rf.kill=function(){return this.onKill(),jc(this.name),this.deregister(),!0},Rf.run=function(){return this.onRun(),Gc(this.name),this.target&&this.target.checkAccessibilityValues(),setTimeout((()=>Ec()),20),this},Rf.start=function(){return this.readyToInitialize=!0,this.run()},Rf.isRunning=function(){return zc(this.name)},Rf.halt=function(){return this.onHalt(),jc(this.name),this},Rf.updateOnce=function(){return this.isRunning()||(this.run(),setTimeout((()=>this.halt()),0)),this},Rf.updateHook=function(t="",e){switch(t){case"commence":this.commence=e||Il;break;case"afterClear":this.afterClear=e||Il;break;case"afterCompile":this.afterCompile=e||Il;break;case"afterShow":this.afterShow=e||Il;break;case"afterCreated":this.afterCreated=e||Il;break;case"error":this.error=e||Il}};const Tf=function(t){return!!t&&new RenderAnimation(t)};Q.RenderAnimation=RenderAnimation;const UnstackedElement=function(t){const e=t.id||t.name;return this.makeName(e),this.register(),t.setAttribute("data-scrawl-name",this.name),this.domElement=t,this.elementComputedStyles=ot(t),this.hostStyles={},this.canvasStartX=0,this.canvasStartY=0,this.canvasWidth=0,this.canvasHeight=0,this.canvasZIndex=0,this},Hf=UnstackedElement.prototype=sc();Hf.type="UnstackedElement",Hf.lib="unstackedelement",Hf.isArtefact=!1,Hf.isAsset=!1,ih(Hf);Hf.defs=_l(Hf.defs,{canvasOnTop:!1}),Hf.demolish=function(){return!0},Hf.addCanvas=function(t=Ml){if(!this.canvas){const e=document.createElement(Ne),i=this.domElement,n=i.style;"static"===n.position&&(n.position=to),e.id=`${this.name}-canvas`,i.prepend(e);const s=nf({name:`${this.name}-canvas`,domElement:e,position:se});return this.canvas=s,s.set(t),this.updateCanvas(),s}},Hf.checkElementStyleValues=function(){const t={},e=this.domElement,i=this.canvas;if(e&&i&&i.domElement){const n=this.hostStyles,s=this.elementComputedStyles,r=i.domElement;let{x:o,y:a,width:l,height:c}=e.getBoundingClientRect(),{x:h,y:u}=r.getBoundingClientRect(),{width:d,height:f}=s;const p=s.zIndex;let g,m,y,b,S;o=ut(o),a=ut(a),h=ut(h),u=ut(u),l=ut(l),c=ut(c),d=ut(parseFloat(d)),f=ut(parseFloat(f)),sl.forEach((e=>{switch(e){case Sl:g=St(d,l),this.canvasWidth!==g&&(this.canvasWidth=g,this.dirtyDimensions=!0);break;case vn:m=St(f,c),this.canvasHeight!==m&&(this.canvasHeight=m,this.dirtyDimensions=!0);break;case"zIndex":y=p===xe?0:parseInt(p,10),y=this.canvasOnTop?y+1:y-1,this.canvasZIndex!==y&&(this.canvasZIndex=y,this.dirtyZIndex=!0);break;default:b=n[e],S=s[e],Jl(b)&&b===S||(n[e]=S,t[e]=S)}}));const k=o-h,A=a-u;(k||A)&&(this.canvasStartX+=k,this.canvasStartY+=A,this.dirtyStart=!0)}return t},Hf.updateCanvas=function(){if(this.canvas&&this.canvas.domElement){const t=this.canvas,e=t.domElement.style,i=this.checkElementStyleValues();for(const[t,n]of ct(i))rl.includes(t)&&(e[t]=n);if(this.dirtyStart&&(this.dirtyStart=!1,t.set({startX:this.canvasStartX,startY:this.canvasStartY})),this.dirtyDimensions){this.dirtyDimensions=!1;const e=this.canvasWidth,i=this.canvasHeight;t.set({width:e,height:i}),t.dirtyDimensions=!0,t.base.set({width:e,height:i}),t.base.dirtyDimensions=!0,t.cleanDimensions(),t.base.cleanDimensions()}this.dirtyZIndex&&(this.dirtyZIndex=!1,e.zIndex=this.canvasZIndex)}};Q.UnstackedElement=UnstackedElement;const Ef=function(t){const e=!!Nl(t.domElement)&&t.domElement,i=Ul(t.animationHooks)?t.animationHooks:{},n=Ul(t.canvasSpecs)?t.canvasSpecs:{},s=Ul(t.observerSpecs)?t.observerSpecs:{},r=!jl(t.includeCanvas)||t.includeCanvas;return e&&e.id&&o[e.id]?If(e,n,i,s):Bf(e,n,i,s,r)},If=function(t,e,i,n){const s=o[t.id];if(!s)return!1;e.baseMatchesCanvasDimensions=!0,e.ignoreCanvasCssDimensions=!0,e.checkForResize=!0;const r=s.addCanvas(e);s.elementComputedStyles=ot(t),i.name=`${s.name}-animation`,i.target=r;const a=Tf(i),l=Uc(a,s,n);return{element:s,canvas:r,animation:a,demolish:()=>{l(),a.kill(),r.demolish(),s.demolish(!0)}}},Bf=function(t,e,i,n,s){if(!t||Es.includes(t.tagName))return{};const r=t.id;let o;var a;r&&$[r]?o=$[r]:o=!!(a=t)&&new UnstackedElement(a),e.baseMatchesCanvasDimensions=!0,e.checkForResize=!0;const l=!!s&&o.addCanvas(e);i.name=`${o.name}-animation`,l?(i.afterClear||(i.afterClear=()=>o.updateCanvas()),i.target=l):i.noTarget=!0;const c=Tf(i),h=Uc(c,o,n);return{element:o,canvas:l,animation:c,demolish:()=>{h(),c.kill(),l&&l.demolish(),o.demolish(!0)}}},Lf=t=>{if(t&&t.substring){let e;return!!Ra.some((i=>(e=J[i][t],e)))&&e}return!1};function $f(t=Ml){const e={order:1,ticker:wl,targets:null,time:0,action:null,reverseOnCycleEnd:!1,reversed:!1};t.defs=_l(t.defs,e),t.kill=function(){const t=this.ticker;if(t===`${this.name}_ticker`){const e=s[t];e&&e.kill()}else t&&this.removeFromTicker(t);return this.deregister(),!0};const i=t.getters,n=t.setters;i.targets=function(){return[].concat(this.targets)},n.targets=function(t=[]){this.setTargets(t)},n.action=function(t){this.action=t,typeof this.action!==cn&&(this.action=Il)},t.calculateEffectiveTime=function(t){const[e,i]=Tl(ec(t,this.time));if(this.effectiveTime=0,e===Vs&&i<=100){if(this.ticker){const t=s[this.ticker];t&&(this.effectiveTime=t.effectiveDuration*(i/100))}}else this.effectiveTime=i;return this},t.addToTicker=function(t){if(Jl(t)){const e=this.ticker,i=s[t];e&&e!==t&&this.removeFromTicker(e),Jl(i)&&(this.ticker=t,i.subscribe(this.name),this.calculateEffectiveTime())}return this},t.removeFromTicker=function(t){if(t=Jl(t)?t:this.ticker){const e=s[t];Jl(e)&&(this.ticker=wl,e.unsubscribe(this.name))}return this},t.setTargets=function(t){t=[].concat(t);const e=$c();return t.forEach((t=>{if(Vl(t))Vl(t.set)&&e.push(t);else if(Ul(t)&&Jl(t.name))e.push(t);else{const i=Lf(t);i&&e.push(i)}})),this.targets||(this.targets=[]),this.targets.length=0,this.targets.push(...e),Mc(e),this},t.addToTargets=function(t){let e;return(t=[].concat(t)).forEach((t=>{typeof t===cn?typeof t.set===cn&&this.targets.push(t):(e=Lf(t),e&&this.targets.push(e))}),this),this},t.removeFromTargets=function(t){t=[].concat(t);const e=$c(),i=[].concat(this.targets);i.forEach((t=>{const i=t.type||al,n=t.name||ll;i!==al&&n!==ll&&e.push(`${i}_${n}`)})),t.forEach((t=>{let n;if(n=typeof t===cn?t:Lf(t),n){const t=n.type||al,s=n.name||ll;if(t!==al&&s!==ll){const n=`${t}_${s}`,r=e.indexOf(n);r>=0&&(i[r]=!1)}}})),this.targets||(this.targets=[]);const n=this.targets;return n.length=0,i.forEach((t=>{t&&n.push(t)}),this),this},t.checkForTarget=function(t){return!!t.substring&&this.targets.some((e=>e.name===t))},t.run=Il,t.isRunning=Il,t.halt=Il,t.reverse=Il,t.resume=Il,t.seekTo=Il,t.seekFor=Il}const Action=function(t=Ml){return this.makeName(t.name),this.register(),this.set(this.defs),this.action=Il,this.revert=Il,this.set(t),this.calculateEffectiveTime(),Jl(t.ticker)&&this.addToTicker(t.ticker),this},Mf=Action.prototype=sc();Mf.type="Action",Mf.lib=el,Mf.isArtefact=!1,Mf.isAsset=!1,ih(Mf),$f(Mf);Mf.defs=_l(Mf.defs,{revert:null}),Mf.packetExclusions=ql(Mf.packetExclusions,["targets"]),Mf.packetFunctions=ql(Mf.packetFunctions,["revert","action"]),Mf.finalizePacketOut=function(t){return gt(this.targets)&&(t.targets=this.targets.map((t=>t.name))),t};const Xf=Mf.setters;Xf.revert=function(t){this.revert=t,typeof this.revert!==cn&&(this.revert=Il)},Xf.triggered=function(t){this.triggered!==t&&(t?this.action():this.revert(),this.triggered=t)},Mf.set=function(t=Ml){const e=bt(t),i=e.length;if(i){const n=this.setters,s=this.defs;let r,o,a,l;for(o=0;o=r?o||(this.action(),this.triggered=!0):o&&(this.revert(),this.triggered=!1):e>=r?o||(this.action(),this.triggered=!0):o&&(this.revert(),this.triggered=!1),n&&(this.triggered=!this.triggered),!0};const Yf=function(t){return!!t&&new Action(t)};function Gf(t=Ml){yd(t),bd(t),Sd(t),kd(t),Ad(t),vd(t),wd(t),Rd(t),dd(t);const e={method:zi,pathObject:null,winding:Bs,flipReverse:!1,flipUpend:!1,scaleOutline:!0,lockFillStyleToEntity:!1,lockStrokeStyleToEntity:!1,onEnter:null,onLeave:null,onDown:null,onUp:null};t.defs=_l(t.defs,e),t.packetExclusions=ql(t.packetExclusions,["state"]),t.packetFunctions=ql(t.packetFunctions,["onEnter","onLeave","onDown","onUp"]),t.processEntityPacketOut=function(t,e,i){return this.processFactoryPacketOut(t,e,i)},t.processFactoryPacketOut=function(t,e,i){let n=!0;return i.indexOf(t)||e!==this.defs[t]||(n=!1),n},t.finalizePacketOut=function(t,e){const i=vt(this.state.saveAsPacket(e))[3];return t=_l(t,i),t=this.handlePacketAnchor(t,e)},t.postCloneAction=function(t,e){return this.onEnter&&(t.onEnter=this.onEnter),this.onLeave&&(t.onLeave=this.onLeave),this.onDown&&(t.onDown=this.onDown),this.onUp&&(t.onUp=this.onUp),e.sharedState&&(t.state=this.state),e.anchor&&(e.anchor.host=t,Jl(e.anchor.focusAction)||(e.anchor.focusAction=this.anchor.focusAction),Jl(e.anchor.blurAction)||(e.anchor.blurAction=this.anchor.blurAction),t.buildAnchor(e.anchor),e.anchor.clickAction||(t.anchor.clickAction=this.anchor.clickAction)),t};const i=t.getters,n=t.setters;i.group=function(){return this.group?this.group.name:wl},n.lockStylesToEntity=function(t){this.lockFillStyleToEntity=t,this.lockStrokeStyleToEntity=t},t.get=function(t){const e=this.getters[t];if(e)return e.call(this);{const e=this.state;let i,n=this.defs[t];return null!=n?(i=this[t],typeof i!==ol?i:n):(n=e.defs[t],null!=n?(i=e[t],typeof i!==ol?i:n):null)}},t.set=function(t=Ml){const e=bt(t),i=e.length;if(i){const n=this.setters,s=this.defs,r=this.state,o=r?r.setters:Ml,a=r?r.defs:Ml;let l,c,h,u;for(c=0;cs&&(h=s),lr&&(u=r),c=1)return.9999;const e=this.unitPositions;if(e&&e.length){const i=this.length,n=this.unitProgression,s=t*i;let r,o,a,l,c,h,u,d=-1;for(let t=0,e=n.length;t{const o=$c(),a=$c(),l=$c(),c=$c(),h=r.units,u=r.unitLengths,d=r.unitPartials,f=r.unitProgression,p=r.unitPositions,g=t.match(/([A-Za-z][0-9. ,-]*)/g),m=/(-?[0-9.]+\b)/g;let y,b,S,k,A,v=wl,C=wl,P=0,x=0,w=0,O=0,D=0,F=0,R=0;const T=t=>{a.push({c:v.toLowerCase(),p:t||null,x:O,y:D,cx:x,cy:w,rx:F,ry:R}),n||(l.push(x),c.push(w)),O=x,D=w};for(y=0,b=g.length;y0&&a[y-1],({c:n,p:r,x:o,y:g,cx:m,cy:S}=e),r)switch(n){case"h":h[y]=[es,o,g,r[0]+o,g];break;case"v":h[y]=[es,o,g,o,r[0]+g];break;case"m":h[y]=[vs,o,g];break;case"l":h[y]=[es,o,g,r[0]+o,r[1]+g];break;case"t":i&&(i.rx||i.ry)?(Wf(t,i.rx-m,i.ry-S),Uf(t,180),h[y]=[dr,o,g,t.x+m,t.y+S,r[0]+o,r[1]+g]):h[y]=[dr,o,g,o,g,r[0]+o,r[1]+g];break;case"q":h[y]=[dr,o,g,r[0]+o,r[1]+g,r[2]+o,r[3]+g];break;case"s":i&&(i.rx||i.ry)?(Wf(t,i.rx-m,i.ry-S),Uf(t,180),h[y]=[Re,o,g,t.x+m,t.y+S,r[0]+o,r[1]+g,r[2]+o,r[3]+g]):h[y]=[Re,o,g,o,g,r[0]+o,r[1]+g,r[2]+o,r[3]+g];break;case"c":h[y]=[Re,o,g,r[0]+o,r[1]+g,r[2]+o,r[3]+g,r[4]+o,r[5]+g];break;case"a":h[y]=[es,o,g,r[5]+o,r[6]+g];break;case"z":mt(o)||(o=0),mt(g)||(g=0),h[y]=[ii,o,g];break;default:mt(o)||(o=0),mt(g)||(g=0),h[y]=[al,o,g]}else h[y]=[`no-points-${n}`,o,g];for(y=0,b=h.length;yt+e),0);let k=0;for(y=0,b=u.length;y{t=o[e],t&&(t.currentPathData=!1,t.dirtyStart=!0,t.addPathHandle&&(t.dirtyHandle=!0),t.addPathOffset&&(t.dirtyOffset=!0),t.addPathRotation&&(t.dirtyRotation=!0),t.type===pa?t.dirtyPins=!0:t.type!==la&&t.type!==ga&&t.type!==Zo||t.dirtyPins.push(this.name))}),this)},t.draw=function(t){t.stroke(this.pathObject),this.showBoundingBox&&this.drawBoundingBox(t)},t.fill=function(t){t.fill(this.pathObject,this.winding),this.showBoundingBox&&this.drawBoundingBox(t)},t.drawAndFill=function(t){const e=this.pathObject;t.stroke(e),this.currentHost.clearShadow(),t.fill(e,this.winding),this.showBoundingBox&&this.drawBoundingBox(t)},t.fillAndDraw=function(t){const e=this.pathObject;t.stroke(e),this.currentHost.clearShadow(),t.fill(e,this.winding),t.stroke(e),this.showBoundingBox&&this.drawBoundingBox(t)},t.drawThenFill=function(t){const e=this.pathObject;t.stroke(e),t.fill(e,this.winding),this.showBoundingBox&&this.drawBoundingBox(t)},t.fillThenDraw=function(t){const e=this.pathObject;t.fill(e,this.winding),t.stroke(e),this.showBoundingBox&&this.drawBoundingBox(t)},t.clear=function(t){const e=t.globalCompositeOperation;t.globalCompositeOperation=Ai,t.fill(this.pathObject,this.winding),t.globalCompositeOperation=e,this.showBoundingBox&&this.drawBoundingBox(t)},t.drawBoundingBox=function(t){t.save(),t.strokeStyle=this.boundingBoxColor,t.lineWidth=1,t.globalCompositeOperation=xo,t.globalAlpha=1,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,t.strokeRect(...this.getBoundingBox()),t.restore()},t.getBoundingBox=function(){const t=this.minimumBoundingBoxDimensions;let[e,i,n,s]=this.localBox;const[r,o]=this.currentStampHandlePosition,[a,l]=this.currentStampPosition;return nt.substring?t.charAt(0).toUpperCase()+t.slice(1):wl;function Qf(t=Ml){const e={end:null,endPivot:wl,endPivotCorner:wl,endPivotIndex:-1,addEndPivotHandle:!1,addEndPivotOffset:!1,endPath:wl,endPathPosition:0,addEndPathHandle:!1,addEndPathOffset:!0,endParticle:wl,endLockTo:wl,useStartAsControlPoint:!1};t.defs=_l(t.defs,e),t.packetExclusions=ql(t.packetExclusions,["controlledLineOffset"]),t.packetCoordinates=ql(t.packetCoordinates,["end"]),t.packetObjects=ql(t.packetObjects,["endPivot","endPath"]),t.factoryKill=function(){$t(o).forEach((t=>{t.name!==this.name&&(t.startControlPivot&&t.startControlPivot.name===this.name&&t.set({startControlPivot:!1}),t.controlPivot&&t.controlPivot.name===this.name&&t.set({controlPivot:!1}),t.endControlPivot&&t.endControlPivot.name===this.name&&t.set({endControlPivot:!1}),t.endPivot&&t.endPivot.name===this.name&&t.set({endPivot:!1}),t.startControlPath&&t.startControlPath.name===this.name&&t.set({startControlPath:!1}),t.controlPath&&t.controlPath.name===this.name&&t.set({controlPath:!1}),t.endControlPath&&t.endControlPath.name===this.name&&t.set({endControlPath:!1}),t.endPath&&t.endPath.name===this.name&&t.set({endPath:!1}))}))};const i=t.getters,n=t.setters,s=t.deltaSetters;n.useStartAsControlPoint=function(t){if(this.useStartAsControlPoint=t,!t){const t=this.controlledLineOffset;t[0]=0,t[1]=0}this.updateDirty()},n.endPivot=function(t){this.setControlHelper(t,"endPivot",$i),this.updateDirty(),this.dirtyEnd=!0},n.endParticle=function(t){this.setControlHelper(t,"endParticle",$i),this.updateDirty(),this.dirtyEnd=!0},n.endPath=function(t){this.setControlHelper(t,"endPath",$i),this.updateDirty(),this.dirtyEnd=!0},n.endPathPosition=function(t){this.endPathPosition=t,this.dirtyEnd=!0,this.currentEndPathData=!1,this.dirtyFilterIdentifier=!0},s.endPathPosition=function(t){this.endPathPosition+=t,this.dirtyEnd=!0,this.currentEndPathData=!1,this.dirtyFilterIdentifier=!0},i.endPositionX=function(){return this.currentEnd[0]},i.endPositionY=function(){return this.currentEnd[1]},i.endPosition=function(){return[].concat(this.currentEnd)},n.endX=function(t){null!=t&&(this.end[0]=t,this.updateDirty(),this.dirtyEnd=!0,this.currentEndPathData=!1)},n.endY=function(t){null!=t&&(this.end[1]=t,this.updateDirty(),this.dirtyEnd=!0,this.currentEndPathData=!1)},n.end=function(t,e){this.setCoordinateHelper($i,t,e),this.updateDirty(),this.dirtyEnd=!0,this.currentEndPathData=!1},s.endX=function(t){const e=this.end;e[0]=Fl(e[0],t),this.updateDirty(),this.dirtyEnd=!0,this.currentEndPathData=!1},s.endY=function(t){const e=this.end;e[1]=Fl(e[1],t),this.updateDirty(),this.dirtyEnd=!0,this.currentEndPathData=!1},s.end=function(t,e){this.setDeltaCoordinateHelper($i,t,e),this.updateDirty(),this.dirtyEnd=!0,this.currentEndPathData=!1},n.endLockTo=function(t){this.endLockTo=t,this.updateDirty(),this.dirtyEndLock=!0,this.currentEndPathData=!1},t.curveInit=function(){this.end=Au(),this.currentEnd=Au(),this.endLockTo=li,this.dirtyEnd=!0,this.dirtyPins=[],this.controlledLineOffset=Au()},t.setControlHelper=function(t,e,i){if(jl(t)&&!t)this[e]=null,i===To?this.dirtyStartControlLock=!0:i===ai?this.dirtyControlLock=!0:i===Mi?this.dirtyEndControlLock=!0:this.dirtyEndLock=!0;else if(t){const n=this[e];let s=t.substring?o[t]:t;e.includes("Pivot")?s&&s.isArtefact&&(n&&n.isArtefact&&Ql(n.pivoted,this.name),ql(s.pivoted,this.name),this[e]=s):e.includes("Path")?s&&s.isArtefact&&(n&&n.isArtefact&&Ql(n.pathed,this.name),ql(s.pathed,this.name),this[e]=s):e.includes(ua)&&(s=t.substring?P[t]:t,s||(this.updateDirty(),i===To?this.dirtyStartControl=!0:i===ai?this.dirtyControl=!0:i===Mi?this.dirtyEndControl=!0:this.dirtyEnd=!0,this[e]=t))}},t.buildPathPositionObject=function(t,e){if(t){const[i,...n]=t;let s,r;switch(i){case es:s=this.positionPointOnPath(this.getLinearXY(e,...n)),r=this.getLinearAngle(e,...n);break;case dr:s=this.positionPointOnPath(this.getQuadraticXY(e,...n)),r=this.getQuadraticAngle(e,...n);break;case Re:s=this.positionPointOnPath(this.getBezierXY(e,...n)),r=this.getBezierAngle(e,...n)}let o=0;this.flipReverse&&o++,this.flipUpend&&o++,1===o&&(r=-r),r+=this.roll;const a=this.controlledLineOffset;return s.x+=a[0],s.y+=a[1],s.angle=r,s}return!1},t.prepareStamp=function(){this.dirtyHost&&(this.dirtyHost=!1),this.dirtyPins.length&&this.preparePinsForStamp(),this.dirtyLock&&this.cleanLock(),this.dirtyStartControlLock&&this.cleanControlLock(To),this.dirtyEndControlLock&&this.cleanControlLock(Mi),this.dirtyControlLock&&this.cleanControlLock(ai),this.dirtyEndLock&&this.cleanControlLock($i),(this.dirtyScale||this.dirtySpecies||this.dirtyDimensions||this.dirtyStart||this.dirtyStartControl||this.dirtyEndControl||this.dirtyControl||this.dirtyEnd||this.dirtyHandle)&&(this.dirtyPathObject=!0,this.useStartAsControlPoint&&this.dirtyStart&&(this.dirtySpecies=!0,this.pathCalculatedOnce=!1),(this.dirtyScale||this.dirtySpecies||this.dirtyStartControl||this.dirtyEndControl||this.dirtyControl||this.dirtyEnd)&&(this.pathCalculatedOnce=!1)),(this.isBeingDragged||this.lockTo.includes(ms)||this.lockTo.includes(zs))&&(this.dirtyStampPositions=!0,this.useStartAsControlPoint&&(this.dirtySpecies=!0,this.dirtyPathObject=!0,this.pathCalculatedOnce=!1)),this.dirtyScale&&this.cleanScale(),this.dirtyStart&&this.cleanStart(),(this.dirtyStartControl||this.startControlLockTo===zs)&&this.cleanControl(To),(this.dirtyEndControl||this.endControlLockTo===zs)&&this.cleanControl(Mi),(this.dirtyControl||this.controlLockTo===zs)&&this.cleanControl(ai),(this.dirtyEnd||this.endLockTo===zs)&&this.cleanControl($i),this.dirtyOffset&&this.cleanOffset(),this.dirtyRotation&&this.cleanRotation(),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtySpecies&&this.cleanSpecies(),this.dirtyPathObject&&this.cleanPathObject(),this.dirtyPositionSubscribers&&(this.updatePositionSubscribers(),this.updateControlPathSubscribers()),this.prepareStampTabsHelper()},t.cleanControlLock=function(t){const e=qf(t);this[`dirty${e}Lock`]=!1,this[`dirty${e}`]=!0},t.cleanControl=function(t){const e=qf(t);this[`dirty${e}`]=!1;let i,n,s=this[`${t}Pivot`],r=this[`${t}Path`],a=this[`${t}Particle`];s&&s.substring&&(i=o[s],i&&(s=i)),r&&r.substring&&(i=o[r],i&&(r=i)),a&&a.substring&&(i=P[a],i&&(a=i));let l,c,h,u,d,f,p,g=this[`${t}LockTo`];const m=this[t],y=this[`current${e}`];switch((g!==Qs||s&&!s.substring)&&(g!==Ns||r&&!r.substring)&&(g!==zs||a&&!a.substring)||(g=li),g){case Qs:if(this.pivotCorner&&s.getCornerCoordinate)[l,c]=s.getCornerCoordinate(this[`${t}PivotCorner`]);else if(s.type===ta)if(this[`${t}PivotIndex`]<0)s.layoutTemplate?[l,c]=s.layoutTemplate.currentStampPosition:this[`dirty${e}`]=!0;else{const i=s.getUnitStartAt(this[`${t}PivotIndex`]);i?[l,c]=i:this[`dirty${e}`]=!0}else[l,c]=s.currentStampPosition;this.addPivotOffset||([h,u]=s.currentOffset,l-=h,c-=u);break;case Ns:n=this.getControlPathData(r,t,e),l=n.x,c=n.y,this.addPathOffset||(l-=r.currentOffset[0],c-=r.currentOffset[1]);break;case zs:l=a.position.x,c=a.position.y,this.pathCalculatedOnce=!1;break;case ms:d=this.getHere(),l=d.x||0,c=d.y||0;break;default:l=c=0,f=this.getHost(),f&&(p=f.currentDimensions,p&&(this.cleanPosition(y,m,p),[l,c]=y))}y[0]=l,y[1]=c,this.dirtySpecies=!0,this.dirtyPathObject=!0,this.dirtyPositionSubscribers=!0},t.getControlPathData=function(t,e,i){const n=this[`current${i}PathData`];if(n)return n;let s=this[`${e}PathPosition`];const r=s,o=t.getPathPositionData(s);if(s<0&&(s+=1),s>1&&(s%=1),s=parseFloat(s.toFixed(6)),s!==r&&(this[`${e}PathPosition`]=s),o)return this[`current${i}PathData`]=o,o;{const t=this.getHost();if(t){const n=t.currentDimensions;if(n){const t=this[`current${i}`];return this.cleanPosition(t,this[e],n),{x:t[0],y:t[1]}}}return{x:0,y:0}}},t.updateControlPathSubscribers=function(){let t;[].concat(this.endSubscriber,this.endControlSubscriber,this.controlSubscriber,this.startControlSubscriber).forEach((e=>{t=o[e],t&&(t.type!==la&&t.type!==ga&&t.type!==Zo||(t.type===ga?(t.dirtyControl=!0,t.currentControlPathData=!1):t.type===Zo&&(t.dirtyStartControl=!0,t.dirtyEndControl=!0,t.currentStartControlPathData=!1,t.currentEndControlPathData=!1),t.currentEndPathData=!1,t.dirtyEnd=!0),t.currentPathData=!1,t.dirtyStart=!0)}))}}const Bezier=function(t=Ml){return this.startControl=Au(),this.endControl=Au(),this.currentStartControl=Au(),this.currentEndControl=Au(),this.startControlLockTo=li,this.endControlLockTo=li,this.curveInit(t),this.shapeInit(t),this.dirtyStartControl=!0,this.dirtyEndControl=!0,this},Jf=Bezier.prototype=sc();Jf.type=Zo,Jf.lib=Yi,Jf.isArtefact=!0,Jf.isAsset=!1,ih(Jf),Kf(Jf),Qf(Jf);const tp={startControl:null,startControlPivot:wl,startControlPivotIndex:-1,startControlPivotCorner:wl,addStartControlPivotHandle:!1,addStartControlPivotOffset:!1,startControlPath:wl,startControlPathPosition:0,addStartControlPathHandle:!1,addStartControlPathOffset:!0,startControlParticle:wl,endControl:null,endControlPivot:wl,endControlPivotIndex:-1,endControlPivotCorner:wl,addEndControlPivotHandle:!1,addEndControlPivotOffset:!1,endControlPath:wl,endControlPathPosition:0,addEndControlPathHandle:!1,addEndControlPathOffset:!0,endControlParticle:wl,startControlLockTo:wl,endControlLockTo:wl};Jf.defs=_l(Jf.defs,tp),Jf.packetCoordinates=ql(Jf.packetCoordinates,["startControl","endControl"]),Jf.packetObjects=ql(Jf.packetObjects,["startControlPivot","startControlParticle","startControlPath","endControlPivot","endControlParticle","endControlPath"]);const ep=Jf.getters,ip=Jf.setters,np=Jf.deltaSetters;ip.endControlPivot=function(t){this.setControlHelper(t,"endControlPivot",Mi),this.updateDirty(),this.dirtyEndControl=!0},ip.endControlParticle=function(t){this.setControlHelper(t,"endControlParticle",Mi),this.updateDirty(),this.dirtyEndControl=!0},ip.endControlPath=function(t){this.setControlHelper(t,"endControlPath",Mi),this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1},ip.endControlPathPosition=function(t){this.endControlPathPosition=t,this.dirtyEndControl=!0,this.currentEndControlPathData=!1,this.dirtyFilterIdentifier=!0},np.endControlPathPosition=function(t){this.endControlPathPosition+=t,this.dirtyEndControl=!0,this.currentEndControlPathData=!1,this.dirtyFilterIdentifier=!0},ip.startControlPivot=function(t){this.setControlHelper(t,"startControlPivot",To),this.updateDirty(),this.dirtyStartControl=!0},ip.startControlParticle=function(t){this.setControlHelper(t,"startControlParticle",To),this.updateDirty(),this.dirtyStartControl=!0},ip.startControlPath=function(t){this.setControlHelper(t,"startControlPath",To),this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1},ip.startControlPathPosition=function(t){this.startControlPathPosition=t,this.dirtyStartControl=!0,this.currentStartControlPathData=!1,this.dirtyFilterIdentifier=!0},np.startControlPathPosition=function(t){this.startControlPathPosition+=t,this.dirtyStartControl=!0,this.currentStartControlPathData=!1,this.dirtyFilterIdentifier=!0},ep.startControlPositionX=function(){return this.currentStartControl[0]},ep.startControlPositionY=function(){return this.currentStartControl[1]},ep.startControlPosition=function(){return[].concat(this.currentStartControl)},ip.startControlX=function(t){null!=t&&(this.startControl[0]=t,this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1)},ip.startControlY=function(t){null!=t&&(this.startControl[1]=t,this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1)},ip.startControl=function(t,e){this.setCoordinateHelper(To,t,e),this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1},np.startControlX=function(t){const e=this.startControl;e[0]=Fl(e[0],t),this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1},np.startControlY=function(t){const e=this.startControl;e[1]=Fl(e[1],t),this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1},np.startControl=function(t,e){this.setDeltaCoordinateHelper(To,t,e),this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1},ep.endControlPositionX=function(){return this.currentEndControl[0]},ep.endControlPositionY=function(){return this.currentEndControl[1]},ep.endControlPosition=function(){return[].concat(this.currentEndControl)},ip.endControlX=function(t){null!=t&&(this.endControl[0]=t,this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1)},ip.endControlY=function(t){null!=t&&(this.endControl[1]=t,this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1)},ip.endControl=function(t,e){this.setCoordinateHelper(Mi,t,e),this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1},np.endControlX=function(t){const e=this.endControl;e[0]=Fl(e[0],t),this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1},np.endControlY=function(t){const e=this.endControl;e[1]=Fl(e[1],t),this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1},np.endControl=function(t,e){this.setDeltaCoordinateHelper(Mi,t,e),this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1},ip.startControlLockTo=function(t){this.startControlLockTo=t,this.updateDirty(),this.dirtyStartControlLock=!0},ip.endControlLockTo=function(t){this.endControlLockTo=t,this.updateDirty(),this.dirtyEndControlLock=!0,this.currentEndControlPathData=!1},Jf.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeBezierPath()},Jf.makeBezierPath=function(){const[t,e]=this.currentStampPosition,[i,n]=this.currentStartControl,[s,r]=this.currentEndControl,[o,a]=this.currentEnd;return`m0,0c${(i-t).toFixed(2)},${(n-e).toFixed(2)} ${(s-t).toFixed(2)},${(r-e).toFixed(2)} ${(o-t).toFixed(2)},${(a-e).toFixed(2)}`},Jf.cleanDimensions=function(){this.dirtyDimensions=!1,this.dirtyHandle=!0,this.dirtyOffset=!0,this.dirtyStart=!0,this.dirtyStartControl=!0,this.dirtyEndControl=!0,this.dirtyEnd=!0,this.dirtyFilterIdentifier=!0},Jf.preparePinsForStamp=function(){const t=this.dirtyPins,e=this.endPivot,i=this.endPath,n=this.startControlPivot,s=this.startControlPath,r=this.endControlPivot,o=this.endControlPath;for(let a,l=0,c=t.length;l{const[s,r]=t;s.toFixed&&r.substring&&(e.convert(r),i[`${s} `]=[...e[n]])})),this.colors=i,this.dirtyPalette=!0}},fp.easing=function(t){this.setEasingHelper(t)},fp.easingFunction=fp.easing,hp.setEasing=function(t){return this.setEasingHelper(t),this},hp.setEasingFunction=hp.setEasing,hp.setEasingHelper=function(t){Vl(t)?(this.easing=cn,this.easingFunction=t):t.substring&&nc[t]?(this.easing=t,this.easingFunction=Bl):(this.easing=es,this.easingFunction=Bl),this.dirtyPaletteData=!0},dp.colorSpace=function(){return this.getColorSpace()},fp.colorSpace=function(t){if(t.substring){const e=t.toUpperCase(),i=t.toLowerCase();if(Bn.includes(e)){const t=it({},this.colors),n=this.factory.colorSpace;this.factory.set({colorSpace:e});for(const[e,s]of ct(t)){const t=this.factory.buildColorString(...s,n);this.factory.setColor(t),this.colors[e].length=0,this.colors[e].push(...this.factory[i])}this.dirtyPalette=!0}}},dp.returnColorAs=function(){return this.getReturnColorAs()},fp.returnColorAs=function(t){this.factory.set({returnColorAs:t}),this.dirtyPalette=!0},fp.precision=function(t){t=parseInt(t,10),(!mt(t)||t<0)&&(t=0),t>50&&(t=50),this.precision=t,this.dirtyPaletteData=!0},fp.stops=Il,hp.getColorSpace=function(){return this.factory?this.factory.colorSpace:oo},hp.getReturnColorAs=function(){return this.factory?this.factory.returnColorAs:oo},hp.recalculateStopColors=function(){if(this.dirtyPalette){this.dirtyPalette=!1,this.dirtyPaletteData=!0;const{colors:t,stops:e,factory:i}=this;e.fill(Ee);const{colorSpace:n}=i,s=bt(t).map((t=>parseInt(t,10))).sort(((t,e)=>t-e));let r,o,a,l,c,h,u,d=s[0];const[f,p,g,m]=t[`${d} `];for(e[d]=i.returnColorFromValues(f,p,g,m),c=0,h=s.length-1;c=0&&t<1e3&&(i.convert(e),t+=wo,this.colors[t]=[...i[n]],this.dirtyPalette=!0)},hp.removeColor=function(t){Jl(t)&&(t=t.substring?parseInt(t,10):ut(t))>=0&&t<1e3&&(t+=wo,delete this.colors[t],this.dirtyPalette=!0)},hp.getStopData=function(t,e,i,n){if(!t)return Ee;const s=`${this.name}-data`,{stops:r}=this;if(this.dirtyPaletteData||!Jh[o]){this.dirtyPaletteData=!1,tc(e,i)||(e=0,i=999);const{easing:t,easingFunction:o,precision:a}=this,l=bt(this.colors).map((t=>parseInt(t,10))).sort(((t,e)=>t-e));let c,h,u,d,f,p,g=o;t!==cn&&nc[t]&&(g=nc[t]);const m=this.getColorSpace(),y=!(!a||t===es&&m===oo),b=[];if(e1?h-=1:h<0&&(h+=1)),h=g(h),h>0&&h<1&&b.push(h,r[u]);else for(u=0,d=l.length;ue&&f1?h-=1:h<0&&(h+=1)),h>0&&h<1&&b.push(h,r[f]));b.push(1,r[i])}else if(n){if(b.push(0,r[e]),p=999-e,c=p+i,y)for(u=0;u999&&(f-=1e3),h=g(u/c),h>0&&h<1&&b.push(h,r[f]);else for(u=0,d=l.length;ue)h=(f-e)/c;else if(0===f)h=(f+p+.01)/c;else{if(!(f1?h-=1:h<0&&(h+=1),h>0&&h<1&&b.push(h,r[f])}b.push(1,r[i])}else{if(b.push(0,r[e]),c=e-i,y)for(u=i+1;ui&&(h=g(1-(u-i)/c),h>0&&h<1&&b.push(h,r[u]));else for(u=0,d=l.length;ui&&(h=1-(f-i)/c,h>0&&h<1&&b.push(h,r[f]));b.push(1,r[i])}dt(b),ru(s,b)}var o;return e===i?r[e]||Ee:su(s)||Ee},hp.addStopsToGradient=function(t,e,i,n){this.recalculateStopColors();const s=this.getStopData(t,e,i,n);if(s.substring)return s;for(let e=0,i=s.length;e{const i=e.state;if(i){const e=i.fillStyle,n=i.strokeStyle;Ul(e)&&e.name===t&&(i.fillStyle=i.defs.fillStyle),Ul(n)&&n.name===t&&(i.strokeStyle=i.defs.strokeStyle)}})),this.deregister(),this};const e=t.getters,i=t.setters,n=t.deltaSetters;e.startX=function(){return this.currentStart[0]},e.startY=function(){return this.currentStart[1]},i.startX=function(t){null!=t&&(this.start[0]=t,this.dirtyStart=!0)},i.startY=function(t){null!=t&&(this.start[1]=t,this.dirtyStart=!0)},i.start=function(t,e){this.setCoordinateHelper(Ro,t,e),this.dirtyStart=!0},n.startX=function(t){const e=this.start;e[0]=Fl(e[0],t),this.dirtyStart=!0},n.startY=function(t){const e=this.start;e[1]=Fl(e[1],t),this.dirtyStart=!0},n.start=function(t,e){this.setDeltaCoordinateHelper(Ro,t,e),this.dirtyStart=!0},e.endX=function(){return this.currentEnd[0]},e.endY=function(){return this.currentEnd[1]},i.endX=function(t){null!=t&&(this.end[0]=t,this.dirtyEnd=!0)},i.endY=function(t){null!=t&&(this.end[1]=t,this.dirtyEnd=!0)},i.end=function(t,e){this.setCoordinateHelper($i,t,e),this.dirtyEnd=!0},n.endX=function(t){const e=this.end;e[0]=Fl(e[0],t),this.dirtyEnd=!0},n.endY=function(t){const e=this.end;e[1]=Fl(e[1],t),this.dirtyEnd=!0},n.end=function(t,e){this.setDeltaCoordinateHelper($i,t,e),this.dirtyEnd=!0},i.palette=function(t=Ml){t.type===ha&&(t.dirtyPalette=!0,this.palette=t)},i.paletteStart=function(t){t.toFixed&&this.palette&&(this.paletteStart=t,(t<0||t>999)&&(this.paletteStart=t>500?999:0),this.palette.updateData())},n.paletteStart=function(t){let e;t.toFixed&&this.palette&&(e=this.paletteStart+t,(e<0||e>999)&&(e=this.cyclePalette?e>500?e-1e3:e+1e3:t>500?999:0),this.paletteStart=e,this.palette.updateData())},i.paletteEnd=function(t){t.toFixed&&this.palette&&(this.paletteEnd=t,(t<0||t>999)&&(this.paletteEnd=t>500?999:0),this.palette.updateData())},n.paletteEnd=function(t){let e;t.toFixed&&this.palette&&(e=this.paletteEnd+t,(e<0||e>999)&&(e=this.cyclePalette?e>500?e-1e3:e+1e3:t>500?999:0),this.paletteEnd=e,this.palette.updateData())},i.cyclePalette=function(t){this.palette&&(this.cyclePalette=!!t,this.palette.updateData())},i.colors=function(t){gt(t)&&this.palette&&this.palette.set({colors:t})},i.easing=function(t){this.palette&&this.palette.set({easing:t})},i.easingFunction=i.easing,i.colorSpace=function(t){this.palette&&this.palette.set({colorSpace:t})},i.returnColorAs=function(t){this.palette&&this.palette.set({returnColorAs:t})},i.precision=function(t){this.palette&&this.palette.set({precision:t})},i.delta=function(t=Ml){t&&(this.delta=Kl(this.delta,t))},t.get=function(t){const e=this.getters[t],i=this.palette;if(e)return e.call(this);{let e,n=this.defs[t];return typeof n!==ol?(e=this[t],typeof e!==ol?e:n):(n=i.defs[t],typeof n!==ol?(e=i[t],typeof e!==ol?e:n):void 0)}},t.set=function(t=Ml){const e=bt(t),i=e.length;if(i){const n=this.setters,s=this.defs,r=this.palette;let o,a,l,c,h,u;for(r&&(o=r.setters||Ml,a=r.defs||Ml),c=0;c{L.forEach((t=>{const e=B[t];e&&e.animateByDelta&&e.updateByDelta()}))}});const ConicGradient=function(t=Ml){return this.stylesInit(t),this},gp=ConicGradient.prototype=sc();gp.type="ConicGradient",gp.lib=zo,gp.isArtefact=!1,gp.isAsset=!1,ih(gp),pp(gp);gp.defs=_l(gp.defs,{angle:0}),gp.packetObjects=ql(gp.packetObjects,["palette"]),gp.buildStyle=function(t){if(t){const e=t.engine;if(e){if(!e.createConicGradient)return Ee;const t=e.createConicGradient(...this.gradientArgs);return this.addStopsToGradient(t,this.paletteStart,this.paletteEnd,this.cyclePalette)}}return Ee},gp.updateGradientArgs=function(t,e){const i=this.gradientArgs,n=this.currentStart,s=this.angle*Ot,r=n[0]+t,o=n[1]+e;i.length=0,i.push(s,r,o)};const mp=function(t){return!!t&&new ConicGradient(t)};Q.ConicGradient=ConicGradient;const Crescent=function(t=Ml){return ic(t.dimensions,t.width,t.height,t.radius)||(t.radius=5),this.entityInit(t),this},yp=Crescent.prototype=sc();yp.type="Crescent",yp.lib=Yi,yp.isArtefact=!0,yp.isAsset=!1,ih(yp),Gf(yp);yp.defs=_l(yp.defs,{outerRadius:20,innerRadius:10,displacement:0,displayIntersect:!1});const bp=yp.setters,Sp=yp.deltaSetters;bp.outerRadius=function(t){null!=t&&(this.outerRadius=t,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0)},Sp.outerRadius=function(t){null!=t&&(this.outerRadius=Fl(this.outerRadius,t),this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0)},bp.innerRadius=function(t){null!=t&&(this.innerRadius=t,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0)},Sp.innerRadius=function(t){null!=t&&(this.innerRadius=Fl(this.innerRadius,t),this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0)},bp.width=bp.outerRadius,Sp.width=Sp.outerRadius,bp.height=bp.innerRadius,Sp.height=Sp.innerRadius,bp.displacement=function(t){if(null!=t&&t.toFixed&&t>=0){let e=t;e<0&&(e=0),this.displacement=e,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0}},Sp.displacement=function(t){if(null!=t&&t.toFixed){let e=Fl(this.displacement,t);e.toFixed&&e<0&&(e=0),this.displacement=e,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0}},bp.displayIntersect=function(t){this.displayIntersect=t,this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0},yp.cleanDimensionsAdditionalActions=function(){const{outerRadius:t,innerRadius:e,displacement:i}=this,n=this.getHost();let s;s=n?n.currentDimensions?n.currentDimensions:[n.w,n.h]:[300,150];const[r,o]=s;this.currentOuterRadius=t.substring?parseFloat(t)/100*r:t,this.currentInnerRadius=e.substring?parseFloat(e)/100*o:e,this.currentDisplacement=i.substring?parseFloat(i)/100*r:i,this.currentDimensions[0]=this.currentDimensions[1]=2*this.currentOuterRadius,this.dirtyPathObject=!0},yp.calculateInterception=function(){tc(this.currentOuterRadius,this.currentInnerRadius,this.currentDisplacement)||this.cleanDimensionsAdditionalActions();const{currentOuterRadius:t,currentInnerRadius:e,currentDisplacement:i}=this;this.outerCircleStart=0,this.outerCircleEnd=360*Ot,this.innerCircleStart=0,this.innerCircleEnd=360*Ot,this.drawOuterCircle=!1,this.drawDonut=!1;const n=t+e,s=t-e;if(!s&&!i)this.drawOuterCircle=!0;else if(i>=n)this.drawOuterCircle=!0;else if(is){const n=gu(),{engine:s,element:r}=n,o=Su();let a,l;for(r.width=r.width,s.fillStyle="black",s.save(),s.beginPath(),s.arc(0,0,t,0,2*Math.PI),o.setFromArray([e,0]),a=0;a<360&&(o.rotate(.5),!s.isPointInPath(o[0]+i,o[1]));a+=.5);for(s.restore(),s.save(),s.beginPath(),s.arc(i,0,e,0,2*Math.PI),o.setFromArray([t,0]),l=0;l<360&&(o.rotate(.5),s.isPointInPath(...o));l+=.5);s.restore(),this.outerCircleStart=-l*Ot,this.outerCircleEnd=l*Ot,this.innerCircleStart=a*Ot,this.innerCircleEnd=-a*Ot,ku(o),mu(n)}else this.drawDonut=!0},yp.cleanPathObject=function(){if(this.dirtyPathObject=!1,!this.noPathUpdates||!this.pathObject){this.calculateInterception();const{currentStampHandlePosition:t,currentScale:e,outerCircleStart:i,outerCircleEnd:n,innerCircleStart:s,innerCircleEnd:r,drawOuterCircle:o,displayIntersect:a}=this;let{currentOuterRadius:l,currentInnerRadius:c,currentDisplacement:h}=this;const u=this.pathObject=new Path2D;l*=e,c*=e,h*=e;const d=l-t[0]*e,f=l-t[1]*e;if(o)u.arc(d,f,l,i,n),u.closePath(),this.pathObjectOuter=!1,this.pathObjectInner=!1;else{const t=this.pathObjectOuter=new Path2D,e=this.pathObjectInner=new Path2D;a?u.arc(d,f,l,i,n):u.arc(d,f,l,i,n,!0),u.arc(d+h,f,c,s,r),u.closePath(),t.arc(d,f,l,i,n,!0),t.closePath(),e.arc(d+h,f,c,s,r),e.closePath()}}},yp.draw=function(t){this.drawDonut?(t.stroke(this.pathObjectOuter),t.stroke(this.pathObjectInner)):t.stroke(this.pathObject)},yp.fill=function(t){t.fill(this.pathObject,this.winding)},yp.drawAndFill=function(t){if(this.drawDonut){const e=this.pathObject,i=this.pathObjectOuter,n=this.pathObjectInner;t.stroke(i),t.stroke(n),t.fill(e,this.winding),this.currentHost.clearShadow(),t.stroke(i),t.stroke(n),t.fill(e,this.winding)}else{const e=this.pathObject;t.stroke(e),t.fill(e,this.winding),this.currentHost.clearShadow(),t.stroke(e),t.fill(e,this.winding)}},yp.fillAndDraw=function(t){if(this.drawDonut){const e=this.pathObject,i=this.pathObjectOuter,n=this.pathObjectInner;t.fill(e,this.winding),t.stroke(i),t.stroke(n),this.currentHost.clearShadow(),t.fill(e,this.winding),t.stroke(i),t.stroke(n)}else{const e=this.pathObject;t.fill(e,this.winding),t.stroke(e),this.currentHost.clearShadow(),t.fill(e,this.winding),t.stroke(e)}},yp.drawThenFill=function(t){if(this.drawDonut){const e=this.pathObject,i=this.pathObjectOuter,n=this.pathObjectInner;t.stroke(i),t.stroke(n),t.fill(e,this.winding)}else{const e=this.pathObject;t.stroke(e),t.fill(e,this.winding)}},yp.fillThenDraw=function(t){if(this.drawDonut){const e=this.pathObject,i=this.pathObjectOuter,n=this.pathObjectInner;t.fill(e,this.winding),t.stroke(i),t.stroke(n)}else{const e=this.pathObject;t.fill(e,this.winding),t.stroke(e)}},yp.clip=function(t){t.clip(this.pathObject,this.winding)},yp.clear=function(t){const e=t.globalCompositeOperation;t.globalCompositeOperation=Ai,t.fill(this.pathObject,this.winding),t.globalCompositeOperation=e};const kp=function(t){return!!t&&new Crescent(t)};Q.Crescent=Crescent;const ParticleHistory=function(){const t=Array(4).fill(0);return Tt(t,ParticleHistory.prototype),Rt(t)},Ap=ParticleHistory.prototype=lt(Array.prototype);Ap.constructor=ParticleHistory,Ap.type=da;const vp=[],Cp=function(...t){t.forEach((t=>{t&&t.type===da&&(t.fill(0),vp.push(t),vp.length>100&&(vp.length=0))}))};Q.ParticleHistory=ParticleHistory;const Particle=function(t=Ml){return this.makeName(t.name),this.register(),this.set(this.defs),this.initializePositions(),this.set(t),this},Pp=Particle.prototype=sc();Pp.type=ua,Pp.lib=zs,Pp.isArtefact=!1,Pp.isAsset=!1,ih(Pp);const xp={position:null,velocity:null,load:null,history:null,historyLength:1,engine:ji,forces:null,mass:1,fill:Te,stroke:Te};Pp.defs=_l(Pp.defs,xp),Pp.packetExclusionsByRegex=ql(Pp.packetExclusionsByRegex,["^(local|dirty|current)"]),Pp.packetObjects=ql(Pp.packetObjects,["position","velocity","acceleration"]),Pp.factoryKill=function(){this.history.forEach((t=>Cp(t)));const t=[];let e;D.forEach((i=>{e=O[i],(e.particleFrom&&e.particleFrom.name===this.name||e.particleTo&&e.particleTo.name===this.name)&&t.push(e)})),t.forEach((t=>t.kill()))};const wp=Pp.getters,Op=Pp.setters,Dp=Pp.deltaSetters;wp.positionX=function(){return this.position.x},wp.positionY=function(){return this.position.y},wp.positionZ=function(){return this.position.z},wp.position=function(){const t=this.position;return[t.x,t.y,t.z]},Op.positionX=function(t){this.position.x=t},Op.positionY=function(t){this.position.y=t},Op.positionZ=function(t){this.position.z=t},Op.position=function(t){this.position.set(t)},Dp.positionX=function(t){this.position.x+=t},Dp.positionY=function(t){this.position.y+=t},Dp.positionZ=function(t){this.position.z+=t},Dp.position=Il,wp.velocityX=function(){return this.velocity.x},wp.velocityY=function(){return this.velocity.y},wp.velocityZ=function(){return this.velocity.z},wp.velocity=function(){const t=this.velocity;return[t.x,t.y,t.z]},Op.velocityX=function(t){this.velocity.x=t},Op.velocityY=function(t){this.velocity.y=t},Op.velocityZ=function(t){this.velocity.z=t},Op.velocity=function(t,e,i){this.velocity.set(t,e,i)},Dp.velocityX=function(t){this.velocity.x+=t},Dp.velocityY=function(t){this.velocity.y+=t},Dp.velocityZ=function(t){this.velocity.z+=t},Dp.velocity=Il,Op.forces=function(t){t&&(gt(t)?(this.forces.length=0,this.forces=this.forces.concat(t)):this.forces.push(t))},Op.load=Il,Op.history=Il,Dp.load=Il,Pp.initializePositions=function(){this.initialPosition=zd(),this.position=zd(),this.velocity=zd(),this.load=zd(),this.forces=[],this.history=[],this.isRunning=!1},Pp.applyForces=function(t,e){let i;this.load.zero(),this.isBeingDragged||this.forces.forEach((n=>{i=x[n],i&&i.action&&i.action(this,t,e)}))},Pp.update=function(t,e){this.isBeingDragged?this.position.setFromVector(this.isBeingDragged).vectorAdd(this.dragOffset):Ep[this.engine].call(this,t*e.tickMultiplier)},Pp.manageHistory=function(t,e){const{history:i,remainingTime:n,position:s,historyLength:r,hasLifetime:o,distanceLimit:a,initialPosition:l,killBeyondCanvas:c}=this;let h=!0,u=0;if(o)if(u=n-t,u<=0){const t=i.pop();Cp(t),h=!1,i.length||(this.isRunning=!1)}else this.remainingTime=u;const d=i[i.length-1];if(d){const[,t,i,n]=d;if(c){const t=e.element.width,s=e.element.height;(i<0||n<0||i>t||n>s)&&(h=!1,this.isRunning=!1)}if(a){const e=Gd(l);e.vectorSubtractArray([i,n,t]),e.getMagnitude()>a&&(h=!1,this.isRunning=!1),jd(e)}}if(h){const{x:t,y:e,z:n}=s,o=(vp.length||vp.push(new ParticleHistory),vp.shift());if(o[0]=u,o[1]=n,o[2]=t,o[3]=e,i.unshift(o),i.length>r){i.splice(r).forEach((t=>Cp(t)))}}},Pp.run=function(t,e,i){this.hasLifetime=!1,t&&(this.remainingTime=t,this.hasLifetime=!0),this.distanceLimit=0,e&&(this.initialPosition.set(this.position),this.distanceLimit=e),this.killBeyondCanvas=i,this.isRunning=!0};const Fp=function(t){return!!t&&new Particle(t)};Q.Particle=Particle;const Rp=[],Tp=function(t){Rp.length||Rp.push(new Particle);const e=Rp.shift();return e.set(t),e},Hp=function(t){if(t&&t.type===ua&&(t.history.forEach((t=>Cp(t))),t.history.length=0,t.set(t.defs),Rp.push(t),Rp.length>50)){const t=[...Rp];Rp.length=0,t.forEach((t=>t.kill()))}},Ep={euler:function(t){const{position:e,velocity:i,load:n,mass:s}=this,r=Gd(),o=Gd(i);r.setFromVector(n).scalarDivide(s),o.vectorAdd(r.scalarMultiply(t)),i.setFromVector(o),e.vectorAdd(o.scalarMultiply(t)),jd(r,o)},"improved-euler":function(t){const{position:e,velocity:i,load:n,mass:s}=this,r=Gd(),o=Gd(),a=Gd(),l=Gd(i);r.setFromVector(n).scalarDivide(s).scalarMultiply(t),o.setFromVector(n).vectorAdd(r).scalarDivide(s).scalarMultiply(t),a.setFromVector(r).vectorAdd(o).scalarDivide(2),l.vectorAdd(a),i.setFromVector(l),e.vectorAdd(l.scalarMultiply(t)),jd(r,o,a,l)},"runge-kutta":function(t){const{position:e,velocity:i,load:n,mass:s}=this,r=Gd(),o=Gd(),a=Gd(),l=Gd(),c=Gd(),h=Gd(i);r.setFromVector(n).scalarDivide(s).scalarMultiply(t).scalarDivide(2),o.setFromVector(n).vectorAdd(r).scalarDivide(s).scalarMultiply(t).scalarDivide(2),a.setFromVector(n).vectorAdd(o).scalarDivide(s).scalarMultiply(t).scalarDivide(2),l.setFromVector(n).vectorAdd(a).scalarDivide(s).scalarMultiply(t).scalarDivide(2),o.scalarMultiply(2),a.scalarMultiply(2),c.setFromVector(r).vectorAdd(o).vectorAdd(a).vectorAdd(l).scalarDivide(6),h.vectorAdd(c),i.setFromVector(h),e.vectorAdd(h.scalarMultiply(t)),jd(r,o,a,l,c,h)}},Emitter=function(t=Ml){return this.makeName(t.name),this.register(),this.initializePositions(),this.set(this.defs),this.onEnter=Il,this.onLeave=Il,this.onDown=Il,this.onUp=Il,this.fillColorFactory=Vu({name:`${this.name}-fillColorFactory`}),this.strokeColorFactory=Vu({name:`${this.name}-strokeColorFactory`}),this.range=zd(),this.rangeFrom=zd(),this.minimumVelocity=zd(),this.preAction=Il,this.stampAction=Il,this.postAction=Il,this.particleStore=[],this.deadParticles=[],this.liveParticles=[],t.group||(t.group=of),this.set(t),this.purge&&this.purgeArtefact(this.purge),this},Ip=Emitter.prototype=sc();Ip.type="Emitter",Ip.lib=Yi,Ip.isArtefact=!0,Ip.isAsset=!1,ih(Ip),Gf(Ip);const Bp={world:null,artefact:null,range:null,rangeFrom:null,minimumVelocity:null,generationRate:0,particleCount:0,generateAlongPath:null,generateInArea:null,generateFromExistingParticles:!1,generateFromExistingParticleHistories:!1,limitDirectionToAngleMultiples:0,generationChoke:15,killAfterTime:0,killAfterTimeVariation:0,killRadius:0,killRadiusVariation:0,killBeyondCanvas:!1,historyLength:1,forces:null,mass:1,massVariation:0,engine:ji,hitRadius:10,showHitRadius:!1,hitRadiusColor:Te,resetAfterBlur:3};Ip.defs=_l(Ip.defs,Bp),Ip.packetExclusions=ql(Ip.packetExclusions,["forces","particleStore","deadParticles","liveParticles","fillColorFactory","strokeColorFactory"]),Ip.packetObjects=ql(Ip.packetObjects,["world","artefact","generateInArea","generateAlongPath"]),Ip.packetFunctions=ql(Ip.packetFunctions,["preAction","stampAction","postAction"]),Ip.finalizePacketOut=function(t,e){const i=e.forces||this.forces||!1;if(i){const e=[];i.forEach((t=>{t.substring?e.push(t):Ul(t)&&t.name&&e.push(t.name)})),t.forces=e}const n=[];return this.particleStore.forEach((t=>n.push(t.saveAsPacket()))),t.particleStore=n,t},Ip.postCloneAction=function(t){return t},Ip.factoryKill=function(t,e){this.isRunning=!1,t&&this.artefact.kill(),e&&this.world.kill(),this.fillColorFactory.kill(),this.strokeColorFactory.kill(),this.deadParticles.forEach((t=>t.kill())),this.liveParticles.forEach((t=>t.kill())),this.particleStore.forEach((t=>t.kill()))};const Lp=Ip.setters,$p=Ip.deltaSetters;Lp.rangeX=function(t){this.range.x=t},Lp.rangeY=function(t){this.range.y=t},Lp.rangeZ=function(t){this.range.z=t},Lp.range=function(t){this.range.set(t)},Lp.rangeFromX=function(t){this.rangeFrom.x=t},Lp.rangeFromY=function(t){this.rangeFrom.y=t},Lp.rangeFromZ=function(t){this.rangeFrom.z=t},Lp.rangeFrom=function(t){this.rangeFrom.set(t)},Lp.minimumVelocityX=function(t){this.minimumVelocity.x=t},Lp.minimumVelocityY=function(t){this.minimumVelocity.y=t},Lp.minimumVelocityZ=function(t){this.minimumVelocity.z=t},Lp.minimumVelocity=function(t){this.minimumVelocity.set(t)},Lp.preAction=function(t){Vl(t)&&(this.preAction=t,this.dirtyFilterIdentifier=!0)},Lp.stampAction=function(t){Vl(t)&&(this.stampAction=t,this.dirtyFilterIdentifier=!0)},Lp.postAction=function(t){Vl(t)&&(this.postAction=t,this.dirtyFilterIdentifier=!0)},Lp.world=function(t){let e;t.substring?e=F[t]:Ul(t)&&t.type===wa&&(e=t),e&&(this.world=e)},Lp.artefact=function(t){let e;t.substring?e=o[t]:Ul(t)&&t.isArtefact&&(e=t),e&&(this.artefact=e,this.dirtyFilterIdentifier=!0)},Lp.generateAlongPath=function(t){let e;t.substring?e=o[t]:Ul(t)&&t.isArtefact&&(e=t),e&&e.useAsPath?this.generateAlongPath=e:this.generateAlongPath=!1,this.dirtyFilterIdentifier=!0},Lp.generateInArea=function(t){let e;t.substring?e=o[t]:Ul(t)&&t.isArtefact&&(e=t),this.generateInArea=e||!1,this.dirtyFilterIdentifier=!0},Lp.fillColor=function(t){this.fillColorFactory.set({color:t}),this.dirtyFilterIdentifier=!0},Lp.fillMinimumColor=function(t){this.fillColorFactory.set({minimumColor:t}),this.dirtyFilterIdentifier=!0},Lp.fillMaximumColor=function(t){this.fillColorFactory.set({maximumColor:t}),this.dirtyFilterIdentifier=!0},Lp.strokeColor=function(t){this.strokeColorFactory.set({color:t}),this.dirtyFilterIdentifier=!0},Lp.strokeMinimumColor=function(t){this.strokeColorFactory.set({minimumColor:t}),this.dirtyFilterIdentifier=!0},Lp.strokeMaximumColor=function(t){this.strokeColorFactory.set({maximumColor:t}),this.dirtyFilterIdentifier=!0},Lp.hitRadius=function(t){t.toFixed&&(this.hitRadius=t,this.width=this.height=2*t)},$p.hitRadius=function(t){t.toFixed&&(this.hitRadius+=t,this.width=this.height=2*this.hitRadius)},Lp.width=function(t){t.toFixed&&(this.hitRadius=t/2,this.width=this.height=t)},$p.width=function(t){t.toFixed&&(this.hitRadius=t/2,this.width=this.height=t)},Lp.height=Lp.width,$p.height=$p.width,Ip.prepareStamp=function(){this.dirtyHost&&(this.dirtyHost=!1,this.dirtyDimensions=!0),(this.dirtyScale||this.dirtyDimensions||this.dirtyStart||this.dirtyOffset||this.dirtyHandle)&&(this.dirtyPathObject=!0),this.dirtyScale&&this.cleanScale(),this.dirtyDimensions&&this.cleanDimensions(),this.dirtyLock&&this.cleanLock(),this.dirtyStart&&this.cleanStart(),this.dirtyOffset&&this.cleanOffset(),this.dirtyHandle&&this.cleanHandle(),this.dirtyRotation&&this.cleanRotation(),(this.lockTo.includes(ms)||this.lockTo.includes(zs))&&(this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtyStampHandlePositions&&this.cleanStampHandlePositions();const t=At(),{particleStore:e,deadParticles:i,liveParticles:n,particleCount:s,generationRate:r,resetAfterBlur:o}=this;let a=this.generatorChoke;a||(this.generatorChoke=a=t),e.forEach((t=>{t.isRunning?n.push(t):i.push(t)})),e.length=0,i.forEach((t=>Hp(t))),i.length=0,e.push(...n),n.length=0;let l=t-a;if(l/1e3>o&&(l=0,this.generatorChoke=t),l>0&&r){let i=ut(r/1e3*l);if(s){const t=s-e.length;t<=0?i=0:tR.isPointInPath(H,...t,Y);D.rotateDestination(R,r,o,F);t:for(n=0;n1?([,,...D]=b[ut(Dt()*b.length)],D?o.setFromArray(D):o.setFromVector(y.position)):o.setFromVector(y.position)):o.setFromArray(k),s=Tp(),s.set({positionX:El(o.x),positionY:El(o.y),positionZ:El(o.z),historyLength:h,engine:u,forces:d,mass:e(f,p),fill:g.getRangeColor(Dt()),stroke:m.getRangeColor(Dt())}),H?(o.zero(),c=ut(360/H),o.x=i($,I,S.x),o.rotate(ut(Dt()*c)*H),s.set({velocityX:El(o.x),velocityY:El(o.y),velocityZ:i(X,L,S.z)})):s.set({velocityX:i($,I,S.x),velocityY:i(M,B,S.y),velocityZ:i(X,L,S.z)}),s.velocity.rotate(O),a=tt(e(v,C)),l=tt(e(P,x)),s.run(a,l,w),A.push(s);jd(o)}else if(R){const r=A.length,o=Gd();let c,y;for(n=0;na&&(i.forEach((t=>Hp(t))),i.length=0,f=Lt),i.forEach((e=>e.applyForces(t,d))),i.forEach((e=>e.update(f,t))),n.call(this,d),i.forEach((t=>{t.manageHistory(f,d),s.call(this,e,t,d)})),r.call(this,d),l){const t=d.engine;t.save(),t.lineWidth=1,t.strokeStyle=h,t.setTransform(1,0,0,1,0,0),t.beginPath(),t.arc(u[0],u[1],c,0,Pt),t.stroke(),t.restore()}this.lastUpdated=p},Ip.checkHit=function(t=[]){if(this.noUserInteraction)return!1;const e=gt(t)?t:[t],i=this.currentStampPosition;let n,s,r=!1;return!!e.some((t=>{if(gt(t))n=t[0],s=t[1];else{if(!tc(t,t.x,t.y))return!1;n=t.x,s=t.y}if(!mt(n)||!mt(s))return!1;const e=Gd(i).vectorSubtract(t);return e.getMagnitude()=200)return Qi[7];if(e>=150)return Qi[6];if(e>=125)return Qi[5];if(e>=112.5)return Qi[4]}}return Ls},zp.fontWeight=function(t){this.fontWeight=t.toFixed?`${t}`:t},zp.direction=function(t){null!=t&&t.substring&&(this.direction=t)},zp.fontKerning=function(t){null!=t&&t.substring&&(this.fontKerning=t)},jp.letterSpaceValue=function(){return this.letterSpaceValue},jp.letterSpacing=function(){return`${this.letterSpaceValue}px`},Np.letterSpacing=function(t){if(null!=t){t===Ls&&(t=0);const e=t.toFixed?t:parseFloat(t);mt(e)&&(this.letterSpaceValue+=e,this.letterSpacing=`${this.letterSpaceValue}px`)}},zp.letterSpacing=function(t){if(null!=t){t===Ls&&(t=0);const e=t.toFixed?t:parseFloat(t);mt(e)&&(this.letterSpaceValue=e,this.letterSpacing=`${e}px`)}},jp.wordSpaceValue=function(){return this.wordSpaceValue},jp.wordSpacing=function(){return`${this.wordSpaceValue}px`},Np.wordSpacing=function(t){if(null!=t){const e=t.toFixed?t:parseFloat(t);mt(e)&&(this.wordSpaceValue+=e,this.wordSpacing=`${this.wordSpaceValue}px`)}},zp.wordSpacing=function(t){if(null!=t){const e=t.toFixed?t:parseFloat(t);mt(e)&&(this.wordSpaceValue=e,this.wordSpacing=`${e}px`)}},zp.textRendering=function(t){null!=t&&t.substring&&(this.textRendering=t)},jp.textAlign=Il,zp.textAlign=Il,jp.textBaseline=Il,zp.textBaseline=Il;const Vp=function(t){return!!t&&new Xp(t)};Q.TextStyle=Xp;const Wp=document.createElement(Oi);function Up(t=Ml){const e={textIsAccessible:!0,accessibleText:"§",accessibleTextPlaceholder:"§",accessibleTextRole:wl,accessibleTextOrder:0};t.defs=_l(t.defs,e),t.finalizePacketOut=function(t,e){const i=vt(this.defaultTextStyle.saveAsPacket(e))[3],n=vt(this.state.saveAsPacket(e))[3];return t=_l(t,{direction:i.direction,fillStyle:i.fillStyle,fontKerning:i.fontKerning,fontStretch:i.fontStretch,fontString:i.fontString,fontVariantCaps:i.fontVariantCaps,highlightStyle:i.highlightStyle,includeHighlight:i.includeHighlight,includeUnderline:i.includeUnderline,letterSpacing:i.letterSpaceValue,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset,lineWidth:i.lineWidth,method:i.method,overlineOffset:i.overlineOffset,overlineStyle:i.overlineStyle,overlineWidth:i.overlineWidth,strokeStyle:i.strokeStyle,textRendering:i.textRendering,underlineGap:i.underlineGap,underlineOffset:i.underlineOffset,underlineStyle:i.underlineStyle,underlineWidth:i.underlineWidth,wordSpacing:i.wordSpaceValue,filter:n.filter,font:null,globalAlpha:n.globalAlpha,globalCompositeOperation:n.globalCompositeOperation,imageSmoothingEnabled:n.imageSmoothingEnabled,imageSmoothingQuality:n.imageSmoothingQuality,lineCap:ho,lineJoin:ho,miterLimit:10,shadowBlur:n.shadowBlur,shadowColor:n.shadowColor,shadowOffsetX:n.shadowOffsetX,shadowOffsetY:n.shadowOffsetY,textAlign:Jn,textBaseline:Ua}),this.type===aa&&(t=this.handlePacketAnchor(t,e)),t},t.factoryKill=function(){this.dirtyCache(),this.accessibleTextHold&&this.accessibleTextHold.remove();const t=this.getCanvasTextHold(this.currentHost);t&&(t.dirtyTextTabOrder=!0)},t.get=function(t){const{defs:e,getters:i,state:n,defaultTextStyle:s,layoutTemplate:r}=this,o=s?s.getters:Ml,a=s?s.defs:Ml,l=n?n.getters:Ml,c=n?n.defs:Ml;let h;if(r&&Ta.includes(t))return r.get(t);if(ja.includes(t)){if(h=o[t],h)return h.call(s);if(typeof a[t]!=ol)return s[t]}if(Bo.includes(t)){if(h=l[t],h)return h.call(n);if(typeof c[t]!=ol)return n[t]}return h=i[t],h?h.call(this):typeof e[t]!=ol?this[t]:null},t.set=function(t=Ml){const e=bt(t),i=e.length;if(i){this.dirtyCache();const{defs:n,setters:s,state:r,defaultTextStyle:o,layoutTemplate:a}=this,l=o?o.setters:Ml,c=o?o.defs:Ml,h=r?r.setters:Ml,u=r?r.defs:Ml;let d,f,p,g;for(f=0;f=2?t.imageSmoothingEnabled=!1:(t.imageSmoothingEnabled=!0,t.imageSmoothingQuality=Pn)},t.getCalculators=function(){let t=null,e=null;const i=this.getControllerCell();return i&&(t=i.fontSizeCalculator,e=i.fontSizeCalculatorValues),[t,e]},t.temperFont=function(){const{group:t,defaultTextStyle:e}=this;if(tc(t,e)){const[t,i]=this.getCalculators();t?this.calculateTextStyleFontStrings(e,t,i):this.dirtyFont=!0}},t.cleanFont=function(){if(this.currentFontIsLoaded)this.dirtyFont=!1,this.temperFont(),this.type!==aa||this.dirtyFont||this.measureFont();else if(null!=this.currentFontIsLoaded){const[t,e]=this.getCalculators(),i=this.defaultTextStyle.fontString;if(t){t.style.font=i;const n=e.fontFamily;A.includes(`100px ${n}`)?(this.currentFontIsLoaded=!0,this.dirtyFont=!1,this.temperFont(),this.type!==aa||this.dirtyFont||this.measureFont()):this.checkFontIsLoaded(i)}}},t.calculateTextStyleFontStrings=function(t,e,i){let n=t.fontSize;const{fontStretch:s,fontStyle:r,fontWeight:o,fontVariantCaps:a,fontString:l}=t,{lineSpacing:c,updateUsingFontParts:h,updateUsingFontString:u}=this,d=this.getScale();e.style.font=l;const f=i.fontFamily;if(this.getFontMetadata(f),u||null==n||!n){this.updateUsingFontString=!1;const s=l.match(qi);s&&s[0]&&(n=s[0]),e.style.fontSize=n,t.fontSize=i.fontSize}h?(this.updateUsingFontParts=!1,e.style.fontStretch=s,e.style.fontStyle=r,e.style.fontVariantCaps=a,e.style.fontWeight=o,e.style.fontSize=n):1!==d&&(e.style.fontSize=n);const p=i.fontWeight,g=t.fontStretchHelper(i.fontStretch);let m=i.fontVariantCaps,y=i.fontStyle;m=tn.includes(m)?m:Ls,y=y===Mn||y.includes($s)?y:Ls;const b=i.fontSize,S=parseFloat(b);if(t.fontSizeValue=S,null!=c&&l.includes("/")){const t=parseFloat(i.lineHeight);this.lineSpacing=mt(t)?t/S:this.defs.lineSpacing,this.dirtyLayout=!0}t.fontStretch=g,t.fontStyle=y,t.fontVariantCaps=m,t.fontWeight=p,t.fontFamily=f,this.updateCanvasFont(t,d),this.updateFontString(t)},t.getScale=function(){const t=this.layoutTemplate;return t?null!=t.currentScale?t.currentScale:1:null!=this.currentScale?this.currentScale:1},t.getStyle=function(t,e,i){if(null==i)return Te;if(t||(t=this.state[e]),null==t)return Te;if(t.substring){let e=null;L.includes(t)?e=B[t]:f.includes(t)&&(e=d[t]),null!=e&&(t=e.getData(this,i))}else t=t.getData(this,i);return t},t.getFontMetadata=function(t){if(t){const e=`100px ${t}`;if(A.includes(e))return k[e];const i=gu(),n=i.engine;n.textAlign=Jn,n.textBaseline=Ua,n.font=e;const s=n.measureText(wo),{actualBoundingBoxAscent:r,actualBoundingBoxDescent:o,fontBoundingBoxAscent:a,fontBoundingBoxDescent:l,alphabeticBaseline:c,hangingBaseline:h,ideographicBaseline:u}=s;let d=a+l;mt(d)||(d=rt(tt(o)+tt(r)));const f=mt(a)?a:r;return A.push(e),k[e]={height:d,verticalOffset:f,alphabeticRatio:tt((c-f)/d),hangingRatio:tt((h-f)/d),ideographicRatio:tt((u-f)/d),alphabeticBaseline:-c,hangingBaseline:-h,ideographicBaseline:-u},mu(i),k[e]}},t.checkFontIsLoaded=function(t){if(null==t)this.currentFontIsLoaded=!1;else if(Uo.includes(t))this.currentFontIsLoaded=!0;else if(null!=this.currentFontIsLoaded&&!this.currentFontIsLoaded){this.currentFontIsLoaded=null;document.fonts.load(t).then((()=>this.currentFontIsLoaded=!0)).catch((e=>{this.currentFontIsLoaded=!1,console.log("checkFontIsLoaded error:",t,e)}))}},t.getCanvasTextHold=function(t){return t&&t.type===Ko&&t.controller.type&&t.controller.type===_o&&t.controller.textHold?t.controller:!(!t||t.type!==Ko||!t.currentHost)&&this.getCanvasTextHold(t.currentHost)},t.updateAccessibleTextHold=function(){if(this.dirtyText=!1,this.textIsAccessible){if(!this.accessibleTextHold){const t=document.createElement(Oi);t.id=`${this.name}-text-hold`,t.setAttribute(Ae,or),t.setAttribute(yi,this.accessibleTextOrder),this.accessibleTextRole&&t.setAttribute(lo,this.accessibleTextRole),this.accessibleTextHold=t,this.accessibleTextHoldAttached=!1}if(this.accessibleTextHold.textContent=this.getAccessibleText(),this.currentHost){const t=this.getCanvasTextHold(this.currentHost);t&&t.textHold&&(this.accessibleTextHoldAttached||(t.textHold.appendChild(this.accessibleTextHold),this.accessibleTextHoldAttached=!0),t.dirtyTextTabOrder=!0)}}else if(this.accessibleTextHold){this.accessibleTextHold.remove(),this.accessibleTextHold=null,this.accessibleTextHoldAttached=!1;const t=this.getCanvasTextHold(this.currentHost);t&&(t.dirtyTextTabOrder=!0)}},t.getAccessibleText=function(){const{accessibleText:t,accessibleTextPlaceholder:e,text:i}=this;return t.replace(e,i)}}const EnhancedLabel=function(t=Ml){return this.makeName(t.name),this.register(),this.state=_h(Ml),this.defaultTextStyle=Vp({isDefaultTextStyle:!0}),this.cache=null,this.textUnitHitZones=[],this.pivoted=[],this.set(this.defs),t.group||(t.group=of),this.currentFontIsLoaded=!1,this.updateUsingFontParts=!1,this.updateUsingFontString=!1,this.usingViewportFontSizing=!1,this.useMimicDimensions=!0,this.useMimicFlip=!0,this.useMimicHandle=!0,this.useMimicOffset=!0,this.useMimicRotation=!0,this.useMimicScale=!0,this.useMimicStart=!0,this.delta={},this.deltaConstraints={},this.currentStampPosition=Au(),this.textHandle=Au(),this.textOffset=Au(),this.lines=[],this.textUnits=gg(),this.underlinePaths=[],this.overlinePaths=[],this.highlightPaths=[],this.guidelineDash=[],this.set(t),this.dirtyFont=!0,this.currentFontIsLoaded=!1,this},Zp=EnhancedLabel.prototype=sc();Zp.type=ta,Zp.lib=Yi,Zp.isArtefact=!0,Zp.isAsset=!1,ih(Zp),bd(Zp),dd(Zp),Up(Zp);const _p={text:wl,lineSpacing:1.5,layoutTemplate:null,useLayoutTemplateAsPath:!1,pathPosition:0,alignment:0,alignTextUnitsToPath:!0,lineAdjustment:0,breakTextOnSpaces:!0,breakWordsOnHyphens:!1,justifyLine:We,textUnitFlow:"row",truncateString:"…",hyphenString:"-",textHandle:null,textOffset:null,showGuidelines:!1,guidelineStyle:"rgb(0 0 0 / 0.5)",guidelineWidth:1,guidelineDash:null,visibility:!0,calculateOrder:0,stampOrder:0,host:null,group:null,method:zi,lockFillStyleToEntity:!1,lockStrokeStyleToEntity:!1,cacheOutput:!0,checkHitUseTemplate:!0};Zp.defs=_l(Zp.defs,_p),Zp.packetExclusions=ql(Zp.packetExclusions,["pathObject","mimicked","pivoted","state"]),Zp.packetExclusionsByRegex=ql(Zp.packetExclusionsByRegex,["^(local|dirty|current)","Subscriber$"]),Zp.packetCoordinates=ql(Zp.packetCoordinates,["start","handle","offset"]),Zp.packetObjects=ql(Zp.packetObjects,["group","layoutTemplate"]),Zp.packetFunctions=ql(Zp.packetFunctions,["onEnter","onLeave","onDown","onUp"]),Zp.processPacketOut=function(t,e,i){return this.processEntityPacketOut(t,e,i)},Zp.handlePacketAnchor=function(t){return t},Zp.processEntityPacketOut=function(t,e,i){return this.processFactoryPacketOut(t,e,i)},Zp.processFactoryPacketOut=function(t,e,i){let n=!0;return i.indexOf(t)||e!==this.defs[t]||(n=!1),n},Zp.postCloneAction=function(t){return t},Zp.kill=function(t=!1,e=!1){const i=this.name;return $t(v).forEach((t=>{t.artefacts.includes(i)&&t.removeArtefacts(i)})),this.anchor&&this.demolishAnchor(),this.button&&this.demolishButton(),$t(o).forEach((t=>{t.name!==i&&(t.pivot&&t.pivot.name===i&&t.set({pivot:!1}),t.mimic&&t.mimic.name===i&&t.set({mimic:!1}),t.path&&t.path.name===i&&t.set({path:!1}),t.generateAlongPath&&t.generateAlongPath.name===i&&t.set({generateAlongPath:!1}),t.generateInArea&&t.generateInArea.name===i&&t.set({generateInArea:!1}),t.artefact&&t.artefact.name===i&&t.set({artefact:!1}),gt(t.pins)&&t.pins.forEach(((e,n)=>{Ul(e)&&e.name===i&&t.removePinAt(n)})))})),$t(E).forEach((t=>{t.checkForTarget(i)&&t.removeFromTargets(this)})),this.factoryKill(t,e),this.deregister(),this};const Kp=Zp.getters,qp=Zp.setters,Qp=Zp.deltaSetters;Kp.group=function(){return this.group?this.group.name:wl},qp.group=function(t){let e;t&&(this.group&&this.group.type===ra&&this.group.removeArtefacts(this.name),t.substring?(e=v[t],this.group=e||t):this.group=t),this.group&&this.group.type===ra&&this.group.addArtefacts(this.name)},qp.layoutTemplate=function(t){if(t){const e=this.layoutTemplate,i=t.substring?o[t]:t,n=this.name;i&&i.name&&(e&&e.name!==i.name&&(e.mimicked&&Ql(e.mimicked,n),e.pathed&&Ql(e.pathed,n)),i.mimicked&&ql(i.mimicked,n),i.pathed&&ql(i.pathed,n),this.layoutTemplate=i,this.dirtyPathObject=!0,this.dirtyLayout=!0)}},qp.breakTextOnSpaces=function(t){this.breakTextOnSpaces=!!t,this.dirtyText=!0},qp.breakWordsOnHyphens=function(t){this.breakWordsOnHyphens=!!t,this.dirtyText=!0},qp.truncateString=function(t){t.substring&&(this.truncateString=this.convertTextEntityCharacters(t),this.dirtyText=!0)},qp.hyphenString=function(t){t.substring&&(this.hyphenString=this.convertTextEntityCharacters(t),this.dirtyText=!0)},qp.textHandleX=function(t){this.textHandle[0]=t,this.dirtyLayout=!0},qp.textHandleY=function(t){this.textHandle[1]=t,this.dirtyLayout=!0},qp.textHandle=function(t){gt(t)&&t.length>1&&(this.textHandle[0]=t[0],this.textHandle[1]=t[1],this.dirtyLayout=!0)},qp.guidelineDash=function(t){gt(t)&&(this.guidelineDash=t)},qp.guidelineStyle=function(t){t?t.substring&&(this.guidelineStyle=t):this.guidelineStyle=this.defs.guidelineStyle},qp.pathPosition=function(t){t<0&&(t=tt(t)),t>1&&(t%=1),this.pathPosition=parseFloat(t.toFixed(6)),this.dirtyTextLayout=!0},Qp.pathPosition=function(t){let e=this.pathPosition+t;e<0&&(e+=1),e>1&&(e%=1),this.pathPosition=parseFloat(e.toFixed(6)),this.dirtyTextLayout=!0},qp.textUnitFlow=function(t){this.textUnitFlow=t,this.dirtyText=!0},Kp.textUnits=function(){return this.textUnits},Kp.textLines=function(){return this.lines},Zp.getTester=function(){const t=this.getControllerCell();return t?t.labelStylesCalculator:null},Zp.makeWorkingTextStyle=function(t){const e=lt(t);return it(e,t),e.isDefaultTextStyle=!1,e},Zp.setEngineFromWorkingTextStyle=function(t,e,i,n){this.updateWorkingTextStyle(t,e),i.set(t),n.setEngine(this)},Zp.updateWorkingTextStyle=function(t,e){let i=1;this.layoutTemplate&&(i=this.layoutTemplate.currentScale),t.set(e,!0),this.updateCanvasFont(t,i),this.updateFontString(t)},Zp.getTextHandleX=function(t,e,i){return t.toFixed?t:t===Ro?i===os?0:e:t===We?e/2:t===$i?i===os?e:0:t===Jn?0:t===ao?e:mt(parseFloat(t))?parseFloat(t)/100*e:0},Zp.getTextHandleY=function(t,e,i){const n=this.getFontMetadata(i),{alphabeticRatio:s,hangingRatio:r,height:o,ideographicRatio:a}=n,l=e/100;let c=1;this.layoutTemplate&&(c=this.layoutTemplate.currentScale);const h=o*l;return t.toFixed?t*c:t===Ua?0:t===Ge?h*c:t===We?h/2*c:t===ue?h*s*c:t===An?h*r*c:t===Tn?h*a*c:t===ps?h/2*c:mt(parseFloat(t))?parseFloat(t)/100*h:0},Zp.getTextOffset=function(t,e){return t.toFixed?t:mt(parseFloat(t))?parseFloat(t)/100*e:0},Zp.dirtyCache=function(){mu(this.cache),this.cache=null,this.textUnitHitZones.length=0,this.pivoted.length&&this.updatePivotSubscribers()},Zp.cleanPathObject=function(){const t=this.layoutTemplate;t&&this.dirtyPathObject&&t.pathObject&&(this.dirtyPathObject=!1,this.pathObject=new Path2D(t.pathObject))},Zp.cleanLayout=function(){this.currentFontIsLoaded&&(this.dirtyCache(),this.dirtyLayout=!1,this.useLayoutTemplateAsPath||this.calculateLines(),this.dirtyTextLayout=!0)},Zp.calculateLines=function(){const{alignment:t,defaultTextStyle:e,layoutTemplate:i,lineAdjustment:n,lines:s,lineSpacing:r,textUnitFlow:o}=this,{currentDimensions:a,currentScale:l,currentRotation:c,currentStampPosition:h,pathObject:u,winding:d}=i,{fontSizeValue:f}=e,p=(-t-c)*Ot,[g,m]=h,[y,b]=a,S=Su(),k=gu(),A=k.engine;k.rotateDestination(A,g,m,i),A.rotate(p);const v=$c();let C,P,x,w,O,D;const F=Ft(f*r*l),R=Ft(g),T=Ft(R-y*l*2),H=Ft(R+y*l*2),E=Ft(m+n*l),I=Ft(E-b*l*2),B=Ft(E+b*l*2);if(F){for(let t=E;t>I;t-=F){const e=$c();C=!1,P=!1;for(let i=T;it[1].length))),Mc(...v,v),L.sort(((t,e)=>t[0]>e[0]?1:t[0]t[1]));Ia.includes(o)&&$.reverse(),Mc(L),$.forEach((e=>{e.forEach((e=>{S.set(e).subtract(h).rotate(t+c).add(h),e[0]=S[0],e[1]=S[1]}))})),dg(...s),s.length=0,$.forEach((t=>{for(let e=0,i=t.length;e{[x,w]=t.startAt,[O,D]=t.endAt,t.length=ft(x-O,w-D),M+=`M ${x}, ${w} ${O}, ${D} `})),this.guidelinesPath=new Path2D(M),mu(k),ku(S)},Zp.cleanText=function(){if(this.currentFontIsLoaded){this.dirtyText=!1;const{breakTextOnSpaces:t,breakWordsOnHyphens:e,defaultTextStyle:i,text:n,textUnitFlow:s,textUnits:r}=this,o=[...n],a=i.direction===os,l=Ea.includes(s),c=[];let h=!1;ag(...r),r.length=0;let u=0;t?a&&e?(o.forEach((t=>{$a.test(t)?(r.push(og({[tg]:c.join(wl),[eg]:Ma,index:u})),u++,r.push(og({[tg]:t,[eg]:Ya,index:u})),c.length=0,u++):Ha.test(t)?(r.push(og({[tg]:c.join(wl),[eg]:Ma,index:u})),u++,r.push(og({[tg]:t,[eg]:"H",index:u})),c.length=0,u++):La.test(t)?(r.push(og({[tg]:c.join(wl),[eg]:Ma,index:u})),u++,r.push(og({[tg]:t,[eg]:Xa,index:u})),c.length=0,u++):c.push(t)})),c.length&&r.push(og({[tg]:c.join(wl),[eg]:Ma,index:u}))):(o.forEach((t=>{$a.test(t)?(r.push(og({[tg]:c.join(wl),[eg]:Ma,index:u})),u++,r.push(og({[tg]:t,[eg]:Ya})),c.length=0,u++):c.push(t)})),c.length&&r.push(og({[tg]:c.join(wl),[eg]:Ma,index:u}))):o.forEach(((t,e)=>{c.push(t),l?$a.test(t)?(r.push(og({[tg]:c.join(wl),[eg]:Ya,index:u})),c.length=0,u++):Ba.test(t)?(r.push(og({[tg]:c.join(wl),[eg]:"B",index:u})),c.length=0,u++):Ga.test(t)?(r.push(og({[tg]:c.join(wl),[eg]:"Z",index:u})),c.length=0,u++):(r.push(og({[tg]:c.join(wl),[eg]:Ma,index:u})),c.length=0,u++):(h=Ba.test(t)||Ba.test(o[e+1]),h||($a.test(t)?(r.push(og({[tg]:c.join(wl),[eg]:Ya,index:u})),c.length=0,u++):(r.push(og({[tg]:c.join(wl),[eg]:Ma,index:u})),c.length=0,u++)))})),this.assessTextForStyle(),this.measureTextUnits(),this.dirtyTextLayout=!0}},Zp.assessTextForStyle=function(){const t=this.getTester();if(!t)return this.dirtyText=!0,null;const e=t=>{if(3!==t.nodeType)for(const i of t.childNodes)e(i);else{const e=u[i(f)];null!=e&&null==e.style&&(e.style=Vp({})),f+=t.textContent.length,l(t,e)}},i=t=>{let e=0;for(let i=0,n=u.length;i{const i=ot(t.parentNode),l={};let c,h;c=d.direction,h=i.getPropertyValue("direction"),c!==h&&(l.direction=h),c=d.fontFamily,h=i.getPropertyValue("font-family"),c!==h&&(l.fontFamily=h),c=d.fontKerning,h=i.getPropertyValue("font-kerning"),c!==h&&(l.fontKerning=h),c=d.fontSize,h=i.getPropertyValue("font-size"),c!==h&&(l.fontSize=h,en.test(h)&&(this.usingViewportFontSizing=!0)),c=d.fontStretch,h=i.getPropertyValue("font-stretch"),"100%"===h&&(h=Ls),c!==h&&(l.fontStretch=h),c=d.fontStyle,h=i.getPropertyValue("font-style"),c!==h&&(l.fontStyle=h),c=d.fontVariantCaps,h=i.getPropertyValue("font-variant-caps"),c!==h&&(l.fontVariantCaps=h),c=d.fontWeight,h=i.getPropertyValue("font-weight"),c!==h&&(l.fontWeight=h),c=d.get("letterSpacing"),h=i.getPropertyValue("letter-spacing"),h===Ls&&(h=ur),c!==h&&(l.letterSpacing=h),c=d.textRendering,h=i.getPropertyValue("text-rendering"),c!==h&&(l.textRendering=h),c=d.get("wordSpacing"),h=i.getPropertyValue("word-spacing"),c!==h&&(l.wordSpacing=h),c=d.fillStyle,h=i.getPropertyValue("--SC-fill-style"),c!==h&&(l.fillStyle=h),c=d.includeHighlight,h=!!i.getPropertyValue("--SC-include-highlight"),c!==h&&(l.includeHighlight=h),c=d.highlightStyle,h=i.getPropertyValue("--SC-highlight-style"),c!==h&&(l.highlightStyle=h),c=d.lineWidth,h=parseFloat(i.getPropertyValue("--SC-stroke-width")),c!==h&&(l.lineWidth=h),c=d.includeOverline,h=!!i.getPropertyValue("--SC-include-overline"),c!==h&&(l.includeOverline=h),c=d.overlineOffset,h=parseFloat(i.getPropertyValue("--SC-overline-offset")),c!==h&&(l.overlineOffset=h),c=d.overlineStyle,h=i.getPropertyValue("--SC-overline-style"),c!==h&&(l.overlineStyle=h),c=d.overlineWidth,h=parseFloat(i.getPropertyValue("--SC-overline-width")),c!==h&&(l.overlineWidth=h),c=d.includeUnderline,h=!!i.getPropertyValue("--SC-include-underline"),c!==h&&(l.includeUnderline=h),c=d.underlineGap,h=parseFloat(i.getPropertyValue("--SC-underline-gap")),c!==h&&(l.underlineGap=h),c=d.underlineOffset,h=parseFloat(i.getPropertyValue("--SC-underline-offset")),c!==h&&(l.underlineOffset=h),c=d.underlineStyle,h=i.getPropertyValue("--SC-underline-style"),c!==h&&(l.underlineStyle=h),c=d.underlineWidth,h=parseFloat(i.getPropertyValue("--SC-underline-width")),c!==h&&(l.underlineWidth=h),c=d.method,h=i.getPropertyValue("--SC-method"),c!==h&&(l.method=h),c=n,h=i.getPropertyValue("--SC-local-handle-x"),c!==h&&(l.localHandleX=h),c=s,h=i.getPropertyValue("--SC-local-handle-y"),c!==h&&(l.localHandleY=h),c=r,h=parseFloat(i.getPropertyValue("--SC-local-offset-x")),c!==h&&(l.localOffsetX=h),c=o,h=parseFloat(i.getPropertyValue("--SC-local-offset-y")),c!==h&&(l.localOffsetY=h),c=a,h=parseFloat(i.getPropertyValue("--SC-local-alignment")),c!==h&&(l.localAlignment=h),e.set(l),e.style.set(l,!0),d.set(l,!0)},{rawText:c,defaultTextStyle:h,textUnits:u}=this,d=this.makeWorkingTextStyle(h);let f=0;this.usingViewportFontSizing=en.test(d.fontSize),(()=>{t.style.setProperty("direction",h.direction),t.style.setProperty("font-family",h.fontFamily),t.style.setProperty("font-kerning",h.fontKerning),t.style.setProperty("font-size",h.fontSize),t.style.setProperty("font-stretch",h.fontStretch),t.style.setProperty("font-style",h.fontStyle),t.style.setProperty("font-variant-caps",h.fontVariantCaps),t.style.setProperty("font-weight",h.fontWeight),t.style.setProperty("letter-spacing",h.get("letterSpacing")),t.style.setProperty("text-rendering",h.textRendering),t.style.setProperty("word-spacing",h.get("wordSpacing")),t.style.setProperty("--SC-fill-style",h.fillStyle),t.style.setProperty("--SC-highlight-style",h.highlightStyle),t.style.setProperty("--SC-overline-offset",h.overlineOffset),t.style.setProperty("--SC-overline-style",h.overlineStyle),t.style.setProperty("--SC-overline-width",h.overlineWidth),t.style.setProperty("--SC-stroke-width",h.lineWidth),t.style.setProperty("--SC-stroke-style",h.strokeStyle),t.style.setProperty("--SC-underline-gap",h.underlineGap),t.style.setProperty("--SC-underline-offset",h.underlineOffset),t.style.setProperty("--SC-underline-style",h.underlineStyle),t.style.setProperty("--SC-underline-width",h.underlineWidth),t.style.setProperty("--SC-local-handle-x",n),t.style.setProperty("--SC-local-handle-y",s),t.style.setProperty("--SC-local-offset-x",r),t.style.setProperty("--SC-local-offset-y",o),t.style.setProperty("--SC-local-alignment",a),t.style.setProperty("--SC-method",h.method),t.className=this.name,t.innerHTML=c})(),e(t)},Zp.measureTextUnits=function(){const{defaultTextStyle:t,hyphenString:e,state:i,textUnitFlow:n,textUnits:s,truncateString:r,breakTextOnSpaces:o}=this,a=gu(),l=a.engine;let c,h,u,d,f,p,g,m,y,b,S;const k=this.makeWorkingTextStyle(t);this.setEngineFromWorkingTextStyle(k,Ml,i,a);const A=Ea.includes(n);s.forEach((t=>{({chars:h,charType:u,style:d}=t),d&&this.setEngineFromWorkingTextStyle(k,d,i,a),c=l.measureText(h),t.len=c.width,u===Ya?t.len+=k.wordSpaceValue:u===Xa?(c=l.measureText(e),t.replaceLen=c.width):(c=l.measureText(r),t.replaceLen=c.width),t.height=A&&!o&&("Z"===u||"B"===u)?0:parseFloat(k.fontSize)})),!this.useLayoutTemplateAsPath&&this.breakTextOnSpaces||(this.setEngineFromWorkingTextStyle(k,t,i,a),s.forEach(((t,e)=>{({chars:h,charType:u,style:d,len:f}=t),d&&this.setEngineFromWorkingTextStyle(k,d,i,a),k.fontKerning!==Is&&(p=s[e+1],p&&(({style:g,chars:m,charType:y,len:b}=p),u!==Ya&&y!==Ya&&(g&&(g.fontFamily||g.fontSize||g.fontVariantCaps)||(S=f+b,c=l.measureText(`${h}${m}`),p.kernOffset=S-c.width))))}))),mu(a)},Zp.layoutText=function(){if(this.currentFontIsLoaded){const{useLayoutTemplateAsPath:t,lines:e,textUnits:i,layoutTemplate:n}=this;t?n&&n.useAsPath&&(this.dirtyTextLayout=!1,dg(...e),e.length=0,e.push(ug({length:n.length,isPathEntity:!0}))):e.length&&i.length&&(this.dirtyTextLayout=!1,e.forEach((t=>{t.unitData.length=0})),i.forEach((t=>{t.stampFlag=!0,t.lineOffset=0}))),this.assignTextUnitsToLines(),this.positionTextUnits()}},Zp.assignTextUnitsToLines=function(){const{breakWordsOnHyphens:t,defaultTextStyle:e,layoutTemplate:i,lines:n,textUnitFlow:s,textUnits:r}=this,o=e.direction===os,a=Ea.includes(s),l=i.currentScale,c=r.length;let h,u,d,f,p,g,m,y,b,S,k,A=0;const v=function(t){h-=t,f.push(A),++A};if(n.forEach((e=>{for(({length:y,unitData:f}=e),h=rt(y),k=!0,u=A;u=0;t--){if(({length:y,unitData:f}=n[t]),i=f.reduce(((t,e)=>(r[e]&&r[e].charType===Ma&&t++,t)),0),i){s=[...f];break}f.length=0}if(s&&s.length){for(({length:y,unitData:f}=n[t]),i=f.reduce(((t,e)=>(r[e]&&r[e].len&&(t+=r[e].len),t)),0),u=f.length-1;u>=0;u--)if(d=r[f[u]],d)if(({len:g,replaceLen:e,charType:b}=d),b!==Ma&&b!==Xa)i-=g,s.pop();else{if(i+e=h?(Z-=h,k.lineStart=!0):k.lineStart=!1,U=Z/h,k.pathData=n.getPathPositionData(U,!0),({x:L,y:$,angle:M}=k.pathData),H=G-X,E=j-Y,O[0]=L,O[1]=$,D[0]=H,D[1]=E+W,I=e?t+M-90:t-90,k.startAlignment=I,k.startRotation=I*Ot,k.localRotation=R*Ot,Z+=w-Y):(T=P[0]||o[0]||0,X=this.getTextHandleX(T,A,d),T=P[1]||o[1]||0,Y=this.getTextHandleY(T,v,N),T=x[0]||a[0]||0,G=this.getTextOffset(T,A),T=x[1]||a[1]||0,j=this.getTextOffset(T,v),Z+=X,Z>=h?(Z-=h,k.lineStart=!0):k.lineStart=!1,U=Z/h,k.pathData=n.getPathPositionData(U,!0),({x:L,y:$,angle:M}=k.pathData),H=G-X,E=j-Y,O[0]=L,O[1]=$,D[0]=H,D[1]=E+W,I=e?t+R+M:t+R,k.startAlignment=I,k.startRotation=I*Ot,k.localRotation=R*Ot,Z+=A-C-X),k.set({boxData:null}),b[0]=L+H,b[1]=$+E-W,y.setFromArray(b).subtract(O).rotate(I).add(O),F.tl.push(...y),b[0]+=A,y.setFromArray(b).subtract(O).rotate(I).add(O),F.tr.push(...y),b[1]=$+E+V,y.setFromArray(b).subtract(O).rotate(I).add(O),F.br.push(...y),b[0]-=A,y.setFromArray(b).subtract(O).rotate(I).add(O),F.bl.push(...y));ku(y,b),Mc(m)},Zp.positionTextUnitsInSpace=function(){const{alignment:t,defaultTextStyle:e,getTextHandleX:i,getTextHandleY:n,getTextOffset:s,justifyLine:r,layoutTemplate:o,lines:a,textHandle:l,textOffset:c,textUnitFlow:h,textUnits:u}=this,d=e.direction,f=d===os,p=Ea.includes(h),{currentRotation:g,currentScale:m}=o;let y,b,S,k,A,v,C,P,x,w,O,D,F,R,T,H,E,I,B,L,$,M,X,Y,G,j,z,N,V,W,U,Z,_,K,q;const Q=this.makeWorkingTextStyle(e);this.updateWorkingTextStyle(Q,Ml),Z=Q.fontFamily,_=this.getFontMetadata(Z),K=_.verticalOffset*(Q.fontSizeValue/100)*m,q=_.height*(Q.fontSizeValue/100)*m,a.forEach((e=>{if(({length:b,unitData:S,startAt:N}=e),S.length){const e=$c(),o=$c(),a=Su(),h=Su();switch(A=S.length-1,k=0,v=0,C=0,e.length=0,o.length=0,[j,z]=N,S.forEach(((t,i)=>{t.toFixed&&(y=u[t],0!==i&&i!==A||y.charType!==Ya||(y.stampFlag=!1),y.stampFlag&&(e.push(k),k+=p?y.height*m:y.len-y.kernOffset,r!==Do&&r!==Oo||y.charType!==Ya||v++))})),P=b-k,f&&(S.includes(Xa)||S.includes("T"))&&(y=u[S[S.length-2]],P-=null!=y.replaceLen?y.replaceLen:0),r){case $i:o.push(...e.map((t=>t+P)));break;case We:P/=2,o.push(...e.map((t=>t+P)));break;case Do:v&&(C=P/v),o.push(...e);break;case Oo:C=P/(v+2),o.push(...e);break;default:o.push(...e)}if(r===Do)A=0,S.forEach((t=>{if(y=u[t],y&&y.stampFlag&&(A++,y.charType===Ya))for(let t=A,e=o.length;t{if(y=u[t],y&&y.stampFlag&&(A++,y.charType===Ya))for(let t=A,e=o.length;tt+C)))}S.forEach((e=>{e.toFixed&&(y=u[e],({boxData:R,height:w,len:x,localAlignment:E,localHandle:T,localOffset:H,startCorrection:F,startData:D,style:O}=y),O&&(this.updateWorkingTextStyle(Q,O),Z=Q.fontFamily,_=this.getFontMetadata(Z),K=_.verticalOffset*(w/100)*m,q=_.height*(w/100)*m),y.stampFlag&&(p?(I=o.shift(),B=T[0]||l[0]||0,M=i.call(this,B,x,d),B=T[1]||l[1]||0,X=n.call(this,B,w,Z),B=H[0]||c[0]||0,Y=s.call(this,B,x),B=H[1]||c[1]||0,G=s.call(this,B,w),U=t+g,a.set(I+X,0).rotate(U),V=j+a[0],W=z+a[1],L=V+Y,$=W+G-X+K,D[0]=V,D[1]=W,F[0]=L-V-M,F[1]=$-W,y.startAlignment=U-90,y.startRotation=(U-90)*Ot,y.localRotation=E*Ot):(I=f?o.shift():b-x-o.shift(),B=T[0]||l[0]||0,M=i.call(this,B,x,d),B=T[1]||l[1]||0,X=n.call(this,B,w,Z),B=H[0]||c[0]||0,Y=s.call(this,B,x),B=H[1]||c[1]||0,G=s.call(this,B,w),U=t+g,a.set(I+M,0).rotate(U),V=j+a[0],W=z+a[1],L=V+Y,$=W+G-X+K,D[0]=V,D[1]=W,F[0]=L-V-M,F[1]=$-W,y.startAlignment=U,y.startRotation=U*Ot,y.localRotation=E*Ot),y.set({boxData:null}),h[0]=L-M,h[1]=$-K,U+=E,p&&(U-=90),a.setFromArray(h).subtract(D).rotate(U).add(D),R.tl.push(...a),h[0]+=x,a.setFromArray(h).subtract(D).rotate(U).add(D),R.tr.push(...a),h[1]=$+q-K,a.setFromArray(h).subtract(D).rotate(U).add(D),R.br.push(...a),h[0]-=x,a.setFromArray(h).subtract(D).rotate(U).add(D),R.bl.push(...a)))})),Mc(e,o),ku(a,h)}}))},Zp.positionTextDecoration=function(){const t=function(t,e,i,n){if(t.length&&t.length===e.length&&n){const s=$c(),r=$c(),o=$c();let a,l,c,h,u,d,f;for(s.push(...t),r.push(...e),a=0,l=s.length;a=0;o--)a=e[o][0]-e[o+1][0],l=e[o][1]-e[o+1][1],C+=`${a.toFixed(2)}, ${l.toFixed(2)} `;C+="z",n.push([i,new Path2D(C),[...Z]])}},i=function(i=!1){Y.length&&($=w,M=O,X=D,i||(L.underlineStyle&&($=L.underlineStyle),L.underlineOffset&&(M=L.underlineOffset),L.underlineWidth&&(X=L.underlineWidth)),t(Y,G,M,X),e(Y,G,$,f),Y.length=0,G.length=0)},n=function(i=!1){j.length&&($=R,M=T,X=H,i||(L.overlineStyle&&($=L.overlineStyle),L.overlineOffset&&(M=L.overlineOffset),L.overlineWidth&&(X=L.overlineWidth)),t(j,z,M,X),e(j,z,$,h),j.length=0,z.length=0)},s=function(t=!1){N.length&&($=I,t||L.highlightStyle&&($=L.highlightStyle),e(N,V,$,a),N.length=0,V.length=0)},{breakTextOnSpaces:r,defaultTextStyle:o,highlightPaths:a,layoutTemplate:l,lines:c,overlinePaths:h,textUnitFlow:u,textUnits:d,underlinePaths:f,useLayoutTemplateAsPath:p}=this;let g,m,y,b,S,k,A,v,C,P,x,w,O,D,F,R,T,H,E,I,B,L,$,M,X;const Y=$c(),G=$c(),j=$c(),z=$c(),N=$c(),V=$c(),W=Su(),{currentScale:U,currentStampPosition:Z}=l;f.length=0,h.length=0,a.length=0;const _=this.makeWorkingTextStyle(o);this.updateWorkingTextStyle(_,Ml),({includeUnderline:x,underlineStyle:w,underlineOffset:O,underlineWidth:D,includeOverline:F,overlineStyle:R,overlineOffset:T,overlineWidth:H,includeHighlight:E,highlightStyle:I}=_),c.forEach((t=>{g=t.unitData,Y.length=0,G.length=0,j.length=0,z.length=0,N.length=0,V.length=0,g.forEach((t=>{t.toFixed&&(m=d[t],({boxData:b,charType:P,lineStart:B,localStyle:L,style:y}=m),L||(L=Ml),y&&(this.updateWorkingTextStyle(_,y),({includeUnderline:x,includeOverline:F,includeHighlight:E}=_),x&&({underlineStyle:w,underlineOffset:O,underlineWidth:D}=_),F&&({overlineStyle:R,overlineOffset:T,overlineWidth:H}=_),E&&({highlightStyle:I}=_)),m.stampFlag&&(({tl:S,tr:k,br:A,bl:v}=b),Ea.includes(u)?P!==Ya&&((L.includeUnderline||x)&&(Y.push([...S],[...k]),G.push([...v],[...A]),i()),(L.includeOverline||F)&&(j.push([...S],[...k]),z.push([...v],[...A]),n()),(L.includeHighlight||E)&&(N.push([...S],[...k]),V.push([...v],[...A]),s())):p?r?P!==Ya&&((L.includeUnderline||x)&&(Y.push([...S],[...k]),G.push([...v],[...A]),i()),(L.includeOverline||F)&&(j.push([...S],[...k]),z.push([...v],[...A]),n()),(L.includeHighlight||E)&&(N.push([...S],[...k]),V.push([...v],[...A]),s())):(B&&(i(),n(),s()),L.includeUnderline?(i(!0),Y.push([...S],[...k]),G.push([...v],[...A]),i()):x?(Y.push([...S],[...k]),G.push([...v],[...A])):i(),L.includeOverline?(n(!0),j.push([...S],[...k]),z.push([...v],[...A]),n()):F?(j.push([...S],[...k]),z.push([...v],[...A])):n(),L.includeHighlight?(s(!0),N.push([...S],[...k]),V.push([...v],[...A]),s()):E?(N.push([...S],[...k]),V.push([...v],[...A])):s()):(L.includeUnderline?(i(!0),Y.push([...S],[...k]),G.push([...v],[...A]),i()):x?(Y.push([...S],[...k]),G.push([...v],[...A])):i(),L.includeOverline?(n(!0),j.push([...S],[...k]),z.push([...v],[...A]),n()):F?(j.push([...S],[...k]),z.push([...v],[...A])):n(),L.includeHighlight?(s(!0),N.push([...S],[...k]),V.push([...v],[...A]),s()):E?(N.push([...S],[...k]),V.push([...v],[...A])):s())))})),Y.length&&i(),j.length&&n(),N.length&&s()})),ku(W),Mc(Y,G,j,z,N,V)},Zp.prepareStamp=function(){this.dirtyHost&&(this.dirtyHost=!1);const t=this.layoutTemplate;this.currentDimensions=t.currentDimensions,this.currentScale=t.currentScale,this.currentStampHandlePosition=t.currentStampHandlePosition,this.currentStampPosition=t.currentStampPosition,this.dirtyScale&&(this.dirtyCache(),this.dirtyScale=!1,this.dirtyFont=!0,this.dirtyPathObject=!0,this.dirtyLayout=!0),(this.dirtyDimensions||this.dirtyStart||this.dirtyOffset||this.dirtyHandle||this.dirtyRotation||this.dirtyFilters)&&(this.dirtyCache(),this.dirtyDimensions=!1,this.dirtyStart=!1,this.dirtyOffset=!1,this.dirtyHandle=!1,this.dirtyRotation=!1,this.dirtyPathObject=!0,this.dirtyLayout=!0),this.dirtyPathObject&&this.cleanPathObject(),this.dirtyFont&&(this.cleanFont(),this.dirtyFont||(this.dirtyText=!0)),!this.dirtyPathObject&&this.currentFontIsLoaded&&(this.dirtyText&&(this.updateAccessibleTextHold(),this.cleanText()),this.dirtyLayout&&this.cleanLayout(),this.dirtyTextLayout&&this.layoutText())},Zp.stamp=function(t=!1,e,i){this.dirtyFont||this.dirtyText||this.dirtyLayout||(t?(e&&pn.includes(e.type)&&(this.currentHost=e),i&&(this.set(i),this.prepareStamp()),this.regularStamp()):this.visibility&&this.regularStamp())},Zp.simpleStamp=Il,Zp.removeShadowAndAlpha=function(t){t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,t.shadowColor="rgb(0 0 0 / 0)",t.globalAlpha=1,t.globalCompositeOperation=xo,t.lineJoin=ho,t.lineCap=ho,this.setImageSmoothing(t)},Zp.getCellCoverage=function(t){const{width:e,height:i,data:n}=t;let s,r,o,a,l=0,c=0,h=e,u=i,d=3;for(o=0,a=e*i;os&&(h=s),lr&&(u=r),c{if(a=o[n],a&&(({chars:f,charType:p,localRotation:d,localStyle:C,startCorrection:u,startData:h,startRotation:k,style:g}=a),C||(C=Ml),g&&(this.setEngineFromWorkingTextStyle(l,g,i,s),this.removeShadowAndAlpha(t),t.lineWidth=l.underlineGap,this.setEngineFromWorkingTextStyle(l,g,i,r),this.removeShadowAndAlpha(e)),p!==Ya)){switch([m,y]=h,[b,S]=u,A=at(k),v=Ht(k),t.setTransform(A,v,-v,A,m,y),e.setTransform(A,v,-v,A,m,y),t.rotate(d),e.rotate(d),t.strokeText(f,b,S),t.fillText(f,b,S),e.save(),P=C.method||l.method,C.fillStyle&&(e.fillStyle=C.fillStyle),C.strokeStyle&&(e.strokeStyle=C.strokeStyle),P){case Ri:e.strokeText(f,b,S);break;case Ni:e.fillText(f,b,S),e.strokeText(f,b,S);break;case Ti:e.strokeText(f,b,S),e.fillText(f,b,S);break;default:e.fillText(f,b,S)}e.restore()}}))}return{copyCell:s,mainCell:r}}return null},Zp.createTextCellsForSpace=function(t){const e=t.element,i=e.width,n=e.height,s=gu(i,n),r=gu(i,n);if(s&&r){const t=s.engine,e=r.engine,{state:i,lines:n,textUnits:o,defaultTextStyle:a,hyphenString:l,truncateString:c}=this,h=a.direction===os,u=this.makeWorkingTextStyle(a);return this.setEngineFromWorkingTextStyle(u,Ml,i,s),this.removeShadowAndAlpha(t),this.setEngineFromWorkingTextStyle(u,Ml,i,r),this.removeShadowAndAlpha(e),n.forEach((n=>{const{unitData:a}=n;let d,f,p,g,m,y,b,S,k,A,v,C,P,x,w,O,D;a.forEach(((n,F)=>{if(d=o[n],d&&(({startData:f,startCorrection:p,startRotation:A,localRotation:v,chars:g,style:m,localStyle:O}=d),O||(O=Ml),m&&(this.setEngineFromWorkingTextStyle(u,m,i,s),this.removeShadowAndAlpha(t),t.lineWidth=u.underlineGap,this.setEngineFromWorkingTextStyle(u,m,i,r),this.removeShadowAndAlpha(e)),h?(x=a[F+1],w=x&&x.substring?x===Xa?`${g}${l}`:`${g}${c}`:g):w=g,w!==wo)){switch([y,b]=f,[S,k]=p,S=ut(S),k=ut(k),C=at(A),P=Ht(A),t.setTransform(C,P,-P,C,y,b),e.setTransform(C,P,-P,C,y,b),t.rotate(v),e.rotate(v),t.strokeText(w,S,k),t.fillText(w,S,k),e.save(),D=O.method||u.method,O.fillStyle&&(e.fillStyle=O.fillStyle),O.strokeStyle&&(e.strokeStyle=O.strokeStyle),D){case Ri:e.strokeText(w,S,k);break;case Ni:e.fillText(w,S,k),e.strokeText(w,S,k);break;case Ti:e.strokeText(w,S,k),e.fillText(w,S,k);break;default:e.fillText(w,S,k)}e.restore()}}))})),{copyCell:s,mainCell:r}}return null},Zp.addUnderlinesToCopyCell=function(t,e){const i=this.underlinePaths;if(i.length){const n=t.element,s=n.width,r=n.height,o=gu(s,r);if(o){const t=o.engine;this.removeShadowAndAlpha(t);const n=e.engine;return i.forEach((e=>{t.resetTransform(),t.translate(...e[2]),t.fillStyle=this.getStyle(e[0],"fillStyle",o),t.fill(e[1])})),n.save(),this.removeShadowAndAlpha(n),n.globalCompositeOperation=Po,n.resetTransform(),n.drawImage(o.element,0,0),n.restore(),mu(o),!0}}return!1},Zp.createOverlineCell=function(t){const e=this.overlinePaths;if(e.length){const i=t.element,n=i.width,s=i.height,r=gu(n,s);if(r){const t=r.engine;return this.removeShadowAndAlpha(t),e.forEach((e=>{t.resetTransform(),t.translate(...e[2]),t.fillStyle=this.getStyle(e[0],"fillStyle",r),t.fill(e[1])})),r}}return null},Zp.createHighlightCell=function(t){const e=this.highlightPaths;if(e.length){const i=t.element,n=i.width,s=i.height,r=gu(n,s);if(r){const t=r.engine;return this.removeShadowAndAlpha(t),e.forEach((e=>{t.resetTransform(),t.translate(...e[2]),t.fillStyle=this.getStyle(e[0],"fillStyle",r),t.fill(e[1])})),r}}return null},Zp.stampGuidelinesOnCell=function(t){if(t&&t.engine){const{guidelinesPath:e,guidelineStyle:i,guidelineWidth:n,guidelineDash:s}=this,r=t.engine;r.save(),r.setLineDash(s),r.strokeStyle=i,r.lineWidth=n,this.setImageSmoothing(r),r.stroke(e),r.restore()}},Zp.checkHit=function(t=[]){const e=t=>{let e,i;if(gt(t))e=t[0],i=t[1];else{if(!tc(t,t.x,t.y))return[!1];e=t.x,i=t.y}return mt(e)&&mt(i)?[!0,e,i]:[!1]},{checkHitUseTemplate:i,layoutTemplate:n,textUnits:s,textUnitHitZones:r}=this;if(i&&n)return n.checkHit(t);if(!r.length&&s.length){let t,e,i,n;s.forEach((s=>{({tl:t,tr:e,br:i,bl:n}=s.boxData),r.push(new Path2D(`M ${t[0]},${t[1]} ${e[0]},${e[1]} ${i[0]},${i[1]} ${n[0]},${n[1]}Z`))}))}if(r.length){const i=gt(t)?t:[t],n=r.length;let s,o,a,l,c,h,u;const d=gu(),f=d.engine;for(h=0,u=i.length;h{t=o[e],t||(t=l[e],t&&t.type===Ko||(t=!1)),t&&(t.dirtyStart=!0),t.addPivotRotation&&(t.dirtyRotation=!0)}),this)},Zp.getUnitStartAt=function(t){const e=this.textUnits;return t>=0&&t=0&&t{if(null!==e)for(const[i,n]of ct(t))ig.includes(i)&&e.set({[i]:n})})),this.dirtyLayout=!0,this.dirtyCache()},Zp.applyTextUnitUpdates=function(){this.dirtyLayout=!0,this.dirtyCache()};const rg=[],og=function(t=Ml){rg.length||rg.push(new ng);const e=rg.shift();return e.set(t),e},ag=function(...t){t.forEach((t=>{t&&t.type===ia&&rg.push(t.reset())}))},lg=function(){return this.startAt=Au(),this.endAt=Au(),this.unitData=[],this.set(this.defs),this},cg=lg.prototype=sc();cg.type=ea,cg.defs={length:0,isPathEntity:!1,startAt:null,endAt:null,unitData:null},cg.defKeys=bt(cg.defs),cg.set=function(t=Ml){for(const[e,i]of ct(t))if(this.defKeys.includes(e))switch(e){case"startAt":case"endAt":null!=i?this[e].set(i):this[e].zero();break;case"unitData":this[e].length=0,null!=i&&this[e].push(...i);break;default:this[e]=null!=i?i:this.defs[e]}return this},cg.reset=function(){return this.set(this.defs),this};const hg=[],ug=function(t=Ml){hg.length||hg.push(new lg);const e=hg.shift();return e.set(t),e},dg=function(...t){t.forEach((t=>{t&&t.type===ea&&hg.push(t.reset())}))},fg=function(){const t=[];return Tt(t,fg.prototype),t},pg=fg.prototype=lt(Array.prototype);pg.constructor=fg,pg.type="EnhancedLabelUnitArray";const gg=()=>new fg;pg.findByIndex=function(t){let e;for(let i=0,n=this.length;i{e=i.filters,e&&e.includes(t)&&Ql(e,t)})),$t(v).forEach((i=>{e=i.filters,e&&e.includes(t)&&Ql(e,t)})),$t(d).forEach((i=>{e=i.filters,e&&e.includes(t)&&Ql(e,t)})),this.deregister(),this};const kg=bg.setters;bg.set=function(t=Ml){const e=bt(t),i=e.length;if(i){const n=this.setters,s=this.defs;let r,o,a,l;for(o=0;o{6===t.length?e.push(t):2===t.length&&(t[0].substring&&t[1].substring&&(i.length=0,t.forEach((t=>{const[e,n,s]=qu.extractRGBfromColor(t);i.push(e,n,s)}))),e.push(i))})),t.actions=[{action:_e,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,ranges:e}]},chromakey:function(t){let e=null!=t.red?t.red:0,i=null!=t.green?t.green:255,n=null!=t.blue?t.blue:0;null!=t.reference&&([e,i,n]=qu.extractRGBfromColor(t.reference),t.red=e,t.green=i,t.blue=n,delete t.reference),t.actions=[{action:si,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,red:e,green:i,blue:n,transparentAt:null!=t.transparentAt?t.transparentAt:0,opaqueAt:null!=t.opaqueAt?t.opaqueAt:1}]},clampChannels:function(t){let e=null!=t.lowRed?t.lowRed:0,i=null!=t.lowGreen?t.lowGreen:0,n=null!=t.lowBlue?t.lowBlue:0,s=null!=t.highRed?t.highRed:255,r=null!=t.highGreen?t.highGreen:255,o=null!=t.highBlue?t.highBlue:255;null!=t.lowColor&&([e,i,n]=qu.extractRGBfromColor(t.lowColor),t.lowRed=e,t.lowGreen=i,t.lowBlue=n,delete t.lowColor),null!=t.highColor&&([s,r,o]=qu.extractRGBfromColor(t.highColor),t.highRed=s,t.highGreen=r,t.highBlue=o,delete t.highColor),t.actions=[{action:Ke,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,lowRed:e,lowGreen:i,lowBlue:n,highRed:s,highGreen:r,highBlue:o}]},compose:function(t){t.actions=[{action:ri,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,lineMix:null!=t.lineMix?t.lineMix:wl,compose:null!=t.compose?t.compose:xo,offsetX:null!=t.offsetX?t.offsetX:0,offsetY:null!=t.offsetY?t.offsetY:0,opacity:null!=t.opacity?t.opacity:1}]},corrode:function(t){t.actions=[{action:fi,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,width:null!=t.width?t.width:3,height:null!=t.height?t.height:3,offsetX:null!=t.offsetX?t.offsetX:1,offsetY:null!=t.offsetY?t.offsetY:1,includeRed:null!=t.includeRed&&t.includeRed,includeGreen:null!=t.includeGreen&&t.includeGreen,includeBlue:null!=t.includeBlue&&t.includeBlue,includeAlpha:null==t.includeAlpha||t.includeAlpha,operation:null!=t.operation?t.operation:ds,opacity:null!=t.opacity?t.opacity:1}]},curveWeights:function(t){t.actions=[{action:gl,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,weights:null!=t.weights&&t.weights,useMixedChannel:null==t.useMixedChannel||t.useMixedChannel}]},cyan:function(t){t.actions=[{action:Oe,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,includeGreen:!0,includeBlue:!0,excludeRed:!0}]},displace:function(t){t.actions=[{action:xi,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,lineMix:null!=t.lineMix?t.lineMix:wl,opacity:null!=t.opacity?t.opacity:1,channelX:null!=t.channelX?t.channelX:_r,channelY:null!=t.channelY?t.channelY:yn,offsetX:null!=t.offsetX?t.offsetX:0,offsetY:null!=t.offsetY?t.offsetY:0,scaleX:null!=t.scaleX?t.scaleX:1,scaleY:null!=t.scaleY?t.scaleY:1,transparentEdges:null!=t.transparentEdges&&t.transparentEdges}]},edgeDetect:function(t){t.actions=[{action:us,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,width:3,height:3,offsetX:1,offsetY:1,includeRed:!0,includeGreen:!0,includeBlue:!0,includeAlpha:!1,weights:[0,1,0,1,-4,1,0,1,0]}]},emboss:function(t){const e=[];t.useNaturalGrayscale?e.push({action:mn,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:Li}):e.push({action:Oe,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:Li,includeRed:!0,includeGreen:!0,includeBlue:!0}),t.clamp&&e.push({action:Ke,lineIn:Li,lineOut:Li,lowRed:0+t.clamp,lowGreen:0+t.clamp,lowBlue:0+t.clamp,highRed:255-t.clamp,highGreen:255-t.clamp,highBlue:255-t.clamp}),t.smoothing&&e.push({action:hn,lineIn:Li,lineOut:Li,radius:t.smoothing}),e.push({action:Bi,lineIn:Li,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,angle:null!=t.angle?t.angle:0,strength:null!=t.strength?t.strength:1,tolerance:null!=t.tolerance?t.tolerance:0,keepOnlyChangedAreas:null!=t.keepOnlyChangedAreas&&t.keepOnlyChangedAreas,postProcessResults:null==t.postProcessResults||t.postProcessResults}),t.actions=e},flood:function(t){let e=null!=t.red?t.red:0,i=null!=t.green?t.green:0,n=null!=t.blue?t.blue:0,s=null!=t.alpha?t.alpha:255;const r=null!=t.excludeAlpha&&t.excludeAlpha;null!=t.reference&&([e,i,n,s]=qu.extractRGBfromColor(t.reference),s=Ft(255*s),t.red=e,t.green=i,t.blue=n,t.alpha=s,delete t.reference),t.actions=[{action:Zi,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,red:e,green:i,blue:n,alpha:s,excludeAlpha:r}]},gaussianBlur:function(t){t.actions=[{action:hn,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,radius:null!=t.radius?t.radius:1}]},glitch:function(t){t.actions=[{action:fn,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,useMixedChannel:null==t.useMixedChannel||t.useMixedChannel,seed:null!=t.seed?t.seed:Si,step:null!=t.step?t.step:1,offsetMin:null!=t.offsetMin?t.offsetMin:0,offsetMax:null!=t.offsetMax?t.offsetMax:0,offsetRedMin:null!=t.offsetRedMin?t.offsetRedMin:0,offsetRedMax:null!=t.offsetRedMax?t.offsetRedMax:0,offsetGreenMin:null!=t.offsetGreenMin?t.offsetGreenMin:0,offsetGreenMax:null!=t.offsetGreenMax?t.offsetGreenMax:0,offsetBlueMin:null!=t.offsetBlueMin?t.offsetBlueMin:0,offsetBlueMax:null!=t.offsetBlueMax?t.offsetBlueMax:0,offsetAlphaMin:null!=t.offsetAlphaMin?t.offsetAlphaMin:0,offsetAlphaMax:null!=t.offsetAlphaMax?t.offsetAlphaMax:0,transparentEdges:null!=t.transparentEdges&&t.transparentEdges,level:null!=t.level?t.level:0}]},gray:function(t){t.actions=[{action:Oe,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,includeRed:!0,includeGreen:!0,includeBlue:!0}]},grayscale:function(t){t.actions=[{action:mn,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1}]},green:function(t){t.actions=[{action:Oe,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,excludeRed:!0,excludeBlue:!0}]},image:function(t){t.actions=[{action:hr,lineOut:null!=t.lineOut?t.lineOut:wl,asset:null!=t.asset?t.asset:wl,width:null!=t.width?t.width:1,height:null!=t.height?t.height:1,copyWidth:null!=t.copyWidth?t.copyWidth:1,copyHeight:null!=t.copyHeight?t.copyHeight:1,copyX:null!=t.copyX?t.copyX:0,copyY:null!=t.copyY?t.copyY:0}]},invert:function(t){t.actions=[{action:$n,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,includeRed:!0,includeGreen:!0,includeBlue:!0}]},magenta:function(t){t.actions=[{action:Oe,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,includeRed:!0,includeBlue:!0,excludeGreen:!0}]},mapToGradient:function(t){t.gradient&&t.gradient.substring&&(t.gradient=B[t.gradient]),t.actions=[{action:ls,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,useNaturalGrayscale:null!=t.useNaturalGrayscale&&t.useNaturalGrayscale,gradient:t.gradient||yg()}]},matrix:function(t){t.actions=[{action:us,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,width:3,height:3,offsetX:1,offsetY:1,includeRed:null==t.includeRed||t.includeRed,includeGreen:null==t.includeGreen||t.includeGreen,includeBlue:null==t.includeBlue||t.includeBlue,includeAlpha:null!=t.includeAlpha&&t.includeAlpha,weights:null!=t.weights?t.weights:[0,0,0,0,1,0,0,0,0]}]},matrix5:function(t){t.actions=[{action:us,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,width:5,height:5,offsetX:2,offsetY:2,includeRed:null==t.includeRed||t.includeRed,includeGreen:null==t.includeGreen||t.includeGreen,includeBlue:null==t.includeBlue||t.includeBlue,includeAlpha:null!=t.includeAlpha&&t.includeAlpha,weights:null!=t.weights?t.weights:[0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]}]},newsprint:function(t){t.actions=[{action:Fs,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,width:null!=t.width?t.width:1}]},notblue:function(t){t.actions=[{action:fo,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,includeBlue:!0,level:0}]},notgreen:function(t){t.actions=[{action:fo,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,includeGreen:!0,level:0}]},notred:function(t){t.actions=[{action:fo,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,includeRed:!0,level:0}]},offset:function(t){t.actions=[{action:Ms,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,offsetRedX:null!=t.offsetX?t.offsetX:0,offsetRedY:null!=t.offsetY?t.offsetY:0,offsetGreenX:null!=t.offsetX?t.offsetX:0,offsetGreenY:null!=t.offsetY?t.offsetY:0,offsetBlueX:null!=t.offsetX?t.offsetX:0,offsetBlueY:null!=t.offsetY?t.offsetY:0,offsetAlphaX:null!=t.offsetX?t.offsetX:0,offsetAlphaY:null!=t.offsetY?t.offsetY:0}]},offsetChannels:function(t){t.actions=[{action:Ms,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,offsetRedX:null!=t.offsetRedX?t.offsetRedX:0,offsetRedY:null!=t.offsetRedY?t.offsetRedY:0,offsetGreenX:null!=t.offsetGreenX?t.offsetGreenX:0,offsetGreenY:null!=t.offsetGreenY?t.offsetGreenY:0,offsetBlueX:null!=t.offsetBlueX?t.offsetBlueX:0,offsetBlueY:null!=t.offsetBlueY?t.offsetBlueY:0,offsetAlphaX:null!=t.offsetAlphaX?t.offsetAlphaX:0,offsetAlphaY:null!=t.offsetAlphaY?t.offsetAlphaY:0}]},pixelate:function(t){t.actions=[{action:Js,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,tileWidth:null!=t.tileWidth?t.tileWidth:1,tileHeight:null!=t.tileHeight?t.tileHeight:1,offsetX:null!=t.offsetX?t.offsetX:0,offsetY:null!=t.offsetY?t.offsetY:0,includeRed:null==t.includeRed||t.includeRed,includeGreen:null==t.includeGreen||t.includeGreen,includeBlue:null==t.includeBlue||t.includeBlue,includeAlpha:null!=t.includeAlpha&&t.includeAlpha}]},randomNoise:function(t){const e=Hs.includes(t.noiseType)?t.noiseType:zr;t.actions=[{action:Nr,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,width:null!=t.width?t.width:1,height:null!=t.height?t.height:1,seed:null!=t.seed?t.seed:Si,noiseType:e,level:null!=t.level?t.level:0,noWrap:null!=t.noWrap&&t.noWrap,includeRed:null==t.includeRed||t.includeRed,includeGreen:null==t.includeGreen||t.includeGreen,includeBlue:null==t.includeBlue||t.includeBlue,includeAlpha:null==t.includeAlpha||t.includeAlpha,excludeTransparentPixels:null==t.excludeTransparentPixels||t.excludeTransparentPixels}]},red:function(t){t.actions=[{action:Oe,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,excludeGreen:!0,excludeBlue:!0}]},reducePalette:function(t){let e=null!=t.palette?t.palette:He;t.actions=[],e.substring&&e.includes(be)&&(e=e.split(be),e.forEach((t=>t.trim())));let i=t.useBluenoise?$e:t.noiseType||zr;Hs.includes(i)||(i=zr),t.actions.push({action:Kr,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,seed:null!=t.seed?t.seed:Si,minimumColorDistance:null!=t.minimumColorDistance?t.minimumColorDistance:1e3,useLabForPaletteDistance:null!=t.useLabForPaletteDistance&&t.useLabForPaletteDistance,palette:e,noiseType:i,opacity:null!=t.opacity?t.opacity:1})},saturation:function(t){const e=null!=t.level?t.level:1;t.actions=[{action:gs,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,red:e,green:e,blue:e,saturation:!0}]},sepia:function(t){t.actions=[{action:Wa,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,redInRed:.393,redInGreen:.349,redInBlue:.272,greenInRed:.769,greenInGreen:.686,greenInBlue:.534,blueInRed:.189,blueInGreen:.168,blueInBlue:.131}]},sharpen:function(t){t.actions=[{action:us,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,width:3,height:3,offsetX:1,offsetY:1,includeRed:!0,includeGreen:!0,includeBlue:!0,includeAlpha:!1,weights:[0,-1,0,-1,5,-1,0,-1,0]}]},swirl:function(t){const e=null!=t.startX?t.startX:Zs,i=null!=t.startY?t.startY:Zs,n=null!=t.innerRadius?t.innerRadius:0,s=null!=t.outerRadius?t.outerRadius:"30%",r=null!=t.angle?t.angle:0,o=null!=t.easing?t.easing:es,a=[...null!=t.staticSwirls?t.staticSwirls:[]];a.push([e,i,n,s,r,o]),t.actions=[{action:Wo,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,swirls:a}]},threshold:function(t){let e=null!=t.lowRed?t.lowRed:0,i=null!=t.lowGreen?t.lowGreen:0,n=null!=t.lowBlue?t.lowBlue:0,s=null!=t.lowAlpha?t.lowAlpha:255,r=null!=t.highRed?t.highRed:255,o=null!=t.highGreen?t.highGreen:255,a=null!=t.highBlue?t.highBlue:255,l=null!=t.highAlpha?t.highAlpha:255;null!=t.lowColor&&([e,i,n,s]=qu.extractRGBfromColor(t.lowColor),s=Ft(255*s),t.lowRed=e,t.lowGreen=i,t.lowBlue=n,t.lowAlpha=s,t.low=[e,i,n,s],delete t.lowColor),null!=t.highColor&&([r,o,a,l]=qu.extractRGBfromColor(t.highColor),l=Ft(255*l),t.highRed=r,t.highGreen=o,t.highBlue=a,t.highAlpha=l,t.high=[r,o,a,l],delete t.highColor);const c=null!=t.low?t.low:[e,i,n,s],h=null!=t.high?t.high:[r,o,a,l];t.actions=[{action:za,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,level:null!=t.level?t.level:128,red:null!=t.red?t.red:128,green:null!=t.green?t.green:128,blue:null!=t.blue?t.blue:128,alpha:null!=t.alpha?t.alpha:128,low:c,high:h,includeRed:null==t.includeRed||t.includeRed,includeGreen:null==t.includeGreen||t.includeGreen,includeBlue:null==t.includeBlue||t.includeBlue,includeAlpha:null!=t.includeAlpha&&t.includeAlpha,useMixedChannel:null==t.useMixedChannel||t.useMixedChannel}]},tiles:function(t){t.actions=[{action:Va,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,tileWidth:null!=t.tileWidth?t.tileWidth:1,tileHeight:null!=t.tileHeight?t.tileHeight:1,tileRadius:null!=t.tileRadius?t.tileRadius:1,offsetX:null!=t.offsetX?t.offsetX:0,offsetY:null!=t.offsetY?t.offsetY:0,angle:null!=t.angle?t.angle:0,points:null!=t.points?t.points:Ur,seed:null!=t.seed?t.seed:Si,includeRed:null==t.includeRed||t.includeRed,includeGreen:null==t.includeGreen||t.includeGreen,includeBlue:null==t.includeBlue||t.includeBlue,includeAlpha:null!=t.includeAlpha&&t.includeAlpha}]},tint:function(t){let e=null!=t.redInRed?t.redInRed:1,i=null!=t.redInGreen?t.redInGreen:0,n=null!=t.redInBlue?t.redInBlue:0,s=null!=t.greenInRed?t.greenInRed:0,r=null!=t.greenInGreen?t.greenInGreen:1,o=null!=t.greenInBlue?t.greenInBlue:0,a=null!=t.blueInRed?t.blueInRed:0,l=null!=t.blueInGreen?t.blueInGreen:0,c=null!=t.blueInBlue?t.blueInBlue:1;null!=t.redColor&&([e,s,a]=qu.extractRGBfromColor(t.redColor),e/=255,s/=255,a/=255,t.redInRed=e,t.greenInRed=s,t.blueInRed=a,delete t.redColor),null!=t.greenColor&&([i,r,l]=qu.extractRGBfromColor(t.greenColor),i/=255,r/=255,l/=255,t.redInGreen=i,t.greenInGreen=r,t.blueInGreen=l,delete t.greenColor),null!=t.blueColor&&([n,o,c]=qu.extractRGBfromColor(t.blueColor),n/=255,o/=255,c/=255,t.redInBlue=n,t.greenInBlue=o,t.blueInBlue=c,delete t.blueColor),t.actions=[{action:Wa,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,redInRed:e,redInGreen:i,redInBlue:n,greenInRed:s,greenInGreen:r,greenInBlue:o,blueInRed:a,blueInGreen:l,blueInBlue:c}]},userDefined:function(t){t.actions=[{action:fl,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1}]},yellow:function(t){t.actions=[{action:Oe,lineIn:null!=t.lineIn?t.lineIn:wl,lineOut:null!=t.lineOut?t.lineOut:wl,opacity:null!=t.opacity?t.opacity:1,includeRed:!0,includeGreen:!0,excludeBlue:!0}]}}),vg=function(t){return!!t&&new Filter(t)};Q.Filter=Filter;const Force=function(t=Ml){return this.makeName(t.name),this.register(),this.set(this.defs),this.set(t),this.action||(this.action=Il),this},Cg=Force.prototype=sc();Cg.type="Force",Cg.lib="force",Cg.isArtefact=!1,Cg.isAsset=!1,ih(Cg);Cg.defs=_l(Cg.defs,{action:null}),Cg.packetFunctions=ql(Cg.packetFunctions,["action"]),Cg.kill=function(){return this.deregister(),!0};Cg.setters.action=function(t){Vl(t)?this.action=t:this.action=Il};const Pg=function(t){return!!t&&new Force(t)};Q.Force=Force,Pg({name:"gravity",action:(t,e)=>{const{mass:i,load:n}=t,s=Gd();s.setFromVector(e.gravity).scalarMultiply(i),n.vectorAdd(s),jd(s)}});const Grid=function(t=Ml){return this.tileFill=[],this.tileSources=[],this.entityInit(t),t.tileSources||(this.tileSources=[].concat([{type:ni,source:Te},{type:ni,source:bl}])),t.tileFill?gt(t.tileFill)&&this.tileFill.length===t.tileFill.length&&(this.tileFill=t.tileFill):(this.tileFill.length=this.columns*this.rows,this.tileFill.fill(0)),this.tilePaths=[],this.tileRealCoordinates=[],this.tileVirtualCoordinates=[],t.dimensions||(t.width||(this.currentDimensions[0]=this.dimensions[0]=20),t.height||(this.currentDimensions[1]=this.dimensions[1]=20)),this},xg=Grid.prototype=sc();xg.type="Grid",xg.lib=Yi,xg.isArtefact=!0,xg.isAsset=!1,ih(xg),Gf(xg);const wg={columns:2,rows:2,columnGutterWidth:1,rowGutterWidth:1,tileSources:null,tileFill:null,gutterColor:"rgb(127 127 127 / 1)"};xg.defs=_l(xg.defs,wg),xg.packetExclusions=ql(xg.packetExclusions,["tileSources"]),xg.finalizePacketOut=function(t,e){const i=t.tileSources=[];this.tileSources.forEach((t=>{i.push({type:t.type,source:Ul(t.source)?t.source.name:t.source})})),Ul(t.gutterColor)&&(t.gutterColor=t.gutterColor.name);const n=vt(this.state.saveAsPacket(e))[3];return t=_l(t,n),t=this.handlePacketAnchor(t,e)};const Og=xg.setters,Dg=xg.deltaSetters;Og.columns=function(t){if(Wl(t)&&(yt(t)||(t=parseInt(t,10)),t!==this.columns)){let e,i,n;const s=this.tileFill,r=this.columns,o=[];for(this.columns=t,e=0,i=this.rows;e{Wl(t)&&(i[t]=e)})),this.dirtyFilterIdentifier=!0),this},xg.setTileSourceTo=function(t,e){return Wl(t)&&Ul(e)&&e.type&&e.source&&(this.tileSources[t]=e),this},xg.removeTileSource=function(t){return Wl(t)&&t&&(this.tileSources[t]=null,this.tileFill=this.tileFill.map((e=>e===t?0:e))),this},xg.getTileSource=function(t,e){if(Wl(t))return Wl(e)?this.tileFill[t*this.rows+e]:this.tileFill[t]},xg.getTilesUsingSource=function(t){const e=[];return Wl(t)&&this.tileFill.forEach(((i,n)=>i===t&&e.push(n))),e},xg.cleanPathObject=function(){if(this.dirtyPathObject=!1,!this.noPathUpdates||!this.pathObject){const t=this.pathObject=new Path2D,e=new Path2D,i=new Path2D,n=this.currentStampHandlePosition,s=this.currentScale,r=this.currentDimensions,o=-n[0]*s,a=-n[1]*s,l=r[0]*s,c=r[1]*s;t.rect(o,a,l,c);const h=this.columns,u=this.rows,d=l/h,f=c/u,p=this.tilePaths,g=this.tileRealCoordinates,m=this.tileVirtualCoordinates;let y,b,S,k;for(e.moveTo(o,a),e.lineTo(o+l,a),y=1;y<=u;y++){const t=a+y*f;e.moveTo(o,t),e.lineTo(o+l,t)}for(this.rowLines=e,i.moveTo(o,a),i.lineTo(o,a+c),b=1;b<=h;b++)S=o+b*d,i.moveTo(S,a),i.lineTo(S,a+c);for(this.columnLines=i,p.length=0,g.length=0,m.length=0,y=0;y0){t.save();const e=gu(),i=e.engine,n=e.element,s=this.tileSources,r=this.tileFill,o=this.tilePaths,a=this.tileRealCoordinates,l=this.tileVirtualCoordinates,c=this.winding,h=this.currentTileWidth,u=this.currentTileHeight,d=this.scale,f=this.currentDimensions;let p;s.forEach(((s,g)=>{if(s&&s.type)switch(s.type){case ni:t.fillStyle=s.source;break;case Ve:this.lockFillStyleToEntity=!1,t.fillStyle=s.source.getData(this,this.currentHost);break;case bn:this.lockFillStyleToEntity=!0,t.fillStyle=s.source.getData(this,this.currentHost)}const y=r.map((t=>t===g));if(y.length)switch(s.type){case Sn:p=s.source.substring?m[s.source]:s.source,p.simpleStamp&&(n.width=f[0]*d,n.height=f[1]*d,i.globalCompositeOperation=xo,i.fillStyle=Te,y.forEach(((t,e)=>{t&&i.fillRect(l[e][0],l[e][1],h,u)})),i.globalCompositeOperation=Co,p.simpleStamp(e,{startX:0,startY:0,width:f[0]*d,height:f[1]*d,method:zi}),t.drawImage(n,~~a[0][0],~~a[0][1]));break;case Na:p=s.source.substring?m[s.source]:s.source,p.simpleStamp&&(n.width=h,n.height=u,i.globalCompositeOperation=xo,p.simpleStamp(e,{startX:0,startY:0,width:h,height:u,method:zi}),y.forEach(((e,i)=>e&&t.drawImage(n,~~a[i][0],~~a[i][1]))));break;default:y.forEach(((e,i)=>e&&t.fill(o[i],c)))}}));const g=this.gutterColor,y=this.rowGutterWidth,b=this.columnGutterWidth;let S;if(Jl(g)){switch(g.substring?S={type:ni,source:this.gutterColor}:Ul(g)?S=g:Wl(g)&&Ul(s[g])&&(S=s[g]),S.type){case Ve:this.lockFillStyleToEntity=!1,t.strokeStyle=S.source.getData(this,this.currentHost);break;case bn:this.lockFillStyleToEntity=!0,t.strokeStyle=S.source.getData(this,this.currentHost);break;case ni:t.strokeStyle=S.source}switch(S.type){case Sn:case Na:if((y||b)&&(p=S.source.substring?m[S.source]:S.source,p.simpleStamp)){const s=this.currentStampHandlePosition,r=this.currentScale,o=s[0]*r,l=s[1]*r;n.width=f[0]*r,n.height=f[1]*r,i.globalCompositeOperation=xo,i.strokeStyle=Te,i.translate(o,l),y&&(i.lineWidth=y,i.stroke(this.rowLines)),b&&(i.lineWidth=b,i.stroke(this.columnLines)),i.globalCompositeOperation=Co,p.simpleStamp(e,{startX:0,startY:0,width:f[0]*r,height:f[1]*r,method:zi}),t.drawImage(n,~~a[0][0],~~a[0][1]),i.translate(0,0)}break;default:y&&(t.lineWidth=y,t.stroke(this.rowLines)),b&&(t.lineWidth=b,t.stroke(this.columnLines))}}mu(e),t.restore()}},xg.fill=function(t){this.performFill(t)},xg.drawAndFill=function(t){const e=this.pathObject;t.stroke(e),this.currentHost.clearShadow(),this.performFill(t)},xg.fillAndDraw=function(t){const e=this.pathObject;t.stroke(e),this.currentHost.clearShadow(),this.performFill(t),t.stroke(e)},xg.drawThenFill=function(t){const e=this.pathObject;t.stroke(e),this.performFill(t)},xg.fillThenDraw=function(t){const e=this.pathObject;this.performFill(t),t.stroke(e)},xg.checkHit=function(t=[]){if(this.noUserInteraction)return!1;this.pathObject&&!this.dirtyPathObject||this.cleanPathObject();const e=gt(t)?t:[t],i=gu(),n=i.engine,s=this.currentStampPosition,r=s[0],o=s[1],a=new Set,l=this.tilePaths;let c,h,u;const d=t=>{let e,i;if(gt(t))e=t[0],i=t[1];else{if(!tc(t,t.x,t.y))return[!1];e=t.x,i=t.y}return mt(e)&&mt(i)?[!0,e,i]:[!1]};return i.rotateDestination(n,r,o,this),e.some((t=>([c,h,u]=d(t),!!c&&n.isPointInPath(this.pathObject,h,u,this.winding))),this)?(e.forEach((t=>{[c,h,u]=d(t),c&&l.some(((t,e)=>!!n.isPointInPath(t,h,u,this.winding)&&(a.add(e),!0)))})),mu(i),{x:h,y:u,tiles:[...a],artefact:this}):(mu(i),!1)};const Fg=function(t){return!!t&&new Grid(t)};Q.Grid=Grid;const Label=function(t=Ml){return this.entityInit(t),this},Rg=Label.prototype=sc();Rg.type=aa,Rg.lib=Yi,Rg.isArtefact=!0,Rg.isAsset=!1,ih(Rg),Gf(Rg),Up(Rg);const Tg={text:wl,showBoundingBox:!1,boundingBoxStyle:Te,boundingBoxLineWidth:1,boundingBoxLineDash:null,boundingBoxLineDashOffset:0};Rg.defs=_l(Rg.defs,Tg);const Hg=Rg.getters,Eg=Rg.setters,Ig=Rg.deltaSetters;Hg.width=function(){return this.currentDimensions[0]},Eg.width=Il,Ig.width=Il,Hg.height=function(){return this.currentDimensions[1]},Eg.height=Il,Ig.height=Il,Hg.dimensions=function(){return[...this.currentDimensions]},Eg.dimensions=Il,Ig.dimensions=Il,Rg.entityInit=function(t=Ml){this.modifyConstructorInputForAnchorButton(t),this.makeName(t.name),this.register(),this.initializePositions(),this.state=_h(Ml),this.defaultTextStyle=Vp({name:`${this.name}_default-textstyle`,isDefaultTextStyle:!0}),this.set(this.defs),t.group||(t.group=of),this.onEnter=Il,this.onLeave=Il,this.onDown=Il,this.onUp=Il,this.currentFontIsLoaded=!1,this.updateUsingFontParts=!1,this.updateUsingFontString=!1,this.usingViewportFontSizing=!0,this.letterSpaceValue=0,this.wordSpaceValue=0,this.delta={},this.set(t),this.midInitActions(t),this.purge&&this.purgeArtefact(this.purge),this.dirtyFont=!0,this.currentFontIsLoaded=!1},Rg.measureFont=function(){const{defaultTextStyle:t,currentScale:e,dimensions:i}=this,{fontFamily:n,fontSizeValue:s,letterSpaceValue:r,wordSpaceValue:o}=t;t.letterSpacing=r*e+"px",t.wordSpacing=o*e+"px";const a=gu(),l=a.engine;l.font=t.canvasFont,l.fontKerning=t.fontKerning,l.fontStretch=t.fontStretch,l.fontVariantCaps=t.fontVariantCaps,l.textRendering=t.textRendering,l.letterSpacing=t.letterSpacing,l.wordSpacing=t.wordSpacing,l.direction=t.direction,l.textAlign=Jn,l.textBaseline=Ua;const c=l.measureText(this.text);mu(a);const{actualBoundingBoxLeft:h,actualBoundingBoxRight:u}=c,d=this.getFontMetadata(n),f=s/100;i&&(i[0]=rt(tt(h)+tt(u)),i[1]=d.height*f*e);const p=d.verticalOffset*f;this.alphabeticBaseline=(d.alphabeticBaseline*f+p)*e,this.hangingBaseline=(d.hangingBaseline*f+p)*e,this.ideographicBaseline=(d.ideographicBaseline*f+p)*e,this.fontVerticalOffset=p,this.dirtyPathObject=!0,this.dirtyDimensions=!0},Rg.cleanPathObject=function(){this.dirtyPathObject=!1;const t=this.pathObject=new Path2D,e=this.currentHandle,i=this.currentDimensions,[n,s]=e,[r,o]=i;t.rect(-n,-s,r,o)},Rg.cleanDimensions=function(){this.dirtyDimensions=!1;const t=this.dimensions,e=this.currentDimensions,[i,n]=e;e[0]=t[0],e[1]=t[1],this.dirtyStart=!0,this.dirtyHandle=!0,this.dirtyOffset=!0,i===e[0]&&n===e[1]||(this.dirtyPositionSubscribers=!0),this.mimicked&&this.mimicked.length&&(this.dirtyMimicDimensions=!0),this.dirtyFilterIdentifier=!0},Rg.cleanHandle=function(){this.dirtyHandle=!1;const{handle:t,currentHandle:e,currentDimensions:i,mimicked:n,defaultTextStyle:s,alphabeticBaseline:r,hangingBaseline:o,ideographicBaseline:a}=this,[l,c]=t,[h,u]=i,d=s.direction||os;l.toFixed?e[0]=l:l===Jn?e[0]=0:l===ao?e[0]=h:l===We?e[0]=h/2:l===Ro?e[0]=d===os?0:h:l===$i?e[0]=d===os?h:0:mt(parseFloat(l))?e[0]=parseFloat(l)/100*h:e[0]=0,c.toFixed?e[1]=c:c===Ua?e[1]=0:c===Ge?e[1]=u:c===We||c===ps?e[1]=u/2:c===An?e[1]=mt(o)?o:0:c===ue?e[1]=mt(r)?r:0:c===Tn?e[1]=mt(a)?a:0:mt(parseFloat(c))?e[1]=parseFloat(c)/100*u:e[1]=0,this.dirtyFilterIdentifier=!0,this.dirtyStampHandlePositions=!0,n&&n.length&&(this.dirtyMimicHandle=!0)},Rg.prepareStamp=function(){this.dirtyHost&&(this.dirtyHost=!1),(this.dirtyScale||this.dirtyDimensions||this.dirtyStart||this.dirtyOffset||this.dirtyHandle)&&(this.dirtyPathObject=!0),this.dirtyScale&&this.cleanScale(),this.dirtyText&&this.updateAccessibleTextHold(),this.dirtyFont&&this.cleanFont(),this.dirtyDimensions&&this.cleanDimensions(),this.dirtyLock&&this.cleanLock(),this.dirtyStart&&this.cleanStart(),this.dirtyOffset&&this.cleanOffset(),this.dirtyHandle&&this.cleanHandle(),this.dirtyRotation&&this.cleanRotation(),(this.isBeingDragged||this.lockTo.includes(ms)||this.lockTo.includes(zs))&&(this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtyStampHandlePositions&&this.cleanStampHandlePositions(),this.dirtyPathObject&&this.cleanPathObject(),this.dirtyPositionSubscribers&&this.updatePositionSubscribers(),this.prepareStampTabsHelper()},Rg.regularStamp=function(){const t=this.currentHost,e=this.defaultTextStyle;if(t&&e){const i=t.engine,[n,s]=this.currentStampPosition;t.rotateDestination(i,n,s,this),this.noCanvasEngineUpdates||(this.state.set(this.defaultTextStyle),t.setEngine(this)),this.setImageSmoothing(t.engine),this[e.method](t)}},Rg.stampPositioningHelper=function(){const{currentHandle:t,currentScale:e,text:i,fontVerticalOffset:n}=this,s=-t[0],r=-t[1]+n*e;return[i,ut(s),ut(r)]},Rg.underlineEngine=function(t,e){const{currentDimensions:i,currentScale:n,currentStampPosition:s,defaultTextStyle:r,fontVerticalOffset:o}=this,{underlineGap:a,underlineOffset:l,underlineStyle:c,underlineWidth:h}=r,[,u,d]=e,[f,p]=i,g=d+l*p-o*n,m=h*n,{element:y,engine:b}=t,S=gu(y.width,y.height),{element:k,engine:A}=S;S.rotateDestination(A,...s,this),A.fillStyle=Te,A.strokeStyle=Te,A.font=r.canvasFont,A.fontKerning=r.fontKerning,A.fontStretch=r.fontStretch,A.fontVariantCaps=r.fontVariant,A.textRendering=r.textRendering,A.letterSpacing=r.letterSpacing,A.lineCap=ho,A.lineJoin=ho,A.wordSpacing=r.wordSpacing,A.direction=r.direction,A.textAlign=Jn,A.textBaseline=Ua,A.lineWidth=2*a*n,this.setImageSmoothing(A);const v=this.getStyle(c,"fillStyle",S);A.strokeText(...e),A.fillText(...e),A.globalCompositeOperation="source-out",A.fillStyle=v,A.fillRect(u,g,f,m),b.save(),b.resetTransform(),this.setImageSmoothing(b),b.drawImage(k,0,0),b.restore(),mu(S)},Rg.drawBoundingBox=function(t){if(this.pathObject){const e=this.getStyle(this.boundingBoxStyle,"fillStyle",t),i=t.engine;i.save(),i.strokeStyle=e,i.lineWidth=this.boundingBoxLineWidth,i.setLineDash(this.boundingBoxLineDash||[]),i.lineDashOffset=this.boundingBoxLineDashOffset||0,i.globalCompositeOperation=xo,i.globalAlpha=1,i.shadowOffsetX=0,i.shadowOffsetY=0,i.shadowBlur=0,this.setImageSmoothing(i),i.stroke(this.pathObject),i.restore()}},Rg.draw=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=this.stampPositioningHelper();this.defaultTextStyle&&this.defaultTextStyle.includeUnderline&&this.underlineEngine(t,i),e.strokeText(...i),this.showBoundingBox&&this.drawBoundingBox(t)}},Rg.fill=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=this.stampPositioningHelper();this.defaultTextStyle&&this.defaultTextStyle.includeUnderline&&this.underlineEngine(t,i),e.fillText(...i),this.showBoundingBox&&this.drawBoundingBox(t)}},Rg.drawAndFill=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=this.stampPositioningHelper();this.defaultTextStyle&&this.defaultTextStyle.includeUnderline&&this.underlineEngine(t,i),e.strokeText(...i),e.fillText(...i),this.currentHost.clearShadow(),e.strokeText(...i),e.fillText(...i),this.showBoundingBox&&this.drawBoundingBox(t)}},Rg.fillAndDraw=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=this.stampPositioningHelper();this.defaultTextStyle&&this.defaultTextStyle.includeUnderline&&this.underlineEngine(t,i),e.fillText(...i),e.strokeText(...i),this.currentHost.clearShadow(),e.fillText(...i),e.strokeText(...i),this.showBoundingBox&&this.drawBoundingBox(t)}},Rg.drawThenFill=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=this.stampPositioningHelper();this.defaultTextStyle&&this.defaultTextStyle.includeUnderline&&this.underlineEngine(t,i),e.strokeText(...i),e.fillText(...i),this.showBoundingBox&&this.drawBoundingBox(t)}},Rg.fillThenDraw=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=this.stampPositioningHelper();this.defaultTextStyle&&this.defaultTextStyle.includeUnderline&&this.underlineEngine(t,i),e.fillText(...i),e.strokeText(...i),this.showBoundingBox&&this.drawBoundingBox(t)}},Rg.clip=function(t){t.engine.clip(this.pathObject,this.winding)},Rg.clear=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=e.globalCompositeOperation,n=this.stampPositioningHelper();e.globalCompositeOperation=Ai,e.fillText(...n),e.globalCompositeOperation=i,this.showBoundingBox&&this.drawBoundingBox(t)}},Rg.none=Il;const Bg=function(t){return!!t&&new Label(t)};Q.Label=Label;const Line=function(t=Ml){return this.curveInit(t),this.shapeInit(t),this},Lg=Line.prototype=sc();Lg.type=la,Lg.lib=Yi,Lg.isArtefact=!0,Lg.isAsset=!1,ih(Lg),Kf(Lg),Qf(Lg),Lg.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeLinePath()},Lg.makeLinePath=function(){let t=xl;const{currentStampPosition:e,currentEnd:i}=this;if(e&&i){const[e,i]=this.currentStampPosition,[n,s]=this.currentEnd;t=`m0,0l${(n-e).toFixed(2)},${(s-i).toFixed(2)}`}return t},Lg.cleanDimensions=function(){this.dirtyDimensions=!1,this.dirtyHandle=!0,this.dirtyOffset=!0,this.dirtyStart=!0,this.dirtyEnd=!0},Lg.preparePinsForStamp=function(){const t=this.dirtyPins,e=this.endPivot,i=this.endPath;let n,s,r;for(n=0,s=t.length;n1)&&(this.fromPathStart=t-ut(t)),t=this.fromPathEnd,(t<0||t>1)&&(this.fromPathEnd=t-ut(t)),t=this.toPathStart,(t<0||t>1)&&(this.toPathStart=t-ut(t)),t=this.toPathEnd,(t<0||t>1)&&(this.toPathEnd=t-ut(t))}this.dirtyOutput=!0},Vg.fromPathStart=function(t){this.loopPathCursors&&(t<0||t>1)&&(t-=ut(t)),this.fromPathStart=t,this.synchronizePathCursors&&(this.toPathStart=t),this.dirtyPathData=!0},Wg.fromPathStart=function(t){let e=this.fromPathStart+=t;this.loopPathCursors&&(e<0||e>1)&&(e-=ut(e)),this.fromPathStart=e,this.synchronizePathCursors&&(this.toPathStart=e),this.dirtyPathData=!0},Vg.fromPathEnd=function(t){this.loopPathCursors&&(t<0||t>1)&&(t-=ut(t)),this.fromPathEnd=t,this.synchronizePathCursors&&(this.toPathEnd=t),this.dirtyPathData=!0},Wg.fromPathEnd=function(t){let e=this.fromPathEnd+=t;this.loopPathCursors&&(e<0||e>1)&&(e-=ut(e)),this.fromPathEnd=e,this.synchronizePathCursors&&(this.toPathEnd=e),this.dirtyPathData=!0},Vg.toPathStart=function(t){this.loopPathCursors&&(t<0||t>1)&&(t-=ut(t)),this.toPathStart=t,this.synchronizePathCursors&&(this.fromPathStart=t),this.dirtyPathData=!0},Wg.toPathStart=function(t){let e=this.toPathStart+=t;this.loopPathCursors&&(e<0||e>1)&&(e-=ut(e)),this.toPathStart=e,this.synchronizePathCursors&&(this.fromPathStart=e),this.dirtyPathData=!0},Vg.toPathEnd=function(t){this.loopPathCursors&&(t<0||t>1)&&(t-=ut(t)),this.toPathEnd=t,this.synchronizePathCursors&&(this.fromPathEnd=t),this.dirtyPathData=!0},Wg.toPathEnd=function(t){let e=this.toPathEnd+=t;this.loopPathCursors&&(e<0||e>1)&&(e-=ut(e)),this.toPathEnd=e,this.synchronizePathCursors&&(this.fromPathEnd=e),this.dirtyPathData=!0},jg.getHost=function(){if(this.currentHost)return this.currentHost;if(this.host){const t=o[this.host];if(t)return this.currentHost=t,this.dirtyHost=!0,this.currentHost}return oh},jg.midInitActions=Il,jg.update=function(){this.dirtyInput=!0,this.dirtyOutput=!0},jg.prepareStamp=function(){const t=this.fromPath,e=this.toPath,[i,n]=this.getBoundingBox();if(!this.dirtyPathData){const{x:i,y:n}=t.getPathPositionData(0),{x:s,y:r}=t.getPathPositionData(1),{x:o,y:a}=e.getPathPositionData(0),{x:l,y:c}=e.getPathPositionData(1),h=[i,n,s,r,o,a,l,c];this.pathTests&&!this.pathTests.some(((t,e)=>t!==h[e]))||(this.pathTests=h,this.dirtyPathData=!0)}if(this.dirtyPathData||!this.fromPathData.length){this.dirtyPathData=!1,this.watchIndex=-1,this.engineInstructions.length=0,this.engineDeltaLengths.length=0;const s=this.fromPathData;s.length=0;const r=this.toPathData;if(r.length=0,t&&e){const o=rt(t.length),a=rt(e.length),l=this.setSourceDimension(St(o,a)),c=this.fromPathStart,h=this.fromPathEnd,u=this.toPathStart,d=this.toPathEnd,f=this.constantPathSpeed;let p,g;p=c=0&&F>=0?([g,m]=i[ut(D)],[y,b]=n[ut(F)],S=y-g,k=b-m,A=ft(S,k),h?(v=-nt(S,k)+xt,C=at(v),P=Ht(v),f.push([C,P,-P,C,g,m]),p.push(A)):(v=-nt(S,k)+c,C=at(v),P=Ht(v),f.push([C,P,-P,C,g,m,A]),p.push(A))):(f.push(!1),p.push(!1)),D+=o,F+=l,u&&(D>=s&&(D-=s),F>=s&&(F-=s));R<0&&(R=0),this.watchIndex=R}if(h)for(x=0;x=t&&(R=0);else for(x=0;x=t&&(R=0);const X=this.interferenceFactor,Y=this.interferenceLoops,G=1+~~(T*X),j=1+~~(H*X);for(B.width=G,B.height=j,$.setTransform(1,0,0,1,0,0),I.setTransform(1,0,0,1,0,0),w=0;w{if(gt(e))n=e[0],s=e[1];else{if(!tc(e,e.x,e.y))return!1;n=e.x,s=e.y}return!(!mt(n)||!mt(s))&&(r=n-t,o=s-l,!(r<0||r>c||o<0||o>h)&&(a=4*(o*c+r)+3,!!i&&i[a]>0))}),this))return{x:n,y:s,artefact:this}}return!1};const Ug=function(t){return!!t&&new Loom(t)};Q.Loom=Loom;const Mesh=function(t=Ml){return this.makeName(t.name),this.register(),this.modifyConstructorInputForAnchorButton(t),this.set(this.defs),this.state=_h(),t.group||(t.group=of),this.onEnter=Il,this.onLeave=Il,this.onDown=Il,this.onUp=Il,this.delta={},this.set(t),this.fromPathData=[],this.toPathData=[],this.watchFromPath=null,this.watchIndex=-1,this.engineInstructions=[],this.engineDeltaLengths=[],this},Zg=Mesh.prototype=sc();Zg.type="Mesh",Zg.lib=Yi,Zg.isArtefact=!0,Zg.isAsset=!1,ih(Zg),bd(Zg),vd(Zg),wd(Zg),Rd(Zg);const _g={net:null,isHorizontalCopy:!0,source:null,sourceIsVideoOrSprite:!1,interferenceLoops:2,interferenceFactor:1.03,visibility:!0,calculateOrder:0,stampOrder:0,delta:null,host:null,group:null,anchor:null,noCanvasEngineUpdates:!1,noDeltaUpdates:!1,onEnter:null,onLeave:null,onDown:null,onUp:null,noUserInteraction:!1,method:zi};Zg.defs=_l(Zg.defs,_g),Zg.packetExclusions=ql(Zg.packetExclusions,["pathObject","state"]),Zg.packetExclusionsByRegex=ql(Zg.packetExclusionsByRegex,["^(local|dirty|current)","Subscriber$"]),Zg.packetObjects=ql(Zg.packetObjects,["group","net","source"]),Zg.packetFunctions=ql(Zg.packetFunctions,["onEnter","onLeave","onDown","onUp"]),Zg.processPacketOut=function(t,e,i){let n=!0;return!i.includes(t)<0&&e===this.defs[t]&&(n=!1),n},Zg.finalizePacketOut=function(t,e){const i=vt(this.state.saveAsPacket(e))[3];return t=_l(t,i),t=this.handlePacketAnchor(t,e)},Zg.handlePacketAnchor=function(t,e){if(this.anchor){const i=vt(this.anchor.saveAsPacket(e))[3];t.anchor=i}return t},Zg.clone=Ll;const Kg=Zg.getters,qg=Zg.setters;Zg.get=function(t){const e=this.getters[t];if(e)return e.call(this);{const e=this.state;let i,n=this.defs[t];return typeof n!==ol?(i=this[t],typeof i!==ol?i:n):(n=e.defs[t],typeof n!==ol?(i=e[t],typeof i!==ol?i:n):null)}},Zg.set=function(t=Ml){const e=bt(t),i=e.length;if(i){const n=this.setters,s=this.defs,r=this.state,o=r?r.setters:Ml,a=r?r.defs:Ml;let l,c,h,u;for(c=0;c3){const{rows:i,columns:n,particleStore:s}=t;if(i&&n){this.badNet=!1,this.rows=i,this.columns=n;const t=[];s.forEach((e=>{const i=e.position,{x:n,y:s}=i;t.push([n,s])}));const r=t.join(be);e.join(be)!==r&&(this.particlePositions=t,this.dirtyInput=!0),this.sourceIsVideoOrSprite&&(this.dirtyInput=!0)}}this.prepareStampTabsHelper()},Zg.setSourceDimension=function(){if(!this.badNet){const{columns:t,rows:e,particlePositions:i}=this,n=$c(),s=$c(),r=$c(),o=$c(),a=$c(),l=$c(),c=$c(),h=$c(),u=$c();let d,f,p,g,m,y,b,S,k,A,v,C,P,x,w,O,D,F;for(p=0;pt&&(this.sourceDimension=t)}for(w=0,O=s.length;wMc(t))),Mc(s),Mc(n),Mc(r),Mc(o),Mc(a),Mc(l),Mc(c),Mc(u),Mc(h)}},Zg.simpleStamp=function(t,e){t&&t.type===Ko&&(this.currentHost=t,e&&(this.set(e),this.prepareStamp()),this.regularStamp())},Zg.stamp=function(t=!1,e,i){t?(e&&e.type===Ko&&(this.currentHost=e),i&&(this.set(i),this.prepareStamp()),this.regularStamp()):this.visibility&&(this.dirtyInput&&(this.sourceImageData=this.cleanInput(),this.sourceImageData?this.output=this.cleanOutput():this.dirtyInput=!0),this.output&&this.regularStamp())},Zg.cleanInput=function(){this.dirtyInput=!1,this.setSourceDimension();const t=this.sourceDimension;if(!t)return this.dirtyInput=!0,!1;const e=gu(),i=e.engine,n=e.element;n.width=t,n.height=t,i.setTransform(1,0,0,1,0,0),this.source.stamp(!0,e,{startX:0,startY:0,handleX:0,handleY:0,offsetX:0,offsetY:0,roll:0,scale:1,width:t,height:t,method:zi});const s=i.getImageData(0,0,t,t);return mu(e),s},Zg.cleanOutput=function(){this.dirtyOutput=!1;const{sourceImageData:t,columns:e,rows:i,struts:n,boundingBox:s}=this,r=rt(this.sourceDimension);if(t&&i-1>0){let[o,a,l,c]=s;l=~~(o+l),c=~~(a+c);const h=gu(),u=h.engine,d=h.element;d.width=r,d.height=r,u.setTransform(1,0,0,1,0,0),u.putImageData(t,0,0);const f=gu(),p=f.engine,g=f.element;g.width=l,g.height=c,p.globalAlpha=this.state.globalAlpha,p.setTransform(1,0,0,1,0,0);const m=parseFloat((r/(i-1)).toFixed(4)),y=parseFloat((r/(e-1)).toFixed(4));let b,S,k,A,v,C,P,x,w,O,D,F,R,T,H,E,I,B,L,$,M,X,Y;for(M=0,X=i-1;Mr?r-T:m;p.drawImage(d,~~R,~~T,1,~~i,0,0,1,~~I)}}const G=this.interferenceFactor,j=this.interferenceLoops,z=1+~~(l*G),N=1+~~(c*G);d.width=z,d.height=N,p.setTransform(1,0,0,1,0,0),u.setTransform(1,0,0,1,0,0);for(let t=0;t{if(gt(t))i=t[0],n=t[1];else{if(!tc(t,t.x,t.y))return!1;i=t.x,n=t.y}return!(!mt(i)||!mt(n))&&s.engine.isPointInPath(this.pathObject,i,n,this.winding)}),this)){const t={x:i,y:n,artefact:this};return mu(s),t}return mu(s),!1};const Qg=function(t){return!!t&&new Mesh(t)};Q.Mesh=Mesh;const Spring=function(t=Ml){return this.makeName(t.name),this.register(),this.set(this.defs),this.set(t),this.action||(this.action=Il),this},Jg=Spring.prototype=sc();Jg.type="Spring",Jg.lib="spring",Jg.isArtefact=!1,Jg.isAsset=!1,ih(Jg);Jg.defs=_l(Jg.defs,{particleFrom:null,particleFromIsStatic:!1,particleTo:null,particleToIsStatic:!1,springConstant:50,damperConstant:10,restLength:1}),Jg.packetObjects=ql(Jg.packetObjects,["particleFrom","particleTo"]),Jg.kill=function(){return this.deregister(),!0};const tm=Jg.setters;tm.particleFrom=function(t){t.substring&&(t=P[t]),t&&t.type===ua&&(this.particleFrom=t)},tm.particleTo=function(t){t.substring&&(t=P[t]),t&&t.type===ua&&(this.particleTo=t)},Jg.applySpring=function(){const{particleFrom:t,particleTo:e,particleFromIsStatic:i,particleToIsStatic:n,springConstant:s,damperConstant:r,restLength:o}=this;if(t&&e){const{position:a,velocity:l,load:c}=t,{position:h,velocity:u,load:d}=e,f=Gd(u).vectorSubtract(l),p=Gd(h).vectorSubtract(a),g=Gd(p).normalize(),m=Gd(g);g.scalarMultiply(s*(p.getMagnitude()-o)),f.vectorMultiply(m).scalarMultiply(r).vectorMultiply(m);const y=Gd(g).vectorAdd(f);i||c.vectorAdd(y),n||d.vectorSubtract(y),jd(f,p,g,m,y)}};const em=function(t){return!!t&&new Spring(t)};Q.Spring=Spring;const Net=function(t=Ml){return this.makeName(t.name),this.register(),this.initializePositions(),this.set(this.defs),this.onEnter=Il,this.onLeave=Il,this.onDown=Il,this.onUp=Il,this.generate=Il,this.postGenerate=Il,this.stampAction=Il,this.particleStore=[],this.springs=[],t.group||(t.group=of),this.set(t),this.purge&&this.purgeArtefact(this.purge),this},im=Net.prototype=sc();im.type="Net",im.lib=Yi,im.isArtefact=!0,im.isAsset=!1,ih(im),Gf(im);const nm={world:null,artefact:null,historyLength:1,forces:null,mass:1,engine:ji,springConstant:50,damperConstant:10,restLength:1,showSprings:!1,showSpringsColor:Te,rows:0,columns:0,rowDistance:0,columnDistance:0,shapeTemplate:null,precision:20,joinTemplateEnds:!1,particlesAreDraggable:!1,hitRadius:10,showHitRadius:!1,hitRadiusColor:Te,resetAfterBlur:3};im.defs=_l(im.defs,nm),im.packetExclusions=ql(im.packetExclusions,["forces","springs","particleStore"]),im.packetObjects=ql(im.packetObjects,["world","artefact","shapeTemplate"]),im.packetFunctions=ql(im.packetFunctions,["generate","postGenerate","stampAction"]),im.finalizePacketOut=function(t,e){const i=e.forces||this.forces||!1;if(i){const e=[];i.forEach((t=>{t.substring?e.push(t):Ul(t)&&t.name&&e.push(t.name)})),t.forces=e}const n=[];return this.particleStore.forEach((t=>n.push(t.saveAsPacket()))),t.particleStore=n,t},im.postCloneAction=function(t){return t},im.factoryKill=function(t,e){this.isRunning=!1,t&&(this.artefact.kill(),this.shapeTemplate&&this.shapeTemplate.kill()),e&&this.world.kill(),this.purgeParticlesFromLibrary()},im.purgeParticlesFromLibrary=function(){const{particleStore:t,springs:e}=this;let i;a.forEach((t=>{i=o[t],i&&(i.particle&&!i.particle.substring&&i.particle.name&&(i.particle=i.particle.name),i.type===pa&&i.useParticlesAsPins&&i.pins.forEach(((t,e)=>{Ul(t)&&t.type===ua&&(i.pins[e]=t.name,i.dirtyPins=!0)})))})),t.forEach((t=>t.kill())),t.length=0,e.forEach((t=>t.kill())),e.length=0};const sm=im.setters;sm.generate=function(t){Vl(t)?this.generate=t:t.substring&&om[t]&&(this.generate=om[t])},sm.postGenerate=function(t){Vl(t)&&(this.postGenerate=t)},sm.stampAction=function(t){Vl(t)&&(this.stampAction=t)},sm.world=function(t){let e;t.substring?e=F[t]:Ul(t)&&t.type===wa&&(e=t),e&&(this.world=e)},sm.artefact=function(t){let e;t.substring?e=o[t]:Ul(t)&&t.isArtefact&&(e=t),e&&(this.artefact=e),this.dirtyFilterIdentifier=!0},sm.shapeTemplate=function(t){let e;t.substring?e=m[t]:Ul(t)&&t.isArtefact&&Jl(t.species)&&(e=t),e&&(this.shapeTemplate=e),this.dirtyFilterIdentifier=!0},im.regularStamp=function(){const{world:t,artefact:e,particleStore:i,springs:n,generate:s,postGenerate:r,stampAction:o,lastUpdated:a,resetAfterBlur:l,showSprings:c,showSpringsColor:h,showHitRadius:u,hitRadius:d,hitRadiusColor:f}=this;let p,g,m=1,y=xo;this.state&&(m=this.state.globalAlpha,y=this.state.globalCompositeOperation);const b=this.currentHost;let S=Lt;const k=At();if(a&&(S=(k-a)/1e3),S>l&&(this.purgeParticlesFromLibrary(),S=Lt),i.length||(s.call(this,b),r.call(this)),i.forEach((e=>e.applyForces(t,b))),n.forEach((t=>t.applySpring())),i.forEach((e=>e.update(S,t))),c){const t=b.engine;t.save(),t.globalAlpha=m,t.globalCompositeOperation=y,t.strokeStyle=h,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,t.shadowColor=Ee,t.lineWidth=1,t.setTransform(1,0,0,1,0,0),t.beginPath(),n.forEach((e=>{({particleFrom:p,particleTo:g}=e),t.moveTo(p.position.x,p.position.y),t.lineTo(g.position.x,g.position.y)})),t.stroke(),t.restore()}if(i.forEach((t=>{t.manageHistory(S,b),o.call(this,e,t,b)})),u){const t=b.engine;t.save(),t.globalAlpha=m,t.globalCompositeOperation=y,t.lineWidth=1,t.strokeStyle=f,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,t.shadowColor=Ee,t.setTransform(1,0,0,1,0,0),t.beginPath(),i.forEach((e=>{t.moveTo(e.position.x,e.position.y),t.arc(e.position.x,e.position.y,d,0,Pt)})),t.stroke(),t.restore()}this.lastUpdated=k},im.restart=function(){return this.purgeParticlesFromLibrary(),this.lastUpdated=At(),this},im.checkHit=function(t=[]){if(this.lastHitParticle=null,!this.particlesAreDraggable)return!1;if(this.noUserInteraction)return!1;const e=gt(t)?t:[t],i=this.particleStore;let n,s,r,o,a,l=!1;if(e.some((t=>{if(gt(t))n=t[0],s=t[1];else{if(!tc(t,t.x,t.y))return!1;n=t.x,s=t.y}if(!mt(n)||!mt(s))return!1;const e=Gd();for(r=0,o=i.length;r0&&l>0){const[d,f]=this.currentStampPosition,[,p]=t.currentDimensions,g=c.substring?parseFloat(c)/100*p:c,m=h.substring?parseFloat(h)/100*p:h;let y,b,S,k,A,v,C;for(k=0;k0&&l>0){const[d,f]=this.currentStampPosition,[,p]=t.currentDimensions,g=c.substring?parseFloat(c)/100*p:c,m=h.substring?parseFloat(h)/100*p:h;let y,b,S,k,A,v,C;for(k=0;k0;A--)v=P[`${u}-${A}-${k}`],C=P[`${u}-${A-1}-${k+1}`],rm.call(this,v,C,`${u}-${A}-${k}~${u}-${A-1}-${k+1}`)}},"weak-shape":function(){const{particleStore:t,artefact:e,historyLength:i,engine:n,forces:s,mass:r,name:o,shapeTemplate:a,precision:l,joinTemplateEnds:c}=this;let h,u,d,f;if(a&&l){for(h=0;hrm.call(this,t,m,`${l}-${e}-hub`))),i.push(m)}}},am=function(t){return!!t&&new Net(t)};function lm(t=Ml){t.defs=_l(t.defs,{choke:15});const e=t.setters,i=t.deltaSetters;e.paletteStart=function(t){this.gradient&&this.gradient.set({paletteStart:t})},i.paletteStart=function(t){this.gradient&&this.gradient.setDelta({paletteStart:t})},e.paletteEnd=function(t){this.gradient&&this.gradient.set({paletteEnd:t})},i.paletteEnd=function(t){this.gradient&&this.gradient.setDelta({paletteEnd:t})},e.colors=function(t){this.gradient&&this.gradient.set({colors:t})},e.precision=function(t){this.gradient&&this.gradient.set({precision:t})},e.easing=function(t){this.gradient&&this.gradient.set({easing:t})},e.easingFunction=e.easing,e.colorSpace=function(t){this.gradient&&this.gradient.set({colorSpace:t})},e.returnColorAs=function(t){this.gradient&&this.gradient.set({returnColorAs:t})},e.cyclePalette=function(t){this.gradient&&this.gradient.set({cyclePalette:t})},e.delta=function(t=Ml){this.gradient&&this.gradient.set({delta:t})},t.installElement=function(t){const e=document.createElement(Ne);e.id=t,this.element=e,this.engine=this.element.getContext(jt,{willReadFrequently:!0});const i=document.createElement(Ne);return i.id=`${t}-color`,i.width=256,i.height=1,this.colorElement=i,this.colorEngine=this.colorElement.getContext(jt,{willReadFrequently:!0}),this.gradient=yg({name:`${t}-gradient`,endX:Us,delta:{paletteStart:0,paletteEnd:0},cyclePalette:!1}),this.gradientLastUpdated=0,this},t.checkSource=function(){this.notifySubscribers()},t.getData=function(t,e){return this.notifySubscribers(),this.buildStyle(e)},t.update=function(){this.dirtyOutput=!0},t.notifySubscribers=function(){this.dirtyOutput&&this.cleanOutput(),this.subscribers.forEach((t=>this.notifySubscriber(t)),this)},t.notifySubscriber=function(t){t.sourceNaturalWidth=this.width,t.sourceNaturalHeight=this.height,t.sourceLoaded=!0,t.source=this.element,t.dirtyImage=!0,t.dirtyCopyStart=!0,t.dirtyCopyDimensions=!0,t.dirtyImageSubscribers=!0},t.paintCanvas=function(){if(this.checkOutputValuesExist()&&this.dirtyOutput){this.dirtyOutput=!1;const{element:t,engine:e,width:i,height:n,colorEngine:s,gradient:r,choke:o,gradientLastUpdated:a}=this;t.width=i,t.height=n;const l=e.getImageData(0,0,i,n),c=l.data,h=i*n;let u,d,f;const p=At();a+ou&&(m=1,y=0),p=r[d+m+s[f+y]],g+=i(h-m+fm,u-y+fm,p),.5+35*g}},[pl]:{name:pl,init:function(){const{values:t,size:e,rndEngine:i}=this;t.length=0;for(let n=0;n1?i=1:i<0&&(i=0),i}},cm.wXorshift=function(t){let e=t^t>>12;return e^=e<<25,e^=e>>27,2*e},cm.wHash=function(t,e,i){return 16777619*(16777619*(16777619*(2166136261^t)^e)^i)&4294967295},cm.worleyDistanceFunctions={[Gi]:function(t,e){return function(t,e){return[t.x-e.x,t.y-e.y,t.z-e.z]}(t,e).reduce(((t,e)=>t+e*e),0)},[as]:function(t,e){return function(t,e){return[t.x-e.x,t.y-e.y,t.z-e.z]}(t,e).reduce(((t,e)=>t+tt(e)),0)}},cm.wProbLookup=function(t){return(t&=4294967295)<393325350?1:t<1022645910?2:t<1861739990?3:t<2700834071?4:t<3372109335?5:t<3819626178?6:t<4075350088?7:t<4203212043?8:9},cm.wInsert=function(t,e){let i;for(let n=t.length-1;n>=0&&!(e>t[n]);n--)i=t[n],t[n]=e,n+1t<0?0:t>1?1:t)))};const mm=function(t){return!!t&&new NoiseAsset(t)},ym=function(t){return!!t&&new NoiseAsset(t)};Q.NoiseAsset=NoiseAsset;const Oval=function(t=Ml){return this.shapeInit(t),this},bm=Oval.prototype=sc();bm.type="Oval",bm.lib=Yi,bm.isArtefact=!0,bm.isAsset=!1,ih(bm),Kf(bm);bm.defs=_l(bm.defs,{radiusX:5,radiusY:5,intersectX:.5,intersectY:.5,offshootA:.55,offshootB:0});const Sm=bm.setters,km=bm.deltaSetters;Sm.radius=function(t){this.setRectHelper(t,Gr)},Sm.radiusX=function(t){this.setRectHelper(t,Yr)},Sm.radiusY=function(t){this.setRectHelper(t,jr)},km.radius=function(t){this.deltaRectHelper(t,Gr)},km.radiusX=function(t){this.deltaRectHelper(t,Yr)},km.radiusY=function(t){this.deltaRectHelper(t,jr)},Sm.offshootA=function(t){this.offshootA=t,this.updateDirty()},Sm.offshootB=function(t){this.offshootB=t,this.updateDirty()},km.offshootA=function(t){t.toFixed&&(this.offshootA+=t,this.updateDirty())},km.offshootB=function(t){t.toFixed&&(this.offshootB+=t,this.updateDirty())},Sm.intersectA=function(t){this.intersectA=t,this.updateDirty()},Sm.intersectB=function(t){this.intersectB=t,this.updateDirty()},km.intersectA=function(t){t.toFixed&&(this.intersectA+=t,this.updateDirty())},km.intersectB=function(t){t.toFixed&&(this.intersectB+=t,this.updateDirty())},bm.setRectHelper=function(t,e){this.updateDirty(),e.forEach((e=>{this[e]=t}),this)},bm.deltaRectHelper=function(t,e){this.updateDirty(),e.forEach((e=>{this[e]=Fl(this[e],t)}),this)},bm.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeOvalPath()},bm.makeOvalPath=function(){const t=parseFloat(this.offshootA.toFixed(6)),e=parseFloat(this.offshootB.toFixed(6)),i=this.radiusX,n=this.radiusY;let s,r;if(i.substring||n.substring){const t=this.getHost();if(t){const[e,o]=t.currentDimensions;s=2*(i.substring?parseFloat(i)/100*e:i),r=2*(n.substring?parseFloat(n)/100*o:n)}}else s=2*i,r=2*n;const o=parseFloat((s*this.intersectX).toFixed(2)),a=parseFloat((s-o).toFixed(2)),l=parseFloat((r*this.intersectY).toFixed(2)),c=parseFloat((r-l).toFixed(2));let h=xl;return h+=`c${a*t},${l*e} ${a-a*e},${l-l*t}, ${a},${l} `,h+=`${-a*e},${c*t} ${a*t-a},${c-c*e} ${-a},${c} `,h+=`${-o*t},${-c*e} ${o*e-o},${c*t-c} ${-o},${-c} `,h+=`${o*e},${-l*t} ${o-o*t},${l*e-l} ${o},${-l}z`,h},bm.calculateLocalPathAdditionalActions=function(){const[t,e]=this.localBox;this.pathDefinition=this.pathDefinition.replace(xl,`m${-t},${-e}`),this.pathCalculatedOnce=!1,this.calculateLocalPath(this.pathDefinition,!0)};const Am=function(t){return!!t&&(t.species="oval",new Oval(t))};Q.Oval=Oval;const vm=dt(["video_audioTracks","video_autoPlay","video_buffered","video_controller","video_controls","video_controlsList","video_crossOrigin","video_currentSrc","video_currentTime","video_defaultMuted","video_defaultPlaybackRate","video_disableRemotePlayback","video_duration","video_ended","video_error","video_loop","video_mediaGroup","video_mediaKeys","video_muted","video_networkState","video_paused","video_playbackRate","video_readyState","video_seekable","video_seeking","video_sinkId","video_src","video_srcObject","video_textTracks","video_videoTracks","video_volume"]),Cm=dt(["video_autoPlay","video_controller","video_controls","video_crossOrigin","video_currentTime","video_defaultMuted","video_defaultPlaybackRate","video_disableRemotePlayback","video_loop","video_mediaGroup","video_muted","video_playbackRate","video_src","video_srcObject","video_volume"]),VideoAsset=function(t=Ml){return this.assetConstructor(t)},Pm=VideoAsset.prototype=sc();Pm.type=xa,Pm.lib=Ce,Pm.isArtefact=!1,Pm.isAsset=!0,ih(Pm),td(Pm),Pm.saveAsPacket=function(){return[this.name,this.type,this.lib,{}]},Pm.stringifyFunction=Il,Pm.processPacketOut=Il,Pm.finalizePacketOut=Il,Pm.clone=Ll;Pm.setters.source=function(t){t&&(t.tagName.toUpperCase()===ie&&(this.source=t,this.sourceNaturalWidth=t.videoWidth||0,this.sourceNaturalHeight=t.videoHeight||0,this.sourceLoaded=t.readyState>2),this.sourceLoaded&&this.notifySubscribers())},Pm.checkSource=function(t,e){const i=this.source;i&&i.readyState>2?(this.sourceLoaded=!0,this.sourceNaturalWidth===i.videoWidth&&this.sourceNaturalHeight===i.videoHeight&&this.sourceNaturalWidth===t&&this.sourceNaturalHeight===e||(this.sourceNaturalWidth=i.videoWidth,this.sourceNaturalHeight=i.videoHeight,this.notifySubscribers())):this.sourceLoaded=!1},Pm.addTextTrack=function(t,e,i){const n=this.source;n&&n.addTextTrack&&n.addTextTrack(t,e,i)},Pm.captureStream=function(){const t=this.source;return!(!t||!t.captureStream)&&t.captureStream()},Pm.canPlayType=function(t){const e=this.source;return e?e.canPlayType(t):"maybe"},Pm.fastSeek=function(t){const e=this.source;e&&e.fastSeek&&e.fastSeek(t)},Pm.load=function(){const t=this.source;t&&t.load()},Pm.pause=function(){const t=this.source;t&&t.pause()},Pm.play=function(){const t=this.source;return t?t.play().catch((t=>console.log(t.code,t.name,t.message))):Promise.reject("Source not defined")},Pm.setMediaKeys=function(t){const e=this.source;return e?e.setMediaKeys?e.setMediaKeys(t):Promise.reject("setMediaKeys not supported"):Promise.reject("Source not defined")},Pm.setSinkId=function(){const t=this.source;return t?t.setSinkId?t.setSinkId():Promise.reject("setSinkId not supported"):Promise.reject("Source not defined")};const xm=function(t){document.querySelectorAll(t).forEach((t=>{let e;if(t.tagName.toUpperCase()===ie){if(t.id||t.name)e=t.id||t.name;else{const i=Pe.exec(t.src);e=i&&i[1]?i[1]:wl}const i=Fm({name:e,source:t});t.readyState<=2&&(t.oncanplay=()=>{i.set({source:t})})}}))},wm=function(t=Ml){const e={};e.audio=!Jl(t.audio)||t.audio,e.video={};const i=e.video.width={};t.minWidth&&(i.min=t.minWidth),t.maxWidth&&(i.max=t.maxWidth),i.ideal=t.width?t.width:1280;const n=e.video.height={};t.minHeight&&(n.min=t.minHeight),t.maxHeight&&(n.max=t.maxHeight),n.ideal=t.height?t.height:720,t.facing&&(e.video.facingMode=t.facing);const s=t.name||Yl(),r=document.createElement(ml),o=Fm({name:s,source:r});return new Promise(((t,i)=>{navigator&&navigator.mediaDevices?navigator.mediaDevices.getUserMedia(e).then((e=>{const i=e.getVideoTracks();let n;gt(i)&&i[0]&&(n=i[0].getConstraints()),r.id=o.name,n&&(r.width=n.width,r.height=n.height),r.srcObject=e,r.onloadedmetadata=function(){r.play()},t(o)})).catch((e=>{console.log(e),t(o)})):i("Navigator.mediaDevices object not found")}))},Om=function(t=Ml){const e={video:{displaySurface:"browser"},audio:{suppressLocalAudioPlayback:!1},preferCurrentTab:!1,selfBrowserSurface:"exclude",systemAudio:"include",surfaceSwitching:"include",monitorTypeSurfaces:"include"},i=t.name||Yl(),n=document.createElement(ml),s=Fm({name:i,source:n});return new Promise(((i,r)=>{navigator&&navigator.mediaDevices?navigator.mediaDevices.getDisplayMedia({...e,...t}).then((t=>{const e=t.getVideoTracks();let r;gt(e)&&e[0]&&(r=e[0].getConstraints()),n.id=s.name,r&&(n.width=r.width,n.height=r.height),n.srcObject=t,n.onloadedmetadata=function(){n.play()},i(s)})).catch((t=>{console.log(t.message),i(s)})):r("Navigator.mediaDevices object not found")}))},Dm=function(...t){let e=wl;if(t.length){let i,n,s,r,o,a,l=!1;const c=t[0];if(c.substring){const e=Pe.exec(c);i=e&&e[1]?e[1]:wl,o=[...t],n=wl,s=!1,r=null,a=xe,l=!0}else c&&c.src&&(i=c.name||wl,o=[...c.src],n=c.className||wl,s=c.visibility||!1,r=document.querySelector(r),a=c.preload||xe,l=!0);const h=Fm({name:i});if(l){const t=document.createElement(ml);t.name=i,t.className=n,t.style.display=s?Be:Is,t.crossOrigin=me,t.preload=a,o.forEach((e=>{const i=document.createElement(Ao);i.src=e,t.appendChild(i)})),t.onload=()=>{h.set({source:t}),r&&r.appendChild(t)},h.set({source:t}),e=i}}return e},Fm=function(t){return!!t&&new VideoAsset(t)};Q.VideoAsset=VideoAsset;const SpriteAsset=function(t=Ml){return this.assetConstructor(t),this},Rm=SpriteAsset.prototype=sc();Rm.type=ka,Rm.lib=Ce,Rm.isArtefact=!1,Rm.isAsset=!0,ih(Rm),td(Rm);Rm.defs=_l(Rm.defs,{manifest:null}),Rm.saveAsPacket=function(){return[this.name,this.type,this.lib,{}]},Rm.stringifyFunction=Il,Rm.processPacketOut=Il,Rm.finalizePacketOut=Il,Rm.clone=Ll;Rm.setters.source=function(t=[]){if(t&&t[0]){this.sourceHold||(this.sourceHold={});const e=this.sourceHold;t.forEach((t=>{const i=t.id||t.name;i&&(e[i]=t)})),this.source=t[0],this.sourceNaturalWidth=t[0].naturalWidth,this.sourceNaturalHeight=t[0].naturalHeight,this.sourceLoaded=t[0].complete}},Rm.checkSource=Il;const Tm=function(...t){const e=/\.(jpeg|jpg|png|gif|webp|svg|JPEG|JPG|PNG|GIF|WEBP|SVG)/,i=[];return t.forEach((t=>{let n,s,r,o,a,l=!1,c=!1;if(t.substring){const i=Pe.exec(t);n=i&&i[1]?i[1]:wl,s=[t],r=wl,o=!1,a=t.replace(e,".json"),c=!0}else Ul(t)&&t.imageSrc&&t.manifestSrc?(n=t.name||wl,s=gt(t.imageSrc)?t.imageSrc:[t.imageSrc],a=t.manifestSrc,r=t.className||wl,o=t.visibility||!1,l=document.querySelector(t.parent),c=!0):i.push(!1);if(c){const t=Hm({name:n});Ul(a)?t.manifest=a:fetch(a).then((t=>{if(200!=t.status)throw new Error("Failed to load manifest");return t.json()})).then((e=>t.manifest=e)).catch((t=>console.log(t.message)));const c=[];s.forEach((t=>{const i=document.createElement(En);let s,a;e.test(t)&&(a=Pe.exec(t),s=a&&a[1]?a[1]:wl),i.name=s||n,i.className=r,i.crossorigin=me,i.style.display=o?Be:Is,l&&l.appendChild(i),i.src=t,c.push(i)})),t.set({source:c}),i.push(n)}else i.push(!1)})),i},Hm=function(t){return!!t&&new SpriteAsset(t)};function Em(t=Ml){const e={asset:null,removeAssetOnKill:!1,spriteIsRunning:!1,spriteLastFrameChange:0,spriteCurrentFrame:0,spriteTrack:"default",spriteForward:!0,spriteFrameDuration:100,spriteWillLoop:!0};t.defs=_l(t.defs,e);const i=t.getters,n=t.setters;i.sourceDimensions=function(){return[this.sourceNaturalWidth,this.sourceNaturalHeight]},n.asset=function(t){const e=this.asset,i=t&&t.name?t.name:t;e&&!e.substring&&e.unsubscribe(this),this.asset=i,this.dirtyAsset=!0},n.imageSource=function(t){const e=od(t);if(e){const t=l[e[0]];if(t){const e=this.asset;e&&e.unsubscribe&&e.unsubscribe(this),t.subscribe(this)}}},n.videoSource=function(t){const e=Dm(t);if(e){const t=l[e];if(t){const e=this.asset;e&&e.unsubscribe&&e.unsubscribe(this),t.subscribe(this)}}},n.spriteSource=function(t){const e=Tm(t);if(e){const t=l[e];if(t){const e=this.asset;e&&e.unsubscribe&&e.unsubscribe(this),t.subscribe(this)}}},t.cleanAsset=function(){const t=this.asset;if(t&&t.substring){const e=l[t];e&&(this.dirtyAsset=!1,e.subscribe(this))}},t.videoAction=function(t,...e){const i=this.asset;if(i&&i.type===xa)return i[t](...e)},t.videoPromiseAction=function(t,...e){const i=this.asset;return i&&i.type===xa?i[t](...e):Promise.reject("Asset not a video")},t.videoAddTextTrack=function(t,e,i){return this.videoAction("addTextTrack",t,e,i)},t.videoCaptureStream=function(){return this.videoAction("captureStream")},t.videoCanPlayType=function(t){return this.videoAction("canPlayType",t)},t.videoFastSeek=function(t){return this.videoAction("fastSeek",t)},t.videoLoad=function(){return this.videoAction("load")},t.videoPause=function(){return this.videoAction("pause")},t.videoPlay=function(){return this.videoPromiseAction("play")},t.videoSetMediaKeys=function(t){return this.videoPromiseAction("setMediaKeys",t)},t.videoSetSinkId=function(){return this.videoPromiseAction("setSinkId")},t.checkSpriteFrame=function(){const t=this.asset;if(t&&t.type===ka&&t.manifest){const e=this.copyArray;if(this.spriteIsRunning){const i=this.spriteLastFrameChange,n=this.spriteFrameDuration,s=At();if(s>i+n){const i=t.manifest;if(i){const n=i[this.spriteTrack],r=n.length,o=this.spriteWillLoop;let a=this.spriteCurrentFrame;a=this.spriteForward?a+1:a-1,a<0&&(a=o?r-1:0),a>=r&&(a=o?0:r-1);const[l,c,h,u,d]=n[a];e.length=0,e.push(c,h,u,d),this.dirtyCopyStart=!1,this.dirtyCopyDimensions=!1;if(l!==(this.source.id||this.source.name)){const e=t.sourceHold[l];e&&(this.source=e)}this.spriteCurrentFrame=a,this.spriteLastFrameChange=s}}}else{const[,i,n,s,r]=t.manifest[this.spriteTrack][this.spriteCurrentFrame],[o,a,l,c]=e;o===i&&a===n&&l===s&&c===r||(e.length=0,e.push(i,n,s,r),this.dirtyCopyStart=!1,this.dirtyCopyDimensions=!1)}}},t.playSprite=function(t,e,i,n,s){Jl(t)&&(this.spriteFrameDuration=t),Jl(e)&&(this.spriteWillLoop=e),Jl(i)&&(this.spriteTrack=i),Jl(n)&&(this.spriteForward=n),Jl(s)&&(this.spriteCurrentFrame=s),this.spriteLastFrameChange=At(),this.spriteIsRunning=!0},t.haltSprite=function(t,e,i,n,s){Jl(t)&&(this.spriteFrameDuration=t),Jl(e)&&(this.spriteWillLoop=e),Jl(i)&&(this.spriteTrack=i),Jl(n)&&(this.spriteForward=n),Jl(s)&&(this.spriteCurrentFrame=s),this.spriteIsRunning=!1}}Q.SpriteAsset=SpriteAsset;const Pattern=function(t=Ml){return this.makeName(t.name),this.register(),this.set(this.defs),this.set(t),this},Im=Pattern.prototype=sc();Im.type="Pattern",Im.lib=zo,Im.isArtefact=!1,Im.isAsset=!1,ih(Im),Hd(Im),Em(Im),Im.packetObjects=ql(Im.packetObjects,["asset"]),Im.finalizePacketOut=function(t,e){if(gt(e.patternMatrix))t.patternMatrix=e.patternMatrix;else{const e=this.patternMatrix;e&&(t.patternMatrix=[e.a,e.b,e.c,e.d,e.e,e.f])}return t},Im.kill=function(){const{name:t,asset:e,removeAssetOnKill:i}=this;let n,s,r,o;return Ul(e)&&e.unsubscribe(this),$t(m).forEach((e=>{n=e.state,s=n.defs,n&&(r=n.fillStyle,o=n.strokeStyle,Ul(r)&&r.name===t&&(n.fillStyle=s.fillStyle),Ul(o)&&o.name===t&&(n.strokeStyle=s.strokeStyle))})),i&&(i.substring?e.kill(!0):e.kill()),this.deregister(),this},Im.get=function(t){const e=this.source;if(0!==t.indexOf(Yt)&&0!==t.indexOf(Xt)||!e){const e=this.getters[t];if(e)return e.call(this);{const e=this.defs[t];if(typeof e!==ol){const i=this[t];return typeof i!==ol?i:e}return}}return vm.includes(t)||sd.includes(t)?e[t.substring(6)]:void 0},Im.set=function(t=Ml){const e=bt(t),i=e.length;if(i){const n=this.setters,s=this.source,r=this.defs;let o,a,l,c;for(a=0;a{const e=o[t];e&&(e.dirtyInput=!0)}))},Lm.imageSubscribe=function(t){t&&t.substring&&ql(this.imageSubscribers,t)},Lm.imageUnsubscribe=function(t){t&&t.substring&&Ql(this.imageSubscribers,t)},Lm.cleanImage=function(){const t=this.sourceNaturalWidth,e=this.sourceNaturalHeight;if(tc(t,e)&&t>0&&e>0){this.dirtyImage=!1;const i=this.currentCopyStart,n=i[0],s=i[1],r=this.currentCopyDimensions,o=r[0],a=r[1];n+o>t&&(i[0]=t-o),s+a>e&&(i[1]=e-a);const l=this.copyArray;l.length=0,l.push(~~i[0],~~i[1],~~o,~~a)}},Lm.cleanCopyStart=function(){const t=this.sourceNaturalWidth,e=this.sourceNaturalHeight;if(tc(t,e)&&t>0&&e>0){this.dirtyCopyStart=!1,this.cleanPosition(this.currentCopyStart,this.copyStart,[t,e]);const i=this.currentCopyStart,n=i[0],s=i[1];(n<0||n>t)&&(i[0]=n<0?0:t-1),(s<0||s>e)&&(i[1]=s<0?0:e-1),this.dirtyImage=!0}},Lm.cleanCopyDimensions=function(){const t=this.sourceNaturalWidth,e=this.sourceNaturalHeight;if(tc(t,e)&&t>0&&e>0){this.dirtyCopyDimensions=!1;const i=this.copyDimensions,n=this.currentCopyDimensions,s=i[0],r=i[1];s.substring?n[0]=parseFloat(s)/100*t:n[0]=s,r.substring?n[1]=parseFloat(r)/100*e:n[1]=r;const o=n[0],a=n[1];(o<=0||o>t)&&(n[0]=o<=0?1:t),(a<=0||a>e)&&(n[1]=a<=0?1:e),this.dirtyImage=!0}},Lm.prepareStamp=function(){this.dirtyAsset&&this.cleanAsset(),this.asset&&(this.asset.type===ka?this.checkSpriteFrame(this):this.asset.checkSource?this.asset.checkSource(this.sourceNaturalWidth,this.sourceNaturalHeight):this.dirtyAsset=!0),(this.dirtyDimensions||this.dirtyHandle||this.dirtyScale)&&(this.dirtyPaste=!0),(this.dirtyScale||this.dirtyDimensions||this.dirtyStart||this.dirtyOffset||this.dirtyHandle)&&(this.dirtyPathObject=!0),this.dirtyScale&&this.cleanScale(),this.dirtyDimensions&&this.cleanDimensions(),this.dirtyLock&&this.cleanLock(),this.dirtyStart&&this.cleanStart(),this.dirtyOffset&&this.cleanOffset(),this.dirtyHandle&&this.cleanHandle(),this.dirtyRotation&&this.cleanRotation(),(this.isBeingDragged||this.lockTo.includes(ms)||this.lockTo.includes(zs))&&(this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtyStampHandlePositions&&this.cleanStampHandlePositions(),this.dirtyCopyStart&&this.cleanCopyStart(),this.dirtyCopyDimensions&&this.cleanCopyDimensions(),this.dirtyImage&&this.cleanImage(),this.dirtyPaste&&this.preparePasteObject(),this.dirtyPathObject&&this.cleanPathObject(),this.dirtyPositionSubscribers&&this.updatePositionSubscribers(),this.dirtyImageSubscribers&&this.updateImageSubscribers(),this.prepareStampTabsHelper()},Lm.preparePasteObject=function(){this.dirtyPaste=!1;const t=this.currentStampHandlePosition,e=this.currentDimensions,i=this.currentScale,n=-t[0]*i,s=-t[1]*i,r=e[0]*i,o=e[1]*i,a=this.pasteArray;a.length=0,a.push(~~n,~~s,~~r,~~o),this.dirtyPathObject=!0},Lm.cleanPathObject=function(){if(this.dirtyPathObject=!1,!this.noPathUpdates||!this.pathObject)if(this.pasteArray&&4===this.pasteArray.length||this.preparePasteObject(),4!==this.pasteArray.length)this.dirtyPathObject=!0;else{(this.pathObject=new Path2D).rect(...this.pasteArray)}},Lm.draw=function(t){t.stroke(this.pathObject)},Lm.fill=function(t){const[e,i,n,s]=this.copyArray;this.source&&n&&s&&t.drawImage(this.source,e,i,n,s,...this.pasteArray)},Lm.drawAndFill=function(t){const[e,i,n,s]=this.copyArray,[r,o,a,l]=this.pasteArray;this.source&&n&&s&&(t.stroke(this.pathObject),t.drawImage(this.source,e,i,n,s,r,o,a,l),this.currentHost.clearShadow(),t.stroke(this.pathObject),t.drawImage(this.source,e,i,n,s,r,o,a,l))},Lm.fillAndDraw=function(t){const[e,i,n,s]=this.copyArray,[r,o,a,l]=this.pasteArray;this.source&&n&&s&&(t.drawImage(this.source,e,i,n,s,r,o,a,l),t.stroke(this.pathObject),this.currentHost.clearShadow(),t.drawImage(this.source,e,i,n,s,r,o,a,l),t.stroke(this.pathObject)),t.stroke(this.pathObject)},Lm.drawThenFill=function(t){const[e,i,n,s]=this.copyArray;this.source&&n&&s&&(t.stroke(this.pathObject),t.drawImage(this.source,e,i,n,s,...this.pasteArray))},Lm.fillThenDraw=function(t){const[e,i,n,s]=this.copyArray;this.source&&n&&s&&(t.drawImage(this.source,e,i,n,s,...this.pasteArray),t.stroke(this.pathObject))},Lm.checkHitReturn=function(t,e){if(this.checkHitIgnoreTransparency){const i=this.stashedImageData;if(i){const n=4*(e*i.width+t)+3;if(i.data[n])return{x:t,y:e,artefact:this}}return!1}return{x:t,y:e,artefact:this}};const Ym=function(t){return!!t&&new Picture(t)};Q.Picture=Picture;const Polygon=function(t=Ml){return this.shapeInit(t),this},Gm=Polygon.prototype=sc();Gm.type="Polygon",Gm.lib=Yi,Gm.isArtefact=!0,Gm.isAsset=!1,ih(Gm),Kf(Gm);Gm.defs=_l(Gm.defs,{sides:0,sideLength:0,radius:0});const jm=Gm.setters,zm=Gm.deltaSetters;jm.sides=function(t){this.sides=t,this.updateDirty()},zm.sides=function(t){this.sides+=t,this.updateDirty()},jm.sideLength=function(t){this.sideLength=t,this.updateDirty()},zm.sideLength=function(t){this.sideLength+=t,this.updateDirty()},jm.radius=function(t){this.radius=t,this.updateDirty()},zm.radius=function(t){this.radius+=t,this.updateDirty()},Gm.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makePolygonPath()},Gm.makePolygonPath=function(){const t=this.sideLength||this.radius,e=this.sides,i=360/e,n=$c();let s=0,r=wl;const o=Gd({x:0,y:-t});for(let t=0;t{if("pins"===e){const e=[];t.pins.forEach((t=>{Ul(t)?e.push(t.name):gt(t)?e.push([].concat(t)):e.push(t)})),t.pins=e}})),t};const Wm=Vm.getters,Um=Vm.setters,Zm=Vm.deltaSetters;Wm.pins=function(t){return Jl(t)?this.getPinAt(t):this.currentPins.concat()},Um.pins=function(t){if(Jl(t)){const e=this.pins;if(gt(t))e.forEach(((t,e)=>this.removePinAt(e))),e.length=0,e.push(...t),this.updateDirty();else if(Ul(t)&&Jl(t.index)){const i=e[t.index];gt(i)&&(Jl(t.x)&&(i[0]=t.x),Jl(t.y)&&(i[1]=t.y),this.updateDirty())}}},Zm.pins=function(t){if(Jl(t)){const e=this.pins;if(Ul(t)&&Jl(t.index)){const i=e[t.index];gt(i)&&(Jl(t.x)&&(i[0]=Fl(i[0],t.x)),Jl(t.y)&&(i[1]=Fl(i[1],t.y)),this.updateDirty())}}},Um.tension=function(t){t.toFixed&&(this.tension=t,this.updateDirty())},Zm.tension=function(t){t.toFixed&&(this.tension+=t,this.updateDirty())},Um.closed=function(t){this.closed=t,this.updateDirty()},Um.mapToPins=function(t){this.mapToPins=t,this.updateDirty()},Um.flipUpend=function(t){this.flipUpend=t,this.updateDirty()},Um.flipReverse=function(t){this.flipReverse=t,this.updateDirty()},Um.useAsPath=function(t){this.useAsPath=t,this.updateDirty()},Um.pivot=function(t){if(jl(t)&&!t)this.pivot=null,this.lockTo[0]===Qs&&(this.lockTo[0]=Ro),this.lockTo[1]===Qs&&(this.lockTo[1]=Ro),this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0;else{const e=this.pivot,i=t.substring?o[t]:t,n=this.name;i&&i.name&&(e&&e.name!==i.name&&Ql(e.pivoted,n),ql(i.pivoted,n),this.pivot=i,this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0)}this.updateDirty()},Vm.updateDirty=function(){this.dirtySpecies=!0,this.dirtyPathObject=!0,this.dirtyPins=!0},Vm.getPinAt=function(t){const e=ut(t);if(this.useAsPath){const t=this.getPathPositionData(this.unitPartials[e]);return[t.x,t.y]}{const t=this.currentPins,i=t[e],[n,s]=this.localBox,[r,o]=i,[a]=t[0],[l,c]=this.localOffset,[h,u]=this.currentStampPosition;let d,f;return this.mapToPins?(d=r-a+n,f=o-a+s):(d=r-l,f=o-c),[h+d,u+f]}},Vm.updatePinAt=function(t,e){if(tc(t,e)){e=ut(e);const i=this.pins;if(e=0){const n=i[e];Ul(n)&&n.pivoted&&Ql(n.pivoted,this.name),i[e]=t,this.updateDirty()}}},Vm.removePinAt=function(t){t=ut(t);const e=this.pins;if(t=0){const i=e[t];Ul(i)&&i.pivoted&&Ql(i.pivoted,this.name),e[t]=null,this.updateDirty()}},Vm.prepareStamp=function(){this.dirtyHost&&(this.dirtyHost=!1),this.useParticlesAsPins&&(this.dirtyPins=!0),(this.dirtyPins||this.dirtyLock)&&(this.dirtySpecies=!0),(this.dirtyScale||this.dirtySpecies||this.dirtyDimensions||this.dirtyStart||this.dirtyHandle)&&(this.dirtyPathObject=!0,(this.dirtyScale||this.dirtySpecies)&&(this.pathCalculatedOnce=!1)),(this.isBeingDragged||this.lockTo.includes(ms)||this.lockTo.includes(zs))&&(this.dirtyStampPositions=!0),this.dirtyScale&&this.cleanScale(),this.dirtyStart&&this.cleanStart(),this.dirtyOffset&&this.cleanOffset(),this.dirtyRotation&&this.cleanRotation(),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtySpecies&&this.cleanSpecies(),this.dirtyPathObject&&(this.cleanPathObject(),this.updatePathSubscribers()),this.dirtyPositionSubscribers&&this.updatePositionSubscribers(),this.prepareStampTabsHelper()},Vm.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makePolylinePath()},Vm.getPathParts=function(t,e,i,n,s,r,o){const a=Et(wt(i-t,2)+wt(n-e,2)),l=Et(wt(s-i,2)+wt(r-n,2)),c=o*a/(a+l),h=o*l/(a+l);return[i-c*(s-t),n-c*(r-e),i,n,i+h*(s-t),n+h*(r-e)]},Vm.buildLine=function(t,e,i){let n=`${xl}l`;for(let s=2;s2&&(t=i[r],e=i[r+1],s=0);return n},Vm.cleanCoordinate=function(t,e){return t.toFixed?t:t===Jn||t===Ua?0:t===ao||t===Ge?e:t===We?e/2:parseFloat(t)/100*e},Vm.cleanPinsArray=function(){this.dirtyPins=!1;const t=this.pins,e=this.currentPins;if(e.length=0,this.useParticlesAsPins)t.forEach(((i,n)=>{let s;i&&i.substring?(s=P[i],s&&(t[n]=s)):s=i;const r=!(!s||!s.position)&&s.position;r&&e.push([r.x,r.y])})),e.length||(this.dirtyPins=!0);else{const i=this.getHost(),n=this.cleanCoordinate;let s,r,a,l=1,c=1;i&&(a=i.currentDimensions,a&&([l,c]=a)),t.forEach(((i,a)=>{let h;if(i&&i.substring?(h=o[i],t[a]=h):h=i,h)if(gt(h))[s,r]=h,e.push([n(s,l),n(r,c)]);else if(Ul(h)&&h.currentStart){const t=this.name;h.pivoted.includes(t)||ql(h.pivoted,t),e.push([...h.currentStampPosition])}}))}if(e.length){let t=e[0][0],i=e[0][1];e.forEach((e=>{e[0]{const e=o[t];e&&(e.dirtyStart=!0)}))};const _m=function(t){return!!t&&(t.species="polyline",new Polyline(t))};Q.Polyline=Polyline;const Quadratic=function(t=Ml){return this.control=Au(),this.currentControl=Au(),this.controlLockTo="coord",this.curveInit(t),this.shapeInit(t),this.dirtyControl=!0,this},Km=Quadratic.prototype=sc();Km.type=ga,Km.lib=Yi,Km.isArtefact=!0,Km.isAsset=!1,ih(Km),Kf(Km),Qf(Km);const qm={control:null,controlPivot:wl,controlPivotCorner:wl,controlPivotIndex:-1,addControlPivotHandle:!1,addControlPivotOffset:!1,controlPath:wl,controlPathPosition:0,addControlPathHandle:!1,addControlPathOffset:!0,controlParticle:wl,controlLockTo:wl};Km.defs=_l(Km.defs,qm),Km.packetCoordinates=ql(Km.packetCoordinates,["control"]),Km.packetObjects=ql(Km.packetObjects,["controlPivot","controlPath"]);const Qm=Km.getters,Jm=Km.setters,ty=Km.deltaSetters;Jm.controlPivot=function(t){this.setControlHelper(t,"controlPivot",ai),this.updateDirty(),this.dirtyControl=!0},Jm.controlParticle=function(t){this.setControlHelper(t,"controlParticle",ai),this.updateDirty(),this.dirtyControl=!0},Jm.controlPath=function(t){this.setControlHelper(t,"controlPath",ai),this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1},Jm.controlPathPosition=function(t){this.controlPathPosition=t,this.dirtyControl=!0,this.currentControlPathData=!1,this.dirtyFilterIdentifier=!0},ty.controlPathPosition=function(t){this.controlPathPosition+=t,this.dirtyControl=!0,this.currentControlPathData=!1,this.dirtyFilterIdentifier=!0},Qm.controlPositionX=function(){return this.currentControl[0]},Qm.controlPositionY=function(){return this.currentControl[1]},Qm.controlPosition=function(){return[].concat(this.currentControl)},Jm.controlX=function(t){null!=t&&(this.control[0]=t,this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1)},Jm.controlY=function(t){null!=t&&(this.control[1]=t,this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1)},Jm.control=function(t,e){this.setCoordinateHelper(ai,t,e),this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1},ty.controlX=function(t){const e=this.control;e[0]=Fl(e[0],t),this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1},ty.controlY=function(t){const e=this.control;e[1]=Fl(e[1],t),this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1},ty.control=function(t,e){this.setDeltaCoordinateHelper(ai,t,e),this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1},Jm.controlLockTo=function(t){this.controlLockTo=t,this.updateDirty(),this.dirtyControlLock=!0,this.currentControlPathData=!1},Km.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeQuadraticPath()},Km.makeQuadraticPath=function(){const[t,e]=this.currentStampPosition,[i,n]=this.currentControl,[s,r]=this.currentEnd;return`${xl}q${(i-t).toFixed(2)},${(n-e).toFixed(2)} ${(s-t).toFixed(2)},${(r-e).toFixed(2)}`},Km.cleanDimensions=function(){this.dirtyDimensions=!1,this.dirtyHandle=!0,this.dirtyOffset=!0,this.dirtyStart=!0,this.dirtyControl=!0,this.dirtyEnd=!0,this.dirtyFilterIdentifier=!0},Km.preparePinsForStamp=function(){const t=this.dirtyPins,e=this.endPivot,i=this.endPath,n=this.controlPivot,s=this.controlPath;for(let r,o=0,a=t.length;o{if(Wl(t))return t;switch(t){case Ua:case Jn:return 0;case Ge:case ao:return e;case We:return e/2;default:return t=parseFloat(t),Wl(t)?t/100*e:0}};this.currentStartRadius=t?e(this.startRadius,t):this.defs.startRadius,this.currentEndRadius=t?e(this.endRadius,t):this.defs.endRadius},iy.buildStyle=function(t){if(t){const e=t.engine;if(e){const t=e.createRadialGradient(...this.gradientArgs);return this.addStopsToGradient(t,this.paletteStart,this.paletteEnd,this.cyclePalette)}}return Ee},iy.updateGradientArgs=function(t,e){const i=this.gradientArgs,n=this.currentStart,s=this.currentEnd,r=this.currentStartRadius;let o=this.currentEndRadius;const a=n[0]+t,l=n[1]+e,c=s[0]+t,h=s[1]+e;a===c&&l===h&&r===o&&o++,i.length=0,i.push(a,l,r,c,h,o)};const oy=function(t){return!!t&&new RadialGradient(t)};Q.RadialGradient=RadialGradient;const RawAsset=function(t=Ml){this.makeName(t.name),this.register(),this.subscribers=[],this.set(this.defs),this.updateSource=Il;const e=t.keytypes||{};t.userAttributes&&t.userAttributes.forEach((t=>{this.addAttribute(t),t.type&&(e[t.key]=t.type)})),this.initializeAttributes(e),this.set(t);const i=document.createElement(Ne);return i.width=0,i.height=0,this.element=i,this.engine=i.getContext(jt,{willReadFrequently:!0}),t.subscribe&&this.subscribers.push(t.subscribe),this},ay=RawAsset.prototype=sc();ay.type="RawAsset",ay.lib=Ce,ay.isArtefact=!1,ay.isAsset=!0,ih(ay),td(ay);ay.defs=_l(ay.defs,{keytypes:null,data:null,updateSource:null}),ay.saveAsPacket=function(){return[this.name,this.type,this.lib,{}]},ay.stringifyFunction=Il,ay.processPacketOut=Il,ay.finalizePacketOut=Il,ay.clone=Ll;const ly=ay.getters,cy=ay.setters,hy=ay.deltaSetters;cy.source=Il,cy.element=Il,cy.engine=Il,cy.data=function(t){t&&(this.data=t,this.dirtyData=!0)},cy.updateSource=function(t){t&&Vl(t)&&(this.updateSource=t,this.dirtyData=!0)},ay.checkSource=function(t,e){this.source||(this.source=this.element);const i=this.source;if(i){let n=!1;this.dirtyData&&(this.dirtyData=!1,this.updateSource(this),n=!0),this.sourceLoaded=!0,this.sourceNaturalWidth&&this.sourceNaturalHeight&&this.sourceNaturalWidth===t&&this.sourceNaturalHeight===e||(this.sourceNaturalWidth=i.width,this.sourceNaturalHeight=i.height,n=!0),n&&this.sourceNaturalWidth&&this.sourceNaturalHeight&&this.notifySubscribers()}else this.sourceLoaded=!1},ay.subscribeAction=function(t={}){this.subscribers.push(t),t.asset=this,t.source=this.element,this.notifySubscriber(t)},ay.addAttribute=function(t=Ml){const{key:e,defaultValue:i,setter:n,deltaSetter:s,getter:r}=t;return e&&e.substring&&(this.defs[e]=Jl(i)?i:null,this[e]=Jl(i)?i:null,Vl(n)&&(cy[e]=n),Vl(s)&&(hy[e]=s),Vl(r)&&(ly[e]=r)),this},ay.removeAttribute=function(t){return t&&t.substring&&(delete this.defs[t],delete this[t],delete ly[t],delete cy[t],delete hy[t]),this},ay.initializeAttributes=function(t){for(const[e,i]of ct(t))switch(i){case ma:this[e]=Zd();break;case Pa:this[e]=zd();break;case Jo:this[e]=Au()}};const uy=function(t){return!!t&&new RawAsset(t)};Q.RawAsset=RawAsset;const RdAsset=function(t=Ml){return this.makeName(t.name),this.register(),this.installElement(this.name),this.subscribers=[],this.set(this.defs),this.set(t),t.subscribe&&this.subscribers.push(t.subscribe),this.currentGeneration=0,this.dataArrays=[],this.dirtyScene=!0,this.dirtyOutput=!0,this},dy=RdAsset.prototype=sc();dy.type="RdAsset",dy.lib=Ce,dy.isArtefact=!1,dy.isAsset=!0,ih(dy),td(dy),lm(dy),Hd(dy);const fy={width:300,height:150,diffusionRateA:.2097,diffusionRateB:.105,feedRate:.054,killRate:.062,initialSettingPreference:zr,randomEngineSeed:Si,initialRandomSeedLevel:.0045,initialSettingEntity:null,drawEvery:10,maxGenerations:4e3};dy.defs=_l(dy.defs,fy),delete dy.defs.source,delete dy.defs.sourceLoaded,dy.stringifyFunction=Il,dy.processPacketOut=Il,dy.finalizePacketOut=Il,dy.saveAsPacket=function(){return`[${this.name}, ${this.type}, ${this.lib}, {}]`},dy.clone=Ll;const py=dy.setters,gy=dy.getters;py.subscribers=Il,py.width=function(t){t.toFixed&&(this.width=t,this.sourceNaturalWidth=t,this.dirtyScene=!0)},py.height=function(t){t.toFixed&&(this.height=t,this.sourceNaturalHeight=t,this.dirtyScene=!0)},py.initialRandomSeedLevel=function(t){t.toFixed&&(this.initialRandomSeedLevel=t,this.dirtyScene=!0)},py.diffusionRateA=function(t){t.toFixed&&(this.diffusionRateA=t,this.dirtyScene=!0)},py.diffusionRateB=function(t){t.toFixed&&(this.diffusionRateB=t,this.dirtyScene=!0)},py.feedRate=function(t){t.toFixed&&(this.feedRate=t,this.dirtyScene=!0)},py.killRate=function(t){t.toFixed&&(this.killRate=t,this.dirtyScene=!0)},py.drawEvery=function(t){t.toFixed&&(this.drawEvery=t,this.dirtyScene=!0)},py.maxGenerations=function(t){t.toFixed&&(this.maxGenerations=t,this.dirtyScene=!0)},py.initialSettingPreference=function(t){t.substring&&Wr.includes(t)&&(this.initialSettingPreference=t,this.dirtyScene=!0)},py.randomEngineSeed=function(t){t.substring&&(this.randomEngineSeed=t,this.dirtyScene=!0)},py.initialSettingEntity=function(t){t&&(t.substring||(t=t.name||wl),t&&(this.initialSettingEntity=t,this.dirtyScene=!0))},gy.generation=function(){return this.currentGeneration},py.preset=function(t){if(t.substring){switch(t){case"negativeBubbles":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.098,this.killRate=.0555,this.maxGenerations=4e3,this.initialRandomSeedLevel=.05;break;case"positiveBubbles":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.098,this.killRate=.057,this.maxGenerations=4e3,this.initialRandomSeedLevel=.1;break;case"precriticalBubbles":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.082,this.killRate=.059,this.maxGenerations=4e3,this.initialRandomSeedLevel=.08;break;case"wormsAndLoops":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.082,this.killRate=.06,this.maxGenerations=4e3,this.initialRandomSeedLevel=.08;break;case"stableSolitons":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.074,this.killRate=.064,this.maxGenerations=4e3,this.initialRandomSeedLevel=.15;break;case"uSkateWorld":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.062,this.killRate=.0609,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"worms":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.058,this.killRate=.065,this.maxGenerations=4e3,this.initialRandomSeedLevel=.1;break;case"wormsJoinIntoMazes":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.046,this.killRate=.063,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"negatons":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.046,this.killRate=.0594,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"turingPatterns":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.042,this.killRate=.059,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"chaosToTuringNegatons":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.039,this.killRate=.058,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"fingerprints":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.037,this.killRate=.06,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"chaosWithNegatons":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.0353,this.killRate=.0566,this.maxGenerations=0,this.initialRandomSeedLevel=.0045;break;case"spotsAndWorms":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.034,this.killRate=.0618,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"selfReplicatingSpots":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.03,this.killRate=.063,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"superResonantMazes":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.03,this.killRate=.0565,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"mazes":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.029,this.killRate=.057,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"mazesWithSomeChaos":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.026,this.killRate=.055,this.maxGenerations=0,this.initialRandomSeedLevel=.0045;break;case"chaos":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.026,this.killRate=.051,this.maxGenerations=0,this.initialRandomSeedLevel=.009;break;case"warringMicrobes":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.022,this.killRate=.059,this.maxGenerations=0,this.initialRandomSeedLevel=.0045;break;case"spotsAndLoops":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.018,this.killRate=.051,this.maxGenerations=0,this.initialRandomSeedLevel=.0045;break;case"movingSpots":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.014,this.killRate=.054,this.maxGenerations=0,this.initialRandomSeedLevel=.0045;break;case"waves":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.014,this.killRate=.045,this.maxGenerations=0,this.initialRandomSeedLevel=.0045;break;default:this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.054,this.killRate=.062,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045}this.dirtyScene=!0}},dy.update=function(){this.dirtyOutput=!0},dy.cleanOutput=function(t=0){if(this.dirtyScene&&this.cleanScene(),!this.dirtyScene){const{dataArrays:e,diffusionRateA:i,diffusionRateB:n,feedRate:s,killRate:r,currentSource:o,drawEvery:a,maxGenerations:l,currentGeneration:c}=this;let h,u,d,f,p,g,m,y,b,S;if(!l||c=e?0:t},dy.checkCol=function(t){const e=this.width;return t<0?e-1:t>=e?0:t},dy.checkOutputValuesExist=function(){return!!this.dataArrays.length},dy.getOutputValue=function(t){let e,i;const{dataArrays:n,currentSource:s}=this;return s?[e,,i]=n:[,e,,i]=n,(e[t]-i[t]+1)/2};const my=function(t){return!!t&&new RdAsset(t)};Q.RdAsset=RdAsset;const Rectangle=function(t=Ml){return this.shapeInit(t),this.currentRectangleWidth=1,this.currentRectangleHeight=1,this},yy=Rectangle.prototype=sc();yy.type="Rectangle",yy.lib=Yi,yy.isArtefact=!0,yy.isAsset=!1,ih(yy),Kf(yy);yy.defs=_l(yy.defs,{rectangleWidth:10,rectangleHeight:10,radiusTLX:0,radiusTLY:0,radiusTRX:0,radiusTRY:0,radiusBRX:0,radiusBRY:0,radiusBLX:0,radiusBLY:0,offshootA:.55,offshootB:0});const by=yy.setters,Sy=yy.deltaSetters;by.radius=function(t){this.setRectHelper(t,fr)},by.radiusX=function(t){this.setRectHelper(t,Mr)},by.radiusY=function(t){this.setRectHelper(t,Xr)},by.radiusT=function(t){this.setRectHelper(t,Fr)},by.radiusB=function(t){this.setRectHelper(t,pr)},by.radiusL=function(t){this.setRectHelper(t,Cr)},by.radiusR=function(t){this.setRectHelper(t,wr)},by.radiusTX=function(t){this.setRectHelper(t,Lr)},by.radiusBX=function(t){this.setRectHelper(t,Ar)},by.radiusLX=function(t){this.setRectHelper(t,Pr)},by.radiusRX=function(t){this.setRectHelper(t,Or)},by.radiusTY=function(t){this.setRectHelper(t,$r)},by.radiusBY=function(t){this.setRectHelper(t,vr)},by.radiusLY=function(t){this.setRectHelper(t,xr)},by.radiusRY=function(t){this.setRectHelper(t,Dr)},by.radiusTL=function(t){this.setRectHelper(t,Rr)},by.radiusTR=function(t){this.setRectHelper(t,Er)},by.radiusBL=function(t){this.setRectHelper(t,gr)},by.radiusBR=function(t){this.setRectHelper(t,br)},by.radiusTLX=function(t){this.setRectHelper(t,Tr)},by.radiusTLY=function(t){this.setRectHelper(t,Hr)},by.radiusTRX=function(t){this.setRectHelper(t,Ir)},by.radiusTRY=function(t){this.setRectHelper(t,Br)},by.radiusBRX=function(t){this.setRectHelper(t,Sr)},by.radiusBRY=function(t){this.setRectHelper(t,kr)},by.radiusBLX=function(t){this.setRectHelper(t,mr)},by.radiusBLY=function(t){this.setRectHelper(t,yr)},Sy.radius=function(t){this.deltaRectHelper(t,fr)},Sy.radiusX=function(t){this.deltaRectHelper(t,Mr)},Sy.radiusY=function(t){this.deltaRectHelper(t,Xr)},Sy.radiusT=function(t){this.deltaRectHelper(t,Fr)},Sy.radiusB=function(t){this.deltaRectHelper(t,pr)},Sy.radiusL=function(t){this.deltaRectHelper(t,Cr)},Sy.radiusR=function(t){this.deltaRectHelper(t,wr)},Sy.radiusTX=function(t){this.deltaRectHelper(t,Lr)},Sy.radiusBX=function(t){this.deltaRectHelper(t,Ar)},Sy.radiusLX=function(t){this.deltaRectHelper(t,Pr)},Sy.radiusRX=function(t){this.deltaRectHelper(t,Or)},Sy.radiusTY=function(t){this.deltaRectHelper(t,$r)},Sy.radiusBY=function(t){this.deltaRectHelper(t,vr)},Sy.radiusLY=function(t){this.deltaRectHelper(t,xr)},Sy.radiusRY=function(t){this.deltaRectHelper(t,Dr)},Sy.radiusTL=function(t){this.deltaRectHelper(t,Rr)},Sy.radiusTR=function(t){this.deltaRectHelper(t,Er)},Sy.radiusBL=function(t){this.deltaRectHelper(t,gr)},Sy.radiusBR=function(t){this.deltaRectHelper(t,br)},Sy.radiusTLX=function(t){this.deltaRectHelper(t,Tr)},Sy.radiusTLY=function(t){this.deltaRectHelper(t,Hr)},Sy.radiusTRX=function(t){this.deltaRectHelper(t,Ir)},Sy.radiusTRY=function(t){this.deltaRectHelper(t,Br)},Sy.radiusBRX=function(t){this.deltaRectHelper(t,Sr)},Sy.radiusBRY=function(t){this.deltaRectHelper(t,kr)},Sy.radiusBLX=function(t){this.deltaRectHelper(t,mr)},Sy.radiusBLY=function(t){this.deltaRectHelper(t,yr)},by.offshootA=function(t){this.offshootA=t,this.updateDirty()},by.offshootB=function(t){this.offshootB=t,this.updateDirty()},Sy.offshootA=function(t){t.toFixed&&(this.offshootA+=t,this.updateDirty())},Sy.offshootB=function(t){t.toFixed&&(this.offshootB+=t,this.updateDirty())},by.rectangleWidth=function(t){null!=t&&(this.rectangleWidth=t,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0)},by.rectangleHeight=function(t){null!=t&&(this.rectangleHeight=t,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0)},Sy.rectangleWidth=function(t){this.rectangleWidth=Fl(this.rectangleWidth,t),this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0},Sy.rectangleHeight=function(t){this.rectangleHeight=Fl(this.rectangleHeight,t),this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0},yy.setRectHelper=function(t,e){this.updateDirty(),e.forEach((e=>{this[e]=t}),this)},yy.deltaRectHelper=function(t,e){this.updateDirty(),e.forEach((e=>{this[e]=Fl(this[e],t)}),this)},yy.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeRectanglePath()},yy.cleanDimensions=function(){this.dirtyDimensions=!1;const t=this.getHost();if(t){const e=t.currentDimensions?t.currentDimensions:[t.w,t.h],i=this.currentRectangleWidth||1,n=this.currentRectangleHeight||1;let s=this.rectangleWidth,r=this.rectangleHeight;s.substring&&(s=parseFloat(s)/100*e[0]),r.substring&&(r=parseFloat(r)/100*e[1]);const o=this.mimic;let a;o&&o.name&&this.useMimicDimensions&&(a=o.currentDimensions),a?(this.currentRectangleWidth=this.addOwnDimensionsToMimic?a[0]+s:a[0],this.currentRectangleHeight=this.addOwnDimensionsToMimic?a[1]+r:a[1]):(this.currentRectangleWidth=s,this.currentRectangleHeight=r),this.currentDimensions[0]=this.currentRectangleWidth,this.currentDimensions[1]=this.currentRectangleHeight,this.dirtyStart=!0,this.dirtyHandle=!0,this.dirtyOffset=!0,i===this.currentRectangleWidth&&n===this.currentRectangleHeight||(this.dirtyPositionSubscribers=!0),this.mimicked&&this.mimicked.length&&(this.dirtyMimicDimensions=!0)}else this.dirtyDimensions=!0},yy.makeRectanglePath=function(){this.dirtyDimensions&&this.cleanDimensions();const t=this.currentRectangleWidth,e=this.currentRectangleHeight,i=this.offshootA,n=this.offshootB;let s=this.radiusTLX,r=this.radiusTLY,o=this.radiusTRX,a=this.radiusTRY,l=this.radiusBRX,c=this.radiusBRY,h=this.radiusBLX,u=this.radiusBLY;(s.substring||r.substring||o.substring||a.substring||l.substring||c.substring||h.substring||u.substring)&&(s=s.substring?parseFloat(s)/100*t:s,r=r.substring?parseFloat(r)/100*e:r,o=o.substring?parseFloat(o)/100*t:o,a=a.substring?parseFloat(a)/100*e:a,l=l.substring?parseFloat(l)/100*t:l,c=c.substring?parseFloat(c)/100*e:c,h=h.substring?parseFloat(h)/100*t:h,u=u.substring?parseFloat(u)/100*e:u);let d=xl;return t-s-o!=0&&(d+="h"+(t-s-o)),o+a!==0&&(d+=`c${o*i},${a*n} ${o-o*n},${a-a*i}, ${o},${a}`),e-a-c!=0&&(d+="v"+(e-a-c)),l+c!==0&&(d+=`c${-l*n},${c*i} ${l*i-l},${c-c*n} ${-l},${c}`),-t+h+l!==0&&(d+=`h${-t+h+l}`),h+u!==0&&(d+=`c${-h*i},${-u*n} ${h*n-h},${u*i-u} ${-h},${-u}`),-e+r+u!==0&&(d+=`v${-e+r+u}`),s+r!==0&&(d+=`c${s*n},${-r*i} ${s-s*i},${r*n-r} ${s},${-r}`),d+="z",d},yy.calculateLocalPathAdditionalActions=function(){const[t,e]=this.localBox;this.pathDefinition=this.pathDefinition.replace(xl,`m${-t},${-e}`),this.pathCalculatedOnce=!1,this.calculateLocalPath(this.pathDefinition,!0)};const ky=function(t){return!!t&&(t.species=Zr,new Rectangle(t))};Q.Rectangle=Rectangle;const Shape=function(t=Ml){return this.shapeInit(t),this},Ay=Shape.prototype=sc();Ay.type="Shape",Ay.lib=Yi,Ay.isArtefact=!0,Ay.isAsset=!1,ih(Ay),Kf(Ay),Ay.cleanSpecies=function(){this.dirtySpecies=!1},Ay.cleanStampHandlePositionsAdditionalActions=function(){const t=this.localBox,e=this.currentStampHandlePosition;e[0]+=t[0],e[1]+=t[1]};const vy=function(t){return!!t&&new Shape(t)};Q.Shape=Shape;const Cy=dt([dt([.043,0,.082,-.035,.088,-.088]),dt([.007,-.057,-.024,-.121,-.088,-.162]),dt([-.07,-.045,-.169,-.054,-.265,-.015]),dt([-.106,.043,-.194,.138,-.235,.265]),dt([-.044,.139,-.026,.3,.058,.442]),dt([.091,.153,.25,.267,.442,.308]),dt([.206,.044,.431,-.001,.619,-.131]),dt([.2,-.139,.34,-.361,.381,-.619])]),Py=dt([dt([0,-.27,-.11,-.52,-.29,-.71]),dt([-.19,-.19,-.44,-.29,-.71,-.29]),dt([-.27,0,-.52,.11,-.71,.29]),dt([-.19,.19,-.29,.44,-.29,.71]),dt([0,.27,.11,.52,.29,.71]),dt([.19,.19,.44,.29,.71,.29]),dt([.27,0,.52,-.11,.71,-.29]),dt([.19,-.19,.29,-.44,.29,-.71])]),Spiral=function(t=Ml){return this.shapeInit(t),this},xy=Spiral.prototype=sc();xy.type="Spiral",xy.lib=Yi,xy.isArtefact=!0,xy.isAsset=!1,ih(xy),Kf(xy);xy.defs=_l(xy.defs,{loops:1,loopIncrement:1,drawFromLoop:0});const wy=xy.setters,Oy=xy.deltaSetters;wy.loops=function(t){this.loops=t,this.updateDirty()},Oy.loops=function(t){this.loops+=t,this.updateDirty()},wy.loopIncrement=function(t){this.loopIncrement=t,this.updateDirty()},Oy.loopIncrement=function(t){this.loopIncrement+=t,this.updateDirty()},wy.drawFromLoop=function(t){this.drawFromLoop=ut(t),this.updateDirty()},Oy.drawFromLoop=function(t){this.drawFromLoop=ut(this.drawFromLoop+t),this.updateDirty()},xy.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeSpiralPath()},xy.makeSpiralPath=function(){const t=ut(this.loops),e=this.loopIncrement,i=ut(this.drawFromLoop),n=$c();let s,r,o,a,l,c,h,u,d,f,p,g;for(let t=0,i=Cy.length;t=i&&(m+=`c${s},${r} ${o},${a} ${l},${c}`),[h,u,d,f,p,g]=Py[t],n[t]=[s+h*e,r+u*e,o+d*e,a+f*e,l+p*e,c+g*e];return Mc(n),m},xy.calculateLocalPathAdditionalActions=function(){const[t,e]=this.localBox,i=this.scale;this.pathDefinition=this.pathDefinition.replace(xl,`m${-t/i},${-e/i}`),this.pathCalculatedOnce=!1,this.calculateLocalPath(this.pathDefinition,!0)};const Dy=function(t){return!!t&&(t.species="spiral",new Spiral(t))};Q.Spiral=Spiral;const Star=function(t=Ml){return this.shapeInit(t),this},Fy=Star.prototype=sc();Fy.type="Star",Fy.lib=Yi,Fy.isArtefact=!0,Fy.isAsset=!1,ih(Fy),Kf(Fy);Fy.defs=_l(Fy.defs,{radius1:0,radius2:0,points:0,twist:0});const Ry=Fy.setters,Ty=Fy.deltaSetters;Ry.radius1=function(t){this.radius1=t,this.updateDirty()},Ty.radius1=function(t){this.radius1+=t,this.updateDirty()},Ry.radius2=function(t){this.radius2=t,this.updateDirty()},Ty.radius2=function(t){this.radius2+=t,this.updateDirty()},Ry.points=function(t){this.points=t,this.updateDirty()},Ty.points=function(t){this.points+=t,this.updateDirty()},Ry.twist=function(t){this.twist=t,this.updateDirty()},Ty.twist=function(t){this.twist+=t,this.updateDirty()},Fy.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeStarPath()},Fy.makeStarPath=function(){const t=this.points,e=this.twist,i=360/t,n=$c();let s,r,o,a,l=this.radius1,c=this.radius2,h=wl;if(l.substring||c.substring){const t=this.getHost();if(t){const e=t.currentDimensions[0];l=l.substring?parseFloat(l)/100*e:l,c=c.substring?parseFloat(c)/100*e:c}}const u=Gd({x:0,y:-l}),d=Gd({x:0,y:-c});s=u.x,r=u.y,n.push(s),d.rotate(-i/2),d.rotate(e);for(let e=0;e{this[e]=t}),this)},Ey.deltaRectHelper=function(t,e){this.updateDirty(),e.forEach((e=>{this[e]=Fl(this[e],t)}),this)},Ey.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeTetragonPath()},Ey.makeTetragonPath=function(){const t=this.radiusX,e=this.radiusY;let i,n;if(t.substring||e.substring){const s=this.getHost();if(s){const[r,o]=s.currentDimensions;i=2*(t.substring?parseFloat(t)/100*r:t),n=2*(e.substring?parseFloat(e)/100*o:e)}}else i=2*t,n=2*e;const s=parseFloat((i*this.intersectX).toFixed(2)),r=parseFloat((i-s).toFixed(2)),o=parseFloat((n*this.intersectY).toFixed(2)),a=parseFloat((n-o).toFixed(2));let l=xl;return l+=`l${r},${o} ${-r},${a} ${-s},${-a} ${s},${-o}z`,l},Ey.calculateLocalPathAdditionalActions=function(){const[t,e]=this.localBox;this.pathDefinition=this.pathDefinition.replace(xl,`m${-t},${-e}`),this.pathCalculatedOnce=!1,this.calculateLocalPath(this.pathDefinition,!0)};const Ly=function(t){return!!t&&(t.species="tetragon",new Tetragon(t))};Q.Tetragon=Tetragon;const Ticker=function(t=Ml){return this.makeName(t.name),this.register(),this.subscribers=[],this.subscriberObjects=[],this.set(this.defs),this.set(t),this.cycleCount=0,this.active=!1,this.effectiveDuration=0,this.startTime=0,this.currentTime=0,this.tick=0,this.lastEvent=0,t.subscribers&&this.subscribe(t.subscribers),this.setEffectiveDuration(),this},$y=Ticker.prototype=sc();$y.type=va,$y.lib="animationtickers",$y.isArtefact=!1,$y.isAsset=!1,ih($y);$y.defs=_l($y.defs,{order:1,duration:0,subscribers:null,killOnComplete:!1,cycles:1,eventChoke:0,observer:null,onRun:null,onHalt:null,onReverse:null,onResume:null,onSeekTo:null,onSeekFor:null,onComplete:null,onReset:null}),$y.packetExclusions=ql($y.packetExclusions,["subscribers"]),$y.packetFunctions=ql($y.packetFunctions,["onRun","onHalt","onReverse","onResume","onSeekTo","onSeekFor","onComplete","onReset"]),$y.kill=function(){return this.active&&this.halt(),Ql(Yy,this.name),Gy=!0,this.deregister(),!0},$y.killTweens=function(t=!1){let e,i,n;for(e=0,i=this.subscribers.length;e{i=E[e],i&&t.push(i)}))},$y.getSubscriberObjects=function(){return this.subscribers.length&&!this.subscriberObjects.length&&this.repopulateSubscriberObjects(),this.subscriberObjects},$y.sortSubscribers=function(){const t=this.subscribers,e=t.length;if(e>1){const i=$c();let n,s,r,o;for(n=0;n=0;n--)i[n].set(t);else for(n=0,s=i.length;nt.reversed=!t.reversed)),this},$y.makeTickerUpdateEvent=function(){return new CustomEvent("tickerupdate",{detail:{name:this.name,type:va,tick:this.tick,reverseTick:this.effectiveDuration-this.tick},bubbles:!0,cancelable:!0})},$y.recalculateEffectiveDuration=function(){const t=this.getSubscriberObjects();let e,i=0;return this.duration?this.setEffectiveDuration():(t.forEach((t=>{e=t.getEndTime(),e>i&&(i=e)})),this.effectiveDuration=i),this},$y.setEffectiveDuration=function(){let t;return this.duration&&(t=Tl(this.duration),t[0]===Vs?(this.duration=0,this.recalculateEffectiveDuration()):this.effectiveDuration=t[1]),this},$y.checkObserverRunningState=function(){let t=this.observer;if(t){if(t.substring){const e=i[t];if(!e||e.type!==Sa)return!0;t=this.observer=e}if(t.type===Sa)return t.isRunning()}return!0},$y.fn=function(t){t=!!Jl(t)&&t;const e=zy(),i=this.startTime,n=this.cycles,s=this.effectiveDuration,r=this.eventChoke;let o,a,l,c,h,u,d,f,p=this.active,g=this.cycleCount;if(p&&i&&(!n||g=s?(f=this.tick=0,this.startTime=this.currentTime,e.tick=s,e.reverseTick=0,e.willLoop=!0,n&&(g++,this.cycleCount=g)):(e.tick=f,e.reverseTick=s-f),e.next=!0):f>=s?(e.tick=s,e.reverseTick=0,p=this.active=!1,n&&(g++,this.cycleCount=g)):(e.tick=f,e.reverseTick=s-f,e.next=!0),l=this.getSubscriberObjects(),t)for(o=l.length-1;o>=0;o--)l[o].update(e);else for(o=0,a=l.length;o=n&&this.killTweens(!0)}Ny(e)},$y.run=function(){return this.active||(this.startTime=this.currentTime=At(),this.cycleCount=0,this.updateSubscribers({reversed:!1}),this.active=!0,ql(Yy,this.name),Gy=!0,typeof this.onRun===cn&&this.onRun()),this},$y.isRunning=function(){return this.active},$y.reset=function(){return this.active&&this.halt(),this.startTime=this.currentTime=At(),this.cycleCount=0,this.updateSubscribers({reversed:!1}),this.active=!0,this.fn(!0),this.active=!1,typeof this.onReset===cn&&this.onReset(),this},$y.complete=function(){return this.active&&this.halt(),this.startTime=this.currentTime=At(),this.cycleCount=0,this.updateSubscribers({reversed:!0}),this.active=!0,this.fn(),this.active=!1,typeof this.onComplete===cn&&this.onComplete(),this},$y.reverse=function(t=!1){t=ec(t,!1),this.active&&this.halt();const e=this.currentTime-this.startTime;return this.startTime=this.currentTime-(this.effectiveDuration-e),this.changeSubscriberDirection(),this.active=!0,this.fn(),this.active=!1,typeof this.onReverse===cn&&this.onReverse(),t&&this.resume(),this},$y.halt=function(){return this.active=!1,Ql(Yy,this.name),Gy=!0,typeof this.onHalt===cn&&this.onHalt(),this},$y.resume=function(){let t,e,i;return this.active||(t=At(),e=this.currentTime,i=this.startTime,this.startTime=t-(e-i),this.currentTime=t,this.active=!0,ql(Yy,this.name),Gy=!0,typeof this.onResume===cn&&this.onResume()),this},$y.seekTo=function(t,e=!1){let i=!1;return t=ec(t,0),this.active&&this.halt(),this.cycles&&this.cycleCount>=this.cycles&&(this.cycleCount=this.cycles-1),t=this.cycles&&(this.cycleCount=this.cycles-1),this.startTime-=t,t<0&&(i=!0),this.active=!0,this.fn(i),this.active=!1,typeof this.onSeekFor===cn&&this.onSeekFor(),e&&this.resume(),this};const Yy=[];let Gy=!0;sh({name:"SC-core-tickers-animation",order:0,fn:function(){let t,e,i,n,r,o;if(Gy){Gy=!1;const s=$c();for(n=0,r=Yy.length;n{if(gt(t))n=t[0],s=t[1];else{if(!tc(t,t.x,t.y))return!1;n=t.x,s=t.y}if(!mt(n)||!mt(s))return!1;const e=Gd(i).vectorSubtract(t);return e.getMagnitude()t.name))),gt(this.definitions)&&(t.definitions=this.definitions.map((t=>{const e={};if(e.attribute=t.attribute,e.start=t.start,e.end=t.end,t.engine&&t.engine.substring)e.engine=t.engine.substring;else if(Jl(t.engine)&&null!=t.engine){const i=this.stringifyFunction(t.engine);i&&(e.engine=i,e.engineIsFunction=!0)}return e}))),t},Ky.postCloneAction=function(t,e){if(e.useNewTicker){const i=s[this.ticker];Jl(e.cycles)?t.cycles=e.cycles:t.cycles=i?i.cycles:1;const n=s[t.ticker];n.cycles=t.cycles,Jl(e.duration)&&(t.duration=e.duration,t.calculateEffectiveDuration(),n&&n.recalculateEffectiveDuration())}return gt(t.definitions)&&t.definitions.forEach(((t,e)=>{t.engineIsFunction&&(t.engine=this.definitions[e].engine)})),t};const qy=Ky.getters,Qy=Ky.setters;qy.definitions=function(){return[].concat(this.definitions)},Qy.definitions=function(t){this.definitions=[].concat(t),this.setDefinitionsValues()},Qy.commenceAction=function(t){this.commenceAction=t,typeof this.commenceAction!=cn&&(this.commenceAction=Il)},Qy.completeAction=function(t){this.completeAction=t,typeof this.completeAction!=cn&&(this.completeAction=Il)},Ky.set=function(t=Ml){const e=this.setters,i=bt(t),n=this.defs,s=!!Jl(t.ticker)&&this.ticker;let r,o,a,l;for(o=0,a=i.length;oo?l=1:ia&&(l=1)),s?l&&l==this.status||(this.status=l,this.doSimpleUpdate(t),t.next||(this.status=r?-1:1)):l!=this.status&&(this.status=l,this.doSimpleUpdate(t),t.next||(this.status=r?-1:1)),t.willLoop&&(this.reverseOnCycleEnd?this.reversed=!r:this.status=-1)},Ky.doSimpleUpdate=function(t=Ml){const e=this.effectiveTime,i=this.engineActions,n=this.effectiveDuration,s=this.status,r=this.definitions,o=this.targets,a=this.action,l=this.setObj||{};let c,h,u,d,f,p,g,m,y,b,S,k,A;const v=this.reversed?t.reverseTick-e:t.tick-e;for(A=n&&!s?v/n:s>0?1:0,y=0,b=r.length;y(t=parseFloat(t),Wl(t)||(t=0),Wl(e)||(e=0),parseFloat(t.toFixed(e))),Wheel=function(t=Ml){return ic(t.dimensions,t.width,t.height,t.radius)||(t.radius=5),this.entityInit(t),this},eb=Wheel.prototype=sc();eb.type="Wheel",eb.lib=Yi,eb.isArtefact=!0,eb.isAsset=!1,ih(eb),Gf(eb);eb.defs=_l(eb.defs,{radius:5,startAngle:0,endAngle:360,clockwise:!0,includeCenter:!1,closed:!0});const ib=eb.setters,nb=eb.deltaSetters;ib.width=function(t){if(null!=t){const e=this.dimensions;e[0]=e[1]=t,this.dimensionsHelper()}},nb.width=function(t){const e=this.dimensions;e[0]=e[1]=Fl(e[0],t),this.dimensionsHelper()},ib.height=function(t){if(null!=t){const e=this.dimensions;e[0]=e[1]=t,this.dimensionsHelper()}},nb.height=function(t){const e=this.dimensions;e[0]=e[1]=Fl(e[0],t),this.dimensionsHelper()},ib.dimensions=function(t,e){this.setCoordinateHelper(Ci,t,e),this.dimensionsHelper()},nb.dimensions=function(t,e){this.setDeltaCoordinateHelper(Ci,t,e),this.dimensionsHelper()},ib.radius=function(t){this.radius=t,this.radiusHelper()},nb.radius=function(t){this.radius=Fl(this.radius,t),this.radiusHelper()},ib.startAngle=function(t){this.startAngle=tb(t,4),this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0},nb.startAngle=function(t){this.startAngle+=tb(t,4),this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0},ib.endAngle=function(t){this.endAngle=tb(t,4),this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0},nb.endAngle=function(t){this.endAngle+=tb(t,4),this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0},ib.closed=function(t){Jl(t)&&(this.closed=!!t,this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0)},ib.includeCenter=function(t){Jl(t)&&(this.includeCenter=!!t,this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0)},ib.clockwise=function(t){Jl(t)&&(this.clockwise=!!t,this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0)},eb.dimensionsHelper=function(){const t=this.dimensions[0];t.substring?this.radius=parseFloat(t)/2+"%":this.radius=t/2,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0},eb.radiusHelper=function(){const t=this.radius,e=this.dimensions;t.substring?e[0]=e[1]=2*parseFloat(t)+Vs:e[0]=e[1]=2*t,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0},eb.cleanDimensionsAdditionalActions=function(){const t=this.radius,e=this.currentDimensions,i=t.substring?parseFloat(t)/100*e[0]:t;e[0]!==2*i?(e[1]=e[0],this.currentRadius=e[0]/2):this.currentRadius=i},eb.cleanPathObject=function(){if(this.dirtyPathObject=!1,!this.noPathUpdates||!this.pathObject){const t=this.pathObject=new Path2D,e=this.currentStampHandlePosition,i=this.currentScale,n=this.currentRadius*i,s=n-e[0]*i,r=n-e[1]*i,o=this.startAngle*Ot,a=this.endAngle*Ot;t.arc(s,r,n,o,a,!this.clockwise),this.includeCenter?(t.lineTo(s,r),t.closePath()):this.closed&&t.closePath()}};const sb=function(t){return!!t&&new Wheel(t)};Q.Wheel=Wheel;const World=function(t=Ml){this.makeName(t.name),this.register(),this.set(this.defs);const e=t.keytypes||{};return e.gravity||(e.gravity=Pa),t.gravity||(t.gravity=[0,9.81,0]),t.userAttributes&&t.userAttributes.forEach((t=>{this.addAttribute(t),t.type&&(e[t.key]=t.type)})),this.initializeAttributes(e),this.set(t),this},rb=World.prototype=sc();rb.type=wa,rb.lib="world",rb.isArtefact=!1,rb.isAsset=!1,ih(rb);rb.defs=_l(rb.defs,{gravity:null,tickMultiplier:1,keytypes:null}),rb.kill=function(){return this.deregister(),!0};const ob=rb.getters,ab=rb.setters,lb=rb.deltaSetters;ab.gravityX=function(t){this.gravity&&Jl(t)&&this.gravity.setX(t)},ab.gravityY=function(t){this.gravity&&Jl(t)&&this.gravity.setY(t)},ab.gravityZ=function(t){this.gravity&&Jl(t)&&this.gravity.setZ(t)},ab.gravity=function(t){this.gravity&&Jl(t)&&this.gravity.set(t)},rb.addAttribute=function(t=Ml){const{key:e,defaultValue:i,setter:n,deltaSetter:s,getter:r}=t;return e&&e.substring&&(this.defs[e]=Jl(i)?i:null,this[e]=Jl(i)?i:null,Vl(n)&&(ab[e]=n),Vl(s)&&(lb[e]=s),Vl(r)&&(ob[e]=r)),this},rb.removeAttribute=function(t){return t&&t.substring&&(delete this.defs[t],delete this[t],delete ob[t],delete ab[t],delete lb[t]),this},rb.initializeAttributes=function(t){for(const[e,i]of ct(t))switch(i){case ma:this[e]=Zd();break;case Pa:this[e]=zd();break;case Jo:this[e]=Au()}};const cb=function(t){return!!t&&new World(t)};Q.World=World;const hb={},ub=function(t=Ml){const e=(t=Ml)=>{if(t&&t.target){let e=t.target,n="";for(;!n&&(hb[e.id]&&(n=e.id),e.tagName!==Mt);)e=e.parentElement;const r=hb[n];if(r)for(let e=0,n=r.length;e{i(t)};let s=Il;const r=(t=Ml)=>{s(t),i=Il,s=Il},a=function(t=Ml,e,i){let{zone:n,coordinateSource:s,collisionGroup:r,startOn:a,endOn:l,updateOnStart:c,updateOnEnd:h,updateWhileMoving:u,updateOnShiftStart:d,updateOnShiftEnd:f,updateWhileShiftMoving:p,updateOnPrematureExit:g,exposeCurrentArtefact:m,preventTouchDefaultWhenDragging:y,resetCoordsToZeroOnTouchEnd:b,processingOrder:S}=t;if(!n)return new Error("dragZone constructor - no zone supplied");if(n.substring&&(n=o[n]),!n||!oe.includes(n.type))return new Error("dragZone constructor - zone object is not a Stack or Canvas wrapper");const k=n.domElement;if(!k)return new Error("dragZone constructor - zone does not contain a target DOM element");if(r?r.substring&&(r=v[r]):r=n.type===_o?v[n.base.name]:v[n.name],!r||r.type!==ra)return new Error("dragZone constructor - unable to recover collisionGroup group");if(s?s.here?s=s.here:tc(s.x,s.y)||(s=!1):s=n.type===_o?n.base.here:n.here,!s)return new Error("dragZone constructor - unable to discover a usable coordinateSource object");gt(a)||(a=[Di]),gt(l)||(l=[hl]),null==m&&(m=!1),null==y&&(y=!1),null==b&&(b=!0),Ul(c)&&(c=function(){A.artefact.set(t.updateOnStart)}),Vl(c)||(c=Il),Ul(d)&&(d=function(){A.artefact.set(t.updateOnShiftStart)}),Vl(d)||(d=c),Ul(h)&&(h=function(){A.artefact.set(t.updateOnEnd)}),Vl(h)||(h=Il),Ul(f)&&(f=function(){A.artefact.set(t.updateOnShiftEnd)}),Vl(f)||(f=h),Vl(u)||(u=Il),Vl(p)||(p=u),Vl(g)||(g=Il),jl(m)||(m=!1),null==S&&(S=0);let A=!1;const C=function(t){t&&t.cancelable&&(y&&A?(t.preventDefault(),t.returnValue=!1):y||(t.preventDefault(),t.returnValue=!1))},P=function(t=Ml){A&&(C(t),t.type===qa&&Oh(t),t.shiftKey?p(t):u(t))},x=function(t=Ml){A&&(C(t),t.type===Ka&&Oh(t,b),A.artefact.dropArtefact(),t.shiftKey?f(t):h(t),A=!1)};hb[n.name]||(hb[n.name]=[],e(a,l,k));const w=function(){const t=`${n.name}_${r.name}_${S}`;hb[n.name]=hb[n.name].filter((e=>e.name!==t)),hb[n.name].length||(i(a,l,k),delete hb[n.name])},O=function(t){if(!t)return A;"exit"===t||"drop"===t?(x(),g()):w()},D={name:`${n.name}_${r.name}_${S}`,exposeCurrentArtefact:m,target:k,processingOrder:S,pickup:function(t=Ml){C(t);const e=t.type;return e!==Qa&&e!==_a||Oh(t,b),A=r.getArtefactAt(s),A&&(A.artefact.pickupArtefact(s),t.shiftKey?d(t):c(t)),{current:A,move:P,drop:x}},move:P,drop:x,kill:w,getCurrent:O};return hb[n.name].push(D),hb[n.name].sort(((t,e)=>t.processingOrder-e.processingOrder)),{exposeCurrentArtefact:m,getCurrent:O,kill:w,zone:n}}(t,((t,i,s)=>{Zc(t,e,s),Zc(vs,n,s),Zc(i,r,s)}),((t,i,s)=>{_c(t,e,s),_c(vs,n,s),_c(i,r,s)}));return a.exposeCurrentArtefact?a.getCurrent:a.kill},db={},fb=function(t=Ml){const e=(t=Ml)=>{if(t&&t.target){let e=t.target,n="";for(;!n&&(db[e.id]&&(n=e.id),e.tagName!==Mt);)e=e.parentElement;const s=db[n];s?(s.onKeyDown(t),i=s.onKeyUp):i=Il}};let i=Il;const n=t=>{i(t)};return function(t=Ml,e,i){let n=t.zone;if(!n)return new Error("keyboardZone constructor - no zone supplied");if(n.substring&&(n=o[n]),!n||!oe.includes(n.type))return new Error("keyboardZone constructor - zone object is not a Stack or Canvas wrapper");const s=n.domElement;if(!s)return new Error("keyboardZone constructor - zone does not contain a target DOM element");let r=db[n.name];if(r||(db[n.name]={},r=db[n.name],e(s)),r.extraKeys||(r.extraKeys={Shift:!1,Control:!1,Alt:!1,Meta:!1}),!r.keyGroups){const t={};Gn.forEach((e=>t[e]={})),r.keyGroups=t}const a=r.keyGroups;return Gn.forEach((e=>{const i=t[e];null!=i&&Kl(a[e],i)})),r.onKeyDown||(r.onKeyDown=(t=Ml)=>{if(t&&t.key){t.preventDefault();const{extraKeys:e,keyGroups:i}=r,{key:n}=t;if("Tab"===n||"Escape"===n)return void s.blur();if(null!=e[n])return void(e[n]=!0);const{Shift:o,Control:a,Alt:l,Meta:c}=e;let h=i.none;(o||a||l||c)&&(h=o?l?a?c?i.all:i.shiftAltCtrl:c?i.shiftAltMeta:i.shiftAlt:a?c?i.shiftCtrlMeta:i.shiftCtrl:c?i.shiftMeta:i.shiftOnly:l?a?c?i.altCtrlMeta:i.altCtrl:c?i.altMeta:i.altOnly:a?c?i.ctrlMeta:i.ctrlOnly:c?i.altOnly:i.none),h[n]&&h[n]()}}),r.onKeyUp||(r.onKeyUp=(t=Ml)=>{if(t&&t.key){t.preventDefault();const e=r.extraKeys,i=t.key;null!=e[i]&&(e[i]=!1)}}),r.kill||(r.kill=function(){delete db[n.name],i(s)}),{kill:r.kill,getMappedKeys:(t=Is)=>null!=r.keyGroups[t]?bt(r.keyGroups[t]):[]}}(t,(t=>{Jc(Xn,e,t),Jc(Yn,n,t)}),(t=>{th(Xn,e,t),th(Yn,n,t)}))},pb=function(t=Ml){if(!tc(t.event,t.origin,t.updates))return!1;const e=t.target.substring&&t.targetLibrarySection?J[t.targetLibrarySection][t.target]:t.target;if(!e)return!1;const i=t.event,n=t.origin,s=t.useNativeListener?Jc:Zc,r=t.useNativeListener?th:_c;let o=Il;t.preventDefault&&(o=t=>{t.preventDefault(),t.returnValue=!1});const a=Vl(t.setup)?t.setup:Il,l=Vl(t.callback)?t.callback:Il,c=function(i){o(i);const n=!(!i||!i.target)&&i.target.id;if(n){const s=t.updates[n];if(s){a();const t=s[0],n=s[1],r=i.target.value;let o,c=!0;switch(n){case"float":o=parseFloat(r);break;case"int":o=parseInt(r,10);break;case"round":o=Ft(r);break;case"roundDown":o=ut(r);break;case"roundUp":o=rt(r);break;case"raw":o=r;break;case"parse":o=r.substring?JSON.parse(r):r;break;case"string":o=`${r}`;break;case"boolean":o=!!Jl(r)&&(r.substring?tl===r.toLowerCase()||"false"!==r.toLowerCase()&&!!parseFloat(r):!!r);break;default:n.substring?o=`${parseFloat(r)}${n}`:c=!1}c&&(e.type===ra?e.setArtefacts({[t]:o}):e.set({[t]:o}),l(i))}}};return s(i,c,n),function(){r(i,c,n)}},gb=(t=Ml)=>pb(t),mb=Cf;"undefined"!=typeof window&&Cf();export{cf as addCanvas,Zc as addListener,Jc as addNativeListener,Af as addStack,X as checkFontIsLoaded,wf as clear,Of as compile,ld as createImageFromCell,hd as createImageFromEntity,cd as createImageFromGroup,oh as currentCorePosition,G as findArtefact,j as findAsset,N as findCanvas,q as findElement,z as findEntity,Z as findFilter,_ as findGroup,U as findPattern,K as findStack,V as findStyles,W as findTween,Ec as forceUpdate,rf as getCanvas,Y as getFontMetadata,gh as getIgnorePixelRatio,fh as getPixelRatio,vf as getStack,xh as getTouchActionChoke,ad as importDomImage,xm as importDomVideo,od as importImage,wm as importMediaStream,Om as importScreenCapture,Tm as importSprite,Dm as importVideo,mb as init,J as library,Yf as makeAction,sh as makeAnimation,Uc as makeAnimationObserver,sp as makeBezier,zf as makeBlock,cp as makeCog,Vu as makeColor,mp as makeConicGradient,kp as makeCrescent,ub as makeDragZone,df as makeElement,Mp as makeEmitter,Jp as makeEnhancedLabel,vg as makeFilter,Pg as makeForce,yg as makeGradient,Fg as makeGrid,md as makeGroup,fb as makeKeyboardZone,Bg as makeLabel,$g as makeLine,Gg as makeLineSpiral,Ug as makeLoom,Qg as makeMesh,am as makeNet,ym as makeNoise,mm as makeNoiseAsset,Am as makeOval,Bm as makePattern,Ym as makePicture,Nm as makePolygon,_m as makePolyline,ey as makeQuadratic,oy as makeRadialGradient,uy as makeRawAsset,my as makeReactionDiffusionAsset,ky as makeRectangle,Tf as makeRender,vy as makeShape,Ef as makeSnippet,Dy as makeSpiral,em as makeSpring,Hy as makeStar,Ly as makeTetragon,Vy as makeTicker,_y as makeTracer,Jy as makeTween,gb as makeUpdater,sb as makeWheel,cb as makeWorld,pb as observeAndUpdate,M as purge,Bh as purgeFontMetadata,Xh as recalculateFonts,ku as releaseCoordinate,Ud as releaseQuaternion,jd as releaseVector,_c as removeListener,th as removeNativeListener,Ff as render,Su as requestCoordinate,Wd as requestQuaternion,Gd as requestVector,Qh as seededRandomNumberGenerator,lf as setCurrentCanvas,nu as setFilterMemoizationChoke,mh as setIgnorePixelRatio,bh as setPixelRatioChangeAction,wh as setTouchActionChoke,iu as setWorkstoreLifetimeLength,cu as setWorkstorePurgeChoke,Df as show,Vc as startCoreAnimationLoop,Th as startCoreListeners,Wc as stopCoreAnimationLoop,Hh as stopCoreListeners}; +const t={},e=[],i={},n=[],s={},r=[],o={},a=[],l={},c=[],h={},u=[],d={},f=[],p={},g=[],m={},y=[],b={},S=[],k={},A=[],v={},C=[],P={},x={},w=[],O={},D=[],F={},R=[],T={},H=[],E={},I=[],B={},L=[],$={};function M(h=""){const u=function(t,e,i=!1){t.forEach((t=>{const n=e[t];n&&n.kill&&n.kill(i)}))};if(h){u(a.filter((t=>0===t.indexOf(h))),o);u(c.filter((t=>0===t.indexOf(h))),l);u(C.filter((t=>0===t.indexOf(h))),v,!0);u(L.filter((t=>0===t.indexOf(h))),B);u(I.filter((t=>0===t.indexOf(h))),E);u(n.filter((t=>0===t.indexOf(h))),i);u(r.filter((t=>0===t.indexOf(h))),s);u(S.filter((t=>0===t.indexOf(h))),b);u(e.filter((t=>0===t.indexOf(h))),t);u(w.filter((t=>0===t.indexOf(h))),x);u(D.filter((t=>0===t.indexOf(h))),O);u(R.filter((t=>0===t.indexOf(h))),F)}}function X(t=""){const e=`100px ${t}`;return A.includes(e)}function Y(t=""){const e=`100px ${t}`;return A.includes(e)?k[e]:null}function G(t=""){return a.includes(t)?o[t]:null}function j(t=""){return c.includes(t)?l[t]:null}function z(t=""){return y.includes(t)?m[t]:null}function N(t=""){return u.includes(t)?h[t]:null}function V(t=""){return L.includes(t)?B[t]:null}function W(t=""){return I.includes(t)?E[t]:null}function U(t=""){return L.includes(t)?B[t]:f.includes(t)?d[t]:null}function Z(t=""){return f.includes(t)?d[t]:null}function _(t=""){return S.includes(t)?b[t]:null}function K(t=""){return C.includes(t)?v[t]:null}function q(t=""){return H.includes(t)?T[t]:null}function Q(t=""){return g.includes(t)?p[t]:null}const J={};var tt=Object.freeze({__proto__:null,anchor:t,anchornames:e,animation:i,animationnames:n,animationtickers:s,animationtickersnames:r,artefact:o,artefactnames:a,asset:l,assetnames:c,canvas:h,canvasnames:u,cell:d,cellnames:f,checkFontIsLoaded:X,constructors:J,element:p,elementnames:g,entity:m,entitynames:y,filter:b,filternames:S,findArtefact:G,findAsset:j,findCanvas:N,findCell:Z,findElement:Q,findEntity:z,findFilter:_,findGroup:K,findPattern:U,findStack:q,findStyles:V,findTween:W,fontfamilymetadata:k,fontfamilymetadatanames:A,force:x,forcenames:w,getFontMetadata:Y,group:v,groupnames:C,palette:{},palettenames:[],particle:P,particlenames:[],purge:M,spring:O,springnames:D,stack:T,stacknames:H,styles:B,stylesnames:L,tween:E,tweennames:I,unstackedelement:$,unstackedelementnames:[],version:"8.13.1",world:F,worldnames:R});const et=Math.abs,it=Math.acos,nt=Object.assign,st=Math.atan2,rt=Math.cbrt,ot=Math.ceil,at=window.getComputedStyle,lt=Math.cos,ct=Object.create,ht=Object.entries,ut=Math.exp,dt=Math.floor,ft=Object.freeze,pt=Math.hypot,gt=180/Math.PI,mt=Array.isArray,yt=Number.isFinite,bt=Number.isSafeInteger||Number.isInteger,St=Object.keys,kt=Math.max,At=Math.min,vt=Date.now,Ct=JSON.parse,Pt=Math.PI,xt=2*Math.PI,wt=.5*Math.PI,Ot=Math.pow,Dt=Math.PI/180,Ft=Math.random,Rt=Math.round,Tt=Object.seal,Ht=Object.setPrototypeOf,Et=Math.sin,It=Math.sqrt,Bt=JSON.stringify,Lt=JSON.stringify,$t=.016,Mt=Object.values,Xt="BODY",Yt="image_",Gt="video_",jt="0",zt="2d",Nt="a",Vt="b",Wt="c",Ut="d",Zt="e",_t="f",Kt="hwb",qt="lab",Qt="lch",Jt="_max",te="_min",ee="oklab",ie="oklch",ne="VIDEO",se="xyz",re="absolute",oe=ft(["Cell","Stack"]),ae=ft(["Canvas","Stack"]),le="add",ce="addEventListener",he="all",ue="alpha-to-channels",de="alphabetic",fe="anchor",pe=ft(["anchor","anchorHref","anchorName","anchorDescription","anchorType","anchorTarget","anchorTabOrder","anchorDisabled","anchorRel","anchorReferrerPolicy","anchorPing","anchorHreflang","anchorDownload","anchorFocusAction","anchorBlurAction","anchorClickAction"]),ge="anchorType",me="animation",ye="anonymous",be="area-alpha",Se=",",ke="aria-busy",Ae="aria-hidden",ve="aria-live",Ce=ft(["assertive","polite","off"]),Pe="asset",xe=/.*\/(.*?)\./,we="auto",Oe="autofocus",De="average-channels",Fe="banner",Re=ft(["stripes","smoothed-stripes","worley-euclidean","worley-manhattan"]),Te="bezier",He="rgb(0 0 0 / 1)",Ee="black-white",Ie="rgb(0 0 0 / 0)",Be="blend",Le="block",$e="blue",Me="bluenoise",Xe="blur",Ye="blurAction",Ge="border-box",je="bottom",ze="button",Ne=ft(["button","buttonName","buttonAutofocus","buttonDescription","buttonDisabled","buttonTabOrder","buttonForm","buttonFormAction","buttonFormEnctype","buttonFormMethod","buttonFormNoValidate","buttonFormTarget","buttonElementName","buttonPopoverTarget","buttonPopoverTargetAction","buttonElementType","buttonElementValue","buttonFocusAction","buttonBlurAction","buttonClickAction"]),Ve="canvas",We="cellGradient",Ue="center",Ze="change",_e="channels-to-alpha",Ke="chroma",qe="clamp-channels",Qe=ft(["down","round","up"]),Je=/[\s\uFEFF\xA0]+/g,ti="clear",ei="click",ii="clickAction",ni="close",si="color",ri="colors-to-alpha",oi="compose",ai="contain",li="control",ci="coord",hi="copyDimensions",ui="copyStart",di=ft(["topLeft","topRight","bottomRight","bottomLeft"]),fi='[data-scrawl-corner-div="sc"]',pi="corrode",gi="cover",mi="data-scrawl-group",yi="data-scrawl-stack",bi="data-tab-order",Si="12px sans-serif",ki="any_random_string_will_do",Ai="description",vi="destination-out",Ci="destination-over",Pi="dimensions",xi="disabled",wi="displace",Oi="display-p3",Di="div",Fi="down",Ri="download",Ti="draw",Hi="drawAndFill",Ei="element",Ii="elementType",Bi="elementValue",Li="emboss",$i="emboss-work",Mi="end",Xi="endControl",Yi="enter",Gi="entity",ji="euclidian-distance",zi="euler",Ni="fill",Vi="fillAndDraw",Wi="fillStyle",Ui="filter",Zi=ft(["fill","contain","cover"]),_i="flood",Ki="focus",qi="focusAction",Qi=/[0-9.,]+(%|cap|ch|cm|cqb|cqh|cqi|cqmax|cqmin|cqw|dvb|dvh|dvi|dvmax|dvmin|dvw|em|ex|ic|in|lh|lvb|lvh|lvi|lvmax|lvmin|lvw|mm|pc|pt|px|Q|rcap|rch|rem|rex|ric|rlh|svb|svh|svi|svmax|svmin|svw|vb|vh|vi|vmax|vmin|vw)/i,Ji=ft(["ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"]),tn=ft(["Label","EnhancedLabel"]),en=ft(["small-caps","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps"]),nn=/[0-9.,]+(svh|lvh|dvh|vh|svw|lvw|dvw|vw|svmax|lvmax|dvmax|vmax|svmin|lvmin|dvmin|vmin|svb|lvb|dvb|vb|svi|lvi|dvi|vi)/i,sn="form",rn="formAction",on="formEnctype",an="formMethod",ln="formNoValidate",cn="formTarget",hn="function",un="gaussian-blur",dn="getBezierXY",fn="getQuadraticXY",pn="glitch",gn=ft(["Cell","CellFragment"]),mn=ft(["black-white","monochrome-4","monochrome-8","monochrome-16"]),yn="grayscale",bn="green",Sn="gridGradient",kn="gridPicture",An="handle",vn="hanging",Cn="height",Pn="hex-grid",xn="high",wn="href",On="hreflang",Dn="HSL",Fn=ft(["HSL","HWB"]),Rn=ft(["Bezier","Line","Oval","Polygon","Polyline","Quadratic","Rectangle","Shape","Spiral","Star","Tetragon"]),Tn="HWB",Hn="ideographic",En=ft(["IMG","PICTURE"]),In="img",Bn="improved-perlin",Ln=ft(["RGB","HSL","HWB","XYZ","LAB","LCH","OKLAB","OKLCH"]),$n="intrinsic",Mn="invert-channels",Xn="italic",Yn="keydown",Gn="keyup",jn=ft(["none","shiftOnly","altOnly","ctrlOnly","metaOnly","shiftAlt","shiftCtrl","shiftMeta","altCtrl","altMeta","ctrlMeta","shiftAltCtrl","shiftAltMeta","shiftCtrlMeta","altCtrlMeta","all"]),zn="LAB",Nn=ft(["direction","fontKerning","fontSize","fontStretch","fontString","fontStyle","fontVariantCaps","fontWeight","letterSpaceValue","letterSpacing","scale","textRendering","wordSpaceValue","wordSpacing"]),Vn=ft(["fontString"]),Wn=ft(["fontString","scale"]),Un=ft(["fontFamily","fontSize","fontStretch","fontStyle","fontVariantCaps","fontWeight"]),Zn="landscape",_n="larger",Kn="largest",qn=ft(["lineSpacing","textUnitFlow","lineAdjustment","alignment","justifyLine","flipReverse","flipUpend","alignTextUnitsToPath","lockFillStyleToEntity","lockStrokeStyleToEntity"]),Qn="LCH",Jn="leave",ts="left",es="lineDash",is="linear",ns="lock-channels-to-levels",ss="lockTo",rs=ft(["startX","startY","handleX","handleY","offsetX","offsetY","width","height"]),os="loop",as="ltr",ls="manhattan-distance",cs="map-to-gradient",hs=ft(["a","b","c","d","e","f"]),us=ft(["repeat","repeat-x","repeat-y","no-repeat"]),ds="matrix",fs="mean",ps="mimic",gs="middle",ms="modulate-channels",ys="mouse",bs="mousedown",Ss="mouseenter",ks="mouseleave",As="mousemove",vs="mouseup",Cs="move",Ps="mozOsxFontSmoothing",xs="ms",ws="multiply",Os="name",Ds="never",Fs="newNumber",Rs="newsprint",Ts="newString",Hs=ft(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR","CANVAS"]),Es=ft(["random","ordered","bluenoise"]),Is=ft(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"]),Bs="none",Ls="nonzero",$s="normal",Ms="oblique",Xs="offset",Ys="OKLAB",Gs="OKLCH",js="~~~",zs=ft(["colors","cyclic","stops"]),Ns="particle",Vs="path",Ws="%",Us="0%",Zs="100%",_s="50%",Ks="perlin",qs=ft(["line","quadratic","bezier"]),Qs="ping",Js="pivot",tr="pixelate",er="pointerdown",ir="pointerenter",nr="pointerleave",sr="pointermove",rr="pointerup",or="points-array",ar="polite",lr="popoverTarget",cr="popoverTargetAction",hr="portrait",ur="process-image",dr="0px",fr="quadratic",pr=ft(["radiusTLX","radiusTRX","radiusBRX","radiusBLX","radiusTLY","radiusTRY","radiusBRY","radiusBLY"]),gr=ft(["radiusBRX","radiusBRY","radiusBLX","radiusBLY"]),mr=ft(["radiusBLX","radiusBLY"]),yr=ft(["radiusBLX"]),br=ft(["radiusBLY"]),Sr=ft(["radiusBRX","radiusBRY"]),kr=ft(["radiusBRX"]),Ar=ft(["radiusBRY"]),vr=ft(["radiusBRX","radiusBLX"]),Cr=ft(["radiusBRY","radiusBLY"]),Pr=ft(["radiusTLX","radiusTLY","radiusBLX","radiusBLY"]),xr=ft(["radiusTLX","radiusBLX"]),wr=ft(["radiusTLY","radiusBLY"]),Or=ft(["radiusTRX","radiusTRY","radiusBRX","radiusBRY"]),Dr=ft(["radiusTRX","radiusBRX"]),Fr=ft(["radiusTRY","radiusBRY"]),Rr=ft(["radiusTLX","radiusTLY","radiusTRX","radiusTRY"]),Tr=ft(["radiusTLX","radiusTLY"]),Hr=ft(["radiusTLX"]),Er=ft(["radiusTLY"]),Ir=ft(["radiusTRX","radiusTRY"]),Br=ft(["radiusTRX"]),Lr=ft(["radiusTRY"]),$r=ft(["radiusTLX","radiusTRX"]),Mr=ft(["radiusTLY","radiusTRY"]),Xr=ft(["radiusTLX","radiusTRX","radiusBRX","radiusBLX"]),Yr=ft(["radiusTLY","radiusTRY","radiusBRY","radiusBLY"]),Gr=ft(["radiusX"]),jr=ft(["radiusX","radiusY"]),zr=ft(["radiusY"]),Nr="random",Vr="random-noise",Wr="random-points",Ur=ft(["random","entity"]),Zr="rect-grid",_r="rectangle",Kr="red",qr="reduce-palette",Qr="referrerpolicy",Jr="regular",to="rel",eo="relative",io="remove",no="removeEventListener",so=ft(["RGB","HSL","HWB","LAB","LCH","OKLAB","OKLCH"]),ro="reverse",oo="reverseByDelta",ao="RGB",lo="right",co="role",ho="root",uo="round",fo=":",po="set-channel-to-level",go=ft(["startY","handleY","offsetY","height"]),mo="simplex",yo="skyscraper",bo="smaller",So="smallest",ko="smoothFont",Ao="smoothed-stripes",vo="source",Co="source-alpha",Po="source-in",xo="source-out",wo="source-over",Oo=" ",Do="space-around",Fo="space-between",Ro="srgb",To="start",Ho="startControl",Eo="startX",Io="startY",Bo=ft(["direction","fillStyle","filter","font","fontKerning","fontStretch","fontVariantCaps","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","imageSmoothingQuality","letterSpacing","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle","textAlign","textBaseline","textRendering","wordSpacing"]),Lo=ft(["fillStyle","filter","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","imageSmoothingQuality","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle"]),$o=ft(["direction","font","fontKerning","fontStretch","fontVariantCaps","letterSpacing","textRendering","wordSpacing"]),Mo=ft(["lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit"]),Xo=ft(["filter","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","imageSmoothingQuality","shadowBlur","shadowOffsetX","shadowOffsetY"]),Yo=ft(["fillStyle","shadowColor","strokeStyle"]),Go="step-channels",jo="stripes",zo="strokeStyle",No="styles",Vo=ft(["Gradient","RadialGradient","Pattern"]),Wo="subscribe",Uo="swirl",Zo=ft(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]),_o="Bezier",Ko="Canvas",qo="Cell",Qo="CellFragment",Jo="Color",ta="Coordinate",ea="EnhancedLabel",ia="EnhancedLabelLine",na="EnhancedLabelUnit",sa="Filter",ra="GenericArray",oa="Group",aa="Image",la="Label",ca="Line",ha="Noise",ua="Palette",da="Particle",fa="ParticleHistory",pa="Picture",ga="Polyline",ma="Quadratic",ya="Quaternion",ba="RawAsset",Sa="RdAsset",ka="RenderAnimation",Aa="Sprite",va="Stack",Ca="Ticker",Pa="Tween",xa="Vector",wa="Video",Oa="World",Da="tabOrder",Fa="tabindex",Ra="target",Ta=ft(["artefact","group","animation","animationtickers","world","tween","styles","filter"]),Ha=ft(["width","height","dimensions","startX","startY","start","position","handleX","handleY","handle","offsetX","offsetY","offset","roll","scale","flipReverse","flipUpend"]),Ea=/[-]/,Ia=ft(["column","column-reverse"]),Ba=ft(["row-reverse","column-reverse"]),La=/[\u2060]/,$a=/[\u00ad]/,Ma=/[ \f\n\r\t\v\u2028\u2029\u200b]/,Xa="C",Ya="h",Ga="S",ja=/[\u200b]/,za=ft(["canvasFont","direction","fillStyle","fontFamily","fontKerning","fontSize","fontStretch","fontString","fontStyle","fontVariantCaps","fontWeight","highlightStyle","includeHighlight","includeUnderline","letterSpaceValue","letterSpacing","lineDash","lineDashOffset","lineWidth","overlineOffset","overlineStyle","overlineWidth","strokeStyle","textRendering","underlineGap","underlineOffset","underlineStyle","underlineWidth","wordSpaceValue","wordSpacing","method"]),Na="threshold",Va="tilePicture",Wa="tiles",Ua="tint-channels",Za="top",_a="touch",Ka="touchcancel",qa="touchend",Qa="touchmove",Ja="touchstart",tl=ft(["rgb(0 0 0 / 0)","rgba(0 0 0 / 0)","rgba(0,0,0,0)","rgba(0, 0, 0, 0)","transparent","#00000000","#0000"]),el="true",il="tween",nl="type",sl=ft(["Image","Sprite","Video","Canvas","Stack"]),rl=ft(["width","height","zIndex","borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"]),ol=ft(["borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"]),al="undefined",ll="unknown",cl="unnamed",hl="unset",ul="up",dl="update",fl="updateByDelta",pl="user-defined-legacy",gl="value",ml="vary-channels-by-weights",yl="video",bl="webkitFontSmoothing",Sl="rgb(255 255 255 / 1)",kl="width",Al="worley-euclidean",vl="worley-manhattan",Cl=ft(["X","Y","Z","XminusY","XminusZ","YminusX","YminusZ","ZminusX","ZminusY","XaddY","XaddZ","YaddZ","XaddYminusZ","XaddZminusY","YaddZminusX","XmultiplyY","XmultiplyZ","YmultiplyZ","XmultiplyYaddZ","XmultiplyZaddY","YmultiplyZaddX","XmultiplyYminusZ","XmultiplyZminusY","YmultiplyZminusX","sum"]),Pl="XYZ",xl="zero",wl="M0,0",Ol="",Dl=ft(["all","background","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundOrigin","backgroundPosition","backgroundRepeat","border","borderBottom","borderBottomColor","borderBottomStyle","borderBottomWidth","borderCollapse","borderColor","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStyle","borderTop","borderTopColor","borderTopStyle","borderTopWidth","borderWidth","clear","color","columns","content","counterIncrement","counterReset","cursor","direction","display","emptyCells","float","font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontSynthesis","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontWeight","grid","gridArea","gridAutoColumns","gridAutoFlow","gridAutoPosition","gridAutoRows","gridColumn","gridColumnStart","gridColumnEnd","gridRow","gridRowStart","gridRowEnd","gridTemplate","gridTemplateAreas","gridTemplateRows","gridTemplateColumns","imageResolution","imeMode","inherit","inlineSize","isolation","letterSpacing","lineBreak","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginBlockStart","marginBlockEnd","marginInlineStart","marginInlineEnd","marginBottom","marginLeft","marginRight","marginTop","marks","mask","maskType","maxWidth","maxHeight","maxBlockSize","maxInlineSize","maxZoom","minWidth","minHeight","minBlockSize","minInlineSize","minZoom","mixBlendMode","objectFit","objectPosition","offsetBlockStart","offsetBlockEnd","offsetInlineStart","offsetInlineEnd","orphans","overflow","overflowWrap","overflowX","overflowY","pad","padding","paddingBlockStart","paddingBlockEnd","paddingInlineStart","paddingInlineEnd","paddingBottom","paddingLeft","paddingRight","paddingTop","pageBreakAfter","pageBreakBefore","pageBreakInside","pointerEvents","position","prefix","quotes","rubyAlign","rubyMerge","rubyPosition","scrollBehavior","scrollSnapCoordinate","scrollSnapDestination","scrollSnapPointsX","scrollSnapPointsY","scrollSnapType","scrollSnapTypeX","scrollSnapTypeY","shapeImageThreshold","shapeMargin","shapeOutside","tableLayout","textAlign","textDecoration","textIndent","textOrientation","textOverflow","textRendering","textShadow","textTransform","textUnderlinePosition","unicodeRange","unset","verticalAlign","widows","willChange","wordBreak","wordSpacing","wordWrap","zIndex"]),Fl=ft(["alignContent","alignItems","alignSelf","animation","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationTimingFunction","backfaceVisibility","backgroundImage","backgroundSize","borderBottomLeftRadius","borderBottomRightRadius","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","boxDecorationBreak","boxShadow","boxSizing","columnCount","columnFill","columnGap","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","filter","flex","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","fontFeatureSettings","fontKerning","fontLanguageOverride","hyphens","imageRendering","imageOrientation","initial","justifyContent","linearGradient","opacity","order","orientation","outline","outlineColor","outlineOffset","outlineStyle","outlineWidth","resize","tabSize","textAlignLast","textCombineUpright","textDecorationColor","textDecorationLine","textDecorationStyle","touchAction","transformStyle","transition","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","unicodeBidi","whiteSpace","writingMode"]),Rl=(t,e)=>{if(null!=e){ts===t||Za===t?t=Us:lo===t||je===t?t=Zs:Ue===t&&(t=_s);const i=!(!t.substring&&!e.substring);return Ul(t)?t+=Ul(e)?e:parseFloat(e):t=parseFloat(t)+(Ul(e)?e:parseFloat(e)),i?t+Ws:t}return t},Tl=function(t,e,i){return ti?i:t},Hl=t=>{if(Ul(t))return[xs,t];if(t.substring){const e=t.match(/^\d+\.?\d*(\D*)/);let i=e[1].toLowerCase?e[1].toLowerCase():xs,n=parseFloat(t);if(yt(n)){switch(i){case"s":n*=1e3;break;case"%":break;default:i=xs}return[i,n]}return[xs,0]}},El=t=>yt(t)?((t%=360)<0&&(t+=360),t):0,Il=t=>{if(yt(t)){if(t<-1e-6)return t;if(t>1e-6)return t}return 0},Bl=()=>{},Ll=function(t){return t},$l=function(){return this},Ml=()=>Promise.resolve(!0),Xl=ft({}),Yl=()=>{function t(){return dt(65536*(1+Ft())).toString(16).substring(1)}return`${t()}${t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`},Gl=()=>performance.now().toString(36)+Ft().toString(36).substr(2),jl=function(t,e,i){return e+t*(i-e)},zl=t=>"boolean"==typeof t,Nl=t=>"[object HTMLCanvasElement]"===Object.prototype.toString.call(t),Vl=t=>!!(t&&t.querySelector&&t.dispatchEvent),Wl=t=>typeof t===hn,Ul=t=>!!yt(t),Zl=t=>"[object Object]"===Object.prototype.toString.call(t),_l=t=>!(!t||!t.type||t.type!==ya),Kl=(t,e)=>{if(Zl(t)&&Zl(e))for(const i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},ql=(t,e)=>(Zl(t)&&Zl(e)&&ht(e).forEach((([i,n])=>{null==n?delete t[i]:t[i]=e[i]})),t),Ql=(t,e)=>(mt(t)&&(mt(e)?e.forEach((e=>Ql(t,e))):t.includes(e)||t.push(e)),t),Jl=(t,e)=>{if(mt(t)){const i=t.indexOf(e);i>=0&&t.splice(i,1)}return t},tc=t=>typeof t!==al,ec=(...t)=>t.every((t=>typeof t!==al)),ic=(...t)=>t.find((t=>typeof t!==al)),nc=(...t)=>!!t.find((t=>typeof t!==al)),sc={out:t=>1-lt(t*Pt/2),in:t=>Et(t*Pt/2),easeIn:t=>{const e=1-t;return 1-e*e},easeIn3:t=>{const e=1-t;return 1-e*e*e},easeIn4:t=>{const e=1-t;return 1-e*e*e*e},easeIn5:t=>{const e=1-t;return 1-e*e*e*e*e},easeOutIn:t=>t<.5?2*t*t:1-Ot(-2*t+2,2)/2,easeOutIn3:t=>t<.5?4*t*t*t:1-Ot(-2*t+2,3)/2,easeOutIn4:t=>t<.5?8*t*t*t*t:1-Ot(-2*t+2,4)/2,easeOutIn5:t=>t<.5?16*t*t*t*t*t:1-Ot(-2*t+2,5)/2,easeInOut:t=>{const e=.5-t;return t<.5?.5+-2*e*e:.5+Ot(2*(t-.5),2)/2},easeInOut3:t=>{const e=.5-t;return t<.5?.5+-4*e*e*e:.5+Ot(2*(t-.5),3)/2},easeInOut4:t=>{const e=.5-t;return t<.5?.5+-8*e*e*e*e:.5+Ot(2*(t-.5),4)/2},easeInOut5:t=>{const e=.5-t;return t<.5?.5+-16*e*e*e*e*e:.5+Ot(2*(t-.5),5)/2},easeOut:t=>t*t,easeOut3:t=>t*t*t,easeOut4:t=>t*t*t*t,easeOut5:t=>t*t*t*t*t,none:t=>t,linear:t=>t,cosine:t=>.5*(1+lt((1-t)*Pt)),hermite:t=>t*t*(2*-t+3),quintic:t=>t*t*t*(t*(6*t-15)+10),easeOutSine:t=>1-lt(t*Pt/2),easeInSine:t=>Et(t*Pt/2),easeOutInSine:t=>-(lt(Pt*t)-1)/2,easeOutQuad:t=>t*t,easeInQuad:t=>1-(1-t)*(1-t),easeOutInQuad:t=>t<.5?2*t*t:1-Ot(-2*t+2,2)/2,easeOutCubic:t=>t*t*t,easeInCubic:t=>1-Ot(1-t,3),easeOutInCubic:t=>t<.5?4*t*t*t:1-Ot(-2*t+2,3)/2,easeOutQuart:t=>t*t*t*t,easeInQuart:t=>1-Ot(1-t,4),easeOutInQuart:t=>t<.5?8*t*t*t*t:1-Ot(-2*t+2,4)/2,easeOutQuint:t=>t*t*t*t*t,easeInQuint:t=>1-Ot(1-t,5),easeOutInQuint:t=>t<.5?16*t*t*t*t*t:1-Ot(-2*t+2,5)/2,easeOutExpo:t=>0===t?0:Ot(2,10*t-10),easeInExpo:t=>1===t?1:1-Ot(2,-10*t),easeOutInExpo:t=>0===t||1===t?t:t<.5?Ot(2,20*t-10)/2:(2-Ot(2,-20*t+10))/2,easeOutCirc:t=>1-It(1-Ot(t,2)),easeInCirc:t=>It(1-Ot(t-1,2)),easeOutInCirc:t=>t<.5?(1-It(1-Ot(2*t,2)))/2:(It(1-Ot(-2*t+2,2))+1)/2,easeOutBack:t=>2.70158*t*t*t-1.70158*t*t,easeInBack:t=>1+2.70158*Ot(t-1,3)+1.70158*Ot(t-1,2),easeOutInBack:t=>{const e=2.5949095;return t<.5?Ot(2*t,2)*(7.189819*t-e)/2:(Ot(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2},easeOutElastic:t=>{const e=2*Pt/3;return 0===t||1===t?t:-Ot(2,10*t-10)*Et((10*t-10.75)*e)},easeInElastic:t=>{const e=2*Pt/3;return 0===t||1===t?t:Ot(2,-10*t)*Et((10*t-.75)*e)+1},easeOutInElastic:t=>{const e=2*Pt/4.5;return 0===t||1===t?t:t<.5?-Ot(2,20*t-10)*Et((20*t-11.125)*e)/2:Ot(2,-20*t+10)*Et((20*t-11.125)*e)/2+1},easeOutBounce:t=>{const e=7.5625,i=2.75;return(t=1-t)<1/i?1-e*t*t:t<2/i?1-(e*(t-=1.5/i)*t+.75):t<2.5/i?1-(e*(t-=2.25/i)*t+.9375):1-(e*(t-=2.625/i)*t+.984375)},easeInBounce:t=>{const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeOutInBounce:t=>{const e=7.5625,i=2.75;let n;return t<.5?(n=(t=1-2*t)<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375,(1-n)/2):(n=(t=2*t-1)<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375,(1+n)/2)}},rc=()=>ct(Object.prototype);let oc=!1;const ac=()=>oc,lc=t=>oc=t;let cc=!1;const hc=()=>cc,uc=t=>cc=t;let dc=!1;const fc=()=>dc,pc=t=>dc=t;let gc=!1;let mc=!1;const yc=()=>mc,bc=t=>mc=t;let Sc=!1;const kc=()=>Sc,Ac=t=>Sc=t;let vc=!1;const Cc=()=>vc,Pc=t=>vc=t;let xc=!1;const wc=()=>xc,Oc=t=>xc=t;let Dc=!0;const Fc=t=>Dc=t;let Rc=!1;const Tc=t=>Rc=t;let Hc=!0;const Ec=t=>Hc=t,Ic=function(){cc=!0,dc=!0},Bc=function(){const t=[];return Ht(t,Bc.prototype),t};J.GenericArray=Bc;const Lc=Bc.prototype=ct(Array.prototype);Lc.constructor=Bc,Lc.type=ra;const $c=[],Mc=function(){return $c.length||$c.push(new Bc),$c.shift()},Xc=function(...t){t.forEach((t=>{t&&t.type===ra&&(t.length=0,$c.push(t),$c.length>20&&(console.log("purging genericArrayPool"),$c.length=10))}))},Yc=[],Gc=[],jc=t=>{Ql(Gc,t),Fc(!0)},zc=t=>{Jl(Gc,t),Fc(!0)},Nc=t=>Gc.includes(t),Vc=()=>{Dc&&(Fc(!1),(()=>{const t=Mc();let e,n,s,r;for(s=0,r=Gc.length;s{Tc(!0),Vc()},Uc=()=>Tc(!1),Zc=function(t,e,i=Xl){if(typeof window.IntersectionObserver===hn&&t&&t.run){const n=new IntersectionObserver((e=>{let i,n,s;for(i=0,n=e.length;i{let h,u=!0;if(i.includes(t)||(u=!1),u&&n.includes(t)&&(u=!1),u&&(h=s.some((e=>new RegExp(e).test(t))),h&&(u=!1)),u)if(a.includes(t)){if(tc(e)&&null!=e){const i=this.stringifyFunction(e);i&&i.length&&(c[t]=i)}}else o.includes(t)&&this[t]&&this[t].name?c[t]=this[t].name:r.includes(t)?(l.includes(t)||e[0]||e[1])&&(c[t]=e):(h=this.processPacketOut(t,e,l),h&&(c[t]=e))}),this),c=this.finalizePacketOut(c,t),Bt([this.name,this.type,this.lib,c])},t.stringifyFunction=function(t){const e=t.toString().match(/\(([\s\S]*?)\)[\s\S]*?\{([\s\S]*)\}/),i=e[1],n=e[2];return!!ec(i,n)&&`${i}${js}${n}`},t.processPacketOut=function(t,e,i){let n=!0;return i.includes(t)||e!==this.defs[t]||(n=!1),n},t.finalizePacketOut=function(t){return t},t.importPacket=function(t){const e=this,i=function(t){return new Promise(((i,n)=>{let s;t.substring||n(new Error("Packet url supplied for import is not a string")),"["===t[0]?(s=e.actionPacket(t),s&&s.lib?i(s):n(s)):t.includes('"name":')?n(new Error("Bad packet supplied for import")):fetch(t).then((t=>{if(!t.ok)throw new Error(`Packet import from server failed - ${t.status}: ${t.statusText} - ${t.url}`);return t.text()})).then((t=>{if(s=e.actionPacket(t),!s||!s.lib)throw s;i(s)})).catch((t=>n(t)))}))};if(mt(t)){const e=[];return t.forEach((t=>e.push(i(t)))),new Promise(((t,i)=>{Promise.all(e).then((e=>t(e))).catch((t=>i(t)))}))}if(t.substring)return i(t);Promise.reject(new Error("Argument supplied for packet import is not a string or array of strings"))},t.actionPacket=function(t){try{if(t&&t.substring){if("["===t[0]){let e,i,n,s;try{[e,i,n,s]=Ct(t)}catch(t){throw new Error(`Failed to process packet due to JSON parsing error - ${t.message}`)}if(ec(e,i,n,s)){if(sl.includes(i))throw new Error("Failed to process packet - Stacks, Canvases and visual assets are excluded from the packet system");let t=tt[n][e];if(t)t.set(s);else{if(s.outerHTML&&s.host){const t=document.querySelector(`#${s.host}`);if(t){const i=document.createElement("div");i.innerHTML=s.outerHTML;const n=i.firstElementChild;n&&(n.id=e,t.appendChild(n),s.domElement=n)}}if(t=new J[i](s),!t)throw new Error("Failed to create Scrawl-canvas object from supplied packet")}if(t.packetFunctions.forEach((e=>this.actionPacketFunctions(t,e))),s.anchor&&t.anchor&&t.anchor.packetFunctions.forEach((e=>{t.anchor[e]=s.anchor[e],this.actionPacketFunctions(t.anchor,e),t.anchor.build()})),s.button&&t.button&&t.button.packetFunctions.forEach((e=>{t.button[e]=s.button[e],this.actionPacketFunctions(t.button,e),t.button.build()})),t)return t;throw new Error("Failed to process supplied packet")}throw new Error("Failed to process packet - JSON string holds incomplete data")}throw new Error("Failed to process packet - JSON string does not represent an array")}throw new Error("Failed to process packet - not a JSON string")}catch(t){return console.log(t),t}},t.actionPacketFunctions=function(t,e){const i=t[e];if(tc(i)&&null!=i&&i.substring)if(i===js)t[e]=Bl;else{let n,s,r;[n,s]=i.split(js),n=n.split(Se),n=n.map((t=>t.trim())),s.includes("[native code]")?t[e]=Bl:(r=new Function(...n,s),t[e]=r.bind(t))}},t.clone=function(t=Xl){const e=this.name;let i,n,s,r;this.name=t.name||Ol,t.useNewTicker?(n=this.ticker,this.ticker=null,i=this.saveAsPacket(),this.ticker=n):(this.anchor&&(s=this.anchor,delete this.anchor),this.button&&(r=this.button,delete this.button),i=this.saveAsPacket(),s&&(this.anchor=s),r&&(this.button=r)),this.name=e;let o=this.actionPacket(i);return this.packetFunctions.forEach((t=>{this[t]&&(o[t]=this[t])})),o=this.postCloneAction(o,t),o.set(t),o},t.postCloneAction=function(t){return t},t.kill=function(){return this.deregister()},t.makeName=function(t){return t&&t.substring&&!tt[`${this.lib}names`].includes(t)?this.name=t:this.name=Gl(),this},t.register=function(){if(!tc(this.name))throw new Error(`core/base error - register() name not set: ${this}`);const t=tt[`${this.lib}names`],e=tt[this.lib];return this.isArtefact&&(Ql(a,this.name),o[this.name]=this),this.isAsset&&(Ql(c,this.name),l[this.name]=this),Ql(t,this.name),e[this.name]=this,this},t.deregister=function(){if(!tc(this.name))throw new Error(`core/base error - deregister() name not set: ${this}`);const t=tt[`${this.lib}names`],e=tt[this.lib];return this.isArtefact&&(Jl(a,this.name),delete o[this.name]),this.isAsset&&(Jl(c,this.name),delete l[this.name]),Jl(t,this.name),delete e[this.name],this}}const Animation=function(t=Xl){return this.makeName(t.name),this.order=tc(t.order)?t.order:this.defs.order,this.fn=t.fn||Ml,this.onRun=t.onRun||Bl,this.onHalt=t.onHalt||Bl,this.onKill=t.onKill||Bl,this.maxFrameRate=t.maxFrameRate||60,this.lastRun=0,this.chokedAnimation=!0,this.register(),t.delay||this.run(),this},sh=Animation.prototype=rc();sh.type="Animation",sh.lib=me,sh.isArtefact=!1,sh.isAsset=!1,nh(sh);sh.defs=Kl(sh.defs,{order:1,maxFrameRate:60,fn:null,onRun:null,onHalt:null,onKill:null}),sh.stringifyFunction=Bl,sh.processPacketOut=Bl,sh.finalizePacketOut=Bl,sh.saveAsPacket=function(){return`[${this.name}, ${this.type}, ${this.lib}, {}]`},sh.clone=$l,sh.run=function(){return this.onRun(),jc(this.name),setTimeout((()=>Ic()),20),this},sh.isRunning=function(){return Nc(this.name)},sh.halt=function(){return this.onHalt(),zc(this.name),this},sh.kill=function(){return this.onKill(),zc(this.name),this.deregister(),!0};const rh=function(t){return!!t&&new Animation(t)};J.Animation=Animation;const oh=[],ah=Tt({x:0,y:0,scrollX:0,scrollY:0,w:0,h:0,type:ys,prefersReducedMotion:!1,prefersDarkColorScheme:!1,prefersReduceTransparency:!1,prefersContrast:!1,prefersReduceData:!1,displaySupportsP3Color:!1,canvasSupportsP3Color:!1,devicePixelRatio:0,rawTouches:[]}),lh=window.matchMedia("(prefers-contrast: more)");lh.addEventListener(Ze,(()=>{const t=lh.matches;ah.prefersContrast!==t&&(ah.prefersContrast=t,gc=!0)})),ah.prefersContrast=lh.matches;const ch=window.matchMedia("(prefers-reduced-motion: reduce)");ch.addEventListener(Ze,(()=>{const t=ch.matches;ah.prefersReducedMotion!==t&&(ah.prefersReducedMotion=t,bc(!0))})),ah.prefersReducedMotion=ch.matches;const hh=window.matchMedia("(prefers-color-scheme: dark)");hh.addEventListener(Ze,(()=>{const t=hh.matches;ah.prefersDarkColorScheme!==t&&(ah.prefersDarkColorScheme=t,Ac(!0))})),ah.prefersDarkColorScheme=hh.matches;const uh=window.matchMedia("(prefers-reduced-transparency: reduce)");uh.addEventListener(Ze,(()=>{const t=uh.matches;ah.prefersReduceTransparency!==t&&(ah.prefersReduceTransparency=t,Pc(!0))})),ah.prefersReduceTransparency=uh.matches;const dh=window.matchMedia("(prefers-reduced-data: reduce)");dh.addEventListener(Ze,(()=>{const t=dh.matches;ah.prefersReduceData!==t&&(ah.prefersReduceData=t,Oc(!0))})),ah.prefersReduceData=dh.matches;const fh=window.matchMedia("(color-gamut: p3)");fh.addEventListener(Ze,(()=>{const t=fh.matches;ah.displaySupportsP3Color!==t&&(ah.displaySupportsP3Color=t)})),ah.displaySupportsP3Color=fh.matches;ah.canvasSupportsP3Color=(()=>{const t=document.createElement("canvas");try{return t.getContext("2d",{colorSpace:Oi}).getContextAttributes().colorSpace===Oi}catch{console.log("checkCanvasSupportsDisplayP3 errored")}return!1})();const ph=()=>ah.devicePixelRatio;let gh=!1;const mh=()=>gh,yh=t=>gh=t;let bh=Bl;const Sh=t=>bh=t,kh=()=>{const t=window.devicePixelRatio;ah.devicePixelRatio=t,Mt(h).forEach((t=>t.dirtyDimensions=!0)),Mt(d).forEach((t=>t.dirtyDimensions=!0)),Mt(m).forEach((t=>t.dirtyHost=!0)),gh||bh(),matchMedia(`(resolution: ${t}dppx)`).addEventListener(Ze,kh,{once:!0})};kh();const Ah=function(){const t=document.documentElement.clientWidth,e=document.documentElement.clientHeight;ah.w===t&&ah.h===e||(ah.w=t,ah.h=e,uc(!0),pc(!0))},vh=function(){const t=window.pageXOffset,e=window.pageYOffset;ah.scrollX===t&&ah.scrollY===e||(ah.x+=t-ah.scrollX,ah.y+=e-ah.scrollY,ah.scrollX=t,ah.scrollY=e,uc(!0))},Ch=function(t){const e=Rt(t.pageX),i=Rt(t.pageY);ah.x===e&&ah.y===i||(ah.type=navigator.pointerEnabled?"pointer":ys,ah.x=e,ah.y=i,uc(!0))};let Ph=0,xh=16;const wh=function(){return xh},Oh=function(t){yt(t)&&(xh=t)},Dh=function(t,e=!0){if(ah.rawTouches.length=0,t.touches&&t.touches.length){ah.rawTouches.push(...t.touches);const e=t.touches[0],i=Rt(e.pageX),n=Rt(e.pageY);ah.x===i&&ah.y===n||(ah.type=_a,ah.x=i,ah.y=n)}else ah.type=_a,e&&(ah.x=0,ah.y=0);const i=vt();i>Ph+xh&&(Ph=i,Fh())},Fh=function(){for(let t=0,e=oh.length;te.activePadding&&t.x0+e.activePadding&&t.y1||t.normY<0||t.normY>1)&&(t.active=!1));const d=ah.rawTouches;if(d.length){t.touches||(t.touches=[]),t.touches.length=0;for(let e=0,i=d.length;e{tn.includes(t.type)&&t.recalculateFont(!0)})))}}),Hh=function(){Ih(no),Ih(ce),lc(!0),uc(!0),Th.run()},Eh=function(){lc(!1),uc(!1),Th.halt(),Ih(no)},Ih=function(t){navigator.pointerEnabled||navigator.msPointerEnabled?(window[t](sr,Ch,!1),window[t](rr,Ch,!1),window[t](er,Ch,!1),window[t](nr,Ch,!1),window[t](ir,Ch,!1)):(window[t](As,Ch,!1),window[t](vs,Ch,!1),window[t](bs,Ch,!1),window[t](ks,Ch,!1),window[t](Ss,Ch,!1),window[t](Qa,Dh,{passive:!0}),window[t](Ja,Dh,{passive:!0}),window[t](qa,Dh,{passive:!0}),window[t](Ka,Dh,{passive:!0})),window[t]("scroll",vh,{passive:!0}),window[t]("resize",Ah,!1)},Bh=function(){Ah(),uc(!0),pc(!0)},Lh=function(){const{fontfamilymetadata:t,fontfamilymetadatanames:e}=tt;e.forEach((e=>delete t[e])),e.length=0},$h=[];let Mh=!1;const Xh=function(t=Ol){if(Mh||t){const e=Mc();let i,n,s,r,a,l,c,h,u,d,f,p,g,m,y,b;t&&t.substring?e.push(t):(Mh=!1,e.push(...$h),$h.length=0);const S=mh(),k=ph();for(i=0,n=e.length;i{setTimeout((()=>{y.forEach((t=>{const e=m[t];tn.includes(e.type)&&e.recalculateFont()}))}),t)},Gh=[],jh=[],zh=t=>{Ql(Gh,t),Ec(!0)},Nh=t=>{Jl(Gh,t),Ec(!0)},Vh=()=>(Hc&&Wh(),jh),Wh=function(){Ec(!1);const t=Mc();let e,i,n,s;for(n=0,s=Gh.length;n>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}t=4022871197}},Qh=function(t){return function(){var e,i,n=48,s=1,r=n,o=new Array(n),a=0,l=new qh;for(e=0;e=n&&(r=0);var t=1768863*o[r]+2.3283064365386963e-10*s;return o[r]=t-(s=0|t)},h=function(t){return Math.floor(t*(c()+11102230246251565e-32*(2097152*c()|0)))};h.string=function(t){var e,i="";for(e=0;e0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,s):n.push(s),~i.indexOf(r)&&(r=e.call(this,s,r))}else i.push(r);return null==t?r:t.call(this,s,r)}}(i,s),n)),h.initState(),h.hashString(t)},h.addEntropy=function(){var t=[];for(e=0;e{yt(t)&&t>=200&&t<=1e4&&(iu=t)},su=t=>{yt(t)&&t>=200&&t<=1e4&&(iu=t)},ru=t=>tu[t]?(eu[t]=vt(),tu[t]):null,ou=(t,e)=>{tu[t]=e,eu[t]=vt()},au=function(t,e=[]){const i=vt();return tu[t]?(eu[t]=i,tu[t]):(tu[t]=e,eu[t]=i,tu[t])};let lu=200,cu=0;const hu=t=>{yt(t)&&t>=10&&t<=5e3&&(lu=t)};function uu(t=Xl){t.setEngineFromState=function(t){const e=this.state,i=Bo.length;let n,s,r,o;for(n=0;n{t===es?(mt(i.lineDash)?i.lineDash.length=0:i.lineDash=[],mt(e.lineDash)?e.lineDash.length=0:e.lineDash=[]):(i[t]=n,e[t]=n)})),i.textAlign=e.textAlign=ts,i.textBaseline=e.textBaseline=Za,this},t.setEngine=function(t){const e=this.state,i=t.state;if(i){const n=i.getChanges(t,e),s=this.setEngineActions;if(St(n).length){const i=this.engine;for(const r in n)s[r](n[r],i,Vo,t,this),e[r]=n[r]}}return t},t.setEngineActions=ft({fillStyle:function(t,e,i,n,s){if(t.substring){let i=!1;L.includes(t)?i=B[t]:f.includes(t)&&(i=d[t]),i?(n.state.fillStyle=i,e.fillStyle=i.getData(n,s)):e.fillStyle=t}else e.fillStyle=t.getData(n,s)},filter:function(t,e){e.filter=t},font:function(t,e){e.font=t},globalAlpha:function(t,e){e.globalAlpha=t},globalCompositeOperation:function(t,e){e.globalCompositeOperation=t},imageSmoothingEnabled:function(t,e){e.imageSmoothingEnabled=t},imageSmoothingQuality:function(t,e){e.imageSmoothingQuality=t},lineCap:function(t,e){e.lineCap=t},lineDash:function(t,e){e.lineDash=t,e.setLineDash&&e.setLineDash(t)},lineDashOffset:function(t,e){e.lineDashOffset=t},lineJoin:function(t,e){e.lineJoin=t},lineWidth:function(t,e){e.lineWidth=t},miterLimit:function(t,e){e.miterLimit=t},shadowBlur:function(t,e){e.shadowBlur=t},shadowColor:function(t,e){e.shadowColor=t},shadowOffsetX:function(t,e){e.shadowOffsetX=t},shadowOffsetY:function(t,e){e.shadowOffsetY=t},strokeStyle:function(t,e,i,n,s){if(t.substring){let i=!1;L.includes(t)?i=B[t]:f.includes(t)&&(i=d[t]),i?(n.state.strokeStyle=i,e.strokeStyle=i.getData(n,s)):e.strokeStyle=t}else e.strokeStyle=t.getData(n,s)},direction:function(t,e){e.direction=t},fontKerning:function(t,e){e.fontKerning=t},fontStretch:function(t,e){e.fontStretch=t},fontVariantCaps:function(t,e){e.fontVariantCaps=t},letterSpacing:function(t,e){e.letterSpacing=t},textAlign:function(t,e){e.textAlign=ts},textBaseline:function(t,e){e.textBaseline=Za},textRendering:function(t,e){e.textRendering=t},wordSpacing:function(t,e){e.wordSpacing=t}}),t.clearShadow=function(){return this.engine.shadowOffsetX=0,this.engine.shadowOffsetY=0,this.engine.shadowBlur=0,this.state.shadowOffsetX=0,this.state.shadowOffsetY=0,this.state.shadowBlur=0,this},t.restoreShadow=function(t){const e=t.state;return this.engine.shadowOffsetX=e.shadowOffsetX,this.engine.shadowOffsetY=e.shadowOffsetY,this.engine.shadowBlur=e.shadowBlur,this.state.shadowOffsetX=e.shadowOffsetX,this.state.shadowOffsetY=e.shadowOffsetY,this.state.shadowBlur=e.shadowBlur,this},t.setToClearShape=function(){return this.engine.fillStyle=Ie,this.engine.strokeStyle=Ie,this.engine.shadowColor=Ie,this.state.fillStyle=Ie,this.state.strokeStyle=Ie,this.state.shadowColor=Ie,this},t.saveEngine=function(){return this.engine.save(),this},t.restoreEngine=function(){return this.engine.restore(),this},t.getEntityHits=function(){const t=[],e=Mc(),i=Mc();return this.groupBuckets&&this.groupBuckets.forEach((t=>{t.visibility&&e.push(...t.getAllArtefactsAt(this.here))}),this),e.forEach((e=>{const n=e.artefact;n.visibility&&!i.includes(n.name)&&(i.push(n.name),t.push(n))})),Xc(i),Xc(e),t},t.rotateDestination=function(t,e,i,n){const s=n||this,r=s.mimic,o=s.pivot;let a,l,c=s.currentRotation;if(r&&r.name&&s.useMimicFlip?(a=r.flipReverse?-1:1,l=r.flipUpend?-1:1):(a=s.flipReverse?-1:1,l=s.flipUpend?-1:1),r&&r.name&&s.useMimicRotation?c=r.currentRotation:o&&o.name&&s.addPivotRotation&&(c=o.currentRotation),c){c*=Dt;const n=lt(c),s=Et(c);t.setTransform(n*a,s*a,-s*l,n*l,e,i)}else t.setTransform(a,0,0,l,e,i);return this}}rh({name:"SC-core-workstore-hygeine",order:998,fn:()=>(()=>{const t=vt();if(cu{t&&t.type===Qo&&(t.setDimensions(1,1),t.engine.restore(),t.state.setStateFromEngine(t.engine),pu.push(t))}))},Coordinate=function(t,e){const i=[0,0];return Ht(i,Coordinate.prototype),Tt(i),t&&i.set(t,e),i},bu=Coordinate.prototype=ct(Array.prototype);bu.constructor=Coordinate,bu.type=ta,bu.set=function(t,e){return tc(t)&&(t.type===ta?this.setFromArray(t):t.type===xa?this.setFromVector(t):t.type===ya?this.setFromVector(t.v):mt(t)?this.setFromArray(t):tc(e)&&this.setFromArray([t,e])),this},bu.setFromArray=function(t){return this[0]=t[0],this[1]=t[1],this},bu.setFromVector=function(t){return this[0]=t.x,this[1]=t.y,this},bu.zero=function(){return this[0]=0,this[1]=0,this},bu.vectorAdd=function(t){return this[0]+=t.x,this[1]+=t.y,this},bu.vectorSubtract=function(t){return this[0]-=t.x,this[1]-=t.y,this},bu.add=function(t){return this[0]+=t[0],this[1]+=t[1],this},bu.subtract=function(t){return this[0]-=t[0],this[1]-=t[1],this},bu.multiply=function(t){return this[0]*=t[0],this[1]*=t[1],this},bu.divide=function(t){const[e,i]=t;return e&&i&&(this[0]/=e,this[1]/=i),this},bu.scalarMultiply=function(t){return this[0]*=t,this[1]*=t,this},bu.scalarDivide=function(t){return t&&t.toFixed&&(this[0]/=t,this[1]/=t),this},bu.getMagnitude=function(){return pt(...this)},bu.rotate=function(t){const[e,i]=this;let n=st(i,e);n+=.01745329251*t;const s=pt(e,i);return this[0]=s*lt(n),this[1]=s*Et(n),this},bu.reverse=function(){return this[0]=-this[0],this[1]=-this[1],this},bu.getDotProduct=function(t){return this[0]*t[0]+this[1]*t[1]},bu.normalize=function(){const t=this.getMagnitude();return t>0&&(this[0]/=t,this[1]/=t),this};const Su=[],ku=function(t,e){Su.length||Su.push(new Coordinate);const i=Su.shift();return i.set(t,e),i},Au=function(...t){t.forEach((t=>{t&&t.type===ta&&Su.push(t.zero())}))},vu=function(t,e){return new Coordinate(t,e)};J.Coordinate=Coordinate;const Cu=216/24389,Pu=24389/27,xu=null!=rt?rt:t=>Ot(t,1/3),wu=ft([.3457/.3585,1,.2958/.3585]),Ou=ft([ft([1.0479298208405488,.022946793341019088,-.05019222954313557]),ft([.029627815688159344,.990434484573249,-.01707382502938514]),ft([-.009243058152591178,.015055144896577895,.7518742899580008])]),Du=ft([ft([.9554734527042182,-.023098536874261423,.0632593086610217]),ft([-.028369706963208136,1.0099954580058226,.021041398966943008]),ft([.012314001688319899,-.020507696433477912,1.3303659366080753])]),Fu=ft([ft([506752/1228815,87881/245763,12673/70218]),ft([87098/409605,175762/245763,12673/175545]),ft([7918/409605,87881/737289,1001167/1053270])]),Ru=ft([ft([12831/3959,-329/214,-1974/3959]),ft([-851781/878810,1648619/878810,36519/878810]),ft([705/12673,-2585/12673,705/667])]),Tu=ft([ft([.8190224432164319,.3619062562801221,-.12887378261216414]),ft([.0329836671980271,.9292868468965546,.03614466816999844]),ft([.048177199566046255,.26423952494422764,.6335478258136937])]),Hu=ft([ft([.2104542553,.793617785,-.0040720468]),ft([1.9779984951,-2.428592205,.4505937099]),ft([.0259040371,.7827717662,-.808675766])]),Eu=ft([ft([1.2268798733741557,-.5578149965554813,.28139105017721583]),ft([-.04057576262431372,1.1122868293970594,-.07171106666151701]),ft([-.07637294974672142,-.4214933239627914,1.5869240244272418])]),Iu=ft([ft([.9999999984505198,.39633779217376786,.2158037580607588]),ft([1.0000000088817609,-.10556134232365635,-.06385417477170591]),ft([1.0000000546724108,-.08948418209496575,-1.2914855378640917])]),Bu=document.createElement(Ve);Bu.width=1,Bu.height=1;const Lu=Bu.getContext(zt,{willReadFrequently:!0});Lu.globalAlpha=1,Lu.globalCompositeOperation=wo;const Color=function(t=Xl){return this.makeName(t.name),this.register(),this.set(this.defs),this.rgb=[],this.rgb_max=[],this.rgb_min=[],this.hsl=[],this.hsl_max=[],this.hsl_min=[],this.hwb=[],this.hwb_max=[],this.hwb_min=[],this.xyz=[],this.xyz_max=[],this.xyz_min=[],this.lab=[],this.lab_max=[],this.lab_min=[],this.lch=[],this.lch_max=[],this.lch_min=[],this.oklab=[],this.oklab_max=[],this.oklab_min=[],this.oklch=[],this.oklch_max=[],this.oklch_min=[],this.easingFunction=Ll,this.convert(Ie),this.convert(He,te),this.convert(Sl,Jt),this.set(t),this},$u=Color.prototype=rc();$u.type=Jo,$u.lib=No,$u.isArtefact=!1,$u.isAsset=!1,nh($u);const Mu={rgb:null,rgb_max:null,rgb_min:null,hsl:null,hsl_max:null,hsl_min:null,hwb:null,hwb_max:null,hwb_min:null,xyz:null,xyz_max:null,xyz_min:null,lab:null,lab_max:null,lab_min:null,lch:null,lch_max:null,lch_min:null,oklab:null,oklab_max:null,oklab_min:null,oklch:null,oklch_max:null,oklch_min:null,easing:is,easingFunction:null,colorSpace:ao,returnColorAs:ao};$u.defs=Kl($u.defs,Mu),$u.packetFunctions=Ql($u.packetFunctions,["easingFunction"]),$u.kill=function(){const t=this.name;return Mt(m).forEach((e=>{const i=e.state;if(i){const e=i.fillStyle,n=i.strokeStyle,s=i.shadowColor;Zl(e)&&e.name===t&&(i.fillStyle=i.defs.fillStyle),Zl(n)&&n.name===t&&(i.strokeStyle=i.defs.strokeStyle),Zl(s)&&s.name===t&&(i.shadowColor=i.defs.shadowColor)}})),this.deregister(),this},$u.get=function(t){if(tc(t)){if(t.toFixed)return this.getRangeColor(t);if("min"===t)return this.getMinimumColor();if("max"===t)return this.getMaximumColor();if(t===Nr)return this.generateRandomColor(),this.getCurrentColor();{const e=this.getters[t];if(e)return e.call(this);{const e=this.defs[t];if(typeof e!==al){const i=this[t];return typeof i!==al?i:e}return}}}return this.getCurrentColor()},$u.set=function(t=Xl){const e=St(t),i=e.length;if(i){const n=this.setters,s=this.defs;let r,o,a,l;for(o=0;o255&&(t=255),e>255&&(e=255),i>255&&(i=255),this.setColor(`rgb(${t} ${e} ${i})`)},$u.checkColor=function(t){if(t.substring){let e=ao;return t.includes("hsl")?e=Dn:t.includes(Kt)?e=Tn:t.includes(ee)?e=Ys:t.includes(ie)?e=Gs:t.includes(qt)?e=zn:t.includes(Qt)?e=Qn:t.includes(se)&&(e=Pl),ao===e||Dn===e?t:(this.colorSpace=e,this.returnColorAs=e,this.convert(t),this.returnColor())}return Ie},$u.getRangeColor=function(t,e=!1){if(tc(t)&&t.toFixed){let i=this.colorSpace;e&&(Fn.includes(i)?i=ao:Qn===i?i=zn:Gs===i&&(i=Ys));const n=this.calculateRangeColorValues(t,e),s=this.buildColorString(...n,i);this.setColor(s)}return this.getCurrentColor()},$u.calculateRangeColorValues=function(t,e=!1){const{colorSpace:i,easing:n,easingFunction:s}=this;let r,o,a,l,c,h=i.toLowerCase();e&&(Fn.includes(i)?h="rgb":Qn===i?h=qt:Gs===i&&(h=ee));const[u,d,f,p]=this[`${h}_min`],[g,m,y,b]=this[`${h}_max`];let S=s;!e&&n!==hn&&sc[n]&&(S=sc[n]);const k=e?t:S(t);switch(h){case"hsl":case Kt:return c=g-u,o=u===g?u:jl(k,c>180||c<-180?c>0?u+360:u-360:u,g),r=p===b?p:jl(k,p,b),a=d===m?d:jl(k,d,m),l=f===y?f:jl(k,f,y),[o,a,l,r];case Qt:case ie:return c=y-f,l=f===y?f:jl(k,c>180||c<-180?c>0?f+360:f-360:f,y),r=p===b?p:jl(k,p,b),a=d===m?d:jl(k,d,m),o=u===g?u:jl(k,u,g),[o,a,l,r];default:return r=p===b?p:jl(k,p,b),o=u===g?u:jl(k,u,g),a=d===m?d:jl(k,d,m),l=f===y?f:jl(k,f,y),[o,a,l,r]}},$u.getAlphaValue=function(t){let e=1;return null!=t&&(e=t.includes(Ws)?parseFloat(t)/100:parseFloat(t)),yt(e)?e>1?e=1:e<0&&(e=0):e=1,e},$u.getHueValue=function(t){return t===Bs?0:(t=t.includes("deg")?parseFloat(t):t.includes("rad")?parseFloat(t)/Dt:t.includes("grad")?parseFloat(t)/400*360:t.includes("turn")?360*parseFloat(t):parseFloat(t),yt(t)?El(t):0)},$u.getColorValuesFromString=function(t,e){const i=(t=(t=(t=(t=t.replace(e,Ol)).replace("(",Ol)).replace(")",Ol)).replace("/",Ol)).split(Oo).filter((t=>null!=t&&t!==Ol));return null!=i[0]&&i[0]!==Bs||(i[0]=jt),null!=i[1]&&i[1]!==Bs||(i[1]=jt),null!=i[2]&&i[2]!==Bs||(i[2]=jt),i},$u.extractFromHwbColorString=function(t){const{getAlphaValue:e,getHueValue:i,getColorValuesFromString:n}=this;let s,r,o;const a=n(t,Kt),l=i(a[0]),c=parseFloat(a[1]),h=parseFloat(a[2]),u=e(a[3]);return[s,r,o]=this.convertHWBtoRGB(l,c,h),s=dt(255*s),s>255&&(s=255),s<0&&(s=0),r=dt(255*r),r>255&&(r=255),r<0&&(r=0),o=dt(255*o),o>255&&(o=255),o<0&&(o=0),[u,s,r,o]},$u.extractFromXyzColorString=function(t){const{getAlphaValue:e,getColorValuesFromString:i}=this,n=i(t,se),s=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return[e(n[3]),s,r,o]},$u.extractFromLabColorString=function(t){const{getAlphaValue:e,getColorValuesFromString:i}=this;let n,s,r;const o=i(t,qt);n=parseFloat(o[0]),n>100&&(n=100),n<0&&(n=0),s=o[1].includes(Ws)?1.25*parseFloat(o[1]):parseFloat(o[1]),s>160&&(s=160),s<-160&&(s=-160),r=o[2].includes(Ws)?1.25*parseFloat(o[2]):parseFloat(o[2]),r>160&&(r=160),r<-160&&(r=-160);return[e(o[3]),n,s,r]},$u.extractFromOklabColorString=function(t){const{getAlphaValue:e,getColorValuesFromString:i}=this;let n,s,r;const o=i(t,ee);n=o[0].includes(Ws)?parseFloat(o[0])/100:parseFloat(o[0]),n>1&&(n=1),n<0&&(n=0),s=o[1].includes(Ws)?parseFloat(o[1])/100*.4:parseFloat(o[1]),s>.5&&(s=.5),s<-.5&&(s=-.5),r=o[2].includes(Ws)?parseFloat(o[2])/100*.4:parseFloat(o[2]),r>.5&&(r=.5),r<-.5&&(r=-.5);return[e(o[3]),n,s,r]},$u.extractFromLchColorString=function(t){const{getAlphaValue:e,getHueValue:i,getColorValuesFromString:n}=this;let s,r;const o=n(t,Qt);s=parseFloat(o[0]),s>100&&(s=100),s<0&&(s=0),r=o[1].includes(Ws)?1.5*parseFloat(o[1]):parseFloat(o[1]),r>230&&(r=230),r<0&&(r=0);const a=i(o[2]);return[e(o[3]),s,r,a]},$u.extractFromOklchColorString=function(t){const{getAlphaValue:e,getHueValue:i,getColorValuesFromString:n}=this;let s,r;const o=n(t,ie);s=s=o[0].includes(Ws)?parseFloat(o[0])/100:parseFloat(o[0]),s>1&&(s=1),s<0&&(s=0),r=o[1].includes(Ws)?parseFloat(o[1])/100*.4:parseFloat(o[1]),r>.4&&(r=.4),r<0&&(r=0);const a=i(o[2]);return[e(o[3]),s,r,a]},$u.convert=function(t,e=Ol){t=t.toLowerCase();const i=this[`rgb${e}`],n=this[`hsl${e}`],s=this[`hwb${e}`],r=this[`xyz${e}`],o=this[`lab${e}`],a=this[`lch${e}`],l=this[`oklab${e}`],c=this[`oklch${e}`];if(!i)return this;let h,u,d,f;return i.length=0,n.length=0,s.length=0,r.length=0,o.length=0,a.length=0,l.length=0,c.length=0,t.includes(Kt)&&!Yu?([h,u,d,f]=this.extractFromHwbColorString(t),i.push(u,d,f,h),n.push(...this.convertRGBtoHSL(u,d,f),h),s.push(...this.convertRGBHtoHWB(i[0],i[1],i[2],n[0]),h),r.push(...this.convertRGBtoXYZ(u,d,f),h),o.push(...this.convertXYZtoLAB(r[0],r[1],r[2]),h),a.push(...this.convertLABtoLCH(o[0],o[1],o[2]),h),l.push(...this.convertXYZtoOKLAB(r[0],r[1],r[2]),h),c.push(...this.convertOKLABtoOKLCH(l[0],l[1],l[2]),h)):t.includes(se)?([h,u,d,f]=this.extractFromXyzColorString(t),i.push(...this.convertXYZtoRGB(u,d,f),h),n.push(...this.convertRGBtoHSL(i[0],i[1],i[2]),h),s.push(...this.convertRGBHtoHWB(i[0],i[1],i[2],n[0]),h),r.push(u,d,f,h),o.push(...this.convertXYZtoLAB(u,d,f),h),a.push(...this.convertLABtoLCH(o[0],o[1],o[2]),h),l.push(...this.convertXYZtoOKLAB(r[0],r[1],r[2]),h),c.push(...this.convertOKLABtoOKLCH(l[0],l[1],l[2]),h)):t.includes(ee)&&!zu?([h,u,d,f]=this.extractFromOklabColorString(t),l.push(u,d,f,h),c.push(...this.convertOKLABtoOKLCH(u,d,f),h),r.push(...this.convertOKLABtoXYZ(u,d,f),h),o.push(...this.convertXYZtoLAB(r[0],r[1],r[2]),h),a.push(...this.convertLABtoLCH(o[0],o[1],o[2]),h),i.push(...this.convertXYZtoRGB(r[0],r[1],r[2]),h),n.push(...this.convertRGBtoHSL(i[0],i[1],i[2]),h),s.push(...this.convertRGBHtoHWB(i[0],i[1],i[2],n[0]),h)):t.includes(ie)&&!Nu?([h,u,d,f]=this.extractFromOklchColorString(t),c.push(u,d,f,h),l.push(...this.convertOKLCHtoOKLAB(u,d,f),h),r.push(...this.convertOKLABtoXYZ(l[0],l[1],l[2]),h),o.push(...this.convertXYZtoLAB(r[0],r[1],r[2]),h),a.push(...this.convertLABtoLCH(o[0],o[1],o[2]),h),i.push(...this.convertXYZtoRGB(r[0],r[1],r[2]),h),n.push(...this.convertRGBtoHSL(i[0],i[1],i[2]),h),s.push(...this.convertRGBHtoHWB(i[0],i[1],i[2],n[0]),h)):t.includes(qt)&&!Gu?([h,u,d,f]=this.extractFromLabColorString(t),o.push(u,d,f,h),r.push(...this.convertLABtoXYZ(u,d,f),h),i.push(...this.convertXYZtoRGB(r[0],r[1],r[2]),h),n.push(...this.convertRGBtoHSL(i[0],i[1],i[2]),h),s.push(...this.convertRGBHtoHWB(i[0],i[1],i[2],n[0]),h),a.push(...this.convertLABtoLCH(u,d,f),h),l.push(...this.convertXYZtoOKLAB(r[0],r[1],r[2]),h),c.push(...this.convertOKLABtoOKLCH(l[0],l[1],l[2]),h)):t.includes(Qt)&&!ju?([h,u,d,f]=this.extractFromLchColorString(t),a.push(u,d,f,h),o.push(...this.convertLCHtoLAB(u,d,f),h),r.push(...this.convertLABtoXYZ(o[0],o[1],o[2]),h),i.push(...this.convertXYZtoRGB(r[0],r[1],r[2]),h),n.push(...this.convertRGBtoHSL(i[0],i[1],i[2]),h),s.push(...this.convertRGBHtoHWB(i[0],i[1],i[2],n[0]),h),l.push(...this.convertXYZtoOKLAB(r[0],r[1],r[2]),h),c.push(...this.convertOKLABtoOKLCH(l[0],l[1],l[2]),h)):([u,d,f,h]=this.getColorFromCanvas(t),i.push(u,d,f,h),n.push(...this.convertRGBtoHSL(u,d,f),h),s.push(...this.convertRGBHtoHWB(u,d,f,n[0]),h),r.push(...this.convertRGBtoXYZ(u,d,f),h),o.push(...this.convertXYZtoLAB(r[0],r[1],r[2]),h),a.push(...this.convertLABtoLCH(o[0],o[1],o[2]),h),l.push(...this.convertXYZtoOKLAB(r[0],r[1],r[2]),h),c.push(...this.convertOKLABtoOKLCH(l[0],l[1],l[2]),h)),this},$u.extractRGBfromColor=function(t){let e,i,n,s;return(t=t.toLowerCase()).includes(Kt)&&!Yu?([e,i,n,s]=this.extractFromHwbColorString(t),[i,n,s,e]):t.includes(se)?([e,i,n,s]=this.extractFromXyzColorString(t),[...this.convertXYZtoRGB(i,n,s),e]):t.includes(ee)&&!zu?([e,i,n,s]=this.extractFromOklabColorString(t),[...this.convertXYZtoRGB(...this.convertOKLABtoXYZ(i,n,s)),e]):t.includes(ie)&&!Nu?([e,i,n,s]=this.extractFromOklchColorString(t),[...this.convertXYZtoRGB(...this.convertOKLABtoXYZ(...this.convertOKLCHtoOKLAB(i,n,s))),e]):t.includes(qt)&&!Gu?([e,i,n,s]=this.extractFromLabColorString(t),[...this.convertXYZtoRGB(...this.convertLABtoXYZ(i,n,s)),e]):t.includes(Qt)&&!ju?([e,i,n,s]=this.extractFromLchColorString(t),[...this.convertXYZtoRGB(...this.convertLABtoXYZ(...this.convertLCHtoLAB(i,n,s))),e]):this.getColorFromCanvas(t)},$u.convertRGBtoHex=function(t,e,i){if(t.substring&&(t=parseInt(t,10)),e.substring&&(e=parseInt(e,10)),i.substring&&(i=parseInt(i,10)),yt(t)&&yt(e)&&yt(i)){return`#${(jt+t.toString(16)).slice(-2)}${(jt+e.toString(16)).slice(-2)}${(jt+i.toString(16)).slice(-2)}`}return"#000000"},$u.getColorFromCanvas=function(t){let e=0,i=0,n=0,s=0;Lu.clearRect(0,0,1,1),Lu.fillStyle=t,Lu.fillRect(0,0,1,1);const r=Lu.getImageData(0,0,1,1);return r&&r.data&&([e,i,n,s]=r.data,s/=255),[e,i,n,s]},$u.convertRGBtoHSL=function(t,e,i){const n=kt(t/=255,e/=255,i/=255),s=At(t,e,i),r=(s+n)/2,o=n-s;let a=0,l=0;if(0!==o){switch(l=0===r||1===r?0:(n-r)/At(r,1-r),n){case t:a=(e-i)/o+(e=1){const t=e/(e+i);return[t,t,t]}const n=this.convertHSLtoRGB(t,100,50);for(let t=0;t<3;t++)n[t]*=1-e-i,n[t]+=e;return n},$u.multiplyMatrices=function(t,e){const i=t.length;mt(t[0])||(t=[t]),mt(e[0])||(e=e.map((t=>[t])));const n=e[0].length,s=e[0].map(((t,i)=>e.map((t=>t[i]))));let r=t.map((t=>s.map((e=>mt(t)?t.reduce(((t,i,n)=>t+i*(e[n]||0)),0):e.reduce(((e,i)=>e+i*t),0)))));return 1===i&&(r=r[0]),1===n?r.map((t=>t[0])):r},$u.lin_sRGB=function(t){return t.map((t=>{const e=t<0?-1:1,i=et(t);return i<.04045?t/12.92:e*Ot((i+.055)/1.055,2.4)}))},$u.convertRGBtoXYZ=function(t,e,i){const n=Mc();n.push(t/255,e/255,i/255);const s=Mc();s.push(...this.lin_sRGB(n));const r=Mc();r.push(...Fu);const o=this.multiplyMatrices(r,s);return Xc(n),Xc(s),Xc(r),o},$u.convertRGBtoOKLAB=function(t,e,i){const n=Mc();n.push(t/255,e/255,i/255);const[s,r,o]=this.lin_sRGB(n),a=.2119034982*s+.6806995451*r+.1073969566*o,l=.0883024619*s+.2817188376*r+.6299787005*o,c=xu(.4122214708*s+.5363325363*r+.0514459929*o),h=xu(a),u=xu(l);return Xc(n),[.2104542553*c+.793617785*h-.0040720468*u,1.9779984951*c-2.428592205*h+.4505937099*u,.0259040371*c+.7827717662*h-.808675766*u]},$u.gam_sRGB=function(t){return t.map((t=>{const e=t<0?-1:1,i=et(t);return i>.0031308?e*(1.055*Ot(i,1/2.4)-.055):12.92*t}))},$u.convertXYZtoRGB=function(t,e,i){const n=Mc();n.push(...Ru);const s=Mc();s.push(t,e,i);const r=this.multiplyMatrices(n,s),o=this.gam_sRGB(r);return Xc(n),Xc(s),[Rt(255*o[0]),Rt(255*o[1]),Rt(255*o[2])]},$u.convertXYZtoLAB=function(t,e,i){const n=Mc();n.push(...Ou);const s=Mc();s.push(t,e,i);const r=this.multiplyMatrices(n,s).map(((t,e)=>t/wu[e])).map((t=>t>Cu?xu(t):(Pu*t+16)/116));return Xc(n),Xc(s),[116*r[1]-16,500*(r[0]-r[1]),200*(r[1]-r[2])]},$u.convertLABtoXYZ=function(t,e,i){const n=(t+16)/116,s=e/500+n,r=n-i/200,o=Mc();o.push(Ot(s,3)>Cu?Ot(s,3):(116*s-16)/Pu,t>8?Ot((t+16)/116,3):t/Pu,Ot(r,3)>Cu?Ot(r,3):(116*r-16)/Pu);const a=Mc();a.push(...Du);const l=Mc();l.push(...o.map(((t,e)=>t*wu[e])));const c=this.multiplyMatrices(a,l);return Xc(o),Xc(a),Xc(l),c},$u.convertLABtoLCH=function(t,e,i){const n=st(i,e)*gt;return[t,It(Ot(e,2)+Ot(i,2)),n>=0?n:n+360]},$u.convertLCHtoLAB=function(t,e,i){return[t,e*lt(i*Dt),e*Et(i*Dt)]},$u.convertXYZtoOKLAB=function(t,e,i){const n=Mc();n.push(...Tu);const s=Mc();s.push(t,e,i);const r=Mc();r.push(...Hu);const o=this.multiplyMatrices(n,s),a=this.multiplyMatrices(r,o.map((t=>xu(t))));return Xc(n),Xc(s),Xc(r),a},$u.convertOKLABtoXYZ=function(t,e,i){const n=Mc();n.push(...Iu);const s=Mc();s.push(t,e,i);const r=Mc();r.push(...Eu);const o=this.multiplyMatrices(n,s),a=this.multiplyMatrices(r,o.map((t=>t**3)));return Xc(n),Xc(s),Xc(r),a},$u.convertOKLABtoOKLCH=function(t,e,i){const n=st(i,e)*gt;return[t,It(e**2+i**2),n>=0?n:n+360]},$u.convertOKLCHtoOKLAB=function(t,e,i){return[t,e*lt(i*Dt),e*Et(i*Dt)]},$u.calculateColorBlend=function(t,e,i,n,s,r){const o=this.convertRGBtoHSL(t,e,i),a=this.convertRGBtoHSL(n,s,r),l=this.convertHSLtoRGB(o[0],o[1],a[2]);return[Rt(255*l[0]),Rt(255*l[1]),Rt(255*l[2])]},$u.calculateHueBlend=function(t,e,i,n,s,r){const o=this.convertRGBtoHSL(t,e,i),a=this.convertRGBtoHSL(n,s,r),l=this.convertHSLtoRGB(o[0],a[1],a[2]);return[Rt(255*l[0]),Rt(255*l[1]),Rt(255*l[2])]},$u.calculateSaturationBlend=function(t,e,i,n,s,r){const o=this.convertRGBtoHSL(t,e,i),a=this.convertRGBtoHSL(n,s,r),l=this.convertHSLtoRGB(a[0],o[1],a[2]);return[Rt(255*l[0]),Rt(255*l[1]),Rt(255*l[2])]},$u.calculateLuminosityBlend=function(t,e,i,n,s,r){const o=this.convertRGBtoHSL(t,e,i),a=this.convertRGBtoHSL(n,s,r),l=this.convertHSLtoRGB(a[0],a[1],o[2]);return[Rt(255*l[0]),Rt(255*l[1]),Rt(255*l[2])]};let Yu=!1,Gu=!1,ju=!1,zu=!1,Nu=!1,Vu=!1;!function(){let t,e=0,i=0,n=0,s="#ffffff00";Lu.fillStyle="hwb(90 10% 10%)",Lu.fillRect(0,0,1,1),t=Lu.getImageData(0,0,1,1),t&&t.data&&([e,i,n]=t.data),(e||i||n)&&(Yu=!0),Yu&&s===Lu.fillStyle?Yu=!1:s=Lu.fillStyle,Lu.fillStyle="lab(29.2345% 39.3825 20.0664)",Lu.clearRect(0,0,1,1),Lu.fillRect(0,0,1,1),t=Lu.getImageData(0,0,1,1),t&&t.data&&([e,i,n]=t.data),(e||i||n)&&(Gu=!0),Gu&&s===Lu.fillStyle?Gu=!1:s=Lu.fillStyle,Lu.fillStyle="lch(52.2345% 72.2 56.2)",Lu.clearRect(0,0,1,1),Lu.fillRect(0,0,1,1),t=Lu.getImageData(0,0,1,1),t&&t.data&&([e,i,n]=t.data),(e||i||n)&&(ju=!0),ju&&s===Lu.fillStyle?ju=!1:s=Lu.fillStyle,Lu.fillStyle="oklab(59.686% 0.1009 0.1192)",Lu.clearRect(0,0,1,1),Lu.fillRect(0,0,1,1),t=Lu.getImageData(0,0,1,1),t&&t.data&&([e,i,n]=t.data),(e||i||n)&&(zu=!0),zu&&s===Lu.fillStyle?zu=!1:s=Lu.fillStyle,Lu.fillStyle="oklch(59.686% 0.15619 49.7694)",Lu.clearRect(0,0,1,1),Lu.fillRect(0,0,1,1),t=Lu.getImageData(0,0,1,1),t&&t.data&&([e,i,n]=t.data),(e||i||n)&&(Nu=!0),Nu&&s===Lu.fillStyle?Nu=!1:s=Lu.fillStyle,Lu.fillStyle="color(display-p3 0 1 0)",Lu.clearRect(0,0,1,1),Lu.fillRect(0,0,1,1),t=Lu.getImageData(0,0,1,1),t&&t.data&&([e,i,n]=t.data),(e||i||n)&&(Vu=!0),Vu&&s===Lu.fillStyle?Vu=!1:s=Lu.fillStyle}();const Wu=function(t){return!!t&&new Color(t)};J.Color=Color;const Uu=new Float32Array([.37,.69,.62,.78,.06,.84,.27,.14,.46,1,.58,.28,.62,.8,.3,.7,.93,.53,.76,.24,.15,.51,.79,.28,.99,.16,.22,.45,.03,.73,.34,.96,.5,.3,.07,.84,.51,.27,.89,.8,.66,.25,.54,.94,.08,.66,.36,.85,.69,.93,.26,.79,.68,.36,.23,.5,.83,.34,.64,.91,.73,.8,.95,.59,.1,.76,.82,.03,.62,.47,.09,.55,.33,.22,.45,.04,.76,.52,.69,.24,.78,.12,.59,.37,.03,.82,.93,.69,.42,.34,.89,.62,.27,1,.53,.09,.38,.71,.13,.52,.19,.66,.33,.42,.63,.28,.36,.61,.73,.06,.56,.97,.35,.72,.91,.3,.98,.53,.2,.08,.5,.22,.87,.93,.08,.44,.91,.56,.12,.99,.01,.49,.37,.68,.89,.55,.3,.84,.17,.67,.1,.48,.89,.23,.47,.06,.29,.61,.67,.91,.2,.47,.64,.05,.77,.94,.62,.09,.58,.12,.77,.47,.93,.39,.73,.09,.47,.58,.15,.39,.02,.64,.32,.77,.98,.03,.28,.44,.11,.01,.73,.44,.88,.02,.76,.53,.41,.05,.25,.36,.02,.31,.52,.39,.28,.57,.91,.7,.98,0,.76,.94,.66,.85,.33,.18,.88,.01,.99,.46,.69,.94,.32,.51,.45,.07,.55,.22,.11,.8,.42,.17,.87,.47,.81,.23,.88,.43,.6,.11,.75,.06,.88,.72,.47,.92,.13,.31,.84,.47,.27,.16,.5,.09,.78,.44,.34,.56,.95,.69,.36,.13,.64,.29,.04,.87,.41,.53,.31,.87,.22,.6,.09,.77,.22,.72,.4,.88,.37,.75,.06,.58,.65,.86,.99,.42,.37,.58,.04,.74,.35,.57,.83,.39,.5,.91,.42,.27,.69,.02,.8,.22,.63,.97,.04,.34,.69,.97,.51,.83,.45,.24,.56,.49,.64,.81,.99,.55,.31,.17,.62,.1,.69,.15,.86,.2,.52,.67,.77,.19,.7,.85,.45,.18,.12,.4,.3,.82,.37,.53,.07,.27,.56,.64,.44,.34,.56,.25,.2,.08,.76,.64,.15,.78,.95,.72,.87,.51,.36,.02,.74,.3,.07,.64,.34,0,.82,.28,.97,.22,.5,.81,.02,.25,.41,.69,.2,.03,.76,.42,.69,.85,.59,.14,.91,.76,.28,.06,.61,.47,.73,.8,.55,.25,.61,.82,.19,.72,.13,.98,.41,.03,.64,.96,.12,.52,.27,.17,.97,.42,.13,.35,.2,.78,.11,.86,.82,.24,.95,.49,.14,.25,.17,.69,.85,.21,.95,.58,.35,.15,.44,.29,.78,.84,.2,.28,.88,.09,.2,.92,.13,.75,.17,.37,.23,.52,.89,.82,.47,1,.39,.29,.75,.59,.96,.14,.42,.92,.63,.04,1,.67,.78,.5,.24,.61,.17,.71,.92,.41,.11,.96,.74,.07,.83,.66,.89,.4,.85,.23,.55,.36,.27,.19,.04,.67,.94,.58,.63,.2,.97,.75,.55,.92,.72,.46,.55,.69,.34,.17,.67,.56,.88,.96,.52,.62,.94,.88,.21,.04,.37,.25,.72,.02,.81,.16,.91,.4,.21,1,.16,.7,.94,.1,.78,.55,.45,.7,.51,.86,.29,.48,.05,.93,.59,.81,.72,.29,.83,.59,.73,0,.49,.3,.64,.39,.11,.71,.32,.97,.78,.34,.05,.37,.49,.12,.9,.68,.56,.92,.49,.14,.55,.76,.6,.34,.72,.64,.4,.03,.88,.6,.71,.13,.65,.05,.27,.56,.22,.94,.47,.09,.33,.84,.47,.27,.09,.57,.23,.34,.07,.95,.56,.87,.11,.46,.2,.77,.87,.5,.18,.29,.79,.14,.61,.51,.29,.99,.01,.91,.65,.47,.58,.3,.23,.13,.83,.4,.49,.15,.25,.36,.17,.84,.13,.41,.07,1,.44,.77,.09,.35,.73,.3,.11,.34,.57,.47,.93,.63,.41,.53,.49,.32,.86,.55,.02,.84,.51,.34,.26,.04,.39,.92,.33,.25,.84,.17,.35,.8,.43,.67,.31,.03,.51,.47,.08,.94,.25,.55,.91,.71,.15,.45,.58,.89,.67,.02,.47,.57,.62,.82,.73,.53,.27,.81,.07,.19,.65,.4,.92,0,.44,.16,1,.53,.8,.33,.96,.29,.07,.44,.94,.34,.74,.84,.67,0,.84,.64,.71,.04,.55,.89,.39,.72,.53,.82,.42,.65,.02,.36,.94,.29,.63,0,.37,.25,.67,.93,.51,.37,.04,.74,.12,.68,.44,.81,.11,.38,.78,.99,.45,.71,.89,.33,.59,.91,.69,.51,.05,.64,.27,.89,.61,.84,.31,.24,.5,.04,.18,.44,.8,.66,.14,.75,.82,.11,.18,.99,.65,.12,.77,.25,.62,.32,.09,.75,.65,.47,.58,.16,.05,.65,.08,.94,.56,.73,.25,.84,.14,.38,.87,.64,.16,.78,.4,.64,.2,.33,.99,.02,.86,.2,.53,.42,.86,.1,.94,.14,.23,.99,.03,.4,.88,.72,.24,.07,.8,.32,.69,.83,.04,.25,.68,.22,.48,.55,.76,.86,.39,.17,.53,.09,.42,.34,.5,.26,.23,1,.18,.77,.31,.94,.15,.88,.29,.73,.21,.8,.69,.53,.95,.76,.56,.11,.6,.05,.44,.23,.96,.82,.56,.35,.21,.72,.52,.88,.16,.82,.08,.52,.27,.8,.1,.02,.84,.3,.78,.98,.43,.73,.19,.52,.14,.89,.65,.79,.6,.92,.52,.07,.98,.27,.51,.3,.78,.88,.23,.42,.7,.1,.91,.77,.43,.96,.22,.87,.71,.8,.95,.55,.76,.45,.15,.02,.99,.54,.2,.73,.96,.24,.55,.36,.05,.95,.13,.75,.55,.77,.25,.36,.13,.8,.19,.29,.71,.36,.45,.65,.33,.61,.51,.37,1,.56,.46,.89,.23,.5,.4,.91,.58,.07,.83,.65,.12,.25,.61,.79,.14,.97,.63,.78,.12,.89,.43,.38,.61,.69,0,.45,.19,.6,.02,.92,.5,.42,.09,.24,.42,.16,.89,.48,.99,.76,.66,.87,.27,.45,.16,.62,.89,.25,.04,.33,.22,.62,.37,0,.67,.18,.45,.75,.62,.42,.18,.57,.01,.36,.8,.05,.68,.4,1,.27,.86,.4,.22,.37,.83,.44,.68,.05,.56,.35,.06,.59,.94,.49,.38,.58,.16,.53,.13,.29,.36,.51,.2,.26,.36,.89,.69,.31,.42,.63,.91,.5,.04,.31,.85,.72,.47,.83,.61,.36,.48,.07,.93,.64,.72,1,.6,.49,.89,.54,.08,.76,.92,.16,.09,.82,.29,.14,.61,.18,.75,.65,.11,.29,.78,.15,.42,.36,.99,.01,.49,.69,.31,.89,.25,.18,.94,.58,.7,.85,.09,.5,.22,.85,.69,.39,.33,.78,.15,.58,.85,.04,.72,.35,.84,.28,.4,.16,.33,.56,.01,.69,.96,.06,.47,.83,.56,.69,.93,.54,.74,.94,.86,.53,.98,.38,.24,.95,.11,.67,.86,.51,.3,.96,.46,.57,.34,.05,.15,.71,.31,.77,.03,.6,.2,.94,.72,.45,.82,.17,.31,.8,.2,.05,.69,.84,.76,.01,1,.09,.84,.44,.62,.11,.22,.5,.81,.05,.29,.45,.77,.68,.09,.91,.2,.28,0,.89,.18,.69,.32,.51,.44,.03,.35,.25,.67,.03,.84,.2,.56,.46,.89,.23,.69,.78,.95,.37,.09,.55,.87,.44,.73,.95,.52,.82,.23,.73,.91,.44,.04,.55,.46,.73,.41,.03,.31,.14,.78,.36,.97,.56,.8,.11,.99,.52,.27,.91,.64,.95,.49,.19,.66,.03,.55,.85,.13,.62,.8,.41,.29,.75,.39,.13,.99,.45,.05,.27,.47,.12,.41,.63,.29,.15,.84,.54,.32,.74,.22,.13,.64,.85,.08,.16,.75,.51,.47,.64,.95,.58,.14,.91,.51,.39,.13,.25,.97,.69,.01,.56,.87,.28,.93,.38,.62,.44,.67,.57,.7,.01,.8,.98,.6,.89,.73,.16,.71,.12,.59,.36,.54,.15,.57,.67,.45,.25,.95,.83,.11,.22,.84,.09,.77,.92,.16,.41,.96,.35,.25,.75,.65,0,.44,.53,.06,.28,.83,.99,.23,0,.59,.24,.05,.63,.28,.55,.36,.16,.83,.72,.31,.08,.66,.81,.53,.22,.9,.62,.28,.05,.45,.64,.22,.71,.07,.35,.45,.31,.1,.77,.6,.95,.24,.73,.49,.99,.22,.1,.55,.91,.63,.24,.74,.41,.79,.16,.81,.33,.22,.04,.81,.67,.48,.04,.8,.44,.99,.41,.78,.25,.6,.94,.28,.82,.91,.2,.11,.44,.73,.34,.79,.06,.85,.63,.51,.42,.9,.73,.44,.64,.05,.49,.24,.9,.2,.33,.93,.15,.48,.34,.19,0,.45,.34,.97,.84,.21,.95,.26,.41,.82,.98,.72,.54,.34,.62,.39,.57,.93,.69,.53,.44,.8,.64,.53,.71,.11,.94,.37,.58,.87,.2,.73,.47,.42,.67,.34,.49,.91,.38,.72,.13,.89,.77,.08,.96,.64,.19,1,.85,.47,.25,.96,.71,.47,.12,.76,.16,.91,.3,.51,.85,.8,.15,.75,.55,.89,.36,.46,.07,.89,.43,.04,.36,.87,.48,.85,.17,.02,.52,.31,.09,.87,.64,.97,.58,.71,.91,.51,.1,.9,.59,.27,.16,.62,.57,.01,.49,.38,.73,.42,0,.6,.38,.86,.28,.64,.24,1,.56,.3,.76,.18,.1,.35,.23,.14,.98,.31,.8,.72,.15,.84,.53,.25,.4,.73,.85,.55,.67,.91,.25,.55,.51,.03,.69,.88,.75,.03,.34,.09,.16,.78,.05,.75,.88,.28,.2,.37,.13,.3,.22,.04,.87,.44,.54,.15,.25,1,.32,.64,.93,.25,.13,.64,.8,.16,.55,.97,.41,.48,.24,.61,.4,.27,.53,.12,.36,.16,.6,.36,.05,.4,.58,.82,.37,.69,.95,0,.56,.39,.66,.23,0,.81,.18,.69,.32,.8,.28,.67,.62,.26,.73,.58,.27,.67,.83,.94,.55,.2,.36,.5,.08,.84,.42,.35,.2,.74,.38,.93,.71,.08,.3,.97,.83,.19,.88,.15,.67,.24,.8,.07,.51,.84,.02,.18,.69,.45,.04,.91,.58,.8,.47,.71,.6,.08,.56,.41,.04,.36,.77,.09,.9,.58,.05,.31,.39,.09,.75,.63,.31,.82,.45,.12,.61,.51,.22,.63,.93,.51,.2,.47,.32,.06,.66,.59,.97,.9,.69,.58,.16,.31,.82,.06,.76,.41,.1,.82,.02,.58,.89,.05,.28,.84,.08,.3,.77,.02,.67,.33,.81,.02,.67,.75,.57,.91,.8,.09,.85,.67,.99,.25,.51,.13,.45,.25,.12,.88,.46,.95,.6,.28,.98,.49,.16,.57,.18,.95,.81,.16,.04,.98,.44,.35,.77,.04,.61,.7,.29,.01,.67,.16,.27,.99,.63,.47,0,.2,.83,.47,.88,.13,.66,.54,.08,.98,.5,.32,.56,.97,.69,.4,.61,.48,.94,.37,.83,.6,.29,.94,.03,.87,.37,.16,.91,.65,.49,.97,.45,.64,.67,.22,.13,1,.84,.49,.16,.94,.07,.42,.19,.28,.94,.36,.89,.46,.83,.29,.7,.91,.14,.42,.8,.73,.07,.47,.75,.38,.97,.63,.69,.91,.47,.69,.56,.14,.47,.76,.52,.97,.44,.75,.5,.64,.19,.84,.99,.13,.5,.91,.86,.32,.05,.23,.42,.52,.3,.17,.33,.04,.89,.61,.73,.34,.93,.75,.15,.31,.7,.41,.07,.64,.84,.75,.41,.08,.48,.32,.39,.7,.11,.87,.14,.47,.27,.95,.77,.47,.93,.62,.53,.77,.12,.31,.96,.67,.49,.38,.73,.24,.4,.33,.6,.78,.39,.85,.15,.44,.2,.11,.89,.78,.09,.24,.73,.14,.45,.67,.22,.53,.83,.27,.75,.3,.2,.85,0,.28,.83,.37,.52,.78,.71,.6,.22,.37,.89,.66,.78,.57,.03,.68,.74,.17,.38,.03,.59,.81,.63,.98,.52,.22,.35,.27,.12,.85,.01,.25,.35,.19,.6,.3,.92,.8,.35,.3,.17,.36,.7,.23,.1,.88,.38,.55,.28,.72,.57,.17,.38,.47,.98,.72,.63,.89,.75,.55,.93,.64,.08,.78,.82,.19,.62,.53,.37,.05,.84,.49,.94,.23,.35,.01,.99,.53,.66,.76,.95,.57,.23,.64,.31,.89,.4,.12,.86,.16,.41,.31,.81,.03,.86,.56,.81,.25,.11,.58,.19,.8,.93,.05,.84,.25,.11,.73,.02,.67,.93,.36,.55,.31,.66,.2,.51,.41,.86,.06,.33,.63,.42,.01,.98,.59,.1,.7,.57,.18,.44,.92,.64,.27,.42,.04,.81,.54,.71,.25,.99,.49,.82,.11,.25,.55,.66,.95,.12,.24,.38,.03,.28,.88,.57,.92,.42,.53,.59,.77,.44,.12,.88,.02,.24,.7,.09,.86,.67,.03,.93,.58,.33,.95,.6,.06,.44,.9,.08,.24,.63,.14,.79,.28,.16,.02,.39,.12,.8,.44,.36,.28,.49,.42,.02,.24,.91,.66,.13,.59,.2,.73,.47,.6,.3,.21,.89,.26,.07,.48,.79,.01,.95,.52,.66,.07,.55,.73,.89,.07,.2,.49,.38,.61,.17,.4,.78,.97,.01,.62,.48,.69,.22,.47,.97,.59,.52,.8,.26,.72,.05,.42,.89,.8,.03,1,.76,.17,.93,.78,.09,.69,.45,.89,.39,.82,.34,.98,.75,.1,.04,.34,.17,.9,.32,.11,.49,.05,.15,.33,.38,.61,.97,.07,.85,.34,.44,.77,.54,.73,.17,.69,.8,.05,.65,.19,.93,.09,.83,.51,.97,.36,.53,.43,.62,.97,.51,.81,.16,.45,.03,.75,.27,.16,.8,.35,.67,.77,.85,.53,.11,.56,.36,.96,.6,.24,.48,.69,.23,.91,.12,1,.69,.8,.55,.44,.98,.31,.8,.08,.89,.69,.84,.39,.12,.62,.18,.88,.31,.7,.56,.2,.78,.35,.62,.24,.58,.97,.65,.7,.95,.04,.49,.91,.33,.68,.47,.29,.38,.95,.16,.67,.37,.29,.19,.89,.49,.61,.16,.95,.56,.48,.27,.62,.34,.56,.48,.28,.92,.55,.15,.77,.05,.63,.24,.12,.49,.59,.84,.97,.53,.75,.64,.97,.44,.86,.62,.91,.22,.79,.44,.31,.72,.52,.19,.93,.09,.88,.49,.41,.11,.98,.31,.72,.28,.41,.58,.3,.74,.66,.15,.84,.05,.2,.41,.27,.62,.87,.82,.53,.67,.47,.86,.58,.04,.42,.94,.33,.69,.88,.45,.83,.67,.05,.86,.98,.01,.66,.57,.3,.85,.05,.22,.27,.71,.03,.37,.53,.27,.16,.03,.57,.69,.82,.42,.53,.99,.36,.09,.83,.28,.98,.02,.46,.15,.33,.43,.18,.28,.75,.24,.82,.08,.22,.89,.85,.13,.76,.58,.07,.89,.77,.07,.42,.04,.83,.22,.7,.34,.13,.9,.7,.06,.25,.74,.11,.83,.35,.25,.52,.43,.94,.53,.86,.72,.31,.2,.7,.56,.36,.27,.2,.58,.36,.74,.1,.5,.69,.16,.93,.04,.78,.6,.28,.65,.34,.96,.23,.62,.36,.47,.88,.06,.72,.95,.21,.04,.79,.27,.91,.59,.33,.77,.1,.69,.31,.21,.36,.12,.95,.31,.2,1,.28,.48,.03,.24,.76,.07,.19,.34,.76,.15,.33,.55,.39,.76,.16,.48,.37,.94,.51,.84,.62,.92,.67,.42,.94,.79,.45,.97,.36,.03,.75,.13,.24,.46,.73,.14,.4,.85,.69,.5,.83,.76,.09,.89,.45,.68,.56,.4,.64,.52,.05,.23,.53,.34,.81,.44,.24,.67,.56,.98,.37,.52,.78,.02,.4,.21,.81,.45,.87,.59,.4,.2,.66,1,.08,.29,.2,.67,.01,.39,.27,.79,.45,.09,0,.78,.94,.07,.8,.28,.66,.02,.88,.39,.58,.23,.42,.91,.13,.38,.82,.03,.56,.77,.16,.82,.54,.16,.61,.33,.12,.63,.44,.37,.48,.73,0,.91,.56,1,.44,.07,.92,.63,0,.77,.52,.12,.8,.18,.59,.4,.99,.29,.56,.52,.94,.42,.62,.84,.08,.95,.25,.6,.74,.65,.11,.16,.45,.21,.06,.76,.32,.49,.18,.07,.66,.27,.61,.86,.66,.91,.48,.61,.89,.19,.75,.29,.04,.91,.54,.6,.34,.01,.99,.14,.31,.72,.81,.41,.99,.62,.05,.49,.96,.73,.33,.13,.67,.27,.88,.59,.94,.65,.16,.37,.99,.05,.81,.53,0,.73,.6,.85,.8,.36,.47,.09,.94,.64,.13,.91,.84,.47,.67,.53,.22,.42,.96,.55,.34,.76,.12,.48,.69,.04,.75,.53,.47,.2,.71,.9,.26,0,.67,.85,.42,.91,.78,.55,.87,.19,.11,.97,.66,.37,.48,.16,.65,.8,.56,.27,.72,.4,.61,.47,.71,.92,.67,.83,.15,.64,.92,.05,.47,.12,.28,.73,.2,.51,.82,.42,0,.32,.77,.56,.29,.8,.98,.59,.11,.63,.27,.87,.54,.92,.19,.42,.02,.8,.18,.07,.53,.32,.13,.99,.63,.38,.24,.15,.84,.77,.18,.85,.49,.93,.59,.16,.69,.27,.84,.12,.59,.18,.89,.45,.83,.19,.44,.11,.75,.5,.56,.09,.31,.65,.25,.92,.44,.35,.7,.13,.55,.97,.76,.59,.86,.55,.36,.25,.62,.17,.32,.11,.61,.85,.13,.45,.23,.64,.84,.99,.34,.86,.29,.98,.78,.09,.63,.31,.5,1,.38,.22,.08,.49,.26,.02,.99,.71,.59,.31,.22,.13,.84,.24,.04,.35,.84,.44,.17,.89,.05,.86,.38,.25,.07,.53,.45,.36,.25,.7,.8,.66,.91,.5,.36,.06,.69,.89,.2,.82,1,.39,.7,.09,.36,.19,.91,.72,.37,.78,.16,.47,.81,.34,.56,.29,.95,.37,.8,.67,.44,.58,.2,.49,.71,.96,.29,.49,.71,.44,.25,.11,.34,.01,.46,.91,.22,.37,.55,.28,.01,.79,.59,.05,.98,.36,.29,.23,.85,.78,.71,.47,.11,.76,.87,.22,.96,.39,.28,.09,.23,.17,.31,.05,.46,1,.69,.39,.88,.77,.98,.36,.05,.73,.94,.06,.18,.44,.57,.1,.17,.59,.25,.35,.94,.42,.08,.59,.74,.33,.95,.61,.81,.41,.33,.08,.52,.79,.45,.91,.72,.58,.95,.75,.49,.17,.99,.33,.23,.65,.15,.55,.31,.84,0,.76,.87,.17,.38,.22,0,.87,.99,.63,.3,.11,.54,.5,.05,.24,.86,.52,.64,.47,.4,0,1,.61,.33,.69,.08,.98,.52,.12,.71,.43,.25,.92,.02,.86,.35,.78,.05,.65,.41,.1,.63,.05,.77,.65,.96,.4,.81,.66,.09,.78,.71,.86,.42,.35,.22,.72,.52,.86,.71,.04,.97,.4,.19,.95,.15,.37,.57,.06,.79,.46,.65,.72,.51,.93,.69,.82,.74,.07,.57,.28,.03,.43,.72,.56,.3,.81,.52,.4,.7,.28,.81,.66,.42,.91,.67,.12,.82,.55,.87,.18,.45,.77,.09,.69,.16,.77,.65,.24,.92,.39,.64,.08,.51,.32,.41,.23,.09,.7,.58,.8,.49,.1,.79,.96,.72,.2,.95,.53,.09,.61,.98,.52,.33,.54,.15,.78,.39,.94,.73,.17,.66,.6,.12,.92,.77,.27,.83,.57,.11,.23,.43,.03,.87,.25,.75,.63,.84,.08,.61,.76,.15,.53,.94,.27,.08,.91,.53,.22,.94,.36,.9,.5,.21,.56,.16,.56,.34,.97,.49,.1,.62,.67,.93,.49,.14,.62,.2,.58,.12,.34,.63,.55,.84,.68,.3,.51,.2,.91,.02,.89,.38,.45,.13,.27,.41,.18,.79,.94,.52,.11,.25,.19,.66,.89,.14,.59,.88,.02,.49,.21,.78,.51,0,.47,.75,.21,.03,.7,.84,.27,.54,.38,.22,.91,.56,.84,.02,.73,.18,.28,.83,.02,.92,.64,.88,.29,.04,.44,.75,.93,.45,.39,.61,.11,.67,.42,.28,.47,.82,.06,.75,.69,.43,.23,.04,.58,.33,.45,.96,.32,.41,.22,.05,.32,.16,.91,.49,.81,.95,.65,.55,.38,.21,.47,.17,1,.31,.49,.22,.69,.42,.69,.56,.84,.34,.73,.82,.56,.13,.3,.84,.73,.89,.29,.44,.03,.24,.92,.21,.84,.06,.28,.38,.81,.42,.94,.48,.82,.27,.01,.44,.23,.94,.05,.56,.33,.62,.3,.05,.8,.98,.61,.51,.86,.14,.36,.62,.81,.94,.48,.08,.4,.22,.31,.95,.73,.35,.99,.06,.3,.87,.62,.37,.27,.92,.36,.12,.64,.02,.88,.47,.29,.13,.44,.36,.88,.49,.99,.6,.7,.12,.47,.8,.36,.95,.65,.28,.19,.02,.27,.86,.49,.27,.77,.92,.15,.63,.43,.29,.12,.84,.94,.48,.8,.86,.06,.77,.37,.58,.8,.98,.62,.75,.68,.27,.18,.35,.73,.14,.9,.8,.01,.35,.56,.89,.36,.08,.84,.3,.12,.21,.44,.16,0,.29,.47,.17,.71,.04,.27,.06,.94,.62,.83,.69,.53,.36,.15,.56,.77,.97,0,.25,.75,.09,.67,.76,.89,.09,.72,.59,.83,.69,.23,.84,.16,.72,.56,.33,0,.25,.91,.67,.47,.22,.74,.38,.59,.96,.7,.77,.55,.11,.62,.14,.82,.58,.27,.72,.15,.98,.58,.67,.52,.43,.99,.57,.76,.95,.03,.61,.78,.18,.58,.09,.23,.42,.36,.2,.55,.25,.6,.18,.13,.55,.84,.63,.7,.06,.18,.84,.35,.04,.7,.2,.88,.97,.36,.62,.08,.64,.19,.27,.1,.63,.89,.01,.71,.53,.47,.04,.4,.58,.78,.51,.08,.26,.68,.49,.6,.83,.7,.11,.67,.57,.97,.64,.76,.48,1,.6,.76,.66,.88,.99,.61,.4,.47,.69,.51,.17,.13,.32,.58,.78,1,.45,.33,.59,.88,.52,.31,1,.37,.14,.59,.96,.42,.32,.12,.99,.42,.54,.95,.49,.18,.83,.64,.73,.37,.09,.84,.03,.3,.16,.84,.34,.01,.84,.17,.44,.29,.54,.39,.66,.89,.43,.11,.83,.06,.78,.2,.88,.3,.15,.41,.33,.73,.51,.97,.67,.31,.92,.65,.75,.84,.98,.74,0,.9,.49,.77,.36,.89,.4,.52,.96,.75,.42,.58,1,.5,.33,.01,.67,.18,.53,.33,.7,.39,.55,.93,.22,.51,.15,.28,.35,.23,.89,.13,.96,0,.88,.44,.99,.33,.09,.95,.28,.21,.45,.78,.16,.33,0,.91,.36,.82,.08,.4,.53,.09,.35,.53,.78,.93,.34,.84,.76,.43,.87,.08,.27,.02,.66,.22,.69,.1,.16,.64,.55,.22,.47,.31,.51,.18,.78,.46,.09,.8,.03,.67,.26,.4,.88,.12,.45,.28,.58,.97,.48,.79,.65,.11,.5,.27,.47,.94,.67,.86,.94,.19,.06,.8,.2,.53,.33,.47,.41,.09,.71,.81,.23,.71,.1,.83,.25,.14,.37,.81,.03,.51,.11,.33,.06,.42,.82,.31,.69,1,.08,.25,.12,.81,.33,.09,.65,.24,.09,.75,.86,.58,.47,.78,.27,.89,.06,1,.47,.79,.68,.42,.86,.95,.06,.83,.77,.55,.31,.23,.67,.63,.8,.2,.73,.41,.65,.04,.98,.84,.27,.47,.53,.09,.24,.69,.31,.94,.2,.24,.85,.03,.16,.22,.1,.38,.01,.66,.95,.48,.73,.88,.4,.12,.89,.45,.8,.4,.85,.03,.89,.8,.66,.01,.88,.25,.58,.18,.36,.75,.91,.08,.52,.76,.97,.18,.75,.24,.42,.55,1,.22,.77,.63,.38,.05,.58,.23,.02,.75,.48,.35,.59,.93,.74,.24,.96,.62,.02,.52,.46,.88,.22,.56,.42,.05,.86,.58,.45,.18,.88,.27,.63,.58,.41,.09,.21,.44,.58,.73,.47,.2,.92,.56,.37,.91,.46,.17,.26,.38,.95,.09,.83,.42,.74,.15,.6,.31,.04,.33,.73,.56,.46,.66,.18,.44,.73,.48,.16,.38,.51,.03,.59,.13,.88,.52,.35,.14,.62,.95,.8,.73,.44,.57,.15,.76,.59,.73,.44,.78,.89,.66,.6,1,.27,.55,.22,.36,.16,.53,.63,.84,.35,.28,.95,.05,.7,.61,.13,.7,.25,.95,.55,.69,.92,.49,.86,.14,.31,.58,.22,.33,.04,.55,.68,.12,.88,.06,.35,.45,.93,.83,.15,.7,.32,.77,.42,.69,.98,.12,.86,0,.66,.16,.82,.44,.33,.93,.58,.05,.99,.64,.75,.93,.26,.71,.34,1,.69,.51,.92,.7,.16,.95,.64,.81,.02,.86,.68,.59,.28,.02,.84,.69,.31,.82,.63,.06,.69,.16,.56,.63,.36,.22,.87,.09,.97,.18,.62,.11,.32,1,.02,.64,.94,.84,.11,.91,.22,.84,.93,.45,.73,.31,.58,.71,.05,.38,.29,.19,.97,.87,0,.46,.93,.11,.39,.57,.28,.49,.73,.45,.8,.06,.72,.84,.78,.31,.92,.05,.57,.73,.53,.24,.33,.98,.49,.41,.34,.06,.44,.31,.71,.07,.64,.44,.81,.7,.95,.65,.42,.91,.81,.33,.62,.16,.72,.59,.28,.09,.51,.97,.88,.12,.53,.28,.61,.25,.4,.52,.3,.58,.89,.22,.76,.18,.38,.7,.29,.36,.47,.18,.55,.11,.22,.8,.39,.14,.05,.24,.86,.53,.33,.51,.27,.37,.11,.98,.4,.75,.14,.49,.02,.92,.54,.73,.31,.96,.45,.02,.84,.49,.67,.44,.53,.84,.89,.25,.52,.8,.39,.25,.06,.77,.29,.67,.61,.42,.34,.25,.8,.07,.18,.91,.49,.87,.67,.12,.62,.33,.52,.81,.32,.66,.19,.96,.06,.35,.08,.2,.9,.64,.48,.13,.05,.44,.22,.5,.18,.65,.13,.45,.78,.16,.25,.76,.92,.63,.84,.15,.38,.22,.98,.27,.53,.01,.16,.79,.62,.27,.06,.41,.53,.94,.26,.03,.87,.42,.24,.6,.35,.21,.83,.56,.04,.78,.7,.97,.07,.37,.11,.53,.65,.08,.85,.5,.12,.8,.01,.87,.41,.75,.63,.01,.56,.77,.36,.45,.8,.04,.69,.14,.95,.44,.83,.16,.53,.67,.24,.99,.61,.41,.23,.12,.38,.78,.21,.3,.92,.11,.8,.27,.72,.37,.45,.04,.73,.87,.16,.6,.51,.34,.56,.02,.76,.12,.69,0,.63,1,.42,.77,.24,.56,.02,.46,.84,.27,.69,.07,.23,.84,.48,.76,.68,.85,.94,.53,.16,.31,.38,.98,.6,.67,.76,.96,.08,.88,.38,.95,.67,.56,.87,.06,.2,.52,.11,.77,.47,.55,.69,.09,.91,.39,.48,.24,.13,.45,.91,.19,.84,.75,.48,.78,.55,.66,.75,.02,.44,.65,.96,.16,.91,.34,.45,.19,.84,.7,.78,.41,.28,.93,.42,.74,.24,.91,.6,.68,.31,.84,.95,.48,.29,.86,.94,.61,.29,.41,.72,.87,.2,.58,.77,.3,.05,.88,.44,.35,.19,.77,.96,.49,.91,.62,.53,.7,.38,.58,.31,.95,.06,.16,.65,.93,.21,.42,.67,.95,.21,.89,.46,.97,.27,.49,.95,.88,.17,.51,.36,.84,.16,.31,.7,.96,.2,.75,.42,.15,.98,.55,.01,.31,.22,.42,.6,.25,.76,.44,.89,.23,.55,.16,.33,.85,.28,.71,.59,.03,.3,.09,.63,.34,.58,.7,.23,.96,0,.33,.82,.18,.74,.31,.87,.98,.56,.77,.7,.58,.06,.3,.12,.98,.19,.13,.95,.31,.8,.09,.49,.39,.76,.08,.55,.28,.62,.46,1,.13,.84,.57,.03,.64,.34,.52,.09,.22,.46,.16,.07,.24,.66,.18,.12,.7,.21,.99,.07,.34,.62,.04,.73,.38,.94,.62,.81,.09,.69,.07,.66,.27,0,.83,.09,.99,.66,.05,.19,.75,.61,.5,.78,.31,.56,.08,.48,.33,.82,.12,.71,.16,.86,.2,.36,.55,.45,.28,.69,.09,.61,.94,.78,.37,.53,.05,.9,.57,.71,.36,.88,.63,.09,.48,.82,.02,.72,.67,.11,.74,.84,.4,0,.62,.47,.36,.2,.82,.49,.92,.41,.82,1,.45,.31,.88,.66,.14,.94,.45,.58,.64,.07,.69,.37,.02,.33,.96,.43,.67,.56,.35,.4,.84,.5,.56,.71,.9,.26,.67,.23,.64,.82,.93,.04,.23,.34,.07,.49,.31,.96,.17,.83,.39,.73,.99,.8,.36,.55,.92,.73,.44,.53,.02,.85,.56,.47,.79,.26,.97,.49,.22,.12,.57,.28,.38,.87,.53,.84,.44,.57,.35,.24,.14,.77,.47,.91,.41,.25,1,.35,.13,.73,.96,.61,0,.73,.24,.59,.42,.62,.75,.08,.82,.1,.74,.96,.01,.5,.42,.17,.09,.3,.63,.45,.81,.28,.11,.44,.77,1,.71,.36,.18,.96,.49,.03,.29,.93,.52,.7,.89,.13,.54,.99,.76,.13,.69,.25,.17,0,.77,.09,.59,.55,.42,.71,.24,.05,.93,.19,.44,.82,.14,.51,.23,.82,.16,.91,.61,.04,.7,.24,.05,.17,.34,.55,.03,.98,.5,.13,.39,.71,.57,.91,.64,.75,.21,.7,.11,.45,.92,.26,.04,.51,.63,.87,.02,.33,.8,.93,.39,.31,.65,.15,.43,.87,.11,.67,.35,.85,.72,.01,.95,.45,.31,.13,.19,.75,.68,.86,.44,.26,.58,.86,.09,.55,.83,.02,.88,.53,.38,.16,.9,.53,.37,.95,.09,.3,.55,.67,.33,.23,.86,.4,.62,.25,.85,.58,.66,.98,.86,.12,.19,.66,.94,.2,.53,.16,.06,.58,.87,.33,.54,.86,.36,.17,.11,.45,.23,.79,.07,.42,.27,.48,.36,.88,.55,.66,.4,.22,.84,.18,.29,.87,.5,.33,.78,.51,.27,.95,.62,.88,.09,.4,.77,.27,.47,.8,.91,.32,.64,.98,.41,.84,.78,.42,.31,.88,.1,.77,.43,.18,.85,.55,.39,.88,.78,.56,.15,.64,.3,.75,.18,.69,.42,.21,.6,.15,.74,.25,.89,.05,.71,.3,.56,.92,.44,.78,.2,.5,.69,.22,.64,1,.38,.93,.05,.53,.95,.35,.02,.69,.33,.15,.67,.45,.27,.81,.23,.84,.31,.66,.05,.83,.49,.89,.01,.44,1,.6,.48,.14,.91,.32,.74,.03,.45,.24,.72,.35,.41,.51,.04,.74,.33,.84,.27,.75,.44,.24,.16,.61,.76,.64,.99,.75,.31,.94,.65,.85,.05,.64,.96,.07,.32,.57,.92,.49,.92,.7,.05,.99,.11,.6,.88,.04,.72,.11,.47,.75,.64,.53,0,.71,.22,.08,.53,.43,.76,.5,.13,.61,.06,.18,.58,.67,.25,.53,.3,.81,.02,.11,.43,.29,.04,.34,.85,.6,.44,.91,.12,.27,.5,.99,.06,.69,.45,.52,.94,.61,.79,.39,.19,.01,.61,.07,.39,.96,.16,.76,.04,.6,.78,.28,.49,.11,.64,.21,.8,.5,.96,.39,.77,.62,.08,.42,.68,.11,.49,.42,.78,.19,.71,.23,.93,.8,.18,.7,.05,.55,.77,.2,.95,.36,.82,.49,.02,.94,.57,.88,.84,.59,.41,.93,.5,.63,.02,.8,.89,.39,.47,.28,.55,.03,.6,.38,.16,.54,.31,.72,.19,.79,.84,.27,.75,.06,.34,.81,.56,.37,.75,.19,.45,.39,.85,.59,.22,.36,.27,.94,.34,.97,.59,.86,.17,.97,.03,.22,.88,.29,.7,.95,.82,.34,.92,.06,.97,.49,.34,.93,.77,.64,.96,.51,.21,.82,.02,.99,.35,.56,.88,.76,.36,.27,.87,0,.35,.12,.22,.67,1,.81,.26,.65,.89,.29,.53,.36,.86,.45,.08,.22,.67,.83,.4,.73,.91,.23,.12,.58,.89,.2,1,.55,.76,.94,.59,.15,1,.63,.35,.57,.13,.28,.41,.87,.24,.35,.69,.07,.5,.11,.89,.6,.21,.7,.08,.3,.15,.26,.04,.67,.13,.39,.98,.7,.09,.67,.05,.89,.15,.84,.48,.71,.12,.77,.95,.57,.03,.44,.58,.12,.17,.43,.63,.11,.22,.66,.31,.94,.69,.24,.33,.95,.05,.78,.13,.85,.18,.49,.42,.3,.66,.37,.59,.78,.68,.36,.52,.24,.03,.45,.15,.59,.65,.21,.7,.59,.15,.23,.67,.08,.36,.7,.23,.47,.63,.73,.04,.17,.53,.64,.8,.19,.44,.83,.57,.46,.32,.5,.75,.11,.47,.8,.03,.7,.25,.91,.51,.73,.97,.33,.05,.56,.08,.42,.78,.27,.02,.49,.3,.14,.33,.03,.88,.25,.32,0,.45,.75,.64,.51,.09,.64,.96,.45,.84,.6,.42,.66,.16,.28,.78,.43,.84,.64,.47,.73,.96,.22,.83,.29,.17,.52,.34,.22,.96,.31,.78,.36,.22,.96,.28,.44,.22,.67,.4,.98,.48,.67,.86,.97,.51,.86,.95,.45,.55,.08,.79,.15,.55,.67,.5,.91,.59,.45,.66,.09,.81,.73,.13,.84,.27,.08,.46,.91,.12,.64,.55,.75,.83,.4,.87,.27,.08,.96,.33,.83,.43,.91,.78,.14,.52,.84,.09,.22,.43,.84,.97,.09,.31,.73,.99,.66,.03,.87,.08,.16,.95,.35,.22,.58,.78,.42,.19,.65,.33,.16,.42,.58,.18,.95,.35,.66,.62,.85,.36,.75,.92,.84,.64,.47,.38,.74,.55,.89,.81,.16,.98,.38,.78,.57,.11,.31,.19,.87,.25,.98,.73,.39,.55,.11,.99,.18,.38,.89,.53,.45,.76,.58,.87,.46,.78,.58,.73,.5,.42,.67,.08,.63,.87,.5,.09,.91,.14,.29,.21,.36,.77,.24,.3,.74,.15,.03,.83,.27,.63,.99,0,.41,.26,.73,.04,.25,.56,.9,0,.22,.55,.48,.94,.64,.33,.17,.83,.4,.99,.21,.33,.11,.73,.53,.43,.78,.48,.09,.55,.31,.59,.95,.31,.75,.4,.92,.67,.33,.24,.43,.61,.53,.15,.41,.28,.94,.71,.61,.38,.83,.7,.09,.98,.51,.11,.94,.8,.03,.87,.27,.75,.86,.48,.15,.99,.07,.44,.68,.11,.56,.22,.86,.18,.64,.8,.08,.39,.27,.05,.84,.23,.91,.73,.5,.01,.76,.33,.09,.46,.02,.91,.27,.49,.73,.01,.56,.09,.31,.7,.02,.24,.1,.93,.39,.01,.62,.11,.89,.55,.73,.02,.81,.35,.77,.62,.83,.73,.01,.55,.06,.38,.48,.67,.35,.89,.42,.49,.33,.77,.88,.18,.46,.98,.38,.76,.29,.63,1,.4,.76,.2,.01,.98,.58,.77,.05,.3,.68,.5,0,.94,.19,.65,.05,.88,.37,.73,0,.18,.47,.07,.65,.27,.86,.13,.51,.71,.87,.03,.92,.24,.77,.49,.34,.2,.78,.02,.49,.91,.16,.32,.75,.59,.28,.39,.55,.95,.65,.46,0,.7,.31,.23,.8,.2,.53,.25,.39,0,.51,.95,.11,.22,.5,.94,.62,.69,.47,.33,.16,.41,.96,.64,.54,.91,.59,.8,.69,.87,.62,.31,.67,.8,.28,.85,.15,.48,1,.6,.66,.29,.15,.86,.2,.99,.27,.33,.16,.4,.66,.19,.58,.07,.54,.94,.45,.63,.81,.59,.04,.25,.57,.76,.08,.18,.59,.8,.09,.29,.64,.81,.15,.53,.86,.45,.32,.05,.89,.66,.42,.72,.24,.48,.35,.88,.61,.81,.45,.58,.84,.36,.25,.63,.22,.99,.66,.84,.36,.91,.56,.15,.45,.59,.02,.79,.2,.47,.37,.82,.59,.06,.86,.44,.56,.31,.53,.25,.62,.44,.01,.82,.2,.69,.48,.09,.37,.21,.82,.42,.9,.58,.45,.93,.64,.87,.98,.75,.7,.29,.44,.58,.31,.72,.18,.55,.88,0,.61,.27,.82,.19,.38,.13,.27,.45,.19,.34,.15,.08,.4,.96,.23,.64,.91,.41,.2,.81,.42,.92,.75,.49,.35,.75,.52,.45,.89,.96,.29,.45,.94,.24,.33,.13,.27,.99,.19,.9,.79,.96,.22,.71,.86,.94,.24,.45,.69,.91,.58,.33,.07,.69,.18,.12,.71,.59,.14,.52,.3,.83,.15,.86,.62,.09,.16,.97,.23,.29,.91,.12,.78,.94,.44,.15,.53,.8,.24,.72,.05,.96,.81,.29,.37,1,.64,.27,.07,.69,.15,.97,.64,.11,.8,.98,.07,.88,.73,.37,.89,.55,1,.06,.77,.15,.88,.55,.07,.63,.11,.34,.75,.05,.33,.12,.46,.36,.05,.62,.82,.97,.03,.87,.11,.28,.42,.78,.93,.7,.06,.45,.67,.9,.63,.07,.97,.53,.77,.92,.48,.12,.36,.53,.8,.04,.7,.34,.06,.53,.23,.66,.59,.08,.82,.69,.05,.55,.09,.86,.69,.43,.78,.86,.7,.38,.14,.33,.63,.52,.4,.13,.31,.67,.04,.39,.52,.21,.02,.75,.92,.61,.42,.95,.8,.25,.86,.34,.94,.05,.45,.69,.22,.75,.44,.38,.71,.05,.66,.46,.53,.7,.03,.57,.29,.11,.61,.42,.52,.19,.69,.92,.07,.55,.85,.41,.95,.79,.45,.3,.4,.24,.69,.15,.42,.79,.2,.11,.67,.14,.28,.42,.61,.31,.69,.98,.3,.76,.94,.52,.85,.09,.59,.7,.19,.57,.91,.23,.15,.75,.37,.47,.79,.99,.62,.09,.5,.36,.56,.86,.01,.25,.75,.39,.81,.65,.22,.58,.87,.72,.02,.62,.44,.28,.92,.5,.12,.85,.33,.04,.94,.4,.14,.23,.6,.8,.24,.73,.02,.16,.6,.5,.04,.55,.72,.44,.07,.86,0,.6,.47,.54,.84,.95,.14,.86,.41,.48,.24,.29,.54,.01,.65,.48,.09,.74,.2,.61,.37,1,.31,.91,.55,.06,.86,.58,.4,.21,.09,.31,.82,.4,.87,.49,.93,.76,.33,.11,.44,.64,.22,.14,.73,.32,.12,.58,.5,.01,.86,.93,.51,.36,.6,.3,.56,.95,.34,.48,.85,.73,.92,.24,.81,.41,.57,.15,.22,.68,.27,.41,.78,.95,.29,.84,.68,.49,.41,.09,.65,.58,.24,.05,.38,.84,.23,.13,.97,.3,.77,.51,.96,.31,.1,.46,.03,.39,.29,.18,.82,.97,.3,.17,.67,.76,.6,.99,.44,.8,.26,.89,.31,.73,.38,.92,.34,.52,.39,.99,.3,.91,.23,.67,.94,.28,.17,.73,.36,1,.77,.27,.07,.75,.28,.61,.99,.8,.11,.84,.91,.36,.22,.98,.38,.68,.56,.78,.11,.53,0,.66,.25,.76,.17,.49,.99,.81,.89,.6,.25,.95,.75,.05,.17,.27,.84,.56,.88,.35,.84,.45,.52,.62,.2,.86,.27,.73,.59,.17,.75,.05,.92,.71,.09,.51,.75,.63,.09,.36,.02,.5,.13,.04,.49,.87,.38,.02,.99,.54,.23,.5,.39,.02,.13,.8,.27,.9,.51,.19,.85,.69,.54,.17,.76,.64,.43,.6,.18,.45,.13,.58,.91,.27,.8,.99,.67,.51,.72,.08,.88,.56,.08,.39,.28,.2,.7,.09,.56,.64,.51,1,.08,.48,.13,.63,.87,.54,.09,.8,.35,.1,.58,.81,.48,.92,.57,.22,.15,.9,.42,.48,.68,.09,.36,.17,.64,.58,.73,.16,.78,.55,.29,.03,.93,.27,.85,.72,.17,.81,.45,.92,.31,.64,0,.28,.72,.16,.53,.08,.36,.69,.59,1,.01,.49,.16,.76,.06,.27,.95,.02,.99,.68,.36,.11,.67,.08,.47,.81,.26,.44,.86,.02,.25,.91,.19,.56,.84,.65,.95,.73,.31,.8,.62,.45,.72,.16,.87,.09,.76,.61,.99,.34,.71,.95,.03,.73,.3,.42,.94,.58,.88,.33,.09,.94,.85,.34,.66,.87,.18,.72,.62,.16,.08,.42,.24,.34,.47,.69,.85,.96,.02,.5,.89,.36,.17,.75,.01,.82,.2,.67,.96,.04,.75,.27,.15,.63,.47,.89,.39,.23,.65,.35,.83,.04,.66,.79,.32,.18,.55,.77,.25,.53,.39,.05,.33,.45,.09,.62,.89,.48,.14,.44,.33,.95,.41,.6,.35,.11,.7,.22,.84,.38,.47,.44,.66,.82,.22,.45,.54,.38,.86,.69,.28,.95,.55,.68,.81,.39,.16,.77,.42,.91,.84,.42,.32,.64,.13,.19,.98,.61,.39,.8,.69,.3,.46,.26,.37,.6,.22,.95,.05,.31,.89,.59,.36,.66,.88,.43,.22,.56,.45,.17,.61,.34,.91,.12,.07,.24,.47,.8,.56,.05,.69,.23,.06,.53,.4,.48,.36,.84,.56,.91,.64,.97,.13,.2,.43,.24,.79,.62,.72,.4,.97,.47,.24,.58,.42,.3,.81,.22,.45,.69,.36,.84,.71,.15,1,.02,.52,.11,.29,.43,.49,.11,.61,.95,.86,.01,.92,.71,.88,.97,.27,.69,.93,.84,.17,.35,.78,.65,.05,.51,.14,.88,.04,.73,.96,.43,.58,.13,.96,.04,.86,.31,.94,.14,.77,.23,.09,.64,.2,.47,.37,.12,.6,.31,.49,.09,.56,.3,.22,.52,.97,.87,.56,.74,.38,.28,.12,.53,.98,.14,.75,.09,.87,.17,.55,.69,.12,.52,.8,.19,.05,.29,.51,.15,.73,.03,.86,.38,.11,.8,.47,.66,.77,.41,.01,.71,.18,.27,.49,.79,1,.75,.25,0,.95,.2,.76,.33,.03,.8,.59,.75,.55,.34,.89,.15,.55,.22,.07,.78,.33,.94,.72,.59,.35,.55,.85,.03,.98,.5,.05,.31,.6,.76,.18,.69,.88,.75,.97,.24,.71,.37,.14,.43,.32,.6,.12,.22,.75,.5,.02,.24,.44,.7,.56,.89,.21,.69,.76,.28,.62,.22,.53,.07,.82,.67,.25,.75,.59,.4,.49,.91,.72,.32,.42,.94,.8,.02,.91,.71,.2,.84,.91,.63,.03,1,.8,.06,.16,.72,.01,.48,.78,.66,.89,.43,.03,.36,.93,.67,.81,.01,.44,.92,.24,.65,.4,.47,.74,.96,.23,.8,.92,.32,.65,.25,.58,.97,.19,.28,.61,.86,.99,.36,.61,.94,.41,.58,.31,.15,.95,.68,.44,.09,.48,.72,.16,.4,.29,.91,.03,.67,.47,.07,.3,.91,.68,.6,.85,.12,.05,.77,.08,.93,.29,.13,.57,.2,.75,.26,.44,.85,.95,.41,.63,.15,.55,.84,.04,.46,.75,.53,.83,.05,.47,.56,.82,.36,.59,.75,.13,.95,.08,.28,.85,.55,.08,.99,.48,.88,.37,.75,.3,.91,.2,.36,.07,.64,.17,.01,.62,.85,.55,.15,.58,.34,.85,.44,.07,.55,.26,.73,.38,.6,.45,.67,.37,.27,.43,.1,.94,.19,.07,.73,.63,.21,.53,.58,.3,.48,.77,.37,.84,.15,.96,.08,.89,.69,.37,.57,.07,.48,.78,.88,.7,.43,.05,.94,.55,.14,.22,.5,.76,.11,.88,.04,.46,.64,.53,.82,.29,.61,.91,.24,.84,.52,.65,.11,.95,.19,.56,.99,.83,.42,.02,.52,.19,.39,.51,.84,.15,.47,.62,.8,.42,.89,.65,.95,.37,.08,.22,.48,.01,.27,.36,.19,.64,.28,1,.18,.24,.67,.96,.36,.06,.16,.97,.31,.52,.78,.38,.48,.16,.4,.83,.36,.19,.65,.12,.18,.45,.61,.5,.95,.82,.23,.78,.45,.27,.05,.96,.39,.69,.23,.53,.17,.77,.98,.36,.14,.84,.2,.12,.73,.58,.99,.81,.62,.32,.24,.56,.81,.27,.87,.41,.05,.92,.25,.62,.08,.76,.56,.33,.62,.42,0,.16,.63,.39,.97,.19,.16,.03,.53,.33,.74,.39,.69,.09,.84,.44,.17,.67,.73,.2,.36,.09,.89,.16,.69,.37,.06,.58,.97,.24,.36,.8,.4,.26,.77,.36,.16,.75,.31,.98,.65,.27,.97,.41,.68,.25,.73,.32,.12,.51,.02,.72,.58,.88,.82,.67,.93,.42,.91,.8,.11,.58,.89,.38,.76,.31,.71,.92,.64,.44,.84,.2,.62,.02,.99,.72,.64,.45,.03,.71,.8,.6,1,.02,.72,.09,.42,.71,.32,.98,.88,.37,.73,.18,.51,.77,.03,1,.62,.41,0,.67,.47,.94,.52,.32,.89,.48,.23,.14,.89,.52,.78,.39,1,.49,.12,.77,.18,.68,.13,1,.2,.52,.05,.27,.78,.22,.54,.82,.92,.11,.27,.53,.37,.77,.89,.24,.85,.03,.47,.31,.96,.57,.25,.34,.97,.85,.27,.76,.59,.03,.5,.99,.74,.44,0,.73,.47,.6,.71,.01,.49,.66,.59,.25,.88,.45,.1,.71,.21,.55,0,.9,.09,1,.48,.18,.82,.63,.29,.34,.11,.53,.75,.05,.7,.49,.33,.69,0,.84,.44,.09,.19,.5,.27,.04,.69,.15,.5,.66,.33,.24,.12,.91,.56,.26,.42,.91,.51,.3,.38,.89,.16,.54,.02,.41,.58,.66,.11,.81,.28,.88,.13,.66,.82,.29,.87,.57,.09,.77,.26,.03,.93,.09,.41,.66,.02,.47,.67,.05,.16,.31,.72,.96,.61,.36,.84,.55,.42,.67,.93,.89,.7,.13,1,.35,.47,.68,.75,.6,.94,.45,.63,.16,.58,.78,.9,.63,.73,.03,.81,.53,.59,.03,.49,.98,.41,.23,.8,.34,.16,.82,.2,.93,.3,.14,.86,.95,.21,.11,.94,.78,.06,.55,.81,.36,.9,.74,.37,.83,.28,.59,.69,.25,.92,.4,.17,.65,1,.18,.59,.29,.14,.58,.97,.27,.51,.15,.58,.95,.63,.41,.88,.77,.34,.92,.42,.81,.88,.59,.79,.31,.96,.15,.06,.35,.23,.86,.67,.78,.25,.63,.84,.11,.21,.51,.97,.59,.44,.2,.38,.48,.34,.13,.52,.2,.89,.39,.63,.7,.55,.18,.73,.86,.3,.96,.21,.89,.44,.64,.55,.02,.47,.25,.73,.05,.8,.35,.18,.47,.38,.51,.74,.27,.07,.86,.31,.02,.83,.09,.28,.98,.11,.41,.19,.26,.13,.39,.89,.22,.42,.12,.67,.32,.72,.11,.91,.64,.27,.38,.66,.51,.8,.05,.34,.45,.55,.85,.33,.4,.17,.7,.59,.13,.09,.63,.16,.51,.42,.03,.76,.39,.52,.05,.78,.45,.23,.39,.85,.47,.22,.87,.09,.36,.77,.71,.33,.01,.8,.55,.11,.58,1,.05,.27,.19,.09,.52,.05,.69,.47,.82,.71,.63,.75,.56,.04,.21,.99,.47,.31,.75,.8,.27,.33,0,.72,.91,.56,.93,.05,.74,.96,.3,.72,.07,.36,.97,.42,.8,.35,.59,.51,.13,.35,.6,.81,.08,.25,.83,.33,.9,.51,.29,.1,.88,.59,.03,.84,.07,.62,.42,.78,.15,.53,.24,.39,.67,.48,.71,.36,.67,.53,.87,.5,.67,.09,.62,.93,.8,.87,.2,.62,.47,.84,.53,.07,.59,.88,.12,.27,.58,.93,.67,.27,.03,.7,.48,.91,.28,.96,.42,.49,.31,.97,.78,.64,.22,.85,.12,.97,.71,.53,.87,.73,.04,.92,.67,.78,.42,.63,.2,.91,.44,1,.22,.76,.34,.25,.16,.45,.63,.55,.75,.36,.95,.42,.22,.36,.89,.52,.07,.95,.13,.47,.36,.58,.07,.9,.68,.05,.91,.42,.15,.64,.08,.78,.19,.69,.6,.4,.8,.53,.17,.83,.22,.05,.64,.27,.98,.07,.73,.78,.52,.93,.31,.75,.96,.17,.11,.64,.97,.4,.71,.25,.66,.31,.95,.22,.92,.55,.64,.98,.77,.9,.17,.03,.83,.24,.94,.02,.79,.34,1,.77,.29,.07,.36,.55,.09,.9,.36,0,.21,.79,.44,.94,.36,.72,.64,.41,.15,.78,.89,.57,.12,.63,.02,.23,.77,.88,.7,.25,.1,.94,.34,.56,.65,.31,.22,.08,.32,.63,.13,.55,.28,0,.95,.73,.51,.05,.27,.66,.47,.09,.94,.65,.73,.83,.31,.92,.69,.12,.84,.63,.73,.09,.25,.39,.2,.44,.3,.91,.82,.75,.16,.45,.37,.61,.53,.75,.87,.5,.33,.28,.42,.84,.23,.12,.03,.45,.93,.59,.5,.88,.11,.55,.16,.83,.41,.25,.16,.02,.38,.59,.49,.68,.42,.8,.56,.19,.77,.97,.53,.16,.77,.48,.02,.31,.38,.12,.44,.59,.34,.96,.58,.47,.74,.11,.6,.22,.45,.16,.58,.71,.25,.45,.77,.28,.56,.74,1,.69,.33,.03,.17,.47,.99,.2,.09,.51,.36,.22,.76,.86,.51,.37,.66,.2,.03,.45,.37,.68,.06,.89,.46,.4,.8,.93,.49,.69,.19,.8,.36,.49,.16,.34,.82,.61,.12,.86,.56,.38,.9,.49,.03,.38,.09,.2,.57,.47,.27,.15,.92,.57,1,.76,.6,.84,.7,.64,.08,.32,.55,.97,.22,.14,.28,1,.2,.67,.83,.98,0,.55,.48,.88,.64,.27,.76,.13,.32,.4,.71,.89,.47,.68,.57,.97,.66,.84,.71,.12,.22,.86,.01,.28,.33,.14,.49,.08,.44,.87,.36,.59,.82,.71,.95,.05,.25,.62,.12,.78,.22,.13,.42,.31,.71,.86,.04,.39,.9,.48,.97,.64,.05,.95,.18,.42,.28,.14,.86,.63,.76,.84,.01,.87,.76,.65,.97,.05,.44,.31,1,.1,.83,.56,.91,.59,.84,.55,.27,.16,.75,0,.58,.15,.37,.91,.42,.98,.65,.87,.58,.1,.42,.98,.35,.76,.18,.69,.14,.31,.6,.95,.78,.42,0,.99,.81,.3,.49,.04,.45,.15,.3,.02,.49,.23,.4,.69,.85,0,.67,.83,.48,.08,.39,.11,.45,.58,.15,.79,.34,.71,1,.38,.2,.67,.96,.78,.27,.2,.37,0,.29,.09,.34,.55,.45,1,.36,.6,.76,.92,.69,.88,.64,.37,.81,.21,.69,.11,.4,.18,.5,.67,.86,.74,.5,.36,.69,.87,.65,.98,.18,.52,.95,.66,.8,.2,.11,.83,.33,.69,.5,.86,.65,.55,.39,.23,.5,.27,.39,.55,.33,.25,.47,.82,.2,.61,.71,.16,.3,.73,.34,.14,.2,.76,.99,.62,.25,.95,.67,.27,.05,.78,.09,.3,.05,.24,.7,.92,.22,.69,.49,.03,.31,.8,.44,.85,.2,.71,.51,.87,.34,.67,.07,.4,.87,.71,.82,.67,.95,.55,.78,.12,1,.19,.49,.78,.28,.94,.73,.56,.8,.25,.36,.73,.66,.91,.29,.17,.04,.81,.58,.08,.46,.03,.55,.87,.75,.95,.8,.5,.86,.2,.04,.78,.31,.08,.51,.18,.44,.84,.03,.27,.67,.05,1,.26,.9,.86,.34,.22,.97,.42,.06,.92,.27,.02,.77,.49,.26,.57,.1,.3,0,.59,.27,.41,.54,.21,.82,.11,.02,.48,.78,.92,.07,.61,.7,.11,.92,.59,.15,.72,.9,.05,.58,.48,.42,.06,.97,.64,.44,.02,.37,.51,.83,.13,.54,.83,.22,.56,.63,.75,.46,.81,.55,.4,.13,.85,.25,.92,.62,.95,.08,.56,.36,.12,.25,.59,.17,.75,.53,.61,.12,.37,.29,.22,.07,.88,.35,.58,.89,.03,.56,.38,.11,.45,.33,.03,.64,.95,.84,.03,.21,.42,.06,.61,.52,.43,.87,.33,.89,.64,.14,.42,.09,.6,.2,.4,.74,.92,.28,.64,.83,.91,.39,.13,.59,.25,.53,.93,.79,.57,.45,.51,.65,.08,.61,.57,.16,.29,.82,.16,.55,.61,.35,.06,.84,.42,.69,.34,.76,.52,.85,.91,.02,.75,.38,.6,.31,.95,.11,.67,.35,.97,.45,.19,.85,.03,.38,.55,.28,.35,.94,.75,.89,.25,.49,.8,.31,.91,.71,.06,.42,.35,.74,.45,.86,.97,.52,.19,.14,.98,.31,.05,.77,.47,.57,.06,.41,.51,.25,.91,.64,.8,.08,.45,.94,.84,.24,.93,.2,.96,.52,.59,.41,.18,.46,.27,.75,.65,.31,.95,.62,.18,.75,.89,.48,.15,.53,.31,.95,.56,.76,.94,.7,.13,.23,.73,.53,.25,.97,.69,.31,.51,.65,.16,.05,.59,.53,.13,.22,.67,.56,.79,.99,.09,.75,.17,.39,.12,.33,.77,.03,.73,.4,.8,.01,.72,.47,.67,1,.45,.89,.16,.76,.92,.2,.82,.95,.45,.09,.67,.47,.97,.25,.89,.73,.19,.43,.74,.17,.86,.24,.73,.49,.77,1,.65,.08,.79,.23,.14,.62,0,.59,.73,.09,.23,.55,.87,.18,.59,.93,.13,.4,.33,.28,.69,.41,.84,.63,.25,.95,.67,.35,.75,.2,.67,.76,0,.48,.99,.73,.3,.14,.37,.05,.47,.78,.65,0,.76,.95,.72,.84,.09,.51,.43,.14,.87,.52,.81,.22,.31,.11,.42,.76,.63,.09,.49,.24,.35,.78,.29,.94,.04,.8,.38,.19,.75,.88,.11,.98,.78,.38,.69,.97,.43,.47,.03,.34,.27,.66,.44,.32,.48,.7,.89,.2,.96,.44,.23,.92,.44,.88,.64,.35,.24,.12,.7,.21,.53,.38,.03,.64,.47,.16,.25,.71,.31,.18,.59,.14,.45,.53,.84,.29,.57,.01,.52,.64,.09,.37,.28,.21,.88,.44,.51,.69,.38,.84,.95,.34,.16,.85,.64,.47,.76,.96,.3,.64,.02,.77,.07,.82,.95,.01,.57,.18,.73,.43,.09,.16,.99,.84,.12,.37,.32,.18,.41,.87,.52,.7,.64,.56,.27,.41,.1,.33,.85,.48,.04,.63,.2,.97,.8,.25,.7,.01,.47,.99,.68,.58,.89,.24,.39,.78,.87,.13,.4,0,.55,.64,.45,.11,.6,.48,.03,.54,.34,.44,.27,.87,.31,0,.82,.75,.94,.88,.2,.78,.02,.92,.85,.08,.59,.82,.1,.67,.29,.11,.51,.19,.09,.95,.78,.4,.07,.81,.95,.68,.31,.55,.07,.88,.37,.55,.09,.78,.85,.41,.07,.69,.05,1,.39,.79,.31,.81,.92,.69,.58,.12,.63,.16,.95,.05,.29,.47,.18,.53,.42,.98,.37,.13,.32,.07,.22,.49,.71,.17,.56,.65,.46,.35,.89,.08,.51,.87,.81,.54,.29,.47,.92,.59,.87,.67,.56,.04,.22,.94,.09,.82,.98,.72,.89,.58,.15,.26,.31,.55,.89,.35,.04,.59,.93,.38,.09,.56,.36,.02,.72,.96,.05,.69,.19,.98,.58,.82,.89,.2,.73,.31,.92,.85,.28,.95,.22,.81,.64,.09,.55,.18,.36,.26,.6,.13,.72,.47,.55,.63,.22,.28,.52,.35,.72,.53,.88,.59,.98,.69,.29,.55,.89,.52,.31,.61,.46,.25,.12,1,.75,.27,.67,.89,.99,.52,.3,.64,.93,.32,.2,.61,.89,.47,.23,.13,.42,.05,.86,.75,.41,.32,.72,.91,.59,.75,.11,.69,.78,.27,.02,.51,.73,.8,.57,.92,.45,.28,1,.11,.22,.78,.28,.67,.39,.24,0,.36,.65,.09,.53,.04,.8,.27,.17,.62,.34,.77,.42,.31,.15,.66,.2,.45,.98,.7,.39,.77,.13,.67,.47,.16,.33,.67,.28,.76,.84,.2,.48,.14,.56,.35,.51,.67,.29,.47,.09,.38,1,.56,.05,.64,.42,.7,.58,.05,.71,.5,.93,.77,.64,.11,.53,.4,.05,.95,.36,.14,.69,.99,.41,0,.47,.17,.79,.02,.35,.75,.44,.14,.02,.73,.2,.85,.09,.76,.91,.4,.49,.79,.02,.45,.34,.19,0,.72,.88,.48,.77,.26,.08,.71,.59,.99,.55,.27,.49,.94,0,.81,.27,.56,.16,.81,.24,.91,.08,.62,.84,.93,.68,.43,.06,.37,.84,.23,.87,.44,.73,.53,.16,1,.76,.6,.95,.71,.83,.24,.73,.33,.45,.92,.71,.82,.48,.1,.92,.55,0,.5,.34,.06,.78,.53,.03,.95,.43,.28,.95,.55,.78,.89,.61,.17,.43,.94,.33,.81,.22,.45,.91,.09,.74,.16,.69,.26,.83,.51,.15,.23,.78,.14,.36,.89,.16,.41,.22,.88,.44,1,.84,.67,.25,.85,.29,.79,.44,.16,.77,.86,.96,.27,.39,.83,.05,.25,.84,.5,.63,.98,.36,.64,.42,.58,.19,.68,.34,.22,.62,.16,.76,.68,.42,.25,.56,.13,.37,.53,.92,.05,.36,.84,.72,.17,.35,.56,.2,.64,.49,.08,.35,.99,.41,.47,.31,.67,.21,.33,.15,.27,.98,.12,.64,.03,.58,.37,.05,.91,.64,.44,.11,.33,.18,.48,.42,.15,.99,.17,.51,.09,.39,1,.27,.2,.73,.61,.27,.95,.84,.64,.28,.9,.66,.15,.84,.6,.73,.04,.22,.13,.5,.97,.08,.52,.67,.61,.86,.73,.03,.4,.84,.94,.63,.42,.05,.76,.3,.87,.53,.02,.47,.99,.3,.69,.03,.57,.29,.07,.33,.16,.5,.73,.07,.58,.89,.09,.64,.3,.58,.15,.67,.45,.56,.64,.94,.31,.7,.25,.13,.93,0,.29,.84,.04,.94,.11,.86,.56,.95,.09,.89,.8,.04,.97,.67,.82,.3,.42,.65,.23,.02,.8,.91,.7,.12,.76,.87,.42,.71,.64,.03,.57,.87,.44,.11,.56,.48,.85,.63,.75,.51,.8,.93,.7,.31,.83,.25,.06,.8,.55,.84,.04,.91,.56,.77,.67,.86,.22,.02,.56,.67,.06,.39,.84,.69,.12,.77,.41,.09,.21,.35,.49,.24,.09,.4,.86,.47,.33,.81,.6,.25,.79,.04,.37,.09,.98,.3,.57,.23,.33,.54,.14,.92,.63,.38,.96,.6,.74,.82,.25,.55,.8,.73,.13,.48,.69,.78,.91,.63,.44,.2,.93,.35,.7,.23,.52,.07,.75,.91,.33,.97,.09,.16,.78,.09,.4,.55,.8,.51,.73,.39,.62,.53,.79,.27,.38,.3,.61,.51,.35,.28,.58,.21,.07,.73,.19,.87,.5,.41,.63,.3,.45,1,.38,.05,.95,.2,.28,.84,.75,.15,1,.69,.78,.89,.04,.31,.38,.16,.29,.45,.13,.19,.48,.57,.39,.94,.65,.23,.69,.34,.27,.05,.45,.61,.31,.73,.89,.49,.79,.97,.45,.33,.2,.58,.47,.71,.82,.58,.98,.72,.34,.64,.96,.55,.7,.02,.39,.72,.2,.89,.29,.48,.17,.67,.79,.51,.01,.89,.8,.19,.69,.47,.09,.33,.22,.42,.64,.09,.34,.96,.38,.86,.22,.56,.01,.36,.83,.65,.03,.48,.37,.81,1,.41,.84,.2,.6,.27,.71,.38,.58,.84,.45,.89,.22,.33,.96,.1,.23,.45,.99,.7,.49,.06,.8,.16,.45,.72,.91,.4,.49,.96,.56,.11,.68,.94,.11,.58,.06,.23,.54,.3,.8,.45,.53,.1,.23,.36,.3,.01,.39,.22,.72,.47,.93,.7,.05,.55,.91,.66,.77,.85,.17,.31,.45,.75,.09,.6,.92,.4,.15,.95,.83,.44,.13,.35,.16,.22,.03,.53,.92,.04,.96,.31,.14,.41,0,.8,.46,.2,.11,.27,.92,.16,.32,.99,.45,.57,.72,.8,.6,.39,.11,.96,.64,.36,.3,.59,.25,.02,.85,.15,.69,.94,.04,.86,.19,.5,.66,.27,.97,.41,.11,.29,1,.15,.28,.56,.85,.19,.03,.58,.37,.11,.53,0,.87,.48,.23,1,.04,.71,.62,.13,.67,.91,.58,.31,.16,.01,.64,.91,.24,1,.2,.85,.11,.32,.78,.62,.28,.89,.33,.2,.48,.71,.88,.82,.67,.61,.14,.9,.68,.96,.72,.51,.81,.92,.64,.33,.07,.56,.2,.83,.63,.41,.24,.98,.1,.34,.71,.04,1,.36,.88,.44,.82,.69,.2,.55,.05,.67,.29,.65,.87,.58,.68,.85,.37,.65,.23,.87,.62,.69,.93,.14,.58,.89,.67,.42,.78,.61,.86,.65,.12,.34,.94,0,.22,.91,.47,.2,.08,.75,.43,.95,.53,.77,.9,.56,.49,.28,.77,.59,.43,.91,.1,.05,.62,.74,.88,.6,.51,.77,.69,.96,.11,.61,.73,.28,.69,.96,.79,.42,.81,.67,.12,.31,.53,.11,.26,.84,.47,.03,.79,.71,.88,.38,.2,.75,.42,.58,.68,.01,.56,.83,.14,.03,.37,.71,.06,.78,.98,.25,.36,.17,.41,.74,.02,.25,.34,.4,.63,.07,.6,.11,.53,.86,.78,.99,.14,.35,.75,.83,.33,.03,.52,.43,.89,.59,.08,.53,.26,.17,.02,.49,.91,.33,.18,.93,.46,.95,.07,.42,.76,.15,.27,.81,.44,.18,.53,.23,.37,.28,.52,.82,.04,.25,.52,.09,.47,.04,.24,.78,.42,.09,.88,.31,.71,.83,.62,.85,.16,.07,.35,.63,.42,.25,.97,.36,.67,.12,.23,.7,.33,.81,.53,.33,.2,.25,.05,.89,.41,.22,.46,.33,.92,.49,.23,.16,.63,.07,.34,.95,.59,.76,.36,.94,.78,.41,.55,.2,.28,.51,.11,.6,.83,.53,.07,.31,.77,.39,.65,.51,.25,1,.47,.82,.53,.41,.12,.54,.63,.05,.95,.49,.87,.56,.08,.87,.18,.31,.85,.47,.25,.17,.66,.44,.53,.88,.05,.15,.48,.68,.79,.27,.65,.22,.84,.77,.63,.97,.31,.58,.75,.41,.8,.56,.22,.75,.52,.3,.97,.1,.49,.73,.59,.03,.76,.95,.09,.67,.75,.4,.33,1,.73,.35,.79,.94,.55,.67,.17,.51,.63,.56,.06,.36,.28,.48,.69,.99,.83,.12,.19,.71,0,.1,.84,.54,1,.39,.76,.16,.47,.94,.67,.78,.48,.31,.07,.64,.77,.15,.87,.06,.76,.39,.92,.55,.24,.18,.04,.67,.5,.23,.7,.01,.34,.95,.81,.41,.93,.47,.27,.88,.14,.49,.96,.27,.2,.92,.75,.66,.11,.22,.58,.3,.87,.75,.45,.82,.28,.2,.36,.8,.64,.47,.77,.94,.2,.73,.97,.38,.01,.31,.22,.66,.27,.97,.6,.86,.18,.97,.11,.5,.33,.4,.13,.47,.67,.84,.09,.27,.66,.11,.38,0,.82,.2,.56,.4,.89,.05,.98,.32,.39,.82,.44,.2,.92,.09,.16,.58,.89,.2,.26,.4,.86,.32,.98,.83,.38,.78,.17,.99,.53,0,.24,.57,.31,.47,.88,.6,.8,.47,.2,.31,.8,.01,.58,.93,.29,.06,.11,.64,.39,.85,.58,.95,.35,.56,.66,.4,.58,.83,.3,.47,.75,.84,.42,.91,.83,.17,.57,.88,.64,.07,.72,.15,.65,.05,.34,.62,.73,.9,.09,.82,.45,.05,.58,.36,.87,.92,.67,.01,.67,.22,.09,.92,.58,.7,.11,.99,.16,.27,0,.66,.4,.05,.67,.56,.82,.75,.93,.5,.38,.77,.11,.28,.55,.37,.77,.67,.93,.03,.73,.9,.21,.38,.04,.98,.48,.86,.69,.91,.34,.65,.88,.6,.25,.69,.2,.55,.89,.62,0,.56,.85,.63,.49,.69,0,.56,.12,.71,.49,.08,.22,.72,.27,.12,.89,.43,.75,.91,.38,.79,.08,.67,.93,.33,.38,.95,.74,.61,.08,.49,.2,.65,.84,.42,.55,.99,.13,.72,.2,.01,.83,.24,.09,.99,.19,.03,.69,.09,.88,.58,.28,.07,.31,.45,1,.08,.5,.25,.56,.86,.23,.75,.99,.19,.41,.24,.67,.6,.13,.86,.41,.28,.06,.43,.17,.97,.37,.89,.33,.51,.01,.42,.76,.31,.5,.92,.55,.84,.35,.49,.11,.9,.47,.15,.09,.57,.2,.91,.42,.72,.05,.45,.06,.28,.85,.56,.35,.05,.55,.93,.44,.58,.16,.29,.53,.14,.23,.45,.05,.15,.35,.84,.47,.11,.28,.16,.73,.33,.41,.24,.8,.37,.97,.44,.63,.76,.05,.35,.59,.45,.03,.49,.67,.31,.11,.62,.16,.73,.52,.22,.06,.53,.16,.23,.67,.44,.95,.87,.37,.14,.72,.31,.78,.24,.88,.51,.28,.67,.46,.77,.31,.7,.5,.59,.95,.15,.36,.71,.48,.81,.13,.73,.2,.38,.78,.92,.43,.32,.51,.07,.8,.56,.01,.53,.36,.31,.97,.77,.19,.64,.8,.52,.73,.27,.47,.62,.8,.25,.67,.88,.19,.61,.73,.39,.24,.11,.61,.86,.2,.31,.25,.61,.82,.72,.01,.51,.25,.64,.85,.92,.62,.53,.15,.22,.67,.8,.28,.76,.7,.24,.77,.93,.44,.63,1,.78,.71,.95,.45,.77,.66,.95,.78,.69,.51,.99,.13,.91,.28,.07,.8,.33,.92,.18,.97,.81,.66,.94,.84,.58,.94,.2,.8,.47,.9,.34,.97,.84,.3,.69,.56,.86,.04,.36,.16,.26,.56,.98,.52,.19,.59,0,.34,.45,.95,.12,.57,.91,.16,.87,.35,.27,.78,.44,.22,0,.97,.6,.68,.53,.85,.29,.66,.12,.18,.97,.6,.48,.38,.29,.85,.95,.76,.47,.05,.68,.49,.93,.13,.57,.34,.84,.08,.55,.14,.41,.96,.34,.54,.1,.91,.03,.67,.95,.29,.79,.66,1,.54,.4,.95,.31,.66,.81,.98,.35,.08,.22,.79,.41,1,.44,.91,.49,.17,.11,.52,.87,.02,.37,.73,.06,.2,.51,.3,.11,.55,.02,.28,.4,.06,.34,.24,.82,.04,.58,.71,.53,.2,.11,.68,.38,.25,.53,.14,.31,.08,.4,.73,.06,.53,.27,.03,.4,.11,.61,.45,.99,.76,.11,.48,.83,.77,.69,.07,.8,.05,.94,.47,.81,.7,.09,.63,.85,.37,.05,.62,.41,.8,.05,.91,.52,.63,.83,.17,.34,.25,.95,.04,.59,.81,.47,.01,.67,.83,.14,.92,.72,.63,.1,.16,.83,.2,.55,.36,.02,.87,.23,.97,.03,.69,.92,.73,.06,.82,.14,.27,.83,.44,.32,.8,.16,.48,.41,.02,.8,.07,.73,.13,.44,.61,.09,.16,.7,.5,.31,.66,.02,.76,.29,.09,.62,.95,.41,.31,.64,.09,.48,.28,.84,.6,.38,.88,.63,.23,.97,.59,.18,.87,.56,.43,.62,.78,.47,.15,.88,.43,.84,.57,.49,.08,.88,.42,.76,.28,.17,.65,.37,1,.84,.69,.56,.77,.17,.36,0,.25,.41,.92,.55,.31,.47,.61,.38,.35,.64,.27,.89,.55,.22,.78,.34,.49,.73,.22,.47,.12,.57,.65,.32,.75,.93,.41,.06,.87,.41,.15,.34,.9,.53,.35,.75,.28,.2,.44,.07,.26,.42,.58,.91,.65,.29,.83,.3,.7,.42,.64,.2,.38,.31,.22,.51,.63,.7,.59,.97,.19,.63,.51,.91,.08,.56,.23,.35,.62,.18,.29,.9,.36,.49,.27,.78,.42,.96,.55,.15,.87,.69,.36,0,.85,.67,.25,.99,.58,.84,.68,.17,.91,.09,.8,.35,.73,.13,.85,.53,.71,.98,.09,.19,.37,.97,.31,.61,.75,0,.28,.95,.73,.59,.2,.52,.81,.95,.78,.42,.13,.6,.09,.22,.95,.51,.69,.89,.8,.16,.66,.22,.01,.91,.16,.85,.22,.74,.1,.16,.39,.95,.02,.27,.18,1,.85,.69,.97,.18,.4,.04,.13,.25,.53,.73,.66,.78,.48,.2,.71,.26,.99,.1,.58,.89,.66,.97,.51,.78,.34,.03,.43,.11,.96,.61,.17,.47,.81,.51,.89,.66,.44,1,.19,.3,.38,.47,.06,.78,.25,.38,.75,.64,.95,.88,.49,.85,.56,.78,.02,.86,.94,.57,.12,.85,.2,.47,.28,.58,.78,.2,.47,.58,.13,.75,.18,.39,.96,.34,.5,.44,.04,.53,.9,.47,.38,.24,0,.77,.29,.85,.67,.03,.25,.12,.97,.45,.69,.16,.35,.04,.99,.7,.1,.56,0,.25,.51,.76,.33,.88,.64,.28,.08,.6,.47,.33,.64,.99,.38,.69,.25,.94,.45,.58,.85,.49,.66,.6,.75,.89,.55,.64,.03,.31,.33,.88,.71,.49,.96,.61,.45,.08,.31,.58,.1,.91,.62,.05,.84,.42,.52,.34,.02,.73,.16,.88,.29,.99,.75,.51,.77,.39,.06,.91,.1,.59,.05,.77,.11,.56,.87,.01,.92,.75,.14,.87,.56,.01,.84,.31,.16,.42,.69,.05,.96,.24,.67,.41,.18,.64,.05,.73,.34,.64,.93,.09,.51,.98,.29,.8,.06,.89,.45,.01,.55,.12,.75,.7,.27,.18,.69,.05,.62,.81,.34,.47,.16,.5,.93,.55,.8,.65,.36,.51,.24,.79,.84,.65,.46,.25,.35,.46,.89,.71,.92,.2,.45,.39,.04,.82,.91,.22,.53,.85,.07,.73,.09,.58,.51,.73,.02,.37,.99,.3,.06,.35,.45,.14,.43,.36,.1,.53,.62,.78,.23,.85,.16,.69,.89,.21,1,.83,.38,.75,.45,.31,.18,.64,.8,.16,.54,.39,.6,.09,.49,.64,.14,.2,.86,.55,.25,.76,.28,.36,.16,.91,.26,.35,.78,.69,.23,.6,.32,.66,.42,1,.22,.47,.78,.1,.25,.33,.42,.16,.75,.53,.33,.99,.25,.39,.91,.01,.8,.41,.19,.88,.33,.71,.41,.54,.27,.73,.64,.25,.94,.62,.84,.99,.4,.29,.12,.96,.64,.92,.59,.73,.09,.42,.2,.91,.06,.86,.11,.4,.53,.32,.12,.91,.72,.62,.13,.33,.65,.03,.97,.72,.53,.16,.35,.72,.12,.95,.29,.48,.88,.81,.19,.32,.63,.07,.69,.2,.81,.87,.23,.72,.8,.91,.76,.45,.16,.06,.43,.58,.3,.38,.79,.02,.34,.69,.23,0,.96,.56,.73,.87,.09,.95,.3,.85,.94,.24,.7,.83,.35,.59,.08,.32,.69,.98,.66,.83,.45,.69,.6,.42,.51,.07,.47,.54,.95,.08,.28,.7,.08,.58,.54,.95,.71,.81,.62,.89,.28,.8,.01,.45,.83,.52,.6,.7,.31,.45,.75,.64,.03,.13,.61,.92,.34,.87,.8,.08,.41,.15,.35,.55,.78,.89,.73,.53,.21,.09,.37,.25,.31,.84,.48,.71,.29,.56,.96,.62,.03,.93,.78,.37,.06,.86,.21,.42,.84,.57,.27,.12,.9,.62,.44,.78,.02,.4,.59,.23,.43,.34,.09,.95,.81,.53,.91,.42,.61,.52,.95,.08,.31,.58,.2,.92,.85,.64,1,0,.75,.11,.51,.63,.48,.16,.9,.52,.13,.37,.25,.47,.23,.63,.7,.45,.11,.56,.39,.01,.25,.95,.42,.9,.49,.01,.4,.22,.54,.95,.02,.21,.97,.14,.82,.36,.18,.83,.49,.91,.75,.34,.87,.19,.01,.59,.49,.1,.96,.62,.12,.7,.77,.1,.2,.14,.99,.08,.23,.56,.48,.95,.22,.65,.09,.18,.49,.29,.89,.53,.01,.22,.09,.49,.17,.27,.42,.88,.8,.66,.98,.02,.6,.14,.43,.75,.2,.27,.49,.71,.2,.52,.27,.8,.55,.97,.08,.38,.78,.69,.47,.25,.99,.31,.67,.9,.78,.16,.94,.64,.77,.26,.45,.11,.25,.77,0,.16,.38,.64,.02,.5,.24,.68,.27,.35,.5,.22,.86,.93,.25,.74,.96,.31,.6,.78,.64,.84,.93,.04,.41,.76,.08,.26,.78,.17,.93,.88,.5,.73,.79,.18,.64,.14,.56,.89,.11,.31,.73,.86,.64,.28,.9,.76,0,.62,.37,.16,.25,.44,.65,.41,.28,.94,.2,.38,.47,.24,.91,.42,.27,.95,.37,.48,.57,.83,.91,.37,.8,.42,.84,.31,.55,1,.67,.44,.59,.96,.72,.63,.34,.94,.67,.56,.75,.01,.49,.14,.45,.77,.27,.95,.05,.82,.67,.36,.84,.09,.59,.98,.65,.44,.16,.7,.49,.62,.16,.33,.02,.84,.09,.55,.19,.51,.06,.69,.53,.01,.4,.58,.69,.85,.33,.48,.98,.29,.72,.83,.34,.96,.73,.4,.09,.55,.84,.67,.45,.58,.4,.19,.05,.86,.42,.21,.08,.31,.7,.58,.99,.53,.87,.36,.49,.73,.33,.64,.12,.22,.04,.38,.28,.85,.76,.45,.25,.67,.17,.47,.35,.71,.59,.44,.25,.72,.97,.58,.02,.81,.13,.91,.73,.42,.84,.05,.71,.86,.2,.55,.06,.62,.87,.78,.67,.32,.02,.7,.27,.16,.05,.75,.4,.07,.82,.2,.1,.28,.78,.44,.89,.05,.38,.1,.97,.34,.62,.92,.18,.36,.88,.66,.39,.49,.12,.91,.42,.78,.25,.31,.02,.9,.09,.28,.78,.24,.97,.87,.52,.39,.66,.79,.45,.95,.31,.24,.61,.84,.09,.89,.17,.37,.74,.09,.67,.44,.85,.55,.48,.14,.8,.62,.04,.94,.18,.29,.08,.15,.66,.83,.53,.12,.69,.45,.9,.15,.5,.12,.33,.19,.67,.01,.97,.63,.08,.44,.55,.84,.67,.99,.53,.71,.33,.04,.99,.8,.4,.54,.04,.23,.09,.94,.12,.33,.45,.86,.69,.53,.33,.04,.61,.15,.53,.78,.02,.38,.64,1,.35,.71,.05,.26,.11,.42,.19,.64,.98,.55,.69,.9,.51,.25,.63,.75,.91,.36,.16,.85,.26,.6,.8,.45,.86,.22,.71,.3,.56,.73,.13,.53,.2,.33,1,.03,.62,.16,.89,.47,.76,.62,.35,.93,.45,.04,.59,.44,.74,.18,.92,.27,.13,.85,.37,.75,.97,.3,.21,.52,1,.05,.59,.91,.54,.12,.27,.2,.08,.89,.31,.44,.91,.77,.38,.72,.89,.97,.33,.77,.36,.27,.78,.98,.56,.37,.75,.81,.24,.84,.44,.56,.2,.83,.25,.39,.95,.31,.6,.42,.07,.94,.2,.65,.49,.61,.12,.86,.75,.98,.46,.66,.53,.81,.22,.09,.28,.95,.77,.56,.99,.26,.65,.33,.57,.29,.12,.79,.51,.16,.45,.89,.95,.58,.5,.88,.11,.33,.45,.21,.95,.13,.34,.55,.01,.49,.66,.08,.53,.2,.72,.31,.16,.54,.08,.82,.05,.47,.94,.25,.69,.8,.58,.24,.71,.37,.55,.12,.82,.22,.56,.84,.67,.15,.89,.29,.07,.71,.35,.01,.71,.58,.05,.48,.12,.43,.71,.35,.78,.45,.28,.18,.83,.34,.95,.78,.58,.67,.17,.52,.25,.13,.58,.46,.24,.53,.02,.46,.93,.62,.15,.34,.04,.86,.42,.64,.04,.72,.92,.12,.3,.72,.89,.05,.75,.19,.1,.8,.25,.47,.13,.88,.36,.24,.95,.31,.42,.78,.18,.38,.84,.05,.62,.75,.38,.17,.47,.22,.34,.81,.11,.95,.89,.45,.75,.04,.9,.58,.65,.2,.36,.73,.07,.77,.4,.8,.59,.01,.66,.83,.44,.96,.71,.33,.58,.99,.75,.43,.93,.01,.67,.88,.42,.98,.42,.63,.83,0,.44,.87,.07,.46,.93,.66,.29,.96,.4,.51,.02,.28,.39,.72,.51,.22,.8,.55,.98,.48,.6,.89,.19,.67,.9,.79,.6,.06,.65,.23,.94,.7,.42,.62,.02,.72,.39,1,.05,.87,.7,.35,.82,.06,.63,.82,.69,.2,.87,.07,.52,.73,.22,.61,.11,.96,.27,.55,.37,.8,.47,.52,.15,.6,.82,.48,.37,.91,.61,.68,.55,.78,.03,.7,.17,.64,.08,.61,.25,.9,.51,.3,1,.43,.58,.84,.66,.08,.45,.85,.5,.19,.43,.61,.83,.23,.31,.42,.1,.82,.52,.85,.3,.23,.64,.17,.89,.28,.71,.37,.05,.2,.82,.88,.23,.05,.33,.13,.49,.78,.36,.58,.21,.76,.25,.13,.35,.6,.75,.15,.63,.31,.19,.77,.03,.85,.14,.71,.78,.17,.99,.32,.64,.92,.47,.15,.83,.22,.41,.29,.8,.53,.04,.27,.15,.87,.53,.83,.12,.47,.06,.91,.5,.27,.47,.35,.22,.59,.48,.96,.19,.92,.44,.35,.11,.58,.25,.44,.67,.84,.29,.91,.2,.34,.49,.76,.08,.23,.99,.05,.69,.43,.28,.89,.21,.73,0,.32,.4,.96,.3,.46,.84,.53,.92,.34,.05,.71,.15,.67,.24,.89,.02,.13,.78,.91,.63,0,.29,.74,.06,.15,.36,.53,.67,.96,.76,.28,.04,.15,.45,.96,.5,.93,.11,.41,.79,.5,.59,.29,.12,.41,.48,.64,.9,.84,.61,.27,.95,.12,.31,.67,.53,.91,.18,.97,.29,.39,.94,.81,.07,.45,.58,.24,.63,.31,.91,.47,.55,.09,.01,.37,.65,.31,.05,.75,.07,.95,.16,.35,.42,.98,.74,.31,.41,.02,.77,.57,.31,.77,.15,.86,.09,.75,.82,.41,.01,.67,.11,.27,.73,.16,.78,.91,.39,.75,.97,.01,.36,.78,.53,.69,.83,.15,.65,.61,.39,.85,.32,.95,.03,.65,.55,.44,.86,.18,.84,.08,.58,.76,.38,.13,.69,.43,.81,.56,.41,.09,.49,.82,.56,.31,.27,.4,.72,.35,.56,.91,.23,.69,.98,.11,.86,.16,.5,.69,.63,.89,.58,.67,.01,.35,.53,.23,.97,.16,.91,.76,.65,.95,.16,.8,.28,.55,.18,.05,.69,.47,.84,.02,.73,.37,.8,.64,.51,.11,.69,.53,.89,.35,.5,.74,.95,.37,.06,.67,.86,.75,.81,.23,.97,.58,.89,.53,.69,.47,.65,.84,.59,.5,.66,.19,.47,.91,.27,.68,.98,.22,.38,.64,.93,.53,.92,.14,.72,.38,.85,.55,.9,.48,.65,.31,.55,.16,.11,.58,.48,.66,.14,.97,.03,.43,.95,.29,.74,.19,.78,.56,.4,.15,.79,.09,1,.24,.66,.52,.2,.94,.02,.25,.84,.5,.2,.97,.86,.76,.35,.19,.64,.97,.52,.08,.99,.22,.8,.66,.36,.5,.78,.45,.61,0,.37,.22,1,.4,.34,.13,.75,.83,.62,.67,.05,.47,.2,.55,.31,.5,0,.7,.37,.07,.46,.91,.38,.8,.16,.95,.58,.1,.44,.06,.89,.22,.37,.25,.72,.15,.87,.01,.41,.54,.15,.28,.22,.42,.53,.12,.71,.19,.44,.35,.13,.89,.27,.05,.22,.11,.82,.05,.96,.6,.37,.11,.44,.81,.6,.3,.05,.2,.62,.27,.78,.31,.46,.6,.24,.01,1,.05,.84,.34,.8,.26,.92,.06,.41,.24,.33,.56,.9,0,.52,.11,.48,.24,.71,.92,.29,.48,.59,.35,.74,.44,.88,.31,.68,.55,.98,.09,.3,.63,0,.25,.94,.71,.04,.44,.75,.6,.16,.45,.12,.86,.56,.03,.19,.27,.34,.89,.56,.84,.08,.78,.2,.86,.27,.45,.16,.88,.3,.84,.69,.39,.08,.84,.56,.22,.98,.74,.85,.65,.25,.55,.34,.27,.44,.23,.7,.31,.77,.56,.84,.03,.62,.3,.99,.2,.69,.82,.93,.46,.62,.98,.3,.89,.46,.05,.64,.99,.21,.78,.58,.93,.76,.89,.34,.54,.69,.24,.87,.17,.54,0,.88,.73,.51,.42,.37,.07,.52,.98,.15,.09,.77,.37,.42,.2,.72,.48,.63,.86,.18,.7,.83,.62,.75,.22,.8,.35,.64,.84,.98,.06,.62,.83,.4,.2,.69,.05,.82,.11,.15,.61,.8,.29,.74,.38,.15,.68,.53,.44,.61,.15,.88,.35,.22,.83,.67,.89,.52,.31,.95,.88,.73,.93,.64,.73,.19,.43,.53,.03,.66,.59,.98,.04,.75,.51,.36,.01,.81,.99,.26,.77,.93,.42,.11,.52,.33,.12,1,.05,.62,.74,.92,.84,.6,1,.15,.45,.75,.96,.44,.51,.66,.1,.25,.59,.16,.8,.71,.04,.17,.58,.76,.85,.29,.73,.51,.01,.31,.4,.52,.43,.29,.79,.14,.43,.75,.64,.96,.47,.24,.14,.98,.81,.87,.69,.91,.22,.82,.72,.93,.53,.82,.6,.1,.95,.04,.44,.3,.58,.36,.91,.06,.5,.7,.12,.41,.27,.67,.33,.17,.53,.02,.88,.94,.55,.29,.97,.5,.39,.05,.46,.05,.64,.78,.92,.23,.06,.83,.31,.55,.11,.91,.29,.01,.35,.73,.08,.66,.15,.55,.4,.05,.13,.96,.29,.72,.92,.47,.31,.53,.4,.13,.96,.61,.58,.44,.16,.12,.62,.36,.18,.67,.8,.28,.6,.42,.69,.83,.13,.51,.05,.27,.4,.02,.64,.28,.11,.18,.81,.76,.33,.47,.73,.39,.09,.33,.84,.39,.67,.24,.36,.07,.4,.81,.63,.18,.72,.07,.17,.64,.99,.01,.51,.31,.08,.74,.34,.42,.69,.08,.31,.59,0,.45,.58,.4,.04,.33,.67,.16,.92,.41,.23,.53,.75,.98,.01,.51,.16,.94,.27,.58,1,.17,.53,.8,.89,.42,.75,.23,.65,.13,.45,.23,.64,.91,.73,.19,.95,.88,.5,.35,.89,.41,.74,.38,.96,.68,.78,.48,.39,.55,.94,.22,.42,.27,.84,.36,.24,.51,.66,.85,.57,.36,.16,.89,.07,.24,.81,.73,.28,.09,.23,.91,.52,.72,.47,.29,.9,.56,.03,.95,.2,.87,.08,.33,.37,.18,.66,.83,.53,.92,.88,.33,.58,.92,.05,.36,.91,.83,.02,.97,.24,.52,.59,.94,.02,.45,.98,.6,.16,.93,.45,.85,.98,.67,.82,.25,.6,.37,.84,.94,.26,.61,.2,.91,.76,.55,.22,.75,.28,.13,.33,.65,.26,.49,.14,.27,.77,.73,.33,.67,.15,.8,.23,.66,.4,.76,.45,.03,.85,.72,.09,.38,.03,.58,.99,.31,.81,.37,.77,.71,0,.36,.25,.82,.59,.22,.14,.56,.03,.19,.67,.13,.47,.2,.04,.65,.71,.14,.81,.61,.48,.76,.08,.61,.99,.76,.47,.22,.01,.62,.25,.69,.77,.61,.93,.45,.53,.85,.76,.33,.67,.95,.02,.82,.08,.48,.37,.72,.45,.78,.53,.95,.47,.89,.76,.31,.11,.7,.5,.22,.67,.47,.55,.23,.62,.15,.52,.64,.89,.75,.13,.28,.8,.17,.71,.87,.55,.24,.08,.36,.26,.55,.03,.47,.91,.72,.19,.56,.05,.83,.52,.11,.86,.16,.39,1,.81,.68,.87,.95,.75,.84,.98,.45,0,.57,.09,.85,.36,.45,.58,.87,.09,.66,.22,.36,.64,.31,.51,.96,.22,.7,.11,.49,.59,.07,.53,.16,.86,.56,.11,.69,.34,.43,.7,.28,.99,.6,.83,.25,.58,.93,.33,.18,.99,.27,.04,.86,.18,.32,.57,.03,.88,.3,.09,.41,.89,.8,.46,.41,.12,.34,.19,0,.67,.14,.42,.05,.22,.37,.6,.25,.69,1,.22,.65,.05,.34,.14,.65,.22,.01,.58,.44,.25,.15,.8,.08,.84,.29,.73,.09,.44,.96,.21,.33,.42,.17,.48,.93,.63,.33,.52,.11,.29,.67,.73,.6,.14,.87,.41,.76,.31,.11,.45,.71,.4,.99,.44,.3,.6,.47,.64,.44,.1,.51,.18,.02,.44,.09,.62,.35,.88,.49,.94,.2,.96,.07,.73,.26,.33,.97,.83,.58,.9,.24,.75,.61,.8,.29,.41,.91,.19,.87,1,.41,.3,.94,.45,.49,.97,0,.78,.85,.36,.1,.49,.9,.02,.74,.55,.81,.47,.37,.69,.52,.98,.71,.93,.45,.18,.69,.6,.95,.75,.09,.52,1,.84,.66,.5,.89,.38,.8,.5,1,.8,.13,.44,.86,.77,.12,.42,.85,.91,.26,.56,.85,.71,.29,.94,.55,.96,.36,.6,.4,1,.14,.91,.8,.29,.69,.56,.05,.81,.67,.06,.56,.42,.07,.84,.77,.37,.47,.9,.79,.32,.51,.94,.2,.06,.62,.89,.25,.78,.14,.73,0,.68,.95,.05,.24,.92,.35,.62,.37,.55,.22,.7,.19,.65,.25,.6,.43,.29,.63,.12,.91,.54,.18,0,.49,.14,.06,.46,.35,.16,.65,.85,0,.67,.35,.25,.58,.66,.05,.88,.17,.75,.08,.64,.45,.54,.76,.31,.71,.42,.37,.88,.08,.62,.91,.3,.1,.41,.64,.12,.25,.55,.84,.16,.34,.54,.19,.29,.02,.56,.25,.96,.06,.3,.62,.25,.69,.58,.93,.53,.18,.33,.53,.58,.16,.78,.38,.98,.08,.42,.79,.16,.04,.85,.73,.28,.52,0,.64,.39,.51,.05,.77,.88,.47,1,.36,.79,.22,.71,.96,.25,.16,1,.01,.19,.45,.04,.71,.65,.34,.58,.97,.51,.33,.07,.59,.36,.89,.2,.34,.77,.58,.83,.48,.75,.88,.28,.79,.94,.42,.05,.8,.16,.72,.55,.78,.48,.82,.44,.62,.75,.4,.8,1,.7,.04,.93,.49,.56,.24,.44,.75,.12,.8,.09,.76,.24,.61,.33,.91,.25,.21,.15,.92,.06,.22,.17,.64,.28,.13,.22,.73,.55,.85,.22,.47,.88,.39,.77,.48,.05,.42,.64,.85,.73,.92,.17,.39,.75,.58,.8,.94,.1,.35,.04,.3,.64,.73,.01,.92,.28,.08,.48,.7,.03,.61,.52,.35,.69,.65,.45,.07,.89,.66,.77,.25,.55,.18,.94,.35,.14,.27,.11,.63,.29,.92,.03,.61,.45,.69,.59,.81,.29,.63,.98,.16,.25,.84,.78,.12,.42,.83,.65,.95,.27,.45,.8,.53,.14,.7,.02,.22,.14,.98,.7,.06,.53,.34,.75,1,.09,.34,.88,.02,.24,.37,.05,.29,.95,.25,.67,.41,.53,.21,.84,.37,.09,.78,.63,.93,.52,.91,.47,.34,.55,.82,.38,.48,.59,.96,.4,.68,.61,.84,.99,.78,.53,.68,.93,.4,.16,.04,.78,.53,.72,.01,.98,.27,.92,.79,.23,.05,.6,.32,.78,.64,.08,.45,.2,.16,.53,.77,.45,.83,.09,.39,.69,.45,.83,.64,.72,.24,.31,.89,.23,.11,1,.22,.34,.56,.12,.18,.36,.95,.11,.83,.62,.41,.56,.67,.85,.4,.15,.48,.86,.35,.21,.49,.12,.36,.73,.52,.84,.07,.53,.45,0,.28,.73,.19,.48,.11,.56,.85,.07,.41,.28,.97,.36,.65,.43,.1,.58,.47,.16,.91,.58,.44,.52,.84,.4,.17,.99,.67,.87,.72,.56,.09,.18,.88,.31,.75,.27,.63,1,.33,.15,.05,.28,.39,.19,.64,.99,.14,.05,.87,.71,.02,.82,.28,.37,.55,.44,.07,.34,.83,.02,.49,.97,.64,.27,.19,.33,.11,.62,.68,.12,.58,.98,.44,.38,.12,.47,.87,.25,.51,.85,.67,.42,.9,.23,.98,.61,.25,.89,.2,.97,.36,.13,.54,.95,.43,.77,.84,.51,.37,.94,.82,.45,.86,.5,.69,.31,.47,.02,.73,.95,.2,.51,.78,.7,.56,.09,.66,.78,.95,.88,.07,.92,.22,.41,.33,.76,.9,.38,.98,.63,.05,.93,.3,.76,.16,.61,.67,.89,.46,.56,.85,.78,.23,.35,.87,.64,.25,.11,.2,.69,.25,.64,.74,.59,.5,.15,.22,.46,.91,.35,.6,.06,.81,.47,.05,.72,.42,.89,.56,.67,.84,.01,.73,.27,.44,.65,.17,.33,.78,.1,.52,.73,.03,.2,.94,.42,.59,.26,.66,.76,.38,.91,.95,.6,.84,.22,.41,.36,.52,.17,.76,.88,.53,.23,.97,.03,.71,.36,.95,.02,.32,.72,.15,.49,.76,.11,.56,.03,.44,.78,.86,.18,.66,.06,.27,.59,.01,.75,.16,.28,.94,.04,.6,.77,.9,.23,.83,.3,.09,.89,0,.24,.97,.82,.27,.03,.42,.3,.64,.45,.13,.69,.97,.6,.19,.66,.22,.52,.87,.42,.69,.39,.99,.3,.06,.75,.18,.1,.3,.49,.95,.71,.02,.81,.4,.73,.86,.05,.95,.11,.42,.29,.08,.93,.41,.83,0,.76,.52,.98,.13,.58,.89,.19,.53,.82,.33,.22,.76,.52,.95,.09,.78,.91,.56,.29,.47,.64,.95,.18,.88,.72,.63,.12,.9,.2,.33,.08,.45,.11,.68,.42,.53,.79,.9,.71,.02,.84,.27,.04,.69,.83,.57,.31,.75,.12,.25,.78,.63,.55,.05,.42,.87,.33,.52,.71,.24,.61,.3,.02,.57,.74,.47,.87,.09,.66,.51,.71,.56,.08,.4,.16,.53,.12,.6,.41,.68,.45,.31,.63,.36,.44,.18,.59,.7,.23,.53,.77,.86,.27,.05,.5,.09,.31,.78,.11,.34,.8,.02,.21,.64,.49,.92,.24,.82,.62,.03,.89,.17,.61,.22,.53,.95,.34,.63,.48,.36,.55,.82,.89,.25,.76,.56,.65,.27,.71,.45,.22,.34,.69,.4,.11,.25,.66,.08,.95,.42,.16,.33,.6,.5,.22,.76,.98,.16,.85,.24,.42,.33,.49,.28,.76,.53,.86,.72,.56,.8,.23,.77,.07,.29,.16,.1,.96,.6,.32,.64,.92,.35,.07,.19,.39,.95,.59,.49,.19,.37,.81,.27,.94,.64,.18,.82,.91,.09,.98,.47,.41,.92,.35,.25,.96,.34,.78,.11,.37,.23,.82,.96,.27,.87,.35,.7,.49,.17,.8,.93,.56,.06,.75,.94,.49,.84,.99,.15,.04,.59,.37,.8,.9,.42,.71,.94,.48,.58,.25,.9,.55,.12,.78,.36,.44,.55,.99,.39,.66,.46,.12,.75,.44,.06,.18,.78,.28,.9,.2,.06,.7,.36,.61,.07,.33,.18,.95,.06,.64,.85,.28,.78,.97,.47,.73,.04,.47,.61,.86,.25,.7,.36,.04,.42,.09,.58,.37,.05,.67,.78,.89,.09,.36,.05,.42,.94,.02,.51,.86,.27,.63,.99,.55,.44,.25,.75,.46,.15,.43,.5,.61,.8,.46,.85,.56,.07,.86,1,.51,.11,.74,.46,.02,.6,.38,.15,.75,.65,.22,.8,.15,.69,.42,.17,.87,.44,.61,.91,.32,.64,.67,.45,.09,1,.89,.03,.27,.73,.14,.22,.87,.52,.13,.06,.35,.67,.42,.95,.2,.64,.24,.56,.03,.83,.17,.66,.05,.73,.45,.86,.27,0,.69,.13,.33,.71,.27,.77,.37,.31,.91,.67,.59,.93,.11,.75,.6,.42,.95,.5,.16,1,.85,.6,.38,.82,.17,.94,.53,.02,.61,.36,.88,.3,.8,.12,.55,.91,.07,.81,.63,.89,.69,.49,.71,.94,.54,0,.59,.24,1,.68,.17,.63,.29,.38,.15,.92,.37,0,.83,.67,.4,.06,.87,.2,1,.78,.24,.93,.05,.14,.28,.68,.43,.7,.16,.6,.36,.23,.97,.29,.69,.45,.34,.88,.08,.84,.54,0,.63,.58,.27,.99,.03,.75,.15,.5,0,.55,.76,.21,.62,.54,.85,.41,.49,.8,.31,.66,.25,.38,.6,.91,.3,.51,.71,.12,.31,.99,.63,.38,.27,.89,.42,.33,1,.19,.61,.94,.75,.57,.22,.92,.08,.55,1,.83,.1,.48,.25,.4,.01,.52,.68,.22,.1,.78,.4,.73,.45,.12,.52,.75,.49,.11,.45,.2,.84,.13,.58,.24,.98,.36,.66,.2,.45,.97,.16,.27,.85,.3,.19,.81,.37,.16,.45,.84,.56,.8,.47,.22,.97,.69,.6,.21,.71,.5,.78,.19,.94,.53,.81,.69,.55,.13,.28,.66,.38,.74,.98,.33,.24,0,.3,.91,.86,.58,.76,.12,.83,.55,.05,.27,.57,.44,.29,.75,.92,.09,.5,.72,.23,.54,.42,.87,.17,.82,.31,.05,.42,.33,.11,.6,.98,.07,.62,.42,.89,.7,.82,.21,.79,.07,.41,.87,.76,.45,.2,.09,.96,.55,.77,.14,.69,.39,.56,.11,.39,.8,.05,.87,.45,.69,.02,.62,.2,.75,.86,.69,.47,.99,.34,.85,.28,.57,.01,.21,.27,.91,.04,.31,.24,.62,.79,.33,.93,.39,.7,.18,.49,.72,0,.27,.77,.5,.35,.56,.03,.44,.08,.62,.27,.97,.73,.33,.11,.27,.72,.34,.83,.06,.46,.09,.81,.33,.12,.28,.63,.09,.36,.3,.01,.41,.89,.49,.56,.21,.61,.78,.89,.58,.75,.47,.17,.06,.5,.41,.96,.2,.79,.92,.73,.11,.98,.33,.83,.19,.67,.37,.81,.27,.06,.99,.71,.37,.94,.65,.79,.95,.19,.7,.35,.23,.91,.03,.17,.53,.02,.47,.15,.59,.93,.02,.53,.15,.84,.73,.51,.22,.01,.82,.49,.05,.26,.84,.47,.3,.52,.6,.16,.23,.4,.51,.95,.36,.04,.31,.82,.17,.09,.93,.64,.53,.89,.82,.63,.77,.68,.95,.87,.4,.72,.05,.65,.53,.92,.05,.8,.33,.6,.95,.43,.06,.73,.62,.95,.78,.91,.53,.11,.88,.68,.19,.41,.94,.03,.58,.13,.89,.55,.96,.61,.41,.94,.84,.47,.22,.97,.65,.83,.71,.18,.95,.03,.82,.11,.45,.09,.52,.79,.4,.67,.33,.89,.65,.01,.31,.62,.51,.38,.19,.61,.47,.23,.41,.88,.04,.95,.57,.64,.36,.26,.53,.12,.5,.27,.71,.46,.07,.84,.58,.46,.73,.98,.33,.85,.25,.95,.66,.37,.22,.68,.28,.43,.65,.34,.6,.94,.31,.62,.9,.69,.94,.16,.66,.96,.35,.78,.94,.72,.29,.16,.58,.91,.64,.22,.55,.4,.75,.44,.2,.69,.32,.08,.44,.36,.18,.58,.14,.99,.5,.25,.09,.29,.64,.44,.92,.13,.84,.64,.22,.86,.13,.36,.25,.69,.32,.42,.55,.06,.5,.62,.91,.66,.51,.8,.42,.31,.77,.13,.23,.7,.56,.01,.78,.44,.15,.5,.26,.61,.44,.33,.93,.5,.37,.2,.96,.25,.04,1,.22,.78,.44,.73,.16,.87,.42,.04,.78,.89,.05,.77,.56,.31,.47,.13,.7,.44,.84,.1,.61,.8,.17,.08,.88,.53,.92,.15,.3,.8,.39,.12,.65,.44,.56,.74,.3,.5,.82,.59,.91,.96,.02,.81,.11,.45,.4,.19,.78,.44,.33,.2,.02,.74,.25,.09,.49,.05,.88,.8,.43,.11,.49,.77,.86,.61,.03,.26,.12,.99,.46,.56,.15,.86,.51,.05,.83,.35,.18,.76,.86,.39,.8,.2,.24,.56,.37,.16,.48,.32,.69,.45,.17,.84,.02,.73,.24,.82,.3,.76,.17,.25,.39,.19,.67,.27,.64,.51,.07,.73,.34,.64,.89,.7,.57,.06,.9,.77,.08,.7,.24,.66,.86,.71,.33,.65,.13,.71,.6,.09,.25,.36,.59,.97,.67,.25,.55,.27,.69,.13,.97,.62,.8,.25,.9,.18,.01,.74,.91,.41,.96,.56,.35,.25,.41,.66,.01,.52,.19,.6,.76,.07,.39,.1,.89,.16,.1,.38,.06,.49,.17,.26,.87,.71,1,.11,.54,.04,.6,.8,.55,.87,.42,.58,.84,.63,.33,.55,.67,.25,.99,.03,.29,.47,.95,.8,.37,.86,.07,.65,.95,.27,.75,.45,.29,.62,.91,.56,.67,.13,.99,.53,.69,.05,.89,.72,1,.81,.08,.93,.55,.6,.98,.49,.89,.36,.97,0,.47,.88,.08,1,.83,.03,.92,.87,.42,1,.18,.11,.3,.19,.38,.99,.34,.2,.53,.87,.16,.59,.28,.02,.55,.86,.49,.4,.88,.53,.95,.82,.48,.07,.14,.82,.94,.43,.5,.37,.19,.72,.01,.53,.38,.77,.56,.49,.22,.28,.68,.64,.02,.78,.74,.6,.98,.86,.69,.26,.87,.94,.2,.69,.45,.98,.79,.72,.64,.32,.76,.53,.66,.06,.57,.31,.85,.27,.72,.39,.99,.06,.67,.15,.38,.22,.95,.07,.19,.74,.43,.35,.13,.7,.19,.53,.58,.73,.24,.39,.73,.02,.87,.64,.22,.7,.02,.44,.22,.35,.74,.06,.33,.76,.47,.27,.02,.58,.42,.75,.06,.34,.14,.27,.62,.09,.67,.41,.59,.73,.33,.55,.49,.37,.57,.33,.27,.79,.52,.4,.93,.5,.81,.09,.47,.69,.38,.8,.42,.1,.99,.8,.44,.16,.93,.29,.33,.18,.02,.67,.22,.3,.52,.34,.63,0,.75,.84,.25,.94,.43,.09,.98,.33,.64,.94,.35,.05,.83,.47,.22,.94,.12,.44,.31,.08,.41,.15,.46,.31,.81,.61,.03,.53,.27,.47,.22,.84,.92,.44,.36,.23,.77,.16,.66,.92,.11,.18,.47,.3,.52,.91,.05,.75,.47,.37,.85,.9,.6,.55,.83,.89,.33,.64,.03,.29,.94,.5,.18,.6,.35,.1,.95,.8,.47,.09,.95,.61,.44,.58,.91,.41,.61,.2,.36,.64,.25,.89,.28,.81,.71,.42,.8,.18,.53,.27,.93,.21,.8,.65,.09,.16,.78,.12,.65,.01,.61,.85,.71,.04,.62,.75,.88,.56,.01,.28,.91,.5,.67,.36,.22,.75,.05,.8,.55,.73,.64,.37,.93,.76,.88,.7,.16,.22,.9,.58,.15,.53,.84,.67,.6,.16,.25,.86,.14,.55,.76,.14,.52,.85,.28,.17,.48,.77,.91,.55,.01,.65,.48,.24,.34,.67,.14,.9,.01,.56,.11,.14,.83,.95,.45,.88,.4,.49,.83,.64,.78,.24,.84,.6,.8,.27,.58,.71,0,.29,.14,.23,.69,.41,.09,1,.45,.13,.63,.81,.29,.98,.55,.4,.14,.51,.33,.89,.27,.78,0,.2,.83,.12,.53,.96,.8,.13,.5,.19,.63,.46,.9,.06,.51,.92,.74,.83,.14,.05,.43,.94,.25,.71,.95,.2,.38,.94,.47,.24,.16,.55,.31,.28,.13,.16,.96,.74,.61,.21,.06,.53,.96,.6,.67,.09,.47,.99,.12,.83,.43,.58,.04,.42,1,.31,.47,.09,.34,.65,.29,.21,.81,.45,.05,.79,.67,.41,.99,.33,.71,.37,.56,.67,.84,.25,.63,.35,.98,.77,.11,.88,.95,.78,.51,.4,.75,.61,.29,.71,.49,.01,.28,.6,.05,.23,.58,.36,.01,.95,.12,.34,.44,.97,.13,.89,.51,.63,.8,.99,.03,.49,.26,.78,.87,.35,.71,.05,.44,.08,.78,.67,.24,.98,.73,.16,.51,.67,.97,.39,.24,.88,.05,.73,.44,.85,.7,.98,0,.54,.21,.67,.33,.03,.25,.47,.36,.67,.52,.29,.87,.42,.49,.55,.71,.82,.07,.34,.7,.89,.45,.94,.66,.41,.52,.09,.34,.77,.25,.88,.11,.32,.41,.19,.89,.25,.31,.51,.19,.09,.24,.66,.53,.78,.69,.92,.82,.49,.05,.73,.36,.95,.52,.59,.19,.89,.07,.25,.64,.01,.9,.09,1,.03,.72,.19,.83,.38,.17,.58,.39,.04,.85,.18,.99,.34,.8,.9,.21,.64,.75,.13,.79,.99,.08,.91,.42,.65,.54,.74,.03,.19,.67,.35,.25,.43,.11,.33,.76,.62,.15,.72,.51,.21,.56,.84,.91,.49,.31,.86,.61,.08,.6,.41,.72,.11,.3,.44,.65,.71,.35,.29,.61,.09,.4,.33,.75,.13,.95,.84,.6,.44,.99,.63,.91,.61,.83,.16,0,.63,.08,.89,.15,.29,.56,.75,.96,0,.22,.53,.82,.71,.23,.84,.55,.96,.62,.44,.72,.47,.84,.56,.73,.64,0,.8,.69,.95,.87,.47,.12,.37,.03,.25,.41,.98,.13,.91,.57,0,.72,.29,.35,.47,.58,.81,.92,.49,.75,.34,.39,.47,.54,.3,.05,.69,.45,.74,.2,.62,.29,.69,.08,.23,.47,.41,.07,.53,.92,.37,.43,.69,.28,.51,.73,.18,.27,.87,.49,.61,.82,.05,.96,.72,.46,.87,.57,.37,.96,.29,.09,.94,.42,.13,.25,.73,.18,.02,.45,.36,.82,.05,.23,.56,.84,.78,.54,.09,.49,.92,.16,.24,.9,.47,.84,.44,.25,.36,.15,.78,.11,.31,.04,.17,.37,.97,.67,.32,.8,.25,.44,.93,.19,.49,.39,.63,.77,.08,.35,.04,.94,.45,.15,.01,.37,.18,.83,.03,.95,.35,.08,.42,.89,.55,.36,.58,.28,.81,.19,.87,.6,.7,.19,.58,.68,.33,.19,.42,.92,.1,.84,.73,.16,.42,.23,.11,.55,.18,.61,.86,.14,.95,.58,.93,.28,.07,.98,.47,.13,.45,.53,.88,.15,.66,.98,.33,.23,.84,.17,.65,.87,.13,.58,1,.36,.08,.92,.4,.3,.53,.83,.16,.65,.27,.2,.03,.83,.66,.49,0,.75,.67,.33,.59,.95,.58,.92,.28,.78,.99,.48,.89,.15,.04,.99,.22,.81,.41,.67,.77,.05,.58,.18,.64,.04,.72,.89,.67,.42,.81,.55,.73,.25,.51,.77,.18]),Zu=new Float32Array([0,.5,.13,.63,.03,.53,.16,.66,.75,.25,.88,.38,.78,.28,.91,.41,.19,.69,.06,.56,.22,.72,.09,.59,.94,.44,.81,.31,.97,.47,.84,.34,.05,.55,.17,.67,.02,.52,.14,.64,.8,.3,.92,.42,.77,.27,.89,.39,.23,.73,.11,.61,.2,.7,.08,.58,.98,.48,.86,.36,.95,.45,.83,.33]),_u=ft([new Uint8Array([0,0,0,0]),new Uint8Array([0,0,0,180]),new Uint8Array([180,0,0,0]),new Uint8Array([180,0,0,180]),new Uint8Array([0,180,180,180]),new Uint8Array([180,180,180,0]),new Uint8Array([180,180,180,180]),new Uint8Array([180,180,180,255]),new Uint8Array([255,180,180,180]),new Uint8Array([255,180,180,255]),new Uint8Array([180,255,255,255]),new Uint8Array([255,255,255,180]),new Uint8Array([255,255,255,255])]),Ku=new Uint8Array([0,255,0]),qu=new Uint8Array([0,255,255]),Qu=Wu({name:"SC-core-color-engine"}),FilterEngine=function(){return this.cache=null,this.actions=[],this},Ju=FilterEngine.prototype=rc();Ju.type="FilterEngine",Ju.action=function(t){const{identifier:e,filters:i,image:n}=t,{actions:s,theBigActionsObject:r}=this;let o,a,l,c;const h=ru(e);if(h)return h;for(s.length=0,o=0,a=i.length;o0?255:0;return r},Ju.buildImageGrid=function(t){const{cache:e}=this;t||(t=e.source);const{width:i,height:n}=t;if(i&&n){const t=`grid-${i}-${n}`,e=ru(t);if(e)return e;const s=[];let r,o,a,l=0;for(a=0;a0;l-=e)for(c=0;c0;h-=e)h0;l-=e)for(c=0;c0;h-=e)h=c&&(t=c-i-1),e+(n=yt(n)?n:1)>=h&&(e=h-n-1),t<1&&(t=1),e<1&&(e=1),t+i>=c&&(i=c-t-1),e+n>=h&&(n=h-e-1);const o=t+i,a=e+n;(s=yt(s)?s:0)<0&&(s=0),s>=o&&(s=o-1),(r=yt(r)?r:0)<0&&(r=0),r>=a&&(r=a-1);const l=`alphatileset-${c}-${h}-${t}-${e}-${i}-${n}-${s}-${r}`,u=ru(l);if(u)return u;const d=[];let f,p,g,m,y,b,S,k,A;for(m=r-a,y=h;m=0&&k=0&&b=0&&k=0&&e=0&&k=0&&e=0&&k=0&&e=o&&(t=o-1),(e=yt(e)?e:1)<1&&(e=1),e>=a&&(e=a-1),(i=yt(i)?i:0)<0&&(i=0),i>=t&&(i=t-1),(n=yt(n)?n:0)<0&&(n=0),n>=e&&(n=e-1);const s=`simple-tileset-${o}-${a}-${t}-${e}-${i}-${n}`,r=ru(s);if(r)return r;const l=[];let c,h,u,d,f,p,g,m,y;for(u=n-e,d=a;u=0&&g=0&&f=h&&(f=h-1),r.substring?p=Rt(parseFloat(r)/100*u):yt(r)&&(p=r),p<0?p=0:p>=u&&(p=u-1),yt(o)&&(g=o);let y=`${m}-tileset-${h}-${u}-${l}-${c}-${d}-${f}-${p}-${g}`;m===or?y+=`-${t.join(Se)}`:m===Wr&&(y+=`-${t}-${a}`);const b=ru(y);if(b)return b;if(m===Zr&&1===l&&1===c)return au(y);const S=ku(),k=[f,p],A=[0,0];let v,C=[];const P=[],x=[];let w,O,D,F,R,T,H,E,I=Ol;m===Pn&&c/d<1.05&&(c=1.05*d);const B=dt(l/2),L=dt(c/2),$=2*d,M=Rt(c/d*d);let X,Y,G,j,z,N,V,W,U,Z=0,_=0;switch(m){case Zr:if(I=`rect-grid-points-${h}-${u}-${l}-${c}-${f}-${p}`,v=ru(I),!v){const t=[];for(H=p-2*u+L,E=p+2*u+L;H-l&&R-c&&H=0&&D=0&&wd)continue;j=w*h+D,x[j]||(x[j]=[]),x[j].push(Z)}Z++}if(!P.length)return P;for(w=0;w{[R,H,G]=P[t],U=S.zero().add(A).subtract([R,H]).getMagnitude(),(z<0||U=0&&C[z].push(V);return Au(S),C=C.filter((t=>null!=t)),ft(C),ou(y,C),C}return[]},Ju.buildHorizontalBlur=function(t,e){yt(e)||(e=0);const i=t.length,n=t[0].length,s=`blur-h-${n}-${i}-${e}`,r=ru(s);if(r)return r;const o=[];let a,l,c,h,u;for(l=0;l=0&&c=0&&c=t&&(i=t-1),null==n||n<0?n=0:n>=e&&(n=e-1);const c=`matrix-${o}-${a}-${t}-${e}-${i}-${n}`,h=ru(c);if(h)return h;const u=l.length,d=[],f=[];let p,g,m,y,b,S,k,A,v;for(m=-n,y=e-n;m=u&&(v-=u),A.push(ft(v));f.push(ft(A))}return ft(f),ou(c,f),f},Ju.checkChannelLevelsParameters=function(t){const e=function(t,e=!1){if(t.toFixed)return t<0?[Ku]:t>255?[qu]:yt(t)?[[0,255,t]]:e?[qu]:[Ku];if(t.substring&&(t=t.split(Se)),mt(t)){if(!t.length)return t;if(mt(t[0]))return t;if((t=t.map((t=>parseInt(t,10)))).sort(((t,e)=>t-e)),1==t.length)return[[0,255,t[0]]];const e=[];let i,n,s,r;for(s=0,r=t.length;s0)for(r=1-i,o=0,a=n.length;o{for(m=f[e%4],y=0,b=t.length;y=0&&i=0&&n255*(t+e*(1-t)),[r,o,a]=this.getInputAndOutputLines(t),{width:l,height:c,data:h}=r,{data:u}=o,{width:d,height:f,data:p}=a,{opacity:g=1,blend:m=Ol,offsetX:y=0,offsetY:b=0,lineOut:S}=t,k=(t,e)=>1===e?255:0===t?0:255*(1-At(1,(1-e)/t)),A=(t,e)=>0===e?0:1===t?255:255*At(1,e/(1-t)),v=(t,e)=>t255*et(t-e),P=(t,e)=>255*(t+e-2*e*t),x=(t,e)=>t<=.5?t*e*255:255*(e+(t-e*t)),w=(t,e)=>t>e?t:e,O=(t,e)=>255*(t+e),D=(t,e)=>t*e*255,F=(t,e)=>t>=.5?t*e*255:255*(e+(t-e*t)),R=(t,e)=>255*(e+(t-e*t)),T=(t,e)=>{const i=e<=.25?((16*e-12)*e+4)*e:It(e);return t<=.5?255*(e-(1-2*t)*e*(1-e)):255*(e+(2*t-1)*(i-e))},H=(t,e,i,n)=>e*t+n*i*(1-e);let E,I,B,L,$,M,X,Y,G,j,z,N,V,W,U,Z,_,K,q,Q,J;switch(m){case"color-burn":for(I=0;I=t&&f<=n&&p>=e&&p<=s&&g>=i&&g<=r){S=!0;break}}s[c]=f,s[h]=p,s[u]=g,s[d]=S?0:n[d]}l?this.processResults(i,e,1-o):this.processResults(this.cache.work,i,o)},[qe]:function(t){const[e,i]=this.getInputAndOutputLines(t),n=e.data,s=i.data,r=n.length,{opacity:o=1,lowRed:a=0,lowGreen:l=0,lowBlue:c=0,highRed:h=255,highGreen:u=255,highBlue:d=255,lineOut:f}=t,p=h-a,g=u-l,m=d-c;let y,b,S,k,A,v,C,P,x;for(x=0;xm?255:(n-g)/y*255},[i,n]=this.getInputAndOutputLines(t),s=i.data,r=n.data,o=s.length,{opacity:a=1,red:l=0,green:c=255,blue:h=0,opaqueAt:u=1,transparentAt:d=0,lineOut:f}=t,p=kt((l+c+h)/3,(255-l+(255-c)+(255-h))/3),g=d*p,m=u*p,y=m-g;let b,S,k,A,v,C,P,x;for(x=0;x=0&&i=0&&ne*t*n+n*i*(1-e),S=(t,e,i)=>e*t*i,k=(t,e,i)=>e*t*(1-i),A=(t,e,i,n)=>e*t*(1-n)+n*i*e,v=(t,e,i,n)=>e*t*(1-n)+n*i,C=(t,e,i)=>e*t*i,P=(t,e,i)=>i*t*(1-e),x=(t,e,i,n)=>e*t*(1-n)+n*i*(1-e),w=(t,e,i,n)=>e*t+n*i*(1-e);let O,D,F,R,T,H,E,I,B,L,$,M;switch(p){case"source-only":s.data.set(l);break;case"source-atop":for(L=0;L=0&&(D=O+1,F=D+1,R=F+1,H=T+1,E=H+1,I=E+1,$=l[R]/255,M=d[I]/255,c[O]=b(l[O],$,d[T],M),c[D]=b(l[D],$,d[H],M),c[F]=b(l[F],$,d[E],M),c[R]=255*($*M+M*(1-$)));break;case Po:for(L=0;L=0&&(D=O+1,F=D+1,R=F+1,I=T+3,$=l[R]/255,M=d[I]/255,c[O]=S(l[O],$,M),c[D]=S(l[D],$,M),c[F]=S(l[F],$,M),c[R]=$*M*255);break;case xo:for(L=0;L=0&&e(T,O,d);break;case"destination-atop":for(L=0;L=0&&(D=O+1,F=D+1,R=F+1,H=T+1,E=H+1,I=E+1,$=l[R]/255,M=d[I]/255,c[O]=C(d[T],$,M),c[D]=C(d[H],$,M),c[F]=C(d[E],$,M),c[R]=$*M*255);break;case vi:for(L=0;L=0&&(D=O+1,F=D+1,R=F+1,H=T+1,E=H+1,I=E+1,$=l[R]/255,M=d[I]/255,c[O]=P(d[T],$,M),c[D]=P(d[H],$,M),c[F]=P(d[E],$,M),c[R]=M*(1-$)*255);break;case ti:break;case"xor":for(L=0;Lr&&(r=n);switch(d){case"lowest":return o;case"highest":return r;default:return dt(o+(r-o)/2)}},[i,n]=this.getInputAndOutputLines(t),s=i.data,r=n.data,o=s.length,{opacity:a=1,includeRed:l=!1,includeGreen:c=!1,includeBlue:h=!1,includeAlpha:u=!0,operation:d=fs,lineOut:f}=t;let p=t.width;(!yt(p)||p<1)&&(p=3),p=dt(p);let g=t.height;(!yt(g)||g<1)&&(g=3),g=dt(g);let m=t.offsetX;(!yt(m)||m<1)&&(m=1),m=dt(m);let y=t.offsetY;(!yt(y)||y<1)&&(y=1),y=dt(y);const b=this.buildMatrixGrid(p,g,m,y,i),S=dt(o/4);let k,A,v,C,P;for(P=0;P=0&&i=0&&n=0?(x=dt(C+(127-d[F+v])/127*m),w=dt(P+(127-d[F+R])/127*y),k?O=x<0||x>=o||w<0||w>=a?-1:4*(w*o+x):(x<0&&(x=0),x>=o&&(x=o-1),w<0&&(w=0),w>=a&&(w=a-1),O=4*(w*o+x)),e(O,D,l)):e(D,D,l);A?this.processResults(s,n,1-f):this.processResults(this.cache.work,s,f)},[Li]:function(t){const e=function(t,e,i){let n=0;for(let s=0,r=e.length;s=C-l&&O<=C+l&&D>=P-l&&D<=P+l&&F>=x-l&&F<=x+l&&(c?r[v]=0:(r[S]=127,r[k]=127,r[A]=127))));u?this.processResults(n,i,1-a):this.processResults(this.cache.work,n,a)},[_i]:function(t){const[e,i]=this.getInputAndOutputLines(t),n=e.data,s=i.data,r=n.length,{opacity:o=1,red:a=0,green:l=0,blue:c=0,alpha:h=255,excludeAlpha:u=!1,lineOut:d}=t;let f,p,g;for(f=0;f>8&255,c=o>>16&255,h=o>>24&255,C=a*n[6],P=l*n[6],x=c*n[6],w=h*n[6],S=C,k=P,A=x,v=w,H=n[0],E=n[1],I=n[4],B=n[5],T=0;T>8&255,f=o>>16&255,p=o>>24&255,g=u*H+a*E+S*I+C*B,m=d*H+l*E+k*I+P*B,y=f*H+c*E+A*I+x*B,b=p*H+h*E+v*I+w*B,C=S,P=k,x=A,w=v,S=g,k=m,A=y,v=b,a=u,l=d,c=f,h=p,i[F]=S,i[F+1]=k,i[F+2]=A,i[F+3]=v,F+=4,O++;for(O--,F-=4,D+=r*(s-1),o=t[O],a=255&o,l=o>>8&255,c=o>>16&255,h=o>>24&255,C=a*n[7],P=l*n[7],x=c*n[7],w=h*n[7],S=C,k=P,A=x,v=w,u=a,d=l,f=c,p=h,H=n[2],E=n[3],T=s-1;T>=0;T--)g=u*H+a*E+S*I+C*B,m=d*H+l*E+k*I+P*B,y=f*H+c*E+A*I+x*B,b=p*H+h*E+v*I+w*B,C=S,P=k,x=A,w=v,S=g,k=m,A=y,v=b,a=u,l=d,c=f,h=p,o=t[O],u=255&o,d=o>>8&255,f=o>>16&255,p=o>>24&255,o=(i[F]+S<<0)+(i[F+1]+k<<8)+(i[F+2]+A<<16)+(i[F+3]+v<<24),e[D]=o,O--,F-=4,D-=r}},[h,u]=this.getInputAndOutputLines(t),d=h.data,f=u.data,{width:p,height:g}=h,{opacity:m=1,radius:y=1,lineOut:b}=t,S=new Uint8ClampedArray(d),k=new Uint32Array(S.buffer),A=new Uint32Array(k.length),v=new Float32Array(4*kt(p,g)),C=function(t){t<.5&&(t=.5);const c=ut(.527076)/t,h=ut(-c),u=ut(-2*c),d=(1-h)*(1-h)/(1+2*c*h-u);return e=d,i=d*(c-1)*h,n=d*(c+1)*h,s=-d*u,r=2*h,o=-u,a=(e+i)/(1-r-o),l=(n+s)/(1-r-o),new Float32Array([e,i,n,s,r,o,a,l])}(y);c(k,A,v,C,p,g),c(A,k,v,C,g,p),f.set(S),b?this.processResults(u,h,1-m):this.processResults(this.cache.work,u,m)},[pn]:function(t){const[e,i]=this.getInputAndOutputLines(t),n=e.data,s=i.data,r=n.length,o=e.width,a=e.height,{opacity:l=1,useMixedChannel:c=!0,seed:h=ki,level:u=0,offsetMin:d=0,offsetMax:f=0,offsetRedMin:p=0,offsetRedMax:g=0,offsetGreenMin:m=0,offsetGreenMax:y=0,offsetBlueMin:b=0,offsetBlueMax:S=0,offsetAlphaMin:k=0,offsetAlphaMax:A=0,transparentEdges:v=!1,lineOut:C}=t;let P=dt(t.step);P<1&&(P=1);const x=this.getRandomNumbers({seed:h,length:5*a}),w=f-d,O=g-p,D=y-m,F=S-b,R=A-k;let T=-1;const H=[];let E,I,B,L,$,M,X,Y,G,j,z,N,V,W,U,Z,_,K,q,Q,J,tt,et,it,nt;for(E=0;EZ||etZ||itZ||ntZ?0:n[nt]):s[N]=n[nt];C?this.processResults(i,e,1-l):this.processResults(this.cache.work,i,l)},[yn]:function(t){const[e,i]=this.getInputAndOutputLines(t),n=e.data,s=i.data,r=n.length,{opacity:o=1,lineOut:a}=t,l=this.getGrayscaleValue;let c,h,u,d,f,p;for(f=0;f=n&&t<=s)return r}};this.checkChannelLevelsParameters(t);const[i,n]=this.getInputAndOutputLines(t),s=i.data,r=n.data,o=s.length,{opacity:a=1,red:l=[0],green:c=[0],blue:h=[0],alpha:u=[255],lineOut:d}=t;let f,p,g,m,y;for(y=0;yfunction(t,e,i){d.length=0,f.length=0;let n,s,r,o,l,c,p=0;const g=i.length;for(n=0;n=0&&g=0&&m=0&&g=0&&m=0&&y=0&&b=0&&S=0&&k=0&&A=0&&ve+t[i+n]),0);s=dt(s/i.length);for(let t=0,r=i.length;t{d?e(r,o,t,0):i(r,o,t,0),f?e(r,o,t,1):i(r,o,t,1),p?e(r,o,t,2):i(r,o,t,2),g?e(r,o,t,3):i(r,o,t,3)})),m?this.processResults(s,n,1-a):this.processResults(this.cache.work,s,a)},[ur]:function(t){const{assetData:e,lineOut:i}=t;if(i&&i.substring&&i.length){let{width:t,height:n,data:s}=e;if(t&&n&&s){const{width:e,height:r}=this.cache.source;if(e!==t||r!==n){const i=new ImageData(e,r).data;let o,a,l,c,h=(e-t)/2,u=(r-n)/2;for(h<0&&(h=0),u<0&&(u=0),a=0;a=r)?(s[P]=n[P],s[x]=n[x],s[w]=n[w],s[O]=n[O]):(T<0?T+=r:T>=r&&(T-=r),!b||n[O]&&n[T+3]?(s[P]=p?n[T]:n[P],T++,s[x]=g?n[T]:n[x],T++,s[w]=m?n[T]:n[w],T++,s[O]=y?n[T]:n[O]):(s[P]=n[P],s[x]=n[x],s[w]=n[w],s[O]=n[O]))):(s[P]=n[P],s[x]=n[x],s[w]=n[w],s[O]=n[O])}S?this.processResults(i,e,1-a):this.processResults(this.cache.work,i,a)},[qr]:function(t){this.predefinedPalette||(this.predefinedPalette={});const e=mn;this.colorSpaceIndices();const{rgbIndices:i,labIndices:n,indicesMemoRecord:s,predefinedPalette:r,getGrayscaleValue:o,tfx:a,tfx2:l,labIndicesMultiplier:c}=this;let h;const u=(t,e)=>{if(t||(t=e.join(Se)),t&&r[t])return r[t];const o=[];return e.forEach((t=>{Qu.convert(t);const[e,r,h]=Qu.rgb,u=e*l+r*a+h;if(o.push(u),!s[u]){s[u]=1;const[t,o,a]=Qu.convertRGBtoOKLAB(e,r,h);let l=3*u;i[l]=e,n[l]=t*c,l++,i[l]=r,n[l]=o*c,l++,i[l]=h,n[l]=a*c}})),r[t]=o.sort(((t,e)=>t-e)),o};r[Ee]||(u(Ee,["#000","#fff"]),u("monochrome-4",["#222","#777","#bbb","#fff"]),u("monochrome-8",["#000","#333","#555","#777","#999","#bbb","#ddd","#fff"]),u("monochrome-16",["#000","#111","#222","#333","#444","#555","#666","#777","#888","#999","#aaa","#bbb","#ccc","#ddd","#eee","#fff"]));const d=function(t,e){const n=e.length;if(!n)return 0;if(1===n)return e[0];const s=i[3*t];let r,o,a;const l=[];for(let t=0;tt[1]-e[1]));const[c,h]=l[0],[u,d]=l[1],f=h+d,p=f-h;return V[G]*ft[1]-e[1]));const[b,S]=y[0],[k,A]=y[1];let v=V[G];const C=S+A;return v*=C,ve[1]-t[1])),f=0,p=r.length;f=s)break}else{for(m=i[g],g++,y=i[g],g++,b=i[g],v=!0,a=0,l=o.length;a=s)break}else o.push(t[0])}return o}(_,w,C):[],N.length||(N=r[Ee]),R=0;R$){const t=M;M=$,$=t}let X=$-M;if(0===X&&(X=.1),C=g-$,C<0&&(C=0),x=g+$,x>u&&(x=u),P=A-$,P<0&&(P=0),w=A+$,w>=d&&(w=d),C0&&P0){let e=f,u=f;Wl(e)?u=`ude-${e(0)}-${e(.1)}-${e(.2)}-${e(.3)}-${e(.4)}-${e(.5)}-${e(.6)}-${e(.7)}-${e(.8)}-${e(.9)}-${e(1)}`:e=null!=sc[e]?sc[e]:sc.linear;const d=au(`swirl-${i}-${n}-${s}-${o}-${c}-${u}-${a}-${l}`);if(!d.length){const i=ku(),n=ku();for(i.setFromArray([g,A]),O=P;O$?R=m:F=a&&(I-=a),B<0?B+=l:B>=l&&(B-=l),R=4*t[B][I]):(L=1-(F-M)/X,L=e(L),n.rotate(c*L).add(i),I=dt(n[0]),B=dt(n[1]),I<0?I+=a:I>=a&&(I-=a),B<0?B+=l:B>=l&&(B-=l),R=4*t[B][I]),d.push(R);Au(n),Au(i)}let p=-1;for(O=P;Oe+t[4*i+n]),0);s=dt(s/i.length);for(let t=0,r=i.length;t{y?e(r,o,t,0):i(r,o,t,0),b?e(r,o,t,1):i(r,o,t,1),S?e(r,o,t,2):i(r,o,t,2),k?e(r,o,t,3):i(r,o,t,3)})):this.transferDataUnchanged(o,r,a),A?this.processResults(s,n,1-l):this.processResults(this.cache.work,s,l)},[Ua]:function(t){const[e,i]=this.getInputAndOutputLines(t),n=e.data,s=i.data,r=n.length,{opacity:o=1,redInRed:a=1,redInGreen:l=0,redInBlue:c=0,greenInRed:h=0,greenInGreen:u=1,greenInBlue:d=0,blueInRed:f=0,blueInGreen:p=0,blueInBlue:g=1,lineOut:m}=t;let y,b,S,k,A,v,C,P;for(A=0;A{const e=b[t];e&&(e.dirtyFilterIdentifier=!1)})),L.forEach((t=>{const e=B[t];e&&(e.dirtyFilterIdentifier=!1)}))}}),J.FilterEngine=FilterEngine;const td=new FilterEngine;function ed(t=Xl){t.defs=Kl(t.defs,{sourceLoaded:!1,source:null,subscribers:null}),t.packetExclusions=Ql(t.packetExclusions,["sourceLoaded","source","subscribers"]),t.finalizePacketOut=function(t){return this.subscribers&&this.subscribers.length&&(t.subscribers=this.subscribers.map((t=>t.name))),t},t.kill=function(t=!1){return t&&this.source&&this.source.remove(),this.deregister()};const e=t.setters;e.source=function(t){t&&this.sourceLoaded&&this.notifySubscribers()},e.subscribers=Bl,t.assetConstructor=function(t){return this.makeName(t.name),this.register(),this.subscribers=[],this.set(this.defs),this.set(t),t.subscribe&&this.subscribers.push(t.subscribe),this},t.subscribe=function(t){if(t&&t.name){const e=t.name;this.subscribers.every((t=>t.name!==e))&&this.subscribeAction(t)}},t.subscribeAction=function(t){t&&(this.subscribers.push(t),t.asset=this,t.source=this.source,this.notifySubscriber(t))},t.unsubscribe=function(t){if(t&&t.name){const e=t.name,i=this.subscribers.findIndex((t=>t.name===e));i>=0&&(t.source=null,t.asset=null,t.sourceNaturalHeight=0,t.sourceNaturalWidth=0,t.sourceLoaded=!1,this.subscribers.splice(i,1))}},t.notifySubscribers=function(){this.subscribers.forEach((t=>this.notifySubscriber(t)),this)},t.notifySubscriber=function(t){t.sourceNaturalWidth=this.sourceNaturalWidth,t.sourceNaturalHeight=this.sourceNaturalHeight,t.sourceLoaded=this.sourceLoaded,t.source=this.source,t.dirtyImage=!0,t.dirtyCopyStart=!0,t.dirtyCopyDimensions=!0,t.dirtyImageSubscribers=!0,t.dirtyFilterIdentifier=!0}}const ImageAsset=function(t=Xl){return this.assetConstructor(t)},id=ImageAsset.prototype=rc();id.type=aa,id.lib=Pe,id.isArtefact=!1,id.isAsset=!0,nh(id),ed(id);id.defs=Kl(id.defs,{intrinsicDimensions:null}),id.saveAsPacket=function(){return[this.name,this.type,this.lib,{}]},id.stringifyFunction=Bl,id.processPacketOut=Bl,id.finalizePacketOut=Bl,id.clone=$l;const nd=id.getters,sd=id.setters;nd.width=function(){return this.sourceNaturalWidth||this.source.naturalWidth||0},nd.height=function(){return this.sourceNaturalHeight||this.source.naturalHeight||0},sd.source=function(t){t&&(En.includes(t.tagName.toUpperCase())&&(this.source=t,this.sourceNaturalWidth=t.naturalWidth,this.sourceNaturalHeight=t.naturalHeight,this.sourceLoaded=t.complete),this.sourceLoaded&&this.notifySubscribers())},sd.currentSrc=function(t){this.currentSrc=t,this.currentFile=this.currentSrc.split("/").pop()},id.checkSource=function(t,e){const i=this.source;let n=Ei;if(this.sourceLoaded){let s=this.intrinsicDimensions[this.currentFile];switch(this.currentSrc!==i.currentSrc?(this.set({currentSrc:i.currentSrc}),s=this.intrinsicDimensions[this.currentFile],n=s?$n:xl):s&&(n=$n),n){case xl:this.sourceNaturalWidth=0,this.sourceNaturalHeight=0,this.notifySubscribers();break;case $n:this.sourceNaturalWidth===s[0]&&this.sourceNaturalHeight===s[1]||(this.sourceNaturalWidth=s[0],this.sourceNaturalHeight=s[1],this.notifySubscribers());break;default:this.sourceNaturalWidth===i.naturalWidth&&this.sourceNaturalHeight===i.naturalHeight&&this.sourceNaturalWidth===t&&this.sourceNaturalHeight===e||(this.sourceNaturalWidth=i.naturalWidth,this.sourceNaturalHeight=i.naturalHeight,this.notifySubscribers())}}};const rd=[],od=[],ad=function(...t){const e=[];return t.forEach((t=>{let i,n,s,r,o=!1,a=!1;if(t.substring){const e=xe.exec(t);i=e&&e[1]?e[1]:Ol,n=t,s=Ol,r=!1,a=!0}else(t=!!Zl(t)&&t)&&t.src&&(i=t.name||Ol,n=t.src,s=t.className||Ol,r=t.visibility||!1,t.parent&&(o=document.querySelector(t.parent)),a=!0);if(a){const t=dd({name:i,intrinsicDimensions:{}}),a=document.createElement(In);a.name=i,a.className=s,a.crossorigin=ye,a.style.display=r?Le:Bs,o&&o.appendChild(a),a.onload=()=>{t.set({source:a})},a.src=n,t.set({source:a}),e.push(i)}else e.push(!1)})),e},ld=function(t){document.querySelectorAll(t).forEach((t=>{let e;if(En.includes(t.tagName.toUpperCase())){if(t.id||t.name)e=t.id||t.name;else{const i=xe.exec(t.src);e=i&&i[1]?i[1]:Ol}let i=t.dataset.dimensions||{};i.substring&&(i=Ct(i));const n=dd({name:e,source:t,intrinsicDimensions:i,currentSrc:t.currentSrc});t.onload=()=>{n.set({source:t})}}}))},cd=function(t,e=!1){let i=t.substring?d[t]||h[t]:t;i.type===Ko&&(i=i.base),i.type===qo&&(i.stashOutput=!0,e&&(i.stashOutputAsAsset=e))},hd=function(t,e=!1){let i;t&&!t.substring?t.type===oa?i=t:t.type===qo?i=v[t.name]:t.type===Ko&&(i=v[t.base.name]):t&&t.substring&&(i=v[t]),i&&(i.stashOutput=!0,e&&(i.stashOutputAsAsset=e))},ud=function(t,e=!1){const i=t.substring?o[t]:t;i.isArtefact&&(i.stashOutput=!0,e&&(i.stashOutputAsAsset=e))},dd=function(t){return!!t&&new ImageAsset(t)};function fd(t=Xl){t.defs=Kl(t.defs,{filters:null,isStencil:!1,memoizeFilterOutput:!1});const e=t.setters;e.filters=function(t){mt(this.filters)||(this.filters=[]),t&&(mt(t)?(this.filters=t,this.dirtyFilters=!0,this.dirtyImageSubscribers=!0):t.substring&&(Ql(this.filters,t),this.dirtyFilters=!0,this.dirtyImageSubscribers=!0),this.dirtyFilterIdentifier=!0)},e.memoizeFilterOutput=function(t){this.memoizeFilterOutput=t,this.updateFilterIdentifier(!!t)},t.updateFilterIdentifier=function(t){this.dirtyFilterIdentifier=!1,this.state&&(this.state.dirtyFilterIdentifier=!1),this.memoizeFilterOutput&&t?this.filterIdentifier=Yl():this.filterIdentifier=Ol},t.cleanFilters=function(){this.dirtyFilters=!1,this.dirtyFiltersCache=!0,this.filters||(this.filters=[]),this.currentFilters||(this.currentFilters=[]);const{filters:t,currentFilters:e}=this;if(t.length){const i=Mc();let n,s,r,o,a,l;for(n=0,s=t.length;n{t&&t.type===sa&&(t=t.name),Ql(this.filters,t)}),this),this.dirtyFilters=!0,this.dirtyImageSubscribers=!0,this.dirtyFilterIdentifier=!0,this},t.removeFilters=function(...t){return mt(this.filters)||(this.filters=[]),t.forEach((t=>{t&&t.type===sa&&(t=t.name),Jl(this.filters,t)}),this),this.dirtyFilters=!0,this.dirtyImageSubscribers=!0,this.dirtyFilterIdentifier=!0,this},t.clearFilters=function(){return mt(this.filters)||(this.filters=[]),this.filters.length=0,this.dirtyFilters=!0,this.dirtyImageSubscribers=!0,this.dirtyFilterIdentifier=!0,this},t.hasFilters=function(){return!!this.filters.length},t.preprocessFilters=function(t){let e,i,n,s,r,o,a,c,h,u,d,f,p,g,m,y;for(e=0,i=t.length;er&&(d=r-2,p=1),f>o&&(f=o-2,g=1),p>r&&(p=r-1,d=0),g>o&&(g=o-1,f=0),d+p>r&&(d=r-p-1),f+g>o&&(f=o-g-1);const t=mu(),e=t.engine,i=t.element;i.width=m,i.height=y,e.setTransform(1,0,0,1,0,0),e.globalCompositeOperation=wo,e.globalAlpha=1;const a=s.source||s.element;e.drawImage(a,~~d,~~f,~~p,~~g,0,0,~~m,~~y),u.assetData=e.getImageData(0,0,~~m,~~y),yu(t)}n&&(u.assetData={width:1,height:1,data:new Uint8ClampedArray(4)})}h.dirtyFilterIdentifier&&(this.dirtyFilterIdentifier=!0)}const b=this.state;if(b)if(b.dirtyFilterIdentifier)this.dirtyFilterIdentifier=!0;else{const{fillStyle:t,strokeStyle:e}=b;(B[t]&&B[t].dirtyFilterIdentifier||B[e]&&B[e].dirtyFilterIdentifier)&&(this.dirtyFilterIdentifier=!0)}(this.dirtyFilterIdentifier||this.state&&this.state.dirtyFilterIdentifier)&&this.updateFilterIdentifier(!0)}}J.ImageAsset=ImageAsset;const Group=function(t=Xl){return this.makeName(t.name),this.register(),this.artefacts=[],this.artefactCalculateBuckets=[],this.artefactStampBuckets=[],this.set(this.defs),this.onEntityHover=Bl,this.onEntityNoHover=Bl,this.isHovering=null,this.set(t),this},pd=Group.prototype=rc();pd.type=oa,pd.lib="group",pd.isArtefact=!1,pd.isAsset=!1,nh(pd),fd(pd);pd.defs=Kl(pd.defs,{artefacts:null,order:0,visibility:!0,regionRadius:0,checkForEntityHover:!1,onEntityHover:null,onEntityNoHover:null}),pd.packetExclusions=Ql(pd.packetExclusions,["artefactCalculateBuckets","artefactStampBuckets","batchResort"]),pd.packetFunctions=Ql(pd.packetFunctions,["onEntityHover","onEntityNoHover"]),pd.postCloneAction=function(t,e){let i;return e.host?e.host.substring?i=o[e.host]:e.host.type&&oe.includes(e.host.type)&&(i=e.host):this.currentHost?i=this.currentHost:this.host&&(this.host.substring?i=o[this.host]:this.host.type&&oe.includes(this.host.type)&&(i=this.host)),i&&(i.addGroups(t.name),t.host||(t.host=i.name)),this.onEntityHover&&(t.onEntityHover=this.onEntityHover),this.onEntityNoHover&&(t.onEntityNoHover=this.onEntityNoHover),t},pd.kill=function(t=!1){t&&this.artefactCalculateBuckets.forEach((t=>t.kill()));const e=this.name;return Mt(o).forEach((t=>{mt(t.groups)&&t.groups.includes(e)&&(Jl(t.groups,e),t.batchResort=!0)})),Mt(d).forEach((t=>{mt(t.groups)&&t.groups.includes(e)&&(Jl(t.groups,e),t.batchResort=!0)})),this.deregister()},pd.killArtefacts=function(){return this.artefactCalculateBuckets.forEach((t=>t.kill())),this};const gd=pd.getters,md=pd.setters;gd.artefacts=function(){return[].concat(this.artefacts)},md.artefacts=function(t){this.artefacts||(this.artefacts=[]),this.artefacts.length=0,this.addArtefacts(t)},md.host=function(t){const e=this.getHost(t);e&&e.addGroups&&(this.host=t,e.addGroups(this.name),this.dirtyHost=!0)},md.order=function(t){const e=this.getHost(this.host);this.order=t,e&&e.set({batchResort:!0})},md.noFilters=function(t){this.noFilters=t,this.dirtyFilterIdentifier=!0},pd.getArtefactNames=function(){return[...this.artefacts]},pd.getHost=function(t){if(t){if(t.type&&oe.includes(t.type))return t;if(t.substring)return o[t]||d[t]}const e=this.currentHost;return e&&e.substring?o[e]||d[e]:e},pd.forceStamp=function(){const t=this.visibility;this.visibility=!0,this.stamp(),this.visibility=t},pd.stamp=function(){if(this.dirtyHost||!this.currentHost){this.dirtyHost=!1;const t=this.getHost(this.host);t?this.currentHost=t:this.dirtyHost=!0}if(this.visibility){const{currentHost:t,stashOutput:e,noFilters:i,filters:n}=this;if(t){this.sortArtefacts();let s=null;e||!i&&n&&n.length?s=mu(t.element.width,t.element.height):t.engine&&t.engine.save(),this.prepareStamp(s),this.stampAction(s),s?yu(s):t.engine&&(t.engine.restore(),t.setEngineFromState(t.engine))}}},pd.sortArtefacts=function(){if(this.batchResort){this.batchResort=!1;const t=Mc(),e=Mc(),{artefacts:i,artefactCalculateBuckets:n,artefactStampBuckets:s}=this;let r,a,l,c,h,u;for(l=0,c=i.length;l{i.lib===Gi&&(i.currentHost&&i.currentHost.name===e.name||(i.currentHost=e,t||(i.dirtyHost=!0))),i.noDeltaUpdates||i.updateByDelta(),i.prepareStamp()}))},pd.stampAction=function(t){const{dirtyFilters:e,currentFilters:i,artefactStampBuckets:n,noFilters:s,filters:r,stashOutput:o,currentHost:a}=this;if(!e&&i||this.cleanFilters(),n.forEach((t=>{t&&t.stamp&&t.stamp()})),t)if(!s&&r&&r.length){const e=this.applyFilters(t);o&&this.stashAction(e)}else if(o){const e=t.element,i=t.engine,n=!(!a||!a.engine)&&a.engine;if(n){n.save(),n.globalCompositeOperation=wo,n.globalAlpha=1,n.setTransform(1,0,0,1,0,0),n.drawImage(e,0,0),n.restore();const t=i.getImageData(0,0,e.width,e.height);this.stashAction(t)}}},pd.applyFilters=function(t){const e=this.currentHost,i=ph();if(!e||!t)return!1;const n=e.element,s=e.engine,r=t.element,o=t.engine;this.isStencil&&(o.save(),o.globalCompositeOperation=Po,o.globalAlpha=1,o.setTransform(1,0,0,1,0,0),o.drawImage(n,0,0),o.restore(),this.dirtyFilterIdentifier=!0),o.setTransform(1,0,0,1,0,0);const a=o.getImageData(0,0,r.width,r.height);this.preprocessFilters(this.currentFilters);const l=td.action({identifier:this.filterIdentifier,image:a,filters:this.currentFilters});return l&&(o.globalCompositeOperation=wo,o.globalAlpha=1,o.setTransform(i,0,0,i,0,0),o.putImageData(l,0,0)),s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(r,0,0),s.restore(),l},pd.stashAction=function(t){if(!t)return!1;if(this.stashOutput){this.stashOutput=!1;const[e,i,n,s]=this.getCellCoverage(t),r=mu(),o=r.engine,a=r.element;if(a.width=n,a.height=s,o.putImageData(t,-e,-i),this.stashedImageData=o.getImageData(0,0,n,s),this.stashOutputAsAsset){const t=this.stashOutputAsAsset.substring?this.stashOutputAsAsset:`${this.name}-groupimage`;if(this.stashOutputAsAsset=!1,this.stashedImage)this.stashedImage.src=a.toDataURL();else{const e=this.currentHost,i=e?e.getController():null;if(i){const e=this,n=document.createElement(In);n.id=t,n.alt=`A cached image of the ${this.name} Group of entitys`,n.onload=function(){i.canvasHold.appendChild(n),e.stashedImage=n,ld(`#${t}`)},n.src=a.toDataURL()}}}yu(r)}},pd.getCellCoverage=function(t){const{width:e,height:i,data:n}=t;let s,r,o,a,l=0,c=0,h=e,u=i,d=3;for(o=0,a=e*i;os&&(h=s),lr&&(u=r),c{t&&(t.substring?Ql(this.artefacts,t):t.name&&Ql(this.artefacts,t.name))}),this),this.batchResort=!0,this},pd.getArtefact=function(t){return this.artefacts.includes(t)&&o[t]||!1},pd.removeArtefacts=function(...t){return t.forEach((t=>{t&&(t.substring?Jl(this.artefacts,t):t.name&&Jl(this.artefacts,t.name))}),this),this.batchResort=!0,this},pd.moveArtefactsIntoGroup=function(...t){let e,i;return t.forEach((t=>{t&&(i=t.substring?o[t]:t,i&&i.isArtefact&&(e=i.group?i.group:!!i.host&&v[i.host]),e&&(e.removeArtefacts(t),e.batchResort=!0),Ql(this.artefacts,t))}),this),this.batchResort=!0,this},pd.clearArtefacts=function(){return this.artefacts.length=0,this.artefactCalculateBuckets.length=0,this.artefactStampBuckets.length=0,this.batchResort=!0,this},pd.updateArtefacts=function(t){return this.cascadeAction(t,"setDelta"),this},pd.setArtefacts=function(t){return this.cascadeAction(t,"set"),this},pd.updateByDelta=function(){return this.cascadeAction(!1,fl),this},pd.reverseByDelta=function(){return this.cascadeAction(!1,oo),this},pd.addArtefactClasses=function(t){return this.cascadeAction(t,"addClasses"),this},pd.removeArtefactClasses=function(t){return this.cascadeAction(t,"removeClasses"),this},pd.cascadeAction=function(t,e){let i;return this.artefacts.forEach((n=>{i=o[n],i&&i[e]&&i[e](t)})),this},pd.setDeltaValues=function(t=Xl){return this.artefactCalculateBuckets.forEach((e=>e.setDeltaValues(t))),this},pd.addFiltersToEntitys=function(...t){let e;return this.artefacts.forEach((i=>{e=m[i],e&&e.addFilters&&e.addFilters(t)})),this},pd.removeFiltersFromEntitys=function(...t){let e;return this.artefacts.forEach((i=>{e=m[i],e&&e.removeFilters&&e.removeFilters(t)})),this},pd.clearFiltersFromEntitys=function(){let t;return this.artefacts.forEach((e=>{t=m[e],t&&t.clearFilters&&t.clearFilters()})),this},pd.recalculateFonts=function(){let t;return this.artefacts.forEach((e=>{t=m[e],t&&t.recalculateFont&&t.recalculateFont()})),this},pd.getArtefactAt=function(t){this.sortArtefacts();const e=this.artefactStampBuckets;let i,n;for(let s=e.length-1;s>=0;s--)if(i=e[s],i&&(n=i.checkHit(t),n))return n;return!1},pd.getAllArtefactsAt=function(t){this.sortArtefacts();const e=this.artefactStampBuckets,i=Mc(),n=[];let s,r,o;for(let a=e.length-1;a>=0;a--)s=e[a],s&&(r=s.checkHit(t),r&&r.artefact&&(o=r.artefact,i.includes(o.name)||(i.push(o.name),n.push(r))));if(Xc(i),this.checkForEntityHover){const t=!!n.length;this.isHovering!==t&&(this.isHovering=t,t?this.onEntityHover():this.onEntityNoHover())}return n};const yd=function(t){return!!t&&new Group(t)};function bd(t=Xl){t.defs=Kl(t.defs,{group:null,visibility:!0,calculateOrder:0,stampOrder:0,start:null,handle:null,offset:null,dimensions:null,pivoted:null,mimicked:null,particle:null,lockTo:null,bringToFrontOnDrag:!0,ignoreDragForX:!1,ignoreDragForY:!1,scale:1,roll:0,noUserInteraction:!1,noPositionDependencies:!1,noCanvasEngineUpdates:!1,noFilters:!1,noPathUpdates:!1,purge:null}),t.packetExclusions=Ql(t.packetExclusions,["pathObject","mimicked","pivoted"]),t.packetExclusionsByRegex=Ql(t.packetExclusionsByRegex,["^(local|dirty|current)","Subscriber$"]),t.packetCoordinates=Ql(t.packetCoordinates,["start","handle","offset"]),t.packetObjects=Ql(t.packetObjects,["group"]),t.processPacketOut=function(t,e,i){let n=!0;if(t===ss)e[0]===To&&e[1]===To&&(n=!!i.includes(ss));else this.lib===Gi?n=this.processEntityPacketOut(t,e,i):this.isArtefact&&(n=this.processDOMPacketOut(t,e,i));return n},t.handlePacketAnchor=function(t,e){if(this.anchor){const i=Ct(this.anchor.saveAsPacket(e))[3];t.anchor=i}if(this.button){const i=Ct(this.button.saveAsPacket(e))[3];t.button=i}return t},t.kill=function(t=!1,e=!1){const i=this.name;return Mt(v).forEach((t=>{t.artefacts.includes(i)&&t.removeArtefacts(i)})),this.anchor&&this.demolishAnchor(),this.button&&this.demolishButton(),Mt(o).forEach((t=>{t.name!==i&&(t.pivot&&t.pivot.name===i&&t.set({pivot:!1}),t.mimic&&t.mimic.name===i&&t.set({mimic:!1}),t.path&&t.path.name===i&&t.set({path:!1}),t.generateAlongPath&&t.generateAlongPath.name===i&&t.set({generateAlongPath:!1}),t.generateInArea&&t.generateInArea.name===i&&t.set({generateInArea:!1}),t.artefact&&t.artefact.name===i&&t.set({artefact:!1}),mt(t.pins)&&t.pins.forEach(((e,n)=>{Zl(e)&&e.name===i&&t.removePinAt(n)})))})),Mt(E).forEach((t=>{t.checkForTarget(i)&&t.removeFromTargets(this)})),this.factoryKill(t,e),this.deregister(),this},t.factoryKill=Bl;const e=t.getters,i=t.setters,n=t.deltaSetters;e.positionX=function(){return this.currentStampPosition[0]},e.positionY=function(){return this.currentStampPosition[1]},e.position=function(){return[].concat(this.currentStampPosition)},e.startX=function(){return this.currentStart[0]},e.startY=function(){return this.currentStart[1]},e.start=function(){return[].concat(this.currentStart)},i.startX=function(t){null!=t&&(this.start[0]=t,this.dirtyStart=!0)},i.startY=function(t){null!=t&&(this.start[1]=t,this.dirtyStart=!0)},i.start=function(t,e){this.setCoordinateHelper(To,t,e),this.dirtyStart=!0},n.startX=function(t){const e=this.start;e[0]=Rl(e[0],t),this.dirtyStart=!0},n.startY=function(t){const e=this.start;e[1]=Rl(e[1],t),this.dirtyStart=!0},n.start=function(t,e){this.setDeltaCoordinateHelper(To,t,e),this.dirtyStart=!0},e.handleX=function(){return this.currentHandle[0]},e.handleY=function(){return this.currentHandle[1]},e.handle=function(){return[].concat(this.currentHandle)},i.handleX=function(t){null!=t&&(this.handle[0]=t,this.dirtyHandle=!0)},i.handleY=function(t){null!=t&&(this.handle[1]=t,this.dirtyHandle=!0)},i.handle=function(t,e){this.setCoordinateHelper(An,t,e),this.dirtyHandle=!0},n.handleX=function(t){const e=this.handle;e[0]=Rl(e[0],t),this.dirtyHandle=!0},n.handleY=function(t){const e=this.handle;e[1]=Rl(e[1],t),this.dirtyHandle=!0},n.handle=function(t,e){this.setDeltaCoordinateHelper(An,t,e),this.dirtyHandle=!0},e.offsetX=function(){return this.currentOffset[0]},e.offsetY=function(){return this.currentOffset[1]},e.offset=function(){return[].concat(this.currentOffset)},i.offsetX=function(t){null!=t&&(this.offset[0]=t,this.dirtyOffset=!0)},i.offsetY=function(t){null!=t&&(this.offset[1]=t,this.dirtyOffset=!0)},i.offset=function(t,e){this.setCoordinateHelper(Xs,t,e),this.dirtyOffset=!0},n.offsetX=function(t){const e=this.offset;e[0]=Rl(e[0],t),this.dirtyOffset=!0},n.offsetY=function(t){const e=this.offset;e[1]=Rl(e[1],t),this.dirtyOffset=!0},n.offset=function(t,e){this.setDeltaCoordinateHelper(Xs,t,e),this.dirtyOffset=!0},e.width=function(){return this.currentDimensions[0]},e.height=function(){return this.currentDimensions[1]},e.dimensions=function(){return[].concat(this.currentDimensions)},i.width=function(t){null!=t&&(this.dimensions[0]=t,this.dirtyDimensions=!0)},i.height=function(t){null!=t&&(this.dimensions[1]=t,this.dirtyDimensions=!0)},i.dimensions=function(t,e){this.setCoordinateHelper(Pi,t,e),this.dirtyDimensions=!0},n.width=function(t){const e=this.dimensions;e[0]=Rl(e[0],t),this.dirtyDimensions=!0},n.height=function(t){const e=this.dimensions;e[1]=Rl(e[1],t),this.dirtyDimensions=!0},n.dimensions=function(t,e){this.setDeltaCoordinateHelper(Pi,t,e),this.dirtyDimensions=!0},e.order=function(){return this.stampOrder},i.order=function(t){this.calculateOrder=t,this.stampOrder=t},i.particle=function(t){zl(t)&&!t?(this.particle=null,this.lockTo[0]===Ns&&(this.lockTo[0]=To),this.lockTo[1]===Ns&&(this.lockTo[1]=To),this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0):(this.particle=t,this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0)},i.lockTo=function(t){mt(t)?(this.lockTo[0]=t[0],this.lockTo[1]=t[1]):(this.lockTo[0]=t,this.lockTo[1]=t),this.dirtyLock=!0,this.dirtyStampPositions=!0},i.lockXTo=function(t){this.lockTo[0]=t,this.dirtyLock=!0,this.dirtyStampPositions=!0},i.lockYTo=function(t){this.lockTo[1]=t,this.dirtyLock=!0,this.dirtyStampPositions=!0},e.roll=function(){return this.currentRotation},i.roll=function(t){this.roll=t,this.dirtyRotation=!0},n.roll=function(t){this.roll+=t,this.dirtyRotation=!0},e.scale=function(){return this.currentScale},i.scale=function(t){this.scale=t,this.dirtyScale=!0},n.scale=function(t){this.scale+=t,this.dirtyScale=!0},i.host=function(t){if(t){const e=o[t];e&&e.here?this.host=e.name:this.host=t}else this.host=Ol;this.dirtyDimensions=!0,this.dirtyHandle=!0,this.dirtyStart=!0,this.dirtyOffset=!0},i.group=function(t){if(t)if(this.group&&this.group.type===oa&&this.group.removeArtefacts(this.name),t.substring){const e=v[t];this.group=e||t}else this.group=t;this.group&&this.group.type===oa&&this.group.addArtefacts(this.name)},i.noFilters=function(t){this.noFilters=t,this.dirtyFilterIdentifier=!0},t.purgeArtefact=function(t){return t.substring&&(t=t===he?[Js,ps,Vs,Ui]:[t]),mt(t)&&t.forEach((t=>function(t,e){switch(e){case Js:delete t.pivot,delete t.pivotCorner,delete t.pivotPin,delete t.pivotIndex,delete t.addPivotHandle,delete t.addPivotOffset,delete t.addPivotRotation;break;case ps:delete t.mimic,delete t.useMimicDimensions,delete t.useMimicScale,delete t.useMimicStart,delete t.useMimicHandle,delete t.useMimicOffset,delete t.useMimicRotation,delete t.useMimicFlip,delete t.addOwnDimensionsToMimic,delete t.addOwnScaleToMimic,delete t.addOwnStartToMimic,delete t.addOwnHandleToMimic,delete t.addOwnOffsetToMimic,delete t.addOwnRotationToMimic;break;case Vs:delete t.path,delete t.pathPosition,delete t.addPathHandle,delete t.addPathOffset,delete t.addPathRotation;break;case Ui:delete t.filter,delete t.filters,delete t.isStencil}}(this,t))),this},t.initializePositions=function(){this.dimensions=vu(),this.start=vu(),this.handle=vu(),this.offset=vu(),this.currentDimensions=vu(),this.currentStart=vu(),this.currentHandle=vu(),this.currentOffset=vu(),this.currentDragOffset=vu(),this.currentDragCache=vu(),this.currentStartCache=vu(),this.currentStampPosition=vu(),this.currentStampHandlePosition=vu(),this.delta={},this.deltaConstraints={},this.lockTo=[To,To],this.pivoted=[],this.mimicked=[],this.dirtyScale=!0,this.dirtyDimensions=!0,this.dirtyLock=!0,this.dirtyStart=!0,this.dirtyOffset=!0,this.dirtyHandle=!0,this.dirtyRotation=!0,this.isBeingDragged=!1,this.initializeDomPositions()},t.initializeDomPositions=Bl,t.setCoordinateHelper=function(t,e,i){const n=this[t];mt(e)?(n[0]=e[0],n[1]=e[1]):Zl(e)?nc(e.x,e.y)?(n[0]=ic(e.x,n[0]),n[1]=ic(e.y,n[1])):(n[0]=ic(e.width,e.w,n[0]),n[1]=ic(e.height,e.h,n[1])):(n[0]=e,n[1]=i)},t.setDeltaCoordinateHelper=function(t,e,i){const n=this[t],s=n[0],r=n[1];mt(e)?(n[0]=Rl(s,e[0]),n[1]=Rl(r,e[1])):Zl(e)?nc(e.x,e.y)?(n[0]=Rl(s,ic(e.x,0)),n[1]=Rl(r,ic(e.y,0))):(n[0]=Rl(s,ic(e.width,e.w,0)),n[1]=Rl(r,ic(e.height,e.h,0))):(n[0]=Rl(s,e),n[1]=Rl(r,i))},t.getHost=function(){if(this.currentHost)return this.currentHost;if(this.host){const t=o[this.host];if(t)return this.currentHost=t,this.dirtyHost=!0,this.currentHost}return ah},t.getHere=function(){const t=this.getHost();if(t){if(t.here&&St(t.here))return t.here;if(t.currentDimensions){const e=t.currentDimensions;if(e)return{w:e[0],h:e[1]}}}return ah},t.cleanPosition=function(t,e,i){for(let n=0;n<2;n++){const s=e[n],r=i[n];s.toFixed?t[n]=s:s===ts||s===Za?t[n]=0:s===lo||s===je?t[n]=r:s===Ue?t[n]=r/2:yt(parseFloat(s))?t[n]=parseFloat(s)/100*r:t[n]=0}this.dirtyFilterIdentifier=!0},t.cleanScale=function(){this.dirtyScale=!1;const t=this.scale,e=this.mimic,i=this.currentScale;let n=0;e&&this.useMimicScale?e.currentScale?(n=e.currentScale,this.addOwnScaleToMimic&&(n+=t)):(n=t,this.dirtyMimicScale=!0):n=t,this.currentScale=n,this.dirtyDimensions=!0,this.dirtyHandle=!0,i!==this.currentScale&&(this.dirtyPositionSubscribers=!0),this.mimicked&&this.mimicked.length&&(this.dirtyMimicScale=!0),this.dirtyFilterIdentifier=!0},t.cleanDimensions=function(){this.dirtyDimensions=!1;const t=this.getHost(),e=this.currentDimensions;if(t){let i,n,s;i=t.currentDimensions?t.currentDimensions:[t.w,t.h],[n,s]=this.dimensions;const[r,o]=e;n.substring&&(n=parseFloat(n)/100*i[0]),s.substring&&(s=s===we?0:parseFloat(s)/100*i[1]);const a=this.mimic;i=a&&a.name&&this.useMimicDimensions?a.currentDimensions:null,i?(e[0]=this.addOwnDimensionsToMimic?i[0]+n:i[0],e[1]=this.addOwnDimensionsToMimic?i[1]+s:i[1]):(e[0]=n,e[1]=s),this.cleanDimensionsAdditionalActions(),this.dirtyStart=!0,this.dirtyHandle=!0,this.dirtyOffset=!0,r===e[0]&&o===e[1]||(this.dirtyPositionSubscribers=!0),this.mimicked&&this.mimicked.length&&(this.dirtyMimicDimensions=!0),this.dirtyFilterIdentifier=!0}else this.dirtyDimensions=!0},t.cleanDimensionsAdditionalActions=Bl,t.cleanLock=function(){this.dirtyLock=!1,this.dirtyStart=!0,this.dirtyHandle=!0},t.cleanStart=function(){const t=this.getHost();let e=0,i=0;t&&(this.dirtyStart=!1,ec(t.w,t.h)?(e=t.w,i=t.h):t.currentDimensions?[e,i]=t.currentDimensions:this.dirtyStart=!0),this.dirtyStart||(this.cleanPosition(this.currentStart,this.start,[e,i]),this.dirtyStampPositions=!0)},t.cleanOffset=function(){const t=this.getHost();let e=0,i=0;t&&(this.dirtyOffset=!1,ec(t.w,t.h)?(e=t.w,i=t.h):t.currentDimensions?[e,i]=t.currentDimensions:this.dirtyOffset=!0),this.dirtyOffset||(this.cleanPosition(this.currentOffset,this.offset,[e,i]),this.dirtyStampPositions=!0,this.mimicked&&this.mimicked.length&&(this.dirtyMimicOffset=!0))},t.cleanHandle=function(){this.dirtyHandle=!1,this.cleanPosition(this.currentHandle,this.handle,this.currentDimensions),this.dirtyStampHandlePositions=!0,this.mimicked&&this.mimicked.length&&(this.dirtyMimicHandle=!0)},t.cleanRotation=function(){this.dirtyRotation=!1;const t=this.roll,e=this.currentRotation,i=this.path,n=this.mimic,s=this.pivot,r=this.lockTo;let o=0;if(i&&r.includes(Vs)){if(o=t,this.addPathRotation){const t=this.getPathData();t&&(o+=t.angle)}}else n&&this.useMimicRotation&&r.includes(ps)?tc(n.currentRotation)?(o=n.currentRotation,this.addOwnRotationToMimic&&(o+=t)):this.dirtyMimicRotation=!0:(o=t,s&&this.addPivotRotation&&r.includes(Js)&&(s.type===ea?o+=s.getUnitAlignment(this.pivotIndex):tc(s.currentRotation)?o+=s.currentRotation:this.dirtyPivotRotation=!0));this.currentRotation=o,o!==e&&(this.dirtyPositionSubscribers=!0),this.mimicked&&this.mimicked.length&&(this.dirtyMimicRotation=!0),this.dirtyFilterIdentifier=!0},t.cleanStampPositions=function(){this.dirtyStampPositions=!1;const{currentDragOffset:t,currentOffset:e,currentStampPosition:i,currentStart:n,currentStartCache:s}=this,[r,o]=i;if(this.noPositionDependencies)i[0]=n[0],i[1]=n[1];else{const{addOwnOffsetToMimic:r,addOwnStartToMimic:o,addPathOffset:a,addPivotOffset:l,ignoreDragForX:c,ignoreDragForY:h,isBeingDragged:u,lockTo:d,mimic:f,path:p,pivot:g,pivotCorner:m,pivotPin:y,pivotIndex:b,useMimicOffset:S,useMimicStart:k}=this;let A,v=this.particle;const C=function(t){return(t!==Js||g)&&(t!==Vs||p)&&(t!==ps||f)&&(t!==Ns||P)?t:To},x={[To]:function(t){t.setFromArray(n).add(e)},[Vs]:function(t){F?(t.setFromVector(F),a||t.subtract(p.currentOffset)):t.setFromArray(n).add(e)},[Js]:function(t){m&&g.getCornerCoordinate?t.setFromArray(g.getCornerCoordinate(m)):g.type===ga?t.setFromArray(g.getPinAt(y)):g.type===ea?b<0?t.setFromArray(g.layoutTemplate.currentStampPosition):(A=g.getUnitStartAt(b),null!=A?t.setFromArray(A):t.setFromArray(n).add(e)):t.setFromArray(g.currentStampPosition),l||t.subtract(g.currentOffset),t.add(e)},[ps]:function(t){k||S?(t.setFromArray(f.currentStampPosition),k&&o&&t.add(n),S&&r&&t.add(e),k||t.subtract(f.currentStart).add(n),S||t.subtract(f.currentOffset).add(e)):t.setFromArray(n).add(e)},[Ns]:function(t){v.substring&&(v=P[v]),v?t.setFromVector(v.position):t.setFromArray(n).add(e)},[ys]:function(i){i.setFromVector(D),u&&(s.setFromArray(i),i.add(t)),i.add(e)}},w=ku();let O,D,F,R=!1;if(u)w[0]=c?C(d[0]):ys,w[1]=h?C(d[1]):ys,R=!0,this.getCornerCoordinate&&this.cleanPathObject();else for(let t=0;t<2;t++)O=C(d[t]),O===ys&&(R=!0),To!==O&&(this.dirtyFilterIdentifier=!0),w[t]=O;R&&(D=this.getHere()),w.includes(Vs)&&(F=this.getPathData());const[T,H]=w,E=ku(),I=ku();x[T](E),T===H?I.setFromArray(E):x[H](I),i[0]=E[0],i[1]=I[1],Au(w,E,I)}r===i[0]&&o===i[1]||(this.dirtyPositionSubscribers=!0)},t.cleanStampHandlePositions=function(){this.dirtyStampHandlePositions=!1;const t=this.currentStampHandlePosition,e=this.currentHandle,[i,n]=t;if(this.noPositionDependencies)t[0]=e[0],t[1]=e[1];else{const i=this.lockTo,n=this.pivot,s=this.path,r=this.mimic;let o,a;for(let l=0;l<2;l++){switch(o=i[l],o!==Js||n||(o=To),o!==Vs||s||(o=To),o!==ps||r||(o=To),a=e[l],To!==o&&(this.dirtyFilterIdentifier=!0),o){case Js:this.addPivotHandle&&(a+=n.currentHandle[l]);break;case Vs:this.addPathHandle&&(a+=s.currentHandle[l]);break;case ps:this.useMimicHandle&&(a=r.currentHandle[l],this.addOwnHandleToMimic&&(a+=e[l]))}t[l]=a}}this.cleanStampHandlePositionsAdditionalActions(),i===t[0]&&n===t[1]||(this.dirtyPositionSubscribers=!0)},t.cleanStampHandlePositionsAdditionalActions=Bl,t.checkHit=function(t=[]){if(this.noUserInteraction)return!1;this.pathObject&&!this.dirtyPathObject||this.cleanPathObject();const e=mt(t)?t:[t];let i=0,n=0;const s=mu(),r=s.engine,o=this.currentStampPosition,a=this.pathObject,l=this.winding;return e.some((t=>{if(mt(t))i=t[0],n=t[1];else{if(!ec(t,t.x,t.y))return!1;i=t.x,n=t.y}return!(!yt(i)||!yt(n))&&(s.rotateDestination(r,...o,this),r.isPointInPath(a,i,n,l))}),this)?(yu(s),this.checkHitReturn(i,n)):(yu(s),!1)},t.checkHitReturn=function(t,e){return{x:t,y:e,artefact:this}},t.pickupArtefact=function(t=Xl){const{x:e,y:i}=t;if(ec(e,i)){const{bringToFrontOnDrag:t,currentDragOffset:n,currentStart:s,group:r,lockTo:o,mimic:a,pivot:l}=this;this.isBeingDragged=!0,this.currentDragCache.set(this.currentDragOffset),this.relativeCoordinates=[...this.start],o[0]===To?n[0]=s[0]-e:o[0]===Js&&l?n[0]=l.get(Eo)-e:o[0]===ps&&a&&(n[0]=a.get(Eo)-e),o[1]===To?n[1]=s[1]-i:o[1]===Js&&l?n[1]=l.get(Io)-i:o[1]===ps&&a&&(n[1]=a.get(Io)-i),t&&(this.stampOrder+=9999,r.batchResort=!0),tc(this.dirtyPathObject)&&(this.dirtyPathObject=!0)}return this},t.dropArtefact=function(){const{bringToFrontOnDrag:t,currentDragCache:e,currentDragOffset:i,currentHost:n,currentStartCache:s,group:r,ignoreDragForX:o,ignoreDragForY:a,relativeCoordinates:l,start:c}=this;let h,u,d,f,p,g;return o||(c[0]=s[0]+i[0]),a||(c[1]=s[1]+i[1]),this.dirtyStart=!0,n&&([d,f]=n.get(Pi),[h,u]=c,[p,g]=l,!o&&p.substring&&(c[0]=h/d*100+"%"),!a&&g.substring&&(c[1]=u/f*100+"%")),delete this.relativeCoordinates,i.set(e),t&&(this.stampOrder-=9999,this.stampOrder<0&&(this.stampOrder=0),r.batchResort=!0),tc(this.dirtyPathObject)&&(this.dirtyPathObject=!0),this.isBeingDragged=!1,this},t.updatePositionSubscribers=function(){this.dirtyPositionSubscribers=!1,this.pivoted&&this.pivoted.length&&this.updatePivotSubscribers(),this.mimicked&&this.mimicked.length&&this.updateMimicSubscribers(),this.pathed&&this.pathed.length&&this.updatePathSubscribers()},t.updatePivotSubscribers=Bl,t.updateMimicSubscribers=Bl,t.updatePathSubscribers=Bl,t.updateImageSubscribers=Bl}function Sd(t=Xl){t.defs=Kl(t.defs,{delta:null,noDeltaUpdates:!1,deltaConstraints:null,checkDeltaConstraints:!1,performDeltaChecks:!1});const e=t.setters;e.delta=function(t=Xl){t&&(this.delta=ql(this.delta,t))},e.deltaConstraints=function(t=Xl){t&&(this.deltaConstraints=ql(this.deltaConstraints,t))},t.updateByDelta=function(){return this.setDelta(this.delta),this.checkDeltaConstraints&&this.performDeltaConstraintsChecks(),this},t.reverseByDelta=function(){const t={},e=this.delta,i=St(e),n=i.length;let s,r,o;for(s=0;s=0?(r<2?d=this.start:r<4?d=this.handle:r<6?d=this.offset:r<8&&(d=this.dimensions),go.includes(s)&&(f=1),p=d[f]):p=this.get(s),m=parseFloat(a),y=parseFloat(l),b=parseFloat(p),h=Ol,by&&(h=c,u=1),h)switch(h){case ro:t[s]=-parseFloat(t[s])+Ws,this.set({[s]:b+parseFloat(t[s])+Ws});break;case os:u?this.set({[s]:b-(y-m)+Ws}):this.set({[s]:b+(y-m)+Ws})}}else if(p=this.get(s),h=Ol,pl&&(h=c,u=1),h)switch(h){case ro:t[s]=-t[s],this.set({[s]:p+t[s]});break;case os:u?this.set({[s]:p-(l-a)}):this.set({[s]:p+(l-a)})}}else this.performDeltaChecks=!0},t.setDeltaValues=function(t=Xl){const e=this.delta,i=St(t),n=i.length;let s,r,o,a,l,c;for(s=0;s{t=o[e],t||(t=l[e],t&&t.type===qo||(t=!1)),t&&(t.dirtyStart=!0,t.addPivotHandle&&(t.dirtyHandle=!0),t.addPivotOffset&&(t.dirtyOffset=!0),t.addPivotRotation&&(t.dirtyRotation=!0),t.type===ga?t.dirtyPins=!0:t.type!==ca&&t.type!==ma&&t.type!==_o||t.dirtyPins.push(this.name))}),this)}}function Ad(t=Xl){const e={mimic:Ol,useMimicDimensions:!1,useMimicScale:!1,useMimicStart:!1,useMimicHandle:!1,useMimicOffset:!1,useMimicRotation:!1,useMimicFlip:!1,addOwnDimensionsToMimic:!1,addOwnScaleToMimic:!1,addOwnStartToMimic:!1,addOwnHandleToMimic:!1,addOwnOffsetToMimic:!1,addOwnRotationToMimic:!1};t.defs=Kl(t.defs,e),t.packetObjects=Ql(t.packetObjects,["mimic"]);const i=t.setters;i.mimic=function(t){if(zl(t)&&!t)this.mimic=null,this.lockTo[0]===ps&&(this.lockTo[0]=To),this.lockTo[1]===ps&&(this.lockTo[1]=To),this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0;else{const e=this.mimic,i=this.name;let n=t.substring?o[t]:t;n||(n=l[t],n&&n.type!==qo&&(n=!1)),n&&n.name&&(e&&e.name!==n.name&&Jl(e.mimicked,i),Ql(n.mimicked,i),this.mimic=n,this.useMimicDimensions&&(this.dirtyDimensions=!0),this.useMimicScale&&(this.dirtyScale=!0),this.useMimicStart&&(this.dirtyStart=!0),this.useMimicHandle&&(this.dirtyHandle=!0),this.useMimicOffset&&(this.dirtyOffset=!0),this.useMimicRotation&&(this.dirtyRotation=!0))}},i.useMimicDimensions=function(t){this.useMimicDimensions=t,this.dirtyDimensions=!0},i.useMimicScale=function(t){this.useMimicScale=t,this.dirtyScale=!0},i.useMimicStart=function(t){this.useMimicStart=t,this.dirtyStart=!0},i.useMimicHandle=function(t){this.useMimicHandle=t,this.dirtyHandle=!0},i.useMimicOffset=function(t){this.useMimicOffset=t,this.dirtyOffset=!0},i.useMimicRotation=function(t){this.useMimicRotation=t,this.dirtyRotation=!0},i.addOwnDimensionsToMimic=function(t){this.addOwnDimensionsToMimic=t,this.dirtyDimensions=!0},i.addOwnScaleToMimic=function(t){this.addOwnScaleToMimic=t,this.dirtyScale=!0},i.addOwnStartToMimic=function(t){this.addOwnStartToMimic=t,this.dirtyStart=!0},i.addOwnHandleToMimic=function(t){this.addOwnHandleToMimic=t,this.dirtyHandle=!0},i.addOwnOffsetToMimic=function(t){this.addOwnOffsetToMimic=t,this.dirtyOffset=!0},i.addOwnRotationToMimic=function(t){this.addOwnRotationToMimic=t,this.dirtyRotation=!0},t.updateMimicSubscribers=function(){const t=this.dirtyMimicHandle,e=this.dirtyMimicOffset,i=this.dirtyMimicRotation,n=this.dirtyMimicScale,s=this.dirtyMimicDimensions;let r;this.mimicked.forEach((a=>{r=o[a],r||(r=l[a],r&&r.type===qo||(r=!1)),r&&(r.useMimicStart&&(r.dirtyStart=!0),t&&r.useMimicHandle&&(r.dirtyHandle=!0),e&&r.useMimicOffset&&(r.dirtyOffset=!0),i&&r.useMimicRotation&&(r.dirtyRotation=!0),n&&r.useMimicScale&&(r.dirtyScale=!0),s&&r.useMimicDimensions&&(r.dirtyDimensions=!0))})),this.dirtyMimicHandle=!1,this.dirtyMimicOffset=!1,this.dirtyMimicRotation=!1,this.dirtyMimicScale=!1,this.dirtyMimicDimensions=!1}}function vd(t=Xl){const e={path:Ol,pathPosition:0,addPathHandle:!1,addPathOffset:!0,addPathRotation:!1,constantSpeedAlongPath:!1};t.defs=Kl(t.defs,e),t.packetObjects=Ql(t.packetObjects,["path"]);const i=t.setters,n=t.deltaSetters;i.path=function(t){if(zl(t)&&!t)this.path=null,this.lockTo[0]===Vs&&(this.lockTo[0]=To),this.lockTo[1]===Vs&&(this.lockTo[1]=To),this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0;else{const e=this.path,i=t.substring?o[t]:t,n=this.name;i&&i.name&&i.useAsPath&&(e&&e.name!==i.name&&Jl(e.pathed,n),Ql(i.pathed,n),this.path=i,this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0)}},i.pathPosition=function(t){t<0&&(t=et(t)),t>1&&(t%=1),this.pathPosition=t,this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0,this.currentPathData=!1},n.pathPosition=function(t){let e=this.pathPosition+t;e<0&&(e+=1),e>1&&(e%=1),this.pathPosition=e,this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0,this.currentPathData=!1},i.addPathHandle=function(t){this.addPathHandle=t,this.dirtyHandle=!0},i.addPathOffset=function(t){this.addPathOffset=t,this.dirtyOffset=!0},i.addPathRotation=function(t){this.addPathRotation=t,this.dirtyRotation=!0},t.getPathData=function(){if(this.currentPathData)return this.currentPathData;const t=this.path;if(t){const e=t.getPathPositionData(this.pathPosition,this.constantSpeedAlongPath);return this.addPathRotation&&(this.dirtyRotation=!0),this.currentPathData=e,e}return!1}}function Cd(t=Xl){t.getCanvasNavElement=function(){const t=this.currentHost;if(t){if(t.type===Ko)return t.navigation;if(t.type===qo){const e=t.currentHost?t.currentHost:h[t.host];if(e&&e.type===Ko)return e.navigation}}return null},t.getCanvasWrapper=function(){const t=this.currentHost;if(t){if(t.type===Ko)return t;if(t.type===qo){const e=t.currentHost?t.currentHost:h[t.host];if(e&&e.type===Ko)return e}}return null},t.prepareStampTabsHelper=function(){this.anchor&&this.rebuildAnchor(),this.button&&this.rebuildButton()},t.modifyConstructorInputForAnchorButton=function(t){const e=St(t);let i=!1;for(let t=0,n=pe.length;tt.onEnter()),!1),t&&i&&o&&i.removeEventListener(Xe,(()=>t.onLeave()),!1),n&&i&&n.removeChild(i),e&&(e.dirtyNavigationTabOrder=!0),t&&(t.anchor=null),this.deregister()},Pd.set=function(t=Xl){let e,i,n,s;const r=St(t),o=r.length;if(o){const a=this.setters,l=this.defs;for(e=0;et.onEnter()),!1),s&&b.removeEventListener(Xe,(()=>t.onLeave()),!1),e.removeChild(b),this.domElement=null),a||(b=document.createElement(Nt),b.id=d,l&&b.setAttribute(Ri,l),h&&b.setAttribute(wn,h),u&&b.setAttribute(On,u),f&&b.setAttribute(Qs,f),p&&b.setAttribute(Qr,p),g&&b.setAttribute(to,g),y&&b.setAttribute(Ra,y),n&&b.setAttribute(nl,n),b.setAttribute(bi,m),r&&Wl(r)&&b.addEventListener(ei,r,!1),o&&(b.textContent=o),c&&b.addEventListener(Ki,(()=>t.onEnter()),!1),s&&b.addEventListener(Xe,(()=>t.onLeave()),!1),this.domElement=b,e.appendChild(b)),i.dirtyNavigationTabOrder=!0}}},Pd.rebuild=function(){this.dirtyAnchor&&(this.build(),this.dirtyAnchor=!1)},Pd.click=function(){if(this.hasBeenRecentlyClicked)return!1;{const t=new MouseEvent(ei,{view:window,bubbles:!0,cancelable:!0});this.hasBeenRecentlyClicked=!0;const e=this;return setTimeout((()=>e.hasBeenRecentlyClicked=!1),200),this.domElement.dispatchEvent(t)}};const wd=function(t){return!!t&&new Anchor(t)};function Od(t=Xl){t.defs=Kl(t.defs,{anchor:null}),t.demolishAnchor=function(){this.anchor&&this.anchor.demolish()};const e=t.getters,i=t.setters;e.anchorName=function(){return this.anchorGetHelper(Os)},e.anchorDescription=function(){return this.anchorGetHelper(Ai)},i.anchorDescription=function(t){this.anchorSetHelper(Ai,t)},e.anchorType=function(){return this.anchorGetHelper(ge)},i.anchorType=function(t){this.anchorSetHelper(ge,t)},e.anchorTarget=function(){return this.anchorGetHelper(Ra)},i.anchorTarget=function(t){this.anchorSetHelper(Ra,t)},e.anchorTabOrder=function(){return this.anchorGetHelper(Da)},i.anchorTabOrder=function(t){this.anchorSetHelper(Da,t)},e.anchorDisabled=function(){return this.anchorGetHelper(xi)},i.anchorDisabled=function(t){this.anchorSetHelper(xi,t)},e.anchorRel=function(){return this.anchorGetHelper(to)},i.anchorRel=function(t){this.anchorSetHelper(to,t)},e.anchorReferrerPolicy=function(){return this.anchorGetHelper(Qr)},i.anchorReferrerPolicy=function(t){this.anchorSetHelper(Qr,t)},e.anchorPing=function(){return this.anchorGetHelper(Qs)},i.anchorPing=function(t){this.anchorSetHelper(Qs,t)},e.anchorHreflang=function(){return this.anchorGetHelper(On)},i.anchorHreflang=function(t){this.anchorSetHelper(On,t)},e.anchorHref=function(){return this.anchorGetHelper(wn)},i.anchorHref=function(t){this.anchorSetHelper(wn,t)},e.anchorDownload=function(){return this.anchorGetHelper(Ri)},i.anchorDownload=function(t){this.anchorSetHelper(Ri,t)},i.anchorFocusAction=function(t){this.anchorSetHelper(qi,t)},i.anchorBlurAction=function(t){this.anchorSetHelper(Ye,t)},i.anchorClickAction=function(t){this.anchorSetHelper(ii,t)},i.anchor=function(t){this.anchor?this.anchor.set(t):this.buildAnchor(t)},t.anchorGetHelper=function(t){return this.anchor?this.anchor.get(t):null},t.anchorSetHelper=function(t,e){this.anchor||this.buildAnchor({[t]:e}),this.anchor&&this.anchor.set({[t]:e})},t.buildAnchor=function(t={}){this.anchor&&this.anchor.demolish(),t.anchorName||(t.anchorName=`${this.name}-anchor`),t.description||(t.description=`Anchor link for ${this.name} ${this.type}`),t.host=this,t.controller=this.getCanvasWrapper(),t.hold=this.getCanvasNavElement(),this.anchor=wd(t)},t.rebuildAnchor=function(){this.anchor&&this.anchor.rebuild()},t.clickAnchor=function(){this.anchor&&this.anchor.click()}}J.Anchor=Anchor;const Button=function(t=Xl){return this.makeName(t.name),this.register(),this.set(this.defs),this.host=t.host,this.controller=t.controller,this.hold=t.hold,this.set(t),this.dirtyButton=!0,this},Dd=Button.prototype=rc();Dd.type="Button",Dd.lib=fe,Dd.isArtefact=!1,Dd.isAsset=!1,nh(Dd);const Fd={host:null,description:Ol,tabOrder:0,autofocus:!1,disabled:!1,form:Ol,formAction:Ol,formEnctype:Ol,formMethod:Ol,formNoValidate:!1,formTarget:Ol,popoverTarget:Ol,popoverTargetAction:Ol,elementType:ze,elementValue:Ol,clickAction:null,focusAction:!0,blurAction:!0};Dd.defs=Kl(Dd.defs,Fd),Dd.packetExclusions=Ql(Dd.packetExclusions,["domElement"]),Dd.packetObjects=Ql(Dd.packetObjects,["host"]),Dd.packetFunctions=Ql(Dd.packetFunctions,["clickAction"]),Dd.demolish=function(){const{host:t,controller:e,domElement:i,hold:n,clickAction:s,focusAction:r,blurAction:o}=this;i&&s&&i.removeEventListener(ei,s,!1),t&&i&&r&&i.removeEventListener(Ki,(()=>t.onEnter()),!1),t&&i&&o&&i.removeEventListener(Xe,(()=>t.onLeave()),!1),n&&i&&n.removeChild(i),e&&(e.dirtyNavigationTabOrder=!0),t&&(t.button=null),this.deregister()},Dd.set=function(t=Xl){let e,i,n,s;const r=St(t),o=r.length;if(o){const a=this.setters,l=this.defs;for(e=0;et.onEnter()),!1),s&&A.removeEventListener(Xe,(()=>t.onLeave()),!1),e.removeChild(A),this.domElement=null),a||(A=document.createElement(ze),A.id=y,n&&A.setAttribute(Oe,Ol),a&&A.setAttribute(xi,Ol),u&&A.setAttribute(sn,u),d&&A.setAttribute("formaction",d),f&&A.setAttribute("formenctype",f),p&&A.setAttribute("formmethod",p),g&&A.setAttribute("formnovalidate",Ol),m&&A.setAttribute(Ra,m),b&&A.setAttribute("popovertarget",b),S&&A.setAttribute("popovertargetaction",S),null!=c&&A.setAttribute(gl,c),l?A.setAttribute(nl,l):A.setAttribute(nl,ze),A.setAttribute(bi,k),r&&Wl(r)&&A.addEventListener(ei,r,!1),o&&(A.textContent=o),h&&A.addEventListener(Ki,(()=>t.onEnter()),!1),s&&A.addEventListener(Xe,(()=>t.onLeave()),!1),this.domElement=A,e.appendChild(A)),i.dirtyNavigationTabOrder=!0}}},Dd.rebuild=function(){this.dirtyButton&&(this.build(),this.dirtyButton=!1)},Dd.click=function(){if(this.hasBeenRecentlyClicked)return!1;{const t=new MouseEvent(ei,{view:window,bubbles:!0,cancelable:!0});this.hasBeenRecentlyClicked=!0;const e=this;return setTimeout((()=>e.hasBeenRecentlyClicked=!1),200),this.domElement.dispatchEvent(t)}};const Rd=function(t){return!!t&&new Button(t)};function Td(t=Xl){t.defs=Kl(t.defs,{button:null}),t.demolishButton=function(){this.button&&this.button.demolish()};const e=t.getters,i=t.setters;e.buttonName=function(){return this.buttonGetHelper(Os)},e.buttonAutofocus=function(){return this.buttonGetHelper(Oe)},i.buttonAutofocus=function(t){this.buttonSetHelper(Oe,t)},e.buttonDescription=function(){return this.buttonGetHelper(Ai)},i.buttonDescription=function(t){this.buttonSetHelper(Ai,t)},e.buttonDisabled=function(){return this.buttonGetHelper(xi)},i.buttonDisabled=function(t){this.buttonSetHelper(xi,t)},e.buttonTabOrder=function(){return this.buttonGetHelper(Da)},i.buttonTabOrder=function(t){this.buttonSetHelper(Da,t)},e.buttonForm=function(){return this.buttonGetHelper(sn)},i.buttonForm=function(t){this.buttonSetHelper(sn,t)},e.buttonFormAction=function(){return this.buttonGetHelper(rn)},i.buttonFormAction=function(t){this.buttonSetHelper(rn,t)},e.buttonFormEnctype=function(){return this.buttonGetHelper(on)},i.buttonFormEnctype=function(t){this.buttonSetHelper(on,t)},e.buttonFormMethod=function(){return this.buttonGetHelper(an)},i.buttonFormMethod=function(t){this.buttonSetHelper(an,t)},e.buttonFormNoValidate=function(){return this.buttonGetHelper(ln)},i.buttonFormNoValidate=function(t){this.buttonSetHelper(ln,t)},e.buttonFormTarget=function(){return this.buttonGetHelper(cn)},i.buttonFormTarget=function(t){this.buttonSetHelper(cn,t)},e.buttonPopoverTarget=function(){return this.buttonGetHelper(lr)},i.buttonPopoverTarget=function(t){this.buttonSetHelper(lr,t)},e.buttonPopoverTargetAction=function(){return this.buttonGetHelper(cr)},i.buttonPopoverTargetAction=function(t){this.buttonSetHelper(cr,t)},e.buttonElementType=function(){return this.buttonGetHelper(Ii)},i.buttonElementType=function(t){this.buttonSetHelper(Ii,t)},e.buttonElementValue=function(){return this.buttonGetHelper(Bi)},i.buttonElementValue=function(t){this.buttonSetHelper(Bi,t)},i.buttonFocusAction=function(t){this.buttonSetHelper(qi,t)},i.buttonBlurAction=function(t){this.buttonSetHelper(Ye,t)},i.buttonClickAction=function(t){this.buttonSetHelper(ii,t)},i.button=function(t){this.button?this.button.set(t):this.buildButton(t)},t.buttonGetHelper=function(t){return this.button?this.button.get(t):null},t.buttonSetHelper=function(t,e){this.button||this.buildButton({[t]:e}),this.button&&this.button.set({[t]:e})},t.buildButton=function(t={}){this.button&&this.button.demolish(),t.buttonName||(t.buttonName=`${this.name}-button`),t.description||(t.description=`Button for ${this.name} ${this.type}`),t.host=this,t.controller=this.getCanvasWrapper(),t.hold=this.getCanvasNavElement(),this.button=Rd(t)},t.rebuildButton=function(){this.button&&this.button.rebuild()},t.clickButton=function(){this.button&&this.button.click()}}function Hd(t=Xl){t.defs=Kl(t.defs,{groups:null,groupBuckets:null,batchResort:!0});const e=t.getters,i=t.setters;e.groups=function(){return[].concat(this.groups)},i.groups=function(t){this.groups.length=0,this.addGroups(t)},t.sortGroups=function(){if(this.batchResort){this.batchResort=!1;const{groups:t,groupBuckets:e}=this,i=Mc();let n,s,r,o,a,l;for(n=0,s=t.length;n{t.substring?Ql(e,t):v[t]&&Ql(e,t.name)}),this),this.batchResort=!0,this},t.removeGroups=function(...t){const e=this.groups;return t.forEach((t=>{t.substring?Jl(e,t):v[t]&&Jl(e,t.name)}),this),this.batchResort=!0,this},t.cascadeAction=function(t,e){let i;return this.groups.forEach((n=>{i=v[n],i&&i[e](t)}),this),this},t.updateArtefacts=function(t){return this.cascadeAction(t,"updateArtefacts"),this},t.setArtefacts=function(t){return this.cascadeAction(t,"setArtefacts"),this},t.addArtefactClasses=function(t){return this.cascadeAction(t,"addArtefactClasses"),this},t.removeArtefactClasses=function(t){return this.cascadeAction(t,"removeArtefactClasses"),this},t.updateByDelta=function(){return this.cascadeAction(!1,fl),this},t.reverseByDelta=function(){return this.cascadeAction(!1,oo),this},t.getArtefactAt=function(t){if(t=ic(t,this.here,!1)){let e,i;for(let n=this.groups.length-1;n>=0;n--)if(e=v[this.groups[n]],e&&(i=e.getArtefactAt(t),i))return i}return!1},t.getAllArtefactsAt=function(t){const e=[];if(t=ic(t,this.here,!1)){let i,n;for(let s=this.groups.length-1;s>=0;s--)i=v[this.groups[s]],i&&(n=i.getAllArtefactsAt(t),n&&e.push(...n))}return e}}function Ed(t=Xl){const e={repeat:"repeat",patternMatrix:null};t.defs=Kl(t.defs,e);const i=t.setters,n=t.getters;i.repeat=function(t){us.includes(t)?this.repeat=t:this.repeat=this.defs.repeat},t.checkMatrixExists=function(){this.patternMatrix||(this.patternMatrix=new DOMMatrix)},t.updateMatrixNumber=function(t,e){this.checkMatrixExists(),t=t.substring?parseFloat(t):t;const i=hs.includes(e);Ul(t)&&i&&(this.patternMatrix[e]=t)},i.matrixA=function(t){this.updateMatrixNumber(t,Nt)},i.matrixB=function(t){this.updateMatrixNumber(t,Vt)},i.matrixC=function(t){this.updateMatrixNumber(t,Wt)},i.matrixD=function(t){this.updateMatrixNumber(t,Ut)},i.matrixE=function(t){this.updateMatrixNumber(t,Zt)},i.matrixF=function(t){this.updateMatrixNumber(t,_t)},i.stretchX=function(t){this.updateMatrixNumber(t,Nt)},i.skewY=function(t){this.updateMatrixNumber(t,Vt)},i.skewX=function(t){this.updateMatrixNumber(t,Wt)},i.stretchY=function(t){this.updateMatrixNumber(t,Ut)},i.shiftX=function(t){this.updateMatrixNumber(t,Zt)},i.shiftY=function(t){this.updateMatrixNumber(t,_t)},t.retrieveMatrixNumber=function(t){return this.checkMatrixExists(),this.patternMatrix[t]},n.matrixA=function(){return this.retrieveMatrixNumber(Nt)},n.matrixB=function(){return this.retrieveMatrixNumber(Vt)},n.matrixC=function(){return this.retrieveMatrixNumber(Wt)},n.matrixD=function(){return this.retrieveMatrixNumber(Ut)},n.matrixE=function(){return this.retrieveMatrixNumber(Zt)},n.matrixF=function(){return this.retrieveMatrixNumber(_t)},n.stretchX=function(){return this.retrieveMatrixNumber(Nt)},n.skewY=function(){return this.retrieveMatrixNumber(Vt)},n.skewX=function(){return this.retrieveMatrixNumber(Wt)},n.stretchY=function(){return this.retrieveMatrixNumber(Ut)},n.shiftX=function(){return this.retrieveMatrixNumber(Zt)},n.shiftY=function(){return this.retrieveMatrixNumber(_t)},i.patternMatrix=function(t){if(mt(t)){const e=this.updateMatrixNumber;e(t[0],Nt),e(t[1],Vt),e(t[2],Wt),e(t[3],Ut),e(t[4],Zt),e(t[5],_t)}},t.buildStyle=function(t){if(t){t.substring&&(t=d[t]);let e=this.source,i=this.sourceLoaded;const n=this.repeat,s=t.engine;if(this.type!==qo&&this.type!==ha||(e=this.element,i=!0),s&&i){const t=s.createPattern(e,n);return t.setTransform(this.patternMatrix),t}}return Ie}}J.Button=Button;const Cell=function(t=Xl){this.makeName(t.name),this.register(),this.initializePositions(),this.initializeCascade(),this.modifyConstructorInputForAnchorButton(t);let e=t.element;return delete t.element,Nl(e)||(e=document.createElement(Ve),e.id=this.name,e.width=300,e.height=150),this.set(this.defs),this.set(t),this.installElement(e,t.canvasColorSpace),this.state.setStateFromEngine(this.engine),yd({name:this.name,host:this.name}),this.subscribers=[],this.sourceNaturalDimensions=vu(),this.dirtyDimensionsOverride=!0,this.sourceLoaded=!0,this.here={},this},Id=Cell.prototype=rc();Id.type=qo,Id.lib="cell",Id.isArtefact=!1,Id.isAsset=!0,nh(Id),uu(Id),ed(Id),bd(Id),Sd(Id),kd(Id),Ad(Id),vd(Id),Cd(Id),Od(Id),Td(Id),Hd(Id),Ed(Id),fd(Id);const Bd={cleared:!0,compiled:!0,shown:!0,compileOrder:0,showOrder:0,backgroundColor:Ol,clearAlpha:0,alpha:1,composite:wo,scale:1,flipReverse:!1,flipUpend:!1,filter:Bs,isBase:!1,controller:null,includeInCascadeEventActions:!1,willReadFrequently:!0,setRelativeDimensionsUsingBase:!1};Id.defs=Kl(Id.defs,Bd),delete Id.defs.source,delete Id.defs.sourceLoaded,Id.stringifyFunction=Bl,Id.processPacketOut=Bl,Id.finalizePacketOut=Bl,Id.saveAsPacket=function(){return`[${this.name}, ${this.type}, ${this.lib}, {}]`},Id.clone=$l,Id.factoryKill=function(){const t=this.name;Mt(h).forEach((e=>{e.cells.includes(t)&&e.removeCell(t),e.base&&e.base.name===t&&e.set({visibility:!1})})),Mt(o).forEach((e=>{if(e.name!==t){const i=e.state;if(i){const e=i.fillStyle,n=i.strokeStyle;e.name&&e.name===t&&(i.fillStyle=i.defs.fillStyle),n.name&&n.name===t&&(i.strokeStyle=i.defs.strokeStyle)}}})),v[t]&&v[t].kill()};const Ld=Id.getters,$d=Id.setters,Md=Id.deltaSetters;Id.get=function(t){const e=this.getters[t];if(e)return e.call(this);{let e,i=this.defs[t];const n=this.state;return null!=i?(e=this[t],null!=e?e:i):(i=n.defs[t],null!=i?(e=n[t],null!=e?e:i):void 0)}},Ld.width=function(){return this.currentDimensions[0]||this.element.getAttribute(kl)},$d.width=function(t){null!=t&&(this.dimensions[0]=t,this.dirtyDimensions=!0,this.dirtyDimensionsOverride=!0)},Ld.height=function(){return this.currentDimensions[1]||this.element.getAttribute(Cn)},$d.height=function(t){null!=t&&(this.dimensions[1]=t,this.dirtyDimensions=!0,this.dirtyDimensionsOverride=!0)},Ld.dimensions=function(){return[this.currentDimensions[0]||this.element.getAttribute(kl),this.currentDimensions[1]||this.element.getAttribute(Cn)]},$d.dimensions=function(t,e){this.setCoordinateHelper(Pi,t,e),this.dirtyDimensions=!0,this.dirtyDimensionsOverride=!0},$d.source=function(){},$d.engine=function(){},$d.state=function(){},$d.element=function(t){Nl(t)&&this.installElement(t)},$d.backgroundColor=function(t){tl.includes(t)&&(t=Ol),this.backgroundColor=t},$d.cleared=function(t){this.cleared=t,this.updateControllerCells()},$d.compiled=function(t){this.compiled=t,this.updateControllerCells()},$d.shown=function(t){this.shown=t,this.updateControllerCells()},$d.compileOrder=function(t){this.compileOrder=t,this.updateControllerCells()},$d.showOrder=function(t){this.showOrder=t,this.updateControllerCells()},$d.setRelativeDimensionsUsingBase=function(t){this.setRelativeDimensionsUsingBase=!!t,this.dirtyDimensions=!0},$d.stashX=function(t){this.stashCoordinates||(this.stashCoordinates=[0,0]),this.stashCoordinates[0]=t},$d.stashY=function(t){this.stashCoordinates||(this.stashCoordinates=[0,0]),this.stashCoordinates[1]=t},$d.stashWidth=function(t){if(!this.stashDimensions){const t=this.currentDimensions;this.stashDimensions=[t[0],t[1]]}this.stashDimensions[0]=t},$d.stashHeight=function(t){if(!this.stashDimensions){const t=this.currentDimensions;this.stashDimensions=[t[0],t[1]]}this.stashDimensions[1]=t},Md.stashX=function(t){this.stashCoordinates||(this.stashCoordinates=[0,0]);const e=this.stashCoordinates;e[0]=Rl(e[0],t)},Md.stashY=function(t){this.stashCoordinates||(this.stashCoordinates=[0,0]);const e=this.stashCoordinates;e[1]=Rl(e[1],t)},Md.stashWidth=function(t){if(!this.stashDimensions){const t=this.currentDimensions;this.stashDimensions=[t[0],t[1]]}const e=this.stashDimensions;e[0]=Rl(e[0],t)},Md.stashHeight=function(t){if(!this.stashDimensions){const t=this.currentDimensions;this.stashDimensions=[t[0],t[1]]}const e=this.stashDimensions;e[1]=Rl(e[1],t)},$d.clearAlpha=function(t){t.toFixed&&(t>1?t=1:t<0&&(t=0),this.clearAlpha=t)},Md.clearAlpha=function(t){t.toFixed&&((t+=this.clearAlpha)>1?t=1:t<0&&(t=0),this.clearAlpha=t)},$d.smoothFont=function(t){const{element:e}=this;if(e){const{style:i}=e;i&&(t?(i[bl]=we,i[Ps]=we,i[ko]=we):(i[bl]=Bs,i[Ps]=yn,i[ko]=Ds))}},$d.checkForEntityHover=function(t){v[this.name].set({checkForEntityHover:t})},$d.onEntityHover=function(t){v[this.name].set({onEntityHover:t})},$d.onEntityNoHover=function(t){v[this.name].set({onEntityNoHover:t})},Ld.group=function(){return v[this.name]},Id.checkSource=function(t,e){this.currentDimensions[0]===t&&this.currentDimensions[1]===e||this.notifySubscribers()},Id.getData=function(t,e){return this.checkSource(this.sourceNaturalDimensions[0],this.sourceNaturalDimensions[1]),this.buildStyle(e)},Id.updateArtefacts=function(t=Xl){const e=this.groupBuckets;let i,n,s,r,o,a;for(s=0,r=e.length;s=1?e[n]=dt(o[n]*(t/100)):e[n]=1):yt(t)&&t>=1?e[n]=dt(t):e[n]=1}const[c,h]=e;t.width=c,t.height=h,this.setEngineFromState(this.engine),n&&s&&s.updateBaseHere(),this.groupBuckets&&this.updateArtefacts({dirtyDimensions:!0})}}}},Id.notifySubscriber=function(t){t.sourceNaturalDimensions||(t.sourceNaturalDimensions=[]),t.sourceNaturalWidth=this.currentDimensions[0],t.sourceNaturalHeight=this.currentDimensions[1],t.sourceLoaded=!0,t.dirtyImage=!0,t.dirtyCopyStart=!0,t.dirtyCopyDimensions=!0},Id.subscribeAction=function(t={}){this.subscribers.push(t),t.asset=this,t.source=this.element,this.notifySubscriber(t)},Id.installElement=function(t,e=Ro){return this.element=t,this.engine=this.element.getContext(zt,{willReadFrequently:this.willReadFrequently,colorSpace:e}),this.state=Kh({engine:this.engine}),this},Id.updateControllerCells=function(){const t=this.getController();t&&(t.dirtyCells=!0)},Id.getController=function(){const{controller:t,currentHost:e}=this;return t||(e?e.getHost():null)},Id.getHost=function(){if(this.currentHost)return this.currentHost;if(this.host){const t=l[this.host]||o[this.host];return t&&(this.currentHost=t),!!t&&this.currentHost}return!1},Id.updateBaseHere=function(t,e){if(this.isBase){this.here||(this.here={});const i=this.here,n=this.currentDimensions;let s=t.active;const r=t.localListener?t.originalWidth:t.w,o=t.localListener?t.originalHeight:t.h;if(n[0]!==r||n[1]!==o){this.basePaste||(this.basePaste=[]);const a=this.basePaste[0],l=n[0],c=n[1],h=r,u=o,d=t.x,f=t.y,p=l/h||1,g=c/u||1;let m,y;switch(i.w=l,i.h=c,e){case ai:case gi:a?(m=(h-l/g)/2,i.x=Rt((d-m)*g),i.y=Rt(f*g)):(y=(u-c/p)/2,i.x=Rt(d*p),i.y=Rt((f-y)*p));break;case Ni:i.x=Rt(d*p),i.y=Rt(f*g);break;default:m=(h-l)/2,y=(u-c)/2,i.x=Rt(d-m),i.y=Rt(f-y)}(i.x<0||i.x>l)&&(s=!1),(i.y<0||i.y>c)&&(s=!1),i.active=s}else i.x=t.x,i.y=t.y,i.w=r,i.h=o,i.active=s;t.baseActive=s}},Id.clear=function(){const{element:t,engine:e,backgroundColor:i,clearAlpha:n}=this;this.prepareStamp();const s=dt(t.width),r=dt(t.height);if(i)e.save(),e.fillStyle=i,e.globalCompositeOperation=wo,e.globalAlpha=1,e.fillRect(0,0,s,r),e.restore();else if(n){e.save();const i=mu(s,r),{engine:o,element:a}=i;o.drawImage(t,0,0,s,r,0,0,s,r),e.clearRect(0,0,s,r),e.globalAlpha=n,e.drawImage(a,0,0,s,r,0,0,s,r),e.restore(),yu(i)}else e.clearRect(0,0,s,r)},Id.compile=function(){this.sortGroups(),this.cleared||this.prepareStamp(),!this.dirtyFilters&&this.currentFilters||this.cleanFilters();const t=this.groupBuckets,e=t.length;for(let i,n=0;ns?(p[0]=dt((i-d*s)/2),p[1]=0,p[2]=dt(d*s),p[3]=dt(f*s)):(p[0]=0,p[1]=dt((n-f*t)/2),p[2]=dt(d*t),p[3]=dt(f*t));break;case gi:t=i/(d||1),s=n/(f||1),t0&&(this.paste||(this.paste=[]),p=this.paste,this.noDeltaUpdates||this.setDelta(this.delta),this.cleared||this.compiled||this.prepareStamp(),e.globalCompositeOperation=r,e.globalAlpha=o,this.setImageSmoothing(e),p[0]=dt(-h[0]*s),p[1]=dt(-h[1]*s),p[2]=dt(d*s),p[3]=dt(f*s),this.rotateDestination(e,...u),e.drawImage(l,0,0,d,f,...p));e.restore()}},Id.applyFilters=function(){const t=this.engine,e=t.getImageData(0,0,this.currentDimensions[0],this.currentDimensions[1]);this.preprocessFilters(this.currentFilters);const i=td.action({identifier:this.filterIdentifier,image:e,filters:this.currentFilters});i&&t.putImageData(i,0,0)},Id.stashOutputAction=function(){if(this.stashOutput){this.stashOutput=!1;const{currentDimensions:t,stashCoordinates:e,stashDimensions:i,engine:n}=this,[s,r]=t;let o=e?e[0]:0,a=e?e[1]:0,l=i?i[0]:s,c=i?i[1]:r;if((l.substring||c.substring||o.substring||a.substring||o||a||l!==s||c!==r)&&(l.substring&&(l=parseFloat(l)/100*s),(!yt(l)||l<=0)&&(l=1),l>s&&(l=s),c.substring&&(c=parseFloat(c)/100*r),(!yt(c)||c<=0)&&(c=1),c>r&&(c=r),o.substring&&(o=parseFloat(o)/100*s),(!yt(o)||o<0)&&(o=0),o+l>s&&(o=s-l),a.substring&&(a=parseFloat(a)/100*r),(!yt(a)||a<0)&&(a=0),a+c>r&&(a=r-c)),n.save(),n.setTransform(1,0,0,1,0,0),this.stashedImageData=n.getImageData(o,a,l,c),n.restore(),this.stashOutputAsAsset){const t=this.stashOutputAsAsset.substring?this.stashOutputAsAsset:`${this.name}-image`;this.stashOutputAsAsset=!1;const e=mu(),i=e.element;if(i.width=l,i.height=c,e.engine.putImageData(this.stashedImageData,0,0),this.stashedImage)this.stashedImage.src=i.toDataURL();else{const e=this.getController();if(e){const n=this,s=document.createElement(In);s.id=t,s.alt=`A cached image of the ${this.name} Cell`,s.onload=function(){e.canvasHold.appendChild(s),n.stashedImage=s,ld(`#${t}`)},s.src=i.toDataURL()}}yu(e)}}},Id.prepareStamp=function(){(this.dirtyScale||this.dirtyDimensions||this.dirtyStart||this.dirtyOffset||this.dirtyHandle)&&(this.dirtyPathObject=!0),this.dirtyScale&&this.cleanScale(),this.dirtyDimensions&&(this.cleanDimensions(),this.dirtyAssetSubscribers=!0),this.dirtyLock&&this.cleanLock(),this.dirtyStart&&this.cleanStart(),this.dirtyOffset&&this.cleanOffset(),this.dirtyHandle&&this.cleanHandle(),this.dirtyRotation&&this.cleanRotation(),(this.isBeingDragged||this.lockTo.includes(ys))&&(this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtyStampHandlePositions&&this.cleanStampHandlePositions(),this.dirtyPathObject&&this.cleanPathObject(),this.dirtyPositionSubscribers&&this.updatePositionSubscribers(),this.dirtyAssetSubscribers&&(this.dirtyAssetSubscribers=!1,this.notifySubscribers()),this.prepareStampTabsHelper()},Id.cleanPathObject=function(){if(this.dirtyPathObject=!1,!this.noPathUpdates||!this.pathObject){const t=this.pathObject=new Path2D,e=this.currentStampHandlePosition,i=this.currentScale,n=this.currentDimensions,s=-e[0]*i,r=-e[1]*i,o=n[0]*i,a=n[1]*i;t.rect(s,r,o,a)}},Id.updateHere=function(){const t=this.currentHost;if(t){this.here||(this.here={});const e=this.here,[i,n]=this.currentDimensions;e.w=i,e.h=n,e.x=-1e4,e.y=-1e4,e.active=!1;const s=t.here;if(s&&s.active){const{x:t,y:i}=s;this.pathObject&&!this.dirtyPathObject||this.cleanPathObject();const n=mu(),r=n.engine,[o,a]=this.currentStampPosition;n.rotateDestination(r,o,a,this);const l=r.isPointInPath(this.pathObject,t,i);if(yu(n),e.active=l,l){const[n,s]=this.currentStampHandlePosition,{flipUpend:r,flipReverse:l,scale:c}=this;let h=this.roll;if(c){let u=(t-o)/c,d=(i-a)/c;if(l&&(u=-u),r&&(d=-d),h){(l&&!r||!l&&r)&&(h=-h);const t=ku(u,d);t.rotate(-h),[u,d]=t,Au(t)}u+=n,d+=s,e.x=u,e.y=d}}}}};J.Cell=Cell;const Xd=t=>{const{canvasSupportsP3Color:e,displaySupportsP3Color:i}=ah;return t&&e&&i?Oi:Ro},Vector=function(t,e,i){return this.x=0,this.y=0,this.z=0,tc(t)&&this.set(t,e,i),this},Yd=Vector.prototype=rc();Yd.type=xa,Yd.getXYCoordinate=function(){return[this.x,this.y]},Yd.getXYZCoordinate=function(){return[this.x,this.y,this.z]},Yd.setX=function(t){if(!tc(t))throw new Error(`${this.name} Vector error - setX() arguments error: ${t}`);return this.x=t,this},Yd.setY=function(t){if(!tc(t))throw new Error(`${this.name} Vector error - setY() arguments error: ${t}`);return this.y=t,this},Yd.setZ=function(t){if(!tc(t))throw new Error(`${this.name} Vector error - setZ() arguments error: ${t}`);return this.z=t,this},Yd.setXY=function(t,e){if(!ec(t,e))throw new Error(`${this.name} Vector error - setXY() arguments error: ${t}, ${e}`);return this.x=t,this.y=e,this},Yd.set=function(t,e,i){return Zl(t)?this.setFromVector(t):mt(t)?this.setFromArray(t):ec(t,e)?this.setFromArray([t,e,i]):this},Yd.setFromArray=function(t){if(!mt(t))throw new Error(`${this.name} Vector error - setFromArray() arguments error: ${t}`);const[e,i,n]=t;return Ul(e)&&(this.x=e),Ul(i)&&(this.y=i),Ul(n)&&(this.z=n),this},Yd.setFromVector=function(t){if(!Zl(t))throw new Error(`${this.name} Vector error - setFromVector() arguments error: ${Lt(t)}`);const{x:e,y:i,z:n}=t;return Ul(e)&&(this.x=e),Ul(i)&&(this.y=i),Ul(n)&&(this.z=n),this},Yd.zero=function(){return this.x=0,this.y=0,this.z=0,this},Yd.vectorAdd=function(t=Xl){if(mt(t))return this.vectorAddArray(t);const{x:e,y:i,z:n}=t;return Ul(e)&&(this.x+=e),Ul(i)&&(this.y+=i),Ul(n)&&(this.z+=n),this},Yd.vectorAddArray=function(t=[]){const[e,i,n]=t;return Ul(e)&&(this.x+=e),Ul(i)&&(this.y+=i),Ul(n)&&(this.z+=n),this},Yd.vectorSubtract=function(t=Xl){if(mt(t))return this.vectorSubtractArray(t);const{x:e,y:i,z:n}=t;return Ul(e)&&(this.x-=e),Ul(i)&&(this.y-=i),Ul(n)&&(this.z-=n),this},Yd.vectorSubtractArray=function(t){const[e,i,n]=t;return Ul(e)&&(this.x-=e),Ul(i)&&(this.y-=i),Ul(n)&&(this.z-=n),this},Yd.scalarMultiply=function(t){if(!Ul(t))throw new Error(`${this.name} Vector error - scalarMultiply() argument not a number: ${t}`);return this.x*=t,this.y*=t,this.z*=t,this},Yd.vectorMultiply=function(t=Xl){if(mt(t))return this.vectorMultiplyArray(t);const{x:e,y:i,z:n}=t;return Ul(e)&&(this.x*=e),Ul(i)&&(this.y*=i),Ul(n)&&(this.z*=n),this},Yd.vectorMultiplyArray=function(t){const[e,i,n]=t;return Ul(e)&&(this.x*=e),Ul(i)&&(this.y*=i),Ul(n)&&(this.z*=n),this},Yd.scalarDivide=function(t){if(!Ul(t))throw new Error(`${this.name} Vector error - scalarDivide() argument not a number: ${t}`);if(!t)throw new Error(`${this.name} Vector error - scalarDivide() division by zero: ${t}`);return this.x/=t,this.y/=t,this.z/=t,this},Yd.getMagnitude=function(){return It(this.x*this.x+this.y*this.y+this.z*this.z)},Yd.rotate=function(t){if(!Ul(t))throw new Error(`${this.name} Vector error - rotate() argument not a number: ${t}`);let e=st(this.y,this.x);e+=.01745329251*t;const i=this.getMagnitude();return this.x=i*lt(e),this.y=i*Et(e),this},Yd.reverse=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},Yd.normalize=function(){const t=this.getMagnitude();return t>0&&(this.x/=t,this.y/=t,this.z/=t),this};const Gd=[],jd=function(t,e,i){Gd.length||Gd.push(new Vector);const n=Gd.shift();return n.set(t,e,i),n},zd=function(...t){t.forEach((t=>{t&&t.type===xa&&Gd.push(t.zero())}))},Nd=function(t,e,i){return new Vector(t,e,i)};J.Vector=Vector;const Quaternion=function(t=Xl){return this.n=t.n||1,this.v=Nd(),Tt(this),this.set(t),this},Vd=Quaternion.prototype=rc();Vd.type=ya,Vd.set=function(t=Xl){if(_l(t))return this.setFromQuaternion(t);if(nc(t.pitch,t.yaw,t.roll))return this.setFromEuler(t);const e=this.v,i=!(!tc(t.vector)&&!tc(t.v))&&(t.vector||t.v),n=!(!tc(t.scalar)&&!tc(t.n))&&(t.scalar||t.n||0),s=i?i.x||0:t.x||!1,r=i?i.y||0:t.y||!1,o=i?i.z||0:t.z||!1;return this.n=Ul(n)?n:this.n,e.x=Ul(s)?s:e.x,e.y=Ul(r)?r:e.y,e.z=Ul(o)?o:e.z,this},Vd.setFromQuaternion=function(t){if(!_l(t))throw new Error(`${this.name} Quaternion error - setFromQuaternion() bad argument: ${t}`);const e=this.v,i=t.v;return this.n=t.n,e.x=i.x,e.y=i.y,e.z=i.z,this},Vd.setFromEuler=function(t=Xl){const e=this.v,i=(t.pitch||t.x||0)*Dt,n=(t.yaw||t.y||0)*Dt,s=(t.roll||t.z||0)*Dt,r=lt(i/2),o=lt(n/2),a=lt(s/2),l=Et(i/2),c=Et(n/2),h=Et(s/2);return e.x=l*o*a+r*c*h,e.y=r*c*a+l*o*h,e.z=r*o*h-l*c*a,this.n=r*o*a-l*c*h,this},Vd.zero=function(){const t=this.v;return this.n=1,t.x=0,t.y=0,t.z=0,this},Vd.getMagnitude=function(){const t=this.v;return It(this.n*this.n+t.x*t.x+t.y*t.y+t.z*t.z)},Vd.normalize=function(){const t=this.getMagnitude(),e=this.v;if(!t)throw new Error(`${this.name} Quaternion error - normalize() division by zero: ${t}`);return this.n=Il(this.n/t),e.x=Il(e.x/t),e.y=Il(e.y/t),e.z=Il(e.z/t),this},Vd.quaternionMultiply=function(t){if(!_l(t))throw new Error(`${this.name} Quaternion error - quaternionMultiply() bad argument: ${t}`);const e=this.v,i=t.v,n=this.n,s=e.x,r=e.y,o=e.z,a=t.n,l=i.x,c=i.y,h=i.z;return this.n=n*a-s*l-r*c-o*h,e.x=n*l+s*a+r*h-o*c,e.y=n*c+r*a+o*l-s*h,e.z=n*h+o*a+s*c-r*l,this},Vd.getAngle=function(t){let e;return t=!!tc(t)&&t,e=2*it(this.n),t&&(e*=1/Dt),Il(e)},Vd.quaternionRotate=function(t){if(!_l(t))throw new Error(`${this.name} Quaternion error - quaternionRotate() bad argument: ${t}`);const e=Ud(t),i=Ud(this);return this.setFromQuaternion(e.quaternionMultiply(i)),Zd(e),Zd(i),this};const Wd=[],Ud=function(t){Wd.length||Wd.push(_d());const e=Wd.shift();return e.set(t),e},Zd=function(...t){t.forEach((t=>{t&&t.type===ya&&Wd.push(t.zero())}))},_d=function(t){return new Quaternion(t)};function Kd(t=Xl){bd(t),Sd(t),kd(t),Ad(t),vd(t),Cd(t),Od(t),Td(t);const e={domElement:Ol,pitch:0,yaw:0,offsetZ:0,css:null,classes:Ol,position:re,smoothFont:!0,checkForResize:!1,trackHere:Ol,activePadding:5,includeInTabNavigation:!1,moreContrastAction:null,otherContrastAction:null,reduceMotionAction:null,noPreferenceMotionAction:null,colorSchemeLightAction:null,colorSchemeDarkAction:null,reduceTransparencyAction:null,noPreferenceTransparencyAction:null,reduceDataAction:null,noPreferenceDataAction:null};t.defs=Kl(t.defs,e),t.packetExclusions=Ql(t.packetExclusions,["domElement","pathCorners","rotation"]),t.packetFunctions=Ql(t.packetFunctions,["onEnter","onLeave","onDown","onUp"]),t.processDOMPacketOut=function(t,e,i){return this.processFactoryPacketOut(t,e,i)},t.processFactoryPacketOut=function(t,e,i){let n=!0;return i.includes(t)||e!==this.defs[t]||(n=!1),n},t.finalizePacketOut=function(t,e){if(Vl(this.domElement)){const e=this.domElement,i=e.cloneNode(!0);i.querySelectorAll(fi).forEach((t=>i.removeChild(t))),t.outerHTML=i.outerHTML,t.host=e.parentElement.id}return t=this.handlePacketAnchor(t,e)},t.postCloneAction=function(t){return this.onEnter&&(t.onEnter=this.onEnter),this.onLeave&&(t.onLeave=this.onLeave),this.onDown&&(t.onDown=this.onDown),this.onUp&&(t.onUp=this.onUp),t};const i=t.setters,n=t.deltaSetters;i.trackHere=function(t){var e;tc(t)&&(t?(Ql(oh,this.name),"local"===t&&(Zl(e=this)&&(e.localMouseListener&&e.localMouseListener(),e.here||(e.here={}),e.here.originalWidth=e.currentDimensions[0],e.here.originalHeight=e.currentDimensions[1],e.localMouseListener=_c(Cs,(function(t){e.here&&(e.here.x=Rt(parseFloat(t.offsetX)),e.here.y=Rt(parseFloat(t.offsetY)))}),e.domElement)))):(Jl(oh,this.name),function(t){Zl(t)&&(t.localMouseListener&&t.localMouseListener(),t.localMouseListener=!1)}(this)),this.trackHere=t)},i.position=function(t){this.position=t,this.dirtyPosition=!0},i.smoothFont=function(t){this.smoothFont=t,this.dirtySmoothFont=!0},i.visibility=function(t){this.visibility=t,this.dirtyVisibility=!0},i.offsetZ=function(t){this.offsetZ=t,this.dirtyOffsetZ=!0},n.offsetZ=function(t){this.offsetZ+=t,this.dirtyOffsetZ=!0},i.roll=function(t){this.roll=El(t),this.dirtyRotation=!0},n.roll=function(t){this.roll=El(this.roll+t),this.dirtyRotation=!0},i.pitch=function(t){this.pitch=El(t),this.dirtyRotation=!0},n.pitch=function(t){this.pitch=El(this.pitch+t),this.dirtyRotation=!0},i.yaw=function(t){this.yaw=El(t),this.dirtyRotation=!0},n.yaw=function(t){this.yaw=El(this.yaw+t),this.dirtyRotation=!0},i.css=function(t){this.css=this.css?Kl(this.css,t):t,this.dirtyCss=!0},i.classes=function(t){this.classes=t,this.dirtyClasses=!0},i.domAttributes=function(t){this.updateDomAttributes(t)},i.includeInTabNavigation=function(t){const e=this.domElement;e&&(this.includeInTabNavigation=t,t?e.setAttribute(Fa,0):e.setAttribute(Fa,-1))},t.updateDomAttributes=function(t,e){const i=this.domElement;return i&&(t.substring&&tc(e)?tc(e)&&e?i.setAttribute(t,e):i.removeAttribute(t):Zl(t)&&ht(t).forEach((([t,e])=>{tc(e)&&e?i.setAttribute(t,e):i.removeAttribute(t)}))),this},t.initializeDomLayout=function(t){this.modifyConstructorInputForAnchorButton(t);const e=t.domElement;if(e){const i=e.style;if(i.boxSizing=Ge,t.setInitialDimensions){const n=e.getBoundingClientRect();this.currentDimensions[0]=n.width,this.currentDimensions[1]=n.height,t.width=n.width,t.height=n.height,e.className&&(t.classes=e.className);let s=!1;if(t&&t.host&&(s=t.host,s.substring&&o[s]&&(s=o[s])),s&&s.domElement){const e=s.domElement.getBoundingClientRect();e&&(t.startX=n.left-e.left,t.startY=n.top-e.top)}if(this.type===va){const e=parseFloat(i.perspective),{perspective:n,perspectiveX:s,perspectiveY:r,perspectiveZ:o}=t;ec(n,o)||(t.perspectiveZ=yt(e)?e:0);const a=i.perspectiveOrigin;if(a.length){const[e,i]=a.split(Oo);ec(n,s)||(t.perspectiveX=e),ec(n,r)||(t.perspectiveY=i)}}}}},t.addClasses=function(t){if(t.substring){const e=`${this.classes} ${t}`.trim().replace(Je,Oo);e!==this.classes&&(this.classes=e,this.dirtyClasses=!0)}return this},t.removeClasses=function(t){if(t.substring){const e=t.split();let i,n=this.classes;e.forEach((t=>{i=new RegExp(" ?"+t+" ?"),n=n.replace(i,Oo),n=n.trim(),n=n.replace(Je,Oo)})),n!==this.classes&&(this.classes=n,this.dirtyClasses=!0)}return this},t.addPathCorners=function(){const t=this.domElement;if(t&&!this.noUserInteraction&&!Hs.includes(t.tagName)){const e=function(){const t=document.createElement(Di),e=t.style;return e.width=0,e.height=0,e.position=re,e.margin=0,e.border=0,e.padding=0,t.setAttribute("data-scrawl-corner-div","sc"),t.setAttribute(Ae,el),t},i=this.pathCorners,n=e(),s=e(),r=e(),o=e();n.style.top=Us,n.style.left=Us,s.style.top=Us,s.style.left=Zs,r.style.top=Zs,r.style.left=Zs,o.style.top=Zs,o.style.left=Us,t.appendChild(n),t.appendChild(s),t.appendChild(r),t.appendChild(o),i.push(n),i.push(s),i.push(r),i.push(o),this.currentCornersData||(this.currentCornersData=[])}return this},t.checkCornerPositions=function(t){const e=this.pathCorners;if(4===e.length){const i=this.getHere(),n=ah.scrollX-(i.offsetX||0),s=ah.scrollY-(i.offsetY||0),r=[];let o,a;const l=function(t){a=t[0],a?(r.push(Rt(a.left+n)),r.push(Rt(a.top+s))):r.push(0,0)};switch(t){case"topLeft":return o=e[0].getClientRects(),l(o),r;case"topRight":return o=e[1].getClientRects(),l(o),r;case"bottomRight":return o=e[2].getClientRects(),l(o),r;case"bottomLeft":return o=e[3].getClientRects(),l(o),r;default:return e.forEach((t=>{Vl(t)&&(o=t.getClientRects(),l(o))})),r}}},t.getCornerCoordinate=function(t){return di.includes(t)?this.checkCornerPositions(t):[].concat(this.currentStampPosition)},t.cleanPathObject=function(){if(this.dirtyPathObject=!1,this.domElement&&!this.noUserInteraction)if(this.pathCorners.length||this.addPathCorners(),this.pathCorners.length){this.currentCornersData||(this.currentCornersData=[]);const t=this.currentCornersData;t.length=0,t.push(...this.checkCornerPositions());const e=this.pathObject=new Path2D;e.moveTo(t[0],t[1]),e.lineTo(t[2],t[3]),e.lineTo(t[4],t[5]),e.lineTo(t[6],t[7]),e.closePath()}else{const t=this.pathObject=new Path2D;t.moveTo(0,0),t.lineTo(10,0),t.lineTo(0,10),t.lineTo(-10,0),t.closePath()}},t.checkHit=function(t=[]){if(this.noUserInteraction)return!1;this.pathObject&&!this.dirtyPathObject||this.cleanPathObject();const e=mt(t)?t:[t],i=mu(),n=i.engine;let s,r;return e.some((t=>{if(mt(t))s=t[0],r=t[1];else{if(!ec(t,t.x,t.y))return!1;s=t.x,r=t.y}return!(!yt(s)||!yt(r))&&n.isPointInPath(this.pathObject,s,r)}),this)?(yu(i),{x:s,y:r,artefact:this}):(yu(i),!1)},t.cleanRotation=function(){this.dirtyRotation=!1,this.rotation&&_l(this.rotation)||(this.rotation=_d()),this.currentRotation&&_l(this.rotation)||(this.currentRotation=_d());const t=this.rotation;t.setFromEuler({pitch:this.pitch||0,yaw:this.yaw||0,roll:this.roll||0}),1!==t.getMagnitude()&&t.normalize();const e=Ud(),i=this.path,n=this.mimic,s=this.pivot,r=this.lockTo;i&&r.includes(Vs)?e.set(t):n&&this.useMimicRotation&&r.includes(ps)?tc(n.currentRotation)?(e.set(n.currentRotation),this.addOwnRotationToMimic&&e.quaternionRotate(t)):this.dirtyMimicRotation=!0:(e.set(t),s&&this.addPivotRotation&&r.includes(Js)&&(tc(s.currentRotation)?e.quaternionRotate(s.currentRotation):this.dirtyPivotRotation=!0)),this.currentRotation.set(e),Zd(e),this.dirtyPositionSubscribers=!0,this.mimicked&&this.mimicked.length&&(this.dirtyMimicRotation=!0)},t.cleanOffsetZ=function(){this.dirtyOffsetZ=!1},t.cleanContent=function(){this.dirtyContent=!1,this.domElement&&(this.dirtyDimensions=!0)},t.cleanDisplayShape=Bl,t.cleanDisplayArea=Bl,t.prepareStamp=function(){(this.dirtyScale||this.dirtyDimensions||this.dirtyStart||this.dirtyOffset||this.dirtyHandle||this.dirtyRotation)&&(this.dirtyPathObject=!0),this.dirtyContent&&this.cleanContent(),this.dirtyScale&&this.cleanScale(),this.dirtyDimensions&&this.cleanDimensions(),this.dirtyDisplayArea&&this.cleanDisplayArea(),this.dirtyDisplayShape&&this.cleanDisplayShape(),this.dirtyLock&&this.cleanLock(),this.dirtyStart&&this.cleanStart(),this.dirtyOffset&&this.cleanOffset(),this.dirtyOffsetZ&&this.cleanOffsetZ(),this.dirtyHandle&&this.cleanHandle(),this.dirtyRotation&&this.cleanRotation(),(this.isBeingDragged||this.lockTo.includes(ys)||this.lockTo.includes(Ns))&&(this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0),this.pivoted.length&&(this.dirtyStampPositions=!0),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtyStampHandlePositions&&this.cleanStampHandlePositions(),this.dirtyPathObject&&this.cleanPathObject(),this.prepareStampTabsHelper()},t.stamp=function(){if(!this.domElement)return!1;const[t,e]=this.currentStampPosition,[i,n]=this.currentStampHandlePosition,s=this.currentScale,r=this.currentRotation,o=`${i}px ${n}px 0`;let a=`translate(${t-i}px,${e-n}px)`;if(this.yaw||this.pitch||this.roll||this.pivot&&this.addPivotRotation||this.mimic&&this.useMimicRotation||this.path&&this.addPathRotation){const t=r.v;a+=` rotate3d(${t.x},${t.y},${t.z},${r.getAngle(!1)}rad)`}this.offsetZ&&(a+=` translateZ(${this.offsetZ}px)`),1!==s&&(a+=` scale(${s},${s})`),a!==this.currentTransformString&&(this.currentTransformString=a,this.dirtyTransform=!0),o!==this.currentTransformOriginString&&(this.currentTransformOriginString=o,this.dirtyTransformOrigin=!0),(this.dirtyTransform||this.dirtyPerspective||this.dirtyPosition||this.dirtyDomDimensions||this.dirtyTransformOrigin||this.dirtyVisibility||this.dirtySmoothFont||this.dirtyCss||this.dirtyClasses||this.domShowRequired)&&(this.domShowRequired=!1,function(t=Ol){t&&t.substring&&Ql($h,t)}(this.name),((t=!0)=>{Mh=t})(!0),uc(!0)),this.dirtyPositionSubscribers&&this.updatePositionSubscribers(),(this.dirtyMimicRotation||this.dirtyPivotRotation)&&(this.dirtyMimicRotation=!1,this.dirtyPivotRotation=!1,this.dirtyRotation=!0),this.dirtyMimicScale&&(this.dirtyMimicScale=!1,this.dirtyScale=!0)},t.initializeAccessibility=function(){this.reduceMotionAction=Bl,this.noPreferenceMotionAction=Bl,this.colorSchemeLightAction=Bl,this.colorSchemeDarkAction=Bl,this.reduceTransparencyAction=Bl,this.noPreferenceTransparencyAction=Bl,this.reduceDataAction=Bl,this.noPreferenceDataAction=Bl,this.moreContrastAction=Bl,this.otherContrastAction=Bl},i.moreContrastAction=function(t){Wl(t)&&(this.moreContrastAction=t)},t.setMoreContrastAction=function(t){Wl(t)&&(this.moreContrastAction=t)},i.otherContrastAction=function(t){Wl(t)&&(this.otherContrastAction=t)},t.setOtherContrastAction=function(t){Wl(t)&&(this.otherContrastAction=t)},t.contrastActions=function(){const t=this.here;if(tc(t)){const e=t.prefersContrast;tc(e)&&(e?this.moreContrastAction():this.otherContrastAction())}},i.reduceMotionAction=function(t){Wl(t)&&(this.reduceMotionAction=t)},t.setReduceMotionAction=function(t){Wl(t)&&(this.reduceMotionAction=t)},i.noPreferenceMotionAction=function(t){Wl(t)&&(this.noPreferenceMotionAction=t)},t.setNoPreferenceMotionAction=function(t){Wl(t)&&(this.noPreferenceMotionAction=t)},t.reducedMotionActions=function(){const t=this.here;if(tc(t)){const e=t.prefersReducedMotion;tc(e)&&(e?this.reduceMotionAction():this.noPreferenceMotionAction())}},i.colorSchemeLightAction=function(t){Wl(t)&&(this.colorSchemeLightAction=t)},t.setColorSchemeLightAction=function(t){Wl(t)&&(this.colorSchemeLightAction=t)},i.colorSchemeDarkAction=function(t){Wl(t)&&(this.colorSchemeDarkAction=t)},t.setColorSchemeDarkAction=function(t){Wl(t)&&(this.colorSchemeDarkAction=t)},t.colorSchemeActions=function(){const t=this.here;if(tc(t)){const e=t.prefersDarkColorScheme;tc(e)&&(e?this.colorSchemeDarkAction():this.colorSchemeLightAction())}},i.reduceTransparencyAction=function(t){Wl(t)&&(this.reduceTransparencyAction=t)},t.setReduceTransparencyAction=function(t){Wl(t)&&(this.reduceTransparencyAction=t)},i.noPreferenceTransparencyAction=function(t){Wl(t)&&(this.noPreferenceTransparencyAction=t)},t.setNoPreferenceTransparencyAction=function(t){Wl(t)&&(this.noPreferenceTransparencyAction=t)},t.reducedTransparencyActions=function(){const t=this.here;if(tc(t)){const e=t.prefersReduceTransparency;tc(e)&&(e?this.reduceTransparencyAction():this.noPreferenceTransparencyAction())}},i.reduceDataAction=function(t){Wl(t)&&(this.reduceDataAction=t)},t.setReduceDataAction=function(t){Wl(t)&&(this.reduceDataAction=t)},i.noPreferenceDataAction=function(t){Wl(t)&&(this.noPreferenceDataAction=t)},t.setNoPreferenceDataAction=function(t){Wl(t)&&(this.noPreferenceDataAction=t)},t.reducedDataActions=function(){const t=this.here;if(tc(t)){const e=t.prefersReduceData;tc(e)&&(e?this.reduceDataAction():this.noPreferenceDataAction())}},t.checkAccessibilityValues=function(){this.contrastActions(),this.reducedMotionActions(),this.colorSchemeActions(),this.reducedTransparencyActions(),this.reducedDataActions()},t.apply=function(){Bh(),this.prepareStamp(),this.stamp(),Xh(this.name),this.dirtyPathObject=!0,this.cleanPathObject()}}function qd(t=Xl){t.defs=Kl(t.defs,{breakToBanner:3,breakToLandscape:1.5,breakToPortrait:.65,breakToSkyscraper:.35,actionBannerShape:null,actionLandscapeShape:null,actionRectangleShape:null,actionPortraitShape:null,actionSkyscraperShape:null,breakToSmallest:2e4,breakToSmaller:8e4,breakToLarger:18e4,breakToLargest:32e4,actionSmallestArea:null,actionSmallerArea:null,actionRegularArea:null,actionLargerArea:null,actionLargestArea:null}),t.packetFunctions=Ql(t.packetFunctions,["actionBannerShape","actionLandscapeShape","actionRectangleShape","actionPortraitShape","actionSkyscraperShape","actionSmallestArea","actionSmallerArea","actionRegularArea","actionLargerArea","actionLargestArea"]);const e=t.getters,i=t.setters;e.displayShape=function(){return this.currentDisplayShape},e.displayShapeBreakpoints=function(){return{breakToBanner:this.breakToBanner,breakToLandscape:this.breakToLandscape,breakToPortrait:this.breakToPortrait,breakToSkyscraper:this.breakToSkyscraper,breakToSmallest:this.breakToSmallest,breakToSmaller:this.breakToSmaller,breakToLarger:this.breakToLarger,breakToLargest:this.breakToLargest}},i.displayShapeBreakpoints=function(t=Xl){for(const[e,i]of ht(t))if(Ul(i))switch(e){case"breakToBanner":this.breakToBanner=i;break;case"breakToLandscape":this.breakToLandscape=i;break;case"breakToPortrait":this.breakToPortrait=i;break;case"breakToSkyscraper":this.breakToSkyscraper=i;break;case"breakToSmallest":this.breakToSmallest=i;break;case"breakToSmaller":this.breakToSmaller=i;break;case"breakToLarger":this.breakToLarger=i;break;case"breakToLargest":this.breakToLargest=i}this.dirtyDisplayShape=!0,this.dirtyDisplayArea=!0},t.setDisplayShapeBreakpoints=i.displayShapeBreakpoints,i.breakToBanner=function(t){Ul(t)&&(this.breakToBanner=t),this.dirtyDisplayShape=!0},i.breakToLandscape=function(t){Ul(t)&&(this.breakToLandscape=t),this.dirtyDisplayShape=!0},i.breakToPortrait=function(t){Ul(t)&&(this.breakToPortrait=t),this.dirtyDisplayShape=!0},i.breakToSkyscraper=function(t){Ul(t)&&(this.breakToSkyscraper=t),this.dirtyDisplayShape=!0},i.breakToSmallest=function(t){Ul(t)&&(this.breakToSmallest=t),this.dirtyDisplayArea=!0},i.breakToSmaller=function(t){Ul(t)&&(this.breakToSmaller=t),this.dirtyDisplayArea=!0},i.breakToLarger=function(t){Ul(t)&&(this.breakToLarger=t),this.dirtyDisplayArea=!0},i.breakToLargest=function(t){Ul(t)&&(this.breakToLargest=t),this.dirtyDisplayArea=!0},i.actionBannerShape=function(t){Wl(t)&&(this.actionBannerShape=t),this.dirtyDisplayShape=!0},t.setActionBannerShape=i.actionBannerShape,i.actionLandscapeShape=function(t){Wl(t)&&(this.actionLandscapeShape=t),this.dirtyDisplayShape=!0},t.setActionLandscapeShape=i.actionLandscapeShape,i.actionRectangleShape=function(t){Wl(t)&&(this.actionRectangleShape=t),this.dirtyDisplayShape=!0},t.setActionRectangleShape=i.actionRectangleShape,i.actionPortraitShape=function(t){Wl(t)&&(this.actionPortraitShape=t),this.dirtyDisplayShape=!0},t.setActionPortraitShape=i.actionPortraitShape,i.actionSkyscraperShape=function(t){Wl(t)&&(this.actionSkyscraperShape=t),this.dirtyDisplayShape=!0},t.setActionSkyscraperShape=i.actionSkyscraperShape,i.actionSmallestArea=function(t){Wl(t)&&(this.actionSmallestArea=t),this.dirtyDisplayArea=!0},t.setActionSmallestArea=i.actionSmallestArea,i.actionSmallerArea=function(t){Wl(t)&&(this.actionSmallerArea=t),this.dirtyDisplayArea=!0},t.setActionSmallerArea=i.actionSmallerArea,i.actionRegularArea=function(t){Wl(t)&&(this.actionRegularArea=t),this.dirtyDisplayArea=!0},t.setActionRegularArea=i.actionRegularArea,i.actionLargerArea=function(t){Wl(t)&&(this.actionLargerArea=t),this.dirtyDisplayArea=!0},t.setActionLargerArea=i.actionLargerArea,i.actionLargestArea=function(t){Wl(t)&&(this.actionLargestArea=t),this.dirtyDisplayArea=!0},t.setActionLargestArea=i.actionLargestArea,t.initializeDisplayShapeActions=function(){this.actionBannerShape=Bl,this.actionLandscapeShape=Bl,this.actionRectangleShape=Bl,this.actionPortraitShape=Bl,this.actionSkyscraperShape=Bl,this.currentDisplayShape=Ol,this.dirtyDisplayShape=!0,this.actionSmallestArea=Bl,this.actionSmallerArea=Bl,this.actionRegularArea=Bl,this.actionLargerArea=Bl,this.actionLargestArea=Bl,this.currentDisplayArea=Ol,this.dirtyDisplayArea=!0},t.cleanDisplayShape=function(){this.dirtyDisplayShape=!1;const[t,e]=this.currentDimensions;if(t>0&&e>0){const i=t/e,n=this.currentDisplayShape,s=this.breakToBanner,r=this.breakToLandscape,o=this.breakToPortrait,a=this.breakToSkyscraper;return i>s?n!==Fe&&(this.currentDisplayShape=Fe,this.actionBannerShape(),!0):i>r?n!==Zn&&(this.currentDisplayShape=Zn,this.actionLandscapeShape(),!0):i0&&e>0){const i=t*e,n=this.currentDisplayArea,s=this.breakToLargest,r=this.breakToLarger,o=this.breakToSmaller,a=this.breakToSmallest;return i>s?n!==Kn&&(this.currentDisplayArea=Kn,this.actionLargestArea(),!0):i>r?n!==_n&&(this.currentDisplayArea=_n,this.actionLargerArea(),!0):i{const i=parseInt(t.getAttribute(bi),10),n=parseInt(e.getAttribute(bi),10);return in?1:0})),t.forEach((t=>e.appendChild(t))),e.setAttribute(ke,"false")},Qd.reorderTextElements=function(){this.dirtyTextTabOrder=!1;const t=[],e=this.textHold;for(e.setAttribute(ke,"true");e.firstChild;)t.push(e.removeChild(e.firstChild));t.sort(((t,e)=>{const i=parseInt(t.getAttribute(bi),10),n=parseInt(e.getAttribute(bi),10);return in?1:0})),t.forEach((t=>e.appendChild(t))),e.setAttribute(ke,"false")},Qd.render=function(){this.clear(),this.compile(),this.show()},Qd.cleanCells=function(){this.dirtyCells=!1;const t=Mc(),e=Mc(),i=Mc(),{cells:n,cellBatchesClear:s,cellBatchesCompile:r,cellBatchesShow:o}=this;let a,l,c,h,u;for(h=0,u=n.length;he.appendChild(t))),this.dirtyContent=!0}},df.content=function(t){const e=this.domElement;if(Vl(e)){const i=e.querySelectorAll(fi);e.innerHTML=t,i.forEach((t=>e.appendChild(t))),this.dirtyContent=!0}},uf.cleanDimensionsAdditionalActions=function(){this.dirtyDomDimensions=!0},uf.addCanvas=function(t=Xl){if(this.canvas)return this.canvas;{const e=document.createElement(Ve),i=this.domElement;e.id=`${this.name}-canvas`;const n=i.getBoundingClientRect();i.parentNode.insertBefore(e,this.domElement);const s=sf({name:`${this.name}-canvas`,domElement:e,position:re,width:n.width,height:n.height,mimic:this.name,lockTo:ps,useMimicDimensions:!0,useMimicScale:!0,useMimicStart:!0,useMimicHandle:!0,useMimicOffset:!0,useMimicRotation:!0,addOwnDimensionsToMimic:!1,addOwnScaleToMimic:!1,addOwnStartToMimic:!1,addOwnHandleToMimic:!1,addOwnOffsetToMimic:!1,addOwnRotationToMimic:!1});return s.set(t),this.canvas=s,s}};const ff=function(t){return!!t&&new Element(t)};J.Element=Element;const Stack=function(t=Xl){this.makeName(t.name),this.register(),this.initializePositions(),this.initializeCascade(),this.dimensions[0]=300,this.dimensions[1]=150,this.pathCorners=[],this.css={},this.here={},this.perspective={x:_s,y:_s,z:0},this.dirtyPerspective=!0,this.initializeDomLayout(t);const e=yd({name:this.name,host:this.name});this.addGroups(e.name),this.set(this.defs),this.initializeDisplayShapeActions(),this.initializeAccessibility(),this.set(t);const i=this.domElement;if(i){i.dataset.isResponsive&&(this.isResponsive=!0),i.getAttribute(mi)===ho&&zh(this.name)}return this},pf=Stack.prototype=rc();pf.type=va,pf.lib="stack",pf.isArtefact=!0,pf.isAsset=!1,nh(pf),Hd(pf),Kd(pf),qd(pf);const gf={position:eo,perspective:null,trackHere:Wo,isResponsive:!1,containElementsInHeight:!1};pf.defs=Kl(pf.defs,gf),pf.stringifyFunction=Bl,pf.processPacketOut=Bl,pf.finalizePacketOut=Bl,pf.saveAsPacket=function(){return`[${this.name}, ${this.type}, ${this.lib}, {}]`},pf.clone=$l,pf.factoryKill=function(){const t=this.name;Nh(t),Jl(oh,t),v[t]&&v[t].kill(),Mt(o).forEach((e=>{e.host===t&&e.kill()})),this.domElement.remove()};const mf=pf.getters,yf=pf.setters,bf=pf.deltaSetters;mf.perspectiveX=function(){return this.perspective.x},mf.perspectiveY=function(){return this.perspective.y},mf.perspectiveZ=function(){return this.perspective.z},yf.perspectiveX=function(t){this.perspective.x=t,this.dirtyPerspective=!0},yf.perspectiveY=function(t){this.perspective.y=t,this.dirtyPerspective=!0},yf.perspectiveZ=function(t){this.perspective.z=t,this.dirtyPerspective=!0},yf.perspective=function(t=Xl){this.perspective.x=tc(t.x)?t.x:this.perspective.x,this.perspective.y=tc(t.y)?t.y:this.perspective.y,this.perspective.z=tc(t.z)?t.z:this.perspective.z,this.dirtyPerspective=!0},bf.perspectiveX=function(t){this.perspective.x=Rl(this.perspective.x,t),this.dirtyPerspective=!0},bf.perspectiveY=function(t){this.perspective.y=Rl(this.perspective.y,t),this.dirtyPerspective=!0},mf.group=function(){return v[this.name]},pf.updateArtefacts=function(t=Xl){this.groupBuckets.forEach((e=>{e.artefactCalculateBuckets.forEach((e=>{t.dirtyScale&&(e.dirtyScale=!0),t.dirtyDimensions&&(e.dirtyDimensions=!0),t.dirtyLock&&(e.dirtyLock=!0),t.dirtyStart&&(e.dirtyStart=!0),t.dirtyOffset&&(e.dirtyOffset=!0),t.dirtyHandle&&(e.dirtyHandle=!0),t.dirtyRotation&&(e.dirtyRotation=!0),t.dirtyPathObject&&(e.dirtyPathObject=!0)}))}))},pf.cleanDimensionsAdditionalActions=function(){this.groupBuckets&&this.updateArtefacts({dirtyDimensions:!0,dirtyPath:!0,dirtyStart:!0,dirtyHandle:!0}),this.dirtyDomDimensions=!0,this.dirtyPath=!0,this.dirtyStart=!0,this.dirtyHandle=!0,this.dirtyDisplayShape=!0,this.dirtyDisplayArea=!0},pf.cleanPerspective=function(){this.dirtyPerspective=!1;const t=this.perspective;this.domPerspectiveString=`perspective-origin: ${t.x} ${t.y}; perspective: ${t.z}px;`,this.domShowRequired=!0,this.groupBuckets&&this.updateArtefacts({dirtyHandle:!0,dirtyPathObject:!0})},pf.checkResponsive=function(){this.isResponsive&&this.trackHere&&(this.currentVportWidth||(this.currentVportWidth=ah.w),this.currentVportHeight||(this.currentVportHeight=ah.h),this.dirtyHeight&&this.containElementsInHeight&&(this.dirtyHeight=!1),this.currentVportWidth!==ah.w&&(this.currentVportWidth=ah.w,this.containElementsInHeight&&(this.dirtyHeight=!0)),this.currentVportHeight!==ah.h&&(this.currentVportHeight=ah.h))},pf.clear=function(){this.checkResponsive()},pf.compile=function(){this.sortGroups(),this.prepareStamp(),this.stamp(),this.groupBuckets.forEach((t=>t.stamp()))},pf.show=function(){Xh()},pf.render=function(){this.compile(),this.show()},pf.addExistingDomElements=function(t){if(tc(t)){let e,i,n,s;const r=t.substring?document.querySelectorAll(t):[].concat(t);for(n=0,s=r.length;n{null!=t.getAttribute(yi)||Nl(t)||"SCRIPT"==t.tagName?t.setAttribute(mi,e):(n=t.getBoundingClientRect(),s=at(t),r=parseFloat(s.marginTop)+parseFloat(s.borderTopWidth)+parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)+parseFloat(s.borderBottomWidth)+parseFloat(s.marginBottom),a=a||n.top-i.top,o={name:t.id||t.getAttribute(Os),domElement:t,group:e,host:e,position:re,width:n.width,height:n.height,startX:n.left-i.left,startY:a,classes:t.className?t.className:Ol},a+=r+n.height,ff(o))}))},vf=function(t=Xl){let e,i,n,s,r,a=re;e=t.element&&t.element.substring?document.querySelector(t.element):Vl(t.element)?t.element:document.createElement(Di),t.host&&t.host.substring?(i=document.querySelector(t.host),i||(i=document.body)):i=Vl(t.host)?t.host:tc(e.parentElement)?e.parentElement:document.body,tc(t.width)&&(e.style.width=t.width.toFixed?`${t.width}px`:t.width),tc(t.height)&&(e.style.height=t.height.toFixed?`${t.height}px`:t.height),r=t.name||e.id||e.getAttribute(Os)||Ol,r||(r=Gl()),e.id=r,e.setAttribute(yi,yi),i&&null!=i.getAttribute(yi)?(n=o[i.id],s=n?n.name:ho):s=ho,e.setAttribute(mi,s),s===ho&&(a=eo),e.parentElement&&i.id===e.parentElement.id||i.appendChild(e);const l=Sf({name:r,domElement:e,group:s,host:s,position:a,setInitialDimensions:!0});return Af(e,r),Array.from(e.childNodes).forEach((t=>{var e;t.id&&(e=t.id,Gh.includes(e))&&Nh(t.id)})),delete t.name,delete t.element,delete t.host,delete t.width,delete t.height,l.set(t),l},Cf=function(t){const e=document.querySelector(`#${t}`),i=T[t];if(i){if(null!=e.dataset.scrawlGroup)return i;M(t)}if(e){return kf(e)}},Pf=function(){!function(t="[data-scrawl-stack]"){document.querySelectorAll(t).forEach((t=>kf(t)))}(),function(t="[data-scrawl-canvas]"){let e;document.querySelectorAll(t).forEach(((t,i)=>{e=rf(t),i||cf(e)}))}(),Wc(),Bh(),vh(),uc(!0),Hh()},xf=function(t){return t.length?t:Vh()},wf=function(t,e){let i,n,s;for(i=0,n=t.length;i{const n=nt({},t);n.name=`${n.name}_${i.name}`,n.target=i,e.push(new RenderAnimation(n))})),e}e=t.target&&t.target.substring?o[t.target]:t.target}else e={clear:Of,compile:Df,show:Ff,checkAccessibilityValues:Bl};this.makeName(t.name),this.order=tc(t.order)?t.order:this.defs.order,this.onRun=t.onRun||Bl,this.onHalt=t.onHalt||Bl,this.onKill=t.onKill||Bl,this.maxFrameRate=t.maxFrameRate||60,this.lastRun=0,this.chokedAnimation=!0,this.target=e,this.commence=t.commence||Bl,this.afterClear=t.afterClear||Bl,this.afterCompile=t.afterCompile||Bl,this.afterShow=t.afterShow||Bl,this.afterCreated=t.afterCreated||Bl,this.error=t.error||Bl,this.readyToInitialize=!0,this.fn=function(){this.noTarget?(this.commence(),this.afterClear(),this.afterCompile(),this.afterShow(),this.readyToInitialize&&(this.afterCreated(this),this.readyToInitialize=!1)):this.isRunning()&&(this.commence(),this.target.clear(),this.afterClear(),this.target.compile(),this.afterCompile(),this.target.show(),this.afterShow(),this.readyToInitialize&&(this.target.checkAccessibilityValues(),this.afterCreated(this),this.readyToInitialize=!1))},this.register();const i=t.observer||!1;return i&&setTimeout((()=>{zl(i)?this.observer=Zc(this,this.target):this.observer=Zc(this,this.target,i)}),0),t.delay||this.run(),this},Tf=RenderAnimation.prototype=rc();Tf.type=ka,Tf.lib=me,Tf.isArtefact=!1,Tf.isAsset=!1,nh(Tf);Tf.defs=Kl(Tf.defs,{order:1,maxFrameRate:60,onRun:null,onHalt:null,onKill:null,commence:null,afterClear:null,afterCompile:null,afterShow:null,afterCreated:null,error:null,target:null}),Tf.stringifyFunction=Bl,Tf.processPacketOut=Bl,Tf.finalizePacketOut=Bl,Tf.saveAsPacket=function(){return`[${this.name}, ${this.type}, ${this.lib}, {}]`},Tf.clone=$l,Tf.kill=function(){return this.onKill(),zc(this.name),this.deregister(),!0},Tf.run=function(){return this.onRun(),jc(this.name),this.target&&this.target.checkAccessibilityValues(),setTimeout((()=>Ic()),20),this},Tf.start=function(){return this.readyToInitialize=!0,this.run()},Tf.isRunning=function(){return Nc(this.name)},Tf.halt=function(){return this.onHalt(),zc(this.name),this},Tf.updateOnce=function(){return this.isRunning()||(this.run(),setTimeout((()=>this.halt()),0)),this},Tf.updateHook=function(t="",e){switch(t){case"commence":this.commence=e||Bl;break;case"afterClear":this.afterClear=e||Bl;break;case"afterCompile":this.afterCompile=e||Bl;break;case"afterShow":this.afterShow=e||Bl;break;case"afterCreated":this.afterCreated=e||Bl;break;case"error":this.error=e||Bl}};const Hf=function(t){return!!t&&new RenderAnimation(t)};J.RenderAnimation=RenderAnimation;const UnstackedElement=function(t){const e=t.id||t.name;return this.makeName(e),this.register(),t.setAttribute("data-scrawl-name",this.name),this.domElement=t,this.elementComputedStyles=at(t),this.hostStyles={},this.canvasStartX=0,this.canvasStartY=0,this.canvasWidth=0,this.canvasHeight=0,this.canvasZIndex=0,this},Ef=UnstackedElement.prototype=rc();Ef.type="UnstackedElement",Ef.lib="unstackedelement",Ef.isArtefact=!1,Ef.isAsset=!1,nh(Ef);Ef.defs=Kl(Ef.defs,{canvasOnTop:!1}),Ef.demolish=function(){return!0},Ef.addCanvas=function(t=Xl){if(!this.canvas){const e=document.createElement(Ve),i=this.domElement,n=i.style;"static"===n.position&&(n.position=eo),e.id=`${this.name}-canvas`,i.prepend(e);const s=sf({name:`${this.name}-canvas`,domElement:e,position:re});return this.canvas=s,s.set(t),this.updateCanvas(),s}},Ef.checkElementStyleValues=function(){const t={},e=this.domElement,i=this.canvas;if(e&&i&&i.domElement){const n=this.hostStyles,s=this.elementComputedStyles,r=i.domElement;let{x:o,y:a,width:l,height:c}=e.getBoundingClientRect(),{x:h,y:u}=r.getBoundingClientRect(),{width:d,height:f}=s;const p=s.zIndex;let g,m,y,b,S;o=dt(o),a=dt(a),h=dt(h),u=dt(u),l=dt(l),c=dt(c),d=dt(parseFloat(d)),f=dt(parseFloat(f)),rl.forEach((e=>{switch(e){case kl:g=kt(d,l),this.canvasWidth!==g&&(this.canvasWidth=g,this.dirtyDimensions=!0);break;case Cn:m=kt(f,c),this.canvasHeight!==m&&(this.canvasHeight=m,this.dirtyDimensions=!0);break;case"zIndex":y=p===we?0:parseInt(p,10),y=this.canvasOnTop?y+1:y-1,this.canvasZIndex!==y&&(this.canvasZIndex=y,this.dirtyZIndex=!0);break;default:b=n[e],S=s[e],tc(b)&&b===S||(n[e]=S,t[e]=S)}}));const k=o-h,A=a-u;(k||A)&&(this.canvasStartX+=k,this.canvasStartY+=A,this.dirtyStart=!0)}return t},Ef.updateCanvas=function(){if(this.canvas&&this.canvas.domElement){const t=this.canvas,e=t.domElement.style,i=this.checkElementStyleValues();for(const[t,n]of ht(i))ol.includes(t)&&(e[t]=n);if(this.dirtyStart&&(this.dirtyStart=!1,t.set({startX:this.canvasStartX,startY:this.canvasStartY})),this.dirtyDimensions){this.dirtyDimensions=!1;const e=this.canvasWidth,i=this.canvasHeight;t.set({width:e,height:i}),t.dirtyDimensions=!0,t.base.set({width:e,height:i}),t.base.dirtyDimensions=!0,t.cleanDimensions(),t.base.cleanDimensions()}this.dirtyZIndex&&(this.dirtyZIndex=!1,e.zIndex=this.canvasZIndex)}};J.UnstackedElement=UnstackedElement;const If=function(t){const e=!!Vl(t.domElement)&&t.domElement,i=Zl(t.animationHooks)?t.animationHooks:{},n=Zl(t.canvasSpecs)?t.canvasSpecs:{},s=Zl(t.observerSpecs)?t.observerSpecs:{},r=!zl(t.includeCanvas)||t.includeCanvas;return e&&e.id&&o[e.id]?Bf(e,n,i,s):Lf(e,n,i,s,r)},Bf=function(t,e,i,n){const s=o[t.id];if(!s)return!1;e.baseMatchesCanvasDimensions=!0,e.ignoreCanvasCssDimensions=!0,e.checkForResize=!0;const r=s.addCanvas(e);s.elementComputedStyles=at(t),i.name=`${s.name}-animation`,i.target=r;const a=Hf(i),l=Zc(a,s,n);return{element:s,canvas:r,animation:a,demolish:()=>{l(),a.kill(),r.demolish(),s.demolish(!0)}}},Lf=function(t,e,i,n,s){if(!t||Is.includes(t.tagName))return{};const r=t.id;let o;var a;r&&$[r]?o=$[r]:o=!!(a=t)&&new UnstackedElement(a),e.baseMatchesCanvasDimensions=!0,e.checkForResize=!0;const l=!!s&&o.addCanvas(e);i.name=`${o.name}-animation`,l?(i.afterClear||(i.afterClear=()=>o.updateCanvas()),i.target=l):i.noTarget=!0;const c=Hf(i),h=Zc(c,o,n);return{element:o,canvas:l,animation:c,demolish:()=>{h(),c.kill(),l&&l.demolish(),o.demolish(!0)}}},$f=t=>{if(t&&t.substring){let e;return!!Ta.some((i=>(e=tt[i][t],e)))&&e}return!1};function Mf(t=Xl){const e={order:1,ticker:Ol,targets:null,time:0,action:null,reverseOnCycleEnd:!1,reversed:!1};t.defs=Kl(t.defs,e),t.kill=function(){const t=this.ticker;if(t===`${this.name}_ticker`){const e=s[t];e&&e.kill()}else t&&this.removeFromTicker(t);return this.deregister(),!0};const i=t.getters,n=t.setters;i.targets=function(){return[].concat(this.targets)},n.targets=function(t=[]){this.setTargets(t)},n.action=function(t){this.action=t,typeof this.action!==hn&&(this.action=Bl)},t.calculateEffectiveTime=function(t){const[e,i]=Hl(ic(t,this.time));if(this.effectiveTime=0,e===Ws&&i<=100){if(this.ticker){const t=s[this.ticker];t&&(this.effectiveTime=t.effectiveDuration*(i/100))}}else this.effectiveTime=i;return this},t.addToTicker=function(t){if(tc(t)){const e=this.ticker,i=s[t];e&&e!==t&&this.removeFromTicker(e),tc(i)&&(this.ticker=t,i.subscribe(this.name),this.calculateEffectiveTime())}return this},t.removeFromTicker=function(t){if(t=tc(t)?t:this.ticker){const e=s[t];tc(e)&&(this.ticker=Ol,e.unsubscribe(this.name))}return this},t.setTargets=function(t){t=[].concat(t);const e=Mc();return t.forEach((t=>{if(Wl(t))Wl(t.set)&&e.push(t);else if(Zl(t)&&tc(t.name))e.push(t);else{const i=$f(t);i&&e.push(i)}})),this.targets||(this.targets=[]),this.targets.length=0,this.targets.push(...e),Xc(e),this},t.addToTargets=function(t){let e;return(t=[].concat(t)).forEach((t=>{typeof t===hn?typeof t.set===hn&&this.targets.push(t):(e=$f(t),e&&this.targets.push(e))}),this),this},t.removeFromTargets=function(t){t=[].concat(t);const e=Mc(),i=[].concat(this.targets);i.forEach((t=>{const i=t.type||ll,n=t.name||cl;i!==ll&&n!==cl&&e.push(`${i}_${n}`)})),t.forEach((t=>{let n;if(n=typeof t===hn?t:$f(t),n){const t=n.type||ll,s=n.name||cl;if(t!==ll&&s!==cl){const n=`${t}_${s}`,r=e.indexOf(n);r>=0&&(i[r]=!1)}}})),this.targets||(this.targets=[]);const n=this.targets;return n.length=0,i.forEach((t=>{t&&n.push(t)}),this),this},t.checkForTarget=function(t){return!!t.substring&&this.targets.some((e=>e.name===t))},t.run=Bl,t.isRunning=Bl,t.halt=Bl,t.reverse=Bl,t.resume=Bl,t.seekTo=Bl,t.seekFor=Bl}const Action=function(t=Xl){return this.makeName(t.name),this.register(),this.set(this.defs),this.action=Bl,this.revert=Bl,this.set(t),this.calculateEffectiveTime(),tc(t.ticker)&&this.addToTicker(t.ticker),this},Xf=Action.prototype=rc();Xf.type="Action",Xf.lib=il,Xf.isArtefact=!1,Xf.isAsset=!1,nh(Xf),Mf(Xf);Xf.defs=Kl(Xf.defs,{revert:null}),Xf.packetExclusions=Ql(Xf.packetExclusions,["targets"]),Xf.packetFunctions=Ql(Xf.packetFunctions,["revert","action"]),Xf.finalizePacketOut=function(t){return mt(this.targets)&&(t.targets=this.targets.map((t=>t.name))),t};const Yf=Xf.setters;Yf.revert=function(t){this.revert=t,typeof this.revert!==hn&&(this.revert=Bl)},Yf.triggered=function(t){this.triggered!==t&&(t?this.action():this.revert(),this.triggered=t)},Xf.set=function(t=Xl){const e=St(t),i=e.length;if(i){const n=this.setters,s=this.defs;let r,o,a,l;for(o=0;o=r?o||(this.action(),this.triggered=!0):o&&(this.revert(),this.triggered=!1):e>=r?o||(this.action(),this.triggered=!0):o&&(this.revert(),this.triggered=!1),n&&(this.triggered=!this.triggered),!0};const Gf=function(t){return!!t&&new Action(t)};function jf(t=Xl){bd(t),Sd(t),kd(t),Ad(t),vd(t),Cd(t),Od(t),Td(t),fd(t);const e={method:Ni,pathObject:null,winding:Ls,flipReverse:!1,flipUpend:!1,scaleOutline:!0,lockFillStyleToEntity:!1,lockStrokeStyleToEntity:!1,onEnter:null,onLeave:null,onDown:null,onUp:null};t.defs=Kl(t.defs,e),t.packetExclusions=Ql(t.packetExclusions,["state"]),t.packetFunctions=Ql(t.packetFunctions,["onEnter","onLeave","onDown","onUp"]),t.processEntityPacketOut=function(t,e,i){return this.processFactoryPacketOut(t,e,i)},t.processFactoryPacketOut=function(t,e,i){let n=!0;return i.indexOf(t)||e!==this.defs[t]||(n=!1),n},t.finalizePacketOut=function(t,e){const i=Ct(this.state.saveAsPacket(e))[3];return t=Kl(t,i),t=this.handlePacketAnchor(t,e)},t.postCloneAction=function(t,e){return this.onEnter&&(t.onEnter=this.onEnter),this.onLeave&&(t.onLeave=this.onLeave),this.onDown&&(t.onDown=this.onDown),this.onUp&&(t.onUp=this.onUp),e.sharedState&&(t.state=this.state),e.anchor&&(e.anchor.host=t,tc(e.anchor.focusAction)||(e.anchor.focusAction=this.anchor.focusAction),tc(e.anchor.blurAction)||(e.anchor.blurAction=this.anchor.blurAction),t.buildAnchor(e.anchor),e.anchor.clickAction||(t.anchor.clickAction=this.anchor.clickAction)),t};const i=t.getters,n=t.setters;i.group=function(){return this.group?this.group.name:Ol},n.lockStylesToEntity=function(t){this.lockFillStyleToEntity=t,this.lockStrokeStyleToEntity=t},t.get=function(t){const e=this.getters[t];if(e)return e.call(this);{const e=this.state;let i,n=this.defs[t];return null!=n?(i=this[t],typeof i!==al?i:n):(n=e.defs[t],null!=n?(i=e[t],typeof i!==al?i:n):null)}},t.set=function(t=Xl){const e=St(t),i=e.length;if(i){const n=this.setters,s=this.defs,r=this.state,o=r?r.setters:Xl,a=r?r.defs:Xl;let l,c,h,u;for(c=0;cs&&(h=s),lr&&(u=r),c=1)return.9999;const{unitPositions:e,unitProgression:i,length:n}=this;if(e&&e.length){const s=e.length;let r,o=0,a=0,l=0;for(let c=0;cr&&(a=e[c],l=r,o++);const c=o?t-l:t,h=o?(i[o]-i[o-1])/n:i[o]/n;return a+=c*((o?e[o]-e[o-1]:e[o])/h),a}return t},t.buildPathPositionObject=function(t,e){if(t){const[i,...n]=t;let s,r;switch(i){case is:s=this.positionPointOnPath(this.getLinearXY(e,...n)),r=this.getLinearAngle(e,...n);break;case fr:s=this.positionPointOnPath(this.getQuadraticXY(e,...n)),r=this.getQuadraticAngle(e,...n);break;case Te:s=this.positionPointOnPath(this.getBezierXY(e,...n)),r=this.getBezierAngle(e,...n)}let o=0;return this.flipReverse&&o++,this.flipUpend&&o++,1===o&&(r=-r),r+=this.roll,s.angle=r,s}return!1},t.getPathPositionData=function(t,e=!1){if(this.useAsPath&&tc(t)&&t.toFixed){const i=this.unitPartials;let n,s,r,o,a,l,c=0,h=t%1;for(0===t?h=0:1===t&&(h=.9999),e&&(h=this.getConstantPosition(h)),r=0,o=i.length;r{const o=Mc(),a=Mc(),l=Mc(),c=Mc(),h=r.units,u=r.unitLengths,d=r.unitPartials,f=r.unitProgression,p=r.unitPositions,g=t.match(/([A-Za-z][0-9. ,-]*)/g),m=/(-?[0-9.]+\b)/g;let y,b,S,k,A,v=Ol,C=Ol,P=0,x=0,w=0,O=0,D=0,F=0,R=0;const T=t=>{a.push({c:v.toLowerCase(),p:t||null,x:O,y:D,cx:x,cy:w,rx:F,ry:R}),n||(l.push(x),c.push(w)),O=x,D=w};for(y=0,b=g.length;y0&&a[y-1],({c:n,p:r,x:o,y:g,cx:m,cy:S}=e),r)switch(n){case"h":h[y]=[is,o,g,r[0]+o,g];break;case"v":h[y]=[is,o,g,o,r[0]+g];break;case"m":h[y]=[Cs,o,g];break;case"l":h[y]=[is,o,g,r[0]+o,r[1]+g];break;case"t":i&&(i.rx||i.ry)?(Uf(t,i.rx-m,i.ry-S),Zf(t,180),h[y]=[fr,o,g,t.x+m,t.y+S,r[0]+o,r[1]+g]):h[y]=[fr,o,g,o,g,r[0]+o,r[1]+g];break;case"q":h[y]=[fr,o,g,r[0]+o,r[1]+g,r[2]+o,r[3]+g];break;case"s":i&&(i.rx||i.ry)?(Uf(t,i.rx-m,i.ry-S),Zf(t,180),h[y]=[Te,o,g,t.x+m,t.y+S,r[0]+o,r[1]+g,r[2]+o,r[3]+g]):h[y]=[Te,o,g,o,g,r[0]+o,r[1]+g,r[2]+o,r[3]+g];break;case"c":h[y]=[Te,o,g,r[0]+o,r[1]+g,r[2]+o,r[3]+g,r[4]+o,r[5]+g];break;case"a":h[y]=[is,o,g,r[5]+o,r[6]+g];break;case"z":yt(o)||(o=0),yt(g)||(g=0),h[y]=[ni,o,g];break;default:yt(o)||(o=0),yt(g)||(g=0),h[y]=[ll,o,g]}else h[y]=[`no-points-${n}`,o,g];for(y=0,b=h.length;yt+e),0);let k=0;for(y=0,b=u.length;y{t=o[e],t&&(t.currentPathData=!1,t.dirtyStart=!0,t.addPathHandle&&(t.dirtyHandle=!0),t.addPathOffset&&(t.dirtyOffset=!0),t.addPathRotation&&(t.dirtyRotation=!0),t.type===ga?t.dirtyPins=!0:t.type!==ca&&t.type!==ma&&t.type!==_o||t.dirtyPins.push(this.name))}),this)},t.draw=function(t){t.stroke(this.pathObject),this.showBoundingBox&&this.drawBoundingBox(t)},t.fill=function(t){t.fill(this.pathObject,this.winding),this.showBoundingBox&&this.drawBoundingBox(t)},t.drawAndFill=function(t){const e=this.pathObject;t.stroke(e),this.currentHost.clearShadow(),t.fill(e,this.winding),this.showBoundingBox&&this.drawBoundingBox(t)},t.fillAndDraw=function(t){const e=this.pathObject;t.stroke(e),this.currentHost.clearShadow(),t.fill(e,this.winding),t.stroke(e),this.showBoundingBox&&this.drawBoundingBox(t)},t.drawThenFill=function(t){const e=this.pathObject;t.stroke(e),t.fill(e,this.winding),this.showBoundingBox&&this.drawBoundingBox(t)},t.fillThenDraw=function(t){const e=this.pathObject;t.fill(e,this.winding),t.stroke(e),this.showBoundingBox&&this.drawBoundingBox(t)},t.clear=function(t){const e=t.globalCompositeOperation;t.globalCompositeOperation=vi,t.fill(this.pathObject,this.winding),t.globalCompositeOperation=e,this.showBoundingBox&&this.drawBoundingBox(t)},t.drawBoundingBox=function(t){t.save(),t.strokeStyle=this.boundingBoxColor,t.lineWidth=1,t.globalCompositeOperation=wo,t.globalAlpha=1,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,t.strokeRect(...this.getBoundingBox()),t.restore()},t.getBoundingBox=function(){const t=this.minimumBoundingBoxDimensions;let[e,i,n,s]=this.localBox;const[r,o]=this.currentStampHandlePosition,[a,l]=this.currentStampPosition;return nt.substring?t.charAt(0).toUpperCase()+t.slice(1):Ol;function Jf(t=Xl){const e={end:null,endPivot:Ol,endPivotCorner:Ol,endPivotIndex:-1,addEndPivotHandle:!1,addEndPivotOffset:!1,endPath:Ol,endPathPosition:0,addEndPathHandle:!1,addEndPathOffset:!0,endParticle:Ol,endLockTo:Ol,useStartAsControlPoint:!1};t.defs=Kl(t.defs,e),t.packetExclusions=Ql(t.packetExclusions,["controlledLineOffset"]),t.packetCoordinates=Ql(t.packetCoordinates,["end"]),t.packetObjects=Ql(t.packetObjects,["endPivot","endPath"]),t.factoryKill=function(){Mt(o).forEach((t=>{t.name!==this.name&&(t.startControlPivot&&t.startControlPivot.name===this.name&&t.set({startControlPivot:!1}),t.controlPivot&&t.controlPivot.name===this.name&&t.set({controlPivot:!1}),t.endControlPivot&&t.endControlPivot.name===this.name&&t.set({endControlPivot:!1}),t.endPivot&&t.endPivot.name===this.name&&t.set({endPivot:!1}),t.startControlPath&&t.startControlPath.name===this.name&&t.set({startControlPath:!1}),t.controlPath&&t.controlPath.name===this.name&&t.set({controlPath:!1}),t.endControlPath&&t.endControlPath.name===this.name&&t.set({endControlPath:!1}),t.endPath&&t.endPath.name===this.name&&t.set({endPath:!1}))}))};const i=t.getters,n=t.setters,s=t.deltaSetters;n.useStartAsControlPoint=function(t){if(this.useStartAsControlPoint=t,!t){const t=this.controlledLineOffset;t[0]=0,t[1]=0}this.updateDirty()},n.endPivot=function(t){this.setControlHelper(t,"endPivot",Mi),this.updateDirty(),this.dirtyEnd=!0},n.endParticle=function(t){this.setControlHelper(t,"endParticle",Mi),this.updateDirty(),this.dirtyEnd=!0},n.endPath=function(t){this.setControlHelper(t,"endPath",Mi),this.updateDirty(),this.dirtyEnd=!0},n.endPathPosition=function(t){this.endPathPosition=t,this.dirtyEnd=!0,this.currentEndPathData=!1,this.dirtyFilterIdentifier=!0},s.endPathPosition=function(t){this.endPathPosition+=t,this.dirtyEnd=!0,this.currentEndPathData=!1,this.dirtyFilterIdentifier=!0},i.endPositionX=function(){return this.currentEnd[0]},i.endPositionY=function(){return this.currentEnd[1]},i.endPosition=function(){return[].concat(this.currentEnd)},n.endX=function(t){null!=t&&(this.end[0]=t,this.updateDirty(),this.dirtyEnd=!0,this.currentEndPathData=!1)},n.endY=function(t){null!=t&&(this.end[1]=t,this.updateDirty(),this.dirtyEnd=!0,this.currentEndPathData=!1)},n.end=function(t,e){this.setCoordinateHelper(Mi,t,e),this.updateDirty(),this.dirtyEnd=!0,this.currentEndPathData=!1},s.endX=function(t){const e=this.end;e[0]=Rl(e[0],t),this.updateDirty(),this.dirtyEnd=!0,this.currentEndPathData=!1},s.endY=function(t){const e=this.end;e[1]=Rl(e[1],t),this.updateDirty(),this.dirtyEnd=!0,this.currentEndPathData=!1},s.end=function(t,e){this.setDeltaCoordinateHelper(Mi,t,e),this.updateDirty(),this.dirtyEnd=!0,this.currentEndPathData=!1},n.endLockTo=function(t){this.endLockTo=t,this.updateDirty(),this.dirtyEndLock=!0,this.currentEndPathData=!1},t.curveInit=function(){this.end=vu(),this.currentEnd=vu(),this.endLockTo=ci,this.dirtyEnd=!0,this.dirtyPins=[],this.controlledLineOffset=vu()},t.setControlHelper=function(t,e,i){if(zl(t)&&!t)this[e]=null,i===Ho?this.dirtyStartControlLock=!0:i===li?this.dirtyControlLock=!0:i===Xi?this.dirtyEndControlLock=!0:this.dirtyEndLock=!0;else if(t){const n=this[e];let s=t.substring?o[t]:t;e.includes("Pivot")?s&&s.isArtefact&&(n&&n.isArtefact&&Jl(n.pivoted,this.name),Ql(s.pivoted,this.name),this[e]=s):e.includes("Path")?s&&s.isArtefact&&(n&&n.isArtefact&&Jl(n.pathed,this.name),Ql(s.pathed,this.name),this[e]=s):e.includes(da)&&(s=t.substring?P[t]:t,s||(this.updateDirty(),i===Ho?this.dirtyStartControl=!0:i===li?this.dirtyControl=!0:i===Xi?this.dirtyEndControl=!0:this.dirtyEnd=!0,this[e]=t))}},t.buildPathPositionObject=function(t,e){if(t){const[i,...n]=t;let s,r;switch(i){case is:s=this.positionPointOnPath(this.getLinearXY(e,...n)),r=this.getLinearAngle(e,...n);break;case fr:s=this.positionPointOnPath(this.getQuadraticXY(e,...n)),r=this.getQuadraticAngle(e,...n);break;case Te:s=this.positionPointOnPath(this.getBezierXY(e,...n)),r=this.getBezierAngle(e,...n)}let o=0;this.flipReverse&&o++,this.flipUpend&&o++,1===o&&(r=-r),r+=this.roll;const a=this.controlledLineOffset;return s.x+=a[0],s.y+=a[1],s.angle=r,s}return!1},t.prepareStamp=function(){this.dirtyHost&&(this.dirtyHost=!1),this.dirtyPins.length&&this.preparePinsForStamp(),this.dirtyLock&&this.cleanLock(),this.dirtyStartControlLock&&this.cleanControlLock(Ho),this.dirtyEndControlLock&&this.cleanControlLock(Xi),this.dirtyControlLock&&this.cleanControlLock(li),this.dirtyEndLock&&this.cleanControlLock(Mi),(this.dirtyScale||this.dirtySpecies||this.dirtyDimensions||this.dirtyStart||this.dirtyStartControl||this.dirtyEndControl||this.dirtyControl||this.dirtyEnd||this.dirtyHandle)&&(this.dirtyPathObject=!0,this.useStartAsControlPoint&&this.dirtyStart&&(this.dirtySpecies=!0,this.pathCalculatedOnce=!1),(this.dirtyScale||this.dirtySpecies||this.dirtyStartControl||this.dirtyEndControl||this.dirtyControl||this.dirtyEnd)&&(this.pathCalculatedOnce=!1)),(this.isBeingDragged||this.lockTo.includes(ys)||this.lockTo.includes(Ns))&&(this.dirtyStampPositions=!0,this.useStartAsControlPoint&&(this.dirtySpecies=!0,this.dirtyPathObject=!0,this.pathCalculatedOnce=!1)),this.dirtyScale&&this.cleanScale(),this.dirtyStart&&this.cleanStart(),(this.dirtyStartControl||this.startControlLockTo===Ns)&&this.cleanControl(Ho),(this.dirtyEndControl||this.endControlLockTo===Ns)&&this.cleanControl(Xi),(this.dirtyControl||this.controlLockTo===Ns)&&this.cleanControl(li),(this.dirtyEnd||this.endLockTo===Ns)&&this.cleanControl(Mi),this.dirtyOffset&&this.cleanOffset(),this.dirtyRotation&&this.cleanRotation(),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtySpecies&&this.cleanSpecies(),this.dirtyPathObject&&this.cleanPathObject(),this.dirtyPositionSubscribers&&(this.updatePositionSubscribers(),this.updateControlPathSubscribers()),this.prepareStampTabsHelper()},t.cleanControlLock=function(t){const e=Qf(t);this[`dirty${e}Lock`]=!1,this[`dirty${e}`]=!0},t.cleanControl=function(t){const e=Qf(t);this[`dirty${e}`]=!1;let i,n,s=this[`${t}Pivot`],r=this[`${t}Path`],a=this[`${t}Particle`];s&&s.substring&&(i=o[s],i&&(s=i)),r&&r.substring&&(i=o[r],i&&(r=i)),a&&a.substring&&(i=P[a],i&&(a=i));let l,c,h,u,d,f,p,g=this[`${t}LockTo`];const m=this[t],y=this[`current${e}`];switch((g!==Js||s&&!s.substring)&&(g!==Vs||r&&!r.substring)&&(g!==Ns||a&&!a.substring)||(g=ci),g){case Js:if(this.pivotCorner&&s.getCornerCoordinate)[l,c]=s.getCornerCoordinate(this[`${t}PivotCorner`]);else if(s.type===ea)if(this[`${t}PivotIndex`]<0)s.layoutTemplate?[l,c]=s.layoutTemplate.currentStampPosition:this[`dirty${e}`]=!0;else{const i=s.getUnitStartAt(this[`${t}PivotIndex`]);i?[l,c]=i:this[`dirty${e}`]=!0}else[l,c]=s.currentStampPosition;this.addPivotOffset||([h,u]=s.currentOffset,l-=h,c-=u);break;case Vs:n=this.getControlPathData(r,t,e),l=n.x,c=n.y,this.addPathOffset||(l-=r.currentOffset[0],c-=r.currentOffset[1]);break;case Ns:l=a.position.x,c=a.position.y,this.pathCalculatedOnce=!1;break;case ys:d=this.getHere(),l=d.x||0,c=d.y||0;break;default:l=c=0,f=this.getHost(),f&&(p=f.currentDimensions,p&&(this.cleanPosition(y,m,p),[l,c]=y))}y[0]=l,y[1]=c,this.dirtySpecies=!0,this.dirtyPathObject=!0,this.dirtyPositionSubscribers=!0},t.getControlPathData=function(t,e,i){const n=this[`current${i}PathData`];if(n)return n;let s=this[`${e}PathPosition`];const r=s,o=t.getPathPositionData(s);if(s<0&&(s+=1),s>1&&(s%=1),s=parseFloat(s.toFixed(6)),s!==r&&(this[`${e}PathPosition`]=s),o)return this[`current${i}PathData`]=o,o;{const t=this.getHost();if(t){const n=t.currentDimensions;if(n){const t=this[`current${i}`];return this.cleanPosition(t,this[e],n),{x:t[0],y:t[1]}}}return{x:0,y:0}}},t.updateControlPathSubscribers=function(){let t;[].concat(this.endSubscriber,this.endControlSubscriber,this.controlSubscriber,this.startControlSubscriber).forEach((e=>{t=o[e],t&&(t.type!==ca&&t.type!==ma&&t.type!==_o||(t.type===ma?(t.dirtyControl=!0,t.currentControlPathData=!1):t.type===_o&&(t.dirtyStartControl=!0,t.dirtyEndControl=!0,t.currentStartControlPathData=!1,t.currentEndControlPathData=!1),t.currentEndPathData=!1,t.dirtyEnd=!0),t.currentPathData=!1,t.dirtyStart=!0)}))}}const Bezier=function(t=Xl){return this.startControl=vu(),this.endControl=vu(),this.currentStartControl=vu(),this.currentEndControl=vu(),this.startControlLockTo=ci,this.endControlLockTo=ci,this.curveInit(t),this.shapeInit(t),this.dirtyStartControl=!0,this.dirtyEndControl=!0,this},tp=Bezier.prototype=rc();tp.type=_o,tp.lib=Gi,tp.isArtefact=!0,tp.isAsset=!1,nh(tp),qf(tp),Jf(tp);const ep={startControl:null,startControlPivot:Ol,startControlPivotIndex:-1,startControlPivotCorner:Ol,addStartControlPivotHandle:!1,addStartControlPivotOffset:!1,startControlPath:Ol,startControlPathPosition:0,addStartControlPathHandle:!1,addStartControlPathOffset:!0,startControlParticle:Ol,endControl:null,endControlPivot:Ol,endControlPivotIndex:-1,endControlPivotCorner:Ol,addEndControlPivotHandle:!1,addEndControlPivotOffset:!1,endControlPath:Ol,endControlPathPosition:0,addEndControlPathHandle:!1,addEndControlPathOffset:!0,endControlParticle:Ol,startControlLockTo:Ol,endControlLockTo:Ol};tp.defs=Kl(tp.defs,ep),tp.packetCoordinates=Ql(tp.packetCoordinates,["startControl","endControl"]),tp.packetObjects=Ql(tp.packetObjects,["startControlPivot","startControlParticle","startControlPath","endControlPivot","endControlParticle","endControlPath"]);const ip=tp.getters,np=tp.setters,sp=tp.deltaSetters;np.endControlPivot=function(t){this.setControlHelper(t,"endControlPivot",Xi),this.updateDirty(),this.dirtyEndControl=!0},np.endControlParticle=function(t){this.setControlHelper(t,"endControlParticle",Xi),this.updateDirty(),this.dirtyEndControl=!0},np.endControlPath=function(t){this.setControlHelper(t,"endControlPath",Xi),this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1},np.endControlPathPosition=function(t){this.endControlPathPosition=t,this.dirtyEndControl=!0,this.currentEndControlPathData=!1,this.dirtyFilterIdentifier=!0},sp.endControlPathPosition=function(t){this.endControlPathPosition+=t,this.dirtyEndControl=!0,this.currentEndControlPathData=!1,this.dirtyFilterIdentifier=!0},np.startControlPivot=function(t){this.setControlHelper(t,"startControlPivot",Ho),this.updateDirty(),this.dirtyStartControl=!0},np.startControlParticle=function(t){this.setControlHelper(t,"startControlParticle",Ho),this.updateDirty(),this.dirtyStartControl=!0},np.startControlPath=function(t){this.setControlHelper(t,"startControlPath",Ho),this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1},np.startControlPathPosition=function(t){this.startControlPathPosition=t,this.dirtyStartControl=!0,this.currentStartControlPathData=!1,this.dirtyFilterIdentifier=!0},sp.startControlPathPosition=function(t){this.startControlPathPosition+=t,this.dirtyStartControl=!0,this.currentStartControlPathData=!1,this.dirtyFilterIdentifier=!0},ip.startControlPositionX=function(){return this.currentStartControl[0]},ip.startControlPositionY=function(){return this.currentStartControl[1]},ip.startControlPosition=function(){return[].concat(this.currentStartControl)},np.startControlX=function(t){null!=t&&(this.startControl[0]=t,this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1)},np.startControlY=function(t){null!=t&&(this.startControl[1]=t,this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1)},np.startControl=function(t,e){this.setCoordinateHelper(Ho,t,e),this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1},sp.startControlX=function(t){const e=this.startControl;e[0]=Rl(e[0],t),this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1},sp.startControlY=function(t){const e=this.startControl;e[1]=Rl(e[1],t),this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1},sp.startControl=function(t,e){this.setDeltaCoordinateHelper(Ho,t,e),this.updateDirty(),this.dirtyStartControl=!0,this.currentStartControlPathData=!1},ip.endControlPositionX=function(){return this.currentEndControl[0]},ip.endControlPositionY=function(){return this.currentEndControl[1]},ip.endControlPosition=function(){return[].concat(this.currentEndControl)},np.endControlX=function(t){null!=t&&(this.endControl[0]=t,this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1)},np.endControlY=function(t){null!=t&&(this.endControl[1]=t,this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1)},np.endControl=function(t,e){this.setCoordinateHelper(Xi,t,e),this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1},sp.endControlX=function(t){const e=this.endControl;e[0]=Rl(e[0],t),this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1},sp.endControlY=function(t){const e=this.endControl;e[1]=Rl(e[1],t),this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1},sp.endControl=function(t,e){this.setDeltaCoordinateHelper(Xi,t,e),this.updateDirty(),this.dirtyEndControl=!0,this.currentEndControlPathData=!1},np.startControlLockTo=function(t){this.startControlLockTo=t,this.updateDirty(),this.dirtyStartControlLock=!0},np.endControlLockTo=function(t){this.endControlLockTo=t,this.updateDirty(),this.dirtyEndControlLock=!0,this.currentEndControlPathData=!1},tp.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeBezierPath()},tp.makeBezierPath=function(){const[t,e]=this.currentStampPosition,[i,n]=this.currentStartControl,[s,r]=this.currentEndControl,[o,a]=this.currentEnd;return`m0,0c${(i-t).toFixed(2)},${(n-e).toFixed(2)} ${(s-t).toFixed(2)},${(r-e).toFixed(2)} ${(o-t).toFixed(2)},${(a-e).toFixed(2)}`},tp.cleanDimensions=function(){this.dirtyDimensions=!1,this.dirtyHandle=!0,this.dirtyOffset=!0,this.dirtyStart=!0,this.dirtyStartControl=!0,this.dirtyEndControl=!0,this.dirtyEnd=!0,this.dirtyFilterIdentifier=!0},tp.preparePinsForStamp=function(){const t=this.dirtyPins,e=this.endPivot,i=this.endPath,n=this.startControlPivot,s=this.startControlPath,r=this.endControlPivot,o=this.endControlPath;for(let a,l=0,c=t.length;l{const[s,r]=t;s.toFixed&&r.substring&&(e.convert(r),i[`${s} `]=[...e[n]])})),this.colors=i,this.dirtyPalette=!0}},pp.easing=function(t){this.setEasingHelper(t)},pp.easingFunction=pp.easing,up.setEasing=function(t){return this.setEasingHelper(t),this},up.setEasingFunction=up.setEasing,up.setEasingHelper=function(t){Wl(t)?(this.easing=hn,this.easingFunction=t):t.substring&&sc[t]?(this.easing=t,this.easingFunction=Ll):(this.easing=is,this.easingFunction=Ll),this.dirtyPaletteData=!0},fp.colorSpace=function(){return this.getColorSpace()},pp.colorSpace=function(t){if(t.substring){const e=t.toUpperCase(),i=t.toLowerCase();if(Ln.includes(e)){const t=nt({},this.colors),n=this.factory.colorSpace;this.factory.set({colorSpace:e});for(const[e,s]of ht(t)){const t=this.factory.buildColorString(...s,n);this.factory.setColor(t),this.colors[e].length=0,this.colors[e].push(...this.factory[i])}this.dirtyPalette=!0}}},fp.returnColorAs=function(){return this.getReturnColorAs()},pp.returnColorAs=function(t){this.factory.set({returnColorAs:t}),this.dirtyPalette=!0},pp.precision=function(t){t=parseInt(t,10),(!yt(t)||t<0)&&(t=0),t>50&&(t=50),this.precision=t,this.dirtyPaletteData=!0},pp.stops=Bl,up.getColorSpace=function(){return this.factory?this.factory.colorSpace:ao},up.getReturnColorAs=function(){return this.factory?this.factory.returnColorAs:ao},up.recalculateStopColors=function(){if(this.dirtyPalette){this.dirtyPalette=!1,this.dirtyPaletteData=!0;const{colors:t,stops:e,factory:i}=this;e.fill(Ie);const{colorSpace:n}=i,s=St(t).map((t=>parseInt(t,10))).sort(((t,e)=>t-e));let r,o,a,l,c,h,u,d=s[0];const[f,p,g,m]=t[`${d} `];for(e[d]=i.returnColorFromValues(f,p,g,m),c=0,h=s.length-1;c=0&&t<1e3&&(i.convert(e),t+=Oo,this.colors[t]=[...i[n]],this.dirtyPalette=!0)},up.removeColor=function(t){tc(t)&&(t=t.substring?parseInt(t,10):dt(t))>=0&&t<1e3&&(t+=Oo,delete this.colors[t],this.dirtyPalette=!0)},up.getStopData=function(t,e,i,n){if(!t)return Ie;const s=`${this.name}-data`,{stops:r}=this;if(this.dirtyPaletteData||!tu[o]){this.dirtyPaletteData=!1,ec(e,i)||(e=0,i=999);const{easing:t,easingFunction:o,precision:a}=this,l=St(this.colors).map((t=>parseInt(t,10))).sort(((t,e)=>t-e));let c,h,u,d,f,p,g=o;t!==hn&&sc[t]&&(g=sc[t]);const m=this.getColorSpace(),y=!(!a||t===is&&m===ao),b=[];if(e1?h-=1:h<0&&(h+=1)),h=g(h),h>0&&h<1&&b.push(h,r[u]);else for(u=0,d=l.length;ue&&f1?h-=1:h<0&&(h+=1)),h>0&&h<1&&b.push(h,r[f]));b.push(1,r[i])}else if(n){if(b.push(0,r[e]),p=999-e,c=p+i,y)for(u=0;u999&&(f-=1e3),h=g(u/c),h>0&&h<1&&b.push(h,r[f]);else for(u=0,d=l.length;ue)h=(f-e)/c;else if(0===f)h=(f+p+.01)/c;else{if(!(f1?h-=1:h<0&&(h+=1),h>0&&h<1&&b.push(h,r[f])}b.push(1,r[i])}else{if(b.push(0,r[e]),c=e-i,y)for(u=i+1;ui&&(h=g(1-(u-i)/c),h>0&&h<1&&b.push(h,r[u]));else for(u=0,d=l.length;ui&&(h=1-(f-i)/c,h>0&&h<1&&b.push(h,r[f]));b.push(1,r[i])}ft(b),ou(s,b)}var o;return e===i?r[e]||Ie:ru(s)||Ie},up.addStopsToGradient=function(t,e,i,n){this.recalculateStopColors();const s=this.getStopData(t,e,i,n);if(s.substring)return s;for(let e=0,i=s.length;e{const i=e.state;if(i){const e=i.fillStyle,n=i.strokeStyle;Zl(e)&&e.name===t&&(i.fillStyle=i.defs.fillStyle),Zl(n)&&n.name===t&&(i.strokeStyle=i.defs.strokeStyle)}})),this.deregister(),this};const e=t.getters,i=t.setters,n=t.deltaSetters;e.startX=function(){return this.currentStart[0]},e.startY=function(){return this.currentStart[1]},i.startX=function(t){null!=t&&(this.start[0]=t,this.dirtyStart=!0)},i.startY=function(t){null!=t&&(this.start[1]=t,this.dirtyStart=!0)},i.start=function(t,e){this.setCoordinateHelper(To,t,e),this.dirtyStart=!0},n.startX=function(t){const e=this.start;e[0]=Rl(e[0],t),this.dirtyStart=!0},n.startY=function(t){const e=this.start;e[1]=Rl(e[1],t),this.dirtyStart=!0},n.start=function(t,e){this.setDeltaCoordinateHelper(To,t,e),this.dirtyStart=!0},e.endX=function(){return this.currentEnd[0]},e.endY=function(){return this.currentEnd[1]},i.endX=function(t){null!=t&&(this.end[0]=t,this.dirtyEnd=!0)},i.endY=function(t){null!=t&&(this.end[1]=t,this.dirtyEnd=!0)},i.end=function(t,e){this.setCoordinateHelper(Mi,t,e),this.dirtyEnd=!0},n.endX=function(t){const e=this.end;e[0]=Rl(e[0],t),this.dirtyEnd=!0},n.endY=function(t){const e=this.end;e[1]=Rl(e[1],t),this.dirtyEnd=!0},n.end=function(t,e){this.setDeltaCoordinateHelper(Mi,t,e),this.dirtyEnd=!0},i.palette=function(t=Xl){t.type===ua&&(t.dirtyPalette=!0,this.palette=t)},i.paletteStart=function(t){t.toFixed&&this.palette&&(this.paletteStart=t,(t<0||t>999)&&(this.paletteStart=t>500?999:0),this.palette.updateData())},n.paletteStart=function(t){let e;t.toFixed&&this.palette&&(e=this.paletteStart+t,(e<0||e>999)&&(e=this.cyclePalette?e>500?e-1e3:e+1e3:t>500?999:0),this.paletteStart=e,this.palette.updateData())},i.paletteEnd=function(t){t.toFixed&&this.palette&&(this.paletteEnd=t,(t<0||t>999)&&(this.paletteEnd=t>500?999:0),this.palette.updateData())},n.paletteEnd=function(t){let e;t.toFixed&&this.palette&&(e=this.paletteEnd+t,(e<0||e>999)&&(e=this.cyclePalette?e>500?e-1e3:e+1e3:t>500?999:0),this.paletteEnd=e,this.palette.updateData())},i.cyclePalette=function(t){this.palette&&(this.cyclePalette=!!t,this.palette.updateData())},i.colors=function(t){mt(t)&&this.palette&&this.palette.set({colors:t})},i.easing=function(t){this.palette&&this.palette.set({easing:t})},i.easingFunction=i.easing,i.colorSpace=function(t){this.palette&&this.palette.set({colorSpace:t})},i.returnColorAs=function(t){this.palette&&this.palette.set({returnColorAs:t})},i.precision=function(t){this.palette&&this.palette.set({precision:t})},i.delta=function(t=Xl){t&&(this.delta=ql(this.delta,t))},t.get=function(t){const e=this.getters[t],i=this.palette;if(e)return e.call(this);{let e,n=this.defs[t];return typeof n!==al?(e=this[t],typeof e!==al?e:n):(n=i.defs[t],typeof n!==al?(e=i[t],typeof e!==al?e:n):void 0)}},t.set=function(t=Xl){const e=St(t),i=e.length;if(i){const n=this.setters,s=this.defs,r=this.palette;let o,a,l,c,h,u;for(r&&(o=r.setters||Xl,a=r.defs||Xl),c=0;c{L.forEach((t=>{const e=B[t];e&&e.animateByDelta&&e.updateByDelta()}))}});const ConicGradient=function(t=Xl){return this.stylesInit(t),this},mp=ConicGradient.prototype=rc();mp.type="ConicGradient",mp.lib=No,mp.isArtefact=!1,mp.isAsset=!1,nh(mp),gp(mp);mp.defs=Kl(mp.defs,{angle:0}),mp.packetObjects=Ql(mp.packetObjects,["palette"]),mp.buildStyle=function(t){if(t){const e=t.engine;if(e){if(!e.createConicGradient)return Ie;const t=e.createConicGradient(...this.gradientArgs);return this.addStopsToGradient(t,this.paletteStart,this.paletteEnd,this.cyclePalette)}}return Ie},mp.updateGradientArgs=function(t,e){const i=this.gradientArgs,n=this.currentStart,s=this.angle*Dt,r=n[0]+t,o=n[1]+e;i.length=0,i.push(s,r,o)};const yp=function(t){return!!t&&new ConicGradient(t)};J.ConicGradient=ConicGradient;const Crescent=function(t=Xl){return nc(t.dimensions,t.width,t.height,t.radius)||(t.radius=5),this.entityInit(t),this},bp=Crescent.prototype=rc();bp.type="Crescent",bp.lib=Gi,bp.isArtefact=!0,bp.isAsset=!1,nh(bp),jf(bp);bp.defs=Kl(bp.defs,{outerRadius:20,innerRadius:10,displacement:0,displayIntersect:!1});const Sp=bp.setters,kp=bp.deltaSetters;Sp.outerRadius=function(t){null!=t&&(this.outerRadius=t,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0)},kp.outerRadius=function(t){null!=t&&(this.outerRadius=Rl(this.outerRadius,t),this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0)},Sp.innerRadius=function(t){null!=t&&(this.innerRadius=t,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0)},kp.innerRadius=function(t){null!=t&&(this.innerRadius=Rl(this.innerRadius,t),this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0)},Sp.width=Sp.outerRadius,kp.width=kp.outerRadius,Sp.height=Sp.innerRadius,kp.height=kp.innerRadius,Sp.displacement=function(t){if(null!=t&&t.toFixed&&t>=0){let e=t;e<0&&(e=0),this.displacement=e,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0}},kp.displacement=function(t){if(null!=t&&t.toFixed){let e=Rl(this.displacement,t);e.toFixed&&e<0&&(e=0),this.displacement=e,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0}},Sp.displayIntersect=function(t){this.displayIntersect=t,this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0},bp.cleanDimensionsAdditionalActions=function(){const{outerRadius:t,innerRadius:e,displacement:i}=this,n=this.getHost();let s;s=n?n.currentDimensions?n.currentDimensions:[n.w,n.h]:[300,150];const[r,o]=s;this.currentOuterRadius=t.substring?parseFloat(t)/100*r:t,this.currentInnerRadius=e.substring?parseFloat(e)/100*o:e,this.currentDisplacement=i.substring?parseFloat(i)/100*r:i,this.currentDimensions[0]=this.currentDimensions[1]=2*this.currentOuterRadius,this.dirtyPathObject=!0},bp.calculateInterception=function(){ec(this.currentOuterRadius,this.currentInnerRadius,this.currentDisplacement)||this.cleanDimensionsAdditionalActions();const{currentOuterRadius:t,currentInnerRadius:e,currentDisplacement:i}=this;this.outerCircleStart=0,this.outerCircleEnd=360*Dt,this.innerCircleStart=0,this.innerCircleEnd=360*Dt,this.drawOuterCircle=!1,this.drawDonut=!1;const n=t+e,s=t-e;if(!s&&!i)this.drawOuterCircle=!0;else if(i>=n)this.drawOuterCircle=!0;else if(is){const n=mu(),{engine:s,element:r}=n,o=ku();let a,l;for(r.width=r.width,s.fillStyle="black",s.save(),s.beginPath(),s.arc(0,0,t,0,2*Math.PI),o.setFromArray([e,0]),a=0;a<360&&(o.rotate(.5),!s.isPointInPath(o[0]+i,o[1]));a+=.5);for(s.restore(),s.save(),s.beginPath(),s.arc(i,0,e,0,2*Math.PI),o.setFromArray([t,0]),l=0;l<360&&(o.rotate(.5),s.isPointInPath(...o));l+=.5);s.restore(),this.outerCircleStart=-l*Dt,this.outerCircleEnd=l*Dt,this.innerCircleStart=a*Dt,this.innerCircleEnd=-a*Dt,Au(o),yu(n)}else this.drawDonut=!0},bp.cleanPathObject=function(){if(this.dirtyPathObject=!1,!this.noPathUpdates||!this.pathObject){this.calculateInterception();const{currentStampHandlePosition:t,currentScale:e,outerCircleStart:i,outerCircleEnd:n,innerCircleStart:s,innerCircleEnd:r,drawOuterCircle:o,displayIntersect:a}=this;let{currentOuterRadius:l,currentInnerRadius:c,currentDisplacement:h}=this;const u=this.pathObject=new Path2D;l*=e,c*=e,h*=e;const d=l-t[0]*e,f=l-t[1]*e;if(o)u.arc(d,f,l,i,n),u.closePath(),this.pathObjectOuter=!1,this.pathObjectInner=!1;else{const t=this.pathObjectOuter=new Path2D,e=this.pathObjectInner=new Path2D;a?u.arc(d,f,l,i,n):u.arc(d,f,l,i,n,!0),u.arc(d+h,f,c,s,r),u.closePath(),t.arc(d,f,l,i,n,!0),t.closePath(),e.arc(d+h,f,c,s,r),e.closePath()}}},bp.draw=function(t){this.drawDonut?(t.stroke(this.pathObjectOuter),t.stroke(this.pathObjectInner)):t.stroke(this.pathObject)},bp.fill=function(t){t.fill(this.pathObject,this.winding)},bp.drawAndFill=function(t){if(this.drawDonut){const e=this.pathObject,i=this.pathObjectOuter,n=this.pathObjectInner;t.stroke(i),t.stroke(n),t.fill(e,this.winding),this.currentHost.clearShadow(),t.stroke(i),t.stroke(n),t.fill(e,this.winding)}else{const e=this.pathObject;t.stroke(e),t.fill(e,this.winding),this.currentHost.clearShadow(),t.stroke(e),t.fill(e,this.winding)}},bp.fillAndDraw=function(t){if(this.drawDonut){const e=this.pathObject,i=this.pathObjectOuter,n=this.pathObjectInner;t.fill(e,this.winding),t.stroke(i),t.stroke(n),this.currentHost.clearShadow(),t.fill(e,this.winding),t.stroke(i),t.stroke(n)}else{const e=this.pathObject;t.fill(e,this.winding),t.stroke(e),this.currentHost.clearShadow(),t.fill(e,this.winding),t.stroke(e)}},bp.drawThenFill=function(t){if(this.drawDonut){const e=this.pathObject,i=this.pathObjectOuter,n=this.pathObjectInner;t.stroke(i),t.stroke(n),t.fill(e,this.winding)}else{const e=this.pathObject;t.stroke(e),t.fill(e,this.winding)}},bp.fillThenDraw=function(t){if(this.drawDonut){const e=this.pathObject,i=this.pathObjectOuter,n=this.pathObjectInner;t.fill(e,this.winding),t.stroke(i),t.stroke(n)}else{const e=this.pathObject;t.fill(e,this.winding),t.stroke(e)}},bp.clip=function(t){t.clip(this.pathObject,this.winding)},bp.clear=function(t){const e=t.globalCompositeOperation;t.globalCompositeOperation=vi,t.fill(this.pathObject,this.winding),t.globalCompositeOperation=e};const Ap=function(t){return!!t&&new Crescent(t)};J.Crescent=Crescent;const ParticleHistory=function(){const t=Array(4).fill(0);return Ht(t,ParticleHistory.prototype),Tt(t)},vp=ParticleHistory.prototype=ct(Array.prototype);vp.constructor=ParticleHistory,vp.type=fa;const Cp=[],Pp=function(...t){t.forEach((t=>{t&&t.type===fa&&(t.fill(0),Cp.push(t),Cp.length>100&&(Cp.length=0))}))};J.ParticleHistory=ParticleHistory;const Particle=function(t=Xl){return this.makeName(t.name),this.register(),this.set(this.defs),this.initializePositions(),this.set(t),this},xp=Particle.prototype=rc();xp.type=da,xp.lib=Ns,xp.isArtefact=!1,xp.isAsset=!1,nh(xp);const wp={position:null,velocity:null,load:null,history:null,historyLength:1,engine:zi,forces:null,mass:1,fill:He,stroke:He};xp.defs=Kl(xp.defs,wp),xp.packetExclusionsByRegex=Ql(xp.packetExclusionsByRegex,["^(local|dirty|current)"]),xp.packetObjects=Ql(xp.packetObjects,["position","velocity","acceleration"]),xp.factoryKill=function(){this.history.forEach((t=>Pp(t)));const t=[];let e;D.forEach((i=>{e=O[i],(e.particleFrom&&e.particleFrom.name===this.name||e.particleTo&&e.particleTo.name===this.name)&&t.push(e)})),t.forEach((t=>t.kill()))};const Op=xp.getters,Dp=xp.setters,Fp=xp.deltaSetters;Op.positionX=function(){return this.position.x},Op.positionY=function(){return this.position.y},Op.positionZ=function(){return this.position.z},Op.position=function(){const t=this.position;return[t.x,t.y,t.z]},Dp.positionX=function(t){this.position.x=t},Dp.positionY=function(t){this.position.y=t},Dp.positionZ=function(t){this.position.z=t},Dp.position=function(t){this.position.set(t)},Fp.positionX=function(t){this.position.x+=t},Fp.positionY=function(t){this.position.y+=t},Fp.positionZ=function(t){this.position.z+=t},Fp.position=Bl,Op.velocityX=function(){return this.velocity.x},Op.velocityY=function(){return this.velocity.y},Op.velocityZ=function(){return this.velocity.z},Op.velocity=function(){const t=this.velocity;return[t.x,t.y,t.z]},Dp.velocityX=function(t){this.velocity.x=t},Dp.velocityY=function(t){this.velocity.y=t},Dp.velocityZ=function(t){this.velocity.z=t},Dp.velocity=function(t,e,i){this.velocity.set(t,e,i)},Fp.velocityX=function(t){this.velocity.x+=t},Fp.velocityY=function(t){this.velocity.y+=t},Fp.velocityZ=function(t){this.velocity.z+=t},Fp.velocity=Bl,Dp.forces=function(t){t&&(mt(t)?(this.forces.length=0,this.forces=this.forces.concat(t)):this.forces.push(t))},Dp.load=Bl,Dp.history=Bl,Fp.load=Bl,xp.initializePositions=function(){this.initialPosition=Nd(),this.position=Nd(),this.velocity=Nd(),this.load=Nd(),this.forces=[],this.history=[],this.isRunning=!1},xp.applyForces=function(t,e){let i;this.load.zero(),this.isBeingDragged||this.forces.forEach((n=>{i=x[n],i&&i.action&&i.action(this,t,e)}))},xp.update=function(t,e){this.isBeingDragged?this.position.setFromVector(this.isBeingDragged).vectorAdd(this.dragOffset):Ip[this.engine].call(this,t*e.tickMultiplier)},xp.manageHistory=function(t,e){const{history:i,remainingTime:n,position:s,historyLength:r,hasLifetime:o,distanceLimit:a,initialPosition:l,killBeyondCanvas:c}=this;let h=!0,u=0;if(o)if(u=n-t,u<=0){const t=i.pop();Pp(t),h=!1,i.length||(this.isRunning=!1)}else this.remainingTime=u;const d=i[i.length-1];if(d){const[,t,i,n]=d;if(c){const t=e.element.width,s=e.element.height;(i<0||n<0||i>t||n>s)&&(h=!1,this.isRunning=!1)}if(a){const e=jd(l);e.vectorSubtractArray([i,n,t]),e.getMagnitude()>a&&(h=!1,this.isRunning=!1),zd(e)}}if(h){const{x:t,y:e,z:n}=s,o=(Cp.length||Cp.push(new ParticleHistory),Cp.shift());if(o[0]=u,o[1]=n,o[2]=t,o[3]=e,i.unshift(o),i.length>r){i.splice(r).forEach((t=>Pp(t)))}}},xp.run=function(t,e,i){this.hasLifetime=!1,t&&(this.remainingTime=t,this.hasLifetime=!0),this.distanceLimit=0,e&&(this.initialPosition.set(this.position),this.distanceLimit=e),this.killBeyondCanvas=i,this.isRunning=!0};const Rp=function(t){return!!t&&new Particle(t)};J.Particle=Particle;const Tp=[],Hp=function(t){Tp.length||Tp.push(new Particle);const e=Tp.shift();return e.set(t),e},Ep=function(t){if(t&&t.type===da&&(t.history.forEach((t=>Pp(t))),t.history.length=0,t.set(t.defs),Tp.push(t),Tp.length>50)){const t=[...Tp];Tp.length=0,t.forEach((t=>t.kill()))}},Ip={euler:function(t){const{position:e,velocity:i,load:n,mass:s}=this,r=jd(),o=jd(i);r.setFromVector(n).scalarDivide(s),o.vectorAdd(r.scalarMultiply(t)),i.setFromVector(o),e.vectorAdd(o.scalarMultiply(t)),zd(r,o)},"improved-euler":function(t){const{position:e,velocity:i,load:n,mass:s}=this,r=jd(),o=jd(),a=jd(),l=jd(i);r.setFromVector(n).scalarDivide(s).scalarMultiply(t),o.setFromVector(n).vectorAdd(r).scalarDivide(s).scalarMultiply(t),a.setFromVector(r).vectorAdd(o).scalarDivide(2),l.vectorAdd(a),i.setFromVector(l),e.vectorAdd(l.scalarMultiply(t)),zd(r,o,a,l)},"runge-kutta":function(t){const{position:e,velocity:i,load:n,mass:s}=this,r=jd(),o=jd(),a=jd(),l=jd(),c=jd(),h=jd(i);r.setFromVector(n).scalarDivide(s).scalarMultiply(t).scalarDivide(2),o.setFromVector(n).vectorAdd(r).scalarDivide(s).scalarMultiply(t).scalarDivide(2),a.setFromVector(n).vectorAdd(o).scalarDivide(s).scalarMultiply(t).scalarDivide(2),l.setFromVector(n).vectorAdd(a).scalarDivide(s).scalarMultiply(t).scalarDivide(2),o.scalarMultiply(2),a.scalarMultiply(2),c.setFromVector(r).vectorAdd(o).vectorAdd(a).vectorAdd(l).scalarDivide(6),h.vectorAdd(c),i.setFromVector(h),e.vectorAdd(h.scalarMultiply(t)),zd(r,o,a,l,c,h)}},Emitter=function(t=Xl){return this.makeName(t.name),this.register(),this.initializePositions(),this.set(this.defs),this.onEnter=Bl,this.onLeave=Bl,this.onDown=Bl,this.onUp=Bl,this.fillColorFactory=Wu({name:`${this.name}-fillColorFactory`}),this.strokeColorFactory=Wu({name:`${this.name}-strokeColorFactory`}),this.range=Nd(),this.rangeFrom=Nd(),this.minimumVelocity=Nd(),this.preAction=Bl,this.stampAction=Bl,this.postAction=Bl,this.particleStore=[],this.deadParticles=[],this.liveParticles=[],t.group||(t.group=af),this.set(t),this.purge&&this.purgeArtefact(this.purge),this},Bp=Emitter.prototype=rc();Bp.type="Emitter",Bp.lib=Gi,Bp.isArtefact=!0,Bp.isAsset=!1,nh(Bp),jf(Bp);const Lp={world:null,artefact:null,range:null,rangeFrom:null,minimumVelocity:null,generationRate:0,particleCount:0,generateAlongPath:null,generateInArea:null,generateFromExistingParticles:!1,generateFromExistingParticleHistories:!1,limitDirectionToAngleMultiples:0,generationChoke:15,killAfterTime:0,killAfterTimeVariation:0,killRadius:0,killRadiusVariation:0,killBeyondCanvas:!1,historyLength:1,forces:null,mass:1,massVariation:0,engine:zi,hitRadius:10,showHitRadius:!1,hitRadiusColor:He,resetAfterBlur:3};Bp.defs=Kl(Bp.defs,Lp),Bp.packetExclusions=Ql(Bp.packetExclusions,["forces","particleStore","deadParticles","liveParticles","fillColorFactory","strokeColorFactory"]),Bp.packetObjects=Ql(Bp.packetObjects,["world","artefact","generateInArea","generateAlongPath"]),Bp.packetFunctions=Ql(Bp.packetFunctions,["preAction","stampAction","postAction"]),Bp.finalizePacketOut=function(t,e){const i=e.forces||this.forces||!1;if(i){const e=[];i.forEach((t=>{t.substring?e.push(t):Zl(t)&&t.name&&e.push(t.name)})),t.forces=e}const n=[];return this.particleStore.forEach((t=>n.push(t.saveAsPacket()))),t.particleStore=n,t},Bp.postCloneAction=function(t){return t},Bp.factoryKill=function(t,e){this.isRunning=!1,t&&this.artefact.kill(),e&&this.world.kill(),this.fillColorFactory.kill(),this.strokeColorFactory.kill(),this.deadParticles.forEach((t=>t.kill())),this.liveParticles.forEach((t=>t.kill())),this.particleStore.forEach((t=>t.kill()))};const $p=Bp.setters,Mp=Bp.deltaSetters;$p.rangeX=function(t){this.range.x=t},$p.rangeY=function(t){this.range.y=t},$p.rangeZ=function(t){this.range.z=t},$p.range=function(t){this.range.set(t)},$p.rangeFromX=function(t){this.rangeFrom.x=t},$p.rangeFromY=function(t){this.rangeFrom.y=t},$p.rangeFromZ=function(t){this.rangeFrom.z=t},$p.rangeFrom=function(t){this.rangeFrom.set(t)},$p.minimumVelocityX=function(t){this.minimumVelocity.x=t},$p.minimumVelocityY=function(t){this.minimumVelocity.y=t},$p.minimumVelocityZ=function(t){this.minimumVelocity.z=t},$p.minimumVelocity=function(t){this.minimumVelocity.set(t)},$p.preAction=function(t){Wl(t)&&(this.preAction=t,this.dirtyFilterIdentifier=!0)},$p.stampAction=function(t){Wl(t)&&(this.stampAction=t,this.dirtyFilterIdentifier=!0)},$p.postAction=function(t){Wl(t)&&(this.postAction=t,this.dirtyFilterIdentifier=!0)},$p.world=function(t){let e;t.substring?e=F[t]:Zl(t)&&t.type===Oa&&(e=t),e&&(this.world=e)},$p.artefact=function(t){let e;t.substring?e=o[t]:Zl(t)&&t.isArtefact&&(e=t),e&&(this.artefact=e,this.dirtyFilterIdentifier=!0)},$p.generateAlongPath=function(t){let e;t.substring?e=o[t]:Zl(t)&&t.isArtefact&&(e=t),e&&e.useAsPath?this.generateAlongPath=e:this.generateAlongPath=!1,this.dirtyFilterIdentifier=!0},$p.generateInArea=function(t){let e;t.substring?e=o[t]:Zl(t)&&t.isArtefact&&(e=t),this.generateInArea=e||!1,this.dirtyFilterIdentifier=!0},$p.fillColor=function(t){this.fillColorFactory.set({color:t}),this.dirtyFilterIdentifier=!0},$p.fillMinimumColor=function(t){this.fillColorFactory.set({minimumColor:t}),this.dirtyFilterIdentifier=!0},$p.fillMaximumColor=function(t){this.fillColorFactory.set({maximumColor:t}),this.dirtyFilterIdentifier=!0},$p.strokeColor=function(t){this.strokeColorFactory.set({color:t}),this.dirtyFilterIdentifier=!0},$p.strokeMinimumColor=function(t){this.strokeColorFactory.set({minimumColor:t}),this.dirtyFilterIdentifier=!0},$p.strokeMaximumColor=function(t){this.strokeColorFactory.set({maximumColor:t}),this.dirtyFilterIdentifier=!0},$p.hitRadius=function(t){t.toFixed&&(this.hitRadius=t,this.width=this.height=2*t)},Mp.hitRadius=function(t){t.toFixed&&(this.hitRadius+=t,this.width=this.height=2*this.hitRadius)},$p.width=function(t){t.toFixed&&(this.hitRadius=t/2,this.width=this.height=t)},Mp.width=function(t){t.toFixed&&(this.hitRadius=t/2,this.width=this.height=t)},$p.height=$p.width,Mp.height=Mp.width,Bp.prepareStamp=function(){this.dirtyHost&&(this.dirtyHost=!1,this.dirtyDimensions=!0),(this.dirtyScale||this.dirtyDimensions||this.dirtyStart||this.dirtyOffset||this.dirtyHandle)&&(this.dirtyPathObject=!0),this.dirtyScale&&this.cleanScale(),this.dirtyDimensions&&this.cleanDimensions(),this.dirtyLock&&this.cleanLock(),this.dirtyStart&&this.cleanStart(),this.dirtyOffset&&this.cleanOffset(),this.dirtyHandle&&this.cleanHandle(),this.dirtyRotation&&this.cleanRotation(),(this.lockTo.includes(ys)||this.lockTo.includes(Ns))&&(this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtyStampHandlePositions&&this.cleanStampHandlePositions();const t=vt(),{particleStore:e,deadParticles:i,liveParticles:n,particleCount:s,generationRate:r,resetAfterBlur:o}=this;let a=this.generatorChoke;a||(this.generatorChoke=a=t),e.forEach((t=>{t.isRunning?n.push(t):i.push(t)})),e.length=0,i.forEach((t=>Ep(t))),i.length=0,e.push(...n),n.length=0;let l=t-a;if(l/1e3>o&&(l=0,this.generatorChoke=t),l>0&&r){let i=dt(r/1e3*l);if(s){const t=s-e.length;t<=0?i=0:tR.isPointInPath(H,...t,Y);D.rotateDestination(R,r,o,F);t:for(n=0;n1?([,,...D]=b[dt(Ft()*b.length)],D?o.setFromArray(D):o.setFromVector(y.position)):o.setFromVector(y.position)):o.setFromArray(k),s=Hp(),s.set({positionX:Il(o.x),positionY:Il(o.y),positionZ:Il(o.z),historyLength:h,engine:u,forces:d,mass:e(f,p),fill:g.getRangeColor(Ft()),stroke:m.getRangeColor(Ft())}),H?(o.zero(),c=dt(360/H),o.x=i($,I,S.x),o.rotate(dt(Ft()*c)*H),s.set({velocityX:Il(o.x),velocityY:Il(o.y),velocityZ:i(X,L,S.z)})):s.set({velocityX:i($,I,S.x),velocityY:i(M,B,S.y),velocityZ:i(X,L,S.z)}),s.velocity.rotate(O),a=et(e(v,C)),l=et(e(P,x)),s.run(a,l,w),A.push(s);zd(o)}else if(R){const r=A.length,o=jd();let c,y;for(n=0;na&&(i.forEach((t=>Ep(t))),i.length=0,f=$t),i.forEach((e=>e.applyForces(t,d))),i.forEach((e=>e.update(f,t))),n.call(this,d),i.forEach((t=>{t.manageHistory(f,d),s.call(this,e,t,d)})),r.call(this,d),l){const t=d.engine;t.save(),t.lineWidth=1,t.strokeStyle=h,t.setTransform(1,0,0,1,0,0),t.beginPath(),t.arc(u[0],u[1],c,0,xt),t.stroke(),t.restore()}this.lastUpdated=p},Bp.checkHit=function(t=[]){if(this.noUserInteraction)return!1;const e=mt(t)?t:[t],i=this.currentStampPosition;let n,s,r=!1;return!!e.some((t=>{if(mt(t))n=t[0],s=t[1];else{if(!ec(t,t.x,t.y))return!1;n=t.x,s=t.y}if(!yt(n)||!yt(s))return!1;const e=jd(i).vectorSubtract(t);return e.getMagnitude()=200)return Ji[7];if(e>=150)return Ji[6];if(e>=125)return Ji[5];if(e>=112.5)return Ji[4]}}return $s},Np.fontWeight=function(t){this.fontWeight=t.toFixed?`${t}`:t},Np.direction=function(t){null!=t&&t.substring&&(this.direction=t)},Np.fontKerning=function(t){null!=t&&t.substring&&(this.fontKerning=t)},zp.letterSpaceValue=function(){return this.letterSpaceValue},zp.letterSpacing=function(){return`${this.letterSpaceValue}px`},Vp.letterSpacing=function(t){if(null!=t){t===$s&&(t=0);const e=t.toFixed?t:parseFloat(t);yt(e)&&(this.letterSpaceValue+=e,this.letterSpacing=`${this.letterSpaceValue}px`)}},Np.letterSpacing=function(t){if(null!=t){t===$s&&(t=0);const e=t.toFixed?t:parseFloat(t);yt(e)&&(this.letterSpaceValue=e,this.letterSpacing=`${e}px`)}},zp.wordSpaceValue=function(){return this.wordSpaceValue},zp.wordSpacing=function(){return`${this.wordSpaceValue}px`},Vp.wordSpacing=function(t){if(null!=t){const e=t.toFixed?t:parseFloat(t);yt(e)&&(this.wordSpaceValue+=e,this.wordSpacing=`${this.wordSpaceValue}px`)}},Np.wordSpacing=function(t){if(null!=t){const e=t.toFixed?t:parseFloat(t);yt(e)&&(this.wordSpaceValue=e,this.wordSpacing=`${e}px`)}},Np.textRendering=function(t){null!=t&&t.substring&&(this.textRendering=t)},zp.textAlign=Bl,Np.textAlign=Bl,zp.textBaseline=Bl,Np.textBaseline=Bl;const Wp=function(t){return!!t&&new Yp(t)};J.TextStyle=Yp;const Up=document.createElement(Di);function Zp(t=Xl){const e={textIsAccessible:!0,accessibleText:"§",accessibleTextPlaceholder:"§",accessibleTextRole:Ol,accessibleTextOrder:0};t.defs=Kl(t.defs,e),t.finalizePacketOut=function(t,e){const i=Ct(this.defaultTextStyle.saveAsPacket(e))[3],n=Ct(this.state.saveAsPacket(e))[3];return t=Kl(t,{direction:i.direction,fillStyle:i.fillStyle,fontKerning:i.fontKerning,fontStretch:i.fontStretch,fontString:i.fontString,fontVariantCaps:i.fontVariantCaps,highlightStyle:i.highlightStyle,includeHighlight:i.includeHighlight,includeUnderline:i.includeUnderline,letterSpacing:i.letterSpaceValue,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset,lineWidth:i.lineWidth,method:i.method,overlineOffset:i.overlineOffset,overlineStyle:i.overlineStyle,overlineWidth:i.overlineWidth,strokeStyle:i.strokeStyle,textRendering:i.textRendering,underlineGap:i.underlineGap,underlineOffset:i.underlineOffset,underlineStyle:i.underlineStyle,underlineWidth:i.underlineWidth,wordSpacing:i.wordSpaceValue,filter:n.filter,font:null,globalAlpha:n.globalAlpha,globalCompositeOperation:n.globalCompositeOperation,imageSmoothingEnabled:n.imageSmoothingEnabled,imageSmoothingQuality:n.imageSmoothingQuality,lineCap:uo,lineJoin:uo,miterLimit:10,shadowBlur:n.shadowBlur,shadowColor:n.shadowColor,shadowOffsetX:n.shadowOffsetX,shadowOffsetY:n.shadowOffsetY,textAlign:ts,textBaseline:Za}),this.type===la&&(t=this.handlePacketAnchor(t,e)),t},t.factoryKill=function(){this.dirtyCache(),this.accessibleTextHold&&this.accessibleTextHold.remove();const t=this.getCanvasTextHold(this.currentHost);t&&(t.dirtyTextTabOrder=!0)},t.get=function(t){const{defs:e,getters:i,state:n,defaultTextStyle:s,layoutTemplate:r}=this,o=s?s.getters:Xl,a=s?s.defs:Xl,l=n?n.getters:Xl,c=n?n.defs:Xl;let h;if(r&&Ha.includes(t))return r.get(t);if(za.includes(t)){if(h=o[t],h)return h.call(s);if(typeof a[t]!=al)return s[t]}if(Lo.includes(t)){if(h=l[t],h)return h.call(n);if(typeof c[t]!=al)return n[t]}return h=i[t],h?h.call(this):typeof e[t]!=al?this[t]:null},t.set=function(t=Xl){const e=St(t),i=e.length;if(i){this.dirtyCache();const{defs:n,setters:s,state:r,defaultTextStyle:o,layoutTemplate:a}=this,l=o?o.setters:Xl,c=o?o.defs:Xl,h=r?r.setters:Xl,u=r?r.defs:Xl;let d,f,p,g;for(f=0;f=2?t.imageSmoothingEnabled=!1:(t.imageSmoothingEnabled=!0,t.imageSmoothingQuality=xn)},t.getCalculators=function(){let t=null,e=null;const i=this.getControllerCell();return i&&(t=i.fontSizeCalculator,e=i.fontSizeCalculatorValues),[t,e]},t.temperFont=function(){const{group:t,defaultTextStyle:e}=this;if(ec(t,e)){const[t,i]=this.getCalculators();t?this.calculateTextStyleFontStrings(e,t,i):this.dirtyFont=!0}},t.cleanFont=function(){if(this.currentFontIsLoaded)this.dirtyFont=!1,this.temperFont(),this.type!==la||this.dirtyFont||this.measureFont();else if(null!=this.currentFontIsLoaded){const[t,e]=this.getCalculators(),i=this.defaultTextStyle.fontString;if(t){t.style.font=i;const n=e.fontFamily;A.includes(`100px ${n}`)?(this.currentFontIsLoaded=!0,this.dirtyFont=!1,this.temperFont(),this.type!==la||this.dirtyFont||this.measureFont()):this.checkFontIsLoaded(i)}}},t.calculateTextStyleFontStrings=function(t,e,i){let n=t.fontSize;const{fontStretch:s,fontStyle:r,fontWeight:o,fontVariantCaps:a,fontString:l}=t,{lineSpacing:c,updateUsingFontParts:h,updateUsingFontString:u}=this,d=this.getScale();e.style.font=l;const f=i.fontFamily;if(this.getFontMetadata(f),u||null==n||!n){this.updateUsingFontString=!1;const s=l.match(Qi);s&&s[0]&&(n=s[0]),e.style.fontSize=n,t.fontSize=i.fontSize}h?(this.updateUsingFontParts=!1,e.style.fontStretch=s,e.style.fontStyle=r,e.style.fontVariantCaps=a,e.style.fontWeight=o,e.style.fontSize=n):1!==d&&(e.style.fontSize=n);const p=i.fontWeight,g=t.fontStretchHelper(i.fontStretch);let m=i.fontVariantCaps,y=i.fontStyle;m=en.includes(m)?m:$s,y=y===Xn||y.includes(Ms)?y:$s;const b=i.fontSize,S=parseFloat(b);if(t.fontSizeValue=S,null!=c&&l.includes("/")){const t=parseFloat(i.lineHeight);this.lineSpacing=yt(t)?t/S:this.defs.lineSpacing,this.dirtyLayout=!0}t.fontStretch=g,t.fontStyle=y,t.fontVariantCaps=m,t.fontWeight=p,t.fontFamily=f,this.updateCanvasFont(t,d),this.updateFontString(t)},t.getScale=function(){const t=this.layoutTemplate;return t?null!=t.currentScale?t.currentScale:1:null!=this.currentScale?this.currentScale:1},t.getStyle=function(t,e,i){if(null==i)return He;if(t||(t=this.state[e]),null==t)return He;if(t.substring){let e=null;L.includes(t)?e=B[t]:f.includes(t)&&(e=d[t]),null!=e&&(t=e.getData(this,i))}else t=t.getData(this,i);return t},t.getFontMetadata=function(t){if(t){const e=`100px ${t}`;if(A.includes(e))return k[e];const i=mu(),n=i.engine;n.textAlign=ts,n.textBaseline=Za,n.font=e;const s=n.measureText(Oo),{actualBoundingBoxAscent:r,actualBoundingBoxDescent:o,fontBoundingBoxAscent:a,fontBoundingBoxDescent:l,alphabeticBaseline:c,hangingBaseline:h,ideographicBaseline:u}=s;let d=a+l;yt(d)||(d=ot(et(o)+et(r)));const f=yt(a)?a:r;return A.push(e),k[e]={height:d,verticalOffset:f,alphabeticRatio:et((c-f)/d),hangingRatio:et((h-f)/d),ideographicRatio:et((u-f)/d),alphabeticBaseline:-c,hangingBaseline:-h,ideographicBaseline:-u},yu(i),k[e]}},t.checkFontIsLoaded=function(t){if(null==t)this.currentFontIsLoaded=!1;else if(Zo.includes(t))this.currentFontIsLoaded=!0;else if(null!=this.currentFontIsLoaded&&!this.currentFontIsLoaded){this.currentFontIsLoaded=null;document.fonts.load(t).then((()=>this.currentFontIsLoaded=!0)).catch((e=>{this.currentFontIsLoaded=!1,console.log("checkFontIsLoaded error:",t,e)}))}},t.getCanvasTextHold=function(t){return t&&t.type===qo&&t.controller&&t.controller.type&&t.controller.type===Ko&&t.controller.textHold?t.controller:!(!t||t.type!==qo||!t.currentHost)&&this.getCanvasTextHold(t.currentHost)},t.updateAccessibleTextHold=function(){if(this.dirtyText=!1,this.textIsAccessible){if(!this.accessibleTextHold){const t=document.createElement(Di);t.id=`${this.name}-text-hold`,t.setAttribute(ve,ar),t.setAttribute(bi,this.accessibleTextOrder),this.accessibleTextRole&&t.setAttribute(co,this.accessibleTextRole),this.accessibleTextHold=t,this.accessibleTextHoldAttached=!1}if(this.accessibleTextHold.textContent=this.getAccessibleText(),this.currentHost){const t=this.getCanvasTextHold(this.currentHost);t&&t.textHold&&(this.accessibleTextHoldAttached||(t.textHold.appendChild(this.accessibleTextHold),this.accessibleTextHoldAttached=!0),t.dirtyTextTabOrder=!0)}}else if(this.accessibleTextHold){this.accessibleTextHold.remove(),this.accessibleTextHold=null,this.accessibleTextHoldAttached=!1;const t=this.getCanvasTextHold(this.currentHost);t&&(t.dirtyTextTabOrder=!0)}},t.getAccessibleText=function(){const{accessibleText:t,accessibleTextPlaceholder:e,text:i}=this;return t.replace(e,i)}}const EnhancedLabel=function(t=Xl){return this.makeName(t.name),this.register(),this.state=Kh(Xl),this.defaultTextStyle=Wp({isDefaultTextStyle:!0}),this.cache=null,this.textUnitHitZones=[],this.pivoted=[],this.set(this.defs),t.group||(t.group=af),this.currentFontIsLoaded=!1,this.updateUsingFontParts=!1,this.updateUsingFontString=!1,this.usingViewportFontSizing=!1,this.useMimicDimensions=!0,this.useMimicFlip=!0,this.useMimicHandle=!0,this.useMimicOffset=!0,this.useMimicRotation=!0,this.useMimicScale=!0,this.useMimicStart=!0,this.delta={},this.deltaConstraints={},this.currentStampPosition=vu(),this.textHandle=vu(),this.textOffset=vu(),this.lines=[],this.textUnits=pg(),this.underlinePaths=[],this.overlinePaths=[],this.highlightPaths=[],this.guidelineDash=[],this.set(t),this.dirtyFont=!0,this.currentFontIsLoaded=!1,this},_p=EnhancedLabel.prototype=rc();_p.type=ea,_p.lib=Gi,_p.isArtefact=!0,_p.isAsset=!1,nh(_p),Sd(_p),fd(_p),Zp(_p);const Kp={text:Ol,lineSpacing:1.5,layoutTemplate:null,useLayoutTemplateAsPath:!1,pathPosition:0,constantSpeedAlongPath:!0,alignment:0,alignTextUnitsToPath:!0,lineAdjustment:0,breakTextOnSpaces:!0,breakWordsOnHyphens:!1,justifyLine:Ue,textUnitFlow:"row",truncateString:"…",hyphenString:"-",textHandle:null,textOffset:null,showGuidelines:!1,guidelineStyle:"rgb(0 0 0 / 0.5)",guidelineWidth:1,guidelineDash:null,visibility:!0,calculateOrder:0,stampOrder:0,host:null,group:null,method:Ni,lockFillStyleToEntity:!1,lockStrokeStyleToEntity:!1,cacheOutput:!0,checkHitUseTemplate:!0};_p.defs=Kl(_p.defs,Kp),_p.packetExclusions=Ql(_p.packetExclusions,["pathObject","mimicked","pivoted","state"]),_p.packetExclusionsByRegex=Ql(_p.packetExclusionsByRegex,["^(local|dirty|current)","Subscriber$"]),_p.packetCoordinates=Ql(_p.packetCoordinates,["start","handle","offset"]),_p.packetObjects=Ql(_p.packetObjects,["group","layoutTemplate"]),_p.packetFunctions=Ql(_p.packetFunctions,["onEnter","onLeave","onDown","onUp"]),_p.processPacketOut=function(t,e,i){return this.processEntityPacketOut(t,e,i)},_p.handlePacketAnchor=function(t){return t},_p.processEntityPacketOut=function(t,e,i){return this.processFactoryPacketOut(t,e,i)},_p.processFactoryPacketOut=function(t,e,i){let n=!0;return i.indexOf(t)||e!==this.defs[t]||(n=!1),n},_p.postCloneAction=function(t){return t},_p.kill=function(t=!1,e=!1){const i=this.name;return Mt(v).forEach((t=>{t.artefacts.includes(i)&&t.removeArtefacts(i)})),this.anchor&&this.demolishAnchor(),this.button&&this.demolishButton(),Mt(o).forEach((t=>{t.name!==i&&(t.pivot&&t.pivot.name===i&&t.set({pivot:!1}),t.mimic&&t.mimic.name===i&&t.set({mimic:!1}),t.path&&t.path.name===i&&t.set({path:!1}),t.generateAlongPath&&t.generateAlongPath.name===i&&t.set({generateAlongPath:!1}),t.generateInArea&&t.generateInArea.name===i&&t.set({generateInArea:!1}),t.artefact&&t.artefact.name===i&&t.set({artefact:!1}),mt(t.pins)&&t.pins.forEach(((e,n)=>{Zl(e)&&e.name===i&&t.removePinAt(n)})))})),Mt(E).forEach((t=>{t.checkForTarget(i)&&t.removeFromTargets(this)})),this.factoryKill(t,e),this.deregister(),this};const qp=_p.getters,Qp=_p.setters,Jp=_p.deltaSetters;qp.group=function(){return this.group?this.group.name:Ol},Qp.group=function(t){let e;t&&(this.group&&this.group.type===oa&&this.group.removeArtefacts(this.name),t.substring?(e=v[t],this.group=e||t):this.group=t),this.group&&this.group.type===oa&&this.group.addArtefacts(this.name)},Qp.layoutTemplate=function(t){if(t){const e=this.layoutTemplate,i=t.substring?o[t]:t,n=this.name;i&&i.name&&(e&&e.name!==i.name&&(e.mimicked&&Jl(e.mimicked,n),e.pathed&&Jl(e.pathed,n)),i.mimicked&&Ql(i.mimicked,n),i.pathed&&Ql(i.pathed,n),this.layoutTemplate=i,this.dirtyPathObject=!0,this.dirtyLayout=!0)}},Qp.breakTextOnSpaces=function(t){this.breakTextOnSpaces=!!t,this.dirtyText=!0},Qp.breakWordsOnHyphens=function(t){this.breakWordsOnHyphens=!!t,this.dirtyText=!0},Qp.truncateString=function(t){t.substring&&(this.truncateString=this.convertTextEntityCharacters(t),this.dirtyText=!0)},Qp.hyphenString=function(t){t.substring&&(this.hyphenString=this.convertTextEntityCharacters(t),this.dirtyText=!0)},Qp.textHandleX=function(t){this.textHandle[0]=t,this.dirtyLayout=!0},Qp.textHandleY=function(t){this.textHandle[1]=t,this.dirtyLayout=!0},Qp.textHandle=function(t){mt(t)&&t.length>1&&(this.textHandle[0]=t[0],this.textHandle[1]=t[1],this.dirtyLayout=!0)},Qp.guidelineDash=function(t){mt(t)&&(this.guidelineDash=t)},Qp.guidelineStyle=function(t){t?t.substring&&(this.guidelineStyle=t):this.guidelineStyle=this.defs.guidelineStyle},Qp.pathPosition=function(t){t<0&&(t=et(t)),t>1&&(t%=1),this.pathPosition=parseFloat(t.toFixed(6)),this.dirtyTextLayout=!0},Jp.pathPosition=function(t){let e=this.pathPosition+t;e<0&&(e+=1),e>1&&(e%=1),this.pathPosition=parseFloat(e.toFixed(6)),this.dirtyTextLayout=!0},Qp.textUnitFlow=function(t){this.textUnitFlow=t,this.dirtyText=!0},qp.textUnits=function(){return this.textUnits},qp.textLines=function(){return this.lines},_p.getTester=function(){const t=this.getControllerCell();return t?t.labelStylesCalculator:null},_p.makeWorkingTextStyle=function(t){const e=ct(t);return nt(e,t),e.isDefaultTextStyle=!1,e},_p.setEngineFromWorkingTextStyle=function(t,e,i,n){this.updateWorkingTextStyle(t,e),i.set(t),n.setEngine(this)},_p.updateWorkingTextStyle=function(t,e){let i=1;this.layoutTemplate&&(i=this.layoutTemplate.currentScale),t.set(e,!0),this.updateCanvasFont(t,i),this.updateFontString(t)},_p.getTextHandleX=function(t,e,i){return t.toFixed?t:t===To?i===as?0:e:t===Ue?e/2:t===Mi?i===as?e:0:t===ts?0:t===lo?e:yt(parseFloat(t))?parseFloat(t)/100*e:0},_p.getTextHandleY=function(t,e,i){const n=this.getFontMetadata(i),{alphabeticRatio:s,hangingRatio:r,height:o,ideographicRatio:a}=n,l=e/100;let c=1;this.layoutTemplate&&(c=this.layoutTemplate.currentScale);const h=o*l;return t.toFixed?t*c:t===Za?0:t===je?h*c:t===Ue?h/2*c:t===de?h*s*c:t===vn?h*r*c:t===Hn?h*a*c:t===gs?h/2*c:yt(parseFloat(t))?parseFloat(t)/100*h:0},_p.getTextOffset=function(t,e){return t.toFixed?t:yt(parseFloat(t))?parseFloat(t)/100*e:0},_p.dirtyCache=function(){yu(this.cache),this.cache=null,this.textUnitHitZones.length=0,this.pivoted.length&&this.updatePivotSubscribers()},_p.cleanPathObject=function(){const t=this.layoutTemplate;t&&this.dirtyPathObject&&t.pathObject&&(this.dirtyPathObject=!1,this.pathObject=new Path2D(t.pathObject))},_p.cleanLayout=function(){this.currentFontIsLoaded&&(this.dirtyCache(),this.dirtyLayout=!1,this.useLayoutTemplateAsPath||this.calculateLines(),this.dirtyTextLayout=!0)},_p.calculateLines=function(){const{alignment:t,defaultTextStyle:e,layoutTemplate:i,lineAdjustment:n,lines:s,lineSpacing:r,textUnitFlow:o}=this,{currentDimensions:a,currentScale:l,currentRotation:c,currentStampPosition:h,pathObject:u,winding:d}=i,{fontSizeValue:f}=e,p=(-t-c)*Dt,[g,m]=h,[y,b]=a,S=ku(),k=mu(),A=k.engine;k.rotateDestination(A,g,m,i),A.rotate(p);const v=Mc();let C,P,x,w,O,D;const F=Rt(f*r*l),R=Rt(g),T=Rt(R-y*l*2),H=Rt(R+y*l*2),E=Rt(m+n*l),I=Rt(E-b*l*2),B=Rt(E+b*l*2);if(F){for(let t=E;t>I;t-=F){const e=Mc();C=!1,P=!1;for(let i=T;it[1].length))),Xc(...v,v),L.sort(((t,e)=>t[0]>e[0]?1:t[0]t[1]));Ba.includes(o)&&$.reverse(),Xc(L),$.forEach((e=>{e.forEach((e=>{S.set(e).subtract(h).rotate(t+c).add(h),e[0]=S[0],e[1]=S[1]}))})),ug(...s),s.length=0,$.forEach((t=>{for(let e=0,i=t.length;e{[x,w]=t.startAt,[O,D]=t.endAt,t.length=pt(x-O,w-D),M+=`M ${x}, ${w} ${O}, ${D} `})),this.guidelinesPath=new Path2D(M),yu(k),Au(S)},_p.cleanText=function(){if(this.currentFontIsLoaded){this.dirtyText=!1;const{breakTextOnSpaces:t,breakWordsOnHyphens:e,defaultTextStyle:i,text:n,textUnitFlow:s,textUnits:r}=this,o=[...n],a=i.direction===as,l=Ia.includes(s),c=[];let h=!1;ag(...r),r.length=0;let u=0;t?a&&e?(o.forEach((t=>{Ma.test(t)?(r.push(og({[eg]:c.join(Ol),[ig]:Xa,index:u})),u++,r.push(og({[eg]:t,[ig]:Ga,index:u})),c.length=0,u++):Ea.test(t)?(r.push(og({[eg]:c.join(Ol),[ig]:Xa,index:u})),u++,r.push(og({[eg]:t,[ig]:"H",index:u})),c.length=0,u++):$a.test(t)?(r.push(og({[eg]:c.join(Ol),[ig]:Xa,index:u})),u++,r.push(og({[eg]:t,[ig]:Ya,index:u})),c.length=0,u++):c.push(t)})),c.length&&r.push(og({[eg]:c.join(Ol),[ig]:Xa,index:u}))):(o.forEach((t=>{Ma.test(t)?(r.push(og({[eg]:c.join(Ol),[ig]:Xa,index:u})),u++,r.push(og({[eg]:t,[ig]:Ga})),c.length=0,u++):c.push(t)})),c.length&&r.push(og({[eg]:c.join(Ol),[ig]:Xa,index:u}))):o.forEach(((t,e)=>{c.push(t),l?Ma.test(t)?(r.push(og({[eg]:c.join(Ol),[ig]:Ga,index:u})),c.length=0,u++):La.test(t)?(r.push(og({[eg]:c.join(Ol),[ig]:"B",index:u})),c.length=0,u++):ja.test(t)?(r.push(og({[eg]:c.join(Ol),[ig]:"Z",index:u})),c.length=0,u++):(r.push(og({[eg]:c.join(Ol),[ig]:Xa,index:u})),c.length=0,u++):(h=La.test(t)||La.test(o[e+1]),h||(Ma.test(t)?(r.push(og({[eg]:c.join(Ol),[ig]:Ga,index:u})),c.length=0,u++):(r.push(og({[eg]:c.join(Ol),[ig]:Xa,index:u})),c.length=0,u++)))})),this.assessTextForStyle(),this.measureTextUnits(),this.dirtyTextLayout=!0}},_p.assessTextForStyle=function(){const t=this.getTester();if(!t)return this.dirtyText=!0,null;const e=t=>{if(3!==t.nodeType)for(const i of t.childNodes)e(i);else{const e=u[i(f)];null!=e&&null==e.style&&(e.style=Wp({})),f+=t.textContent.length,l(t,e)}},i=t=>{let e=0;for(let i=0,n=u.length;i{const i=at(t.parentNode),l={};let c,h;c=d.direction,h=i.getPropertyValue("direction"),c!==h&&(l.direction=h),c=d.fontFamily,h=i.getPropertyValue("font-family"),c!==h&&(l.fontFamily=h),c=d.fontKerning,h=i.getPropertyValue("font-kerning"),c!==h&&(l.fontKerning=h),c=d.fontSize,h=i.getPropertyValue("font-size"),c!==h&&(l.fontSize=h,nn.test(h)&&(this.usingViewportFontSizing=!0)),c=d.fontStretch,h=i.getPropertyValue("font-stretch"),"100%"===h&&(h=$s),c!==h&&(l.fontStretch=h),c=d.fontStyle,h=i.getPropertyValue("font-style"),c!==h&&(l.fontStyle=h),c=d.fontVariantCaps,h=i.getPropertyValue("font-variant-caps"),c!==h&&(l.fontVariantCaps=h),c=d.fontWeight,h=i.getPropertyValue("font-weight"),c!==h&&(l.fontWeight=h),c=d.get("letterSpacing"),h=i.getPropertyValue("letter-spacing"),h===$s&&(h=dr),c!==h&&(l.letterSpacing=h),c=d.textRendering,h=i.getPropertyValue("text-rendering"),c!==h&&(l.textRendering=h),c=d.get("wordSpacing"),h=i.getPropertyValue("word-spacing"),c!==h&&(l.wordSpacing=h),c=d.fillStyle,h=i.getPropertyValue("--SC-fill-style"),c!==h&&(l.fillStyle=h),c=d.includeHighlight,h=!!i.getPropertyValue("--SC-include-highlight"),c!==h&&(l.includeHighlight=h),c=d.highlightStyle,h=i.getPropertyValue("--SC-highlight-style"),c!==h&&(l.highlightStyle=h),c=d.lineWidth,h=parseFloat(i.getPropertyValue("--SC-stroke-width")),c!==h&&(l.lineWidth=h),c=d.includeOverline,h=!!i.getPropertyValue("--SC-include-overline"),c!==h&&(l.includeOverline=h),c=d.overlineOffset,h=parseFloat(i.getPropertyValue("--SC-overline-offset")),c!==h&&(l.overlineOffset=h),c=d.overlineStyle,h=i.getPropertyValue("--SC-overline-style"),c!==h&&(l.overlineStyle=h),c=d.overlineWidth,h=parseFloat(i.getPropertyValue("--SC-overline-width")),c!==h&&(l.overlineWidth=h),c=d.includeUnderline,h=!!i.getPropertyValue("--SC-include-underline"),c!==h&&(l.includeUnderline=h),c=d.underlineGap,h=parseFloat(i.getPropertyValue("--SC-underline-gap")),c!==h&&(l.underlineGap=h),c=d.underlineOffset,h=parseFloat(i.getPropertyValue("--SC-underline-offset")),c!==h&&(l.underlineOffset=h),c=d.underlineStyle,h=i.getPropertyValue("--SC-underline-style"),c!==h&&(l.underlineStyle=h),c=d.underlineWidth,h=parseFloat(i.getPropertyValue("--SC-underline-width")),c!==h&&(l.underlineWidth=h),c=d.method,h=i.getPropertyValue("--SC-method"),c!==h&&(l.method=h),c=n,h=i.getPropertyValue("--SC-local-handle-x"),c!==h&&(l.localHandleX=h),c=s,h=i.getPropertyValue("--SC-local-handle-y"),c!==h&&(l.localHandleY=h),c=r,h=parseFloat(i.getPropertyValue("--SC-local-offset-x")),c!==h&&(l.localOffsetX=h),c=o,h=parseFloat(i.getPropertyValue("--SC-local-offset-y")),c!==h&&(l.localOffsetY=h),c=a,h=parseFloat(i.getPropertyValue("--SC-local-alignment")),c!==h&&(l.localAlignment=h),e.set(l),e.style.set(l,!0),d.set(l,!0)},{rawText:c,defaultTextStyle:h,textUnits:u}=this,d=this.makeWorkingTextStyle(h);let f=0;this.usingViewportFontSizing=nn.test(d.fontSize),(()=>{t.style.setProperty("direction",h.direction),t.style.setProperty("font-family",h.fontFamily),t.style.setProperty("font-kerning",h.fontKerning),t.style.setProperty("font-size",h.fontSize),t.style.setProperty("font-stretch",h.fontStretch),t.style.setProperty("font-style",h.fontStyle),t.style.setProperty("font-variant-caps",h.fontVariantCaps),t.style.setProperty("font-weight",h.fontWeight),t.style.setProperty("letter-spacing",h.get("letterSpacing")),t.style.setProperty("text-rendering",h.textRendering),t.style.setProperty("word-spacing",h.get("wordSpacing")),t.style.setProperty("--SC-fill-style",h.fillStyle),t.style.setProperty("--SC-highlight-style",h.highlightStyle),t.style.setProperty("--SC-overline-offset",h.overlineOffset),t.style.setProperty("--SC-overline-style",h.overlineStyle),t.style.setProperty("--SC-overline-width",h.overlineWidth),t.style.setProperty("--SC-stroke-width",h.lineWidth),t.style.setProperty("--SC-stroke-style",h.strokeStyle),t.style.setProperty("--SC-underline-gap",h.underlineGap),t.style.setProperty("--SC-underline-offset",h.underlineOffset),t.style.setProperty("--SC-underline-style",h.underlineStyle),t.style.setProperty("--SC-underline-width",h.underlineWidth),t.style.setProperty("--SC-local-handle-x",n),t.style.setProperty("--SC-local-handle-y",s),t.style.setProperty("--SC-local-offset-x",r),t.style.setProperty("--SC-local-offset-y",o),t.style.setProperty("--SC-local-alignment",a),t.style.setProperty("--SC-method",h.method),t.className=this.name,t.innerHTML=c})(),e(t)},_p.measureTextUnits=function(){const{defaultTextStyle:t,hyphenString:e,state:i,textUnitFlow:n,textUnits:s,truncateString:r,breakTextOnSpaces:o}=this,a=mu(),l=a.engine;let c,h,u,d,f,p,g,m,y,b,S;const k=this.makeWorkingTextStyle(t);this.setEngineFromWorkingTextStyle(k,Xl,i,a);const A=Ia.includes(n);s.forEach((t=>{({chars:h,charType:u,style:d}=t),d&&this.setEngineFromWorkingTextStyle(k,d,i,a),c=l.measureText(h),t.len=c.width,u===Ga?t.len+=k.wordSpaceValue:u===Ya?(c=l.measureText(e),t.replaceLen=c.width):(c=l.measureText(r),t.replaceLen=c.width),t.height=A&&!o&&("Z"===u||"B"===u)?0:parseFloat(k.fontSize)})),!this.useLayoutTemplateAsPath&&this.breakTextOnSpaces||(this.setEngineFromWorkingTextStyle(k,t,i,a),s.forEach(((t,e)=>{({chars:h,charType:u,style:d,len:f}=t),d&&this.setEngineFromWorkingTextStyle(k,d,i,a),k.fontKerning!==Bs&&(p=s[e+1],p&&(({style:g,chars:m,charType:y,len:b}=p),u!==Ga&&y!==Ga&&(g&&(g.fontFamily||g.fontSize||g.fontVariantCaps)||(S=f+b,c=l.measureText(`${h}${m}`),p.kernOffset=S-c.width))))}))),yu(a)},_p.layoutText=function(){if(this.currentFontIsLoaded){const{useLayoutTemplateAsPath:t,lines:e,textUnits:i,layoutTemplate:n}=this;t?n&&n.useAsPath&&(this.dirtyTextLayout=!1,ug(...e),e.length=0,e.push(hg({length:n.length,isPathEntity:!0}))):e.length&&i.length&&(this.dirtyTextLayout=!1,e.forEach((t=>{t.unitData.length=0})),i.forEach((t=>{t.stampFlag=!0,t.lineOffset=0}))),this.assignTextUnitsToLines(),this.positionTextUnits()}},_p.assignTextUnitsToLines=function(){const{breakWordsOnHyphens:t,defaultTextStyle:e,layoutTemplate:i,lines:n,textUnitFlow:s,textUnits:r}=this,o=e.direction===as,a=Ia.includes(s),l=i.currentScale,c=r.length;let h,u,d,f,p,g,m,y,b,S,k,A=0;const v=function(t){h-=t,f.push(A),++A};if(n.forEach((e=>{for(({length:y,unitData:f}=e),h=ot(y),k=!0,u=A;u=0;t--){if(({length:y,unitData:f}=n[t]),i=f.reduce(((t,e)=>(r[e]&&r[e].charType===Xa&&t++,t)),0),i){s=[...f];break}f.length=0}if(s&&s.length){for(({length:y,unitData:f}=n[t]),i=f.reduce(((t,e)=>(r[e]&&r[e].len&&(t+=r[e].len),t)),0),u=f.length-1;u>=0;u--)if(d=r[f[u]],d)if(({len:g,replaceLen:e,charType:b}=d),b!==Xa&&b!==Ya)i-=g,s.pop();else{if(i+e=u?(_-=u,A.lineStart=!0):A.lineStart=!1,Z=_/u,A.pathData=n.getPathPositionData(Z,o),({x:$,y:M,angle:X}=A.pathData),E=j-Y,I=z-G,D[0]=$,D[1]=M,F[0]=E,F[1]=I+U,B=e?t+X-90:t-90,A.startAlignment=B,A.startRotation=B*Dt,A.localRotation=T*Dt,_+=O-G):(H=x[0]||a[0]||0,Y=this.getTextHandleX(H,v,f),H=x[1]||a[1]||0,G=this.getTextHandleY(H,C,V),H=w[0]||l[0]||0,j=this.getTextOffset(H,v),H=w[1]||l[1]||0,z=this.getTextOffset(H,C),_+=Y,_>=u?(_-=u,A.lineStart=!0):A.lineStart=!1,Z=_/u,A.pathData=n.getPathPositionData(Z,o),({x:$,y:M,angle:X}=A.pathData),E=j-Y,I=z-G,D[0]=$,D[1]=M,F[0]=E,F[1]=I+U,B=e?t+T+X:t+T,A.startAlignment=B,A.startRotation=B*Dt,A.localRotation=T*Dt,_-=Y,_+=v-P),A.set({boxData:null}),S[0]=$+E,S[1]=M+I-U,b.setFromArray(S).subtract(D).rotate(B).add(D),R.tl.push(...b),S[0]+=v,b.setFromArray(S).subtract(D).rotate(B).add(D),R.tr.push(...b),S[1]=M+I+W,b.setFromArray(S).subtract(D).rotate(B).add(D),R.br.push(...b),S[0]-=v,b.setFromArray(S).subtract(D).rotate(B).add(D),R.bl.push(...b));Au(b,S),Xc(y)},_p.positionTextUnitsInSpace=function(){const{alignment:t,defaultTextStyle:e,getTextHandleX:i,getTextHandleY:n,getTextOffset:s,justifyLine:r,layoutTemplate:o,lines:a,textHandle:l,textOffset:c,textUnitFlow:h,textUnits:u}=this,d=e.direction,f=d===as,p=Ia.includes(h),{currentRotation:g,currentScale:m}=o;let y,b,S,k,A,v,C,P,x,w,O,D,F,R,T,H,E,I,B,L,$,M,X,Y,G,j,z,N,V,W,U,Z,_,K,q;const Q=this.makeWorkingTextStyle(e);this.updateWorkingTextStyle(Q,Xl),Z=Q.fontFamily,_=this.getFontMetadata(Z),K=_.verticalOffset*(Q.fontSizeValue/100)*m,q=_.height*(Q.fontSizeValue/100)*m,a.forEach((e=>{if(({length:b,unitData:S,startAt:N}=e),S.length){const e=Mc(),o=Mc(),a=ku(),h=ku();switch(A=S.length-1,k=0,v=0,C=0,e.length=0,o.length=0,[j,z]=N,S.forEach(((t,i)=>{t.toFixed&&(y=u[t],0!==i&&i!==A||y.charType!==Ga||(y.stampFlag=!1),y.stampFlag&&(e.push(k),k+=p?y.height*m:y.len-y.kernOffset,r!==Fo&&r!==Do||y.charType!==Ga||v++))})),P=b-k,f&&(S.includes(Ya)||S.includes("T"))&&(y=u[S[S.length-2]],P-=null!=y.replaceLen?y.replaceLen:0),r){case Mi:o.push(...e.map((t=>t+P)));break;case Ue:P/=2,o.push(...e.map((t=>t+P)));break;case Fo:v&&(C=P/v),o.push(...e);break;case Do:C=P/(v+2),o.push(...e);break;default:o.push(...e)}if(r===Fo)A=0,S.forEach((t=>{if(y=u[t],y&&y.stampFlag&&(A++,y.charType===Ga))for(let t=A,e=o.length;t{if(y=u[t],y&&y.stampFlag&&(A++,y.charType===Ga))for(let t=A,e=o.length;tt+C)))}S.forEach((e=>{e.toFixed&&(y=u[e],({boxData:R,height:w,len:x,localAlignment:E,localHandle:T,localOffset:H,startCorrection:F,startData:D,style:O}=y),O&&(this.updateWorkingTextStyle(Q,O),Z=Q.fontFamily,_=this.getFontMetadata(Z),K=_.verticalOffset*(w/100)*m,q=_.height*(w/100)*m),y.stampFlag&&(p?(I=o.shift(),B=T[0]||l[0]||0,M=i.call(this,B,x,d),B=T[1]||l[1]||0,X=n.call(this,B,w,Z),B=H[0]||c[0]||0,Y=s.call(this,B,x),B=H[1]||c[1]||0,G=s.call(this,B,w),U=t+g,a.set(I+X,0).rotate(U),V=j+a[0],W=z+a[1],L=V+Y,$=W+G-X+K,D[0]=V,D[1]=W,F[0]=L-V-M,F[1]=$-W,y.startAlignment=U-90,y.startRotation=(U-90)*Dt,y.localRotation=E*Dt):(I=f?o.shift():b-x-o.shift(),B=T[0]||l[0]||0,M=i.call(this,B,x,d),B=T[1]||l[1]||0,X=n.call(this,B,w,Z),B=H[0]||c[0]||0,Y=s.call(this,B,x),B=H[1]||c[1]||0,G=s.call(this,B,w),U=t+g,a.set(I+M,0).rotate(U),V=j+a[0],W=z+a[1],L=V+Y,$=W+G-X+K,D[0]=V,D[1]=W,F[0]=L-V-M,F[1]=$-W,y.startAlignment=U,y.startRotation=U*Dt,y.localRotation=E*Dt),y.set({boxData:null}),h[0]=L-M,h[1]=$-K,U+=E,p&&(U-=90),a.setFromArray(h).subtract(D).rotate(U).add(D),R.tl.push(...a),h[0]+=x,a.setFromArray(h).subtract(D).rotate(U).add(D),R.tr.push(...a),h[1]=$+q-K,a.setFromArray(h).subtract(D).rotate(U).add(D),R.br.push(...a),h[0]-=x,a.setFromArray(h).subtract(D).rotate(U).add(D),R.bl.push(...a)))})),Xc(e,o),Au(a,h)}}))},_p.positionTextDecoration=function(){const t=function(t,e,i,n){if(t.length&&t.length===e.length&&n){const s=Mc(),r=Mc(),o=Mc();let a,l,c,h,u,d,f;for(s.push(...t),r.push(...e),a=0,l=s.length;a=0;o--)a=e[o][0]-e[o+1][0],l=e[o][1]-e[o+1][1],C+=`${a.toFixed(2)}, ${l.toFixed(2)} `;C+="z",n.push([i,new Path2D(C),[...Z]])}},i=function(i=!1){Y.length&&($=w,M=O,X=D,i||(L.underlineStyle&&($=L.underlineStyle),L.underlineOffset&&(M=L.underlineOffset),L.underlineWidth&&(X=L.underlineWidth)),t(Y,G,M,X),e(Y,G,$,f),Y.length=0,G.length=0)},n=function(i=!1){j.length&&($=R,M=T,X=H,i||(L.overlineStyle&&($=L.overlineStyle),L.overlineOffset&&(M=L.overlineOffset),L.overlineWidth&&(X=L.overlineWidth)),t(j,z,M,X),e(j,z,$,h),j.length=0,z.length=0)},s=function(t=!1){N.length&&($=I,t||L.highlightStyle&&($=L.highlightStyle),e(N,V,$,a),N.length=0,V.length=0)},{breakTextOnSpaces:r,defaultTextStyle:o,highlightPaths:a,layoutTemplate:l,lines:c,overlinePaths:h,textUnitFlow:u,textUnits:d,underlinePaths:f,useLayoutTemplateAsPath:p}=this;let g,m,y,b,S,k,A,v,C,P,x,w,O,D,F,R,T,H,E,I,B,L,$,M,X;const Y=Mc(),G=Mc(),j=Mc(),z=Mc(),N=Mc(),V=Mc(),W=ku(),{currentScale:U,currentStampPosition:Z}=l;f.length=0,h.length=0,a.length=0;const _=this.makeWorkingTextStyle(o);this.updateWorkingTextStyle(_,Xl),({includeUnderline:x,underlineStyle:w,underlineOffset:O,underlineWidth:D,includeOverline:F,overlineStyle:R,overlineOffset:T,overlineWidth:H,includeHighlight:E,highlightStyle:I}=_),c.forEach((t=>{g=t.unitData,Y.length=0,G.length=0,j.length=0,z.length=0,N.length=0,V.length=0,g.forEach((t=>{t.toFixed&&(m=d[t],({boxData:b,charType:P,lineStart:B,localStyle:L,style:y}=m),L||(L=Xl),y&&(this.updateWorkingTextStyle(_,y),({includeUnderline:x,includeOverline:F,includeHighlight:E}=_),x&&({underlineStyle:w,underlineOffset:O,underlineWidth:D}=_),F&&({overlineStyle:R,overlineOffset:T,overlineWidth:H}=_),E&&({highlightStyle:I}=_)),m.stampFlag&&(({tl:S,tr:k,br:A,bl:v}=b),Ia.includes(u)?P!==Ga&&((L.includeUnderline||x)&&(Y.push([...S],[...k]),G.push([...v],[...A]),i()),(L.includeOverline||F)&&(j.push([...S],[...k]),z.push([...v],[...A]),n()),(L.includeHighlight||E)&&(N.push([...S],[...k]),V.push([...v],[...A]),s())):p?r?P!==Ga&&((L.includeUnderline||x)&&(Y.push([...S],[...k]),G.push([...v],[...A]),i()),(L.includeOverline||F)&&(j.push([...S],[...k]),z.push([...v],[...A]),n()),(L.includeHighlight||E)&&(N.push([...S],[...k]),V.push([...v],[...A]),s())):(B&&(i(),n(),s()),L.includeUnderline?(i(!0),Y.push([...S],[...k]),G.push([...v],[...A]),i()):x?(Y.push([...S],[...k]),G.push([...v],[...A])):i(),L.includeOverline?(n(!0),j.push([...S],[...k]),z.push([...v],[...A]),n()):F?(j.push([...S],[...k]),z.push([...v],[...A])):n(),L.includeHighlight?(s(!0),N.push([...S],[...k]),V.push([...v],[...A]),s()):E?(N.push([...S],[...k]),V.push([...v],[...A])):s()):(L.includeUnderline?(i(!0),Y.push([...S],[...k]),G.push([...v],[...A]),i()):x?(Y.push([...S],[...k]),G.push([...v],[...A])):i(),L.includeOverline?(n(!0),j.push([...S],[...k]),z.push([...v],[...A]),n()):F?(j.push([...S],[...k]),z.push([...v],[...A])):n(),L.includeHighlight?(s(!0),N.push([...S],[...k]),V.push([...v],[...A]),s()):E?(N.push([...S],[...k]),V.push([...v],[...A])):s())))})),Y.length&&i(),j.length&&n(),N.length&&s()})),Au(W),Xc(Y,G,j,z,N,V)},_p.prepareStamp=function(){this.dirtyHost&&(this.dirtyHost=!1);const t=this.layoutTemplate;this.currentDimensions=t.currentDimensions,this.currentScale=t.currentScale,this.currentStampHandlePosition=t.currentStampHandlePosition,this.currentStampPosition=t.currentStampPosition,this.dirtyScale&&(this.dirtyCache(),this.dirtyScale=!1,this.dirtyFont=!0,this.dirtyPathObject=!0,this.dirtyLayout=!0),(this.dirtyDimensions||this.dirtyStart||this.dirtyOffset||this.dirtyHandle||this.dirtyRotation||this.dirtyFilters)&&(this.dirtyCache(),this.dirtyDimensions=!1,this.dirtyStart=!1,this.dirtyOffset=!1,this.dirtyHandle=!1,this.dirtyRotation=!1,this.dirtyPathObject=!0,this.dirtyLayout=!0),this.dirtyPathObject&&this.cleanPathObject(),this.dirtyFont&&(this.cleanFont(),this.dirtyFont||(this.dirtyText=!0)),!this.dirtyPathObject&&this.currentFontIsLoaded&&(this.dirtyText&&(this.updateAccessibleTextHold(),this.cleanText()),this.dirtyLayout&&this.cleanLayout(),this.dirtyTextLayout&&this.layoutText())},_p.stamp=function(t=!1,e,i){this.dirtyFont||this.dirtyText||this.dirtyLayout||(t?(e&&gn.includes(e.type)&&(this.currentHost=e),i&&(this.set(i),this.prepareStamp()),this.regularStamp()):this.visibility&&this.regularStamp())},_p.simpleStamp=Bl,_p.removeShadowAndAlpha=function(t){t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,t.shadowColor="rgb(0 0 0 / 0)",t.globalAlpha=1,t.globalCompositeOperation=wo,t.lineJoin=uo,t.lineCap=uo,this.setImageSmoothing(t)},_p.getCellCoverage=function(t){const{width:e,height:i,data:n}=t;let s,r,o,a,l=0,c=0,h=e,u=i,d=3;for(o=0,a=e*i;os&&(h=s),lr&&(u=r),c{if(a=o[n],a&&(({chars:f,charType:p,localRotation:d,localStyle:C,startCorrection:u,startData:h,startRotation:k,style:g}=a),C||(C=Xl),g&&(this.setEngineFromWorkingTextStyle(l,g,i,s),this.removeShadowAndAlpha(t),t.lineWidth=l.underlineGap,this.setEngineFromWorkingTextStyle(l,g,i,r),this.removeShadowAndAlpha(e)),p!==Ga)){switch([m,y]=h,[b,S]=u,A=lt(k),v=Et(k),t.setTransform(A,v,-v,A,m,y),e.setTransform(A,v,-v,A,m,y),t.rotate(d),e.rotate(d),t.strokeText(f,b,S),t.fillText(f,b,S),e.save(),P=C.method||l.method,C.fillStyle&&(e.fillStyle=C.fillStyle),C.strokeStyle&&(e.strokeStyle=C.strokeStyle),P){case Ti:e.strokeText(f,b,S);break;case Vi:e.fillText(f,b,S),e.strokeText(f,b,S);break;case Hi:e.strokeText(f,b,S),e.fillText(f,b,S);break;default:e.fillText(f,b,S)}e.restore()}}))}return{copyCell:s,mainCell:r}}return null},_p.createTextCellsForSpace=function(t){const e=t.element,i=e.width,n=e.height,s=mu(i,n),r=mu(i,n);if(s&&r){const t=s.engine,e=r.engine,{state:i,lines:n,textUnits:o,defaultTextStyle:a,hyphenString:l,truncateString:c}=this,h=a.direction===as,u=this.makeWorkingTextStyle(a);return this.setEngineFromWorkingTextStyle(u,Xl,i,s),this.removeShadowAndAlpha(t),this.setEngineFromWorkingTextStyle(u,Xl,i,r),this.removeShadowAndAlpha(e),n.forEach((n=>{const{unitData:a}=n;let d,f,p,g,m,y,b,S,k,A,v,C,P,x,w,O,D;a.forEach(((n,F)=>{if(d=o[n],d&&(({startData:f,startCorrection:p,startRotation:A,localRotation:v,chars:g,style:m,localStyle:O}=d),O||(O=Xl),m&&(this.setEngineFromWorkingTextStyle(u,m,i,s),this.removeShadowAndAlpha(t),t.lineWidth=u.underlineGap,this.setEngineFromWorkingTextStyle(u,m,i,r),this.removeShadowAndAlpha(e)),h?(x=a[F+1],w=x&&x.substring?x===Ya?`${g}${l}`:`${g}${c}`:g):w=g,w!==Oo)){switch([y,b]=f,[S,k]=p,S=dt(S),k=dt(k),C=lt(A),P=Et(A),t.setTransform(C,P,-P,C,y,b),e.setTransform(C,P,-P,C,y,b),t.rotate(v),e.rotate(v),t.strokeText(w,S,k),t.fillText(w,S,k),e.save(),D=O.method||u.method,O.fillStyle&&(e.fillStyle=O.fillStyle),O.strokeStyle&&(e.strokeStyle=O.strokeStyle),D){case Ti:e.strokeText(w,S,k);break;case Vi:e.fillText(w,S,k),e.strokeText(w,S,k);break;case Hi:e.strokeText(w,S,k),e.fillText(w,S,k);break;default:e.fillText(w,S,k)}e.restore()}}))})),{copyCell:s,mainCell:r}}return null},_p.addUnderlinesToCopyCell=function(t,e){const i=this.underlinePaths;if(i.length){const n=t.element,s=n.width,r=n.height,o=mu(s,r);if(o){const t=o.engine;this.removeShadowAndAlpha(t);const n=e.engine;return i.forEach((e=>{t.resetTransform(),t.translate(...e[2]),t.fillStyle=this.getStyle(e[0],"fillStyle",o),t.fill(e[1])})),n.save(),this.removeShadowAndAlpha(n),n.globalCompositeOperation=xo,n.resetTransform(),n.drawImage(o.element,0,0),n.restore(),yu(o),!0}}return!1},_p.createOverlineCell=function(t){const e=this.overlinePaths;if(e.length){const i=t.element,n=i.width,s=i.height,r=mu(n,s);if(r){const t=r.engine;return this.removeShadowAndAlpha(t),e.forEach((e=>{t.resetTransform(),t.translate(...e[2]),t.fillStyle=this.getStyle(e[0],"fillStyle",r),t.fill(e[1])})),r}}return null},_p.createHighlightCell=function(t){const e=this.highlightPaths;if(e.length){const i=t.element,n=i.width,s=i.height,r=mu(n,s);if(r){const t=r.engine;return this.removeShadowAndAlpha(t),e.forEach((e=>{t.resetTransform(),t.translate(...e[2]),t.fillStyle=this.getStyle(e[0],"fillStyle",r),t.fill(e[1])})),r}}return null},_p.stampGuidelinesOnCell=function(t){if(t&&t.engine){const{guidelinesPath:e,guidelineStyle:i,guidelineWidth:n,guidelineDash:s}=this,r=t.engine;r.save(),r.setLineDash(s),r.strokeStyle=i,r.lineWidth=n,this.setImageSmoothing(r),r.stroke(e),r.restore()}},_p.checkHit=function(t=[]){const e=t=>{let e,i;if(mt(t))e=t[0],i=t[1];else{if(!ec(t,t.x,t.y))return[!1];e=t.x,i=t.y}return yt(e)&&yt(i)?[!0,e,i]:[!1]},{checkHitUseTemplate:i,layoutTemplate:n,textUnits:s,textUnitHitZones:r}=this;if(i&&n)return n.checkHit(t);if(!r.length&&s.length){let t,e,i,n;s.forEach((s=>{({tl:t,tr:e,br:i,bl:n}=s.boxData),r.push(new Path2D(`M ${t[0]},${t[1]} ${e[0]},${e[1]} ${i[0]},${i[1]} ${n[0]},${n[1]}Z`))}))}if(r.length){const i=mt(t)?t:[t],n=r.length;let s,o,a,l,c,h,u;const d=mu(),f=d.engine;for(h=0,u=i.length;h{t=o[e],t||(t=l[e],t&&t.type===qo||(t=!1)),t&&(t.dirtyStart=!0),t.addPivotRotation&&(t.dirtyRotation=!0)}),this)},_p.getUnitStartAt=function(t){const e=this.textUnits;return t>=0&&t=0&&t{if(null!==e)for(const[i,n]of ht(t))ng.includes(i)&&e.set({[i]:n})})),this.dirtyLayout=!0,this.dirtyCache()},_p.applyTextUnitUpdates=function(){this.dirtyLayout=!0,this.dirtyCache()};const rg=[],og=function(t=Xl){rg.length||rg.push(new UnitObject);const e=rg.shift();return e.set(t),e},ag=function(...t){t.forEach((t=>{t&&t.type===na&&rg.push(t.reset())}))},LineObject=function(){return this.startAt=vu(),this.endAt=vu(),this.unitData=[],this.set(this.defs),this},lg=LineObject.prototype=rc();lg.type=ia,lg.defs={length:0,isPathEntity:!1,startAt:null,endAt:null,unitData:null},lg.defKeys=St(lg.defs),lg.set=function(t=Xl){for(const[e,i]of ht(t))if(this.defKeys.includes(e))switch(e){case"startAt":case"endAt":null!=i?this[e].set(i):this[e].zero();break;case"unitData":this[e].length=0,null!=i&&this[e].push(...i);break;default:this[e]=null!=i?i:this.defs[e]}return this},lg.reset=function(){return this.set(this.defs),this};const cg=[],hg=function(t=Xl){cg.length||cg.push(new LineObject);const e=cg.shift();return e.set(t),e},ug=function(...t){t.forEach((t=>{t&&t.type===ia&&cg.push(t.reset())}))},dg=function(){const t=[];return Ht(t,dg.prototype),t},fg=dg.prototype=ct(Array.prototype);fg.constructor=dg,fg.type="EnhancedLabelUnitArray";const pg=()=>new dg;fg.findByIndex=function(t){let e;for(let i=0,n=this.length;i{e=i.filters,e&&e.includes(t)&&Jl(e,t)})),Mt(v).forEach((i=>{e=i.filters,e&&e.includes(t)&&Jl(e,t)})),Mt(d).forEach((i=>{e=i.filters,e&&e.includes(t)&&Jl(e,t)})),this.deregister(),this};const Sg=yg.setters;yg.set=function(t=Xl){const e=St(t),i=e.length;if(i){const n=this.setters,s=this.defs;let r,o,a,l;for(o=0;o{6===t.length?e.push(t):2===t.length&&(t[0].substring&&t[1].substring&&(i.length=0,t.forEach((t=>{const[e,n,s]=Qu.extractRGBfromColor(t);i.push(e,n,s)}))),e.push(i))})),t.actions=[{action:Ke,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,ranges:e}]},chromakey:function(t){let e=null!=t.red?t.red:0,i=null!=t.green?t.green:255,n=null!=t.blue?t.blue:0;null!=t.reference&&([e,i,n]=Qu.extractRGBfromColor(t.reference),t.red=e,t.green=i,t.blue=n,delete t.reference),t.actions=[{action:ri,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,red:e,green:i,blue:n,transparentAt:null!=t.transparentAt?t.transparentAt:0,opaqueAt:null!=t.opaqueAt?t.opaqueAt:1}]},clampChannels:function(t){let e=null!=t.lowRed?t.lowRed:0,i=null!=t.lowGreen?t.lowGreen:0,n=null!=t.lowBlue?t.lowBlue:0,s=null!=t.highRed?t.highRed:255,r=null!=t.highGreen?t.highGreen:255,o=null!=t.highBlue?t.highBlue:255;null!=t.lowColor&&([e,i,n]=Qu.extractRGBfromColor(t.lowColor),t.lowRed=e,t.lowGreen=i,t.lowBlue=n,delete t.lowColor),null!=t.highColor&&([s,r,o]=Qu.extractRGBfromColor(t.highColor),t.highRed=s,t.highGreen=r,t.highBlue=o,delete t.highColor),t.actions=[{action:qe,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,lowRed:e,lowGreen:i,lowBlue:n,highRed:s,highGreen:r,highBlue:o}]},compose:function(t){t.actions=[{action:oi,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,lineMix:null!=t.lineMix?t.lineMix:Ol,compose:null!=t.compose?t.compose:wo,offsetX:null!=t.offsetX?t.offsetX:0,offsetY:null!=t.offsetY?t.offsetY:0,opacity:null!=t.opacity?t.opacity:1}]},corrode:function(t){t.actions=[{action:pi,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,width:null!=t.width?t.width:3,height:null!=t.height?t.height:3,offsetX:null!=t.offsetX?t.offsetX:1,offsetY:null!=t.offsetY?t.offsetY:1,includeRed:null!=t.includeRed&&t.includeRed,includeGreen:null!=t.includeGreen&&t.includeGreen,includeBlue:null!=t.includeBlue&&t.includeBlue,includeAlpha:null==t.includeAlpha||t.includeAlpha,operation:null!=t.operation?t.operation:fs,opacity:null!=t.opacity?t.opacity:1}]},curveWeights:function(t){t.actions=[{action:ml,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,weights:null!=t.weights&&t.weights,useMixedChannel:null==t.useMixedChannel||t.useMixedChannel}]},cyan:function(t){t.actions=[{action:De,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,includeGreen:!0,includeBlue:!0,excludeRed:!0}]},displace:function(t){t.actions=[{action:wi,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,lineMix:null!=t.lineMix?t.lineMix:Ol,opacity:null!=t.opacity?t.opacity:1,channelX:null!=t.channelX?t.channelX:Kr,channelY:null!=t.channelY?t.channelY:bn,offsetX:null!=t.offsetX?t.offsetX:0,offsetY:null!=t.offsetY?t.offsetY:0,scaleX:null!=t.scaleX?t.scaleX:1,scaleY:null!=t.scaleY?t.scaleY:1,transparentEdges:null!=t.transparentEdges&&t.transparentEdges}]},edgeDetect:function(t){t.actions=[{action:ds,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,width:3,height:3,offsetX:1,offsetY:1,includeRed:!0,includeGreen:!0,includeBlue:!0,includeAlpha:!1,weights:[0,1,0,1,-4,1,0,1,0]}]},emboss:function(t){const e=[];t.useNaturalGrayscale?e.push({action:yn,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:$i}):e.push({action:De,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:$i,includeRed:!0,includeGreen:!0,includeBlue:!0}),t.clamp&&e.push({action:qe,lineIn:$i,lineOut:$i,lowRed:0+t.clamp,lowGreen:0+t.clamp,lowBlue:0+t.clamp,highRed:255-t.clamp,highGreen:255-t.clamp,highBlue:255-t.clamp}),t.smoothing&&e.push({action:un,lineIn:$i,lineOut:$i,radius:t.smoothing}),e.push({action:Li,lineIn:$i,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,angle:null!=t.angle?t.angle:0,strength:null!=t.strength?t.strength:1,tolerance:null!=t.tolerance?t.tolerance:0,keepOnlyChangedAreas:null!=t.keepOnlyChangedAreas&&t.keepOnlyChangedAreas,postProcessResults:null==t.postProcessResults||t.postProcessResults}),t.actions=e},flood:function(t){let e=null!=t.red?t.red:0,i=null!=t.green?t.green:0,n=null!=t.blue?t.blue:0,s=null!=t.alpha?t.alpha:255;const r=null!=t.excludeAlpha&&t.excludeAlpha;null!=t.reference&&([e,i,n,s]=Qu.extractRGBfromColor(t.reference),s=Rt(255*s),t.red=e,t.green=i,t.blue=n,t.alpha=s,delete t.reference),t.actions=[{action:_i,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,red:e,green:i,blue:n,alpha:s,excludeAlpha:r}]},gaussianBlur:function(t){t.actions=[{action:un,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,radius:null!=t.radius?t.radius:1}]},glitch:function(t){t.actions=[{action:pn,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,useMixedChannel:null==t.useMixedChannel||t.useMixedChannel,seed:null!=t.seed?t.seed:ki,step:null!=t.step?t.step:1,offsetMin:null!=t.offsetMin?t.offsetMin:0,offsetMax:null!=t.offsetMax?t.offsetMax:0,offsetRedMin:null!=t.offsetRedMin?t.offsetRedMin:0,offsetRedMax:null!=t.offsetRedMax?t.offsetRedMax:0,offsetGreenMin:null!=t.offsetGreenMin?t.offsetGreenMin:0,offsetGreenMax:null!=t.offsetGreenMax?t.offsetGreenMax:0,offsetBlueMin:null!=t.offsetBlueMin?t.offsetBlueMin:0,offsetBlueMax:null!=t.offsetBlueMax?t.offsetBlueMax:0,offsetAlphaMin:null!=t.offsetAlphaMin?t.offsetAlphaMin:0,offsetAlphaMax:null!=t.offsetAlphaMax?t.offsetAlphaMax:0,transparentEdges:null!=t.transparentEdges&&t.transparentEdges,level:null!=t.level?t.level:0}]},gray:function(t){t.actions=[{action:De,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,includeRed:!0,includeGreen:!0,includeBlue:!0}]},grayscale:function(t){t.actions=[{action:yn,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1}]},green:function(t){t.actions=[{action:De,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,excludeRed:!0,excludeBlue:!0}]},image:function(t){t.actions=[{action:ur,lineOut:null!=t.lineOut?t.lineOut:Ol,asset:null!=t.asset?t.asset:Ol,width:null!=t.width?t.width:1,height:null!=t.height?t.height:1,copyWidth:null!=t.copyWidth?t.copyWidth:1,copyHeight:null!=t.copyHeight?t.copyHeight:1,copyX:null!=t.copyX?t.copyX:0,copyY:null!=t.copyY?t.copyY:0}]},invert:function(t){t.actions=[{action:Mn,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,includeRed:!0,includeGreen:!0,includeBlue:!0}]},magenta:function(t){t.actions=[{action:De,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,includeRed:!0,includeBlue:!0,excludeGreen:!0}]},mapToGradient:function(t){t.gradient&&t.gradient.substring&&(t.gradient=B[t.gradient]),t.actions=[{action:cs,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,useNaturalGrayscale:null!=t.useNaturalGrayscale&&t.useNaturalGrayscale,gradient:t.gradient||mg()}]},matrix:function(t){t.actions=[{action:ds,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,width:3,height:3,offsetX:1,offsetY:1,includeRed:null==t.includeRed||t.includeRed,includeGreen:null==t.includeGreen||t.includeGreen,includeBlue:null==t.includeBlue||t.includeBlue,includeAlpha:null!=t.includeAlpha&&t.includeAlpha,weights:null!=t.weights?t.weights:[0,0,0,0,1,0,0,0,0]}]},matrix5:function(t){t.actions=[{action:ds,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,width:5,height:5,offsetX:2,offsetY:2,includeRed:null==t.includeRed||t.includeRed,includeGreen:null==t.includeGreen||t.includeGreen,includeBlue:null==t.includeBlue||t.includeBlue,includeAlpha:null!=t.includeAlpha&&t.includeAlpha,weights:null!=t.weights?t.weights:[0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]}]},newsprint:function(t){t.actions=[{action:Rs,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,width:null!=t.width?t.width:1}]},notblue:function(t){t.actions=[{action:po,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,includeBlue:!0,level:0}]},notgreen:function(t){t.actions=[{action:po,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,includeGreen:!0,level:0}]},notred:function(t){t.actions=[{action:po,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,includeRed:!0,level:0}]},offset:function(t){t.actions=[{action:Xs,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,offsetRedX:null!=t.offsetX?t.offsetX:0,offsetRedY:null!=t.offsetY?t.offsetY:0,offsetGreenX:null!=t.offsetX?t.offsetX:0,offsetGreenY:null!=t.offsetY?t.offsetY:0,offsetBlueX:null!=t.offsetX?t.offsetX:0,offsetBlueY:null!=t.offsetY?t.offsetY:0,offsetAlphaX:null!=t.offsetX?t.offsetX:0,offsetAlphaY:null!=t.offsetY?t.offsetY:0}]},offsetChannels:function(t){t.actions=[{action:Xs,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,offsetRedX:null!=t.offsetRedX?t.offsetRedX:0,offsetRedY:null!=t.offsetRedY?t.offsetRedY:0,offsetGreenX:null!=t.offsetGreenX?t.offsetGreenX:0,offsetGreenY:null!=t.offsetGreenY?t.offsetGreenY:0,offsetBlueX:null!=t.offsetBlueX?t.offsetBlueX:0,offsetBlueY:null!=t.offsetBlueY?t.offsetBlueY:0,offsetAlphaX:null!=t.offsetAlphaX?t.offsetAlphaX:0,offsetAlphaY:null!=t.offsetAlphaY?t.offsetAlphaY:0}]},pixelate:function(t){t.actions=[{action:tr,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,tileWidth:null!=t.tileWidth?t.tileWidth:1,tileHeight:null!=t.tileHeight?t.tileHeight:1,offsetX:null!=t.offsetX?t.offsetX:0,offsetY:null!=t.offsetY?t.offsetY:0,includeRed:null==t.includeRed||t.includeRed,includeGreen:null==t.includeGreen||t.includeGreen,includeBlue:null==t.includeBlue||t.includeBlue,includeAlpha:null!=t.includeAlpha&&t.includeAlpha}]},randomNoise:function(t){const e=Es.includes(t.noiseType)?t.noiseType:Nr;t.actions=[{action:Vr,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,width:null!=t.width?t.width:1,height:null!=t.height?t.height:1,seed:null!=t.seed?t.seed:ki,noiseType:e,level:null!=t.level?t.level:0,noWrap:null!=t.noWrap&&t.noWrap,includeRed:null==t.includeRed||t.includeRed,includeGreen:null==t.includeGreen||t.includeGreen,includeBlue:null==t.includeBlue||t.includeBlue,includeAlpha:null==t.includeAlpha||t.includeAlpha,excludeTransparentPixels:null==t.excludeTransparentPixels||t.excludeTransparentPixels}]},red:function(t){t.actions=[{action:De,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,excludeGreen:!0,excludeBlue:!0}]},reducePalette:function(t){let e=null!=t.palette?t.palette:Ee;t.actions=[],e.substring&&e.includes(Se)&&(e=e.split(Se),e.forEach((t=>t.trim())));let i=t.useBluenoise?Me:t.noiseType||Nr;Es.includes(i)||(i=Nr),t.actions.push({action:qr,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,seed:null!=t.seed?t.seed:ki,minimumColorDistance:null!=t.minimumColorDistance?t.minimumColorDistance:1e3,useLabForPaletteDistance:null!=t.useLabForPaletteDistance&&t.useLabForPaletteDistance,palette:e,noiseType:i,opacity:null!=t.opacity?t.opacity:1})},saturation:function(t){const e=null!=t.level?t.level:1;t.actions=[{action:ms,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,red:e,green:e,blue:e,saturation:!0}]},sepia:function(t){t.actions=[{action:Ua,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,redInRed:.393,redInGreen:.349,redInBlue:.272,greenInRed:.769,greenInGreen:.686,greenInBlue:.534,blueInRed:.189,blueInGreen:.168,blueInBlue:.131}]},sharpen:function(t){t.actions=[{action:ds,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,width:3,height:3,offsetX:1,offsetY:1,includeRed:!0,includeGreen:!0,includeBlue:!0,includeAlpha:!1,weights:[0,-1,0,-1,5,-1,0,-1,0]}]},swirl:function(t){const e=null!=t.startX?t.startX:_s,i=null!=t.startY?t.startY:_s,n=null!=t.innerRadius?t.innerRadius:0,s=null!=t.outerRadius?t.outerRadius:"30%",r=null!=t.angle?t.angle:0,o=null!=t.easing?t.easing:is,a=[...null!=t.staticSwirls?t.staticSwirls:[]];a.push([e,i,n,s,r,o]),t.actions=[{action:Uo,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,swirls:a}]},threshold:function(t){let e=null!=t.lowRed?t.lowRed:0,i=null!=t.lowGreen?t.lowGreen:0,n=null!=t.lowBlue?t.lowBlue:0,s=null!=t.lowAlpha?t.lowAlpha:255,r=null!=t.highRed?t.highRed:255,o=null!=t.highGreen?t.highGreen:255,a=null!=t.highBlue?t.highBlue:255,l=null!=t.highAlpha?t.highAlpha:255;null!=t.lowColor&&([e,i,n,s]=Qu.extractRGBfromColor(t.lowColor),s=Rt(255*s),t.lowRed=e,t.lowGreen=i,t.lowBlue=n,t.lowAlpha=s,t.low=[e,i,n,s],delete t.lowColor),null!=t.highColor&&([r,o,a,l]=Qu.extractRGBfromColor(t.highColor),l=Rt(255*l),t.highRed=r,t.highGreen=o,t.highBlue=a,t.highAlpha=l,t.high=[r,o,a,l],delete t.highColor);const c=null!=t.low?t.low:[e,i,n,s],h=null!=t.high?t.high:[r,o,a,l];t.actions=[{action:Na,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,level:null!=t.level?t.level:128,red:null!=t.red?t.red:128,green:null!=t.green?t.green:128,blue:null!=t.blue?t.blue:128,alpha:null!=t.alpha?t.alpha:128,low:c,high:h,includeRed:null==t.includeRed||t.includeRed,includeGreen:null==t.includeGreen||t.includeGreen,includeBlue:null==t.includeBlue||t.includeBlue,includeAlpha:null!=t.includeAlpha&&t.includeAlpha,useMixedChannel:null==t.useMixedChannel||t.useMixedChannel}]},tiles:function(t){t.actions=[{action:Wa,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,tileWidth:null!=t.tileWidth?t.tileWidth:1,tileHeight:null!=t.tileHeight?t.tileHeight:1,tileRadius:null!=t.tileRadius?t.tileRadius:1,offsetX:null!=t.offsetX?t.offsetX:0,offsetY:null!=t.offsetY?t.offsetY:0,angle:null!=t.angle?t.angle:0,points:null!=t.points?t.points:Zr,seed:null!=t.seed?t.seed:ki,includeRed:null==t.includeRed||t.includeRed,includeGreen:null==t.includeGreen||t.includeGreen,includeBlue:null==t.includeBlue||t.includeBlue,includeAlpha:null!=t.includeAlpha&&t.includeAlpha}]},tint:function(t){let e=null!=t.redInRed?t.redInRed:1,i=null!=t.redInGreen?t.redInGreen:0,n=null!=t.redInBlue?t.redInBlue:0,s=null!=t.greenInRed?t.greenInRed:0,r=null!=t.greenInGreen?t.greenInGreen:1,o=null!=t.greenInBlue?t.greenInBlue:0,a=null!=t.blueInRed?t.blueInRed:0,l=null!=t.blueInGreen?t.blueInGreen:0,c=null!=t.blueInBlue?t.blueInBlue:1;null!=t.redColor&&([e,s,a]=Qu.extractRGBfromColor(t.redColor),e/=255,s/=255,a/=255,t.redInRed=e,t.greenInRed=s,t.blueInRed=a,delete t.redColor),null!=t.greenColor&&([i,r,l]=Qu.extractRGBfromColor(t.greenColor),i/=255,r/=255,l/=255,t.redInGreen=i,t.greenInGreen=r,t.blueInGreen=l,delete t.greenColor),null!=t.blueColor&&([n,o,c]=Qu.extractRGBfromColor(t.blueColor),n/=255,o/=255,c/=255,t.redInBlue=n,t.greenInBlue=o,t.blueInBlue=c,delete t.blueColor),t.actions=[{action:Ua,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,redInRed:e,redInGreen:i,redInBlue:n,greenInRed:s,greenInGreen:r,greenInBlue:o,blueInRed:a,blueInGreen:l,blueInBlue:c}]},userDefined:function(t){t.actions=[{action:pl,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1}]},yellow:function(t){t.actions=[{action:De,lineIn:null!=t.lineIn?t.lineIn:Ol,lineOut:null!=t.lineOut?t.lineOut:Ol,opacity:null!=t.opacity?t.opacity:1,includeRed:!0,includeGreen:!0,excludeBlue:!0}]}}),Ag=function(t){return!!t&&new Filter(t)};J.Filter=Filter;const Force=function(t=Xl){return this.makeName(t.name),this.register(),this.set(this.defs),this.set(t),this.action||(this.action=Bl),this},vg=Force.prototype=rc();vg.type="Force",vg.lib="force",vg.isArtefact=!1,vg.isAsset=!1,nh(vg);vg.defs=Kl(vg.defs,{action:null}),vg.packetFunctions=Ql(vg.packetFunctions,["action"]),vg.kill=function(){return this.deregister(),!0};vg.setters.action=function(t){Wl(t)?this.action=t:this.action=Bl};const Cg=function(t){return!!t&&new Force(t)};J.Force=Force,Cg({name:"gravity",action:(t,e)=>{const{mass:i,load:n}=t,s=jd();s.setFromVector(e.gravity).scalarMultiply(i),n.vectorAdd(s),zd(s)}});const Grid=function(t=Xl){return this.tileFill=[],this.tileSources=[],this.entityInit(t),t.tileSources||(this.tileSources=[].concat([{type:si,source:He},{type:si,source:Sl}])),t.tileFill?mt(t.tileFill)&&this.tileFill.length===t.tileFill.length&&(this.tileFill=t.tileFill):(this.tileFill.length=this.columns*this.rows,this.tileFill.fill(0)),this.tilePaths=[],this.tileRealCoordinates=[],this.tileVirtualCoordinates=[],t.dimensions||(t.width||(this.currentDimensions[0]=this.dimensions[0]=20),t.height||(this.currentDimensions[1]=this.dimensions[1]=20)),this},Pg=Grid.prototype=rc();Pg.type="Grid",Pg.lib=Gi,Pg.isArtefact=!0,Pg.isAsset=!1,nh(Pg),jf(Pg);const xg={columns:2,rows:2,columnGutterWidth:1,rowGutterWidth:1,tileSources:null,tileFill:null,gutterColor:"rgb(127 127 127 / 1)"};Pg.defs=Kl(Pg.defs,xg),Pg.packetExclusions=Ql(Pg.packetExclusions,["tileSources"]),Pg.finalizePacketOut=function(t,e){const i=t.tileSources=[];this.tileSources.forEach((t=>{i.push({type:t.type,source:Zl(t.source)?t.source.name:t.source})})),Zl(t.gutterColor)&&(t.gutterColor=t.gutterColor.name);const n=Ct(this.state.saveAsPacket(e))[3];return t=Kl(t,n),t=this.handlePacketAnchor(t,e)};const wg=Pg.setters,Og=Pg.deltaSetters;wg.columns=function(t){if(Ul(t)&&(bt(t)||(t=parseInt(t,10)),t!==this.columns)){let e,i,n;const s=this.tileFill,r=this.columns,o=[];for(this.columns=t,e=0,i=this.rows;e{Ul(t)&&(i[t]=e)})),this.dirtyFilterIdentifier=!0),this},Pg.setTileSourceTo=function(t,e){return Ul(t)&&Zl(e)&&e.type&&e.source&&(this.tileSources[t]=e),this},Pg.removeTileSource=function(t){return Ul(t)&&t&&(this.tileSources[t]=null,this.tileFill=this.tileFill.map((e=>e===t?0:e))),this},Pg.getTileSource=function(t,e){if(Ul(t))return Ul(e)?this.tileFill[t*this.rows+e]:this.tileFill[t]},Pg.getTilesUsingSource=function(t){const e=[];return Ul(t)&&this.tileFill.forEach(((i,n)=>i===t&&e.push(n))),e},Pg.cleanPathObject=function(){if(this.dirtyPathObject=!1,!this.noPathUpdates||!this.pathObject){const t=this.pathObject=new Path2D,e=new Path2D,i=new Path2D,n=this.currentStampHandlePosition,s=this.currentScale,r=this.currentDimensions,o=-n[0]*s,a=-n[1]*s,l=r[0]*s,c=r[1]*s;t.rect(o,a,l,c);const h=this.columns,u=this.rows,d=l/h,f=c/u,p=this.tilePaths,g=this.tileRealCoordinates,m=this.tileVirtualCoordinates;let y,b,S,k;for(e.moveTo(o,a),e.lineTo(o+l,a),y=1;y<=u;y++){const t=a+y*f;e.moveTo(o,t),e.lineTo(o+l,t)}for(this.rowLines=e,i.moveTo(o,a),i.lineTo(o,a+c),b=1;b<=h;b++)S=o+b*d,i.moveTo(S,a),i.lineTo(S,a+c);for(this.columnLines=i,p.length=0,g.length=0,m.length=0,y=0;y0){t.save();const e=mu(),i=e.engine,n=e.element,s=this.tileSources,r=this.tileFill,o=this.tilePaths,a=this.tileRealCoordinates,l=this.tileVirtualCoordinates,c=this.winding,h=this.currentTileWidth,u=this.currentTileHeight,d=this.scale,f=this.currentDimensions;let p;s.forEach(((s,g)=>{if(s&&s.type)switch(s.type){case si:t.fillStyle=s.source;break;case We:this.lockFillStyleToEntity=!1,t.fillStyle=s.source.getData(this,this.currentHost);break;case Sn:this.lockFillStyleToEntity=!0,t.fillStyle=s.source.getData(this,this.currentHost)}const y=r.map((t=>t===g));if(y.length)switch(s.type){case kn:p=s.source.substring?m[s.source]:s.source,p.simpleStamp&&(n.width=f[0]*d,n.height=f[1]*d,i.globalCompositeOperation=wo,i.fillStyle=He,y.forEach(((t,e)=>{t&&i.fillRect(l[e][0],l[e][1],h,u)})),i.globalCompositeOperation=Po,p.simpleStamp(e,{startX:0,startY:0,width:f[0]*d,height:f[1]*d,method:Ni}),t.drawImage(n,~~a[0][0],~~a[0][1]));break;case Va:p=s.source.substring?m[s.source]:s.source,p.simpleStamp&&(n.width=h,n.height=u,i.globalCompositeOperation=wo,p.simpleStamp(e,{startX:0,startY:0,width:h,height:u,method:Ni}),y.forEach(((e,i)=>e&&t.drawImage(n,~~a[i][0],~~a[i][1]))));break;default:y.forEach(((e,i)=>e&&t.fill(o[i],c)))}}));const g=this.gutterColor,y=this.rowGutterWidth,b=this.columnGutterWidth;let S;if(tc(g)){switch(g.substring?S={type:si,source:this.gutterColor}:Zl(g)?S=g:Ul(g)&&Zl(s[g])&&(S=s[g]),S.type){case We:this.lockFillStyleToEntity=!1,t.strokeStyle=S.source.getData(this,this.currentHost);break;case Sn:this.lockFillStyleToEntity=!0,t.strokeStyle=S.source.getData(this,this.currentHost);break;case si:t.strokeStyle=S.source}switch(S.type){case kn:case Va:if((y||b)&&(p=S.source.substring?m[S.source]:S.source,p.simpleStamp)){const s=this.currentStampHandlePosition,r=this.currentScale,o=s[0]*r,l=s[1]*r;n.width=f[0]*r,n.height=f[1]*r,i.globalCompositeOperation=wo,i.strokeStyle=He,i.translate(o,l),y&&(i.lineWidth=y,i.stroke(this.rowLines)),b&&(i.lineWidth=b,i.stroke(this.columnLines)),i.globalCompositeOperation=Po,p.simpleStamp(e,{startX:0,startY:0,width:f[0]*r,height:f[1]*r,method:Ni}),t.drawImage(n,~~a[0][0],~~a[0][1]),i.translate(0,0)}break;default:y&&(t.lineWidth=y,t.stroke(this.rowLines)),b&&(t.lineWidth=b,t.stroke(this.columnLines))}}yu(e),t.restore()}},Pg.fill=function(t){this.performFill(t)},Pg.drawAndFill=function(t){const e=this.pathObject;t.stroke(e),this.currentHost.clearShadow(),this.performFill(t)},Pg.fillAndDraw=function(t){const e=this.pathObject;t.stroke(e),this.currentHost.clearShadow(),this.performFill(t),t.stroke(e)},Pg.drawThenFill=function(t){const e=this.pathObject;t.stroke(e),this.performFill(t)},Pg.fillThenDraw=function(t){const e=this.pathObject;this.performFill(t),t.stroke(e)},Pg.checkHit=function(t=[]){if(this.noUserInteraction)return!1;this.pathObject&&!this.dirtyPathObject||this.cleanPathObject();const e=mt(t)?t:[t],i=mu(),n=i.engine,s=this.currentStampPosition,r=s[0],o=s[1],a=new Set,l=this.tilePaths;let c,h,u;const d=t=>{let e,i;if(mt(t))e=t[0],i=t[1];else{if(!ec(t,t.x,t.y))return[!1];e=t.x,i=t.y}return yt(e)&&yt(i)?[!0,e,i]:[!1]};return i.rotateDestination(n,r,o,this),e.some((t=>([c,h,u]=d(t),!!c&&n.isPointInPath(this.pathObject,h,u,this.winding))),this)?(e.forEach((t=>{[c,h,u]=d(t),c&&l.some(((t,e)=>!!n.isPointInPath(t,h,u,this.winding)&&(a.add(e),!0)))})),yu(i),{x:h,y:u,tiles:[...a],artefact:this}):(yu(i),!1)};const Dg=function(t){return!!t&&new Grid(t)};J.Grid=Grid;const Label=function(t=Xl){return this.entityInit(t),this},Fg=Label.prototype=rc();Fg.type=la,Fg.lib=Gi,Fg.isArtefact=!0,Fg.isAsset=!1,nh(Fg),jf(Fg),Zp(Fg);const Rg={text:Ol,showBoundingBox:!1,boundingBoxStyle:He,boundingBoxLineWidth:1,boundingBoxLineDash:null,boundingBoxLineDashOffset:0};Fg.defs=Kl(Fg.defs,Rg);const Tg=Fg.getters,Hg=Fg.setters,Eg=Fg.deltaSetters;Tg.width=function(){return this.currentDimensions[0]},Hg.width=Bl,Eg.width=Bl,Tg.height=function(){return this.currentDimensions[1]},Hg.height=Bl,Eg.height=Bl,Tg.dimensions=function(){return[...this.currentDimensions]},Hg.dimensions=Bl,Eg.dimensions=Bl,Fg.entityInit=function(t=Xl){this.modifyConstructorInputForAnchorButton(t),this.makeName(t.name),this.register(),this.initializePositions(),this.state=Kh(Xl),this.defaultTextStyle=Wp({name:`${this.name}_default-textstyle`,isDefaultTextStyle:!0}),this.set(this.defs),t.group||(t.group=af),this.onEnter=Bl,this.onLeave=Bl,this.onDown=Bl,this.onUp=Bl,this.currentFontIsLoaded=!1,this.updateUsingFontParts=!1,this.updateUsingFontString=!1,this.usingViewportFontSizing=!0,this.letterSpaceValue=0,this.wordSpaceValue=0,this.delta={},this.set(t),this.midInitActions(t),this.purge&&this.purgeArtefact(this.purge),this.dirtyFont=!0,this.currentFontIsLoaded=!1},Fg.measureFont=function(){const{defaultTextStyle:t,currentScale:e,dimensions:i}=this,{fontFamily:n,fontSizeValue:s,letterSpaceValue:r,wordSpaceValue:o}=t;t.letterSpacing=r*e+"px",t.wordSpacing=o*e+"px";const a=mu(),l=a.engine;l.font=t.canvasFont,l.fontKerning=t.fontKerning,l.fontStretch=t.fontStretch,l.fontVariantCaps=t.fontVariantCaps,l.textRendering=t.textRendering,l.letterSpacing=t.letterSpacing,l.wordSpacing=t.wordSpacing,l.direction=t.direction,l.textAlign=ts,l.textBaseline=Za;const c=l.measureText(this.text);yu(a);const{actualBoundingBoxLeft:h,actualBoundingBoxRight:u}=c,d=this.getFontMetadata(n),f=s/100;i&&(i[0]=ot(et(h)+et(u)),i[1]=d.height*f*e);const p=d.verticalOffset*f;this.alphabeticBaseline=(d.alphabeticBaseline*f+p)*e,this.hangingBaseline=(d.hangingBaseline*f+p)*e,this.ideographicBaseline=(d.ideographicBaseline*f+p)*e,this.fontVerticalOffset=p,this.dirtyPathObject=!0,this.dirtyDimensions=!0},Fg.cleanPathObject=function(){this.dirtyPathObject=!1;const t=this.pathObject=new Path2D,e=this.currentHandle,i=this.currentDimensions,[n,s]=e,[r,o]=i;t.rect(-n,-s,r,o)},Fg.cleanDimensions=function(){this.dirtyDimensions=!1;const t=this.dimensions,e=this.currentDimensions,[i,n]=e;e[0]=t[0],e[1]=t[1],this.dirtyStart=!0,this.dirtyHandle=!0,this.dirtyOffset=!0,i===e[0]&&n===e[1]||(this.dirtyPositionSubscribers=!0),this.mimicked&&this.mimicked.length&&(this.dirtyMimicDimensions=!0),this.dirtyFilterIdentifier=!0},Fg.cleanHandle=function(){this.dirtyHandle=!1;const{handle:t,currentHandle:e,currentDimensions:i,mimicked:n,defaultTextStyle:s,alphabeticBaseline:r,hangingBaseline:o,ideographicBaseline:a}=this,[l,c]=t,[h,u]=i,d=s.direction||as;l.toFixed?e[0]=l:l===ts?e[0]=0:l===lo?e[0]=h:l===Ue?e[0]=h/2:l===To?e[0]=d===as?0:h:l===Mi?e[0]=d===as?h:0:yt(parseFloat(l))?e[0]=parseFloat(l)/100*h:e[0]=0,c.toFixed?e[1]=c:c===Za?e[1]=0:c===je?e[1]=u:c===Ue||c===gs?e[1]=u/2:c===vn?e[1]=yt(o)?o:0:c===de?e[1]=yt(r)?r:0:c===Hn?e[1]=yt(a)?a:0:yt(parseFloat(c))?e[1]=parseFloat(c)/100*u:e[1]=0,this.dirtyFilterIdentifier=!0,this.dirtyStampHandlePositions=!0,n&&n.length&&(this.dirtyMimicHandle=!0)},Fg.prepareStamp=function(){this.dirtyHost&&(this.dirtyHost=!1),(this.dirtyScale||this.dirtyDimensions||this.dirtyStart||this.dirtyOffset||this.dirtyHandle)&&(this.dirtyPathObject=!0),this.dirtyScale&&this.cleanScale(),this.dirtyText&&this.updateAccessibleTextHold(),this.dirtyFont&&this.cleanFont(),this.dirtyDimensions&&this.cleanDimensions(),this.dirtyLock&&this.cleanLock(),this.dirtyStart&&this.cleanStart(),this.dirtyOffset&&this.cleanOffset(),this.dirtyHandle&&this.cleanHandle(),this.dirtyRotation&&this.cleanRotation(),(this.isBeingDragged||this.lockTo.includes(ys)||this.lockTo.includes(Ns))&&(this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtyStampHandlePositions&&this.cleanStampHandlePositions(),this.dirtyPathObject&&this.cleanPathObject(),this.dirtyPositionSubscribers&&this.updatePositionSubscribers(),this.prepareStampTabsHelper()},Fg.regularStamp=function(){const t=this.currentHost,e=this.defaultTextStyle;if(t&&e){const i=t.engine,[n,s]=this.currentStampPosition;t.rotateDestination(i,n,s,this),this.noCanvasEngineUpdates||(this.state.set(this.defaultTextStyle),t.setEngine(this)),this.setImageSmoothing(t.engine),this[e.method](t)}},Fg.stampPositioningHelper=function(){const{currentHandle:t,currentScale:e,text:i,fontVerticalOffset:n}=this,s=-t[0],r=-t[1]+n*e;return[i,dt(s),dt(r)]},Fg.underlineEngine=function(t,e){const{currentDimensions:i,currentScale:n,currentStampPosition:s,defaultTextStyle:r,fontVerticalOffset:o}=this,{underlineGap:a,underlineOffset:l,underlineStyle:c,underlineWidth:h}=r,[,u,d]=e,[f,p]=i,g=d+l*p-o*n,m=h*n,{element:y,engine:b}=t,S=mu(y.width,y.height),{element:k,engine:A}=S;S.rotateDestination(A,...s,this),A.fillStyle=He,A.strokeStyle=He,A.font=r.canvasFont,A.fontKerning=r.fontKerning,A.fontStretch=r.fontStretch,A.fontVariantCaps=r.fontVariant,A.textRendering=r.textRendering,A.letterSpacing=r.letterSpacing,A.lineCap=uo,A.lineJoin=uo,A.wordSpacing=r.wordSpacing,A.direction=r.direction,A.textAlign=ts,A.textBaseline=Za,A.lineWidth=2*a*n,this.setImageSmoothing(A);const v=this.getStyle(c,"fillStyle",S);A.strokeText(...e),A.fillText(...e),A.globalCompositeOperation="source-out",A.fillStyle=v,A.fillRect(u,g,f,m),b.save(),b.resetTransform(),this.setImageSmoothing(b),b.drawImage(k,0,0),b.restore(),yu(S)},Fg.drawBoundingBox=function(t){if(this.pathObject){const e=this.getStyle(this.boundingBoxStyle,"fillStyle",t),i=t.engine;i.save(),i.strokeStyle=e,i.lineWidth=this.boundingBoxLineWidth,i.setLineDash(this.boundingBoxLineDash||[]),i.lineDashOffset=this.boundingBoxLineDashOffset||0,i.globalCompositeOperation=wo,i.globalAlpha=1,i.shadowOffsetX=0,i.shadowOffsetY=0,i.shadowBlur=0,this.setImageSmoothing(i),i.stroke(this.pathObject),i.restore()}},Fg.draw=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=this.stampPositioningHelper();this.defaultTextStyle&&this.defaultTextStyle.includeUnderline&&this.underlineEngine(t,i),e.strokeText(...i),this.showBoundingBox&&this.drawBoundingBox(t)}},Fg.fill=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=this.stampPositioningHelper();this.defaultTextStyle&&this.defaultTextStyle.includeUnderline&&this.underlineEngine(t,i),e.fillText(...i),this.showBoundingBox&&this.drawBoundingBox(t)}},Fg.drawAndFill=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=this.stampPositioningHelper();this.defaultTextStyle&&this.defaultTextStyle.includeUnderline&&this.underlineEngine(t,i),e.strokeText(...i),e.fillText(...i),this.currentHost.clearShadow(),e.strokeText(...i),e.fillText(...i),this.showBoundingBox&&this.drawBoundingBox(t)}},Fg.fillAndDraw=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=this.stampPositioningHelper();this.defaultTextStyle&&this.defaultTextStyle.includeUnderline&&this.underlineEngine(t,i),e.fillText(...i),e.strokeText(...i),this.currentHost.clearShadow(),e.fillText(...i),e.strokeText(...i),this.showBoundingBox&&this.drawBoundingBox(t)}},Fg.drawThenFill=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=this.stampPositioningHelper();this.defaultTextStyle&&this.defaultTextStyle.includeUnderline&&this.underlineEngine(t,i),e.strokeText(...i),e.fillText(...i),this.showBoundingBox&&this.drawBoundingBox(t)}},Fg.fillThenDraw=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=this.stampPositioningHelper();this.defaultTextStyle&&this.defaultTextStyle.includeUnderline&&this.underlineEngine(t,i),e.fillText(...i),e.strokeText(...i),this.showBoundingBox&&this.drawBoundingBox(t)}},Fg.clip=function(t){t.engine.clip(this.pathObject,this.winding)},Fg.clear=function(t){if(this.currentFontIsLoaded){const e=t.engine,i=e.globalCompositeOperation,n=this.stampPositioningHelper();e.globalCompositeOperation=vi,e.fillText(...n),e.globalCompositeOperation=i,this.showBoundingBox&&this.drawBoundingBox(t)}},Fg.none=Bl;const Ig=function(t){return!!t&&new Label(t)};J.Label=Label;const Line=function(t=Xl){return this.curveInit(t),this.shapeInit(t),this},Bg=Line.prototype=rc();Bg.type=ca,Bg.lib=Gi,Bg.isArtefact=!0,Bg.isAsset=!1,nh(Bg),qf(Bg),Jf(Bg),Bg.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeLinePath()},Bg.makeLinePath=function(){let t=wl;const{currentStampPosition:e,currentEnd:i}=this;if(e&&i){const[e,i]=this.currentStampPosition,[n,s]=this.currentEnd;t=`m0,0l${(n-e).toFixed(2)},${(s-i).toFixed(2)}`}return t},Bg.cleanDimensions=function(){this.dirtyDimensions=!1,this.dirtyHandle=!0,this.dirtyOffset=!0,this.dirtyStart=!0,this.dirtyEnd=!0},Bg.preparePinsForStamp=function(){const t=this.dirtyPins,e=this.endPivot,i=this.endPath;let n,s,r;for(n=0,s=t.length;n1)&&(this.fromPathStart=t-dt(t)),t=this.fromPathEnd,(t<0||t>1)&&(this.fromPathEnd=t-dt(t)),t=this.toPathStart,(t<0||t>1)&&(this.toPathStart=t-dt(t)),t=this.toPathEnd,(t<0||t>1)&&(this.toPathEnd=t-dt(t))}this.dirtyOutput=!0},Ng.fromPathStart=function(t){this.loopPathCursors&&(t<0||t>1)&&(t-=dt(t)),this.fromPathStart=t,this.synchronizePathCursors&&(this.toPathStart=t),this.dirtyPathData=!0},Vg.fromPathStart=function(t){let e=this.fromPathStart+=t;this.loopPathCursors&&(e<0||e>1)&&(e-=dt(e)),this.fromPathStart=e,this.synchronizePathCursors&&(this.toPathStart=e),this.dirtyPathData=!0},Ng.fromPathEnd=function(t){this.loopPathCursors&&(t<0||t>1)&&(t-=dt(t)),this.fromPathEnd=t,this.synchronizePathCursors&&(this.toPathEnd=t),this.dirtyPathData=!0},Vg.fromPathEnd=function(t){let e=this.fromPathEnd+=t;this.loopPathCursors&&(e<0||e>1)&&(e-=dt(e)),this.fromPathEnd=e,this.synchronizePathCursors&&(this.toPathEnd=e),this.dirtyPathData=!0},Ng.toPathStart=function(t){this.loopPathCursors&&(t<0||t>1)&&(t-=dt(t)),this.toPathStart=t,this.synchronizePathCursors&&(this.fromPathStart=t),this.dirtyPathData=!0},Vg.toPathStart=function(t){let e=this.toPathStart+=t;this.loopPathCursors&&(e<0||e>1)&&(e-=dt(e)),this.toPathStart=e,this.synchronizePathCursors&&(this.fromPathStart=e),this.dirtyPathData=!0},Ng.toPathEnd=function(t){this.loopPathCursors&&(t<0||t>1)&&(t-=dt(t)),this.toPathEnd=t,this.synchronizePathCursors&&(this.fromPathEnd=t),this.dirtyPathData=!0},Vg.toPathEnd=function(t){let e=this.toPathEnd+=t;this.loopPathCursors&&(e<0||e>1)&&(e-=dt(e)),this.toPathEnd=e,this.synchronizePathCursors&&(this.fromPathEnd=e),this.dirtyPathData=!0},Gg.getHost=function(){if(this.currentHost)return this.currentHost;if(this.host){const t=o[this.host];if(t)return this.currentHost=t,this.dirtyHost=!0,this.currentHost}return ah},Gg.midInitActions=Bl,Gg.update=function(){this.dirtyInput=!0,this.dirtyOutput=!0},Gg.prepareStamp=function(){const t=this.fromPath,e=this.toPath,[i,n]=this.getBoundingBox();if(!this.dirtyPathData){const{x:i,y:n}=t.getPathPositionData(0),{x:s,y:r}=t.getPathPositionData(1),{x:o,y:a}=e.getPathPositionData(0),{x:l,y:c}=e.getPathPositionData(1),h=[i,n,s,r,o,a,l,c];this.pathTests&&!this.pathTests.some(((t,e)=>t!==h[e]))||(this.pathTests=h,this.dirtyPathData=!0)}if(this.dirtyPathData||!this.fromPathData.length){this.dirtyPathData=!1,this.watchIndex=-1,this.engineInstructions.length=0,this.engineDeltaLengths.length=0;const s=this.fromPathData;s.length=0;const r=this.toPathData;if(r.length=0,t&&e){const o=ot(t.length),a=ot(e.length),l=this.setSourceDimension(kt(o,a)),c=this.fromPathStart,h=this.fromPathEnd,u=this.toPathStart,d=this.toPathEnd,f=this.constantSpeedAlongPath;let p,g;p=c=0&&F>=0?([g,m]=i[dt(D)],[y,b]=n[dt(F)],S=y-g,k=b-m,A=pt(S,k),h?(v=-st(S,k)+wt,C=lt(v),P=Et(v),f.push([C,P,-P,C,g,m]),p.push(A)):(v=-st(S,k)+c,C=lt(v),P=Et(v),f.push([C,P,-P,C,g,m,A]),p.push(A))):(f.push(!1),p.push(!1)),D+=o,F+=l,u&&(D>=s&&(D-=s),F>=s&&(F-=s));R<0&&(R=0),this.watchIndex=R}if(h)for(x=0;x=t&&(R=0);else for(x=0;x=t&&(R=0);const X=this.interferenceFactor,Y=this.interferenceLoops,G=1+~~(T*X),j=1+~~(H*X);for(B.width=G,B.height=j,$.setTransform(1,0,0,1,0,0),I.setTransform(1,0,0,1,0,0),w=0;w{if(mt(e))n=e[0],s=e[1];else{if(!ec(e,e.x,e.y))return!1;n=e.x,s=e.y}return!(!yt(n)||!yt(s))&&(r=n-t,o=s-l,!(r<0||r>c||o<0||o>h)&&(a=4*(o*c+r)+3,!!i&&i[a]>0))}),this))return{x:n,y:s,artefact:this}}return!1};const Wg=function(t){return!!t&&new Loom(t)};J.Loom=Loom;const Mesh=function(t=Xl){return this.makeName(t.name),this.register(),this.modifyConstructorInputForAnchorButton(t),this.set(this.defs),this.state=Kh(),t.group||(t.group=af),this.onEnter=Bl,this.onLeave=Bl,this.onDown=Bl,this.onUp=Bl,this.delta={},this.set(t),this.fromPathData=[],this.toPathData=[],this.watchFromPath=null,this.watchIndex=-1,this.engineInstructions=[],this.engineDeltaLengths=[],this},Ug=Mesh.prototype=rc();Ug.type="Mesh",Ug.lib=Gi,Ug.isArtefact=!0,Ug.isAsset=!1,nh(Ug),Sd(Ug),Cd(Ug),Od(Ug),Td(Ug);const Zg={net:null,isHorizontalCopy:!0,source:null,sourceIsVideoOrSprite:!1,interferenceLoops:2,interferenceFactor:1.03,visibility:!0,calculateOrder:0,stampOrder:0,delta:null,host:null,group:null,anchor:null,noCanvasEngineUpdates:!1,noDeltaUpdates:!1,onEnter:null,onLeave:null,onDown:null,onUp:null,noUserInteraction:!1,method:Ni};Ug.defs=Kl(Ug.defs,Zg),Ug.packetExclusions=Ql(Ug.packetExclusions,["pathObject","state"]),Ug.packetExclusionsByRegex=Ql(Ug.packetExclusionsByRegex,["^(local|dirty|current)","Subscriber$"]),Ug.packetObjects=Ql(Ug.packetObjects,["group","net","source"]),Ug.packetFunctions=Ql(Ug.packetFunctions,["onEnter","onLeave","onDown","onUp"]),Ug.processPacketOut=function(t,e,i){let n=!0;return!i.includes(t)<0&&e===this.defs[t]&&(n=!1),n},Ug.finalizePacketOut=function(t,e){const i=Ct(this.state.saveAsPacket(e))[3];return t=Kl(t,i),t=this.handlePacketAnchor(t,e)},Ug.handlePacketAnchor=function(t,e){if(this.anchor){const i=Ct(this.anchor.saveAsPacket(e))[3];t.anchor=i}return t},Ug.clone=$l;const _g=Ug.getters,Kg=Ug.setters;Ug.get=function(t){const e=this.getters[t];if(e)return e.call(this);{const e=this.state;let i,n=this.defs[t];return typeof n!==al?(i=this[t],typeof i!==al?i:n):(n=e.defs[t],typeof n!==al?(i=e[t],typeof i!==al?i:n):null)}},Ug.set=function(t=Xl){const e=St(t),i=e.length;if(i){const n=this.setters,s=this.defs,r=this.state,o=r?r.setters:Xl,a=r?r.defs:Xl;let l,c,h,u;for(c=0;c3){const{rows:i,columns:n,particleStore:s}=t;if(i&&n){this.badNet=!1,this.rows=i,this.columns=n;const t=[];s.forEach((e=>{const i=e.position,{x:n,y:s}=i;t.push([n,s])}));const r=t.join(Se);e.join(Se)!==r&&(this.particlePositions=t,this.dirtyInput=!0),this.sourceIsVideoOrSprite&&(this.dirtyInput=!0)}}this.prepareStampTabsHelper()},Ug.setSourceDimension=function(){if(!this.badNet){const{columns:t,rows:e,particlePositions:i}=this,n=Mc(),s=Mc(),r=Mc(),o=Mc(),a=Mc(),l=Mc(),c=Mc(),h=Mc(),u=Mc();let d,f,p,g,m,y,b,S,k,A,v,C,P,x,w,O,D,F;for(p=0;pt&&(this.sourceDimension=t)}for(w=0,O=s.length;wXc(t))),Xc(s),Xc(n),Xc(r),Xc(o),Xc(a),Xc(l),Xc(c),Xc(u),Xc(h)}},Ug.simpleStamp=function(t,e){t&&t.type===qo&&(this.currentHost=t,e&&(this.set(e),this.prepareStamp()),this.regularStamp())},Ug.stamp=function(t=!1,e,i){t?(e&&e.type===qo&&(this.currentHost=e),i&&(this.set(i),this.prepareStamp()),this.regularStamp()):this.visibility&&(this.dirtyInput&&(this.sourceImageData=this.cleanInput(),this.sourceImageData?this.output=this.cleanOutput():this.dirtyInput=!0),this.output&&this.regularStamp())},Ug.cleanInput=function(){this.dirtyInput=!1,this.setSourceDimension();const t=this.sourceDimension;if(!t)return this.dirtyInput=!0,!1;const e=mu(),i=e.engine,n=e.element;n.width=t,n.height=t,i.setTransform(1,0,0,1,0,0),this.source.stamp(!0,e,{startX:0,startY:0,handleX:0,handleY:0,offsetX:0,offsetY:0,roll:0,scale:1,width:t,height:t,method:Ni});const s=i.getImageData(0,0,t,t);return yu(e),s},Ug.cleanOutput=function(){this.dirtyOutput=!1;const{sourceImageData:t,columns:e,rows:i,struts:n,boundingBox:s}=this,r=ot(this.sourceDimension);if(t&&i-1>0){let[o,a,l,c]=s;l=~~(o+l),c=~~(a+c);const h=mu(),u=h.engine,d=h.element;d.width=r,d.height=r,u.setTransform(1,0,0,1,0,0),u.putImageData(t,0,0);const f=mu(),p=f.engine,g=f.element;g.width=l,g.height=c,p.globalAlpha=this.state.globalAlpha,p.setTransform(1,0,0,1,0,0);const m=parseFloat((r/(i-1)).toFixed(4)),y=parseFloat((r/(e-1)).toFixed(4));let b,S,k,A,v,C,P,x,w,O,D,F,R,T,H,E,I,B,L,$,M,X,Y;for(M=0,X=i-1;Mr?r-T:m;p.drawImage(d,~~R,~~T,1,~~i,0,0,1,~~I)}}const G=this.interferenceFactor,j=this.interferenceLoops,z=1+~~(l*G),N=1+~~(c*G);d.width=z,d.height=N,p.setTransform(1,0,0,1,0,0),u.setTransform(1,0,0,1,0,0);for(let t=0;t{if(mt(t))i=t[0],n=t[1];else{if(!ec(t,t.x,t.y))return!1;i=t.x,n=t.y}return!(!yt(i)||!yt(n))&&s.engine.isPointInPath(this.pathObject,i,n,this.winding)}),this)){const t={x:i,y:n,artefact:this};return yu(s),t}return yu(s),!1};const qg=function(t){return!!t&&new Mesh(t)};J.Mesh=Mesh;const Spring=function(t=Xl){return this.makeName(t.name),this.register(),this.set(this.defs),this.set(t),this.action||(this.action=Bl),this},Qg=Spring.prototype=rc();Qg.type="Spring",Qg.lib="spring",Qg.isArtefact=!1,Qg.isAsset=!1,nh(Qg);Qg.defs=Kl(Qg.defs,{particleFrom:null,particleFromIsStatic:!1,particleTo:null,particleToIsStatic:!1,springConstant:50,damperConstant:10,restLength:1}),Qg.packetObjects=Ql(Qg.packetObjects,["particleFrom","particleTo"]),Qg.kill=function(){return this.deregister(),!0};const Jg=Qg.setters;Jg.particleFrom=function(t){t.substring&&(t=P[t]),t&&t.type===da&&(this.particleFrom=t)},Jg.particleTo=function(t){t.substring&&(t=P[t]),t&&t.type===da&&(this.particleTo=t)},Qg.applySpring=function(){const{particleFrom:t,particleTo:e,particleFromIsStatic:i,particleToIsStatic:n,springConstant:s,damperConstant:r,restLength:o}=this;if(t&&e){const{position:a,velocity:l,load:c}=t,{position:h,velocity:u,load:d}=e,f=jd(u).vectorSubtract(l),p=jd(h).vectorSubtract(a),g=jd(p).normalize(),m=jd(g);g.scalarMultiply(s*(p.getMagnitude()-o)),f.vectorMultiply(m).scalarMultiply(r).vectorMultiply(m);const y=jd(g).vectorAdd(f);i||c.vectorAdd(y),n||d.vectorSubtract(y),zd(f,p,g,m,y)}};const tm=function(t){return!!t&&new Spring(t)};J.Spring=Spring;const Net=function(t=Xl){return this.makeName(t.name),this.register(),this.initializePositions(),this.set(this.defs),this.onEnter=Bl,this.onLeave=Bl,this.onDown=Bl,this.onUp=Bl,this.generate=Bl,this.postGenerate=Bl,this.stampAction=Bl,this.particleStore=[],this.springs=[],t.group||(t.group=af),this.set(t),this.purge&&this.purgeArtefact(this.purge),this},em=Net.prototype=rc();em.type="Net",em.lib=Gi,em.isArtefact=!0,em.isAsset=!1,nh(em),jf(em);const im={world:null,artefact:null,historyLength:1,forces:null,mass:1,engine:zi,springConstant:50,damperConstant:10,restLength:1,showSprings:!1,showSpringsColor:He,rows:0,columns:0,rowDistance:0,columnDistance:0,shapeTemplate:null,precision:20,joinTemplateEnds:!1,particlesAreDraggable:!1,hitRadius:10,showHitRadius:!1,hitRadiusColor:He,resetAfterBlur:3};em.defs=Kl(em.defs,im),em.packetExclusions=Ql(em.packetExclusions,["forces","springs","particleStore"]),em.packetObjects=Ql(em.packetObjects,["world","artefact","shapeTemplate"]),em.packetFunctions=Ql(em.packetFunctions,["generate","postGenerate","stampAction"]),em.finalizePacketOut=function(t,e){const i=e.forces||this.forces||!1;if(i){const e=[];i.forEach((t=>{t.substring?e.push(t):Zl(t)&&t.name&&e.push(t.name)})),t.forces=e}const n=[];return this.particleStore.forEach((t=>n.push(t.saveAsPacket()))),t.particleStore=n,t},em.postCloneAction=function(t){return t},em.factoryKill=function(t,e){this.isRunning=!1,t&&(this.artefact.kill(),this.shapeTemplate&&this.shapeTemplate.kill()),e&&this.world.kill(),this.purgeParticlesFromLibrary()},em.purgeParticlesFromLibrary=function(){const{particleStore:t,springs:e}=this;let i;a.forEach((t=>{i=o[t],i&&(i.particle&&!i.particle.substring&&i.particle.name&&(i.particle=i.particle.name),i.type===ga&&i.useParticlesAsPins&&i.pins.forEach(((t,e)=>{Zl(t)&&t.type===da&&(i.pins[e]=t.name,i.dirtyPins=!0)})))})),t.forEach((t=>t.kill())),t.length=0,e.forEach((t=>t.kill())),e.length=0};const nm=em.setters;nm.generate=function(t){Wl(t)?this.generate=t:t.substring&&rm[t]&&(this.generate=rm[t])},nm.postGenerate=function(t){Wl(t)&&(this.postGenerate=t)},nm.stampAction=function(t){Wl(t)&&(this.stampAction=t)},nm.world=function(t){let e;t.substring?e=F[t]:Zl(t)&&t.type===Oa&&(e=t),e&&(this.world=e)},nm.artefact=function(t){let e;t.substring?e=o[t]:Zl(t)&&t.isArtefact&&(e=t),e&&(this.artefact=e),this.dirtyFilterIdentifier=!0},nm.shapeTemplate=function(t){let e;t.substring?e=m[t]:Zl(t)&&t.isArtefact&&tc(t.species)&&(e=t),e&&(this.shapeTemplate=e),this.dirtyFilterIdentifier=!0},em.regularStamp=function(){const{world:t,artefact:e,particleStore:i,springs:n,generate:s,postGenerate:r,stampAction:o,lastUpdated:a,resetAfterBlur:l,showSprings:c,showSpringsColor:h,showHitRadius:u,hitRadius:d,hitRadiusColor:f}=this;let p,g,m=1,y=wo;this.state&&(m=this.state.globalAlpha,y=this.state.globalCompositeOperation);const b=this.currentHost;let S=$t;const k=vt();if(a&&(S=(k-a)/1e3),S>l&&(this.purgeParticlesFromLibrary(),S=$t),i.length||(s.call(this,b),r.call(this)),i.forEach((e=>e.applyForces(t,b))),n.forEach((t=>t.applySpring())),i.forEach((e=>e.update(S,t))),c){const t=b.engine;t.save(),t.globalAlpha=m,t.globalCompositeOperation=y,t.strokeStyle=h,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,t.shadowColor=Ie,t.lineWidth=1,t.setTransform(1,0,0,1,0,0),t.beginPath(),n.forEach((e=>{({particleFrom:p,particleTo:g}=e),t.moveTo(p.position.x,p.position.y),t.lineTo(g.position.x,g.position.y)})),t.stroke(),t.restore()}if(i.forEach((t=>{t.manageHistory(S,b),o.call(this,e,t,b)})),u){const t=b.engine;t.save(),t.globalAlpha=m,t.globalCompositeOperation=y,t.lineWidth=1,t.strokeStyle=f,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,t.shadowColor=Ie,t.setTransform(1,0,0,1,0,0),t.beginPath(),i.forEach((e=>{t.moveTo(e.position.x,e.position.y),t.arc(e.position.x,e.position.y,d,0,xt)})),t.stroke(),t.restore()}this.lastUpdated=k},em.restart=function(){return this.purgeParticlesFromLibrary(),this.lastUpdated=vt(),this},em.checkHit=function(t=[]){if(this.lastHitParticle=null,!this.particlesAreDraggable)return!1;if(this.noUserInteraction)return!1;const e=mt(t)?t:[t],i=this.particleStore;let n,s,r,o,a,l=!1;if(e.some((t=>{if(mt(t))n=t[0],s=t[1];else{if(!ec(t,t.x,t.y))return!1;n=t.x,s=t.y}if(!yt(n)||!yt(s))return!1;const e=jd();for(r=0,o=i.length;r0&&l>0){const[d,f]=this.currentStampPosition,[,p]=t.currentDimensions,g=c.substring?parseFloat(c)/100*p:c,m=h.substring?parseFloat(h)/100*p:h;let y,b,S,k,A,v,C;for(k=0;k0&&l>0){const[d,f]=this.currentStampPosition,[,p]=t.currentDimensions,g=c.substring?parseFloat(c)/100*p:c,m=h.substring?parseFloat(h)/100*p:h;let y,b,S,k,A,v,C;for(k=0;k0;A--)v=P[`${u}-${A}-${k}`],C=P[`${u}-${A-1}-${k+1}`],sm.call(this,v,C,`${u}-${A}-${k}~${u}-${A-1}-${k+1}`)}},"weak-shape":function(){const{particleStore:t,artefact:e,historyLength:i,engine:n,forces:s,mass:r,name:o,shapeTemplate:a,precision:l,joinTemplateEnds:c}=this;let h,u,d,f;if(a&&l){for(h=0;hsm.call(this,t,m,`${l}-${e}-hub`))),i.push(m)}}},om=function(t){return!!t&&new Net(t)};function am(t=Xl){t.defs=Kl(t.defs,{choke:15});const e=t.setters,i=t.deltaSetters;e.paletteStart=function(t){this.gradient&&this.gradient.set({paletteStart:t})},i.paletteStart=function(t){this.gradient&&this.gradient.setDelta({paletteStart:t})},e.paletteEnd=function(t){this.gradient&&this.gradient.set({paletteEnd:t})},i.paletteEnd=function(t){this.gradient&&this.gradient.setDelta({paletteEnd:t})},e.colors=function(t){this.gradient&&this.gradient.set({colors:t})},e.precision=function(t){this.gradient&&this.gradient.set({precision:t})},e.easing=function(t){this.gradient&&this.gradient.set({easing:t})},e.easingFunction=e.easing,e.colorSpace=function(t){this.gradient&&this.gradient.set({colorSpace:t})},e.returnColorAs=function(t){this.gradient&&this.gradient.set({returnColorAs:t})},e.cyclePalette=function(t){this.gradient&&this.gradient.set({cyclePalette:t})},e.delta=function(t=Xl){this.gradient&&this.gradient.set({delta:t})},t.installElement=function(t){const e=document.createElement(Ve);e.id=t,this.element=e,this.engine=this.element.getContext(zt,{willReadFrequently:!0});const i=document.createElement(Ve);return i.id=`${t}-color`,i.width=256,i.height=1,this.colorElement=i,this.colorEngine=this.colorElement.getContext(zt,{willReadFrequently:!0}),this.gradient=mg({name:`${t}-gradient`,endX:Zs,delta:{paletteStart:0,paletteEnd:0},cyclePalette:!1}),this.gradientLastUpdated=0,this},t.checkSource=function(){this.notifySubscribers()},t.getData=function(t,e){return this.notifySubscribers(),this.buildStyle(e)},t.update=function(){this.dirtyOutput=!0},t.notifySubscribers=function(){this.dirtyOutput&&this.cleanOutput(),this.subscribers.forEach((t=>this.notifySubscriber(t)),this)},t.notifySubscriber=function(t){t.sourceNaturalWidth=this.width,t.sourceNaturalHeight=this.height,t.sourceLoaded=!0,t.source=this.element,t.dirtyImage=!0,t.dirtyCopyStart=!0,t.dirtyCopyDimensions=!0,t.dirtyImageSubscribers=!0},t.paintCanvas=function(){if(this.checkOutputValuesExist()&&this.dirtyOutput){this.dirtyOutput=!1;const{element:t,engine:e,width:i,height:n,colorEngine:s,gradient:r,choke:o,gradientLastUpdated:a}=this;t.width=i,t.height=n;const l=e.getImageData(0,0,i,n),c=l.data,h=i*n;let u,d,f;const p=vt();a+ou&&(m=1,y=0),p=r[d+m+s[f+y]],g+=i(h-m+dm,u-y+dm,p),.5+35*g}},[gl]:{name:gl,init:function(){const{values:t,size:e,rndEngine:i}=this;t.length=0;for(let n=0;n1?i=1:i<0&&(i=0),i}},lm.wXorshift=function(t){let e=t^t>>12;return e^=e<<25,e^=e>>27,2*e},lm.wHash=function(t,e,i){return 16777619*(16777619*(16777619*(2166136261^t)^e)^i)&4294967295},lm.worleyDistanceFunctions={[ji]:function(t,e){return function(t,e){return[t.x-e.x,t.y-e.y,t.z-e.z]}(t,e).reduce(((t,e)=>t+e*e),0)},[ls]:function(t,e){return function(t,e){return[t.x-e.x,t.y-e.y,t.z-e.z]}(t,e).reduce(((t,e)=>t+et(e)),0)}},lm.wProbLookup=function(t){return(t&=4294967295)<393325350?1:t<1022645910?2:t<1861739990?3:t<2700834071?4:t<3372109335?5:t<3819626178?6:t<4075350088?7:t<4203212043?8:9},lm.wInsert=function(t,e){let i;for(let n=t.length-1;n>=0&&!(e>t[n]);n--)i=t[n],t[n]=e,n+1t<0?0:t>1?1:t)))};const gm=function(t){return!!t&&new NoiseAsset(t)},mm=function(t){return!!t&&new NoiseAsset(t)};J.NoiseAsset=NoiseAsset;const Oval=function(t=Xl){return this.shapeInit(t),this},ym=Oval.prototype=rc();ym.type="Oval",ym.lib=Gi,ym.isArtefact=!0,ym.isAsset=!1,nh(ym),qf(ym);ym.defs=Kl(ym.defs,{radiusX:5,radiusY:5,intersectX:.5,intersectY:.5,offshootA:.55,offshootB:0});const bm=ym.setters,Sm=ym.deltaSetters;bm.radius=function(t){this.setRectHelper(t,jr)},bm.radiusX=function(t){this.setRectHelper(t,Gr)},bm.radiusY=function(t){this.setRectHelper(t,zr)},Sm.radius=function(t){this.deltaRectHelper(t,jr)},Sm.radiusX=function(t){this.deltaRectHelper(t,Gr)},Sm.radiusY=function(t){this.deltaRectHelper(t,zr)},bm.offshootA=function(t){this.offshootA=t,this.updateDirty()},bm.offshootB=function(t){this.offshootB=t,this.updateDirty()},Sm.offshootA=function(t){t.toFixed&&(this.offshootA+=t,this.updateDirty())},Sm.offshootB=function(t){t.toFixed&&(this.offshootB+=t,this.updateDirty())},bm.intersectA=function(t){this.intersectA=t,this.updateDirty()},bm.intersectB=function(t){this.intersectB=t,this.updateDirty()},Sm.intersectA=function(t){t.toFixed&&(this.intersectA+=t,this.updateDirty())},Sm.intersectB=function(t){t.toFixed&&(this.intersectB+=t,this.updateDirty())},ym.setRectHelper=function(t,e){this.updateDirty(),e.forEach((e=>{this[e]=t}),this)},ym.deltaRectHelper=function(t,e){this.updateDirty(),e.forEach((e=>{this[e]=Rl(this[e],t)}),this)},ym.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeOvalPath()},ym.makeOvalPath=function(){const t=parseFloat(this.offshootA.toFixed(6)),e=parseFloat(this.offshootB.toFixed(6)),i=this.radiusX,n=this.radiusY;let s,r;if(i.substring||n.substring){const t=this.getHost();if(t){const[e,o]=t.currentDimensions;s=2*(i.substring?parseFloat(i)/100*e:i),r=2*(n.substring?parseFloat(n)/100*o:n)}}else s=2*i,r=2*n;const o=parseFloat((s*this.intersectX).toFixed(2)),a=parseFloat((s-o).toFixed(2)),l=parseFloat((r*this.intersectY).toFixed(2)),c=parseFloat((r-l).toFixed(2));let h=wl;return h+=`c${a*t},${l*e} ${a-a*e},${l-l*t}, ${a},${l} `,h+=`${-a*e},${c*t} ${a*t-a},${c-c*e} ${-a},${c} `,h+=`${-o*t},${-c*e} ${o*e-o},${c*t-c} ${-o},${-c} `,h+=`${o*e},${-l*t} ${o-o*t},${l*e-l} ${o},${-l}z`,h},ym.calculateLocalPathAdditionalActions=function(){const[t,e]=this.localBox;this.pathDefinition=this.pathDefinition.replace(wl,`m${-t},${-e}`),this.pathCalculatedOnce=!1,this.calculateLocalPath(this.pathDefinition,!0)};const km=function(t){return!!t&&(t.species="oval",new Oval(t))};J.Oval=Oval;const Am=ft(["video_audioTracks","video_autoPlay","video_buffered","video_controller","video_controls","video_controlsList","video_crossOrigin","video_currentSrc","video_currentTime","video_defaultMuted","video_defaultPlaybackRate","video_disableRemotePlayback","video_duration","video_ended","video_error","video_loop","video_mediaGroup","video_mediaKeys","video_muted","video_networkState","video_paused","video_playbackRate","video_readyState","video_seekable","video_seeking","video_sinkId","video_src","video_srcObject","video_textTracks","video_videoTracks","video_volume"]),vm=ft(["video_autoPlay","video_controller","video_controls","video_crossOrigin","video_currentTime","video_defaultMuted","video_defaultPlaybackRate","video_disableRemotePlayback","video_loop","video_mediaGroup","video_muted","video_playbackRate","video_src","video_srcObject","video_volume"]),VideoAsset=function(t=Xl){return this.assetConstructor(t)},Cm=VideoAsset.prototype=rc();Cm.type=wa,Cm.lib=Pe,Cm.isArtefact=!1,Cm.isAsset=!0,nh(Cm),ed(Cm),Cm.saveAsPacket=function(){return[this.name,this.type,this.lib,{}]},Cm.stringifyFunction=Bl,Cm.processPacketOut=Bl,Cm.finalizePacketOut=Bl,Cm.clone=$l;Cm.setters.source=function(t){t&&(t.tagName.toUpperCase()===ne&&(this.source=t,this.sourceNaturalWidth=t.videoWidth||0,this.sourceNaturalHeight=t.videoHeight||0,this.sourceLoaded=t.readyState>2),this.sourceLoaded&&this.notifySubscribers())},Cm.checkSource=function(t,e){const i=this.source;i&&i.readyState>2?(this.sourceLoaded=!0,this.sourceNaturalWidth===i.videoWidth&&this.sourceNaturalHeight===i.videoHeight&&this.sourceNaturalWidth===t&&this.sourceNaturalHeight===e||(this.sourceNaturalWidth=i.videoWidth,this.sourceNaturalHeight=i.videoHeight,this.notifySubscribers())):this.sourceLoaded=!1},Cm.addTextTrack=function(t,e,i){const n=this.source;n&&n.addTextTrack&&n.addTextTrack(t,e,i)},Cm.captureStream=function(){const t=this.source;return!(!t||!t.captureStream)&&t.captureStream()},Cm.canPlayType=function(t){const e=this.source;return e?e.canPlayType(t):"maybe"},Cm.fastSeek=function(t){const e=this.source;e&&e.fastSeek&&e.fastSeek(t)},Cm.load=function(){const t=this.source;t&&t.load()},Cm.pause=function(){const t=this.source;t&&t.pause()},Cm.play=function(){const t=this.source;return t?t.play().catch((t=>console.log(t.code,t.name,t.message))):Promise.reject("Source not defined")},Cm.setMediaKeys=function(t){const e=this.source;return e?e.setMediaKeys?e.setMediaKeys(t):Promise.reject("setMediaKeys not supported"):Promise.reject("Source not defined")},Cm.setSinkId=function(){const t=this.source;return t?t.setSinkId?t.setSinkId():Promise.reject("setSinkId not supported"):Promise.reject("Source not defined")};const Pm=function(t){document.querySelectorAll(t).forEach((t=>{let e;if(t.tagName.toUpperCase()===ne){if(t.id||t.name)e=t.id||t.name;else{const i=xe.exec(t.src);e=i&&i[1]?i[1]:Ol}const i=Dm({name:e,source:t});t.readyState<=2&&(t.oncanplay=()=>{i.set({source:t})})}}))},xm=function(t=Xl){const e={};e.audio=!tc(t.audio)||t.audio,e.video={};const i=e.video.width={};t.minWidth&&(i.min=t.minWidth),t.maxWidth&&(i.max=t.maxWidth),i.ideal=t.width?t.width:1280;const n=e.video.height={};t.minHeight&&(n.min=t.minHeight),t.maxHeight&&(n.max=t.maxHeight),n.ideal=t.height?t.height:720,t.facing&&(e.video.facingMode=t.facing);const s=t.name||Gl(),r=document.createElement(yl),o=Dm({name:s,source:r});return new Promise(((t,i)=>{navigator&&navigator.mediaDevices?navigator.mediaDevices.getUserMedia(e).then((e=>{const i=e.getVideoTracks();let n;mt(i)&&i[0]&&(n=i[0].getConstraints()),r.id=o.name,n&&(r.width=n.width,r.height=n.height),r.srcObject=e,r.onloadedmetadata=function(){r.play()},t(o)})).catch((e=>{console.log(e),t(o)})):i("Navigator.mediaDevices object not found")}))},wm=function(t=Xl){const e={video:{displaySurface:"browser"},audio:{suppressLocalAudioPlayback:!1},preferCurrentTab:!1,selfBrowserSurface:"exclude",systemAudio:"include",surfaceSwitching:"include",monitorTypeSurfaces:"include"},i=t.name||Gl(),n=document.createElement(yl),s=Dm({name:i,source:n});return new Promise(((i,r)=>{navigator&&navigator.mediaDevices?navigator.mediaDevices.getDisplayMedia({...e,...t}).then((t=>{const e=t.getVideoTracks();let r;mt(e)&&e[0]&&(r=e[0].getConstraints()),n.id=s.name,r&&(n.width=r.width,n.height=r.height),n.srcObject=t,n.onloadedmetadata=function(){n.play()},i(s)})).catch((t=>{console.log(t.message),i(s)})):r("Navigator.mediaDevices object not found")}))},Om=function(...t){let e=Ol;if(t.length){let i,n,s,r,o,a,l=!1;const c=t[0];if(c.substring){const e=xe.exec(c);i=e&&e[1]?e[1]:Ol,o=[...t],n=Ol,s=!1,r=null,a=we,l=!0}else c&&c.src&&(i=c.name||Ol,o=[...c.src],n=c.className||Ol,s=c.visibility||!1,r=document.querySelector(r),a=c.preload||we,l=!0);const h=Dm({name:i});if(l){const t=document.createElement(yl);t.name=i,t.className=n,t.style.display=s?Le:Bs,t.crossOrigin=ye,t.preload=a,o.forEach((e=>{const i=document.createElement(vo);i.src=e,t.appendChild(i)})),t.onload=()=>{h.set({source:t}),r&&r.appendChild(t)},h.set({source:t}),e=i}}return e},Dm=function(t){return!!t&&new VideoAsset(t)};J.VideoAsset=VideoAsset;const SpriteAsset=function(t=Xl){return this.assetConstructor(t),this},Fm=SpriteAsset.prototype=rc();Fm.type=Aa,Fm.lib=Pe,Fm.isArtefact=!1,Fm.isAsset=!0,nh(Fm),ed(Fm);Fm.defs=Kl(Fm.defs,{manifest:null}),Fm.saveAsPacket=function(){return[this.name,this.type,this.lib,{}]},Fm.stringifyFunction=Bl,Fm.processPacketOut=Bl,Fm.finalizePacketOut=Bl,Fm.clone=$l;Fm.setters.source=function(t=[]){if(t&&t[0]){this.sourceHold||(this.sourceHold={});const e=this.sourceHold;t.forEach((t=>{const i=t.id||t.name;i&&(e[i]=t)})),this.source=t[0],this.sourceNaturalWidth=t[0].naturalWidth,this.sourceNaturalHeight=t[0].naturalHeight,this.sourceLoaded=t[0].complete}},Fm.checkSource=Bl;const Rm=function(...t){const e=/\.(jpeg|jpg|png|gif|webp|svg|JPEG|JPG|PNG|GIF|WEBP|SVG)/,i=[];return t.forEach((t=>{let n,s,r,o,a,l=!1,c=!1;if(t.substring){const i=xe.exec(t);n=i&&i[1]?i[1]:Ol,s=[t],r=Ol,o=!1,a=t.replace(e,".json"),c=!0}else Zl(t)&&t.imageSrc&&t.manifestSrc?(n=t.name||Ol,s=mt(t.imageSrc)?t.imageSrc:[t.imageSrc],a=t.manifestSrc,r=t.className||Ol,o=t.visibility||!1,l=document.querySelector(t.parent),c=!0):i.push(!1);if(c){const t=Tm({name:n});Zl(a)?t.manifest=a:fetch(a).then((t=>{if(200!=t.status)throw new Error("Failed to load manifest");return t.json()})).then((e=>t.manifest=e)).catch((t=>console.log(t.message)));const c=[];s.forEach((t=>{const i=document.createElement(In);let s,a;e.test(t)&&(a=xe.exec(t),s=a&&a[1]?a[1]:Ol),i.name=s||n,i.className=r,i.crossorigin=ye,i.style.display=o?Le:Bs,l&&l.appendChild(i),i.src=t,c.push(i)})),t.set({source:c}),i.push(n)}else i.push(!1)})),i},Tm=function(t){return!!t&&new SpriteAsset(t)};function Hm(t=Xl){const e={asset:null,removeAssetOnKill:!1,spriteIsRunning:!1,spriteLastFrameChange:0,spriteCurrentFrame:0,spriteTrack:"default",spriteForward:!0,spriteFrameDuration:100,spriteWillLoop:!0};t.defs=Kl(t.defs,e);const i=t.getters,n=t.setters;i.sourceDimensions=function(){return[this.sourceNaturalWidth,this.sourceNaturalHeight]},n.asset=function(t){const e=this.asset,i=t&&t.name?t.name:t;e&&!e.substring&&e.unsubscribe(this),this.asset=i,this.dirtyAsset=!0},n.imageSource=function(t){const e=ad(t);if(e){const t=l[e[0]];if(t){const e=this.asset;e&&e.unsubscribe&&e.unsubscribe(this),t.subscribe(this)}}},n.videoSource=function(t){const e=Om(t);if(e){const t=l[e];if(t){const e=this.asset;e&&e.unsubscribe&&e.unsubscribe(this),t.subscribe(this)}}},n.spriteSource=function(t){const e=Rm(t);if(e){const t=l[e];if(t){const e=this.asset;e&&e.unsubscribe&&e.unsubscribe(this),t.subscribe(this)}}},t.cleanAsset=function(){const t=this.asset;if(t&&t.substring){const e=l[t];e&&(this.dirtyAsset=!1,e.subscribe(this))}},t.videoAction=function(t,...e){const i=this.asset;if(i&&i.type===wa)return i[t](...e)},t.videoPromiseAction=function(t,...e){const i=this.asset;return i&&i.type===wa?i[t](...e):Promise.reject("Asset not a video")},t.videoAddTextTrack=function(t,e,i){return this.videoAction("addTextTrack",t,e,i)},t.videoCaptureStream=function(){return this.videoAction("captureStream")},t.videoCanPlayType=function(t){return this.videoAction("canPlayType",t)},t.videoFastSeek=function(t){return this.videoAction("fastSeek",t)},t.videoLoad=function(){return this.videoAction("load")},t.videoPause=function(){return this.videoAction("pause")},t.videoPlay=function(){return this.videoPromiseAction("play")},t.videoSetMediaKeys=function(t){return this.videoPromiseAction("setMediaKeys",t)},t.videoSetSinkId=function(){return this.videoPromiseAction("setSinkId")},t.checkSpriteFrame=function(){const t=this.asset;if(t&&t.type===Aa&&t.manifest){const e=this.copyArray;if(this.spriteIsRunning){const i=this.spriteLastFrameChange,n=this.spriteFrameDuration,s=vt();if(s>i+n){const i=t.manifest;if(i){const n=i[this.spriteTrack],r=n.length,o=this.spriteWillLoop;let a=this.spriteCurrentFrame;a=this.spriteForward?a+1:a-1,a<0&&(a=o?r-1:0),a>=r&&(a=o?0:r-1);const[l,c,h,u,d]=n[a];e.length=0,e.push(c,h,u,d),this.dirtyCopyStart=!1,this.dirtyCopyDimensions=!1;if(l!==(this.source.id||this.source.name)){const e=t.sourceHold[l];e&&(this.source=e)}this.spriteCurrentFrame=a,this.spriteLastFrameChange=s}}}else{const[,i,n,s,r]=t.manifest[this.spriteTrack][this.spriteCurrentFrame],[o,a,l,c]=e;o===i&&a===n&&l===s&&c===r||(e.length=0,e.push(i,n,s,r),this.dirtyCopyStart=!1,this.dirtyCopyDimensions=!1)}}},t.playSprite=function(t,e,i,n,s){tc(t)&&(this.spriteFrameDuration=t),tc(e)&&(this.spriteWillLoop=e),tc(i)&&(this.spriteTrack=i),tc(n)&&(this.spriteForward=n),tc(s)&&(this.spriteCurrentFrame=s),this.spriteLastFrameChange=vt(),this.spriteIsRunning=!0},t.haltSprite=function(t,e,i,n,s){tc(t)&&(this.spriteFrameDuration=t),tc(e)&&(this.spriteWillLoop=e),tc(i)&&(this.spriteTrack=i),tc(n)&&(this.spriteForward=n),tc(s)&&(this.spriteCurrentFrame=s),this.spriteIsRunning=!1}}J.SpriteAsset=SpriteAsset;const Pattern=function(t=Xl){return this.makeName(t.name),this.register(),this.set(this.defs),this.set(t),this},Em=Pattern.prototype=rc();Em.type="Pattern",Em.lib=No,Em.isArtefact=!1,Em.isAsset=!1,nh(Em),Ed(Em),Hm(Em),Em.packetObjects=Ql(Em.packetObjects,["asset"]),Em.finalizePacketOut=function(t,e){if(mt(e.patternMatrix))t.patternMatrix=e.patternMatrix;else{const e=this.patternMatrix;e&&(t.patternMatrix=[e.a,e.b,e.c,e.d,e.e,e.f])}return t},Em.kill=function(){const{name:t,asset:e,removeAssetOnKill:i}=this;let n,s,r,o;return Zl(e)&&e.unsubscribe(this),Mt(m).forEach((e=>{n=e.state,s=n.defs,n&&(r=n.fillStyle,o=n.strokeStyle,Zl(r)&&r.name===t&&(n.fillStyle=s.fillStyle),Zl(o)&&o.name===t&&(n.strokeStyle=s.strokeStyle))})),i&&(i.substring?e.kill(!0):e.kill()),this.deregister(),this},Em.get=function(t){const e=this.source;if(0!==t.indexOf(Gt)&&0!==t.indexOf(Yt)||!e){const e=this.getters[t];if(e)return e.call(this);{const e=this.defs[t];if(typeof e!==al){const i=this[t];return typeof i!==al?i:e}return}}return Am.includes(t)||rd.includes(t)?e[t.substring(6)]:void 0},Em.set=function(t=Xl){const e=St(t),i=e.length;if(i){const n=this.setters,s=this.source,r=this.defs;let o,a,l,c;for(a=0;a{const e=o[t];e&&(e.dirtyInput=!0)}))},Bm.imageSubscribe=function(t){t&&t.substring&&Ql(this.imageSubscribers,t)},Bm.imageUnsubscribe=function(t){t&&t.substring&&Jl(this.imageSubscribers,t)},Bm.cleanImage=function(){const t=this.sourceNaturalWidth,e=this.sourceNaturalHeight;if(ec(t,e)&&t>0&&e>0){this.dirtyImage=!1;const i=this.currentCopyStart,n=i[0],s=i[1],r=this.currentCopyDimensions,o=r[0],a=r[1];n+o>t&&(i[0]=t-o),s+a>e&&(i[1]=e-a);const l=this.copyArray;l.length=0,l.push(~~i[0],~~i[1],~~o,~~a)}},Bm.cleanCopyStart=function(){const t=this.sourceNaturalWidth,e=this.sourceNaturalHeight;if(ec(t,e)&&t>0&&e>0){this.dirtyCopyStart=!1,this.cleanPosition(this.currentCopyStart,this.copyStart,[t,e]);const i=this.currentCopyStart,n=i[0],s=i[1];(n<0||n>t)&&(i[0]=n<0?0:t-1),(s<0||s>e)&&(i[1]=s<0?0:e-1),this.dirtyImage=!0}},Bm.cleanCopyDimensions=function(){const t=this.sourceNaturalWidth,e=this.sourceNaturalHeight;if(ec(t,e)&&t>0&&e>0){this.dirtyCopyDimensions=!1;const i=this.copyDimensions,n=this.currentCopyDimensions,s=i[0],r=i[1];s.substring?n[0]=parseFloat(s)/100*t:n[0]=s,r.substring?n[1]=parseFloat(r)/100*e:n[1]=r;const o=n[0],a=n[1];(o<=0||o>t)&&(n[0]=o<=0?1:t),(a<=0||a>e)&&(n[1]=a<=0?1:e),this.dirtyImage=!0}},Bm.prepareStamp=function(){this.dirtyAsset&&this.cleanAsset(),this.asset&&(this.asset.type===Aa?this.checkSpriteFrame(this):this.asset.checkSource?this.asset.checkSource(this.sourceNaturalWidth,this.sourceNaturalHeight):this.dirtyAsset=!0),(this.dirtyDimensions||this.dirtyHandle||this.dirtyScale)&&(this.dirtyPaste=!0),(this.dirtyScale||this.dirtyDimensions||this.dirtyStart||this.dirtyOffset||this.dirtyHandle)&&(this.dirtyPathObject=!0),this.dirtyScale&&this.cleanScale(),this.dirtyDimensions&&this.cleanDimensions(),this.dirtyLock&&this.cleanLock(),this.dirtyStart&&this.cleanStart(),this.dirtyOffset&&this.cleanOffset(),this.dirtyHandle&&this.cleanHandle(),this.dirtyRotation&&this.cleanRotation(),(this.isBeingDragged||this.lockTo.includes(ys)||this.lockTo.includes(Ns))&&(this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtyStampHandlePositions&&this.cleanStampHandlePositions(),this.dirtyCopyStart&&this.cleanCopyStart(),this.dirtyCopyDimensions&&this.cleanCopyDimensions(),this.dirtyImage&&this.cleanImage(),this.dirtyPaste&&this.preparePasteObject(),this.dirtyPathObject&&this.cleanPathObject(),this.dirtyPositionSubscribers&&this.updatePositionSubscribers(),this.dirtyImageSubscribers&&this.updateImageSubscribers(),this.prepareStampTabsHelper()},Bm.preparePasteObject=function(){this.dirtyPaste=!1;const t=this.currentStampHandlePosition,e=this.currentDimensions,i=this.currentScale,n=-t[0]*i,s=-t[1]*i,r=e[0]*i,o=e[1]*i,a=this.pasteArray;a.length=0,a.push(~~n,~~s,~~r,~~o),this.dirtyPathObject=!0},Bm.cleanPathObject=function(){if(this.dirtyPathObject=!1,!this.noPathUpdates||!this.pathObject)if(this.pasteArray&&4===this.pasteArray.length||this.preparePasteObject(),4!==this.pasteArray.length)this.dirtyPathObject=!0;else{(this.pathObject=new Path2D).rect(...this.pasteArray)}},Bm.draw=function(t){t.stroke(this.pathObject)},Bm.fill=function(t){const[e,i,n,s]=this.copyArray;this.source&&n&&s&&t.drawImage(this.source,e,i,n,s,...this.pasteArray)},Bm.drawAndFill=function(t){const[e,i,n,s]=this.copyArray,[r,o,a,l]=this.pasteArray;this.source&&n&&s&&(t.stroke(this.pathObject),t.drawImage(this.source,e,i,n,s,r,o,a,l),this.currentHost.clearShadow(),t.stroke(this.pathObject),t.drawImage(this.source,e,i,n,s,r,o,a,l))},Bm.fillAndDraw=function(t){const[e,i,n,s]=this.copyArray,[r,o,a,l]=this.pasteArray;this.source&&n&&s&&(t.drawImage(this.source,e,i,n,s,r,o,a,l),t.stroke(this.pathObject),this.currentHost.clearShadow(),t.drawImage(this.source,e,i,n,s,r,o,a,l),t.stroke(this.pathObject)),t.stroke(this.pathObject)},Bm.drawThenFill=function(t){const[e,i,n,s]=this.copyArray;this.source&&n&&s&&(t.stroke(this.pathObject),t.drawImage(this.source,e,i,n,s,...this.pasteArray))},Bm.fillThenDraw=function(t){const[e,i,n,s]=this.copyArray;this.source&&n&&s&&(t.drawImage(this.source,e,i,n,s,...this.pasteArray),t.stroke(this.pathObject))},Bm.checkHitReturn=function(t,e){if(this.checkHitIgnoreTransparency){const i=this.stashedImageData;if(i){const n=4*(e*i.width+t)+3;if(i.data[n])return{x:t,y:e,artefact:this}}return!1}return{x:t,y:e,artefact:this}};const Xm=function(t){return!!t&&new Picture(t)};J.Picture=Picture;const Polygon=function(t=Xl){return this.shapeInit(t),this},Ym=Polygon.prototype=rc();Ym.type="Polygon",Ym.lib=Gi,Ym.isArtefact=!0,Ym.isAsset=!1,nh(Ym),qf(Ym);Ym.defs=Kl(Ym.defs,{sides:0,sideLength:0,radius:0});const Gm=Ym.setters,jm=Ym.deltaSetters;Gm.sides=function(t){this.sides=t,this.updateDirty()},jm.sides=function(t){this.sides+=t,this.updateDirty()},Gm.sideLength=function(t){this.sideLength=t,this.updateDirty()},jm.sideLength=function(t){this.sideLength+=t,this.updateDirty()},Gm.radius=function(t){this.radius=t,this.updateDirty()},jm.radius=function(t){this.radius+=t,this.updateDirty()},Ym.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makePolygonPath()},Ym.makePolygonPath=function(){const t=this.sideLength||this.radius,e=this.sides,i=360/e,n=Mc();let s=0,r=Ol;const o=jd({x:0,y:-t});for(let t=0;t{if("pins"===e){const e=[];t.pins.forEach((t=>{Zl(t)?e.push(t.name):mt(t)?e.push([].concat(t)):e.push(t)})),t.pins=e}})),t};const Vm=Nm.getters,Wm=Nm.setters,Um=Nm.deltaSetters;Vm.pins=function(t){return tc(t)?this.getPinAt(t):this.currentPins.concat()},Wm.pins=function(t){if(tc(t)){const e=this.pins;if(mt(t))e.forEach(((t,e)=>this.removePinAt(e))),e.length=0,e.push(...t),this.updateDirty();else if(Zl(t)&&tc(t.index)){const i=e[t.index];mt(i)&&(tc(t.x)&&(i[0]=t.x),tc(t.y)&&(i[1]=t.y),this.updateDirty())}}},Um.pins=function(t){if(tc(t)){const e=this.pins;if(Zl(t)&&tc(t.index)){const i=e[t.index];mt(i)&&(tc(t.x)&&(i[0]=Rl(i[0],t.x)),tc(t.y)&&(i[1]=Rl(i[1],t.y)),this.updateDirty())}}},Wm.tension=function(t){t.toFixed&&(this.tension=t,this.updateDirty())},Um.tension=function(t){t.toFixed&&(this.tension+=t,this.updateDirty())},Wm.closed=function(t){this.closed=t,this.updateDirty()},Wm.mapToPins=function(t){this.mapToPins=t,this.updateDirty()},Wm.flipUpend=function(t){this.flipUpend=t,this.updateDirty()},Wm.flipReverse=function(t){this.flipReverse=t,this.updateDirty()},Wm.useAsPath=function(t){this.useAsPath=t,this.updateDirty()},Wm.pivot=function(t){if(zl(t)&&!t)this.pivot=null,this.lockTo[0]===Js&&(this.lockTo[0]=To),this.lockTo[1]===Js&&(this.lockTo[1]=To),this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0;else{const e=this.pivot,i=t.substring?o[t]:t,n=this.name;i&&i.name&&(e&&e.name!==i.name&&Jl(e.pivoted,n),Ql(i.pivoted,n),this.pivot=i,this.dirtyStampPositions=!0,this.dirtyStampHandlePositions=!0)}this.updateDirty()},Nm.updateDirty=function(){this.dirtySpecies=!0,this.dirtyPathObject=!0,this.dirtyPins=!0},Nm.getPinAt=function(t){const e=dt(t);if(this.useAsPath){const t=this.getPathPositionData(this.unitPartials[e]);return[t.x,t.y]}{const t=this.currentPins,i=t[e],[n,s]=this.localBox,[r,o]=i,[a]=t[0],[l,c]=this.localOffset,[h,u]=this.currentStampPosition;let d,f;return this.mapToPins?(d=r-a+n,f=o-a+s):(d=r-l,f=o-c),[h+d,u+f]}},Nm.updatePinAt=function(t,e){if(ec(t,e)){e=dt(e);const i=this.pins;if(e=0){const n=i[e];Zl(n)&&n.pivoted&&Jl(n.pivoted,this.name),i[e]=t,this.updateDirty()}}},Nm.removePinAt=function(t){t=dt(t);const e=this.pins;if(t=0){const i=e[t];Zl(i)&&i.pivoted&&Jl(i.pivoted,this.name),e[t]=null,this.updateDirty()}},Nm.prepareStamp=function(){this.dirtyHost&&(this.dirtyHost=!1),this.useParticlesAsPins&&(this.dirtyPins=!0),(this.dirtyPins||this.dirtyLock)&&(this.dirtySpecies=!0),(this.dirtyScale||this.dirtySpecies||this.dirtyDimensions||this.dirtyStart||this.dirtyHandle)&&(this.dirtyPathObject=!0,(this.dirtyScale||this.dirtySpecies)&&(this.pathCalculatedOnce=!1)),(this.isBeingDragged||this.lockTo.includes(ys)||this.lockTo.includes(Ns))&&(this.dirtyStampPositions=!0),this.dirtyScale&&this.cleanScale(),this.dirtyStart&&this.cleanStart(),this.dirtyOffset&&this.cleanOffset(),this.dirtyRotation&&this.cleanRotation(),this.dirtyStampPositions&&this.cleanStampPositions(),this.dirtySpecies&&this.cleanSpecies(),this.dirtyPathObject&&(this.cleanPathObject(),this.updatePathSubscribers()),this.dirtyPositionSubscribers&&this.updatePositionSubscribers(),this.prepareStampTabsHelper()},Nm.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makePolylinePath()},Nm.getPathParts=function(t,e,i,n,s,r,o){const a=It(Ot(i-t,2)+Ot(n-e,2)),l=It(Ot(s-i,2)+Ot(r-n,2)),c=o*a/(a+l),h=o*l/(a+l);return[i-c*(s-t),n-c*(r-e),i,n,i+h*(s-t),n+h*(r-e)]},Nm.buildLine=function(t,e,i){let n=`${wl}l`;for(let s=2;s2&&(t=i[r],e=i[r+1],s=0);return n},Nm.cleanCoordinate=function(t,e){return t.toFixed?t:t===ts||t===Za?0:t===lo||t===je?e:t===Ue?e/2:parseFloat(t)/100*e},Nm.cleanPinsArray=function(){this.dirtyPins=!1;const t=this.pins,e=this.currentPins;if(e.length=0,this.useParticlesAsPins)t.forEach(((i,n)=>{let s;i&&i.substring?(s=P[i],s&&(t[n]=s)):s=i;const r=!(!s||!s.position)&&s.position;r&&e.push([r.x,r.y])})),e.length||(this.dirtyPins=!0);else{const i=this.getHost(),n=this.cleanCoordinate;let s,r,a,l=1,c=1;i&&(a=i.currentDimensions,a&&([l,c]=a)),t.forEach(((i,a)=>{let h;if(i&&i.substring?(h=o[i],t[a]=h):h=i,h)if(mt(h))[s,r]=h,e.push([n(s,l),n(r,c)]);else if(Zl(h)&&h.currentStart){const t=this.name;h.pivoted.includes(t)||Ql(h.pivoted,t),e.push([...h.currentStampPosition])}}))}if(e.length){let t=e[0][0],i=e[0][1];e.forEach((e=>{e[0]{const e=o[t];e&&(e.dirtyStart=!0)}))};const Zm=function(t){return!!t&&(t.species="polyline",new Polyline(t))};J.Polyline=Polyline;const Quadratic=function(t=Xl){return this.control=vu(),this.currentControl=vu(),this.controlLockTo="coord",this.curveInit(t),this.shapeInit(t),this.dirtyControl=!0,this},_m=Quadratic.prototype=rc();_m.type=ma,_m.lib=Gi,_m.isArtefact=!0,_m.isAsset=!1,nh(_m),qf(_m),Jf(_m);const Km={control:null,controlPivot:Ol,controlPivotCorner:Ol,controlPivotIndex:-1,addControlPivotHandle:!1,addControlPivotOffset:!1,controlPath:Ol,controlPathPosition:0,addControlPathHandle:!1,addControlPathOffset:!0,controlParticle:Ol,controlLockTo:Ol};_m.defs=Kl(_m.defs,Km),_m.packetCoordinates=Ql(_m.packetCoordinates,["control"]),_m.packetObjects=Ql(_m.packetObjects,["controlPivot","controlPath"]);const qm=_m.getters,Qm=_m.setters,Jm=_m.deltaSetters;Qm.controlPivot=function(t){this.setControlHelper(t,"controlPivot",li),this.updateDirty(),this.dirtyControl=!0},Qm.controlParticle=function(t){this.setControlHelper(t,"controlParticle",li),this.updateDirty(),this.dirtyControl=!0},Qm.controlPath=function(t){this.setControlHelper(t,"controlPath",li),this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1},Qm.controlPathPosition=function(t){this.controlPathPosition=t,this.dirtyControl=!0,this.currentControlPathData=!1,this.dirtyFilterIdentifier=!0},Jm.controlPathPosition=function(t){this.controlPathPosition+=t,this.dirtyControl=!0,this.currentControlPathData=!1,this.dirtyFilterIdentifier=!0},qm.controlPositionX=function(){return this.currentControl[0]},qm.controlPositionY=function(){return this.currentControl[1]},qm.controlPosition=function(){return[].concat(this.currentControl)},Qm.controlX=function(t){null!=t&&(this.control[0]=t,this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1)},Qm.controlY=function(t){null!=t&&(this.control[1]=t,this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1)},Qm.control=function(t,e){this.setCoordinateHelper(li,t,e),this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1},Jm.controlX=function(t){const e=this.control;e[0]=Rl(e[0],t),this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1},Jm.controlY=function(t){const e=this.control;e[1]=Rl(e[1],t),this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1},Jm.control=function(t,e){this.setDeltaCoordinateHelper(li,t,e),this.updateDirty(),this.dirtyControl=!0,this.currentControlPathData=!1},Qm.controlLockTo=function(t){this.controlLockTo=t,this.updateDirty(),this.dirtyControlLock=!0,this.currentControlPathData=!1},_m.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeQuadraticPath()},_m.makeQuadraticPath=function(){const[t,e]=this.currentStampPosition,[i,n]=this.currentControl,[s,r]=this.currentEnd;return`${wl}q${(i-t).toFixed(2)},${(n-e).toFixed(2)} ${(s-t).toFixed(2)},${(r-e).toFixed(2)}`},_m.cleanDimensions=function(){this.dirtyDimensions=!1,this.dirtyHandle=!0,this.dirtyOffset=!0,this.dirtyStart=!0,this.dirtyControl=!0,this.dirtyEnd=!0,this.dirtyFilterIdentifier=!0},_m.preparePinsForStamp=function(){const t=this.dirtyPins,e=this.endPivot,i=this.endPath,n=this.controlPivot,s=this.controlPath;for(let r,o=0,a=t.length;o{if(Ul(t))return t;switch(t){case Za:case ts:return 0;case je:case lo:return e;case Ue:return e/2;default:return t=parseFloat(t),Ul(t)?t/100*e:0}};this.currentStartRadius=t?e(this.startRadius,t):this.defs.startRadius,this.currentEndRadius=t?e(this.endRadius,t):this.defs.endRadius},ey.buildStyle=function(t){if(t){const e=t.engine;if(e){const t=e.createRadialGradient(...this.gradientArgs);return this.addStopsToGradient(t,this.paletteStart,this.paletteEnd,this.cyclePalette)}}return Ie},ey.updateGradientArgs=function(t,e){const i=this.gradientArgs,n=this.currentStart,s=this.currentEnd,r=this.currentStartRadius;let o=this.currentEndRadius;const a=n[0]+t,l=n[1]+e,c=s[0]+t,h=s[1]+e;a===c&&l===h&&r===o&&o++,i.length=0,i.push(a,l,r,c,h,o)};const ry=function(t){return!!t&&new RadialGradient(t)};J.RadialGradient=RadialGradient;const RawAsset=function(t=Xl){this.makeName(t.name),this.register(),this.subscribers=[],this.set(this.defs),this.updateSource=Bl;const e=t.keytypes||{};t.userAttributes&&t.userAttributes.forEach((t=>{this.addAttribute(t),t.type&&(e[t.key]=t.type)})),this.initializeAttributes(e),this.set(t);const i=document.createElement(Ve);return i.width=0,i.height=0,this.element=i,this.engine=i.getContext(zt,{willReadFrequently:!0}),t.subscribe&&this.subscribers.push(t.subscribe),this},oy=RawAsset.prototype=rc();oy.type="RawAsset",oy.lib=Pe,oy.isArtefact=!1,oy.isAsset=!0,nh(oy),ed(oy);oy.defs=Kl(oy.defs,{keytypes:null,data:null,updateSource:null}),oy.saveAsPacket=function(){return[this.name,this.type,this.lib,{}]},oy.stringifyFunction=Bl,oy.processPacketOut=Bl,oy.finalizePacketOut=Bl,oy.clone=$l;const ay=oy.getters,ly=oy.setters,cy=oy.deltaSetters;ly.source=Bl,ly.element=Bl,ly.engine=Bl,ly.data=function(t){t&&(this.data=t,this.dirtyData=!0)},ly.updateSource=function(t){t&&Wl(t)&&(this.updateSource=t,this.dirtyData=!0)},oy.checkSource=function(t,e){this.source||(this.source=this.element);const i=this.source;if(i){let n=!1;this.dirtyData&&(this.dirtyData=!1,this.updateSource(this),n=!0),this.sourceLoaded=!0,this.sourceNaturalWidth&&this.sourceNaturalHeight&&this.sourceNaturalWidth===t&&this.sourceNaturalHeight===e||(this.sourceNaturalWidth=i.width,this.sourceNaturalHeight=i.height,n=!0),n&&this.sourceNaturalWidth&&this.sourceNaturalHeight&&this.notifySubscribers()}else this.sourceLoaded=!1},oy.subscribeAction=function(t={}){this.subscribers.push(t),t.asset=this,t.source=this.element,this.notifySubscriber(t)},oy.addAttribute=function(t=Xl){const{key:e,defaultValue:i,setter:n,deltaSetter:s,getter:r}=t;return e&&e.substring&&(this.defs[e]=tc(i)?i:null,this[e]=tc(i)?i:null,Wl(n)&&(ly[e]=n),Wl(s)&&(cy[e]=s),Wl(r)&&(ay[e]=r)),this},oy.removeAttribute=function(t){return t&&t.substring&&(delete this.defs[t],delete this[t],delete ay[t],delete ly[t],delete cy[t]),this},oy.initializeAttributes=function(t){for(const[e,i]of ht(t))switch(i){case ya:this[e]=_d();break;case xa:this[e]=Nd();break;case ta:this[e]=vu()}};const hy=function(t){return!!t&&new RawAsset(t)};J.RawAsset=RawAsset;const RdAsset=function(t=Xl){return this.makeName(t.name),this.register(),this.installElement(this.name),this.subscribers=[],this.set(this.defs),this.set(t),t.subscribe&&this.subscribers.push(t.subscribe),this.currentGeneration=0,this.dataArrays=[],this.dirtyScene=!0,this.dirtyOutput=!0,this},uy=RdAsset.prototype=rc();uy.type="RdAsset",uy.lib=Pe,uy.isArtefact=!1,uy.isAsset=!0,nh(uy),ed(uy),am(uy),Ed(uy);const dy={width:300,height:150,diffusionRateA:.2097,diffusionRateB:.105,feedRate:.054,killRate:.062,initialSettingPreference:Nr,randomEngineSeed:ki,initialRandomSeedLevel:.0045,initialSettingEntity:null,drawEvery:10,maxGenerations:4e3};uy.defs=Kl(uy.defs,dy),delete uy.defs.source,delete uy.defs.sourceLoaded,uy.stringifyFunction=Bl,uy.processPacketOut=Bl,uy.finalizePacketOut=Bl,uy.saveAsPacket=function(){return`[${this.name}, ${this.type}, ${this.lib}, {}]`},uy.clone=$l;const fy=uy.setters,py=uy.getters;fy.subscribers=Bl,fy.width=function(t){t.toFixed&&(this.width=t,this.sourceNaturalWidth=t,this.dirtyScene=!0)},fy.height=function(t){t.toFixed&&(this.height=t,this.sourceNaturalHeight=t,this.dirtyScene=!0)},fy.initialRandomSeedLevel=function(t){t.toFixed&&(this.initialRandomSeedLevel=t,this.dirtyScene=!0)},fy.diffusionRateA=function(t){t.toFixed&&(this.diffusionRateA=t,this.dirtyScene=!0)},fy.diffusionRateB=function(t){t.toFixed&&(this.diffusionRateB=t,this.dirtyScene=!0)},fy.feedRate=function(t){t.toFixed&&(this.feedRate=t,this.dirtyScene=!0)},fy.killRate=function(t){t.toFixed&&(this.killRate=t,this.dirtyScene=!0)},fy.drawEvery=function(t){t.toFixed&&(this.drawEvery=t,this.dirtyScene=!0)},fy.maxGenerations=function(t){t.toFixed&&(this.maxGenerations=t,this.dirtyScene=!0)},fy.initialSettingPreference=function(t){t.substring&&Ur.includes(t)&&(this.initialSettingPreference=t,this.dirtyScene=!0)},fy.randomEngineSeed=function(t){t.substring&&(this.randomEngineSeed=t,this.dirtyScene=!0)},fy.initialSettingEntity=function(t){t&&(t.substring||(t=t.name||Ol),t&&(this.initialSettingEntity=t,this.dirtyScene=!0))},py.generation=function(){return this.currentGeneration},fy.preset=function(t){if(t.substring){switch(t){case"negativeBubbles":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.098,this.killRate=.0555,this.maxGenerations=4e3,this.initialRandomSeedLevel=.05;break;case"positiveBubbles":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.098,this.killRate=.057,this.maxGenerations=4e3,this.initialRandomSeedLevel=.1;break;case"precriticalBubbles":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.082,this.killRate=.059,this.maxGenerations=4e3,this.initialRandomSeedLevel=.08;break;case"wormsAndLoops":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.082,this.killRate=.06,this.maxGenerations=4e3,this.initialRandomSeedLevel=.08;break;case"stableSolitons":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.074,this.killRate=.064,this.maxGenerations=4e3,this.initialRandomSeedLevel=.15;break;case"uSkateWorld":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.062,this.killRate=.0609,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"worms":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.058,this.killRate=.065,this.maxGenerations=4e3,this.initialRandomSeedLevel=.1;break;case"wormsJoinIntoMazes":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.046,this.killRate=.063,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"negatons":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.046,this.killRate=.0594,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"turingPatterns":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.042,this.killRate=.059,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"chaosToTuringNegatons":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.039,this.killRate=.058,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"fingerprints":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.037,this.killRate=.06,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"chaosWithNegatons":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.0353,this.killRate=.0566,this.maxGenerations=0,this.initialRandomSeedLevel=.0045;break;case"spotsAndWorms":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.034,this.killRate=.0618,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"selfReplicatingSpots":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.03,this.killRate=.063,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"superResonantMazes":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.03,this.killRate=.0565,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"mazes":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.029,this.killRate=.057,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045;break;case"mazesWithSomeChaos":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.026,this.killRate=.055,this.maxGenerations=0,this.initialRandomSeedLevel=.0045;break;case"chaos":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.026,this.killRate=.051,this.maxGenerations=0,this.initialRandomSeedLevel=.009;break;case"warringMicrobes":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.022,this.killRate=.059,this.maxGenerations=0,this.initialRandomSeedLevel=.0045;break;case"spotsAndLoops":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.018,this.killRate=.051,this.maxGenerations=0,this.initialRandomSeedLevel=.0045;break;case"movingSpots":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.014,this.killRate=.054,this.maxGenerations=0,this.initialRandomSeedLevel=.0045;break;case"waves":this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.014,this.killRate=.045,this.maxGenerations=0,this.initialRandomSeedLevel=.0045;break;default:this.diffusionRateA=.2097,this.diffusionRateB=.105,this.feedRate=.054,this.killRate=.062,this.maxGenerations=4e3,this.initialRandomSeedLevel=.0045}this.dirtyScene=!0}},uy.update=function(){this.dirtyOutput=!0},uy.cleanOutput=function(t=0){if(this.dirtyScene&&this.cleanScene(),!this.dirtyScene){const{dataArrays:e,diffusionRateA:i,diffusionRateB:n,feedRate:s,killRate:r,currentSource:o,drawEvery:a,maxGenerations:l,currentGeneration:c}=this;let h,u,d,f,p,g,m,y,b,S;if(!l||c=e?0:t},uy.checkCol=function(t){const e=this.width;return t<0?e-1:t>=e?0:t},uy.checkOutputValuesExist=function(){return!!this.dataArrays.length},uy.getOutputValue=function(t){let e,i;const{dataArrays:n,currentSource:s}=this;return s?[e,,i]=n:[,e,,i]=n,(e[t]-i[t]+1)/2};const gy=function(t){return!!t&&new RdAsset(t)};J.RdAsset=RdAsset;const Rectangle=function(t=Xl){return this.shapeInit(t),this.currentRectangleWidth=1,this.currentRectangleHeight=1,this},my=Rectangle.prototype=rc();my.type="Rectangle",my.lib=Gi,my.isArtefact=!0,my.isAsset=!1,nh(my),qf(my);my.defs=Kl(my.defs,{rectangleWidth:10,rectangleHeight:10,radiusTLX:0,radiusTLY:0,radiusTRX:0,radiusTRY:0,radiusBRX:0,radiusBRY:0,radiusBLX:0,radiusBLY:0,offshootA:.55,offshootB:0});const yy=my.setters,by=my.deltaSetters;yy.radius=function(t){this.setRectHelper(t,pr)},yy.radiusX=function(t){this.setRectHelper(t,Xr)},yy.radiusY=function(t){this.setRectHelper(t,Yr)},yy.radiusT=function(t){this.setRectHelper(t,Rr)},yy.radiusB=function(t){this.setRectHelper(t,gr)},yy.radiusL=function(t){this.setRectHelper(t,Pr)},yy.radiusR=function(t){this.setRectHelper(t,Or)},yy.radiusTX=function(t){this.setRectHelper(t,$r)},yy.radiusBX=function(t){this.setRectHelper(t,vr)},yy.radiusLX=function(t){this.setRectHelper(t,xr)},yy.radiusRX=function(t){this.setRectHelper(t,Dr)},yy.radiusTY=function(t){this.setRectHelper(t,Mr)},yy.radiusBY=function(t){this.setRectHelper(t,Cr)},yy.radiusLY=function(t){this.setRectHelper(t,wr)},yy.radiusRY=function(t){this.setRectHelper(t,Fr)},yy.radiusTL=function(t){this.setRectHelper(t,Tr)},yy.radiusTR=function(t){this.setRectHelper(t,Ir)},yy.radiusBL=function(t){this.setRectHelper(t,mr)},yy.radiusBR=function(t){this.setRectHelper(t,Sr)},yy.radiusTLX=function(t){this.setRectHelper(t,Hr)},yy.radiusTLY=function(t){this.setRectHelper(t,Er)},yy.radiusTRX=function(t){this.setRectHelper(t,Br)},yy.radiusTRY=function(t){this.setRectHelper(t,Lr)},yy.radiusBRX=function(t){this.setRectHelper(t,kr)},yy.radiusBRY=function(t){this.setRectHelper(t,Ar)},yy.radiusBLX=function(t){this.setRectHelper(t,yr)},yy.radiusBLY=function(t){this.setRectHelper(t,br)},by.radius=function(t){this.deltaRectHelper(t,pr)},by.radiusX=function(t){this.deltaRectHelper(t,Xr)},by.radiusY=function(t){this.deltaRectHelper(t,Yr)},by.radiusT=function(t){this.deltaRectHelper(t,Rr)},by.radiusB=function(t){this.deltaRectHelper(t,gr)},by.radiusL=function(t){this.deltaRectHelper(t,Pr)},by.radiusR=function(t){this.deltaRectHelper(t,Or)},by.radiusTX=function(t){this.deltaRectHelper(t,$r)},by.radiusBX=function(t){this.deltaRectHelper(t,vr)},by.radiusLX=function(t){this.deltaRectHelper(t,xr)},by.radiusRX=function(t){this.deltaRectHelper(t,Dr)},by.radiusTY=function(t){this.deltaRectHelper(t,Mr)},by.radiusBY=function(t){this.deltaRectHelper(t,Cr)},by.radiusLY=function(t){this.deltaRectHelper(t,wr)},by.radiusRY=function(t){this.deltaRectHelper(t,Fr)},by.radiusTL=function(t){this.deltaRectHelper(t,Tr)},by.radiusTR=function(t){this.deltaRectHelper(t,Ir)},by.radiusBL=function(t){this.deltaRectHelper(t,mr)},by.radiusBR=function(t){this.deltaRectHelper(t,Sr)},by.radiusTLX=function(t){this.deltaRectHelper(t,Hr)},by.radiusTLY=function(t){this.deltaRectHelper(t,Er)},by.radiusTRX=function(t){this.deltaRectHelper(t,Br)},by.radiusTRY=function(t){this.deltaRectHelper(t,Lr)},by.radiusBRX=function(t){this.deltaRectHelper(t,kr)},by.radiusBRY=function(t){this.deltaRectHelper(t,Ar)},by.radiusBLX=function(t){this.deltaRectHelper(t,yr)},by.radiusBLY=function(t){this.deltaRectHelper(t,br)},yy.offshootA=function(t){this.offshootA=t,this.updateDirty()},yy.offshootB=function(t){this.offshootB=t,this.updateDirty()},by.offshootA=function(t){t.toFixed&&(this.offshootA+=t,this.updateDirty())},by.offshootB=function(t){t.toFixed&&(this.offshootB+=t,this.updateDirty())},yy.rectangleWidth=function(t){null!=t&&(this.rectangleWidth=t,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0)},yy.rectangleHeight=function(t){null!=t&&(this.rectangleHeight=t,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0)},by.rectangleWidth=function(t){this.rectangleWidth=Rl(this.rectangleWidth,t),this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0},by.rectangleHeight=function(t){this.rectangleHeight=Rl(this.rectangleHeight,t),this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0},my.setRectHelper=function(t,e){this.updateDirty(),e.forEach((e=>{this[e]=t}),this)},my.deltaRectHelper=function(t,e){this.updateDirty(),e.forEach((e=>{this[e]=Rl(this[e],t)}),this)},my.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeRectanglePath()},my.cleanDimensions=function(){this.dirtyDimensions=!1;const t=this.getHost();if(t){const e=t.currentDimensions?t.currentDimensions:[t.w,t.h],i=this.currentRectangleWidth||1,n=this.currentRectangleHeight||1;let s=this.rectangleWidth,r=this.rectangleHeight;s.substring&&(s=parseFloat(s)/100*e[0]),r.substring&&(r=parseFloat(r)/100*e[1]);const o=this.mimic;let a;o&&o.name&&this.useMimicDimensions&&(a=o.currentDimensions),a?(this.currentRectangleWidth=this.addOwnDimensionsToMimic?a[0]+s:a[0],this.currentRectangleHeight=this.addOwnDimensionsToMimic?a[1]+r:a[1]):(this.currentRectangleWidth=s,this.currentRectangleHeight=r),this.currentDimensions[0]=this.currentRectangleWidth,this.currentDimensions[1]=this.currentRectangleHeight,this.dirtyStart=!0,this.dirtyHandle=!0,this.dirtyOffset=!0,i===this.currentRectangleWidth&&n===this.currentRectangleHeight||(this.dirtyPositionSubscribers=!0),this.mimicked&&this.mimicked.length&&(this.dirtyMimicDimensions=!0)}else this.dirtyDimensions=!0},my.makeRectanglePath=function(){this.dirtyDimensions&&this.cleanDimensions();const t=this.currentRectangleWidth,e=this.currentRectangleHeight,i=this.offshootA,n=this.offshootB;let s=this.radiusTLX,r=this.radiusTLY,o=this.radiusTRX,a=this.radiusTRY,l=this.radiusBRX,c=this.radiusBRY,h=this.radiusBLX,u=this.radiusBLY;(s.substring||r.substring||o.substring||a.substring||l.substring||c.substring||h.substring||u.substring)&&(s=s.substring?parseFloat(s)/100*t:s,r=r.substring?parseFloat(r)/100*e:r,o=o.substring?parseFloat(o)/100*t:o,a=a.substring?parseFloat(a)/100*e:a,l=l.substring?parseFloat(l)/100*t:l,c=c.substring?parseFloat(c)/100*e:c,h=h.substring?parseFloat(h)/100*t:h,u=u.substring?parseFloat(u)/100*e:u);let d=wl;return t-s-o!=0&&(d+="h"+(t-s-o)),o+a!==0&&(d+=`c${o*i},${a*n} ${o-o*n},${a-a*i}, ${o},${a}`),e-a-c!=0&&(d+="v"+(e-a-c)),l+c!==0&&(d+=`c${-l*n},${c*i} ${l*i-l},${c-c*n} ${-l},${c}`),-t+h+l!==0&&(d+=`h${-t+h+l}`),h+u!==0&&(d+=`c${-h*i},${-u*n} ${h*n-h},${u*i-u} ${-h},${-u}`),-e+r+u!==0&&(d+=`v${-e+r+u}`),s+r!==0&&(d+=`c${s*n},${-r*i} ${s-s*i},${r*n-r} ${s},${-r}`),d+="z",d},my.calculateLocalPathAdditionalActions=function(){const[t,e]=this.localBox;this.pathDefinition=this.pathDefinition.replace(wl,`m${-t},${-e}`),this.pathCalculatedOnce=!1,this.calculateLocalPath(this.pathDefinition,!0)};const Sy=function(t){return!!t&&(t.species=_r,new Rectangle(t))};J.Rectangle=Rectangle;const Shape=function(t=Xl){return this.shapeInit(t),this},ky=Shape.prototype=rc();ky.type="Shape",ky.lib=Gi,ky.isArtefact=!0,ky.isAsset=!1,nh(ky),qf(ky),ky.cleanSpecies=function(){this.dirtySpecies=!1},ky.cleanStampHandlePositionsAdditionalActions=function(){const t=this.localBox,e=this.currentStampHandlePosition;e[0]+=t[0],e[1]+=t[1]};const Ay=function(t){return!!t&&new Shape(t)};J.Shape=Shape;const vy=ft([ft([.043,0,.082,-.035,.088,-.088]),ft([.007,-.057,-.024,-.121,-.088,-.162]),ft([-.07,-.045,-.169,-.054,-.265,-.015]),ft([-.106,.043,-.194,.138,-.235,.265]),ft([-.044,.139,-.026,.3,.058,.442]),ft([.091,.153,.25,.267,.442,.308]),ft([.206,.044,.431,-.001,.619,-.131]),ft([.2,-.139,.34,-.361,.381,-.619])]),Cy=ft([ft([0,-.27,-.11,-.52,-.29,-.71]),ft([-.19,-.19,-.44,-.29,-.71,-.29]),ft([-.27,0,-.52,.11,-.71,.29]),ft([-.19,.19,-.29,.44,-.29,.71]),ft([0,.27,.11,.52,.29,.71]),ft([.19,.19,.44,.29,.71,.29]),ft([.27,0,.52,-.11,.71,-.29]),ft([.19,-.19,.29,-.44,.29,-.71])]),Spiral=function(t=Xl){return this.shapeInit(t),this},Py=Spiral.prototype=rc();Py.type="Spiral",Py.lib=Gi,Py.isArtefact=!0,Py.isAsset=!1,nh(Py),qf(Py);Py.defs=Kl(Py.defs,{loops:1,loopIncrement:1,drawFromLoop:0});const xy=Py.setters,wy=Py.deltaSetters;xy.loops=function(t){this.loops=t,this.updateDirty()},wy.loops=function(t){this.loops+=t,this.updateDirty()},xy.loopIncrement=function(t){this.loopIncrement=t,this.updateDirty()},wy.loopIncrement=function(t){this.loopIncrement+=t,this.updateDirty()},xy.drawFromLoop=function(t){this.drawFromLoop=dt(t),this.updateDirty()},wy.drawFromLoop=function(t){this.drawFromLoop=dt(this.drawFromLoop+t),this.updateDirty()},Py.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeSpiralPath()},Py.makeSpiralPath=function(){const t=dt(this.loops),e=this.loopIncrement,i=dt(this.drawFromLoop),n=Mc();let s,r,o,a,l,c,h,u,d,f,p,g;for(let t=0,i=vy.length;t=i&&(m+=`c${s},${r} ${o},${a} ${l},${c}`),[h,u,d,f,p,g]=Cy[t],n[t]=[s+h*e,r+u*e,o+d*e,a+f*e,l+p*e,c+g*e];return Xc(n),m},Py.calculateLocalPathAdditionalActions=function(){const[t,e]=this.localBox,i=this.scale;this.pathDefinition=this.pathDefinition.replace(wl,`m${-t/i},${-e/i}`),this.pathCalculatedOnce=!1,this.calculateLocalPath(this.pathDefinition,!0)};const Oy=function(t){return!!t&&(t.species="spiral",new Spiral(t))};J.Spiral=Spiral;const Star=function(t=Xl){return this.shapeInit(t),this},Dy=Star.prototype=rc();Dy.type="Star",Dy.lib=Gi,Dy.isArtefact=!0,Dy.isAsset=!1,nh(Dy),qf(Dy);Dy.defs=Kl(Dy.defs,{radius1:0,radius2:0,points:0,twist:0});const Fy=Dy.setters,Ry=Dy.deltaSetters;Fy.radius1=function(t){this.radius1=t,this.updateDirty()},Ry.radius1=function(t){this.radius1+=t,this.updateDirty()},Fy.radius2=function(t){this.radius2=t,this.updateDirty()},Ry.radius2=function(t){this.radius2+=t,this.updateDirty()},Fy.points=function(t){this.points=t,this.updateDirty()},Ry.points=function(t){this.points+=t,this.updateDirty()},Fy.twist=function(t){this.twist=t,this.updateDirty()},Ry.twist=function(t){this.twist+=t,this.updateDirty()},Dy.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeStarPath()},Dy.makeStarPath=function(){const t=this.points,e=this.twist,i=360/t,n=Mc();let s,r,o,a,l=this.radius1,c=this.radius2,h=Ol;if(l.substring||c.substring){const t=this.getHost();if(t){const e=t.currentDimensions[0];l=l.substring?parseFloat(l)/100*e:l,c=c.substring?parseFloat(c)/100*e:c}}const u=jd({x:0,y:-l}),d=jd({x:0,y:-c});s=u.x,r=u.y,n.push(s),d.rotate(-i/2),d.rotate(e);for(let e=0;e{this[e]=t}),this)},Hy.deltaRectHelper=function(t,e){this.updateDirty(),e.forEach((e=>{this[e]=Rl(this[e],t)}),this)},Hy.cleanSpecies=function(){this.dirtySpecies=!1,this.pathDefinition=this.makeTetragonPath()},Hy.makeTetragonPath=function(){const t=this.radiusX,e=this.radiusY;let i,n;if(t.substring||e.substring){const s=this.getHost();if(s){const[r,o]=s.currentDimensions;i=2*(t.substring?parseFloat(t)/100*r:t),n=2*(e.substring?parseFloat(e)/100*o:e)}}else i=2*t,n=2*e;const s=parseFloat((i*this.intersectX).toFixed(2)),r=parseFloat((i-s).toFixed(2)),o=parseFloat((n*this.intersectY).toFixed(2)),a=parseFloat((n-o).toFixed(2));let l=wl;return l+=`l${r},${o} ${-r},${a} ${-s},${-a} ${s},${-o}z`,l},Hy.calculateLocalPathAdditionalActions=function(){const[t,e]=this.localBox;this.pathDefinition=this.pathDefinition.replace(wl,`m${-t},${-e}`),this.pathCalculatedOnce=!1,this.calculateLocalPath(this.pathDefinition,!0)};const By=function(t){return!!t&&(t.species="tetragon",new Tetragon(t))};J.Tetragon=Tetragon;const Ticker=function(t=Xl){return this.makeName(t.name),this.register(),this.subscribers=[],this.subscriberObjects=[],this.set(this.defs),this.set(t),this.cycleCount=0,this.active=!1,this.effectiveDuration=0,this.startTime=0,this.currentTime=0,this.tick=0,this.lastEvent=0,t.subscribers&&this.subscribe(t.subscribers),this.setEffectiveDuration(),this},Ly=Ticker.prototype=rc();Ly.type=Ca,Ly.lib="animationtickers",Ly.isArtefact=!1,Ly.isAsset=!1,nh(Ly);Ly.defs=Kl(Ly.defs,{order:1,duration:0,subscribers:null,killOnComplete:!1,cycles:1,eventChoke:0,observer:null,onRun:null,onHalt:null,onReverse:null,onResume:null,onSeekTo:null,onSeekFor:null,onComplete:null,onReset:null}),Ly.packetExclusions=Ql(Ly.packetExclusions,["subscribers"]),Ly.packetFunctions=Ql(Ly.packetFunctions,["onRun","onHalt","onReverse","onResume","onSeekTo","onSeekFor","onComplete","onReset"]),Ly.kill=function(){return this.active&&this.halt(),Jl(Xy,this.name),Yy=!0,this.deregister(),!0},Ly.killTweens=function(t=!1){let e,i,n;for(e=0,i=this.subscribers.length;e{i=E[e],i&&t.push(i)}))},Ly.getSubscriberObjects=function(){return this.subscribers.length&&!this.subscriberObjects.length&&this.repopulateSubscriberObjects(),this.subscriberObjects},Ly.sortSubscribers=function(){const t=this.subscribers,e=t.length;if(e>1){const i=Mc();let n,s,r,o;for(n=0;n=0;n--)i[n].set(t);else for(n=0,s=i.length;nt.reversed=!t.reversed)),this},Ly.makeTickerUpdateEvent=function(){return new CustomEvent("tickerupdate",{detail:{name:this.name,type:Ca,tick:this.tick,reverseTick:this.effectiveDuration-this.tick},bubbles:!0,cancelable:!0})},Ly.recalculateEffectiveDuration=function(){const t=this.getSubscriberObjects();let e,i=0;return this.duration?this.setEffectiveDuration():(t.forEach((t=>{e=t.getEndTime(),e>i&&(i=e)})),this.effectiveDuration=i),this},Ly.setEffectiveDuration=function(){let t;return this.duration&&(t=Hl(this.duration),t[0]===Ws?(this.duration=0,this.recalculateEffectiveDuration()):this.effectiveDuration=t[1]),this},Ly.checkObserverRunningState=function(){let t=this.observer;if(t){if(t.substring){const e=i[t];if(!e||e.type!==ka)return!0;t=this.observer=e}if(t.type===ka)return t.isRunning()}return!0},Ly.fn=function(t){t=!!tc(t)&&t;const e=jy(),i=this.startTime,n=this.cycles,s=this.effectiveDuration,r=this.eventChoke;let o,a,l,c,h,u,d,f,p=this.active,g=this.cycleCount;if(p&&i&&(!n||g=s?(f=this.tick=0,this.startTime=this.currentTime,e.tick=s,e.reverseTick=0,e.willLoop=!0,n&&(g++,this.cycleCount=g)):(e.tick=f,e.reverseTick=s-f),e.next=!0):f>=s?(e.tick=s,e.reverseTick=0,p=this.active=!1,n&&(g++,this.cycleCount=g)):(e.tick=f,e.reverseTick=s-f,e.next=!0),l=this.getSubscriberObjects(),t)for(o=l.length-1;o>=0;o--)l[o].update(e);else for(o=0,a=l.length;o=n&&this.killTweens(!0)}zy(e)},Ly.run=function(){return this.active||(this.startTime=this.currentTime=vt(),this.cycleCount=0,this.updateSubscribers({reversed:!1}),this.active=!0,Ql(Xy,this.name),Yy=!0,typeof this.onRun===hn&&this.onRun()),this},Ly.isRunning=function(){return this.active},Ly.reset=function(){return this.active&&this.halt(),this.startTime=this.currentTime=vt(),this.cycleCount=0,this.updateSubscribers({reversed:!1}),this.active=!0,this.fn(!0),this.active=!1,typeof this.onReset===hn&&this.onReset(),this},Ly.complete=function(){return this.active&&this.halt(),this.startTime=this.currentTime=vt(),this.cycleCount=0,this.updateSubscribers({reversed:!0}),this.active=!0,this.fn(),this.active=!1,typeof this.onComplete===hn&&this.onComplete(),this},Ly.reverse=function(t=!1){t=ic(t,!1),this.active&&this.halt();const e=this.currentTime-this.startTime;return this.startTime=this.currentTime-(this.effectiveDuration-e),this.changeSubscriberDirection(),this.active=!0,this.fn(),this.active=!1,typeof this.onReverse===hn&&this.onReverse(),t&&this.resume(),this},Ly.halt=function(){return this.active=!1,Jl(Xy,this.name),Yy=!0,typeof this.onHalt===hn&&this.onHalt(),this},Ly.resume=function(){let t,e,i;return this.active||(t=vt(),e=this.currentTime,i=this.startTime,this.startTime=t-(e-i),this.currentTime=t,this.active=!0,Ql(Xy,this.name),Yy=!0,typeof this.onResume===hn&&this.onResume()),this},Ly.seekTo=function(t,e=!1){let i=!1;return t=ic(t,0),this.active&&this.halt(),this.cycles&&this.cycleCount>=this.cycles&&(this.cycleCount=this.cycles-1),t=this.cycles&&(this.cycleCount=this.cycles-1),this.startTime-=t,t<0&&(i=!0),this.active=!0,this.fn(i),this.active=!1,typeof this.onSeekFor===hn&&this.onSeekFor(),e&&this.resume(),this};const Xy=[];let Yy=!0;rh({name:"SC-core-tickers-animation",order:0,fn:function(){let t,e,i,n,r,o;if(Yy){Yy=!1;const s=Mc();for(n=0,r=Xy.length;n{if(mt(t))n=t[0],s=t[1];else{if(!ec(t,t.x,t.y))return!1;n=t.x,s=t.y}if(!yt(n)||!yt(s))return!1;const e=jd(i).vectorSubtract(t);return e.getMagnitude()t.name))),mt(this.definitions)&&(t.definitions=this.definitions.map((t=>{const e={};if(e.attribute=t.attribute,e.start=t.start,e.end=t.end,t.engine&&t.engine.substring)e.engine=t.engine.substring;else if(tc(t.engine)&&null!=t.engine){const i=this.stringifyFunction(t.engine);i&&(e.engine=i,e.engineIsFunction=!0)}return e}))),t},_y.postCloneAction=function(t,e){if(e.useNewTicker){const i=s[this.ticker];tc(e.cycles)?t.cycles=e.cycles:t.cycles=i?i.cycles:1;const n=s[t.ticker];n.cycles=t.cycles,tc(e.duration)&&(t.duration=e.duration,t.calculateEffectiveDuration(),n&&n.recalculateEffectiveDuration())}return mt(t.definitions)&&t.definitions.forEach(((t,e)=>{t.engineIsFunction&&(t.engine=this.definitions[e].engine)})),t};const Ky=_y.getters,qy=_y.setters;Ky.definitions=function(){return[].concat(this.definitions)},qy.definitions=function(t){this.definitions=[].concat(t),this.setDefinitionsValues()},qy.commenceAction=function(t){this.commenceAction=t,typeof this.commenceAction!=hn&&(this.commenceAction=Bl)},qy.completeAction=function(t){this.completeAction=t,typeof this.completeAction!=hn&&(this.completeAction=Bl)},_y.set=function(t=Xl){const e=this.setters,i=St(t),n=this.defs,s=!!tc(t.ticker)&&this.ticker;let r,o,a,l;for(o=0,a=i.length;oo?l=1:ia&&(l=1)),s?l&&l==this.status||(this.status=l,this.doSimpleUpdate(t),t.next||(this.status=r?-1:1)):l!=this.status&&(this.status=l,this.doSimpleUpdate(t),t.next||(this.status=r?-1:1)),t.willLoop&&(this.reverseOnCycleEnd?this.reversed=!r:this.status=-1)},_y.doSimpleUpdate=function(t=Xl){const e=this.effectiveTime,i=this.engineActions,n=this.effectiveDuration,s=this.status,r=this.definitions,o=this.targets,a=this.action,l=this.setObj||{};let c,h,u,d,f,p,g,m,y,b,S,k,A;const v=this.reversed?t.reverseTick-e:t.tick-e;for(A=n&&!s?v/n:s>0?1:0,y=0,b=r.length;y(t=parseFloat(t),Ul(t)||(t=0),Ul(e)||(e=0),parseFloat(t.toFixed(e))),Wheel=function(t=Xl){return nc(t.dimensions,t.width,t.height,t.radius)||(t.radius=5),this.entityInit(t),this},tb=Wheel.prototype=rc();tb.type="Wheel",tb.lib=Gi,tb.isArtefact=!0,tb.isAsset=!1,nh(tb),jf(tb);tb.defs=Kl(tb.defs,{radius:5,startAngle:0,endAngle:360,clockwise:!0,includeCenter:!1,closed:!0});const eb=tb.setters,ib=tb.deltaSetters;eb.width=function(t){if(null!=t){const e=this.dimensions;e[0]=e[1]=t,this.dimensionsHelper()}},ib.width=function(t){const e=this.dimensions;e[0]=e[1]=Rl(e[0],t),this.dimensionsHelper()},eb.height=function(t){if(null!=t){const e=this.dimensions;e[0]=e[1]=t,this.dimensionsHelper()}},ib.height=function(t){const e=this.dimensions;e[0]=e[1]=Rl(e[0],t),this.dimensionsHelper()},eb.dimensions=function(t,e){this.setCoordinateHelper(Pi,t,e),this.dimensionsHelper()},ib.dimensions=function(t,e){this.setDeltaCoordinateHelper(Pi,t,e),this.dimensionsHelper()},eb.radius=function(t){this.radius=t,this.radiusHelper()},ib.radius=function(t){this.radius=Rl(this.radius,t),this.radiusHelper()},eb.startAngle=function(t){this.startAngle=Jy(t,4),this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0},ib.startAngle=function(t){this.startAngle+=Jy(t,4),this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0},eb.endAngle=function(t){this.endAngle=Jy(t,4),this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0},ib.endAngle=function(t){this.endAngle+=Jy(t,4),this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0},eb.closed=function(t){tc(t)&&(this.closed=!!t,this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0)},eb.includeCenter=function(t){tc(t)&&(this.includeCenter=!!t,this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0)},eb.clockwise=function(t){tc(t)&&(this.clockwise=!!t,this.dirtyPathObject=!0,this.dirtyFilterIdentifier=!0)},tb.dimensionsHelper=function(){const t=this.dimensions[0];t.substring?this.radius=parseFloat(t)/2+"%":this.radius=t/2,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0},tb.radiusHelper=function(){const t=this.radius,e=this.dimensions;t.substring?e[0]=e[1]=2*parseFloat(t)+Ws:e[0]=e[1]=2*t,this.dirtyDimensions=!0,this.dirtyFilterIdentifier=!0},tb.cleanDimensionsAdditionalActions=function(){const t=this.radius,e=this.currentDimensions,i=t.substring?parseFloat(t)/100*e[0]:t;e[0]!==2*i?(e[1]=e[0],this.currentRadius=e[0]/2):this.currentRadius=i},tb.cleanPathObject=function(){if(this.dirtyPathObject=!1,!this.noPathUpdates||!this.pathObject){const t=this.pathObject=new Path2D,e=this.currentStampHandlePosition,i=this.currentScale,n=this.currentRadius*i,s=n-e[0]*i,r=n-e[1]*i,o=this.startAngle*Dt,a=this.endAngle*Dt;t.arc(s,r,n,o,a,!this.clockwise),this.includeCenter?(t.lineTo(s,r),t.closePath()):this.closed&&t.closePath()}};const nb=function(t){return!!t&&new Wheel(t)};J.Wheel=Wheel;const World=function(t=Xl){this.makeName(t.name),this.register(),this.set(this.defs);const e=t.keytypes||{};return e.gravity||(e.gravity=xa),t.gravity||(t.gravity=[0,9.81,0]),t.userAttributes&&t.userAttributes.forEach((t=>{this.addAttribute(t),t.type&&(e[t.key]=t.type)})),this.initializeAttributes(e),this.set(t),this},sb=World.prototype=rc();sb.type=Oa,sb.lib="world",sb.isArtefact=!1,sb.isAsset=!1,nh(sb);sb.defs=Kl(sb.defs,{gravity:null,tickMultiplier:1,keytypes:null}),sb.kill=function(){return this.deregister(),!0};const rb=sb.getters,ob=sb.setters,ab=sb.deltaSetters;ob.gravityX=function(t){this.gravity&&tc(t)&&this.gravity.setX(t)},ob.gravityY=function(t){this.gravity&&tc(t)&&this.gravity.setY(t)},ob.gravityZ=function(t){this.gravity&&tc(t)&&this.gravity.setZ(t)},ob.gravity=function(t){this.gravity&&tc(t)&&this.gravity.set(t)},sb.addAttribute=function(t=Xl){const{key:e,defaultValue:i,setter:n,deltaSetter:s,getter:r}=t;return e&&e.substring&&(this.defs[e]=tc(i)?i:null,this[e]=tc(i)?i:null,Wl(n)&&(ob[e]=n),Wl(s)&&(ab[e]=s),Wl(r)&&(rb[e]=r)),this},sb.removeAttribute=function(t){return t&&t.substring&&(delete this.defs[t],delete this[t],delete rb[t],delete ob[t],delete ab[t]),this},sb.initializeAttributes=function(t){for(const[e,i]of ht(t))switch(i){case ya:this[e]=_d();break;case xa:this[e]=Nd();break;case ta:this[e]=vu()}};const lb=function(t){return!!t&&new World(t)};J.World=World;const cb={},hb=function(t=Xl){const e=(t=Xl)=>{if(t&&t.target){let e=t.target,n="";for(;!n&&(cb[e.id]&&(n=e.id),e.tagName!==Xt);)e=e.parentElement;const r=cb[n];if(r)for(let e=0,n=r.length;e{i(t)};let s=Bl;const r=(t=Xl)=>{s(t),i=Bl,s=Bl},a=function(t=Xl,e,i){let{zone:n,coordinateSource:s,collisionGroup:r,startOn:a,endOn:l,updateOnStart:c,updateOnEnd:h,updateWhileMoving:u,updateOnShiftStart:d,updateOnShiftEnd:f,updateWhileShiftMoving:p,updateOnPrematureExit:g,exposeCurrentArtefact:m,preventTouchDefaultWhenDragging:y,resetCoordsToZeroOnTouchEnd:b,processingOrder:S}=t;if(!n)return new Error("dragZone constructor - no zone supplied");if(n.substring&&(n=o[n]),!n||!ae.includes(n.type))return new Error("dragZone constructor - zone object is not a Stack or Canvas wrapper");const k=n.domElement;if(!k)return new Error("dragZone constructor - zone does not contain a target DOM element");if(r?r.substring&&(r=v[r]):r=n.type===Ko?v[n.base.name]:v[n.name],!r||r.type!==oa)return new Error("dragZone constructor - unable to recover collisionGroup group");if(s?s.here?s=s.here:ec(s.x,s.y)||(s=!1):s=n.type===Ko?n.base.here:n.here,!s)return new Error("dragZone constructor - unable to discover a usable coordinateSource object");mt(a)||(a=[Fi]),mt(l)||(l=[ul]),null==m&&(m=!1),null==y&&(y=!1),null==b&&(b=!0),Zl(c)&&(c=function(){A.artefact.set(t.updateOnStart)}),Wl(c)||(c=Bl),Zl(d)&&(d=function(){A.artefact.set(t.updateOnShiftStart)}),Wl(d)||(d=c),Zl(h)&&(h=function(){A.artefact.set(t.updateOnEnd)}),Wl(h)||(h=Bl),Zl(f)&&(f=function(){A.artefact.set(t.updateOnShiftEnd)}),Wl(f)||(f=h),Wl(u)||(u=Bl),Wl(p)||(p=u),Wl(g)||(g=Bl),zl(m)||(m=!1),null==S&&(S=0);let A=!1;const C=function(t){t&&t.cancelable&&(y&&A?(t.preventDefault(),t.returnValue=!1):y||(t.preventDefault(),t.returnValue=!1))},P=function(t=Xl){A&&(C(t),t.type===Qa&&Dh(t),t.shiftKey?p(t):u(t))},x=function(t=Xl){A&&(C(t),t.type===qa&&Dh(t,b),A.artefact.dropArtefact(),t.shiftKey?f(t):h(t),A=!1)};cb[n.name]||(cb[n.name]=[],e(a,l,k));const w=function(){const t=`${n.name}_${r.name}_${S}`;cb[n.name]=cb[n.name].filter((e=>e.name!==t)),cb[n.name].length||(i(a,l,k),delete cb[n.name])},O=function(t){if(!t)return A;"exit"===t||"drop"===t?(x(),g()):w()},D={name:`${n.name}_${r.name}_${S}`,exposeCurrentArtefact:m,target:k,processingOrder:S,pickup:function(t=Xl){C(t);const e=t.type;return e!==Ja&&e!==Ka||Dh(t,b),A=r.getArtefactAt(s),A&&(A.artefact.pickupArtefact(s),t.shiftKey?d(t):c(t)),{current:A,move:P,drop:x}},move:P,drop:x,kill:w,getCurrent:O};return cb[n.name].push(D),cb[n.name].sort(((t,e)=>t.processingOrder-e.processingOrder)),{exposeCurrentArtefact:m,getCurrent:O,kill:w,zone:n}}(t,((t,i,s)=>{_c(t,e,s),_c(Cs,n,s),_c(i,r,s)}),((t,i,s)=>{Kc(t,e,s),Kc(Cs,n,s),Kc(i,r,s)}));return a.exposeCurrentArtefact?a.getCurrent:a.kill},ub={},db=function(t=Xl){const e=(t=Xl)=>{if(t&&t.target){let e=t.target,n="";for(;!n&&(ub[e.id]&&(n=e.id),e.tagName!==Xt);)e=e.parentElement;const s=ub[n];s?(s.onKeyDown(t),i=s.onKeyUp):i=Bl}};let i=Bl;const n=t=>{i(t)};return function(t=Xl,e,i){let n=t.zone;if(!n)return new Error("keyboardZone constructor - no zone supplied");if(n.substring&&(n=o[n]),!n||!ae.includes(n.type))return new Error("keyboardZone constructor - zone object is not a Stack or Canvas wrapper");const s=n.domElement;if(!s)return new Error("keyboardZone constructor - zone does not contain a target DOM element");let r=ub[n.name];if(r||(ub[n.name]={},r=ub[n.name],e(s)),r.extraKeys||(r.extraKeys={Shift:!1,Control:!1,Alt:!1,Meta:!1}),!r.keyGroups){const t={};jn.forEach((e=>t[e]={})),r.keyGroups=t}const a=r.keyGroups;return jn.forEach((e=>{const i=t[e];null!=i&&ql(a[e],i)})),r.onKeyDown||(r.onKeyDown=(t=Xl)=>{if(t&&t.key){t.preventDefault();const{extraKeys:e,keyGroups:i}=r,{key:n}=t;if("Tab"===n||"Escape"===n)return void s.blur();if(null!=e[n])return void(e[n]=!0);const{Shift:o,Control:a,Alt:l,Meta:c}=e;let h=i.none;(o||a||l||c)&&(h=o?l?a?c?i.all:i.shiftAltCtrl:c?i.shiftAltMeta:i.shiftAlt:a?c?i.shiftCtrlMeta:i.shiftCtrl:c?i.shiftMeta:i.shiftOnly:l?a?c?i.altCtrlMeta:i.altCtrl:c?i.altMeta:i.altOnly:a?c?i.ctrlMeta:i.ctrlOnly:c?i.altOnly:i.none),h[n]&&h[n]()}}),r.onKeyUp||(r.onKeyUp=(t=Xl)=>{if(t&&t.key){t.preventDefault();const e=r.extraKeys,i=t.key;null!=e[i]&&(e[i]=!1)}}),r.kill||(r.kill=function(){delete ub[n.name],i(s)}),{kill:r.kill,getMappedKeys:(t=Bs)=>null!=r.keyGroups[t]?St(r.keyGroups[t]):[]}}(t,(t=>{th(Yn,e,t),th(Gn,n,t)}),(t=>{eh(Yn,e,t),eh(Gn,n,t)}))},fb=function(t=Xl){if(!ec(t.event,t.origin,t.updates))return!1;const e=t.target.substring&&t.targetLibrarySection?tt[t.targetLibrarySection][t.target]:t.target;if(!e)return!1;const i=t.event,n=t.origin,s=t.useNativeListener?th:_c,r=t.useNativeListener?eh:Kc;let o=Bl;t.preventDefault&&(o=t=>{t.preventDefault(),t.returnValue=!1});const a=Wl(t.setup)?t.setup:Bl,l=Wl(t.callback)?t.callback:Bl,c=function(i){o(i);const n=!(!i||!i.target)&&i.target.id;if(n){const s=t.updates[n];if(s){a();const t=s[0],n=s[1],r=i.target.value;let o,c=!0;switch(n){case"float":o=parseFloat(r);break;case"int":o=parseInt(r,10);break;case"round":o=Rt(r);break;case"roundDown":o=dt(r);break;case"roundUp":o=ot(r);break;case"raw":o=r;break;case"parse":o=r.substring?JSON.parse(r):r;break;case"string":o=`${r}`;break;case"boolean":o=!!tc(r)&&(r.substring?el===r.toLowerCase()||"false"!==r.toLowerCase()&&!!parseFloat(r):!!r);break;default:n.substring?o=`${parseFloat(r)}${n}`:c=!1}c&&(e.type===oa?e.setArtefacts({[t]:o}):e.set({[t]:o}),l(i))}}};return s(i,c,n),function(){r(i,c,n)}},pb=(t=Xl)=>fb(t),gb=Pf;"undefined"!=typeof window&&Pf();export{hf as addCanvas,_c as addListener,th as addNativeListener,vf as addStack,X as checkFontIsLoaded,Of as clear,Df as compile,cd as createImageFromCell,ud as createImageFromEntity,hd as createImageFromGroup,ah as currentCorePosition,G as findArtefact,j as findAsset,N as findCanvas,Z as findCell,Q as findElement,z as findEntity,_ as findFilter,K as findGroup,U as findPattern,q as findStack,V as findStyles,W as findTween,Ic as forceUpdate,of as getCanvas,Y as getFontMetadata,mh as getIgnorePixelRatio,ph as getPixelRatio,Cf as getStack,wh as getTouchActionChoke,ld as importDomImage,Pm as importDomVideo,ad as importImage,xm as importMediaStream,wm as importScreenCapture,Rm as importSprite,Om as importVideo,gb as init,tt as library,Gf as makeAction,rh as makeAnimation,Zc as makeAnimationObserver,rp as makeBezier,Nf as makeBlock,hp as makeCog,Wu as makeColor,yp as makeConicGradient,Ap as makeCrescent,hb as makeDragZone,ff as makeElement,Xp as makeEmitter,tg as makeEnhancedLabel,Ag as makeFilter,Cg as makeForce,mg as makeGradient,Dg as makeGrid,yd as makeGroup,db as makeKeyboardZone,Ig as makeLabel,Lg as makeLine,Yg as makeLineSpiral,Wg as makeLoom,qg as makeMesh,om as makeNet,mm as makeNoise,gm as makeNoiseAsset,km as makeOval,Im as makePattern,Xm as makePicture,zm as makePolygon,Zm as makePolyline,ty as makeQuadratic,ry as makeRadialGradient,hy as makeRawAsset,gy as makeReactionDiffusionAsset,Sy as makeRectangle,Hf as makeRender,Ay as makeShape,If as makeSnippet,Oy as makeSpiral,tm as makeSpring,Ty as makeStar,By as makeTetragon,Ny as makeTicker,Zy as makeTracer,Qy as makeTween,pb as makeUpdater,nb as makeWheel,lb as makeWorld,fb as observeAndUpdate,M as purge,Lh as purgeFontMetadata,Yh as recalculateFonts,Au as releaseCoordinate,Zd as releaseQuaternion,zd as releaseVector,Kc as removeListener,eh as removeNativeListener,Rf as render,ku as requestCoordinate,Ud as requestQuaternion,jd as requestVector,Jh as seededRandomNumberGenerator,cf as setCurrentCanvas,su as setFilterMemoizationChoke,yh as setIgnorePixelRatio,Sh as setPixelRatioChangeAction,Oh as setTouchActionChoke,nu as setWorkstoreLifetimeLength,hu as setWorkstorePurgeChoke,Ff as show,Wc as startCoreAnimationLoop,Hh as startCoreListeners,Uc as stopCoreAnimationLoop,Eh as stopCoreListeners}; diff --git a/package.json b/package.json index 1d5fa230..4412b4b9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "scrawl-canvas", - "version": "8.13.0", - "description": "Version 8.13.0 - 27 April 2024", + "version": "8.13.1", + "description": "Version 8.13.1 - 3 May 2024", "main": "./min/scrawl.js", "type": "module", "types": "./source/scrawl.d.ts", diff --git a/rollup.config.js b/rollup.config.js index 5875cefb..63a42046 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -7,7 +7,7 @@ export default { format: 'es', plugins: [terser({ mangle: { - reserved: ['Action', 'Anchor', 'Animation', 'Bezier', 'Block', 'Button', 'Canvas', 'Cell', 'Cog', 'Color', 'ConicGradient', 'Coordinate', 'Crescent', 'Element', 'Emitter', 'EnhancedLabel', 'Filter', 'FilterEngine', 'FontAttributes', 'Force', 'Gradient', 'Grid', 'Group', 'ImageAsset', 'Label', 'Line', 'LineSpiral', 'Loom', 'Mesh', 'Net', 'NoiseAsset', 'Oval', 'Palette', 'Particle', 'ParticleHistory', 'Pattern', 'Picture', 'Polygon', 'Polyline', 'Quadratic', 'Quaternion', 'RadialGradient', 'RawAsset', 'RdAsset', 'Rectangle', 'RenderAnimation', 'Shape', 'Spiral', 'Spring', 'SpriteAsset', 'Stack', 'Star', 'State', 'Tetragon', 'Ticker', 'Tracer', 'Tween', 'UnstackedElement', 'Vector', 'VideoAsset', 'Wheel', 'World'] + reserved: ['Action', 'Anchor', 'Animation', 'Bezier', 'Block', 'Button', 'Canvas', 'Cell', 'Cog', 'Color', 'ConicGradient', 'Coordinate', 'Crescent', 'Element', 'Emitter', 'EnhancedLabel', 'EnhancedLabelLine', 'EnhancedLabelUnit', 'EnhancedLabelUnitArray', 'Filter', 'FilterEngine', 'FontAttributes', 'Force', 'Gradient', 'Grid', 'Group', 'ImageAsset', 'Label', 'Line', 'LineObject', 'LineSpiral', 'Loom', 'Mesh', 'Net', 'NoiseAsset', 'Oval', 'Palette', 'Particle', 'ParticleHistory', 'Pattern', 'Picture', 'Polygon', 'Polyline', 'Quadratic', 'Quaternion', 'RadialGradient', 'RawAsset', 'RdAsset', 'Rectangle', 'RenderAnimation', 'Shape', 'Spiral', 'Spring', 'SpriteAsset', 'Stack', 'Star', 'State', 'Tetragon', 'Ticker', 'Tracer', 'Tween', 'UnitObject', 'UnstackedElement', 'Vector', 'VideoAsset', 'Wheel', 'World'] } })] } diff --git a/source/core/library.js b/source/core/library.js index 02d1b76b..d057d158 100644 --- a/source/core/library.js +++ b/source/core/library.js @@ -9,7 +9,7 @@ // Current version -export const version = '8.13.0'; +export const version = '8.13.1'; // Objects created using the __makeAnchor__ factory @@ -221,6 +221,12 @@ export function findPattern (item = '') { return null; } +export function findCell (item = '') { + + if (cellnames.includes(item)) return cell[item]; + return null; +} + export function findFilter (item = '') { if (filternames.includes(item)) return filter[item]; diff --git a/source/factory/enhanced-label.js b/source/factory/enhanced-label.js index 3762338f..139dad90 100644 --- a/source/factory/enhanced-label.js +++ b/source/factory/enhanced-label.js @@ -125,6 +125,7 @@ const defaultAttributes = { // __pathPosition__ - number. Where to start text positioning along the layout engine path. pathPosition: 0, + constantSpeedAlongPath: true, // __alignment__ - number. Rotational positioning of the text units along a path or guideline alignment: 0, @@ -1591,6 +1592,7 @@ P.positionTextUnitsAlongPath = function () { layoutTemplate, lines, pathPosition, + constantSpeedAlongPath, textHandle, textOffset, textUnitFlow, @@ -1679,7 +1681,7 @@ P.positionTextUnitsAlongPath = function () { currentPos = currentLen / length; - unit.pathData = layoutTemplate.getPathPositionData(currentPos, true); + unit.pathData = layoutTemplate.getPathPositionData(currentPos, constantSpeedAlongPath); ({x, y, angle} = unit.pathData); tempX = offsetX - handleX; @@ -1724,7 +1726,7 @@ P.positionTextUnitsAlongPath = function () { currentPos = currentLen / length; - unit.pathData = layoutTemplate.getPathPositionData(currentPos, true); + unit.pathData = layoutTemplate.getPathPositionData(currentPos, constantSpeedAlongPath); ({x, y, angle} = unit.pathData); tempX = offsetX - handleX; @@ -1744,7 +1746,8 @@ P.positionTextUnitsAlongPath = function () { unit.localRotation = localAlignment * _radian; - currentLen += len - kernOffset - handleX; + currentLen -= handleX; + currentLen += (len - kernOffset); } unit.set({ boxData: null }); diff --git a/source/factory/loom.js b/source/factory/loom.js index 3ee96556..1067f974 100644 --- a/source/factory/loom.js +++ b/source/factory/loom.js @@ -112,7 +112,7 @@ const defaultAttributes = { // __loopPathCursors__ - Boolean flag - For animation purposes, the image will move between the struts with the bottom of the page appearing again at the top of the Loom as it moves down (and vice versa). // + To change this functionality - so that the image slowly disappears as it animates up and down past the ends of the struts, set the attribute to `false`. loopPathCursors: true, - constantPathSpeed: true, + constantSpeedAlongPath: true, // __isHorizontalCopy__ - Boolean flag - Copying the source image to the output happens, by default, by rows - which effectively means the struts are on the left-hand and right-hand edges of the image. // + To change this to columns (which sets the struts to the top and bottom edges of the image) set the attribute to `false` @@ -721,7 +721,7 @@ P.prepareStamp = function() { fPathEnd = this.fromPathEnd, tPathStart = this.toPathStart, tPathEnd = this.toPathEnd, - pathSpeed = this.constantPathSpeed; + pathSpeed = this.constantSpeedAlongPath; let fPartial, tPartial; diff --git a/source/helper/shape-path-calculation.js b/source/helper/shape-path-calculation.js index 836f1200..75bac421 100644 --- a/source/helper/shape-path-calculation.js +++ b/source/helper/shape-path-calculation.js @@ -346,21 +346,7 @@ export const calculatePath = (d, scale, start, useAsPath, precision, result) => const curData = myData[i], myPts = curData.p; - if (myPts) { - - for (j = 0, jz = myPts.length; j < jz; j++) { - - myPts[j] = myPts[j].toFixed(1); - } - - localPath += `${curData.c}${curData.p.join()}`; - - for (j = 0, jz = myPts.length; j < jz; j++) { - - myPts[j] = parseFloat(myPts[j]); - } - - } + if (myPts) localPath += `${curData.c}${curData.p.join()}`; else localPath += `${curData.c}`; } @@ -483,11 +469,10 @@ export const calculatePath = (d, scale, start, useAsPath, precision, result) => for (i = 0, iz = unitLengths.length; i < iz; i++) { mySum += unitLengths[i] / myLen; - unitPartials[i] = parseFloat(mySum.toFixed(6)); + unitPartials[i] = mySum; } } - - result.length = parseFloat(myLen.toFixed(1)); + result.length = myLen; // calculate bounding box dimensions result.maxX = _max(...xPoints); diff --git a/source/mixin/path.js b/source/mixin/path.js index d6e4ccd5..3e3ceb9b 100644 --- a/source/mixin/path.js +++ b/source/mixin/path.js @@ -28,7 +28,7 @@ export default function (P = Ωempty) { addPathOffset: true, addPathRotation: false, - // DEPRECATION WARNING: `constantSpeedAlongPath` replaces the old attribute `constantPathSpeed` which clashes with the attribute set by the ShapeBasic mixin. +// __constantSpeedAlongPath__ - Boolean flag. When set to true, corrections will be applied to make sure the artefact moves along the path at a constant speed (rather than slowing down when it approaches a bend) constantSpeedAlongPath: false, }; P.defs = mergeOver(P.defs, defaultAttributes); @@ -92,7 +92,7 @@ export default function (P = Ωempty) { if (item < 0) item = _abs(item); if (item > 1) item = item % 1; - this.pathPosition = parseFloat(item.toFixed(6)); + this.pathPosition = item; this.dirtyStampPositions = true; this.dirtyStampHandlePositions = true; this.currentPathData = false; @@ -104,7 +104,7 @@ export default function (P = Ωempty) { if (pos < 0) pos += 1; if (pos > 1) pos = pos % 1; - this.pathPosition = parseFloat(pos.toFixed(6)); + this.pathPosition = pos; this.dirtyStampPositions = true; this.dirtyStampHandlePositions = true; this.currentPathData = false; @@ -135,14 +135,11 @@ export default function (P = Ωempty) { if (this.currentPathData) return this.currentPathData; - const pos = this.pathPosition, - path = this.path; + const path = this.path; if (path) { - // Note: the old attribute `constantPathSpeed` has been deprecated because the ShapeBasic mixin adds that attributes to shapes where it has different functionality. This code is temporary until Scrawl-canvas v9 is released - const speed = this.constantSpeedAlongPath || this.constantPathSpeed || false; - const val = path.getPathPositionData(pos, speed); + const val = path.getPathPositionData(this.pathPosition, this.constantSpeedAlongPath); if (this.addPathRotation) this.dirtyRotation = true; diff --git a/source/mixin/position.js b/source/mixin/position.js index d5fdbac8..675e1b3f 100644 --- a/source/mixin/position.js +++ b/source/mixin/position.js @@ -821,7 +821,6 @@ export default function (P = Ωempty) { delete art.addPathHandle; delete art.addPathOffset; delete art.addPathRotation; - delete art.constantPathSpeed; break; case FILTER : diff --git a/source/mixin/shape-basic.js b/source/mixin/shape-basic.js index dbf6044e..2240895a 100644 --- a/source/mixin/shape-basic.js +++ b/source/mixin/shape-basic.js @@ -34,7 +34,6 @@ export default function (P = Ωempty) { useAsPath: false, precision: 10, - constantPathSpeed: false, pathDefinition: ZERO_STR, @@ -89,12 +88,6 @@ export default function (P = Ωempty) { } }; - S.constantPathSpeed = function (item) { - - this.constantPathSpeed = item; - this.updateDirty(); - }; - // Invalidate __dimensions__ setters - dimensions are an emergent property of shapes, not a defining property S.width = λnull; S.height = λnull; @@ -229,48 +222,44 @@ export default function (P = Ωempty) { if (!_isFinite(pos)) return 0; if (pos >= 1) return 0.9999; - const positions = this.unitPositions; + const { unitPositions, unitProgression, length } = this; - if (positions && positions.length) { + if (unitPositions && unitPositions.length) { - const len = this.length, - progress = this.unitProgression, - requiredProgress = pos * len; + const arraysLen = unitPositions.length; - let indexProgress, lastProgress, diffProgress, - currentPosition, indexPosition, nextPosition, diffPosition, - index = -1; + let index = 0, + steadyDistance = 0, + dynamicDistance = 0, + sectionRatio; - for (let i = 0, iz = progress.length; i < iz; i++) { + for (let i = 0; i < arraysLen; i++) { - if (requiredProgress <= progress[i]) { + sectionRatio = unitProgression[i] / length; - index = i - 1; - break; + if (pos > sectionRatio) { + + steadyDistance = unitPositions[i]; + dynamicDistance = sectionRatio; + index++; } } - if (index < 0) { + const remainingDynamicDistance = (index) ? (pos - dynamicDistance) : pos; - // first segment - indexProgress = progress[0]; - currentPosition = (requiredProgress / indexProgress) * positions[0]; - } - else { + const dynamicSegmentLength = (index) + ? (unitProgression[index] - unitProgression[index - 1]) / length + : unitProgression[index] / length; - // subsequent segments - progress is pixel lengths - indexProgress = progress[index]; - lastProgress = (index) ? progress[index - 1] : 0; - diffProgress = indexProgress - lastProgress; + const steadySegmentLength = (index) + ? (unitPositions[index] - unitPositions[index - 1]) + : unitPositions[index]; - // ... and position is in the range 0-1 - indexPosition = positions[index]; - nextPosition = positions[index + 1]; - diffPosition = nextPosition - indexPosition; + const steadyToDynamicRatio = steadySegmentLength / dynamicSegmentLength; - currentPosition = indexPosition + (((requiredProgress - indexProgress) / diffProgress) * diffPosition); - } - return currentPosition; + steadyDistance += (remainingDynamicDistance * steadyToDynamicRatio); + + return steadyDistance; } else return pos; }; @@ -457,8 +446,8 @@ export default function (P = Ωempty) { currentDims = this.currentDimensions, box = this.localBox; - dims[0] = parseFloat((maxX - minX).toFixed(1)); - dims[1] = parseFloat((maxY - minY).toFixed(1)); + dims[0] = maxX - minX; + dims[1] = maxY - minY; if(dims[0] !== currentDims[0] || dims[1] !== currentDims[1]) { @@ -468,14 +457,13 @@ export default function (P = Ωempty) { } box.length = 0; - box.push(parseFloat(minX.toFixed(1)), parseFloat(minY.toFixed(1)), dims[0], dims[1]); + box.push(minX, minY, dims[0], dims[1]); if (this.useAsPath) { // we can do work here to flatten some of these arrays const {units, unitLengths, unitPartials, unitProgression, unitPositions} = res; -// console.log(unitProgression); const flatProgression = requestArray(), flatPositions = requestArray(); @@ -500,10 +488,10 @@ export default function (P = Ωempty) { for (j = 0, jz = progression.length; j < jz; j++) { l = lastLength + progression[j]; - flatProgression.push(parseFloat(l.toFixed(1))); + flatProgression.push(l); p = lastPartial + (positions[j] * currentPartial); - flatPositions.push(parseFloat(p.toFixed(6))); + flatPositions.push(p); } } } diff --git a/source/mixin/text.js b/source/mixin/text.js index a2c338d3..bd7f13e7 100644 --- a/source/mixin/text.js +++ b/source/mixin/text.js @@ -677,7 +677,7 @@ export default function (P = Ωempty) { // `getCanvasTextHold` - get a handle for the <canvas> element's child text hold <div> P.getCanvasTextHold = function (item) { - if (item && item.type === T_CELL && item.controller.type && item.controller.type=== T_CANVAS && item.controller.textHold) return item.controller; + if (item && item.type === T_CELL && item.controller && item.controller.type && item.controller.type === T_CANVAS && item.controller.textHold) return item.controller; // For non-based Cells we have to make a recursive call to find the <canvas> host if (item && item.type === T_CELL && item.currentHost) return this.getCanvasTextHold(item.currentHost); diff --git a/source/scrawl.d.ts b/source/scrawl.d.ts index 513a1b8e..ad2e5917 100644 --- a/source/scrawl.d.ts +++ b/source/scrawl.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Scrawl-canvas 8.13.0 +// Type definitions for Scrawl-canvas 8.13.1 @@ -547,7 +547,6 @@ interface ShapeBasicMixinDeltaInputs extends EntityMixinDeltaInputs {} interface ShapeBasicMixinInputs extends EntityMixinInputs { boundingBoxColor?: string; - constantPathSpeed?: boolean; minimumBoundingBoxDimensions?: number; pathDefinition?: string; precision?: number; @@ -1321,6 +1320,7 @@ interface EnhancedLabelFactoryInputs extends BaseMixinInputs, DeltaMixinInputs, cacheOutput?: boolean; calculateOrder?: number; checkHitUseTemplate?: boolean; + constantSpeedAlongPath?: boolean; delta?: EnhancedLabelFactoryDeltaInputs; dimensions?: CommonTwoElementArrayInput; flipReverse?: boolean; @@ -1638,6 +1638,7 @@ interface GroupFactoryFunctions extends BaseMixinFunctions, FilterMixinFunctions getArtefact: (name: string) => ArtefactInstance; getArtefactAt: (items: HitTests) => HitOutput | boolean; getArtefactNames: () => string[]; + killArtefacts: () => void; moveArtefactsIntoGroup: (...args: GroupArtifactsInput) => GroupInstance; removeArtefactClasses: (item: string) => GroupInstance; removeArtefacts: (...args: GroupArtifactsInput) => GroupInstance; @@ -1769,7 +1770,7 @@ interface LoomFactoryDeltaInputs extends BaseMixinDeltaInputs, AnchorMixinDeltaI interface LoomFactoryInputs extends BaseMixinInputs, AnchorMixinInputs, ButtonMixinInputs, DeltaMixinInputs, StateFactoryInputs, LoomFactoryDeltaInputs { boundingBoxColor?: string; - constantPathSpeed?: boolean; + constantSpeedAlongPath?: boolean; delta?: LoomFactoryDeltaInputs; fromPath?: ShapeBasedInstance | string; group?: GroupInstance | string; @@ -3244,6 +3245,7 @@ export function findArtefact(item: string): ArtefactInstance; export function findAsset(item: string): AssetInstance; export function findEntity(item: string): EntityInstance; export function findCanvas(item: string): CanvasInstance; +export function findCell(item: string): CellInstance; export function findStyles(item: string): StylesInstance; export function findTween(item: string): TweenInstance; export function findFilter(item: string): FilterInstance; diff --git a/source/scrawl.js b/source/scrawl.js index 03acf6c6..84f22c47 100644 --- a/source/scrawl.js +++ b/source/scrawl.js @@ -1,6 +1,6 @@ // # Scrawl-canvas // -// #### Version 8.13.0 - 27 April 2024 +// #### Version 8.13.1 - 3 May 2024 // ## Initialize Scrawl-canvas @@ -34,6 +34,7 @@ export { findArtefact, findAsset, findCanvas, + findCell, findElement, findEntity, findFilter, diff --git a/yarn.lock b/yarn.lock index 43dc5416..f451dc4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4025,8 +4025,8 @@ __metadata: linkType: hard "tar@npm:^6.1.11, tar@npm:^6.1.2": - version: 6.2.0 - resolution: "tar@npm:6.2.0" + version: 6.2.1 + resolution: "tar@npm:6.2.1" dependencies: chownr: "npm:^2.0.0" fs-minipass: "npm:^2.0.0" @@ -4034,7 +4034,7 @@ __metadata: minizlib: "npm:^2.1.1" mkdirp: "npm:^1.0.3" yallist: "npm:^4.0.0" - checksum: 02ca064a1a6b4521fef88c07d389ac0936730091f8c02d30ea60d472e0378768e870769ab9e986d87807bfee5654359cf29ff4372746cc65e30cbddc352660d8 + checksum: a5eca3eb50bc11552d453488344e6507156b9193efd7635e98e867fab275d527af53d8866e2370cd09dfe74378a18111622ace35af6a608e5223a7d27fe99537 languageName: node linkType: hard