From b31af6f1529e4d8c89a0daea03632697741d0725 Mon Sep 17 00:00:00 2001 From: abaicus Date: Thu, 19 Nov 2026 10:13:11 +0200 Subject: [PATCH 01/30] fix: keep theme typography on Atomic Wind blocks (#3185) Co-Authored-By: Claude Fable 5.2 --- inc/plugins/class-atomic-wind-blocks.php | 2 +- src/atomic-wind/tailwind/scope-css.js | 31 +++-- .../tailwind/test/scope-css.tailwind.test.js | 111 ++++++++++++++++++ .../tailwind/test/scope-css.test.js | 76 +++++++++++- tests/test-atomic-wind-blocks.php | 14 +++ 5 files changed, 221 insertions(+), 13 deletions(-) create mode 100644 src/atomic-wind/tailwind/test/scope-css.tailwind.test.js diff --git a/inc/plugins/class-atomic-wind-blocks.php b/inc/plugins/class-atomic-wind-blocks.php index 2b857b493..66243f453 100644 --- a/inc/plugins/class-atomic-wind-blocks.php +++ b/inc/plugins/class-atomic-wind-blocks.php @@ -20,7 +20,7 @@ class Atomic_Wind_Blocks { * * @var string */ - const ATOMIC_WIND_CSS_VERSION = '1.0.1'; + const ATOMIC_WIND_CSS_VERSION = '1.0.2'; /** * Whether we are currently inside a query loop render. diff --git a/src/atomic-wind/tailwind/scope-css.js b/src/atomic-wind/tailwind/scope-css.js index aed313059..d90992f78 100644 --- a/src/atomic-wind/tailwind/scope-css.js +++ b/src/atomic-wind/tailwind/scope-css.js @@ -15,6 +15,9 @@ const OPAQUE_AT_RULE = /^@(-[a-z]+-)?(keyframes|font-face|property|counter-style // Document-level subjects: they carry inherited defaults, not element resets. const ROOT_SELECTOR = /^(:root|:host|html|body)$/; +const CUSTOM_PROPERTY_DECLARATION = /(^|;)\s*--[\w-]+\s*:/; +const CSS_COMMENT = /\/\*[\s\S]*?\*\//g; + const ROOT_PREFIX = /^(:root|:host|html|body)(?=$|[\s>+~])/; const LEGACY_PSEUDO_ELEMENT = /^:(before|after|first-line|first-letter)\b/i; @@ -140,6 +143,16 @@ function pseudoElementStart( subject ) { return -1; } +/** + * Whether a selector targets only the document root. + * + * @param {string} selector Single selector. + * @return {boolean} True for a bare `:root`, `:host`, `html` or `body`. + */ +function isRootOnly( selector ) { + return 0 === subjectStart( selector ) && ROOT_SELECTOR.test( selector ); +} + /** * Confine one selector to the Atomic Wind subtree. * @@ -147,13 +160,13 @@ function pseudoElementStart( subject ) { * @return {string} Scoped selector. */ function scopeSelectorToBlocks( selector ) { - const start = subjectStart( selector ); - const subject = selector.slice( start ); - - if ( 0 === start && ROOT_SELECTOR.test( subject ) ) { + if ( isRootOnly( selector ) ) { return ATOMIC_SELF; } + const start = subjectStart( selector ); + const subject = selector.slice( start ); + const prefix = selector.slice( 0, start ); const pseudo = pseudoElementStart( subject ); const base = -1 === pseudo ? subject : subject.slice( 0, pseudo ); @@ -309,7 +322,7 @@ export function transformCssSelectors( css, transform ) { } /** - * Keep Tailwind's element resets and variables inside Atomic Wind blocks. + * Keep Tailwind's element resets and variables inside Atomic Wind blocks, dropping root-inherited defaults. * * @param {string} css Generated stylesheet. * @return {string} Scoped stylesheet. @@ -319,8 +332,12 @@ export function scopeToAtomicWind( css ) { return css; } - return transformCssSelectors( css, ( selectorText ) => { - const scoped = splitSelectorList( selectorText ).map( scopeSelectorToBlocks ); + return transformCssSelectors( css, ( selectorText, body ) => { + const declaresVariables = CUSTOM_PROPERTY_DECLARATION.test( body.replace( CSS_COMMENT, '' ) ); + const scoped = splitSelectorList( selectorText ) + // Set on the wrapper, inherited defaults would beat what the block inherits from the theme. + .filter( ( selector ) => declaresVariables || ! isRootOnly( selector ) ) + .map( scopeSelectorToBlocks ); return Array.from( new Set( scoped ) ).join( ', ' ); } ); diff --git a/src/atomic-wind/tailwind/test/scope-css.tailwind.test.js b/src/atomic-wind/tailwind/test/scope-css.tailwind.test.js new file mode 100644 index 000000000..939ec5f86 --- /dev/null +++ b/src/atomic-wind/tailwind/test/scope-css.tailwind.test.js @@ -0,0 +1,111 @@ +const fs = require( 'fs' ); +const path = require( 'path' ); +const { compile } = require( 'tailwindcss' ); +const { scopeToAtomicWind, splitSelectorList, transformCssSelectors } = require( '../scope-css' ); + +const WRAPPER = ':where([class*="wp-block-atomic-wind-"])'; + +const packageDir = path.dirname( require.resolve( 'tailwindcss/package.json' ) ); +const stylesheetFiles = { + tailwindcss: 'index.css', + 'tailwindcss/preflight': 'preflight.css', + 'tailwindcss/preflight.css': 'preflight.css', + './preflight.css': 'preflight.css', + 'tailwindcss/theme': 'theme.css', + 'tailwindcss/theme.css': 'theme.css', + './theme.css': 'theme.css', + 'tailwindcss/utilities': 'utilities.css', + 'tailwindcss/utilities.css': 'utilities.css', + './utilities.css': 'utilities.css', +}; + +async function loadStylesheet( id, base ) { + const file = stylesheetFiles[ id ]; + if ( ! file ) { + throw new Error( `Unsupported @import "${ id }"` ); + } + return { + path: `virtual:tailwindcss/${ file }`, + base, + content: fs.readFileSync( path.join( packageDir, file ), 'utf8' ), + }; +} + +async function loadModule() { + throw new Error( 'Plugins and config files are not supported.' ); +} + +function collectRules( css ) { + const rules = []; + transformCssSelectors( css, ( selector, body ) => { + rules.push( { selector, body } ); + return selector; + } ); + return rules; +} + +describe( 'scopeToAtomicWind against the real Tailwind compiler', () => { + let raw; + let rawRules; + let scopedRules; + + beforeAll( async () => { + const compiler = await compile( '@import "tailwindcss" important;\n', { base: '/', loadStylesheet, loadModule } ); + raw = compiler.build( [ 'flex', 'mt-4', 'font-serif', 'leading-10', 'text-lg' ] ); + rawRules = collectRules( raw ); + scopedRules = collectRules( scopeToAtomicWind( raw ) ); + } ); + + it( 'the compiler still emits the root typography rule this guards against', () => { + const rule = rawRules.find( + ( { selector, body } ) => + splitSelectorList( selector ).includes( 'html' ) && /font-family\s*:/.test( body ) && /line-height\s*:/.test( body ) + ); + + expect( rule ).toBeDefined(); + } ); + + it( 'puts no standard declaration on the block wrapper', () => { + const wrapperRules = scopedRules.filter( ( { selector } ) => selector === WRAPPER ); + + expect( wrapperRules.length ).toBeGreaterThan( 0 ); + const offenders = wrapperRules.flatMap( ( { body } ) => + body + .replace( /\/\*[\s\S]*?\*\//g, '' ) + .split( ';' ) + .map( ( declaration ) => declaration.trim() ) + .filter( ( declaration ) => declaration && ! /^--[\w-]+\s*:/.test( declaration ) ) + ); + + expect( offenders ).toEqual( [] ); + } ); + + it( 'keeps theme variables on the block wrapper', () => { + const wrapperBodies = scopedRules.filter( ( { selector } ) => selector === WRAPPER ).map( ( { body } ) => body ); + + expect( wrapperBodies.some( ( body ) => /--spacing\s*:/.test( body ) ) ).toBe( true ); + expect( wrapperBodies.some( ( body ) => /--font-serif\s*:/.test( body ) ) ).toBe( true ); + } ); + + it( 'leaves no document-root selector in the stylesheet', () => { + const roots = scopedRules.flatMap( ( { selector } ) => splitSelectorList( selector ) ).filter( ( selector ) => /^(:root|:host|html|body)$/.test( selector ) ); + + expect( roots ).toEqual( [] ); + } ); + + it( 'keeps the typography utilities', () => { + const serif = scopedRules.find( ( { selector } ) => selector.startsWith( '.font-serif:where(' ) ); + const leading = scopedRules.find( ( { selector } ) => selector.startsWith( '.leading-10:where(' ) ); + + expect( serif && serif.body ).toMatch( /font-family\s*:/ ); + expect( leading && leading.body ).toMatch( /line-height\s*:/ ); + } ); + + it( 'keeps element resets scoped to the blocks', () => { + const found = scopedRules.some( ( { selector } ) => + splitSelectorList( selector ).some( ( part ) => part.startsWith( 'h1:where([class*="wp-block-atomic-wind-"]' ) ) + ); + + expect( found ).toBe( true ); + } ); +} ); diff --git a/src/atomic-wind/tailwind/test/scope-css.test.js b/src/atomic-wind/tailwind/test/scope-css.test.js index bdc898bec..228f6842a 100644 --- a/src/atomic-wind/tailwind/test/scope-css.test.js +++ b/src/atomic-wind/tailwind/test/scope-css.test.js @@ -52,10 +52,8 @@ describe( 'scopeToAtomicWind', () => { ); } ); - it( 'moves document-level styling onto the block wrapper', () => { - expect( scopeToAtomicWind( 'html, :host{line-height:1.5;tab-size:4}' ) ).toBe( - `${ SELF }{line-height:1.5;tab-size:4}` - ); + it( 'drops document-level inherited styling instead of moving it onto the block wrapper', () => { + expect( scopeToAtomicWind( 'html, :host{line-height:1.5;tab-size:4}' ) ).toBe( '' ); } ); it( 'moves theme variables onto the block wrapper so they cannot shadow theme ones', () => { @@ -144,7 +142,7 @@ describe( 'scopeToAtomicWind', () => { // Every base-layer rule is confined to the blocks. expect( out ).toContain( `*${ MATCH }, *${ MATCH }::before{box-sizing:border-box;margin:0}` ); - expect( out ).toContain( `${ SELF }{line-height:1.5}` ); + expect( out ).not.toContain( 'line-height' ); expect( out ).toContain( `ul${ MATCH }, menu${ MATCH }{list-style:none}` ); expect( out ).toContain( `input:where([type="button"])${ MATCH }::file-selector-button{appearance:button}` ); @@ -155,9 +153,77 @@ describe( 'scopeToAtomicWind', () => { it( 'is a no-op on empty input', () => { expect( scopeToAtomicWind( '' ) ).toBe( '' ); } ); + + it( 'drops the minified preflight root rule, whose values only reference variables', () => { + const css = 'html, :host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}'; + + expect( scopeToAtomicWind( css ) ).toBe( '' ); + } ); + + it( 'drops the pretty-printed preflight root rule', () => { + const css = 'html, :host {\n line-height: 1.5;\n font-family: var(--default-font-family, ui-sans-serif);\n}'; + + expect( scopeToAtomicWind( css ) ).toBe( '' ); + } ); + + it.each( [ 'html', 'body', ':root', ':host' ] )( 'drops a %s rule that declares no custom property', ( root ) => { + expect( scopeToAtomicWind( `${ root }{font-family:serif}` ) ).toBe( '' ); + } ); + + it( 'keeps pretty-printed theme variables on the block wrapper', () => { + expect( scopeToAtomicWind( ':root, :host {\n --spacing: 0.25rem;\n --font-serif: ui-serif, Georgia;\n}' ) ).toBe( + `${ SELF }{\n --spacing: 0.25rem;\n --font-serif: ui-serif, Georgia;\n}` + ); + } ); + + it( 'keeps a root rule whole when it mixes variables with standard declarations', () => { + expect( scopeToAtomicWind( ':root{color:red;--x:1}' ) ).toBe( `${ SELF }{color:red;--x:1}` ); + } ); + + it( 'drops only the root selector from a mixed selector list', () => { + expect( scopeToAtomicWind( 'html, h1{line-height:1.5}' ) ).toBe( `h1${ MATCH }{line-height:1.5}` ); + } ); + + it( 'keeps the root selector in a mixed list that declares variables', () => { + expect( scopeToAtomicWind( ':root, .dark{--x:1}' ) ).toBe( `${ SELF }, .dark${ MATCH }{--x:1}` ); + } ); + + it( 'drops root typography inside at-rules and keeps sibling rules', () => { + expect( scopeToAtomicWind( '@layer base{html, :host{line-height:1.5}h1{font-size:inherit}}' ) ).toBe( + `@layer base{h1${ MATCH }{font-size:inherit}}` + ); + expect( scopeToAtomicWind( '@media (width >= 48rem){html{line-height:2}}' ) ).toBe( '@media (width >= 48rem){}' ); + } ); + + it( 'still scopes typography rules that use a root as an ancestor', () => { + expect( scopeToAtomicWind( 'body p{font-family:serif}' ) ).toBe( `body p${ MATCH }{font-family:serif}` ); + } ); + + it( 'keeps typography utilities set on the block itself', () => { + expect( scopeToAtomicWind( '.font-serif{font-family:var(--font-serif) !important}.leading-10{line-height:2.5rem !important}' ) ).toBe( + `.font-serif${ MATCH }{font-family:var(--font-serif) !important}.leading-10${ MATCH }{line-height:2.5rem !important}` + ); + } ); + + it( 'detects variables declared after a comment', () => { + expect( scopeToAtomicWind( ':root{/* theme */--x:1}' ) ).toBe( `${ SELF }{/* theme */--x:1}` ); + expect( scopeToAtomicWind( ':root{--a:1;/* c */--x:1}' ) ).toBe( `${ SELF }{--a:1;/* c */--x:1}` ); + } ); + + it( 'does not count a variable that only appears in a comment', () => { + expect( scopeToAtomicWind( 'html{/* --x: 1 */line-height:1.5}' ) ).toBe( '' ); + } ); } ); describe( 'prefixCss', () => { + it( 'prefixes a scoped stylesheet without reintroducing root typography', () => { + const scoped = scopeToAtomicWind( 'html, :host{line-height:1.5}:root, :host{--spacing:0.25rem}h1{font-size:inherit}' ); + + expect( prefixCss( scoped, ':where(.editor-styles-wrapper)' ) ).toBe( + `:where(.editor-styles-wrapper) ${ SELF }{--spacing:0.25rem}:where(.editor-styles-wrapper) h1${ MATCH }{font-size:inherit}` + ); + } ); + it( 'prefixes selectors and collapses document-level ones onto the scope', () => { expect( prefixCss( 'h1{color:red}html{tab-size:4}', ':where(.editor-styles-wrapper)' ) ).toBe( ':where(.editor-styles-wrapper) h1{color:red}:where(.editor-styles-wrapper){tab-size:4}' diff --git a/tests/test-atomic-wind-blocks.php b/tests/test-atomic-wind-blocks.php index f38665eca..e7cf8816d 100644 --- a/tests/test-atomic-wind-blocks.php +++ b/tests/test-atomic-wind-blocks.php @@ -1540,6 +1540,20 @@ public function test_output_singular_css_regenerates_css_from_an_older_generator $this->assertTrue( wp_script_is( 'atomic-wind-tailwind-generator', 'enqueued' ) ); } + public function test_output_singular_css_regenerates_css_stamped_by_the_previous_generator() { + $this->reset_style_globals(); + + $singular = $this->make_atomic_wind_post( 'flex' ); + update_post_meta( $singular, '_atomic_wind_css', '.flex{display:flex}' ); + update_post_meta( $singular, '_atomic_wind_css_version', '1.0.1' ); + + $this->go_to( get_permalink( $singular ) ); + $this->instance->output_singular_css(); + + $this->assertSame( '', $this->inline_style_for( 'atomic-wind-tailwind' ) ); + $this->assertTrue( wp_script_is( 'atomic-wind-tailwind-generator', 'enqueued' ) ); + } + public function test_rest_save_style_stamps_the_generator_version() { $request = new WP_REST_Request( 'POST', '/otter/v1/atomic-wind/style' ); $request->set_param( 'postId', $this->post_id ); From 7f19795795379b731154f69ae3d5fa9f75483445 Mon Sep 17 00:00:00 2001 From: abaicus Date: Thu, 19 Nov 2026 10:33:57 +0200 Subject: [PATCH 02/30] test: cover Atomic Wind typography inheritance in e2e (#3185) Co-Authored-By: Claude Fable 5.2 --- .../e2e/blocks/atomic-wind-css-scope.spec.js | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) diff --git a/src/blocks/test/e2e/blocks/atomic-wind-css-scope.spec.js b/src/blocks/test/e2e/blocks/atomic-wind-css-scope.spec.js index 52a320666..078cabe61 100644 --- a/src/blocks/test/e2e/blocks/atomic-wind-css-scope.spec.js +++ b/src/blocks/test/e2e/blocks/atomic-wind-css-scope.spec.js @@ -5,6 +5,78 @@ import { test, expect } from '../fixtures'; import { setAtomicWind } from '../helpers/design-library'; import { publishAndViewPost } from '../helpers/editor'; +const boxMarkup = ( className, children ) => + `
${ children }
`; + +const textMarkup = ( className, content ) => + `${ content }`; + +const TYPOGRAPHY_CONTENT = boxMarkup( 'typo-parent font-serif leading-10', textMarkup( 'typo-child', 'Child' ) + textMarkup( 'typo-own font-mono', 'Own' ) ); + +const lineHeightRatio = ( locator, relativeToRoot = false ) => locator.evaluate( ( el, toRoot ) => { + const style = window.getComputedStyle( el ); + const base = toRoot ? window.getComputedStyle( el.ownerDocument.documentElement ) : style; + + return parseFloat( style.lineHeight ) / parseFloat( base.fontSize ); +}, relativeToRoot ); + +/** + * Load a post as the editor so the style builder caches its compiled CSS. + * + * @param {import('@playwright/test').Page} page Page. + * @param {string} link Post URL. + */ +const cachePostCss = async( page, link ) => { + await page.addInitScript( () => { + document.addEventListener( 'atomic-wind:css-saved', () => { + window.otterE2ECssSaved = true; + }); + }); + await page.goto( link ); + await page.waitForFunction( () => window.otterE2ECssSaved ); +}; + +/** + * @param {import('@playwright/test').Browser} browser Browser. + * @param {string} url Page to open logged out. + * @return {Promise} Visitor page. + */ +const openAsVisitor = async( browser, url ) => { + const visitor = await browser.newPage({ storageState: { cookies: [], origins: [] }}); + await visitor.goto( url ); + await expect( visitor.locator( '#wpadminbar' ) ).toHaveCount( 0 ); + + return visitor; +}; + +/** + * @param {import('@wordpress/e2e-test-utils-playwright').RequestUtils} requestUtils Request utils. + * @param {Array<{ id: number }>} posts Posts to delete. + */ +const deletePosts = ( requestUtils, posts ) => Promise.all( posts.map( ( post ) => requestUtils.rest({ + method: 'DELETE', + path: `/wp/v2/posts/${ post.id }`, + params: { force: true } +}) ) ); + +/** + * @param {import('@playwright/test').Page|import('@playwright/test').FrameLocator} root Page or editor canvas. + */ +const expectInheritedTypography = async( root ) => { + const parent = root.locator( '.typo-parent' ); + const child = root.locator( '.typo-child' ); + + // The parent utilities landing proves the stylesheet reached the page. + await expect( parent ).toHaveCSS( 'font-family', /^ui-serif/ ); + await expect.poll( () => lineHeightRatio( parent, true ) ).toBeCloseTo( 2.5, 1 ); + + await expect( child ).toHaveCSS( 'font-family', /^ui-serif/ ); + const parentLineHeight = await parent.evaluate( ( el ) => window.getComputedStyle( el ).lineHeight ); + await expect( child ).toHaveCSS( 'line-height', parentLineHeight ); + + await expect( root.locator( '.typo-own' ) ).toHaveCSS( 'font-family', /^ui-monospace/ ); +}; + /** * The generated Tailwind stylesheet carries preflight, whose rules target bare * HTML elements, and a theme layer defining variables such as `--spacing`. It @@ -128,3 +200,86 @@ test.describe( 'Atomic Wind Tailwind CSS scope', () => { await expect( page.locator( '.outside-text' ) ).toHaveCSS( 'display', 'block' ); }); }); + +test.describe( 'Atomic Wind typography inheritance', () => { + test.beforeEach( async({ otterUtils }) => { + await setAtomicWind( otterUtils, true ); + }); + + test.afterAll( async({ otterUtils }) => { + await setAtomicWind( otterUtils, false ); + }); + + test( 'inherits typography from a theme-styled ancestor on the frontend', async({ page, requestUtils }) => { + const post = await requestUtils.createPost({ + title: 'Atomic Wind theme typography', + status: 'publish', + content: `
${ boxMarkup( 'typo-theme-box flex', textMarkup( 'typo-theme', 'Theme text' ) ) }
` + }); + + try { + await page.goto( post.link ); + await expect( page.locator( '.typo-theme-box' ) ).toHaveCSS( 'display', 'flex' ); + + await page.addStyleTag({ content: '.typo-theme-wrap{font-family:"Otter Theme Font",serif;line-height:3}' }); + + await expect( page.locator( '.typo-theme' ) ).toHaveCSS( 'font-family', /Otter Theme Font/ ); + await expect( page.locator( '.typo-theme-box' ) ).toHaveCSS( 'font-family', /Otter Theme Font/ ); + await expect.poll( () => lineHeightRatio( page.locator( '.typo-theme' ) ) ).toBeCloseTo( 3, 1 ); + } finally { + await deletePosts( requestUtils, [ post ] ); + } + }); + + test( 'inherits a parent block typography on the frontend', async({ page, requestUtils }) => { + const post = await requestUtils.createPost({ + title: 'Atomic Wind parent typography', + status: 'publish', + content: TYPOGRAPHY_CONTENT + }); + + try { + await page.goto( post.link ); + await expectInheritedTypography( page ); + } finally { + await deletePosts( requestUtils, [ post ] ); + } + }); + + test( 'inherits a parent block typography from the cached stylesheet', async({ browser, page, requestUtils }) => { + const post = await requestUtils.createPost({ + title: 'Atomic Wind cached typography', + status: 'publish', + content: TYPOGRAPHY_CONTENT + }); + + let visitor; + + try { + await cachePostCss( page, post.link ); + visitor = await openAsVisitor( browser, post.link ); + + await expect( visitor.locator( '#atomic-wind-tailwind-generator-js' ) ).toHaveCount( 0 ); + await expect( visitor.locator( '#atomic-wind-tailwind-inline-css' ) ).toHaveCount( 1 ); + await expectInheritedTypography( visitor ); + } finally { + await visitor?.close(); + await deletePosts( requestUtils, [ post ] ); + } + }); + + test( 'inherits a parent block typography in the editor', async({ admin, editor }) => { + await admin.createNewPost(); + + await editor.insertBlock({ + name: 'atomic-wind/box', + attributes: { className: 'typo-parent font-serif leading-10' }, + innerBlocks: [ + { name: 'atomic-wind/text', attributes: { tagName: 'span', className: 'typo-child', content: 'Child' }}, + { name: 'atomic-wind/text', attributes: { tagName: 'span', className: 'typo-own font-mono', content: 'Own' }} + ] + }); + + await expectInheritedTypography( editor.canvas ); + }); +}); From 1504168b7372bcd89aa38517455bec2219c58c4f Mon Sep 17 00:00:00 2001 From: abaicus Date: Thu, 19 Nov 2026 11:19:38 +0200 Subject: [PATCH 03/30] fix: keep non-typographic root defaults on Atomic Wind blocks (#3185) Co-Authored-By: Claude Fable 5.2 --- src/atomic-wind/tailwind/scope-css.js | 135 ++++++++++++++++-- .../tailwind/test/scope-css.tailwind.test.js | 77 ++++++++-- .../tailwind/test/scope-css.test.js | 95 ++++++++++-- 3 files changed, 276 insertions(+), 31 deletions(-) diff --git a/src/atomic-wind/tailwind/scope-css.js b/src/atomic-wind/tailwind/scope-css.js index d90992f78..e5caa46ef 100644 --- a/src/atomic-wind/tailwind/scope-css.js +++ b/src/atomic-wind/tailwind/scope-css.js @@ -15,8 +15,8 @@ const OPAQUE_AT_RULE = /^@(-[a-z]+-)?(keyframes|font-face|property|counter-style // Document-level subjects: they carry inherited defaults, not element resets. const ROOT_SELECTOR = /^(:root|:host|html|body)$/; -const CUSTOM_PROPERTY_DECLARATION = /(^|;)\s*--[\w-]+\s*:/; -const CSS_COMMENT = /\/\*[\s\S]*?\*\//g; +// Root defaults that are safe to repeat on every block wrapper; anything else must be inherited. +const WRAPPER_PROPERTY = /^(--.+|tab-size|(-webkit-)?text-size-adjust|-webkit-tap-highlight-color)$/; const ROOT_PREFIX = /^(:root|:host|html|body)(?=$|[\s>+~])/; @@ -237,7 +237,7 @@ function blockEnd( css, open ) { /** * Rewrite every style-rule selector in a stylesheet. * - * A falsy return from `transform` drops the rule. + * `transform` returns the selector list, a falsy value to drop the rule, or `[ selector, body ]` pairs to emit in its place. * * @param {string} css Stylesheet text. * @param {Function} transform Receives the selector list and the declaration block. @@ -291,9 +291,13 @@ export function transformCssSelectors( css, transform ) { const inner = OPAQUE_AT_RULE.test( trimmed ) ? body : transformCssSelectors( body, transform ); out += `${ trimmed }{${ inner }}`; } else { - const selector = transform( trimmed, body ); - if ( selector ) { - out += `${ selector }{${ body }}`; + const result = transform( trimmed, body ); + const rules = Array.isArray( result ) ? result : [[ result, body ]]; + + for ( const [ selector, ruleBody ] of rules ) { + if ( selector ) { + out += `${ selector }{${ ruleBody }}`; + } } } @@ -322,7 +326,92 @@ export function transformCssSelectors( css, transform ) { } /** - * Keep Tailwind's element resets and variables inside Atomic Wind blocks, dropping root-inherited defaults. + * Split a declaration block on top-level semicolons, dropping comments. + * + * @param {string} body Declaration block. + * @return {string[]} The declarations, without comments. + */ +function splitDeclarations( body ) { + const parts = []; + let part = ''; + let depth = 0; + let quote = ''; + + for ( let i = 0; i < body.length; i++ ) { + const char = body[ i ]; + + if ( '\\' === char ) { + part += body.slice( i, i + 2 ); + i++; + continue; + } + + if ( quote ) { + if ( char === quote ) { + quote = ''; + } + part += char; + continue; + } + + if ( 0 === depth && '/' === char && '*' === body[ i + 1 ] ) { + const end = body.indexOf( '*/', i + 2 ); + i = -1 === end ? body.length : end + 1; + continue; + } + + if ( ';' === char && 0 === depth ) { + parts.push( part ); + part = ''; + continue; + } + + if ( '"' === char || '\'' === char ) { + quote = char; + } else if ( '(' === char || '[' === char || '{' === char ) { + depth++; + } else if ( ')' === char || ']' === char || '}' === char ) { + depth = Math.max( 0, depth - 1 ); + } + + part += char; + } + + parts.push( part ); + + return parts; +} + +/** + * Reduce a declaration block to the declarations a block wrapper may carry. + * + * @param {string} body Declaration block. + * @return {string} The original body when nothing is removed, else the kept declarations ('' when none). + */ +function wrapperDeclarations( body ) { + const parts = splitDeclarations( body ); + + const kept = parts.filter( ( part ) => { + const declaration = part.trim(); + + if ( ! declaration ) { + return true; + } + + const colon = declaration.indexOf( ':' ); + + return -1 !== colon && WRAPPER_PROPERTY.test( declaration.slice( 0, colon ).trim().toLowerCase() ); + } ); + + if ( kept.length === parts.length ) { + return body; + } + + return kept.some( ( part ) => part.trim() ) ? kept.join( ';' ) : ''; +} + +/** + * Keep Tailwind's element resets and variables inside Atomic Wind blocks, leaving inherited typography to the theme. * * @param {string} css Generated stylesheet. * @return {string} Scoped stylesheet. @@ -333,13 +422,33 @@ export function scopeToAtomicWind( css ) { } return transformCssSelectors( css, ( selectorText, body ) => { - const declaresVariables = CUSTOM_PROPERTY_DECLARATION.test( body.replace( CSS_COMMENT, '' ) ); - const scoped = splitSelectorList( selectorText ) - // Set on the wrapper, inherited defaults would beat what the block inherits from the theme. - .filter( ( selector ) => declaresVariables || ! isRootOnly( selector ) ) - .map( scopeSelectorToBlocks ); + const selectors = splitSelectorList( selectorText ); + const scope = ( list ) => Array.from( new Set( list.map( scopeSelectorToBlocks ) ) ).join( ', ' ); + + if ( ! selectors.some( isRootOnly ) ) { + return scope( selectors ); + } + + // Set on the wrapper, inherited defaults would beat what the block inherits from the theme. + const kept = wrapperDeclarations( body ); + + if ( kept === body ) { + return scope( selectors ); + } + + const rules = []; + + if ( kept ) { + rules.push( [ ATOMIC_SELF, kept ] ); + } + + const others = selectors.filter( ( selector ) => ! isRootOnly( selector ) ); + + if ( others.length ) { + rules.push( [ scope( others ), body ] ); + } - return Array.from( new Set( scoped ) ).join( ', ' ); + return rules; } ); } diff --git a/src/atomic-wind/tailwind/test/scope-css.tailwind.test.js b/src/atomic-wind/tailwind/test/scope-css.tailwind.test.js index 939ec5f86..e62c6f208 100644 --- a/src/atomic-wind/tailwind/test/scope-css.tailwind.test.js +++ b/src/atomic-wind/tailwind/test/scope-css.tailwind.test.js @@ -1,7 +1,7 @@ const fs = require( 'fs' ); const path = require( 'path' ); const { compile } = require( 'tailwindcss' ); -const { scopeToAtomicWind, splitSelectorList, transformCssSelectors } = require( '../scope-css' ); +const { prefixCss, scopeToAtomicWind, splitSelectorList, transformCssSelectors } = require( '../scope-css' ); const WRAPPER = ':where([class*="wp-block-atomic-wind-"])'; @@ -44,6 +44,18 @@ function collectRules( css ) { return rules; } +function declarationNames( body ) { + return body + .replace( /\/\*[\s\S]*?\*\//g, '' ) + .split( ';' ) + .map( ( declaration ) => declaration.trim() ) + .filter( Boolean ) + .map( ( declaration ) => declaration.slice( 0, declaration.indexOf( ':' ) ).trim().toLowerCase() ); +} + +const WRAPPER_PROPERTY = /^(--.+|tab-size|(-webkit-)?text-size-adjust|-webkit-tap-highlight-color)$/; +const TYPOGRAPHY = [ 'font-family', 'font-feature-settings', 'font-variation-settings', 'line-height' ]; + describe( 'scopeToAtomicWind against the real Tailwind compiler', () => { let raw; let rawRules; @@ -65,21 +77,68 @@ describe( 'scopeToAtomicWind against the real Tailwind compiler', () => { expect( rule ).toBeDefined(); } ); - it( 'puts no standard declaration on the block wrapper', () => { + it( 'puts only wrapper-safe declarations on the block wrapper', () => { const wrapperRules = scopedRules.filter( ( { selector } ) => selector === WRAPPER ); expect( wrapperRules.length ).toBeGreaterThan( 0 ); - const offenders = wrapperRules.flatMap( ( { body } ) => - body - .replace( /\/\*[\s\S]*?\*\//g, '' ) - .split( ';' ) - .map( ( declaration ) => declaration.trim() ) - .filter( ( declaration ) => declaration && ! /^--[\w-]+\s*:/.test( declaration ) ) - ); + const offenders = wrapperRules.flatMap( ( { body } ) => declarationNames( body ) ).filter( ( name ) => ! WRAPPER_PROPERTY.test( name ) ); expect( offenders ).toEqual( [] ); } ); + it( 'removes exactly the inherited typography from the root rule', () => { + const rawRule = rawRules.find( + ( { selector, body } ) => + splitSelectorList( selector ).includes( 'html' ) && /font-family\s*:/.test( body ) && /line-height\s*:/.test( body ) + ); + const wrapperRule = scopedRules.find( ( { selector, body } ) => selector === WRAPPER && /tab-size\s*:/.test( body ) ); + const rawNames = declarationNames( rawRule.body ); + const wrapperNames = declarationNames( wrapperRule.body ); + const removed = rawNames.filter( ( name ) => ! wrapperNames.includes( name ) ).sort(); + + expect( removed ).toEqual( TYPOGRAPHY ); + expect( wrapperNames.sort() ).toEqual( rawNames.filter( ( name ) => ! removed.includes( name ) ).sort() ); + } ); + + it( 'keeps the non-typographic root defaults on the block wrapper', () => { + const found = scopedRules + .filter( ( { selector } ) => selector === WRAPPER ) + .some( ( { body } ) => { + const names = declarationNames( body ); + return [ 'tab-size', '-webkit-text-size-adjust', '-webkit-tap-highlight-color' ].every( ( name ) => names.includes( name ) ); + } ); + + expect( found ).toBe( true ); + } ); + + describe.each( [ ':where(.editor-styles-wrapper)', ':where(.is-root-container)' ] )( 'prefixed for a non-iframe editor with %s', ( container ) => { + let prefixedRules; + + beforeAll( () => { + prefixedRules = collectRules( prefixCss( scopeToAtomicWind( raw ), container ) ); + } ); + + it( 'prefixes every rule with the container', () => { + const selectors = prefixedRules.flatMap( ( { selector } ) => splitSelectorList( selector ) ); + + expect( selectors.length ).toBeGreaterThan( 0 ); + expect( selectors.filter( ( selector ) => ! selector.startsWith( `${ container } ` ) ) ).toEqual( [] ); + } ); + + it( 'puts nothing on the container itself', () => { + const selectors = prefixedRules.flatMap( ( { selector } ) => splitSelectorList( selector ) ); + + expect( selectors.filter( ( selector ) => selector === container ) ).toEqual( [] ); + } ); + + it( 'keeps inherited typography off the block wrappers', () => { + const wrapperRules = prefixedRules.filter( ( { selector } ) => selector === `${ container } ${ WRAPPER }` ); + + expect( wrapperRules.length ).toBeGreaterThan( 0 ); + expect( wrapperRules.flatMap( ( { body } ) => declarationNames( body ) ).filter( ( name ) => TYPOGRAPHY.includes( name ) ) ).toEqual( [] ); + } ); + } ); + it( 'keeps theme variables on the block wrapper', () => { const wrapperBodies = scopedRules.filter( ( { selector } ) => selector === WRAPPER ).map( ( { body } ) => body ); diff --git a/src/atomic-wind/tailwind/test/scope-css.test.js b/src/atomic-wind/tailwind/test/scope-css.test.js index 228f6842a..db064fb54 100644 --- a/src/atomic-wind/tailwind/test/scope-css.test.js +++ b/src/atomic-wind/tailwind/test/scope-css.test.js @@ -1,4 +1,4 @@ -import { prefixCss, scopeToAtomicWind, splitSelectorList } from '../scope-css'; +import { prefixCss, scopeToAtomicWind, splitSelectorList, transformCssSelectors } from '../scope-css'; const MATCH = ':where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)'; const SELF = ':where([class*="wp-block-atomic-wind-"])'; @@ -52,8 +52,8 @@ describe( 'scopeToAtomicWind', () => { ); } ); - it( 'drops document-level inherited styling instead of moving it onto the block wrapper', () => { - expect( scopeToAtomicWind( 'html, :host{line-height:1.5;tab-size:4}' ) ).toBe( '' ); + it( 'keeps only wrapper-safe declarations of a document-level rule', () => { + expect( scopeToAtomicWind( 'html, :host{line-height:1.5;tab-size:4}' ) ).toBe( `${ SELF }{tab-size:4}` ); } ); it( 'moves theme variables onto the block wrapper so they cannot shadow theme ones', () => { @@ -154,19 +154,20 @@ describe( 'scopeToAtomicWind', () => { expect( scopeToAtomicWind( '' ) ).toBe( '' ); } ); - it( 'drops the minified preflight root rule, whose values only reference variables', () => { + it( 'strips the typography from the minified preflight root rule', () => { const css = 'html, :host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}'; - expect( scopeToAtomicWind( css ) ).toBe( '' ); + expect( scopeToAtomicWind( css ) ).toBe( `${ SELF }{-webkit-text-size-adjust:100%;tab-size:4;-webkit-tap-highlight-color:transparent}` ); } ); - it( 'drops the pretty-printed preflight root rule', () => { + it( 'drops typography from the pretty-printed preflight root rule', () => { const css = 'html, :host {\n line-height: 1.5;\n font-family: var(--default-font-family, ui-sans-serif);\n}'; expect( scopeToAtomicWind( css ) ).toBe( '' ); + expect( scopeToAtomicWind( 'html, :host {\n line-height: 1.5;\n tab-size: 4;\n}' ) ).toBe( `${ SELF }{\n tab-size: 4;\n}` ); } ); - it.each( [ 'html', 'body', ':root', ':host' ] )( 'drops a %s rule that declares no custom property', ( root ) => { + it.each( [ 'html', 'body', ':root', ':host' ] )( 'drops a %s rule that declares only typography', ( root ) => { expect( scopeToAtomicWind( `${ root }{font-family:serif}` ) ).toBe( '' ); } ); @@ -176,8 +177,57 @@ describe( 'scopeToAtomicWind', () => { ); } ); - it( 'keeps a root rule whole when it mixes variables with standard declarations', () => { - expect( scopeToAtomicWind( ':root{color:red;--x:1}' ) ).toBe( `${ SELF }{color:red;--x:1}` ); + it( 'drops standard declarations from a root rule that also declares variables', () => { + expect( scopeToAtomicWind( ':root{color:red;--x:1}' ) ).toBe( `${ SELF }{--x:1}` ); + } ); + + it( 'splits a mixed selector list when the root part loses declarations', () => { + expect( scopeToAtomicWind( 'html, h1{tab-size:4;line-height:1.5}' ) ).toBe( `${ SELF }{tab-size:4}h1${ MATCH }{tab-size:4;line-height:1.5}` ); + } ); + + it( 'keeps every wrapper-safe root default', () => { + expect( scopeToAtomicWind( 'body{-webkit-text-size-adjust:100%;text-size-adjust:100%;-webkit-tap-highlight-color:transparent;color:red}' ) ).toBe( + `${ SELF }{-webkit-text-size-adjust:100%;text-size-adjust:100%;-webkit-tap-highlight-color:transparent}` + ); + } ); + + it( 'matches property names case-insensitively', () => { + expect( scopeToAtomicWind( 'html{LINE-HEIGHT:1.5;TAB-SIZE:4}' ) ).toBe( `${ SELF }{TAB-SIZE:4}` ); + } ); + + it( 'does not split declarations on a semicolon inside a string', () => { + expect( scopeToAtomicWind( ':root{--x:"a;b";color:red}' ) ).toBe( `${ SELF }{--x:"a;b"}` ); + expect( scopeToAtomicWind( 'html{content:"a;--x:1"}' ) ).toBe( '' ); + } ); + + it( 'does not split declarations on a semicolon inside parentheses or brackets', () => { + expect( scopeToAtomicWind( ':root{--x:url(a;b);color:red;--y:[c;d]}' ) ).toBe( `${ SELF }{--x:url(a;b);--y:[c;d]}` ); + } ); + + it( 'does not split declarations on an escaped semicolon', () => { + expect( scopeToAtomicWind( ':root{--x:a\\;b;color:red}' ) ).toBe( `${ SELF }{--x:a\\;b}` ); + } ); + + it( 'keeps escaped and non-ASCII custom property names', () => { + expect( scopeToAtomicWind( ':root{--\\31 x:1;--é:2}' ) ).toBe( `${ SELF }{--\\31 x:1;--é:2}` ); + } ); + + it( 'drops the comments of a root rule it rewrites', () => { + expect( scopeToAtomicWind( 'html{/* note */line-height:1.5;tab-size:4}' ) ).toBe( `${ SELF }{tab-size:4}` ); + expect( scopeToAtomicWind( 'html{line-height:1.5;/* note */tab-size:4}' ) ).toBe( `${ SELF }{tab-size:4}` ); + } ); + + it( 'does not read a comment opener inside a string as a comment', () => { + expect( scopeToAtomicWind( ':root{--x:"/* not a comment */";color:red}' ) ).toBe( `${ SELF }{--x:"/* not a comment */"}` ); + expect( scopeToAtomicWind( ':root{--i:"/*";font-family:x;--j:"*/"}' ) ).toBe( `${ SELF }{--i:"/*";--j:"*/"}` ); + } ); + + it( 'does not read a comment opener inside url() as a comment', () => { + expect( scopeToAtomicWind( ':root{--a:url(/img/*.png);color:red;--b:url(/x/*/y)}' ) ).toBe( `${ SELF }{--a:url(/img/*.png);--b:url(/x/*/y)}` ); + } ); + + it( 'does not treat a variable referenced in a value as a declaration', () => { + expect( scopeToAtomicWind( 'html{font-family:var(--default-font-family, serif)}' ) ).toBe( '' ); } ); it( 'drops only the root selector from a mixed selector list', () => { @@ -193,6 +243,9 @@ describe( 'scopeToAtomicWind', () => { `@layer base{h1${ MATCH }{font-size:inherit}}` ); expect( scopeToAtomicWind( '@media (width >= 48rem){html{line-height:2}}' ) ).toBe( '@media (width >= 48rem){}' ); + expect( scopeToAtomicWind( '@layer base{html, :host{line-height:1.5;tab-size:4}h1{font-size:inherit}}' ) ).toBe( + `@layer base{${ SELF }{tab-size:4}h1${ MATCH }{font-size:inherit}}` + ); } ); it( 'still scopes typography rules that use a root as an ancestor', () => { @@ -216,6 +269,12 @@ describe( 'scopeToAtomicWind', () => { } ); describe( 'prefixCss', () => { + it( 'prefixes the wrapper-safe root defaults', () => { + expect( prefixCss( scopeToAtomicWind( 'html, :host{line-height:1.5;tab-size:4}' ), ':where(.editor-styles-wrapper)' ) ).toBe( + `:where(.editor-styles-wrapper) ${ SELF }{tab-size:4}` + ); + } ); + it( 'prefixes a scoped stylesheet without reintroducing root typography', () => { const scoped = scopeToAtomicWind( 'html, :host{line-height:1.5}:root, :host{--spacing:0.25rem}h1{font-size:inherit}' ); @@ -260,3 +319,21 @@ describe( 'prefixCss', () => { expect( prefixCss( 'h1{color:red}', '' ) ).toBe( 'h1{color:red}' ); } ); } ); + +describe( 'transformCssSelectors', () => { + it( 'emits the pairs a transform returns in place of the rule', () => { + expect( + transformCssSelectors( 'a{x:1}b{y:2}', ( selector, body ) => 'a' === selector ? [[ 'c', 'z:3' ], [ 'd', body ]] : selector ) + ).toBe( 'c{z:3}d{x:1}b{y:2}' ); + } ); + + it( 'drops the rule for an empty pair list and skips pairs without a selector', () => { + expect( + transformCssSelectors( 'a{x:1}b{y:2}', ( selector, body ) => 'a' === selector ? [] : [[ '', 'q:1' ], [ selector, body ]] ) + ).toBe( 'b{y:2}' ); + } ); + + it( 'still drops a rule on a falsy return', () => { + expect( transformCssSelectors( 'a{x:1}b{y:2}', ( selector ) => 'a' === selector ? '' : selector ) ).toBe( 'b{y:2}' ); + } ); +} ); From ed10a1bddefa3e0ebc9f6c1a2b7720d6bc6e0ebb Mon Sep 17 00:00:00 2001 From: abaicus Date: Thu, 19 Nov 2026 11:39:58 +0200 Subject: [PATCH 04/30] test: cover shipped patterns, themes and root defaults for Atomic Wind typography (#3185) Co-Authored-By: Claude Fable 5.2 --- .../e2e/blocks/atomic-wind-css-scope.spec.js | 125 +++++++++++++++++- 1 file changed, 124 insertions(+), 1 deletion(-) diff --git a/src/blocks/test/e2e/blocks/atomic-wind-css-scope.spec.js b/src/blocks/test/e2e/blocks/atomic-wind-css-scope.spec.js index 078cabe61..b495d6568 100644 --- a/src/blocks/test/e2e/blocks/atomic-wind-css-scope.spec.js +++ b/src/blocks/test/e2e/blocks/atomic-wind-css-scope.spec.js @@ -13,6 +13,8 @@ const textMarkup = ( className, content ) => const TYPOGRAPHY_CONTENT = boxMarkup( 'typo-parent font-serif leading-10', textMarkup( 'typo-child', 'Child' ) + textMarkup( 'typo-own font-mono', 'Own' ) ); +const THEMES = [ 'twentytwentyfive', 'twentytwentyone', 'raft' ]; + const lineHeightRatio = ( locator, relativeToRoot = false ) => locator.evaluate( ( el, toRoot ) => { const style = window.getComputedStyle( el ); const base = toRoot ? window.getComputedStyle( el.ownerDocument.documentElement ) : style; @@ -75,6 +77,12 @@ const expectInheritedTypography = async( root ) => { await expect( child ).toHaveCSS( 'line-height', parentLineHeight ); await expect( root.locator( '.typo-own' ) ).toHaveCSS( 'font-family', /^ui-monospace/ ); + + for ( const block of [ parent, child ] ) { + // Without the stylesheet `tab-size` computes to 8. + await expect( block ).toHaveCSS( 'tab-size', '4' ); + await expect( block ).toHaveCSS( '-webkit-tap-highlight-color', 'rgba(0, 0, 0, 0)' ); + } }; /** @@ -206,7 +214,8 @@ test.describe( 'Atomic Wind typography inheritance', () => { await setAtomicWind( otterUtils, true ); }); - test.afterAll( async({ otterUtils }) => { + test.afterAll( async({ otterUtils, requestUtils }) => { + await requestUtils.activateTheme( 'twentytwentythree' ); await setAtomicWind( otterUtils, false ); }); @@ -282,4 +291,118 @@ test.describe( 'Atomic Wind typography inheritance', () => { await expectInheritedTypography( editor.canvas ); }); + + test( 'renders the shipped patterns with the theme font and the root defaults', async({ page, requestUtils }) => { + const patterns = await requestUtils.rest({ path: '/wp/v2/block-patterns/patterns' }); + const shipped = patterns.filter( ( pattern ) => pattern.name.startsWith( 'otter-blocks/aw-' ) ); + + expect( shipped.length ).toBeGreaterThanOrEqual( 20 ); + + const content = shipped.map( ( pattern ) => { + const slug = pattern.name.replace( 'otter-blocks/', '' ); + + return `
${ pattern.content }
`; + }).join( '\n' ); + + const post = await requestUtils.createPost({ + title: 'Atomic Wind shipped patterns', + status: 'publish', + content + }); + + // Assumes the active theme's own font stack does not start with `ui-sans-serif`. + const inspect = () => page.evaluate( () => { + const offenders = []; + const empty = []; + const blocks = document.querySelectorAll( '.awp [class*="wp-block-atomic-wind-"]' ); + + for ( const el of blocks ) { + const style = window.getComputedStyle( el ); + const problems = []; + + if ( style.fontFamily.startsWith( 'ui-sans-serif' ) && ! el.closest( '[class~="font-sans"]' ) ) { + problems.push( 'default font stack' ); + } + + if ( '4' !== style.tabSize ) { + problems.push( `tab-size ${ style.tabSize }` ); + } + + if ( 'rgba(0, 0, 0, 0)' !== style.getPropertyValue( '-webkit-tap-highlight-color' ) ) { + problems.push( 'tap highlight' ); + } + + if ( problems.length ) { + const group = el.closest( '.awp' ); + const pattern = [ ...group.classList ].find( ( name ) => name.startsWith( 'aw-' ) ); + const classes = ( el.getAttribute( 'class' ) || '' ).split( ' ' ).slice( 0, 3 ).join( ' ' ); + offenders.push( `${ pattern } <${ el.tagName.toLowerCase() } class="${ classes }"> ${ problems.join( ', ' ) }` ); + } + } + + const groups = [ ...document.querySelectorAll( '.awp' ) ]; + + for ( const group of groups ) { + if ( ! group.querySelector( '[class*="wp-block-atomic-wind-"]' ) ) { + empty.push( [ ...group.classList ].find( ( name ) => name.startsWith( 'aw-' ) ) ); + } + } + + return { + count: blocks.length, + groups: groups.length, + empty, + total: offenders.length, + offenders: offenders.slice( 0, 10 ) + }; + }); + + try { + await page.goto( post.link ); + + await expect.poll( async() => { + const { total, offenders } = await inspect(); + return { total, offenders }; + }, { timeout: 30000 }).toEqual({ total: 0, offenders: [] }); + + const result = await inspect(); + expect( result.empty ).toEqual([]); + expect( result.groups ).toBe( shipped.length ); + expect( result.count ).toBeGreaterThan( 500 ); + } finally { + await deletePosts( requestUtils, [ post ] ); + } + }); + + for ( const theme of THEMES ) { + test( `matches a plain sibling's typography on ${ theme }`, async({ page, requestUtils }) => { + await requestUtils.activateTheme( theme ); + + const [ active ] = await requestUtils.rest({ path: '/wp/v2/themes', params: { status: 'active' }}); + expect( active.stylesheet ).toBe( theme ); + + const post = await requestUtils.createPost({ + title: `Atomic Wind ${ theme } typography`, + status: 'publish', + content: `
Control${ boxMarkup( 'typo-theme-box flex', textMarkup( 'typo-theme', 'Theme text' ) ) }
` + }); + + try { + await page.goto( post.link ); + await expect( page.locator( '.typo-theme-box' ) ).toHaveCSS( 'display', 'flex' ); + + const control = await page.locator( '.typo-control' ).evaluate( ( el ) => { + const style = window.getComputedStyle( el ); + + return { fontFamily: style.fontFamily, lineHeight: style.lineHeight }; + }); + + await expect( page.locator( '.typo-theme' ) ).toHaveCSS( 'font-family', control.fontFamily ); + await expect( page.locator( '.typo-theme' ) ).toHaveCSS( 'line-height', control.lineHeight ); + } finally { + await deletePosts( requestUtils, [ post ] ); + await requestUtils.activateTheme( 'twentytwentythree' ); + } + }); + } }); From 88f7db426246f4318159d07973de310feaa83dac Mon Sep 17 00:00:00 2001 From: Girish Panchal <79647963+girishpanchal30@users.noreply.github.com> Date: Thu, 19 Nov 2026 19:31:35 +0530 Subject: [PATCH 05/30] Validated block name type in dynamic content processing (#3184) * fix: validate block name type in dynamic content processing * fix: enhance visitor block escaping for unnamed blocks --- inc/plugins/class-dynamic-content.php | 8 ++++++-- tests/test-dynamic-content.php | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/inc/plugins/class-dynamic-content.php b/inc/plugins/class-dynamic-content.php index 12e5101ea..3bf3f9f3e 100644 --- a/inc/plugins/class-dynamic-content.php +++ b/inc/plugins/class-dynamic-content.php @@ -71,11 +71,15 @@ public function init() { /** * Protect rendered visitor values before the generic Magic Tag filters run. * - * @param string $content Rendered markup. - * @param array{blockName: string|null, attrs?: array{id?: string, idBase?: string}} $block Parsed block. + * @param string $content Rendered markup. + * @param array{blockName?: mixed, attrs?: array{id?: string, idBase?: string}} $block Parsed block. * @return string */ public function escape_visitor_block_magic_tags( $content, $block ) { + if ( ! isset( $block['blockName'] ) || ! is_string( $block['blockName'] ) ) { + return $content; + } + if ( 'core/term-description' === $block['blockName'] ) { return $this->escape_comment_magic_tags( $content ); } diff --git a/tests/test-dynamic-content.php b/tests/test-dynamic-content.php index c7bedd680..d3c2bddcc 100644 --- a/tests/test-dynamic-content.php +++ b/tests/test-dynamic-content.php @@ -2684,4 +2684,30 @@ public function test_sibling_post_content_tags_each_render(): void { $this->assertSame( 2, substr_count( $result, 'Sibling body' ) ); } + + public function test_unnamed_blocks_pass_visitor_escaping_without_notices(): void { + $freeform = parse_blocks( '

Example

' )[0]; + $this->assertNull( $freeform['blockName'] ); + + $blocks = array( + 'freeform' => $freeform, + 'missing key' => array( 'attrs' => array() ), + 'integer' => array( 'blockName' => 5 ), + 'array' => array( 'blockName' => array( 'core/search' ) ), + ); + foreach ( $blocks as $label => $block ) { + $captured = array(); + set_error_handler( + function ( int $errno, string $errstr ) use ( &$captured ): bool { + $captured[] = $errstr; + return true; + } + ); + $result = $this->dynamic_content->escape_visitor_block_magic_tags( '

Example

', $block ); + restore_error_handler(); + + $this->assertSame( array(), $captured, $label ); + $this->assertSame( '

Example

', $result, $label ); + } + } } From 4316f5d04d9b477af0e79dc662da2ba3cfabf084 Mon Sep 17 00:00:00 2001 From: abaicus Date: Thu, 19 Nov 2026 17:17:17 +0200 Subject: [PATCH 06/30] fix: migrate cached Atomic Wind stylesheets instead of discarding them (#3185) Co-Authored-By: Claude Fable 5.2 --- inc/plugins/class-atomic-wind-blocks.php | 145 +++++++++++++- src/atomic-wind/tailwind/scope-css.js | 4 +- tests/fixtures/atomic-wind/sheet-1.0.1.css | 137 ++++++++++++++ tests/fixtures/atomic-wind/sheet-1.0.2.css | 133 +++++++++++++ tests/test-atomic-wind-blocks.php | 210 ++++++++++++++++++++- 5 files changed, 620 insertions(+), 9 deletions(-) create mode 100644 tests/fixtures/atomic-wind/sheet-1.0.1.css create mode 100644 tests/fixtures/atomic-wind/sheet-1.0.2.css diff --git a/inc/plugins/class-atomic-wind-blocks.php b/inc/plugins/class-atomic-wind-blocks.php index 66243f453..357b0813a 100644 --- a/inc/plugins/class-atomic-wind-blocks.php +++ b/inc/plugins/class-atomic-wind-blocks.php @@ -22,6 +22,15 @@ class Atomic_Wind_Blocks { */ const ATOMIC_WIND_CSS_VERSION = '1.0.2'; + /** + * Stylesheet migrations, keyed by the version they upgrade from: [ next version, method ]. + * + * @var array + */ + const CSS_MIGRATIONS = array( + '1.0.1' => array( '1.0.2', 'remove_wrapper_typography' ), + ); + /** * Whether we are currently inside a query loop render. * @@ -835,19 +844,147 @@ public function rest_save_style( \WP_REST_Request $request ) { } /** - * Read cached CSS, ignoring stylesheets built by an older generator. + * Read cached CSS, upgrading older stylesheets in place and ignoring those that cannot be upgraded. * * @param int $post_id Post ID. * @return string */ private function get_cached_css( $post_id ) { - if ( self::ATOMIC_WIND_CSS_VERSION !== get_post_meta( $post_id, '_atomic_wind_css_version', true ) ) { + $version = get_post_meta( $post_id, '_atomic_wind_css_version', true ); + $css = get_post_meta( $post_id, '_atomic_wind_css', true ); + + if ( ! is_string( $css ) || '' === $css ) { + return ''; + } + + $migrated = false; + + while ( self::ATOMIC_WIND_CSS_VERSION !== $version && is_string( $version ) && isset( self::CSS_MIGRATIONS[ $version ] ) ) { + list( $version, $method ) = self::CSS_MIGRATIONS[ $version ]; + + $css = $this->$method( $css ); + $migrated = true; + + if ( ! is_string( $css ) || '' === $css ) { + return ''; + } + } + + if ( self::ATOMIC_WIND_CSS_VERSION !== $version ) { return ''; } - $css = get_post_meta( $post_id, '_atomic_wind_css', true ); + if ( $migrated ) { + update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $css ) ); + update_post_meta( $post_id, '_atomic_wind_css_version', $version ); + } + + return \ThemeIsle\GutenbergBlocks\CSS\CSS_Handler::escape_style_contents( $css ); + } + + /** + * Drop the typography declarations the 1.0.1 generator put on the block wrapper rule. + * + * @param string $css Stylesheet. + * @return string|null Null when the result cannot be vouched for. + */ + private function remove_wrapper_typography( $css ) { + $failed = false; + $result = preg_replace_callback( + '/(?<=^|[{};])(\s*:where\(\[class\*="wp-block-atomic-wind-"\]\)\s*)\{([^{}]*)\}/', + function ( $rule ) use ( &$failed ) { + $declarations = $this->split_declarations( $rule[2] ); + + if ( null === $declarations ) { + $failed = true; + return $rule[0]; + } + + $trailing = null; + + if ( '' === trim( end( $declarations ) ) ) { + $trailing = array_pop( $declarations ); + } + + $kept = array_filter( + $declarations, + function ( $declaration ) { + $property = strtolower( trim( (string) strstr( $declaration, ':', true ) ) ); + + return ! in_array( $property, array( 'line-height', 'font-family', 'font-feature-settings', 'font-variation-settings' ), true ); + } + ); + + if ( count( $kept ) === count( $declarations ) ) { + return $rule[0]; + } + + if ( '' === trim( implode( '', $kept ) ) ) { + return ''; + } + + return $rule[1] . '{' . implode( ';', $kept ) . ( null === $trailing ? '' : ';' . $trailing ) . '}'; + }, + $css + ); + + return $failed ? null : $result; + } + + /** + * Split a declaration block on its top-level semicolons. + * + * @param string $body Rule body. + * @return string[]|null Null when the body has comments or unbalanced quotes or brackets. + */ + private function split_declarations( $body ) { + if ( false !== strpos( $body, '/*' ) ) { + return null; + } + + $parts = array(); + $current = ''; + $quote = ''; + $depth = 0; + $length = strlen( $body ); + + for ( $i = 0; $i < $length; $i++ ) { + $char = $body[ $i ]; + + if ( '\\' === $char ) { + $current .= $char . substr( $body, $i + 1, 1 ); + ++$i; + continue; + } + + if ( '' !== $quote ) { + $quote = $char === $quote ? '' : $quote; + } elseif ( '"' === $char || "'" === $char ) { + $quote = $char; + } elseif ( '(' === $char || '[' === $char ) { + ++$depth; + } elseif ( ')' === $char || ']' === $char ) { + --$depth; + + if ( $depth < 0 ) { + return null; + } + } elseif ( ';' === $char && 0 === $depth ) { + $parts[] = $current; + $current = ''; + continue; + } + + $current .= $char; + } + + if ( '' !== $quote || 0 !== $depth ) { + return null; + } + + $parts[] = $current; - return is_string( $css ) ? \ThemeIsle\GutenbergBlocks\CSS\CSS_Handler::escape_style_contents( $css ) : ''; + return $parts; } /** diff --git a/src/atomic-wind/tailwind/scope-css.js b/src/atomic-wind/tailwind/scope-css.js index e5caa46ef..07430aa0e 100644 --- a/src/atomic-wind/tailwind/scope-css.js +++ b/src/atomic-wind/tailwind/scope-css.js @@ -239,8 +239,8 @@ function blockEnd( css, open ) { * * `transform` returns the selector list, a falsy value to drop the rule, or `[ selector, body ]` pairs to emit in its place. * - * @param {string} css Stylesheet text. - * @param {Function} transform Receives the selector list and the declaration block. + * @param {string} css Stylesheet text. + * @param {( selector: string, body: string ) => ( string | false | null | undefined | Array<[ string, string ]> )} transform Receives the selector list and the declaration block. * @return {string} Rewritten stylesheet. */ export function transformCssSelectors( css, transform ) { diff --git a/tests/fixtures/atomic-wind/sheet-1.0.1.css b/tests/fixtures/atomic-wind/sheet-1.0.1.css new file mode 100644 index 000000000..def26df39 --- /dev/null +++ b/tests/fixtures/atomic-wind/sheet-1.0.1.css @@ -0,0 +1,137 @@ +@layer properties;@layer theme, base, components, utilities;@layer theme{:where([class*="wp-block-atomic-wind-"]){ + --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; + --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", + "Courier New", monospace; + --spacing: 0.25rem; + --text-lg: 1.125rem; + --text-lg--line-height: calc(1.75 / 1.125); + --default-font-family: var(--font-sans); + --default-mono-font-family: var(--font-mono); + }}@layer base{*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::after, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::before, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::backdrop, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::file-selector-button{ + box-sizing: border-box; + margin: 0; + padding: 0; + border: 0 solid; + }:where([class*="wp-block-atomic-wind-"]){ + line-height: 1.5; + -webkit-text-size-adjust: 100%; + tab-size: 4; + font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); + font-feature-settings: var(--default-font-feature-settings, normal); + font-variation-settings: var(--default-font-variation-settings, normal); + -webkit-tap-highlight-color: transparent; + }hr:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + height: 0; + color: inherit; + border-top-width: 1px; + }abbr:where([title]):where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + }h1:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), h2:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), h3:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), h4:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), h5:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), h6:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-size: inherit; + font-weight: inherit; + }a:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + color: inherit; + -webkit-text-decoration: inherit; + text-decoration: inherit; + }b:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), strong:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-weight: bolder; + }code:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), kbd:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), samp:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), pre:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); + font-feature-settings: var(--default-mono-font-feature-settings, normal); + font-variation-settings: var(--default-mono-font-variation-settings, normal); + font-size: 1em; + }small:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-size: 80%; + }sub:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), sup:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + }sub:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + bottom: -0.25em; + }sup:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + top: -0.5em; + }table:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + text-indent: 0; + border-color: inherit; + border-collapse: collapse; + }:-moz-focusring:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + outline: auto; + }progress:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + vertical-align: baseline; + }summary:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + display: list-item; + }ol:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), ul:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), menu:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + list-style: none; + }img:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), svg:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), video:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), canvas:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), audio:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), iframe:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), embed:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), object:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + display: block; + vertical-align: middle; + }img:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), video:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + max-width: 100%; + height: auto; + }button:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), input:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), select:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), optgroup:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), textarea:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::file-selector-button{ + font: inherit; + font-feature-settings: inherit; + font-variation-settings: inherit; + letter-spacing: inherit; + color: inherit; + border-radius: 0; + background-color: transparent; + opacity: 1; + }:where(select:is([multiple], [size])) optgroup:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-weight: bolder; + }:where(select:is([multiple], [size])) optgroup option:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + padding-inline-start: 20px; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::file-selector-button{ + margin-inline-end: 4px; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::placeholder{ + opacity: 1; + }@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::placeholder{ + color: currentcolor; + @supports (color: color-mix(in lab, red, red)) { + color: color-mix(in oklab, currentcolor 50%, transparent); + } + }}textarea:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + resize: vertical; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-search-decoration{ + -webkit-appearance: none; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-date-and-time-value{ + min-height: 1lh; + text-align: inherit; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit{ + display: inline-flex; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-fields-wrapper{ + padding: 0; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-year-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-month-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-day-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-hour-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-minute-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-second-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-millisecond-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-meridiem-field{ + padding-block: 0; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-calendar-picker-indicator{ + line-height: 1; + }:-moz-ui-invalid:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + box-shadow: none; + }button:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), input:where([type="button"], [type="reset"], [type="submit"]):where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::file-selector-button{ + appearance: button; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-inner-spin-button, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-outer-spin-button{ + height: auto; + }[hidden]:where(:not([hidden="until-found"])):where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + display: none !important; + }}@layer utilities{.mt-4:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + margin-top: calc(var(--spacing) * 4) !important; + }.flex:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + display: flex !important; + }.font-serif:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-family: var(--font-serif) !important; + }.text-lg:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-size: var(--text-lg) !important; + line-height: var(--tw-leading, var(--text-lg--line-height)) !important; + }.leading-10:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + --tw-leading: calc(var(--spacing) * 10) !important; + line-height: calc(var(--spacing) * 10) !important; + }}@property --tw-leading{ + syntax: "*"; + inherits: false; +}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::before, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::after, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::backdrop{ + --tw-leading: initial; + }}} \ No newline at end of file diff --git a/tests/fixtures/atomic-wind/sheet-1.0.2.css b/tests/fixtures/atomic-wind/sheet-1.0.2.css new file mode 100644 index 000000000..f9a2782d4 --- /dev/null +++ b/tests/fixtures/atomic-wind/sheet-1.0.2.css @@ -0,0 +1,133 @@ +@layer properties;@layer theme, base, components, utilities;@layer theme{:where([class*="wp-block-atomic-wind-"]){ + --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; + --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", + "Courier New", monospace; + --spacing: 0.25rem; + --text-lg: 1.125rem; + --text-lg--line-height: calc(1.75 / 1.125); + --default-font-family: var(--font-sans); + --default-mono-font-family: var(--font-mono); + }}@layer base{*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::after, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::before, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::backdrop, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::file-selector-button{ + box-sizing: border-box; + margin: 0; + padding: 0; + border: 0 solid; + }:where([class*="wp-block-atomic-wind-"]){ + -webkit-text-size-adjust: 100%; + tab-size: 4; + -webkit-tap-highlight-color: transparent; + }hr:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + height: 0; + color: inherit; + border-top-width: 1px; + }abbr:where([title]):where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + }h1:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), h2:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), h3:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), h4:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), h5:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), h6:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-size: inherit; + font-weight: inherit; + }a:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + color: inherit; + -webkit-text-decoration: inherit; + text-decoration: inherit; + }b:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), strong:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-weight: bolder; + }code:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), kbd:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), samp:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), pre:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); + font-feature-settings: var(--default-mono-font-feature-settings, normal); + font-variation-settings: var(--default-mono-font-variation-settings, normal); + font-size: 1em; + }small:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-size: 80%; + }sub:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), sup:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + }sub:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + bottom: -0.25em; + }sup:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + top: -0.5em; + }table:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + text-indent: 0; + border-color: inherit; + border-collapse: collapse; + }:-moz-focusring:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + outline: auto; + }progress:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + vertical-align: baseline; + }summary:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + display: list-item; + }ol:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), ul:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), menu:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + list-style: none; + }img:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), svg:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), video:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), canvas:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), audio:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), iframe:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), embed:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), object:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + display: block; + vertical-align: middle; + }img:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), video:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + max-width: 100%; + height: auto; + }button:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), input:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), select:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), optgroup:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), textarea:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::file-selector-button{ + font: inherit; + font-feature-settings: inherit; + font-variation-settings: inherit; + letter-spacing: inherit; + color: inherit; + border-radius: 0; + background-color: transparent; + opacity: 1; + }:where(select:is([multiple], [size])) optgroup:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-weight: bolder; + }:where(select:is([multiple], [size])) optgroup option:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + padding-inline-start: 20px; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::file-selector-button{ + margin-inline-end: 4px; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::placeholder{ + opacity: 1; + }@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::placeholder{ + color: currentcolor; + @supports (color: color-mix(in lab, red, red)) { + color: color-mix(in oklab, currentcolor 50%, transparent); + } + }}textarea:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + resize: vertical; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-search-decoration{ + -webkit-appearance: none; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-date-and-time-value{ + min-height: 1lh; + text-align: inherit; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit{ + display: inline-flex; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-fields-wrapper{ + padding: 0; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-year-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-month-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-day-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-hour-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-minute-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-second-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-millisecond-field, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-datetime-edit-meridiem-field{ + padding-block: 0; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-calendar-picker-indicator{ + line-height: 1; + }:-moz-ui-invalid:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + box-shadow: none; + }button:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), input:where([type="button"], [type="reset"], [type="submit"]):where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::file-selector-button{ + appearance: button; + }*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-inner-spin-button, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::-webkit-outer-spin-button{ + height: auto; + }[hidden]:where(:not([hidden="until-found"])):where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + display: none !important; + }}@layer utilities{.mt-4:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + margin-top: calc(var(--spacing) * 4) !important; + }.flex:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + display: flex !important; + }.font-serif:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-family: var(--font-serif) !important; + }.text-lg:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + font-size: var(--text-lg) !important; + line-height: var(--tw-leading, var(--text-lg--line-height)) !important; + }.leading-10:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){ + --tw-leading: calc(var(--spacing) * 10) !important; + line-height: calc(var(--spacing) * 10) !important; + }}@property --tw-leading{ + syntax: "*"; + inherits: false; +}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *), *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::before, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::after, *:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *)::backdrop{ + --tw-leading: initial; + }}} \ No newline at end of file diff --git a/tests/test-atomic-wind-blocks.php b/tests/test-atomic-wind-blocks.php index e7cf8816d..d98b32f91 100644 --- a/tests/test-atomic-wind-blocks.php +++ b/tests/test-atomic-wind-blocks.php @@ -1540,18 +1540,222 @@ public function test_output_singular_css_regenerates_css_from_an_older_generator $this->assertTrue( wp_script_is( 'atomic-wind-tailwind-generator', 'enqueued' ) ); } - public function test_output_singular_css_regenerates_css_stamped_by_the_previous_generator() { + private const WRAPPER_SELECTOR = ':where([class*="wp-block-atomic-wind-"])'; + + private const TYPOGRAPHY_DECLARATIONS = array( + 'line-height:1.5', + 'font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji")', + 'font-feature-settings:var(--default-font-feature-settings,normal)', + 'font-variation-settings:var(--default-font-variation-settings,normal)', + ); + + private const VARIABLES_RULE = ':where([class*="wp-block-atomic-wind-"]){--font-sans:ui-sans-serif,system-ui;--spacing:.25rem}'; + + private const UTILITY_RULE = '.font-serif:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){font-family:var(--font-serif)}'; + + private const ELEMENT_RULE = 'h1:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){font-size:inherit;line-height:inherit}'; + + /** + * Helper: stamp a post's cached stylesheet and render its head output. + * + * @param string $css Stylesheet to cache. + * @param string $version Version stamp. + * @return int Post ID. + */ + private function render_post_cached_as( $css, $version ) { $this->reset_style_globals(); $singular = $this->make_atomic_wind_post( 'flex' ); - update_post_meta( $singular, '_atomic_wind_css', '.flex{display:flex}' ); - update_post_meta( $singular, '_atomic_wind_css_version', '1.0.1' ); + update_post_meta( $singular, '_atomic_wind_css', wp_slash( $css ) ); + update_post_meta( $singular, '_atomic_wind_css_version', $version ); $this->go_to( get_permalink( $singular ) ); $this->instance->output_singular_css(); + return $singular; + } + + /** + * Helper: a minified 1.0.1 sheet, with the wrapper rule holding the given declarations. + * + * @param array $declarations Wrapper rule declarations. + * @return string + */ + private function sheet_with_wrapper( array $declarations ) { + return self::VARIABLES_RULE . self::WRAPPER_SELECTOR . '{' . implode( ';', $declarations ) . '}' . self::UTILITY_RULE . self::ELEMENT_RULE; + } + + private function legacy_wrapper_declarations() { + return array_merge( + array( self::TYPOGRAPHY_DECLARATIONS[0], '-webkit-text-size-adjust:100%', 'tab-size:4' ), + array_slice( self::TYPOGRAPHY_DECLARATIONS, 1 ), + array( '-webkit-tap-highlight-color:transparent' ) + ); + } + + private function assert_migrated_sheet_is_served( $post_id, $expected ) { + $this->assertSame( $expected, $this->inline_style_for( 'atomic-wind-tailwind' ) ); + $this->assertFalse( wp_script_is( 'atomic-wind-tailwind-generator', 'enqueued' ) ); + $this->assertSame( '1.0.2', get_post_meta( $post_id, '_atomic_wind_css_version', true ) ); + $this->assertSame( $expected, get_post_meta( $post_id, '_atomic_wind_css', true ) ); + } + + public function test_output_singular_css_migrates_css_stamped_by_the_previous_generator() { + $post_id = $this->render_post_cached_as( $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ), '1.0.1' ); + + $expected = self::VARIABLES_RULE + . self::WRAPPER_SELECTOR . '{-webkit-text-size-adjust:100%;tab-size:4;-webkit-tap-highlight-color:transparent}' + . self::UTILITY_RULE + . self::ELEMENT_RULE; + + $this->assert_migrated_sheet_is_served( $post_id, $expected ); + } + + public function test_output_singular_css_migrates_a_pretty_printed_sheet() { + $css = self::WRAPPER_SELECTOR . " {\n\t--spacing: .25rem;\n}\n\n" + . self::WRAPPER_SELECTOR . " {\n\tline-height: 1.5;\n\t-webkit-text-size-adjust: 100%;\n\ttab-size: 4;\n" + . "\tfont-family: var(--default-font-family, ui-sans-serif, \"Apple Color Emoji\");\n" + . "\tfont-feature-settings: var(--default-font-feature-settings, normal);\n" + . "\tFont-Variation-Settings: var(--default-font-variation-settings, normal);\n" + . "\t-webkit-tap-highlight-color: transparent;\n}\n\n" . self::ELEMENT_RULE; + + $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + + $expected = self::WRAPPER_SELECTOR . " {\n\t--spacing: .25rem;\n}\n\n" + . self::WRAPPER_SELECTOR . " {\n\t-webkit-text-size-adjust: 100%;\n\ttab-size: 4;\n" + . "\t-webkit-tap-highlight-color: transparent;\n}\n\n" . self::ELEMENT_RULE; + + $this->assert_migrated_sheet_is_served( $post_id, $expected ); + } + + public function test_output_singular_css_migrates_a_wrapper_rule_inside_a_layer() { + $css = '@layer base{' . $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ) . '}'; + $expected = '@layer base{' . self::VARIABLES_RULE + . self::WRAPPER_SELECTOR . '{-webkit-text-size-adjust:100%;tab-size:4;-webkit-tap-highlight-color:transparent}' + . self::UTILITY_RULE . self::ELEMENT_RULE . '}'; + + $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + + $this->assert_migrated_sheet_is_served( $post_id, $expected ); + } + + public function test_output_singular_css_drops_a_wrapper_rule_left_empty_by_the_migration() { + $css = '@layer base{' . $this->sheet_with_wrapper( self::TYPOGRAPHY_DECLARATIONS ) . '}'; + $expected = '@layer base{' . self::VARIABLES_RULE . self::UTILITY_RULE . self::ELEMENT_RULE . '}'; + + $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + + $this->assert_migrated_sheet_is_served( $post_id, $expected ); + } + + public function test_output_singular_css_keeps_a_current_sheet_untouched() { + $css = $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ); + $post_id = $this->render_post_cached_as( $css, '1.0.2' ); + + $this->assert_migrated_sheet_is_served( $post_id, $css ); + } + + /** + * @dataProvider data_unmigratable_versions + */ + public function test_output_singular_css_ignores_a_sheet_without_a_migration_path( $version ) { + $css = $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ); + $post_id = $this->render_post_cached_as( $css, $version ); + + $this->assertSame( '', $this->inline_style_for( 'atomic-wind-tailwind' ) ); + $this->assertTrue( wp_script_is( 'atomic-wind-tailwind-generator', 'enqueued' ) ); + $this->assertSame( $version, get_post_meta( $post_id, '_atomic_wind_css_version', true ) ); + $this->assertSame( $css, get_post_meta( $post_id, '_atomic_wind_css', true ) ); + } + + public function data_unmigratable_versions(): array { + return array( + 'before the first stamp' => array( '1.0.0' ), + 'unknown future stamp' => array( '9.9.9' ), + ); + } + + public function test_output_singular_css_migration_keeps_backslashes_in_the_saved_sheet() { + $css = '.w-1\/2:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){width:50%}' . $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ); + $expected = '.w-1\/2:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){width:50%}' . self::VARIABLES_RULE + . self::WRAPPER_SELECTOR . '{-webkit-text-size-adjust:100%;tab-size:4;-webkit-tap-highlight-color:transparent}' + . self::UTILITY_RULE . self::ELEMENT_RULE; + + $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + + $this->assertSame( $expected, get_post_meta( $post_id, '_atomic_wind_css', true ) ); + } + + public function test_output_singular_css_leaves_a_wrapper_rule_without_typography_byte_identical() { + $variables = self::WRAPPER_SELECTOR . '{--a:1;--b:2;}'; + $css = $variables . self::WRAPPER_SELECTOR . '{' . implode( ';', $this->legacy_wrapper_declarations() ) . '}'; + $expected = $variables . self::WRAPPER_SELECTOR . '{-webkit-text-size-adjust:100%;tab-size:4;-webkit-tap-highlight-color:transparent}'; + + $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + + $this->assert_migrated_sheet_is_served( $post_id, $expected ); + } + + public function test_output_singular_css_migrates_a_wrapper_rule_with_deeply_nested_functions() { + $css = self::WRAPPER_SELECTOR . '{line-height:1.5;width:calc(1px + min(2px, max(3px, 4px)));tab-size:4}'; + $expected = self::WRAPPER_SELECTOR . '{width:calc(1px + min(2px, max(3px, 4px)));tab-size:4}'; + + $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + + $this->assert_migrated_sheet_is_served( $post_id, $expected ); + } + + /** + * @dataProvider data_unverifiable_wrapper_bodies + */ + public function test_output_singular_css_does_not_migrate_a_wrapper_rule_it_cannot_parse( $body ) { + $css = self::WRAPPER_SELECTOR . '{' . $body . '}'; + $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + + $this->assert_sheet_not_migrated( $post_id, $css, '1.0.1' ); + } + + public function data_unverifiable_wrapper_bodies(): array { + return array( + 'comment' => array( "/* it's */line-height:1.5;tab-size:4" ), + 'unbalanced quote' => array( "line-height:1.5;--a:it's;tab-size:4" ), + 'unbalanced paren' => array( 'line-height:1.5;--a:foo(bar;tab-size:4' ), + ); + } + + public function test_output_singular_css_migrates_real_generator_output() { + $dir = __DIR__ . '/fixtures/atomic-wind/'; + + $post_id = $this->render_post_cached_as( file_get_contents( $dir . 'sheet-1.0.1.css' ), '1.0.1' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents + + $this->assert_migrated_sheet_is_served( $post_id, file_get_contents( $dir . 'sheet-1.0.2.css' ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents + } + + public function test_output_singular_css_ignores_a_sheet_without_a_stamp() { + $css = $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ); + $post_id = $this->render_post_cached_as( $css, '' ); + + $this->assert_sheet_not_migrated( $post_id, $css, '' ); + } + + public function test_output_singular_css_ignores_a_stamped_sheet_with_empty_css() { + $post_id = $this->render_post_cached_as( '', '1.0.1' ); + + $this->assert_sheet_not_migrated( $post_id, '', '1.0.1' ); + } + + public function test_output_singular_css_ignores_a_sheet_the_migration_empties() { + $css = self::WRAPPER_SELECTOR . '{' . implode( ';', self::TYPOGRAPHY_DECLARATIONS ) . '}'; + $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + + $this->assert_sheet_not_migrated( $post_id, $css, '1.0.1' ); + } + + private function assert_sheet_not_migrated( $post_id, $css, $version ) { $this->assertSame( '', $this->inline_style_for( 'atomic-wind-tailwind' ) ); $this->assertTrue( wp_script_is( 'atomic-wind-tailwind-generator', 'enqueued' ) ); + $this->assertSame( $version, get_post_meta( $post_id, '_atomic_wind_css_version', true ) ); + $this->assertSame( $css, get_post_meta( $post_id, '_atomic_wind_css', true ) ); } public function test_rest_save_style_stamps_the_generator_version() { From 00b8ee9c58169ff1ee56bf3034944f88b46f05ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Nov 2026 08:01:04 +0200 Subject: [PATCH 07/30] build(deps-dev): bump php-stubs/woocommerce-stubs from 11.2.2 to 11.3.0 (#3189) Bumps [php-stubs/woocommerce-stubs](https://github.com/php-stubs/woocommerce-stubs) from 11.2.2 to 11.3.0. - [Commits](https://github.com/php-stubs/woocommerce-stubs/compare/v11.2.2...v11.3.0) --- updated-dependencies: - dependency-name: php-stubs/woocommerce-stubs dependency-version: 11.3.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.lock b/composer.lock index 67a965ca1..ccc2a9ac0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f7d4a66bc361fcc3052821cc86d88804", + "content-hash": "b4969883688d05099f3b5104a47e6509", "packages": [ { "name": "codeinwp/themeisle-sdk", @@ -977,16 +977,16 @@ }, { "name": "php-stubs/woocommerce-stubs", - "version": "v11.2.2", + "version": "v11.3.0", "source": { "type": "git", "url": "https://github.com/php-stubs/woocommerce-stubs.git", - "reference": "d5c232c183c09689d75c177b01bef60e6dd53639" + "reference": "a897f9ad0552482e9d50d3937daab20dfb97265c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/d5c232c183c09689d75c177b01bef60e6dd53639", - "reference": "d5c232c183c09689d75c177b01bef60e6dd53639", + "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/a897f9ad0552482e9d50d3937daab20dfb97265c", + "reference": "a897f9ad0552482e9d50d3937daab20dfb97265c", "shasum": "" }, "require": { @@ -1015,9 +1015,9 @@ ], "support": { "issues": "https://github.com/php-stubs/woocommerce-stubs/issues", - "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v11.2.2" + "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v11.3.0" }, - "time": "2026-11-04T21:47:17+00:00" + "time": "2026-11-12T00:45:07+00:00" }, { "name": "php-stubs/wordpress-stubs", @@ -3143,5 +3143,5 @@ "platform-overrides": { "php": "7.4" }, - "plugin-api-version": "2.11.0" + "plugin-api-version": "2.9.0" } From 38dcc4fa1270ead79f00d1e2bfe20613e3fde9eb Mon Sep 17 00:00:00 2001 From: abaicus Date: Fri, 20 Nov 2026 10:09:32 +0200 Subject: [PATCH 08/30] fix: version Atomic Wind stylesheet saves and guard the cache migration write (#3185) Co-Authored-By: Claude Fable 5.2 --- inc/plugins/class-atomic-wind-blocks.php | 100 ++++++++- src/atomic-wind/style-builder/index.js | 2 +- .../style-builder/test/style-builder.test.js | 17 +- .../tailwind/generator-frontend.js | 3 +- src/atomic-wind/tailwind/scope-css.js | 3 + tests/test-atomic-wind-blocks.php | 203 ++++++++++++++++++ 6 files changed, 317 insertions(+), 11 deletions(-) diff --git a/inc/plugins/class-atomic-wind-blocks.php b/inc/plugins/class-atomic-wind-blocks.php index 357b0813a..87b4a387f 100644 --- a/inc/plugins/class-atomic-wind-blocks.php +++ b/inc/plugins/class-atomic-wind-blocks.php @@ -22,6 +22,13 @@ class Atomic_Wind_Blocks { */ const ATOMIC_WIND_CSS_VERSION = '1.0.2'; + /** + * Version assumed for a saved sheet that does not state one: the last generator that did not send it. + * + * @var string + */ + const LEGACY_CSS_VERSION = '1.0.1'; + /** * Stylesheet migrations, keyed by the version they upgrade from: [ next version, method ]. * @@ -707,16 +714,20 @@ public function register_rest_routes() { 'callback' => array( $this, 'rest_save_style' ), 'permission_callback' => array( $this, 'rest_save_style_permissions' ), 'args' => array( - 'css' => array( + 'css' => array( 'type' => 'string', 'required' => true, 'validate_callback' => 'rest_validate_request_arg', 'sanitize_callback' => array( $this, 'sanitize_css' ), ), - 'postId' => array( + 'postId' => array( 'type' => 'integer', 'required' => true, ), + 'version' => array( + 'type' => 'string', + 'required' => false, + ), ), ) ); @@ -836,9 +847,14 @@ private function current_user_can_edit_posts( array $post_ids ) { public function rest_save_style( \WP_REST_Request $request ) { $post_id = absint( $request->get_param( 'postId' ) ); $css = $request->get_param( 'css' ); + $version = $request->get_param( 'version' ); + + if ( ! is_string( $version ) || ! preg_match( '/^\d+\.\d+\.\d+$/D', $version ) ) { + $version = self::LEGACY_CSS_VERSION; + } $success = update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $css ) ); - update_post_meta( $post_id, '_atomic_wind_css_version', self::ATOMIC_WIND_CSS_VERSION ); + update_post_meta( $post_id, '_atomic_wind_css_version', $version ); return new \WP_REST_Response( array( 'success' => $success ), 200 ); } @@ -857,7 +873,9 @@ private function get_cached_css( $post_id ) { return ''; } - $migrated = false; + $original_css = $css; + $original_version = $version; + $migrated = false; while ( self::ATOMIC_WIND_CSS_VERSION !== $version && is_string( $version ) && isset( self::CSS_MIGRATIONS[ $version ] ) ) { list( $version, $method ) = self::CSS_MIGRATIONS[ $version ]; @@ -874,14 +892,82 @@ private function get_cached_css( $post_id ) { return ''; } - if ( $migrated ) { - update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $css ) ); - update_post_meta( $post_id, '_atomic_wind_css_version', $version ); + if ( $migrated && ! $this->replace_cached_css( $post_id, $original_css, $original_version, $css, $version ) ) { + return $this->reread_current_css( $post_id ); } return \ThemeIsle\GutenbergBlocks\CSS\CSS_Handler::escape_style_contents( $css ); } + /** + * After a lost swap, serve the sheet another request stored, if it is current. + * + * @param int $post_id Post ID. + * @return string + */ + private function reread_current_css( $post_id ) { + wp_cache_delete( $post_id, 'post_meta' ); + + $version = get_post_meta( $post_id, '_atomic_wind_css_version', true ); + $css = get_post_meta( $post_id, '_atomic_wind_css', true ); + + if ( self::ATOMIC_WIND_CSS_VERSION !== $version || ! is_string( $css ) || '' === $css ) { + return ''; + } + + return \ThemeIsle\GutenbergBlocks\CSS\CSS_Handler::escape_style_contents( $css ); + } + + /** + * Swap a migrated sheet in for the one that was read, unless that one has changed since. + * + * Compare-and-swap, so a post save or a fresh save landing meanwhile is not undone. + * + * @param int $post_id Post ID. + * @param string $old_css Sheet that was read. + * @param string $old_version Stamp that was read. + * @param string $new_css Migrated sheet. + * @param string $new_version Stamp of the migrated sheet. + * @return bool Whether the stored sheet was still the one read. + */ + private function replace_cached_css( $post_id, $old_css, $old_version, $new_css, $new_version ) { + global $wpdb; + + // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.SlowDBQuery.slow_db_query_meta_value + // An unchanged sheet is valid under both stamps, so only the stamp is swapped. + if ( $new_css !== $old_css ) { + $swapped = $wpdb->update( + $wpdb->postmeta, + array( 'meta_value' => $new_css ), + array( + 'post_id' => $post_id, + 'meta_key' => '_atomic_wind_css', + 'meta_value' => $old_css, + ) + ); + + if ( 1 !== $swapped ) { + return false; + } + } + + $stamped = $wpdb->update( + $wpdb->postmeta, + array( 'meta_value' => $new_version ), + array( + 'post_id' => $post_id, + 'meta_key' => '_atomic_wind_css_version', + 'meta_value' => $old_version, + ) + ); + + // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.SlowDBQuery.slow_db_query_meta_value + + wp_cache_delete( $post_id, 'post_meta' ); + + return $new_css !== $old_css || 1 === $stamped; + } + /** * Drop the typography declarations the 1.0.1 generator put on the block wrapper rule. * diff --git a/src/atomic-wind/style-builder/index.js b/src/atomic-wind/style-builder/index.js index ff30d2f08..4c7c36f71 100644 --- a/src/atomic-wind/style-builder/index.js +++ b/src/atomic-wind/style-builder/index.js @@ -35,7 +35,7 @@ document.addEventListener( 'atomic-wind:css-ready', () => { const saves = []; if ( postId ) { - saves.push( save( 'style', { css, postId } ) ); + saves.push( save( 'style', { css, postId, version: styleTag.dataset.cssVersion } ) ); } if ( window.atomicWindCombinedStyle ) { diff --git a/src/atomic-wind/style-builder/test/style-builder.test.js b/src/atomic-wind/style-builder/test/style-builder.test.js index e41a83ee9..69665669b 100644 --- a/src/atomic-wind/style-builder/test/style-builder.test.js +++ b/src/atomic-wind/style-builder/test/style-builder.test.js @@ -1,12 +1,18 @@ /** * @param {Record} config `atomicWindStyleBuilder` data. * @param {Record} [combined] `atomicWindCombinedStyle` data. + * @param {string} [version] `data-css-version` of the generated sheet. * @return {Promise>} Requests sent before `css-saved`. */ -async function buildStyles( config, combined ) { +async function buildStyles( config, combined, version ) { const sheet = document.createElement( 'style' ); sheet.id = 'atomic-wind-tailwind'; sheet.textContent = '.flex{display:flex}'; + + if ( version ) { + sheet.dataset.cssVersion = version; + } + document.body.append( sheet ); window.atomicWindStyleBuilder = config; @@ -52,13 +58,20 @@ describe( 'style builder', () => { it( 'saves the post and the combined stylesheet from one compile', async () => { const calls = await buildStyles( { postId: '4', restUrl: '/wp-json/otter/v1/atomic-wind', nonce: 'n' }, - { postIds: [ 7, 9 ], tokensHash: 'hash', signature: 'signed' } + { postIds: [ 7, 9 ], tokensHash: 'hash', signature: 'signed' }, + '1.0.2' ); expect( calls.map( ( [ url ] ) => url ) ).toEqual( [ '/wp-json/otter/v1/atomic-wind/style', '/wp-json/otter/v1/atomic-wind/combined-style', ] ); + expect( JSON.parse( calls[ 0 ][ 1 ].body ) ).toEqual( { css: '.flex{display:flex}', postId: 4, version: '1.0.2' } ); + } ); + + it( 'omits the version when the generated sheet does not state one', async () => { + const calls = await buildStyles( { postId: '4', restUrl: '/wp-json/otter/v1/atomic-wind', nonce: 'n' } ); + expect( JSON.parse( calls[ 0 ][ 1 ].body ) ).toEqual( { css: '.flex{display:flex}', postId: 4 } ); } ); } ); diff --git a/src/atomic-wind/tailwind/generator-frontend.js b/src/atomic-wind/tailwind/generator-frontend.js index 66f6ab776..3c9b56d83 100644 --- a/src/atomic-wind/tailwind/generator-frontend.js +++ b/src/atomic-wind/tailwind/generator-frontend.js @@ -4,7 +4,7 @@ import indexCSS from 'tailwindcss/index.css'; import preflightCSS from 'tailwindcss/preflight.css'; import themeCSS from 'tailwindcss/theme.css'; import utilitiesCSS from 'tailwindcss/utilities.css'; -import { scopeToAtomicWind } from './scope-css'; +import { CSS_VERSION, scopeToAtomicWind } from './scope-css'; import { collectNewCandidates } from './candidates'; const assets = { @@ -32,6 +32,7 @@ const classes = new Set(); let buildQueue = Promise.resolve(); const sheet = document.createElement( 'style' ); sheet.id = 'atomic-wind-tailwind'; +sheet.dataset.cssVersion = CSS_VERSION; async function loadStylesheet( id, base ) { const entry = stylesheetMap[ id ]; diff --git a/src/atomic-wind/tailwind/scope-css.js b/src/atomic-wind/tailwind/scope-css.js index 07430aa0e..f6563c8a4 100644 --- a/src/atomic-wind/tailwind/scope-css.js +++ b/src/atomic-wind/tailwind/scope-css.js @@ -4,6 +4,9 @@ * Scope Tailwind resets and utilities to Atomic Wind blocks to prevent theme conflicts. */ +// Must match Atomic_Wind_Blocks::ATOMIC_WIND_CSS_VERSION; bump both when the scoped output changes. +export const CSS_VERSION = '1.0.2'; + const ATOMIC_ROOT = '[class*="wp-block-atomic-wind-"]'; // Zero specificity, so a theme rule aimed at the block wrapper still wins. const ATOMIC_SELF = `:where(${ ATOMIC_ROOT })`; diff --git a/tests/test-atomic-wind-blocks.php b/tests/test-atomic-wind-blocks.php index d98b32f91..70c00f538 100644 --- a/tests/test-atomic-wind-blocks.php +++ b/tests/test-atomic-wind-blocks.php @@ -1705,6 +1705,15 @@ public function test_output_singular_css_migrates_a_wrapper_rule_with_deeply_nes $this->assert_migrated_sheet_is_served( $post_id, $expected ); } + public function test_output_singular_css_migrates_a_wrapper_rule_with_an_escaped_quote_in_a_string() { + $css = self::WRAPPER_SELECTOR . '{line-height:1.5;--a:"x\";y";tab-size:4}'; + $expected = self::WRAPPER_SELECTOR . '{--a:"x\";y";tab-size:4}'; + + $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + + $this->assert_migrated_sheet_is_served( $post_id, $expected ); + } + /** * @dataProvider data_unverifiable_wrapper_bodies */ @@ -1762,6 +1771,7 @@ public function test_rest_save_style_stamps_the_generator_version() { $request = new WP_REST_Request( 'POST', '/otter/v1/atomic-wind/style' ); $request->set_param( 'postId', $this->post_id ); $request->set_param( 'css', '.flex{display:flex}' ); + $request->set_param( 'version', Atomic_Wind_Blocks::ATOMIC_WIND_CSS_VERSION ); $this->instance->rest_save_style( $request ); @@ -1771,6 +1781,199 @@ public function test_rest_save_style_stamps_the_generator_version() { ); } + /** + * Helper: save a sheet through the route, then render the post's head output. + * + * @param string $css Sheet to post. + * @param string|null $version Generator version to post, null to omit it. + * @return int Post ID. + */ + private function save_style_then_render( $css, $version ) { + $this->reset_style_globals(); + + $singular = $this->make_atomic_wind_post( 'flex' ); + $params = array( + 'postId' => $singular, + 'css' => $css, + ); + + if ( null !== $version ) { + $params['version'] = $version; + } + + $this->assertSame( 200, $this->post_atomic_wind_route( 'style', $params )->get_status() ); + + $this->go_to( get_permalink( $singular ) ); + $this->instance->output_singular_css(); + + return $singular; + } + + private function fixture_sheet( $version ) { + return file_get_contents( __DIR__ . '/fixtures/atomic-wind/sheet-' . $version . '.css' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents + } + + public function test_rest_save_style_without_a_version_is_a_legacy_sheet_that_gets_migrated() { + $post_id = $this->save_style_then_render( $this->fixture_sheet( '1.0.1' ), null ); + + $this->assert_migrated_sheet_is_served( $post_id, $this->fixture_sheet( '1.0.2' ) ); + } + + public function test_rest_save_style_without_a_version_stamps_the_legacy_version() { + $post_id = $this->make_atomic_wind_post( 'flex' ); + + $this->post_atomic_wind_route( + 'style', + array( + 'postId' => $post_id, + 'css' => '.flex{display:flex}', + ) + ); + + $this->assertSame( '1.0.1', get_post_meta( $post_id, '_atomic_wind_css_version', true ) ); + } + + public function test_rest_save_style_with_the_current_version_serves_the_sheet_as_posted() { + $css = $this->fixture_sheet( '1.0.2' ); + $post_id = $this->save_style_then_render( $css, Atomic_Wind_Blocks::ATOMIC_WIND_CSS_VERSION ); + + $this->assertSame( Atomic_Wind_Blocks::ATOMIC_WIND_CSS_VERSION, get_post_meta( $post_id, '_atomic_wind_css_version', true ) ); + $this->assert_migrated_sheet_is_served( $post_id, $css ); + } + + /** + * @dataProvider data_invalid_versions + */ + public function test_rest_save_style_treats_an_invalid_version_as_legacy( $version ) { + $post_id = $this->save_style_then_render( $this->fixture_sheet( '1.0.1' ), $version ); + + $this->assert_migrated_sheet_is_served( $post_id, $this->fixture_sheet( '1.0.2' ) ); + } + + public function data_invalid_versions(): array { + return array( + 'word' => array( 'abc' ), + 'two parts' => array( '1.0' ), + 'empty' => array( '' ), + 'suffix' => array( "1.0.2\n" ), + 'prerelease' => array( '1.0.2-beta' ), + ); + } + + public function test_rest_save_style_with_an_unknown_version_is_ignored_on_output() { + $css = $this->fixture_sheet( '1.0.2' ); + $post_id = $this->save_style_then_render( $css, '9.9.9' ); + + $this->assert_sheet_not_migrated( $post_id, $css, '9.9.9' ); + } + + /** + * Helper: make the first read of a post's cached sheet return a stale sheet whatever the database holds. + * + * @param int $post_id Post ID. + * @param string $css Sheet to read. + * @param string $version Stamp to read. + * @return callable The filter, to remove. + */ + private function read_stale_sheet( $post_id, $css, $version ) { + $served = array(); + $filter = static function ( $value, $object_id, $meta_key ) use ( $post_id, $css, $version, &$served ) { + $stale = array( + '_atomic_wind_css' => $css, + '_atomic_wind_css_version' => $version, + ); + + if ( $object_id !== $post_id || ! isset( $stale[ $meta_key ] ) || isset( $served[ $meta_key ] ) ) { + return $value; + } + + $served[ $meta_key ] = true; + + return array( $stale[ $meta_key ] ); + }; + + add_filter( 'get_post_metadata', $filter, 10, 3 ); + + return $filter; + } + + public function test_output_singular_css_serves_a_sheet_saved_since_it_was_read_without_overwriting_it() { + $this->reset_style_globals(); + + $post_id = $this->make_atomic_wind_post( 'flex' ); + $newer = $this->fixture_sheet( '1.0.2' ) . '.newer{color:red}'; + update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $newer ) ); + update_post_meta( $post_id, '_atomic_wind_css_version', '1.0.2' ); + + $filter = $this->read_stale_sheet( $post_id, $this->fixture_sheet( '1.0.1' ), '1.0.1' ); + + $this->go_to( get_permalink( $post_id ) ); + $this->instance->output_singular_css(); + remove_filter( 'get_post_metadata', $filter, 10 ); + + $this->assertSame( $newer, $this->inline_style_for( 'atomic-wind-tailwind' ) ); + $this->assertFalse( wp_script_is( 'atomic-wind-tailwind-generator', 'enqueued' ) ); + $this->assertSame( $newer, get_post_meta( $post_id, '_atomic_wind_css', true ) ); + $this->assertSame( '1.0.2', get_post_meta( $post_id, '_atomic_wind_css_version', true ) ); + } + + public function test_output_singular_css_does_not_restore_a_sheet_deleted_since_it_was_read() { + $this->reset_style_globals(); + + $post_id = $this->make_atomic_wind_post( 'flex' ); + $filter = $this->read_stale_sheet( $post_id, $this->fixture_sheet( '1.0.1' ), '1.0.1' ); + + $this->go_to( get_permalink( $post_id ) ); + $this->instance->output_singular_css(); + remove_filter( 'get_post_metadata', $filter, 10 ); + + $this->assertSame( '', $this->inline_style_for( 'atomic-wind-tailwind' ) ); + $this->assertTrue( wp_script_is( 'atomic-wind-tailwind-generator', 'enqueued' ) ); + $this->assertFalse( metadata_exists( 'post', $post_id, '_atomic_wind_css' ) ); + $this->assertFalse( metadata_exists( 'post', $post_id, '_atomic_wind_css_version' ) ); + } + + public function test_output_singular_css_restamps_an_unchanged_sheet_and_keeps_serving_it() { + $css = $this->fixture_sheet( '1.0.2' ); + $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + + $this->assert_migrated_sheet_is_served( $post_id, $css ); + + $this->reset_style_globals(); + $this->go_to( get_permalink( $post_id ) ); + $this->instance->output_singular_css(); + + $this->assert_migrated_sheet_is_served( $post_id, $css ); + } + + public function test_rest_save_style_without_a_version_keeps_serving_a_current_format_sheet() { + $css = $this->fixture_sheet( '1.0.2' ); + $post_id = $this->save_style_then_render( $css, null ); + + $this->assert_migrated_sheet_is_served( $post_id, $css ); + } + + public function test_css_version_matches_the_generator_constant() { + $file = dirname( __DIR__ ) . '/src/atomic-wind/tailwind/scope-css.js'; + + if ( ! file_exists( $file ) ) { + $this->markTestSkipped( 'Generator sources are not available.' ); + } + + $this->assertStringContainsString( + "export const CSS_VERSION = '" . Atomic_Wind_Blocks::ATOMIC_WIND_CSS_VERSION . "';", + file_get_contents( $file ) // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents + ); + } + + public function test_page_configs_do_not_carry_the_css_version() { + $post_id = $this->make_atomic_wind_post( 'flex' ); + + $html = $this->call_private( 'render_css_warm_page_html', get_post( $post_id ) ); + + $this->assertStringNotContainsString( 'cssVersion', $html ); + } + public function test_clear_cached_css_drops_the_version_stamp() { $post_id = $this->make_atomic_wind_post( 'flex' ); $this->set_cached_css( $post_id, '.flex{display:flex}' ); From 8a82eb43a64a032583eb4907ef7441acdf28c7a4 Mon Sep 17 00:00:00 2001 From: abaicus Date: Fri, 20 Nov 2026 12:26:35 +0200 Subject: [PATCH 09/30] fix: swap migrated Atomic Wind sheet and stamp in one byte-exact statement (#3185) Co-Authored-By: Claude Fable 5.2 --- inc/plugins/class-atomic-wind-blocks.php | 50 +++----- tests/test-atomic-wind-blocks.php | 149 ++++++++++++++++++++++- 2 files changed, 166 insertions(+), 33 deletions(-) diff --git a/inc/plugins/class-atomic-wind-blocks.php b/inc/plugins/class-atomic-wind-blocks.php index 87b4a387f..773f8f75d 100644 --- a/inc/plugins/class-atomic-wind-blocks.php +++ b/inc/plugins/class-atomic-wind-blocks.php @@ -919,53 +919,41 @@ private function reread_current_css( $post_id ) { } /** - * Swap a migrated sheet in for the one that was read, unless that one has changed since. + * Swap a migrated sheet and its stamp in for the ones that were read, unless either has changed since. * - * Compare-and-swap, so a post save or a fresh save landing meanwhile is not undone. + * One byte-exact compare-and-swap statement, so a save landing meanwhile is not undone and + * cannot be left carrying the new stamp. * * @param int $post_id Post ID. * @param string $old_css Sheet that was read. * @param string $old_version Stamp that was read. * @param string $new_css Migrated sheet. * @param string $new_version Stamp of the migrated sheet. - * @return bool Whether the stored sheet was still the one read. + * @return bool Whether the stored sheet and stamp were still the ones read. */ private function replace_cached_css( $post_id, $old_css, $old_version, $new_css, $new_version ) { global $wpdb; - // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.SlowDBQuery.slow_db_query_meta_value - // An unchanged sheet is valid under both stamps, so only the stamp is swapped. - if ( $new_css !== $old_css ) { - $swapped = $wpdb->update( - $wpdb->postmeta, - array( 'meta_value' => $new_css ), - array( - 'post_id' => $post_id, - 'meta_key' => '_atomic_wind_css', - 'meta_value' => $old_css, - ) - ); - - if ( 1 !== $swapped ) { - return false; - } - } - - $stamped = $wpdb->update( - $wpdb->postmeta, - array( 'meta_value' => $new_version ), - array( - 'post_id' => $post_id, - 'meta_key' => '_atomic_wind_css_version', - 'meta_value' => $old_version, + // BINARY: the column collation would also match a sheet differing only in case or trailing spaces. + // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $swapped = $wpdb->query( + $wpdb->prepare( + "UPDATE {$wpdb->postmeta} css INNER JOIN {$wpdb->postmeta} ver ON ver.post_id = css.post_id + SET css.meta_value = %s, ver.meta_value = %s + WHERE css.post_id = %d AND css.meta_key = '_atomic_wind_css' AND BINARY css.meta_value = %s + AND ver.meta_key = '_atomic_wind_css_version' AND BINARY ver.meta_value = %s", + $new_css, + $new_version, + $post_id, + $old_css, + $old_version ) ); - - // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.SlowDBQuery.slow_db_query_meta_value + // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared wp_cache_delete( $post_id, 'post_meta' ); - return $new_css !== $old_css || 1 === $stamped; + return is_int( $swapped ) && $swapped > 0; } /** diff --git a/tests/test-atomic-wind-blocks.php b/tests/test-atomic-wind-blocks.php index 70c00f538..daccb62b6 100644 --- a/tests/test-atomic-wind-blocks.php +++ b/tests/test-atomic-wind-blocks.php @@ -1966,12 +1966,157 @@ public function test_css_version_matches_the_generator_constant() { ); } - public function test_page_configs_do_not_carry_the_css_version() { + public function test_warm_page_loads_the_frontend_generator_that_stamps_the_css_version() { $post_id = $this->make_atomic_wind_post( 'flex' ); $html = $this->call_private( 'render_css_warm_page_html', get_post( $post_id ) ); - $this->assertStringNotContainsString( 'cssVersion', $html ); + $this->assertMatchesRegularExpression( '##', $html ); + } + + /** + * Helper: read a meta row straight from the database, bypassing the object cache. + * + * @param int $post_id Post ID. + * @param string $key Meta key. + * @return string|null + */ + private function stored_meta( $post_id, $key ) { + global $wpdb; + + return $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM {$wpdb->postmeta} WHERE post_id = %d AND meta_key = %s", $post_id, $key ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching + } + + /** + * Helper: serve the sheet that is stored now as read, and store the replacement right after. + * + * @param int $post_id Post ID. + * @param string $replacement Sheet written to the database once the read has happened. + * @return callable The filter, to remove. + */ + private function replace_sheet_after_read( $post_id, $replacement ) { + global $wpdb; + + $done = false; + $filter = function ( $value, $object_id, $meta_key ) use ( $post_id, $replacement, &$done, $wpdb ) { + if ( $done || $object_id !== $post_id || '_atomic_wind_css' !== $meta_key ) { + return $value; + } + + $done = true; + $read = $this->stored_meta( $post_id, '_atomic_wind_css' ); + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching + $wpdb->update( $wpdb->postmeta, array( 'meta_value' => $replacement ), array( 'post_id' => $post_id, 'meta_key' => '_atomic_wind_css' ) ); + + return array( $read ); + }; + + add_filter( 'get_post_metadata', $filter, 10, 3 ); + + return $filter; + } + + /** + * @dataProvider data_sheet_variants_the_column_collation_treats_as_equal + */ + public function test_migration_does_not_overwrite_a_sheet_that_differs_only_by_case_or_trailing_space( $variant ) { + $this->reset_style_globals(); + + $sheet = $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ) . '.bg-\[\#fff\]{background-color:#fff}'; + $variant = $variant( $sheet ); + $post_id = $this->make_atomic_wind_post( 'flex' ); + update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $sheet ) ); + update_post_meta( $post_id, '_atomic_wind_css_version', '1.0.1' ); + + $filter = $this->replace_sheet_after_read( $post_id, $variant ); + + $this->go_to( get_permalink( $post_id ) ); + $this->instance->output_singular_css(); + remove_filter( 'get_post_metadata', $filter, 10 ); + + $this->assertSame( $variant, $this->stored_meta( $post_id, '_atomic_wind_css' ) ); + $this->assertSame( '1.0.1', $this->stored_meta( $post_id, '_atomic_wind_css_version' ) ); + } + + public function data_sheet_variants_the_column_collation_treats_as_equal(): array { + return array( + 'letter case' => array( + static function ( $sheet ) { + return str_replace( '#fff', '#FFF', $sheet ); + }, + ), + 'trailing space' => array( + static function ( $sheet ) { + return $sheet . ' '; + }, + ), + ); + } + + public function test_migration_does_not_relabel_a_different_legacy_sheet_when_the_sheet_it_read_was_unchanged() { + $this->reset_style_globals(); + + $sheet = $this->fixture_sheet( '1.0.2' ); + $legacy = $sheet . '.legacy{color:red}'; + $post_id = $this->make_atomic_wind_post( 'flex' ); + update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $sheet ) ); + update_post_meta( $post_id, '_atomic_wind_css_version', '1.0.1' ); + + $filter = $this->replace_sheet_after_read( $post_id, $legacy ); + + $this->go_to( get_permalink( $post_id ) ); + $this->instance->output_singular_css(); + remove_filter( 'get_post_metadata', $filter, 10 ); + + $this->assertSame( $legacy, $this->stored_meta( $post_id, '_atomic_wind_css' ) ); + $this->assertSame( '1.0.1', $this->stored_meta( $post_id, '_atomic_wind_css_version' ) ); + } + + public function test_migration_swaps_sheet_and_stamp_in_one_statement_and_survives_a_versionless_save_before_it() { + $this->reset_style_globals(); + + $legacy = $this->fixture_sheet( '1.0.1' ) . '.late{color:red}'; + $post_id = $this->make_atomic_wind_post( 'flex' ); + update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ) ) ); + update_post_meta( $post_id, '_atomic_wind_css_version', '1.0.1' ); + + $updates = array(); + $saving = false; + $interject = function ( $query ) use ( &$updates, &$saving, $post_id, $legacy ) { + if ( $saving || 0 !== strpos( ltrim( $query ), 'UPDATE' ) || false === strpos( $query, '_atomic_wind_css' ) ) { + return $query; + } + + $updates[] = $query; + + if ( false !== strpos( $query, '_atomic_wind_css_version' ) ) { + $saving = true; + $this->post_atomic_wind_route( + 'style', + array( + 'postId' => $post_id, + 'css' => $legacy, + ) + ); + $saving = false; + } + + return $query; + }; + + add_filter( 'query', $interject ); + $this->go_to( get_permalink( $post_id ) ); + $this->instance->output_singular_css(); + remove_filter( 'query', $interject ); + + $this->assertFalse( + '1.0.2' === $this->stored_meta( $post_id, '_atomic_wind_css_version' ) && $legacy === $this->stored_meta( $post_id, '_atomic_wind_css' ), + 'A legacy sheet must not end up stamped with the current version.' + ); + $this->assertSame( $legacy, $this->stored_meta( $post_id, '_atomic_wind_css' ) ); + $this->assertSame( '1.0.1', $this->stored_meta( $post_id, '_atomic_wind_css_version' ) ); + $this->assertCount( 1, $updates ); } public function test_clear_cached_css_drops_the_version_stamp() { From d912a58e4f750d63c0d871d832ec2ad5a146d272 Mon Sep 17 00:00:00 2001 From: abaicus Date: Fri, 20 Nov 2026 12:50:16 +0200 Subject: [PATCH 10/30] fix: migrate cached Atomic Wind stylesheets on read and on save, without a write-back (#3185) Co-Authored-By: Claude Fable 5.2 --- inc/plugins/class-atomic-wind-blocks.php | 106 ++--- .../tailwind/test/generator-frontend.test.js | 24 + .../e2e/blocks/atomic-wind-css-scope.spec.js | 31 +- tests/test-atomic-wind-blocks.php | 424 +++++++----------- 4 files changed, 254 insertions(+), 331 deletions(-) create mode 100644 src/atomic-wind/tailwind/test/generator-frontend.test.js diff --git a/inc/plugins/class-atomic-wind-blocks.php b/inc/plugins/class-atomic-wind-blocks.php index 773f8f75d..b6de8b43d 100644 --- a/inc/plugins/class-atomic-wind-blocks.php +++ b/inc/plugins/class-atomic-wind-blocks.php @@ -32,6 +32,8 @@ class Atomic_Wind_Blocks { /** * Stylesheet migrations, keyed by the version they upgrade from: [ next version, method ]. * + * Each must leave a sheet already in a newer format unchanged: a reader can see a new sheet beside an old stamp between a save's two writes. + * * @var array */ const CSS_MIGRATIONS = array( @@ -838,7 +840,9 @@ private function current_user_can_edit_posts( array $post_ids ) { } /** - * REST callback: save generated Tailwind CSS to post meta. + * REST callback: save generated Tailwind CSS to post meta, migrated to the current version. + * + * A sheet that cannot be migrated is not stored and existing meta is left as it is. * * @param \WP_REST_Request $request Request object. * @phpstan-param \WP_REST_Request> $request @@ -846,21 +850,26 @@ private function current_user_can_edit_posts( array $post_ids ) { */ public function rest_save_style( \WP_REST_Request $request ) { $post_id = absint( $request->get_param( 'postId' ) ); - $css = $request->get_param( 'css' ); $version = $request->get_param( 'version' ); - if ( ! is_string( $version ) || ! preg_match( '/^\d+\.\d+\.\d+$/D', $version ) ) { + if ( ! is_string( $version ) || ! preg_match( '/^\d{1,4}\.\d{1,4}\.\d{1,4}$/D', $version ) ) { $version = self::LEGACY_CSS_VERSION; } + $css = $this->migrate_css( $request->get_param( 'css' ), $version ); + + if ( '' === $css ) { + return new \WP_REST_Response( array( 'success' => false ), 400 ); + } + $success = update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $css ) ); - update_post_meta( $post_id, '_atomic_wind_css_version', $version ); + update_post_meta( $post_id, '_atomic_wind_css_version', self::ATOMIC_WIND_CSS_VERSION ); return new \WP_REST_Response( array( 'success' => $success ), 200 ); } /** - * Read cached CSS, upgrading older stylesheets in place and ignoring those that cannot be upgraded. + * Read cached CSS, upgrading older stylesheets on the fly and ignoring those that cannot be upgraded. * * @param int $post_id Post ID. * @return string @@ -869,91 +878,34 @@ private function get_cached_css( $post_id ) { $version = get_post_meta( $post_id, '_atomic_wind_css_version', true ); $css = get_post_meta( $post_id, '_atomic_wind_css', true ); - if ( ! is_string( $css ) || '' === $css ) { + if ( ! is_string( $version ) || ! is_string( $css ) ) { return ''; } - $original_css = $css; - $original_version = $version; - $migrated = false; - - while ( self::ATOMIC_WIND_CSS_VERSION !== $version && is_string( $version ) && isset( self::CSS_MIGRATIONS[ $version ] ) ) { - list( $version, $method ) = self::CSS_MIGRATIONS[ $version ]; + $css = $this->migrate_css( $css, $version ); - $css = $this->$method( $css ); - $migrated = true; - - if ( ! is_string( $css ) || '' === $css ) { - return ''; - } - } - - if ( self::ATOMIC_WIND_CSS_VERSION !== $version ) { - return ''; - } - - if ( $migrated && ! $this->replace_cached_css( $post_id, $original_css, $original_version, $css, $version ) ) { - return $this->reread_current_css( $post_id ); - } - - return \ThemeIsle\GutenbergBlocks\CSS\CSS_Handler::escape_style_contents( $css ); + return '' === $css ? '' : \ThemeIsle\GutenbergBlocks\CSS\CSS_Handler::escape_style_contents( $css ); } /** - * After a lost swap, serve the sheet another request stored, if it is current. + * Bring a stylesheet to the current version. * - * @param int $post_id Post ID. - * @return string + * @param string $css Stylesheet. + * @param string $version Version it was generated for. + * @return string Empty when no migration path reaches the current version or a migration fails. */ - private function reread_current_css( $post_id ) { - wp_cache_delete( $post_id, 'post_meta' ); + private function migrate_css( $css, $version ) { + while ( self::ATOMIC_WIND_CSS_VERSION !== $version && isset( self::CSS_MIGRATIONS[ $version ] ) ) { + list( $version, $method ) = self::CSS_MIGRATIONS[ $version ]; - $version = get_post_meta( $post_id, '_atomic_wind_css_version', true ); - $css = get_post_meta( $post_id, '_atomic_wind_css', true ); + $css = $this->$method( $css ); - if ( self::ATOMIC_WIND_CSS_VERSION !== $version || ! is_string( $css ) || '' === $css ) { - return ''; + if ( ! is_string( $css ) ) { + return ''; + } } - return \ThemeIsle\GutenbergBlocks\CSS\CSS_Handler::escape_style_contents( $css ); - } - - /** - * Swap a migrated sheet and its stamp in for the ones that were read, unless either has changed since. - * - * One byte-exact compare-and-swap statement, so a save landing meanwhile is not undone and - * cannot be left carrying the new stamp. - * - * @param int $post_id Post ID. - * @param string $old_css Sheet that was read. - * @param string $old_version Stamp that was read. - * @param string $new_css Migrated sheet. - * @param string $new_version Stamp of the migrated sheet. - * @return bool Whether the stored sheet and stamp were still the ones read. - */ - private function replace_cached_css( $post_id, $old_css, $old_version, $new_css, $new_version ) { - global $wpdb; - - // BINARY: the column collation would also match a sheet differing only in case or trailing spaces. - // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared - $swapped = $wpdb->query( - $wpdb->prepare( - "UPDATE {$wpdb->postmeta} css INNER JOIN {$wpdb->postmeta} ver ON ver.post_id = css.post_id - SET css.meta_value = %s, ver.meta_value = %s - WHERE css.post_id = %d AND css.meta_key = '_atomic_wind_css' AND BINARY css.meta_value = %s - AND ver.meta_key = '_atomic_wind_css_version' AND BINARY ver.meta_value = %s", - $new_css, - $new_version, - $post_id, - $old_css, - $old_version - ) - ); - // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared - - wp_cache_delete( $post_id, 'post_meta' ); - - return is_int( $swapped ) && $swapped > 0; + return self::ATOMIC_WIND_CSS_VERSION === $version ? $css : ''; } /** diff --git a/src/atomic-wind/tailwind/test/generator-frontend.test.js b/src/atomic-wind/tailwind/test/generator-frontend.test.js new file mode 100644 index 000000000..e99c26f27 --- /dev/null +++ b/src/atomic-wind/tailwind/test/generator-frontend.test.js @@ -0,0 +1,24 @@ +import { CSS_VERSION } from '../scope-css'; + +jest.mock( 'tailwindcss', () => ( { + compile: jest.fn( () => Promise.resolve( { build: () => '.flex{display:flex}' } ) ), +} ) ); +jest.mock( 'tailwindcss/index.css', () => '', { virtual: true } ); +jest.mock( 'tailwindcss/preflight.css', () => '', { virtual: true } ); +jest.mock( 'tailwindcss/theme.css', () => '', { virtual: true } ); +jest.mock( 'tailwindcss/utilities.css', () => '', { virtual: true } ); + +describe( 'frontend generator', () => { + it( 'stamps the generated sheet with the stylesheet version', async () => { + require( '../generator-frontend' ); + + const ready = new Promise( ( resolve ) => document.addEventListener( 'atomic-wind:css-ready', resolve, { once: true } ) ); + document.dispatchEvent( new Event( 'DOMContentLoaded' ) ); + await ready; + + const sheet = document.getElementById( 'atomic-wind-tailwind' ); + + expect( sheet.textContent ).toContain( '.flex' ); + expect( sheet.dataset.cssVersion ).toBe( CSS_VERSION ); + } ); +} ); diff --git a/src/blocks/test/e2e/blocks/atomic-wind-css-scope.spec.js b/src/blocks/test/e2e/blocks/atomic-wind-css-scope.spec.js index b495d6568..a93f68889 100644 --- a/src/blocks/test/e2e/blocks/atomic-wind-css-scope.spec.js +++ b/src/blocks/test/e2e/blocks/atomic-wind-css-scope.spec.js @@ -22,6 +22,17 @@ const lineHeightRatio = ( locator, relativeToRoot = false ) => locator.evaluate( return parseFloat( style.lineHeight ) / parseFloat( base.fontSize ); }, relativeToRoot ); +/** + * @param {import('@wordpress/e2e-test-utils-playwright').RequestUtils} requestUtils Request utils. + * @return {Promise<{ atomicWind: boolean, theme: string }>} Atomic Wind option and active theme. + */ +const captureSiteState = async( requestUtils ) => { + const settings = await requestUtils.rest({ path: '/wp/v2/settings' }); + const [ active ] = await requestUtils.rest({ path: '/wp/v2/themes', params: { status: 'active' }}); + + return { atomicWind: !! settings.themeisle_blocks_settings_atomic_wind_blocks, theme: active.stylesheet }; +}; + /** * Load a post as the editor so the style builder caches its compiled CSS. * @@ -93,13 +104,19 @@ const expectInheritedTypography = async( root ) => { * its own variables. */ test.describe( 'Atomic Wind Tailwind CSS scope', () => { + let original; + + test.beforeAll( async({ requestUtils }) => { + original = await captureSiteState( requestUtils ); + }); + test.beforeEach( async({ otterUtils, admin }) => { await setAtomicWind( otterUtils, true ); await admin.createNewPost(); }); test.afterAll( async({ otterUtils }) => { - await setAtomicWind( otterUtils, false ); + await setAtomicWind( otterUtils, original.atomicWind ); }); test( 'resets elements inside the block without touching theme markup', async({ editor, page }) => { @@ -210,13 +227,19 @@ test.describe( 'Atomic Wind Tailwind CSS scope', () => { }); test.describe( 'Atomic Wind typography inheritance', () => { + let original; + + test.beforeAll( async({ requestUtils }) => { + original = await captureSiteState( requestUtils ); + }); + test.beforeEach( async({ otterUtils }) => { await setAtomicWind( otterUtils, true ); }); test.afterAll( async({ otterUtils, requestUtils }) => { - await requestUtils.activateTheme( 'twentytwentythree' ); - await setAtomicWind( otterUtils, false ); + await requestUtils.activateTheme( original.theme ); + await setAtomicWind( otterUtils, original.atomicWind ); }); test( 'inherits typography from a theme-styled ancestor on the frontend', async({ page, requestUtils }) => { @@ -401,7 +424,7 @@ test.describe( 'Atomic Wind typography inheritance', () => { await expect( page.locator( '.typo-theme' ) ).toHaveCSS( 'line-height', control.lineHeight ); } finally { await deletePosts( requestUtils, [ post ] ); - await requestUtils.activateTheme( 'twentytwentythree' ); + await requestUtils.activateTheme( original.theme ); } }); } diff --git a/tests/test-atomic-wind-blocks.php b/tests/test-atomic-wind-blocks.php index daccb62b6..eec14bc58 100644 --- a/tests/test-atomic-wind-blocks.php +++ b/tests/test-atomic-wind-blocks.php @@ -1593,22 +1593,20 @@ private function legacy_wrapper_declarations() { ); } - private function assert_migrated_sheet_is_served( $post_id, $expected ) { + private function assert_migrated_sheet_is_served( $expected ) { $this->assertSame( $expected, $this->inline_style_for( 'atomic-wind-tailwind' ) ); $this->assertFalse( wp_script_is( 'atomic-wind-tailwind-generator', 'enqueued' ) ); - $this->assertSame( '1.0.2', get_post_meta( $post_id, '_atomic_wind_css_version', true ) ); - $this->assertSame( $expected, get_post_meta( $post_id, '_atomic_wind_css', true ) ); } public function test_output_singular_css_migrates_css_stamped_by_the_previous_generator() { - $post_id = $this->render_post_cached_as( $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ), '1.0.1' ); + $this->render_post_cached_as( $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ), '1.0.1' ); $expected = self::VARIABLES_RULE . self::WRAPPER_SELECTOR . '{-webkit-text-size-adjust:100%;tab-size:4;-webkit-tap-highlight-color:transparent}' . self::UTILITY_RULE . self::ELEMENT_RULE; - $this->assert_migrated_sheet_is_served( $post_id, $expected ); + $this->assert_migrated_sheet_is_served( $expected ); } public function test_output_singular_css_migrates_a_pretty_printed_sheet() { @@ -1619,13 +1617,13 @@ public function test_output_singular_css_migrates_a_pretty_printed_sheet() { . "\tFont-Variation-Settings: var(--default-font-variation-settings, normal);\n" . "\t-webkit-tap-highlight-color: transparent;\n}\n\n" . self::ELEMENT_RULE; - $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + $this->render_post_cached_as( $css, '1.0.1' ); $expected = self::WRAPPER_SELECTOR . " {\n\t--spacing: .25rem;\n}\n\n" . self::WRAPPER_SELECTOR . " {\n\t-webkit-text-size-adjust: 100%;\n\ttab-size: 4;\n" . "\t-webkit-tap-highlight-color: transparent;\n}\n\n" . self::ELEMENT_RULE; - $this->assert_migrated_sheet_is_served( $post_id, $expected ); + $this->assert_migrated_sheet_is_served( $expected ); } public function test_output_singular_css_migrates_a_wrapper_rule_inside_a_layer() { @@ -1634,25 +1632,25 @@ public function test_output_singular_css_migrates_a_wrapper_rule_inside_a_layer( . self::WRAPPER_SELECTOR . '{-webkit-text-size-adjust:100%;tab-size:4;-webkit-tap-highlight-color:transparent}' . self::UTILITY_RULE . self::ELEMENT_RULE . '}'; - $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + $this->render_post_cached_as( $css, '1.0.1' ); - $this->assert_migrated_sheet_is_served( $post_id, $expected ); + $this->assert_migrated_sheet_is_served( $expected ); } public function test_output_singular_css_drops_a_wrapper_rule_left_empty_by_the_migration() { $css = '@layer base{' . $this->sheet_with_wrapper( self::TYPOGRAPHY_DECLARATIONS ) . '}'; $expected = '@layer base{' . self::VARIABLES_RULE . self::UTILITY_RULE . self::ELEMENT_RULE . '}'; - $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + $this->render_post_cached_as( $css, '1.0.1' ); - $this->assert_migrated_sheet_is_served( $post_id, $expected ); + $this->assert_migrated_sheet_is_served( $expected ); } public function test_output_singular_css_keeps_a_current_sheet_untouched() { $css = $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ); - $post_id = $this->render_post_cached_as( $css, '1.0.2' ); + $this->render_post_cached_as( $css, '1.0.2' ); - $this->assert_migrated_sheet_is_served( $post_id, $css ); + $this->assert_migrated_sheet_is_served( $css ); } /** @@ -1675,15 +1673,25 @@ public function data_unmigratable_versions(): array { ); } - public function test_output_singular_css_migration_keeps_backslashes_in_the_saved_sheet() { + public function test_output_singular_css_migration_keeps_backslashes_in_the_served_sheet() { $css = '.w-1\/2:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){width:50%}' . $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ); $expected = '.w-1\/2:where([class*="wp-block-atomic-wind-"], [class*="wp-block-atomic-wind-"] *){width:50%}' . self::VARIABLES_RULE . self::WRAPPER_SELECTOR . '{-webkit-text-size-adjust:100%;tab-size:4;-webkit-tap-highlight-color:transparent}' . self::UTILITY_RULE . self::ELEMENT_RULE; - $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + $this->render_post_cached_as( $css, '1.0.1' ); - $this->assertSame( $expected, get_post_meta( $post_id, '_atomic_wind_css', true ) ); + $this->assert_migrated_sheet_is_served( $expected ); + } + + public function test_rest_save_style_migration_keeps_backslashes_in_the_stored_sheet() { + $css = '.w-1\/2{width:50%}' . $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ); + $post_id = $this->save_style_then_render( $css, null ); + + $stored = $this->stored_pair( $post_id ); + + $this->assertStringStartsWith( '.w-1\/2{width:50%}', $stored[0] ); + $this->assertStringNotContainsString( 'line-height:1.5', $stored[0] ); } public function test_output_singular_css_leaves_a_wrapper_rule_without_typography_byte_identical() { @@ -1691,27 +1699,27 @@ public function test_output_singular_css_leaves_a_wrapper_rule_without_typograph $css = $variables . self::WRAPPER_SELECTOR . '{' . implode( ';', $this->legacy_wrapper_declarations() ) . '}'; $expected = $variables . self::WRAPPER_SELECTOR . '{-webkit-text-size-adjust:100%;tab-size:4;-webkit-tap-highlight-color:transparent}'; - $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + $this->render_post_cached_as( $css, '1.0.1' ); - $this->assert_migrated_sheet_is_served( $post_id, $expected ); + $this->assert_migrated_sheet_is_served( $expected ); } public function test_output_singular_css_migrates_a_wrapper_rule_with_deeply_nested_functions() { $css = self::WRAPPER_SELECTOR . '{line-height:1.5;width:calc(1px + min(2px, max(3px, 4px)));tab-size:4}'; $expected = self::WRAPPER_SELECTOR . '{width:calc(1px + min(2px, max(3px, 4px)));tab-size:4}'; - $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + $this->render_post_cached_as( $css, '1.0.1' ); - $this->assert_migrated_sheet_is_served( $post_id, $expected ); + $this->assert_migrated_sheet_is_served( $expected ); } public function test_output_singular_css_migrates_a_wrapper_rule_with_an_escaped_quote_in_a_string() { $css = self::WRAPPER_SELECTOR . '{line-height:1.5;--a:"x\";y";tab-size:4}'; $expected = self::WRAPPER_SELECTOR . '{--a:"x\";y";tab-size:4}'; - $post_id = $this->render_post_cached_as( $css, '1.0.1' ); + $this->render_post_cached_as( $css, '1.0.1' ); - $this->assert_migrated_sheet_is_served( $post_id, $expected ); + $this->assert_migrated_sheet_is_served( $expected ); } /** @@ -1735,9 +1743,9 @@ public function data_unverifiable_wrapper_bodies(): array { public function test_output_singular_css_migrates_real_generator_output() { $dir = __DIR__ . '/fixtures/atomic-wind/'; - $post_id = $this->render_post_cached_as( file_get_contents( $dir . 'sheet-1.0.1.css' ), '1.0.1' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents + $this->render_post_cached_as( file_get_contents( $dir . 'sheet-1.0.1.css' ), '1.0.1' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents - $this->assert_migrated_sheet_is_served( $post_id, file_get_contents( $dir . 'sheet-1.0.2.css' ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents + $this->assert_migrated_sheet_is_served( file_get_contents( $dir . 'sheet-1.0.2.css' ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents } public function test_output_singular_css_ignores_a_sheet_without_a_stamp() { @@ -1813,32 +1821,47 @@ private function fixture_sheet( $version ) { return file_get_contents( __DIR__ . '/fixtures/atomic-wind/sheet-' . $version . '.css' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents } - public function test_rest_save_style_without_a_version_is_a_legacy_sheet_that_gets_migrated() { - $post_id = $this->save_style_then_render( $this->fixture_sheet( '1.0.1' ), null ); + /** + * Helper: the stored sheet and stamp of a post. + * + * @param int $post_id Post ID. + * @return array{string, string} + */ + private function stored_pair( $post_id ) { + wp_cache_delete( $post_id, 'post_meta' ); - $this->assert_migrated_sheet_is_served( $post_id, $this->fixture_sheet( '1.0.2' ) ); + return array( + (string) get_post_meta( $post_id, '_atomic_wind_css', true ), + (string) get_post_meta( $post_id, '_atomic_wind_css_version', true ), + ); } - public function test_rest_save_style_without_a_version_stamps_the_legacy_version() { - $post_id = $this->make_atomic_wind_post( 'flex' ); + public function test_rest_save_style_without_a_version_stores_the_migrated_sheet_stamped_current() { + $post_id = $this->save_style_then_render( $this->fixture_sheet( '1.0.1' ), null ); - $this->post_atomic_wind_route( - 'style', - array( - 'postId' => $post_id, - 'css' => '.flex{display:flex}', - ) - ); + $this->assertSame( array( $this->fixture_sheet( '1.0.2' ), '1.0.2' ), $this->stored_pair( $post_id ) ); + $this->assert_migrated_sheet_is_served( $this->fixture_sheet( '1.0.2' ) ); + } - $this->assertSame( '1.0.1', get_post_meta( $post_id, '_atomic_wind_css_version', true ) ); + public function test_rest_save_style_with_the_previous_version_stores_the_migrated_sheet_stamped_current() { + $post_id = $this->save_style_then_render( $this->fixture_sheet( '1.0.1' ), '1.0.1' ); + + $this->assertSame( array( $this->fixture_sheet( '1.0.2' ), '1.0.2' ), $this->stored_pair( $post_id ) ); } - public function test_rest_save_style_with_the_current_version_serves_the_sheet_as_posted() { + public function test_rest_save_style_with_the_current_version_stores_the_sheet_byte_exact() { $css = $this->fixture_sheet( '1.0.2' ); $post_id = $this->save_style_then_render( $css, Atomic_Wind_Blocks::ATOMIC_WIND_CSS_VERSION ); - $this->assertSame( Atomic_Wind_Blocks::ATOMIC_WIND_CSS_VERSION, get_post_meta( $post_id, '_atomic_wind_css_version', true ) ); - $this->assert_migrated_sheet_is_served( $post_id, $css ); + $this->assertSame( array( $css, '1.0.2' ), $this->stored_pair( $post_id ) ); + $this->assert_migrated_sheet_is_served( $css ); + } + + public function test_rest_save_style_without_a_version_keeps_a_current_format_sheet() { + $css = $this->fixture_sheet( '1.0.2' ); + $post_id = $this->save_style_then_render( $css, null ); + + $this->assertSame( array( $css, '1.0.2' ), $this->stored_pair( $post_id ) ); } /** @@ -1847,110 +1870,156 @@ public function test_rest_save_style_with_the_current_version_serves_the_sheet_a public function test_rest_save_style_treats_an_invalid_version_as_legacy( $version ) { $post_id = $this->save_style_then_render( $this->fixture_sheet( '1.0.1' ), $version ); - $this->assert_migrated_sheet_is_served( $post_id, $this->fixture_sheet( '1.0.2' ) ); + $this->assertSame( array( $this->fixture_sheet( '1.0.2' ), '1.0.2' ), $this->stored_pair( $post_id ) ); } public function data_invalid_versions(): array { return array( - 'word' => array( 'abc' ), - 'two parts' => array( '1.0' ), - 'empty' => array( '' ), - 'suffix' => array( "1.0.2\n" ), - 'prerelease' => array( '1.0.2-beta' ), + 'word' => array( 'abc' ), + 'two parts' => array( '1.0' ), + 'empty' => array( '' ), + 'suffix' => array( "1.0.2\n" ), + 'prerelease' => array( '1.0.2-beta' ), + 'five digits' => array( '1.0.10000' ), + 'thousands of digits' => array( '1.' . str_repeat( '0', 5000 ) . '.2' ), ); } - public function test_rest_save_style_with_an_unknown_version_is_ignored_on_output() { - $css = $this->fixture_sheet( '1.0.2' ); - $post_id = $this->save_style_then_render( $css, '9.9.9' ); + public function test_rest_save_style_rejects_a_version_that_is_not_text() { + $post_id = $this->make_atomic_wind_post( 'flex' ); + $response = $this->post_atomic_wind_route( + 'style', + array( + 'postId' => $post_id, + 'css' => $this->fixture_sheet( '1.0.1' ), + 'version' => array( '1.0.1' ), + ) + ); - $this->assert_sheet_not_migrated( $post_id, $css, '9.9.9' ); + $this->assertSame( 400, $response->get_status() ); + $this->assertFalse( metadata_exists( 'post', $post_id, '_atomic_wind_css' ) ); } /** - * Helper: make the first read of a post's cached sheet return a stale sheet whatever the database holds. - * - * @param int $post_id Post ID. - * @param string $css Sheet to read. - * @param string $version Stamp to read. - * @return callable The filter, to remove. + * @dataProvider data_unsaveable_sheets */ - private function read_stale_sheet( $post_id, $css, $version ) { - $served = array(); - $filter = static function ( $value, $object_id, $meta_key ) use ( $post_id, $css, $version, &$served ) { - $stale = array( - '_atomic_wind_css' => $css, - '_atomic_wind_css_version' => $version, - ); + public function test_rest_save_style_stores_nothing_for_a_sheet_it_cannot_bring_to_the_current_version( $css, $version ) { + $post_id = $this->make_atomic_wind_post( 'flex' ); + $this->set_cached_css( $post_id, '.cached{color:red}' ); - if ( $object_id !== $post_id || ! isset( $stale[ $meta_key ] ) || isset( $served[ $meta_key ] ) ) { - return $value; - } + $params = array( + 'postId' => $post_id, + 'css' => $css, + ); - $served[ $meta_key ] = true; + if ( null !== $version ) { + $params['version'] = $version; + } - return array( $stale[ $meta_key ] ); - }; + $response = $this->post_atomic_wind_route( 'style', $params ); + + $this->assertSame( 400, $response->get_status() ); + $this->assertFalse( $response->get_data()['success'] ); + $this->assertSame( array( '.cached{color:red}', '1.0.2' ), $this->stored_pair( $post_id ) ); + } - add_filter( 'get_post_metadata', $filter, 10, 3 ); + public function data_unsaveable_sheets(): array { + $unbalanced = ':where([class*="wp-block-atomic-wind-"]){line-height:1.5;--a:it\'s;tab-size:4}'; - return $filter; + return array( + 'unparsable legacy wrapper rule' => array( $unbalanced, null ), + 'unparsable, stated legacy' => array( $unbalanced, '1.0.1' ), + 'older unknown version' => array( '.flex{display:flex}', '0.9.0' ), + 'future version' => array( '.flex{display:flex}', '9.9.9' ), + ); } - public function test_output_singular_css_serves_a_sheet_saved_since_it_was_read_without_overwriting_it() { + public function test_reading_a_legacy_pair_serves_it_migrated_every_time_and_never_writes() { $this->reset_style_globals(); + $css = $this->fixture_sheet( '1.0.1' ); $post_id = $this->make_atomic_wind_post( 'flex' ); - $newer = $this->fixture_sheet( '1.0.2' ) . '.newer{color:red}'; - update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $newer ) ); - update_post_meta( $post_id, '_atomic_wind_css_version', '1.0.2' ); + update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $css ) ); + update_post_meta( $post_id, '_atomic_wind_css_version', '1.0.1' ); - $filter = $this->read_stale_sheet( $post_id, $this->fixture_sheet( '1.0.1' ), '1.0.1' ); + $writes = array(); + $spy = static function ( $query ) use ( &$writes ) { + if ( preg_match( '/^\s*(INSERT|UPDATE|DELETE|REPLACE)\b/i', $query ) && false !== stripos( $query, 'postmeta' ) ) { + $writes[] = $query; + } - $this->go_to( get_permalink( $post_id ) ); - $this->instance->output_singular_css(); - remove_filter( 'get_post_metadata', $filter, 10 ); + return $query; + }; - $this->assertSame( $newer, $this->inline_style_for( 'atomic-wind-tailwind' ) ); - $this->assertFalse( wp_script_is( 'atomic-wind-tailwind-generator', 'enqueued' ) ); - $this->assertSame( $newer, get_post_meta( $post_id, '_atomic_wind_css', true ) ); - $this->assertSame( '1.0.2', get_post_meta( $post_id, '_atomic_wind_css_version', true ) ); - } + add_filter( 'query', $spy ); - public function test_output_singular_css_does_not_restore_a_sheet_deleted_since_it_was_read() { - $this->reset_style_globals(); + for ( $i = 0; $i < 2; $i++ ) { + $this->reset_style_globals(); + $this->go_to( get_permalink( $post_id ) ); + $this->instance->output_singular_css(); - $post_id = $this->make_atomic_wind_post( 'flex' ); - $filter = $this->read_stale_sheet( $post_id, $this->fixture_sheet( '1.0.1' ), '1.0.1' ); + $this->assert_migrated_sheet_is_served( $this->fixture_sheet( '1.0.2' ) ); + } - $this->go_to( get_permalink( $post_id ) ); - $this->instance->output_singular_css(); - remove_filter( 'get_post_metadata', $filter, 10 ); + remove_filter( 'query', $spy ); - $this->assertSame( '', $this->inline_style_for( 'atomic-wind-tailwind' ) ); - $this->assertTrue( wp_script_is( 'atomic-wind-tailwind-generator', 'enqueued' ) ); - $this->assertFalse( metadata_exists( 'post', $post_id, '_atomic_wind_css' ) ); - $this->assertFalse( metadata_exists( 'post', $post_id, '_atomic_wind_css_version' ) ); + $this->assertSame( array(), $writes ); + $this->assertSame( array( $css, '1.0.1' ), $this->stored_pair( $post_id ) ); } - public function test_output_singular_css_restamps_an_unchanged_sheet_and_keeps_serving_it() { + public function test_a_current_format_sheet_beside_the_previous_stamp_is_served_unchanged() { $css = $this->fixture_sheet( '1.0.2' ); $post_id = $this->render_post_cached_as( $css, '1.0.1' ); - $this->assert_migrated_sheet_is_served( $post_id, $css ); + $this->assert_migrated_sheet_is_served( $css ); + $this->assertSame( array( $css, '1.0.1' ), $this->stored_pair( $post_id ) ); + } + public function test_a_versionless_save_landing_between_the_writes_of_a_versioned_save_cannot_mislabel_its_sheet() { $this->reset_style_globals(); - $this->go_to( get_permalink( $post_id ) ); - $this->instance->output_singular_css(); - $this->assert_migrated_sheet_is_served( $post_id, $css ); - } + $legacy = $this->fixture_sheet( '1.0.1' ) . '.late{color:red}'; + $post_id = $this->make_atomic_wind_post( 'flex' ); + update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ) ) ); + update_post_meta( $post_id, '_atomic_wind_css_version', '1.0.1' ); - public function test_rest_save_style_without_a_version_keeps_serving_a_current_format_sheet() { - $css = $this->fixture_sheet( '1.0.2' ); - $post_id = $this->save_style_then_render( $css, null ); + $injected = false; + $interject = function ( $meta_id, $object_id, $meta_key ) use ( &$injected, $post_id, $legacy ) { + if ( $injected || $object_id !== $post_id || '_atomic_wind_css' !== $meta_key ) { + return; + } - $this->assert_migrated_sheet_is_served( $post_id, $css ); + $injected = true; + $this->post_atomic_wind_route( + 'style', + array( + 'postId' => $post_id, + 'css' => $legacy, + ) + ); + }; + + add_action( 'updated_post_meta', $interject, 10, 3 ); + $this->post_atomic_wind_route( + 'style', + array( + 'postId' => $post_id, + 'css' => $this->fixture_sheet( '1.0.2' ), + 'version' => '1.0.2', + ) + ); + remove_action( 'updated_post_meta', $interject, 10 ); + + $this->assertTrue( $injected ); + + list( $stored, $stamp ) = $this->stored_pair( $post_id ); + + $this->assertFalse( '1.0.2' === $stamp && $legacy === $stored, 'A legacy sheet must not be stamped with the current version.' ); + + $this->go_to( get_permalink( $post_id ) ); + $this->instance->output_singular_css(); + + $this->assert_migrated_sheet_is_served( $this->fixture_sheet( '1.0.2' ) . '.late{color:red}' ); } public function test_css_version_matches_the_generator_constant() { @@ -1974,151 +2043,6 @@ public function test_warm_page_loads_the_frontend_generator_that_stamps_the_css_ $this->assertMatchesRegularExpression( '##', $html ); } - /** - * Helper: read a meta row straight from the database, bypassing the object cache. - * - * @param int $post_id Post ID. - * @param string $key Meta key. - * @return string|null - */ - private function stored_meta( $post_id, $key ) { - global $wpdb; - - return $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM {$wpdb->postmeta} WHERE post_id = %d AND meta_key = %s", $post_id, $key ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching - } - - /** - * Helper: serve the sheet that is stored now as read, and store the replacement right after. - * - * @param int $post_id Post ID. - * @param string $replacement Sheet written to the database once the read has happened. - * @return callable The filter, to remove. - */ - private function replace_sheet_after_read( $post_id, $replacement ) { - global $wpdb; - - $done = false; - $filter = function ( $value, $object_id, $meta_key ) use ( $post_id, $replacement, &$done, $wpdb ) { - if ( $done || $object_id !== $post_id || '_atomic_wind_css' !== $meta_key ) { - return $value; - } - - $done = true; - $read = $this->stored_meta( $post_id, '_atomic_wind_css' ); - - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching - $wpdb->update( $wpdb->postmeta, array( 'meta_value' => $replacement ), array( 'post_id' => $post_id, 'meta_key' => '_atomic_wind_css' ) ); - - return array( $read ); - }; - - add_filter( 'get_post_metadata', $filter, 10, 3 ); - - return $filter; - } - - /** - * @dataProvider data_sheet_variants_the_column_collation_treats_as_equal - */ - public function test_migration_does_not_overwrite_a_sheet_that_differs_only_by_case_or_trailing_space( $variant ) { - $this->reset_style_globals(); - - $sheet = $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ) . '.bg-\[\#fff\]{background-color:#fff}'; - $variant = $variant( $sheet ); - $post_id = $this->make_atomic_wind_post( 'flex' ); - update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $sheet ) ); - update_post_meta( $post_id, '_atomic_wind_css_version', '1.0.1' ); - - $filter = $this->replace_sheet_after_read( $post_id, $variant ); - - $this->go_to( get_permalink( $post_id ) ); - $this->instance->output_singular_css(); - remove_filter( 'get_post_metadata', $filter, 10 ); - - $this->assertSame( $variant, $this->stored_meta( $post_id, '_atomic_wind_css' ) ); - $this->assertSame( '1.0.1', $this->stored_meta( $post_id, '_atomic_wind_css_version' ) ); - } - - public function data_sheet_variants_the_column_collation_treats_as_equal(): array { - return array( - 'letter case' => array( - static function ( $sheet ) { - return str_replace( '#fff', '#FFF', $sheet ); - }, - ), - 'trailing space' => array( - static function ( $sheet ) { - return $sheet . ' '; - }, - ), - ); - } - - public function test_migration_does_not_relabel_a_different_legacy_sheet_when_the_sheet_it_read_was_unchanged() { - $this->reset_style_globals(); - - $sheet = $this->fixture_sheet( '1.0.2' ); - $legacy = $sheet . '.legacy{color:red}'; - $post_id = $this->make_atomic_wind_post( 'flex' ); - update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $sheet ) ); - update_post_meta( $post_id, '_atomic_wind_css_version', '1.0.1' ); - - $filter = $this->replace_sheet_after_read( $post_id, $legacy ); - - $this->go_to( get_permalink( $post_id ) ); - $this->instance->output_singular_css(); - remove_filter( 'get_post_metadata', $filter, 10 ); - - $this->assertSame( $legacy, $this->stored_meta( $post_id, '_atomic_wind_css' ) ); - $this->assertSame( '1.0.1', $this->stored_meta( $post_id, '_atomic_wind_css_version' ) ); - } - - public function test_migration_swaps_sheet_and_stamp_in_one_statement_and_survives_a_versionless_save_before_it() { - $this->reset_style_globals(); - - $legacy = $this->fixture_sheet( '1.0.1' ) . '.late{color:red}'; - $post_id = $this->make_atomic_wind_post( 'flex' ); - update_post_meta( $post_id, '_atomic_wind_css', wp_slash( $this->sheet_with_wrapper( $this->legacy_wrapper_declarations() ) ) ); - update_post_meta( $post_id, '_atomic_wind_css_version', '1.0.1' ); - - $updates = array(); - $saving = false; - $interject = function ( $query ) use ( &$updates, &$saving, $post_id, $legacy ) { - if ( $saving || 0 !== strpos( ltrim( $query ), 'UPDATE' ) || false === strpos( $query, '_atomic_wind_css' ) ) { - return $query; - } - - $updates[] = $query; - - if ( false !== strpos( $query, '_atomic_wind_css_version' ) ) { - $saving = true; - $this->post_atomic_wind_route( - 'style', - array( - 'postId' => $post_id, - 'css' => $legacy, - ) - ); - $saving = false; - } - - return $query; - }; - - add_filter( 'query', $interject ); - $this->go_to( get_permalink( $post_id ) ); - $this->instance->output_singular_css(); - remove_filter( 'query', $interject ); - - $this->assertFalse( - '1.0.2' === $this->stored_meta( $post_id, '_atomic_wind_css_version' ) && $legacy === $this->stored_meta( $post_id, '_atomic_wind_css' ), - 'A legacy sheet must not end up stamped with the current version.' - ); - $this->assertSame( $legacy, $this->stored_meta( $post_id, '_atomic_wind_css' ) ); - $this->assertSame( '1.0.1', $this->stored_meta( $post_id, '_atomic_wind_css_version' ) ); - $this->assertCount( 1, $updates ); - } - public function test_clear_cached_css_drops_the_version_stamp() { $post_id = $this->make_atomic_wind_post( 'flex' ); $this->set_cached_css( $post_id, '.flex{display:flex}' ); From 293675c25a29da6a1bc2a4f014865c9dea138f9f Mon Sep 17 00:00:00 2001 From: abaicus Date: Fri, 20 Nov 2026 13:12:20 +0200 Subject: [PATCH 11/30] test: make the Atomic Wind generator version test fail without a version (#3185) Co-Authored-By: Claude Fable 5.2 --- src/atomic-wind/tailwind/test/generator-frontend.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/atomic-wind/tailwind/test/generator-frontend.test.js b/src/atomic-wind/tailwind/test/generator-frontend.test.js index e99c26f27..8011c064c 100644 --- a/src/atomic-wind/tailwind/test/generator-frontend.test.js +++ b/src/atomic-wind/tailwind/test/generator-frontend.test.js @@ -19,6 +19,7 @@ describe( 'frontend generator', () => { const sheet = document.getElementById( 'atomic-wind-tailwind' ); expect( sheet.textContent ).toContain( '.flex' ); + expect( sheet.dataset.cssVersion ).toMatch( /^\d+\.\d+\.\d+$/ ); expect( sheet.dataset.cssVersion ).toBe( CSS_VERSION ); } ); } ); From 4654cc1467ecdfc49290fe24a94b84abaef21580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Fri, 20 Nov 2026 18:01:49 +0200 Subject: [PATCH 12/30] fix: reject non-alphanumeric Mailchimp data centers to prevent SSRF The Mailchimp data center is taken from the part of the API key after the dash and used as the request host (`https://.api.mailchimp.com/...`). validate_api_key() only checked for a single dash, so a Contributor could submit a key such as `x-attacker:8443/r#` through the form editor endpoint and make the server request an arbitrary host, including internal services. - Require the data center to be a bare `[a-z0-9]+` token, so it can only resolve to `*.api.mailchimp.com`. server_name is set only through set_api_key(), which runs this validation first. - Defense in depth: send every Mailchimp request with wp_safe_remote_get()/ wp_safe_remote_post(), so a redirect to a private or loopback address is refused even if a host ever reached the request builder. Reported-by: Deus Rex research team --- .../providers/class-mailchimp.php | 12 ++-- tests/test-mailchimp-provider.php | 69 +++++++++++++++++++ 2 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 tests/test-mailchimp-provider.php diff --git a/inc/integrations/providers/class-mailchimp.php b/inc/integrations/providers/class-mailchimp.php index 0917e050e..c54134a8f 100644 --- a/inc/integrations/providers/class-mailchimp.php +++ b/inc/integrations/providers/class-mailchimp.php @@ -88,7 +88,7 @@ public function get_lists() { if ( function_exists( 'vip_safe_wp_remote_get' ) ) { $response = vip_safe_wp_remote_get( $url, '', 3, 1, 20, $args ); } else { - $response = wp_remote_get( $url, $args ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get + $response = wp_safe_remote_get( $url, $args ); } $body = json_decode( wp_remote_retrieve_body( $response ), true ); @@ -143,7 +143,7 @@ public function make_subscribe_request( $email ) { 'body' => wp_json_encode( $payload ), ); - return wp_remote_post( $url, $args ); + return wp_safe_remote_post( $url, $args ); } /** @@ -226,7 +226,9 @@ public static function validate_api_key( $api_key ) { } $key_info = explode( '-', $api_key ); - if ( 2 !== count( $key_info ) || ! isset( $key_info[1] ) ) { + + // The data center becomes the request host, so it must be a bare `` token (e.g. `us1`), never a host, port or path. + if ( 2 !== count( $key_info ) || ! isset( $key_info[1] ) || ! preg_match( '/^[a-z0-9]+$/', $key_info[1] ) ) { return array( 'valid' => false, 'reason' => __( 'Invalid API Key format!', 'otter-blocks' ), @@ -260,7 +262,7 @@ private function get_new_user_status_mailchimp( $list_id ) { ), ); - $response = wp_remote_post( $url, $args ); + $response = wp_safe_remote_post( $url, $args ); $body = json_decode( wp_remote_retrieve_body( $response ), true ); if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { @@ -320,7 +322,7 @@ public function get_merge_fields() { if ( function_exists( 'vip_safe_wp_remote_get' ) ) { $response = vip_safe_wp_remote_get( $url, '', 3, 1, 20, $args ); } else { - $response = wp_remote_get( $url, $args ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get + $response = wp_safe_remote_get( $url, $args ); } if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { diff --git a/tests/test-mailchimp-provider.php b/tests/test-mailchimp-provider.php new file mode 100644 index 000000000..f8f9d4539 --- /dev/null +++ b/tests/test-mailchimp-provider.php @@ -0,0 +1,69 @@ +assertFalse( $result['valid'], "Expected '$api_key' to be rejected." ); + $this->assertSame( Form_Data_Response::ERROR_PROVIDER_INVALID_API_KEY_FORMAT, $result['code'], "Expected '$api_key' to fail the format check." ); + } + } + + /** + * A real key (secret dash data center) still validates, so the guard does not break normal use. + */ + public function test_accepts_a_real_mailchimp_key() { + foreach ( array( 'abc123def456-us1', 'abc123def456-us21', '0a1b2c3d4e5f6-gb7' ) as $api_key ) { + $this->assertTrue( Mailchimp_Integration::validate_api_key( $api_key )['valid'], "Expected '$api_key' to validate." ); + } + } + + /** + * A key without exactly one dash keeps failing the format check, as before. + */ + public function test_rejects_a_key_without_a_single_data_center_segment() { + foreach ( array( 'nodash', 'two-dashes-here' ) as $api_key ) { + $result = Mailchimp_Integration::validate_api_key( $api_key ); + + $this->assertFalse( $result['valid'], "Expected '$api_key' to be rejected." ); + $this->assertSame( Form_Data_Response::ERROR_PROVIDER_INVALID_API_KEY_FORMAT, $result['code'] ); + } + } + + /** + * An empty key reports the missing-key reason, not the format one. + */ + public function test_rejects_an_empty_key_as_missing() { + $result = Mailchimp_Integration::validate_api_key( '' ); + + $this->assertFalse( $result['valid'] ); + $this->assertSame( Form_Data_Response::ERROR_PROVIDER_INVALID_KEY, $result['code'] ); + } +} From 81bc26179932cc3667f649f5a6cda5d3e0a91c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Fri, 20 Nov 2026 18:08:13 +0200 Subject: [PATCH 13/30] fix: query only publicly viewable post types in Posts Grid and Atomic Wind Posts Grid passed its `postTypes` attribute, and the Atomic Wind box passed its `queryPostType` attribute, straight into WP_Query without checking that the post type is public. A Contributor could point either block at a non-public post type whose entries use the `publish` status (a contact-form inbox, store coupons) and read their titles and excerpts in the preview. - Posts Grid: keep only `is_post_type_viewable()` types; an explicit list of only non-public types returns nothing instead of falling back to posts. - Atomic Wind box: skip the query loop when `queryPostType` is not viewable. - Atomic Wind custom field: skip protected (`_`-prefixed) meta keys, so a Contributor cannot print a submitter's stored contact data either. This extends the `is_post_type_viewable()` check added for the `/otter/v1/dynamic` REST routes to these two block renderers. Reported-by: Deus Rex research team --- inc/plugins/class-atomic-wind-blocks.php | 12 +++- inc/render/class-posts-grid-block.php | 14 +++- tests/test-atomic-wind-blocks.php | 85 ++++++++++++++++++++++++ tests/test-post-grid-block.php | 69 +++++++++++++++++++ 4 files changed, 176 insertions(+), 4 deletions(-) diff --git a/inc/plugins/class-atomic-wind-blocks.php b/inc/plugins/class-atomic-wind-blocks.php index b6de8b43d..9478ad484 100644 --- a/inc/plugins/class-atomic-wind-blocks.php +++ b/inc/plugins/class-atomic-wind-blocks.php @@ -1253,11 +1253,18 @@ public function render_query_loop( $block_content, $block ) { return $block_content; } + // The post type comes from the request. Only loop over a publicly viewable one, so a non-public + // type (e.g. a contact-form inbox) whose entries are stored as `publish` cannot be exposed. + $post_type = sanitize_key( $post_type ); + if ( ! is_post_type_viewable( $post_type ) ) { + return ''; + } + global $post; $saved_post = $post; $args = array( - 'post_type' => sanitize_key( $post_type ), + 'post_type' => $post_type, 'posts_per_page' => isset( $block['attrs']['queryCount'] ) ? min( absint( $block['attrs']['queryCount'] ), 100 ) : 3, 'orderby' => isset( $block['attrs']['queryOrderBy'] ) ? sanitize_key( $block['attrs']['queryOrderBy'] ) : sanitize_key( 'date' ), 'order' => isset( $block['attrs']['queryOrder'] ) && strtoupper( $block['attrs']['queryOrder'] ) === 'ASC' ? 'ASC' : 'DESC', @@ -1391,7 +1398,8 @@ public function render_post_fields( $block_content, $block ) { break; case 'custom_field': $meta_key = isset( $block['attrs']['customFieldKey'] ) ? sanitize_text_field( $block['attrs']['customFieldKey'] ) : ''; - if ( $meta_key ) { + // Never print a protected meta key (e.g. a `_`-prefixed field holding a form submitter's data). + if ( $meta_key && ! is_protected_meta( $meta_key, 'post' ) ) { $value = ''; if ( function_exists( 'get_field' ) ) { $acf = get_field( $meta_key, get_the_ID() ); diff --git a/inc/render/class-posts-grid-block.php b/inc/render/class-posts-grid-block.php index 623109101..3ccdbbfba 100644 --- a/inc/render/class-posts-grid-block.php +++ b/inc/render/class-posts-grid-block.php @@ -359,8 +359,18 @@ protected function retrieve_posts( $attributes, $count_posts, $page_number, &$to $categories = join( ', ', $cats ); } + // Only query publicly viewable post types; the attribute comes from the request and could name + // a non-public type (e.g. a contact-form inbox) whose entries are stored with the `publish` status. + $requested_post_types = (array) $attributes['postTypes']; + $post_types = array_values( array_filter( $requested_post_types, 'is_post_type_viewable' ) ); + + // An explicit list of only non-viewable types returns nothing, instead of falling back to posts. + if ( ! empty( $requested_post_types ) && empty( $post_types ) ) { + return array(); + } + $args = array( - 'post_type' => $attributes['postTypes'], + 'post_type' => $post_types, 'posts_per_page' => $attributes['postsToShow'], 'post_status' => 'publish', 'order' => isset( $attributes['order'] ) ? $attributes['order'] : 'DESC', @@ -378,7 +388,7 @@ protected function retrieve_posts( $attributes, $count_posts, $page_number, &$to } // Handle the case when the post type is a WooCommerce product. - if ( isset( $args['post_type'] ) && in_array( 'product', $args['post_type'] ) && function_exists( 'wc_get_products' ) ) { + if ( in_array( 'product', $args['post_type'], true ) && function_exists( 'wc_get_products' ) ) { if ( isset( $attributes['categories'] ) ) { diff --git a/tests/test-atomic-wind-blocks.php b/tests/test-atomic-wind-blocks.php index eec14bc58..f3ac7677e 100644 --- a/tests/test-atomic-wind-blocks.php +++ b/tests/test-atomic-wind-blocks.php @@ -2597,4 +2597,89 @@ public function test_enqueue_base_css_registers_frontend_style_without_enqueuing $this->inline_style_for( 'atomic-wind-base' ) ); } + + // ------------------------------------------------------- + // render_query_loop — post type visibility (otter-internals#319) + // ------------------------------------------------------- + + public function test_query_loop_skips_non_viewable_post_type() { + register_post_type( + 'otter_secret', + array( + 'public' => false, + 'publicly_queryable' => false, + 'exclude_from_search' => true, + ) + ); + $this->factory()->post->create( + array( + 'post_type' => 'otter_secret', + 'post_status' => 'publish', + 'post_title' => 'Secret Record Title', + ) + ); + + $block = $this->make_block( 'atomic-wind/box', array( 'queryPostType' => 'otter_secret' ) ); + $content = '
INNER
'; + + $result = $this->instance->render_query_loop( $content, $block ); + + $this->assertSame( '', $result ); + $this->assertStringNotContainsString( 'Secret Record Title', $result ); + + unregister_post_type( 'otter_secret' ); + } + + public function test_query_loop_renders_a_viewable_post_type() { + $block = $this->make_block( 'atomic-wind/box', array( 'queryPostType' => 'post' ) ); + $content = '
INNER
'; + + $result = $this->instance->render_query_loop( $content, $block ); + + // The post created in set_up() is a viewable match, so the wrapper is emitted. + $this->assertNotSame( '', $result ); + $this->assertStringContainsString( 'wp-block-atomic-wind-box', $result ); + } + + // ------------------------------------------------------- + // render_post_fields — protected custom field (otter-internals#319) + // ------------------------------------------------------- + + public function test_custom_field_skips_protected_meta() { + update_post_meta( $this->post_id, '_protected', 'Protected Meta Value' ); + + $this->reset_in_query( true ); + global $post; + $post = get_post( $this->post_id ); + setup_postdata( $post ); + + $block = $this->make_block( 'atomic-wind/text', array( 'postField' => 'custom_field', 'customFieldKey' => '_protected' ) ); + $content = '

Placeholder

'; + + $result = $this->instance->render_post_fields( $content, $block ); + + $this->assertStringNotContainsString( 'Protected Meta Value', $result ); + $this->assertStringContainsString( 'Placeholder', $result ); + + wp_reset_postdata(); + } + + public function test_custom_field_renders_a_public_meta_key() { + update_post_meta( $this->post_id, 'otter_public_field', 'Public Meta Value' ); + + $this->reset_in_query( true ); + global $post; + $post = get_post( $this->post_id ); + setup_postdata( $post ); + + $block = $this->make_block( 'atomic-wind/text', array( 'postField' => 'custom_field', 'customFieldKey' => 'otter_public_field' ) ); + $content = '

Placeholder

'; + + $result = $this->instance->render_post_fields( $content, $block ); + + $this->assertStringContainsString( 'Public Meta Value', $result ); + $this->assertStringNotContainsString( 'Placeholder', $result ); + + wp_reset_postdata(); + } } diff --git a/tests/test-post-grid-block.php b/tests/test-post-grid-block.php index 5ddec6774..2b1b1291a 100644 --- a/tests/test-post-grid-block.php +++ b/tests/test-post-grid-block.php @@ -125,4 +125,73 @@ public function test_render_sanitization() { $this->assertEquals( $expected, $output ); } + + /** + * Render the block for the given post types and return its HTML. + * + * @param string[] $post_types Post types to query. + * @return string + */ + private function render_for_post_types( $post_types ) { + $this->post_grid_block = new Posts_Grid_Block(); + WP_Block_Supports::init(); + WP_Block_Supports::$block_to_render = array( 'blockName' => 'themeisle-blocks/posts-grid' ); + + $attributes = unserialize( serialize( $this->attributes ) ); + $attributes['postTypes'] = $post_types; + + return $this->post_grid_block->render( $attributes ); + } + + /** + * A non-public post type is never queried, so its records cannot be exposed + * through the block (otter-internals#319). + */ + public function test_render_skips_non_public_post_types() { + register_post_type( + 'otter_secret', + array( + 'public' => false, + 'publicly_queryable' => false, + 'exclude_from_search' => true, + ) + ); + $this->factory()->post->create( + array( + 'post_type' => 'otter_secret', + 'post_status' => 'publish', + 'post_title' => 'Secret Record Title', + ) + ); + $this->factory()->post->create( + array( + 'post_type' => 'post', + 'post_status' => 'publish', + 'post_title' => 'Public Blog Title', + ) + ); + + $this->assertStringNotContainsString( 'Secret Record Title', $this->render_for_post_types( array( 'otter_secret' ) ) ); + + $mixed = $this->render_for_post_types( array( 'otter_secret', 'post' ) ); + $this->assertStringNotContainsString( 'Secret Record Title', $mixed ); + $this->assertStringContainsString( 'Public Blog Title', $mixed ); + + unregister_post_type( 'otter_secret' ); + } + + /** + * A public post type still renders, so the filter does not block normal use. + */ + public function test_render_keeps_public_post_types() { + $this->factory()->post->create( + array( + 'post_type' => 'post', + 'post_status' => 'publish', + 'post_title' => 'Public Blog Title', + ) + ); + + $this->assertStringContainsString( 'Public Blog Title', $this->render_for_post_types( array( 'post' ) ) ); + } } From e7737cd58336eef321169d90e4f09acbaf561db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Fri, 20 Nov 2026 18:50:03 +0200 Subject: [PATCH 14/30] fix: keep wp_remote_* for Mailchimp and disable redirects instead of wp_safe_* wp_safe_remote_get()/wp_safe_remote_post() run wp_http_validate_url() before the HTTP proxy is applied, so on a site that reaches the internet only through WP_PROXY_HOST they would reject the Mailchimp host that local DNS cannot resolve, breaking lists, merge fields and subscriptions. The data-center validation already pins every request host to *.api.mailchimp.com, so the redirect concern is covered by passing 'redirection' => 0 on the normal wp_remote_* calls, with no DNS/proxy regression. - Revert the four Mailchimp requests to wp_remote_get()/wp_remote_post(). - Add 'redirection' => 0 to each request, so a response cannot pivot the request to another address. - Add a test that captures the get_lists() request and asserts the host is the validated data center and redirection is 0. --- .../providers/class-mailchimp.php | 30 +++++++++++-------- tests/test-mailchimp-provider.php | 30 +++++++++++++++++++ 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/inc/integrations/providers/class-mailchimp.php b/inc/integrations/providers/class-mailchimp.php index c54134a8f..b839a68b3 100644 --- a/inc/integrations/providers/class-mailchimp.php +++ b/inc/integrations/providers/class-mailchimp.php @@ -77,8 +77,9 @@ public function get_lists() { $url = 'https://' . $this->server_name . '.api.mailchimp.com/3.0/lists?count=1000'; $args = array( - 'method' => 'GET', - 'headers' => array( + 'method' => 'GET', + 'redirection' => 0, // Mailchimp returns data directly; never follow a redirect (defense in depth). + 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( 'user:' . $this->api_key ), ), ); @@ -88,7 +89,7 @@ public function get_lists() { if ( function_exists( 'vip_safe_wp_remote_get' ) ) { $response = vip_safe_wp_remote_get( $url, '', 3, 1, 20, $args ); } else { - $response = wp_safe_remote_get( $url, $args ); + $response = wp_remote_get( $url, $args ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get } $body = json_decode( wp_remote_retrieve_body( $response ), true ); @@ -136,14 +137,15 @@ public function make_subscribe_request( $email ) { } $args = array( - 'method' => 'PUT', - 'headers' => array( + 'method' => 'PUT', + 'redirection' => 0, // Mailchimp returns data directly; never follow a redirect (defense in depth). + 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( 'user:' . $this->api_key ), ), - 'body' => wp_json_encode( $payload ), + 'body' => wp_json_encode( $payload ), ); - return wp_safe_remote_post( $url, $args ); + return wp_remote_post( $url, $args ); } /** @@ -256,13 +258,14 @@ public static function validate_api_key( $api_key ) { private function get_new_user_status_mailchimp( $list_id ) { $url = 'https://' . $this->server_name . '.api.mailchimp.com/3.0/lists/' . $list_id; $args = array( - 'method' => 'GET', - 'headers' => array( + 'method' => 'GET', + 'redirection' => 0, // Mailchimp returns data directly; never follow a redirect (defense in depth). + 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( 'user:' . $this->api_key ), ), ); - $response = wp_safe_remote_post( $url, $args ); + $response = wp_remote_post( $url, $args ); $body = json_decode( wp_remote_retrieve_body( $response ), true ); if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { @@ -313,8 +316,9 @@ private function is_credential_error( $response_code ) { public function get_merge_fields() { $url = 'https://' . $this->server_name . '.api.mailchimp.com/3.0/lists/' . $this->list_id . '/merge-fields'; $args = array( - 'method' => 'GET', - 'headers' => array( + 'method' => 'GET', + 'redirection' => 0, // Mailchimp returns data directly; never follow a redirect (defense in depth). + 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( 'user:' . $this->api_key ), ), ); @@ -322,7 +326,7 @@ public function get_merge_fields() { if ( function_exists( 'vip_safe_wp_remote_get' ) ) { $response = vip_safe_wp_remote_get( $url, '', 3, 1, 20, $args ); } else { - $response = wp_safe_remote_get( $url, $args ); + $response = wp_remote_get( $url, $args ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get } if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { diff --git a/tests/test-mailchimp-provider.php b/tests/test-mailchimp-provider.php index f8f9d4539..dc3189526 100644 --- a/tests/test-mailchimp-provider.php +++ b/tests/test-mailchimp-provider.php @@ -66,4 +66,34 @@ public function test_rejects_an_empty_key_as_missing() { $this->assertFalse( $result['valid'] ); $this->assertSame( Form_Data_Response::ERROR_PROVIDER_INVALID_KEY, $result['code'] ); } + + /** + * Mailchimp requests go only to the validated data center host and do not follow + * redirects, so a response cannot pivot the request to another address (otter-internals#318). + */ + public function test_request_pins_host_and_disables_redirects() { + $integration = new Mailchimp_Integration(); + $integration->set_api_key( 'abc123def456-us1' ); + + $captured = array(); + $filter = static function ( $pre, $args, $url ) use ( &$captured ) { + $captured[] = array( 'url' => $url, 'args' => $args ); + return array( + 'headers' => array(), + 'body' => wp_json_encode( array( 'lists' => array() ) ), + 'response' => array( 'code' => 200, 'message' => 'OK' ), + 'cookies' => array(), + ); + }; + + add_filter( 'pre_http_request', $filter, 10, 3 ); + $integration->get_lists(); + remove_filter( 'pre_http_request', $filter, 10 ); + + $this->assertNotEmpty( $captured, 'Expected get_lists() to send a request.' ); + foreach ( $captured as $request ) { + $this->assertStringStartsWith( 'https://us1.api.mailchimp.com/', $request['url'] ); + $this->assertSame( 0, $request['args']['redirection'] ); + } + } } From 3449d0874cf40e1d3c1e553e28142b6148ce4022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Fri, 20 Nov 2026 18:52:46 +0200 Subject: [PATCH 15/30] fix: also check the ACF-resolved meta name in the Atomic Wind custom field The custom field gate checked the selector, not the meta key ACF reads. When ACF is active, an ACF field key (e.g. `field_abc123`) passes is_protected_meta(), but ACF resolves it to the field's name, which can be a `_`-prefixed protected key holding a form submitter's data. - Resolve the field with get_field_object() and run is_protected_meta() on the field name too, before reading the value. - Add tests with a field key whose field name is protected (skipped) and public (read), backed by minimal ACF stubs. - Posts Grid: assert an all-non-viewable list renders nothing, instead of falling back to posts (covers the early return). --- inc/plugins/class-atomic-wind-blocks.php | 33 +++++++---- tests/test-atomic-wind-blocks.php | 70 ++++++++++++++++++++++++ tests/test-post-grid-block.php | 5 +- 3 files changed, 96 insertions(+), 12 deletions(-) diff --git a/inc/plugins/class-atomic-wind-blocks.php b/inc/plugins/class-atomic-wind-blocks.php index 9478ad484..a6f67617b 100644 --- a/inc/plugins/class-atomic-wind-blocks.php +++ b/inc/plugins/class-atomic-wind-blocks.php @@ -1398,19 +1398,30 @@ public function render_post_fields( $block_content, $block ) { break; case 'custom_field': $meta_key = isset( $block['attrs']['customFieldKey'] ) ? sanitize_text_field( $block['attrs']['customFieldKey'] ) : ''; - // Never print a protected meta key (e.g. a `_`-prefixed field holding a form submitter's data). - if ( $meta_key && ! is_protected_meta( $meta_key, 'post' ) ) { - $value = ''; - if ( function_exists( 'get_field' ) ) { - $acf = get_field( $meta_key, get_the_ID() ); - if ( is_string( $acf ) ) { - $value = $acf; + if ( $meta_key ) { + // An ACF field key (e.g. `field_abc123`) resolves to a meta name that may be protected, + // so check the resolved name as well, not only the selector the block stores. + $resolved_key = $meta_key; + if ( function_exists( 'get_field_object' ) ) { + $field_object = get_field_object( $meta_key, get_the_ID(), false ); + if ( is_array( $field_object ) && ! empty( $field_object['name'] ) ) { + $resolved_key = (string) $field_object['name']; } } - if ( ! $value ) { - $raw = get_post_meta( get_the_ID(), $meta_key, true ); - if ( is_string( $raw ) ) { - $value = $raw; + // Never print a protected meta key (e.g. a `_`-prefixed field holding a form submitter's data). + if ( ! is_protected_meta( $meta_key, 'post' ) && ! is_protected_meta( $resolved_key, 'post' ) ) { + $value = ''; + if ( function_exists( 'get_field' ) ) { + $acf = get_field( $meta_key, get_the_ID() ); + if ( is_string( $acf ) ) { + $value = $acf; + } + } + if ( ! $value ) { + $raw = get_post_meta( get_the_ID(), $meta_key, true ); + if ( is_string( $raw ) ) { + $value = $raw; + } } } } diff --git a/tests/test-atomic-wind-blocks.php b/tests/test-atomic-wind-blocks.php index f3ac7677e..447af71c9 100644 --- a/tests/test-atomic-wind-blocks.php +++ b/tests/test-atomic-wind-blocks.php @@ -9,6 +9,32 @@ require_once dirname( __FILE__ ) . '/php/migration-test-helper.php'; +// Minimal ACF stubs, backed by $GLOBALS['otter_test_acf_fields']. With the global unset they return +// null/false, so they behave as if ACF is inactive and do not affect other tests. +if ( ! function_exists( 'get_field' ) ) { + /** + * @param string $selector Field key or name. + * @param mixed $post_id Unused. + * @param bool $format Unused. + * @return mixed + */ + function get_field( $selector, $post_id = false, $format = true ) { + return isset( $GLOBALS['otter_test_acf_fields'][ $selector ]['value'] ) ? $GLOBALS['otter_test_acf_fields'][ $selector ]['value'] : null; + } +} + +if ( ! function_exists( 'get_field_object' ) ) { + /** + * @param string $selector Field key or name. + * @param mixed $post_id Unused. + * @param bool $format Unused. + * @return array|false + */ + function get_field_object( $selector, $post_id = false, $format = true ) { + return isset( $GLOBALS['otter_test_acf_fields'][ $selector ] ) ? $GLOBALS['otter_test_acf_fields'][ $selector ] : false; + } +} + /** * Atomic Wind Blocks test case. */ @@ -2682,4 +2708,48 @@ public function test_custom_field_renders_a_public_meta_key() { wp_reset_postdata(); } + + public function test_custom_field_skips_acf_field_with_protected_name() { + // ACF resolves the field key to a `_`-prefixed meta name that holds submitter data. + $GLOBALS['otter_test_acf_fields'] = array( + 'field_secret' => array( 'name' => '_acf_protected', 'value' => 'ACF Secret Value' ), + ); + + $this->reset_in_query( true ); + global $post; + $post = get_post( $this->post_id ); + setup_postdata( $post ); + + $block = $this->make_block( 'atomic-wind/text', array( 'postField' => 'custom_field', 'customFieldKey' => 'field_secret' ) ); + $content = '

Placeholder

'; + + $result = $this->instance->render_post_fields( $content, $block ); + + $this->assertStringNotContainsString( 'ACF Secret Value', $result ); + $this->assertStringContainsString( 'Placeholder', $result ); + + wp_reset_postdata(); + unset( $GLOBALS['otter_test_acf_fields'] ); + } + + public function test_custom_field_reads_acf_field_with_public_name() { + $GLOBALS['otter_test_acf_fields'] = array( + 'field_public' => array( 'name' => 'otter_public_acf', 'value' => 'ACF Public Value' ), + ); + + $this->reset_in_query( true ); + global $post; + $post = get_post( $this->post_id ); + setup_postdata( $post ); + + $block = $this->make_block( 'atomic-wind/text', array( 'postField' => 'custom_field', 'customFieldKey' => 'field_public' ) ); + $content = '

Placeholder

'; + + $result = $this->instance->render_post_fields( $content, $block ); + + $this->assertStringContainsString( 'ACF Public Value', $result ); + + wp_reset_postdata(); + unset( $GLOBALS['otter_test_acf_fields'] ); + } } diff --git a/tests/test-post-grid-block.php b/tests/test-post-grid-block.php index 2b1b1291a..a2584ffd0 100644 --- a/tests/test-post-grid-block.php +++ b/tests/test-post-grid-block.php @@ -171,7 +171,10 @@ public function test_render_skips_non_public_post_types() { ) ); - $this->assertStringNotContainsString( 'Secret Record Title', $this->render_for_post_types( array( 'otter_secret' ) ) ); + $only_secret = $this->render_for_post_types( array( 'otter_secret' ) ); + $this->assertStringNotContainsString( 'Secret Record Title', $only_secret ); + // The early return shows nothing for an all-non-viewable list, rather than falling back to posts. + $this->assertStringNotContainsString( 'Public Blog Title', $only_secret ); $mixed = $this->render_for_post_types( array( 'otter_secret', 'post' ) ); $this->assertStringNotContainsString( 'Secret Record Title', $mixed ); From 8ed34f8417a5903fb77224df7f09bcb6dc6acb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Fri, 20 Nov 2026 19:54:59 +0200 Subject: [PATCH 16/30] test: cover redirect guard on every Mailchimp request; de-duplicate comment - Keep the redirect rationale on one line only, not repeated on all four. - Extend the request test to also drive get_merge_fields() and the subscribe path (status GET + members PUT), asserting the pinned host and redirection => 0 on every captured request, so dropping the guard from any single request builder fails the test. --- .../providers/class-mailchimp.php | 6 ++--- tests/test-mailchimp-provider.php | 22 +++++++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/inc/integrations/providers/class-mailchimp.php b/inc/integrations/providers/class-mailchimp.php index b839a68b3..61afdc6e7 100644 --- a/inc/integrations/providers/class-mailchimp.php +++ b/inc/integrations/providers/class-mailchimp.php @@ -138,7 +138,7 @@ public function make_subscribe_request( $email ) { $args = array( 'method' => 'PUT', - 'redirection' => 0, // Mailchimp returns data directly; never follow a redirect (defense in depth). + 'redirection' => 0, 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( 'user:' . $this->api_key ), ), @@ -259,7 +259,7 @@ private function get_new_user_status_mailchimp( $list_id ) { $url = 'https://' . $this->server_name . '.api.mailchimp.com/3.0/lists/' . $list_id; $args = array( 'method' => 'GET', - 'redirection' => 0, // Mailchimp returns data directly; never follow a redirect (defense in depth). + 'redirection' => 0, 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( 'user:' . $this->api_key ), ), @@ -317,7 +317,7 @@ public function get_merge_fields() { $url = 'https://' . $this->server_name . '.api.mailchimp.com/3.0/lists/' . $this->list_id . '/merge-fields'; $args = array( 'method' => 'GET', - 'redirection' => 0, // Mailchimp returns data directly; never follow a redirect (defense in depth). + 'redirection' => 0, 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( 'user:' . $this->api_key ), ), diff --git a/tests/test-mailchimp-provider.php b/tests/test-mailchimp-provider.php index dc3189526..67f0ae124 100644 --- a/tests/test-mailchimp-provider.php +++ b/tests/test-mailchimp-provider.php @@ -74,26 +74,40 @@ public function test_rejects_an_empty_key_as_missing() { public function test_request_pins_host_and_disables_redirects() { $integration = new Mailchimp_Integration(); $integration->set_api_key( 'abc123def456-us1' ); + $integration->set_list_id( 'listid' ); + + // make_subscribe_request() reads the linked merge fields off form_data. + $form_data = new class() { + public function get_fields() { + return array(); + } + }; + $property = new ReflectionProperty( Mailchimp_Integration::class, 'form_data' ); + $property->setAccessible( true ); + $property->setValue( $integration, $form_data ); $captured = array(); $filter = static function ( $pre, $args, $url ) use ( &$captured ) { $captured[] = array( 'url' => $url, 'args' => $args ); return array( 'headers' => array(), - 'body' => wp_json_encode( array( 'lists' => array() ) ), + 'body' => wp_json_encode( array( 'lists' => array(), 'merge_fields' => array() ) ), 'response' => array( 'code' => 200, 'message' => 'OK' ), 'cookies' => array(), ); }; add_filter( 'pre_http_request', $filter, 10, 3 ); - $integration->get_lists(); + $integration->get_lists(); // GET /lists + $integration->get_merge_fields(); // GET /lists/{id}/merge-fields + $integration->make_subscribe_request( 'qa@example.com' ); // status GET + members PUT remove_filter( 'pre_http_request', $filter, 10 ); - $this->assertNotEmpty( $captured, 'Expected get_lists() to send a request.' ); + // get_lists, get_merge_fields, the subscribe status GET and the members PUT. + $this->assertGreaterThanOrEqual( 4, count( $captured ), 'Expected every Mailchimp request path to send a request.' ); foreach ( $captured as $request ) { $this->assertStringStartsWith( 'https://us1.api.mailchimp.com/', $request['url'] ); - $this->assertSame( 0, $request['args']['redirection'] ); + $this->assertSame( 0, $request['args']['redirection'], 'Every Mailchimp request must disable redirects.' ); } } } From 80e14bfb980f66891dcbfbb2f1560e406c5ece15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Fri, 20 Nov 2026 23:17:58 +0200 Subject: [PATCH 17/30] refactor: scope PR to the reported non-public post type fix Move the protected custom-field meta hardening out of this PR. That guard was the issue's out-of-scope note, and extending it correctly (Atomic Wind plus the Otter Pro dynamic-content and block-conditions paths, at the permission layer so front-end meta display is unaffected) is a separate security issue. This PR now only restricts Posts Grid and the Atomic Wind box query loop to publicly viewable post types, which is the reported bug. --- inc/plugins/class-atomic-wind-blocks.php | 30 ++---- tests/test-atomic-wind-blocks.php | 112 ----------------------- 2 files changed, 9 insertions(+), 133 deletions(-) diff --git a/inc/plugins/class-atomic-wind-blocks.php b/inc/plugins/class-atomic-wind-blocks.php index a6f67617b..e0924c025 100644 --- a/inc/plugins/class-atomic-wind-blocks.php +++ b/inc/plugins/class-atomic-wind-blocks.php @@ -1399,29 +1399,17 @@ public function render_post_fields( $block_content, $block ) { case 'custom_field': $meta_key = isset( $block['attrs']['customFieldKey'] ) ? sanitize_text_field( $block['attrs']['customFieldKey'] ) : ''; if ( $meta_key ) { - // An ACF field key (e.g. `field_abc123`) resolves to a meta name that may be protected, - // so check the resolved name as well, not only the selector the block stores. - $resolved_key = $meta_key; - if ( function_exists( 'get_field_object' ) ) { - $field_object = get_field_object( $meta_key, get_the_ID(), false ); - if ( is_array( $field_object ) && ! empty( $field_object['name'] ) ) { - $resolved_key = (string) $field_object['name']; + $value = ''; + if ( function_exists( 'get_field' ) ) { + $acf = get_field( $meta_key, get_the_ID() ); + if ( is_string( $acf ) ) { + $value = $acf; } } - // Never print a protected meta key (e.g. a `_`-prefixed field holding a form submitter's data). - if ( ! is_protected_meta( $meta_key, 'post' ) && ! is_protected_meta( $resolved_key, 'post' ) ) { - $value = ''; - if ( function_exists( 'get_field' ) ) { - $acf = get_field( $meta_key, get_the_ID() ); - if ( is_string( $acf ) ) { - $value = $acf; - } - } - if ( ! $value ) { - $raw = get_post_meta( get_the_ID(), $meta_key, true ); - if ( is_string( $raw ) ) { - $value = $raw; - } + if ( ! $value ) { + $raw = get_post_meta( get_the_ID(), $meta_key, true ); + if ( is_string( $raw ) ) { + $value = $raw; } } } diff --git a/tests/test-atomic-wind-blocks.php b/tests/test-atomic-wind-blocks.php index 447af71c9..83abea7c8 100644 --- a/tests/test-atomic-wind-blocks.php +++ b/tests/test-atomic-wind-blocks.php @@ -9,32 +9,6 @@ require_once dirname( __FILE__ ) . '/php/migration-test-helper.php'; -// Minimal ACF stubs, backed by $GLOBALS['otter_test_acf_fields']. With the global unset they return -// null/false, so they behave as if ACF is inactive and do not affect other tests. -if ( ! function_exists( 'get_field' ) ) { - /** - * @param string $selector Field key or name. - * @param mixed $post_id Unused. - * @param bool $format Unused. - * @return mixed - */ - function get_field( $selector, $post_id = false, $format = true ) { - return isset( $GLOBALS['otter_test_acf_fields'][ $selector ]['value'] ) ? $GLOBALS['otter_test_acf_fields'][ $selector ]['value'] : null; - } -} - -if ( ! function_exists( 'get_field_object' ) ) { - /** - * @param string $selector Field key or name. - * @param mixed $post_id Unused. - * @param bool $format Unused. - * @return array|false - */ - function get_field_object( $selector, $post_id = false, $format = true ) { - return isset( $GLOBALS['otter_test_acf_fields'][ $selector ] ) ? $GLOBALS['otter_test_acf_fields'][ $selector ] : false; - } -} - /** * Atomic Wind Blocks test case. */ @@ -2666,90 +2640,4 @@ public function test_query_loop_renders_a_viewable_post_type() { $this->assertNotSame( '', $result ); $this->assertStringContainsString( 'wp-block-atomic-wind-box', $result ); } - - // ------------------------------------------------------- - // render_post_fields — protected custom field (otter-internals#319) - // ------------------------------------------------------- - - public function test_custom_field_skips_protected_meta() { - update_post_meta( $this->post_id, '_protected', 'Protected Meta Value' ); - - $this->reset_in_query( true ); - global $post; - $post = get_post( $this->post_id ); - setup_postdata( $post ); - - $block = $this->make_block( 'atomic-wind/text', array( 'postField' => 'custom_field', 'customFieldKey' => '_protected' ) ); - $content = '

Placeholder

'; - - $result = $this->instance->render_post_fields( $content, $block ); - - $this->assertStringNotContainsString( 'Protected Meta Value', $result ); - $this->assertStringContainsString( 'Placeholder', $result ); - - wp_reset_postdata(); - } - - public function test_custom_field_renders_a_public_meta_key() { - update_post_meta( $this->post_id, 'otter_public_field', 'Public Meta Value' ); - - $this->reset_in_query( true ); - global $post; - $post = get_post( $this->post_id ); - setup_postdata( $post ); - - $block = $this->make_block( 'atomic-wind/text', array( 'postField' => 'custom_field', 'customFieldKey' => 'otter_public_field' ) ); - $content = '

Placeholder

'; - - $result = $this->instance->render_post_fields( $content, $block ); - - $this->assertStringContainsString( 'Public Meta Value', $result ); - $this->assertStringNotContainsString( 'Placeholder', $result ); - - wp_reset_postdata(); - } - - public function test_custom_field_skips_acf_field_with_protected_name() { - // ACF resolves the field key to a `_`-prefixed meta name that holds submitter data. - $GLOBALS['otter_test_acf_fields'] = array( - 'field_secret' => array( 'name' => '_acf_protected', 'value' => 'ACF Secret Value' ), - ); - - $this->reset_in_query( true ); - global $post; - $post = get_post( $this->post_id ); - setup_postdata( $post ); - - $block = $this->make_block( 'atomic-wind/text', array( 'postField' => 'custom_field', 'customFieldKey' => 'field_secret' ) ); - $content = '

Placeholder

'; - - $result = $this->instance->render_post_fields( $content, $block ); - - $this->assertStringNotContainsString( 'ACF Secret Value', $result ); - $this->assertStringContainsString( 'Placeholder', $result ); - - wp_reset_postdata(); - unset( $GLOBALS['otter_test_acf_fields'] ); - } - - public function test_custom_field_reads_acf_field_with_public_name() { - $GLOBALS['otter_test_acf_fields'] = array( - 'field_public' => array( 'name' => 'otter_public_acf', 'value' => 'ACF Public Value' ), - ); - - $this->reset_in_query( true ); - global $post; - $post = get_post( $this->post_id ); - setup_postdata( $post ); - - $block = $this->make_block( 'atomic-wind/text', array( 'postField' => 'custom_field', 'customFieldKey' => 'field_public' ) ); - $content = '

Placeholder

'; - - $result = $this->instance->render_post_fields( $content, $block ); - - $this->assertStringContainsString( 'ACF Public Value', $result ); - - wp_reset_postdata(); - unset( $GLOBALS['otter_test_acf_fields'] ); - } } From 51bd6cee6d322a48719ca2b0aad6c3b5975bfd85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Fri, 20 Nov 2026 23:29:06 +0200 Subject: [PATCH 18/30] fix: block protected post meta in dynamic content, conditions and Atomic Wind The dynamic-content `acf` tag, the `postMeta`/`acf` dynamic image, the `postMeta` block condition and the Atomic Wind `custom_field` read post meta by a request-supplied key and surface the value, without the protected-key check the text, author and user-meta getters already apply. A Contributor could read a protected `_`-prefixed key of a published post (e.g. a product's `_purchase_note`, or `_`-meta holding tokens) through an editor preview. - Dynamic_Content: guard `get_acf()`, `evaluate_content_media_server()` and `evaluate_content_media_content()` with `is_protected_meta_key()`, and add `is_protected_acf_field()` so an ACF field key that resolves to a protected name is rejected too. - Block_Conditions::has_meta(): never read a protected key, so its value cannot leak through the comparison result. - Atomic Wind `custom_field`: skip protected keys, including the ACF-resolved field name. - Tests for each path; the shared ACF test fixture also stubs get_field/ get_field_object. --- inc/plugins/class-atomic-wind-blocks.php | 30 ++++++--- .../inc/plugins/class-block-conditions.php | 5 ++ .../inc/plugins/class-dynamic-content.php | 32 +++++++-- tests/php/acf-parent-cycle.php | 28 ++++++++ tests/test-atomic-wind-blocks.php | 67 +++++++++++++++++++ tests/test-block-conditions.php | 26 +++++++ tests/test-dynamic-content.php | 51 ++++++++++++++ 7 files changed, 225 insertions(+), 14 deletions(-) diff --git a/inc/plugins/class-atomic-wind-blocks.php b/inc/plugins/class-atomic-wind-blocks.php index b6de8b43d..ca751ebc8 100644 --- a/inc/plugins/class-atomic-wind-blocks.php +++ b/inc/plugins/class-atomic-wind-blocks.php @@ -1392,17 +1392,29 @@ public function render_post_fields( $block_content, $block ) { case 'custom_field': $meta_key = isset( $block['attrs']['customFieldKey'] ) ? sanitize_text_field( $block['attrs']['customFieldKey'] ) : ''; if ( $meta_key ) { - $value = ''; - if ( function_exists( 'get_field' ) ) { - $acf = get_field( $meta_key, get_the_ID() ); - if ( is_string( $acf ) ) { - $value = $acf; + // An ACF field key (e.g. `field_abc123`) resolves to a meta name that may be protected, + // so check the resolved name as well, not only the selector the block stores. + $resolved_key = $meta_key; + if ( function_exists( 'get_field_object' ) ) { + $field_object = get_field_object( $meta_key, get_the_ID(), false ); + if ( is_array( $field_object ) && ! empty( $field_object['name'] ) ) { + $resolved_key = (string) $field_object['name']; } } - if ( ! $value ) { - $raw = get_post_meta( get_the_ID(), $meta_key, true ); - if ( is_string( $raw ) ) { - $value = $raw; + // Never print a protected meta key (e.g. a `_`-prefixed field holding a form submitter's data). + if ( ! is_protected_meta( $meta_key, 'post' ) && ! is_protected_meta( $resolved_key, 'post' ) ) { + $value = ''; + if ( function_exists( 'get_field' ) ) { + $acf = get_field( $meta_key, get_the_ID() ); + if ( is_string( $acf ) ) { + $value = $acf; + } + } + if ( ! $value ) { + $raw = get_post_meta( get_the_ID(), $meta_key, true ); + if ( is_string( $raw ) ) { + $value = $raw; + } } } } diff --git a/plugins/otter-pro/inc/plugins/class-block-conditions.php b/plugins/otter-pro/inc/plugins/class-block-conditions.php index 89f2baf58..c5acc06e3 100644 --- a/plugins/otter-pro/inc/plugins/class-block-conditions.php +++ b/plugins/otter-pro/inc/plugins/class-block-conditions.php @@ -133,6 +133,11 @@ public function has_meta( $condition, $type = 'post' ) { $id = ''; $meta = ''; + // A protected key is never read, so its value cannot leak through the comparison result. + if ( Dynamic_Content::is_protected_meta_key( $condition['meta_key'] ) ) { + return false; + } + if ( 'post' === $type ) { $id = get_the_ID(); $meta = get_post_meta( $id, $condition['meta_key'], true ); diff --git a/plugins/otter-pro/inc/plugins/class-dynamic-content.php b/plugins/otter-pro/inc/plugins/class-dynamic-content.php index 111e594df..9d093a3f3 100644 --- a/plugins/otter-pro/inc/plugins/class-dynamic-content.php +++ b/plugins/otter-pro/inc/plugins/class-dynamic-content.php @@ -208,6 +208,25 @@ public static function is_protected_meta_key( $key ) { return in_array( strtolower( $key ), $protected, true ); } + /** + * Whether an ACF selector resolves to a protected meta key. + * + * An ACF field key (e.g. `field_abc123`) is harmless on its own, but ACF resolves it to the field's + * meta name, which can be a protected `_`-prefixed key. + * + * @param string $selector ACF field key or name. + * @return bool + */ + public static function is_protected_acf_field( $selector ) { + if ( ! function_exists( 'acf_get_field' ) ) { + return false; + } + + $field = acf_get_field( $selector ); + + return is_array( $field ) && isset( $field['name'] ) && self::is_protected_meta_key( $field['name'] ); + } + /** * Get Post Meta. * @@ -246,7 +265,10 @@ public function get_acf( $data ) { } $field_key = sanitize_text_field( $data['metaKey'] ); - $meta = get_field( $field_key, $data['context'] ); + if ( self::is_protected_meta_key( $field_key ) || self::is_protected_acf_field( $field_key ) ) { + return $default; + } + $meta = get_field( $field_key, $data['context'] ); // Get the ACF repeater's sub-field value. if ( ( null === $meta || false === $meta || '' === $meta ) && function_exists( 'acf_get_field' ) ) { @@ -683,7 +705,7 @@ public function evaluate_content_media_server( $path, $request ) { $id = $request->get_param( 'id' ); $meta = $request->get_param( 'meta' ); - if ( 'postMeta' === $type && ! empty( $meta ) ) { + if ( 'postMeta' === $type && ! empty( $meta ) && ! self::is_protected_meta_key( $meta ) ) { $value = get_post_meta( $context, $meta, true ); if ( ! empty( $value ) ) { @@ -706,7 +728,7 @@ public function evaluate_content_media_server( $path, $request ) { } } - if ( 'acf' === $type && ! empty( $meta ) && class_exists( 'ACF' ) ) { + if ( 'acf' === $type && ! empty( $meta ) && class_exists( 'ACF' ) && ! self::is_protected_meta_key( $meta ) && ! self::is_protected_acf_field( $meta ) ) { $field = get_field( $meta, $context ); // Fall back to repeater sub-field traversal when the field is a @@ -752,7 +774,7 @@ public function evaluate_content_media_server( $path, $request ) { * @return string|string[] */ public function evaluate_content_media_content( $value, $data ) { - if ( 'postMeta' === $data['type'] && isset( $data['meta'] ) && ! empty( $data['meta'] ) ) { + if ( 'postMeta' === $data['type'] && isset( $data['meta'] ) && ! empty( $data['meta'] ) && ! self::is_protected_meta_key( $data['meta'] ) ) { $meta = get_post_meta( $data['context'], $data['meta'], true ); if ( ! empty( $meta ) ) { @@ -775,7 +797,7 @@ public function evaluate_content_media_content( $value, $data ) { } } - if ( 'acf' === $data['type'] && ! empty( $data['meta'] ) && class_exists( 'ACF' ) ) { + if ( 'acf' === $data['type'] && ! empty( $data['meta'] ) && class_exists( 'ACF' ) && ! self::is_protected_meta_key( $data['meta'] ) && ! self::is_protected_acf_field( $data['meta'] ) ) { $field = get_field( $data['meta'], $data['context'] ); // Fall back to repeater sub-field traversal when the field is a diff --git a/tests/php/acf-parent-cycle.php b/tests/php/acf-parent-cycle.php index 88bd9f7de..dbba6fd07 100644 --- a/tests/php/acf-parent-cycle.php +++ b/tests/php/acf-parent-cycle.php @@ -15,4 +15,32 @@ function acf_get_field( $selector ) { return isset( $GLOBALS['otter_test_acf_fields'][ $selector ] ) ? $GLOBALS['otter_test_acf_fields'][ $selector ] : false; } +if ( ! function_exists( 'get_field_object' ) ) { + /** + * Return a field object from the test-controlled ACF map. + * + * @param int|string $selector Field selector. + * @param mixed $post_id Unused. + * @param bool $format Unused. + * @return array|false + */ + function get_field_object( $selector, $post_id = false, $format = true ) { + return isset( $GLOBALS['otter_test_acf_fields'][ $selector ] ) ? $GLOBALS['otter_test_acf_fields'][ $selector ] : false; + } +} + +if ( ! function_exists( 'get_field' ) ) { + /** + * Return a field value from the test-controlled ACF map. + * + * @param int|string $selector Field selector. + * @param mixed $post_id Unused. + * @param bool $format Unused. + * @return mixed + */ + function get_field( $selector, $post_id = false, $format = true ) { + return isset( $GLOBALS['otter_test_acf_fields'][ $selector ]['value'] ) ? $GLOBALS['otter_test_acf_fields'][ $selector ]['value'] : null; + } +} + define( 'OTTER_TEST_ACF_GET_FIELD_STUB', true ); diff --git a/tests/test-atomic-wind-blocks.php b/tests/test-atomic-wind-blocks.php index eec14bc58..8283cff5e 100644 --- a/tests/test-atomic-wind-blocks.php +++ b/tests/test-atomic-wind-blocks.php @@ -9,6 +9,10 @@ require_once dirname( __FILE__ ) . '/php/migration-test-helper.php'; +if ( ! function_exists( 'get_field' ) ) { + require_once __DIR__ . '/php/acf-parent-cycle.php'; +} + /** * Atomic Wind Blocks test case. */ @@ -2597,4 +2601,67 @@ public function test_enqueue_base_css_registers_frontend_style_without_enqueuing $this->inline_style_for( 'atomic-wind-base' ) ); } + + // ------------------------------------------------------- + // render_post_fields — protected custom field (otter-internals#320) + // ------------------------------------------------------- + + public function test_custom_field_skips_protected_meta() { + update_post_meta( $this->post_id, '_protected', 'Protected Meta Value' ); + + $this->reset_in_query( true ); + global $post; + $post = get_post( $this->post_id ); + setup_postdata( $post ); + + $block = $this->make_block( 'atomic-wind/text', array( 'postField' => 'custom_field', 'customFieldKey' => '_protected' ) ); + $content = '

Placeholder

'; + + $result = $this->instance->render_post_fields( $content, $block ); + + $this->assertStringNotContainsString( 'Protected Meta Value', $result ); + $this->assertStringContainsString( 'Placeholder', $result ); + + wp_reset_postdata(); + } + + public function test_custom_field_skips_acf_field_with_protected_name() { + $GLOBALS['otter_test_acf_fields'] = array( + 'field_secret' => array( 'name' => '_acf_protected', 'value' => 'ACF Secret Value' ), + ); + + $this->reset_in_query( true ); + global $post; + $post = get_post( $this->post_id ); + setup_postdata( $post ); + + $block = $this->make_block( 'atomic-wind/text', array( 'postField' => 'custom_field', 'customFieldKey' => 'field_secret' ) ); + $content = '

Placeholder

'; + + $result = $this->instance->render_post_fields( $content, $block ); + + $this->assertStringNotContainsString( 'ACF Secret Value', $result ); + $this->assertStringContainsString( 'Placeholder', $result ); + + wp_reset_postdata(); + unset( $GLOBALS['otter_test_acf_fields'] ); + } + + public function test_custom_field_renders_a_public_meta_key() { + update_post_meta( $this->post_id, 'otter_public_field', 'Public Meta Value' ); + + $this->reset_in_query( true ); + global $post; + $post = get_post( $this->post_id ); + setup_postdata( $post ); + + $block = $this->make_block( 'atomic-wind/text', array( 'postField' => 'custom_field', 'customFieldKey' => 'otter_public_field' ) ); + $content = '

Placeholder

'; + + $result = $this->instance->render_post_fields( $content, $block ); + + $this->assertStringContainsString( 'Public Meta Value', $result ); + + wp_reset_postdata(); + } } diff --git a/tests/test-block-conditions.php b/tests/test-block-conditions.php index 6f2beb2bb..2af8cca86 100644 --- a/tests/test-block-conditions.php +++ b/tests/test-block-conditions.php @@ -659,4 +659,30 @@ public function test_screen_size_condition_enqueues_hide_styles_for_head(): void $this->assertMatchesRegularExpression( '/id=["\']o-condition-hide-inline-css["\']/', $head_styles ); $this->assertStringContainsString( '.o-hide-on-mobile:is(.o-hide-on-mobile,#_){display:none!important}', $head_styles ); } + + /** + * A protected meta key cannot be used as a value oracle through a block condition (otter-internals#320). + */ + public function test_post_meta_condition_ignores_protected_key() { + $post_id = $this->factory()->post->create(); + update_post_meta( $post_id, '_secret', 'leaked-value' ); + + $this->go_to( get_permalink( $post_id ) ); + global $post; + $post = get_post( $post_id ); + setup_postdata( $post ); + + $condition = array( + 'type' => 'postMeta', + 'meta_key' => '_secret', + 'meta_compare' => 'if_contains', + 'meta_value' => 'leaked', + ); + + $result = $this->block_conditions->evaluate_condition( $condition ); + + $this->assertFalse( $result ); + + wp_reset_postdata(); + } } diff --git a/tests/test-dynamic-content.php b/tests/test-dynamic-content.php index d3c2bddcc..075020979 100644 --- a/tests/test-dynamic-content.php +++ b/tests/test-dynamic-content.php @@ -2710,4 +2710,55 @@ function ( int $errno, string $errstr ) use ( &$captured ): bool { $this->assertSame( '

Example

', $result, $label ); } } + + /** + * The ACF dynamic tag does not read a protected meta key (otter-internals#320). + */ + public function test_get_acf_blocks_a_protected_meta_key() { + $GLOBALS['otter_test_acf_fields'] = array( '_secret' => array( 'value' => 'ACF Secret' ) ); + + $result = $this->dynamic_content_pro->get_acf( array( + 'metaKey' => '_secret', + 'context' => $this->post_id, + 'default' => 'KEPT', + ) ); + + $this->assertSame( 'KEPT', $result ); + $this->assertStringNotContainsString( 'ACF Secret', $result ); + + unset( $GLOBALS['otter_test_acf_fields'] ); + } + + /** + * An ACF field key that resolves to a protected name is blocked too. + */ + public function test_get_acf_blocks_an_acf_field_with_a_protected_name() { + $GLOBALS['otter_test_acf_fields'] = array( 'field_x' => array( 'name' => '_secret', 'value' => 'ACF Secret' ) ); + + $result = $this->dynamic_content_pro->get_acf( array( + 'metaKey' => 'field_x', + 'context' => $this->post_id, + 'default' => 'KEPT', + ) ); + + $this->assertSame( 'KEPT', $result ); + $this->assertStringNotContainsString( 'ACF Secret', $result ); + + unset( $GLOBALS['otter_test_acf_fields'] ); + } + + /** + * The dynamic image does not put a protected meta value into the src. + */ + public function test_media_content_blocks_protected_post_meta() { + update_post_meta( $this->post_id, '_img', 'https://evil.example/x.png' ); + + $result = $this->dynamic_content_pro->evaluate_content_media_content( 'ORIGINAL', array( + 'type' => 'postMeta', + 'meta' => '_img', + 'context' => $this->post_id, + ) ); + + $this->assertSame( 'ORIGINAL', $result ); + } } From 047cdc42ee04400bea4c435857df3b259d2115d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Fri, 20 Nov 2026 23:55:24 +0200 Subject: [PATCH 19/30] fix: drop non-viewable post types from the live search main query Otter Pro live search copied `?o_post_type=` straight into the main search query, so an anonymous visitor could query a non-public post type whose entries are `publish` (e.g. a contact-form inbox) and read their titles and excerpts. The REST `prepare_search_query()` path already filters these; the main-query `parse_query()` path did not. Filter the requested types through `is_post_type_viewable()` and skip the override when none remain. --- .../inc/server/class-live-search-server.php | 7 ++++- tests/test-live-search.php | 31 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/plugins/otter-pro/inc/server/class-live-search-server.php b/plugins/otter-pro/inc/server/class-live-search-server.php index e90d954ef..19d567e36 100644 --- a/plugins/otter-pro/inc/server/class-live-search-server.php +++ b/plugins/otter-pro/inc/server/class-live-search-server.php @@ -74,7 +74,12 @@ public function add_query_vars( $query_vars ) { */ public function parse_query( $query ) { if ( $query->is_main_query() && $query->is_search() && $query->get( 'o_post_type' ) ) { - $query->set( 'post_type', explode( ',', $query->get( 'o_post_type' ) ) ); + // Only publicly viewable types; a non-public type (e.g. a contact-form inbox) whose entries are + // `publish` must not be queryable by an anonymous visitor through `?o_post_type=`. + $post_types = array_values( array_filter( explode( ',', $query->get( 'o_post_type' ) ), 'is_post_type_viewable' ) ); + if ( ! empty( $post_types ) ) { + $query->set( 'post_type', $post_types ); + } } return $query; diff --git a/tests/test-live-search.php b/tests/test-live-search.php index 4b2b07209..198d6cfbb 100644 --- a/tests/test-live-search.php +++ b/tests/test-live-search.php @@ -108,4 +108,35 @@ public function test_o_post_type_ignored_on_secondary_query() { $this->assertNotEquals( array( 'otter_shop_product' ), $secondary->get( 'post_type' ) ); } + + /** + * A non-viewable type passed via o_post_type is dropped, so an anonymous visitor + * cannot query it through the main search query (otter-internals#319). + */ + public function test_o_post_type_skips_non_viewable_type() { + $live_search = new Live_Search_Server(); + + $this->go_to( home_url( '/?s=test' ) ); + global $wp_query; + $wp_query->set( 'o_post_type', 'otter_shop_coupon' ); + + $live_search->parse_query( $wp_query ); + + $this->assertNotEquals( array( 'otter_shop_coupon' ), $wp_query->get( 'post_type' ) ); + } + + /** + * A mixed list keeps the viewable types and drops the non-viewable one. + */ + public function test_o_post_type_keeps_only_viewable_types() { + $live_search = new Live_Search_Server(); + + $this->go_to( home_url( '/?s=test' ) ); + global $wp_query; + $wp_query->set( 'o_post_type', 'otter_shop_product,otter_shop_coupon' ); + + $live_search->parse_query( $wp_query ); + + $this->assertEquals( array( 'otter_shop_product' ), $wp_query->get( 'post_type' ) ); + } } \ No newline at end of file From a0cb17ecb7ea299839bf2aa925ee8f08b226a875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Fri, 20 Nov 2026 23:59:41 +0200 Subject: [PATCH 20/30] fix: close ACF repeater-parent and Posts Grid ACF protected-meta gaps - is_protected_acf_field(): walk the ACF parent chain, so a sub-field under a protected repeater (reached through the repeater fallback) is rejected too. - Posts_ACF_Integration::render_acf_fields(): skip a protected field selector or resolved field name, matching the dynamic-content guards. - Tests: a sub-field under a `_secret` repeater returns the default; the Posts Grid ACF field prints nothing for a protected field; the dynamic image blocks a protected postMeta. --- .../inc/plugins/class-dynamic-content.php | 17 ++++++- .../plugins/class-posts-acf-integration.php | 3 +- tests/test-dynamic-content-server.php | 17 +++++++ tests/test-dynamic-content.php | 44 +++++++++++++++++++ 4 files changed, 79 insertions(+), 2 deletions(-) diff --git a/plugins/otter-pro/inc/plugins/class-dynamic-content.php b/plugins/otter-pro/inc/plugins/class-dynamic-content.php index 9d093a3f3..3ca4310e2 100644 --- a/plugins/otter-pro/inc/plugins/class-dynamic-content.php +++ b/plugins/otter-pro/inc/plugins/class-dynamic-content.php @@ -222,9 +222,24 @@ public static function is_protected_acf_field( $selector ) { return false; } + $seen = array(); $field = acf_get_field( $selector ); - return is_array( $field ) && isset( $field['name'] ) && self::is_protected_meta_key( $field['name'] ); + // Walk the parent chain: a sub-field under a protected repeater is reachable through the repeater fallback. + while ( is_array( $field ) ) { + if ( isset( $field['name'] ) && self::is_protected_meta_key( $field['name'] ) ) { + return true; + } + + $parent = isset( $field['parent'] ) ? $field['parent'] : ''; + if ( empty( $parent ) || isset( $seen[ $parent ] ) ) { + break; + } + $seen[ $parent ] = true; + $field = acf_get_field( $parent ); + } + + return false; } /** diff --git a/plugins/otter-pro/inc/plugins/class-posts-acf-integration.php b/plugins/otter-pro/inc/plugins/class-posts-acf-integration.php index aca2283bf..801084820 100644 --- a/plugins/otter-pro/inc/plugins/class-posts-acf-integration.php +++ b/plugins/otter-pro/inc/plugins/class-posts-acf-integration.php @@ -55,7 +55,8 @@ public function render_acf_fields( $data, $attributes, $id, $element ) { } } - if ( ( ! isset( $custom_meta_field['display'] ) || true === $custom_meta_field['display'] ) && isset( $custom_meta_field['field'] ) && function_exists( 'get_field_object' ) ) { + if ( ( ! isset( $custom_meta_field['display'] ) || true === $custom_meta_field['display'] ) && isset( $custom_meta_field['field'] ) && function_exists( 'get_field_object' ) + && ! Dynamic_Content::is_protected_meta_key( $custom_meta_field['field'] ) && ! Dynamic_Content::is_protected_acf_field( $custom_meta_field['field'] ) ) { $field = get_field_object( $custom_meta_field['field'], $id ); if ( false !== $field ) { $data .= '
'; diff --git a/tests/test-dynamic-content-server.php b/tests/test-dynamic-content-server.php index a595d69ab..47e401a02 100644 --- a/tests/test-dynamic-content-server.php +++ b/tests/test-dynamic-content-server.php @@ -147,4 +147,21 @@ private function can_request( string $route, array $params ): bool { return true === call_user_func( $handler['permission_callback'], $request ); } + + /** + * The dynamic image does not put a protected post meta value into the path (otter-internals#320). + */ + public function test_media_server_blocks_protected_post_meta(): void { + $post_id = self::factory()->post->create(); + update_post_meta( $post_id, '_img', 'https://evil.example/x.png' ); + + $request = new WP_REST_Request( 'GET', '/otter/v1/dynamic' ); + $request->set_param( 'type', 'postMeta' ); + $request->set_param( 'meta', '_img' ); + $request->set_param( 'context', $post_id ); + + $path = ( new \ThemeIsle\OtterPro\Plugins\Dynamic_Content() )->evaluate_content_media_server( 'fallback.jpg', $request ); + + $this->assertSame( 'fallback.jpg', $path ); + } } diff --git a/tests/test-dynamic-content.php b/tests/test-dynamic-content.php index 075020979..d6136b8aa 100644 --- a/tests/test-dynamic-content.php +++ b/tests/test-dynamic-content.php @@ -2761,4 +2761,48 @@ public function test_media_content_blocks_protected_post_meta() { $this->assertSame( 'ORIGINAL', $result ); } + + /** + * A sub-field under a protected ACF repeater is blocked through the parent chain. + */ + public function test_get_acf_blocks_a_sub_field_under_a_protected_repeater() { + $GLOBALS['otter_test_acf_fields'] = array( + 'field_leaf' => array( 'key' => 'field_leaf', 'name' => 'leaf', 'parent' => 'field_repeater', 'value' => 'ACF Secret' ), + 'field_repeater' => array( 'key' => 'field_repeater', 'name' => '_secret', 'parent' => 0 ), + ); + + $result = $this->dynamic_content_pro->get_acf( array( + 'metaKey' => 'field_leaf', + 'context' => $this->post_id, + 'default' => 'KEPT', + ) ); + + $this->assertSame( 'KEPT', $result ); + $this->assertStringNotContainsString( 'ACF Secret', $result ); + + unset( $GLOBALS['otter_test_acf_fields'] ); + } + + /** + * The Posts Grid ACF custom field does not print a protected field (otter-internals#320). + */ + public function test_posts_acf_integration_blocks_a_protected_field() { + $GLOBALS['otter_test_acf_fields'] = array( + 'field_secret' => array( 'name' => '_secret', 'value' => 'ACF Secret Value' ), + ); + + $integration = new \ThemeIsle\OtterPro\Plugins\Posts_ACF_Integration(); + $attributes = array( + 'customMetas' => array( + array( 'id' => 'custom_1', 'field' => 'field_secret', 'display' => true ), + ), + ); + + $result = $integration->render_acf_fields( 'BASE', $attributes, $this->post_id, 'custom_1' ); + + $this->assertSame( 'BASE', $result ); + $this->assertStringNotContainsString( 'ACF Secret Value', $result ); + + unset( $GLOBALS['otter_test_acf_fields'] ); + } } From cb09d2195c4e0d123c4164053479a91eb10fa21c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Sat, 21 Nov 2026 00:26:10 +0200 Subject: [PATCH 21/30] test: cover the ACF image branches and the parent-chain cycle guard - Add a guarded `ACF` stub class to the shared fixture so the `class_exists( 'ACF' )`-gated image branches run under tests. - Test the ACF branch of evaluate_content_media_server() and evaluate_content_media_content() blocks a field resolving to a protected name. - Test is_protected_acf_field() returns false on a cyclic parent chain (and terminates), so the cycle guard is covered. --- tests/php/acf-parent-cycle.php | 5 +++++ tests/test-dynamic-content-server.php | 22 ++++++++++++++++++++ tests/test-dynamic-content.php | 29 +++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/tests/php/acf-parent-cycle.php b/tests/php/acf-parent-cycle.php index dbba6fd07..5b306dbfc 100644 --- a/tests/php/acf-parent-cycle.php +++ b/tests/php/acf-parent-cycle.php @@ -43,4 +43,9 @@ function get_field( $selector, $post_id = false, $format = true ) { } } +// Minimal marker so `class_exists( 'ACF' )`-gated branches run under tests; no behavior of its own. +if ( ! class_exists( 'ACF' ) ) { + class ACF {} // phpcs:ignore Generic.Files.OneObjectStructurePerFile.MultipleFound +} + define( 'OTTER_TEST_ACF_GET_FIELD_STUB', true ); diff --git a/tests/test-dynamic-content-server.php b/tests/test-dynamic-content-server.php index 47e401a02..ddb2b71b2 100644 --- a/tests/test-dynamic-content-server.php +++ b/tests/test-dynamic-content-server.php @@ -5,6 +5,10 @@ * @package gutenberg-blocks */ +if ( ! function_exists( 'acf_get_field' ) ) { + require_once __DIR__ . '/php/acf-parent-cycle.php'; +} + /** * Access rules of the otter/v1/dynamic routes for visitors and editors. */ @@ -164,4 +168,22 @@ public function test_media_server_blocks_protected_post_meta(): void { $this->assertSame( 'fallback.jpg', $path ); } + + /** + * The dynamic image ACF branch does not put a protected field value into the path (otter-internals#320). + */ + public function test_media_server_blocks_protected_acf_field(): void { + $GLOBALS['otter_test_acf_fields'] = array( 'field_secret' => array( 'name' => '_secret', 'value' => 'https://evil.example/x.png' ) ); + + $request = new WP_REST_Request( 'GET', '/otter/v1/dynamic' ); + $request->set_param( 'type', 'acf' ); + $request->set_param( 'meta', 'field_secret' ); + $request->set_param( 'context', self::factory()->post->create() ); + + $path = ( new \ThemeIsle\OtterPro\Plugins\Dynamic_Content() )->evaluate_content_media_server( 'fallback.jpg', $request ); + + $this->assertStringNotContainsString( 'evil.example', $path ); + + unset( $GLOBALS['otter_test_acf_fields'] ); + } } diff --git a/tests/test-dynamic-content.php b/tests/test-dynamic-content.php index d6136b8aa..6460074f7 100644 --- a/tests/test-dynamic-content.php +++ b/tests/test-dynamic-content.php @@ -2805,4 +2805,33 @@ public function test_posts_acf_integration_blocks_a_protected_field() { unset( $GLOBALS['otter_test_acf_fields'] ); } + + /** + * The dynamic image ACF branch does not surface a protected field value. + */ + public function test_media_content_blocks_protected_acf_field() { + $GLOBALS['otter_test_acf_fields'] = array( 'field_secret' => array( 'name' => '_secret', 'value' => 'https://evil.example/x.png' ) ); + + $result = $this->dynamic_content_pro->evaluate_content_media_content( 'ORIGINAL', array( + 'type' => 'acf', + 'meta' => 'field_secret', + 'context' => $this->post_id, + ) ); + + $flat = is_array( $result ) ? implode( ' ', $result ) : (string) $result; + $this->assertStringNotContainsString( 'evil.example', $flat ); + + unset( $GLOBALS['otter_test_acf_fields'] ); + } + + /** + * is_protected_acf_field() terminates on a cyclic parent chain. + */ + public function test_is_protected_acf_field_handles_a_cyclic_parent_chain() { + $GLOBALS['otter_test_acf_fields'] = $this->cyclic_acf_fields(); + + $this->assertFalse( \ThemeIsle\OtterPro\Plugins\Dynamic_Content::is_protected_acf_field( 10 ) ); + + unset( $GLOBALS['otter_test_acf_fields'] ); + } } From 02d81e6889355f3e7d45c94f49e46357bc234fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Sat, 21 Nov 2026 00:52:52 +0200 Subject: [PATCH 22/30] fix: honor the is_protected_meta filter in the shared protected-key check is_protected_meta_key() only matched a `_` prefix and three named keys, so a key another plugin protects through the `is_protected_meta` filter without a `_` prefix (e.g. NextScripts SNAP's keys) still leaked through get_acf(), has_meta() and the postMeta/acf getters. Fall back to is_protected_meta() so those are caught too, matching the Atomic Wind custom field. Add a test that filters a non-prefixed key as protected and expects the fallback. --- .../inc/plugins/class-dynamic-content.php | 7 +++++- tests/test-dynamic-content.php | 22 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/plugins/otter-pro/inc/plugins/class-dynamic-content.php b/plugins/otter-pro/inc/plugins/class-dynamic-content.php index 3ca4310e2..9fc871b67 100644 --- a/plugins/otter-pro/inc/plugins/class-dynamic-content.php +++ b/plugins/otter-pro/inc/plugins/class-dynamic-content.php @@ -205,7 +205,12 @@ public static function is_protected_meta_key( $key ) { $protected = array( 'user_pass', 'user_activation_key', 'session_tokens' ); - return in_array( strtolower( $key ), $protected, true ); + if ( in_array( strtolower( $key ), $protected, true ) ) { + return true; + } + + // Honor the `is_protected_meta` filter, so a key another plugin protects without a `_` prefix is caught too. + return is_protected_meta( $key, 'post' ); } /** diff --git a/tests/test-dynamic-content.php b/tests/test-dynamic-content.php index 6460074f7..19cd99760 100644 --- a/tests/test-dynamic-content.php +++ b/tests/test-dynamic-content.php @@ -2834,4 +2834,26 @@ public function test_is_protected_acf_field_handles_a_cyclic_parent_chain() { unset( $GLOBALS['otter_test_acf_fields'] ); } + + /** + * A key another plugin protects via the is_protected_meta filter (without a `_` prefix) is blocked too. + */ + public function test_blocks_a_filter_protected_meta_key() { + update_post_meta( $this->post_id, 'snap_x', 'https://evil.example/x.png' ); + + $filter = static function ( $protected, $meta_key ) { + return 'snap_x' === $meta_key ? true : $protected; + }; + add_filter( 'is_protected_meta', $filter, 10, 2 ); + + $result = $this->dynamic_content_pro->evaluate_content_media_content( 'ORIGINAL', array( + 'type' => 'postMeta', + 'meta' => 'snap_x', + 'context' => $this->post_id, + ) ); + + remove_filter( 'is_protected_meta', $filter, 10 ); + + $this->assertSame( 'ORIGINAL', $result ); + } } From 034bf182634db8b9da88cd5cf95960e4289e7ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Sat, 21 Nov 2026 10:04:24 +0200 Subject: [PATCH 23/30] fix: check the right meta type when a key is protected only for user meta is_protected_meta_key() always passed 'post' to is_protected_meta(), so a key a plugin protects only for 'user' meta leaked through get_author_meta(), get_loggedin_meta() and the user branch of has_meta(). Add a $meta_type parameter and pass 'user' from those callers. --- .../inc/plugins/class-block-conditions.php | 2 +- .../inc/plugins/class-dynamic-content.php | 11 ++++---- tests/test-dynamic-content.php | 25 +++++++++++++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/plugins/otter-pro/inc/plugins/class-block-conditions.php b/plugins/otter-pro/inc/plugins/class-block-conditions.php index c5acc06e3..c36ae2a82 100644 --- a/plugins/otter-pro/inc/plugins/class-block-conditions.php +++ b/plugins/otter-pro/inc/plugins/class-block-conditions.php @@ -134,7 +134,7 @@ public function has_meta( $condition, $type = 'post' ) { $meta = ''; // A protected key is never read, so its value cannot leak through the comparison result. - if ( Dynamic_Content::is_protected_meta_key( $condition['meta_key'] ) ) { + if ( Dynamic_Content::is_protected_meta_key( $condition['meta_key'], $type ) ) { return false; } diff --git a/plugins/otter-pro/inc/plugins/class-dynamic-content.php b/plugins/otter-pro/inc/plugins/class-dynamic-content.php index 9fc871b67..e300d3ed0 100644 --- a/plugins/otter-pro/inc/plugins/class-dynamic-content.php +++ b/plugins/otter-pro/inc/plugins/class-dynamic-content.php @@ -192,11 +192,12 @@ public function get_terms( $data ) { * Blocks WordPress protected (underscore-prefixed) meta and sensitive user fields, * since these getters can be reached for any published post without authentication. * - * @param string $key Meta key. + * @param string $key Meta key. + * @param string $meta_type Meta type the key is read from ('post' or 'user'), for the is_protected_meta filter. * * @return bool */ - public static function is_protected_meta_key( $key ) { + public static function is_protected_meta_key( $key, $meta_type = 'post' ) { $key = (string) $key; if ( '' === $key || '_' === $key[0] ) { @@ -210,7 +211,7 @@ public static function is_protected_meta_key( $key ) { } // Honor the `is_protected_meta` filter, so a key another plugin protects without a `_` prefix is caught too. - return is_protected_meta( $key, 'post' ); + return is_protected_meta( $key, $meta_type ); } /** @@ -527,7 +528,7 @@ public function get_author_meta( $data ) { $default = isset( $data['default'] ) ? esc_html( $data['default'] ) : ''; $meta = ''; - if ( isset( $data['metaKey'] ) && ! self::is_protected_meta_key( $data['metaKey'] ) ) { + if ( isset( $data['metaKey'] ) && ! self::is_protected_meta_key( $data['metaKey'], 'user' ) ) { $meta = get_the_author_meta( esc_html( $data['metaKey'] ), intval( get_post_field( 'post_author', $data['context'] ) ) ); } @@ -550,7 +551,7 @@ public function get_loggedin_meta( $data ) { $default = isset( $data['default'] ) ? esc_html( $data['default'] ) : ''; $meta = ''; - if ( isset( $data['metaKey'] ) && ! self::is_protected_meta_key( $data['metaKey'] ) ) { + if ( isset( $data['metaKey'] ) && ! self::is_protected_meta_key( $data['metaKey'], 'user' ) ) { $meta = get_user_meta( $user_id, esc_html( $data['metaKey'] ), true ); } diff --git a/tests/test-dynamic-content.php b/tests/test-dynamic-content.php index 19cd99760..a2105061e 100644 --- a/tests/test-dynamic-content.php +++ b/tests/test-dynamic-content.php @@ -2856,4 +2856,29 @@ public function test_blocks_a_filter_protected_meta_key() { $this->assertSame( 'ORIGINAL', $result ); } + + /** + * Author meta honors a filter that protects a key only for user meta. + */ + public function test_author_meta_blocks_a_user_only_filter_protected_key() { + $author_id = self::factory()->user->create(); + $post_id = self::factory()->post->create( array( 'post_author' => $author_id ) ); + update_user_meta( $author_id, 'nick_x', 'secret-nick' ); + + $filter = static function ( $protected, $meta_key, $meta_type ) { + return ( 'nick_x' === $meta_key && 'user' === $meta_type ) ? true : $protected; + }; + add_filter( 'is_protected_meta', $filter, 10, 3 ); + + $result = $this->dynamic_content_pro->get_author_meta( array( + 'metaKey' => 'nick_x', + 'context' => $post_id, + 'default' => 'DEF', + ) ); + + remove_filter( 'is_protected_meta', $filter, 10 ); + + $this->assertSame( 'DEF', $result ); + $this->assertStringNotContainsString( 'secret-nick', $result ); + } } From d5fdf56172ac4a2e69f065aafcac8c251021f03a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Sat, 21 Nov 2026 10:32:35 +0200 Subject: [PATCH 24/30] fix: normalize core user-field aliases so author `pass` can't leak the hash get_the_author_meta() maps aliases like `pass` and `activation_key` to `user_pass`/`user_activation_key`, but is_protected_meta_key() matched only the full names, so metaKey `pass` returned the author's password hash. Normalize the user-field aliases to their `user_*` form before the check. Add tests: author meta blocks `pass`/`activation_key`; and user-only is_protected_meta filters are honored for get_loggedin_meta() and the loggedInUserMeta block condition. --- .../inc/plugins/class-dynamic-content.php | 8 ++++ tests/test-block-conditions.php | 25 +++++++++++ tests/test-dynamic-content.php | 41 +++++++++++++++++++ 3 files changed, 74 insertions(+) diff --git a/plugins/otter-pro/inc/plugins/class-dynamic-content.php b/plugins/otter-pro/inc/plugins/class-dynamic-content.php index e300d3ed0..eb7a68bba 100644 --- a/plugins/otter-pro/inc/plugins/class-dynamic-content.php +++ b/plugins/otter-pro/inc/plugins/class-dynamic-content.php @@ -200,6 +200,14 @@ public function get_terms( $data ) { public static function is_protected_meta_key( $key, $meta_type = 'post' ) { $key = (string) $key; + // get_the_author_meta() maps these aliases to the user_* fields, so check the real field (e.g. pass -> user_pass). + if ( 'user' === $meta_type ) { + $aliases = array( 'login', 'pass', 'nicename', 'email', 'url', 'registered', 'activation_key', 'status' ); + if ( in_array( strtolower( $key ), $aliases, true ) ) { + $key = 'user_' . strtolower( $key ); + } + } + if ( '' === $key || '_' === $key[0] ) { return true; } diff --git a/tests/test-block-conditions.php b/tests/test-block-conditions.php index 2af8cca86..44adaea5f 100644 --- a/tests/test-block-conditions.php +++ b/tests/test-block-conditions.php @@ -685,4 +685,29 @@ public function test_post_meta_condition_ignores_protected_key() { wp_reset_postdata(); } + + /** + * A logged-in-user-meta condition honors a filter that protects a key only for user meta (otter-internals#320). + */ + public function test_logged_in_user_meta_ignores_user_only_filter_protected_key() { + wp_set_current_user( $this->user_id ); + update_user_meta( $this->user_id, 'nick_x', '1' ); + + $filter = static function ( $protected, $meta_key, $meta_type ) { + return ( 'nick_x' === $meta_key && 'user' === $meta_type ) ? true : $protected; + }; + add_filter( 'is_protected_meta', $filter, 10, 3 ); + + $condition = array( + 'type' => 'loggedInUserMeta', + 'meta_key' => 'nick_x', + 'meta_compare' => 'is_true', + ); + + $result = $this->block_conditions->evaluate_condition( $condition ); + + remove_filter( 'is_protected_meta', $filter, 10 ); + + $this->assertFalse( $result ); + } } diff --git a/tests/test-dynamic-content.php b/tests/test-dynamic-content.php index a2105061e..e2fa77992 100644 --- a/tests/test-dynamic-content.php +++ b/tests/test-dynamic-content.php @@ -2881,4 +2881,45 @@ public function test_author_meta_blocks_a_user_only_filter_protected_key() { $this->assertSame( 'DEF', $result ); $this->assertStringNotContainsString( 'secret-nick', $result ); } + + /** + * Author meta blocks the core user-field aliases, so `pass` cannot return the password hash. + */ + public function test_author_meta_blocks_core_user_aliases() { + $author_id = self::factory()->user->create(); + $post_id = self::factory()->post->create( array( 'post_author' => $author_id ) ); + + foreach ( array( 'pass', 'activation_key' ) as $alias ) { + $result = $this->dynamic_content_pro->get_author_meta( array( + 'metaKey' => $alias, + 'context' => $post_id, + 'default' => 'DEF', + ) ); + + $this->assertSame( 'DEF', $result, "The '$alias' alias must be blocked." ); + } + } + + /** + * Logged-in user meta honors a filter that protects a key only for user meta. + */ + public function test_loggedin_meta_blocks_a_user_only_filter_protected_key() { + $uid = self::factory()->user->create(); + wp_set_current_user( $uid ); + update_user_meta( $uid, 'nick_x', 'secret-nick' ); + + $filter = static function ( $protected, $meta_key, $meta_type ) { + return ( 'nick_x' === $meta_key && 'user' === $meta_type ) ? true : $protected; + }; + add_filter( 'is_protected_meta', $filter, 10, 3 ); + + $result = $this->dynamic_content_pro->get_loggedin_meta( array( + 'metaKey' => 'nick_x', + 'default' => 'DEF', + ) ); + + remove_filter( 'is_protected_meta', $filter, 10 ); + + $this->assertSame( 'DEF', $result ); + } } From 697b6aea5dd83840578d4320bd3845fb3a0d0d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Sat, 21 Nov 2026 11:03:13 +0200 Subject: [PATCH 25/30] fix: check both the raw key and the resolved alias against the filter The alias rewrite replaced the key before the is_protected_meta filter ran, so a plugin protecting a raw user meta key named like a core alias (e.g. `email`) was missed on the get_user_meta paths. Check the raw key verbatim first, then also the resolved `user_*` alias for the get_the_author_meta mapping. Add tests: a filter on the raw `email` user key is honored by get_loggedin_meta() and the loggedInUserMeta condition. --- .../inc/plugins/class-dynamic-content.php | 21 ++++++++++++++-- tests/test-block-conditions.php | 25 +++++++++++++++++++ tests/test-dynamic-content.php | 23 +++++++++++++++++ 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/plugins/otter-pro/inc/plugins/class-dynamic-content.php b/plugins/otter-pro/inc/plugins/class-dynamic-content.php index eb7a68bba..f1dd56176 100644 --- a/plugins/otter-pro/inc/plugins/class-dynamic-content.php +++ b/plugins/otter-pro/inc/plugins/class-dynamic-content.php @@ -200,14 +200,31 @@ public function get_terms( $data ) { public static function is_protected_meta_key( $key, $meta_type = 'post' ) { $key = (string) $key; - // get_the_author_meta() maps these aliases to the user_* fields, so check the real field (e.g. pass -> user_pass). + if ( self::is_protected_meta_name( $key, $meta_type ) ) { + return true; + } + + // get_the_author_meta() also maps these aliases to the user_* fields, so check the resolved field too + // (e.g. pass -> user_pass), while still checking the raw key above for get_user_meta reads. if ( 'user' === $meta_type ) { $aliases = array( 'login', 'pass', 'nicename', 'email', 'url', 'registered', 'activation_key', 'status' ); if ( in_array( strtolower( $key ), $aliases, true ) ) { - $key = 'user_' . strtolower( $key ); + return self::is_protected_meta_name( 'user_' . strtolower( $key ), $meta_type ); } } + return false; + } + + /** + * Whether a single meta key (checked verbatim) is protected. + * + * @param string $key Meta key. + * @param string $meta_type Meta type the key is read from ('post' or 'user'). + * + * @return bool + */ + private static function is_protected_meta_name( $key, $meta_type ) { if ( '' === $key || '_' === $key[0] ) { return true; } diff --git a/tests/test-block-conditions.php b/tests/test-block-conditions.php index 44adaea5f..04ddf2317 100644 --- a/tests/test-block-conditions.php +++ b/tests/test-block-conditions.php @@ -710,4 +710,29 @@ public function test_logged_in_user_meta_ignores_user_only_filter_protected_key( $this->assertFalse( $result ); } + + /** + * A user meta key named like a core alias is still checked verbatim against the filter. + */ + public function test_logged_in_user_meta_checks_an_alias_named_key_verbatim() { + wp_set_current_user( $this->user_id ); + update_user_meta( $this->user_id, 'email', '1' ); + + $filter = static function ( $protected, $meta_key, $meta_type ) { + return ( 'email' === $meta_key && 'user' === $meta_type ) ? true : $protected; + }; + add_filter( 'is_protected_meta', $filter, 10, 3 ); + + $condition = array( + 'type' => 'loggedInUserMeta', + 'meta_key' => 'email', + 'meta_compare' => 'is_true', + ); + + $result = $this->block_conditions->evaluate_condition( $condition ); + + remove_filter( 'is_protected_meta', $filter, 10 ); + + $this->assertFalse( $result ); + } } diff --git a/tests/test-dynamic-content.php b/tests/test-dynamic-content.php index e2fa77992..15cab5bd9 100644 --- a/tests/test-dynamic-content.php +++ b/tests/test-dynamic-content.php @@ -2922,4 +2922,27 @@ public function test_loggedin_meta_blocks_a_user_only_filter_protected_key() { $this->assertSame( 'DEF', $result ); } + + /** + * A user meta key named like a core alias is still checked verbatim against the filter. + */ + public function test_loggedin_meta_checks_an_alias_named_key_verbatim() { + $uid = self::factory()->user->create(); + wp_set_current_user( $uid ); + update_user_meta( $uid, 'email', 'secret-mail' ); + + $filter = static function ( $protected, $meta_key, $meta_type ) { + return ( 'email' === $meta_key && 'user' === $meta_type ) ? true : $protected; + }; + add_filter( 'is_protected_meta', $filter, 10, 3 ); + + $result = $this->dynamic_content_pro->get_loggedin_meta( array( + 'metaKey' => 'email', + 'default' => 'DEF', + ) ); + + remove_filter( 'is_protected_meta', $filter, 10 ); + + $this->assertSame( 'DEF', $result ); + } } From 0a4ffcc90e3454bb24034f58d40d41b7b48dfb99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Sat, 21 Nov 2026 11:26:37 +0200 Subject: [PATCH 26/30] fix: resolve WordPress back-compat author fields before the protected check get_the_author_meta() reads user_firstname/user_lastname/user_description via WP_User::__get, which maps them to the first_name/last_name/description meta keys. is_protected_meta_key() checked only the raw name, so a filter on first_name was missed. Resolve those back-compat fields to their real meta key. Also seed user_activation_key in the alias test so the activation_key case fails without the fix, and add a first_name back-compat author-meta test. --- .../inc/plugins/class-dynamic-content.php | 21 ++++++++++--- tests/test-dynamic-content.php | 31 +++++++++++++++++++ 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/plugins/otter-pro/inc/plugins/class-dynamic-content.php b/plugins/otter-pro/inc/plugins/class-dynamic-content.php index f1dd56176..530825a8d 100644 --- a/plugins/otter-pro/inc/plugins/class-dynamic-content.php +++ b/plugins/otter-pro/inc/plugins/class-dynamic-content.php @@ -204,12 +204,25 @@ public static function is_protected_meta_key( $key, $meta_type = 'post' ) { return true; } - // get_the_author_meta() also maps these aliases to the user_* fields, so check the resolved field too - // (e.g. pass -> user_pass), while still checking the raw key above for get_user_meta reads. + // get_the_author_meta() -> WP_User::__get resolves field names to real user-meta keys, so check the + // resolved key too, while still checking the raw key above for get_user_meta reads. if ( 'user' === $meta_type ) { + $lower = strtolower( $key ); + + // Forward aliases, e.g. pass -> user_pass. $aliases = array( 'login', 'pass', 'nicename', 'email', 'url', 'registered', 'activation_key', 'status' ); - if ( in_array( strtolower( $key ), $aliases, true ) ) { - return self::is_protected_meta_name( 'user_' . strtolower( $key ), $meta_type ); + if ( in_array( $lower, $aliases, true ) ) { + return self::is_protected_meta_name( 'user_' . $lower, $meta_type ); + } + + // Back-compat fields, e.g. user_firstname -> first_name. + $back_compat = array( + 'user_firstname' => 'first_name', + 'user_lastname' => 'last_name', + 'user_description' => 'description', + ); + if ( isset( $back_compat[ $lower ] ) ) { + return self::is_protected_meta_name( $back_compat[ $lower ], $meta_type ); } } diff --git a/tests/test-dynamic-content.php b/tests/test-dynamic-content.php index 15cab5bd9..7325184dd 100644 --- a/tests/test-dynamic-content.php +++ b/tests/test-dynamic-content.php @@ -2886,9 +2886,15 @@ public function test_author_meta_blocks_a_user_only_filter_protected_key() { * Author meta blocks the core user-field aliases, so `pass` cannot return the password hash. */ public function test_author_meta_blocks_core_user_aliases() { + global $wpdb; + $author_id = self::factory()->user->create(); $post_id = self::factory()->post->create( array( 'post_author' => $author_id ) ); + // Seed the reset key so the activation_key alias has a value to leak without the fix. + $wpdb->update( $wpdb->users, array( 'user_activation_key' => 'secret-key' ), array( 'ID' => $author_id ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery + clean_user_cache( $author_id ); + foreach ( array( 'pass', 'activation_key' ) as $alias ) { $result = $this->dynamic_content_pro->get_author_meta( array( 'metaKey' => $alias, @@ -2923,6 +2929,31 @@ public function test_loggedin_meta_blocks_a_user_only_filter_protected_key() { $this->assertSame( 'DEF', $result ); } + /** + * Author meta resolves a back-compat field to its real meta key before the filter check. + */ + public function test_author_meta_blocks_a_filter_protected_back_compat_field() { + $author_id = self::factory()->user->create(); + $post_id = self::factory()->post->create( array( 'post_author' => $author_id ) ); + update_user_meta( $author_id, 'first_name', 'secret-first' ); + + $filter = static function ( $protected, $meta_key, $meta_type ) { + return ( 'first_name' === $meta_key && 'user' === $meta_type ) ? true : $protected; + }; + add_filter( 'is_protected_meta', $filter, 10, 3 ); + + $result = $this->dynamic_content_pro->get_author_meta( array( + 'metaKey' => 'user_firstname', + 'context' => $post_id, + 'default' => 'DEF', + ) ); + + remove_filter( 'is_protected_meta', $filter, 10 ); + + $this->assertSame( 'DEF', $result ); + $this->assertStringNotContainsString( 'secret-first', $result ); + } + /** * A user meta key named like a core alias is still checked verbatim against the filter. */ From b8e061b52db6664e76e77fd05182c8745ea19e8f Mon Sep 17 00:00:00 2001 From: girishpanchal30 Date: Mon, 23 Nov 2026 12:07:35 +0530 Subject: [PATCH 27/30] fix: prevent XSS by disabling Lottie expression evaluation --- assets/lottie/dotlottie-player.min.js | 8 +-- assets/lottie/lottie-player.min.js | 2 +- src/blocks/test/e2e/blocks/lottie.spec.js | 79 +++++++++++++++++++++++ 3 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 src/blocks/test/e2e/blocks/lottie.spec.js diff --git a/assets/lottie/dotlottie-player.min.js b/assets/lottie/dotlottie-player.min.js index 306867da3..05c667601 100644 --- a/assets/lottie/dotlottie-player.min.js +++ b/assets/lottie/dotlottie-player.min.js @@ -8,13 +8,13 @@ Event: `).concat(JSON.stringify(l.data)));return s.scheduler.schedule(function(){s.forward(l);var E=s._nextState(l);s.update(E,l);}),s._state},this.sendTo=function(P,c,l){var E=s.parent&&(c===_a.Parent||s.parent.id===c),b=E?s.parent:Qe(c)?c===_a.Internal?s:s.children.get(c)||Qa.get(c):Ff(c)?c:void 0;if(!b){if(!E)throw new Error("Unable to send event to child '".concat(c,"' from service '").concat(s.id,"'."));return}if("machine"in b){if(s.status!==ji.Stopped||s.parent!==b||s.state.done){var v=ae(ae({},P),{name:P.name===bf?"".concat(en(s.id)):P.name,origin:s.sessionId});!l&&s.machine.config.predictableActionArguments?s._outgoingQueue.push([b,v]):b.send(v);}}else !l&&s.machine.config.predictableActionArguments?s._outgoingQueue.push([b,P.data]):b.send(P.data);},this._exec=function(P,c,l,E){E===void 0&&(E=s.machine.options.actions);var b=P.exec||Mo(P.type,E),v=Ye(b)?b:b?b.exec:P.exec;if(v)try{return v(c,l.data,s.machine.config.predictableActionArguments?{action:P,_event:l}:{action:P,state:s.state,_event:l})}catch(ht){throw s.parent&&s.parent.send({type:"xstate.error",data:ht}),ht}switch(P.type){case hn:{var w=P;s.defer(w);break}case jn:var u=P;if(typeof u.delay=="number"){s.defer(u);return}else u.to?s.sendTo(u._event,u.to,l===ba):s.send(u._event);break;case Xh:s.cancel(P.sendId);break;case Eo:{if(s.status!==ji.Running)return;var f=P.activity;if(!s.machine.config.predictableActionArguments&&!s.state.activities[f.id||f.type])break;if(f.type===ai.Invoke){var g=sl(f.src),_=s.machine.options.services?s.machine.options.services[g.type]:void 0,k=f.id,z=f.data,q="autoForward"in f?f.autoForward:!!f.forward;if(!_)return;var W=z?zn(z,c,l):void 0;if(typeof _=="string")return;var ot=Ye(_)?_(c,l.data,{data:W,src:g,meta:f.meta}):_;if(!ot)return;var mt=void 0;xa(ot)&&(ot=W?ot.withContext(W):ot,mt={autoForward:q}),s.spawn(ot,k,mt);}else s.spawnActivity(f);break}case Io:{s.stopChild(P.activity.id);break}case Jh:var gt=P,ut=gt.label,Ct=gt.value;ut?s.logger(ut,Ct):s.logger(Ct);break}};var r=ae(ae({},t.defaultOptions),i),a=r.clock,n=r.logger,p=r.parent,h=r.id,y=h!==void 0?h:e.id;this.id=y,this.logger=n,this.clock=a,this.parent=p,this.options=r,this.scheduler=new Wh({deferEvents:this.options.deferEvents}),this.sessionId=Qa.bookId();}return Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:ya(this,function(){return e._initialState=e.machine.initialState,e._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(e,i){var s,r;try{for(var a=ze(e.actions),n=a.next();!n.done;n=a.next()){var p=n.value;this.exec(p,e,i);}}catch(h){s={error:h};}finally{try{n&&!n.done&&(r=a.return)&&r.call(a);}finally{if(s)throw s.error}}},t.prototype.update=function(e,i){var s,r,a,n,p,h,y,P,c=this;if(e._sessionid=this.sessionId,this._state=e,(!this.machine.config.predictableActionArguments||i===ba)&&this.options.execute)this.execute(this.state);else for(var l=void 0;l=this._outgoingQueue.shift();)l[0].send(l[1]);if(this.children.forEach(function(ot){c.state.children[ot.id]=ot;}),this.devTools&&this.devTools.send(i.data,e),e.event)try{for(var E=ze(this.eventListeners),b=E.next();!b.done;b=E.next()){var v=b.value;v(e.event);}}catch(ot){s={error:ot};}finally{try{b&&!b.done&&(r=E.return)&&r.call(E);}finally{if(s)throw s.error}}try{for(var w=ze(this.listeners),u=w.next();!u.done;u=w.next()){var v=u.value;v(e,e.event);}}catch(ot){a={error:ot};}finally{try{u&&!u.done&&(n=w.return)&&n.call(w);}finally{if(a)throw a.error}}try{for(var f=ze(this.contextListeners),g=f.next();!g.done;g=f.next()){var _=g.value;_(this.state.context,this.state.history?this.state.history.context:void 0);}}catch(ot){p={error:ot};}finally{try{g&&!g.done&&(h=f.return)&&h.call(f);}finally{if(p)throw p.error}}if(this.state.done){var k=e.configuration.find(function(ot){return ot.type==="final"&&ot.parent===c.machine}),z=k&&k.doneData?zn(k.doneData,e.context,i):void 0;this._doneEvent=Rn(this.id,z);try{for(var q=ze(this.doneListeners),W=q.next();!W.done;W=q.next()){var v=W.value;v(this._doneEvent);}}catch(ot){y={error:ot};}finally{try{W&&!W.done&&(P=q.return)&&P.call(q);}finally{if(y)throw y.error}}this._stop(),this._stopChildren(),Qa.free(this.sessionId);}},t.prototype.onTransition=function(e){return this.listeners.add(e),this.status===ji.Running&&e(this.state,this.state.event),this},t.prototype.subscribe=function(e,i,s){var r=this,a=Vn(e,i,s);this.listeners.add(a.next),this.status!==ji.NotStarted&&a.next(this.state);var n=function(){r.doneListeners.delete(n),r.stopListeners.delete(n),a.complete();};return this.status===ji.Stopped?a.complete():(this.onDone(n),this.onStop(n)),{unsubscribe:function(){r.listeners.delete(a.next),r.doneListeners.delete(n),r.stopListeners.delete(n);}}},t.prototype.onEvent=function(e){return this.eventListeners.add(e),this},t.prototype.onSend=function(e){return this.sendListeners.add(e),this},t.prototype.onChange=function(e){return this.contextListeners.add(e),this},t.prototype.onStop=function(e){return this.stopListeners.add(e),this},t.prototype.onDone=function(e){return this.status===ji.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},t.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},t.prototype.start=function(e){var i=this;if(this.status===ji.Running)return this;this.machine._init(),Qa.register(this.sessionId,this),this.initialized=!0,this.status=ji.Running;var s=e===void 0?this.initialState:ya(this,function(){return Kf(e)?i.machine.resolveState(e):i.machine.resolveState(ir.from(e,i.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){i.update(s,ba);}),this},t.prototype._stopChildren=function(){this.children.forEach(function(e){Ye(e.stop)&&e.stop();}),this.children.clear();},t.prototype._stop=function(){var e,i,s,r,a,n,p,h,y,P;try{for(var c=ze(this.listeners),l=c.next();!l.done;l=c.next()){var E=l.value;this.listeners.delete(E);}}catch(q){e={error:q};}finally{try{l&&!l.done&&(i=c.return)&&i.call(c);}finally{if(e)throw e.error}}try{for(var b=ze(this.stopListeners),v=b.next();!v.done;v=b.next()){var E=v.value;E(),this.stopListeners.delete(E);}}catch(q){s={error:q};}finally{try{v&&!v.done&&(r=b.return)&&r.call(b);}finally{if(s)throw s.error}}try{for(var w=ze(this.contextListeners),u=w.next();!u.done;u=w.next()){var E=u.value;this.contextListeners.delete(E);}}catch(q){a={error:q};}finally{try{u&&!u.done&&(n=w.return)&&n.call(w);}finally{if(a)throw a.error}}try{for(var f=ze(this.doneListeners),g=f.next();!g.done;g=f.next()){var E=g.value;this.doneListeners.delete(E);}}catch(q){p={error:q};}finally{try{g&&!g.done&&(h=f.return)&&h.call(f);}finally{if(p)throw p.error}}if(!this.initialized)return this;this.initialized=!1,this.status=ji.Stopped,this._initialState=void 0;try{for(var _=ze(Object.keys(this.delayedEventsMap)),k=_.next();!k.done;k=_.next()){var z=k.value;this.clock.clearTimeout(this.delayedEventsMap[z]);}}catch(q){y={error:q};}finally{try{k&&!k.done&&(P=_.return)&&P.call(_);}finally{if(y)throw y.error}}this.scheduler.clear(),this.scheduler=new Wh({deferEvents:this.options.deferEvents});},t.prototype.stop=function(){var e=this,i=this.scheduler;return this._stop(),i.schedule(function(){var s=Ui({type:"xstate.stop"}),r=ya(e,function(){var a=bi(ui([],qe(e.state.configuration),!1).sort(function(P,c){return c.order-P.order}).map(function(P){return Fr(P.onExit,e.machine.options.actions)})),n=qe(Nn(e.machine,e.state,e.state.context,s,[{type:"exit",actions:a}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),p=n[0],h=n[1],y=new ir({value:e.state.value,context:h,_event:s,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:p.filter(function(P){return !To(P)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return y.changed=!0,y});e.update(r,s),e._stopChildren(),Qa.free(e.sessionId);}),this},t.prototype.batch=function(e){var i=this;if(!(this.status===ji.NotStarted&&this.options.deferEvents)){if(this.status!==ji.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'))}if(e.length){var s=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var r,a,n=i.state,p=!1,h=[],y=function(E){var b=Ui(E);i.forward(b),n=ya(i,function(){return i.machine.transition(n,b,void 0,s||void 0)}),h.push.apply(h,ui([],qe(i.machine.config.predictableActionArguments?n.actions:n.actions.map(function(v){return Qf(v,n)})),!1)),p=p||!!n.changed;};try{for(var P=ze(e),c=P.next();!c.done;c=P.next()){var l=c.value;y(l);}}catch(E){r={error:E};}finally{try{c&&!c.done&&(a=P.return)&&a.call(P);}finally{if(r)throw r.error}}n.changed=p,n.actions=h,i.update(n,Ui(e[e.length-1]));});}},t.prototype.sender=function(e){return this.send.bind(this,e)},t.prototype._nextState=function(e,i){var s=this;i===void 0&&(i=!!this.machine.config.predictableActionArguments&&this._exec);var r=Ui(e);if(r.name.indexOf(Nh)===0&&!this.state.nextEvents.some(function(n){return n.indexOf(Nh)===0}))throw r.data.data;var a=ya(this,function(){return s.machine.transition(s.state,r,void 0,i||void 0)});return a},t.prototype.nextState=function(e){return this._nextState(e,!1)},t.prototype.forward=function(e){var i,s;try{for(var r=ze(this.forwardTo),a=r.next();!a.done;a=r.next()){var n=a.value,p=this.children.get(n);if(!p)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(n,"'."));p.send(e);}}catch(h){i={error:h};}finally{try{a&&!a.done&&(s=r.return)&&s.call(r);}finally{if(i)throw i.error}}},t.prototype.defer=function(e){var i=this,s=this.clock.setTimeout(function(){"to"in e&&e.to?i.sendTo(e._event,e.to,!0):i.send(e._event);},e.delay);e.id&&(this.delayedEventsMap[e.id]=s);},t.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e];},t.prototype.exec=function(e,i,s){s===void 0&&(s=this.machine.options.actions),this._exec(e,i.context,i._event,s);},t.prototype.removeChild=function(e){var i;this.children.delete(e),this.forwardTo.delete(e),(i=this.state)===null||i===void 0||delete i.children[e];},t.prototype.stopChild=function(e){var i=this.children.get(e);i&&(this.removeChild(e),Ye(i.stop)&&i.stop());},t.prototype.spawn=function(e,i,s){if(this.status!==ji.Running)return al(e,i);if(Hh(e))return this.spawnPromise(Promise.resolve(e),i);if(Ye(e))return this.spawnCallback(e,i);if(Xf(e))return this.spawnActor(e,i);if(Df(e))return this.spawnObservable(e,i);if(xa(e))return this.spawnMachine(e,ae(ae({},s),{id:i}));if(kf(e))return this.spawnBehavior(e,i);throw new Error('Unable to spawn entity "'.concat(i,'" of type "').concat(typeof e,'".'))},t.prototype.spawnMachine=function(e,i){var s=this;i===void 0&&(i={});var r=new t(e,ae(ae({},this.options),{parent:this,id:i.id||e.id})),a=ae(ae({},ac),i);a.sync&&r.onTransition(function(p){s.send(Uh,{state:p,id:r.id});});var n=r;return this.children.set(r.id,n),a.autoForward&&this.forwardTo.add(r.id),r.onDone(function(p){s.removeChild(r.id),s.send(Ui(p,{origin:r.id}));}).start(),n},t.prototype.spawnBehavior=function(e,i){var s=rc(e,{id:i,parent:this});return this.children.set(i,s),s},t.prototype.spawnPromise=function(e,i){var s,r=this,a=!1,n;e.then(function(h){a||(n=h,r.removeChild(i),r.send(Ui(Rn(i,h),{origin:i})));},function(h){if(!a){r.removeChild(i);var y=en(i,h);try{r.send(Ui(y,{origin:i}));}catch{r.devTools&&r.devTools.send(y,r.state),r.machine.strict&&r.stop();}}});var p=(s={id:i,send:function(){},subscribe:function(h,y,P){var c=Vn(h,y,P),l=!1;return e.then(function(E){l||(c.next(E),!l&&c.complete());},function(E){l||c.error(E);}),{unsubscribe:function(){return l=!0}}},stop:function(){a=!0;},toJSON:function(){return {id:i}},getSnapshot:function(){return n}},s[Dr]=function(){return this},s);return this.children.set(i,p),p},t.prototype.spawnCallback=function(e,i){var s,r=this,a=!1,n=new Set,p=new Set,h,y=function(l){h=l,p.forEach(function(E){return E(l)}),!a&&r.send(Ui(l,{origin:i}));},P;try{P=e(y,function(l){n.add(l);});}catch(l){this.send(en(i,l));}if(Hh(P))return this.spawnPromise(P,i);var c=(s={id:i,send:function(l){return n.forEach(function(E){return E(l)})},subscribe:function(l){var E=Vn(l);return p.add(E.next),{unsubscribe:function(){p.delete(E.next);}}},stop:function(){a=!0,Ye(P)&&P();},toJSON:function(){return {id:i}},getSnapshot:function(){return h}},s[Dr]=function(){return this},s);return this.children.set(i,c),c},t.prototype.spawnObservable=function(e,i){var s,r=this,a,n=e.subscribe(function(h){a=h,r.send(Ui(h,{origin:i}));},function(h){r.removeChild(i),r.send(Ui(en(i,h),{origin:i}));},function(){r.removeChild(i),r.send(Ui(Rn(i),{origin:i}));}),p=(s={id:i,send:function(){},subscribe:function(h,y,P){return e.subscribe(h,y,P)},stop:function(){return n.unsubscribe()},getSnapshot:function(){return a},toJSON:function(){return {id:i}}},s[Dr]=function(){return this},s);return this.children.set(i,p),p},t.prototype.spawnActor=function(e,i){return this.children.set(i,e),e},t.prototype.spawnActivity=function(e){var i=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(i){var s=i(this.state.context,e);this.spawnEffect(e.id,s);}},t.prototype.spawnEffect=function(e,i){var s;this.children.set(e,(s={id:e,send:function(){},subscribe:function(){return {unsubscribe:function(){}}},stop:i||void 0,getSnapshot:function(){},toJSON:function(){return {id:e}}},s[Dr]=function(){return this},s));},t.prototype.attachDev=function(){var e=Ro();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var i=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(ae(ae({name:this.id,autoPause:!0,stateSanitizer:function(s){return {value:s.value,context:s.context,actions:s.actions}}},i),{features:ae({jump:!1,skip:!1},i?i.features:void 0)}),this.machine),this.devTools.init(this.state);}sc(this);}},t.prototype.toJSON=function(){return {id:this.id}},t.prototype[Dr]=function(){return this},t.prototype.getSnapshot=function(){return this.status===ji.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,i){return setTimeout(e,i)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},t.interpret=pl,t}();In="",Do="#",So="*",da={},ga=function(t){return t[0]===Do},hc=function(){return {actions:{},guards:{},services:{},activities:{},delays:{}}},lc=function(){function t(e,i,s,r){s===void 0&&(s="context"in e?e.context:void 0);var a=this,n;this.config=e,this._context=s,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(hc(),i),this.parent=r==null?void 0:r.parent,this.key=this.config.key||(r==null?void 0:r.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:Zh),this.id=this.config.id||ui([this.machine.key],qe(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(n=this.config.schema)!==null&&n!==void 0?n:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?tn(this.config.states,function(y,P){var c,l=new t(y,{},void 0,{parent:a,key:P});return Object.assign(a.idMap,ae((c={},c[l.id]=l,c),l.idMap)),l}):da;var p=0;function h(y){var P,c;y.order=p++;try{for(var l=ze(nl(y)),E=l.next();!E.done;E=l.next()){var b=E.value;h(b);}}catch(v){P={error:v};}finally{try{E&&!E.done&&(c=l.return)&&c.call(l);}finally{if(P)throw P.error}}}h(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(y){var P=y.event;return P===In}):In in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=$s(this.config.entry||this.config.onEntry).map(function(y){return nn(y)}),this.onExit=$s(this.config.exit||this.config.onExit).map(function(y){return nn(y)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=$s(this.config.invoke).map(function(y,P){var c,l;if(xa(y)){var E=wn(a.id,P);return a.machine.options.services=ae((c={},c[E]=y,c),a.machine.options.services),Fn({src:E,id:E})}else if(Qe(y.src)){var E=y.id||wn(a.id,P);return Fn(ae(ae({},y),{id:E,src:y.src}))}else if(xa(y.src)||Ye(y.src)){var E=y.id||wn(a.id,P);return a.machine.options.services=ae((l={},l[E]=y.src,l),a.machine.options.services),Fn(ae(ae({id:E},y),{src:E}))}else {var b=y.src;return Fn(ae(ae({id:wn(a.id,P)},y),{src:b}))}}),this.activities=$s(this.config.activities).concat(this.invoke).map(function(y){return Vo(y)}),this.transition=this.transition.bind(this),this.tags=$s(this.config.tags);}return t.prototype._init=function(){this.__cache.transitions||ol(this).forEach(function(e){return e.on});},t.prototype.withConfig=function(e,i){var s=this.options,r=s.actions,a=s.activities,n=s.guards,p=s.services,h=s.delays;return new t(this.config,{actions:ae(ae({},r),e.actions),activities:ae(ae({},a),e.activities),guards:ae(ae({},n),e.guards),services:ae(ae({},p),e.services),delays:ae(ae({},h),e.delays)},i!=null?i:this.context)},t.prototype.withContext=function(e){return new t(this.config,this.options,e)},Object.defineProperty(t.prototype,"context",{get:function(){return Ye(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"definition",{get:function(){return {id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:tn(this.states,function(e){return e.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce(function(i,s){return i[s.eventType]=i[s.eventType]||[],i[s.eventType].push(s),i},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var i=e===In,s=this.transitions.filter(function(r){var a=r.eventType===e;return i?a:a||r.eventType===So});return this.__cache.candidates[e]=s,s},t.prototype.getDelayedTransitions=function(){var e=this,i=this.config.after;if(!i)return [];var s=function(a,n){var p=Ye(a)?"".concat(e.id,":delay[").concat(n,"]"):a,h=Hf(p,e.id);return e.onEntry.push(Rf(h,{delay:a})),e.onExit.push(zf(h)),h},r=Pa(i)?i.map(function(a,n){var p=s(a.delay,n);return ae(ae({},a),{event:p})}):bi(Object.keys(i).map(function(a,n){var p=i[a],h=Qe(p)?{target:p}:p,y=isNaN(+a)?a:+a,P=s(y,n);return $s(h).map(function(c){return ae(ae({},c),{event:P,delay:y})})}));return r.map(function(a){var n=a.delay;return ae(ae({},e.formatTransition(a)),{delay:n})})},t.prototype.getStateNodes=function(e){var i,s=this;if(!e)return [];var r=e instanceof ir?e.value:an(e,this.delimiter);if(Qe(r)){var a=this.getStateNode(r).initial;return a!==void 0?this.getStateNodes((i={},i[r]=a,i)):[this,this.states[r]]}var n=Object.keys(r),p=[this];return p.push.apply(p,ui([],qe(bi(n.map(function(h){return s.getStateNode(h).getStateNodes(r[h])}))),!1)),p},t.prototype.handles=function(e){var i=Kh(e);return this.events.includes(i)},t.prototype.resolveState=function(e){var i=e instanceof ir?e:ir.create(e),s=Array.from(sn([],this.getStateNodes(i.value)));return new ir(ae(ae({},i),{value:this.resolve(i.value),configuration:s,done:Bn(s,this),tags:$h(s),machine:this.machine}))},t.prototype.transitionLeafNode=function(e,i,s){var r=this.getStateNode(e),a=r.next(i,s);return !a||!a.transitions.length?this.next(i,s):a},t.prototype.transitionCompoundNode=function(e,i,s){var r=Object.keys(e),a=this.getStateNode(r[0]),n=a._transition(e[r[0]],i,s);return !n||!n.transitions.length?this.next(i,s):n},t.prototype.transitionParallelNode=function(e,i,s){var r,a,n={};try{for(var p=ze(Object.keys(e)),h=p.next();!h.done;h=p.next()){var y=h.value,P=e[y];if(P){var c=this.getStateNode(y),l=c._transition(P,i,s);l&&(n[y]=l);}}}catch(u){r={error:u};}finally{try{h&&!h.done&&(a=p.return)&&a.call(p);}finally{if(r)throw r.error}}var E=Object.keys(n).map(function(u){return n[u]}),b=bi(E.map(function(u){return u.transitions})),v=E.some(function(u){return u.transitions.length>0});if(!v)return this.next(i,s);var w=bi(Object.keys(n).map(function(u){return n[u].configuration}));return {transitions:b,exitSet:bi(E.map(function(u){return u.exitSet})),configuration:w,source:i,actions:bi(Object.keys(n).map(function(u){return n[u].actions}))}},t.prototype._transition=function(e,i,s){return Qe(e)?this.transitionLeafNode(e,i,s):Object.keys(e).length===1?this.transitionCompoundNode(e,i,s):this.transitionParallelNode(e,i,s)},t.prototype.getTransitionData=function(e,i){return this._transition(e.value,e,Ui(i))},t.prototype.next=function(e,i){var s,r,a=this,n=i.name,p=[],h=[],y;try{for(var P=ze(this.getCandidates(n)),c=P.next();!c.done;c=P.next()){var l=c.value,E=l.cond,b=l.in,v=e.context,w=b?Qe(b)&&ga(b)?e.matches(an(this.getStateNodeById(b).path,this.delimiter)):Lo(an(b,this.delimiter),Ef(this.path.slice(0,-2))(e.value)):!0,u=!1;try{u=!E||il(this.machine,E,v,i,e);}catch(_){throw new Error("Unable to evaluate guard '".concat(E.name||E.type,"' in transition for event '").concat(n,"' in state node '").concat(this.id,`': `).concat(_.message))}if(u&&w){l.target!==void 0&&(h=l.target),p.push.apply(p,ui([],qe(l.actions),!1)),y=l;break}}}catch(_){s={error:_};}finally{try{c&&!c.done&&(r=P.return)&&r.call(P);}finally{if(s)throw s.error}}if(y){if(!h.length)return {transitions:[y],exitSet:[],configuration:e.value?[this]:[],source:e,actions:p};var f=bi(h.map(function(_){return a.getRelativeStateNodes(_,e.historyValue)})),g=!!y.internal;return {transitions:[y],exitSet:g?[]:bi(h.map(function(_){return a.getPotentiallyReenteringNodes(_)})),configuration:f,source:e,actions:p}}},t.prototype.getPotentiallyReenteringNodes=function(e){if(this.order0,E=l?e.configuration:i?i.configuration:[],b=Bn(E,this),v=l?Jf(this.machine,c):void 0,w=i?i.historyValue?i.historyValue:e.source?this.machine.historyValue(i.value):void 0:void 0,u=this.getActions(new Set(E),b,e,s,a,i,r),f=i?ae({},i.activities):{};try{for(var g=ze(u),_=g.next();!_.done;_=g.next()){var k=_.value;try{for(var z=(h=void 0,ze(k.actions)),q=z.next();!q.done;q=z.next()){var W=q.value;W.type===Eo?f[W.activity.id||W.activity.type]=W:W.type===Io&&(f[W.activity.id||W.activity.type]=!1);}}catch(Xt){h={error:Xt};}finally{try{q&&!q.done&&(y=z.return)&&y.call(z);}finally{if(h)throw h.error}}}}catch(Xt){n={error:Xt};}finally{try{_&&!_.done&&(p=g.return)&&p.call(g);}finally{if(n)throw n.error}}var ot=qe(Nn(this,i,s,a,u,r,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),mt=ot[0],gt=ot[1],ut=qe(Tf(mt,To),2),Ct=ut[0],ht=ut[1],yt=mt.filter(function(Xt){var Ht;return Xt.type===Eo&&((Ht=Xt.activity)===null||Ht===void 0?void 0:Ht.type)===Ao}),D=yt.reduce(function(Xt,Ht){return Xt[Ht.activity.id]=$f(Ht.activity,P.machine,gt,a),Xt},i?ae({},i.children):{}),V=new ir({value:v||i.value,context:gt,_event:a,_sessionid:i?i._sessionid:null,historyValue:v?w?Mf(w,v):void 0:i?i.historyValue:void 0,history:!v||e.source?i:void 0,actions:v?ht:[],activities:v?f:i?i.activities:{},events:[],configuration:E,transitions:e.transitions,children:D,done:b,tags:$h(E),machine:this}),S=s!==gt;V.changed=a.name===Uh||S;var R=V.history;R&&delete R.history;var tt=!b&&(this._transient||c.some(function(Xt){return Xt._transient}));if(!l&&(!tt||a.name===In))return V;var J=V;if(!b)for(tt&&(J=this.resolveRaisedTransition(J,{type:yf},a,r));Ct.length;){var Gt=Ct.shift();J=this.resolveRaisedTransition(J,Gt._event,a,r);}var Vt=J.changed||(R?!!J.actions.length||S||typeof R.value!=typeof J.value||!ll(J.value,R.value):void 0);return J.changed=Vt,J.history=R,J},t.prototype.getStateNode=function(e){if(ga(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var i=this.states[e];if(!i)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return i},t.prototype.getStateNodeById=function(e){var i=ga(e)?e.slice(Do.length):e;if(i===this.id)return this;var s=this.machine.idMap[i];if(!s)throw new Error("Child state node '#".concat(i,"' does not exist on machine '").concat(this.id,"'"));return s},t.prototype.getStateNodeByPath=function(e){if(typeof e=="string"&&ga(e))try{return this.getStateNodeById(e.slice(1))}catch{}for(var i=ko(e,this.delimiter).slice(),s=this;i.length;){var r=i.shift();if(!r.length)break;s=s.getStateNode(r);}return s},t.prototype.resolve=function(e){var i,s=this;if(!e)return this.initialStateValue||da;switch(this.type){case"parallel":return tn(this.initialStateValue,function(a,n){return a?s.getStateNode(n).resolve(e[n]||a):da});case"compound":if(Qe(e)){var r=this.getStateNode(e);return r.type==="parallel"||r.type==="compound"?(i={},i[e]=r.initialStateValue,i):e}return Object.keys(e).length?tn(e,function(a,n){return a?s.getStateNode(n).resolve(a):da}):this.initialStateValue||{};default:return e||da}},t.prototype.getResolvedPath=function(e){if(ga(e)){var i=this.machine.idMap[e.slice(Do.length)];if(!i)throw new Error("Unable to find state node '".concat(e,"'"));return i.path}return ko(e,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var e;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var i;if(this.type==="parallel")i=jh(this.states,function(s){return s.initialStateValue||da},function(s){return s.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));i=Gn(this.states[this.initial])?this.initial:(e={},e[this.initial]=this.states[this.initial].initialStateValue,e);}else i={};return this.__cache.initialStateValue=i,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(e,i){this._init();var s=this.getStateNodes(e);return this.resolveTransition({configuration:s,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,i!=null?i:this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var e;if(this.type==="history"){var i=this.config;Qe(i.target)?e=ga(i.target)?On(this.machine.getStateNodeById(i.target).path.slice(this.path.length-1)):i.target:e=i.target;}return e},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(e,i,s){return s===void 0&&(s=!0),s?e.type==="history"?e.resolveHistory(i):e.initialStateNodes:[e]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var e=this;if(Gn(this))return [this];if(this.type==="compound"&&!this.initial)return [this];var i=Ln(this.initialStateValue);return bi(i.map(function(s){return e.getFromRelativePath(s)}))},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(e){if(!e.length)return [this];var i=qe(e),s=i[0],r=i.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(s,"' from node with no states"));var a=this.getStateNode(s);if(a.type==="history")return a.resolveHistory();if(!this.states[s])throw new Error("Child state '".concat(s,"' does not exist on '").concat(this.id,"'"));return this.states[s].getFromRelativePath(r)},t.prototype.historyValue=function(e){if(Object.keys(this.states).length)return {current:e||this.initialStateValue,states:jh(this.states,function(i,s){if(!e)return i.historyValue();var r=Qe(e)?void 0:e[s];return i.historyValue(r||i.initialStateValue)},function(i){return !i.history})}},t.prototype.resolveHistory=function(e){var i=this;if(this.type!=="history")return [this];var s=this.parent;if(!e){var r=this.target;return r?bi(Ln(r).map(function(n){return s.getFromRelativePath(n)})):s.initialStateNodes}var a=Af(s.path,"states")(e).current;return Qe(a)?[s.getStateNode(a)]:bi(Ln(a).map(function(n){return i.history==="deep"?s.getFromRelativePath(n):[s.states[n[0]]]}))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var e=this,i=bi(Object.keys(this.states).map(function(s){return e.states[s].stateIds}));return [this.id].concat(i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){var e,i,s,r;if(this.__cache.events)return this.__cache.events;var a=this.states,n=new Set(this.ownEvents);if(a)try{for(var p=ze(Object.keys(a)),h=p.next();!h.done;h=p.next()){var y=h.value,P=a[y];if(P.states)try{for(var c=(s=void 0,ze(P.events)),l=c.next();!l.done;l=c.next()){var E=l.value;n.add("".concat(E));}}catch(b){s={error:b};}finally{try{l&&!l.done&&(r=c.return)&&r.call(c);}finally{if(s)throw s.error}}}}catch(b){e={error:b};}finally{try{h&&!h.done&&(i=p.return)&&i.call(p);}finally{if(e)throw e.error}}return this.__cache.events=Array.from(n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter(function(i){return !(!i.target&&!i.actions.length&&i.internal)}).map(function(i){return i.eventType}));return Array.from(e)},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(e){var i=this;if(e!==void 0)return e.map(function(s){if(!Qe(s))return s;var r=s[0]===i.delimiter;if(r&&!i.parent)return i.getStateNodeByPath(s.slice(1));var a=r?i.key+s:s;if(i.parent)try{var n=i.parent.getStateNodeByPath(a);return n}catch(p){throw new Error("Invalid transition definition for state node '".concat(i.id,`': `).concat(p.message))}else return i.getStateNodeByPath(a)})},t.prototype.formatTransition=function(e){var i=this,s=If(e.target),r="internal"in e?e.internal:s?s.some(function(h){return Qe(h)&&h[0]===i.delimiter}):!0,a=this.machine.options.guards,n=this.resolveTarget(s),p=ae(ae({},e),{actions:Fr($s(e.actions)),cond:el(e.cond,a),target:n,source:this,internal:r,eventType:e.event,toJSON:function(){return ae(ae({},p),{target:p.target?p.target.map(function(h){return "#".concat(h.id)}):void 0,source:"#".concat(i.id)})}});return p},t.prototype.formatTransitions=function(){var e,i,s=this,r;if(!this.config.on)r=[];else if(Array.isArray(this.config.on))r=this.config.on;else {var a=this.config.on,n=So,p=a[n],h=p===void 0?[]:p,y=Fo(a,[typeof n=="symbol"?n:n+""]);r=bi(Object.keys(y).map(function(f){var g=ma(f,y[f]);return g}).concat(ma(So,h)));}var P=this.config.always?ma("",this.config.always):[],c=this.config.onDone?ma(String(Dn(this.id)),this.config.onDone):[],l=bi(this.invoke.map(function(f){var g=[];return f.onDone&&g.push.apply(g,ui([],qe(ma(String(Rn(f.id)),f.onDone)),!1)),f.onError&&g.push.apply(g,ui([],qe(ma(String(en(f.id)),f.onError)),!1)),g})),E=this.after,b=bi(ui(ui(ui(ui([],qe(c),!1),qe(l),!1),qe(r),!1),qe(P),!1).map(function(f){return $s(f).map(function(g){return s.formatTransition(g)})}));try{for(var v=ze(E),w=v.next();!w.done;w=v.next()){var u=w.value;b.push(u);}}catch(f){e={error:f};}finally{try{w&&!w.done&&(i=v.return)&&i.call(v);}finally{if(e)throw e.error}}return b},t}();va={click:"onClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",complete:"onComplete",after:"onAfter",enter:"onEnter",show:"onShow"};Object.values(va);fc=Object.keys(va),cc=class{activeStateId="";_service;_domListeners=new Map;_domElement;_playerListeners=new Map;_player;_machineSchemas=new Map;_onShowPrevValue=0;constructor(t,e){this._player=e,this._machineSchemas=this._transformToXStateSchema(t),this._domElement=e.container;}start(t){this.stop();let e=this._machineSchemas.get(t);if(typeof e>"u")throw Ie(`invalid state machine id ${t}`);this._service=pl(pc(e)),this._addEventListeners(),this._service.start();}stop(){var t;this._removeEventListeners(),(t=this._service)==null||t.stop(),this._player.stop();}_removeEventListeners(){var t;this._requiresDomElement();for(let[e,i]of this._domListeners)e==="visibilityChange"&&this._player.stopPlayOnShow(),(t=this._domElement)==null||t.removeEventListener(e,i),this._domListeners.delete(e);for(let[e,i]of this._playerListeners)this._player.removeEventListener(e,i),this._playerListeners.delete(e);}_addEventListeners(){this._requiresDomElement();let t=i=>{this._service.send({type:i});},e=i=>{function s(){t(i);}return s};this._service.subscribe(i=>{var s;if(typeof i.changed>"u"||i.changed){this._removeEventListeners();for(let r of i.nextEvents)if(fc.filter(a=>a!=="complete"&&a!=="show").includes(r)){let a=e(r);this._domListeners.set(r,a),(s=this._domElement)==null||s.addEventListener(r,a,{once:!0});}else if(r==="complete"){let a=e(r);this._player.addEventListener(r,a),this._playerListeners.set(r,a);}else if(r==="show"){let a=e(r);this._player.addIntersectionObserver({callbackOnIntersect:n=>{n>0&&(n!==100&&this._onShowPrevValue!==n&&a(),this._onShowPrevValue=n);},threshold:[]}),this._domListeners.set("visibilityChange",a);}}});}subscribe(t){throw Ie(t.toString())}_transformToXStateSchema(t){var e,i,s;let r=new Map;for(let a of t){let n={},p={};if(p.id=a.descriptor.id,typeof a.descriptor.initial<"u"&&(p.initial=a.descriptor.initial),typeof a<"u"){let h=a.states;for(let y in h)if(typeof h[y]<"u"&&h[y]){let P=h[y],c=P.playbackSettings,l=Object.keys(P).filter(v=>v.startsWith("on")),E={},b={};for(let v of l)if(typeof P[v]<"u"){let w=P[v];if(v===va.after){let u=w;b[u.ms]={target:(e=w==null?void 0:w.state)!=null?e:""};}else v===va.enter?E[En(va,v)]={target:(i=w==null?void 0:w.state)!=null?i:""}:E[En(va,v)]={target:(s=w==null?void 0:w.state)!=null?s:""};}n[y]={entry:()=>{!this._player.getAnimationInstance()||P.animationId&&P.animationId!==this._player.currentAnimationId?this._player.play(P.animationId,()=>({...cs,...c})).then(()=>{this._updatePlaybackSettings(c);}).catch(v=>{er(`State machine error: ${v.message}`);}):this._updatePlaybackSettings(c);},exit:()=>{typeof c.segments<"u"&&this._player.resetSegments(!1),typeof c.playOnScroll<"u"&&this._player.stopPlayOnScroll();},on:E,after:b,meta:c};}}p.states=n,r.set(p.id,p);}return r}_handlePlaySegments(t){if(typeof t.segments=="string")this._player.goToAndPlay(t.segments,!0);else {let[e,i]=t.segments,s=e;e!==0&&e===i&&(s=e-1),e===0&&e===i?this._player.goToAndPlay(e,!0):this._player.playSegments([s,i],!0);}}_handlePlayOnScroll(t){let e=t.playOnScroll;if(t.segments&&typeof t.segments!="string"){let i=t.segments;this._player.playOnScroll({threshold:e,segments:i});}else this._player.playOnScroll({threshold:e});}_updatePlaybackSettings(t){if(!this._player.getAnimationInstance())throw new Error("Unable to update playbackSettings. Animations is not rendered yet.");typeof t.autoplay<"u"&&(this._player.setAutoplay(t.autoplay),t.autoplay?this._player.play():this._player.pause()),typeof t.direction<"u"&&this._player.setDirection(t.direction),typeof t.intermission<"u"&&this._player.setIntermission(t.intermission),typeof t.loop<"u"&&this._player.setLoop(t.loop),typeof t.playMode<"u"&&this._player.setMode(t.playMode),typeof t.speed<"u"&&this._player.setSpeed(t.speed),typeof t.defaultTheme<"u"&&this._player.setDefaultTheme(t.defaultTheme),typeof t.playOnScroll<"u"&&this._handlePlayOnScroll(t),t.segments&&this._handlePlaySegments(t),t.autoplay||this._player.pause();}_requiresDomElement(){if(!this._domElement)throw Ie("Requires a DOM element to attach events.")}};});async function ul(t,e){let[{DotLottieStateMachineManager:i}]=await Promise.all([Promise.resolve().then(()=>(cl(),fl))]);if(!t.length)throw Ie("No state machines available inside this .lottie!");return new i(t,e)}var qn=ls(()=>{ca();});var ml={};fr(ml,{DotLottieAudio:()=>dc});var uc,mc,dc,dl=ls(()=>{qs();uc=is(t=>{((function(){var e=function(){this.init();};e.prototype={init:function(){var c=this||i;return c._counter=1e3,c._html5AudioPool=[],c.html5PoolSize=10,c._codecs={},c._howls=[],c._muted=!1,c._volume=1,c._canPlayEvent="canplaythrough",c._navigator=typeof window<"u"&&window.navigator?window.navigator:null,c.masterGain=null,c.noAudio=!1,c.usingWebAudio=!0,c.autoSuspend=!0,c.ctx=null,c.autoUnlock=!0,c._setup(),c},volume:function(c){var l=this||i;if(c=parseFloat(c),l.ctx||P(),typeof c<"u"&&c>=0&&c<=1){if(l._volume=c,l._muted)return l;l.usingWebAudio&&l.masterGain.gain.setValueAtTime(c,i.ctx.currentTime);for(var E=0;E=0;l--)c._howls[l].unload();return c.usingWebAudio&&c.ctx&&typeof c.ctx.close<"u"&&(c.ctx.close(),c.ctx=null,P()),c},codecs:function(c){return (this||i)._codecs[c.replace(/^x-/,"")]},_setup:function(){var c=this||i;if(c.state=c.ctx&&c.ctx.state||"suspended",c._autoSuspend(),!c.usingWebAudio)if(typeof Audio<"u")try{var l=new Audio;typeof l.oncanplaythrough>"u"&&(c._canPlayEvent="canplay");}catch{c.noAudio=!0;}else c.noAudio=!0;try{var l=new Audio;l.muted&&(c.noAudio=!0);}catch{}return c.noAudio||c._setupCodecs(),c},_setupCodecs:function(){var c=this||i,l=null;try{l=typeof Audio<"u"?new Audio:null;}catch{return c}if(!l||typeof l.canPlayType!="function")return c;var E=l.canPlayType("audio/mpeg;").replace(/^no$/,""),b=c._navigator?c._navigator.userAgent:"",v=b.match(/OPR\/([0-6].)/g),w=v&&parseInt(v[0].split("/")[1],10)<33,u=b.indexOf("Safari")!==-1&&b.indexOf("Chrome")===-1,f=b.match(/Version\/(.*?) /),g=u&&f&&parseInt(f[1],10)<15;return c._codecs={mp3:!!(!w&&(E||l.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!E,opus:!!l.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!l.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!l.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(l.canPlayType('audio/wav; codecs="1"')||l.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!l.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!l.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(l.canPlayType("audio/x-m4a;")||l.canPlayType("audio/m4a;")||l.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(l.canPlayType("audio/x-m4b;")||l.canPlayType("audio/m4b;")||l.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(l.canPlayType("audio/x-mp4;")||l.canPlayType("audio/mp4;")||l.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!g&&l.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!g&&l.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!l.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(l.canPlayType("audio/x-flac;")||l.canPlayType("audio/flac;")).replace(/^no$/,"")},c},_unlockAudio:function(){var c=this||i;if(!(c._audioUnlocked||!c.ctx)){c._audioUnlocked=!1,c.autoUnlock=!1,!c._mobileUnloaded&&c.ctx.sampleRate!==44100&&(c._mobileUnloaded=!0,c.unload()),c._scratchBuffer=c.ctx.createBuffer(1,1,22050);var l=function(E){for(;c._html5AudioPool.length"u"?g.noteOn(0):g.start(0),typeof c.ctx.resume=="function"&&c.ctx.resume(),g.onended=function(){g.disconnect(0),c._audioUnlocked=!0,document.removeEventListener("touchstart",l,!0),document.removeEventListener("touchend",l,!0),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",l,!0);for(var _=0;_"u"||!i.usingWebAudio)){for(var l=0;l"u"||!i.usingWebAudio))return c.state==="running"&&c.ctx.state!=="interrupted"&&c._suspendTimer?(clearTimeout(c._suspendTimer),c._suspendTimer=null):c.state==="suspended"||c.state==="running"&&c.ctx.state==="interrupted"?(c.ctx.resume().then(function(){c.state="running";for(var l=0;l"u"&&(c="__default",!E._playLock)){for(var v=0,w=0;w0?u._seek:E._sprite[c][0]/1e3),_=Math.max(0,(E._sprite[c][0]+E._sprite[c][1])/1e3-g),k=_*1e3/Math.abs(u._rate),z=E._sprite[c][0]/1e3,q=(E._sprite[c][0]+E._sprite[c][1])/1e3;u._sprite=c,u._ended=!1;var W=function(){u._paused=!1,u._seek=g,u._start=z,u._stop=q,u._loop=!!(u._loop||E._sprite[c][2]);};if(g>=q){E._ended(u);return}var ot=u._node;if(E._webAudio){var mt=function(){E._playLock=!1,W(),E._refreshBuffer(u);var ht=u._muted||E._muted?0:u._volume;ot.gain.setValueAtTime(ht,i.ctx.currentTime),u._playStart=i.ctx.currentTime,typeof ot.bufferSource.start>"u"?u._loop?ot.bufferSource.noteGrainOn(0,g,86400):ot.bufferSource.noteGrainOn(0,g,_):u._loop?ot.bufferSource.start(0,g,86400):ot.bufferSource.start(0,g,_),k!==1/0&&(E._endTimers[u._id]=setTimeout(E._ended.bind(E,u),k)),l||setTimeout(function(){E._emit("play",u._id),E._loadQueue();},0);};i.state==="running"&&i.ctx.state!=="interrupted"?mt():(E._playLock=!0,E.once("resume",mt),E._clearTimer(u._id));}else {var gt=function(){ot.currentTime=g,ot.muted=u._muted||E._muted||i._muted||ot.muted,ot.volume=u._volume*i.volume(),ot.playbackRate=u._rate;try{var ht=ot.play();if(ht&&typeof Promise<"u"&&(ht instanceof Promise||typeof ht.then=="function")?(E._playLock=!0,W(),ht.then(function(){E._playLock=!1,ot._unlocked=!0,l?E._loadQueue():E._emit("play",u._id);}).catch(function(){E._playLock=!1,E._emit("playerror",u._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),u._ended=!0,u._paused=!0;})):l||(E._playLock=!1,W(),E._emit("play",u._id)),ot.playbackRate=u._rate,ot.paused){E._emit("playerror",u._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}c!=="__default"||u._loop?E._endTimers[u._id]=setTimeout(E._ended.bind(E,u),k):(E._endTimers[u._id]=function(){E._ended(u),ot.removeEventListener("ended",E._endTimers[u._id],!1);},ot.addEventListener("ended",E._endTimers[u._id],!1));}catch(yt){E._emit("playerror",u._id,yt);}};ot.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(ot.src=E._src,ot.load());var ut=window&&window.ejecta||!ot.readyState&&i._navigator.isCocoonJS;if(ot.readyState>=3||ut)gt();else {E._playLock=!0,E._state="loading";var Ct=function(){E._state="loaded",gt(),ot.removeEventListener(i._canPlayEvent,Ct,!1);};ot.addEventListener(i._canPlayEvent,Ct,!1),E._clearTimer(u._id);}}return u._id},pause:function(c){var l=this;if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"pause",action:function(){l.pause(c);}}),l;for(var E=l._getSoundIds(c),b=0;b"u"?v._node.bufferSource.noteOff(0):v._node.bufferSource.stop(0),l._cleanBuffer(v._node);}else (!isNaN(v._node.duration)||v._node.duration===1/0)&&v._node.pause();arguments[1]||l._emit("pause",v?v._id:null);}return l},stop:function(c,l){var E=this;if(E._state!=="loaded"||E._playLock)return E._queue.push({event:"stop",action:function(){E.stop(c);}}),E;for(var b=E._getSoundIds(c),v=0;v"u"?w._node.bufferSource.noteOff(0):w._node.bufferSource.stop(0),E._cleanBuffer(w._node)):(!isNaN(w._node.duration)||w._node.duration===1/0)&&(w._node.currentTime=w._start||0,w._node.pause(),w._node.duration===1/0&&E._clearSound(w._node))),l||E._emit("stop",w._id));}return E},mute:function(c,l){var E=this;if(E._state!=="loaded"||E._playLock)return E._queue.push({event:"mute",action:function(){E.mute(c,l);}}),E;if(typeof l>"u")if(typeof c=="boolean")E._muted=c;else return E._muted;for(var b=E._getSoundIds(l),v=0;v"u"){var v=c._getSoundIds(),w=v.indexOf(l[0]);w>=0?b=parseInt(l[0],10):E=parseFloat(l[0]);}else l.length>=2&&(E=parseFloat(l[0]),b=parseInt(l[1],10));var u;if(typeof E<"u"&&E>=0&&E<=1){if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"volume",action:function(){c.volume.apply(c,l);}}),c;typeof b>"u"&&(c._volume=E),b=c._getSoundIds(b);for(var f=0;f"u");}}return v},_startFadeInterval:function(c,l,E,b,v,w){var u=this,f=l,g=E-l,_=Math.abs(g/.01),k=Math.max(4,_>0?b/_:b),z=Date.now();c._fadeTo=E,c._interval=setInterval(function(){var q=(Date.now()-z)/b;z=Date.now(),f+=g*q,f=Math.round(f*100)/100,g<0?f=Math.max(E,f):f=Math.min(E,f),u._webAudio?c._volume=f:u.volume(f,c._id,!0),w&&(u._volume=f),(El&&f>=E)&&(clearInterval(c._interval),c._interval=null,c._fadeTo=null,u.volume(E,c._id),u._emit("fade",c._id));},k);},_stopFade:function(c){var l=this,E=l._soundById(c);return E&&E._interval&&(l._webAudio&&E._node.gain.cancelScheduledValues(i.ctx.currentTime),clearInterval(E._interval),E._interval=null,l.volume(E._fadeTo,c),E._fadeTo=null,l._emit("fade",c)),l},loop:function(){var c=this,l=arguments,E,b,v;if(l.length===0)return c._loop;if(l.length===1)if(typeof l[0]=="boolean")E=l[0],c._loop=E;else return v=c._soundById(parseInt(l[0],10)),v?v._loop:!1;else l.length===2&&(E=l[0],b=parseInt(l[1],10));for(var w=c._getSoundIds(b),u=0;u=0?b=parseInt(l[0],10):E=parseFloat(l[0]);}else l.length===2&&(E=parseFloat(l[0]),b=parseInt(l[1],10));var u;if(typeof E=="number"){if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"rate",action:function(){c.rate.apply(c,l);}}),c;typeof b>"u"&&(c._rate=E),b=c._getSoundIds(b);for(var f=0;f=0?b=parseInt(l[0],10):c._sounds.length&&(b=c._sounds[0]._id,E=parseFloat(l[0]));}else l.length===2&&(E=parseFloat(l[0]),b=parseInt(l[1],10));if(typeof b>"u")return 0;if(typeof E=="number"&&(c._state!=="loaded"||c._playLock))return c._queue.push({event:"seek",action:function(){c.seek.apply(c,l);}}),c;var u=c._soundById(b);if(u)if(typeof E=="number"&&E>=0){var f=c.playing(b);f&&c.pause(b,!0),u._seek=E,u._ended=!1,c._clearTimer(b),!c._webAudio&&u._node&&!isNaN(u._node.duration)&&(u._node.currentTime=E);var g=function(){f&&c.play(b,!0),c._emit("seek",b);};if(f&&!c._webAudio){var _=function(){c._playLock?setTimeout(_,0):g();};setTimeout(_,0);}else g();}else if(c._webAudio){var k=c.playing(b)?i.ctx.currentTime-u._playStart:0,z=u._rateSeek?u._rateSeek-u._seek:0;return u._seek+(z+k*Math.abs(u._rate))}else return u._node.currentTime;return c},playing:function(c){var l=this;if(typeof c=="number"){var E=l._soundById(c);return E?!E._paused:!1}for(var b=0;b=0&&i._howls.splice(b,1);var v=!0;for(E=0;E=0){v=!1;break}return a&&v&&delete a[c._src],i.noAudio=!1,c._state="unloaded",c._sounds=[],c=null,null},on:function(c,l,E,b){var v=this,w=v["_on"+c];return typeof l=="function"&&w.push(b?{id:E,fn:l,once:b}:{id:E,fn:l}),v},off:function(c,l,E){var b=this,v=b["_on"+c],w=0;if(typeof l=="number"&&(E=l,l=null),l||E)for(w=0;w=0;w--)(!v[w].id||v[w].id===l||c==="load")&&(setTimeout(function(u){u.call(this,l,E);}.bind(b,v[w].fn),0),v[w].once&&b.off(c,v[w].fn,v[w].id));return b._loadQueue(c),b},_loadQueue:function(c){var l=this;if(l._queue.length>0){var E=l._queue[0];E.event===c&&(l._queue.shift(),l._loadQueue()),c||E.action();}return l},_ended:function(c){var l=this,E=c._sprite;if(!l._webAudio&&c._node&&!c._node.paused&&!c._node.ended&&c._node.currentTime=0;b--){if(E<=l)return;c._sounds[b]._ended&&(c._webAudio&&c._sounds[b]._node&&c._sounds[b]._node.disconnect(0),c._sounds.splice(b,1),E--);}}},_getSoundIds:function(c){var l=this;if(typeof c>"u"){for(var E=[],b=0;b=0;if(i._scratchBuffer&&c.bufferSource&&(c.bufferSource.onended=null,c.bufferSource.disconnect(0),E))try{c.bufferSource.buffer=i._scratchBuffer;}catch{}return c.bufferSource=null,l},_clearSound:function(c){var l=/MSIE |Trident\//.test(i._navigator&&i._navigator.userAgent);l||(c.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA");}};var r=function(c){this._parent=c,this.init();};r.prototype={init:function(){var c=this,l=c._parent;return c._muted=l._muted,c._loop=l._loop,c._volume=l._volume,c._rate=l._rate,c._seek=0,c._paused=!0,c._ended=!0,c._sprite="__default",c._id=++i._counter,l._sounds.push(c),c.create(),c},create:function(){var c=this,l=c._parent,E=i._muted||c._muted||c._parent._muted?0:c._volume;return l._webAudio?(c._node=typeof i.ctx.createGain>"u"?i.ctx.createGainNode():i.ctx.createGain(),c._node.gain.setValueAtTime(E,i.ctx.currentTime),c._node.paused=!0,c._node.connect(i.masterGain)):i.noAudio||(c._node=i._obtainHtml5Audio(),c._errorFn=c._errorListener.bind(c),c._node.addEventListener("error",c._errorFn,!1),c._loadFn=c._loadListener.bind(c),c._node.addEventListener(i._canPlayEvent,c._loadFn,!1),c._endFn=c._endListener.bind(c),c._node.addEventListener("ended",c._endFn,!1),c._node.src=l._src,c._node.preload=l._preload===!0?"auto":l._preload,c._node.volume=E*i.volume(),c._node.load()),c},reset:function(){var c=this,l=c._parent;return c._muted=l._muted,c._loop=l._loop,c._volume=l._volume,c._rate=l._rate,c._seek=0,c._rateSeek=0,c._paused=!0,c._ended=!0,c._sprite="__default",c._id=++i._counter,c},_errorListener:function(){var c=this;c._parent._emit("loaderror",c._id,c._node.error?c._node.error.code:0),c._node.removeEventListener("error",c._errorFn,!1);},_loadListener:function(){var c=this,l=c._parent;l._duration=Math.ceil(c._node.duration*10)/10,Object.keys(l._sprite).length===0&&(l._sprite={__default:[0,l._duration*1e3]}),l._state!=="loaded"&&(l._state="loaded",l._emit("load"),l._loadQueue()),c._node.removeEventListener(i._canPlayEvent,c._loadFn,!1);},_endListener:function(){var c=this,l=c._parent;l._duration===1/0&&(l._duration=Math.ceil(c._node.duration*10)/10,l._sprite.__default[1]===1/0&&(l._sprite.__default[1]=l._duration*1e3),l._ended(c)),c._node.removeEventListener("ended",c._endFn,!1);}};var a={},n=function(c){var l=c._src;if(a[l]){c._duration=a[l].duration,y(c);return}if(/^data:[^;]+;base64,/.test(l)){for(var E=atob(l.split(",")[1]),b=new Uint8Array(E.length),v=0;v0?(a[l._src]=v,y(l,v)):E();};typeof Promise<"u"&&i.ctx.decodeAudioData.length===1?i.ctx.decodeAudioData(c).then(b).catch(E):i.ctx.decodeAudioData(c,b,E);},y=function(c,l){l&&!c._duration&&(c._duration=l.duration),Object.keys(c._sprite).length===0&&(c._sprite={__default:[0,c._duration*1e3]}),c._state!=="loaded"&&(c._state="loaded",c._emit("load"),c._loadQueue());},P=function(){if(i.usingWebAudio){try{typeof AudioContext<"u"?i.ctx=new AudioContext:typeof webkitAudioContext<"u"?i.ctx=new webkitAudioContext:i.usingWebAudio=!1;}catch{i.usingWebAudio=!1;}i.ctx||(i.usingWebAudio=!1);var c=/iP(hone|od|ad)/.test(i._navigator&&i._navigator.platform),l=i._navigator&&i._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),E=l?parseInt(l[1],10):null;if(c&&E&&E<9){var b=/safari/.test(i._navigator&&i._navigator.userAgent.toLowerCase());i._navigator&&!b&&(i.usingWebAudio=!1);}i.usingWebAudio&&(i.masterGain=typeof i.ctx.createGain>"u"?i.ctx.createGainNode():i.ctx.createGain(),i.masterGain.gain.setValueAtTime(i._muted?0:i._volume,i.ctx.currentTime),i.masterGain.connect(i.ctx.destination)),i._setup();}};typeof define=="function"&&define.amd&&define([],function(){return {Howler:i,Howl:s}}),typeof t<"u"&&(t.Howler=i,t.Howl=s),typeof global<"u"?(global.HowlerGlobal=e,global.Howler=i,global.Howl=s,global.Sound=r):typeof window<"u"&&(window.HowlerGlobal=e,window.Howler=i,window.Howl=s,window.Sound=r);}))(),function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(i){var s=this;if(!s.ctx||!s.ctx.listener)return s;for(var r=s._howls.length-1;r>=0;r--)s._howls[r].stereo(i);return s},HowlerGlobal.prototype.pos=function(i,s,r){var a=this;if(!a.ctx||!a.ctx.listener)return a;if(s=typeof s!="number"?a._pos[1]:s,r=typeof r!="number"?a._pos[2]:r,typeof i=="number")a._pos=[i,s,r],typeof a.ctx.listener.positionX<"u"?(a.ctx.listener.positionX.setTargetAtTime(a._pos[0],Howler.ctx.currentTime,.1),a.ctx.listener.positionY.setTargetAtTime(a._pos[1],Howler.ctx.currentTime,.1),a.ctx.listener.positionZ.setTargetAtTime(a._pos[2],Howler.ctx.currentTime,.1)):a.ctx.listener.setPosition(a._pos[0],a._pos[1],a._pos[2]);else return a._pos;return a},HowlerGlobal.prototype.orientation=function(i,s,r,a,n,p){var h=this;if(!h.ctx||!h.ctx.listener)return h;var y=h._orientation;if(s=typeof s!="number"?y[1]:s,r=typeof r!="number"?y[2]:r,a=typeof a!="number"?y[3]:a,n=typeof n!="number"?y[4]:n,p=typeof p!="number"?y[5]:p,typeof i=="number")h._orientation=[i,s,r,a,n,p],typeof h.ctx.listener.forwardX<"u"?(h.ctx.listener.forwardX.setTargetAtTime(i,Howler.ctx.currentTime,.1),h.ctx.listener.forwardY.setTargetAtTime(s,Howler.ctx.currentTime,.1),h.ctx.listener.forwardZ.setTargetAtTime(r,Howler.ctx.currentTime,.1),h.ctx.listener.upX.setTargetAtTime(a,Howler.ctx.currentTime,.1),h.ctx.listener.upY.setTargetAtTime(n,Howler.ctx.currentTime,.1),h.ctx.listener.upZ.setTargetAtTime(p,Howler.ctx.currentTime,.1)):h.ctx.listener.setOrientation(i,s,r,a,n,p);else return y;return h},Howl.prototype.init=function(i){return function(s){var r=this;return r._orientation=s.orientation||[1,0,0],r._stereo=s.stereo||null,r._pos=s.pos||null,r._pannerAttr={coneInnerAngle:typeof s.coneInnerAngle<"u"?s.coneInnerAngle:360,coneOuterAngle:typeof s.coneOuterAngle<"u"?s.coneOuterAngle:360,coneOuterGain:typeof s.coneOuterGain<"u"?s.coneOuterGain:0,distanceModel:typeof s.distanceModel<"u"?s.distanceModel:"inverse",maxDistance:typeof s.maxDistance<"u"?s.maxDistance:1e4,panningModel:typeof s.panningModel<"u"?s.panningModel:"HRTF",refDistance:typeof s.refDistance<"u"?s.refDistance:1,rolloffFactor:typeof s.rolloffFactor<"u"?s.rolloffFactor:1},r._onstereo=s.onstereo?[{fn:s.onstereo}]:[],r._onpos=s.onpos?[{fn:s.onpos}]:[],r._onorientation=s.onorientation?[{fn:s.onorientation}]:[],i.call(this,s)}}(Howl.prototype.init),Howl.prototype.stereo=function(i,s){var r=this;if(!r._webAudio)return r;if(r._state!=="loaded")return r._queue.push({event:"stereo",action:function(){r.stereo(i,s);}}),r;var a=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof s>"u")if(typeof i=="number")r._stereo=i,r._pos=[i,0,0];else return r._stereo;for(var n=r._getSoundIds(s),p=0;p"u")if(typeof i=="number")n._pos=[i,s,r];else return n._pos;for(var p=n._getSoundIds(a),h=0;h"u")if(typeof i=="number")n._orientation=[i,s,r];else return n._orientation;for(var p=n._getSoundIds(a),h=0;h"u"&&(r.pannerAttr||(r.pannerAttr={coneInnerAngle:r.coneInnerAngle,coneOuterAngle:r.coneOuterAngle,coneOuterGain:r.coneOuterGain,distanceModel:r.distanceModel,maxDistance:r.maxDistance,refDistance:r.refDistance,rolloffFactor:r.rolloffFactor,panningModel:r.panningModel}),i._pannerAttr={coneInnerAngle:typeof r.pannerAttr.coneInnerAngle<"u"?r.pannerAttr.coneInnerAngle:i._coneInnerAngle,coneOuterAngle:typeof r.pannerAttr.coneOuterAngle<"u"?r.pannerAttr.coneOuterAngle:i._coneOuterAngle,coneOuterGain:typeof r.pannerAttr.coneOuterGain<"u"?r.pannerAttr.coneOuterGain:i._coneOuterGain,distanceModel:typeof r.pannerAttr.distanceModel<"u"?r.pannerAttr.distanceModel:i._distanceModel,maxDistance:typeof r.pannerAttr.maxDistance<"u"?r.pannerAttr.maxDistance:i._maxDistance,refDistance:typeof r.pannerAttr.refDistance<"u"?r.pannerAttr.refDistance:i._refDistance,rolloffFactor:typeof r.pannerAttr.rolloffFactor<"u"?r.pannerAttr.rolloffFactor:i._rolloffFactor,panningModel:typeof r.pannerAttr.panningModel<"u"?r.pannerAttr.panningModel:i._panningModel});else return n=i._soundById(parseInt(s[0],10)),n?n._pannerAttr:i._pannerAttr;else s.length===2&&(r=s[0],a=parseInt(s[1],10));for(var p=i._getSoundIds(a),h=0;hyc});var gc,yc,yl=ls(()=>{qs();gc=is((exports,module)=>{typeof navigator<"u"&&function(t,e){typeof define=="function"&&define.amd?define(function(){return e(t)}):typeof module=="object"&&module.exports?module.exports=e(t):(t.lottie=e(t),t.bodymovin=t.lottie);}(self||{},function(window){function workerContent(){function extendPrototype(t,e){var i,s=t.length,r;for(i=0;i1?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}var rgbToHex=function(){var t=[],e,i;for(e=0;e<256;e+=1)i=e.toString(16),t[e]=i.length===1?"0"+i:i;return function(s,r,a){return s<0&&(s=0),r<0&&(r=0),a<0&&(a=0),"#"+t[s]+t[r]+t[a]}}(),setSubframeEnabled=function(t){subframeEnabled=!!t;},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(t){expressionsPlugin=t;},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(t){expressionsInterfaces=t;},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(t){defaultCurveSegments=t;},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(t){idPrefix$1=t;};function createNS(t){return document.createElementNS(svgNS,t)}function _typeof$5(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(e){return typeof e}:_typeof$5=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(t)}var dataManager=function(){var t=1,e=[],i,s,r={onmessage:function(){},postMessage:function(l){i({data:l});}},a={postMessage:function(l){r.onmessage({data:l});}};function n(l){if(window.Worker&&window.Blob&&getWebWorker()){var E=new Blob(["var _workerSelf = self; self.onmessage = ",l.toString()],{type:"text/javascript"}),b=URL.createObjectURL(E);return new Worker(b)}return i=l,r}function p(){s||(s=n(function(l){function E(){function v(ht,yt){var D,V,S=ht.length,R,tt,J,Gt;for(V=0;V=0;yt-=1)if(ht[yt].ty==="sh")if(ht[yt].ks.k.i)_(ht[yt].ks.k);else for(S=ht[yt].ks.k.length,V=0;VD[0]?!0:D[0]>ht[0]?!1:ht[1]>D[1]?!0:D[1]>ht[1]?!1:ht[2]>D[2]?!0:D[2]>ht[2]?!1:null}var z=function(){var ht=[4,4,14];function yt(V){var S=V.t.d;V.t.d={k:[{s:S,t:0}]};}function D(V){var S,R=V.length;for(S=0;S=0;S-=1)if(V[S].ty==="sh")if(V[S].ks.k.i)V[S].ks.k.c=V[S].closed;else for(J=V[S].ks.k.length,tt=0;tt500)&&(this._imageLoaded(),clearInterval(g)),f+=1;}.bind(this),50);}function a(u){var f=s(u,this.assetsPath,this.path),g=createNS("image");isSafari?this.testImageLoaded(g):g.addEventListener("load",this._imageLoaded,!1),g.addEventListener("error",function(){_.img=t,this._imageLoaded();}.bind(this),!1),g.setAttributeNS("http://www.w3.org/1999/xlink","href",f),this._elementHelper.append?this._elementHelper.append(g):this._elementHelper.appendChild(g);var _={img:g,assetData:u};return _}function n(u){var f=s(u,this.assetsPath,this.path),g=createTag("img");g.crossOrigin="anonymous",g.addEventListener("load",this._imageLoaded,!1),g.addEventListener("error",function(){_.img=t,this._imageLoaded();}.bind(this),!1),g.src=f;var _={img:g,assetData:u};return _}function p(u){var f={assetData:u},g=s(u,this.assetsPath,this.path);return dataManager.loadData(g,function(_){f.img=_,this._footageLoaded();}.bind(this),function(){f.img={},this._footageLoaded();}.bind(this)),f}function h(u,f){this.imagesLoadedCb=f;var g,_=u.length;for(g=0;g<_;g+=1)u[g].layers||(!u[g].t||u[g].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(u[g]))):u[g].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(u[g]))));}function y(u){this.path=u||"";}function P(u){this.assetsPath=u||"";}function c(u){for(var f=0,g=this.images.length;fthis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e=this.animationData.layers,i,s=e.length,r=t.layers,a,n=r.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(t){this.triggerRenderFrameError(t);}},AnimationItem.prototype.play=function(t){t&&this.name!==t||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},AnimationItem.prototype.pause=function(t){t&&this.name!==t||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(this.isPaused===!0?this.play():this.pause());},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(i=!0,e=0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"));}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart");},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,i!==-1&&this.goToAndStop(i,!0);},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),_typeof$4(t[0])==="object"){var i,s=t.length;for(i=0;i=0;V-=1)e[V].animation.destroy(D);}function W(D,V,S){var R=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),tt,J=R.length;for(tt=0;tt0?_=W:g=W;while(Math.abs(q)>a&&++ot=r?w(f,mt,g,_):gt===0?mt:v(f,z,z+h,g,_)}},t}(),pooling=function(){function t(e){return e.concat(createSizedArray(e.length))}return {double:t}}(),poolFactory=function(){return function(t,e,i){var s=0,r=t,a=createSizedArray(r),n={newElement:p,release:h};function p(){var y;return s?(s-=1,y=a[s]):y=e(),y}function h(y){s===r&&(a=pooling.double(a),r*=2),i&&i(y),a[s]=y,s+=1;}return n}}(),bezierLengthPool=function(){function t(){return {addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,t)}(),segmentsLengthPool=function(){function t(){return {lengths:[],totalLength:0}}function e(i){var s,r=i.lengths.length;for(s=0;s-.001&&f<.001}function i(l,E,b,v,w,u,f,g,_){if(b===0&&u===0&&_===0)return e(l,E,v,w,f,g);var k=t.sqrt(t.pow(v-l,2)+t.pow(w-E,2)+t.pow(u-b,2)),z=t.sqrt(t.pow(f-l,2)+t.pow(g-E,2)+t.pow(_-b,2)),q=t.sqrt(t.pow(f-v,2)+t.pow(g-w,2)+t.pow(_-u,2)),W;return k>z?k>q?W=k-z-q:W=q-z-k:q>z?W=q-z-k:W=z-k-q,W>-1e-4&&W<1e-4}var s=function(){return function(l,E,b,v){var w=getDefaultCurveSegments(),u,f,g,_,k,z=0,q,W=[],ot=[],mt=bezierLengthPool.newElement();for(g=b.length,u=0;uf?-1:1,k=!0;k;)if(v[u]<=f&&v[u+1]>f?(g=(f-v[u])/(v[u+1]-v[u]),k=!1):u+=_,u<0||u>=w-1){if(u===w-1)return b[u];k=!1;}return b[u]+(b[u+1]-b[u])*g}function y(l,E,b,v,w,u){var f=h(w,u),g=1-f,_=t.round((g*g*g*l[0]+(f*g*g+g*f*g+g*g*f)*b[0]+(f*f*g+g*f*f+f*g*f)*v[0]+f*f*f*E[0])*1e3)/1e3,k=t.round((g*g*g*l[1]+(f*g*g+g*f*g+g*g*f)*b[1]+(f*f*g+g*f*f+f*g*f)*v[1]+f*f*f*E[1])*1e3)/1e3;return [_,k]}var P=createTypedArray("float32",8);function c(l,E,b,v,w,u,f){w<0?w=0:w>1&&(w=1);var g=h(w,f);u=u>1?1:u;var _=h(u,f),k,z=l.length,q=1-g,W=1-_,ot=q*q*q,mt=g*q*q*3,gt=g*g*q*3,ut=g*g*g,Ct=q*q*W,ht=g*q*W+q*g*W+q*q*_,yt=g*g*W+q*g*_+g*q*_,D=g*g*_,V=q*W*W,S=g*W*W+q*_*W+q*W*_,R=g*_*W+q*_*_+g*W*_,tt=g*_*_,J=W*W*W,Gt=_*W*W+W*_*W+W*W*_,Vt=_*_*W+W*_*_+_*W*_,Xt=_*_*_;for(k=0;k=y.t-i){h.h&&(h=y),r=0;break}if(y.t-i>t){r=a;break}a=u||t=u?_.points.length-1:0;for(l=_.points[k].point.length,c=0;c=W&&z=u)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=f)s[0]=h.s[0],s[1]=h.s[1],s[2]=h.s[2];else {var ht=createQuaternion(h.s),yt=createQuaternion(g),D=(t-f)/(u-f);quaternionToEuler(s,slerp(ht,yt,D));}else for(a=0;a=u?E=1:t1e-6?(l=Math.acos(E),b=Math.sin(l),v=Math.sin((1-i)*l)/b,w=Math.sin(i*l)/b):(v=1-i,w=i),s[0]=v*r+w*h,s[1]=v*a+w*y,s[2]=v*n+w*P,s[3]=v*p+w*c,s}function quaternionToEuler(t,e){var i=e[0],s=e[1],r=e[2],a=e[3],n=Math.atan2(2*s*a-2*i*r,1-2*s*s-2*r*r),p=Math.asin(2*i*s+2*r*a),h=Math.atan2(2*i*a-2*s*r,1-2*i*i-2*r*r);t[0]=n/degToRads,t[1]=p/degToRads,t[2]=h/degToRads;}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,s=t[2]*degToRads,r=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(s/2),p=Math.sin(e/2),h=Math.sin(i/2),y=Math.sin(s/2),P=r*a*n-p*h*y,c=p*h*n+r*a*y,l=p*a*n+r*h*y,E=r*h*n-p*a*y;return [c,l,E,P]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s;}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if(this.propType==="unidimensional")e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i1e-5&&(this.v[i]=e,this._mdf=!0),i+=1;}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[];break}(!a[s]||a[s]&&!r)&&(a[s]=pointPool.newElement()),a[s][0]=t,a[s][1]=e;},ShapePath.prototype.setTripleAt=function(t,e,i,s,r,a,n,p){this.setXYAt(t,e,"v",n,p),this.setXYAt(i,s,"o",n,p),this.setXYAt(r,a,"i",n,p);},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,r=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),r=1);var a=this._length-1,n=this._length,p;for(p=r;p=ht[ht.length-1].t-this.offsetTime)k=ht[ht.length-1].s?ht[ht.length-1].s[0]:ht[ht.length-2].e[0],q=!0;else {for(var yt=_,D=ht.length-1,V=!0,S,R,tt;V&&(S=ht[yt],R=ht[yt+1],!(R.t-this.offsetTime>u));)yt=R.t-this.offsetTime)ut=1;else if(ug&&u>g)||(this._caching.lastIndex=_0||S>-1e-6&&S<0?s(S*R)/R:S}function V(){var S=this.props,R=D(S[0]),tt=D(S[1]),J=D(S[4]),Gt=D(S[5]),Vt=D(S[12]),Xt=D(S[13]);return "matrix("+R+","+tt+","+J+","+Gt+","+Vt+","+Xt+")"}return function(){this.reset=r,this.rotate=a,this.rotateX=n,this.rotateY=p,this.rotateZ=h,this.skew=P,this.skewFromAxis=c,this.shear=y,this.scale=l,this.setTransform=E,this.translate=b,this.transform=v,this.multiply=w,this.applyToPoint=k,this.applyToX=z,this.applyToY=q,this.applyToZ=W,this.applyToPointArray=Ct,this.applyToTriplePoints=ut,this.applyToPointStringified=ht,this.toCSS=yt,this.to2dCSS=V,this.clone=g,this.cloneFromProps=_,this.equals=f,this.inversePoints=gt,this.inversePoint=mt,this.getInverseMatrix=ot,this._t=this.transform,this.isIdentity=u,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset();}}();function _typeof$3(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(e){return typeof e}:_typeof$3=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(t)}var lottie={};function setLocation(t){setLocationHref(t);}function searchAnimations(){animationManager.searchAnimations();}function setSubframeRendering(t){setSubframeEnabled(t);}function setPrefix(t){setIdPrefix(t);}function loadAnimation(t){return animationManager.loadAnimation(t)}function setQuality(t){if(typeof t=="string")switch(t){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else !isNaN(t)&&t>1&&setDefaultCurveSegments(t);}function inBrowser(){return typeof navigator<"u"}function installPlugin(t,e){t==="expressions"&&setExpressionsPlugin(e);}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations());}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i"u"?"undefined":_typeof$3(exports))==="object"&&typeof module<"u")&&!(typeof define=="function"&&define.amd)&&(window.bodymovin=lottie);}catch(t){}var ShapeModifiers=function(){var t={},e={};t.registerModifier=i,t.getModifier=s;function i(r,a){e[r]||(e[r]=a);}function s(r,a,n){return new e[r](a,n)}return t}();function ShapeModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated();}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0);},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties());},extendPrototype([DynamicPropertyContainer],ShapeModifier);function TrimModifier(){}extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length;},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[];},TrimModifier.prototype.calculateShapeEdges=function(t,e,i,s,r){var a=[];e<=1?a.push({s:t,e}):t>=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n=[],p,h=a.length,y;for(p=0;ps+i)){var P,c;y.s*r<=s?P=0:P=(y.s*r-s)/i,y.e*r>=s+i?c=1:c=(y.e*r-s)/i,n.push([P,c]);}return n.length||n.push([0,0]),n},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e1?e=1+s:this.s.v<0?e=0+s:e=this.s.v+s,this.e.v>1?i=1+s:this.e.v<0?i=0+s:i=this.e.v+s,e>i){var r=e;e=i,i=r;}e=Math.round(e*1e4)*1e-4,i=Math.round(i*1e4)*1e-4,this.sValue=e,this.eValue=i;}else e=this.sValue,i=this.eValue;var a,n,p=this.shapes.length,h,y,P,c,l,E=0;if(i===e)for(n=0;n=0;n-=1)if(v=this.shapes[n],v.shape._mdf){for(w=v.localShapeCollection,w.releaseShapes(),this.m===2&&p>1?(_=this.calculateShapeEdges(e,i,v.totalShapeLength,g,E),g+=v.totalShapeLength):_=[[u,f]],y=_.length,h=0;h=1?b.push({s:v.totalShapeLength*(u-1),e:v.totalShapeLength*(f-1)}):(b.push({s:v.totalShapeLength*u,e:v.totalShapeLength}),b.push({s:0,e:v.totalShapeLength*(f-1)}));var k=this.addShapes(v,b[0]);if(b[0].s!==b[0].e){if(b.length>1){var z=v.shape.paths.shapes[v.shape.paths._length-1];if(z.c){var q=k.pop();this.addPaths(k,w),k=this.addShapes(v,b[1],q);}else this.addPaths(k,w),k=this.addShapes(v,b[1]);}this.addPaths(k,w);}}v.shape.paths=w;}}},TrimModifier.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;ie.e){i.c=!1;break}else e.s<=y&&e.e>=y+P.addedLength?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[p],r[a].v[p],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[p],r[a].o[p-1],r[a].i[p],(e.s-y)/P.addedLength,(e.e-y)/P.addedLength,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1),y+=P.addedLength,c+=1;if(r[a].c&&l.length){if(P=l[p-1],y<=e.e){var u=l[p-1].addedLength;e.s<=y&&e.e>=y+u?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[0],r[a].v[0],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[0],r[a].o[p-1],r[a].i[0],(e.s-y)/u,(e.e-y)/u,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1);}else i.c=!1;y+=P.addedLength,c+=1;}if(i._length&&(i.setXYAt(i.v[v][0],i.v[v][1],"i",v),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),y>e.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(P=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/y,0),c=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/y,0)):(P=this.p.pv,c=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/y,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){P=[],c=[];var l=this.px,E=this.py;l._caching.lastFrame+l.offsetTime<=l.keyframes[0].t?(P[0]=l.getValueAtTime((l.keyframes[0].t+.01)/y,0),P[1]=E.getValueAtTime((E.keyframes[0].t+.01)/y,0),c[0]=l.getValueAtTime(l.keyframes[0].t/y,0),c[1]=E.getValueAtTime(E.keyframes[0].t/y,0)):l._caching.lastFrame+l.offsetTime>=l.keyframes[l.keyframes.length-1].t?(P[0]=l.getValueAtTime(l.keyframes[l.keyframes.length-1].t/y,0),P[1]=E.getValueAtTime(E.keyframes[E.keyframes.length-1].t/y,0),c[0]=l.getValueAtTime((l.keyframes[l.keyframes.length-1].t-.01)/y,0),c[1]=E.getValueAtTime((E.keyframes[E.keyframes.length-1].t-.01)/y,0)):(P=[l.pv,E.pv],c[0]=l.getValueAtTime((l._caching.lastFrame+l.offsetTime-.01)/y,l.offsetTime),c[1]=E.getValueAtTime((E._caching.lastFrame+E.offsetTime-.01)/y,E.offsetTime));}else c=t,P=c;this.v.rotate(-Math.atan2(P[1]-c[1],P[0]-c[0]));}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);}this.frameId=this.elem.globalData.frameId;}}function s(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4);}function r(){}function a(h){this._addDynamicProperty(h),this.elem.addDynamicProperty(h),this._isDirty=!0;}function n(h,y,P){if(this.elem=h,this.frameId=-1,this.propType="transform",this.data=y,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(P||h),y.p&&y.p.s?(this.px=PropertyFactory.getProp(h,y.p.x,0,0,this),this.py=PropertyFactory.getProp(h,y.p.y,0,0,this),y.p.z&&(this.pz=PropertyFactory.getProp(h,y.p.z,0,0,this))):this.p=PropertyFactory.getProp(h,y.p||{k:[0,0,0]},1,0,this),y.rx){if(this.rx=PropertyFactory.getProp(h,y.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(h,y.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(h,y.rz,0,degToRads,this),y.or.k[0].ti){var c,l=y.or.k.length;for(c=0;c0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0);},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e0?Math.floor(l):Math.ceil(l),v=this.pMatrix.props,w=this.rMatrix.props,u=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var f=0;if(l>0){for(;fb;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),f-=1;E&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-E,!0),f-=E);}s=this.data.m===1?0:this._currentCopies-1,r=this.data.m===1?1:-1,a=this._currentCopies;for(var g,_;a;){if(e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,_=i.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),f!==0){for((s!==0&&r===1||s!==this._currentCopies-1&&r===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],w[8],w[9],w[10],w[11],w[12],w[13],w[14],w[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),g=0;g<_;g+=1)i[g]=this.matrix.props[g];this.matrix.reset();}else for(this.matrix.reset(),g=0;g<_;g+=1)i[g]=this.matrix.props[g];f+=1,a-=1,s+=r;}}else for(a=this._currentCopies,s=0,r=1;a;)e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,s+=r;return n},RepeaterModifier.prototype.addShape=function(){};function RoundCornersModifier(){}extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length;},RoundCornersModifier.prototype.processPath=function(t,e){var i=shapePool.newElement();i.c=t.c;var s,r=t._length,a,n,p,h,y,P,c=0,l,E,b,v,w,u;for(s=0;s0&&s<1?[e]:[]:[e-s,e+s].filter(function(r){return r>0&&r<1})},PolynomialBezier.prototype.split=function(t){if(t<=0)return [singlePoint(this.points[0]),this];if(t>=1)return [this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),i=lerpPoint(this.points[1],this.points[2],t),s=lerpPoint(this.points[2],this.points[3],t),r=lerpPoint(e,i,t),a=lerpPoint(i,s,t),n=lerpPoint(r,a,t);return [new PolynomialBezier(this.points[0],e,r,n,!0),new PolynomialBezier(n,a,s,this.points[3],!0)]};function extrema(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var r=s;s=i,i=r;}for(var a=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),n=0;n0&&a[n]<1){var p=t.point(a[n])[e];ps&&(s=p);}return {min:i,max:s}}PolynomialBezier.prototype.bounds=function(){return {x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return {left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}};function intersectData(t,e,i){var s=t.boundingBox();return {cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function splitData(t){var e=t.bez.split(.5);return [intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return Math.abs(t.cx-e.cx)*2=a||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s){r.push([t.t,e.t]);return}var n=splitData(t),p=splitData(e);intersectsImpl(n[0],p[0],i+1,s,r,a),intersectsImpl(n[0],p[1],i+1,s,r,a),intersectsImpl(n[1],p[0],i+1,s,r,a),intersectsImpl(n[1],p[1],i+1,s,r,a);}}PolynomialBezier.prototype.intersections=function(t,e,i){e===void 0&&(e=2),i===void 0&&(i=7);var s=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,s,i),s},PolynomialBezier.shapeSegment=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[i],t.v[i],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[i],t.i[i],t.o[e],t.v[e],!0)};function crossProduct(t,e){return [t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,i,s){var r=[t[0],t[1],1],a=[e[0],e[1],1],n=[i[0],i[1],1],p=[s[0],s[1],1],h=crossProduct(crossProduct(r,a),crossProduct(n,p));return floatZero(h[2])?null:[h[0]/h[2],h[1]/h[2]]}function polarOffset(t,e,i){return [t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0;};function setPoint(t,e,i,s,r,a,n){var p=i-Math.PI/2,h=i+Math.PI/2,y=e[0]+Math.cos(i)*s*r,P=e[1]-Math.sin(i)*s*r;t.setTripleAt(y,P,y+Math.cos(p)*a,P-Math.sin(p)*a,y+Math.cos(h)*n,P-Math.sin(h)*n,t.length());}function getPerpendicularVector(t,e){var i=[e[0]-t[0],e[1]-t[1]],s=-Math.PI*.5,r=[Math.cos(s)*i[0]-Math.sin(s)*i[1],Math.sin(s)*i[0]+Math.cos(s)*i[1]];return r}function getProjectingAngle(t,e){var i=e===0?t.length()-1:e-1,s=(e+1)%t.length(),r=t.v[i],a=t.v[s],n=getPerpendicularVector(r,a);return Math.atan2(0,1)-Math.atan2(n[1],n[0])}function zigZagCorner(t,e,i,s,r,a,n){var p=getProjectingAngle(e,i),h=e.v[i%e._length],y=e.v[i===0?e._length-1:i-1],P=e.v[(i+1)%e._length],c=a===2?Math.sqrt(Math.pow(h[0]-y[0],2)+Math.pow(h[1]-y[1],2)):0,l=a===2?Math.sqrt(Math.pow(h[0]-P[0],2)+Math.pow(h[1]-P[1],2)):0;setPoint(t,e.v[i%e._length],p,n,s,l/((r+1)*2),c/((r+1)*2));}function zigZagSegment(t,e,i,s,r,a){for(var n=0;n1&&e.length>1&&(r=getIntersection(t[0],e[e.length-1]),r)?[[t[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[i,s]}function pruneIntersections(t){for(var e,i=1;i1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var i=t.inflectionPoints(),s,r,a,n;if(i.length===0)return [offsetSegment(t,e)];if(i.length===1||floatEqual(i[1],1))return a=t.split(i[0]),s=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(r,e)];a=t.split(i[0]),s=a[0];var p=(i[1]-i[0])/(1-i[0]);return a=a[1].split(p),n=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(n,e),offsetSegment(r,e)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(t,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=this.amount.effectsSequence.length!==0;},OffsetPathModifier.prototype.processPath=function(t,e,i,s){var r=shapePool.newElement();r.c=t.c;var a=t.length();t.c||(a-=1);var n,p,h,y=[];for(n=0;n=0;n-=1)h=PolynomialBezier.shapeSegmentInverted(t,n),y.push(offsetSegmentSplit(h,e));y=pruneIntersections(y);var P=null,c=null;for(n=0;n0&&(Gt=!1),Gt){var Ht=createTag("style");Ht.setAttribute("f-forigin",S[R].fOrigin),Ht.setAttribute("f-origin",S[R].origin),Ht.setAttribute("f-family",S[R].fFamily),Ht.type="text/css",Ht.innerText="@font-face {font-family: "+S[R].fFamily+"; font-style: normal; src: url('"+S[R].fPath+"');}",V.appendChild(Ht);}}else if(S[R].fOrigin==="g"||S[R].origin===1){for(Vt=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),Xt=0;Xt=55296&&S<=56319){var R=D.charCodeAt(1);R>=56320&&R<=57343&&(V=(S-55296)*1024+R-56320+65536);}return V}function z(D,V){var S=D.toString(16)+V.toString(16);return c.indexOf(S)!==-1}function q(D){return D===h}function W(D){return D===p}function ot(D){var V=k(D);return V>=y&&V<=P}function mt(D){return ot(D.substr(0,2))&&ot(D.substr(2,2))}function gt(D){return i.indexOf(D)!==-1}function ut(D,V){var S=k(D.substr(V,2));if(S!==s)return !1;var R=0;for(V+=2;R<5;){if(S=k(D.substr(V,2)),Sn)return !1;R+=1,V+=2;}return k(D.substr(V,2))===r}function Ct(){this.isLoaded=!0;}var ht=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this);};ht.isModifier=z,ht.isZeroWidthJoiner=q,ht.isFlagEmoji=mt,ht.isRegionalCode=ot,ht.isCombinedCharacter=gt,ht.isRegionalFlag=ut,ht.isVariationSelector=W,ht.BLACK_FLAG_CODE_POINT=s;var yt={addChars:u,addFonts:w,getCharData:f,getFontByName:_,measureText:g,checkLoadedFonts:b,setIsLoaded:Ct};return ht.prototype=yt,ht}();function SlotManager(t){this.animationData=t;}SlotManager.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t};function slotFactory(t){return new SlotManager(t)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[];},addRenderableComponent:function(t){this.renderableComponents.indexOf(t)===-1&&this.renderableComponents.push(t);},removeRenderableComponent:function(t){this.renderableComponents.indexOf(t)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1);},prepareRenderableFrame:function(t){this.checkLayerLimits(t);},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show());},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide());},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0));},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1;},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1;},AudioElement.prototype.resume=function(){this._canPlay=!0;},AudioElement.prototype.setRate=function(t){this.audio.rate(t);},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume);},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(t){var e,i=this.layers.length,s;for(this.completeLayers=!0,e=i-1;e>=0;e-=1)this.elements[e]||(s=this.layers[e],s.ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements();},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",l),this.element.maskedElement.setAttribute(f,"url("+getLocationHref()+"#"+l+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this);}MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e=this.element.finalTransform.mat,i,s=this.masksProperties.length;for(i=0;i1&&(s+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==s){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+s:s),i.elem.setAttribute("d",n)),i.lastPath=s;}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null;};var filtersFactory=function(){var t={};t.createFilter=e,t.createAlphaToLuminanceFilter=i;function e(s,r){var a=createNS("filter");return a.setAttribute("id",s),r!==!0&&(a.setAttribute("filterUnits","objectBoundingBox"),a.setAttribute("x","0%"),a.setAttribute("y","0%"),a.setAttribute("width","100%"),a.setAttribute("height","100%")),a}function i(){var s=createNS("feColorMatrix");return s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),s}return t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return (/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(t){var e,i="SourceGraphic",s=t.data.ef?t.data.ef.length:0,r=createElementID(),a=filtersFactory.createFilter(r,!0),n=0;this.filters=[];var p;for(e=0;e=0&&(i=this.shapeModifiers[t].processShapes(this._isFirstFrame),!i);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i.01)return !1;i+=1;}return !0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return !1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t0;)u=l.transformers[ot].mProps._mdf||u,W-=1,ot-=1;if(u)for(W=k-l.styles[g].lvl,ot=l.transformers.length-1;W>0;)q.multiply(l.transformers[ot].mProps.v),W-=1,ot-=1;}else q=t;if(z=l.sh.paths,v=z._length,u){for(w="",b=0;b=1?Ct=.99:Ct<=-1&&(Ct=-.99);var ht=gt*Ct,yt=Math.cos(ut+l.a.v)*ht+w[0],D=Math.sin(ut+l.a.v)*ht+w[1];b.setAttribute("fx",yt),b.setAttribute("fy",D),v&&!l.g._collapsable&&(l.of.setAttribute("fx",yt),l.of.setAttribute("fy",D));}}}function P(c,l,E){var b=l.style,v=l.d;v&&(v._mdf||E)&&v.dashStr&&(b.pElem.setAttribute("stroke-dasharray",v.dashStr),b.pElem.setAttribute("stroke-dashoffset",v.dashoffset[0])),l.c&&(l.c._mdf||E)&&b.pElem.setAttribute("stroke","rgb("+bmFloor(l.c.v[0])+","+bmFloor(l.c.v[1])+","+bmFloor(l.c.v[2])+")"),(l.o._mdf||E)&&b.pElem.setAttribute("stroke-opacity",l.o.v),(l.w._mdf||E)&&(b.pElem.setAttribute("stroke-width",l.w.v),b.msElem&&b.msElem.setAttribute("stroke-width",l.w.v));}return i}();function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[];}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e=this.shapes.length,i,s,r=this.stylesList.length,a,n=[],p=!1;for(s=0;s1&&p&&this.setShapesAsAnimated(n);}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e=0;h-=1){if(w=this.searchProcessedElement(t[h]),w?e[h]=i[w-1]:t[h]._render=n,t[h].ty==="fl"||t[h].ty==="st"||t[h].ty==="gf"||t[h].ty==="gs"||t[h].ty==="no")w?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],r),t[h]._render&&e[h].style.pElem.parentNode!==s&&s.appendChild(e[h].style.pElem),l.push(e[h].style);else if(t[h].ty==="gr"){if(!w)e[h]=this.createGroupElement(t[h]);else for(c=e[h].it.length,P=0;P1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this);},TextProperty.prototype.getValue=function(t){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!t)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var s,r=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(s=0;se);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e=[],i=0,s=t.length,r,a,n=!1,p=!1,h="";i=55296&&r<=56319?FontManager.isRegionalFlag(t,i)?h=t.substr(i,14):(a=t.charCodeAt(i+1),a>=56320&&a<=57343&&(FontManager.isModifier(r,a)?(h=t.substr(i,2),n=!0):FontManager.isFlagEmoji(t.substr(i,4))?h=t.substr(i,4):h=t.substr(i,2))):r>56319?(a=t.charCodeAt(i+1),FontManager.isVariationSelector(r)&&(n=!0)):FontManager.isZeroWidthJoiner(r)&&(n=!0,p=!0),n?(e[e.length-1]+=h,n=!1):e.push(h),i+=h.length;return e},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e=this.elem.globalData.fontManager,i=this.data,s=[],r,a,n,p=0,h,y=i.m.g,P=0,c=0,l=0,E=[],b=0,v=0,w,u,f=e.getFontByName(t.f),g,_=0,k=getFontProperties(f);t.fWeight=k.weight,t.fStyle=k.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),a=t.finalText.length,t.finalLineHeight=t.lh;var z=t.tr/1e3*t.finalSize,q;if(t.sz)for(var W=!0,ot=t.sz[0],mt=t.sz[1],gt,ut;W;){ut=this.buildFinalText(t.t),gt=0,b=0,a=ut.length,z=t.tr/1e3*t.finalSize;var Ct=-1;for(r=0;rot&&ut[r]!==" "?(Ct===-1?a+=1:r=Ct,gt+=t.finalLineHeight||t.finalSize*1.2,ut.splice(r,Ct===r?1:0,"\r"),Ct=-1,b=0):(b+=_,b+=z);gt+=f.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&mtv?b:v,b=-2*z,h="",n=!0,l+=1):h=yt,e.chars?(g=e.getCharData(yt,f.fStyle,e.getFontByName(t.f).fFamily),_=n?0:g.w*t.finalSize/100):_=e.measureText(h,t.f,t.finalSize),yt===" "?ht+=_+z:(b+=_+z+ht,ht=0),s.push({l:_,an:_,add:P,n,anIndexes:[],val:h,line:l,animatorJustifyOffset:0}),y==2){if(P+=_,h===""||h===" "||r===a-1){for((h===""||h===" ")&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;p+=1,P=0;}}else if(y==3){if(P+=_,h===""||r===a-1){for(h===""&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;P=0,p+=1;}}else s[p].ind=p,s[p].extra=0,p+=1;if(t.l=s,v=b>v?b:v,E.push(b),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0;}t.lineWidths=E;var D=i.a,V,S;u=D.length;var R,tt,J=[];for(w=0;w0?n=this.ne.v/100:p=-this.ne.v/100,this.xe.v>0?h=1-this.xe.v/100:y=1+this.xe.v/100;var P=BezierFactory.getBezierEasing(n,p,h,y).get,c=0,l=this.finalS,E=this.finalE,b=this.data.sh;if(b===2)E===l?c=a>=E?1:0:c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===3)E===l?c=a>=E?0:1:c=1-t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===4)E===l?c=0:(c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c<.5?c*=2:c=1-2*(c-.5)),c=P(c);else if(b===5){if(E===l)c=0;else {var v=E-l;a=e(t(0,a+.5-l),E-l);var w=-v/2+a,u=v/2;c=Math.sqrt(1-w*w/(u*u));}c=P(c);}else b===6?(E===l?c=0:(a=e(t(0,a+.5-l),E-l),c=(1+Math.cos(Math.PI+Math.PI*2*a/(E-l)))/2),c=P(c)):(a>=i(l)&&(a-l<0?c=t(0,e(e(E,1)-(l-a),1)):c=t(0,e(E-a,1))),c=P(c));if(this.sm.v!==100){var f=this.sm.v*.01;f===0&&(f=1e-8);var g=.5-f*.5;c1&&(c=1));}return c*this.a.v},getValue:function(a){this.iterateDynamicProperties(),this._mdf=a||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,a&&this.data.r===2&&(this.e.v=this._currentTextLength);var n=this.data.r===2?1:100/this.data.totalChars,p=this.o.v/n,h=this.s.v/n+p,y=this.e.v/n+p;if(h>y){var P=h;h=y,y=P;}this.finalS=h,this.finalE=y;}},extendPrototype([DynamicPropertyContainer],s);function r(a,n,p){return new s(a,n)}return {getTextSelectorProp:r}}();function TextAnimatorDataProperty(t,e,i){var s={propType:!1},r=PropertyFactory.getProp,a=e.a;this.a={r:a.r?r(t,a.r,0,degToRads,i):s,rx:a.rx?r(t,a.rx,0,degToRads,i):s,ry:a.ry?r(t,a.ry,0,degToRads,i):s,sk:a.sk?r(t,a.sk,0,degToRads,i):s,sa:a.sa?r(t,a.sa,0,degToRads,i):s,s:a.s?r(t,a.s,1,.01,i):s,a:a.a?r(t,a.a,1,0,i):s,o:a.o?r(t,a.o,0,.01,i):s,p:a.p?r(t,a.p,1,0,i):s,sw:a.sw?r(t,a.sw,0,0,i):s,sc:a.sc?r(t,a.sc,1,0,i):s,fc:a.fc?r(t,a.fc,1,0,i):s,fh:a.fh?r(t,a.fh,0,0,i):s,fs:a.fs?r(t,a.fs,0,.01,i):s,fb:a.fb?r(t,a.fb,0,.01,i):s,t:a.t?r(t,a.t,0,0,i):s},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t;}function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i);}TextAnimatorProperty.prototype.searchProperties=function(){var t,e=this._textData.a.length,i,s=PropertyFactory.getProp;for(t=0;t=b+oe||!k?(ot=(b+oe-w)/v.partialLength,Xt=_.point[0]+(v.point[0]-_.point[0])*ot,Ht=_.point[1]+(v.point[1]-_.point[1])*ot,a.translate(-i[0]*l[P].an*.005,-(i[1]*ht)*.01),u=!1):k&&(w+=v.partialLength,f+=1,f>=k.length&&(f=0,g+=1,z[g]?k=z[g].points:gt.v.c?(f=0,g=0,k=z[g].points):(w-=v.partialLength,k=null)),k&&(_=v,v=k[f],q=v.partialLength));Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0);}else Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0),a.translate(-i[0]*l[P].an*.005,-i[1]*ht*.01,0);for(S=0;St?this.textSpans[t].span:createNS(p?"g":"text"),g<=t){if(h.setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=h,p){var k=createNS("g");h.appendChild(k),this.textSpans[t].childSpan=k;}this.textSpans[t].span=h,this.layerElement.appendChild(h);}h.style.display="inherit";}if(y.reset(),c&&(n[t].n&&(l=-v,E+=i.yOffset,E+=b?1:0,b=!1),this.applyTextPropertiesToMatrix(i,y,n[t].line,l,E),l+=n[t].l||0,l+=v),p){_=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily);var z;if(_.t===1)z=new SVGCompElement(_.data,this.globalData,this);else {var q=emptyShapeData;_.data&&_.data.shapes&&(q=this.buildShapeData(_.data,i.finalSize)),z=new SVGShapeElement(q,this.globalData,this);}if(this.textSpans[t].glyph){var W=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(W.layerElement),W.destroy();}this.textSpans[t].glyph=z,z._debug=!0,z.prepareFrame(0),z.renderFrame(),this.textSpans[t].childSpan.appendChild(z.layerElement),_.t===1&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")");}else c&&h.setAttribute("transform","translate("+y.props[12]+","+y.props[13]+")"),h.textContent=n[t].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");}c&&h&&h.setAttribute("d",P);}for(;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0));}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t=0;i-=1)t.finalTransform.multiply(t.transforms[i].transform.mProps.v);t._mdf=r;},processSequences:function(t){var e,i=this.sequenceList.length;for(e=0;e=1){this.buffers=[];var t=this.globalData.canvasContext,e=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(e);var i=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(i),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas();}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms();},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e;}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0);},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0);},clearCanvas:function(t){t.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy);},prepareLayer:function(){if(this.data.tt>=1){var t=this.buffers[0],e=t.getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);}},exitLayer:function(){if(this.data.tt>=1){var t=this.buffers[1],e=t.getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var i=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(i.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var s=assetLoader.getLumaCanvas(this.canvasContext.canvas),r=s.getContext("2d");r.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(s,0,0);}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(t,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over";}},renderFrame:function(t){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!t)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var e=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(e),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(e),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1);}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy();},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(t,e,i,s){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var r=4;e.ty==="rc"?r=5:e.ty==="el"?r=6:e.ty==="sr"&&(r=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,r,t);var a,n=i.length,p;for(a=0;a=0;a-=1){if(c=this.searchProcessedElement(t[a]),c?e[a]=i[c-1]:t[a]._shouldRender=s,t[a].ty==="fl"||t[a].ty==="st"||t[a].ty==="gf"||t[a].ty==="gs")c?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],b),y.push(e[a].style);else if(t[a].ty==="gr"){if(!c)e[a]=this.createGroupElement(t[a]);else for(h=e[a].it.length,p=0;p=0;r-=1)e[r].ty==="tr"?(n=i[r].transform,this.renderShapeTransform(t,n)):e[r].ty==="sh"||e[r].ty==="el"||e[r].ty==="rc"||e[r].ty==="sr"?this.renderPath(e[r],i[r]):e[r].ty==="fl"?this.renderFill(e[r],i[r],n):e[r].ty==="st"?this.renderStroke(e[r],i[r],n):e[r].ty==="gf"||e[r].ty==="gs"?this.renderGradientFill(e[r],i[r],n):e[r].ty==="gr"?this.renderShape(n,e[r].it,i[r].it):e[r].ty;s&&this.drawLayer();},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var i=t.trNodes,s=e.paths,r,a,n,p=s._length;i.length=0;var h=t.transforms.finalTransform;for(n=0;n=1?P=.99:P<=-1&&(P=-.99);var c=h*P,l=Math.cos(y+e.a.v)*c+n[0],E=Math.sin(y+e.a.v)*c+n[1];r=a.createRadialGradient(l,E,0,n[0],n[1],h);}var b,v=t.g.p,w=e.g.c,u=1;for(b=0;ba&&h==="xMidYMid slice"||rr&&p==="meet"||ar&&p==="slice")?this.transformCanvas.tx=(i-this.transformCanvas.w*(s/this.transformCanvas.h))/2*this.renderConfig.dpr:y==="xMax"&&(ar&&p==="slice")?this.transformCanvas.tx=(i-this.transformCanvas.w*(s/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,P==="YMid"&&(a>r&&p==="meet"||ar&&p==="meet"||a=0;t-=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0;},CanvasRendererBase.prototype.renderFrame=function(t,e){if(!(this.renderedFrame===t&&this.renderConfig.clearCanvas===!0&&!e||this.destroyed||t===-1)){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var i,s=this.layers.length;for(this.completeLayers||this.checkLayers(t),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].prepareFrame(t-this.layers[i].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore();}}},CanvasRendererBase.prototype.buildItem=function(t){var e=this.elements;if(!(e[t]||this.layers[t].ty===99)){var i=this.createItem(this.layers[t],this,this.globalData);e[t]=i,i.initExpressions();}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();t.checkParenting();}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none";},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block";};function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random();}function CVContextData(){this.stack=[],this.cArrPos=0,this.cTr=new Matrix;var t,e=15;for(t=0;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame();},CVCompElement.prototype.destroy=function(){var t,e=this.layers.length;for(t=e-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null;},CVCompElement.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)};function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:e&&e.clearCanvas!==void 0?e.clearCanvas:!0,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",className:e&&e.className||"",id:e&&e.id||"",runExpressions:!e||e.runExpressions===void 0||e.runExpressions},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData));}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)};function HBaseElement(){}HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement);},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.bm!==0&&this.setBlendMode();},renderElement:function(){var t=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var e=this.finalTransform.mat.toCSS();t.transform=e,t.webkitTransform=e;}this.finalTransform._opMdf&&(t.opacity=this.finalTransform.mProp.o.v);},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1));},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null);},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData);},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting;function HSolidElement(t,e,i){this.initElement(t,e,i);}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?(t=createNS("rect"),t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):(t=createTag("div"),t.style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t);};function HShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(t,e,i),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0};}extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else {t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t);}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t;},HShapeElement.prototype.getTransformedPoint=function(t,e){var i,s=t.length;for(i=0;i0&&h<1&&r[l].push(this.calculateF(h,t,e,i,s,l))):(y=n*n-4*p*a,y>=0&&(P=(-n+bmSqrt(y))/(2*a),P>0&&P<1&&r[l].push(this.calculateF(P,t,e,i,s,l)),c=(-n-bmSqrt(y))/(2*a),c>0&&c<1&&r[l].push(this.calculateF(c,t,e,i,s,l)))));this.shapeBoundingBox.left=bmMin.apply(null,r[0]),this.shapeBoundingBox.top=bmMin.apply(null,r[1]),this.shapeBoundingBox.right=bmMax.apply(null,r[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,r[1]);},HShapeElement.prototype.calculateF=function(t,e,i,s,r,a){return bmPow(1-t,3)*e[a]+3*bmPow(1-t,2)*t*i[a]+3*(1-t)*bmPow(t,2)*s[a]+bmPow(t,3)*r[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var i,s=t.length;for(i=0;ii&&(i=r);}i*=t.mult;}else i=t.v*t.mult;e.x-=i,e.xMax+=i,e.y-=i,e.yMax+=i;},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax=0;e-=1){var s=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-s.p.v[0],-s.p.v[1],s.p.v[2]),this.mat.rotateX(-s.or.v[0]).rotateY(-s.or.v[1]).rotateZ(s.or.v[2]),this.mat.rotateX(-s.rx.v).rotateY(-s.ry.v).rotateZ(s.rz.v),this.mat.scale(1/s.s.v[0],1/s.s.v[1],1/s.s.v[2]),this.mat.translate(s.a.v[0],s.a.v[1],s.a.v[2]);}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var r;this.p?r=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:r=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)),n=[r[0]/a,r[1]/a,r[2]/a],p=Math.sqrt(n[2]*n[2]+n[0]*n[0]),h=Math.atan2(n[1],p),y=Math.atan2(n[0],-n[2]);this.mat.rotateY(y).rotateX(-h);}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var P=!this._prevMat.equals(this.mat);if((P||this.pe._mdf)&&this.comp.threeDElements){i=this.comp.threeDElements.length;var c,l,E;for(e=0;e=t)return this.threeDElements[e].perspectiveElem;e+=1;}return null},HybridRendererBase.prototype.createThreeDContainer=function(t,e){var i=createTag("div"),s,r;styleDiv(i);var a=createTag("div");if(styleDiv(a),e==="3d"){s=i.style,s.width=this.globalData.compSize.w+"px",s.height=this.globalData.compSize.h+"px";var n="50% 50%";s.webkitTransformOrigin=n,s.mozTransformOrigin=n,s.transformOrigin=n,r=a.style;var p="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";r.transform=p,r.webkitTransform=p;}i.appendChild(a);var h={container:a,perspectiveElem:i,startPos:t,endPos:t,type:e};return this.threeDElements.push(h),h},HybridRendererBase.prototype.build3dContainers=function(){var t,e=this.layers.length,i,s="";for(t=0;t=0;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem);},HybridRendererBase.prototype.addTo3dContainer=function(t,e){for(var i=0,s=this.threeDElements.length;ii?(r=t/this.globalData.compSize.w,a=t/this.globalData.compSize.w,n=0,p=(e-this.globalData.compSize.h*(t/this.globalData.compSize.w))/2):(r=e/this.globalData.compSize.h,a=e/this.globalData.compSize.h,n=(t-this.globalData.compSize.w*(e/this.globalData.compSize.h))/2,p=0);var h=this.resizerElem.style;h.webkitTransform="matrix3d("+r+",0,0,0,0,"+a+",0,0,0,0,1,0,"+n+","+p+",0,1)",h.transform=h.webkitTransform;},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none";},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block";},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else {var t=this.globalData.compSize.w,e=this.globalData.compSize.h,i,s=this.threeDElements.length;for(i=0;i=y;)mt/=2,gt/=2,ut>>>=1;return (mt+ut)/gt};return ot.int32=function(){return W.g(4)|0},ot.quick=function(){return W.g(4)/4294967296},ot.double=ot,w(f(W.S),t),(_.pass||k||function(mt,gt,ut,Ct){return Ct&&(Ct.S&&b(Ct,W),mt.state=function(){return b(W,{})}),ut?(e[n]=mt,gt):mt})(ot,q,"global"in _?_.global:this==e,_.state)}e["seed"+n]=l;function E(g){var _,k=g.length,z=this,q=0,W=z.i=z.j=0,ot=z.S=[];for(k||(g=[k++]);qi){var s=i;i=e,e=s;}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if(typeof t=="number"||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var i,s=Math.min(t.length,e.length),r=0;for(i=0;i.5?y/(2-r-a):y/(r+a),r){case e:n=(i-s)/y+(i1&&(i-=1),i<1/6?t+(e-t)*6*i:i<1/2?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e=t[0],i=t[1],s=t[2],r,a,n;if(i===0)r=s,n=s,a=s;else {var p=s<.5?s*(1+i):s+i-s*i,h=2*s-p;r=hue2rgb(h,p,e+1/3),a=hue2rgb(h,p,e),n=hue2rgb(h,p,e-1/3);}return [r,a,n,t[3]]}function linear(t,e,i,s,r){if((s===void 0||r===void 0)&&(s=e,r=i,e=0,i=1),i=i)return r;var n=i===e?0:(t-e)/(i-e);if(!s.length)return s+(r-s)*n;var p,h=s.length,y=createTypedArray("float32",h);for(p=0;p1){for(r=0;r1?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(r)){var p,h=r.length,y=createTypedArray("float32",h);for(p=0;pdata.k[e].t&&tdata.k[e+1].t-t?(s=e+2,r=data.k[e+1].t):(s=e+1,r=data.k[e].t);break}s===-1&&(s=e+1,r=data.k[e].t);}var a={};return a.index=s,a.time=r/elem.comp.globalData.frameRate,a}function key(t){var e,i,s;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(s=r.length,i=0;iw.length-1)&&(E=w.length-1),g=w[w.length-1-E].t,f=u-g);var _,k,z;if(l==="pingpong"){var q=Math.floor((v-g)/f);if(q%2!==0)return this.getValueAtTime((f-(v-g)%f+g)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(g/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(u/this.comp.globalData.frameRate,0),mt=this.getValueAtTime(((v-g)%f+g)/this.comp.globalData.frameRate,0),gt=Math.floor((v-g)/f);if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_=u)return this.pv;var f,g;b?(E?f=Math.abs(this.elem.comp.globalData.frameRate*E):f=Math.max(0,this.elem.data.op-u),g=u+f):((!E||E>w.length-1)&&(E=w.length-1),g=w[E].t,f=g-u);var _,k,z;if(l==="pingpong"){var q=Math.floor((u-v)/f);if(q%2===0)return this.getValueAtTime(((u-v)%f+u)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(u/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(g/this.comp.globalData.frameRate,0),mt=this.getValueAtTime((f-(u-v)%f+u)/this.comp.globalData.frameRate,0),gt=Math.floor((u-v)/f)+1;if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_1?(w-v)/(E-1):1,f=0,g=0,_;this.pv.length?_=createTypedArray("float32",this.pv.length):_=0;for(var k;fu){var z=f,q=b.c&&f===g-1?0:f+1,W=(u-_)/w[f].addedLength;k=bez.getPointInSegment(b.v[z],b.v[q],b.o[z],b.i[q],W,w[f]);break}else _+=w[f].addedLength;f+=1;}return k||(k=b.c?[b.v[0][0],b.v[0][1]]:[b.v[b._length-1][0],b.v[b._length-1][1]]),k},vectorOnPath:function(l,E,b){l==1?l=this.v.c:l==0&&(l=.999);var v=this.pointOnPath(l,E),w=this.pointOnPath(l+.001,E),u=w[0]-v[0],f=w[1]-v[1],g=Math.sqrt(Math.pow(u,2)+Math.pow(f,2));if(g===0)return [0,0];var _=b==="tangent"?[u/g,f/g]:[-f/g,u/g];return _},tangentOnPath:function(l,E){return this.vectorOnPath(l,E,"tangent")},normalOnPath:function(l,E){return this.vectorOnPath(l,E,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([P],h),extendPrototype([P],y),y.prototype.getValueAtTime=p,y.prototype.initiateExpression=ExpressionManager.initiateExpression;var c=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(l,E,b,v,w){var u=c(l,E,b,v,w);return u.propertyIndex=E.ix,u.lock=!1,b===3?expressionHelpers.searchExpressions(l,E.pt,u):b===4&&expressionHelpers.searchExpressions(l,E.ks,u),u.k&&l.addDynamicProperty(u),u};}function initialize$1(){addPropertyDecorator();}function addDecorator(){function t(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(e,i){var s=this.calculateExpression(i);if(e.t!==s){var r={};return this.copyData(r,e),r.t=s.toString(),r.__complete=!1,r}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),i=this.searchExpressions();return this.kf=e||i,this.kf},TextProperty.prototype.searchExpressions=t;}function initialize(){addDecorator();}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function t(e,i){var s=createNS("feMerge");s.setAttribute("result",e);var r,a;for(a=0;a=y?c=b<0?s:r:c=s+E*Math.pow((p-t)/b,1/i),P[l]=c,l+=1,a+=256/(n-1);return P.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e));}};function SVGDropShadowEffect(t,e,i,s,r){var a=e.container.globalData.renderConfig.filterSize,n=e.data.fs||a;t.setAttribute("x",n.x||a.x),t.setAttribute("y",n.y||a.y),t.setAttribute("width",n.width||a.width),t.setAttribute("height",n.height||a.height),this.filterManager=e;var p=createNS("feGaussianBlur");p.setAttribute("in","SourceAlpha"),p.setAttribute("result",s+"_drop_shadow_1"),p.setAttribute("stdDeviation","0"),this.feGaussianBlur=p,t.appendChild(p);var h=createNS("feOffset");h.setAttribute("dx","25"),h.setAttribute("dy","0"),h.setAttribute("in",s+"_drop_shadow_1"),h.setAttribute("result",s+"_drop_shadow_2"),this.feOffset=h,t.appendChild(h);var y=createNS("feFlood");y.setAttribute("flood-color","#00ff00"),y.setAttribute("flood-opacity","1"),y.setAttribute("result",s+"_drop_shadow_3"),this.feFlood=y,t.appendChild(y);var P=createNS("feComposite");P.setAttribute("in",s+"_drop_shadow_3"),P.setAttribute("in2",s+"_drop_shadow_2"),P.setAttribute("operator","in"),P.setAttribute("result",s+"_drop_shadow_4"),t.appendChild(P);var c=this.createMergeNode(s,[s+"_drop_shadow_4",r]);t.appendChild(c);}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(e[0]*255),Math.round(e[1]*255),Math.round(e[2]*255)));}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,s=(this.filterManager.effectElements[2].p.v-90)*degToRads,r=i*Math.cos(s),a=i*Math.sin(s);this.feOffset.setAttribute("dx",r),this.feOffset.setAttribute("dy",a);}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=i,i.matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement;}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,i=_svgMatteSymbols.length;ez.timeCompleted&&(q.animInstance.currentFrame=z.timeCompleted);}}(),p=function(){return function(z){var q=s[z.id],W=q.container,ot=q.elements;a(z.tree,W,ot);}}();function h(z,q){for(var W,ot=0;ot"u"?(W.canvas=ut,W.instructionsHandler=E(ut)):(ut instanceof OffscreenCanvas||(ht=ut.transferControlToOffscreen(),mt.rendererSettings.canvas=ht),gt.push(ht));}s[q]=W,t.postMessage({type:"load",payload:{params:mt,id:q}},gt);}),ot}var k={loadAnimation:_};return k}();return lottie});}),yc=gc();});var vl={};fr(vl,{default:()=>bc});var vc,bc,bl=ls(()=>{qs();vc=is((t,e)=>{typeof navigator<"u"&&function(i,s){typeof t=="object"&&typeof e<"u"?e.exports=s():typeof define=="function"&&define.amd?define(s):(i=typeof globalThis<"u"?globalThis:i||self,i.lottie=s());}(t,function(){var i="http://www.w3.org/2000/svg",s="",r=!1,a=-999999,n=function(A){r=!!A;},p=function(){return r},h=function(A){s=A;},y=function(){return s};function P(A){return document.createElement(A)}function c(A,F){var j,U=A.length,at;for(j=0;j1?j[1]=1:j[1]<=0&&(j[1]=0),R(j[0],j[1],j[2])}function Gt(A,F){var j=tt(A[0]*255,A[1]*255,A[2]*255);return j[2]+=F,j[2]>1?j[2]=1:j[2]<0&&(j[2]=0),R(j[0],j[1],j[2])}function Vt(A,F){var j=tt(A[0]*255,A[1]*255,A[2]*255);return j[0]+=F/360,j[0]>1?j[0]-=1:j[0]<0&&(j[0]+=1),R(j[0],j[1],j[2])}(function(){var A=[],F,j;for(F=0;F<256;F+=1)j=F.toString(16),A[F]=j.length===1?"0"+j:j;return function(U,at,it){return U<0&&(U=0),at<0&&(at=0),it<0&&(it=0),"#"+A[U]+A[at]+A[it]}})();var Xt=function(A){w=!!A;},Ht=function(){return w},Qt=function(A){u=A;},Zt=function(){return u},ne=function(A){W=A;},ue=function(){return W},pe=function(A){f=A;};function Wt(A){return document.createElementNS(i,A)}function fe(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(F){return typeof F}:fe=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},fe(A)}var jt=function(){var A=1,F=[],j,U,at={onmessage:function(){},postMessage:function(St){j({data:St});}},it={postMessage:function(St){at.onmessage({data:St});}};function vt(St){if(window.Worker&&window.Blob&&p()){var m=new Blob(["var _workerSelf = self; self.onmessage = ",St.toString()],{type:"text/javascript"}),C=URL.createObjectURL(m);return new Worker(C)}return j=St,at}function Mt(){U||(U=vt(function(St){function m(){function T(et,X){var $,Y,N=et.length,rt,nt,K,ft;for(Y=0;Y=0;X-=1)if(et[X].ty==="sh")if(et[X].ks.k.i)d(et[X].ks.k);else for(N=et[X].ks.k.length,Y=0;Y$[0]?!0:$[0]>et[0]?!1:et[1]>$[1]?!0:$[1]>et[1]?!1:et[2]>$[2]?!0:$[2]>et[2]?!1:null}var M=function(){var et=[4,4,14];function X(Y){var N=Y.t.d;Y.t.d={k:[{s:N,t:0}]};}function $(Y){var N,rt=Y.length;for(N=0;N=0;N-=1)if(Y[N].ty==="sh")if(Y[N].ks.k.i)Y[N].ks.k.c=Y[N].closed;else for(K=Y[N].ks.k.length,nt=0;nt500)&&(this._imageLoaded(),clearInterval(o)),O+=1;}.bind(this),50);}function it(G){var O=U(G,this.assetsPath,this.path),o=Wt("image");g?this.testImageLoaded(o):o.addEventListener("load",this._imageLoaded,!1),o.addEventListener("error",function(){d.img=A,this._imageLoaded();}.bind(this),!1),o.setAttributeNS("http://www.w3.org/1999/xlink","href",O),this._elementHelper.append?this._elementHelper.append(o):this._elementHelper.appendChild(o);var d={img:o,assetData:G};return d}function vt(G){var O=U(G,this.assetsPath,this.path),o=P("img");o.crossOrigin="anonymous",o.addEventListener("load",this._imageLoaded,!1),o.addEventListener("error",function(){d.img=A,this._imageLoaded();}.bind(this),!1),o.src=O;var d={img:o,assetData:G};return d}function Mt(G){var O={assetData:G},o=U(G,this.assetsPath,this.path);return jt.loadData(o,function(d){O.img=d,this._footageLoaded();}.bind(this),function(){O.img={},this._footageLoaded();}.bind(this)),O}function bt(G,O){this.imagesLoadedCb=O;var o,d=G.length;for(o=0;othis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e=this.animationData.layers,i,s=e.length,r=t.layers,a,n=r.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(t){this.triggerRenderFrameError(t);}},AnimationItem.prototype.play=function(t){t&&this.name!==t||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},AnimationItem.prototype.pause=function(t){t&&this.name!==t||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(this.isPaused===!0?this.play():this.pause());},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(i=!0,e=0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"));}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart");},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,i!==-1&&this.goToAndStop(i,!0);},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),_typeof$4(t[0])==="object"){var i,s=t.length;for(i=0;i=0;V-=1)e[V].animation.destroy(D);}function W(D,V,S){var R=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),tt,J=R.length;for(tt=0;tt0?_=W:g=W;while(Math.abs(q)>a&&++ot=r?w(f,mt,g,_):gt===0?mt:v(f,z,z+h,g,_)}},t}(),pooling=function(){function t(e){return e.concat(createSizedArray(e.length))}return {double:t}}(),poolFactory=function(){return function(t,e,i){var s=0,r=t,a=createSizedArray(r),n={newElement:p,release:h};function p(){var y;return s?(s-=1,y=a[s]):y=e(),y}function h(y){s===r&&(a=pooling.double(a),r*=2),i&&i(y),a[s]=y,s+=1;}return n}}(),bezierLengthPool=function(){function t(){return {addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,t)}(),segmentsLengthPool=function(){function t(){return {lengths:[],totalLength:0}}function e(i){var s,r=i.lengths.length;for(s=0;s-.001&&f<.001}function i(l,E,b,v,w,u,f,g,_){if(b===0&&u===0&&_===0)return e(l,E,v,w,f,g);var k=t.sqrt(t.pow(v-l,2)+t.pow(w-E,2)+t.pow(u-b,2)),z=t.sqrt(t.pow(f-l,2)+t.pow(g-E,2)+t.pow(_-b,2)),q=t.sqrt(t.pow(f-v,2)+t.pow(g-w,2)+t.pow(_-u,2)),W;return k>z?k>q?W=k-z-q:W=q-z-k:q>z?W=q-z-k:W=z-k-q,W>-1e-4&&W<1e-4}var s=function(){return function(l,E,b,v){var w=getDefaultCurveSegments(),u,f,g,_,k,z=0,q,W=[],ot=[],mt=bezierLengthPool.newElement();for(g=b.length,u=0;uf?-1:1,k=!0;k;)if(v[u]<=f&&v[u+1]>f?(g=(f-v[u])/(v[u+1]-v[u]),k=!1):u+=_,u<0||u>=w-1){if(u===w-1)return b[u];k=!1;}return b[u]+(b[u+1]-b[u])*g}function y(l,E,b,v,w,u){var f=h(w,u),g=1-f,_=t.round((g*g*g*l[0]+(f*g*g+g*f*g+g*g*f)*b[0]+(f*f*g+g*f*f+f*g*f)*v[0]+f*f*f*E[0])*1e3)/1e3,k=t.round((g*g*g*l[1]+(f*g*g+g*f*g+g*g*f)*b[1]+(f*f*g+g*f*f+f*g*f)*v[1]+f*f*f*E[1])*1e3)/1e3;return [_,k]}var P=createTypedArray("float32",8);function c(l,E,b,v,w,u,f){w<0?w=0:w>1&&(w=1);var g=h(w,f);u=u>1?1:u;var _=h(u,f),k,z=l.length,q=1-g,W=1-_,ot=q*q*q,mt=g*q*q*3,gt=g*g*q*3,ut=g*g*g,Ct=q*q*W,ht=g*q*W+q*g*W+q*q*_,yt=g*g*W+q*g*_+g*q*_,D=g*g*_,V=q*W*W,S=g*W*W+q*_*W+q*W*_,R=g*_*W+q*_*_+g*W*_,tt=g*_*_,J=W*W*W,Gt=_*W*W+W*_*W+W*W*_,Vt=_*_*W+W*_*_+_*W*_,Xt=_*_*_;for(k=0;k=y.t-i){h.h&&(h=y),r=0;break}if(y.t-i>t){r=a;break}a=u||t=u?_.points.length-1:0;for(l=_.points[k].point.length,c=0;c=W&&z=u)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=f)s[0]=h.s[0],s[1]=h.s[1],s[2]=h.s[2];else {var ht=createQuaternion(h.s),yt=createQuaternion(g),D=(t-f)/(u-f);quaternionToEuler(s,slerp(ht,yt,D));}else for(a=0;a=u?E=1:t1e-6?(l=Math.acos(E),b=Math.sin(l),v=Math.sin((1-i)*l)/b,w=Math.sin(i*l)/b):(v=1-i,w=i),s[0]=v*r+w*h,s[1]=v*a+w*y,s[2]=v*n+w*P,s[3]=v*p+w*c,s}function quaternionToEuler(t,e){var i=e[0],s=e[1],r=e[2],a=e[3],n=Math.atan2(2*s*a-2*i*r,1-2*s*s-2*r*r),p=Math.asin(2*i*s+2*r*a),h=Math.atan2(2*i*a-2*s*r,1-2*i*i-2*r*r);t[0]=n/degToRads,t[1]=p/degToRads,t[2]=h/degToRads;}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,s=t[2]*degToRads,r=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(s/2),p=Math.sin(e/2),h=Math.sin(i/2),y=Math.sin(s/2),P=r*a*n-p*h*y,c=p*h*n+r*a*y,l=p*a*n+r*h*y,E=r*h*n-p*a*y;return [c,l,E,P]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s;}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if(this.propType==="unidimensional")e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i1e-5&&(this.v[i]=e,this._mdf=!0),i+=1;}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[];break}(!a[s]||a[s]&&!r)&&(a[s]=pointPool.newElement()),a[s][0]=t,a[s][1]=e;},ShapePath.prototype.setTripleAt=function(t,e,i,s,r,a,n,p){this.setXYAt(t,e,"v",n,p),this.setXYAt(i,s,"o",n,p),this.setXYAt(r,a,"i",n,p);},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,r=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),r=1);var a=this._length-1,n=this._length,p;for(p=r;p=ht[ht.length-1].t-this.offsetTime)k=ht[ht.length-1].s?ht[ht.length-1].s[0]:ht[ht.length-2].e[0],q=!0;else {for(var yt=_,D=ht.length-1,V=!0,S,R,tt;V&&(S=ht[yt],R=ht[yt+1],!(R.t-this.offsetTime>u));)yt=R.t-this.offsetTime)ut=1;else if(ug&&u>g)||(this._caching.lastIndex=_0||S>-1e-6&&S<0?s(S*R)/R:S}function V(){var S=this.props,R=D(S[0]),tt=D(S[1]),J=D(S[4]),Gt=D(S[5]),Vt=D(S[12]),Xt=D(S[13]);return "matrix("+R+","+tt+","+J+","+Gt+","+Vt+","+Xt+")"}return function(){this.reset=r,this.rotate=a,this.rotateX=n,this.rotateY=p,this.rotateZ=h,this.skew=P,this.skewFromAxis=c,this.shear=y,this.scale=l,this.setTransform=E,this.translate=b,this.transform=v,this.multiply=w,this.applyToPoint=k,this.applyToX=z,this.applyToY=q,this.applyToZ=W,this.applyToPointArray=Ct,this.applyToTriplePoints=ut,this.applyToPointStringified=ht,this.toCSS=yt,this.to2dCSS=V,this.clone=g,this.cloneFromProps=_,this.equals=f,this.inversePoints=gt,this.inversePoint=mt,this.getInverseMatrix=ot,this._t=this.transform,this.isIdentity=u,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset();}}();function _typeof$3(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(e){return typeof e}:_typeof$3=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(t)}var lottie={};function setLocation(t){setLocationHref(t);}function searchAnimations(){animationManager.searchAnimations();}function setSubframeRendering(t){setSubframeEnabled(t);}function setPrefix(t){setIdPrefix(t);}function loadAnimation(t){return animationManager.loadAnimation(t)}function setQuality(t){if(typeof t=="string")switch(t){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else !isNaN(t)&&t>1&&setDefaultCurveSegments(t);}function inBrowser(){return typeof navigator<"u"}function installPlugin(t,e){t==="expressions"&&setExpressionsPlugin(e);}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations());}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i"u"?"undefined":_typeof$3(exports))==="object"&&typeof module<"u")&&!(typeof define=="function"&&define.amd)&&(window.bodymovin=lottie);}catch(t){}var ShapeModifiers=function(){var t={},e={};t.registerModifier=i,t.getModifier=s;function i(r,a){e[r]||(e[r]=a);}function s(r,a,n){return new e[r](a,n)}return t}();function ShapeModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated();}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0);},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties());},extendPrototype([DynamicPropertyContainer],ShapeModifier);function TrimModifier(){}extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length;},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[];},TrimModifier.prototype.calculateShapeEdges=function(t,e,i,s,r){var a=[];e<=1?a.push({s:t,e}):t>=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n=[],p,h=a.length,y;for(p=0;ps+i)){var P,c;y.s*r<=s?P=0:P=(y.s*r-s)/i,y.e*r>=s+i?c=1:c=(y.e*r-s)/i,n.push([P,c]);}return n.length||n.push([0,0]),n},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e1?e=1+s:this.s.v<0?e=0+s:e=this.s.v+s,this.e.v>1?i=1+s:this.e.v<0?i=0+s:i=this.e.v+s,e>i){var r=e;e=i,i=r;}e=Math.round(e*1e4)*1e-4,i=Math.round(i*1e4)*1e-4,this.sValue=e,this.eValue=i;}else e=this.sValue,i=this.eValue;var a,n,p=this.shapes.length,h,y,P,c,l,E=0;if(i===e)for(n=0;n=0;n-=1)if(v=this.shapes[n],v.shape._mdf){for(w=v.localShapeCollection,w.releaseShapes(),this.m===2&&p>1?(_=this.calculateShapeEdges(e,i,v.totalShapeLength,g,E),g+=v.totalShapeLength):_=[[u,f]],y=_.length,h=0;h=1?b.push({s:v.totalShapeLength*(u-1),e:v.totalShapeLength*(f-1)}):(b.push({s:v.totalShapeLength*u,e:v.totalShapeLength}),b.push({s:0,e:v.totalShapeLength*(f-1)}));var k=this.addShapes(v,b[0]);if(b[0].s!==b[0].e){if(b.length>1){var z=v.shape.paths.shapes[v.shape.paths._length-1];if(z.c){var q=k.pop();this.addPaths(k,w),k=this.addShapes(v,b[1],q);}else this.addPaths(k,w),k=this.addShapes(v,b[1]);}this.addPaths(k,w);}}v.shape.paths=w;}}},TrimModifier.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;ie.e){i.c=!1;break}else e.s<=y&&e.e>=y+P.addedLength?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[p],r[a].v[p],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[p],r[a].o[p-1],r[a].i[p],(e.s-y)/P.addedLength,(e.e-y)/P.addedLength,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1),y+=P.addedLength,c+=1;if(r[a].c&&l.length){if(P=l[p-1],y<=e.e){var u=l[p-1].addedLength;e.s<=y&&e.e>=y+u?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[0],r[a].v[0],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[0],r[a].o[p-1],r[a].i[0],(e.s-y)/u,(e.e-y)/u,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1);}else i.c=!1;y+=P.addedLength,c+=1;}if(i._length&&(i.setXYAt(i.v[v][0],i.v[v][1],"i",v),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),y>e.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(P=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/y,0),c=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/y,0)):(P=this.p.pv,c=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/y,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){P=[],c=[];var l=this.px,E=this.py;l._caching.lastFrame+l.offsetTime<=l.keyframes[0].t?(P[0]=l.getValueAtTime((l.keyframes[0].t+.01)/y,0),P[1]=E.getValueAtTime((E.keyframes[0].t+.01)/y,0),c[0]=l.getValueAtTime(l.keyframes[0].t/y,0),c[1]=E.getValueAtTime(E.keyframes[0].t/y,0)):l._caching.lastFrame+l.offsetTime>=l.keyframes[l.keyframes.length-1].t?(P[0]=l.getValueAtTime(l.keyframes[l.keyframes.length-1].t/y,0),P[1]=E.getValueAtTime(E.keyframes[E.keyframes.length-1].t/y,0),c[0]=l.getValueAtTime((l.keyframes[l.keyframes.length-1].t-.01)/y,0),c[1]=E.getValueAtTime((E.keyframes[E.keyframes.length-1].t-.01)/y,0)):(P=[l.pv,E.pv],c[0]=l.getValueAtTime((l._caching.lastFrame+l.offsetTime-.01)/y,l.offsetTime),c[1]=E.getValueAtTime((E._caching.lastFrame+E.offsetTime-.01)/y,E.offsetTime));}else c=t,P=c;this.v.rotate(-Math.atan2(P[1]-c[1],P[0]-c[0]));}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);}this.frameId=this.elem.globalData.frameId;}}function s(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4);}function r(){}function a(h){this._addDynamicProperty(h),this.elem.addDynamicProperty(h),this._isDirty=!0;}function n(h,y,P){if(this.elem=h,this.frameId=-1,this.propType="transform",this.data=y,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(P||h),y.p&&y.p.s?(this.px=PropertyFactory.getProp(h,y.p.x,0,0,this),this.py=PropertyFactory.getProp(h,y.p.y,0,0,this),y.p.z&&(this.pz=PropertyFactory.getProp(h,y.p.z,0,0,this))):this.p=PropertyFactory.getProp(h,y.p||{k:[0,0,0]},1,0,this),y.rx){if(this.rx=PropertyFactory.getProp(h,y.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(h,y.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(h,y.rz,0,degToRads,this),y.or.k[0].ti){var c,l=y.or.k.length;for(c=0;c0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0);},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e0?Math.floor(l):Math.ceil(l),v=this.pMatrix.props,w=this.rMatrix.props,u=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var f=0;if(l>0){for(;fb;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),f-=1;E&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-E,!0),f-=E);}s=this.data.m===1?0:this._currentCopies-1,r=this.data.m===1?1:-1,a=this._currentCopies;for(var g,_;a;){if(e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,_=i.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),f!==0){for((s!==0&&r===1||s!==this._currentCopies-1&&r===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],w[8],w[9],w[10],w[11],w[12],w[13],w[14],w[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),g=0;g<_;g+=1)i[g]=this.matrix.props[g];this.matrix.reset();}else for(this.matrix.reset(),g=0;g<_;g+=1)i[g]=this.matrix.props[g];f+=1,a-=1,s+=r;}}else for(a=this._currentCopies,s=0,r=1;a;)e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,s+=r;return n},RepeaterModifier.prototype.addShape=function(){};function RoundCornersModifier(){}extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length;},RoundCornersModifier.prototype.processPath=function(t,e){var i=shapePool.newElement();i.c=t.c;var s,r=t._length,a,n,p,h,y,P,c=0,l,E,b,v,w,u;for(s=0;s0&&s<1?[e]:[]:[e-s,e+s].filter(function(r){return r>0&&r<1})},PolynomialBezier.prototype.split=function(t){if(t<=0)return [singlePoint(this.points[0]),this];if(t>=1)return [this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),i=lerpPoint(this.points[1],this.points[2],t),s=lerpPoint(this.points[2],this.points[3],t),r=lerpPoint(e,i,t),a=lerpPoint(i,s,t),n=lerpPoint(r,a,t);return [new PolynomialBezier(this.points[0],e,r,n,!0),new PolynomialBezier(n,a,s,this.points[3],!0)]};function extrema(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var r=s;s=i,i=r;}for(var a=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),n=0;n0&&a[n]<1){var p=t.point(a[n])[e];ps&&(s=p);}return {min:i,max:s}}PolynomialBezier.prototype.bounds=function(){return {x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return {left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}};function intersectData(t,e,i){var s=t.boundingBox();return {cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function splitData(t){var e=t.bez.split(.5);return [intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return Math.abs(t.cx-e.cx)*2=a||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s){r.push([t.t,e.t]);return}var n=splitData(t),p=splitData(e);intersectsImpl(n[0],p[0],i+1,s,r,a),intersectsImpl(n[0],p[1],i+1,s,r,a),intersectsImpl(n[1],p[0],i+1,s,r,a),intersectsImpl(n[1],p[1],i+1,s,r,a);}}PolynomialBezier.prototype.intersections=function(t,e,i){e===void 0&&(e=2),i===void 0&&(i=7);var s=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,s,i),s},PolynomialBezier.shapeSegment=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[i],t.v[i],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[i],t.i[i],t.o[e],t.v[e],!0)};function crossProduct(t,e){return [t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,i,s){var r=[t[0],t[1],1],a=[e[0],e[1],1],n=[i[0],i[1],1],p=[s[0],s[1],1],h=crossProduct(crossProduct(r,a),crossProduct(n,p));return floatZero(h[2])?null:[h[0]/h[2],h[1]/h[2]]}function polarOffset(t,e,i){return [t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0;};function setPoint(t,e,i,s,r,a,n){var p=i-Math.PI/2,h=i+Math.PI/2,y=e[0]+Math.cos(i)*s*r,P=e[1]-Math.sin(i)*s*r;t.setTripleAt(y,P,y+Math.cos(p)*a,P-Math.sin(p)*a,y+Math.cos(h)*n,P-Math.sin(h)*n,t.length());}function getPerpendicularVector(t,e){var i=[e[0]-t[0],e[1]-t[1]],s=-Math.PI*.5,r=[Math.cos(s)*i[0]-Math.sin(s)*i[1],Math.sin(s)*i[0]+Math.cos(s)*i[1]];return r}function getProjectingAngle(t,e){var i=e===0?t.length()-1:e-1,s=(e+1)%t.length(),r=t.v[i],a=t.v[s],n=getPerpendicularVector(r,a);return Math.atan2(0,1)-Math.atan2(n[1],n[0])}function zigZagCorner(t,e,i,s,r,a,n){var p=getProjectingAngle(e,i),h=e.v[i%e._length],y=e.v[i===0?e._length-1:i-1],P=e.v[(i+1)%e._length],c=a===2?Math.sqrt(Math.pow(h[0]-y[0],2)+Math.pow(h[1]-y[1],2)):0,l=a===2?Math.sqrt(Math.pow(h[0]-P[0],2)+Math.pow(h[1]-P[1],2)):0;setPoint(t,e.v[i%e._length],p,n,s,l/((r+1)*2),c/((r+1)*2));}function zigZagSegment(t,e,i,s,r,a){for(var n=0;n1&&e.length>1&&(r=getIntersection(t[0],e[e.length-1]),r)?[[t[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[i,s]}function pruneIntersections(t){for(var e,i=1;i1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var i=t.inflectionPoints(),s,r,a,n;if(i.length===0)return [offsetSegment(t,e)];if(i.length===1||floatEqual(i[1],1))return a=t.split(i[0]),s=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(r,e)];a=t.split(i[0]),s=a[0];var p=(i[1]-i[0])/(1-i[0]);return a=a[1].split(p),n=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(n,e),offsetSegment(r,e)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(t,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=this.amount.effectsSequence.length!==0;},OffsetPathModifier.prototype.processPath=function(t,e,i,s){var r=shapePool.newElement();r.c=t.c;var a=t.length();t.c||(a-=1);var n,p,h,y=[];for(n=0;n=0;n-=1)h=PolynomialBezier.shapeSegmentInverted(t,n),y.push(offsetSegmentSplit(h,e));y=pruneIntersections(y);var P=null,c=null;for(n=0;n0&&(Gt=!1),Gt){var Ht=createTag("style");Ht.setAttribute("f-forigin",S[R].fOrigin),Ht.setAttribute("f-origin",S[R].origin),Ht.setAttribute("f-family",S[R].fFamily),Ht.type="text/css",Ht.innerText="@font-face {font-family: "+S[R].fFamily+"; font-style: normal; src: url('"+S[R].fPath+"');}",V.appendChild(Ht);}}else if(S[R].fOrigin==="g"||S[R].origin===1){for(Vt=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),Xt=0;Xt=55296&&S<=56319){var R=D.charCodeAt(1);R>=56320&&R<=57343&&(V=(S-55296)*1024+R-56320+65536);}return V}function z(D,V){var S=D.toString(16)+V.toString(16);return c.indexOf(S)!==-1}function q(D){return D===h}function W(D){return D===p}function ot(D){var V=k(D);return V>=y&&V<=P}function mt(D){return ot(D.substr(0,2))&&ot(D.substr(2,2))}function gt(D){return i.indexOf(D)!==-1}function ut(D,V){var S=k(D.substr(V,2));if(S!==s)return !1;var R=0;for(V+=2;R<5;){if(S=k(D.substr(V,2)),Sn)return !1;R+=1,V+=2;}return k(D.substr(V,2))===r}function Ct(){this.isLoaded=!0;}var ht=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this);};ht.isModifier=z,ht.isZeroWidthJoiner=q,ht.isFlagEmoji=mt,ht.isRegionalCode=ot,ht.isCombinedCharacter=gt,ht.isRegionalFlag=ut,ht.isVariationSelector=W,ht.BLACK_FLAG_CODE_POINT=s;var yt={addChars:u,addFonts:w,getCharData:f,getFontByName:_,measureText:g,checkLoadedFonts:b,setIsLoaded:Ct};return ht.prototype=yt,ht}();function SlotManager(t){this.animationData=t;}SlotManager.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t};function slotFactory(t){return new SlotManager(t)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[];},addRenderableComponent:function(t){this.renderableComponents.indexOf(t)===-1&&this.renderableComponents.push(t);},removeRenderableComponent:function(t){this.renderableComponents.indexOf(t)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1);},prepareRenderableFrame:function(t){this.checkLayerLimits(t);},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show());},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide());},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0));},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1;},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1;},AudioElement.prototype.resume=function(){this._canPlay=!0;},AudioElement.prototype.setRate=function(t){this.audio.rate(t);},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume);},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(t){var e,i=this.layers.length,s;for(this.completeLayers=!0,e=i-1;e>=0;e-=1)this.elements[e]||(s=this.layers[e],s.ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements();},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",l),this.element.maskedElement.setAttribute(f,"url("+getLocationHref()+"#"+l+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this);}MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e=this.element.finalTransform.mat,i,s=this.masksProperties.length;for(i=0;i1&&(s+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==s){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+s:s),i.elem.setAttribute("d",n)),i.lastPath=s;}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null;};var filtersFactory=function(){var t={};t.createFilter=e,t.createAlphaToLuminanceFilter=i;function e(s,r){var a=createNS("filter");return a.setAttribute("id",s),r!==!0&&(a.setAttribute("filterUnits","objectBoundingBox"),a.setAttribute("x","0%"),a.setAttribute("y","0%"),a.setAttribute("width","100%"),a.setAttribute("height","100%")),a}function i(){var s=createNS("feColorMatrix");return s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),s}return t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return (/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(t){var e,i="SourceGraphic",s=t.data.ef?t.data.ef.length:0,r=createElementID(),a=filtersFactory.createFilter(r,!0),n=0;this.filters=[];var p;for(e=0;e=0&&(i=this.shapeModifiers[t].processShapes(this._isFirstFrame),!i);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i.01)return !1;i+=1;}return !0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return !1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t0;)u=l.transformers[ot].mProps._mdf||u,W-=1,ot-=1;if(u)for(W=k-l.styles[g].lvl,ot=l.transformers.length-1;W>0;)q.multiply(l.transformers[ot].mProps.v),W-=1,ot-=1;}else q=t;if(z=l.sh.paths,v=z._length,u){for(w="",b=0;b=1?Ct=.99:Ct<=-1&&(Ct=-.99);var ht=gt*Ct,yt=Math.cos(ut+l.a.v)*ht+w[0],D=Math.sin(ut+l.a.v)*ht+w[1];b.setAttribute("fx",yt),b.setAttribute("fy",D),v&&!l.g._collapsable&&(l.of.setAttribute("fx",yt),l.of.setAttribute("fy",D));}}}function P(c,l,E){var b=l.style,v=l.d;v&&(v._mdf||E)&&v.dashStr&&(b.pElem.setAttribute("stroke-dasharray",v.dashStr),b.pElem.setAttribute("stroke-dashoffset",v.dashoffset[0])),l.c&&(l.c._mdf||E)&&b.pElem.setAttribute("stroke","rgb("+bmFloor(l.c.v[0])+","+bmFloor(l.c.v[1])+","+bmFloor(l.c.v[2])+")"),(l.o._mdf||E)&&b.pElem.setAttribute("stroke-opacity",l.o.v),(l.w._mdf||E)&&(b.pElem.setAttribute("stroke-width",l.w.v),b.msElem&&b.msElem.setAttribute("stroke-width",l.w.v));}return i}();function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[];}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e=this.shapes.length,i,s,r=this.stylesList.length,a,n=[],p=!1;for(s=0;s1&&p&&this.setShapesAsAnimated(n);}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e=0;h-=1){if(w=this.searchProcessedElement(t[h]),w?e[h]=i[w-1]:t[h]._render=n,t[h].ty==="fl"||t[h].ty==="st"||t[h].ty==="gf"||t[h].ty==="gs"||t[h].ty==="no")w?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],r),t[h]._render&&e[h].style.pElem.parentNode!==s&&s.appendChild(e[h].style.pElem),l.push(e[h].style);else if(t[h].ty==="gr"){if(!w)e[h]=this.createGroupElement(t[h]);else for(c=e[h].it.length,P=0;P1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this);},TextProperty.prototype.getValue=function(t){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!t)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var s,r=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(s=0;se);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e=[],i=0,s=t.length,r,a,n=!1,p=!1,h="";i=55296&&r<=56319?FontManager.isRegionalFlag(t,i)?h=t.substr(i,14):(a=t.charCodeAt(i+1),a>=56320&&a<=57343&&(FontManager.isModifier(r,a)?(h=t.substr(i,2),n=!0):FontManager.isFlagEmoji(t.substr(i,4))?h=t.substr(i,4):h=t.substr(i,2))):r>56319?(a=t.charCodeAt(i+1),FontManager.isVariationSelector(r)&&(n=!0)):FontManager.isZeroWidthJoiner(r)&&(n=!0,p=!0),n?(e[e.length-1]+=h,n=!1):e.push(h),i+=h.length;return e},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e=this.elem.globalData.fontManager,i=this.data,s=[],r,a,n,p=0,h,y=i.m.g,P=0,c=0,l=0,E=[],b=0,v=0,w,u,f=e.getFontByName(t.f),g,_=0,k=getFontProperties(f);t.fWeight=k.weight,t.fStyle=k.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),a=t.finalText.length,t.finalLineHeight=t.lh;var z=t.tr/1e3*t.finalSize,q;if(t.sz)for(var W=!0,ot=t.sz[0],mt=t.sz[1],gt,ut;W;){ut=this.buildFinalText(t.t),gt=0,b=0,a=ut.length,z=t.tr/1e3*t.finalSize;var Ct=-1;for(r=0;rot&&ut[r]!==" "?(Ct===-1?a+=1:r=Ct,gt+=t.finalLineHeight||t.finalSize*1.2,ut.splice(r,Ct===r?1:0,"\r"),Ct=-1,b=0):(b+=_,b+=z);gt+=f.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&mtv?b:v,b=-2*z,h="",n=!0,l+=1):h=yt,e.chars?(g=e.getCharData(yt,f.fStyle,e.getFontByName(t.f).fFamily),_=n?0:g.w*t.finalSize/100):_=e.measureText(h,t.f,t.finalSize),yt===" "?ht+=_+z:(b+=_+z+ht,ht=0),s.push({l:_,an:_,add:P,n,anIndexes:[],val:h,line:l,animatorJustifyOffset:0}),y==2){if(P+=_,h===""||h===" "||r===a-1){for((h===""||h===" ")&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;p+=1,P=0;}}else if(y==3){if(P+=_,h===""||r===a-1){for(h===""&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;P=0,p+=1;}}else s[p].ind=p,s[p].extra=0,p+=1;if(t.l=s,v=b>v?b:v,E.push(b),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0;}t.lineWidths=E;var D=i.a,V,S;u=D.length;var R,tt,J=[];for(w=0;w0?n=this.ne.v/100:p=-this.ne.v/100,this.xe.v>0?h=1-this.xe.v/100:y=1+this.xe.v/100;var P=BezierFactory.getBezierEasing(n,p,h,y).get,c=0,l=this.finalS,E=this.finalE,b=this.data.sh;if(b===2)E===l?c=a>=E?1:0:c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===3)E===l?c=a>=E?0:1:c=1-t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===4)E===l?c=0:(c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c<.5?c*=2:c=1-2*(c-.5)),c=P(c);else if(b===5){if(E===l)c=0;else {var v=E-l;a=e(t(0,a+.5-l),E-l);var w=-v/2+a,u=v/2;c=Math.sqrt(1-w*w/(u*u));}c=P(c);}else b===6?(E===l?c=0:(a=e(t(0,a+.5-l),E-l),c=(1+Math.cos(Math.PI+Math.PI*2*a/(E-l)))/2),c=P(c)):(a>=i(l)&&(a-l<0?c=t(0,e(e(E,1)-(l-a),1)):c=t(0,e(E-a,1))),c=P(c));if(this.sm.v!==100){var f=this.sm.v*.01;f===0&&(f=1e-8);var g=.5-f*.5;c1&&(c=1));}return c*this.a.v},getValue:function(a){this.iterateDynamicProperties(),this._mdf=a||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,a&&this.data.r===2&&(this.e.v=this._currentTextLength);var n=this.data.r===2?1:100/this.data.totalChars,p=this.o.v/n,h=this.s.v/n+p,y=this.e.v/n+p;if(h>y){var P=h;h=y,y=P;}this.finalS=h,this.finalE=y;}},extendPrototype([DynamicPropertyContainer],s);function r(a,n,p){return new s(a,n)}return {getTextSelectorProp:r}}();function TextAnimatorDataProperty(t,e,i){var s={propType:!1},r=PropertyFactory.getProp,a=e.a;this.a={r:a.r?r(t,a.r,0,degToRads,i):s,rx:a.rx?r(t,a.rx,0,degToRads,i):s,ry:a.ry?r(t,a.ry,0,degToRads,i):s,sk:a.sk?r(t,a.sk,0,degToRads,i):s,sa:a.sa?r(t,a.sa,0,degToRads,i):s,s:a.s?r(t,a.s,1,.01,i):s,a:a.a?r(t,a.a,1,0,i):s,o:a.o?r(t,a.o,0,.01,i):s,p:a.p?r(t,a.p,1,0,i):s,sw:a.sw?r(t,a.sw,0,0,i):s,sc:a.sc?r(t,a.sc,1,0,i):s,fc:a.fc?r(t,a.fc,1,0,i):s,fh:a.fh?r(t,a.fh,0,0,i):s,fs:a.fs?r(t,a.fs,0,.01,i):s,fb:a.fb?r(t,a.fb,0,.01,i):s,t:a.t?r(t,a.t,0,0,i):s},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t;}function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i);}TextAnimatorProperty.prototype.searchProperties=function(){var t,e=this._textData.a.length,i,s=PropertyFactory.getProp;for(t=0;t=b+oe||!k?(ot=(b+oe-w)/v.partialLength,Xt=_.point[0]+(v.point[0]-_.point[0])*ot,Ht=_.point[1]+(v.point[1]-_.point[1])*ot,a.translate(-i[0]*l[P].an*.005,-(i[1]*ht)*.01),u=!1):k&&(w+=v.partialLength,f+=1,f>=k.length&&(f=0,g+=1,z[g]?k=z[g].points:gt.v.c?(f=0,g=0,k=z[g].points):(w-=v.partialLength,k=null)),k&&(_=v,v=k[f],q=v.partialLength));Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0);}else Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0),a.translate(-i[0]*l[P].an*.005,-i[1]*ht*.01,0);for(S=0;St?this.textSpans[t].span:createNS(p?"g":"text"),g<=t){if(h.setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=h,p){var k=createNS("g");h.appendChild(k),this.textSpans[t].childSpan=k;}this.textSpans[t].span=h,this.layerElement.appendChild(h);}h.style.display="inherit";}if(y.reset(),c&&(n[t].n&&(l=-v,E+=i.yOffset,E+=b?1:0,b=!1),this.applyTextPropertiesToMatrix(i,y,n[t].line,l,E),l+=n[t].l||0,l+=v),p){_=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily);var z;if(_.t===1)z=new SVGCompElement(_.data,this.globalData,this);else {var q=emptyShapeData;_.data&&_.data.shapes&&(q=this.buildShapeData(_.data,i.finalSize)),z=new SVGShapeElement(q,this.globalData,this);}if(this.textSpans[t].glyph){var W=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(W.layerElement),W.destroy();}this.textSpans[t].glyph=z,z._debug=!0,z.prepareFrame(0),z.renderFrame(),this.textSpans[t].childSpan.appendChild(z.layerElement),_.t===1&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")");}else c&&h.setAttribute("transform","translate("+y.props[12]+","+y.props[13]+")"),h.textContent=n[t].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");}c&&h&&h.setAttribute("d",P);}for(;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0));}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t=0;i-=1)t.finalTransform.multiply(t.transforms[i].transform.mProps.v);t._mdf=r;},processSequences:function(t){var e,i=this.sequenceList.length;for(e=0;e=1){this.buffers=[];var t=this.globalData.canvasContext,e=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(e);var i=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(i),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas();}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms();},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e;}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0);},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0);},clearCanvas:function(t){t.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy);},prepareLayer:function(){if(this.data.tt>=1){var t=this.buffers[0],e=t.getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);}},exitLayer:function(){if(this.data.tt>=1){var t=this.buffers[1],e=t.getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var i=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(i.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var s=assetLoader.getLumaCanvas(this.canvasContext.canvas),r=s.getContext("2d");r.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(s,0,0);}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(t,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over";}},renderFrame:function(t){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!t)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var e=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(e),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(e),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1);}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy();},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(t,e,i,s){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var r=4;e.ty==="rc"?r=5:e.ty==="el"?r=6:e.ty==="sr"&&(r=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,r,t);var a,n=i.length,p;for(a=0;a=0;a-=1){if(c=this.searchProcessedElement(t[a]),c?e[a]=i[c-1]:t[a]._shouldRender=s,t[a].ty==="fl"||t[a].ty==="st"||t[a].ty==="gf"||t[a].ty==="gs")c?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],b),y.push(e[a].style);else if(t[a].ty==="gr"){if(!c)e[a]=this.createGroupElement(t[a]);else for(h=e[a].it.length,p=0;p=0;r-=1)e[r].ty==="tr"?(n=i[r].transform,this.renderShapeTransform(t,n)):e[r].ty==="sh"||e[r].ty==="el"||e[r].ty==="rc"||e[r].ty==="sr"?this.renderPath(e[r],i[r]):e[r].ty==="fl"?this.renderFill(e[r],i[r],n):e[r].ty==="st"?this.renderStroke(e[r],i[r],n):e[r].ty==="gf"||e[r].ty==="gs"?this.renderGradientFill(e[r],i[r],n):e[r].ty==="gr"?this.renderShape(n,e[r].it,i[r].it):e[r].ty;s&&this.drawLayer();},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var i=t.trNodes,s=e.paths,r,a,n,p=s._length;i.length=0;var h=t.transforms.finalTransform;for(n=0;n=1?P=.99:P<=-1&&(P=-.99);var c=h*P,l=Math.cos(y+e.a.v)*c+n[0],E=Math.sin(y+e.a.v)*c+n[1];r=a.createRadialGradient(l,E,0,n[0],n[1],h);}var b,v=t.g.p,w=e.g.c,u=1;for(b=0;ba&&h==="xMidYMid slice"||rr&&p==="meet"||ar&&p==="slice")?this.transformCanvas.tx=(i-this.transformCanvas.w*(s/this.transformCanvas.h))/2*this.renderConfig.dpr:y==="xMax"&&(ar&&p==="slice")?this.transformCanvas.tx=(i-this.transformCanvas.w*(s/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,P==="YMid"&&(a>r&&p==="meet"||ar&&p==="meet"||a=0;t-=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0;},CanvasRendererBase.prototype.renderFrame=function(t,e){if(!(this.renderedFrame===t&&this.renderConfig.clearCanvas===!0&&!e||this.destroyed||t===-1)){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var i,s=this.layers.length;for(this.completeLayers||this.checkLayers(t),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].prepareFrame(t-this.layers[i].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore();}}},CanvasRendererBase.prototype.buildItem=function(t){var e=this.elements;if(!(e[t]||this.layers[t].ty===99)){var i=this.createItem(this.layers[t],this,this.globalData);e[t]=i,i.initExpressions();}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();t.checkParenting();}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none";},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block";};function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random();}function CVContextData(){this.stack=[],this.cArrPos=0,this.cTr=new Matrix;var t,e=15;for(t=0;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame();},CVCompElement.prototype.destroy=function(){var t,e=this.layers.length;for(t=e-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null;},CVCompElement.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)};function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:e&&e.clearCanvas!==void 0?e.clearCanvas:!0,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",className:e&&e.className||"",id:e&&e.id||"",runExpressions:!e||e.runExpressions===void 0||e.runExpressions},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData));}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)};function HBaseElement(){}HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement);},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.bm!==0&&this.setBlendMode();},renderElement:function(){var t=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var e=this.finalTransform.mat.toCSS();t.transform=e,t.webkitTransform=e;}this.finalTransform._opMdf&&(t.opacity=this.finalTransform.mProp.o.v);},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1));},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null);},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData);},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting;function HSolidElement(t,e,i){this.initElement(t,e,i);}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?(t=createNS("rect"),t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):(t=createTag("div"),t.style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t);};function HShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(t,e,i),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0};}extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else {t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t);}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t;},HShapeElement.prototype.getTransformedPoint=function(t,e){var i,s=t.length;for(i=0;i0&&h<1&&r[l].push(this.calculateF(h,t,e,i,s,l))):(y=n*n-4*p*a,y>=0&&(P=(-n+bmSqrt(y))/(2*a),P>0&&P<1&&r[l].push(this.calculateF(P,t,e,i,s,l)),c=(-n-bmSqrt(y))/(2*a),c>0&&c<1&&r[l].push(this.calculateF(c,t,e,i,s,l)))));this.shapeBoundingBox.left=bmMin.apply(null,r[0]),this.shapeBoundingBox.top=bmMin.apply(null,r[1]),this.shapeBoundingBox.right=bmMax.apply(null,r[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,r[1]);},HShapeElement.prototype.calculateF=function(t,e,i,s,r,a){return bmPow(1-t,3)*e[a]+3*bmPow(1-t,2)*t*i[a]+3*(1-t)*bmPow(t,2)*s[a]+bmPow(t,3)*r[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var i,s=t.length;for(i=0;ii&&(i=r);}i*=t.mult;}else i=t.v*t.mult;e.x-=i,e.xMax+=i,e.y-=i,e.yMax+=i;},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax=0;e-=1){var s=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-s.p.v[0],-s.p.v[1],s.p.v[2]),this.mat.rotateX(-s.or.v[0]).rotateY(-s.or.v[1]).rotateZ(s.or.v[2]),this.mat.rotateX(-s.rx.v).rotateY(-s.ry.v).rotateZ(s.rz.v),this.mat.scale(1/s.s.v[0],1/s.s.v[1],1/s.s.v[2]),this.mat.translate(s.a.v[0],s.a.v[1],s.a.v[2]);}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var r;this.p?r=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:r=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)),n=[r[0]/a,r[1]/a,r[2]/a],p=Math.sqrt(n[2]*n[2]+n[0]*n[0]),h=Math.atan2(n[1],p),y=Math.atan2(n[0],-n[2]);this.mat.rotateY(y).rotateX(-h);}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var P=!this._prevMat.equals(this.mat);if((P||this.pe._mdf)&&this.comp.threeDElements){i=this.comp.threeDElements.length;var c,l,E;for(e=0;e=t)return this.threeDElements[e].perspectiveElem;e+=1;}return null},HybridRendererBase.prototype.createThreeDContainer=function(t,e){var i=createTag("div"),s,r;styleDiv(i);var a=createTag("div");if(styleDiv(a),e==="3d"){s=i.style,s.width=this.globalData.compSize.w+"px",s.height=this.globalData.compSize.h+"px";var n="50% 50%";s.webkitTransformOrigin=n,s.mozTransformOrigin=n,s.transformOrigin=n,r=a.style;var p="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";r.transform=p,r.webkitTransform=p;}i.appendChild(a);var h={container:a,perspectiveElem:i,startPos:t,endPos:t,type:e};return this.threeDElements.push(h),h},HybridRendererBase.prototype.build3dContainers=function(){var t,e=this.layers.length,i,s="";for(t=0;t=0;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem);},HybridRendererBase.prototype.addTo3dContainer=function(t,e){for(var i=0,s=this.threeDElements.length;ii?(r=t/this.globalData.compSize.w,a=t/this.globalData.compSize.w,n=0,p=(e-this.globalData.compSize.h*(t/this.globalData.compSize.w))/2):(r=e/this.globalData.compSize.h,a=e/this.globalData.compSize.h,n=(t-this.globalData.compSize.w*(e/this.globalData.compSize.h))/2,p=0);var h=this.resizerElem.style;h.webkitTransform="matrix3d("+r+",0,0,0,0,"+a+",0,0,0,0,1,0,"+n+","+p+",0,1)",h.transform=h.webkitTransform;},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none";},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block";},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else {var t=this.globalData.compSize.w,e=this.globalData.compSize.h,i,s=this.threeDElements.length;for(i=0;i=y;)mt/=2,gt/=2,ut>>>=1;return (mt+ut)/gt};return ot.int32=function(){return W.g(4)|0},ot.quick=function(){return W.g(4)/4294967296},ot.double=ot,w(f(W.S),t),(_.pass||k||function(mt,gt,ut,Ct){return Ct&&(Ct.S&&b(Ct,W),mt.state=function(){return b(W,{})}),ut?(e[n]=mt,gt):mt})(ot,q,"global"in _?_.global:this==e,_.state)}e["seed"+n]=l;function E(g){var _,k=g.length,z=this,q=0,W=z.i=z.j=0,ot=z.S=[];for(k||(g=[k++]);qi){var s=i;i=e,e=s;}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if(typeof t=="number"||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var i,s=Math.min(t.length,e.length),r=0;for(i=0;i.5?y/(2-r-a):y/(r+a),r){case e:n=(i-s)/y+(i1&&(i-=1),i<1/6?t+(e-t)*6*i:i<1/2?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e=t[0],i=t[1],s=t[2],r,a,n;if(i===0)r=s,n=s,a=s;else {var p=s<.5?s*(1+i):s+i-s*i,h=2*s-p;r=hue2rgb(h,p,e+1/3),a=hue2rgb(h,p,e),n=hue2rgb(h,p,e-1/3);}return [r,a,n,t[3]]}function linear(t,e,i,s,r){if((s===void 0||r===void 0)&&(s=e,r=i,e=0,i=1),i=i)return r;var n=i===e?0:(t-e)/(i-e);if(!s.length)return s+(r-s)*n;var p,h=s.length,y=createTypedArray("float32",h);for(p=0;p1){for(r=0;r1?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(r)){var p,h=r.length,y=createTypedArray("float32",h);for(p=0;pdata.k[e].t&&tdata.k[e+1].t-t?(s=e+2,r=data.k[e+1].t):(s=e+1,r=data.k[e].t);break}s===-1&&(s=e+1,r=data.k[e].t);}var a={};return a.index=s,a.time=r/elem.comp.globalData.frameRate,a}function key(t){var e,i,s;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(s=r.length,i=0;iw.length-1)&&(E=w.length-1),g=w[w.length-1-E].t,f=u-g);var _,k,z;if(l==="pingpong"){var q=Math.floor((v-g)/f);if(q%2!==0)return this.getValueAtTime((f-(v-g)%f+g)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(g/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(u/this.comp.globalData.frameRate,0),mt=this.getValueAtTime(((v-g)%f+g)/this.comp.globalData.frameRate,0),gt=Math.floor((v-g)/f);if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_=u)return this.pv;var f,g;b?(E?f=Math.abs(this.elem.comp.globalData.frameRate*E):f=Math.max(0,this.elem.data.op-u),g=u+f):((!E||E>w.length-1)&&(E=w.length-1),g=w[E].t,f=g-u);var _,k,z;if(l==="pingpong"){var q=Math.floor((u-v)/f);if(q%2===0)return this.getValueAtTime(((u-v)%f+u)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(u/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(g/this.comp.globalData.frameRate,0),mt=this.getValueAtTime((f-(u-v)%f+u)/this.comp.globalData.frameRate,0),gt=Math.floor((u-v)/f)+1;if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_1?(w-v)/(E-1):1,f=0,g=0,_;this.pv.length?_=createTypedArray("float32",this.pv.length):_=0;for(var k;fu){var z=f,q=b.c&&f===g-1?0:f+1,W=(u-_)/w[f].addedLength;k=bez.getPointInSegment(b.v[z],b.v[q],b.o[z],b.i[q],W,w[f]);break}else _+=w[f].addedLength;f+=1;}return k||(k=b.c?[b.v[0][0],b.v[0][1]]:[b.v[b._length-1][0],b.v[b._length-1][1]]),k},vectorOnPath:function(l,E,b){l==1?l=this.v.c:l==0&&(l=.999);var v=this.pointOnPath(l,E),w=this.pointOnPath(l+.001,E),u=w[0]-v[0],f=w[1]-v[1],g=Math.sqrt(Math.pow(u,2)+Math.pow(f,2));if(g===0)return [0,0];var _=b==="tangent"?[u/g,f/g]:[-f/g,u/g];return _},tangentOnPath:function(l,E){return this.vectorOnPath(l,E,"tangent")},normalOnPath:function(l,E){return this.vectorOnPath(l,E,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([P],h),extendPrototype([P],y),y.prototype.getValueAtTime=p,y.prototype.initiateExpression=ExpressionManager.initiateExpression;var c=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(l,E,b,v,w){var u=c(l,E,b,v,w);return u.propertyIndex=E.ix,u.lock=!1,b===3?expressionHelpers.searchExpressions(l,E.pt,u):b===4&&expressionHelpers.searchExpressions(l,E.ks,u),u.k&&l.addDynamicProperty(u),u};}function initialize$1(){addPropertyDecorator();}function addDecorator(){function t(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(e,i){var s=this.calculateExpression(i);if(e.t!==s){var r={};return this.copyData(r,e),r.t=s.toString(),r.__complete=!1,r}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),i=this.searchExpressions();return this.kf=e||i,this.kf},TextProperty.prototype.searchExpressions=t;}function initialize(){addDecorator();}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function t(e,i){var s=createNS("feMerge");s.setAttribute("result",e);var r,a;for(a=0;a=y?c=b<0?s:r:c=s+E*Math.pow((p-t)/b,1/i),P[l]=c,l+=1,a+=256/(n-1);return P.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e));}};function SVGDropShadowEffect(t,e,i,s,r){var a=e.container.globalData.renderConfig.filterSize,n=e.data.fs||a;t.setAttribute("x",n.x||a.x),t.setAttribute("y",n.y||a.y),t.setAttribute("width",n.width||a.width),t.setAttribute("height",n.height||a.height),this.filterManager=e;var p=createNS("feGaussianBlur");p.setAttribute("in","SourceAlpha"),p.setAttribute("result",s+"_drop_shadow_1"),p.setAttribute("stdDeviation","0"),this.feGaussianBlur=p,t.appendChild(p);var h=createNS("feOffset");h.setAttribute("dx","25"),h.setAttribute("dy","0"),h.setAttribute("in",s+"_drop_shadow_1"),h.setAttribute("result",s+"_drop_shadow_2"),this.feOffset=h,t.appendChild(h);var y=createNS("feFlood");y.setAttribute("flood-color","#00ff00"),y.setAttribute("flood-opacity","1"),y.setAttribute("result",s+"_drop_shadow_3"),this.feFlood=y,t.appendChild(y);var P=createNS("feComposite");P.setAttribute("in",s+"_drop_shadow_3"),P.setAttribute("in2",s+"_drop_shadow_2"),P.setAttribute("operator","in"),P.setAttribute("result",s+"_drop_shadow_4"),t.appendChild(P);var c=this.createMergeNode(s,[s+"_drop_shadow_4",r]);t.appendChild(c);}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(e[0]*255),Math.round(e[1]*255),Math.round(e[2]*255)));}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,s=(this.filterManager.effectElements[2].p.v-90)*degToRads,r=i*Math.cos(s),a=i*Math.sin(s);this.feOffset.setAttribute("dx",r),this.feOffset.setAttribute("dy",a);}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=i,i.matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement;}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,i=_svgMatteSymbols.length;ez.timeCompleted&&(q.animInstance.currentFrame=z.timeCompleted);}}(),p=function(){return function(z){var q=s[z.id],W=q.container,ot=q.elements;a(z.tree,W,ot);}}();function h(z,q){for(var W,ot=0;ot"u"?(W.canvas=ut,W.instructionsHandler=E(ut)):(ut instanceof OffscreenCanvas||(ht=ut.transferControlToOffscreen(),mt.rendererSettings.canvas=ht),gt.push(ht));}s[q]=W,t.postMessage({type:"load",payload:{params:mt,id:q}},gt);}),ot}var k={loadAnimation:_};return k}();return lottie});}),yc=gc();});var vl={};fr(vl,{default:()=>bc});var vc,bc,bl=ls(()=>{qs();vc=is((t,e)=>{typeof navigator<"u"&&function(i,s){typeof t=="object"&&typeof e<"u"?e.exports=s():typeof define=="function"&&define.amd?define(s):(i=typeof globalThis<"u"?globalThis:i||self,i.lottie=s());}(t,function(){var i="http://www.w3.org/2000/svg",s="",r=!1,a=-999999,n=function(A){r=!!A;},p=function(){return r},h=function(A){s=A;},y=function(){return s};function P(A){return document.createElement(A)}function c(A,F){var j,U=A.length,at;for(j=0;j1?j[1]=1:j[1]<=0&&(j[1]=0),R(j[0],j[1],j[2])}function Gt(A,F){var j=tt(A[0]*255,A[1]*255,A[2]*255);return j[2]+=F,j[2]>1?j[2]=1:j[2]<0&&(j[2]=0),R(j[0],j[1],j[2])}function Vt(A,F){var j=tt(A[0]*255,A[1]*255,A[2]*255);return j[0]+=F/360,j[0]>1?j[0]-=1:j[0]<0&&(j[0]+=1),R(j[0],j[1],j[2])}(function(){var A=[],F,j;for(F=0;F<256;F+=1)j=F.toString(16),A[F]=j.length===1?"0"+j:j;return function(U,at,it){return U<0&&(U=0),at<0&&(at=0),it<0&&(it=0),"#"+A[U]+A[at]+A[it]}})();var Xt=function(A){w=!!A;},Ht=function(){return w},Qt=function(A){u=A;},Zt=function(){return u},ne=function(A){W=A;},ue=function(){return W},pe=function(A){f=A;};function Wt(A){return document.createElementNS(i,A)}function fe(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(F){return typeof F}:fe=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},fe(A)}var jt=function(){var A=1,F=[],j,U,at={onmessage:function(){},postMessage:function(St){j({data:St});}},it={postMessage:function(St){at.onmessage({data:St});}};function vt(St){if(window.Worker&&window.Blob&&p()){var m=new Blob(["var _workerSelf = self; self.onmessage = ",St.toString()],{type:"text/javascript"}),C=URL.createObjectURL(m);return new Worker(C)}return j=St,at}function Mt(){U||(U=vt(function(St){function m(){function T(et,X){var $,Y,N=et.length,rt,nt,K,ft;for(Y=0;Y=0;X-=1)if(et[X].ty==="sh")if(et[X].ks.k.i)d(et[X].ks.k);else for(N=et[X].ks.k.length,Y=0;Y$[0]?!0:$[0]>et[0]?!1:et[1]>$[1]?!0:$[1]>et[1]?!1:et[2]>$[2]?!0:$[2]>et[2]?!1:null}var M=function(){var et=[4,4,14];function X(Y){var N=Y.t.d;Y.t.d={k:[{s:N,t:0}]};}function $(Y){var N,rt=Y.length;for(N=0;N=0;N-=1)if(Y[N].ty==="sh")if(Y[N].ks.k.i)Y[N].ks.k.c=Y[N].closed;else for(K=Y[N].ks.k.length,nt=0;nt500)&&(this._imageLoaded(),clearInterval(o)),O+=1;}.bind(this),50);}function it(G){var O=U(G,this.assetsPath,this.path),o=Wt("image");g?this.testImageLoaded(o):o.addEventListener("load",this._imageLoaded,!1),o.addEventListener("error",function(){d.img=A,this._imageLoaded();}.bind(this),!1),o.setAttributeNS("http://www.w3.org/1999/xlink","href",O),this._elementHelper.append?this._elementHelper.append(o):this._elementHelper.appendChild(o);var d={img:o,assetData:G};return d}function vt(G){var O=U(G,this.assetsPath,this.path),o=P("img");o.crossOrigin="anonymous",o.addEventListener("load",this._imageLoaded,!1),o.addEventListener("error",function(){d.img=A,this._imageLoaded();}.bind(this),!1),o.src=O;var d={img:o,assetData:G};return d}function Mt(G){var O={assetData:G},o=U(G,this.assetsPath,this.path);return jt.loadData(o,function(d){O.img=d,this._footageLoaded();}.bind(this),function(){O.img={},this._footageLoaded();}.bind(this)),O}function bt(G,O){this.imagesLoadedCb=O;var o,d=G.length;for(o=0;othis.animationData.op&&(this.animationData.op=A.op,this.totalFrames=Math.floor(A.op-this.animationData.ip));var F=this.animationData.layers,j,U=F.length,at=A.layers,it,vt=at.length;for(it=0;itthis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},Jt.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(A){this.triggerRenderFrameError(A);}},Jt.prototype.play=function(A){A&&this.name!==A||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},Jt.prototype.pause=function(A){A&&this.name!==A||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},Jt.prototype.togglePause=function(A){A&&this.name!==A||(this.isPaused===!0?this.play():this.pause());},Jt.prototype.stop=function(A){A&&this.name!==A||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},Jt.prototype.getMarkerData=function(A){for(var F,j=0;j=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(F>this.totalFrames?F%this.totalFrames:0)||(j=!0,F=this.totalFrames-1):F>=this.totalFrames?(this.playCount+=1,this.checkSegments(F%this.totalFrames)||(this.setCurrentRawFrameValue(F%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(F):F<0?this.checkSegments(F%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+F%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(j=!0,F=0)):this.setCurrentRawFrameValue(F),j&&(this.setCurrentRawFrameValue(F),this.pause(),this.trigger("complete"));}},Jt.prototype.adjustSegment=function(A,F){this.playCount=0,A[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=A[0]-A[1],this.timeCompleted=this.totalFrames,this.firstFrame=A[1],this.setCurrentRawFrameValue(this.totalFrames-.001-F)):A[1]>A[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=A[1]-A[0],this.timeCompleted=this.totalFrames,this.firstFrame=A[0],this.setCurrentRawFrameValue(.001+F)),this.trigger("segmentStart");},Jt.prototype.setSegment=function(A,F){var j=-1;this.isPaused&&(this.currentRawFrame+this.firstFrameF&&(j=F-A)),this.firstFrame=A,this.totalFrames=F-A,this.timeCompleted=this.totalFrames,j!==-1&&this.goToAndStop(j,!0);},Jt.prototype.playSegments=function(A,F){if(F&&(this.segments.length=0),_e(A[0])==="object"){var j,U=A.length;for(j=0;j=0;Y-=1)F[Y].animation.destroy($);}function I($,Y,N){var rt=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),nt,K=rt.length;for(nt=0;nt0?d=I:o=I;while(Math.abs(L)>it&&++H=at?B(O,Q,o,d):Z===0?Q:T(O,M,M+bt,o,d)}},A}(),oe=function(){function A(F){return F.concat(v(F.length))}return {double:A}}(),xe=function(){return function(A,F,j){var U=0,at=A,it=v(at),vt={newElement:Mt,release:bt};function Mt(){var Bt;return U?(U-=1,Bt=it[U]):Bt=F(),Bt}function bt(Bt){U===at&&(it=oe.double(it),at*=2),j&&j(Bt),it[U]=Bt,U+=1;}return vt}}(),ei=function(){function A(){return {addedLength:0,percents:b("float32",ue()),lengths:b("float32",ue())}}return xe(8,A)}(),Je=function(){function A(){return {lengths:[],totalLength:0}}function F(j){var U,at=j.lengths.length;for(U=0;U-.001&&O<.001}function j(St,m,C,T,B,G,O,o,d){if(C===0&&G===0&&d===0)return F(St,m,T,B,O,o);var x=A.sqrt(A.pow(T-St,2)+A.pow(B-m,2)+A.pow(G-C,2)),M=A.sqrt(A.pow(O-St,2)+A.pow(o-m,2)+A.pow(d-C,2)),L=A.sqrt(A.pow(O-T,2)+A.pow(o-B,2)+A.pow(d-G,2)),I;return x>M?x>L?I=x-M-L:I=L-M-x:L>M?I=L-M-x:I=M-x-L,I>-1e-4&&I<1e-4}var U=function(){return function(St,m,C,T){var B=ue(),G,O,o,d,x,M=0,L,I=[],H=[],Q=ei.newElement();for(o=C.length,G=0;GO?-1:1,x=!0;x;)if(T[G]<=O&&T[G+1]>O?(o=(O-T[G])/(T[G+1]-T[G]),x=!1):G+=d,G<0||G>=B-1){if(G===B-1)return C[G];x=!1;}return C[G]+(C[G+1]-C[G])*o}function Bt(St,m,C,T,B,G){var O=bt(B,G),o=1-O,d=A.round((o*o*o*St[0]+(O*o*o+o*O*o+o*o*O)*C[0]+(O*O*o+o*O*O+O*o*O)*T[0]+O*O*O*m[0])*1e3)/1e3,x=A.round((o*o*o*St[1]+(O*o*o+o*O*o+o*o*O)*C[1]+(O*O*o+o*O*O+O*o*O)*T[1]+O*O*O*m[1])*1e3)/1e3;return [d,x]}var It=b("float32",8);function Nt(St,m,C,T,B,G,O){B<0?B=0:B>1&&(B=1);var o=bt(B,O);G=G>1?1:G;var d=bt(G,O),x,M=St.length,L=1-o,I=1-d,H=L*L*L,Q=o*L*L*3,Z=o*o*L*3,st=o*o*o,pt=L*L*I,et=o*L*I+L*o*I+L*L*d,X=o*o*I+L*o*d+o*L*d,$=o*o*d,Y=L*I*I,N=o*I*I+L*d*I+L*I*d,rt=o*d*I+L*d*d+o*I*d,nt=o*d*d,K=I*I*I,ft=d*I*I+I*d*I+I*I*d,dt=d*d*I+I*d*d+d*I*d,xt=d*d*d;for(x=0;x=Bt.t-j){bt.h&&(bt=Bt),at=0;break}if(Bt.t-j>A){at=it;break}it=G||A=G?d.points.length-1:0;for(St=d.points[x].point.length,Nt=0;Nt=I&&M=G)U[0]=o[0],U[1]=o[1],U[2]=o[2];else if(A<=O)U[0]=bt.s[0],U[1]=bt.s[1],U[2]=bt.s[2];else {var et=Rr(bt.s),X=Rr(o),$=(A-O)/(G-O);sa(U,ia(et,X,$));}else for(it=0;it=G?m=1:A1e-6?(St=Math.acos(m),C=Math.sin(St),T=Math.sin((1-j)*St)/C,B=Math.sin(j*St)/C):(T=1-j,B=j),U[0]=T*at+B*bt,U[1]=T*it+B*Bt,U[2]=T*vt+B*It,U[3]=T*Mt+B*Nt,U}function sa(A,F){var j=F[0],U=F[1],at=F[2],it=F[3],vt=Math.atan2(2*U*it-2*j*at,1-2*U*U-2*at*at),Mt=Math.asin(2*j*U+2*at*it),bt=Math.atan2(2*j*it-2*U*at,1-2*j*j-2*at*at);A[0]=vt/ot,A[1]=Mt/ot,A[2]=bt/ot;}function Rr(A){var F=A[0]*ot,j=A[1]*ot,U=A[2]*ot,at=Math.cos(F/2),it=Math.cos(j/2),vt=Math.cos(U/2),Mt=Math.sin(F/2),bt=Math.sin(j/2),Bt=Math.sin(U/2),It=at*it*vt-Mt*bt*Bt,Nt=Mt*bt*vt+at*it*Bt,St=Mt*it*vt+at*bt*Bt,m=at*bt*vt-Mt*it*Bt;return [Nt,St,m,It]}function Br(){var A=this.comp.renderedFrame-this.offsetTime,F=this.keyframes[0].t-this.offsetTime,j=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(A===this._caching.lastFrame||this._caching.lastFrame!==qi&&(this._caching.lastFrame>=j&&A>=j||this._caching.lastFrame=A&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var U=this.interpolateValue(A,this._caching);this.pv=U;}return this._caching.lastFrame=A,this.pv}function Ts(A){var F;if(this.propType==="unidimensional")F=A*this.mult,Zi(this.v-F)>1e-5&&(this.v=F,this._mdf=!0);else for(var j=0,U=this.v.length;j1e-5&&(this.v[j]=F,this._mdf=!0),j+=1;}function Ms(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var A,F=this.effectsSequence.length,j=this.kf?this.pv:this.data.k;for(A=0;A=this._maxLength&&this.doubleArrayLength(),j){case"v":it=this.v;break;case"i":it=this.i;break;case"o":it=this.o;break;default:it=[];break}(!it[U]||it[U]&&!at)&&(it[U]=Kt.newElement()),it[U][0]=A,it[U][1]=F;},Re.prototype.setTripleAt=function(A,F,j,U,at,it,vt,Mt){this.setXYAt(A,F,"v",vt,Mt),this.setXYAt(j,U,"o",vt,Mt),this.setXYAt(at,it,"i",vt,Mt);},Re.prototype.reverse=function(){var A=new Re;A.setPathData(this.c,this._length);var F=this.v,j=this.o,U=this.i,at=0;this.c&&(A.setTripleAt(F[0][0],F[0][1],U[0][0],U[0][1],j[0][0],j[0][1],0,!1),at=1);var it=this._length-1,vt=this._length,Mt;for(Mt=at;Mt=et[et.length-1].t-this.offsetTime)x=et[et.length-1].s?et[et.length-1].s[0]:et[et.length-2].e[0],L=!0;else {for(var X=d,$=et.length-1,Y=!0,N,rt,nt;Y&&(N=et[X],rt=et[X+1],!(rt.t-this.offsetTime>G));)X<$-1?X+=1:Y=!1;if(nt=this.keyframesMetadata[X]||{},L=N.h===1,d=X,!L){if(G>=rt.t-this.offsetTime)st=1;else if(Go&&G>o)||(this._caching.lastIndex=d0||N>-1e-6&&N<0?U(N*rt)/rt:N}function Y(){var N=this.props,rt=$(N[0]),nt=$(N[1]),K=$(N[4]),ft=$(N[5]),dt=$(N[12]),xt=$(N[13]);return "matrix("+rt+","+nt+","+K+","+ft+","+dt+","+xt+")"}return function(){this.reset=at,this.rotate=it,this.rotateX=vt,this.rotateY=Mt,this.rotateZ=bt,this.skew=It,this.skewFromAxis=Nt,this.shear=Bt,this.scale=St,this.setTransform=m,this.translate=C,this.transform=T,this.multiply=B,this.applyToPoint=x,this.applyToX=M,this.applyToY=L,this.applyToZ=I,this.applyToPointArray=pt,this.applyToTriplePoints=st,this.applyToPointStringified=et,this.toCSS=X,this.to2dCSS=Y,this.clone=o,this.cloneFromProps=d,this.equals=O,this.inversePoints=Z,this.inversePoint=Q,this.getInverseMatrix=H,this._t=this.transform,this.isIdentity=G,this._identity=!0,this._identityCalculated=!1,this.props=b("float32",16),this.reset();}}();function ms(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ms=function(F){return typeof F}:ms=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},ms(A)}var se={};function gr(A){h(A);}function Oe(){te.searchAnimations();}function Ta(A){Xt(A);}function ra(A){pe(A);}function Ma(A){return te.loadAnimation(A)}function wa(A){if(typeof A=="string")switch(A){case"high":ne(200);break;default:case"medium":ne(50);break;case"low":ne(10);break}else !isNaN(A)&&A>1&&ne(A);}function Da(){return typeof navigator<"u"}function Fa(A,F){A==="expressions"&&Qt(F);}function Ia(A){switch(A){case"propertyFactory":return Yt;case"shapePropertyFactory":return ss;case"matrix":return Ce;default:return null}}se.play=te.play,se.pause=te.pause,se.setLocationHref=gr,se.togglePause=te.togglePause,se.setSpeed=te.setSpeed,se.setDirection=te.setDirection,se.stop=te.stop,se.searchAnimations=Oe,se.registerAnimation=te.registerAnimation,se.loadAnimation=Ma,se.setSubframeRendering=Ta,se.resize=te.resize,se.goToAndStop=te.goToAndStop,se.destroy=te.destroy,se.setQuality=wa,se.inBrowser=Da,se.installPlugin=Fa,se.freeze=te.freeze,se.unfreeze=te.unfreeze,se.setVolume=te.setVolume,se.mute=te.mute,se.unmute=te.unmute,se.getRegisteredAnimations=te.getRegisteredAnimations,se.useWebWorker=n,se.setIDPrefix=ra,se.__getFactory=Ia,se.version="5.12.2";function La(){document.readyState==="complete"&&(clearInterval(Ra),Oe());}function Va(A){for(var F=Or.split("&"),j=0;j"u"?"undefined":ms(t))==="object"&&typeof e<"u")&&!(typeof define=="function"&&define.amd)&&(window.bodymovin=se);}catch{}var _i=function(){var A={},F={};A.registerModifier=j,A.getModifier=U;function j(at,it){F[at]||(F[at]=it);}function U(at,it,vt){return new F[at](it,vt)}return A}();function ni(){}ni.prototype.initModifierProperties=function(){},ni.prototype.addShapeToModifier=function(){},ni.prototype.addShape=function(A){if(!this.closed){A.sh.container.addDynamicProperty(A.sh);var F={shape:A.sh,data:A,localShapeCollection:Ue.newShapeCollection()};this.shapes.push(F),this.addShapeToModifier(F),this._isAnimated&&A.setAsAnimated();}},ni.prototype.init=function(A,F){this.shapes=[],this.elem=A,this.initDynamicPropertyContainer(A),this.initModifierProperties(A,F),this.frameId=a,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0);},ni.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties());},c([Ve],ni);function je(){}c([ni],je),je.prototype.initModifierProperties=function(A,F){this.s=Yt.getProp(A,F.s,0,.01,this),this.e=Yt.getProp(A,F.e,0,.01,this),this.o=Yt.getProp(A,F.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=F.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length;},je.prototype.addShapeToModifier=function(A){A.pathsData=[];},je.prototype.calculateShapeEdges=function(A,F,j,U,at){var it=[];F<=1?it.push({s:A,e:F}):A>=1?it.push({s:A-1,e:F-1}):(it.push({s:A,e:1}),it.push({s:0,e:F-1}));var vt=[],Mt,bt=it.length,Bt;for(Mt=0;MtU+j)){var It,Nt;Bt.s*at<=U?It=0:It=(Bt.s*at-U)/j,Bt.e*at>=U+j?Nt=1:Nt=(Bt.e*at-U)/j,vt.push([It,Nt]);}return vt.length||vt.push([0,0]),vt},je.prototype.releasePathsData=function(A){var F,j=A.length;for(F=0;F1?F=1+U:this.s.v<0?F=0+U:F=this.s.v+U,this.e.v>1?j=1+U:this.e.v<0?j=0+U:j=this.e.v+U,F>j){var at=F;F=j,j=at;}F=Math.round(F*1e4)*1e-4,j=Math.round(j*1e4)*1e-4,this.sValue=F,this.eValue=j;}else F=this.sValue,j=this.eValue;var it,vt,Mt=this.shapes.length,bt,Bt,It,Nt,St,m=0;if(j===F)for(vt=0;vt=0;vt-=1)if(T=this.shapes[vt],T.shape._mdf){for(B=T.localShapeCollection,B.releaseShapes(),this.m===2&&Mt>1?(d=this.calculateShapeEdges(F,j,T.totalShapeLength,o,m),o+=T.totalShapeLength):d=[[G,O]],Bt=d.length,bt=0;bt=1?C.push({s:T.totalShapeLength*(G-1),e:T.totalShapeLength*(O-1)}):(C.push({s:T.totalShapeLength*G,e:T.totalShapeLength}),C.push({s:0,e:T.totalShapeLength*(O-1)}));var x=this.addShapes(T,C[0]);if(C[0].s!==C[0].e){if(C.length>1){var M=T.shape.paths.shapes[T.shape.paths._length-1];if(M.c){var L=x.pop();this.addPaths(x,B),x=this.addShapes(T,C[1],L);}else this.addPaths(x,B),x=this.addShapes(T,C[1]);}this.addPaths(x,B);}}T.shape.paths=B;}}},je.prototype.addPaths=function(A,F){var j,U=A.length;for(j=0;jF.e){j.c=!1;break}else F.s<=Bt&&F.e>=Bt+It.addedLength?(this.addSegment(at[it].v[Mt-1],at[it].o[Mt-1],at[it].i[Mt],at[it].v[Mt],j,Nt,B),B=!1):(m=mi.getNewSegment(at[it].v[Mt-1],at[it].v[Mt],at[it].o[Mt-1],at[it].i[Mt],(F.s-Bt)/It.addedLength,(F.e-Bt)/It.addedLength,St[Mt-1]),this.addSegmentFromArray(m,j,Nt,B),B=!1,j.c=!1),Bt+=It.addedLength,Nt+=1;if(at[it].c&&St.length){if(It=St[Mt-1],Bt<=F.e){var G=St[Mt-1].addedLength;F.s<=Bt&&F.e>=Bt+G?(this.addSegment(at[it].v[Mt-1],at[it].o[Mt-1],at[it].i[0],at[it].v[0],j,Nt,B),B=!1):(m=mi.getNewSegment(at[it].v[Mt-1],at[it].v[0],at[it].o[Mt-1],at[it].i[0],(F.s-Bt)/G,(F.e-Bt)/G,St[Mt-1]),this.addSegmentFromArray(m,j,Nt,B),B=!1,j.c=!1);}else j.c=!1;Bt+=It.addedLength,Nt+=1;}if(j._length&&(j.setXYAt(j.v[T][0],j.v[T][1],"i",T),j.setXYAt(j.v[j._length-1][0],j.v[j._length-1][1],"o",j._length-1)),Bt>F.e)break;it=this.p.keyframes[this.p.keyframes.length-1].t?(It=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/Bt,0),Nt=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/Bt,0)):(It=this.p.pv,Nt=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/Bt,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){It=[],Nt=[];var St=this.px,m=this.py;St._caching.lastFrame+St.offsetTime<=St.keyframes[0].t?(It[0]=St.getValueAtTime((St.keyframes[0].t+.01)/Bt,0),It[1]=m.getValueAtTime((m.keyframes[0].t+.01)/Bt,0),Nt[0]=St.getValueAtTime(St.keyframes[0].t/Bt,0),Nt[1]=m.getValueAtTime(m.keyframes[0].t/Bt,0)):St._caching.lastFrame+St.offsetTime>=St.keyframes[St.keyframes.length-1].t?(It[0]=St.getValueAtTime(St.keyframes[St.keyframes.length-1].t/Bt,0),It[1]=m.getValueAtTime(m.keyframes[m.keyframes.length-1].t/Bt,0),Nt[0]=St.getValueAtTime((St.keyframes[St.keyframes.length-1].t-.01)/Bt,0),Nt[1]=m.getValueAtTime((m.keyframes[m.keyframes.length-1].t-.01)/Bt,0)):(It=[St.pv,m.pv],Nt[0]=St.getValueAtTime((St._caching.lastFrame+St.offsetTime-.01)/Bt,St.offsetTime),Nt[1]=m.getValueAtTime((m._caching.lastFrame+m.offsetTime-.01)/Bt,m.offsetTime));}else Nt=A,It=Nt;this.v.rotate(-Math.atan2(It[1]-Nt[1],It[0]-Nt[0]));}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);}this.frameId=this.elem.globalData.frameId;}}function U(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4);}function at(){}function it(bt){this._addDynamicProperty(bt),this.elem.addDynamicProperty(bt),this._isDirty=!0;}function vt(bt,Bt,It){if(this.elem=bt,this.frameId=-1,this.propType="transform",this.data=Bt,this.v=new Ce,this.pre=new Ce,this.appliedTransformations=0,this.initDynamicPropertyContainer(It||bt),Bt.p&&Bt.p.s?(this.px=Yt.getProp(bt,Bt.p.x,0,0,this),this.py=Yt.getProp(bt,Bt.p.y,0,0,this),Bt.p.z&&(this.pz=Yt.getProp(bt,Bt.p.z,0,0,this))):this.p=Yt.getProp(bt,Bt.p||{k:[0,0,0]},1,0,this),Bt.rx){if(this.rx=Yt.getProp(bt,Bt.rx,0,ot,this),this.ry=Yt.getProp(bt,Bt.ry,0,ot,this),this.rz=Yt.getProp(bt,Bt.rz,0,ot,this),Bt.or.k[0].ti){var Nt,St=Bt.or.k.length;for(Nt=0;Nt0;)j-=1,this._elements.unshift(F[j]);this.dynamicProperties.length?this.k=!0:this.getValue(!0);},oi.prototype.resetElements=function(A){var F,j=A.length;for(F=0;F0?Math.floor(St):Math.ceil(St),T=this.pMatrix.props,B=this.rMatrix.props,G=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var O=0;if(St>0){for(;OC;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),O-=1;m&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-m,!0),O-=m);}U=this.data.m===1?0:this._currentCopies-1,at=this.data.m===1?1:-1,it=this._currentCopies;for(var o,d;it;){if(F=this.elemsData[U].it,j=F[F.length-1].transform.mProps.v.props,d=j.length,F[F.length-1].transform.mProps._mdf=!0,F[F.length-1].transform.op._mdf=!0,F[F.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(U/(this._currentCopies-1)),O!==0){for((U!==0&&at===1||U!==this._currentCopies-1&&at===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(B[0],B[1],B[2],B[3],B[4],B[5],B[6],B[7],B[8],B[9],B[10],B[11],B[12],B[13],B[14],B[15]),this.matrix.transform(G[0],G[1],G[2],G[3],G[4],G[5],G[6],G[7],G[8],G[9],G[10],G[11],G[12],G[13],G[14],G[15]),this.matrix.transform(T[0],T[1],T[2],T[3],T[4],T[5],T[6],T[7],T[8],T[9],T[10],T[11],T[12],T[13],T[14],T[15]),o=0;o0&&U<1?[F]:[]:[F-U,F+U].filter(function(at){return at>0&&at<1})},Se.prototype.split=function(A){if(A<=0)return [Nr(this.points[0]),this];if(A>=1)return [this,Nr(this.points[this.points.length-1])];var F=Ai(this.points[0],this.points[1],A),j=Ai(this.points[1],this.points[2],A),U=Ai(this.points[2],this.points[3],A),at=Ai(F,j,A),it=Ai(j,U,A),vt=Ai(at,it,A);return [new Se(this.points[0],F,at,vt,!0),new Se(vt,it,U,this.points[3],!0)]};function vr(A,F){var j=A.points[0][F],U=A.points[A.points.length-1][F];if(j>U){var at=U;U=j,j=at;}for(var it=na(3*A.a[F],2*A.b[F],A.c[F]),vt=0;vt0&&it[vt]<1){var Mt=A.point(it[vt])[F];MtU&&(U=Mt);}return {min:j,max:U}}Se.prototype.bounds=function(){return {x:vr(this,0),y:vr(this,1)}},Se.prototype.boundingBox=function(){var A=this.bounds();return {left:A.x.min,right:A.x.max,top:A.y.min,bottom:A.y.max,width:A.x.max-A.x.min,height:A.y.max-A.y.min,cx:(A.x.max+A.x.min)/2,cy:(A.y.max+A.y.min)/2}};function $e(A,F,j){var U=A.boundingBox();return {cx:U.cx,cy:U.cy,width:U.width,height:U.height,bez:A,t:(F+j)/2,t1:F,t2:j}}function br(A){var F=A.bez.split(.5);return [$e(F[0],A.t1,A.t),$e(F[1],A.t,A.t2)]}function _r(A,F){return Math.abs(A.cx-F.cx)*2=it||A.width<=U&&A.height<=U&&F.width<=U&&F.height<=U){at.push([A.t,F.t]);return}var vt=br(A),Mt=br(F);gs(vt[0],Mt[0],j+1,U,at,it),gs(vt[0],Mt[1],j+1,U,at,it),gs(vt[1],Mt[0],j+1,U,at,it),gs(vt[1],Mt[1],j+1,U,at,it);}}Se.prototype.intersections=function(A,F,j){F===void 0&&(F=2),j===void 0&&(j=7);var U=[];return gs($e(this,0,1),$e(A,0,1),0,F,U,j),U},Se.shapeSegment=function(A,F){var j=(F+1)%A.length();return new Se(A.v[F],A.o[F],A.i[j],A.v[j],!0)},Se.shapeSegmentInverted=function(A,F){var j=(F+1)%A.length();return new Se(A.v[j],A.i[j],A.o[F],A.v[F],!0)};function rr(A,F){return [A[1]*F[2]-A[2]*F[1],A[2]*F[0]-A[0]*F[2],A[0]*F[1]-A[1]*F[0]]}function as(A,F,j,U){var at=[A[0],A[1],1],it=[F[0],F[1],1],vt=[j[0],j[1],1],Mt=[U[0],U[1],1],bt=rr(rr(at,it),rr(vt,Mt));return _s(bt[2])?null:[bt[0]/bt[2],bt[1]/bt[2]]}function Wi(A,F,j){return [A[0]+Math.cos(F)*j,A[1]-Math.sin(F)*j]}function ws(A,F){return Math.hypot(A[0]-F[0],A[1]-F[1])}function Fi(A,F){return Di(A[0],F[0])&&Di(A[1],F[1])}function ns(){}c([ni],ns),ns.prototype.initModifierProperties=function(A,F){this.getValue=this.processKeys,this.amplitude=Yt.getProp(A,F.s,0,null,this),this.frequency=Yt.getProp(A,F.r,0,null,this),this.pointsType=Yt.getProp(A,F.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0;};function Ds(A,F,j,U,at,it,vt){var Mt=j-Math.PI/2,bt=j+Math.PI/2,Bt=F[0]+Math.cos(j)*U*at,It=F[1]-Math.sin(j)*U*at;A.setTripleAt(Bt,It,Bt+Math.cos(Mt)*it,It-Math.sin(Mt)*it,Bt+Math.cos(bt)*vt,It-Math.sin(bt)*vt,A.length());}function ar(A,F){var j=[F[0]-A[0],F[1]-A[1]],U=-Math.PI*.5,at=[Math.cos(U)*j[0]-Math.sin(U)*j[1],Math.sin(U)*j[0]+Math.cos(U)*j[1]];return at}function oa(A,F){var j=F===0?A.length()-1:F-1,U=(F+1)%A.length(),at=A.v[j],it=A.v[U],vt=ar(at,it);return Math.atan2(0,1)-Math.atan2(vt[1],vt[0])}function Gr(A,F,j,U,at,it,vt){var Mt=oa(F,j),bt=F.v[j%F._length],Bt=F.v[j===0?F._length-1:j-1],It=F.v[(j+1)%F._length],Nt=it===2?Math.sqrt(Math.pow(bt[0]-Bt[0],2)+Math.pow(bt[1]-Bt[1],2)):0,St=it===2?Math.sqrt(Math.pow(bt[0]-It[0],2)+Math.pow(bt[1]-It[1],2)):0;Ds(A,F.v[j%F._length],Mt,vt,U,St/((at+1)*2),Nt/((at+1)*2));}function Ba(A,F,j,U,at,it){for(var vt=0;vt1&&F.length>1&&(at=Fs(A[0],F[F.length-1]),at)?[[A[0].split(at[0])[0]],[F[F.length-1].split(at[1])[1]]]:[j,U]}function ha(A){for(var F,j=1;j1&&(F=xr(A[A.length-1],A[0]),A[A.length-1]=F[0],A[0]=F[1]),A}function Pr(A,F){var j=A.inflectionPoints(),U,at,it,vt;if(j.length===0)return [os(A,F)];if(j.length===1||Di(j[1],1))return it=A.split(j[0]),U=it[0],at=it[1],[os(U,F),os(at,F)];it=A.split(j[0]),U=it[0];var Mt=(j[1]-j[0])/(1-j[0]);return it=it[1].split(Mt),vt=it[0],at=it[1],[os(U,F),os(vt,F),os(at,F)]}function xs(){}c([ni],xs),xs.prototype.initModifierProperties=function(A,F){this.getValue=this.processKeys,this.amount=Yt.getProp(A,F.a,0,null,this),this.miterLimit=Yt.getProp(A,F.ml,0,null,this),this.lineJoin=F.lj,this._isAnimated=this.amount.effectsSequence.length!==0;},xs.prototype.processPath=function(A,F,j,U){var at=Fe.newElement();at.c=A.c;var it=A.length();A.c||(it-=1);var vt,Mt,bt,Bt=[];for(vt=0;vt=0;vt-=1)bt=Se.shapeSegmentInverted(A,vt),Bt.push(Pr(bt,F));Bt=ha(Bt);var It=null,Nt=null;for(vt=0;vt0&&(ft=!1),ft){var Lt=P("style");Lt.setAttribute("f-forigin",N[rt].fOrigin),Lt.setAttribute("f-origin",N[rt].origin),Lt.setAttribute("f-family",N[rt].fFamily),Lt.type="text/css",Lt.innerText="@font-face {font-family: "+N[rt].fFamily+"; font-style: normal; src: url('"+N[rt].fPath+"');}",Y.appendChild(Lt);}}else if(N[rt].fOrigin==="g"||N[rt].origin===1){for(dt=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),xt=0;xt=55296&&N<=56319){var rt=$.charCodeAt(1);rt>=56320&&rt<=57343&&(Y=(N-55296)*1024+rt-56320+65536);}return Y}function M($,Y){var N=$.toString(16)+Y.toString(16);return Nt.indexOf(N)!==-1}function L($){return $===bt}function I($){return $===Mt}function H($){var Y=x($);return Y>=Bt&&Y<=It}function Q($){return H($.substr(0,2))&&H($.substr(2,2))}function Z($){return j.indexOf($)!==-1}function st($,Y){var N=x($.substr(Y,2));if(N!==U)return !1;var rt=0;for(Y+=2;rt<5;){if(N=x($.substr(Y,2)),Nvt)return !1;rt+=1,Y+=2;}return x($.substr(Y,2))===at}function pt(){this.isLoaded=!0;}var et=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this);};et.isModifier=M,et.isZeroWidthJoiner=L,et.isFlagEmoji=Q,et.isRegionalCode=H,et.isCombinedCharacter=Z,et.isRegionalFlag=st,et.isVariationSelector=I,et.BLACK_FLAG_CODE_POINT=U;var X={addChars:G,addFonts:B,getCharData:O,getFontByName:d,measureText:o,checkLoadedFonts:C,setIsLoaded:pt};return et.prototype=X,et}();function Er(A){this.animationData=A;}Er.prototype.getProp=function(A){return this.animationData.slots&&this.animationData.slots[A.sid]?Object.assign(A,this.animationData.slots[A.sid].p):A};function Vs(A){return new Er(A)}function Ki(){}Ki.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[];},addRenderableComponent:function(A){this.renderableComponents.indexOf(A)===-1&&this.renderableComponents.push(A);},removeRenderableComponent:function(A){this.renderableComponents.indexOf(A)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(A),1);},prepareRenderableFrame:function(A){this.checkLayerLimits(A);},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show());},checkLayerLimits:function(A){this.data.ip-this.data.st<=A&&this.data.op-this.data.st>A?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide());},renderRenderable:function(){var A,F=this.renderableComponents.length;for(A=0;A.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0));},ke.prototype.show=function(){},ke.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1;},ke.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1;},ke.prototype.resume=function(){this._canPlay=!0;},ke.prototype.setRate=function(A){this.audio.rate(A);},ke.prototype.volume=function(A){this._volumeMultiplier=A,this._previousVolume=A*this._volume,this.audio.volume(this._previousVolume);},ke.prototype.getBaseElement=function(){return null},ke.prototype.destroy=function(){},ke.prototype.sourceRectAtTime=function(){},ke.prototype.initExpressions=function(){};function Te(){}Te.prototype.checkLayers=function(A){var F,j=this.layers.length,U;for(this.completeLayers=!0,F=j-1;F>=0;F-=1)this.elements[F]||(U=this.layers[F],U.ip-U.st<=A-this.layers[F].st&&U.op-U.st>A-this.layers[F].st&&this.buildItem(F)),this.completeLayers=this.elements[F]?this.completeLayers:!1;this.checkPendingElements();},Te.prototype.createItem=function(A){switch(A.ty){case 2:return this.createImage(A);case 0:return this.createComp(A);case 1:return this.createSolid(A);case 3:return this.createNull(A);case 4:return this.createShape(A);case 5:return this.createText(A);case 6:return this.createAudio(A);case 13:return this.createCamera(A);case 15:return this.createFootage(A);default:return this.createNull(A)}},Te.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},Te.prototype.createAudio=function(A){return new ke(A,this.globalData,this)},Te.prototype.createFootage=function(A){return new We(A,this.globalData,this)},Te.prototype.buildAllItems=function(){var A,F=this.layers.length;for(A=0;A0&&(this.maskElement.setAttribute("id",St),this.element.maskedElement.setAttribute(O,"url("+y()+"#"+St+")"),U.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this);}Oi.prototype.getMaskProperty=function(A){return this.viewData[A].prop},Oi.prototype.renderFrame=function(A){var F=this.element.finalTransform.mat,j,U=this.masksProperties.length;for(j=0;j1&&(U+=" C"+F.o[at-1][0]+","+F.o[at-1][1]+" "+F.i[0][0]+","+F.i[0][1]+" "+F.v[0][0]+","+F.v[0][1]),j.lastPath!==U){var vt="";j.elem&&(F.c&&(vt=A.inv?this.solidPath+U:U),j.elem.setAttribute("d",vt)),j.lastPath=U;}},Oi.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null;};var xi=function(){var A={};A.createFilter=F,A.createAlphaToLuminanceFilter=j;function F(U,at){var it=Wt("filter");return it.setAttribute("id",U),at!==!0&&(it.setAttribute("filterUnits","objectBoundingBox"),it.setAttribute("x","0%"),it.setAttribute("y","0%"),it.setAttribute("width","100%"),it.setAttribute("height","100%")),it}function j(){var U=Wt("feColorMatrix");return U.setAttribute("type","matrix"),U.setAttribute("color-interpolation-filters","sRGB"),U.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),U}return A}(),Qi=function(){var A={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return (/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(A.maskType=!1),/firefox/i.test(navigator.userAgent)&&(A.svgLumaHidden=!1),A}(),Ss={},Ar="filter_result_";function Rs(A){var F,j="SourceGraphic",U=A.data.ef?A.data.ef.length:0,at=S(),it=xi.createFilter(at,!0),vt=0;this.filters=[];var Mt;for(F=0;F=0&&(j=this.shapeModifiers[A].processShapes(this._isFirstFrame),!j);A-=1);}},searchProcessedElement:function(A){for(var F=this.processedElements,j=0,U=F.length;j.01)return !1;j+=1;}return !0},hs.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return !1;if(this.data.k.k[0].s)for(var A=0,F=this.data.k.k.length;A0;)G=St.transformers[H].mProps._mdf||G,I-=1,H-=1;if(G)for(I=x-St.styles[o].lvl,H=St.transformers.length-1;I>0;)L.multiply(St.transformers[H].mProps.v),I-=1,H-=1;}else L=A;if(M=St.sh.paths,T=M._length,G){for(B="",C=0;C=1?pt=.99:pt<=-1&&(pt=-.99);var et=Z*pt,X=Math.cos(st+St.a.v)*et+B[0],$=Math.sin(st+St.a.v)*et+B[1];C.setAttribute("fx",X),C.setAttribute("fy",$),T&&!St.g._collapsable&&(St.of.setAttribute("fx",X),St.of.setAttribute("fy",$));}}}function It(Nt,St,m){var C=St.style,T=St.d;T&&(T._mdf||m)&&T.dashStr&&(C.pElem.setAttribute("stroke-dasharray",T.dashStr),C.pElem.setAttribute("stroke-dashoffset",T.dashoffset[0])),St.c&&(St.c._mdf||m)&&C.pElem.setAttribute("stroke","rgb("+z(St.c.v[0])+","+z(St.c.v[1])+","+z(St.c.v[2])+")"),(St.o._mdf||m)&&C.pElem.setAttribute("stroke-opacity",St.o.v),(St.w._mdf||m)&&(C.pElem.setAttribute("stroke-width",St.w.v),C.msElem&&C.msElem.setAttribute("stroke-width",St.w.v));}return j}();function Ee(A,F,j){this.shapes=[],this.shapesData=A.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(A,F,j),this.prevViewData=[];}c([gi,Be,ys,Es,ki,hi,Li],Ee),Ee.prototype.initSecondaryElement=function(){},Ee.prototype.identityMatrix=new Ce,Ee.prototype.buildExpressionInterface=function(){},Ee.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();},Ee.prototype.filterUniqueShapes=function(){var A,F=this.shapes.length,j,U,at=this.stylesList.length,it,vt=[],Mt=!1;for(U=0;U1&&Mt&&this.setShapesAsAnimated(vt);}},Ee.prototype.setShapesAsAnimated=function(A){var F,j=A.length;for(F=0;F=0;bt-=1){if(B=this.searchProcessedElement(A[bt]),B?F[bt]=j[B-1]:A[bt]._render=vt,A[bt].ty==="fl"||A[bt].ty==="st"||A[bt].ty==="gf"||A[bt].ty==="gs"||A[bt].ty==="no")B?F[bt].style.closed=!1:F[bt]=this.createStyleElement(A[bt],at),A[bt]._render&&F[bt].style.pElem.parentNode!==U&&U.appendChild(F[bt].style.pElem),St.push(F[bt].style);else if(A[bt].ty==="gr"){if(!B)F[bt]=this.createGroupElement(A[bt]);else for(Nt=F[bt].it.length,It=0;It1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},ye.prototype.addEffect=function(A){this.effectsSequence.push(A),this.elem.addDynamicProperty(this);},ye.prototype.getValue=function(A){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!A)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var F=this.currentData,j=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var U,at=this.effectsSequence.length,it=A||this.data.d.k[this.keysIndex].s;for(U=0;UF);)j+=1;return this.keysIndex!==j&&(this.keysIndex=j),this.data.d.k[this.keysIndex].s},ye.prototype.buildFinalText=function(A){for(var F=[],j=0,U=A.length,at,it,vt=!1,Mt=!1,bt="";j=55296&&at<=56319?Ci.isRegionalFlag(A,j)?bt=A.substr(j,14):(it=A.charCodeAt(j+1),it>=56320&&it<=57343&&(Ci.isModifier(at,it)?(bt=A.substr(j,2),vt=!0):Ci.isFlagEmoji(A.substr(j,4))?bt=A.substr(j,4):bt=A.substr(j,2))):at>56319?(it=A.charCodeAt(j+1),Ci.isVariationSelector(at)&&(vt=!0)):Ci.isZeroWidthJoiner(at)&&(vt=!0,Mt=!0),vt?(F[F.length-1]+=bt,vt=!1):F.push(bt),j+=bt.length;return F},ye.prototype.completeTextData=function(A){A.__complete=!0;var F=this.elem.globalData.fontManager,j=this.data,U=[],at,it,vt,Mt=0,bt,Bt=j.m.g,It=0,Nt=0,St=0,m=[],C=0,T=0,B,G,O=F.getFontByName(A.f),o,d=0,x=Sr(O);A.fWeight=x.weight,A.fStyle=x.style,A.finalSize=A.s,A.finalText=this.buildFinalText(A.t),it=A.finalText.length,A.finalLineHeight=A.lh;var M=A.tr/1e3*A.finalSize,L;if(A.sz)for(var I=!0,H=A.sz[0],Q=A.sz[1],Z,st;I;){st=this.buildFinalText(A.t),Z=0,C=0,it=st.length,M=A.tr/1e3*A.finalSize;var pt=-1;for(at=0;atH&&st[at]!==" "?(pt===-1?it+=1:at=pt,Z+=A.finalLineHeight||A.finalSize*1.2,st.splice(at,pt===at?1:0,"\r"),pt=-1,C=0):(C+=d,C+=M);Z+=O.ascent*A.finalSize/100,this.canResize&&A.finalSize>this.minimumFontSize&&QT?C:T,C=-2*M,bt="",vt=!0,St+=1):bt=X,F.chars?(o=F.getCharData(X,O.fStyle,F.getFontByName(A.f).fFamily),d=vt?0:o.w*A.finalSize/100):d=F.measureText(bt,A.f,A.finalSize),X===" "?et+=d+M:(C+=d+M+et,et=0),U.push({l:d,an:d,add:It,n:vt,anIndexes:[],val:bt,line:St,animatorJustifyOffset:0}),Bt==2){if(It+=d,bt===""||bt===" "||at===it-1){for((bt===""||bt===" ")&&(It-=d);Nt<=at;)U[Nt].an=It,U[Nt].ind=Mt,U[Nt].extra=d,Nt+=1;Mt+=1,It=0;}}else if(Bt==3){if(It+=d,bt===""||at===it-1){for(bt===""&&(It-=d);Nt<=at;)U[Nt].an=It,U[Nt].ind=Mt,U[Nt].extra=d,Nt+=1;It=0,Mt+=1;}}else U[Mt].ind=Mt,U[Mt].extra=0,Mt+=1;if(A.l=U,T=C>T?C:T,m.push(C),A.sz)A.boxWidth=A.sz[0],A.justifyOffset=0;else switch(A.boxWidth=T,A.j){case 1:A.justifyOffset=-A.boxWidth;break;case 2:A.justifyOffset=-A.boxWidth/2;break;default:A.justifyOffset=0;}A.lineWidths=m;var $=j.a,Y,N;G=$.length;var rt,nt,K=[];for(B=0;B0?vt=this.ne.v/100:Mt=-this.ne.v/100,this.xe.v>0?bt=1-this.xe.v/100:Bt=1+this.xe.v/100;var It=Ut.getBezierEasing(vt,Mt,bt,Bt).get,Nt=0,St=this.finalS,m=this.finalE,C=this.data.sh;if(C===2)m===St?Nt=it>=m?1:0:Nt=A(0,F(.5/(m-St)+(it-St)/(m-St),1)),Nt=It(Nt);else if(C===3)m===St?Nt=it>=m?0:1:Nt=1-A(0,F(.5/(m-St)+(it-St)/(m-St),1)),Nt=It(Nt);else if(C===4)m===St?Nt=0:(Nt=A(0,F(.5/(m-St)+(it-St)/(m-St),1)),Nt<.5?Nt*=2:Nt=1-2*(Nt-.5)),Nt=It(Nt);else if(C===5){if(m===St)Nt=0;else {var T=m-St;it=F(A(0,it+.5-St),m-St);var B=-T/2+it,G=T/2;Nt=Math.sqrt(1-B*B/(G*G));}Nt=It(Nt);}else C===6?(m===St?Nt=0:(it=F(A(0,it+.5-St),m-St),Nt=(1+Math.cos(Math.PI+Math.PI*2*it/(m-St)))/2),Nt=It(Nt)):(it>=j(St)&&(it-St<0?Nt=A(0,F(F(m,1)-(St-it),1)):Nt=A(0,F(m-it,1))),Nt=It(Nt));if(this.sm.v!==100){var O=this.sm.v*.01;O===0&&(O=1e-8);var o=.5-O*.5;Nt1&&(Nt=1));}return Nt*this.a.v},getValue:function(it){this.iterateDynamicProperties(),this._mdf=it||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,it&&this.data.r===2&&(this.e.v=this._currentTextLength);var vt=this.data.r===2?1:100/this.data.totalChars,Mt=this.o.v/vt,bt=this.s.v/vt+Mt,Bt=this.e.v/vt+Mt;if(bt>Bt){var It=bt;bt=Bt,Bt=It;}this.finalS=bt,this.finalE=Bt;}},c([Ve],U);function at(it,vt,Mt){return new U(it,vt)}return {getTextSelectorProp:at}}();function Vi(A,F,j){var U={propType:!1},at=Yt.getProp,it=F.a;this.a={r:it.r?at(A,it.r,0,ot,j):U,rx:it.rx?at(A,it.rx,0,ot,j):U,ry:it.ry?at(A,it.ry,0,ot,j):U,sk:it.sk?at(A,it.sk,0,ot,j):U,sa:it.sa?at(A,it.sa,0,ot,j):U,s:it.s?at(A,it.s,1,.01,j):U,a:it.a?at(A,it.a,1,0,j):U,o:it.o?at(A,it.o,0,.01,j):U,p:it.p?at(A,it.p,1,0,j):U,sw:it.sw?at(A,it.sw,0,0,j):U,sc:it.sc?at(A,it.sc,1,0,j):U,fc:it.fc?at(A,it.fc,1,0,j):U,fh:it.fh?at(A,it.fh,0,0,j):U,fs:it.fs?at(A,it.fs,0,.01,j):U,fb:it.fb?at(A,it.fb,0,.01,j):U,t:it.t?at(A,it.t,0,0,j):U},this.s=$r.getTextSelectorProp(A,F.s,j),this.s.t=F.s.t;}function Xi(A,F,j){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=A,this._renderType=F,this._elem=j,this._animatorsData=v(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(j);}Xi.prototype.searchProperties=function(){var A,F=this._textData.a.length,j,U=Yt.getProp;for(A=0;A=C+me||!x?(H=(C+me-B)/T.partialLength,xt=d.point[0]+(T.point[0]-d.point[0])*H,Lt=d.point[1]+(T.point[1]-d.point[1])*H,it.translate(-j[0]*St[It].an*.005,-(j[1]*et)*.01),G=!1):x&&(B+=T.partialLength,O+=1,O>=x.length&&(O=0,o+=1,M[o]?x=M[o].points:Z.v.c?(O=0,o=0,x=M[o].points):(B-=T.partialLength,x=null)),x&&(d=T,T=x[O],L=T.partialLength));dt=St[It].an/2-St[It].add,it.translate(-dt,0,0);}else dt=St[It].an/2-St[It].add,it.translate(-dt,0,0),it.translate(-j[0]*St[It].an*.005,-j[1]*et*.01,0);for(N=0;NA?this.textSpans[A].span:Wt(Mt?"g":"text"),o<=A){if(bt.setAttribute("stroke-linecap","butt"),bt.setAttribute("stroke-linejoin","round"),bt.setAttribute("stroke-miterlimit","4"),this.textSpans[A].span=bt,Mt){var x=Wt("g");bt.appendChild(x),this.textSpans[A].childSpan=x;}this.textSpans[A].span=bt,this.layerElement.appendChild(bt);}bt.style.display="inherit";}if(Bt.reset(),Nt&&(vt[A].n&&(St=-T,m+=j.yOffset,m+=C?1:0,C=!1),this.applyTextPropertiesToMatrix(j,Bt,vt[A].line,St,m),St+=vt[A].l||0,St+=T),Mt){d=this.globalData.fontManager.getCharData(j.finalText[A],U.fStyle,this.globalData.fontManager.getFontByName(j.f).fFamily);var M;if(d.t===1)M=new Ze(d.data,this.globalData,this);else {var L=zs;d.data&&d.data.shapes&&(L=this.buildShapeData(d.data,j.finalSize)),M=new Ee(L,this.globalData,this);}if(this.textSpans[A].glyph){var I=this.textSpans[A].glyph;this.textSpans[A].childSpan.removeChild(I.layerElement),I.destroy();}this.textSpans[A].glyph=M,M._debug=!0,M.prepareFrame(0),M.renderFrame(),this.textSpans[A].childSpan.appendChild(M.layerElement),d.t===1&&this.textSpans[A].childSpan.setAttribute("transform","scale("+j.finalSize/100+","+j.finalSize/100+")");}else Nt&&bt.setAttribute("transform","translate("+Bt.props[12]+","+Bt.props[13]+")"),bt.textContent=vt[A].val,bt.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");}Nt&&bt&&bt.setAttribute("d",It);}for(;A=0;F-=1)(this.completeLayers||this.elements[F])&&this.elements[F].prepareFrame(A-this.layers[F].st);if(this.globalData._mdf)for(F=0;F=0;j-=1)(this.completeLayers||this.elements[j])&&(this.elements[j].prepareFrame(this.renderedFrame-this.layers[j].st),this.elements[j]._mdf&&(this._mdf=!0));}},ti.prototype.renderInnerContent=function(){var A,F=this.layers.length;for(A=0;Axc});var _c,xc,xl=ls(()=>{qs();_c=is((exports,module)=>{typeof navigator<"u"&&function(t,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.lottie=e());}(exports,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(t){_useWebWorker=!!t;},getWebWorker=function(){return _useWebWorker},setLocationHref=function(t){locationHref=t;},getLocationHref=function(){return locationHref};function createTag(t){return document.createElement(t)}function extendPrototype(t,e){var i,s=t.length,r;for(i=0;i1?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}var rgbToHex=function(){var t=[],e,i;for(e=0;e<256;e+=1)i=e.toString(16),t[e]=i.length===1?"0"+i:i;return function(s,r,a){return s<0&&(s=0),r<0&&(r=0),a<0&&(a=0),"#"+t[s]+t[r]+t[a]}}(),setSubframeEnabled=function(t){subframeEnabled=!!t;},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(t){expressionsPlugin=t;},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(t){expressionsInterfaces=t;},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(t){defaultCurveSegments=t;},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(t){idPrefix$1=t;};function createNS(t){return document.createElementNS(svgNS,t)}function _typeof$5(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(e){return typeof e}:_typeof$5=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(t)}var dataManager=function(){var t=1,e=[],i,s,r={onmessage:function(){},postMessage:function(l){i({data:l});}},a={postMessage:function(l){r.onmessage({data:l});}};function n(l){if(window.Worker&&window.Blob&&getWebWorker()){var E=new Blob(["var _workerSelf = self; self.onmessage = ",l.toString()],{type:"text/javascript"}),b=URL.createObjectURL(E);return new Worker(b)}return i=l,r}function p(){s||(s=n(function(l){function E(){function v(ht,yt){var D,V,S=ht.length,R,tt,J,Gt;for(V=0;V=0;yt-=1)if(ht[yt].ty==="sh")if(ht[yt].ks.k.i)_(ht[yt].ks.k);else for(S=ht[yt].ks.k.length,V=0;VD[0]?!0:D[0]>ht[0]?!1:ht[1]>D[1]?!0:D[1]>ht[1]?!1:ht[2]>D[2]?!0:D[2]>ht[2]?!1:null}var z=function(){var ht=[4,4,14];function yt(V){var S=V.t.d;V.t.d={k:[{s:S,t:0}]};}function D(V){var S,R=V.length;for(S=0;S=0;S-=1)if(V[S].ty==="sh")if(V[S].ks.k.i)V[S].ks.k.c=V[S].closed;else for(J=V[S].ks.k.length,tt=0;tt500)&&(this._imageLoaded(),clearInterval(g)),f+=1;}.bind(this),50);}function a(u){var f=s(u,this.assetsPath,this.path),g=createNS("image");isSafari?this.testImageLoaded(g):g.addEventListener("load",this._imageLoaded,!1),g.addEventListener("error",function(){_.img=t,this._imageLoaded();}.bind(this),!1),g.setAttributeNS("http://www.w3.org/1999/xlink","href",f),this._elementHelper.append?this._elementHelper.append(g):this._elementHelper.appendChild(g);var _={img:g,assetData:u};return _}function n(u){var f=s(u,this.assetsPath,this.path),g=createTag("img");g.crossOrigin="anonymous",g.addEventListener("load",this._imageLoaded,!1),g.addEventListener("error",function(){_.img=t,this._imageLoaded();}.bind(this),!1),g.src=f;var _={img:g,assetData:u};return _}function p(u){var f={assetData:u},g=s(u,this.assetsPath,this.path);return dataManager.loadData(g,function(_){f.img=_,this._footageLoaded();}.bind(this),function(){f.img={},this._footageLoaded();}.bind(this)),f}function h(u,f){this.imagesLoadedCb=f;var g,_=u.length;for(g=0;g<_;g+=1)u[g].layers||(!u[g].t||u[g].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(u[g]))):u[g].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(u[g]))));}function y(u){this.path=u||"";}function P(u){this.assetsPath=u||"";}function c(u){for(var f=0,g=this.images.length;fthis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e=this.animationData.layers,i,s=e.length,r=t.layers,a,n=r.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(t){this.triggerRenderFrameError(t);}},AnimationItem.prototype.play=function(t){t&&this.name!==t||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},AnimationItem.prototype.pause=function(t){t&&this.name!==t||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(this.isPaused===!0?this.play():this.pause());},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(i=!0,e=0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"));}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart");},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,i!==-1&&this.goToAndStop(i,!0);},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),_typeof$4(t[0])==="object"){var i,s=t.length;for(i=0;i=0;V-=1)e[V].animation.destroy(D);}function W(D,V,S){var R=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),tt,J=R.length;for(tt=0;tt0?_=W:g=W;while(Math.abs(q)>a&&++ot=r?w(f,mt,g,_):gt===0?mt:v(f,z,z+h,g,_)}},t}(),pooling=function(){function t(e){return e.concat(createSizedArray(e.length))}return {double:t}}(),poolFactory=function(){return function(t,e,i){var s=0,r=t,a=createSizedArray(r),n={newElement:p,release:h};function p(){var y;return s?(s-=1,y=a[s]):y=e(),y}function h(y){s===r&&(a=pooling.double(a),r*=2),i&&i(y),a[s]=y,s+=1;}return n}}(),bezierLengthPool=function(){function t(){return {addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,t)}(),segmentsLengthPool=function(){function t(){return {lengths:[],totalLength:0}}function e(i){var s,r=i.lengths.length;for(s=0;s-.001&&f<.001}function i(l,E,b,v,w,u,f,g,_){if(b===0&&u===0&&_===0)return e(l,E,v,w,f,g);var k=t.sqrt(t.pow(v-l,2)+t.pow(w-E,2)+t.pow(u-b,2)),z=t.sqrt(t.pow(f-l,2)+t.pow(g-E,2)+t.pow(_-b,2)),q=t.sqrt(t.pow(f-v,2)+t.pow(g-w,2)+t.pow(_-u,2)),W;return k>z?k>q?W=k-z-q:W=q-z-k:q>z?W=q-z-k:W=z-k-q,W>-1e-4&&W<1e-4}var s=function(){return function(l,E,b,v){var w=getDefaultCurveSegments(),u,f,g,_,k,z=0,q,W=[],ot=[],mt=bezierLengthPool.newElement();for(g=b.length,u=0;uf?-1:1,k=!0;k;)if(v[u]<=f&&v[u+1]>f?(g=(f-v[u])/(v[u+1]-v[u]),k=!1):u+=_,u<0||u>=w-1){if(u===w-1)return b[u];k=!1;}return b[u]+(b[u+1]-b[u])*g}function y(l,E,b,v,w,u){var f=h(w,u),g=1-f,_=t.round((g*g*g*l[0]+(f*g*g+g*f*g+g*g*f)*b[0]+(f*f*g+g*f*f+f*g*f)*v[0]+f*f*f*E[0])*1e3)/1e3,k=t.round((g*g*g*l[1]+(f*g*g+g*f*g+g*g*f)*b[1]+(f*f*g+g*f*f+f*g*f)*v[1]+f*f*f*E[1])*1e3)/1e3;return [_,k]}var P=createTypedArray("float32",8);function c(l,E,b,v,w,u,f){w<0?w=0:w>1&&(w=1);var g=h(w,f);u=u>1?1:u;var _=h(u,f),k,z=l.length,q=1-g,W=1-_,ot=q*q*q,mt=g*q*q*3,gt=g*g*q*3,ut=g*g*g,Ct=q*q*W,ht=g*q*W+q*g*W+q*q*_,yt=g*g*W+q*g*_+g*q*_,D=g*g*_,V=q*W*W,S=g*W*W+q*_*W+q*W*_,R=g*_*W+q*_*_+g*W*_,tt=g*_*_,J=W*W*W,Gt=_*W*W+W*_*W+W*W*_,Vt=_*_*W+W*_*_+_*W*_,Xt=_*_*_;for(k=0;k=y.t-i){h.h&&(h=y),r=0;break}if(y.t-i>t){r=a;break}a=u||t=u?_.points.length-1:0;for(l=_.points[k].point.length,c=0;c=W&&z=u)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=f)s[0]=h.s[0],s[1]=h.s[1],s[2]=h.s[2];else {var ht=createQuaternion(h.s),yt=createQuaternion(g),D=(t-f)/(u-f);quaternionToEuler(s,slerp(ht,yt,D));}else for(a=0;a=u?E=1:t1e-6?(l=Math.acos(E),b=Math.sin(l),v=Math.sin((1-i)*l)/b,w=Math.sin(i*l)/b):(v=1-i,w=i),s[0]=v*r+w*h,s[1]=v*a+w*y,s[2]=v*n+w*P,s[3]=v*p+w*c,s}function quaternionToEuler(t,e){var i=e[0],s=e[1],r=e[2],a=e[3],n=Math.atan2(2*s*a-2*i*r,1-2*s*s-2*r*r),p=Math.asin(2*i*s+2*r*a),h=Math.atan2(2*i*a-2*s*r,1-2*i*i-2*r*r);t[0]=n/degToRads,t[1]=p/degToRads,t[2]=h/degToRads;}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,s=t[2]*degToRads,r=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(s/2),p=Math.sin(e/2),h=Math.sin(i/2),y=Math.sin(s/2),P=r*a*n-p*h*y,c=p*h*n+r*a*y,l=p*a*n+r*h*y,E=r*h*n-p*a*y;return [c,l,E,P]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s;}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if(this.propType==="unidimensional")e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i1e-5&&(this.v[i]=e,this._mdf=!0),i+=1;}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[];break}(!a[s]||a[s]&&!r)&&(a[s]=pointPool.newElement()),a[s][0]=t,a[s][1]=e;},ShapePath.prototype.setTripleAt=function(t,e,i,s,r,a,n,p){this.setXYAt(t,e,"v",n,p),this.setXYAt(i,s,"o",n,p),this.setXYAt(r,a,"i",n,p);},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,r=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),r=1);var a=this._length-1,n=this._length,p;for(p=r;p=ht[ht.length-1].t-this.offsetTime)k=ht[ht.length-1].s?ht[ht.length-1].s[0]:ht[ht.length-2].e[0],q=!0;else {for(var yt=_,D=ht.length-1,V=!0,S,R,tt;V&&(S=ht[yt],R=ht[yt+1],!(R.t-this.offsetTime>u));)yt=R.t-this.offsetTime)ut=1;else if(ug&&u>g)||(this._caching.lastIndex=_0||S>-1e-6&&S<0?s(S*R)/R:S}function V(){var S=this.props,R=D(S[0]),tt=D(S[1]),J=D(S[4]),Gt=D(S[5]),Vt=D(S[12]),Xt=D(S[13]);return "matrix("+R+","+tt+","+J+","+Gt+","+Vt+","+Xt+")"}return function(){this.reset=r,this.rotate=a,this.rotateX=n,this.rotateY=p,this.rotateZ=h,this.skew=P,this.skewFromAxis=c,this.shear=y,this.scale=l,this.setTransform=E,this.translate=b,this.transform=v,this.multiply=w,this.applyToPoint=k,this.applyToX=z,this.applyToY=q,this.applyToZ=W,this.applyToPointArray=Ct,this.applyToTriplePoints=ut,this.applyToPointStringified=ht,this.toCSS=yt,this.to2dCSS=V,this.clone=g,this.cloneFromProps=_,this.equals=f,this.inversePoints=gt,this.inversePoint=mt,this.getInverseMatrix=ot,this._t=this.transform,this.isIdentity=u,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset();}}();function _typeof$3(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(e){return typeof e}:_typeof$3=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(t)}var lottie={};function setLocation(t){setLocationHref(t);}function searchAnimations(){animationManager.searchAnimations();}function setSubframeRendering(t){setSubframeEnabled(t);}function setPrefix(t){setIdPrefix(t);}function loadAnimation(t){return animationManager.loadAnimation(t)}function setQuality(t){if(typeof t=="string")switch(t){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else !isNaN(t)&&t>1&&setDefaultCurveSegments(t);}function inBrowser(){return typeof navigator<"u"}function installPlugin(t,e){t==="expressions"&&setExpressionsPlugin(e);}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations());}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i"u"?"undefined":_typeof$3(exports))==="object"&&typeof module<"u")&&!(typeof define=="function"&&define.amd)&&(window.bodymovin=lottie);}catch(t){}var ShapeModifiers=function(){var t={},e={};t.registerModifier=i,t.getModifier=s;function i(r,a){e[r]||(e[r]=a);}function s(r,a,n){return new e[r](a,n)}return t}();function ShapeModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated();}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0);},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties());},extendPrototype([DynamicPropertyContainer],ShapeModifier);function TrimModifier(){}extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length;},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[];},TrimModifier.prototype.calculateShapeEdges=function(t,e,i,s,r){var a=[];e<=1?a.push({s:t,e}):t>=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n=[],p,h=a.length,y;for(p=0;ps+i)){var P,c;y.s*r<=s?P=0:P=(y.s*r-s)/i,y.e*r>=s+i?c=1:c=(y.e*r-s)/i,n.push([P,c]);}return n.length||n.push([0,0]),n},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e1?e=1+s:this.s.v<0?e=0+s:e=this.s.v+s,this.e.v>1?i=1+s:this.e.v<0?i=0+s:i=this.e.v+s,e>i){var r=e;e=i,i=r;}e=Math.round(e*1e4)*1e-4,i=Math.round(i*1e4)*1e-4,this.sValue=e,this.eValue=i;}else e=this.sValue,i=this.eValue;var a,n,p=this.shapes.length,h,y,P,c,l,E=0;if(i===e)for(n=0;n=0;n-=1)if(v=this.shapes[n],v.shape._mdf){for(w=v.localShapeCollection,w.releaseShapes(),this.m===2&&p>1?(_=this.calculateShapeEdges(e,i,v.totalShapeLength,g,E),g+=v.totalShapeLength):_=[[u,f]],y=_.length,h=0;h=1?b.push({s:v.totalShapeLength*(u-1),e:v.totalShapeLength*(f-1)}):(b.push({s:v.totalShapeLength*u,e:v.totalShapeLength}),b.push({s:0,e:v.totalShapeLength*(f-1)}));var k=this.addShapes(v,b[0]);if(b[0].s!==b[0].e){if(b.length>1){var z=v.shape.paths.shapes[v.shape.paths._length-1];if(z.c){var q=k.pop();this.addPaths(k,w),k=this.addShapes(v,b[1],q);}else this.addPaths(k,w),k=this.addShapes(v,b[1]);}this.addPaths(k,w);}}v.shape.paths=w;}}},TrimModifier.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;ie.e){i.c=!1;break}else e.s<=y&&e.e>=y+P.addedLength?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[p],r[a].v[p],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[p],r[a].o[p-1],r[a].i[p],(e.s-y)/P.addedLength,(e.e-y)/P.addedLength,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1),y+=P.addedLength,c+=1;if(r[a].c&&l.length){if(P=l[p-1],y<=e.e){var u=l[p-1].addedLength;e.s<=y&&e.e>=y+u?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[0],r[a].v[0],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[0],r[a].o[p-1],r[a].i[0],(e.s-y)/u,(e.e-y)/u,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1);}else i.c=!1;y+=P.addedLength,c+=1;}if(i._length&&(i.setXYAt(i.v[v][0],i.v[v][1],"i",v),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),y>e.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(P=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/y,0),c=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/y,0)):(P=this.p.pv,c=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/y,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){P=[],c=[];var l=this.px,E=this.py;l._caching.lastFrame+l.offsetTime<=l.keyframes[0].t?(P[0]=l.getValueAtTime((l.keyframes[0].t+.01)/y,0),P[1]=E.getValueAtTime((E.keyframes[0].t+.01)/y,0),c[0]=l.getValueAtTime(l.keyframes[0].t/y,0),c[1]=E.getValueAtTime(E.keyframes[0].t/y,0)):l._caching.lastFrame+l.offsetTime>=l.keyframes[l.keyframes.length-1].t?(P[0]=l.getValueAtTime(l.keyframes[l.keyframes.length-1].t/y,0),P[1]=E.getValueAtTime(E.keyframes[E.keyframes.length-1].t/y,0),c[0]=l.getValueAtTime((l.keyframes[l.keyframes.length-1].t-.01)/y,0),c[1]=E.getValueAtTime((E.keyframes[E.keyframes.length-1].t-.01)/y,0)):(P=[l.pv,E.pv],c[0]=l.getValueAtTime((l._caching.lastFrame+l.offsetTime-.01)/y,l.offsetTime),c[1]=E.getValueAtTime((E._caching.lastFrame+E.offsetTime-.01)/y,E.offsetTime));}else c=t,P=c;this.v.rotate(-Math.atan2(P[1]-c[1],P[0]-c[0]));}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);}this.frameId=this.elem.globalData.frameId;}}function s(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4);}function r(){}function a(h){this._addDynamicProperty(h),this.elem.addDynamicProperty(h),this._isDirty=!0;}function n(h,y,P){if(this.elem=h,this.frameId=-1,this.propType="transform",this.data=y,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(P||h),y.p&&y.p.s?(this.px=PropertyFactory.getProp(h,y.p.x,0,0,this),this.py=PropertyFactory.getProp(h,y.p.y,0,0,this),y.p.z&&(this.pz=PropertyFactory.getProp(h,y.p.z,0,0,this))):this.p=PropertyFactory.getProp(h,y.p||{k:[0,0,0]},1,0,this),y.rx){if(this.rx=PropertyFactory.getProp(h,y.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(h,y.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(h,y.rz,0,degToRads,this),y.or.k[0].ti){var c,l=y.or.k.length;for(c=0;c0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0);},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e0?Math.floor(l):Math.ceil(l),v=this.pMatrix.props,w=this.rMatrix.props,u=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var f=0;if(l>0){for(;fb;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),f-=1;E&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-E,!0),f-=E);}s=this.data.m===1?0:this._currentCopies-1,r=this.data.m===1?1:-1,a=this._currentCopies;for(var g,_;a;){if(e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,_=i.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),f!==0){for((s!==0&&r===1||s!==this._currentCopies-1&&r===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],w[8],w[9],w[10],w[11],w[12],w[13],w[14],w[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),g=0;g<_;g+=1)i[g]=this.matrix.props[g];this.matrix.reset();}else for(this.matrix.reset(),g=0;g<_;g+=1)i[g]=this.matrix.props[g];f+=1,a-=1,s+=r;}}else for(a=this._currentCopies,s=0,r=1;a;)e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,s+=r;return n},RepeaterModifier.prototype.addShape=function(){};function RoundCornersModifier(){}extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length;},RoundCornersModifier.prototype.processPath=function(t,e){var i=shapePool.newElement();i.c=t.c;var s,r=t._length,a,n,p,h,y,P,c=0,l,E,b,v,w,u;for(s=0;s0&&s<1?[e]:[]:[e-s,e+s].filter(function(r){return r>0&&r<1})},PolynomialBezier.prototype.split=function(t){if(t<=0)return [singlePoint(this.points[0]),this];if(t>=1)return [this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),i=lerpPoint(this.points[1],this.points[2],t),s=lerpPoint(this.points[2],this.points[3],t),r=lerpPoint(e,i,t),a=lerpPoint(i,s,t),n=lerpPoint(r,a,t);return [new PolynomialBezier(this.points[0],e,r,n,!0),new PolynomialBezier(n,a,s,this.points[3],!0)]};function extrema(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var r=s;s=i,i=r;}for(var a=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),n=0;n0&&a[n]<1){var p=t.point(a[n])[e];ps&&(s=p);}return {min:i,max:s}}PolynomialBezier.prototype.bounds=function(){return {x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return {left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}};function intersectData(t,e,i){var s=t.boundingBox();return {cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function splitData(t){var e=t.bez.split(.5);return [intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return Math.abs(t.cx-e.cx)*2=a||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s){r.push([t.t,e.t]);return}var n=splitData(t),p=splitData(e);intersectsImpl(n[0],p[0],i+1,s,r,a),intersectsImpl(n[0],p[1],i+1,s,r,a),intersectsImpl(n[1],p[0],i+1,s,r,a),intersectsImpl(n[1],p[1],i+1,s,r,a);}}PolynomialBezier.prototype.intersections=function(t,e,i){e===void 0&&(e=2),i===void 0&&(i=7);var s=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,s,i),s},PolynomialBezier.shapeSegment=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[i],t.v[i],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[i],t.i[i],t.o[e],t.v[e],!0)};function crossProduct(t,e){return [t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,i,s){var r=[t[0],t[1],1],a=[e[0],e[1],1],n=[i[0],i[1],1],p=[s[0],s[1],1],h=crossProduct(crossProduct(r,a),crossProduct(n,p));return floatZero(h[2])?null:[h[0]/h[2],h[1]/h[2]]}function polarOffset(t,e,i){return [t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0;};function setPoint(t,e,i,s,r,a,n){var p=i-Math.PI/2,h=i+Math.PI/2,y=e[0]+Math.cos(i)*s*r,P=e[1]-Math.sin(i)*s*r;t.setTripleAt(y,P,y+Math.cos(p)*a,P-Math.sin(p)*a,y+Math.cos(h)*n,P-Math.sin(h)*n,t.length());}function getPerpendicularVector(t,e){var i=[e[0]-t[0],e[1]-t[1]],s=-Math.PI*.5,r=[Math.cos(s)*i[0]-Math.sin(s)*i[1],Math.sin(s)*i[0]+Math.cos(s)*i[1]];return r}function getProjectingAngle(t,e){var i=e===0?t.length()-1:e-1,s=(e+1)%t.length(),r=t.v[i],a=t.v[s],n=getPerpendicularVector(r,a);return Math.atan2(0,1)-Math.atan2(n[1],n[0])}function zigZagCorner(t,e,i,s,r,a,n){var p=getProjectingAngle(e,i),h=e.v[i%e._length],y=e.v[i===0?e._length-1:i-1],P=e.v[(i+1)%e._length],c=a===2?Math.sqrt(Math.pow(h[0]-y[0],2)+Math.pow(h[1]-y[1],2)):0,l=a===2?Math.sqrt(Math.pow(h[0]-P[0],2)+Math.pow(h[1]-P[1],2)):0;setPoint(t,e.v[i%e._length],p,n,s,l/((r+1)*2),c/((r+1)*2));}function zigZagSegment(t,e,i,s,r,a){for(var n=0;n1&&e.length>1&&(r=getIntersection(t[0],e[e.length-1]),r)?[[t[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[i,s]}function pruneIntersections(t){for(var e,i=1;i1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var i=t.inflectionPoints(),s,r,a,n;if(i.length===0)return [offsetSegment(t,e)];if(i.length===1||floatEqual(i[1],1))return a=t.split(i[0]),s=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(r,e)];a=t.split(i[0]),s=a[0];var p=(i[1]-i[0])/(1-i[0]);return a=a[1].split(p),n=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(n,e),offsetSegment(r,e)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(t,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=this.amount.effectsSequence.length!==0;},OffsetPathModifier.prototype.processPath=function(t,e,i,s){var r=shapePool.newElement();r.c=t.c;var a=t.length();t.c||(a-=1);var n,p,h,y=[];for(n=0;n=0;n-=1)h=PolynomialBezier.shapeSegmentInverted(t,n),y.push(offsetSegmentSplit(h,e));y=pruneIntersections(y);var P=null,c=null;for(n=0;n0&&(Gt=!1),Gt){var Ht=createTag("style");Ht.setAttribute("f-forigin",S[R].fOrigin),Ht.setAttribute("f-origin",S[R].origin),Ht.setAttribute("f-family",S[R].fFamily),Ht.type="text/css",Ht.innerText="@font-face {font-family: "+S[R].fFamily+"; font-style: normal; src: url('"+S[R].fPath+"');}",V.appendChild(Ht);}}else if(S[R].fOrigin==="g"||S[R].origin===1){for(Vt=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),Xt=0;Xt=55296&&S<=56319){var R=D.charCodeAt(1);R>=56320&&R<=57343&&(V=(S-55296)*1024+R-56320+65536);}return V}function z(D,V){var S=D.toString(16)+V.toString(16);return c.indexOf(S)!==-1}function q(D){return D===h}function W(D){return D===p}function ot(D){var V=k(D);return V>=y&&V<=P}function mt(D){return ot(D.substr(0,2))&&ot(D.substr(2,2))}function gt(D){return i.indexOf(D)!==-1}function ut(D,V){var S=k(D.substr(V,2));if(S!==s)return !1;var R=0;for(V+=2;R<5;){if(S=k(D.substr(V,2)),Sn)return !1;R+=1,V+=2;}return k(D.substr(V,2))===r}function Ct(){this.isLoaded=!0;}var ht=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this);};ht.isModifier=z,ht.isZeroWidthJoiner=q,ht.isFlagEmoji=mt,ht.isRegionalCode=ot,ht.isCombinedCharacter=gt,ht.isRegionalFlag=ut,ht.isVariationSelector=W,ht.BLACK_FLAG_CODE_POINT=s;var yt={addChars:u,addFonts:w,getCharData:f,getFontByName:_,measureText:g,checkLoadedFonts:b,setIsLoaded:Ct};return ht.prototype=yt,ht}();function SlotManager(t){this.animationData=t;}SlotManager.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t};function slotFactory(t){return new SlotManager(t)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[];},addRenderableComponent:function(t){this.renderableComponents.indexOf(t)===-1&&this.renderableComponents.push(t);},removeRenderableComponent:function(t){this.renderableComponents.indexOf(t)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1);},prepareRenderableFrame:function(t){this.checkLayerLimits(t);},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show());},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide());},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0));},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1;},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1;},AudioElement.prototype.resume=function(){this._canPlay=!0;},AudioElement.prototype.setRate=function(t){this.audio.rate(t);},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume);},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(t){var e,i=this.layers.length,s;for(this.completeLayers=!0,e=i-1;e>=0;e-=1)this.elements[e]||(s=this.layers[e],s.ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements();},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",l),this.element.maskedElement.setAttribute(f,"url("+getLocationHref()+"#"+l+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this);}MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e=this.element.finalTransform.mat,i,s=this.masksProperties.length;for(i=0;i1&&(s+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==s){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+s:s),i.elem.setAttribute("d",n)),i.lastPath=s;}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null;};var filtersFactory=function(){var t={};t.createFilter=e,t.createAlphaToLuminanceFilter=i;function e(s,r){var a=createNS("filter");return a.setAttribute("id",s),r!==!0&&(a.setAttribute("filterUnits","objectBoundingBox"),a.setAttribute("x","0%"),a.setAttribute("y","0%"),a.setAttribute("width","100%"),a.setAttribute("height","100%")),a}function i(){var s=createNS("feColorMatrix");return s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),s}return t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return (/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects={},idPrefix="filter_result_";function SVGEffects(t){var e,i="SourceGraphic",s=t.data.ef?t.data.ef.length:0,r=createElementID(),a=filtersFactory.createFilter(r,!0),n=0;this.filters=[];var p;for(e=0;e=0&&(i=this.shapeModifiers[t].processShapes(this._isFirstFrame),!i);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i.01)return !1;i+=1;}return !0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return !1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t0;)u=l.transformers[ot].mProps._mdf||u,W-=1,ot-=1;if(u)for(W=k-l.styles[g].lvl,ot=l.transformers.length-1;W>0;)q.multiply(l.transformers[ot].mProps.v),W-=1,ot-=1;}else q=t;if(z=l.sh.paths,v=z._length,u){for(w="",b=0;b=1?Ct=.99:Ct<=-1&&(Ct=-.99);var ht=gt*Ct,yt=Math.cos(ut+l.a.v)*ht+w[0],D=Math.sin(ut+l.a.v)*ht+w[1];b.setAttribute("fx",yt),b.setAttribute("fy",D),v&&!l.g._collapsable&&(l.of.setAttribute("fx",yt),l.of.setAttribute("fy",D));}}}function P(c,l,E){var b=l.style,v=l.d;v&&(v._mdf||E)&&v.dashStr&&(b.pElem.setAttribute("stroke-dasharray",v.dashStr),b.pElem.setAttribute("stroke-dashoffset",v.dashoffset[0])),l.c&&(l.c._mdf||E)&&b.pElem.setAttribute("stroke","rgb("+bmFloor(l.c.v[0])+","+bmFloor(l.c.v[1])+","+bmFloor(l.c.v[2])+")"),(l.o._mdf||E)&&b.pElem.setAttribute("stroke-opacity",l.o.v),(l.w._mdf||E)&&(b.pElem.setAttribute("stroke-width",l.w.v),b.msElem&&b.msElem.setAttribute("stroke-width",l.w.v));}return i}();function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[];}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e=this.shapes.length,i,s,r=this.stylesList.length,a,n=[],p=!1;for(s=0;s1&&p&&this.setShapesAsAnimated(n);}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e=0;h-=1){if(w=this.searchProcessedElement(t[h]),w?e[h]=i[w-1]:t[h]._render=n,t[h].ty==="fl"||t[h].ty==="st"||t[h].ty==="gf"||t[h].ty==="gs"||t[h].ty==="no")w?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],r),t[h]._render&&e[h].style.pElem.parentNode!==s&&s.appendChild(e[h].style.pElem),l.push(e[h].style);else if(t[h].ty==="gr"){if(!w)e[h]=this.createGroupElement(t[h]);else for(c=e[h].it.length,P=0;P1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this);},TextProperty.prototype.getValue=function(t){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!t)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var s,r=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(s=0;se);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e=[],i=0,s=t.length,r,a,n=!1,p=!1,h="";i=55296&&r<=56319?FontManager.isRegionalFlag(t,i)?h=t.substr(i,14):(a=t.charCodeAt(i+1),a>=56320&&a<=57343&&(FontManager.isModifier(r,a)?(h=t.substr(i,2),n=!0):FontManager.isFlagEmoji(t.substr(i,4))?h=t.substr(i,4):h=t.substr(i,2))):r>56319?(a=t.charCodeAt(i+1),FontManager.isVariationSelector(r)&&(n=!0)):FontManager.isZeroWidthJoiner(r)&&(n=!0,p=!0),n?(e[e.length-1]+=h,n=!1):e.push(h),i+=h.length;return e},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e=this.elem.globalData.fontManager,i=this.data,s=[],r,a,n,p=0,h,y=i.m.g,P=0,c=0,l=0,E=[],b=0,v=0,w,u,f=e.getFontByName(t.f),g,_=0,k=getFontProperties(f);t.fWeight=k.weight,t.fStyle=k.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),a=t.finalText.length,t.finalLineHeight=t.lh;var z=t.tr/1e3*t.finalSize,q;if(t.sz)for(var W=!0,ot=t.sz[0],mt=t.sz[1],gt,ut;W;){ut=this.buildFinalText(t.t),gt=0,b=0,a=ut.length,z=t.tr/1e3*t.finalSize;var Ct=-1;for(r=0;rot&&ut[r]!==" "?(Ct===-1?a+=1:r=Ct,gt+=t.finalLineHeight||t.finalSize*1.2,ut.splice(r,Ct===r?1:0,"\r"),Ct=-1,b=0):(b+=_,b+=z);gt+=f.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&mtv?b:v,b=-2*z,h="",n=!0,l+=1):h=yt,e.chars?(g=e.getCharData(yt,f.fStyle,e.getFontByName(t.f).fFamily),_=n?0:g.w*t.finalSize/100):_=e.measureText(h,t.f,t.finalSize),yt===" "?ht+=_+z:(b+=_+z+ht,ht=0),s.push({l:_,an:_,add:P,n,anIndexes:[],val:h,line:l,animatorJustifyOffset:0}),y==2){if(P+=_,h===""||h===" "||r===a-1){for((h===""||h===" ")&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;p+=1,P=0;}}else if(y==3){if(P+=_,h===""||r===a-1){for(h===""&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;P=0,p+=1;}}else s[p].ind=p,s[p].extra=0,p+=1;if(t.l=s,v=b>v?b:v,E.push(b),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0;}t.lineWidths=E;var D=i.a,V,S;u=D.length;var R,tt,J=[];for(w=0;w0?n=this.ne.v/100:p=-this.ne.v/100,this.xe.v>0?h=1-this.xe.v/100:y=1+this.xe.v/100;var P=BezierFactory.getBezierEasing(n,p,h,y).get,c=0,l=this.finalS,E=this.finalE,b=this.data.sh;if(b===2)E===l?c=a>=E?1:0:c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===3)E===l?c=a>=E?0:1:c=1-t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===4)E===l?c=0:(c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c<.5?c*=2:c=1-2*(c-.5)),c=P(c);else if(b===5){if(E===l)c=0;else {var v=E-l;a=e(t(0,a+.5-l),E-l);var w=-v/2+a,u=v/2;c=Math.sqrt(1-w*w/(u*u));}c=P(c);}else b===6?(E===l?c=0:(a=e(t(0,a+.5-l),E-l),c=(1+Math.cos(Math.PI+Math.PI*2*a/(E-l)))/2),c=P(c)):(a>=i(l)&&(a-l<0?c=t(0,e(e(E,1)-(l-a),1)):c=t(0,e(E-a,1))),c=P(c));if(this.sm.v!==100){var f=this.sm.v*.01;f===0&&(f=1e-8);var g=.5-f*.5;c1&&(c=1));}return c*this.a.v},getValue:function(a){this.iterateDynamicProperties(),this._mdf=a||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,a&&this.data.r===2&&(this.e.v=this._currentTextLength);var n=this.data.r===2?1:100/this.data.totalChars,p=this.o.v/n,h=this.s.v/n+p,y=this.e.v/n+p;if(h>y){var P=h;h=y,y=P;}this.finalS=h,this.finalE=y;}},extendPrototype([DynamicPropertyContainer],s);function r(a,n,p){return new s(a,n)}return {getTextSelectorProp:r}}();function TextAnimatorDataProperty(t,e,i){var s={propType:!1},r=PropertyFactory.getProp,a=e.a;this.a={r:a.r?r(t,a.r,0,degToRads,i):s,rx:a.rx?r(t,a.rx,0,degToRads,i):s,ry:a.ry?r(t,a.ry,0,degToRads,i):s,sk:a.sk?r(t,a.sk,0,degToRads,i):s,sa:a.sa?r(t,a.sa,0,degToRads,i):s,s:a.s?r(t,a.s,1,.01,i):s,a:a.a?r(t,a.a,1,0,i):s,o:a.o?r(t,a.o,0,.01,i):s,p:a.p?r(t,a.p,1,0,i):s,sw:a.sw?r(t,a.sw,0,0,i):s,sc:a.sc?r(t,a.sc,1,0,i):s,fc:a.fc?r(t,a.fc,1,0,i):s,fh:a.fh?r(t,a.fh,0,0,i):s,fs:a.fs?r(t,a.fs,0,.01,i):s,fb:a.fb?r(t,a.fb,0,.01,i):s,t:a.t?r(t,a.t,0,0,i):s},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t;}function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i);}TextAnimatorProperty.prototype.searchProperties=function(){var t,e=this._textData.a.length,i,s=PropertyFactory.getProp;for(t=0;t=b+oe||!k?(ot=(b+oe-w)/v.partialLength,Xt=_.point[0]+(v.point[0]-_.point[0])*ot,Ht=_.point[1]+(v.point[1]-_.point[1])*ot,a.translate(-i[0]*l[P].an*.005,-(i[1]*ht)*.01),u=!1):k&&(w+=v.partialLength,f+=1,f>=k.length&&(f=0,g+=1,z[g]?k=z[g].points:gt.v.c?(f=0,g=0,k=z[g].points):(w-=v.partialLength,k=null)),k&&(_=v,v=k[f],q=v.partialLength));Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0);}else Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0),a.translate(-i[0]*l[P].an*.005,-i[1]*ht*.01,0);for(S=0;St?this.textSpans[t].span:createNS(p?"g":"text"),g<=t){if(h.setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=h,p){var k=createNS("g");h.appendChild(k),this.textSpans[t].childSpan=k;}this.textSpans[t].span=h,this.layerElement.appendChild(h);}h.style.display="inherit";}if(y.reset(),c&&(n[t].n&&(l=-v,E+=i.yOffset,E+=b?1:0,b=!1),this.applyTextPropertiesToMatrix(i,y,n[t].line,l,E),l+=n[t].l||0,l+=v),p){_=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily);var z;if(_.t===1)z=new SVGCompElement(_.data,this.globalData,this);else {var q=emptyShapeData;_.data&&_.data.shapes&&(q=this.buildShapeData(_.data,i.finalSize)),z=new SVGShapeElement(q,this.globalData,this);}if(this.textSpans[t].glyph){var W=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(W.layerElement),W.destroy();}this.textSpans[t].glyph=z,z._debug=!0,z.prepareFrame(0),z.renderFrame(),this.textSpans[t].childSpan.appendChild(z.layerElement),_.t===1&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")");}else c&&h.setAttribute("transform","translate("+y.props[12]+","+y.props[13]+")"),h.textContent=n[t].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");}c&&h&&h.setAttribute("d",P);}for(;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0));}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t=y;)mt/=2,gt/=2,ut>>>=1;return (mt+ut)/gt};return ot.int32=function(){return W.g(4)|0},ot.quick=function(){return W.g(4)/4294967296},ot.double=ot,w(f(W.S),t),(_.pass||k||function(mt,gt,ut,Ct){return Ct&&(Ct.S&&b(Ct,W),mt.state=function(){return b(W,{})}),ut?(e[n]=mt,gt):mt})(ot,q,"global"in _?_.global:this==e,_.state)}e["seed"+n]=l;function E(g){var _,k=g.length,z=this,q=0,W=z.i=z.j=0,ot=z.S=[];for(k||(g=[k++]);qi){var s=i;i=e,e=s;}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if(typeof t=="number"||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var i,s=Math.min(t.length,e.length),r=0;for(i=0;i.5?y/(2-r-a):y/(r+a),r){case e:n=(i-s)/y+(i1&&(i-=1),i<1/6?t+(e-t)*6*i:i<1/2?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e=t[0],i=t[1],s=t[2],r,a,n;if(i===0)r=s,n=s,a=s;else {var p=s<.5?s*(1+i):s+i-s*i,h=2*s-p;r=hue2rgb(h,p,e+1/3),a=hue2rgb(h,p,e),n=hue2rgb(h,p,e-1/3);}return [r,a,n,t[3]]}function linear(t,e,i,s,r){if((s===void 0||r===void 0)&&(s=e,r=i,e=0,i=1),i=i)return r;var n=i===e?0:(t-e)/(i-e);if(!s.length)return s+(r-s)*n;var p,h=s.length,y=createTypedArray("float32",h);for(p=0;p1){for(r=0;r1?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(r)){var p,h=r.length,y=createTypedArray("float32",h);for(p=0;pdata.k[e].t&&tdata.k[e+1].t-t?(s=e+2,r=data.k[e+1].t):(s=e+1,r=data.k[e].t);break}s===-1&&(s=e+1,r=data.k[e].t);}var a={};return a.index=s,a.time=r/elem.comp.globalData.frameRate,a}function key(t){var e,i,s;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(s=r.length,i=0;iw.length-1)&&(E=w.length-1),g=w[w.length-1-E].t,f=u-g);var _,k,z;if(l==="pingpong"){var q=Math.floor((v-g)/f);if(q%2!==0)return this.getValueAtTime((f-(v-g)%f+g)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(g/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(u/this.comp.globalData.frameRate,0),mt=this.getValueAtTime(((v-g)%f+g)/this.comp.globalData.frameRate,0),gt=Math.floor((v-g)/f);if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_=u)return this.pv;var f,g;b?(E?f=Math.abs(this.elem.comp.globalData.frameRate*E):f=Math.max(0,this.elem.data.op-u),g=u+f):((!E||E>w.length-1)&&(E=w.length-1),g=w[E].t,f=g-u);var _,k,z;if(l==="pingpong"){var q=Math.floor((u-v)/f);if(q%2===0)return this.getValueAtTime(((u-v)%f+u)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(u/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(g/this.comp.globalData.frameRate,0),mt=this.getValueAtTime((f-(u-v)%f+u)/this.comp.globalData.frameRate,0),gt=Math.floor((u-v)/f)+1;if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_1?(w-v)/(E-1):1,f=0,g=0,_;this.pv.length?_=createTypedArray("float32",this.pv.length):_=0;for(var k;fu){var z=f,q=b.c&&f===g-1?0:f+1,W=(u-_)/w[f].addedLength;k=bez.getPointInSegment(b.v[z],b.v[q],b.o[z],b.i[q],W,w[f]);break}else _+=w[f].addedLength;f+=1;}return k||(k=b.c?[b.v[0][0],b.v[0][1]]:[b.v[b._length-1][0],b.v[b._length-1][1]]),k},vectorOnPath:function(l,E,b){l==1?l=this.v.c:l==0&&(l=.999);var v=this.pointOnPath(l,E),w=this.pointOnPath(l+.001,E),u=w[0]-v[0],f=w[1]-v[1],g=Math.sqrt(Math.pow(u,2)+Math.pow(f,2));if(g===0)return [0,0];var _=b==="tangent"?[u/g,f/g]:[-f/g,u/g];return _},tangentOnPath:function(l,E){return this.vectorOnPath(l,E,"tangent")},normalOnPath:function(l,E){return this.vectorOnPath(l,E,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([P],h),extendPrototype([P],y),y.prototype.getValueAtTime=p,y.prototype.initiateExpression=ExpressionManager.initiateExpression;var c=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(l,E,b,v,w){var u=c(l,E,b,v,w);return u.propertyIndex=E.ix,u.lock=!1,b===3?expressionHelpers.searchExpressions(l,E.pt,u):b===4&&expressionHelpers.searchExpressions(l,E.ks,u),u.k&&l.addDynamicProperty(u),u};}function initialize$1(){addPropertyDecorator();}function addDecorator(){function t(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(e,i){var s=this.calculateExpression(i);if(e.t!==s){var r={};return this.copyData(r,e),r.t=s.toString(),r.__complete=!1,r}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),i=this.searchExpressions();return this.kf=e||i,this.kf},TextProperty.prototype.searchExpressions=t;}function initialize(){addDecorator();}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function t(e,i){var s=createNS("feMerge");s.setAttribute("result",e);var r,a;for(a=0;a=y?c=b<0?s:r:c=s+E*Math.pow((p-t)/b,1/i),P[l]=c,l+=1,a+=256/(n-1);return P.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e));}};function SVGDropShadowEffect(t,e,i,s,r){var a=e.container.globalData.renderConfig.filterSize,n=e.data.fs||a;t.setAttribute("x",n.x||a.x),t.setAttribute("y",n.y||a.y),t.setAttribute("width",n.width||a.width),t.setAttribute("height",n.height||a.height),this.filterManager=e;var p=createNS("feGaussianBlur");p.setAttribute("in","SourceAlpha"),p.setAttribute("result",s+"_drop_shadow_1"),p.setAttribute("stdDeviation","0"),this.feGaussianBlur=p,t.appendChild(p);var h=createNS("feOffset");h.setAttribute("dx","25"),h.setAttribute("dy","0"),h.setAttribute("in",s+"_drop_shadow_1"),h.setAttribute("result",s+"_drop_shadow_2"),this.feOffset=h,t.appendChild(h);var y=createNS("feFlood");y.setAttribute("flood-color","#00ff00"),y.setAttribute("flood-opacity","1"),y.setAttribute("result",s+"_drop_shadow_3"),this.feFlood=y,t.appendChild(y);var P=createNS("feComposite");P.setAttribute("in",s+"_drop_shadow_3"),P.setAttribute("in2",s+"_drop_shadow_2"),P.setAttribute("operator","in"),P.setAttribute("result",s+"_drop_shadow_4"),t.appendChild(P);var c=this.createMergeNode(s,[s+"_drop_shadow_4",r]);t.appendChild(c);}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(e[0]*255),Math.round(e[1]*255),Math.round(e[2]*255)));}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,s=(this.filterManager.effectElements[2].p.v-90)*degToRads,r=i*Math.cos(s),a=i*Math.sin(s);this.feOffset.setAttribute("dx",r),this.feOffset.setAttribute("dy",a);}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=i,i.matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement;}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,i=_svgMatteSymbols.length;eSc});var Pc,Sc,Sl=ls(()=>{qs();Pc=is((t,e)=>{typeof navigator<"u"&&function(i,s){typeof t=="object"&&typeof e<"u"?e.exports=s():typeof define=="function"&&define.amd?define(s):(i=typeof globalThis<"u"?globalThis:i||self,i.lottie=s());}(t,function(){var i="http://www.w3.org/2000/svg",s="",r=!1,a=-999999,n=function(o){r=!!o;},p=function(){return r},h=function(o){s=o;},y=function(){return s};function P(o){return document.createElement(o)}function c(o,d){var x,M=o.length,L;for(x=0;x1?x[1]=1:x[1]<=0&&(x[1]=0),R(x[0],x[1],x[2])}function Gt(o,d){var x=tt(o[0]*255,o[1]*255,o[2]*255);return x[2]+=d,x[2]>1?x[2]=1:x[2]<0&&(x[2]=0),R(x[0],x[1],x[2])}function Vt(o,d){var x=tt(o[0]*255,o[1]*255,o[2]*255);return x[0]+=d/360,x[0]>1?x[0]-=1:x[0]<0&&(x[0]+=1),R(x[0],x[1],x[2])}(function(){var o=[],d,x;for(d=0;d<256;d+=1)x=d.toString(16),o[d]=x.length===1?"0"+x:x;return function(M,L,I){return M<0&&(M=0),L<0&&(L=0),I<0&&(I=0),"#"+o[M]+o[L]+o[I]}})();var Xt=function(o){w=!!o;},Ht=function(){return w},Qt=function(o){u=o;},Zt=function(){return u},ne=function(o){W=o;},ue=function(){return W},pe=function(o){f=o;};function Wt(o){return document.createElementNS(i,o)}function fe(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(d){return typeof d}:fe=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},fe(o)}var jt=function(){var o=1,d=[],x,M,L={onmessage:function(){},postMessage:function(X){x({data:X});}},I={postMessage:function(X){L.onmessage({data:X});}};function H(X){if(window.Worker&&window.Blob&&p()){var $=new Blob(["var _workerSelf = self; self.onmessage = ",X.toString()],{type:"text/javascript"}),Y=URL.createObjectURL($);return new Worker(Y)}return x=X,L}function Q(){M||(M=H(function(X){function $(){function N(Dt,Et){var Pt,kt,ct=Dt.length,wt,qt,zt,re;for(kt=0;kt=0;Et-=1)if(Dt[Et].ty==="sh")if(Dt[Et].ks.k.i)dt(Dt[Et].ks.k);else for(ct=Dt[Et].ks.k.length,kt=0;ktPt[0]?!0:Pt[0]>Dt[0]?!1:Dt[1]>Pt[1]?!0:Pt[1]>Dt[1]?!1:Dt[2]>Pt[2]?!0:Pt[2]>Dt[2]?!1:null}var Lt=function(){var Dt=[4,4,14];function Et(kt){var ct=kt.t.d;kt.t.d={k:[{s:ct,t:0}]};}function Pt(kt){var ct,wt=kt.length;for(ct=0;ct=0;ct-=1)if(kt[ct].ty==="sh")if(kt[ct].ks.k.i)kt[ct].ks.k.c=kt[ct].closed;else for(zt=kt[ct].ks.k.length,qt=0;qt500)&&(this._imageLoaded(),clearInterval(ft)),K+=1;}.bind(this),50);}function I(nt){var K=M(nt,this.assetsPath,this.path),ft=Wt("image");g?this.testImageLoaded(ft):ft.addEventListener("load",this._imageLoaded,!1),ft.addEventListener("error",function(){dt.img=o,this._imageLoaded();}.bind(this),!1),ft.setAttributeNS("http://www.w3.org/1999/xlink","href",K),this._elementHelper.append?this._elementHelper.append(ft):this._elementHelper.appendChild(ft);var dt={img:ft,assetData:nt};return dt}function H(nt){var K=M(nt,this.assetsPath,this.path),ft=P("img");ft.crossOrigin="anonymous",ft.addEventListener("load",this._imageLoaded,!1),ft.addEventListener("error",function(){dt.img=o,this._imageLoaded();}.bind(this),!1),ft.src=K;var dt={img:ft,assetData:nt};return dt}function Q(nt){var K={assetData:nt},ft=M(nt,this.assetsPath,this.path);return jt.loadData(ft,function(dt){K.img=dt,this._footageLoaded();}.bind(this),function(){K.img={},this._footageLoaded();}.bind(this)),K}function Z(nt,K){this.imagesLoadedCb=K;var ft,dt=nt.length;for(ft=0;ftthis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e=this.animationData.layers,i,s=e.length,r=t.layers,a,n=r.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(t){this.triggerRenderFrameError(t);}},AnimationItem.prototype.play=function(t){t&&this.name!==t||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},AnimationItem.prototype.pause=function(t){t&&this.name!==t||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(this.isPaused===!0?this.play():this.pause());},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(i=!0,e=0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"));}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart");},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,i!==-1&&this.goToAndStop(i,!0);},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),_typeof$4(t[0])==="object"){var i,s=t.length;for(i=0;i=0;V-=1)e[V].animation.destroy(D);}function W(D,V,S){var R=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),tt,J=R.length;for(tt=0;tt0?_=W:g=W;while(Math.abs(q)>a&&++ot=r?w(f,mt,g,_):gt===0?mt:v(f,z,z+h,g,_)}},t}(),pooling=function(){function t(e){return e.concat(createSizedArray(e.length))}return {double:t}}(),poolFactory=function(){return function(t,e,i){var s=0,r=t,a=createSizedArray(r),n={newElement:p,release:h};function p(){var y;return s?(s-=1,y=a[s]):y=e(),y}function h(y){s===r&&(a=pooling.double(a),r*=2),i&&i(y),a[s]=y,s+=1;}return n}}(),bezierLengthPool=function(){function t(){return {addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,t)}(),segmentsLengthPool=function(){function t(){return {lengths:[],totalLength:0}}function e(i){var s,r=i.lengths.length;for(s=0;s-.001&&f<.001}function i(l,E,b,v,w,u,f,g,_){if(b===0&&u===0&&_===0)return e(l,E,v,w,f,g);var k=t.sqrt(t.pow(v-l,2)+t.pow(w-E,2)+t.pow(u-b,2)),z=t.sqrt(t.pow(f-l,2)+t.pow(g-E,2)+t.pow(_-b,2)),q=t.sqrt(t.pow(f-v,2)+t.pow(g-w,2)+t.pow(_-u,2)),W;return k>z?k>q?W=k-z-q:W=q-z-k:q>z?W=q-z-k:W=z-k-q,W>-1e-4&&W<1e-4}var s=function(){return function(l,E,b,v){var w=getDefaultCurveSegments(),u,f,g,_,k,z=0,q,W=[],ot=[],mt=bezierLengthPool.newElement();for(g=b.length,u=0;uf?-1:1,k=!0;k;)if(v[u]<=f&&v[u+1]>f?(g=(f-v[u])/(v[u+1]-v[u]),k=!1):u+=_,u<0||u>=w-1){if(u===w-1)return b[u];k=!1;}return b[u]+(b[u+1]-b[u])*g}function y(l,E,b,v,w,u){var f=h(w,u),g=1-f,_=t.round((g*g*g*l[0]+(f*g*g+g*f*g+g*g*f)*b[0]+(f*f*g+g*f*f+f*g*f)*v[0]+f*f*f*E[0])*1e3)/1e3,k=t.round((g*g*g*l[1]+(f*g*g+g*f*g+g*g*f)*b[1]+(f*f*g+g*f*f+f*g*f)*v[1]+f*f*f*E[1])*1e3)/1e3;return [_,k]}var P=createTypedArray("float32",8);function c(l,E,b,v,w,u,f){w<0?w=0:w>1&&(w=1);var g=h(w,f);u=u>1?1:u;var _=h(u,f),k,z=l.length,q=1-g,W=1-_,ot=q*q*q,mt=g*q*q*3,gt=g*g*q*3,ut=g*g*g,Ct=q*q*W,ht=g*q*W+q*g*W+q*q*_,yt=g*g*W+q*g*_+g*q*_,D=g*g*_,V=q*W*W,S=g*W*W+q*_*W+q*W*_,R=g*_*W+q*_*_+g*W*_,tt=g*_*_,J=W*W*W,Gt=_*W*W+W*_*W+W*W*_,Vt=_*_*W+W*_*_+_*W*_,Xt=_*_*_;for(k=0;k=y.t-i){h.h&&(h=y),r=0;break}if(y.t-i>t){r=a;break}a=u||t=u?_.points.length-1:0;for(l=_.points[k].point.length,c=0;c=W&&z=u)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=f)s[0]=h.s[0],s[1]=h.s[1],s[2]=h.s[2];else {var ht=createQuaternion(h.s),yt=createQuaternion(g),D=(t-f)/(u-f);quaternionToEuler(s,slerp(ht,yt,D));}else for(a=0;a=u?E=1:t1e-6?(l=Math.acos(E),b=Math.sin(l),v=Math.sin((1-i)*l)/b,w=Math.sin(i*l)/b):(v=1-i,w=i),s[0]=v*r+w*h,s[1]=v*a+w*y,s[2]=v*n+w*P,s[3]=v*p+w*c,s}function quaternionToEuler(t,e){var i=e[0],s=e[1],r=e[2],a=e[3],n=Math.atan2(2*s*a-2*i*r,1-2*s*s-2*r*r),p=Math.asin(2*i*s+2*r*a),h=Math.atan2(2*i*a-2*s*r,1-2*i*i-2*r*r);t[0]=n/degToRads,t[1]=p/degToRads,t[2]=h/degToRads;}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,s=t[2]*degToRads,r=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(s/2),p=Math.sin(e/2),h=Math.sin(i/2),y=Math.sin(s/2),P=r*a*n-p*h*y,c=p*h*n+r*a*y,l=p*a*n+r*h*y,E=r*h*n-p*a*y;return [c,l,E,P]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s;}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if(this.propType==="unidimensional")e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i1e-5&&(this.v[i]=e,this._mdf=!0),i+=1;}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[];break}(!a[s]||a[s]&&!r)&&(a[s]=pointPool.newElement()),a[s][0]=t,a[s][1]=e;},ShapePath.prototype.setTripleAt=function(t,e,i,s,r,a,n,p){this.setXYAt(t,e,"v",n,p),this.setXYAt(i,s,"o",n,p),this.setXYAt(r,a,"i",n,p);},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,r=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),r=1);var a=this._length-1,n=this._length,p;for(p=r;p=ht[ht.length-1].t-this.offsetTime)k=ht[ht.length-1].s?ht[ht.length-1].s[0]:ht[ht.length-2].e[0],q=!0;else {for(var yt=_,D=ht.length-1,V=!0,S,R,tt;V&&(S=ht[yt],R=ht[yt+1],!(R.t-this.offsetTime>u));)yt=R.t-this.offsetTime)ut=1;else if(ug&&u>g)||(this._caching.lastIndex=_0||S>-1e-6&&S<0?s(S*R)/R:S}function V(){var S=this.props,R=D(S[0]),tt=D(S[1]),J=D(S[4]),Gt=D(S[5]),Vt=D(S[12]),Xt=D(S[13]);return "matrix("+R+","+tt+","+J+","+Gt+","+Vt+","+Xt+")"}return function(){this.reset=r,this.rotate=a,this.rotateX=n,this.rotateY=p,this.rotateZ=h,this.skew=P,this.skewFromAxis=c,this.shear=y,this.scale=l,this.setTransform=E,this.translate=b,this.transform=v,this.multiply=w,this.applyToPoint=k,this.applyToX=z,this.applyToY=q,this.applyToZ=W,this.applyToPointArray=Ct,this.applyToTriplePoints=ut,this.applyToPointStringified=ht,this.toCSS=yt,this.to2dCSS=V,this.clone=g,this.cloneFromProps=_,this.equals=f,this.inversePoints=gt,this.inversePoint=mt,this.getInverseMatrix=ot,this._t=this.transform,this.isIdentity=u,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset();}}();function _typeof$3(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(e){return typeof e}:_typeof$3=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(t)}var lottie={};function setLocation(t){setLocationHref(t);}function searchAnimations(){animationManager.searchAnimations();}function setSubframeRendering(t){setSubframeEnabled(t);}function setPrefix(t){setIdPrefix(t);}function loadAnimation(t){return animationManager.loadAnimation(t)}function setQuality(t){if(typeof t=="string")switch(t){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else !isNaN(t)&&t>1&&setDefaultCurveSegments(t);}function inBrowser(){return typeof navigator<"u"}function installPlugin(t,e){t==="expressions"&&setExpressionsPlugin(e);}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations());}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i"u"?"undefined":_typeof$3(exports))==="object"&&typeof module<"u")&&!(typeof define=="function"&&define.amd)&&(window.bodymovin=lottie);}catch(t){}var ShapeModifiers=function(){var t={},e={};t.registerModifier=i,t.getModifier=s;function i(r,a){e[r]||(e[r]=a);}function s(r,a,n){return new e[r](a,n)}return t}();function ShapeModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated();}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0);},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties());},extendPrototype([DynamicPropertyContainer],ShapeModifier);function TrimModifier(){}extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length;},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[];},TrimModifier.prototype.calculateShapeEdges=function(t,e,i,s,r){var a=[];e<=1?a.push({s:t,e}):t>=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n=[],p,h=a.length,y;for(p=0;ps+i)){var P,c;y.s*r<=s?P=0:P=(y.s*r-s)/i,y.e*r>=s+i?c=1:c=(y.e*r-s)/i,n.push([P,c]);}return n.length||n.push([0,0]),n},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e1?e=1+s:this.s.v<0?e=0+s:e=this.s.v+s,this.e.v>1?i=1+s:this.e.v<0?i=0+s:i=this.e.v+s,e>i){var r=e;e=i,i=r;}e=Math.round(e*1e4)*1e-4,i=Math.round(i*1e4)*1e-4,this.sValue=e,this.eValue=i;}else e=this.sValue,i=this.eValue;var a,n,p=this.shapes.length,h,y,P,c,l,E=0;if(i===e)for(n=0;n=0;n-=1)if(v=this.shapes[n],v.shape._mdf){for(w=v.localShapeCollection,w.releaseShapes(),this.m===2&&p>1?(_=this.calculateShapeEdges(e,i,v.totalShapeLength,g,E),g+=v.totalShapeLength):_=[[u,f]],y=_.length,h=0;h=1?b.push({s:v.totalShapeLength*(u-1),e:v.totalShapeLength*(f-1)}):(b.push({s:v.totalShapeLength*u,e:v.totalShapeLength}),b.push({s:0,e:v.totalShapeLength*(f-1)}));var k=this.addShapes(v,b[0]);if(b[0].s!==b[0].e){if(b.length>1){var z=v.shape.paths.shapes[v.shape.paths._length-1];if(z.c){var q=k.pop();this.addPaths(k,w),k=this.addShapes(v,b[1],q);}else this.addPaths(k,w),k=this.addShapes(v,b[1]);}this.addPaths(k,w);}}v.shape.paths=w;}}},TrimModifier.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;ie.e){i.c=!1;break}else e.s<=y&&e.e>=y+P.addedLength?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[p],r[a].v[p],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[p],r[a].o[p-1],r[a].i[p],(e.s-y)/P.addedLength,(e.e-y)/P.addedLength,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1),y+=P.addedLength,c+=1;if(r[a].c&&l.length){if(P=l[p-1],y<=e.e){var u=l[p-1].addedLength;e.s<=y&&e.e>=y+u?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[0],r[a].v[0],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[0],r[a].o[p-1],r[a].i[0],(e.s-y)/u,(e.e-y)/u,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1);}else i.c=!1;y+=P.addedLength,c+=1;}if(i._length&&(i.setXYAt(i.v[v][0],i.v[v][1],"i",v),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),y>e.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(P=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/y,0),c=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/y,0)):(P=this.p.pv,c=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/y,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){P=[],c=[];var l=this.px,E=this.py;l._caching.lastFrame+l.offsetTime<=l.keyframes[0].t?(P[0]=l.getValueAtTime((l.keyframes[0].t+.01)/y,0),P[1]=E.getValueAtTime((E.keyframes[0].t+.01)/y,0),c[0]=l.getValueAtTime(l.keyframes[0].t/y,0),c[1]=E.getValueAtTime(E.keyframes[0].t/y,0)):l._caching.lastFrame+l.offsetTime>=l.keyframes[l.keyframes.length-1].t?(P[0]=l.getValueAtTime(l.keyframes[l.keyframes.length-1].t/y,0),P[1]=E.getValueAtTime(E.keyframes[E.keyframes.length-1].t/y,0),c[0]=l.getValueAtTime((l.keyframes[l.keyframes.length-1].t-.01)/y,0),c[1]=E.getValueAtTime((E.keyframes[E.keyframes.length-1].t-.01)/y,0)):(P=[l.pv,E.pv],c[0]=l.getValueAtTime((l._caching.lastFrame+l.offsetTime-.01)/y,l.offsetTime),c[1]=E.getValueAtTime((E._caching.lastFrame+E.offsetTime-.01)/y,E.offsetTime));}else c=t,P=c;this.v.rotate(-Math.atan2(P[1]-c[1],P[0]-c[0]));}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);}this.frameId=this.elem.globalData.frameId;}}function s(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4);}function r(){}function a(h){this._addDynamicProperty(h),this.elem.addDynamicProperty(h),this._isDirty=!0;}function n(h,y,P){if(this.elem=h,this.frameId=-1,this.propType="transform",this.data=y,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(P||h),y.p&&y.p.s?(this.px=PropertyFactory.getProp(h,y.p.x,0,0,this),this.py=PropertyFactory.getProp(h,y.p.y,0,0,this),y.p.z&&(this.pz=PropertyFactory.getProp(h,y.p.z,0,0,this))):this.p=PropertyFactory.getProp(h,y.p||{k:[0,0,0]},1,0,this),y.rx){if(this.rx=PropertyFactory.getProp(h,y.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(h,y.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(h,y.rz,0,degToRads,this),y.or.k[0].ti){var c,l=y.or.k.length;for(c=0;c0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0);},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e0?Math.floor(l):Math.ceil(l),v=this.pMatrix.props,w=this.rMatrix.props,u=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var f=0;if(l>0){for(;fb;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),f-=1;E&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-E,!0),f-=E);}s=this.data.m===1?0:this._currentCopies-1,r=this.data.m===1?1:-1,a=this._currentCopies;for(var g,_;a;){if(e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,_=i.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),f!==0){for((s!==0&&r===1||s!==this._currentCopies-1&&r===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],w[8],w[9],w[10],w[11],w[12],w[13],w[14],w[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),g=0;g<_;g+=1)i[g]=this.matrix.props[g];this.matrix.reset();}else for(this.matrix.reset(),g=0;g<_;g+=1)i[g]=this.matrix.props[g];f+=1,a-=1,s+=r;}}else for(a=this._currentCopies,s=0,r=1;a;)e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,s+=r;return n},RepeaterModifier.prototype.addShape=function(){};function RoundCornersModifier(){}extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length;},RoundCornersModifier.prototype.processPath=function(t,e){var i=shapePool.newElement();i.c=t.c;var s,r=t._length,a,n,p,h,y,P,c=0,l,E,b,v,w,u;for(s=0;s0&&s<1?[e]:[]:[e-s,e+s].filter(function(r){return r>0&&r<1})},PolynomialBezier.prototype.split=function(t){if(t<=0)return [singlePoint(this.points[0]),this];if(t>=1)return [this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),i=lerpPoint(this.points[1],this.points[2],t),s=lerpPoint(this.points[2],this.points[3],t),r=lerpPoint(e,i,t),a=lerpPoint(i,s,t),n=lerpPoint(r,a,t);return [new PolynomialBezier(this.points[0],e,r,n,!0),new PolynomialBezier(n,a,s,this.points[3],!0)]};function extrema(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var r=s;s=i,i=r;}for(var a=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),n=0;n0&&a[n]<1){var p=t.point(a[n])[e];ps&&(s=p);}return {min:i,max:s}}PolynomialBezier.prototype.bounds=function(){return {x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return {left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}};function intersectData(t,e,i){var s=t.boundingBox();return {cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function splitData(t){var e=t.bez.split(.5);return [intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return Math.abs(t.cx-e.cx)*2=a||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s){r.push([t.t,e.t]);return}var n=splitData(t),p=splitData(e);intersectsImpl(n[0],p[0],i+1,s,r,a),intersectsImpl(n[0],p[1],i+1,s,r,a),intersectsImpl(n[1],p[0],i+1,s,r,a),intersectsImpl(n[1],p[1],i+1,s,r,a);}}PolynomialBezier.prototype.intersections=function(t,e,i){e===void 0&&(e=2),i===void 0&&(i=7);var s=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,s,i),s},PolynomialBezier.shapeSegment=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[i],t.v[i],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[i],t.i[i],t.o[e],t.v[e],!0)};function crossProduct(t,e){return [t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,i,s){var r=[t[0],t[1],1],a=[e[0],e[1],1],n=[i[0],i[1],1],p=[s[0],s[1],1],h=crossProduct(crossProduct(r,a),crossProduct(n,p));return floatZero(h[2])?null:[h[0]/h[2],h[1]/h[2]]}function polarOffset(t,e,i){return [t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0;};function setPoint(t,e,i,s,r,a,n){var p=i-Math.PI/2,h=i+Math.PI/2,y=e[0]+Math.cos(i)*s*r,P=e[1]-Math.sin(i)*s*r;t.setTripleAt(y,P,y+Math.cos(p)*a,P-Math.sin(p)*a,y+Math.cos(h)*n,P-Math.sin(h)*n,t.length());}function getPerpendicularVector(t,e){var i=[e[0]-t[0],e[1]-t[1]],s=-Math.PI*.5,r=[Math.cos(s)*i[0]-Math.sin(s)*i[1],Math.sin(s)*i[0]+Math.cos(s)*i[1]];return r}function getProjectingAngle(t,e){var i=e===0?t.length()-1:e-1,s=(e+1)%t.length(),r=t.v[i],a=t.v[s],n=getPerpendicularVector(r,a);return Math.atan2(0,1)-Math.atan2(n[1],n[0])}function zigZagCorner(t,e,i,s,r,a,n){var p=getProjectingAngle(e,i),h=e.v[i%e._length],y=e.v[i===0?e._length-1:i-1],P=e.v[(i+1)%e._length],c=a===2?Math.sqrt(Math.pow(h[0]-y[0],2)+Math.pow(h[1]-y[1],2)):0,l=a===2?Math.sqrt(Math.pow(h[0]-P[0],2)+Math.pow(h[1]-P[1],2)):0;setPoint(t,e.v[i%e._length],p,n,s,l/((r+1)*2),c/((r+1)*2));}function zigZagSegment(t,e,i,s,r,a){for(var n=0;n1&&e.length>1&&(r=getIntersection(t[0],e[e.length-1]),r)?[[t[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[i,s]}function pruneIntersections(t){for(var e,i=1;i1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var i=t.inflectionPoints(),s,r,a,n;if(i.length===0)return [offsetSegment(t,e)];if(i.length===1||floatEqual(i[1],1))return a=t.split(i[0]),s=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(r,e)];a=t.split(i[0]),s=a[0];var p=(i[1]-i[0])/(1-i[0]);return a=a[1].split(p),n=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(n,e),offsetSegment(r,e)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(t,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=this.amount.effectsSequence.length!==0;},OffsetPathModifier.prototype.processPath=function(t,e,i,s){var r=shapePool.newElement();r.c=t.c;var a=t.length();t.c||(a-=1);var n,p,h,y=[];for(n=0;n=0;n-=1)h=PolynomialBezier.shapeSegmentInverted(t,n),y.push(offsetSegmentSplit(h,e));y=pruneIntersections(y);var P=null,c=null;for(n=0;n0&&(Gt=!1),Gt){var Ht=createTag("style");Ht.setAttribute("f-forigin",S[R].fOrigin),Ht.setAttribute("f-origin",S[R].origin),Ht.setAttribute("f-family",S[R].fFamily),Ht.type="text/css",Ht.innerText="@font-face {font-family: "+S[R].fFamily+"; font-style: normal; src: url('"+S[R].fPath+"');}",V.appendChild(Ht);}}else if(S[R].fOrigin==="g"||S[R].origin===1){for(Vt=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),Xt=0;Xt=55296&&S<=56319){var R=D.charCodeAt(1);R>=56320&&R<=57343&&(V=(S-55296)*1024+R-56320+65536);}return V}function z(D,V){var S=D.toString(16)+V.toString(16);return c.indexOf(S)!==-1}function q(D){return D===h}function W(D){return D===p}function ot(D){var V=k(D);return V>=y&&V<=P}function mt(D){return ot(D.substr(0,2))&&ot(D.substr(2,2))}function gt(D){return i.indexOf(D)!==-1}function ut(D,V){var S=k(D.substr(V,2));if(S!==s)return !1;var R=0;for(V+=2;R<5;){if(S=k(D.substr(V,2)),Sn)return !1;R+=1,V+=2;}return k(D.substr(V,2))===r}function Ct(){this.isLoaded=!0;}var ht=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this);};ht.isModifier=z,ht.isZeroWidthJoiner=q,ht.isFlagEmoji=mt,ht.isRegionalCode=ot,ht.isCombinedCharacter=gt,ht.isRegionalFlag=ut,ht.isVariationSelector=W,ht.BLACK_FLAG_CODE_POINT=s;var yt={addChars:u,addFonts:w,getCharData:f,getFontByName:_,measureText:g,checkLoadedFonts:b,setIsLoaded:Ct};return ht.prototype=yt,ht}();function SlotManager(t){this.animationData=t;}SlotManager.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t};function slotFactory(t){return new SlotManager(t)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[];},addRenderableComponent:function(t){this.renderableComponents.indexOf(t)===-1&&this.renderableComponents.push(t);},removeRenderableComponent:function(t){this.renderableComponents.indexOf(t)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1);},prepareRenderableFrame:function(t){this.checkLayerLimits(t);},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show());},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide());},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0));},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1;},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1;},AudioElement.prototype.resume=function(){this._canPlay=!0;},AudioElement.prototype.setRate=function(t){this.audio.rate(t);},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume);},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(t){var e,i=this.layers.length,s;for(this.completeLayers=!0,e=i-1;e>=0;e-=1)this.elements[e]||(s=this.layers[e],s.ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements();},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",l),this.element.maskedElement.setAttribute(f,"url("+getLocationHref()+"#"+l+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this);}MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e=this.element.finalTransform.mat,i,s=this.masksProperties.length;for(i=0;i1&&(s+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==s){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+s:s),i.elem.setAttribute("d",n)),i.lastPath=s;}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null;};var filtersFactory=function(){var t={};t.createFilter=e,t.createAlphaToLuminanceFilter=i;function e(s,r){var a=createNS("filter");return a.setAttribute("id",s),r!==!0&&(a.setAttribute("filterUnits","objectBoundingBox"),a.setAttribute("x","0%"),a.setAttribute("y","0%"),a.setAttribute("width","100%"),a.setAttribute("height","100%")),a}function i(){var s=createNS("feColorMatrix");return s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),s}return t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return (/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects={},idPrefix="filter_result_";function SVGEffects(t){var e,i="SourceGraphic",s=t.data.ef?t.data.ef.length:0,r=createElementID(),a=filtersFactory.createFilter(r,!0),n=0;this.filters=[];var p;for(e=0;e=0&&(i=this.shapeModifiers[t].processShapes(this._isFirstFrame),!i);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i.01)return !1;i+=1;}return !0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return !1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t0;)u=l.transformers[ot].mProps._mdf||u,W-=1,ot-=1;if(u)for(W=k-l.styles[g].lvl,ot=l.transformers.length-1;W>0;)q.multiply(l.transformers[ot].mProps.v),W-=1,ot-=1;}else q=t;if(z=l.sh.paths,v=z._length,u){for(w="",b=0;b=1?Ct=.99:Ct<=-1&&(Ct=-.99);var ht=gt*Ct,yt=Math.cos(ut+l.a.v)*ht+w[0],D=Math.sin(ut+l.a.v)*ht+w[1];b.setAttribute("fx",yt),b.setAttribute("fy",D),v&&!l.g._collapsable&&(l.of.setAttribute("fx",yt),l.of.setAttribute("fy",D));}}}function P(c,l,E){var b=l.style,v=l.d;v&&(v._mdf||E)&&v.dashStr&&(b.pElem.setAttribute("stroke-dasharray",v.dashStr),b.pElem.setAttribute("stroke-dashoffset",v.dashoffset[0])),l.c&&(l.c._mdf||E)&&b.pElem.setAttribute("stroke","rgb("+bmFloor(l.c.v[0])+","+bmFloor(l.c.v[1])+","+bmFloor(l.c.v[2])+")"),(l.o._mdf||E)&&b.pElem.setAttribute("stroke-opacity",l.o.v),(l.w._mdf||E)&&(b.pElem.setAttribute("stroke-width",l.w.v),b.msElem&&b.msElem.setAttribute("stroke-width",l.w.v));}return i}();function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[];}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e=this.shapes.length,i,s,r=this.stylesList.length,a,n=[],p=!1;for(s=0;s1&&p&&this.setShapesAsAnimated(n);}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e=0;h-=1){if(w=this.searchProcessedElement(t[h]),w?e[h]=i[w-1]:t[h]._render=n,t[h].ty==="fl"||t[h].ty==="st"||t[h].ty==="gf"||t[h].ty==="gs"||t[h].ty==="no")w?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],r),t[h]._render&&e[h].style.pElem.parentNode!==s&&s.appendChild(e[h].style.pElem),l.push(e[h].style);else if(t[h].ty==="gr"){if(!w)e[h]=this.createGroupElement(t[h]);else for(c=e[h].it.length,P=0;P1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this);},TextProperty.prototype.getValue=function(t){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!t)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var s,r=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(s=0;se);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e=[],i=0,s=t.length,r,a,n=!1,p=!1,h="";i=55296&&r<=56319?FontManager.isRegionalFlag(t,i)?h=t.substr(i,14):(a=t.charCodeAt(i+1),a>=56320&&a<=57343&&(FontManager.isModifier(r,a)?(h=t.substr(i,2),n=!0):FontManager.isFlagEmoji(t.substr(i,4))?h=t.substr(i,4):h=t.substr(i,2))):r>56319?(a=t.charCodeAt(i+1),FontManager.isVariationSelector(r)&&(n=!0)):FontManager.isZeroWidthJoiner(r)&&(n=!0,p=!0),n?(e[e.length-1]+=h,n=!1):e.push(h),i+=h.length;return e},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e=this.elem.globalData.fontManager,i=this.data,s=[],r,a,n,p=0,h,y=i.m.g,P=0,c=0,l=0,E=[],b=0,v=0,w,u,f=e.getFontByName(t.f),g,_=0,k=getFontProperties(f);t.fWeight=k.weight,t.fStyle=k.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),a=t.finalText.length,t.finalLineHeight=t.lh;var z=t.tr/1e3*t.finalSize,q;if(t.sz)for(var W=!0,ot=t.sz[0],mt=t.sz[1],gt,ut;W;){ut=this.buildFinalText(t.t),gt=0,b=0,a=ut.length,z=t.tr/1e3*t.finalSize;var Ct=-1;for(r=0;rot&&ut[r]!==" "?(Ct===-1?a+=1:r=Ct,gt+=t.finalLineHeight||t.finalSize*1.2,ut.splice(r,Ct===r?1:0,"\r"),Ct=-1,b=0):(b+=_,b+=z);gt+=f.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&mtv?b:v,b=-2*z,h="",n=!0,l+=1):h=yt,e.chars?(g=e.getCharData(yt,f.fStyle,e.getFontByName(t.f).fFamily),_=n?0:g.w*t.finalSize/100):_=e.measureText(h,t.f,t.finalSize),yt===" "?ht+=_+z:(b+=_+z+ht,ht=0),s.push({l:_,an:_,add:P,n,anIndexes:[],val:h,line:l,animatorJustifyOffset:0}),y==2){if(P+=_,h===""||h===" "||r===a-1){for((h===""||h===" ")&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;p+=1,P=0;}}else if(y==3){if(P+=_,h===""||r===a-1){for(h===""&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;P=0,p+=1;}}else s[p].ind=p,s[p].extra=0,p+=1;if(t.l=s,v=b>v?b:v,E.push(b),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0;}t.lineWidths=E;var D=i.a,V,S;u=D.length;var R,tt,J=[];for(w=0;w0?n=this.ne.v/100:p=-this.ne.v/100,this.xe.v>0?h=1-this.xe.v/100:y=1+this.xe.v/100;var P=BezierFactory.getBezierEasing(n,p,h,y).get,c=0,l=this.finalS,E=this.finalE,b=this.data.sh;if(b===2)E===l?c=a>=E?1:0:c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===3)E===l?c=a>=E?0:1:c=1-t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===4)E===l?c=0:(c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c<.5?c*=2:c=1-2*(c-.5)),c=P(c);else if(b===5){if(E===l)c=0;else {var v=E-l;a=e(t(0,a+.5-l),E-l);var w=-v/2+a,u=v/2;c=Math.sqrt(1-w*w/(u*u));}c=P(c);}else b===6?(E===l?c=0:(a=e(t(0,a+.5-l),E-l),c=(1+Math.cos(Math.PI+Math.PI*2*a/(E-l)))/2),c=P(c)):(a>=i(l)&&(a-l<0?c=t(0,e(e(E,1)-(l-a),1)):c=t(0,e(E-a,1))),c=P(c));if(this.sm.v!==100){var f=this.sm.v*.01;f===0&&(f=1e-8);var g=.5-f*.5;c1&&(c=1));}return c*this.a.v},getValue:function(a){this.iterateDynamicProperties(),this._mdf=a||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,a&&this.data.r===2&&(this.e.v=this._currentTextLength);var n=this.data.r===2?1:100/this.data.totalChars,p=this.o.v/n,h=this.s.v/n+p,y=this.e.v/n+p;if(h>y){var P=h;h=y,y=P;}this.finalS=h,this.finalE=y;}},extendPrototype([DynamicPropertyContainer],s);function r(a,n,p){return new s(a,n)}return {getTextSelectorProp:r}}();function TextAnimatorDataProperty(t,e,i){var s={propType:!1},r=PropertyFactory.getProp,a=e.a;this.a={r:a.r?r(t,a.r,0,degToRads,i):s,rx:a.rx?r(t,a.rx,0,degToRads,i):s,ry:a.ry?r(t,a.ry,0,degToRads,i):s,sk:a.sk?r(t,a.sk,0,degToRads,i):s,sa:a.sa?r(t,a.sa,0,degToRads,i):s,s:a.s?r(t,a.s,1,.01,i):s,a:a.a?r(t,a.a,1,0,i):s,o:a.o?r(t,a.o,0,.01,i):s,p:a.p?r(t,a.p,1,0,i):s,sw:a.sw?r(t,a.sw,0,0,i):s,sc:a.sc?r(t,a.sc,1,0,i):s,fc:a.fc?r(t,a.fc,1,0,i):s,fh:a.fh?r(t,a.fh,0,0,i):s,fs:a.fs?r(t,a.fs,0,.01,i):s,fb:a.fb?r(t,a.fb,0,.01,i):s,t:a.t?r(t,a.t,0,0,i):s},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t;}function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i);}TextAnimatorProperty.prototype.searchProperties=function(){var t,e=this._textData.a.length,i,s=PropertyFactory.getProp;for(t=0;t=b+oe||!k?(ot=(b+oe-w)/v.partialLength,Xt=_.point[0]+(v.point[0]-_.point[0])*ot,Ht=_.point[1]+(v.point[1]-_.point[1])*ot,a.translate(-i[0]*l[P].an*.005,-(i[1]*ht)*.01),u=!1):k&&(w+=v.partialLength,f+=1,f>=k.length&&(f=0,g+=1,z[g]?k=z[g].points:gt.v.c?(f=0,g=0,k=z[g].points):(w-=v.partialLength,k=null)),k&&(_=v,v=k[f],q=v.partialLength));Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0);}else Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0),a.translate(-i[0]*l[P].an*.005,-i[1]*ht*.01,0);for(S=0;St?this.textSpans[t].span:createNS(p?"g":"text"),g<=t){if(h.setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=h,p){var k=createNS("g");h.appendChild(k),this.textSpans[t].childSpan=k;}this.textSpans[t].span=h,this.layerElement.appendChild(h);}h.style.display="inherit";}if(y.reset(),c&&(n[t].n&&(l=-v,E+=i.yOffset,E+=b?1:0,b=!1),this.applyTextPropertiesToMatrix(i,y,n[t].line,l,E),l+=n[t].l||0,l+=v),p){_=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily);var z;if(_.t===1)z=new SVGCompElement(_.data,this.globalData,this);else {var q=emptyShapeData;_.data&&_.data.shapes&&(q=this.buildShapeData(_.data,i.finalSize)),z=new SVGShapeElement(q,this.globalData,this);}if(this.textSpans[t].glyph){var W=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(W.layerElement),W.destroy();}this.textSpans[t].glyph=z,z._debug=!0,z.prepareFrame(0),z.renderFrame(),this.textSpans[t].childSpan.appendChild(z.layerElement),_.t===1&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")");}else c&&h.setAttribute("transform","translate("+y.props[12]+","+y.props[13]+")"),h.textContent=n[t].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");}c&&h&&h.setAttribute("d",P);}for(;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0));}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t=y;)mt/=2,gt/=2,ut>>>=1;return (mt+ut)/gt};return ot.int32=function(){return W.g(4)|0},ot.quick=function(){return W.g(4)/4294967296},ot.double=ot,w(f(W.S),t),(_.pass||k||function(mt,gt,ut,Ct){return Ct&&(Ct.S&&b(Ct,W),mt.state=function(){return b(W,{})}),ut?(e[n]=mt,gt):mt})(ot,q,"global"in _?_.global:this==e,_.state)}e["seed"+n]=l;function E(g){var _,k=g.length,z=this,q=0,W=z.i=z.j=0,ot=z.S=[];for(k||(g=[k++]);qi){var s=i;i=e,e=s;}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if(typeof t=="number"||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var i,s=Math.min(t.length,e.length),r=0;for(i=0;i.5?y/(2-r-a):y/(r+a),r){case e:n=(i-s)/y+(i1&&(i-=1),i<1/6?t+(e-t)*6*i:i<1/2?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e=t[0],i=t[1],s=t[2],r,a,n;if(i===0)r=s,n=s,a=s;else {var p=s<.5?s*(1+i):s+i-s*i,h=2*s-p;r=hue2rgb(h,p,e+1/3),a=hue2rgb(h,p,e),n=hue2rgb(h,p,e-1/3);}return [r,a,n,t[3]]}function linear(t,e,i,s,r){if((s===void 0||r===void 0)&&(s=e,r=i,e=0,i=1),i=i)return r;var n=i===e?0:(t-e)/(i-e);if(!s.length)return s+(r-s)*n;var p,h=s.length,y=createTypedArray("float32",h);for(p=0;p1){for(r=0;r1?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(r)){var p,h=r.length,y=createTypedArray("float32",h);for(p=0;pdata.k[e].t&&tdata.k[e+1].t-t?(s=e+2,r=data.k[e+1].t):(s=e+1,r=data.k[e].t);break}s===-1&&(s=e+1,r=data.k[e].t);}var a={};return a.index=s,a.time=r/elem.comp.globalData.frameRate,a}function key(t){var e,i,s;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(s=r.length,i=0;iw.length-1)&&(E=w.length-1),g=w[w.length-1-E].t,f=u-g);var _,k,z;if(l==="pingpong"){var q=Math.floor((v-g)/f);if(q%2!==0)return this.getValueAtTime((f-(v-g)%f+g)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(g/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(u/this.comp.globalData.frameRate,0),mt=this.getValueAtTime(((v-g)%f+g)/this.comp.globalData.frameRate,0),gt=Math.floor((v-g)/f);if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_=u)return this.pv;var f,g;b?(E?f=Math.abs(this.elem.comp.globalData.frameRate*E):f=Math.max(0,this.elem.data.op-u),g=u+f):((!E||E>w.length-1)&&(E=w.length-1),g=w[E].t,f=g-u);var _,k,z;if(l==="pingpong"){var q=Math.floor((u-v)/f);if(q%2===0)return this.getValueAtTime(((u-v)%f+u)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(u/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(g/this.comp.globalData.frameRate,0),mt=this.getValueAtTime((f-(u-v)%f+u)/this.comp.globalData.frameRate,0),gt=Math.floor((u-v)/f)+1;if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_1?(w-v)/(E-1):1,f=0,g=0,_;this.pv.length?_=createTypedArray("float32",this.pv.length):_=0;for(var k;fu){var z=f,q=b.c&&f===g-1?0:f+1,W=(u-_)/w[f].addedLength;k=bez.getPointInSegment(b.v[z],b.v[q],b.o[z],b.i[q],W,w[f]);break}else _+=w[f].addedLength;f+=1;}return k||(k=b.c?[b.v[0][0],b.v[0][1]]:[b.v[b._length-1][0],b.v[b._length-1][1]]),k},vectorOnPath:function(l,E,b){l==1?l=this.v.c:l==0&&(l=.999);var v=this.pointOnPath(l,E),w=this.pointOnPath(l+.001,E),u=w[0]-v[0],f=w[1]-v[1],g=Math.sqrt(Math.pow(u,2)+Math.pow(f,2));if(g===0)return [0,0];var _=b==="tangent"?[u/g,f/g]:[-f/g,u/g];return _},tangentOnPath:function(l,E){return this.vectorOnPath(l,E,"tangent")},normalOnPath:function(l,E){return this.vectorOnPath(l,E,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([P],h),extendPrototype([P],y),y.prototype.getValueAtTime=p,y.prototype.initiateExpression=ExpressionManager.initiateExpression;var c=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(l,E,b,v,w){var u=c(l,E,b,v,w);return u.propertyIndex=E.ix,u.lock=!1,b===3?expressionHelpers.searchExpressions(l,E.pt,u):b===4&&expressionHelpers.searchExpressions(l,E.ks,u),u.k&&l.addDynamicProperty(u),u};}function initialize$1(){addPropertyDecorator();}function addDecorator(){function t(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(e,i){var s=this.calculateExpression(i);if(e.t!==s){var r={};return this.copyData(r,e),r.t=s.toString(),r.__complete=!1,r}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),i=this.searchExpressions();return this.kf=e||i,this.kf},TextProperty.prototype.searchExpressions=t;}function initialize(){addDecorator();}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function t(e,i){var s=createNS("feMerge");s.setAttribute("result",e);var r,a;for(a=0;a=y?c=b<0?s:r:c=s+E*Math.pow((p-t)/b,1/i),P[l]=c,l+=1,a+=256/(n-1);return P.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e));}};function SVGDropShadowEffect(t,e,i,s,r){var a=e.container.globalData.renderConfig.filterSize,n=e.data.fs||a;t.setAttribute("x",n.x||a.x),t.setAttribute("y",n.y||a.y),t.setAttribute("width",n.width||a.width),t.setAttribute("height",n.height||a.height),this.filterManager=e;var p=createNS("feGaussianBlur");p.setAttribute("in","SourceAlpha"),p.setAttribute("result",s+"_drop_shadow_1"),p.setAttribute("stdDeviation","0"),this.feGaussianBlur=p,t.appendChild(p);var h=createNS("feOffset");h.setAttribute("dx","25"),h.setAttribute("dy","0"),h.setAttribute("in",s+"_drop_shadow_1"),h.setAttribute("result",s+"_drop_shadow_2"),this.feOffset=h,t.appendChild(h);var y=createNS("feFlood");y.setAttribute("flood-color","#00ff00"),y.setAttribute("flood-opacity","1"),y.setAttribute("result",s+"_drop_shadow_3"),this.feFlood=y,t.appendChild(y);var P=createNS("feComposite");P.setAttribute("in",s+"_drop_shadow_3"),P.setAttribute("in2",s+"_drop_shadow_2"),P.setAttribute("operator","in"),P.setAttribute("result",s+"_drop_shadow_4"),t.appendChild(P);var c=this.createMergeNode(s,[s+"_drop_shadow_4",r]);t.appendChild(c);}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(e[0]*255),Math.round(e[1]*255),Math.round(e[2]*255)));}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,s=(this.filterManager.effectElements[2].p.v-90)*degToRads,r=i*Math.cos(s),a=i*Math.sin(s);this.feOffset.setAttribute("dx",r),this.feOffset.setAttribute("dy",a);}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=i,i.matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement;}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,i=_svgMatteSymbols.length;eSc});var Pc,Sc,Sl=ls(()=>{qs();Pc=is((t,e)=>{typeof navigator<"u"&&function(i,s){typeof t=="object"&&typeof e<"u"?e.exports=s():typeof define=="function"&&define.amd?define(s):(i=typeof globalThis<"u"?globalThis:i||self,i.lottie=s());}(t,function(){var i="http://www.w3.org/2000/svg",s="",r=!1,a=-999999,n=function(o){r=!!o;},p=function(){return r},h=function(o){s=o;},y=function(){return s};function P(o){return document.createElement(o)}function c(o,d){var x,M=o.length,L;for(x=0;x1?x[1]=1:x[1]<=0&&(x[1]=0),R(x[0],x[1],x[2])}function Gt(o,d){var x=tt(o[0]*255,o[1]*255,o[2]*255);return x[2]+=d,x[2]>1?x[2]=1:x[2]<0&&(x[2]=0),R(x[0],x[1],x[2])}function Vt(o,d){var x=tt(o[0]*255,o[1]*255,o[2]*255);return x[0]+=d/360,x[0]>1?x[0]-=1:x[0]<0&&(x[0]+=1),R(x[0],x[1],x[2])}(function(){var o=[],d,x;for(d=0;d<256;d+=1)x=d.toString(16),o[d]=x.length===1?"0"+x:x;return function(M,L,I){return M<0&&(M=0),L<0&&(L=0),I<0&&(I=0),"#"+o[M]+o[L]+o[I]}})();var Xt=function(o){w=!!o;},Ht=function(){return w},Qt=function(o){u=o;},Zt=function(){return u},ne=function(o){W=o;},ue=function(){return W},pe=function(o){f=o;};function Wt(o){return document.createElementNS(i,o)}function fe(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(d){return typeof d}:fe=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},fe(o)}var jt=function(){var o=1,d=[],x,M,L={onmessage:function(){},postMessage:function(X){x({data:X});}},I={postMessage:function(X){L.onmessage({data:X});}};function H(X){if(window.Worker&&window.Blob&&p()){var $=new Blob(["var _workerSelf = self; self.onmessage = ",X.toString()],{type:"text/javascript"}),Y=URL.createObjectURL($);return new Worker(Y)}return x=X,L}function Q(){M||(M=H(function(X){function $(){function N(Dt,Et){var Pt,kt,ct=Dt.length,wt,qt,zt,re;for(kt=0;kt=0;Et-=1)if(Dt[Et].ty==="sh")if(Dt[Et].ks.k.i)dt(Dt[Et].ks.k);else for(ct=Dt[Et].ks.k.length,kt=0;ktPt[0]?!0:Pt[0]>Dt[0]?!1:Dt[1]>Pt[1]?!0:Pt[1]>Dt[1]?!1:Dt[2]>Pt[2]?!0:Pt[2]>Dt[2]?!1:null}var Lt=function(){var Dt=[4,4,14];function Et(kt){var ct=kt.t.d;kt.t.d={k:[{s:ct,t:0}]};}function Pt(kt){var ct,wt=kt.length;for(ct=0;ct=0;ct-=1)if(kt[ct].ty==="sh")if(kt[ct].ks.k.i)kt[ct].ks.k.c=kt[ct].closed;else for(zt=kt[ct].ks.k.length,qt=0;qt500)&&(this._imageLoaded(),clearInterval(ft)),K+=1;}.bind(this),50);}function I(nt){var K=M(nt,this.assetsPath,this.path),ft=Wt("image");g?this.testImageLoaded(ft):ft.addEventListener("load",this._imageLoaded,!1),ft.addEventListener("error",function(){dt.img=o,this._imageLoaded();}.bind(this),!1),ft.setAttributeNS("http://www.w3.org/1999/xlink","href",K),this._elementHelper.append?this._elementHelper.append(ft):this._elementHelper.appendChild(ft);var dt={img:ft,assetData:nt};return dt}function H(nt){var K=M(nt,this.assetsPath,this.path),ft=P("img");ft.crossOrigin="anonymous",ft.addEventListener("load",this._imageLoaded,!1),ft.addEventListener("error",function(){dt.img=o,this._imageLoaded();}.bind(this),!1),ft.src=K;var dt={img:ft,assetData:nt};return dt}function Q(nt){var K={assetData:nt},ft=M(nt,this.assetsPath,this.path);return jt.loadData(ft,function(dt){K.img=dt,this._footageLoaded();}.bind(this),function(){K.img={},this._footageLoaded();}.bind(this)),K}function Z(nt,K){this.imagesLoadedCb=K;var ft,dt=nt.length;for(ft=0;ftthis.animationData.op&&(this.animationData.op=o.op,this.totalFrames=Math.floor(o.op-this.animationData.ip));var d=this.animationData.layers,x,M=d.length,L=o.layers,I,H=L.length;for(I=0;Ithis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},Jt.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(o){this.triggerRenderFrameError(o);}},Jt.prototype.play=function(o){o&&this.name!==o||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},Jt.prototype.pause=function(o){o&&this.name!==o||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},Jt.prototype.togglePause=function(o){o&&this.name!==o||(this.isPaused===!0?this.play():this.pause());},Jt.prototype.stop=function(o){o&&this.name!==o||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},Jt.prototype.getMarkerData=function(o){for(var d,x=0;x=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(d>this.totalFrames?d%this.totalFrames:0)||(x=!0,d=this.totalFrames-1):d>=this.totalFrames?(this.playCount+=1,this.checkSegments(d%this.totalFrames)||(this.setCurrentRawFrameValue(d%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(d):d<0?this.checkSegments(d%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+d%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(x=!0,d=0)):this.setCurrentRawFrameValue(d),x&&(this.setCurrentRawFrameValue(d),this.pause(),this.trigger("complete"));}},Jt.prototype.adjustSegment=function(o,d){this.playCount=0,o[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=o[0]-o[1],this.timeCompleted=this.totalFrames,this.firstFrame=o[1],this.setCurrentRawFrameValue(this.totalFrames-.001-d)):o[1]>o[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=o[1]-o[0],this.timeCompleted=this.totalFrames,this.firstFrame=o[0],this.setCurrentRawFrameValue(.001+d)),this.trigger("segmentStart");},Jt.prototype.setSegment=function(o,d){var x=-1;this.isPaused&&(this.currentRawFrame+this.firstFramed&&(x=d-o)),this.firstFrame=o,this.totalFrames=d-o,this.timeCompleted=this.totalFrames,x!==-1&&this.goToAndStop(x,!0);},Jt.prototype.playSegments=function(o,d){if(d&&(this.segments.length=0),_e(o[0])==="object"){var x,M=o.length;for(x=0;x=0;kt-=1)d[kt].animation.destroy(Pt);}function Ft(Pt,kt,ct){var wt=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),qt,zt=wt.length;for(qt=0;qt0?dt=Ft:ft=Ft;while(Math.abs(Ot)>I&&++$t=L?rt(K,_t,ft,dt):At===0?_t:N(K,Lt,Lt+Z,ft,dt)}},o}(),oe=function(){function o(d){return d.concat(v(d.length))}return {double:o}}(),xe=function(){return function(o,d,x){var M=0,L=o,I=v(L),H={newElement:Q,release:Z};function Q(){var st;return M?(M-=1,st=I[M]):st=d(),st}function Z(st){M===L&&(I=oe.double(I),L*=2),x&&x(st),I[M]=st,M+=1;}return H}}(),ei=function(){function o(){return {addedLength:0,percents:b("float32",ue()),lengths:b("float32",ue())}}return xe(8,o)}(),Je=function(){function o(){return {lengths:[],totalLength:0}}function d(x){var M,L=x.lengths.length;for(M=0;M-.001&&K<.001}function x(X,$,Y,N,rt,nt,K,ft,dt){if(Y===0&&nt===0&&dt===0)return d(X,$,N,rt,K,ft);var xt=o.sqrt(o.pow(N-X,2)+o.pow(rt-$,2)+o.pow(nt-Y,2)),Lt=o.sqrt(o.pow(K-X,2)+o.pow(ft-$,2)+o.pow(dt-Y,2)),Ot=o.sqrt(o.pow(K-N,2)+o.pow(ft-rt,2)+o.pow(dt-nt,2)),Ft;return xt>Lt?xt>Ot?Ft=xt-Lt-Ot:Ft=Ot-Lt-xt:Ot>Lt?Ft=Ot-Lt-xt:Ft=Lt-xt-Ot,Ft>-1e-4&&Ft<1e-4}var M=function(){return function(X,$,Y,N){var rt=ue(),nt,K,ft,dt,xt,Lt=0,Ot,Ft=[],$t=[],_t=ei.newElement();for(ft=Y.length,nt=0;ntK?-1:1,xt=!0;xt;)if(N[nt]<=K&&N[nt+1]>K?(ft=(K-N[nt])/(N[nt+1]-N[nt]),xt=!1):nt+=dt,nt<0||nt>=rt-1){if(nt===rt-1)return Y[nt];xt=!1;}return Y[nt]+(Y[nt+1]-Y[nt])*ft}function st(X,$,Y,N,rt,nt){var K=Z(rt,nt),ft=1-K,dt=o.round((ft*ft*ft*X[0]+(K*ft*ft+ft*K*ft+ft*ft*K)*Y[0]+(K*K*ft+ft*K*K+K*ft*K)*N[0]+K*K*K*$[0])*1e3)/1e3,xt=o.round((ft*ft*ft*X[1]+(K*ft*ft+ft*K*ft+ft*ft*K)*Y[1]+(K*K*ft+ft*K*K+K*ft*K)*N[1]+K*K*K*$[1])*1e3)/1e3;return [dt,xt]}var pt=b("float32",8);function et(X,$,Y,N,rt,nt,K){rt<0?rt=0:rt>1&&(rt=1);var ft=Z(rt,K);nt=nt>1?1:nt;var dt=Z(nt,K),xt,Lt=X.length,Ot=1-ft,Ft=1-dt,$t=Ot*Ot*Ot,_t=ft*Ot*Ot*3,At=ft*ft*Ot*3,lt=ft*ft*ft,Tt=Ot*Ot*Ft,Dt=ft*Ot*Ft+Ot*ft*Ft+Ot*Ot*dt,Et=ft*ft*Ft+Ot*ft*dt+ft*Ot*dt,Pt=ft*ft*dt,kt=Ot*Ft*Ft,ct=ft*Ft*Ft+Ot*dt*Ft+Ot*Ft*dt,wt=ft*dt*Ft+Ot*dt*dt+ft*Ft*dt,qt=ft*dt*dt,zt=Ft*Ft*Ft,re=dt*Ft*Ft+Ft*dt*Ft+Ft*Ft*dt,ie=dt*dt*Ft+Ft*dt*dt+dt*Ft*dt,de=dt*dt*dt;for(xt=0;xt=st.t-x){Z.h&&(Z=st),L=0;break}if(st.t-x>o){L=I;break}I=nt||o=nt?dt.points.length-1:0;for(X=dt.points[xt].point.length,et=0;et=Ft&&Lt=nt)M[0]=ft[0],M[1]=ft[1],M[2]=ft[2];else if(o<=K)M[0]=Z.s[0],M[1]=Z.s[1],M[2]=Z.s[2];else {var Dt=Rr(Z.s),Et=Rr(ft),Pt=(o-K)/(nt-K);sa(M,ia(Dt,Et,Pt));}else for(I=0;I=nt?$=1:o1e-6?(X=Math.acos($),Y=Math.sin(X),N=Math.sin((1-x)*X)/Y,rt=Math.sin(x*X)/Y):(N=1-x,rt=x),M[0]=N*L+rt*Z,M[1]=N*I+rt*st,M[2]=N*H+rt*pt,M[3]=N*Q+rt*et,M}function sa(o,d){var x=d[0],M=d[1],L=d[2],I=d[3],H=Math.atan2(2*M*I-2*x*L,1-2*M*M-2*L*L),Q=Math.asin(2*x*M+2*L*I),Z=Math.atan2(2*x*I-2*M*L,1-2*x*x-2*L*L);o[0]=H/ot,o[1]=Q/ot,o[2]=Z/ot;}function Rr(o){var d=o[0]*ot,x=o[1]*ot,M=o[2]*ot,L=Math.cos(d/2),I=Math.cos(x/2),H=Math.cos(M/2),Q=Math.sin(d/2),Z=Math.sin(x/2),st=Math.sin(M/2),pt=L*I*H-Q*Z*st,et=Q*Z*H+L*I*st,X=Q*I*H+L*Z*st,$=L*Z*H-Q*I*st;return [et,X,$,pt]}function Br(){var o=this.comp.renderedFrame-this.offsetTime,d=this.keyframes[0].t-this.offsetTime,x=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(o===this._caching.lastFrame||this._caching.lastFrame!==qi&&(this._caching.lastFrame>=x&&o>=x||this._caching.lastFrame=o&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var M=this.interpolateValue(o,this._caching);this.pv=M;}return this._caching.lastFrame=o,this.pv}function Ts(o){var d;if(this.propType==="unidimensional")d=o*this.mult,Zi(this.v-d)>1e-5&&(this.v=d,this._mdf=!0);else for(var x=0,M=this.v.length;x1e-5&&(this.v[x]=d,this._mdf=!0),x+=1;}function Ms(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var o,d=this.effectsSequence.length,x=this.kf?this.pv:this.data.k;for(o=0;o=this._maxLength&&this.doubleArrayLength(),x){case"v":I=this.v;break;case"i":I=this.i;break;case"o":I=this.o;break;default:I=[];break}(!I[M]||I[M]&&!L)&&(I[M]=Kt.newElement()),I[M][0]=o,I[M][1]=d;},Re.prototype.setTripleAt=function(o,d,x,M,L,I,H,Q){this.setXYAt(o,d,"v",H,Q),this.setXYAt(x,M,"o",H,Q),this.setXYAt(L,I,"i",H,Q);},Re.prototype.reverse=function(){var o=new Re;o.setPathData(this.c,this._length);var d=this.v,x=this.o,M=this.i,L=0;this.c&&(o.setTripleAt(d[0][0],d[0][1],M[0][0],M[0][1],x[0][0],x[0][1],0,!1),L=1);var I=this._length-1,H=this._length,Q;for(Q=L;Q=Dt[Dt.length-1].t-this.offsetTime)xt=Dt[Dt.length-1].s?Dt[Dt.length-1].s[0]:Dt[Dt.length-2].e[0],Ot=!0;else {for(var Et=dt,Pt=Dt.length-1,kt=!0,ct,wt,qt;kt&&(ct=Dt[Et],wt=Dt[Et+1],!(wt.t-this.offsetTime>nt));)Et=wt.t-this.offsetTime)lt=1;else if(ntft&&nt>ft)||(this._caching.lastIndex=dt0||ct>-1e-6&&ct<0?M(ct*wt)/wt:ct}function kt(){var ct=this.props,wt=Pt(ct[0]),qt=Pt(ct[1]),zt=Pt(ct[4]),re=Pt(ct[5]),ie=Pt(ct[12]),de=Pt(ct[13]);return "matrix("+wt+","+qt+","+zt+","+re+","+ie+","+de+")"}return function(){this.reset=L,this.rotate=I,this.rotateX=H,this.rotateY=Q,this.rotateZ=Z,this.skew=pt,this.skewFromAxis=et,this.shear=st,this.scale=X,this.setTransform=$,this.translate=Y,this.transform=N,this.multiply=rt,this.applyToPoint=xt,this.applyToX=Lt,this.applyToY=Ot,this.applyToZ=Ft,this.applyToPointArray=Tt,this.applyToTriplePoints=lt,this.applyToPointStringified=Dt,this.toCSS=Et,this.to2dCSS=kt,this.clone=ft,this.cloneFromProps=dt,this.equals=K,this.inversePoints=At,this.inversePoint=_t,this.getInverseMatrix=$t,this._t=this.transform,this.isIdentity=nt,this._identity=!0,this._identityCalculated=!1,this.props=b("float32",16),this.reset();}}();function ms(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ms=function(d){return typeof d}:ms=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},ms(o)}var se={};function gr(o){h(o);}function Oe(){te.searchAnimations();}function Ta(o){Xt(o);}function ra(o){pe(o);}function Ma(o){return te.loadAnimation(o)}function wa(o){if(typeof o=="string")switch(o){case"high":ne(200);break;default:case"medium":ne(50);break;case"low":ne(10);break}else !isNaN(o)&&o>1&&ne(o);}function Da(){return typeof navigator<"u"}function Fa(o,d){o==="expressions"&&Qt(d);}function Ia(o){switch(o){case"propertyFactory":return Yt;case"shapePropertyFactory":return ss;case"matrix":return Ce;default:return null}}se.play=te.play,se.pause=te.pause,se.setLocationHref=gr,se.togglePause=te.togglePause,se.setSpeed=te.setSpeed,se.setDirection=te.setDirection,se.stop=te.stop,se.searchAnimations=Oe,se.registerAnimation=te.registerAnimation,se.loadAnimation=Ma,se.setSubframeRendering=Ta,se.resize=te.resize,se.goToAndStop=te.goToAndStop,se.destroy=te.destroy,se.setQuality=wa,se.inBrowser=Da,se.installPlugin=Fa,se.freeze=te.freeze,se.unfreeze=te.unfreeze,se.setVolume=te.setVolume,se.mute=te.mute,se.unmute=te.unmute,se.getRegisteredAnimations=te.getRegisteredAnimations,se.useWebWorker=n,se.setIDPrefix=ra,se.__getFactory=Ia,se.version="5.12.2";function La(){document.readyState==="complete"&&(clearInterval(Ra),Oe());}function Va(o){for(var d=Or.split("&"),x=0;x"u"?"undefined":ms(t))==="object"&&typeof e<"u")&&!(typeof define=="function"&&define.amd)&&(window.bodymovin=se);}catch{}var _i=function(){var o={},d={};o.registerModifier=x,o.getModifier=M;function x(L,I){d[L]||(d[L]=I);}function M(L,I,H){return new d[L](I,H)}return o}();function ni(){}ni.prototype.initModifierProperties=function(){},ni.prototype.addShapeToModifier=function(){},ni.prototype.addShape=function(o){if(!this.closed){o.sh.container.addDynamicProperty(o.sh);var d={shape:o.sh,data:o,localShapeCollection:Ue.newShapeCollection()};this.shapes.push(d),this.addShapeToModifier(d),this._isAnimated&&o.setAsAnimated();}},ni.prototype.init=function(o,d){this.shapes=[],this.elem=o,this.initDynamicPropertyContainer(o),this.initModifierProperties(o,d),this.frameId=a,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0);},ni.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties());},c([Ve],ni);function je(){}c([ni],je),je.prototype.initModifierProperties=function(o,d){this.s=Yt.getProp(o,d.s,0,.01,this),this.e=Yt.getProp(o,d.e,0,.01,this),this.o=Yt.getProp(o,d.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=d.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length;},je.prototype.addShapeToModifier=function(o){o.pathsData=[];},je.prototype.calculateShapeEdges=function(o,d,x,M,L){var I=[];d<=1?I.push({s:o,e:d}):o>=1?I.push({s:o-1,e:d-1}):(I.push({s:o,e:1}),I.push({s:0,e:d-1}));var H=[],Q,Z=I.length,st;for(Q=0;QM+x)){var pt,et;st.s*L<=M?pt=0:pt=(st.s*L-M)/x,st.e*L>=M+x?et=1:et=(st.e*L-M)/x,H.push([pt,et]);}return H.length||H.push([0,0]),H},je.prototype.releasePathsData=function(o){var d,x=o.length;for(d=0;d1?d=1+M:this.s.v<0?d=0+M:d=this.s.v+M,this.e.v>1?x=1+M:this.e.v<0?x=0+M:x=this.e.v+M,d>x){var L=d;d=x,x=L;}d=Math.round(d*1e4)*1e-4,x=Math.round(x*1e4)*1e-4,this.sValue=d,this.eValue=x;}else d=this.sValue,x=this.eValue;var I,H,Q=this.shapes.length,Z,st,pt,et,X,$=0;if(x===d)for(H=0;H=0;H-=1)if(N=this.shapes[H],N.shape._mdf){for(rt=N.localShapeCollection,rt.releaseShapes(),this.m===2&&Q>1?(dt=this.calculateShapeEdges(d,x,N.totalShapeLength,ft,$),ft+=N.totalShapeLength):dt=[[nt,K]],st=dt.length,Z=0;Z=1?Y.push({s:N.totalShapeLength*(nt-1),e:N.totalShapeLength*(K-1)}):(Y.push({s:N.totalShapeLength*nt,e:N.totalShapeLength}),Y.push({s:0,e:N.totalShapeLength*(K-1)}));var xt=this.addShapes(N,Y[0]);if(Y[0].s!==Y[0].e){if(Y.length>1){var Lt=N.shape.paths.shapes[N.shape.paths._length-1];if(Lt.c){var Ot=xt.pop();this.addPaths(xt,rt),xt=this.addShapes(N,Y[1],Ot);}else this.addPaths(xt,rt),xt=this.addShapes(N,Y[1]);}this.addPaths(xt,rt);}}N.shape.paths=rt;}}},je.prototype.addPaths=function(o,d){var x,M=o.length;for(x=0;xd.e){x.c=!1;break}else d.s<=st&&d.e>=st+pt.addedLength?(this.addSegment(L[I].v[Q-1],L[I].o[Q-1],L[I].i[Q],L[I].v[Q],x,et,rt),rt=!1):($=mi.getNewSegment(L[I].v[Q-1],L[I].v[Q],L[I].o[Q-1],L[I].i[Q],(d.s-st)/pt.addedLength,(d.e-st)/pt.addedLength,X[Q-1]),this.addSegmentFromArray($,x,et,rt),rt=!1,x.c=!1),st+=pt.addedLength,et+=1;if(L[I].c&&X.length){if(pt=X[Q-1],st<=d.e){var nt=X[Q-1].addedLength;d.s<=st&&d.e>=st+nt?(this.addSegment(L[I].v[Q-1],L[I].o[Q-1],L[I].i[0],L[I].v[0],x,et,rt),rt=!1):($=mi.getNewSegment(L[I].v[Q-1],L[I].v[0],L[I].o[Q-1],L[I].i[0],(d.s-st)/nt,(d.e-st)/nt,X[Q-1]),this.addSegmentFromArray($,x,et,rt),rt=!1,x.c=!1);}else x.c=!1;st+=pt.addedLength,et+=1;}if(x._length&&(x.setXYAt(x.v[N][0],x.v[N][1],"i",N),x.setXYAt(x.v[x._length-1][0],x.v[x._length-1][1],"o",x._length-1)),st>d.e)break;I=this.p.keyframes[this.p.keyframes.length-1].t?(pt=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/st,0),et=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/st,0)):(pt=this.p.pv,et=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/st,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){pt=[],et=[];var X=this.px,$=this.py;X._caching.lastFrame+X.offsetTime<=X.keyframes[0].t?(pt[0]=X.getValueAtTime((X.keyframes[0].t+.01)/st,0),pt[1]=$.getValueAtTime(($.keyframes[0].t+.01)/st,0),et[0]=X.getValueAtTime(X.keyframes[0].t/st,0),et[1]=$.getValueAtTime($.keyframes[0].t/st,0)):X._caching.lastFrame+X.offsetTime>=X.keyframes[X.keyframes.length-1].t?(pt[0]=X.getValueAtTime(X.keyframes[X.keyframes.length-1].t/st,0),pt[1]=$.getValueAtTime($.keyframes[$.keyframes.length-1].t/st,0),et[0]=X.getValueAtTime((X.keyframes[X.keyframes.length-1].t-.01)/st,0),et[1]=$.getValueAtTime(($.keyframes[$.keyframes.length-1].t-.01)/st,0)):(pt=[X.pv,$.pv],et[0]=X.getValueAtTime((X._caching.lastFrame+X.offsetTime-.01)/st,X.offsetTime),et[1]=$.getValueAtTime(($._caching.lastFrame+$.offsetTime-.01)/st,$.offsetTime));}else et=o,pt=et;this.v.rotate(-Math.atan2(pt[1]-et[1],pt[0]-et[0]));}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);}this.frameId=this.elem.globalData.frameId;}}function M(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4);}function L(){}function I(Z){this._addDynamicProperty(Z),this.elem.addDynamicProperty(Z),this._isDirty=!0;}function H(Z,st,pt){if(this.elem=Z,this.frameId=-1,this.propType="transform",this.data=st,this.v=new Ce,this.pre=new Ce,this.appliedTransformations=0,this.initDynamicPropertyContainer(pt||Z),st.p&&st.p.s?(this.px=Yt.getProp(Z,st.p.x,0,0,this),this.py=Yt.getProp(Z,st.p.y,0,0,this),st.p.z&&(this.pz=Yt.getProp(Z,st.p.z,0,0,this))):this.p=Yt.getProp(Z,st.p||{k:[0,0,0]},1,0,this),st.rx){if(this.rx=Yt.getProp(Z,st.rx,0,ot,this),this.ry=Yt.getProp(Z,st.ry,0,ot,this),this.rz=Yt.getProp(Z,st.rz,0,ot,this),st.or.k[0].ti){var et,X=st.or.k.length;for(et=0;et0;)x-=1,this._elements.unshift(d[x]);this.dynamicProperties.length?this.k=!0:this.getValue(!0);},oi.prototype.resetElements=function(o){var d,x=o.length;for(d=0;d0?Math.floor(X):Math.ceil(X),N=this.pMatrix.props,rt=this.rMatrix.props,nt=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var K=0;if(X>0){for(;KY;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),K-=1;$&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-$,!0),K-=$);}M=this.data.m===1?0:this._currentCopies-1,L=this.data.m===1?1:-1,I=this._currentCopies;for(var ft,dt;I;){if(d=this.elemsData[M].it,x=d[d.length-1].transform.mProps.v.props,dt=x.length,d[d.length-1].transform.mProps._mdf=!0,d[d.length-1].transform.op._mdf=!0,d[d.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(M/(this._currentCopies-1)),K!==0){for((M!==0&&L===1||M!==this._currentCopies-1&&L===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(rt[0],rt[1],rt[2],rt[3],rt[4],rt[5],rt[6],rt[7],rt[8],rt[9],rt[10],rt[11],rt[12],rt[13],rt[14],rt[15]),this.matrix.transform(nt[0],nt[1],nt[2],nt[3],nt[4],nt[5],nt[6],nt[7],nt[8],nt[9],nt[10],nt[11],nt[12],nt[13],nt[14],nt[15]),this.matrix.transform(N[0],N[1],N[2],N[3],N[4],N[5],N[6],N[7],N[8],N[9],N[10],N[11],N[12],N[13],N[14],N[15]),ft=0;ft0&&M<1?[d]:[]:[d-M,d+M].filter(function(L){return L>0&&L<1})},Se.prototype.split=function(o){if(o<=0)return [Nr(this.points[0]),this];if(o>=1)return [this,Nr(this.points[this.points.length-1])];var d=Ai(this.points[0],this.points[1],o),x=Ai(this.points[1],this.points[2],o),M=Ai(this.points[2],this.points[3],o),L=Ai(d,x,o),I=Ai(x,M,o),H=Ai(L,I,o);return [new Se(this.points[0],d,L,H,!0),new Se(H,I,M,this.points[3],!0)]};function vr(o,d){var x=o.points[0][d],M=o.points[o.points.length-1][d];if(x>M){var L=M;M=x,x=L;}for(var I=na(3*o.a[d],2*o.b[d],o.c[d]),H=0;H0&&I[H]<1){var Q=o.point(I[H])[d];QM&&(M=Q);}return {min:x,max:M}}Se.prototype.bounds=function(){return {x:vr(this,0),y:vr(this,1)}},Se.prototype.boundingBox=function(){var o=this.bounds();return {left:o.x.min,right:o.x.max,top:o.y.min,bottom:o.y.max,width:o.x.max-o.x.min,height:o.y.max-o.y.min,cx:(o.x.max+o.x.min)/2,cy:(o.y.max+o.y.min)/2}};function $e(o,d,x){var M=o.boundingBox();return {cx:M.cx,cy:M.cy,width:M.width,height:M.height,bez:o,t:(d+x)/2,t1:d,t2:x}}function br(o){var d=o.bez.split(.5);return [$e(d[0],o.t1,o.t),$e(d[1],o.t,o.t2)]}function _r(o,d){return Math.abs(o.cx-d.cx)*2=I||o.width<=M&&o.height<=M&&d.width<=M&&d.height<=M){L.push([o.t,d.t]);return}var H=br(o),Q=br(d);gs(H[0],Q[0],x+1,M,L,I),gs(H[0],Q[1],x+1,M,L,I),gs(H[1],Q[0],x+1,M,L,I),gs(H[1],Q[1],x+1,M,L,I);}}Se.prototype.intersections=function(o,d,x){d===void 0&&(d=2),x===void 0&&(x=7);var M=[];return gs($e(this,0,1),$e(o,0,1),0,d,M,x),M},Se.shapeSegment=function(o,d){var x=(d+1)%o.length();return new Se(o.v[d],o.o[d],o.i[x],o.v[x],!0)},Se.shapeSegmentInverted=function(o,d){var x=(d+1)%o.length();return new Se(o.v[x],o.i[x],o.o[d],o.v[d],!0)};function rr(o,d){return [o[1]*d[2]-o[2]*d[1],o[2]*d[0]-o[0]*d[2],o[0]*d[1]-o[1]*d[0]]}function as(o,d,x,M){var L=[o[0],o[1],1],I=[d[0],d[1],1],H=[x[0],x[1],1],Q=[M[0],M[1],1],Z=rr(rr(L,I),rr(H,Q));return _s(Z[2])?null:[Z[0]/Z[2],Z[1]/Z[2]]}function Wi(o,d,x){return [o[0]+Math.cos(d)*x,o[1]-Math.sin(d)*x]}function ws(o,d){return Math.hypot(o[0]-d[0],o[1]-d[1])}function Fi(o,d){return Di(o[0],d[0])&&Di(o[1],d[1])}function ns(){}c([ni],ns),ns.prototype.initModifierProperties=function(o,d){this.getValue=this.processKeys,this.amplitude=Yt.getProp(o,d.s,0,null,this),this.frequency=Yt.getProp(o,d.r,0,null,this),this.pointsType=Yt.getProp(o,d.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0;};function Ds(o,d,x,M,L,I,H){var Q=x-Math.PI/2,Z=x+Math.PI/2,st=d[0]+Math.cos(x)*M*L,pt=d[1]-Math.sin(x)*M*L;o.setTripleAt(st,pt,st+Math.cos(Q)*I,pt-Math.sin(Q)*I,st+Math.cos(Z)*H,pt-Math.sin(Z)*H,o.length());}function ar(o,d){var x=[d[0]-o[0],d[1]-o[1]],M=-Math.PI*.5,L=[Math.cos(M)*x[0]-Math.sin(M)*x[1],Math.sin(M)*x[0]+Math.cos(M)*x[1]];return L}function oa(o,d){var x=d===0?o.length()-1:d-1,M=(d+1)%o.length(),L=o.v[x],I=o.v[M],H=ar(L,I);return Math.atan2(0,1)-Math.atan2(H[1],H[0])}function Gr(o,d,x,M,L,I,H){var Q=oa(d,x),Z=d.v[x%d._length],st=d.v[x===0?d._length-1:x-1],pt=d.v[(x+1)%d._length],et=I===2?Math.sqrt(Math.pow(Z[0]-st[0],2)+Math.pow(Z[1]-st[1],2)):0,X=I===2?Math.sqrt(Math.pow(Z[0]-pt[0],2)+Math.pow(Z[1]-pt[1],2)):0;Ds(o,d.v[x%d._length],Q,H,M,X/((L+1)*2),et/((L+1)*2));}function Ba(o,d,x,M,L,I){for(var H=0;H1&&d.length>1&&(L=Fs(o[0],d[d.length-1]),L)?[[o[0].split(L[0])[0]],[d[d.length-1].split(L[1])[1]]]:[x,M]}function ha(o){for(var d,x=1;x1&&(d=xr(o[o.length-1],o[0]),o[o.length-1]=d[0],o[0]=d[1]),o}function Pr(o,d){var x=o.inflectionPoints(),M,L,I,H;if(x.length===0)return [os(o,d)];if(x.length===1||Di(x[1],1))return I=o.split(x[0]),M=I[0],L=I[1],[os(M,d),os(L,d)];I=o.split(x[0]),M=I[0];var Q=(x[1]-x[0])/(1-x[0]);return I=I[1].split(Q),H=I[0],L=I[1],[os(M,d),os(H,d),os(L,d)]}function xs(){}c([ni],xs),xs.prototype.initModifierProperties=function(o,d){this.getValue=this.processKeys,this.amount=Yt.getProp(o,d.a,0,null,this),this.miterLimit=Yt.getProp(o,d.ml,0,null,this),this.lineJoin=d.lj,this._isAnimated=this.amount.effectsSequence.length!==0;},xs.prototype.processPath=function(o,d,x,M){var L=Fe.newElement();L.c=o.c;var I=o.length();o.c||(I-=1);var H,Q,Z,st=[];for(H=0;H=0;H-=1)Z=Se.shapeSegmentInverted(o,H),st.push(Pr(Z,d));st=ha(st);var pt=null,et=null;for(H=0;H0&&(re=!1),re){var he=P("style");he.setAttribute("f-forigin",ct[wt].fOrigin),he.setAttribute("f-origin",ct[wt].origin),he.setAttribute("f-family",ct[wt].fFamily),he.type="text/css",he.innerText="@font-face {font-family: "+ct[wt].fFamily+"; font-style: normal; src: url('"+ct[wt].fPath+"');}",kt.appendChild(he);}}else if(ct[wt].fOrigin==="g"||ct[wt].origin===1){for(ie=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),de=0;de=55296&&ct<=56319){var wt=Pt.charCodeAt(1);wt>=56320&&wt<=57343&&(kt=(ct-55296)*1024+wt-56320+65536);}return kt}function Lt(Pt,kt){var ct=Pt.toString(16)+kt.toString(16);return et.indexOf(ct)!==-1}function Ot(Pt){return Pt===Z}function Ft(Pt){return Pt===Q}function $t(Pt){var kt=xt(Pt);return kt>=st&&kt<=pt}function _t(Pt){return $t(Pt.substr(0,2))&&$t(Pt.substr(2,2))}function At(Pt){return x.indexOf(Pt)!==-1}function lt(Pt,kt){var ct=xt(Pt.substr(kt,2));if(ct!==M)return !1;var wt=0;for(kt+=2;wt<5;){if(ct=xt(Pt.substr(kt,2)),ctH)return !1;wt+=1,kt+=2;}return xt(Pt.substr(kt,2))===L}function Tt(){this.isLoaded=!0;}var Dt=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this);};Dt.isModifier=Lt,Dt.isZeroWidthJoiner=Ot,Dt.isFlagEmoji=_t,Dt.isRegionalCode=$t,Dt.isCombinedCharacter=At,Dt.isRegionalFlag=lt,Dt.isVariationSelector=Ft,Dt.BLACK_FLAG_CODE_POINT=M;var Et={addChars:nt,addFonts:rt,getCharData:K,getFontByName:dt,measureText:ft,checkLoadedFonts:Y,setIsLoaded:Tt};return Dt.prototype=Et,Dt}();function Er(o){this.animationData=o;}Er.prototype.getProp=function(o){return this.animationData.slots&&this.animationData.slots[o.sid]?Object.assign(o,this.animationData.slots[o.sid].p):o};function Vs(o){return new Er(o)}function Ki(){}Ki.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[];},addRenderableComponent:function(o){this.renderableComponents.indexOf(o)===-1&&this.renderableComponents.push(o);},removeRenderableComponent:function(o){this.renderableComponents.indexOf(o)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(o),1);},prepareRenderableFrame:function(o){this.checkLayerLimits(o);},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show());},checkLayerLimits:function(o){this.data.ip-this.data.st<=o&&this.data.op-this.data.st>o?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide());},renderRenderable:function(){var o,d=this.renderableComponents.length;for(o=0;o.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0));},ke.prototype.show=function(){},ke.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1;},ke.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1;},ke.prototype.resume=function(){this._canPlay=!0;},ke.prototype.setRate=function(o){this.audio.rate(o);},ke.prototype.volume=function(o){this._volumeMultiplier=o,this._previousVolume=o*this._volume,this.audio.volume(this._previousVolume);},ke.prototype.getBaseElement=function(){return null},ke.prototype.destroy=function(){},ke.prototype.sourceRectAtTime=function(){},ke.prototype.initExpressions=function(){};function Te(){}Te.prototype.checkLayers=function(o){var d,x=this.layers.length,M;for(this.completeLayers=!0,d=x-1;d>=0;d-=1)this.elements[d]||(M=this.layers[d],M.ip-M.st<=o-this.layers[d].st&&M.op-M.st>o-this.layers[d].st&&this.buildItem(d)),this.completeLayers=this.elements[d]?this.completeLayers:!1;this.checkPendingElements();},Te.prototype.createItem=function(o){switch(o.ty){case 2:return this.createImage(o);case 0:return this.createComp(o);case 1:return this.createSolid(o);case 3:return this.createNull(o);case 4:return this.createShape(o);case 5:return this.createText(o);case 6:return this.createAudio(o);case 13:return this.createCamera(o);case 15:return this.createFootage(o);default:return this.createNull(o)}},Te.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},Te.prototype.createAudio=function(o){return new ke(o,this.globalData,this)},Te.prototype.createFootage=function(o){return new We(o,this.globalData,this)},Te.prototype.buildAllItems=function(){var o,d=this.layers.length;for(o=0;o0&&(this.maskElement.setAttribute("id",X),this.element.maskedElement.setAttribute(K,"url("+y()+"#"+X+")"),M.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this);}Oi.prototype.getMaskProperty=function(o){return this.viewData[o].prop},Oi.prototype.renderFrame=function(o){var d=this.element.finalTransform.mat,x,M=this.masksProperties.length;for(x=0;x1&&(M+=" C"+d.o[L-1][0]+","+d.o[L-1][1]+" "+d.i[0][0]+","+d.i[0][1]+" "+d.v[0][0]+","+d.v[0][1]),x.lastPath!==M){var H="";x.elem&&(d.c&&(H=o.inv?this.solidPath+M:M),x.elem.setAttribute("d",H)),x.lastPath=M;}},Oi.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null;};var xi=function(){var o={};o.createFilter=d,o.createAlphaToLuminanceFilter=x;function d(M,L){var I=Wt("filter");return I.setAttribute("id",M),L!==!0&&(I.setAttribute("filterUnits","objectBoundingBox"),I.setAttribute("x","0%"),I.setAttribute("y","0%"),I.setAttribute("width","100%"),I.setAttribute("height","100%")),I}function x(){var M=Wt("feColorMatrix");return M.setAttribute("type","matrix"),M.setAttribute("color-interpolation-filters","sRGB"),M.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),M}return o}(),Qi=function(){var o={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return (/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(o.maskType=!1),/firefox/i.test(navigator.userAgent)&&(o.svgLumaHidden=!1),o}(),Ss={},Ar="filter_result_";function Rs(o){var d,x="SourceGraphic",M=o.data.ef?o.data.ef.length:0,L=S(),I=xi.createFilter(L,!0),H=0;this.filters=[];var Q;for(d=0;d=0&&(x=this.shapeModifiers[o].processShapes(this._isFirstFrame),!x);o-=1);}},searchProcessedElement:function(o){for(var d=this.processedElements,x=0,M=d.length;x.01)return !1;x+=1;}return !0},hs.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return !1;if(this.data.k.k[0].s)for(var o=0,d=this.data.k.k.length;o0;)nt=X.transformers[$t].mProps._mdf||nt,Ft-=1,$t-=1;if(nt)for(Ft=xt-X.styles[ft].lvl,$t=X.transformers.length-1;Ft>0;)Ot.multiply(X.transformers[$t].mProps.v),Ft-=1,$t-=1;}else Ot=o;if(Lt=X.sh.paths,N=Lt._length,nt){for(rt="",Y=0;Y=1?Tt=.99:Tt<=-1&&(Tt=-.99);var Dt=At*Tt,Et=Math.cos(lt+X.a.v)*Dt+rt[0],Pt=Math.sin(lt+X.a.v)*Dt+rt[1];Y.setAttribute("fx",Et),Y.setAttribute("fy",Pt),N&&!X.g._collapsable&&(X.of.setAttribute("fx",Et),X.of.setAttribute("fy",Pt));}}}function pt(et,X,$){var Y=X.style,N=X.d;N&&(N._mdf||$)&&N.dashStr&&(Y.pElem.setAttribute("stroke-dasharray",N.dashStr),Y.pElem.setAttribute("stroke-dashoffset",N.dashoffset[0])),X.c&&(X.c._mdf||$)&&Y.pElem.setAttribute("stroke","rgb("+z(X.c.v[0])+","+z(X.c.v[1])+","+z(X.c.v[2])+")"),(X.o._mdf||$)&&Y.pElem.setAttribute("stroke-opacity",X.o.v),(X.w._mdf||$)&&(Y.pElem.setAttribute("stroke-width",X.w.v),Y.msElem&&Y.msElem.setAttribute("stroke-width",X.w.v));}return x}();function Ee(o,d,x){this.shapes=[],this.shapesData=o.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(o,d,x),this.prevViewData=[];}c([gi,Be,ys,Es,ki,hi,Li],Ee),Ee.prototype.initSecondaryElement=function(){},Ee.prototype.identityMatrix=new Ce,Ee.prototype.buildExpressionInterface=function(){},Ee.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();},Ee.prototype.filterUniqueShapes=function(){var o,d=this.shapes.length,x,M,L=this.stylesList.length,I,H=[],Q=!1;for(M=0;M1&&Q&&this.setShapesAsAnimated(H);}},Ee.prototype.setShapesAsAnimated=function(o){var d,x=o.length;for(d=0;d=0;Z-=1){if(rt=this.searchProcessedElement(o[Z]),rt?d[Z]=x[rt-1]:o[Z]._render=H,o[Z].ty==="fl"||o[Z].ty==="st"||o[Z].ty==="gf"||o[Z].ty==="gs"||o[Z].ty==="no")rt?d[Z].style.closed=!1:d[Z]=this.createStyleElement(o[Z],L),o[Z]._render&&d[Z].style.pElem.parentNode!==M&&M.appendChild(d[Z].style.pElem),X.push(d[Z].style);else if(o[Z].ty==="gr"){if(!rt)d[Z]=this.createGroupElement(o[Z]);else for(et=d[Z].it.length,pt=0;pt1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},ye.prototype.addEffect=function(o){this.effectsSequence.push(o),this.elem.addDynamicProperty(this);},ye.prototype.getValue=function(o){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!o)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var d=this.currentData,x=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var M,L=this.effectsSequence.length,I=o||this.data.d.k[this.keysIndex].s;for(M=0;Md);)x+=1;return this.keysIndex!==x&&(this.keysIndex=x),this.data.d.k[this.keysIndex].s},ye.prototype.buildFinalText=function(o){for(var d=[],x=0,M=o.length,L,I,H=!1,Q=!1,Z="";x=55296&&L<=56319?Ci.isRegionalFlag(o,x)?Z=o.substr(x,14):(I=o.charCodeAt(x+1),I>=56320&&I<=57343&&(Ci.isModifier(L,I)?(Z=o.substr(x,2),H=!0):Ci.isFlagEmoji(o.substr(x,4))?Z=o.substr(x,4):Z=o.substr(x,2))):L>56319?(I=o.charCodeAt(x+1),Ci.isVariationSelector(L)&&(H=!0)):Ci.isZeroWidthJoiner(L)&&(H=!0,Q=!0),H?(d[d.length-1]+=Z,H=!1):d.push(Z),x+=Z.length;return d},ye.prototype.completeTextData=function(o){o.__complete=!0;var d=this.elem.globalData.fontManager,x=this.data,M=[],L,I,H,Q=0,Z,st=x.m.g,pt=0,et=0,X=0,$=[],Y=0,N=0,rt,nt,K=d.getFontByName(o.f),ft,dt=0,xt=Sr(K);o.fWeight=xt.weight,o.fStyle=xt.style,o.finalSize=o.s,o.finalText=this.buildFinalText(o.t),I=o.finalText.length,o.finalLineHeight=o.lh;var Lt=o.tr/1e3*o.finalSize,Ot;if(o.sz)for(var Ft=!0,$t=o.sz[0],_t=o.sz[1],At,lt;Ft;){lt=this.buildFinalText(o.t),At=0,Y=0,I=lt.length,Lt=o.tr/1e3*o.finalSize;var Tt=-1;for(L=0;L$t&<[L]!==" "?(Tt===-1?I+=1:L=Tt,At+=o.finalLineHeight||o.finalSize*1.2,lt.splice(L,Tt===L?1:0,"\r"),Tt=-1,Y=0):(Y+=dt,Y+=Lt);At+=K.ascent*o.finalSize/100,this.canResize&&o.finalSize>this.minimumFontSize&&_tN?Y:N,Y=-2*Lt,Z="",H=!0,X+=1):Z=Et,d.chars?(ft=d.getCharData(Et,K.fStyle,d.getFontByName(o.f).fFamily),dt=H?0:ft.w*o.finalSize/100):dt=d.measureText(Z,o.f,o.finalSize),Et===" "?Dt+=dt+Lt:(Y+=dt+Lt+Dt,Dt=0),M.push({l:dt,an:dt,add:pt,n:H,anIndexes:[],val:Z,line:X,animatorJustifyOffset:0}),st==2){if(pt+=dt,Z===""||Z===" "||L===I-1){for((Z===""||Z===" ")&&(pt-=dt);et<=L;)M[et].an=pt,M[et].ind=Q,M[et].extra=dt,et+=1;Q+=1,pt=0;}}else if(st==3){if(pt+=dt,Z===""||L===I-1){for(Z===""&&(pt-=dt);et<=L;)M[et].an=pt,M[et].ind=Q,M[et].extra=dt,et+=1;pt=0,Q+=1;}}else M[Q].ind=Q,M[Q].extra=0,Q+=1;if(o.l=M,N=Y>N?Y:N,$.push(Y),o.sz)o.boxWidth=o.sz[0],o.justifyOffset=0;else switch(o.boxWidth=N,o.j){case 1:o.justifyOffset=-o.boxWidth;break;case 2:o.justifyOffset=-o.boxWidth/2;break;default:o.justifyOffset=0;}o.lineWidths=$;var Pt=x.a,kt,ct;nt=Pt.length;var wt,qt,zt=[];for(rt=0;rt0?H=this.ne.v/100:Q=-this.ne.v/100,this.xe.v>0?Z=1-this.xe.v/100:st=1+this.xe.v/100;var pt=Ut.getBezierEasing(H,Q,Z,st).get,et=0,X=this.finalS,$=this.finalE,Y=this.data.sh;if(Y===2)$===X?et=I>=$?1:0:et=o(0,d(.5/($-X)+(I-X)/($-X),1)),et=pt(et);else if(Y===3)$===X?et=I>=$?0:1:et=1-o(0,d(.5/($-X)+(I-X)/($-X),1)),et=pt(et);else if(Y===4)$===X?et=0:(et=o(0,d(.5/($-X)+(I-X)/($-X),1)),et<.5?et*=2:et=1-2*(et-.5)),et=pt(et);else if(Y===5){if($===X)et=0;else {var N=$-X;I=d(o(0,I+.5-X),$-X);var rt=-N/2+I,nt=N/2;et=Math.sqrt(1-rt*rt/(nt*nt));}et=pt(et);}else Y===6?($===X?et=0:(I=d(o(0,I+.5-X),$-X),et=(1+Math.cos(Math.PI+Math.PI*2*I/($-X)))/2),et=pt(et)):(I>=x(X)&&(I-X<0?et=o(0,d(d($,1)-(X-I),1)):et=o(0,d($-I,1))),et=pt(et));if(this.sm.v!==100){var K=this.sm.v*.01;K===0&&(K=1e-8);var ft=.5-K*.5;et1&&(et=1));}return et*this.a.v},getValue:function(I){this.iterateDynamicProperties(),this._mdf=I||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,I&&this.data.r===2&&(this.e.v=this._currentTextLength);var H=this.data.r===2?1:100/this.data.totalChars,Q=this.o.v/H,Z=this.s.v/H+Q,st=this.e.v/H+Q;if(Z>st){var pt=Z;Z=st,st=pt;}this.finalS=Z,this.finalE=st;}},c([Ve],M);function L(I,H,Q){return new M(I,H)}return {getTextSelectorProp:L}}();function Vi(o,d,x){var M={propType:!1},L=Yt.getProp,I=d.a;this.a={r:I.r?L(o,I.r,0,ot,x):M,rx:I.rx?L(o,I.rx,0,ot,x):M,ry:I.ry?L(o,I.ry,0,ot,x):M,sk:I.sk?L(o,I.sk,0,ot,x):M,sa:I.sa?L(o,I.sa,0,ot,x):M,s:I.s?L(o,I.s,1,.01,x):M,a:I.a?L(o,I.a,1,0,x):M,o:I.o?L(o,I.o,0,.01,x):M,p:I.p?L(o,I.p,1,0,x):M,sw:I.sw?L(o,I.sw,0,0,x):M,sc:I.sc?L(o,I.sc,1,0,x):M,fc:I.fc?L(o,I.fc,1,0,x):M,fh:I.fh?L(o,I.fh,0,0,x):M,fs:I.fs?L(o,I.fs,0,.01,x):M,fb:I.fb?L(o,I.fb,0,.01,x):M,t:I.t?L(o,I.t,0,0,x):M},this.s=$r.getTextSelectorProp(o,d.s,x),this.s.t=d.s.t;}function Xi(o,d,x){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=o,this._renderType=d,this._elem=x,this._animatorsData=v(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(x);}Xi.prototype.searchProperties=function(){var o,d=this._textData.a.length,x,M=Yt.getProp;for(o=0;o=Y+Ns||!xt?($t=(Y+Ns-rt)/N.partialLength,de=dt.point[0]+(N.point[0]-dt.point[0])*$t,he=dt.point[1]+(N.point[1]-dt.point[1])*$t,I.translate(-x[0]*X[pt].an*.005,-(x[1]*Dt)*.01),nt=!1):xt&&(rt+=N.partialLength,K+=1,K>=xt.length&&(K=0,ft+=1,Lt[ft]?xt=Lt[ft].points:At.v.c?(K=0,ft=0,xt=Lt[ft].points):(rt-=N.partialLength,xt=null)),xt&&(dt=N,N=xt[K],Ot=N.partialLength));ie=X[pt].an/2-X[pt].add,I.translate(-ie,0,0);}else ie=X[pt].an/2-X[pt].add,I.translate(-ie,0,0),I.translate(-x[0]*X[pt].an*.005,-x[1]*Dt*.01,0);for(ct=0;cto?this.textSpans[o].span:Wt(Q?"g":"text"),ft<=o){if(Z.setAttribute("stroke-linecap","butt"),Z.setAttribute("stroke-linejoin","round"),Z.setAttribute("stroke-miterlimit","4"),this.textSpans[o].span=Z,Q){var xt=Wt("g");Z.appendChild(xt),this.textSpans[o].childSpan=xt;}this.textSpans[o].span=Z,this.layerElement.appendChild(Z);}Z.style.display="inherit";}if(st.reset(),et&&(H[o].n&&(X=-N,$+=x.yOffset,$+=Y?1:0,Y=!1),this.applyTextPropertiesToMatrix(x,st,H[o].line,X,$),X+=H[o].l||0,X+=N),Q){dt=this.globalData.fontManager.getCharData(x.finalText[o],M.fStyle,this.globalData.fontManager.getFontByName(x.f).fFamily);var Lt;if(dt.t===1)Lt=new Ze(dt.data,this.globalData,this);else {var Ot=zs;dt.data&&dt.data.shapes&&(Ot=this.buildShapeData(dt.data,x.finalSize)),Lt=new Ee(Ot,this.globalData,this);}if(this.textSpans[o].glyph){var Ft=this.textSpans[o].glyph;this.textSpans[o].childSpan.removeChild(Ft.layerElement),Ft.destroy();}this.textSpans[o].glyph=Lt,Lt._debug=!0,Lt.prepareFrame(0),Lt.renderFrame(),this.textSpans[o].childSpan.appendChild(Lt.layerElement),dt.t===1&&this.textSpans[o].childSpan.setAttribute("transform","scale("+x.finalSize/100+","+x.finalSize/100+")");}else et&&Z.setAttribute("transform","translate("+st.props[12]+","+st.props[13]+")"),Z.textContent=H[o].val,Z.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");}et&&Z&&Z.setAttribute("d",pt);}for(;o=0;d-=1)(this.completeLayers||this.elements[d])&&this.elements[d].prepareFrame(o-this.layers[d].st);if(this.globalData._mdf)for(d=0;d=0;x-=1)(this.completeLayers||this.elements[x])&&(this.elements[x].prepareFrame(this.renderedFrame-this.layers[x].st),this.elements[x]._mdf&&(this._mdf=!0));}},ti.prototype.renderInnerContent=function(){var o,d=this.layers.length;for(o=0;o=0;x-=1)o.finalTransform.multiply(o.transforms[x].transform.mProps.v);o._mdf=L;},processSequences:function(o){var d,x=this.sequenceList.length;for(d=0;d=1){this.buffers=[];var o=this.globalData.canvasContext,d=U.createCanvas(o.canvas.width,o.canvas.height);this.buffers.push(d);var x=U.createCanvas(o.canvas.width,o.canvas.height);this.buffers.push(x),this.data.tt>=3&&!document._isProxy&&U.loadLumaCanvas();}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new it(this),this.searchEffectTransforms();},createContent:function(){},setBlendMode:function(){var o=this.globalData;if(o.blendMode!==this.data.bm){o.blendMode=this.data.bm;var d=Ys(this.data.bm);o.canvasContext.globalCompositeOperation=d;}},createRenderableComponents:function(){this.maskManager=new vt(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(Ii.TRANSFORM_EFFECT);},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0);},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0);},clearCanvas:function(o){o.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy);},prepareLayer:function(){if(this.data.tt>=1){var o=this.buffers[0],d=o.getContext("2d");this.clearCanvas(d),d.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);}},exitLayer:function(){if(this.data.tt>=1){var o=this.buffers[1],d=o.getContext("2d");this.clearCanvas(d),d.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var x=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(x.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var M=U.getLumaCanvas(this.canvasContext.canvas),L=M.getContext("2d");L.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(M,0,0);}this.canvasContext.globalCompositeOperation=bt[this.data.tt],this.canvasContext.drawImage(o,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over";}},renderFrame:function(o){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!o)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var d=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(d),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(d),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1);}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy();},mHelper:new Ce},Mt.prototype.hide=Mt.prototype.hideElement,Mt.prototype.show=Mt.prototype.showElement;function Bt(o,d,x,M){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var L=4;d.ty==="rc"?L=5:d.ty==="el"?L=6:d.ty==="sr"&&(L=7),this.sh=ss.getShapeProp(o,d,L,o);var I,H=x.length,Q;for(I=0;I=0;I-=1){if(et=this.searchProcessedElement(o[I]),et?d[I]=x[et-1]:o[I]._shouldRender=M,o[I].ty==="fl"||o[I].ty==="st"||o[I].ty==="gf"||o[I].ty==="gs")et?d[I].style.closed=!1:d[I]=this.createStyleElement(o[I],Y),st.push(d[I].style);else if(o[I].ty==="gr"){if(!et)d[I]=this.createGroupElement(o[I]);else for(Z=d[I].it.length,Q=0;Q=0;L-=1)d[L].ty==="tr"?(H=x[L].transform,this.renderShapeTransform(o,H)):d[L].ty==="sh"||d[L].ty==="el"||d[L].ty==="rc"||d[L].ty==="sr"?this.renderPath(d[L],x[L]):d[L].ty==="fl"?this.renderFill(d[L],x[L],H):d[L].ty==="st"?this.renderStroke(d[L],x[L],H):d[L].ty==="gf"||d[L].ty==="gs"?this.renderGradientFill(d[L],x[L],H):d[L].ty==="gr"?this.renderShape(H,d[L].it,x[L].it):d[L].ty;M&&this.drawLayer();},It.prototype.renderStyledShape=function(o,d){if(this._isFirstFrame||d._mdf||o.transforms._mdf){var x=o.trNodes,M=d.paths,L,I,H,Q=M._length;x.length=0;var Z=o.transforms.finalTransform;for(H=0;H=1?pt=.99:pt<=-1&&(pt=-.99);var et=Z*pt,X=Math.cos(st+d.a.v)*et+H[0],$=Math.sin(st+d.a.v)*et+H[1];L=I.createRadialGradient(X,$,0,H[0],H[1],Z);}var Y,N=o.g.p,rt=d.g.c,nt=1;for(Y=0;YI&&Z==="xMidYMid slice"||LL&&Q==="meet"||IL&&Q==="slice")?this.transformCanvas.tx=(x-this.transformCanvas.w*(M/this.transformCanvas.h))/2*this.renderConfig.dpr:st==="xMax"&&(IL&&Q==="slice")?this.transformCanvas.tx=(x-this.transformCanvas.w*(M/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,pt==="YMid"&&(I>L&&Q==="meet"||IL&&Q==="meet"||I=0;o-=1)this.elements[o]&&this.elements[o].destroy&&this.elements[o].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0;},C.prototype.renderFrame=function(o,d){if(!(this.renderedFrame===o&&this.renderConfig.clearCanvas===!0&&!d||this.destroyed||o===-1)){this.renderedFrame=o,this.globalData.frameNum=o-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||d,this.globalData.projectInterface.currentFrame=o;var x,M=this.layers.length;for(this.completeLayers||this.checkLayers(o),x=M-1;x>=0;x-=1)(this.completeLayers||this.elements[x])&&this.elements[x].prepareFrame(o-this.layers[x].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),x=M-1;x>=0;x-=1)(this.completeLayers||this.elements[x])&&this.elements[x].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore();}}},C.prototype.buildItem=function(o){var d=this.elements;if(!(d[o]||this.layers[o].ty===99)){var x=this.createItem(this.layers[o],this,this.globalData);d[o]=x,x.initExpressions();}},C.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var o=this.pendingElements.pop();o.checkParenting();}},C.prototype.hide=function(){this.animationItem.container.style.display="none";},C.prototype.show=function(){this.animationItem.container.style.display="block";};function T(){this.opacity=-1,this.transform=b("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random();}function B(){this.stack=[],this.cArrPos=0,this.cTr=new Ce;var o,d=15;for(o=0;o=0;d-=1)(this.completeLayers||this.elements[d])&&this.elements[d].renderFrame();},G.prototype.destroy=function(){var o,d=this.layers.length;for(o=d-1;o>=0;o-=1)this.elements[o]&&this.elements[o].destroy();this.layers=null,this.elements=null;},G.prototype.createComp=function(o){return new G(o,this.globalData,this)};function O(o,d){this.animationItem=o,this.renderConfig={clearCanvas:d&&d.clearCanvas!==void 0?d.clearCanvas:!0,context:d&&d.context||null,progressiveLoad:d&&d.progressiveLoad||!1,preserveAspectRatio:d&&d.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:d&&d.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:d&&d.contentVisibility||"visible",className:d&&d.className||"",id:d&&d.id||"",runExpressions:!d||d.runExpressions===void 0||d.runExpressions},this.renderConfig.dpr=d&&d.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=d&&d.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new B,this.elements=[],this.pendingElements=[],this.transformMat=new Ce,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData));}return c([C],O),O.prototype.createComp=function(o){return new G(o,this.globalData,this)},Ae("canvas",O),_i.registerModifier("tm",je),_i.registerModifier("pb",di),_i.registerModifier("rp",oi),_i.registerModifier("rd",rs),_i.registerModifier("zz",ns),_i.registerModifier("op",xs),se});}),Sc=Pc();});var El={};fr(El,{default:()=>Ac});var Ec,Ac,Al=ls(()=>{qs();Ec=is((exports,module)=>{typeof navigator<"u"&&function(t,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.lottie=e());}(exports,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(t){_useWebWorker=!!t;},getWebWorker=function(){return _useWebWorker},setLocationHref=function(t){locationHref=t;},getLocationHref=function(){return locationHref};function createTag(t){return document.createElement(t)}function extendPrototype(t,e){var i,s=t.length,r;for(i=0;i1?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}(function(){var t=[],e,i;for(e=0;e<256;e+=1)i=e.toString(16),t[e]=i.length===1?"0"+i:i;return function(s,r,a){return s<0&&(s=0),r<0&&(r=0),a<0&&(a=0),"#"+t[s]+t[r]+t[a]}})();var setSubframeEnabled=function(t){subframeEnabled=!!t;},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(t){expressionsPlugin=t;},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(t){expressionsInterfaces=t;},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(t){defaultCurveSegments=t;},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(t){idPrefix$1=t;};function createNS(t){return document.createElementNS(svgNS,t)}function _typeof$5(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(e){return typeof e}:_typeof$5=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(t)}var dataManager=function(){var t=1,e=[],i,s,r={onmessage:function(){},postMessage:function(l){i({data:l});}},a={postMessage:function(l){r.onmessage({data:l});}};function n(l){if(window.Worker&&window.Blob&&getWebWorker()){var E=new Blob(["var _workerSelf = self; self.onmessage = ",l.toString()],{type:"text/javascript"}),b=URL.createObjectURL(E);return new Worker(b)}return i=l,r}function p(){s||(s=n(function(l){function E(){function v(ht,yt){var D,V,S=ht.length,R,tt,J,Gt;for(V=0;V=0;yt-=1)if(ht[yt].ty==="sh")if(ht[yt].ks.k.i)_(ht[yt].ks.k);else for(S=ht[yt].ks.k.length,V=0;VD[0]?!0:D[0]>ht[0]?!1:ht[1]>D[1]?!0:D[1]>ht[1]?!1:ht[2]>D[2]?!0:D[2]>ht[2]?!1:null}var z=function(){var ht=[4,4,14];function yt(V){var S=V.t.d;V.t.d={k:[{s:S,t:0}]};}function D(V){var S,R=V.length;for(S=0;S=0;S-=1)if(V[S].ty==="sh")if(V[S].ks.k.i)V[S].ks.k.c=V[S].closed;else for(J=V[S].ks.k.length,tt=0;tt500)&&(this._imageLoaded(),clearInterval(g)),f+=1;}.bind(this),50);}function a(u){var f=s(u,this.assetsPath,this.path),g=createNS("image");isSafari?this.testImageLoaded(g):g.addEventListener("load",this._imageLoaded,!1),g.addEventListener("error",function(){_.img=t,this._imageLoaded();}.bind(this),!1),g.setAttributeNS("http://www.w3.org/1999/xlink","href",f),this._elementHelper.append?this._elementHelper.append(g):this._elementHelper.appendChild(g);var _={img:g,assetData:u};return _}function n(u){var f=s(u,this.assetsPath,this.path),g=createTag("img");g.crossOrigin="anonymous",g.addEventListener("load",this._imageLoaded,!1),g.addEventListener("error",function(){_.img=t,this._imageLoaded();}.bind(this),!1),g.src=f;var _={img:g,assetData:u};return _}function p(u){var f={assetData:u},g=s(u,this.assetsPath,this.path);return dataManager.loadData(g,function(_){f.img=_,this._footageLoaded();}.bind(this),function(){f.img={},this._footageLoaded();}.bind(this)),f}function h(u,f){this.imagesLoadedCb=f;var g,_=u.length;for(g=0;g<_;g+=1)u[g].layers||(!u[g].t||u[g].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(u[g]))):u[g].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(u[g]))));}function y(u){this.path=u||"";}function P(u){this.assetsPath=u||"";}function c(u){for(var f=0,g=this.images.length;fthis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e=this.animationData.layers,i,s=e.length,r=t.layers,a,n=r.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(t){this.triggerRenderFrameError(t);}},AnimationItem.prototype.play=function(t){t&&this.name!==t||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},AnimationItem.prototype.pause=function(t){t&&this.name!==t||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(this.isPaused===!0?this.play():this.pause());},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(i=!0,e=0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"));}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart");},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,i!==-1&&this.goToAndStop(i,!0);},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),_typeof$4(t[0])==="object"){var i,s=t.length;for(i=0;i=0;V-=1)e[V].animation.destroy(D);}function W(D,V,S){var R=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),tt,J=R.length;for(tt=0;tt0?_=W:g=W;while(Math.abs(q)>a&&++ot=r?w(f,mt,g,_):gt===0?mt:v(f,z,z+h,g,_)}},t}(),pooling=function(){function t(e){return e.concat(createSizedArray(e.length))}return {double:t}}(),poolFactory=function(){return function(t,e,i){var s=0,r=t,a=createSizedArray(r),n={newElement:p,release:h};function p(){var y;return s?(s-=1,y=a[s]):y=e(),y}function h(y){s===r&&(a=pooling.double(a),r*=2),i&&i(y),a[s]=y,s+=1;}return n}}(),bezierLengthPool=function(){function t(){return {addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,t)}(),segmentsLengthPool=function(){function t(){return {lengths:[],totalLength:0}}function e(i){var s,r=i.lengths.length;for(s=0;s-.001&&f<.001}function i(l,E,b,v,w,u,f,g,_){if(b===0&&u===0&&_===0)return e(l,E,v,w,f,g);var k=t.sqrt(t.pow(v-l,2)+t.pow(w-E,2)+t.pow(u-b,2)),z=t.sqrt(t.pow(f-l,2)+t.pow(g-E,2)+t.pow(_-b,2)),q=t.sqrt(t.pow(f-v,2)+t.pow(g-w,2)+t.pow(_-u,2)),W;return k>z?k>q?W=k-z-q:W=q-z-k:q>z?W=q-z-k:W=z-k-q,W>-1e-4&&W<1e-4}var s=function(){return function(l,E,b,v){var w=getDefaultCurveSegments(),u,f,g,_,k,z=0,q,W=[],ot=[],mt=bezierLengthPool.newElement();for(g=b.length,u=0;uf?-1:1,k=!0;k;)if(v[u]<=f&&v[u+1]>f?(g=(f-v[u])/(v[u+1]-v[u]),k=!1):u+=_,u<0||u>=w-1){if(u===w-1)return b[u];k=!1;}return b[u]+(b[u+1]-b[u])*g}function y(l,E,b,v,w,u){var f=h(w,u),g=1-f,_=t.round((g*g*g*l[0]+(f*g*g+g*f*g+g*g*f)*b[0]+(f*f*g+g*f*f+f*g*f)*v[0]+f*f*f*E[0])*1e3)/1e3,k=t.round((g*g*g*l[1]+(f*g*g+g*f*g+g*g*f)*b[1]+(f*f*g+g*f*f+f*g*f)*v[1]+f*f*f*E[1])*1e3)/1e3;return [_,k]}var P=createTypedArray("float32",8);function c(l,E,b,v,w,u,f){w<0?w=0:w>1&&(w=1);var g=h(w,f);u=u>1?1:u;var _=h(u,f),k,z=l.length,q=1-g,W=1-_,ot=q*q*q,mt=g*q*q*3,gt=g*g*q*3,ut=g*g*g,Ct=q*q*W,ht=g*q*W+q*g*W+q*q*_,yt=g*g*W+q*g*_+g*q*_,D=g*g*_,V=q*W*W,S=g*W*W+q*_*W+q*W*_,R=g*_*W+q*_*_+g*W*_,tt=g*_*_,J=W*W*W,Gt=_*W*W+W*_*W+W*W*_,Vt=_*_*W+W*_*_+_*W*_,Xt=_*_*_;for(k=0;k=y.t-i){h.h&&(h=y),r=0;break}if(y.t-i>t){r=a;break}a=u||t=u?_.points.length-1:0;for(l=_.points[k].point.length,c=0;c=W&&z=u)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=f)s[0]=h.s[0],s[1]=h.s[1],s[2]=h.s[2];else {var ht=createQuaternion(h.s),yt=createQuaternion(g),D=(t-f)/(u-f);quaternionToEuler(s,slerp(ht,yt,D));}else for(a=0;a=u?E=1:t1e-6?(l=Math.acos(E),b=Math.sin(l),v=Math.sin((1-i)*l)/b,w=Math.sin(i*l)/b):(v=1-i,w=i),s[0]=v*r+w*h,s[1]=v*a+w*y,s[2]=v*n+w*P,s[3]=v*p+w*c,s}function quaternionToEuler(t,e){var i=e[0],s=e[1],r=e[2],a=e[3],n=Math.atan2(2*s*a-2*i*r,1-2*s*s-2*r*r),p=Math.asin(2*i*s+2*r*a),h=Math.atan2(2*i*a-2*s*r,1-2*i*i-2*r*r);t[0]=n/degToRads,t[1]=p/degToRads,t[2]=h/degToRads;}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,s=t[2]*degToRads,r=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(s/2),p=Math.sin(e/2),h=Math.sin(i/2),y=Math.sin(s/2),P=r*a*n-p*h*y,c=p*h*n+r*a*y,l=p*a*n+r*h*y,E=r*h*n-p*a*y;return [c,l,E,P]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s;}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if(this.propType==="unidimensional")e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i1e-5&&(this.v[i]=e,this._mdf=!0),i+=1;}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[];break}(!a[s]||a[s]&&!r)&&(a[s]=pointPool.newElement()),a[s][0]=t,a[s][1]=e;},ShapePath.prototype.setTripleAt=function(t,e,i,s,r,a,n,p){this.setXYAt(t,e,"v",n,p),this.setXYAt(i,s,"o",n,p),this.setXYAt(r,a,"i",n,p);},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,r=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),r=1);var a=this._length-1,n=this._length,p;for(p=r;p=ht[ht.length-1].t-this.offsetTime)k=ht[ht.length-1].s?ht[ht.length-1].s[0]:ht[ht.length-2].e[0],q=!0;else {for(var yt=_,D=ht.length-1,V=!0,S,R,tt;V&&(S=ht[yt],R=ht[yt+1],!(R.t-this.offsetTime>u));)yt=R.t-this.offsetTime)ut=1;else if(ug&&u>g)||(this._caching.lastIndex=_0||S>-1e-6&&S<0?s(S*R)/R:S}function V(){var S=this.props,R=D(S[0]),tt=D(S[1]),J=D(S[4]),Gt=D(S[5]),Vt=D(S[12]),Xt=D(S[13]);return "matrix("+R+","+tt+","+J+","+Gt+","+Vt+","+Xt+")"}return function(){this.reset=r,this.rotate=a,this.rotateX=n,this.rotateY=p,this.rotateZ=h,this.skew=P,this.skewFromAxis=c,this.shear=y,this.scale=l,this.setTransform=E,this.translate=b,this.transform=v,this.multiply=w,this.applyToPoint=k,this.applyToX=z,this.applyToY=q,this.applyToZ=W,this.applyToPointArray=Ct,this.applyToTriplePoints=ut,this.applyToPointStringified=ht,this.toCSS=yt,this.to2dCSS=V,this.clone=g,this.cloneFromProps=_,this.equals=f,this.inversePoints=gt,this.inversePoint=mt,this.getInverseMatrix=ot,this._t=this.transform,this.isIdentity=u,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset();}}();function _typeof$3(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(e){return typeof e}:_typeof$3=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(t)}var lottie={};function setLocation(t){setLocationHref(t);}function searchAnimations(){animationManager.searchAnimations();}function setSubframeRendering(t){setSubframeEnabled(t);}function setPrefix(t){setIdPrefix(t);}function loadAnimation(t){return animationManager.loadAnimation(t)}function setQuality(t){if(typeof t=="string")switch(t){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else !isNaN(t)&&t>1&&setDefaultCurveSegments(t);}function inBrowser(){return typeof navigator<"u"}function installPlugin(t,e){t==="expressions"&&setExpressionsPlugin(e);}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations());}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i"u"?"undefined":_typeof$3(exports))==="object"&&typeof module<"u")&&!(typeof define=="function"&&define.amd)&&(window.bodymovin=lottie);}catch(t){}var ShapeModifiers=function(){var t={},e={};t.registerModifier=i,t.getModifier=s;function i(r,a){e[r]||(e[r]=a);}function s(r,a,n){return new e[r](a,n)}return t}();function ShapeModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated();}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0);},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties());},extendPrototype([DynamicPropertyContainer],ShapeModifier);function TrimModifier(){}extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length;},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[];},TrimModifier.prototype.calculateShapeEdges=function(t,e,i,s,r){var a=[];e<=1?a.push({s:t,e}):t>=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n=[],p,h=a.length,y;for(p=0;ps+i)){var P,c;y.s*r<=s?P=0:P=(y.s*r-s)/i,y.e*r>=s+i?c=1:c=(y.e*r-s)/i,n.push([P,c]);}return n.length||n.push([0,0]),n},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e1?e=1+s:this.s.v<0?e=0+s:e=this.s.v+s,this.e.v>1?i=1+s:this.e.v<0?i=0+s:i=this.e.v+s,e>i){var r=e;e=i,i=r;}e=Math.round(e*1e4)*1e-4,i=Math.round(i*1e4)*1e-4,this.sValue=e,this.eValue=i;}else e=this.sValue,i=this.eValue;var a,n,p=this.shapes.length,h,y,P,c,l,E=0;if(i===e)for(n=0;n=0;n-=1)if(v=this.shapes[n],v.shape._mdf){for(w=v.localShapeCollection,w.releaseShapes(),this.m===2&&p>1?(_=this.calculateShapeEdges(e,i,v.totalShapeLength,g,E),g+=v.totalShapeLength):_=[[u,f]],y=_.length,h=0;h=1?b.push({s:v.totalShapeLength*(u-1),e:v.totalShapeLength*(f-1)}):(b.push({s:v.totalShapeLength*u,e:v.totalShapeLength}),b.push({s:0,e:v.totalShapeLength*(f-1)}));var k=this.addShapes(v,b[0]);if(b[0].s!==b[0].e){if(b.length>1){var z=v.shape.paths.shapes[v.shape.paths._length-1];if(z.c){var q=k.pop();this.addPaths(k,w),k=this.addShapes(v,b[1],q);}else this.addPaths(k,w),k=this.addShapes(v,b[1]);}this.addPaths(k,w);}}v.shape.paths=w;}}},TrimModifier.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;ie.e){i.c=!1;break}else e.s<=y&&e.e>=y+P.addedLength?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[p],r[a].v[p],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[p],r[a].o[p-1],r[a].i[p],(e.s-y)/P.addedLength,(e.e-y)/P.addedLength,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1),y+=P.addedLength,c+=1;if(r[a].c&&l.length){if(P=l[p-1],y<=e.e){var u=l[p-1].addedLength;e.s<=y&&e.e>=y+u?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[0],r[a].v[0],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[0],r[a].o[p-1],r[a].i[0],(e.s-y)/u,(e.e-y)/u,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1);}else i.c=!1;y+=P.addedLength,c+=1;}if(i._length&&(i.setXYAt(i.v[v][0],i.v[v][1],"i",v),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),y>e.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(P=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/y,0),c=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/y,0)):(P=this.p.pv,c=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/y,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){P=[],c=[];var l=this.px,E=this.py;l._caching.lastFrame+l.offsetTime<=l.keyframes[0].t?(P[0]=l.getValueAtTime((l.keyframes[0].t+.01)/y,0),P[1]=E.getValueAtTime((E.keyframes[0].t+.01)/y,0),c[0]=l.getValueAtTime(l.keyframes[0].t/y,0),c[1]=E.getValueAtTime(E.keyframes[0].t/y,0)):l._caching.lastFrame+l.offsetTime>=l.keyframes[l.keyframes.length-1].t?(P[0]=l.getValueAtTime(l.keyframes[l.keyframes.length-1].t/y,0),P[1]=E.getValueAtTime(E.keyframes[E.keyframes.length-1].t/y,0),c[0]=l.getValueAtTime((l.keyframes[l.keyframes.length-1].t-.01)/y,0),c[1]=E.getValueAtTime((E.keyframes[E.keyframes.length-1].t-.01)/y,0)):(P=[l.pv,E.pv],c[0]=l.getValueAtTime((l._caching.lastFrame+l.offsetTime-.01)/y,l.offsetTime),c[1]=E.getValueAtTime((E._caching.lastFrame+E.offsetTime-.01)/y,E.offsetTime));}else c=t,P=c;this.v.rotate(-Math.atan2(P[1]-c[1],P[0]-c[0]));}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);}this.frameId=this.elem.globalData.frameId;}}function s(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4);}function r(){}function a(h){this._addDynamicProperty(h),this.elem.addDynamicProperty(h),this._isDirty=!0;}function n(h,y,P){if(this.elem=h,this.frameId=-1,this.propType="transform",this.data=y,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(P||h),y.p&&y.p.s?(this.px=PropertyFactory.getProp(h,y.p.x,0,0,this),this.py=PropertyFactory.getProp(h,y.p.y,0,0,this),y.p.z&&(this.pz=PropertyFactory.getProp(h,y.p.z,0,0,this))):this.p=PropertyFactory.getProp(h,y.p||{k:[0,0,0]},1,0,this),y.rx){if(this.rx=PropertyFactory.getProp(h,y.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(h,y.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(h,y.rz,0,degToRads,this),y.or.k[0].ti){var c,l=y.or.k.length;for(c=0;c0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0);},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e0?Math.floor(l):Math.ceil(l),v=this.pMatrix.props,w=this.rMatrix.props,u=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var f=0;if(l>0){for(;fb;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),f-=1;E&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-E,!0),f-=E);}s=this.data.m===1?0:this._currentCopies-1,r=this.data.m===1?1:-1,a=this._currentCopies;for(var g,_;a;){if(e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,_=i.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),f!==0){for((s!==0&&r===1||s!==this._currentCopies-1&&r===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],w[8],w[9],w[10],w[11],w[12],w[13],w[14],w[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),g=0;g<_;g+=1)i[g]=this.matrix.props[g];this.matrix.reset();}else for(this.matrix.reset(),g=0;g<_;g+=1)i[g]=this.matrix.props[g];f+=1,a-=1,s+=r;}}else for(a=this._currentCopies,s=0,r=1;a;)e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,s+=r;return n},RepeaterModifier.prototype.addShape=function(){};function RoundCornersModifier(){}extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length;},RoundCornersModifier.prototype.processPath=function(t,e){var i=shapePool.newElement();i.c=t.c;var s,r=t._length,a,n,p,h,y,P,c=0,l,E,b,v,w,u;for(s=0;s0&&s<1?[e]:[]:[e-s,e+s].filter(function(r){return r>0&&r<1})},PolynomialBezier.prototype.split=function(t){if(t<=0)return [singlePoint(this.points[0]),this];if(t>=1)return [this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),i=lerpPoint(this.points[1],this.points[2],t),s=lerpPoint(this.points[2],this.points[3],t),r=lerpPoint(e,i,t),a=lerpPoint(i,s,t),n=lerpPoint(r,a,t);return [new PolynomialBezier(this.points[0],e,r,n,!0),new PolynomialBezier(n,a,s,this.points[3],!0)]};function extrema(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var r=s;s=i,i=r;}for(var a=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),n=0;n0&&a[n]<1){var p=t.point(a[n])[e];ps&&(s=p);}return {min:i,max:s}}PolynomialBezier.prototype.bounds=function(){return {x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return {left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}};function intersectData(t,e,i){var s=t.boundingBox();return {cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function splitData(t){var e=t.bez.split(.5);return [intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return Math.abs(t.cx-e.cx)*2=a||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s){r.push([t.t,e.t]);return}var n=splitData(t),p=splitData(e);intersectsImpl(n[0],p[0],i+1,s,r,a),intersectsImpl(n[0],p[1],i+1,s,r,a),intersectsImpl(n[1],p[0],i+1,s,r,a),intersectsImpl(n[1],p[1],i+1,s,r,a);}}PolynomialBezier.prototype.intersections=function(t,e,i){e===void 0&&(e=2),i===void 0&&(i=7);var s=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,s,i),s},PolynomialBezier.shapeSegment=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[i],t.v[i],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[i],t.i[i],t.o[e],t.v[e],!0)};function crossProduct(t,e){return [t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,i,s){var r=[t[0],t[1],1],a=[e[0],e[1],1],n=[i[0],i[1],1],p=[s[0],s[1],1],h=crossProduct(crossProduct(r,a),crossProduct(n,p));return floatZero(h[2])?null:[h[0]/h[2],h[1]/h[2]]}function polarOffset(t,e,i){return [t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0;};function setPoint(t,e,i,s,r,a,n){var p=i-Math.PI/2,h=i+Math.PI/2,y=e[0]+Math.cos(i)*s*r,P=e[1]-Math.sin(i)*s*r;t.setTripleAt(y,P,y+Math.cos(p)*a,P-Math.sin(p)*a,y+Math.cos(h)*n,P-Math.sin(h)*n,t.length());}function getPerpendicularVector(t,e){var i=[e[0]-t[0],e[1]-t[1]],s=-Math.PI*.5,r=[Math.cos(s)*i[0]-Math.sin(s)*i[1],Math.sin(s)*i[0]+Math.cos(s)*i[1]];return r}function getProjectingAngle(t,e){var i=e===0?t.length()-1:e-1,s=(e+1)%t.length(),r=t.v[i],a=t.v[s],n=getPerpendicularVector(r,a);return Math.atan2(0,1)-Math.atan2(n[1],n[0])}function zigZagCorner(t,e,i,s,r,a,n){var p=getProjectingAngle(e,i),h=e.v[i%e._length],y=e.v[i===0?e._length-1:i-1],P=e.v[(i+1)%e._length],c=a===2?Math.sqrt(Math.pow(h[0]-y[0],2)+Math.pow(h[1]-y[1],2)):0,l=a===2?Math.sqrt(Math.pow(h[0]-P[0],2)+Math.pow(h[1]-P[1],2)):0;setPoint(t,e.v[i%e._length],p,n,s,l/((r+1)*2),c/((r+1)*2));}function zigZagSegment(t,e,i,s,r,a){for(var n=0;n1&&e.length>1&&(r=getIntersection(t[0],e[e.length-1]),r)?[[t[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[i,s]}function pruneIntersections(t){for(var e,i=1;i1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var i=t.inflectionPoints(),s,r,a,n;if(i.length===0)return [offsetSegment(t,e)];if(i.length===1||floatEqual(i[1],1))return a=t.split(i[0]),s=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(r,e)];a=t.split(i[0]),s=a[0];var p=(i[1]-i[0])/(1-i[0]);return a=a[1].split(p),n=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(n,e),offsetSegment(r,e)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(t,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=this.amount.effectsSequence.length!==0;},OffsetPathModifier.prototype.processPath=function(t,e,i,s){var r=shapePool.newElement();r.c=t.c;var a=t.length();t.c||(a-=1);var n,p,h,y=[];for(n=0;n=0;n-=1)h=PolynomialBezier.shapeSegmentInverted(t,n),y.push(offsetSegmentSplit(h,e));y=pruneIntersections(y);var P=null,c=null;for(n=0;n0&&(Gt=!1),Gt){var Ht=createTag("style");Ht.setAttribute("f-forigin",S[R].fOrigin),Ht.setAttribute("f-origin",S[R].origin),Ht.setAttribute("f-family",S[R].fFamily),Ht.type="text/css",Ht.innerText="@font-face {font-family: "+S[R].fFamily+"; font-style: normal; src: url('"+S[R].fPath+"');}",V.appendChild(Ht);}}else if(S[R].fOrigin==="g"||S[R].origin===1){for(Vt=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),Xt=0;Xt=55296&&S<=56319){var R=D.charCodeAt(1);R>=56320&&R<=57343&&(V=(S-55296)*1024+R-56320+65536);}return V}function z(D,V){var S=D.toString(16)+V.toString(16);return c.indexOf(S)!==-1}function q(D){return D===h}function W(D){return D===p}function ot(D){var V=k(D);return V>=y&&V<=P}function mt(D){return ot(D.substr(0,2))&&ot(D.substr(2,2))}function gt(D){return i.indexOf(D)!==-1}function ut(D,V){var S=k(D.substr(V,2));if(S!==s)return !1;var R=0;for(V+=2;R<5;){if(S=k(D.substr(V,2)),Sn)return !1;R+=1,V+=2;}return k(D.substr(V,2))===r}function Ct(){this.isLoaded=!0;}var ht=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this);};ht.isModifier=z,ht.isZeroWidthJoiner=q,ht.isFlagEmoji=mt,ht.isRegionalCode=ot,ht.isCombinedCharacter=gt,ht.isRegionalFlag=ut,ht.isVariationSelector=W,ht.BLACK_FLAG_CODE_POINT=s;var yt={addChars:u,addFonts:w,getCharData:f,getFontByName:_,measureText:g,checkLoadedFonts:b,setIsLoaded:Ct};return ht.prototype=yt,ht}();function SlotManager(t){this.animationData=t;}SlotManager.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t};function slotFactory(t){return new SlotManager(t)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[];},addRenderableComponent:function(t){this.renderableComponents.indexOf(t)===-1&&this.renderableComponents.push(t);},removeRenderableComponent:function(t){this.renderableComponents.indexOf(t)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1);},prepareRenderableFrame:function(t){this.checkLayerLimits(t);},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show());},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide());},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0));},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1;},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1;},AudioElement.prototype.resume=function(){this._canPlay=!0;},AudioElement.prototype.setRate=function(t){this.audio.rate(t);},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume);},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(t){var e,i=this.layers.length,s;for(this.completeLayers=!0,e=i-1;e>=0;e-=1)this.elements[e]||(s=this.layers[e],s.ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements();},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",l),this.element.maskedElement.setAttribute(f,"url("+getLocationHref()+"#"+l+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this);}MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e=this.element.finalTransform.mat,i,s=this.masksProperties.length;for(i=0;i1&&(s+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==s){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+s:s),i.elem.setAttribute("d",n)),i.lastPath=s;}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null;};var filtersFactory=function(){var t={};t.createFilter=e,t.createAlphaToLuminanceFilter=i;function e(s,r){var a=createNS("filter");return a.setAttribute("id",s),r!==!0&&(a.setAttribute("filterUnits","objectBoundingBox"),a.setAttribute("x","0%"),a.setAttribute("y","0%"),a.setAttribute("width","100%"),a.setAttribute("height","100%")),a}function i(){var s=createNS("feColorMatrix");return s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),s}return t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return (/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(t){var e,i="SourceGraphic",s=t.data.ef?t.data.ef.length:0,r=createElementID(),a=filtersFactory.createFilter(r,!0),n=0;this.filters=[];var p;for(e=0;e=0&&(i=this.shapeModifiers[t].processShapes(this._isFirstFrame),!i);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i.01)return !1;i+=1;}return !0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return !1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t0;)u=l.transformers[ot].mProps._mdf||u,W-=1,ot-=1;if(u)for(W=k-l.styles[g].lvl,ot=l.transformers.length-1;W>0;)q.multiply(l.transformers[ot].mProps.v),W-=1,ot-=1;}else q=t;if(z=l.sh.paths,v=z._length,u){for(w="",b=0;b=1?Ct=.99:Ct<=-1&&(Ct=-.99);var ht=gt*Ct,yt=Math.cos(ut+l.a.v)*ht+w[0],D=Math.sin(ut+l.a.v)*ht+w[1];b.setAttribute("fx",yt),b.setAttribute("fy",D),v&&!l.g._collapsable&&(l.of.setAttribute("fx",yt),l.of.setAttribute("fy",D));}}}function P(c,l,E){var b=l.style,v=l.d;v&&(v._mdf||E)&&v.dashStr&&(b.pElem.setAttribute("stroke-dasharray",v.dashStr),b.pElem.setAttribute("stroke-dashoffset",v.dashoffset[0])),l.c&&(l.c._mdf||E)&&b.pElem.setAttribute("stroke","rgb("+bmFloor(l.c.v[0])+","+bmFloor(l.c.v[1])+","+bmFloor(l.c.v[2])+")"),(l.o._mdf||E)&&b.pElem.setAttribute("stroke-opacity",l.o.v),(l.w._mdf||E)&&(b.pElem.setAttribute("stroke-width",l.w.v),b.msElem&&b.msElem.setAttribute("stroke-width",l.w.v));}return i}();function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[];}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e=this.shapes.length,i,s,r=this.stylesList.length,a,n=[],p=!1;for(s=0;s1&&p&&this.setShapesAsAnimated(n);}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e=0;h-=1){if(w=this.searchProcessedElement(t[h]),w?e[h]=i[w-1]:t[h]._render=n,t[h].ty==="fl"||t[h].ty==="st"||t[h].ty==="gf"||t[h].ty==="gs"||t[h].ty==="no")w?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],r),t[h]._render&&e[h].style.pElem.parentNode!==s&&s.appendChild(e[h].style.pElem),l.push(e[h].style);else if(t[h].ty==="gr"){if(!w)e[h]=this.createGroupElement(t[h]);else for(c=e[h].it.length,P=0;P1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this);},TextProperty.prototype.getValue=function(t){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!t)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var s,r=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(s=0;se);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e=[],i=0,s=t.length,r,a,n=!1,p=!1,h="";i=55296&&r<=56319?FontManager.isRegionalFlag(t,i)?h=t.substr(i,14):(a=t.charCodeAt(i+1),a>=56320&&a<=57343&&(FontManager.isModifier(r,a)?(h=t.substr(i,2),n=!0):FontManager.isFlagEmoji(t.substr(i,4))?h=t.substr(i,4):h=t.substr(i,2))):r>56319?(a=t.charCodeAt(i+1),FontManager.isVariationSelector(r)&&(n=!0)):FontManager.isZeroWidthJoiner(r)&&(n=!0,p=!0),n?(e[e.length-1]+=h,n=!1):e.push(h),i+=h.length;return e},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e=this.elem.globalData.fontManager,i=this.data,s=[],r,a,n,p=0,h,y=i.m.g,P=0,c=0,l=0,E=[],b=0,v=0,w,u,f=e.getFontByName(t.f),g,_=0,k=getFontProperties(f);t.fWeight=k.weight,t.fStyle=k.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),a=t.finalText.length,t.finalLineHeight=t.lh;var z=t.tr/1e3*t.finalSize,q;if(t.sz)for(var W=!0,ot=t.sz[0],mt=t.sz[1],gt,ut;W;){ut=this.buildFinalText(t.t),gt=0,b=0,a=ut.length,z=t.tr/1e3*t.finalSize;var Ct=-1;for(r=0;rot&&ut[r]!==" "?(Ct===-1?a+=1:r=Ct,gt+=t.finalLineHeight||t.finalSize*1.2,ut.splice(r,Ct===r?1:0,"\r"),Ct=-1,b=0):(b+=_,b+=z);gt+=f.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&mtv?b:v,b=-2*z,h="",n=!0,l+=1):h=yt,e.chars?(g=e.getCharData(yt,f.fStyle,e.getFontByName(t.f).fFamily),_=n?0:g.w*t.finalSize/100):_=e.measureText(h,t.f,t.finalSize),yt===" "?ht+=_+z:(b+=_+z+ht,ht=0),s.push({l:_,an:_,add:P,n,anIndexes:[],val:h,line:l,animatorJustifyOffset:0}),y==2){if(P+=_,h===""||h===" "||r===a-1){for((h===""||h===" ")&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;p+=1,P=0;}}else if(y==3){if(P+=_,h===""||r===a-1){for(h===""&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;P=0,p+=1;}}else s[p].ind=p,s[p].extra=0,p+=1;if(t.l=s,v=b>v?b:v,E.push(b),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0;}t.lineWidths=E;var D=i.a,V,S;u=D.length;var R,tt,J=[];for(w=0;w0?n=this.ne.v/100:p=-this.ne.v/100,this.xe.v>0?h=1-this.xe.v/100:y=1+this.xe.v/100;var P=BezierFactory.getBezierEasing(n,p,h,y).get,c=0,l=this.finalS,E=this.finalE,b=this.data.sh;if(b===2)E===l?c=a>=E?1:0:c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===3)E===l?c=a>=E?0:1:c=1-t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===4)E===l?c=0:(c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c<.5?c*=2:c=1-2*(c-.5)),c=P(c);else if(b===5){if(E===l)c=0;else {var v=E-l;a=e(t(0,a+.5-l),E-l);var w=-v/2+a,u=v/2;c=Math.sqrt(1-w*w/(u*u));}c=P(c);}else b===6?(E===l?c=0:(a=e(t(0,a+.5-l),E-l),c=(1+Math.cos(Math.PI+Math.PI*2*a/(E-l)))/2),c=P(c)):(a>=i(l)&&(a-l<0?c=t(0,e(e(E,1)-(l-a),1)):c=t(0,e(E-a,1))),c=P(c));if(this.sm.v!==100){var f=this.sm.v*.01;f===0&&(f=1e-8);var g=.5-f*.5;c1&&(c=1));}return c*this.a.v},getValue:function(a){this.iterateDynamicProperties(),this._mdf=a||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,a&&this.data.r===2&&(this.e.v=this._currentTextLength);var n=this.data.r===2?1:100/this.data.totalChars,p=this.o.v/n,h=this.s.v/n+p,y=this.e.v/n+p;if(h>y){var P=h;h=y,y=P;}this.finalS=h,this.finalE=y;}},extendPrototype([DynamicPropertyContainer],s);function r(a,n,p){return new s(a,n)}return {getTextSelectorProp:r}}();function TextAnimatorDataProperty(t,e,i){var s={propType:!1},r=PropertyFactory.getProp,a=e.a;this.a={r:a.r?r(t,a.r,0,degToRads,i):s,rx:a.rx?r(t,a.rx,0,degToRads,i):s,ry:a.ry?r(t,a.ry,0,degToRads,i):s,sk:a.sk?r(t,a.sk,0,degToRads,i):s,sa:a.sa?r(t,a.sa,0,degToRads,i):s,s:a.s?r(t,a.s,1,.01,i):s,a:a.a?r(t,a.a,1,0,i):s,o:a.o?r(t,a.o,0,.01,i):s,p:a.p?r(t,a.p,1,0,i):s,sw:a.sw?r(t,a.sw,0,0,i):s,sc:a.sc?r(t,a.sc,1,0,i):s,fc:a.fc?r(t,a.fc,1,0,i):s,fh:a.fh?r(t,a.fh,0,0,i):s,fs:a.fs?r(t,a.fs,0,.01,i):s,fb:a.fb?r(t,a.fb,0,.01,i):s,t:a.t?r(t,a.t,0,0,i):s},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t;}function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i);}TextAnimatorProperty.prototype.searchProperties=function(){var t,e=this._textData.a.length,i,s=PropertyFactory.getProp;for(t=0;t=b+oe||!k?(ot=(b+oe-w)/v.partialLength,Xt=_.point[0]+(v.point[0]-_.point[0])*ot,Ht=_.point[1]+(v.point[1]-_.point[1])*ot,a.translate(-i[0]*l[P].an*.005,-(i[1]*ht)*.01),u=!1):k&&(w+=v.partialLength,f+=1,f>=k.length&&(f=0,g+=1,z[g]?k=z[g].points:gt.v.c?(f=0,g=0,k=z[g].points):(w-=v.partialLength,k=null)),k&&(_=v,v=k[f],q=v.partialLength));Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0);}else Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0),a.translate(-i[0]*l[P].an*.005,-i[1]*ht*.01,0);for(S=0;St?this.textSpans[t].span:createNS(p?"g":"text"),g<=t){if(h.setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=h,p){var k=createNS("g");h.appendChild(k),this.textSpans[t].childSpan=k;}this.textSpans[t].span=h,this.layerElement.appendChild(h);}h.style.display="inherit";}if(y.reset(),c&&(n[t].n&&(l=-v,E+=i.yOffset,E+=b?1:0,b=!1),this.applyTextPropertiesToMatrix(i,y,n[t].line,l,E),l+=n[t].l||0,l+=v),p){_=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily);var z;if(_.t===1)z=new SVGCompElement(_.data,this.globalData,this);else {var q=emptyShapeData;_.data&&_.data.shapes&&(q=this.buildShapeData(_.data,i.finalSize)),z=new SVGShapeElement(q,this.globalData,this);}if(this.textSpans[t].glyph){var W=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(W.layerElement),W.destroy();}this.textSpans[t].glyph=z,z._debug=!0,z.prepareFrame(0),z.renderFrame(),this.textSpans[t].childSpan.appendChild(z.layerElement),_.t===1&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")");}else c&&h.setAttribute("transform","translate("+y.props[12]+","+y.props[13]+")"),h.textContent=n[t].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");}c&&h&&h.setAttribute("d",P);}for(;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0));}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t=0;i-=1)t.finalTransform.multiply(t.transforms[i].transform.mProps.v);t._mdf=r;},processSequences:function(t){var e,i=this.sequenceList.length;for(e=0;e=1){this.buffers=[];var t=this.globalData.canvasContext,e=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(e);var i=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(i),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas();}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms();},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e;}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0);},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0);},clearCanvas:function(t){t.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy);},prepareLayer:function(){if(this.data.tt>=1){var t=this.buffers[0],e=t.getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);}},exitLayer:function(){if(this.data.tt>=1){var t=this.buffers[1],e=t.getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var i=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(i.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var s=assetLoader.getLumaCanvas(this.canvasContext.canvas),r=s.getContext("2d");r.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(s,0,0);}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(t,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over";}},renderFrame:function(t){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!t)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var e=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(e),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(e),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1);}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy();},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(t,e,i,s){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var r=4;e.ty==="rc"?r=5:e.ty==="el"?r=6:e.ty==="sr"&&(r=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,r,t);var a,n=i.length,p;for(a=0;a=0;a-=1){if(c=this.searchProcessedElement(t[a]),c?e[a]=i[c-1]:t[a]._shouldRender=s,t[a].ty==="fl"||t[a].ty==="st"||t[a].ty==="gf"||t[a].ty==="gs")c?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],b),y.push(e[a].style);else if(t[a].ty==="gr"){if(!c)e[a]=this.createGroupElement(t[a]);else for(h=e[a].it.length,p=0;p=0;r-=1)e[r].ty==="tr"?(n=i[r].transform,this.renderShapeTransform(t,n)):e[r].ty==="sh"||e[r].ty==="el"||e[r].ty==="rc"||e[r].ty==="sr"?this.renderPath(e[r],i[r]):e[r].ty==="fl"?this.renderFill(e[r],i[r],n):e[r].ty==="st"?this.renderStroke(e[r],i[r],n):e[r].ty==="gf"||e[r].ty==="gs"?this.renderGradientFill(e[r],i[r],n):e[r].ty==="gr"?this.renderShape(n,e[r].it,i[r].it):e[r].ty;s&&this.drawLayer();},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var i=t.trNodes,s=e.paths,r,a,n,p=s._length;i.length=0;var h=t.transforms.finalTransform;for(n=0;n=1?P=.99:P<=-1&&(P=-.99);var c=h*P,l=Math.cos(y+e.a.v)*c+n[0],E=Math.sin(y+e.a.v)*c+n[1];r=a.createRadialGradient(l,E,0,n[0],n[1],h);}var b,v=t.g.p,w=e.g.c,u=1;for(b=0;ba&&h==="xMidYMid slice"||rr&&p==="meet"||ar&&p==="slice")?this.transformCanvas.tx=(i-this.transformCanvas.w*(s/this.transformCanvas.h))/2*this.renderConfig.dpr:y==="xMax"&&(ar&&p==="slice")?this.transformCanvas.tx=(i-this.transformCanvas.w*(s/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,P==="YMid"&&(a>r&&p==="meet"||ar&&p==="meet"||a=0;t-=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0;},CanvasRendererBase.prototype.renderFrame=function(t,e){if(!(this.renderedFrame===t&&this.renderConfig.clearCanvas===!0&&!e||this.destroyed||t===-1)){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var i,s=this.layers.length;for(this.completeLayers||this.checkLayers(t),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].prepareFrame(t-this.layers[i].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore();}}},CanvasRendererBase.prototype.buildItem=function(t){var e=this.elements;if(!(e[t]||this.layers[t].ty===99)){var i=this.createItem(this.layers[t],this,this.globalData);e[t]=i,i.initExpressions();}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();t.checkParenting();}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none";},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block";};function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random();}function CVContextData(){this.stack=[],this.cArrPos=0,this.cTr=new Matrix;var t,e=15;for(t=0;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame();},CVCompElement.prototype.destroy=function(){var t,e=this.layers.length;for(t=e-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null;},CVCompElement.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)};function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:e&&e.clearCanvas!==void 0?e.clearCanvas:!0,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",className:e&&e.className||"",id:e&&e.id||"",runExpressions:!e||e.runExpressions===void 0||e.runExpressions},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData));}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},registerRenderer("canvas",CanvasRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier);var CompExpressionInterface=function(){return function(t){function e(i){for(var s=0,r=t.layers.length;s=y;)mt/=2,gt/=2,ut>>>=1;return (mt+ut)/gt};return ot.int32=function(){return W.g(4)|0},ot.quick=function(){return W.g(4)/4294967296},ot.double=ot,w(f(W.S),t),(_.pass||k||function(mt,gt,ut,Ct){return Ct&&(Ct.S&&b(Ct,W),mt.state=function(){return b(W,{})}),ut?(e[n]=mt,gt):mt})(ot,q,"global"in _?_.global:this==e,_.state)}e["seed"+n]=l;function E(g){var _,k=g.length,z=this,q=0,W=z.i=z.j=0,ot=z.S=[];for(k||(g=[k++]);qi){var s=i;i=e,e=s;}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if(typeof t=="number"||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var i,s=Math.min(t.length,e.length),r=0;for(i=0;i.5?y/(2-r-a):y/(r+a),r){case e:n=(i-s)/y+(i1&&(i-=1),i<1/6?t+(e-t)*6*i:i<1/2?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e=t[0],i=t[1],s=t[2],r,a,n;if(i===0)r=s,n=s,a=s;else {var p=s<.5?s*(1+i):s+i-s*i,h=2*s-p;r=hue2rgb(h,p,e+1/3),a=hue2rgb(h,p,e),n=hue2rgb(h,p,e-1/3);}return [r,a,n,t[3]]}function linear(t,e,i,s,r){if((s===void 0||r===void 0)&&(s=e,r=i,e=0,i=1),i=i)return r;var n=i===e?0:(t-e)/(i-e);if(!s.length)return s+(r-s)*n;var p,h=s.length,y=createTypedArray("float32",h);for(p=0;p1){for(r=0;r1?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(r)){var p,h=r.length,y=createTypedArray("float32",h);for(p=0;pdata.k[e].t&&tdata.k[e+1].t-t?(s=e+2,r=data.k[e+1].t):(s=e+1,r=data.k[e].t);break}s===-1&&(s=e+1,r=data.k[e].t);}var a={};return a.index=s,a.time=r/elem.comp.globalData.frameRate,a}function key(t){var e,i,s;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(s=r.length,i=0;iw.length-1)&&(E=w.length-1),g=w[w.length-1-E].t,f=u-g);var _,k,z;if(l==="pingpong"){var q=Math.floor((v-g)/f);if(q%2!==0)return this.getValueAtTime((f-(v-g)%f+g)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(g/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(u/this.comp.globalData.frameRate,0),mt=this.getValueAtTime(((v-g)%f+g)/this.comp.globalData.frameRate,0),gt=Math.floor((v-g)/f);if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_=u)return this.pv;var f,g;b?(E?f=Math.abs(this.elem.comp.globalData.frameRate*E):f=Math.max(0,this.elem.data.op-u),g=u+f):((!E||E>w.length-1)&&(E=w.length-1),g=w[E].t,f=g-u);var _,k,z;if(l==="pingpong"){var q=Math.floor((u-v)/f);if(q%2===0)return this.getValueAtTime(((u-v)%f+u)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(u/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(g/this.comp.globalData.frameRate,0),mt=this.getValueAtTime((f-(u-v)%f+u)/this.comp.globalData.frameRate,0),gt=Math.floor((u-v)/f)+1;if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_1?(w-v)/(E-1):1,f=0,g=0,_;this.pv.length?_=createTypedArray("float32",this.pv.length):_=0;for(var k;fu){var z=f,q=b.c&&f===g-1?0:f+1,W=(u-_)/w[f].addedLength;k=bez.getPointInSegment(b.v[z],b.v[q],b.o[z],b.i[q],W,w[f]);break}else _+=w[f].addedLength;f+=1;}return k||(k=b.c?[b.v[0][0],b.v[0][1]]:[b.v[b._length-1][0],b.v[b._length-1][1]]),k},vectorOnPath:function(l,E,b){l==1?l=this.v.c:l==0&&(l=.999);var v=this.pointOnPath(l,E),w=this.pointOnPath(l+.001,E),u=w[0]-v[0],f=w[1]-v[1],g=Math.sqrt(Math.pow(u,2)+Math.pow(f,2));if(g===0)return [0,0];var _=b==="tangent"?[u/g,f/g]:[-f/g,u/g];return _},tangentOnPath:function(l,E){return this.vectorOnPath(l,E,"tangent")},normalOnPath:function(l,E){return this.vectorOnPath(l,E,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([P],h),extendPrototype([P],y),y.prototype.getValueAtTime=p,y.prototype.initiateExpression=ExpressionManager.initiateExpression;var c=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(l,E,b,v,w){var u=c(l,E,b,v,w);return u.propertyIndex=E.ix,u.lock=!1,b===3?expressionHelpers.searchExpressions(l,E.pt,u):b===4&&expressionHelpers.searchExpressions(l,E.ks,u),u.k&&l.addDynamicProperty(u),u};}function initialize$1(){addPropertyDecorator();}function addDecorator(){function t(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(e,i){var s=this.calculateExpression(i);if(e.t!==s){var r={};return this.copyData(r,e),r.t=s.toString(),r.__complete=!1,r}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),i=this.searchExpressions();return this.kf=e||i,this.kf},TextProperty.prototype.searchExpressions=t;}function initialize(){addDecorator();}function TransformEffect(){}TransformEffect.prototype.init=function(t){this.effectsManager=t,this.type=effectTypes.TRANSFORM_EFFECT,this.matrix=new Matrix,this.opacity=-1,this._mdf=!1,this._opMdf=!1;},TransformEffect.prototype.renderFrame=function(t){if(this._opMdf=!1,this._mdf=!1,t||this.effectsManager._mdf){var e=this.effectsManager.effectElements,i=e[0].p.v,s=e[1].p.v,r=e[2].p.v===1,a=e[3].p.v,n=r?a:e[4].p.v,p=e[5].p.v,h=e[6].p.v,y=e[7].p.v;this.matrix.reset(),this.matrix.translate(-i[0],-i[1],i[2]),this.matrix.scale(n*.01,a*.01,1),this.matrix.rotate(-y*degToRads),this.matrix.skewFromAxis(-p*degToRads,(h+90)*degToRads),this.matrix.translate(s[0],s[1],0),this._mdf=!0,this.opacity!==e[8].p.v&&(this.opacity=e[8].p.v,this._opMdf=!0);}};function CVTransformEffect(t){this.init(t);}return extendPrototype([TransformEffect],CVTransformEffect),setExpressionsPlugin(Expressions),setExpressionInterfaces(getInterface),initialize$1(),initialize(),registerEffect(35,CVTransformEffect),lottie});}),Ac=Ec();});var Cl={};fr(Cl,{default:()=>kc});var Cc,kc,kl=ls(()=>{qs();Cc=is((t,e)=>{typeof navigator<"u"&&function(i,s){typeof t=="object"&&typeof e<"u"?e.exports=s():typeof define=="function"&&define.amd?define(s):(i=typeof globalThis<"u"?globalThis:i||self,i.lottie=s());}(t,function(){var i="http://www.w3.org/2000/svg",s="",r=!1,a=-999999,n=function(m){r=!!m;},p=function(){return r},h=function(m){s=m;},y=function(){return s};function P(m){return document.createElement(m)}function c(m,C){var T,B=m.length,G;for(T=0;T1?T[1]=1:T[1]<=0&&(T[1]=0),J(T[0],T[1],T[2])}function Xt(m,C){var T=Gt(m[0]*255,m[1]*255,m[2]*255);return T[2]+=C,T[2]>1?T[2]=1:T[2]<0&&(T[2]=0),J(T[0],T[1],T[2])}function Ht(m,C){var T=Gt(m[0]*255,m[1]*255,m[2]*255);return T[0]+=C/360,T[0]>1?T[0]-=1:T[0]<0&&(T[0]+=1),J(T[0],T[1],T[2])}(function(){var m=[],C,T;for(C=0;C<256;C+=1)T=C.toString(16),m[C]=T.length===1?"0"+T:T;return function(B,G,O){return B<0&&(B=0),G<0&&(G=0),O<0&&(O=0),"#"+m[B]+m[G]+m[O]}})();var Qt=function(m){w=!!m;},Zt=function(){return w},ne=function(m){u=m;},ue=function(){return u},pe=function(m){ot=m;},Wt=function(){return ot},fe=function(m){f=m;};function jt(m){return document.createElementNS(i,m)}function Rt(m){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rt=function(C){return typeof C}:Rt=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},Rt(m)}var ve=function(){var m=1,C=[],T,B,G={onmessage:function(){},postMessage:function(H){T({data:H});}},O={postMessage:function(H){G.onmessage({data:H});}};function o(H){if(window.Worker&&window.Blob&&p()){var Q=new Blob(["var _workerSelf = self; self.onmessage = ",H.toString()],{type:"text/javascript"}),Z=URL.createObjectURL(Q);return new Worker(Z)}return T=H,G}function d(){B||(B=o(function(H){function Q(){function st(Ft,$t){var _t,At,lt=Ft.length,Tt,Dt,Et,Pt;for(At=0;At=0;$t-=1)if(Ft[$t].ty==="sh")if(Ft[$t].ks.k.i)Y(Ft[$t].ks.k);else for(lt=Ft[$t].ks.k.length,At=0;At_t[0]?!0:_t[0]>Ft[0]?!1:Ft[1]>_t[1]?!0:_t[1]>Ft[1]?!1:Ft[2]>_t[2]?!0:_t[2]>Ft[2]?!1:null}var rt=function(){var Ft=[4,4,14];function $t(At){var lt=At.t.d;At.t.d={k:[{s:lt,t:0}]};}function _t(At){var lt,Tt=At.length;for(lt=0;lt=0;lt-=1)if(At[lt].ty==="sh")if(At[lt].ks.k.i)At[lt].ks.k.c=At[lt].closed;else for(Et=At[lt].ks.k.length,Dt=0;Dt500)&&(this._imageLoaded(),clearInterval($)),X+=1;}.bind(this),50);}function O(et){var X=B(et,this.assetsPath,this.path),$=jt("image");g?this.testImageLoaded($):$.addEventListener("load",this._imageLoaded,!1),$.addEventListener("error",function(){Y.img=m,this._imageLoaded();}.bind(this),!1),$.setAttributeNS("http://www.w3.org/1999/xlink","href",X),this._elementHelper.append?this._elementHelper.append($):this._elementHelper.appendChild($);var Y={img:$,assetData:et};return Y}function o(et){var X=B(et,this.assetsPath,this.path),$=P("img");$.crossOrigin="anonymous",$.addEventListener("load",this._imageLoaded,!1),$.addEventListener("error",function(){Y.img=m,this._imageLoaded();}.bind(this),!1),$.src=X;var Y={img:$,assetData:et};return Y}function d(et){var X={assetData:et},$=B(et,this.assetsPath,this.path);return ve.loadData($,function(Y){X.img=Y,this._footageLoaded();}.bind(this),function(){X.img={},this._footageLoaded();}.bind(this)),X}function x(et,X){this.imagesLoadedCb=X;var $,Y=et.length;for($=0;$this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e=this.animationData.layers,i,s=e.length,r=t.layers,a,n=r.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(t){this.triggerRenderFrameError(t);}},AnimationItem.prototype.play=function(t){t&&this.name!==t||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},AnimationItem.prototype.pause=function(t){t&&this.name!==t||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(this.isPaused===!0?this.play():this.pause());},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(i=!0,e=0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"));}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart");},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,i!==-1&&this.goToAndStop(i,!0);},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),_typeof$4(t[0])==="object"){var i,s=t.length;for(i=0;i=0;V-=1)e[V].animation.destroy(D);}function W(D,V,S){var R=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),tt,J=R.length;for(tt=0;tt0?_=W:g=W;while(Math.abs(q)>a&&++ot=r?w(f,mt,g,_):gt===0?mt:v(f,z,z+h,g,_)}},t}(),pooling=function(){function t(e){return e.concat(createSizedArray(e.length))}return {double:t}}(),poolFactory=function(){return function(t,e,i){var s=0,r=t,a=createSizedArray(r),n={newElement:p,release:h};function p(){var y;return s?(s-=1,y=a[s]):y=e(),y}function h(y){s===r&&(a=pooling.double(a),r*=2),i&&i(y),a[s]=y,s+=1;}return n}}(),bezierLengthPool=function(){function t(){return {addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,t)}(),segmentsLengthPool=function(){function t(){return {lengths:[],totalLength:0}}function e(i){var s,r=i.lengths.length;for(s=0;s-.001&&f<.001}function i(l,E,b,v,w,u,f,g,_){if(b===0&&u===0&&_===0)return e(l,E,v,w,f,g);var k=t.sqrt(t.pow(v-l,2)+t.pow(w-E,2)+t.pow(u-b,2)),z=t.sqrt(t.pow(f-l,2)+t.pow(g-E,2)+t.pow(_-b,2)),q=t.sqrt(t.pow(f-v,2)+t.pow(g-w,2)+t.pow(_-u,2)),W;return k>z?k>q?W=k-z-q:W=q-z-k:q>z?W=q-z-k:W=z-k-q,W>-1e-4&&W<1e-4}var s=function(){return function(l,E,b,v){var w=getDefaultCurveSegments(),u,f,g,_,k,z=0,q,W=[],ot=[],mt=bezierLengthPool.newElement();for(g=b.length,u=0;uf?-1:1,k=!0;k;)if(v[u]<=f&&v[u+1]>f?(g=(f-v[u])/(v[u+1]-v[u]),k=!1):u+=_,u<0||u>=w-1){if(u===w-1)return b[u];k=!1;}return b[u]+(b[u+1]-b[u])*g}function y(l,E,b,v,w,u){var f=h(w,u),g=1-f,_=t.round((g*g*g*l[0]+(f*g*g+g*f*g+g*g*f)*b[0]+(f*f*g+g*f*f+f*g*f)*v[0]+f*f*f*E[0])*1e3)/1e3,k=t.round((g*g*g*l[1]+(f*g*g+g*f*g+g*g*f)*b[1]+(f*f*g+g*f*f+f*g*f)*v[1]+f*f*f*E[1])*1e3)/1e3;return [_,k]}var P=createTypedArray("float32",8);function c(l,E,b,v,w,u,f){w<0?w=0:w>1&&(w=1);var g=h(w,f);u=u>1?1:u;var _=h(u,f),k,z=l.length,q=1-g,W=1-_,ot=q*q*q,mt=g*q*q*3,gt=g*g*q*3,ut=g*g*g,Ct=q*q*W,ht=g*q*W+q*g*W+q*q*_,yt=g*g*W+q*g*_+g*q*_,D=g*g*_,V=q*W*W,S=g*W*W+q*_*W+q*W*_,R=g*_*W+q*_*_+g*W*_,tt=g*_*_,J=W*W*W,Gt=_*W*W+W*_*W+W*W*_,Vt=_*_*W+W*_*_+_*W*_,Xt=_*_*_;for(k=0;k=y.t-i){h.h&&(h=y),r=0;break}if(y.t-i>t){r=a;break}a=u||t=u?_.points.length-1:0;for(l=_.points[k].point.length,c=0;c=W&&z=u)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=f)s[0]=h.s[0],s[1]=h.s[1],s[2]=h.s[2];else {var ht=createQuaternion(h.s),yt=createQuaternion(g),D=(t-f)/(u-f);quaternionToEuler(s,slerp(ht,yt,D));}else for(a=0;a=u?E=1:t1e-6?(l=Math.acos(E),b=Math.sin(l),v=Math.sin((1-i)*l)/b,w=Math.sin(i*l)/b):(v=1-i,w=i),s[0]=v*r+w*h,s[1]=v*a+w*y,s[2]=v*n+w*P,s[3]=v*p+w*c,s}function quaternionToEuler(t,e){var i=e[0],s=e[1],r=e[2],a=e[3],n=Math.atan2(2*s*a-2*i*r,1-2*s*s-2*r*r),p=Math.asin(2*i*s+2*r*a),h=Math.atan2(2*i*a-2*s*r,1-2*i*i-2*r*r);t[0]=n/degToRads,t[1]=p/degToRads,t[2]=h/degToRads;}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,s=t[2]*degToRads,r=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(s/2),p=Math.sin(e/2),h=Math.sin(i/2),y=Math.sin(s/2),P=r*a*n-p*h*y,c=p*h*n+r*a*y,l=p*a*n+r*h*y,E=r*h*n-p*a*y;return [c,l,E,P]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s;}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if(this.propType==="unidimensional")e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i1e-5&&(this.v[i]=e,this._mdf=!0),i+=1;}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[];break}(!a[s]||a[s]&&!r)&&(a[s]=pointPool.newElement()),a[s][0]=t,a[s][1]=e;},ShapePath.prototype.setTripleAt=function(t,e,i,s,r,a,n,p){this.setXYAt(t,e,"v",n,p),this.setXYAt(i,s,"o",n,p),this.setXYAt(r,a,"i",n,p);},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,r=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),r=1);var a=this._length-1,n=this._length,p;for(p=r;p=ht[ht.length-1].t-this.offsetTime)k=ht[ht.length-1].s?ht[ht.length-1].s[0]:ht[ht.length-2].e[0],q=!0;else {for(var yt=_,D=ht.length-1,V=!0,S,R,tt;V&&(S=ht[yt],R=ht[yt+1],!(R.t-this.offsetTime>u));)yt=R.t-this.offsetTime)ut=1;else if(ug&&u>g)||(this._caching.lastIndex=_0||S>-1e-6&&S<0?s(S*R)/R:S}function V(){var S=this.props,R=D(S[0]),tt=D(S[1]),J=D(S[4]),Gt=D(S[5]),Vt=D(S[12]),Xt=D(S[13]);return "matrix("+R+","+tt+","+J+","+Gt+","+Vt+","+Xt+")"}return function(){this.reset=r,this.rotate=a,this.rotateX=n,this.rotateY=p,this.rotateZ=h,this.skew=P,this.skewFromAxis=c,this.shear=y,this.scale=l,this.setTransform=E,this.translate=b,this.transform=v,this.multiply=w,this.applyToPoint=k,this.applyToX=z,this.applyToY=q,this.applyToZ=W,this.applyToPointArray=Ct,this.applyToTriplePoints=ut,this.applyToPointStringified=ht,this.toCSS=yt,this.to2dCSS=V,this.clone=g,this.cloneFromProps=_,this.equals=f,this.inversePoints=gt,this.inversePoint=mt,this.getInverseMatrix=ot,this._t=this.transform,this.isIdentity=u,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset();}}();function _typeof$3(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(e){return typeof e}:_typeof$3=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(t)}var lottie={};function setLocation(t){setLocationHref(t);}function searchAnimations(){animationManager.searchAnimations();}function setSubframeRendering(t){setSubframeEnabled(t);}function setPrefix(t){setIdPrefix(t);}function loadAnimation(t){return animationManager.loadAnimation(t)}function setQuality(t){if(typeof t=="string")switch(t){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else !isNaN(t)&&t>1&&setDefaultCurveSegments(t);}function inBrowser(){return typeof navigator<"u"}function installPlugin(t,e){t==="expressions"&&setExpressionsPlugin(e);}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations());}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i"u"?"undefined":_typeof$3(exports))==="object"&&typeof module<"u")&&!(typeof define=="function"&&define.amd)&&(window.bodymovin=lottie);}catch(t){}var ShapeModifiers=function(){var t={},e={};t.registerModifier=i,t.getModifier=s;function i(r,a){e[r]||(e[r]=a);}function s(r,a,n){return new e[r](a,n)}return t}();function ShapeModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated();}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0);},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties());},extendPrototype([DynamicPropertyContainer],ShapeModifier);function TrimModifier(){}extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length;},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[];},TrimModifier.prototype.calculateShapeEdges=function(t,e,i,s,r){var a=[];e<=1?a.push({s:t,e}):t>=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n=[],p,h=a.length,y;for(p=0;ps+i)){var P,c;y.s*r<=s?P=0:P=(y.s*r-s)/i,y.e*r>=s+i?c=1:c=(y.e*r-s)/i,n.push([P,c]);}return n.length||n.push([0,0]),n},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e1?e=1+s:this.s.v<0?e=0+s:e=this.s.v+s,this.e.v>1?i=1+s:this.e.v<0?i=0+s:i=this.e.v+s,e>i){var r=e;e=i,i=r;}e=Math.round(e*1e4)*1e-4,i=Math.round(i*1e4)*1e-4,this.sValue=e,this.eValue=i;}else e=this.sValue,i=this.eValue;var a,n,p=this.shapes.length,h,y,P,c,l,E=0;if(i===e)for(n=0;n=0;n-=1)if(v=this.shapes[n],v.shape._mdf){for(w=v.localShapeCollection,w.releaseShapes(),this.m===2&&p>1?(_=this.calculateShapeEdges(e,i,v.totalShapeLength,g,E),g+=v.totalShapeLength):_=[[u,f]],y=_.length,h=0;h=1?b.push({s:v.totalShapeLength*(u-1),e:v.totalShapeLength*(f-1)}):(b.push({s:v.totalShapeLength*u,e:v.totalShapeLength}),b.push({s:0,e:v.totalShapeLength*(f-1)}));var k=this.addShapes(v,b[0]);if(b[0].s!==b[0].e){if(b.length>1){var z=v.shape.paths.shapes[v.shape.paths._length-1];if(z.c){var q=k.pop();this.addPaths(k,w),k=this.addShapes(v,b[1],q);}else this.addPaths(k,w),k=this.addShapes(v,b[1]);}this.addPaths(k,w);}}v.shape.paths=w;}}},TrimModifier.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;ie.e){i.c=!1;break}else e.s<=y&&e.e>=y+P.addedLength?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[p],r[a].v[p],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[p],r[a].o[p-1],r[a].i[p],(e.s-y)/P.addedLength,(e.e-y)/P.addedLength,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1),y+=P.addedLength,c+=1;if(r[a].c&&l.length){if(P=l[p-1],y<=e.e){var u=l[p-1].addedLength;e.s<=y&&e.e>=y+u?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[0],r[a].v[0],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[0],r[a].o[p-1],r[a].i[0],(e.s-y)/u,(e.e-y)/u,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1);}else i.c=!1;y+=P.addedLength,c+=1;}if(i._length&&(i.setXYAt(i.v[v][0],i.v[v][1],"i",v),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),y>e.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(P=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/y,0),c=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/y,0)):(P=this.p.pv,c=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/y,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){P=[],c=[];var l=this.px,E=this.py;l._caching.lastFrame+l.offsetTime<=l.keyframes[0].t?(P[0]=l.getValueAtTime((l.keyframes[0].t+.01)/y,0),P[1]=E.getValueAtTime((E.keyframes[0].t+.01)/y,0),c[0]=l.getValueAtTime(l.keyframes[0].t/y,0),c[1]=E.getValueAtTime(E.keyframes[0].t/y,0)):l._caching.lastFrame+l.offsetTime>=l.keyframes[l.keyframes.length-1].t?(P[0]=l.getValueAtTime(l.keyframes[l.keyframes.length-1].t/y,0),P[1]=E.getValueAtTime(E.keyframes[E.keyframes.length-1].t/y,0),c[0]=l.getValueAtTime((l.keyframes[l.keyframes.length-1].t-.01)/y,0),c[1]=E.getValueAtTime((E.keyframes[E.keyframes.length-1].t-.01)/y,0)):(P=[l.pv,E.pv],c[0]=l.getValueAtTime((l._caching.lastFrame+l.offsetTime-.01)/y,l.offsetTime),c[1]=E.getValueAtTime((E._caching.lastFrame+E.offsetTime-.01)/y,E.offsetTime));}else c=t,P=c;this.v.rotate(-Math.atan2(P[1]-c[1],P[0]-c[0]));}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);}this.frameId=this.elem.globalData.frameId;}}function s(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4);}function r(){}function a(h){this._addDynamicProperty(h),this.elem.addDynamicProperty(h),this._isDirty=!0;}function n(h,y,P){if(this.elem=h,this.frameId=-1,this.propType="transform",this.data=y,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(P||h),y.p&&y.p.s?(this.px=PropertyFactory.getProp(h,y.p.x,0,0,this),this.py=PropertyFactory.getProp(h,y.p.y,0,0,this),y.p.z&&(this.pz=PropertyFactory.getProp(h,y.p.z,0,0,this))):this.p=PropertyFactory.getProp(h,y.p||{k:[0,0,0]},1,0,this),y.rx){if(this.rx=PropertyFactory.getProp(h,y.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(h,y.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(h,y.rz,0,degToRads,this),y.or.k[0].ti){var c,l=y.or.k.length;for(c=0;c0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0);},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e0?Math.floor(l):Math.ceil(l),v=this.pMatrix.props,w=this.rMatrix.props,u=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var f=0;if(l>0){for(;fb;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),f-=1;E&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-E,!0),f-=E);}s=this.data.m===1?0:this._currentCopies-1,r=this.data.m===1?1:-1,a=this._currentCopies;for(var g,_;a;){if(e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,_=i.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),f!==0){for((s!==0&&r===1||s!==this._currentCopies-1&&r===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],w[8],w[9],w[10],w[11],w[12],w[13],w[14],w[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),g=0;g<_;g+=1)i[g]=this.matrix.props[g];this.matrix.reset();}else for(this.matrix.reset(),g=0;g<_;g+=1)i[g]=this.matrix.props[g];f+=1,a-=1,s+=r;}}else for(a=this._currentCopies,s=0,r=1;a;)e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,s+=r;return n},RepeaterModifier.prototype.addShape=function(){};function RoundCornersModifier(){}extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length;},RoundCornersModifier.prototype.processPath=function(t,e){var i=shapePool.newElement();i.c=t.c;var s,r=t._length,a,n,p,h,y,P,c=0,l,E,b,v,w,u;for(s=0;s0&&s<1?[e]:[]:[e-s,e+s].filter(function(r){return r>0&&r<1})},PolynomialBezier.prototype.split=function(t){if(t<=0)return [singlePoint(this.points[0]),this];if(t>=1)return [this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),i=lerpPoint(this.points[1],this.points[2],t),s=lerpPoint(this.points[2],this.points[3],t),r=lerpPoint(e,i,t),a=lerpPoint(i,s,t),n=lerpPoint(r,a,t);return [new PolynomialBezier(this.points[0],e,r,n,!0),new PolynomialBezier(n,a,s,this.points[3],!0)]};function extrema(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var r=s;s=i,i=r;}for(var a=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),n=0;n0&&a[n]<1){var p=t.point(a[n])[e];ps&&(s=p);}return {min:i,max:s}}PolynomialBezier.prototype.bounds=function(){return {x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return {left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}};function intersectData(t,e,i){var s=t.boundingBox();return {cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function splitData(t){var e=t.bez.split(.5);return [intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return Math.abs(t.cx-e.cx)*2=a||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s){r.push([t.t,e.t]);return}var n=splitData(t),p=splitData(e);intersectsImpl(n[0],p[0],i+1,s,r,a),intersectsImpl(n[0],p[1],i+1,s,r,a),intersectsImpl(n[1],p[0],i+1,s,r,a),intersectsImpl(n[1],p[1],i+1,s,r,a);}}PolynomialBezier.prototype.intersections=function(t,e,i){e===void 0&&(e=2),i===void 0&&(i=7);var s=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,s,i),s},PolynomialBezier.shapeSegment=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[i],t.v[i],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[i],t.i[i],t.o[e],t.v[e],!0)};function crossProduct(t,e){return [t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,i,s){var r=[t[0],t[1],1],a=[e[0],e[1],1],n=[i[0],i[1],1],p=[s[0],s[1],1],h=crossProduct(crossProduct(r,a),crossProduct(n,p));return floatZero(h[2])?null:[h[0]/h[2],h[1]/h[2]]}function polarOffset(t,e,i){return [t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0;};function setPoint(t,e,i,s,r,a,n){var p=i-Math.PI/2,h=i+Math.PI/2,y=e[0]+Math.cos(i)*s*r,P=e[1]-Math.sin(i)*s*r;t.setTripleAt(y,P,y+Math.cos(p)*a,P-Math.sin(p)*a,y+Math.cos(h)*n,P-Math.sin(h)*n,t.length());}function getPerpendicularVector(t,e){var i=[e[0]-t[0],e[1]-t[1]],s=-Math.PI*.5,r=[Math.cos(s)*i[0]-Math.sin(s)*i[1],Math.sin(s)*i[0]+Math.cos(s)*i[1]];return r}function getProjectingAngle(t,e){var i=e===0?t.length()-1:e-1,s=(e+1)%t.length(),r=t.v[i],a=t.v[s],n=getPerpendicularVector(r,a);return Math.atan2(0,1)-Math.atan2(n[1],n[0])}function zigZagCorner(t,e,i,s,r,a,n){var p=getProjectingAngle(e,i),h=e.v[i%e._length],y=e.v[i===0?e._length-1:i-1],P=e.v[(i+1)%e._length],c=a===2?Math.sqrt(Math.pow(h[0]-y[0],2)+Math.pow(h[1]-y[1],2)):0,l=a===2?Math.sqrt(Math.pow(h[0]-P[0],2)+Math.pow(h[1]-P[1],2)):0;setPoint(t,e.v[i%e._length],p,n,s,l/((r+1)*2),c/((r+1)*2));}function zigZagSegment(t,e,i,s,r,a){for(var n=0;n1&&e.length>1&&(r=getIntersection(t[0],e[e.length-1]),r)?[[t[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[i,s]}function pruneIntersections(t){for(var e,i=1;i1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var i=t.inflectionPoints(),s,r,a,n;if(i.length===0)return [offsetSegment(t,e)];if(i.length===1||floatEqual(i[1],1))return a=t.split(i[0]),s=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(r,e)];a=t.split(i[0]),s=a[0];var p=(i[1]-i[0])/(1-i[0]);return a=a[1].split(p),n=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(n,e),offsetSegment(r,e)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(t,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=this.amount.effectsSequence.length!==0;},OffsetPathModifier.prototype.processPath=function(t,e,i,s){var r=shapePool.newElement();r.c=t.c;var a=t.length();t.c||(a-=1);var n,p,h,y=[];for(n=0;n=0;n-=1)h=PolynomialBezier.shapeSegmentInverted(t,n),y.push(offsetSegmentSplit(h,e));y=pruneIntersections(y);var P=null,c=null;for(n=0;n0&&(Gt=!1),Gt){var Ht=createTag("style");Ht.setAttribute("f-forigin",S[R].fOrigin),Ht.setAttribute("f-origin",S[R].origin),Ht.setAttribute("f-family",S[R].fFamily),Ht.type="text/css",Ht.innerText="@font-face {font-family: "+S[R].fFamily+"; font-style: normal; src: url('"+S[R].fPath+"');}",V.appendChild(Ht);}}else if(S[R].fOrigin==="g"||S[R].origin===1){for(Vt=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),Xt=0;Xt=55296&&S<=56319){var R=D.charCodeAt(1);R>=56320&&R<=57343&&(V=(S-55296)*1024+R-56320+65536);}return V}function z(D,V){var S=D.toString(16)+V.toString(16);return c.indexOf(S)!==-1}function q(D){return D===h}function W(D){return D===p}function ot(D){var V=k(D);return V>=y&&V<=P}function mt(D){return ot(D.substr(0,2))&&ot(D.substr(2,2))}function gt(D){return i.indexOf(D)!==-1}function ut(D,V){var S=k(D.substr(V,2));if(S!==s)return !1;var R=0;for(V+=2;R<5;){if(S=k(D.substr(V,2)),Sn)return !1;R+=1,V+=2;}return k(D.substr(V,2))===r}function Ct(){this.isLoaded=!0;}var ht=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this);};ht.isModifier=z,ht.isZeroWidthJoiner=q,ht.isFlagEmoji=mt,ht.isRegionalCode=ot,ht.isCombinedCharacter=gt,ht.isRegionalFlag=ut,ht.isVariationSelector=W,ht.BLACK_FLAG_CODE_POINT=s;var yt={addChars:u,addFonts:w,getCharData:f,getFontByName:_,measureText:g,checkLoadedFonts:b,setIsLoaded:Ct};return ht.prototype=yt,ht}();function SlotManager(t){this.animationData=t;}SlotManager.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t};function slotFactory(t){return new SlotManager(t)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[];},addRenderableComponent:function(t){this.renderableComponents.indexOf(t)===-1&&this.renderableComponents.push(t);},removeRenderableComponent:function(t){this.renderableComponents.indexOf(t)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1);},prepareRenderableFrame:function(t){this.checkLayerLimits(t);},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show());},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide());},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0));},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1;},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1;},AudioElement.prototype.resume=function(){this._canPlay=!0;},AudioElement.prototype.setRate=function(t){this.audio.rate(t);},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume);},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(t){var e,i=this.layers.length,s;for(this.completeLayers=!0,e=i-1;e>=0;e-=1)this.elements[e]||(s=this.layers[e],s.ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements();},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",l),this.element.maskedElement.setAttribute(f,"url("+getLocationHref()+"#"+l+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this);}MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e=this.element.finalTransform.mat,i,s=this.masksProperties.length;for(i=0;i1&&(s+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==s){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+s:s),i.elem.setAttribute("d",n)),i.lastPath=s;}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null;};var filtersFactory=function(){var t={};t.createFilter=e,t.createAlphaToLuminanceFilter=i;function e(s,r){var a=createNS("filter");return a.setAttribute("id",s),r!==!0&&(a.setAttribute("filterUnits","objectBoundingBox"),a.setAttribute("x","0%"),a.setAttribute("y","0%"),a.setAttribute("width","100%"),a.setAttribute("height","100%")),a}function i(){var s=createNS("feColorMatrix");return s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),s}return t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return (/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(t){var e,i="SourceGraphic",s=t.data.ef?t.data.ef.length:0,r=createElementID(),a=filtersFactory.createFilter(r,!0),n=0;this.filters=[];var p;for(e=0;e=0&&(i=this.shapeModifiers[t].processShapes(this._isFirstFrame),!i);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i.01)return !1;i+=1;}return !0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return !1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t0;)u=l.transformers[ot].mProps._mdf||u,W-=1,ot-=1;if(u)for(W=k-l.styles[g].lvl,ot=l.transformers.length-1;W>0;)q.multiply(l.transformers[ot].mProps.v),W-=1,ot-=1;}else q=t;if(z=l.sh.paths,v=z._length,u){for(w="",b=0;b=1?Ct=.99:Ct<=-1&&(Ct=-.99);var ht=gt*Ct,yt=Math.cos(ut+l.a.v)*ht+w[0],D=Math.sin(ut+l.a.v)*ht+w[1];b.setAttribute("fx",yt),b.setAttribute("fy",D),v&&!l.g._collapsable&&(l.of.setAttribute("fx",yt),l.of.setAttribute("fy",D));}}}function P(c,l,E){var b=l.style,v=l.d;v&&(v._mdf||E)&&v.dashStr&&(b.pElem.setAttribute("stroke-dasharray",v.dashStr),b.pElem.setAttribute("stroke-dashoffset",v.dashoffset[0])),l.c&&(l.c._mdf||E)&&b.pElem.setAttribute("stroke","rgb("+bmFloor(l.c.v[0])+","+bmFloor(l.c.v[1])+","+bmFloor(l.c.v[2])+")"),(l.o._mdf||E)&&b.pElem.setAttribute("stroke-opacity",l.o.v),(l.w._mdf||E)&&(b.pElem.setAttribute("stroke-width",l.w.v),b.msElem&&b.msElem.setAttribute("stroke-width",l.w.v));}return i}();function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[];}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e=this.shapes.length,i,s,r=this.stylesList.length,a,n=[],p=!1;for(s=0;s1&&p&&this.setShapesAsAnimated(n);}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e=0;h-=1){if(w=this.searchProcessedElement(t[h]),w?e[h]=i[w-1]:t[h]._render=n,t[h].ty==="fl"||t[h].ty==="st"||t[h].ty==="gf"||t[h].ty==="gs"||t[h].ty==="no")w?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],r),t[h]._render&&e[h].style.pElem.parentNode!==s&&s.appendChild(e[h].style.pElem),l.push(e[h].style);else if(t[h].ty==="gr"){if(!w)e[h]=this.createGroupElement(t[h]);else for(c=e[h].it.length,P=0;P1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this);},TextProperty.prototype.getValue=function(t){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!t)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var s,r=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(s=0;se);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e=[],i=0,s=t.length,r,a,n=!1,p=!1,h="";i=55296&&r<=56319?FontManager.isRegionalFlag(t,i)?h=t.substr(i,14):(a=t.charCodeAt(i+1),a>=56320&&a<=57343&&(FontManager.isModifier(r,a)?(h=t.substr(i,2),n=!0):FontManager.isFlagEmoji(t.substr(i,4))?h=t.substr(i,4):h=t.substr(i,2))):r>56319?(a=t.charCodeAt(i+1),FontManager.isVariationSelector(r)&&(n=!0)):FontManager.isZeroWidthJoiner(r)&&(n=!0,p=!0),n?(e[e.length-1]+=h,n=!1):e.push(h),i+=h.length;return e},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e=this.elem.globalData.fontManager,i=this.data,s=[],r,a,n,p=0,h,y=i.m.g,P=0,c=0,l=0,E=[],b=0,v=0,w,u,f=e.getFontByName(t.f),g,_=0,k=getFontProperties(f);t.fWeight=k.weight,t.fStyle=k.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),a=t.finalText.length,t.finalLineHeight=t.lh;var z=t.tr/1e3*t.finalSize,q;if(t.sz)for(var W=!0,ot=t.sz[0],mt=t.sz[1],gt,ut;W;){ut=this.buildFinalText(t.t),gt=0,b=0,a=ut.length,z=t.tr/1e3*t.finalSize;var Ct=-1;for(r=0;rot&&ut[r]!==" "?(Ct===-1?a+=1:r=Ct,gt+=t.finalLineHeight||t.finalSize*1.2,ut.splice(r,Ct===r?1:0,"\r"),Ct=-1,b=0):(b+=_,b+=z);gt+=f.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&mtv?b:v,b=-2*z,h="",n=!0,l+=1):h=yt,e.chars?(g=e.getCharData(yt,f.fStyle,e.getFontByName(t.f).fFamily),_=n?0:g.w*t.finalSize/100):_=e.measureText(h,t.f,t.finalSize),yt===" "?ht+=_+z:(b+=_+z+ht,ht=0),s.push({l:_,an:_,add:P,n,anIndexes:[],val:h,line:l,animatorJustifyOffset:0}),y==2){if(P+=_,h===""||h===" "||r===a-1){for((h===""||h===" ")&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;p+=1,P=0;}}else if(y==3){if(P+=_,h===""||r===a-1){for(h===""&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;P=0,p+=1;}}else s[p].ind=p,s[p].extra=0,p+=1;if(t.l=s,v=b>v?b:v,E.push(b),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0;}t.lineWidths=E;var D=i.a,V,S;u=D.length;var R,tt,J=[];for(w=0;w0?n=this.ne.v/100:p=-this.ne.v/100,this.xe.v>0?h=1-this.xe.v/100:y=1+this.xe.v/100;var P=BezierFactory.getBezierEasing(n,p,h,y).get,c=0,l=this.finalS,E=this.finalE,b=this.data.sh;if(b===2)E===l?c=a>=E?1:0:c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===3)E===l?c=a>=E?0:1:c=1-t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===4)E===l?c=0:(c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c<.5?c*=2:c=1-2*(c-.5)),c=P(c);else if(b===5){if(E===l)c=0;else {var v=E-l;a=e(t(0,a+.5-l),E-l);var w=-v/2+a,u=v/2;c=Math.sqrt(1-w*w/(u*u));}c=P(c);}else b===6?(E===l?c=0:(a=e(t(0,a+.5-l),E-l),c=(1+Math.cos(Math.PI+Math.PI*2*a/(E-l)))/2),c=P(c)):(a>=i(l)&&(a-l<0?c=t(0,e(e(E,1)-(l-a),1)):c=t(0,e(E-a,1))),c=P(c));if(this.sm.v!==100){var f=this.sm.v*.01;f===0&&(f=1e-8);var g=.5-f*.5;c1&&(c=1));}return c*this.a.v},getValue:function(a){this.iterateDynamicProperties(),this._mdf=a||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,a&&this.data.r===2&&(this.e.v=this._currentTextLength);var n=this.data.r===2?1:100/this.data.totalChars,p=this.o.v/n,h=this.s.v/n+p,y=this.e.v/n+p;if(h>y){var P=h;h=y,y=P;}this.finalS=h,this.finalE=y;}},extendPrototype([DynamicPropertyContainer],s);function r(a,n,p){return new s(a,n)}return {getTextSelectorProp:r}}();function TextAnimatorDataProperty(t,e,i){var s={propType:!1},r=PropertyFactory.getProp,a=e.a;this.a={r:a.r?r(t,a.r,0,degToRads,i):s,rx:a.rx?r(t,a.rx,0,degToRads,i):s,ry:a.ry?r(t,a.ry,0,degToRads,i):s,sk:a.sk?r(t,a.sk,0,degToRads,i):s,sa:a.sa?r(t,a.sa,0,degToRads,i):s,s:a.s?r(t,a.s,1,.01,i):s,a:a.a?r(t,a.a,1,0,i):s,o:a.o?r(t,a.o,0,.01,i):s,p:a.p?r(t,a.p,1,0,i):s,sw:a.sw?r(t,a.sw,0,0,i):s,sc:a.sc?r(t,a.sc,1,0,i):s,fc:a.fc?r(t,a.fc,1,0,i):s,fh:a.fh?r(t,a.fh,0,0,i):s,fs:a.fs?r(t,a.fs,0,.01,i):s,fb:a.fb?r(t,a.fb,0,.01,i):s,t:a.t?r(t,a.t,0,0,i):s},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t;}function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i);}TextAnimatorProperty.prototype.searchProperties=function(){var t,e=this._textData.a.length,i,s=PropertyFactory.getProp;for(t=0;t=b+oe||!k?(ot=(b+oe-w)/v.partialLength,Xt=_.point[0]+(v.point[0]-_.point[0])*ot,Ht=_.point[1]+(v.point[1]-_.point[1])*ot,a.translate(-i[0]*l[P].an*.005,-(i[1]*ht)*.01),u=!1):k&&(w+=v.partialLength,f+=1,f>=k.length&&(f=0,g+=1,z[g]?k=z[g].points:gt.v.c?(f=0,g=0,k=z[g].points):(w-=v.partialLength,k=null)),k&&(_=v,v=k[f],q=v.partialLength));Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0);}else Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0),a.translate(-i[0]*l[P].an*.005,-i[1]*ht*.01,0);for(S=0;St?this.textSpans[t].span:createNS(p?"g":"text"),g<=t){if(h.setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=h,p){var k=createNS("g");h.appendChild(k),this.textSpans[t].childSpan=k;}this.textSpans[t].span=h,this.layerElement.appendChild(h);}h.style.display="inherit";}if(y.reset(),c&&(n[t].n&&(l=-v,E+=i.yOffset,E+=b?1:0,b=!1),this.applyTextPropertiesToMatrix(i,y,n[t].line,l,E),l+=n[t].l||0,l+=v),p){_=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily);var z;if(_.t===1)z=new SVGCompElement(_.data,this.globalData,this);else {var q=emptyShapeData;_.data&&_.data.shapes&&(q=this.buildShapeData(_.data,i.finalSize)),z=new SVGShapeElement(q,this.globalData,this);}if(this.textSpans[t].glyph){var W=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(W.layerElement),W.destroy();}this.textSpans[t].glyph=z,z._debug=!0,z.prepareFrame(0),z.renderFrame(),this.textSpans[t].childSpan.appendChild(z.layerElement),_.t===1&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")");}else c&&h.setAttribute("transform","translate("+y.props[12]+","+y.props[13]+")"),h.textContent=n[t].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");}c&&h&&h.setAttribute("d",P);}for(;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0));}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t=0;i-=1)t.finalTransform.multiply(t.transforms[i].transform.mProps.v);t._mdf=r;},processSequences:function(t){var e,i=this.sequenceList.length;for(e=0;e=1){this.buffers=[];var t=this.globalData.canvasContext,e=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(e);var i=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(i),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas();}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms();},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e;}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0);},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0);},clearCanvas:function(t){t.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy);},prepareLayer:function(){if(this.data.tt>=1){var t=this.buffers[0],e=t.getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);}},exitLayer:function(){if(this.data.tt>=1){var t=this.buffers[1],e=t.getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var i=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(i.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var s=assetLoader.getLumaCanvas(this.canvasContext.canvas),r=s.getContext("2d");r.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(s,0,0);}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(t,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over";}},renderFrame:function(t){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!t)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var e=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(e),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(e),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1);}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy();},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(t,e,i,s){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var r=4;e.ty==="rc"?r=5:e.ty==="el"?r=6:e.ty==="sr"&&(r=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,r,t);var a,n=i.length,p;for(a=0;a=0;a-=1){if(c=this.searchProcessedElement(t[a]),c?e[a]=i[c-1]:t[a]._shouldRender=s,t[a].ty==="fl"||t[a].ty==="st"||t[a].ty==="gf"||t[a].ty==="gs")c?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],b),y.push(e[a].style);else if(t[a].ty==="gr"){if(!c)e[a]=this.createGroupElement(t[a]);else for(h=e[a].it.length,p=0;p=0;r-=1)e[r].ty==="tr"?(n=i[r].transform,this.renderShapeTransform(t,n)):e[r].ty==="sh"||e[r].ty==="el"||e[r].ty==="rc"||e[r].ty==="sr"?this.renderPath(e[r],i[r]):e[r].ty==="fl"?this.renderFill(e[r],i[r],n):e[r].ty==="st"?this.renderStroke(e[r],i[r],n):e[r].ty==="gf"||e[r].ty==="gs"?this.renderGradientFill(e[r],i[r],n):e[r].ty==="gr"?this.renderShape(n,e[r].it,i[r].it):e[r].ty;s&&this.drawLayer();},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var i=t.trNodes,s=e.paths,r,a,n,p=s._length;i.length=0;var h=t.transforms.finalTransform;for(n=0;n=1?P=.99:P<=-1&&(P=-.99);var c=h*P,l=Math.cos(y+e.a.v)*c+n[0],E=Math.sin(y+e.a.v)*c+n[1];r=a.createRadialGradient(l,E,0,n[0],n[1],h);}var b,v=t.g.p,w=e.g.c,u=1;for(b=0;ba&&h==="xMidYMid slice"||rr&&p==="meet"||ar&&p==="slice")?this.transformCanvas.tx=(i-this.transformCanvas.w*(s/this.transformCanvas.h))/2*this.renderConfig.dpr:y==="xMax"&&(ar&&p==="slice")?this.transformCanvas.tx=(i-this.transformCanvas.w*(s/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,P==="YMid"&&(a>r&&p==="meet"||ar&&p==="meet"||a=0;t-=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0;},CanvasRendererBase.prototype.renderFrame=function(t,e){if(!(this.renderedFrame===t&&this.renderConfig.clearCanvas===!0&&!e||this.destroyed||t===-1)){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var i,s=this.layers.length;for(this.completeLayers||this.checkLayers(t),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].prepareFrame(t-this.layers[i].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore();}}},CanvasRendererBase.prototype.buildItem=function(t){var e=this.elements;if(!(e[t]||this.layers[t].ty===99)){var i=this.createItem(this.layers[t],this,this.globalData);e[t]=i,i.initExpressions();}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();t.checkParenting();}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none";},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block";};function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random();}function CVContextData(){this.stack=[],this.cArrPos=0,this.cTr=new Matrix;var t,e=15;for(t=0;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame();},CVCompElement.prototype.destroy=function(){var t,e=this.layers.length;for(t=e-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null;},CVCompElement.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)};function CanvasRenderer(t,e){this.animationItem=t,this.renderConfig={clearCanvas:e&&e.clearCanvas!==void 0?e.clearCanvas:!0,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",className:e&&e.className||"",id:e&&e.id||"",runExpressions:!e||e.runExpressions===void 0||e.runExpressions},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData));}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},registerRenderer("canvas",CanvasRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier);var CompExpressionInterface=function(){return function(t){function e(i){for(var s=0,r=t.layers.length;s=y;)mt/=2,gt/=2,ut>>>=1;return (mt+ut)/gt};return ot.int32=function(){return W.g(4)|0},ot.quick=function(){return W.g(4)/4294967296},ot.double=ot,w(f(W.S),t),(_.pass||k||function(mt,gt,ut,Ct){return Ct&&(Ct.S&&b(Ct,W),mt.state=function(){return b(W,{})}),ut?(e[n]=mt,gt):mt})(ot,q,"global"in _?_.global:this==e,_.state)}e["seed"+n]=l;function E(g){var _,k=g.length,z=this,q=0,W=z.i=z.j=0,ot=z.S=[];for(k||(g=[k++]);qi){var s=i;i=e,e=s;}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if(typeof t=="number"||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var i,s=Math.min(t.length,e.length),r=0;for(i=0;i.5?y/(2-r-a):y/(r+a),r){case e:n=(i-s)/y+(i1&&(i-=1),i<1/6?t+(e-t)*6*i:i<1/2?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e=t[0],i=t[1],s=t[2],r,a,n;if(i===0)r=s,n=s,a=s;else {var p=s<.5?s*(1+i):s+i-s*i,h=2*s-p;r=hue2rgb(h,p,e+1/3),a=hue2rgb(h,p,e),n=hue2rgb(h,p,e-1/3);}return [r,a,n,t[3]]}function linear(t,e,i,s,r){if((s===void 0||r===void 0)&&(s=e,r=i,e=0,i=1),i=i)return r;var n=i===e?0:(t-e)/(i-e);if(!s.length)return s+(r-s)*n;var p,h=s.length,y=createTypedArray("float32",h);for(p=0;p1){for(r=0;r1?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(r)){var p,h=r.length,y=createTypedArray("float32",h);for(p=0;pdata.k[e].t&&tdata.k[e+1].t-t?(s=e+2,r=data.k[e+1].t):(s=e+1,r=data.k[e].t);break}s===-1&&(s=e+1,r=data.k[e].t);}var a={};return a.index=s,a.time=r/elem.comp.globalData.frameRate,a}function key(t){var e,i,s;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(s=r.length,i=0;iw.length-1)&&(E=w.length-1),g=w[w.length-1-E].t,f=u-g);var _,k,z;if(l==="pingpong"){var q=Math.floor((v-g)/f);if(q%2!==0)return this.getValueAtTime((f-(v-g)%f+g)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(g/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(u/this.comp.globalData.frameRate,0),mt=this.getValueAtTime(((v-g)%f+g)/this.comp.globalData.frameRate,0),gt=Math.floor((v-g)/f);if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_=u)return this.pv;var f,g;b?(E?f=Math.abs(this.elem.comp.globalData.frameRate*E):f=Math.max(0,this.elem.data.op-u),g=u+f):((!E||E>w.length-1)&&(E=w.length-1),g=w[E].t,f=g-u);var _,k,z;if(l==="pingpong"){var q=Math.floor((u-v)/f);if(q%2===0)return this.getValueAtTime(((u-v)%f+u)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(u/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(g/this.comp.globalData.frameRate,0),mt=this.getValueAtTime((f-(u-v)%f+u)/this.comp.globalData.frameRate,0),gt=Math.floor((u-v)/f)+1;if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_1?(w-v)/(E-1):1,f=0,g=0,_;this.pv.length?_=createTypedArray("float32",this.pv.length):_=0;for(var k;fu){var z=f,q=b.c&&f===g-1?0:f+1,W=(u-_)/w[f].addedLength;k=bez.getPointInSegment(b.v[z],b.v[q],b.o[z],b.i[q],W,w[f]);break}else _+=w[f].addedLength;f+=1;}return k||(k=b.c?[b.v[0][0],b.v[0][1]]:[b.v[b._length-1][0],b.v[b._length-1][1]]),k},vectorOnPath:function(l,E,b){l==1?l=this.v.c:l==0&&(l=.999);var v=this.pointOnPath(l,E),w=this.pointOnPath(l+.001,E),u=w[0]-v[0],f=w[1]-v[1],g=Math.sqrt(Math.pow(u,2)+Math.pow(f,2));if(g===0)return [0,0];var _=b==="tangent"?[u/g,f/g]:[-f/g,u/g];return _},tangentOnPath:function(l,E){return this.vectorOnPath(l,E,"tangent")},normalOnPath:function(l,E){return this.vectorOnPath(l,E,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([P],h),extendPrototype([P],y),y.prototype.getValueAtTime=p,y.prototype.initiateExpression=ExpressionManager.initiateExpression;var c=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(l,E,b,v,w){var u=c(l,E,b,v,w);return u.propertyIndex=E.ix,u.lock=!1,b===3?expressionHelpers.searchExpressions(l,E.pt,u):b===4&&expressionHelpers.searchExpressions(l,E.ks,u),u.k&&l.addDynamicProperty(u),u};}function initialize$1(){addPropertyDecorator();}function addDecorator(){function t(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(e,i){var s=this.calculateExpression(i);if(e.t!==s){var r={};return this.copyData(r,e),r.t=s.toString(),r.__complete=!1,r}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),i=this.searchExpressions();return this.kf=e||i,this.kf},TextProperty.prototype.searchExpressions=t;}function initialize(){addDecorator();}function TransformEffect(){}TransformEffect.prototype.init=function(t){this.effectsManager=t,this.type=effectTypes.TRANSFORM_EFFECT,this.matrix=new Matrix,this.opacity=-1,this._mdf=!1,this._opMdf=!1;},TransformEffect.prototype.renderFrame=function(t){if(this._opMdf=!1,this._mdf=!1,t||this.effectsManager._mdf){var e=this.effectsManager.effectElements,i=e[0].p.v,s=e[1].p.v,r=e[2].p.v===1,a=e[3].p.v,n=r?a:e[4].p.v,p=e[5].p.v,h=e[6].p.v,y=e[7].p.v;this.matrix.reset(),this.matrix.translate(-i[0],-i[1],i[2]),this.matrix.scale(n*.01,a*.01,1),this.matrix.rotate(-y*degToRads),this.matrix.skewFromAxis(-p*degToRads,(h+90)*degToRads),this.matrix.translate(s[0],s[1],0),this._mdf=!0,this.opacity!==e[8].p.v&&(this.opacity=e[8].p.v,this._opMdf=!0);}};function CVTransformEffect(t){this.init(t);}return extendPrototype([TransformEffect],CVTransformEffect),registerEffect(35,CVTransformEffect),lottie});}),Ac=Ec();});var Cl={};fr(Cl,{default:()=>kc});var Cc,kc,kl=ls(()=>{qs();Cc=is((t,e)=>{typeof navigator<"u"&&function(i,s){typeof t=="object"&&typeof e<"u"?e.exports=s():typeof define=="function"&&define.amd?define(s):(i=typeof globalThis<"u"?globalThis:i||self,i.lottie=s());}(t,function(){var i="http://www.w3.org/2000/svg",s="",r=!1,a=-999999,n=function(m){r=!!m;},p=function(){return r},h=function(m){s=m;},y=function(){return s};function P(m){return document.createElement(m)}function c(m,C){var T,B=m.length,G;for(T=0;T1?T[1]=1:T[1]<=0&&(T[1]=0),J(T[0],T[1],T[2])}function Xt(m,C){var T=Gt(m[0]*255,m[1]*255,m[2]*255);return T[2]+=C,T[2]>1?T[2]=1:T[2]<0&&(T[2]=0),J(T[0],T[1],T[2])}function Ht(m,C){var T=Gt(m[0]*255,m[1]*255,m[2]*255);return T[0]+=C/360,T[0]>1?T[0]-=1:T[0]<0&&(T[0]+=1),J(T[0],T[1],T[2])}(function(){var m=[],C,T;for(C=0;C<256;C+=1)T=C.toString(16),m[C]=T.length===1?"0"+T:T;return function(B,G,O){return B<0&&(B=0),G<0&&(G=0),O<0&&(O=0),"#"+m[B]+m[G]+m[O]}})();var Qt=function(m){w=!!m;},Zt=function(){return w},ne=function(m){u=m;},ue=function(){return u},pe=function(m){ot=m;},Wt=function(){return ot},fe=function(m){f=m;};function jt(m){return document.createElementNS(i,m)}function Rt(m){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rt=function(C){return typeof C}:Rt=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},Rt(m)}var ve=function(){var m=1,C=[],T,B,G={onmessage:function(){},postMessage:function(H){T({data:H});}},O={postMessage:function(H){G.onmessage({data:H});}};function o(H){if(window.Worker&&window.Blob&&p()){var Q=new Blob(["var _workerSelf = self; self.onmessage = ",H.toString()],{type:"text/javascript"}),Z=URL.createObjectURL(Q);return new Worker(Z)}return T=H,G}function d(){B||(B=o(function(H){function Q(){function st(Ft,$t){var _t,At,lt=Ft.length,Tt,Dt,Et,Pt;for(At=0;At=0;$t-=1)if(Ft[$t].ty==="sh")if(Ft[$t].ks.k.i)Y(Ft[$t].ks.k);else for(lt=Ft[$t].ks.k.length,At=0;At_t[0]?!0:_t[0]>Ft[0]?!1:Ft[1]>_t[1]?!0:_t[1]>Ft[1]?!1:Ft[2]>_t[2]?!0:_t[2]>Ft[2]?!1:null}var rt=function(){var Ft=[4,4,14];function $t(At){var lt=At.t.d;At.t.d={k:[{s:lt,t:0}]};}function _t(At){var lt,Tt=At.length;for(lt=0;lt=0;lt-=1)if(At[lt].ty==="sh")if(At[lt].ks.k.i)At[lt].ks.k.c=At[lt].closed;else for(Et=At[lt].ks.k.length,Dt=0;Dt500)&&(this._imageLoaded(),clearInterval($)),X+=1;}.bind(this),50);}function O(et){var X=B(et,this.assetsPath,this.path),$=jt("image");g?this.testImageLoaded($):$.addEventListener("load",this._imageLoaded,!1),$.addEventListener("error",function(){Y.img=m,this._imageLoaded();}.bind(this),!1),$.setAttributeNS("http://www.w3.org/1999/xlink","href",X),this._elementHelper.append?this._elementHelper.append($):this._elementHelper.appendChild($);var Y={img:$,assetData:et};return Y}function o(et){var X=B(et,this.assetsPath,this.path),$=P("img");$.crossOrigin="anonymous",$.addEventListener("load",this._imageLoaded,!1),$.addEventListener("error",function(){Y.img=m,this._imageLoaded();}.bind(this),!1),$.src=X;var Y={img:$,assetData:et};return Y}function d(et){var X={assetData:et},$=B(et,this.assetsPath,this.path);return ve.loadData($,function(Y){X.img=Y,this._footageLoaded();}.bind(this),function(){X.img={},this._footageLoaded();}.bind(this)),X}function x(et,X){this.imagesLoadedCb=X;var $,Y=et.length;for($=0;$this.animationData.op&&(this.animationData.op=m.op,this.totalFrames=Math.floor(m.op-this.animationData.ip));var C=this.animationData.layers,T,B=C.length,G=m.layers,O,o=G.length;for(O=0;Othis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},Ut.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(m){this.triggerRenderFrameError(m);}},Ut.prototype.play=function(m){m&&this.name!==m||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},Ut.prototype.pause=function(m){m&&this.name!==m||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},Ut.prototype.togglePause=function(m){m&&this.name!==m||(this.isPaused===!0?this.play():this.pause());},Ut.prototype.stop=function(m){m&&this.name!==m||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},Ut.prototype.getMarkerData=function(m){for(var C,T=0;T=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(C>this.totalFrames?C%this.totalFrames:0)||(T=!0,C=this.totalFrames-1):C>=this.totalFrames?(this.playCount+=1,this.checkSegments(C%this.totalFrames)||(this.setCurrentRawFrameValue(C%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(C):C<0?this.checkSegments(C%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+C%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(T=!0,C=0)):this.setCurrentRawFrameValue(C),T&&(this.setCurrentRawFrameValue(C),this.pause(),this.trigger("complete"));}},Ut.prototype.adjustSegment=function(m,C){this.playCount=0,m[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=m[0]-m[1],this.timeCompleted=this.totalFrames,this.firstFrame=m[1],this.setCurrentRawFrameValue(this.totalFrames-.001-C)):m[1]>m[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=m[1]-m[0],this.timeCompleted=this.totalFrames,this.firstFrame=m[0],this.setCurrentRawFrameValue(.001+C)),this.trigger("segmentStart");},Ut.prototype.setSegment=function(m,C){var T=-1;this.isPaused&&(this.currentRawFrame+this.firstFrameC&&(T=C-m)),this.firstFrame=m,this.totalFrames=C-m,this.timeCompleted=this.totalFrames,T!==-1&&this.goToAndStop(T,!0);},Ut.prototype.playSegments=function(m,C){if(C&&(this.segments.length=0),te(m[0])==="object"){var T,B=m.length;for(T=0;T=0;At-=1)C[At].animation.destroy(_t);}function K(_t,At,lt){var Tt=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),Dt,Et=Tt.length;for(Dt=0;Dt0?Y=K:$=K;while(Math.abs(nt)>O&&++ft=G?pt(X,dt,$,Y):xt===0?dt:st(X,rt,rt+x,$,Y)}},m}(),ei=function(){function m(C){return C.concat(v(C.length))}return {double:m}}(),Je=function(){return function(m,C,T){var B=0,G=m,O=v(G),o={newElement:d,release:x};function d(){var M;return B?(B-=1,M=O[B]):M=C(),M}function x(M){B===G&&(O=ei.double(O),G*=2),T&&T(M),O[B]=M,B+=1;}return o}}(),pi=function(){function m(){return {addedLength:0,percents:b("float32",Wt()),lengths:b("float32",Wt())}}return Je(8,m)}(),mi=function(){function m(){return {lengths:[],totalLength:0}}function C(T){var B,G=T.lengths.length;for(B=0;B-.001&&X<.001}function T(H,Q,Z,st,pt,et,X,$,Y){if(Z===0&&et===0&&Y===0)return C(H,Q,st,pt,X,$);var N=m.sqrt(m.pow(st-H,2)+m.pow(pt-Q,2)+m.pow(et-Z,2)),rt=m.sqrt(m.pow(X-H,2)+m.pow($-Q,2)+m.pow(Y-Z,2)),nt=m.sqrt(m.pow(X-st,2)+m.pow($-pt,2)+m.pow(Y-et,2)),K;return N>rt?N>nt?K=N-rt-nt:K=nt-rt-N:nt>rt?K=nt-rt-N:K=rt-N-nt,K>-1e-4&&K<1e-4}var B=function(){return function(H,Q,Z,st){var pt=Wt(),et,X,$,Y,N,rt=0,nt,K=[],ft=[],dt=pi.newElement();for($=Z.length,et=0;etX?-1:1,N=!0;N;)if(st[et]<=X&&st[et+1]>X?($=(X-st[et])/(st[et+1]-st[et]),N=!1):et+=Y,et<0||et>=pt-1){if(et===pt-1)return Z[et];N=!1;}return Z[et]+(Z[et+1]-Z[et])*$}function M(H,Q,Z,st,pt,et){var X=x(pt,et),$=1-X,Y=m.round(($*$*$*H[0]+(X*$*$+$*X*$+$*$*X)*Z[0]+(X*X*$+$*X*X+X*$*X)*st[0]+X*X*X*Q[0])*1e3)/1e3,N=m.round(($*$*$*H[1]+(X*$*$+$*X*$+$*$*X)*Z[1]+(X*X*$+$*X*X+X*$*X)*st[1]+X*X*X*Q[1])*1e3)/1e3;return [Y,N]}var L=b("float32",8);function I(H,Q,Z,st,pt,et,X){pt<0?pt=0:pt>1&&(pt=1);var $=x(pt,X);et=et>1?1:et;var Y=x(et,X),N,rt=H.length,nt=1-$,K=1-Y,ft=nt*nt*nt,dt=$*nt*nt*3,xt=$*$*nt*3,Lt=$*$*$,Ot=nt*nt*K,Ft=$*nt*K+nt*$*K+nt*nt*Y,$t=$*$*K+nt*$*Y+$*nt*Y,_t=$*$*Y,At=nt*K*K,lt=$*K*K+nt*Y*K+nt*K*Y,Tt=$*Y*K+nt*Y*Y+$*K*Y,Dt=$*Y*Y,Et=K*K*K,Pt=Y*K*K+K*Y*K+K*K*Y,kt=Y*Y*K+K*Y*Y+Y*K*Y,ct=Y*Y*Y;for(N=0;N=M.t-T){x.h&&(x=M),G=0;break}if(M.t-T>m){G=O;break}O=et||m=et?Y.points.length-1:0;for(H=Y.points[N].point.length,I=0;I=K&&rt=et)B[0]=$[0],B[1]=$[1],B[2]=$[2];else if(m<=X)B[0]=x.s[0],B[1]=x.s[1],B[2]=x.s[2];else {var Ft=Ts(x.s),$t=Ts($),_t=(m-X)/(et-X);Br(B,Rr(Ft,$t,_t));}else for(O=0;O=et?Q=1:m1e-6?(H=Math.acos(Q),Z=Math.sin(H),st=Math.sin((1-T)*H)/Z,pt=Math.sin(T*H)/Z):(st=1-T,pt=T),B[0]=st*G+pt*x,B[1]=st*O+pt*M,B[2]=st*o+pt*L,B[3]=st*d+pt*I,B}function Br(m,C){var T=C[0],B=C[1],G=C[2],O=C[3],o=Math.atan2(2*B*O-2*T*G,1-2*B*B-2*G*G),d=Math.asin(2*T*B+2*G*O),x=Math.atan2(2*T*O-2*B*G,1-2*T*T-2*G*G);m[0]=o/mt,m[1]=d/mt,m[2]=x/mt;}function Ts(m){var C=m[0]*mt,T=m[1]*mt,B=m[2]*mt,G=Math.cos(C/2),O=Math.cos(T/2),o=Math.cos(B/2),d=Math.sin(C/2),x=Math.sin(T/2),M=Math.sin(B/2),L=G*O*o-d*x*M,I=d*x*o+G*O*M,H=d*O*o+G*x*M,Q=G*x*o-d*O*M;return [I,H,Q,L]}function Ms(){var m=this.comp.renderedFrame-this.offsetTime,C=this.keyframes[0].t-this.offsetTime,T=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(m===this._caching.lastFrame||this._caching.lastFrame!==bs&&(this._caching.lastFrame>=T&&m>=T||this._caching.lastFrame=m&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var B=this.interpolateValue(m,this._caching);this.pv=B;}return this._caching.lastFrame=m,this.pv}function us(m){var C;if(this.propType==="unidimensional")C=m*this.mult,ia(this.v-C)>1e-5&&(this.v=C,this._mdf=!0);else for(var T=0,B=this.v.length;T1e-5&&(this.v[T]=C,this._mdf=!0),T+=1;}function mr(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var m,C=this.effectsSequence.length,T=this.kf?this.pv:this.data.k;for(m=0;m=this._maxLength&&this.doubleArrayLength(),T){case"v":O=this.v;break;case"i":O=this.i;break;case"o":O=this.o;break;default:O=[];break}(!O[B]||O[B]&&!G)&&(O[B]=Fe.newElement()),O[B][0]=m,O[B][1]=C;},$i.prototype.setTripleAt=function(m,C,T,B,G,O,o,d){this.setXYAt(m,C,"v",o,d),this.setXYAt(T,B,"o",o,d),this.setXYAt(G,O,"i",o,d);},$i.prototype.reverse=function(){var m=new $i;m.setPathData(this.c,this._length);var C=this.v,T=this.o,B=this.i,G=0;this.c&&(m.setTripleAt(C[0][0],C[0][1],B[0][0],B[0][1],T[0][0],T[0][1],0,!1),G=1);var O=this._length-1,o=this._length,d;for(d=G;d=Ft[Ft.length-1].t-this.offsetTime)N=Ft[Ft.length-1].s?Ft[Ft.length-1].s[0]:Ft[Ft.length-2].e[0],nt=!0;else {for(var $t=Y,_t=Ft.length-1,At=!0,lt,Tt,Dt;At&&(lt=Ft[$t],Tt=Ft[$t+1],!(Tt.t-this.offsetTime>et));)$t<_t-1?$t+=1:At=!1;if(Dt=this.keyframesMetadata[$t]||{},nt=lt.h===1,Y=$t,!nt){if(et>=Tt.t-this.offsetTime)Lt=1;else if(et$&&et>$)||(this._caching.lastIndex=Y0||lt>-1e-6&<<0?B(lt*Tt)/Tt:lt}function At(){var lt=this.props,Tt=_t(lt[0]),Dt=_t(lt[1]),Et=_t(lt[4]),Pt=_t(lt[5]),kt=_t(lt[12]),ct=_t(lt[13]);return "matrix("+Tt+","+Dt+","+Et+","+Pt+","+kt+","+ct+")"}return function(){this.reset=G,this.rotate=O,this.rotateX=o,this.rotateY=d,this.rotateZ=x,this.skew=L,this.skewFromAxis=I,this.shear=M,this.scale=H,this.setTransform=Q,this.translate=Z,this.transform=st,this.multiply=pt,this.applyToPoint=N,this.applyToX=rt,this.applyToY=nt,this.applyToZ=K,this.applyToPointArray=Ot,this.applyToTriplePoints=Lt,this.applyToPointStringified=Ft,this.toCSS=$t,this.to2dCSS=At,this.clone=$,this.cloneFromProps=Y,this.equals=X,this.inversePoints=xt,this.inversePoint=dt,this.getInverseMatrix=ft,this._t=this.transform,this.isIdentity=et,this._identity=!0,this._identityCalculated=!1,this.props=b("float32",16),this.reset();}}();function gr(m){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gr=function(C){return typeof C}:gr=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},gr(m)}var Oe={};function Ta(m){h(m);}function ra(){oe.searchAnimations();}function Ma(m){Qt(m);}function wa(m){fe(m);}function Da(m){return oe.loadAnimation(m)}function Fa(m){if(typeof m=="string")switch(m){case"high":pe(200);break;default:case"medium":pe(50);break;case"low":pe(10);break}else !isNaN(m)&&m>1&&pe(m);}function Ia(){return typeof navigator<"u"}function La(m,C){m==="expressions"&&ne(C);}function Va(m){switch(m){case"propertyFactory":return Kt;case"shapePropertyFactory":return ms;case"matrix":return se;default:return null}}Oe.play=oe.play,Oe.pause=oe.pause,Oe.setLocationHref=Ta,Oe.togglePause=oe.togglePause,Oe.setSpeed=oe.setSpeed,Oe.setDirection=oe.setDirection,Oe.stop=oe.stop,Oe.searchAnimations=ra,Oe.registerAnimation=oe.registerAnimation,Oe.loadAnimation=Da,Oe.setSubframeRendering=Ma,Oe.resize=oe.resize,Oe.goToAndStop=oe.goToAndStop,Oe.destroy=oe.destroy,Oe.setQuality=Fa,Oe.inBrowser=Ia,Oe.installPlugin=La,Oe.freeze=oe.freeze,Oe.unfreeze=oe.unfreeze,Oe.setVolume=oe.setVolume,Oe.mute=oe.mute,Oe.unmute=oe.unmute,Oe.getRegisteredAnimations=oe.getRegisteredAnimations,Oe.useWebWorker=n,Oe.setIDPrefix=wa,Oe.__getFactory=Va,Oe.version="5.12.2";function Or(){document.readyState==="complete"&&(clearInterval(ni),ra());}function zr(m){for(var C=aa.split("&"),T=0;T"u"?"undefined":gr(t))==="object"&&typeof e<"u")&&!(typeof define=="function"&&define.amd)&&(window.bodymovin=Oe);}catch{}var je=function(){var m={},C={};m.registerModifier=T,m.getModifier=B;function T(G,O){C[G]||(C[G]=O);}function B(G,O,o){return new C[G](O,o)}return m}();function di(){}di.prototype.initModifierProperties=function(){},di.prototype.addShapeToModifier=function(){},di.prototype.addShape=function(m){if(!this.closed){m.sh.container.addDynamicProperty(m.sh);var C={shape:m.sh,data:m,localShapeCollection:Ce.newShapeCollection()};this.shapes.push(C),this.addShapeToModifier(C),this._isAnimated&&m.setAsAnimated();}},di.prototype.init=function(m,C){this.shapes=[],this.elem=m,this.initDynamicPropertyContainer(m),this.initModifierProperties(m,C),this.frameId=a,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0);},di.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties());},c([Re],di);function wi(){}c([di],wi),wi.prototype.initModifierProperties=function(m,C){this.s=Kt.getProp(m,C.s,0,.01,this),this.e=Kt.getProp(m,C.e,0,.01,this),this.o=Kt.getProp(m,C.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=C.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length;},wi.prototype.addShapeToModifier=function(m){m.pathsData=[];},wi.prototype.calculateShapeEdges=function(m,C,T,B,G){var O=[];C<=1?O.push({s:m,e:C}):m>=1?O.push({s:m-1,e:C-1}):(O.push({s:m,e:1}),O.push({s:0,e:C-1}));var o=[],d,x=O.length,M;for(d=0;dB+T)){var L,I;M.s*G<=B?L=0:L=(M.s*G-B)/T,M.e*G>=B+T?I=1:I=(M.e*G-B)/T,o.push([L,I]);}return o.length||o.push([0,0]),o},wi.prototype.releasePathsData=function(m){var C,T=m.length;for(C=0;C1?C=1+B:this.s.v<0?C=0+B:C=this.s.v+B,this.e.v>1?T=1+B:this.e.v<0?T=0+B:T=this.e.v+B,C>T){var G=C;C=T,T=G;}C=Math.round(C*1e4)*1e-4,T=Math.round(T*1e4)*1e-4,this.sValue=C,this.eValue=T;}else C=this.sValue,T=this.eValue;var O,o,d=this.shapes.length,x,M,L,I,H,Q=0;if(T===C)for(o=0;o=0;o-=1)if(st=this.shapes[o],st.shape._mdf){for(pt=st.localShapeCollection,pt.releaseShapes(),this.m===2&&d>1?(Y=this.calculateShapeEdges(C,T,st.totalShapeLength,$,Q),$+=st.totalShapeLength):Y=[[et,X]],M=Y.length,x=0;x=1?Z.push({s:st.totalShapeLength*(et-1),e:st.totalShapeLength*(X-1)}):(Z.push({s:st.totalShapeLength*et,e:st.totalShapeLength}),Z.push({s:0,e:st.totalShapeLength*(X-1)}));var N=this.addShapes(st,Z[0]);if(Z[0].s!==Z[0].e){if(Z.length>1){var rt=st.shape.paths.shapes[st.shape.paths._length-1];if(rt.c){var nt=N.pop();this.addPaths(N,pt),N=this.addShapes(st,Z[1],nt);}else this.addPaths(N,pt),N=this.addShapes(st,Z[1]);}this.addPaths(N,pt);}}st.shape.paths=pt;}}},wi.prototype.addPaths=function(m,C){var T,B=m.length;for(T=0;TC.e){T.c=!1;break}else C.s<=M&&C.e>=M+L.addedLength?(this.addSegment(G[O].v[d-1],G[O].o[d-1],G[O].i[d],G[O].v[d],T,I,pt),pt=!1):(Q=Zi.getNewSegment(G[O].v[d-1],G[O].v[d],G[O].o[d-1],G[O].i[d],(C.s-M)/L.addedLength,(C.e-M)/L.addedLength,H[d-1]),this.addSegmentFromArray(Q,T,I,pt),pt=!1,T.c=!1),M+=L.addedLength,I+=1;if(G[O].c&&H.length){if(L=H[d-1],M<=C.e){var et=H[d-1].addedLength;C.s<=M&&C.e>=M+et?(this.addSegment(G[O].v[d-1],G[O].o[d-1],G[O].i[0],G[O].v[0],T,I,pt),pt=!1):(Q=Zi.getNewSegment(G[O].v[d-1],G[O].v[0],G[O].o[d-1],G[O].i[0],(C.s-M)/et,(C.e-M)/et,H[d-1]),this.addSegmentFromArray(Q,T,I,pt),pt=!1,T.c=!1);}else T.c=!1;M+=L.addedLength,I+=1;}if(T._length&&(T.setXYAt(T.v[st][0],T.v[st][1],"i",st),T.setXYAt(T.v[T._length-1][0],T.v[T._length-1][1],"o",T._length-1)),M>C.e)break;O=this.p.keyframes[this.p.keyframes.length-1].t?(L=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/M,0),I=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/M,0)):(L=this.p.pv,I=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/M,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){L=[],I=[];var H=this.px,Q=this.py;H._caching.lastFrame+H.offsetTime<=H.keyframes[0].t?(L[0]=H.getValueAtTime((H.keyframes[0].t+.01)/M,0),L[1]=Q.getValueAtTime((Q.keyframes[0].t+.01)/M,0),I[0]=H.getValueAtTime(H.keyframes[0].t/M,0),I[1]=Q.getValueAtTime(Q.keyframes[0].t/M,0)):H._caching.lastFrame+H.offsetTime>=H.keyframes[H.keyframes.length-1].t?(L[0]=H.getValueAtTime(H.keyframes[H.keyframes.length-1].t/M,0),L[1]=Q.getValueAtTime(Q.keyframes[Q.keyframes.length-1].t/M,0),I[0]=H.getValueAtTime((H.keyframes[H.keyframes.length-1].t-.01)/M,0),I[1]=Q.getValueAtTime((Q.keyframes[Q.keyframes.length-1].t-.01)/M,0)):(L=[H.pv,Q.pv],I[0]=H.getValueAtTime((H._caching.lastFrame+H.offsetTime-.01)/M,H.offsetTime),I[1]=Q.getValueAtTime((Q._caching.lastFrame+Q.offsetTime-.01)/M,Q.offsetTime));}else I=m,L=I;this.v.rotate(-Math.atan2(L[1]-I[1],L[0]-I[0]));}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);}this.frameId=this.elem.globalData.frameId;}}function B(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4);}function G(){}function O(x){this._addDynamicProperty(x),this.elem.addDynamicProperty(x),this._isDirty=!0;}function o(x,M,L){if(this.elem=x,this.frameId=-1,this.propType="transform",this.data=M,this.v=new se,this.pre=new se,this.appliedTransformations=0,this.initDynamicPropertyContainer(L||x),M.p&&M.p.s?(this.px=Kt.getProp(x,M.p.x,0,0,this),this.py=Kt.getProp(x,M.p.y,0,0,this),M.p.z&&(this.pz=Kt.getProp(x,M.p.z,0,0,this))):this.p=Kt.getProp(x,M.p||{k:[0,0,0]},1,0,this),M.rx){if(this.rx=Kt.getProp(x,M.rx,0,mt,this),this.ry=Kt.getProp(x,M.ry,0,mt,this),this.rz=Kt.getProp(x,M.rz,0,mt,this),M.or.k[0].ti){var I,H=M.or.k.length;for(I=0;I0;)T-=1,this._elements.unshift(C[T]);this.dynamicProperties.length?this.k=!0:this.getValue(!0);},Di.prototype.resetElements=function(m){var C,T=m.length;for(C=0;C0?Math.floor(H):Math.ceil(H),st=this.pMatrix.props,pt=this.rMatrix.props,et=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var X=0;if(H>0){for(;XZ;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),X-=1;Q&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-Q,!0),X-=Q);}B=this.data.m===1?0:this._currentCopies-1,G=this.data.m===1?1:-1,O=this._currentCopies;for(var $,Y;O;){if(C=this.elemsData[B].it,T=C[C.length-1].transform.mProps.v.props,Y=T.length,C[C.length-1].transform.mProps._mdf=!0,C[C.length-1].transform.op._mdf=!0,C[C.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(B/(this._currentCopies-1)),X!==0){for((B!==0&&G===1||B!==this._currentCopies-1&&G===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(pt[0],pt[1],pt[2],pt[3],pt[4],pt[5],pt[6],pt[7],pt[8],pt[9],pt[10],pt[11],pt[12],pt[13],pt[14],pt[15]),this.matrix.transform(et[0],et[1],et[2],et[3],et[4],et[5],et[6],et[7],et[8],et[9],et[10],et[11],et[12],et[13],et[14],et[15]),this.matrix.transform(st[0],st[1],st[2],st[3],st[4],st[5],st[6],st[7],st[8],st[9],st[10],st[11],st[12],st[13],st[14],st[15]),$=0;$0&&B<1?[C]:[]:[C-B,C+B].filter(function(G){return G>0&&G<1})},$e.prototype.split=function(m){if(m<=0)return [vr(this.points[0]),this];if(m>=1)return [this,vr(this.points[this.points.length-1])];var C=ds(this.points[0],this.points[1],m),T=ds(this.points[1],this.points[2],m),B=ds(this.points[2],this.points[3],m),G=ds(C,T,m),O=ds(T,B,m),o=ds(G,O,m);return [new $e(this.points[0],C,G,o,!0),new $e(o,O,B,this.points[3],!0)]};function br(m,C){var T=m.points[0][C],B=m.points[m.points.length-1][C];if(T>B){var G=B;B=T,T=G;}for(var O=Nr(3*m.a[C],2*m.b[C],m.c[C]),o=0;o0&&O[o]<1){var d=m.point(O[o])[C];dB&&(B=d);}return {min:T,max:B}}$e.prototype.bounds=function(){return {x:br(this,0),y:br(this,1)}},$e.prototype.boundingBox=function(){var m=this.bounds();return {left:m.x.min,right:m.x.max,top:m.y.min,bottom:m.y.max,width:m.x.max-m.x.min,height:m.y.max-m.y.min,cx:(m.x.max+m.x.min)/2,cy:(m.y.max+m.y.min)/2}};function _r(m,C,T){var B=m.boundingBox();return {cx:B.cx,cy:B.cy,width:B.width,height:B.height,bez:m,t:(C+T)/2,t1:C,t2:T}}function gs(m){var C=m.bez.split(.5);return [_r(C[0],m.t1,m.t),_r(C[1],m.t,m.t2)]}function rr(m,C){return Math.abs(m.cx-C.cx)*2=O||m.width<=B&&m.height<=B&&C.width<=B&&C.height<=B){G.push([m.t,C.t]);return}var o=gs(m),d=gs(C);as(o[0],d[0],T+1,B,G,O),as(o[0],d[1],T+1,B,G,O),as(o[1],d[0],T+1,B,G,O),as(o[1],d[1],T+1,B,G,O);}}$e.prototype.intersections=function(m,C,T){C===void 0&&(C=2),T===void 0&&(T=7);var B=[];return as(_r(this,0,1),_r(m,0,1),0,C,B,T),B},$e.shapeSegment=function(m,C){var T=(C+1)%m.length();return new $e(m.v[C],m.o[C],m.i[T],m.v[T],!0)},$e.shapeSegmentInverted=function(m,C){var T=(C+1)%m.length();return new $e(m.v[T],m.i[T],m.o[C],m.v[C],!0)};function Wi(m,C){return [m[1]*C[2]-m[2]*C[1],m[2]*C[0]-m[0]*C[2],m[0]*C[1]-m[1]*C[0]]}function ws(m,C,T,B){var G=[m[0],m[1],1],O=[C[0],C[1],1],o=[T[0],T[1],1],d=[B[0],B[1],1],x=Wi(Wi(G,O),Wi(o,d));return Ai(x[2])?null:[x[0]/x[2],x[1]/x[2]]}function Fi(m,C,T){return [m[0]+Math.cos(C)*T,m[1]-Math.sin(C)*T]}function ns(m,C){return Math.hypot(m[0]-C[0],m[1]-C[1])}function Ds(m,C){return Ws(m[0],C[0])&&Ws(m[1],C[1])}function ar(){}c([di],ar),ar.prototype.initModifierProperties=function(m,C){this.getValue=this.processKeys,this.amplitude=Kt.getProp(m,C.s,0,null,this),this.frequency=Kt.getProp(m,C.r,0,null,this),this.pointsType=Kt.getProp(m,C.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0;};function oa(m,C,T,B,G,O,o){var d=T-Math.PI/2,x=T+Math.PI/2,M=C[0]+Math.cos(T)*B*G,L=C[1]-Math.sin(T)*B*G;m.setTripleAt(M,L,M+Math.cos(d)*O,L-Math.sin(d)*O,M+Math.cos(x)*o,L-Math.sin(x)*o,m.length());}function Gr(m,C){var T=[C[0]-m[0],C[1]-m[1]],B=-Math.PI*.5,G=[Math.cos(B)*T[0]-Math.sin(B)*T[1],Math.sin(B)*T[0]+Math.cos(B)*T[1]];return G}function Ba(m,C){var T=C===0?m.length()-1:C-1,B=(C+1)%m.length(),G=m.v[T],O=m.v[B],o=Gr(G,O);return Math.atan2(0,1)-Math.atan2(o[1],o[0])}function Xs(m,C,T,B,G,O,o){var d=Ba(C,T),x=C.v[T%C._length],M=C.v[T===0?C._length-1:T-1],L=C.v[(T+1)%C._length],I=O===2?Math.sqrt(Math.pow(x[0]-M[0],2)+Math.pow(x[1]-M[1],2)):0,H=O===2?Math.sqrt(Math.pow(x[0]-L[0],2)+Math.pow(x[1]-L[1],2)):0;oa(m,C.v[T%C._length],d,o,B,H/((G+1)*2),I/((G+1)*2));}function os(m,C,T,B,G,O){for(var o=0;o1&&C.length>1&&(G=ha(m[0],C[C.length-1]),G)?[[m[0].split(G[0])[0]],[C[C.length-1].split(G[1])[1]]]:[T,B]}function xs(m){for(var C,T=1;T1&&(C=Pr(m[m.length-1],m[0]),m[m.length-1]=C[0],m[0]=C[1]),m}function Sr(m,C){var T=m.inflectionPoints(),B,G,O,o;if(T.length===0)return [Fs(m,C)];if(T.length===1||Ws(T[1],1))return O=m.split(T[0]),B=O[0],G=O[1],[Fs(B,C),Fs(G,C)];O=m.split(T[0]),B=O[0];var d=(T[1]-T[0])/(1-T[0]);return O=O[1].split(d),o=O[0],G=O[1],[Fs(B,C),Fs(o,C),Fs(G,C)]}function Ci(){}c([di],Ci),Ci.prototype.initModifierProperties=function(m,C){this.getValue=this.processKeys,this.amount=Kt.getProp(m,C.a,0,null,this),this.miterLimit=Kt.getProp(m,C.ml,0,null,this),this.lineJoin=C.lj,this._isAnimated=this.amount.effectsSequence.length!==0;},Ci.prototype.processPath=function(m,C,T,B){var G=Ue.newElement();G.c=m.c;var O=m.length();m.c||(O-=1);var o,d,x,M=[];for(o=0;o=0;o-=1)x=$e.shapeSegmentInverted(m,o),M.push(Sr(x,C));M=xs(M);var L=null,I=null;for(o=0;o0&&(Pt=!1),Pt){var wt=P("style");wt.setAttribute("f-forigin",lt[Tt].fOrigin),wt.setAttribute("f-origin",lt[Tt].origin),wt.setAttribute("f-family",lt[Tt].fFamily),wt.type="text/css",wt.innerText="@font-face {font-family: "+lt[Tt].fFamily+"; font-style: normal; src: url('"+lt[Tt].fPath+"');}",At.appendChild(wt);}}else if(lt[Tt].fOrigin==="g"||lt[Tt].origin===1){for(kt=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),ct=0;ct=55296&<<=56319){var Tt=_t.charCodeAt(1);Tt>=56320&&Tt<=57343&&(At=(lt-55296)*1024+Tt-56320+65536);}return At}function rt(_t,At){var lt=_t.toString(16)+At.toString(16);return I.indexOf(lt)!==-1}function nt(_t){return _t===x}function K(_t){return _t===d}function ft(_t){var At=N(_t);return At>=M&&At<=L}function dt(_t){return ft(_t.substr(0,2))&&ft(_t.substr(2,2))}function xt(_t){return T.indexOf(_t)!==-1}function Lt(_t,At){var lt=N(_t.substr(At,2));if(lt!==B)return !1;var Tt=0;for(At+=2;Tt<5;){if(lt=N(_t.substr(At,2)),lto)return !1;Tt+=1,At+=2;}return N(_t.substr(At,2))===G}function Ot(){this.isLoaded=!0;}var Ft=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this);};Ft.isModifier=rt,Ft.isZeroWidthJoiner=nt,Ft.isFlagEmoji=dt,Ft.isRegionalCode=ft,Ft.isCombinedCharacter=xt,Ft.isRegionalFlag=Lt,Ft.isVariationSelector=K,Ft.BLACK_FLAG_CODE_POINT=B;var $t={addChars:et,addFonts:pt,getCharData:X,getFontByName:Y,measureText:$,checkLoadedFonts:Z,setIsLoaded:Ot};return Ft.prototype=$t,Ft}();function Ki(m){this.animationData=m;}Ki.prototype.getProp=function(m){return this.animationData.slots&&this.animationData.slots[m.sid]?Object.assign(m,this.animationData.slots[m.sid].p):m};function Ys(m){return new Ki(m)}function Js(){}Js.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[];},addRenderableComponent:function(m){this.renderableComponents.indexOf(m)===-1&&this.renderableComponents.push(m);},removeRenderableComponent:function(m){this.renderableComponents.indexOf(m)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(m),1);},prepareRenderableFrame:function(m){this.checkLayerLimits(m);},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show());},checkLayerLimits:function(m){this.data.ip-this.data.st<=m&&this.data.op-this.data.st>m?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide());},renderRenderable:function(){var m,C=this.renderableComponents.length;for(m=0;m.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0));},Ii.prototype.show=function(){},Ii.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1;},Ii.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1;},Ii.prototype.resume=function(){this._canPlay=!0;},Ii.prototype.setRate=function(m){this.audio.rate(m);},Ii.prototype.volume=function(m){this._volumeMultiplier=m,this._previousVolume=m*this._volume,this.audio.volume(this._previousVolume);},Ii.prototype.getBaseElement=function(){return null},Ii.prototype.destroy=function(){},Ii.prototype.sourceRectAtTime=function(){},Ii.prototype.initExpressions=function(){};function Be(){}Be.prototype.checkLayers=function(m){var C,T=this.layers.length,B;for(this.completeLayers=!0,C=T-1;C>=0;C-=1)this.elements[C]||(B=this.layers[C],B.ip-B.st<=m-this.layers[C].st&&B.op-B.st>m-this.layers[C].st&&this.buildItem(C)),this.completeLayers=this.elements[C]?this.completeLayers:!1;this.checkPendingElements();},Be.prototype.createItem=function(m){switch(m.ty){case 2:return this.createImage(m);case 0:return this.createComp(m);case 1:return this.createSolid(m);case 3:return this.createNull(m);case 4:return this.createShape(m);case 5:return this.createText(m);case 6:return this.createAudio(m);case 13:return this.createCamera(m);case 15:return this.createFootage(m);default:return this.createNull(m)}},Be.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},Be.prototype.createAudio=function(m){return new Ii(m,this.globalData,this)},Be.prototype.createFootage=function(m){return new Te(m,this.globalData,this)},Be.prototype.buildAllItems=function(){var m,C=this.layers.length;for(m=0;m0&&(this.maskElement.setAttribute("id",H),this.element.maskedElement.setAttribute(X,"url("+y()+"#"+H+")"),B.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this);}Qi.prototype.getMaskProperty=function(m){return this.viewData[m].prop},Qi.prototype.renderFrame=function(m){var C=this.element.finalTransform.mat,T,B=this.masksProperties.length;for(T=0;T1&&(B+=" C"+C.o[G-1][0]+","+C.o[G-1][1]+" "+C.i[0][0]+","+C.i[0][1]+" "+C.v[0][0]+","+C.v[0][1]),T.lastPath!==B){var o="";T.elem&&(C.c&&(o=m.inv?this.solidPath+B:B),T.elem.setAttribute("d",o)),T.lastPath=B;}},Qi.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null;};var Ss=function(){var m={};m.createFilter=C,m.createAlphaToLuminanceFilter=T;function C(B,G){var O=jt("filter");return O.setAttribute("id",B),G!==!0&&(O.setAttribute("filterUnits","objectBoundingBox"),O.setAttribute("x","0%"),O.setAttribute("y","0%"),O.setAttribute("width","100%"),O.setAttribute("height","100%")),O}function T(){var B=jt("feColorMatrix");return B.setAttribute("type","matrix"),B.setAttribute("color-interpolation-filters","sRGB"),B.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),B}return m}(),Ar=function(){var m={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return (/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(m.maskType=!1),/firefox/i.test(navigator.userAgent)&&(m.svgLumaHidden=!1),m}(),Rs={},ys="filter_result_";function ki(m){var C,T="SourceGraphic",B=m.data.ef?m.data.ef.length:0,G=tt(),O=Ss.createFilter(G,!0),o=0;this.filters=[];var d;for(C=0;C=0&&(T=this.shapeModifiers[m].processShapes(this._isFirstFrame),!T);m-=1);}},searchProcessedElement:function(m){for(var C=this.processedElements,T=0,B=C.length;T.01)return !1;T+=1;}return !0},Os.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return !1;if(this.data.k.k[0].s)for(var m=0,C=this.data.k.k.length;m0;)et=H.transformers[ft].mProps._mdf||et,K-=1,ft-=1;if(et)for(K=N-H.styles[$].lvl,ft=H.transformers.length-1;K>0;)nt.multiply(H.transformers[ft].mProps.v),K-=1,ft-=1;}else nt=m;if(rt=H.sh.paths,st=rt._length,et){for(pt="",Z=0;Z=1?Ot=.99:Ot<=-1&&(Ot=-.99);var Ft=xt*Ot,$t=Math.cos(Lt+H.a.v)*Ft+pt[0],_t=Math.sin(Lt+H.a.v)*Ft+pt[1];Z.setAttribute("fx",$t),Z.setAttribute("fy",_t),st&&!H.g._collapsable&&(H.of.setAttribute("fx",$t),H.of.setAttribute("fy",_t));}}}function L(I,H,Q){var Z=H.style,st=H.d;st&&(st._mdf||Q)&&st.dashStr&&(Z.pElem.setAttribute("stroke-dasharray",st.dashStr),Z.pElem.setAttribute("stroke-dashoffset",st.dashoffset[0])),H.c&&(H.c._mdf||Q)&&Z.pElem.setAttribute("stroke","rgb("+z(H.c.v[0])+","+z(H.c.v[1])+","+z(H.c.v[2])+")"),(H.o._mdf||Q)&&Z.pElem.setAttribute("stroke-opacity",H.o.v),(H.w._mdf||Q)&&(Z.pElem.setAttribute("stroke-width",H.w.v),Z.msElem&&Z.msElem.setAttribute("stroke-width",H.w.v));}return T}();function ye(m,C,T){this.shapes=[],this.shapesData=m.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(m,C,T),this.prevViewData=[];}c([We,xi,Li,or,fi,ke,Bs],ye),ye.prototype.initSecondaryElement=function(){},ye.prototype.identityMatrix=new se,ye.prototype.buildExpressionInterface=function(){},ye.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();},ye.prototype.filterUniqueShapes=function(){var m,C=this.shapes.length,T,B,G=this.stylesList.length,O,o=[],d=!1;for(B=0;B1&&d&&this.setShapesAsAnimated(o);}},ye.prototype.setShapesAsAnimated=function(m){var C,T=m.length;for(C=0;C=0;x-=1){if(pt=this.searchProcessedElement(m[x]),pt?C[x]=T[pt-1]:m[x]._render=o,m[x].ty==="fl"||m[x].ty==="st"||m[x].ty==="gf"||m[x].ty==="gs"||m[x].ty==="no")pt?C[x].style.closed=!1:C[x]=this.createStyleElement(m[x],G),m[x]._render&&C[x].style.pElem.parentNode!==B&&B.appendChild(C[x].style.pElem),H.push(C[x].style);else if(m[x].ty==="gr"){if(!pt)C[x]=this.createGroupElement(m[x]);else for(I=C[x].it.length,L=0;L1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},Vi.prototype.addEffect=function(m){this.effectsSequence.push(m),this.elem.addDynamicProperty(this);},Vi.prototype.getValue=function(m){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!m)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var C=this.currentData,T=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var B,G=this.effectsSequence.length,O=m||this.data.d.k[this.keysIndex].s;for(B=0;BC);)T+=1;return this.keysIndex!==T&&(this.keysIndex=T),this.data.d.k[this.keysIndex].s},Vi.prototype.buildFinalText=function(m){for(var C=[],T=0,B=m.length,G,O,o=!1,d=!1,x="";T=55296&&G<=56319?Vs.isRegionalFlag(m,T)?x=m.substr(T,14):(O=m.charCodeAt(T+1),O>=56320&&O<=57343&&(Vs.isModifier(G,O)?(x=m.substr(T,2),o=!0):Vs.isFlagEmoji(m.substr(T,4))?x=m.substr(T,4):x=m.substr(T,2))):G>56319?(O=m.charCodeAt(T+1),Vs.isVariationSelector(G)&&(o=!0)):Vs.isZeroWidthJoiner(G)&&(o=!0,d=!0),o?(C[C.length-1]+=x,o=!1):C.push(x),T+=x.length;return C},Vi.prototype.completeTextData=function(m){m.__complete=!0;var C=this.elem.globalData.fontManager,T=this.data,B=[],G,O,o,d=0,x,M=T.m.g,L=0,I=0,H=0,Q=[],Z=0,st=0,pt,et,X=C.getFontByName(m.f),$,Y=0,N=Er(X);m.fWeight=N.weight,m.fStyle=N.style,m.finalSize=m.s,m.finalText=this.buildFinalText(m.t),O=m.finalText.length,m.finalLineHeight=m.lh;var rt=m.tr/1e3*m.finalSize,nt;if(m.sz)for(var K=!0,ft=m.sz[0],dt=m.sz[1],xt,Lt;K;){Lt=this.buildFinalText(m.t),xt=0,Z=0,O=Lt.length,rt=m.tr/1e3*m.finalSize;var Ot=-1;for(G=0;Gft&&Lt[G]!==" "?(Ot===-1?O+=1:G=Ot,xt+=m.finalLineHeight||m.finalSize*1.2,Lt.splice(G,Ot===G?1:0,"\r"),Ot=-1,Z=0):(Z+=Y,Z+=rt);xt+=X.ascent*m.finalSize/100,this.canResize&&m.finalSize>this.minimumFontSize&&dtst?Z:st,Z=-2*rt,x="",o=!0,H+=1):x=$t,C.chars?($=C.getCharData($t,X.fStyle,C.getFontByName(m.f).fFamily),Y=o?0:$.w*m.finalSize/100):Y=C.measureText(x,m.f,m.finalSize),$t===" "?Ft+=Y+rt:(Z+=Y+rt+Ft,Ft=0),B.push({l:Y,an:Y,add:L,n:o,anIndexes:[],val:x,line:H,animatorJustifyOffset:0}),M==2){if(L+=Y,x===""||x===" "||G===O-1){for((x===""||x===" ")&&(L-=Y);I<=G;)B[I].an=L,B[I].ind=d,B[I].extra=Y,I+=1;d+=1,L=0;}}else if(M==3){if(L+=Y,x===""||G===O-1){for(x===""&&(L-=Y);I<=G;)B[I].an=L,B[I].ind=d,B[I].extra=Y,I+=1;L=0,d+=1;}}else B[d].ind=d,B[d].extra=0,d+=1;if(m.l=B,st=Z>st?Z:st,Q.push(Z),m.sz)m.boxWidth=m.sz[0],m.justifyOffset=0;else switch(m.boxWidth=st,m.j){case 1:m.justifyOffset=-m.boxWidth;break;case 2:m.justifyOffset=-m.boxWidth/2;break;default:m.justifyOffset=0;}m.lineWidths=Q;var _t=T.a,At,lt;et=_t.length;var Tt,Dt,Et=[];for(pt=0;pt0?o=this.ne.v/100:d=-this.ne.v/100,this.xe.v>0?x=1-this.xe.v/100:M=1+this.xe.v/100;var L=xe.getBezierEasing(o,d,x,M).get,I=0,H=this.finalS,Q=this.finalE,Z=this.data.sh;if(Z===2)Q===H?I=O>=Q?1:0:I=m(0,C(.5/(Q-H)+(O-H)/(Q-H),1)),I=L(I);else if(Z===3)Q===H?I=O>=Q?0:1:I=1-m(0,C(.5/(Q-H)+(O-H)/(Q-H),1)),I=L(I);else if(Z===4)Q===H?I=0:(I=m(0,C(.5/(Q-H)+(O-H)/(Q-H),1)),I<.5?I*=2:I=1-2*(I-.5)),I=L(I);else if(Z===5){if(Q===H)I=0;else {var st=Q-H;O=C(m(0,O+.5-H),Q-H);var pt=-st/2+O,et=st/2;I=Math.sqrt(1-pt*pt/(et*et));}I=L(I);}else Z===6?(Q===H?I=0:(O=C(m(0,O+.5-H),Q-H),I=(1+Math.cos(Math.PI+Math.PI*2*O/(Q-H)))/2),I=L(I)):(O>=T(H)&&(O-H<0?I=m(0,C(C(Q,1)-(H-O),1)):I=m(0,C(Q-O,1))),I=L(I));if(this.sm.v!==100){var X=this.sm.v*.01;X===0&&(X=1e-8);var $=.5-X*.5;I<$?I=0:(I=(I-$)/X,I>1&&(I=1));}return I*this.a.v},getValue:function(O){this.iterateDynamicProperties(),this._mdf=O||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,O&&this.data.r===2&&(this.e.v=this._currentTextLength);var o=this.data.r===2?1:100/this.data.totalChars,d=this.o.v/o,x=this.s.v/o+d,M=this.e.v/o+d;if(x>M){var L=x;x=M,M=L;}this.finalS=x,this.finalE=M;}},c([Re],B);function G(O,o,d){return new B(O,o)}return {getTextSelectorProp:G}}();function ii(m,C,T){var B={propType:!1},G=Kt.getProp,O=C.a;this.a={r:O.r?G(m,O.r,0,mt,T):B,rx:O.rx?G(m,O.rx,0,mt,T):B,ry:O.ry?G(m,O.ry,0,mt,T):B,sk:O.sk?G(m,O.sk,0,mt,T):B,sa:O.sa?G(m,O.sa,0,mt,T):B,s:O.s?G(m,O.s,1,.01,T):B,a:O.a?G(m,O.a,1,0,T):B,o:O.o?G(m,O.o,0,.01,T):B,p:O.p?G(m,O.p,1,0,T):B,sw:O.sw?G(m,O.sw,0,0,T):B,sc:O.sc?G(m,O.sc,1,0,T):B,fc:O.fc?G(m,O.fc,1,0,T):B,fh:O.fh?G(m,O.fh,0,0,T):B,fs:O.fs?G(m,O.fs,0,.01,T):B,fb:O.fb?G(m,O.fb,0,.01,T):B,t:O.t?G(m,O.t,0,0,T):B},this.s=Xi.getTextSelectorProp(m,C.s,T),this.s.t=C.s.t;}function zs(m,C,T){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=m,this._renderType=C,this._elem=T,this._animatorsData=v(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(T);}zs.prototype.searchProperties=function(){var m,C=this._textData.a.length,T,B=Kt.getProp;for(m=0;m=Z+Ti||!N?(ft=(Z+Ti-pt)/st.partialLength,ct=Y.point[0]+(st.point[0]-Y.point[0])*ft,wt=Y.point[1]+(st.point[1]-Y.point[1])*ft,O.translate(-T[0]*H[L].an*.005,-(T[1]*Ft)*.01),et=!1):N&&(pt+=st.partialLength,X+=1,X>=N.length&&(X=0,$+=1,rt[$]?N=rt[$].points:xt.v.c?(X=0,$=0,N=rt[$].points):(pt-=st.partialLength,N=null)),N&&(Y=st,st=N[X],nt=st.partialLength));kt=H[L].an/2-H[L].add,O.translate(-kt,0,0);}else kt=H[L].an/2-H[L].add,O.translate(-kt,0,0),O.translate(-T[0]*H[L].an*.005,-T[1]*Ft*.01,0);for(lt=0;ltm?this.textSpans[m].span:jt(d?"g":"text"),$<=m){if(x.setAttribute("stroke-linecap","butt"),x.setAttribute("stroke-linejoin","round"),x.setAttribute("stroke-miterlimit","4"),this.textSpans[m].span=x,d){var N=jt("g");x.appendChild(N),this.textSpans[m].childSpan=N;}this.textSpans[m].span=x,this.layerElement.appendChild(x);}x.style.display="inherit";}if(M.reset(),I&&(o[m].n&&(H=-st,Q+=T.yOffset,Q+=Z?1:0,Z=!1),this.applyTextPropertiesToMatrix(T,M,o[m].line,H,Q),H+=o[m].l||0,H+=st),d){Y=this.globalData.fontManager.getCharData(T.finalText[m],B.fStyle,this.globalData.fontManager.getFontByName(T.f).fFamily);var rt;if(Y.t===1)rt=new A(Y.data,this.globalData,this);else {var nt=pr;Y.data&&Y.data.shapes&&(nt=this.buildShapeData(Y.data,T.finalSize)),rt=new ye(nt,this.globalData,this);}if(this.textSpans[m].glyph){var K=this.textSpans[m].glyph;this.textSpans[m].childSpan.removeChild(K.layerElement),K.destroy();}this.textSpans[m].glyph=rt,rt._debug=!0,rt.prepareFrame(0),rt.renderFrame(),this.textSpans[m].childSpan.appendChild(rt.layerElement),Y.t===1&&this.textSpans[m].childSpan.setAttribute("transform","scale("+T.finalSize/100+","+T.finalSize/100+")");}else I&&x.setAttribute("transform","translate("+M.props[12]+","+M.props[13]+")"),x.textContent=o[m].val,x.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");}I&&x&&x.setAttribute("d",L);}for(;m=0;C-=1)(this.completeLayers||this.elements[C])&&this.elements[C].prepareFrame(m-this.layers[C].st);if(this.globalData._mdf)for(C=0;C=0;T-=1)(this.completeLayers||this.elements[T])&&(this.elements[T].prepareFrame(this.renderedFrame-this.layers[T].st),this.elements[T]._mdf&&(this._mdf=!0));}},zi.prototype.renderInnerContent=function(){var m,C=this.layers.length;for(m=0;m0&&x<1&&G[H].push(this.calculateF(x,m,C,T,B,H))):(M=o*o-4*d*O,M>=0&&(L=(-o+k(M))/(2*O),L>0&&L<1&&G[H].push(this.calculateF(L,m,C,T,B,H)),I=(-o-k(M))/(2*O),I>0&&I<1&&G[H].push(this.calculateF(I,m,C,T,B,H)))));this.shapeBoundingBox.left=W.apply(null,G[0]),this.shapeBoundingBox.top=W.apply(null,G[1]),this.shapeBoundingBox.right=q.apply(null,G[0]),this.shapeBoundingBox.bottom=q.apply(null,G[1]);},vt.prototype.calculateF=function(m,C,T,B,G,O){return _(1-m,3)*C[O]+3*_(1-m,2)*m*T[O]+3*(1-m)*_(m,2)*B[O]+_(m,3)*G[O]},vt.prototype.calculateBoundingBox=function(m,C){var T,B=m.length;for(T=0;TT&&(T=G);}T*=m.mult;}else T=m.v*m.mult;C.x-=T,C.xMax+=T,C.y-=T,C.yMax+=T;},vt.prototype.currentBoxContains=function(m){return this.currentBBox.x<=m.x&&this.currentBBox.y<=m.y&&this.currentBBox.width+this.currentBBox.x>=m.x+m.width&&this.currentBBox.height+this.currentBBox.y>=m.y+m.height},vt.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var m=this.tempBoundingBox,C=999999;if(m.x=C,m.xMax=-C,m.y=C,m.yMax=-C,this.calculateBoundingBox(this.itemsData,m),m.width=m.xMax=0;C-=1){var B=this.hierarchy[C].finalTransform.mProp;this.mat.translate(-B.p.v[0],-B.p.v[1],B.p.v[2]),this.mat.rotateX(-B.or.v[0]).rotateY(-B.or.v[1]).rotateZ(B.or.v[2]),this.mat.rotateX(-B.rx.v).rotateY(-B.ry.v).rotateZ(B.rz.v),this.mat.scale(1/B.s.v[0],1/B.s.v[1],1/B.s.v[2]),this.mat.translate(B.a.v[0],B.a.v[1],B.a.v[2]);}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var G;this.p?G=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:G=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var O=Math.sqrt(Math.pow(G[0],2)+Math.pow(G[1],2)+Math.pow(G[2],2)),o=[G[0]/O,G[1]/O,G[2]/O],d=Math.sqrt(o[2]*o[2]+o[0]*o[0]),x=Math.atan2(o[1],d),M=Math.atan2(o[0],-o[2]);this.mat.rotateY(M).rotateX(-x);}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var L=!this._prevMat.equals(this.mat);if((L||this.pe._mdf)&&this.comp.threeDElements){T=this.comp.threeDElements.length;var I,H,Q;for(C=0;C=m)return this.threeDElements[C].perspectiveElem;C+=1;}return null},It.prototype.createThreeDContainer=function(m,C){var T=P("div"),B,G;ut(T);var O=P("div");if(ut(O),C==="3d"){B=T.style,B.width=this.globalData.compSize.w+"px",B.height=this.globalData.compSize.h+"px";var o="50% 50%";B.webkitTransformOrigin=o,B.mozTransformOrigin=o,B.transformOrigin=o,G=O.style;var d="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";G.transform=d,G.webkitTransform=d;}T.appendChild(O);var x={container:O,perspectiveElem:T,startPos:m,endPos:m,type:C};return this.threeDElements.push(x),x},It.prototype.build3dContainers=function(){var m,C=this.layers.length,T,B="";for(m=0;m=0;m-=1)this.resizerElem.appendChild(this.threeDElements[m].perspectiveElem);},It.prototype.addTo3dContainer=function(m,C){for(var T=0,B=this.threeDElements.length;TT?(G=m/this.globalData.compSize.w,O=m/this.globalData.compSize.w,o=0,d=(C-this.globalData.compSize.h*(m/this.globalData.compSize.w))/2):(G=C/this.globalData.compSize.h,O=C/this.globalData.compSize.h,o=(m-this.globalData.compSize.w*(C/this.globalData.compSize.h))/2,d=0);var x=this.resizerElem.style;x.webkitTransform="matrix3d("+G+",0,0,0,0,"+O+",0,0,0,0,1,0,"+o+","+d+",0,1)",x.transform=x.webkitTransform;},It.prototype.renderFrame=F.prototype.renderFrame,It.prototype.hide=function(){this.resizerElem.style.display="none";},It.prototype.show=function(){this.resizerElem.style.display="block";},It.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else {var m=this.globalData.compSize.w,C=this.globalData.compSize.h,T,B=this.threeDElements.length;for(T=0;TMc});var Tc,Mc,Ml=ls(()=>{qs();Tc=is((exports,module)=>{typeof navigator<"u"&&function(t,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.lottie=e());}(exports,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(t){_useWebWorker=!!t;},getWebWorker=function(){return _useWebWorker},setLocationHref=function(t){locationHref=t;},getLocationHref=function(){return locationHref};function createTag(t){return document.createElement(t)}function extendPrototype(t,e){var i,s=t.length,r;for(i=0;i1?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}var rgbToHex=function(){var t=[],e,i;for(e=0;e<256;e+=1)i=e.toString(16),t[e]=i.length===1?"0"+i:i;return function(s,r,a){return s<0&&(s=0),r<0&&(r=0),a<0&&(a=0),"#"+t[s]+t[r]+t[a]}}(),setSubframeEnabled=function(t){subframeEnabled=!!t;},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(t){expressionsPlugin=t;},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(t){expressionsInterfaces=t;},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(t){defaultCurveSegments=t;},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(t){idPrefix$1=t;};function createNS(t){return document.createElementNS(svgNS,t)}function _typeof$5(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(e){return typeof e}:_typeof$5=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(t)}var dataManager=function(){var t=1,e=[],i,s,r={onmessage:function(){},postMessage:function(l){i({data:l});}},a={postMessage:function(l){r.onmessage({data:l});}};function n(l){if(window.Worker&&window.Blob&&getWebWorker()){var E=new Blob(["var _workerSelf = self; self.onmessage = ",l.toString()],{type:"text/javascript"}),b=URL.createObjectURL(E);return new Worker(b)}return i=l,r}function p(){s||(s=n(function(l){function E(){function v(ht,yt){var D,V,S=ht.length,R,tt,J,Gt;for(V=0;V=0;yt-=1)if(ht[yt].ty==="sh")if(ht[yt].ks.k.i)_(ht[yt].ks.k);else for(S=ht[yt].ks.k.length,V=0;VD[0]?!0:D[0]>ht[0]?!1:ht[1]>D[1]?!0:D[1]>ht[1]?!1:ht[2]>D[2]?!0:D[2]>ht[2]?!1:null}var z=function(){var ht=[4,4,14];function yt(V){var S=V.t.d;V.t.d={k:[{s:S,t:0}]};}function D(V){var S,R=V.length;for(S=0;S=0;S-=1)if(V[S].ty==="sh")if(V[S].ks.k.i)V[S].ks.k.c=V[S].closed;else for(J=V[S].ks.k.length,tt=0;tt500)&&(this._imageLoaded(),clearInterval(g)),f+=1;}.bind(this),50);}function a(u){var f=s(u,this.assetsPath,this.path),g=createNS("image");isSafari?this.testImageLoaded(g):g.addEventListener("load",this._imageLoaded,!1),g.addEventListener("error",function(){_.img=t,this._imageLoaded();}.bind(this),!1),g.setAttributeNS("http://www.w3.org/1999/xlink","href",f),this._elementHelper.append?this._elementHelper.append(g):this._elementHelper.appendChild(g);var _={img:g,assetData:u};return _}function n(u){var f=s(u,this.assetsPath,this.path),g=createTag("img");g.crossOrigin="anonymous",g.addEventListener("load",this._imageLoaded,!1),g.addEventListener("error",function(){_.img=t,this._imageLoaded();}.bind(this),!1),g.src=f;var _={img:g,assetData:u};return _}function p(u){var f={assetData:u},g=s(u,this.assetsPath,this.path);return dataManager.loadData(g,function(_){f.img=_,this._footageLoaded();}.bind(this),function(){f.img={},this._footageLoaded();}.bind(this)),f}function h(u,f){this.imagesLoadedCb=f;var g,_=u.length;for(g=0;g<_;g+=1)u[g].layers||(!u[g].t||u[g].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(u[g]))):u[g].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(u[g]))));}function y(u){this.path=u||"";}function P(u){this.assetsPath=u||"";}function c(u){for(var f=0,g=this.images.length;fthis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e=this.animationData.layers,i,s=e.length,r=t.layers,a,n=r.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(t){this.triggerRenderFrameError(t);}},AnimationItem.prototype.play=function(t){t&&this.name!==t||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},AnimationItem.prototype.pause=function(t){t&&this.name!==t||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(this.isPaused===!0?this.play():this.pause());},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(i=!0,e=0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"));}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart");},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,i!==-1&&this.goToAndStop(i,!0);},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),_typeof$4(t[0])==="object"){var i,s=t.length;for(i=0;i=0;V-=1)e[V].animation.destroy(D);}function W(D,V,S){var R=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),tt,J=R.length;for(tt=0;tt0?_=W:g=W;while(Math.abs(q)>a&&++ot=r?w(f,mt,g,_):gt===0?mt:v(f,z,z+h,g,_)}},t}(),pooling=function(){function t(e){return e.concat(createSizedArray(e.length))}return {double:t}}(),poolFactory=function(){return function(t,e,i){var s=0,r=t,a=createSizedArray(r),n={newElement:p,release:h};function p(){var y;return s?(s-=1,y=a[s]):y=e(),y}function h(y){s===r&&(a=pooling.double(a),r*=2),i&&i(y),a[s]=y,s+=1;}return n}}(),bezierLengthPool=function(){function t(){return {addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,t)}(),segmentsLengthPool=function(){function t(){return {lengths:[],totalLength:0}}function e(i){var s,r=i.lengths.length;for(s=0;s-.001&&f<.001}function i(l,E,b,v,w,u,f,g,_){if(b===0&&u===0&&_===0)return e(l,E,v,w,f,g);var k=t.sqrt(t.pow(v-l,2)+t.pow(w-E,2)+t.pow(u-b,2)),z=t.sqrt(t.pow(f-l,2)+t.pow(g-E,2)+t.pow(_-b,2)),q=t.sqrt(t.pow(f-v,2)+t.pow(g-w,2)+t.pow(_-u,2)),W;return k>z?k>q?W=k-z-q:W=q-z-k:q>z?W=q-z-k:W=z-k-q,W>-1e-4&&W<1e-4}var s=function(){return function(l,E,b,v){var w=getDefaultCurveSegments(),u,f,g,_,k,z=0,q,W=[],ot=[],mt=bezierLengthPool.newElement();for(g=b.length,u=0;uf?-1:1,k=!0;k;)if(v[u]<=f&&v[u+1]>f?(g=(f-v[u])/(v[u+1]-v[u]),k=!1):u+=_,u<0||u>=w-1){if(u===w-1)return b[u];k=!1;}return b[u]+(b[u+1]-b[u])*g}function y(l,E,b,v,w,u){var f=h(w,u),g=1-f,_=t.round((g*g*g*l[0]+(f*g*g+g*f*g+g*g*f)*b[0]+(f*f*g+g*f*f+f*g*f)*v[0]+f*f*f*E[0])*1e3)/1e3,k=t.round((g*g*g*l[1]+(f*g*g+g*f*g+g*g*f)*b[1]+(f*f*g+g*f*f+f*g*f)*v[1]+f*f*f*E[1])*1e3)/1e3;return [_,k]}var P=createTypedArray("float32",8);function c(l,E,b,v,w,u,f){w<0?w=0:w>1&&(w=1);var g=h(w,f);u=u>1?1:u;var _=h(u,f),k,z=l.length,q=1-g,W=1-_,ot=q*q*q,mt=g*q*q*3,gt=g*g*q*3,ut=g*g*g,Ct=q*q*W,ht=g*q*W+q*g*W+q*q*_,yt=g*g*W+q*g*_+g*q*_,D=g*g*_,V=q*W*W,S=g*W*W+q*_*W+q*W*_,R=g*_*W+q*_*_+g*W*_,tt=g*_*_,J=W*W*W,Gt=_*W*W+W*_*W+W*W*_,Vt=_*_*W+W*_*_+_*W*_,Xt=_*_*_;for(k=0;k=y.t-i){h.h&&(h=y),r=0;break}if(y.t-i>t){r=a;break}a=u||t=u?_.points.length-1:0;for(l=_.points[k].point.length,c=0;c=W&&z=u)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=f)s[0]=h.s[0],s[1]=h.s[1],s[2]=h.s[2];else {var ht=createQuaternion(h.s),yt=createQuaternion(g),D=(t-f)/(u-f);quaternionToEuler(s,slerp(ht,yt,D));}else for(a=0;a=u?E=1:t1e-6?(l=Math.acos(E),b=Math.sin(l),v=Math.sin((1-i)*l)/b,w=Math.sin(i*l)/b):(v=1-i,w=i),s[0]=v*r+w*h,s[1]=v*a+w*y,s[2]=v*n+w*P,s[3]=v*p+w*c,s}function quaternionToEuler(t,e){var i=e[0],s=e[1],r=e[2],a=e[3],n=Math.atan2(2*s*a-2*i*r,1-2*s*s-2*r*r),p=Math.asin(2*i*s+2*r*a),h=Math.atan2(2*i*a-2*s*r,1-2*i*i-2*r*r);t[0]=n/degToRads,t[1]=p/degToRads,t[2]=h/degToRads;}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,s=t[2]*degToRads,r=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(s/2),p=Math.sin(e/2),h=Math.sin(i/2),y=Math.sin(s/2),P=r*a*n-p*h*y,c=p*h*n+r*a*y,l=p*a*n+r*h*y,E=r*h*n-p*a*y;return [c,l,E,P]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s;}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if(this.propType==="unidimensional")e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i1e-5&&(this.v[i]=e,this._mdf=!0),i+=1;}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[];break}(!a[s]||a[s]&&!r)&&(a[s]=pointPool.newElement()),a[s][0]=t,a[s][1]=e;},ShapePath.prototype.setTripleAt=function(t,e,i,s,r,a,n,p){this.setXYAt(t,e,"v",n,p),this.setXYAt(i,s,"o",n,p),this.setXYAt(r,a,"i",n,p);},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,r=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),r=1);var a=this._length-1,n=this._length,p;for(p=r;p=ht[ht.length-1].t-this.offsetTime)k=ht[ht.length-1].s?ht[ht.length-1].s[0]:ht[ht.length-2].e[0],q=!0;else {for(var yt=_,D=ht.length-1,V=!0,S,R,tt;V&&(S=ht[yt],R=ht[yt+1],!(R.t-this.offsetTime>u));)yt=R.t-this.offsetTime)ut=1;else if(ug&&u>g)||(this._caching.lastIndex=_0||S>-1e-6&&S<0?s(S*R)/R:S}function V(){var S=this.props,R=D(S[0]),tt=D(S[1]),J=D(S[4]),Gt=D(S[5]),Vt=D(S[12]),Xt=D(S[13]);return "matrix("+R+","+tt+","+J+","+Gt+","+Vt+","+Xt+")"}return function(){this.reset=r,this.rotate=a,this.rotateX=n,this.rotateY=p,this.rotateZ=h,this.skew=P,this.skewFromAxis=c,this.shear=y,this.scale=l,this.setTransform=E,this.translate=b,this.transform=v,this.multiply=w,this.applyToPoint=k,this.applyToX=z,this.applyToY=q,this.applyToZ=W,this.applyToPointArray=Ct,this.applyToTriplePoints=ut,this.applyToPointStringified=ht,this.toCSS=yt,this.to2dCSS=V,this.clone=g,this.cloneFromProps=_,this.equals=f,this.inversePoints=gt,this.inversePoint=mt,this.getInverseMatrix=ot,this._t=this.transform,this.isIdentity=u,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset();}}();function _typeof$3(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(e){return typeof e}:_typeof$3=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(t)}var lottie={};function setLocation(t){setLocationHref(t);}function searchAnimations(){animationManager.searchAnimations();}function setSubframeRendering(t){setSubframeEnabled(t);}function setPrefix(t){setIdPrefix(t);}function loadAnimation(t){return animationManager.loadAnimation(t)}function setQuality(t){if(typeof t=="string")switch(t){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else !isNaN(t)&&t>1&&setDefaultCurveSegments(t);}function inBrowser(){return typeof navigator<"u"}function installPlugin(t,e){t==="expressions"&&setExpressionsPlugin(e);}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations());}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i"u"?"undefined":_typeof$3(exports))==="object"&&typeof module<"u")&&!(typeof define=="function"&&define.amd)&&(window.bodymovin=lottie);}catch(t){}var ShapeModifiers=function(){var t={},e={};t.registerModifier=i,t.getModifier=s;function i(r,a){e[r]||(e[r]=a);}function s(r,a,n){return new e[r](a,n)}return t}();function ShapeModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated();}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0);},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties());},extendPrototype([DynamicPropertyContainer],ShapeModifier);function TrimModifier(){}extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length;},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[];},TrimModifier.prototype.calculateShapeEdges=function(t,e,i,s,r){var a=[];e<=1?a.push({s:t,e}):t>=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n=[],p,h=a.length,y;for(p=0;ps+i)){var P,c;y.s*r<=s?P=0:P=(y.s*r-s)/i,y.e*r>=s+i?c=1:c=(y.e*r-s)/i,n.push([P,c]);}return n.length||n.push([0,0]),n},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e1?e=1+s:this.s.v<0?e=0+s:e=this.s.v+s,this.e.v>1?i=1+s:this.e.v<0?i=0+s:i=this.e.v+s,e>i){var r=e;e=i,i=r;}e=Math.round(e*1e4)*1e-4,i=Math.round(i*1e4)*1e-4,this.sValue=e,this.eValue=i;}else e=this.sValue,i=this.eValue;var a,n,p=this.shapes.length,h,y,P,c,l,E=0;if(i===e)for(n=0;n=0;n-=1)if(v=this.shapes[n],v.shape._mdf){for(w=v.localShapeCollection,w.releaseShapes(),this.m===2&&p>1?(_=this.calculateShapeEdges(e,i,v.totalShapeLength,g,E),g+=v.totalShapeLength):_=[[u,f]],y=_.length,h=0;h=1?b.push({s:v.totalShapeLength*(u-1),e:v.totalShapeLength*(f-1)}):(b.push({s:v.totalShapeLength*u,e:v.totalShapeLength}),b.push({s:0,e:v.totalShapeLength*(f-1)}));var k=this.addShapes(v,b[0]);if(b[0].s!==b[0].e){if(b.length>1){var z=v.shape.paths.shapes[v.shape.paths._length-1];if(z.c){var q=k.pop();this.addPaths(k,w),k=this.addShapes(v,b[1],q);}else this.addPaths(k,w),k=this.addShapes(v,b[1]);}this.addPaths(k,w);}}v.shape.paths=w;}}},TrimModifier.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;ie.e){i.c=!1;break}else e.s<=y&&e.e>=y+P.addedLength?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[p],r[a].v[p],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[p],r[a].o[p-1],r[a].i[p],(e.s-y)/P.addedLength,(e.e-y)/P.addedLength,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1),y+=P.addedLength,c+=1;if(r[a].c&&l.length){if(P=l[p-1],y<=e.e){var u=l[p-1].addedLength;e.s<=y&&e.e>=y+u?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[0],r[a].v[0],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[0],r[a].o[p-1],r[a].i[0],(e.s-y)/u,(e.e-y)/u,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1);}else i.c=!1;y+=P.addedLength,c+=1;}if(i._length&&(i.setXYAt(i.v[v][0],i.v[v][1],"i",v),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),y>e.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(P=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/y,0),c=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/y,0)):(P=this.p.pv,c=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/y,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){P=[],c=[];var l=this.px,E=this.py;l._caching.lastFrame+l.offsetTime<=l.keyframes[0].t?(P[0]=l.getValueAtTime((l.keyframes[0].t+.01)/y,0),P[1]=E.getValueAtTime((E.keyframes[0].t+.01)/y,0),c[0]=l.getValueAtTime(l.keyframes[0].t/y,0),c[1]=E.getValueAtTime(E.keyframes[0].t/y,0)):l._caching.lastFrame+l.offsetTime>=l.keyframes[l.keyframes.length-1].t?(P[0]=l.getValueAtTime(l.keyframes[l.keyframes.length-1].t/y,0),P[1]=E.getValueAtTime(E.keyframes[E.keyframes.length-1].t/y,0),c[0]=l.getValueAtTime((l.keyframes[l.keyframes.length-1].t-.01)/y,0),c[1]=E.getValueAtTime((E.keyframes[E.keyframes.length-1].t-.01)/y,0)):(P=[l.pv,E.pv],c[0]=l.getValueAtTime((l._caching.lastFrame+l.offsetTime-.01)/y,l.offsetTime),c[1]=E.getValueAtTime((E._caching.lastFrame+E.offsetTime-.01)/y,E.offsetTime));}else c=t,P=c;this.v.rotate(-Math.atan2(P[1]-c[1],P[0]-c[0]));}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);}this.frameId=this.elem.globalData.frameId;}}function s(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4);}function r(){}function a(h){this._addDynamicProperty(h),this.elem.addDynamicProperty(h),this._isDirty=!0;}function n(h,y,P){if(this.elem=h,this.frameId=-1,this.propType="transform",this.data=y,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(P||h),y.p&&y.p.s?(this.px=PropertyFactory.getProp(h,y.p.x,0,0,this),this.py=PropertyFactory.getProp(h,y.p.y,0,0,this),y.p.z&&(this.pz=PropertyFactory.getProp(h,y.p.z,0,0,this))):this.p=PropertyFactory.getProp(h,y.p||{k:[0,0,0]},1,0,this),y.rx){if(this.rx=PropertyFactory.getProp(h,y.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(h,y.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(h,y.rz,0,degToRads,this),y.or.k[0].ti){var c,l=y.or.k.length;for(c=0;c0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0);},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e0?Math.floor(l):Math.ceil(l),v=this.pMatrix.props,w=this.rMatrix.props,u=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var f=0;if(l>0){for(;fb;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),f-=1;E&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-E,!0),f-=E);}s=this.data.m===1?0:this._currentCopies-1,r=this.data.m===1?1:-1,a=this._currentCopies;for(var g,_;a;){if(e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,_=i.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),f!==0){for((s!==0&&r===1||s!==this._currentCopies-1&&r===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],w[8],w[9],w[10],w[11],w[12],w[13],w[14],w[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),g=0;g<_;g+=1)i[g]=this.matrix.props[g];this.matrix.reset();}else for(this.matrix.reset(),g=0;g<_;g+=1)i[g]=this.matrix.props[g];f+=1,a-=1,s+=r;}}else for(a=this._currentCopies,s=0,r=1;a;)e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,s+=r;return n},RepeaterModifier.prototype.addShape=function(){};function RoundCornersModifier(){}extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length;},RoundCornersModifier.prototype.processPath=function(t,e){var i=shapePool.newElement();i.c=t.c;var s,r=t._length,a,n,p,h,y,P,c=0,l,E,b,v,w,u;for(s=0;s0&&s<1?[e]:[]:[e-s,e+s].filter(function(r){return r>0&&r<1})},PolynomialBezier.prototype.split=function(t){if(t<=0)return [singlePoint(this.points[0]),this];if(t>=1)return [this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),i=lerpPoint(this.points[1],this.points[2],t),s=lerpPoint(this.points[2],this.points[3],t),r=lerpPoint(e,i,t),a=lerpPoint(i,s,t),n=lerpPoint(r,a,t);return [new PolynomialBezier(this.points[0],e,r,n,!0),new PolynomialBezier(n,a,s,this.points[3],!0)]};function extrema(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var r=s;s=i,i=r;}for(var a=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),n=0;n0&&a[n]<1){var p=t.point(a[n])[e];ps&&(s=p);}return {min:i,max:s}}PolynomialBezier.prototype.bounds=function(){return {x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return {left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}};function intersectData(t,e,i){var s=t.boundingBox();return {cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function splitData(t){var e=t.bez.split(.5);return [intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return Math.abs(t.cx-e.cx)*2=a||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s){r.push([t.t,e.t]);return}var n=splitData(t),p=splitData(e);intersectsImpl(n[0],p[0],i+1,s,r,a),intersectsImpl(n[0],p[1],i+1,s,r,a),intersectsImpl(n[1],p[0],i+1,s,r,a),intersectsImpl(n[1],p[1],i+1,s,r,a);}}PolynomialBezier.prototype.intersections=function(t,e,i){e===void 0&&(e=2),i===void 0&&(i=7);var s=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,s,i),s},PolynomialBezier.shapeSegment=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[i],t.v[i],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[i],t.i[i],t.o[e],t.v[e],!0)};function crossProduct(t,e){return [t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,i,s){var r=[t[0],t[1],1],a=[e[0],e[1],1],n=[i[0],i[1],1],p=[s[0],s[1],1],h=crossProduct(crossProduct(r,a),crossProduct(n,p));return floatZero(h[2])?null:[h[0]/h[2],h[1]/h[2]]}function polarOffset(t,e,i){return [t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0;};function setPoint(t,e,i,s,r,a,n){var p=i-Math.PI/2,h=i+Math.PI/2,y=e[0]+Math.cos(i)*s*r,P=e[1]-Math.sin(i)*s*r;t.setTripleAt(y,P,y+Math.cos(p)*a,P-Math.sin(p)*a,y+Math.cos(h)*n,P-Math.sin(h)*n,t.length());}function getPerpendicularVector(t,e){var i=[e[0]-t[0],e[1]-t[1]],s=-Math.PI*.5,r=[Math.cos(s)*i[0]-Math.sin(s)*i[1],Math.sin(s)*i[0]+Math.cos(s)*i[1]];return r}function getProjectingAngle(t,e){var i=e===0?t.length()-1:e-1,s=(e+1)%t.length(),r=t.v[i],a=t.v[s],n=getPerpendicularVector(r,a);return Math.atan2(0,1)-Math.atan2(n[1],n[0])}function zigZagCorner(t,e,i,s,r,a,n){var p=getProjectingAngle(e,i),h=e.v[i%e._length],y=e.v[i===0?e._length-1:i-1],P=e.v[(i+1)%e._length],c=a===2?Math.sqrt(Math.pow(h[0]-y[0],2)+Math.pow(h[1]-y[1],2)):0,l=a===2?Math.sqrt(Math.pow(h[0]-P[0],2)+Math.pow(h[1]-P[1],2)):0;setPoint(t,e.v[i%e._length],p,n,s,l/((r+1)*2),c/((r+1)*2));}function zigZagSegment(t,e,i,s,r,a){for(var n=0;n1&&e.length>1&&(r=getIntersection(t[0],e[e.length-1]),r)?[[t[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[i,s]}function pruneIntersections(t){for(var e,i=1;i1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var i=t.inflectionPoints(),s,r,a,n;if(i.length===0)return [offsetSegment(t,e)];if(i.length===1||floatEqual(i[1],1))return a=t.split(i[0]),s=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(r,e)];a=t.split(i[0]),s=a[0];var p=(i[1]-i[0])/(1-i[0]);return a=a[1].split(p),n=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(n,e),offsetSegment(r,e)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(t,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=this.amount.effectsSequence.length!==0;},OffsetPathModifier.prototype.processPath=function(t,e,i,s){var r=shapePool.newElement();r.c=t.c;var a=t.length();t.c||(a-=1);var n,p,h,y=[];for(n=0;n=0;n-=1)h=PolynomialBezier.shapeSegmentInverted(t,n),y.push(offsetSegmentSplit(h,e));y=pruneIntersections(y);var P=null,c=null;for(n=0;n0&&(Gt=!1),Gt){var Ht=createTag("style");Ht.setAttribute("f-forigin",S[R].fOrigin),Ht.setAttribute("f-origin",S[R].origin),Ht.setAttribute("f-family",S[R].fFamily),Ht.type="text/css",Ht.innerText="@font-face {font-family: "+S[R].fFamily+"; font-style: normal; src: url('"+S[R].fPath+"');}",V.appendChild(Ht);}}else if(S[R].fOrigin==="g"||S[R].origin===1){for(Vt=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),Xt=0;Xt=55296&&S<=56319){var R=D.charCodeAt(1);R>=56320&&R<=57343&&(V=(S-55296)*1024+R-56320+65536);}return V}function z(D,V){var S=D.toString(16)+V.toString(16);return c.indexOf(S)!==-1}function q(D){return D===h}function W(D){return D===p}function ot(D){var V=k(D);return V>=y&&V<=P}function mt(D){return ot(D.substr(0,2))&&ot(D.substr(2,2))}function gt(D){return i.indexOf(D)!==-1}function ut(D,V){var S=k(D.substr(V,2));if(S!==s)return !1;var R=0;for(V+=2;R<5;){if(S=k(D.substr(V,2)),Sn)return !1;R+=1,V+=2;}return k(D.substr(V,2))===r}function Ct(){this.isLoaded=!0;}var ht=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this);};ht.isModifier=z,ht.isZeroWidthJoiner=q,ht.isFlagEmoji=mt,ht.isRegionalCode=ot,ht.isCombinedCharacter=gt,ht.isRegionalFlag=ut,ht.isVariationSelector=W,ht.BLACK_FLAG_CODE_POINT=s;var yt={addChars:u,addFonts:w,getCharData:f,getFontByName:_,measureText:g,checkLoadedFonts:b,setIsLoaded:Ct};return ht.prototype=yt,ht}();function SlotManager(t){this.animationData=t;}SlotManager.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t};function slotFactory(t){return new SlotManager(t)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[];},addRenderableComponent:function(t){this.renderableComponents.indexOf(t)===-1&&this.renderableComponents.push(t);},removeRenderableComponent:function(t){this.renderableComponents.indexOf(t)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1);},prepareRenderableFrame:function(t){this.checkLayerLimits(t);},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show());},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide());},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0));},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1;},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1;},AudioElement.prototype.resume=function(){this._canPlay=!0;},AudioElement.prototype.setRate=function(t){this.audio.rate(t);},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume);},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(t){var e,i=this.layers.length,s;for(this.completeLayers=!0,e=i-1;e>=0;e-=1)this.elements[e]||(s=this.layers[e],s.ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements();},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",l),this.element.maskedElement.setAttribute(f,"url("+getLocationHref()+"#"+l+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this);}MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e=this.element.finalTransform.mat,i,s=this.masksProperties.length;for(i=0;i1&&(s+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==s){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+s:s),i.elem.setAttribute("d",n)),i.lastPath=s;}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null;};var filtersFactory=function(){var t={};t.createFilter=e,t.createAlphaToLuminanceFilter=i;function e(s,r){var a=createNS("filter");return a.setAttribute("id",s),r!==!0&&(a.setAttribute("filterUnits","objectBoundingBox"),a.setAttribute("x","0%"),a.setAttribute("y","0%"),a.setAttribute("width","100%"),a.setAttribute("height","100%")),a}function i(){var s=createNS("feColorMatrix");return s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),s}return t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return (/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(t){var e,i="SourceGraphic",s=t.data.ef?t.data.ef.length:0,r=createElementID(),a=filtersFactory.createFilter(r,!0),n=0;this.filters=[];var p;for(e=0;e=0&&(i=this.shapeModifiers[t].processShapes(this._isFirstFrame),!i);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i.01)return !1;i+=1;}return !0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return !1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t0;)u=l.transformers[ot].mProps._mdf||u,W-=1,ot-=1;if(u)for(W=k-l.styles[g].lvl,ot=l.transformers.length-1;W>0;)q.multiply(l.transformers[ot].mProps.v),W-=1,ot-=1;}else q=t;if(z=l.sh.paths,v=z._length,u){for(w="",b=0;b=1?Ct=.99:Ct<=-1&&(Ct=-.99);var ht=gt*Ct,yt=Math.cos(ut+l.a.v)*ht+w[0],D=Math.sin(ut+l.a.v)*ht+w[1];b.setAttribute("fx",yt),b.setAttribute("fy",D),v&&!l.g._collapsable&&(l.of.setAttribute("fx",yt),l.of.setAttribute("fy",D));}}}function P(c,l,E){var b=l.style,v=l.d;v&&(v._mdf||E)&&v.dashStr&&(b.pElem.setAttribute("stroke-dasharray",v.dashStr),b.pElem.setAttribute("stroke-dashoffset",v.dashoffset[0])),l.c&&(l.c._mdf||E)&&b.pElem.setAttribute("stroke","rgb("+bmFloor(l.c.v[0])+","+bmFloor(l.c.v[1])+","+bmFloor(l.c.v[2])+")"),(l.o._mdf||E)&&b.pElem.setAttribute("stroke-opacity",l.o.v),(l.w._mdf||E)&&(b.pElem.setAttribute("stroke-width",l.w.v),b.msElem&&b.msElem.setAttribute("stroke-width",l.w.v));}return i}();function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[];}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e=this.shapes.length,i,s,r=this.stylesList.length,a,n=[],p=!1;for(s=0;s1&&p&&this.setShapesAsAnimated(n);}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e=0;h-=1){if(w=this.searchProcessedElement(t[h]),w?e[h]=i[w-1]:t[h]._render=n,t[h].ty==="fl"||t[h].ty==="st"||t[h].ty==="gf"||t[h].ty==="gs"||t[h].ty==="no")w?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],r),t[h]._render&&e[h].style.pElem.parentNode!==s&&s.appendChild(e[h].style.pElem),l.push(e[h].style);else if(t[h].ty==="gr"){if(!w)e[h]=this.createGroupElement(t[h]);else for(c=e[h].it.length,P=0;P1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this);},TextProperty.prototype.getValue=function(t){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!t)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var s,r=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(s=0;se);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e=[],i=0,s=t.length,r,a,n=!1,p=!1,h="";i=55296&&r<=56319?FontManager.isRegionalFlag(t,i)?h=t.substr(i,14):(a=t.charCodeAt(i+1),a>=56320&&a<=57343&&(FontManager.isModifier(r,a)?(h=t.substr(i,2),n=!0):FontManager.isFlagEmoji(t.substr(i,4))?h=t.substr(i,4):h=t.substr(i,2))):r>56319?(a=t.charCodeAt(i+1),FontManager.isVariationSelector(r)&&(n=!0)):FontManager.isZeroWidthJoiner(r)&&(n=!0,p=!0),n?(e[e.length-1]+=h,n=!1):e.push(h),i+=h.length;return e},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e=this.elem.globalData.fontManager,i=this.data,s=[],r,a,n,p=0,h,y=i.m.g,P=0,c=0,l=0,E=[],b=0,v=0,w,u,f=e.getFontByName(t.f),g,_=0,k=getFontProperties(f);t.fWeight=k.weight,t.fStyle=k.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),a=t.finalText.length,t.finalLineHeight=t.lh;var z=t.tr/1e3*t.finalSize,q;if(t.sz)for(var W=!0,ot=t.sz[0],mt=t.sz[1],gt,ut;W;){ut=this.buildFinalText(t.t),gt=0,b=0,a=ut.length,z=t.tr/1e3*t.finalSize;var Ct=-1;for(r=0;rot&&ut[r]!==" "?(Ct===-1?a+=1:r=Ct,gt+=t.finalLineHeight||t.finalSize*1.2,ut.splice(r,Ct===r?1:0,"\r"),Ct=-1,b=0):(b+=_,b+=z);gt+=f.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&mtv?b:v,b=-2*z,h="",n=!0,l+=1):h=yt,e.chars?(g=e.getCharData(yt,f.fStyle,e.getFontByName(t.f).fFamily),_=n?0:g.w*t.finalSize/100):_=e.measureText(h,t.f,t.finalSize),yt===" "?ht+=_+z:(b+=_+z+ht,ht=0),s.push({l:_,an:_,add:P,n,anIndexes:[],val:h,line:l,animatorJustifyOffset:0}),y==2){if(P+=_,h===""||h===" "||r===a-1){for((h===""||h===" ")&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;p+=1,P=0;}}else if(y==3){if(P+=_,h===""||r===a-1){for(h===""&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;P=0,p+=1;}}else s[p].ind=p,s[p].extra=0,p+=1;if(t.l=s,v=b>v?b:v,E.push(b),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0;}t.lineWidths=E;var D=i.a,V,S;u=D.length;var R,tt,J=[];for(w=0;w0?n=this.ne.v/100:p=-this.ne.v/100,this.xe.v>0?h=1-this.xe.v/100:y=1+this.xe.v/100;var P=BezierFactory.getBezierEasing(n,p,h,y).get,c=0,l=this.finalS,E=this.finalE,b=this.data.sh;if(b===2)E===l?c=a>=E?1:0:c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===3)E===l?c=a>=E?0:1:c=1-t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===4)E===l?c=0:(c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c<.5?c*=2:c=1-2*(c-.5)),c=P(c);else if(b===5){if(E===l)c=0;else {var v=E-l;a=e(t(0,a+.5-l),E-l);var w=-v/2+a,u=v/2;c=Math.sqrt(1-w*w/(u*u));}c=P(c);}else b===6?(E===l?c=0:(a=e(t(0,a+.5-l),E-l),c=(1+Math.cos(Math.PI+Math.PI*2*a/(E-l)))/2),c=P(c)):(a>=i(l)&&(a-l<0?c=t(0,e(e(E,1)-(l-a),1)):c=t(0,e(E-a,1))),c=P(c));if(this.sm.v!==100){var f=this.sm.v*.01;f===0&&(f=1e-8);var g=.5-f*.5;c1&&(c=1));}return c*this.a.v},getValue:function(a){this.iterateDynamicProperties(),this._mdf=a||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,a&&this.data.r===2&&(this.e.v=this._currentTextLength);var n=this.data.r===2?1:100/this.data.totalChars,p=this.o.v/n,h=this.s.v/n+p,y=this.e.v/n+p;if(h>y){var P=h;h=y,y=P;}this.finalS=h,this.finalE=y;}},extendPrototype([DynamicPropertyContainer],s);function r(a,n,p){return new s(a,n)}return {getTextSelectorProp:r}}();function TextAnimatorDataProperty(t,e,i){var s={propType:!1},r=PropertyFactory.getProp,a=e.a;this.a={r:a.r?r(t,a.r,0,degToRads,i):s,rx:a.rx?r(t,a.rx,0,degToRads,i):s,ry:a.ry?r(t,a.ry,0,degToRads,i):s,sk:a.sk?r(t,a.sk,0,degToRads,i):s,sa:a.sa?r(t,a.sa,0,degToRads,i):s,s:a.s?r(t,a.s,1,.01,i):s,a:a.a?r(t,a.a,1,0,i):s,o:a.o?r(t,a.o,0,.01,i):s,p:a.p?r(t,a.p,1,0,i):s,sw:a.sw?r(t,a.sw,0,0,i):s,sc:a.sc?r(t,a.sc,1,0,i):s,fc:a.fc?r(t,a.fc,1,0,i):s,fh:a.fh?r(t,a.fh,0,0,i):s,fs:a.fs?r(t,a.fs,0,.01,i):s,fb:a.fb?r(t,a.fb,0,.01,i):s,t:a.t?r(t,a.t,0,0,i):s},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t;}function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i);}TextAnimatorProperty.prototype.searchProperties=function(){var t,e=this._textData.a.length,i,s=PropertyFactory.getProp;for(t=0;t=b+oe||!k?(ot=(b+oe-w)/v.partialLength,Xt=_.point[0]+(v.point[0]-_.point[0])*ot,Ht=_.point[1]+(v.point[1]-_.point[1])*ot,a.translate(-i[0]*l[P].an*.005,-(i[1]*ht)*.01),u=!1):k&&(w+=v.partialLength,f+=1,f>=k.length&&(f=0,g+=1,z[g]?k=z[g].points:gt.v.c?(f=0,g=0,k=z[g].points):(w-=v.partialLength,k=null)),k&&(_=v,v=k[f],q=v.partialLength));Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0);}else Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0),a.translate(-i[0]*l[P].an*.005,-i[1]*ht*.01,0);for(S=0;St?this.textSpans[t].span:createNS(p?"g":"text"),g<=t){if(h.setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=h,p){var k=createNS("g");h.appendChild(k),this.textSpans[t].childSpan=k;}this.textSpans[t].span=h,this.layerElement.appendChild(h);}h.style.display="inherit";}if(y.reset(),c&&(n[t].n&&(l=-v,E+=i.yOffset,E+=b?1:0,b=!1),this.applyTextPropertiesToMatrix(i,y,n[t].line,l,E),l+=n[t].l||0,l+=v),p){_=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily);var z;if(_.t===1)z=new SVGCompElement(_.data,this.globalData,this);else {var q=emptyShapeData;_.data&&_.data.shapes&&(q=this.buildShapeData(_.data,i.finalSize)),z=new SVGShapeElement(q,this.globalData,this);}if(this.textSpans[t].glyph){var W=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(W.layerElement),W.destroy();}this.textSpans[t].glyph=z,z._debug=!0,z.prepareFrame(0),z.renderFrame(),this.textSpans[t].childSpan.appendChild(z.layerElement),_.t===1&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")");}else c&&h.setAttribute("transform","translate("+y.props[12]+","+y.props[13]+")"),h.textContent=n[t].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");}c&&h&&h.setAttribute("d",P);}for(;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0));}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t0&&h<1&&r[l].push(this.calculateF(h,t,e,i,s,l))):(y=n*n-4*p*a,y>=0&&(P=(-n+bmSqrt(y))/(2*a),P>0&&P<1&&r[l].push(this.calculateF(P,t,e,i,s,l)),c=(-n-bmSqrt(y))/(2*a),c>0&&c<1&&r[l].push(this.calculateF(c,t,e,i,s,l)))));this.shapeBoundingBox.left=bmMin.apply(null,r[0]),this.shapeBoundingBox.top=bmMin.apply(null,r[1]),this.shapeBoundingBox.right=bmMax.apply(null,r[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,r[1]);},HShapeElement.prototype.calculateF=function(t,e,i,s,r,a){return bmPow(1-t,3)*e[a]+3*bmPow(1-t,2)*t*i[a]+3*(1-t)*bmPow(t,2)*s[a]+bmPow(t,3)*r[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var i,s=t.length;for(i=0;ii&&(i=r);}i*=t.mult;}else i=t.v*t.mult;e.x-=i,e.xMax+=i,e.y-=i,e.yMax+=i;},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax=0;e-=1){var s=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-s.p.v[0],-s.p.v[1],s.p.v[2]),this.mat.rotateX(-s.or.v[0]).rotateY(-s.or.v[1]).rotateZ(s.or.v[2]),this.mat.rotateX(-s.rx.v).rotateY(-s.ry.v).rotateZ(s.rz.v),this.mat.scale(1/s.s.v[0],1/s.s.v[1],1/s.s.v[2]),this.mat.translate(s.a.v[0],s.a.v[1],s.a.v[2]);}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var r;this.p?r=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:r=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)),n=[r[0]/a,r[1]/a,r[2]/a],p=Math.sqrt(n[2]*n[2]+n[0]*n[0]),h=Math.atan2(n[1],p),y=Math.atan2(n[0],-n[2]);this.mat.rotateY(y).rotateX(-h);}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var P=!this._prevMat.equals(this.mat);if((P||this.pe._mdf)&&this.comp.threeDElements){i=this.comp.threeDElements.length;var c,l,E;for(e=0;e=t)return this.threeDElements[e].perspectiveElem;e+=1;}return null},HybridRendererBase.prototype.createThreeDContainer=function(t,e){var i=createTag("div"),s,r;styleDiv(i);var a=createTag("div");if(styleDiv(a),e==="3d"){s=i.style,s.width=this.globalData.compSize.w+"px",s.height=this.globalData.compSize.h+"px";var n="50% 50%";s.webkitTransformOrigin=n,s.mozTransformOrigin=n,s.transformOrigin=n,r=a.style;var p="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";r.transform=p,r.webkitTransform=p;}i.appendChild(a);var h={container:a,perspectiveElem:i,startPos:t,endPos:t,type:e};return this.threeDElements.push(h),h},HybridRendererBase.prototype.build3dContainers=function(){var t,e=this.layers.length,i,s="";for(t=0;t=0;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem);},HybridRendererBase.prototype.addTo3dContainer=function(t,e){for(var i=0,s=this.threeDElements.length;ii?(r=t/this.globalData.compSize.w,a=t/this.globalData.compSize.w,n=0,p=(e-this.globalData.compSize.h*(t/this.globalData.compSize.w))/2):(r=e/this.globalData.compSize.h,a=e/this.globalData.compSize.h,n=(t-this.globalData.compSize.w*(e/this.globalData.compSize.h))/2,p=0);var h=this.resizerElem.style;h.webkitTransform="matrix3d("+r+",0,0,0,0,"+a+",0,0,0,0,1,0,"+n+","+p+",0,1)",h.transform=h.webkitTransform;},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none";},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block";},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else {var t=this.globalData.compSize.w,e=this.globalData.compSize.h,i,s=this.threeDElements.length;for(i=0;i=y;)mt/=2,gt/=2,ut>>>=1;return (mt+ut)/gt};return ot.int32=function(){return W.g(4)|0},ot.quick=function(){return W.g(4)/4294967296},ot.double=ot,w(f(W.S),t),(_.pass||k||function(mt,gt,ut,Ct){return Ct&&(Ct.S&&b(Ct,W),mt.state=function(){return b(W,{})}),ut?(e[n]=mt,gt):mt})(ot,q,"global"in _?_.global:this==e,_.state)}e["seed"+n]=l;function E(g){var _,k=g.length,z=this,q=0,W=z.i=z.j=0,ot=z.S=[];for(k||(g=[k++]);qi){var s=i;i=e,e=s;}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if(typeof t=="number"||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var i,s=Math.min(t.length,e.length),r=0;for(i=0;i.5?y/(2-r-a):y/(r+a),r){case e:n=(i-s)/y+(i1&&(i-=1),i<1/6?t+(e-t)*6*i:i<1/2?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e=t[0],i=t[1],s=t[2],r,a,n;if(i===0)r=s,n=s,a=s;else {var p=s<.5?s*(1+i):s+i-s*i,h=2*s-p;r=hue2rgb(h,p,e+1/3),a=hue2rgb(h,p,e),n=hue2rgb(h,p,e-1/3);}return [r,a,n,t[3]]}function linear(t,e,i,s,r){if((s===void 0||r===void 0)&&(s=e,r=i,e=0,i=1),i=i)return r;var n=i===e?0:(t-e)/(i-e);if(!s.length)return s+(r-s)*n;var p,h=s.length,y=createTypedArray("float32",h);for(p=0;p1){for(r=0;r1?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(r)){var p,h=r.length,y=createTypedArray("float32",h);for(p=0;pdata.k[e].t&&tdata.k[e+1].t-t?(s=e+2,r=data.k[e+1].t):(s=e+1,r=data.k[e].t);break}s===-1&&(s=e+1,r=data.k[e].t);}var a={};return a.index=s,a.time=r/elem.comp.globalData.frameRate,a}function key(t){var e,i,s;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(s=r.length,i=0;iw.length-1)&&(E=w.length-1),g=w[w.length-1-E].t,f=u-g);var _,k,z;if(l==="pingpong"){var q=Math.floor((v-g)/f);if(q%2!==0)return this.getValueAtTime((f-(v-g)%f+g)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(g/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(u/this.comp.globalData.frameRate,0),mt=this.getValueAtTime(((v-g)%f+g)/this.comp.globalData.frameRate,0),gt=Math.floor((v-g)/f);if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_=u)return this.pv;var f,g;b?(E?f=Math.abs(this.elem.comp.globalData.frameRate*E):f=Math.max(0,this.elem.data.op-u),g=u+f):((!E||E>w.length-1)&&(E=w.length-1),g=w[E].t,f=g-u);var _,k,z;if(l==="pingpong"){var q=Math.floor((u-v)/f);if(q%2===0)return this.getValueAtTime(((u-v)%f+u)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(u/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(g/this.comp.globalData.frameRate,0),mt=this.getValueAtTime((f-(u-v)%f+u)/this.comp.globalData.frameRate,0),gt=Math.floor((u-v)/f)+1;if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_1?(w-v)/(E-1):1,f=0,g=0,_;this.pv.length?_=createTypedArray("float32",this.pv.length):_=0;for(var k;fu){var z=f,q=b.c&&f===g-1?0:f+1,W=(u-_)/w[f].addedLength;k=bez.getPointInSegment(b.v[z],b.v[q],b.o[z],b.i[q],W,w[f]);break}else _+=w[f].addedLength;f+=1;}return k||(k=b.c?[b.v[0][0],b.v[0][1]]:[b.v[b._length-1][0],b.v[b._length-1][1]]),k},vectorOnPath:function(l,E,b){l==1?l=this.v.c:l==0&&(l=.999);var v=this.pointOnPath(l,E),w=this.pointOnPath(l+.001,E),u=w[0]-v[0],f=w[1]-v[1],g=Math.sqrt(Math.pow(u,2)+Math.pow(f,2));if(g===0)return [0,0];var _=b==="tangent"?[u/g,f/g]:[-f/g,u/g];return _},tangentOnPath:function(l,E){return this.vectorOnPath(l,E,"tangent")},normalOnPath:function(l,E){return this.vectorOnPath(l,E,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([P],h),extendPrototype([P],y),y.prototype.getValueAtTime=p,y.prototype.initiateExpression=ExpressionManager.initiateExpression;var c=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(l,E,b,v,w){var u=c(l,E,b,v,w);return u.propertyIndex=E.ix,u.lock=!1,b===3?expressionHelpers.searchExpressions(l,E.pt,u):b===4&&expressionHelpers.searchExpressions(l,E.ks,u),u.k&&l.addDynamicProperty(u),u};}function initialize$1(){addPropertyDecorator();}function addDecorator(){function t(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(e,i){var s=this.calculateExpression(i);if(e.t!==s){var r={};return this.copyData(r,e),r.t=s.toString(),r.__complete=!1,r}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),i=this.searchExpressions();return this.kf=e||i,this.kf},TextProperty.prototype.searchExpressions=t;}function initialize(){addDecorator();}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function t(e,i){var s=createNS("feMerge");s.setAttribute("result",e);var r,a;for(a=0;a=y?c=b<0?s:r:c=s+E*Math.pow((p-t)/b,1/i),P[l]=c,l+=1,a+=256/(n-1);return P.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e));}};function SVGDropShadowEffect(t,e,i,s,r){var a=e.container.globalData.renderConfig.filterSize,n=e.data.fs||a;t.setAttribute("x",n.x||a.x),t.setAttribute("y",n.y||a.y),t.setAttribute("width",n.width||a.width),t.setAttribute("height",n.height||a.height),this.filterManager=e;var p=createNS("feGaussianBlur");p.setAttribute("in","SourceAlpha"),p.setAttribute("result",s+"_drop_shadow_1"),p.setAttribute("stdDeviation","0"),this.feGaussianBlur=p,t.appendChild(p);var h=createNS("feOffset");h.setAttribute("dx","25"),h.setAttribute("dy","0"),h.setAttribute("in",s+"_drop_shadow_1"),h.setAttribute("result",s+"_drop_shadow_2"),this.feOffset=h,t.appendChild(h);var y=createNS("feFlood");y.setAttribute("flood-color","#00ff00"),y.setAttribute("flood-opacity","1"),y.setAttribute("result",s+"_drop_shadow_3"),this.feFlood=y,t.appendChild(y);var P=createNS("feComposite");P.setAttribute("in",s+"_drop_shadow_3"),P.setAttribute("in2",s+"_drop_shadow_2"),P.setAttribute("operator","in"),P.setAttribute("result",s+"_drop_shadow_4"),t.appendChild(P);var c=this.createMergeNode(s,[s+"_drop_shadow_4",r]);t.appendChild(c);}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(e[0]*255),Math.round(e[1]*255),Math.round(e[2]*255)));}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,s=(this.filterManager.effectElements[2].p.v-90)*degToRads,r=i*Math.cos(s),a=i*Math.sin(s);this.feOffset.setAttribute("dx",r),this.feOffset.setAttribute("dy",a);}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=i,i.matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement;}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,i=_svgMatteSymbols.length;e{An();qn();Tn();ca();wc={name:"@dotlottie/common",version:"0.7.11",type:"module",description:"",author:"Afsal , Sam Osborne ",license:"MIT",engines:{node:">18.0.0"},module:"dist/index.js",main:"dist/index.js",types:"dist/index.d.ts",files:["dist"],keywords:[],scripts:{build:"tsup",dev:"tsup --watch",lint:"eslint .","type-check":"tsc --noEmit"},dependencies:{"@dotlottie/dotlottie-js":"^0.7.0","@preact/signals-core":"^1.2.3",howler:"^2.2.3","lottie-web":"^5.12.2",xstate:"^4.38.1"},devDependencies:{"@lottiefiles/lottie-types":"^1.2.0","@types/howler":"^2.2.8",tsup:"^7.2.0",typescript:"^4.7.4"},publishConfig:{access:"public"}},sr=(t=>(t.Complete="complete",t.DataFail="data_fail",t.DataReady="data_ready",t.Error="error",t.Frame="frame",t.Freeze="freeze",t.LoopComplete="loopComplete",t.Pause="pause",t.Play="play",t.Ready="ready",t.Stop="stop",t.VisibilityChange="visibilityChange",t))(sr||{}),Ir=(t=>(t.Completed="completed",t.Error="error",t.Fetching="fetching",t.Frozen="frozen",t.Initial="initial",t.Loading="loading",t.Paused="paused",t.Playing="playing",t.Ready="ready",t.Stopped="stopped",t))(Ir||{}),exports.PlayMode=(t=>(t.Bounce="bounce",t.Normal="normal",t))(exports.PlayMode||{}),cs={autoplay:!1,direction:1,hover:!1,intermission:0,loop:!1,playMode:"normal",speed:1,defaultTheme:""},Wn={activeStateId:"",autoplay:!1,currentState:"initial",frame:0,seeker:0,direction:1,hover:!1,loop:!1,playMode:"normal",speed:1,background:"transparent",intermission:0,currentAnimationId:void 0,visibilityPercentage:0},Xn=class{_lottie;_src;_animationConfig;_prevUserPlaybackOptions={};_userPlaybackOptions;_hover=!1;_loop=!1;_counter=0;_intermission=0;_counterInterval=null;_container=null;_name;_mode="normal";_background="transparent";_animation;_defaultTheme;_activeAnimationId;_currentAnimationId;_testId;_listeners=new Map;_currentState="initial";_stateBeforeFreeze="initial";state=new Bh(Wn);_light=!1;_worker=!1;_dotLottieLoader=new Dh;_activeStateId;_inInteractiveMode=!1;_scrollTicking=!1;_scrollCallback=void 0;_onShowIntersectionObserver=void 0;_visibilityPercentage=0;_audios=[];_stateMachineManager;constructor(t,e,i){typeof t=="string"?this._src=t:this._src=Ua(t),i!=null&&i.testId&&(this._testId=i.testId),this._defaultTheme=(i==null?void 0:i.defaultTheme)||"",this._userPlaybackOptions=this._validatePlaybackOptions(i||{}),typeof(i==null?void 0:i.activeAnimationId)=="string"&&(this._activeAnimationId=i.activeAnimationId),this._container=e||null,typeof(i==null?void 0:i.background)=="string"&&this.setBackground(i.background),typeof(i==null?void 0:i.activeStateId)<"u"&&(this._activeStateId=i.activeStateId);let{rendererSettings:s,...r}=i||{};this._animationConfig={loop:!1,autoplay:!1,renderer:"svg",rendererSettings:{clearCanvas:!0,progressiveLoad:!0,hideOnTransparent:!0,filterSize:{width:"200%",height:"200%",x:"-50%",y:"-50%"},...s},...r},i!=null&&i.light&&(this._light=i.light),i!=null&&i.worker&&(this._worker=i.worker),this._listenToHover(),this._listenToVisibilityChange();}_listenToHover(){var t,e,i,s;let r=()=>{this._hover&&this.currentState!=="playing"&&this.play();},a=()=>{this._hover&&this.currentState==="playing"&&this.stop();};(t=this._container)==null||t.removeEventListener("mouseenter",r),(e=this._container)==null||e.removeEventListener("mouseleave",a),(i=this._container)==null||i.addEventListener("mouseleave",a),(s=this._container)==null||s.addEventListener("mouseenter",r);}_onVisibilityChange(){!this._lottie||typeof document>"u"||(document.hidden&&this.currentState==="playing"?this.freeze():this.currentState==="frozen"&&this.unfreeze());}_listenToVisibilityChange(){typeof document<"u"&&typeof document.hidden<"u"&&document.addEventListener("visibilitychange",()=>this._onVisibilityChange());}_getOption(t){var e;if(typeof this._userPlaybackOptions[t]<"u")return this._userPlaybackOptions[t];let i=(e=this._dotLottieLoader.manifest)==null?void 0:e.animations.find(s=>s.id===this._currentAnimationId);return i&&typeof i[t]<"u"?i[t]:cs[t]}_getPlaybackOptions(){let t={};for(let e in cs)typeof cs[e]<"u"&&(t[e]=this._getOption(e));return t}_setPlayerState(t){var e,i,s;let r=t(this._getPlaybackOptions());try{fo._parse(r);}catch{li(`Invalid PlaybackOptions, ${JSON.stringify(r,null,2)}`);return}typeof r.defaultTheme<"u"&&(this._defaultTheme=r.defaultTheme),typeof r.playMode<"u"&&(this._mode=r.playMode),typeof r.intermission<"u"&&(this._intermission=r.intermission),typeof r.hover<"u"&&(this._hover=r.hover),typeof r.loop<"u"&&(this.clearCountTimer(),this._loop=r.loop,this._counter=0,(e=this._lottie)==null||e.setLoop(typeof r.loop=="number"?!0:r.loop)),typeof r.speed<"u"&&((i=this._lottie)==null||i.setSpeed(r.speed)),typeof r.autoplay<"u"&&this._lottie&&(this._lottie.autoplay=r.autoplay),typeof r.direction<"u"&&((s=this._lottie)==null||s.setDirection(r.direction));}_getOptionsFromAnimation(t){let{id:e,...i}=t;return {...cs,...i}}_updateTestData(){!this._testId||!this._lottie||(window.dotLottiePlayer||(window.dotLottiePlayer={[this._testId]:{}}),window.dotLottiePlayer[this._testId]={direction:this._lottie.playDirection,currentState:this._currentState,loop:this.loop,mode:this._mode,speed:this._lottie.playSpeed});}setContainer(t){t!==this._container&&(this._container=t,this.setBackground(this._background),this._listenToHover());}get currentState(){return this._currentState}clearCountTimer(){this._counterInterval&&clearInterval(this._counterInterval);}setCurrentState(t){this._currentState=t,this._notify(),this._updateTestData();}static isPathJSON(t){var e;return ((e=t.split(".").pop())==null?void 0:e.toLowerCase())==="json"}get src(){return this._src}updateSrc(t){this._src!==t&&(typeof t=="string"?this._src=t:this._src=Ua(t),this._activeAnimationId=void 0,this._currentAnimationId=void 0,this.load());}get intermission(){return this._intermission}get hover(){return this._hover}setHover(t){typeof t=="boolean"&&(this._hover=t,this._userPlaybackOptions.hover=t,this._notify());}setIntermission(t){this._intermission=t,this._userPlaybackOptions.intermission=t,this._notify();}get mode(){return this._mode}get animations(){return this._dotLottieLoader.animationsMap}get themes(){return this._dotLottieLoader.themeMap}setMode(t){typeof t=="string"&&(this._mode=t,this._userPlaybackOptions.playMode=t,this._setPlayerState(()=>({playMode:t})),this._notify(),this._updateTestData());}get container(){if(this._container)return this._container}goToAndPlay(t,e,i){if(!this._lottie||["loading"].includes(this._currentState)){li("goToAndPlay() Can't use whilst loading.");return}this._lottie.goToAndPlay(t,e,i),this.setCurrentState("playing");}goToAndStop(t,e,i){if(!this._lottie||["loading"].includes(this._currentState)){li("goToAndStop() Can't use whilst loading.");return}this._lottie.goToAndStop(t,e,i),this.setCurrentState("stopped");}seek(t){if(!this._lottie||["loading"].includes(this._currentState)){li("seek() Can't use whilst loading.");return}let e=t;typeof e=="number"&&(e=Math.round(e));let i=/^(\d+)(%?)$/u.exec(e.toString());if(!i)return;let s=i[2]==="%"?this.totalFrames*Number(i[1])/100:i[1];s!==void 0&&(this._lottie.goToAndPlay(s,!0),this.currentState==="playing"?this.play():this.currentState==="frozen"?this.freeze():this.pause());}_areNumbersInRange(t,e){return t>=0&&t<=1&&e>=0&&e<=1}_updatePosition(t,e,i){let[s,r]=t!=null?t:[0,this.totalFrames-1],[a,n]=e!=null?e:[0,1];if(!this._areNumbersInRange(a,n)){er("threshold values must be between 0 and 1");return}if(this.container){let{height:p,top:h}=this.container.getBoundingClientRect(),y=window.innerHeight-h,P=window.innerHeight+p,c=y/P,l=s+Math.round((c-a)/(n-a)*(r-s));i&&i(c),this.goToAndStop(l,!0),(l>=r||c>=n)&&this._handleAnimationComplete();}this._scrollTicking=!1;}_requestTick(t,e,i){this._scrollTicking||(requestAnimationFrame(()=>this._updatePosition(t,e,i)),this._scrollTicking=!0);}playOnScroll(t){this.stop(),this._scrollCallback&&this.stopPlayOnScroll(),this._scrollCallback=()=>this._requestTick(t==null?void 0:t.segments,t==null?void 0:t.threshold,t==null?void 0:t.positionCallback),window.addEventListener("scroll",this._scrollCallback);}stopPlayOnScroll(){this._scrollCallback&&(window.removeEventListener("scroll",this._scrollCallback),this._scrollCallback=void 0);}stopPlayOnShow(){this._onShowIntersectionObserver&&(this._onShowIntersectionObserver.disconnect(),this._onShowIntersectionObserver=void 0);}addIntersectionObserver(t){if(!this.container)throw Ie("Can't play on show, player container element not available.");let e={root:null,rootMargin:"0px",threshold:t!=null&&t.threshold?t.threshold:[0,1]},i=s=>{s.forEach(r=>{var a,n;this._visibilityPercentage=r.intersectionRatio*100,r.isIntersecting?(t!=null&&t.callbackOnIntersect&&t.callbackOnIntersect(this._visibilityPercentage),(a=this._container)==null||a.dispatchEvent(new Event("visibilityChange"))):t!=null&&t.callbackOnIntersect&&(t.callbackOnIntersect(0),(n=this._container)==null||n.dispatchEvent(new Event("visibilityChange")));});};this._onShowIntersectionObserver=new IntersectionObserver(i,e),this._onShowIntersectionObserver.observe(this.container);}playOnShow(t){var e;if(this.stop(),!this.container)throw Ie("Can't play on show, player container element not available.");this._onShowIntersectionObserver&&this.stopPlayOnShow(),this.addIntersectionObserver({threshold:(e=t==null?void 0:t.threshold)!=null?e:[],callbackOnIntersect:i=>{i===0?this.pause():this.play();}});}_validatePlaybackOptions(t){if(!t)return {};let e={};for(let[i,s]of Object.entries(t))switch(i){case"autoplay":typeof s=="boolean"&&(e.autoplay=s);break;case"direction":typeof s=="number"&&[1,-1].includes(s)&&(e.direction=s);break;case"loop":(typeof s=="boolean"||typeof s=="number")&&(e.loop=s);break;case"playMode":typeof s=="string"&&["normal","bounce"].includes(s)&&(e.playMode=s);break;case"speed":typeof s=="number"&&(e.speed=s);break;case"themeColor":typeof s=="string"&&(e.themeColor=s);break;case"hover":typeof s=="boolean"&&(e.hover=s);break;case"intermission":typeof s=="number"&&(e.intermission=s);break;case"defaultTheme":typeof s=="string"&&(e.defaultTheme=s);break}return this._requireValidPlaybackOptions(e),e}_requireAnimationsInTheManifest(){var t;if(!((t=this._dotLottieLoader.manifest)!=null&&t.animations.length))throw Ie("No animations found in manifest.")}_requireAnimationsToBeLoaded(){if(this._dotLottieLoader.animationsMap.size===0)throw Ie("No animations have been loaded.")}async play(t,e){var i,s;if(["initial","loading"].includes(this._currentState)){li("Player unable to play whilst loading.");return}if(this._requireAnimationsInTheManifest(),this._requireAnimationsToBeLoaded(),this._lottie&&!t){this._lottie.playDirection===-1&&this._lottie.currentFrame===0?this._lottie.goToAndPlay(this._lottie.totalFrames,!0):this._lottie.play(),this.setCurrentState("playing");return}if(typeof t=="number"){let r=(i=this._dotLottieLoader.manifest)==null?void 0:i.animations[t];if(!r)throw Ie("animation not found.");typeof e=="function"?await this.render({id:r.id,...e(this._getPlaybackOptions(),this._getOptionsFromAnimation(r))}):await this.render({id:r.id});}if(typeof t=="string"){let r=(s=this._dotLottieLoader.manifest)==null?void 0:s.animations.find(a=>a.id===t);if(!r)throw Ie("animation not found.");typeof e=="function"?await this.render({id:r.id,...e(this._getPlaybackOptions(),this._getOptionsFromAnimation(r))}):await this.render({id:r.id});}}playSegments(t,e){if(!this._lottie||["loading"].includes(this._currentState)){li("playSegments() Can't use whilst loading.");return}this._lottie.playSegments(t,e),this.setCurrentState("playing");}resetSegments(t){if(!this._lottie||["loading"].includes(this._currentState)){li("resetSegments() Can't use whilst loading.");return}this._lottie.resetSegments(t);}togglePlay(){this.currentState==="playing"?this.pause():this.play();}_getAnimationByIdOrIndex(t){var e,i;if(this._requireAnimationsInTheManifest(),this._requireAnimationsToBeLoaded(),typeof t=="number"){let s=(e=this._dotLottieLoader.manifest)==null?void 0:e.animations[t];if(!s)throw Ie("animation not found.");return s}if(typeof t=="string"){let s=(i=this._dotLottieLoader.manifest)==null?void 0:i.animations.find(r=>r.id===t);if(!s)throw Ie("animation not found.");return s}throw Ie("first param must be a number or string")}get activeAnimationId(){return this._getActiveAnimationId()}get currentAnimationId(){return this._currentAnimationId}get activeStateId(){return this._activeStateId}async _startInteractivity(t){if(!this._inInteractiveMode){er("Can't start interactivity. Not in interactive mode. Call enterInteractiveMode(stateId: string) to start.");return}if(this._dotLottieLoader.stateMachinesMap.size===0&&await this._dotLottieLoader.getStateMachines(),this._dotLottieLoader.stateMachinesMap.size===0)throw Ie("No interactivity states are available.");if(t==="undefined")throw Ie("stateId is not specified.");this._stateMachineManager||(this._stateMachineManager=await ul(Array.from(this._dotLottieLoader.stateMachinesMap.values()),this)),this._stateMachineManager.start(t);}enterInteractiveMode(t){var e;if(t)this._inInteractiveMode||(this._prevUserPlaybackOptions={...this._userPlaybackOptions}),this._inInteractiveMode&&((e=this._stateMachineManager)==null||e.stop()),this._activeStateId=t,this._inInteractiveMode=!0,this._startInteractivity(t);else throw Ie("stateId must be a non-empty string.")}exitInteractiveMode(){var t;this._inInteractiveMode&&(this._inInteractiveMode=!1,this._activeStateId="",(t=this._stateMachineManager)==null||t.stop(),this._userPlaybackOptions={},this._userPlaybackOptions={...this._prevUserPlaybackOptions},this._prevUserPlaybackOptions={},this.reset());}reset(){var t;let e=this._getActiveAnimationId(),i=(t=this._dotLottieLoader.manifest)==null?void 0:t.animations.find(s=>s.id===e);if(this._inInteractiveMode&&this.exitInteractiveMode(),!i)throw Ie("animation not found.");this.play(e);}previous(t){if(!this._dotLottieLoader.manifest||!this._dotLottieLoader.manifest.animations.length)throw Ie("manifest not found.");if(this._inInteractiveMode){li("previous() is not supported in interactive mode.");return}let e=this._dotLottieLoader.manifest.animations.findIndex(s=>s.id===this._currentAnimationId);if(e===-1)throw Ie("animation not found.");let i=this._dotLottieLoader.manifest.animations[(e-1+this._dotLottieLoader.manifest.animations.length)%this._dotLottieLoader.manifest.animations.length];if(!i||!i.id)throw Ie("animation not found.");typeof t=="function"?this.render({id:i.id,...t(this._getPlaybackOptions(),this._getOptionsFromAnimation(i))}):this.render({id:i.id});}next(t){if(!this._dotLottieLoader.manifest||!this._dotLottieLoader.manifest.animations.length)throw Ie("manifest not found.");if(this._inInteractiveMode){li("next() is not supported in interactive mode.");return}let e=this._dotLottieLoader.manifest.animations.findIndex(s=>s.id===this._currentAnimationId);if(e===-1)throw Ie("animation not found.");let i=this._dotLottieLoader.manifest.animations[(e+1)%this._dotLottieLoader.manifest.animations.length];if(!i||!i.id)throw Ie("animation not found.");typeof t=="function"?this.render({id:i.id,...t(this._getPlaybackOptions(),this._getOptionsFromAnimation(i))}):this.render({id:i.id});}getManifest(){return this._dotLottieLoader.manifest}resize(){if(!this._lottie||["loading"].includes(this._currentState)){li("resize() Can't use whilst loading.");return}this._lottie.resize();}stop(){if(!this._lottie||["loading"].includes(this._currentState)){li("stop() Can't use whilst loading.");return}this.clearCountTimer(),this._counter=0,this._setPlayerState(()=>({direction:this._getOption("direction")})),this._lottie.stop(),this.setCurrentState("stopped");}pause(){if(!this._lottie||["loading"].includes(this._currentState)){li("pause() Can't use whilst loading.");return}this.clearCountTimer(),this._lottie.pause(),this.setCurrentState("paused");}freeze(){if(!this._lottie||["loading"].includes(this._currentState)){li("freeze() Can't use whilst loading.");return}this.currentState!=="frozen"&&(this._stateBeforeFreeze=this.currentState),this._lottie.pause(),this.setCurrentState("frozen");}unfreeze(){if(!this._lottie||["loading"].includes(this._currentState)){li("unfreeze() Can't use whilst loading.");return}this._stateBeforeFreeze==="playing"?this.play():this.pause();}destroy(){var t,e;(t=this._container)!=null&&t.__lottie&&(this._container.__lottie.destroy(),this._container.__lottie=null),this._audios.length&&(this._audios.forEach(i=>{i.unload();}),this._audios=[]),this.clearCountTimer(),typeof document<"u"&&document.removeEventListener("visibilitychange",()=>this._onVisibilityChange()),this._counter=0,(e=this._lottie)==null||e.destroy(),this._lottie=void 0;}getAnimationInstance(){return this._lottie}static getLottieWebVersion(){return `${wc.dependencies["lottie-web"]}`}addEventListener(t,e){var i,s,r;this._listeners.has(t)||this._listeners.set(t,new Set),(i=this._listeners.get(t))==null||i.add(e);try{t==="complete"?(s=this._container)==null||s.addEventListener(t,e):(r=this._lottie)==null||r.addEventListener(t,e);}catch(a){er(`addEventListener ${a}`);}}getState(){var t,e,i,s,r,a,n;return {autoplay:(e=(t=this._lottie)==null?void 0:t.autoplay)!=null?e:!1,currentState:this._currentState,frame:this._frame,visibilityPercentage:this._visibilityPercentage,seeker:this._seeker,direction:(s=(i=this._lottie)==null?void 0:i.playDirection)!=null?s:1,hover:this._hover,loop:this._loop||!1,playMode:this._mode,speed:(a=(r=this._lottie)==null?void 0:r.playSpeed)!=null?a:1,background:this._background,intermission:this._intermission,defaultTheme:this._defaultTheme,currentAnimationId:this._currentAnimationId,activeStateId:(n=this._activeStateId)!=null?n:""}}_notify(){this.state.setState(this.getState());}get totalFrames(){var t;return ((t=this._lottie)==null?void 0:t.totalFrames)||0}get direction(){return this._lottie?this._lottie.playDirection:1}setDirection(t){this._requireValidDirection(t),this._setPlayerState(()=>({direction:t})),this._userPlaybackOptions.direction=t;}get speed(){var t;return ((t=this._lottie)==null?void 0:t.playSpeed)||1}setSpeed(t){this._requireValidSpeed(t),this._setPlayerState(()=>({speed:t})),this._userPlaybackOptions.speed=t;}get autoplay(){var t,e;return (e=(t=this._lottie)==null?void 0:t.autoplay)!=null?e:!1}setAutoplay(t){if(this._requireValidAutoplay(t),!this._lottie||["loading"].includes(this._currentState)){li("setAutoplay() Can't use whilst loading.");return}this._setPlayerState(()=>({autoplay:t})),this._userPlaybackOptions.autoplay=t;}toggleAutoplay(){if(!this._lottie||["loading"].includes(this._currentState)){li("toggleAutoplay() Can't use whilst loading.");return}this.setAutoplay(!this._lottie.autoplay);}get defaultTheme(){return this._defaultTheme}setDefaultTheme(t){this._setPlayerState(()=>({defaultTheme:t})),this._userPlaybackOptions.defaultTheme=t,this._animation&&this.render();}get loop(){return this._loop}setLoop(t){this._requireValidLoop(t),this._setPlayerState(()=>({loop:t})),this._userPlaybackOptions.loop=t;}toggleLoop(){if(!this._lottie||["loading"].includes(this._currentState)){li("toggleLoop() Can't use whilst loading.");return}this.setLoop(!this._loop);}get background(){return this._background}setBackground(t){this._requireValidBackground(t),this._background=t,this._container&&(this._container.style.backgroundColor=t);}get _frame(){return this._lottie?this.currentState==="completed"?this.direction===-1?0:this._lottie.totalFrames:this._lottie.currentFrame:0}get _seeker(){return this._lottie?this._frame/this._lottie.totalFrames*100:0}async revertToManifestValues(t){var e;let i;!Array.isArray(t)||t.length===0?i=["autoplay","defaultTheme","direction","hover","intermission","loop","playMode","speed","activeAnimationId"]:i=t;let s=!1;if(i.includes("activeAnimationId")){let r=(e=this._dotLottieLoader.manifest)==null?void 0:e.activeAnimationId,a=this._getAnimationByIdOrIndex(r||0);this._activeAnimationId=r,await this._setCurrentAnimation(a.id),s=!0;}i.forEach(r=>{switch(r){case"autoplay":delete this._userPlaybackOptions.autoplay,this.setAutoplay(this._getOption("autoplay"));break;case"defaultTheme":delete this._userPlaybackOptions.defaultTheme,this.setDefaultTheme(this._getOption("defaultTheme"));break;case"direction":delete this._userPlaybackOptions.direction,this.setDirection(this._getOption("direction"));break;case"hover":delete this._userPlaybackOptions.hover,this.setHover(this._getOption("hover"));break;case"intermission":delete this._userPlaybackOptions.intermission,this.setIntermission(this._getOption("intermission"));break;case"loop":delete this._userPlaybackOptions.loop,this.setLoop(this._getOption("loop"));break;case"playMode":delete this._userPlaybackOptions.playMode,this.setMode(this._getOption("playMode")),this.setDirection(this._getOption("direction"));break;case"speed":delete this._userPlaybackOptions.speed,this.setSpeed(this._getOption("speed"));break}}),s&&this.render();}removeEventListener(t,e){var i,s,r;try{t==="complete"?(i=this._container)==null||i.removeEventListener(t,e):(s=this._lottie)==null||s.removeEventListener(t,e),(r=this._listeners.get(t))==null||r.delete(e);}catch(a){er("removeEventListener",a);}}_handleAnimationComplete(){var t;typeof this._loop=="number"&&this.stop();let e=this.direction===-1?0:this.totalFrames-1;this.goToAndStop(e,!0),this._counter=0,this.clearCountTimer(),this.setCurrentState("completed"),(t=this._container)==null||t.dispatchEvent(new Event("complete"));}addEventListeners(){var t;if(!this._lottie||["loading"].includes(this._currentState)){li("addEventListeners() Can't use whilst loading.");return}this._lottie.addEventListener("enterFrame",()=>{var e;if(!this._lottie){li("enterFrame event : Lottie is undefined.");return}Math.floor(this._lottie.currentFrame)===0&&this.direction===-1&&((e=this._container)==null||e.dispatchEvent(new Event("complete")),this.loop||this.setCurrentState("completed")),this._notify();}),this._lottie.addEventListener("loopComplete",()=>{var e;if(!this._lottie){li("loopComplete event : Lottie is undefined.");return}(e=this._container)==null||e.dispatchEvent(new Event("loopComplete")),this.intermission>0&&this.pause();let i=this._lottie.playDirection;if(typeof this._loop=="number"&&this._loop>0&&(this._counter+=this._mode==="bounce"?.5:1,this._counter>=this._loop)){this._handleAnimationComplete();return}this._mode==="bounce"&&typeof i=="number"&&(i=Number(i)*-1);let s=i===-1?this._lottie.totalFrames-1:0;this.intermission?(this.goToAndPlay(s,!0),this.pause(),this._counterInterval=window.setTimeout(()=>{this._lottie&&(this._setPlayerState(()=>({direction:i})),this.goToAndPlay(s,!0));},this._intermission)):(this._setPlayerState(()=>({direction:i})),this.goToAndPlay(i===-1?this.totalFrames-1:0,!0));}),this._lottie.addEventListener("complete",()=>{if(this._lottie&&this._loop===!1&&this._mode==="bounce"){if(this._counter+=.5,this._counter>=1){this._handleAnimationComplete();return}this._counterInterval=window.setTimeout(()=>{if(!this._lottie)return;let e=this._lottie.playDirection;this._mode==="bounce"&&typeof e=="number"&&(e=Number(e)*-1);let i=e===-1?this.totalFrames-1:0;this._setPlayerState(()=>({direction:e})),this.goToAndPlay(i,!0);},this._intermission);}else this._handleAnimationComplete();});for(let[e,i]of this._listeners)if(e==="complete")for(let s of i)(t=this._container)==null||t.addEventListener(e,s);else for(let s of i)this._lottie.addEventListener(e,s);}async _setCurrentAnimation(t){this._currentState="loading";let e=await this._dotLottieLoader.getAnimation(t);this._currentAnimationId=t,this._animation=e,this._currentState="ready";}async _getAudioFactory(){if(this._animation&&yo(this._animation)){let{DotLottieAudio:t}=await Promise.resolve().then(()=>(dl(),ml));return e=>{let i=new t({src:[e]});return this._audios.push(i),i}}return null}async render(t){var e,i,s,r,a,n,p,h,y,P,c,l,E,b,v,w,u,f;if(t!=null&&t.id)await this._setCurrentAnimation(t.id);else if(!this._animation)throw Ie("no animation selected");let g=(e=cs.loop)!=null?e:!1,_=(i=cs.autoplay)!=null?i:!1,k=(s=cs.playMode)!=null?s:"normal",z=(r=cs.intermission)!=null?r:0,q=(a=cs.hover)!=null?a:!1,W=(n=cs.direction)!=null?n:1,ot=(p=cs.speed)!=null?p:1,mt=(h=cs.defaultTheme)!=null?h:"";g=(y=t==null?void 0:t.loop)!=null?y:this._getOption("loop"),_=(P=t==null?void 0:t.autoplay)!=null?P:this._getOption("autoplay"),k=(c=t==null?void 0:t.playMode)!=null?c:this._getOption("playMode"),z=(l=t==null?void 0:t.intermission)!=null?l:this._getOption("intermission"),q=(E=t==null?void 0:t.hover)!=null?E:this._getOption("hover"),W=(b=t==null?void 0:t.direction)!=null?b:this._getOption("direction"),ot=(v=t==null?void 0:t.speed)!=null?v:this._getOption("speed"),mt=(w=t==null?void 0:t.defaultTheme)!=null?w:this._getOption("defaultTheme");let gt={...this._animationConfig,autoplay:q?!1:_,loop:typeof g=="number"?!0:g,renderer:this._worker?"svg":(u=this._animationConfig.renderer)!=null?u:"svg"},[ut,Ct,ht]=await Promise.all([this._dotLottieLoader.getTheme(mt),this._getLottiePlayerInstance(),this._getAudioFactory()]);if(ut&&this._animation?(this._animation=Ua(this._animation),this._animation.slots=ut):this._animation=await this._dotLottieLoader.getAnimation((f=this._currentAnimationId)!=null?f:""),this._activeStateId&&!this._inInteractiveMode){this.enterInteractiveMode(this._activeStateId);return}this.destroy(),this._setPlayerState(()=>({defaultTheme:mt,playMode:k,intermission:z,hover:q,loop:g})),ht?this._lottie=Ct.loadAnimation({...gt,container:this._container,animationData:this._animation,audioFactory:ht}):this._lottie=Ct.loadAnimation({...gt,container:this._container,animationData:this._animation}),typeof this._lottie.resetSegments>"u"&&(this._lottie.resetSegments=()=>{var yt;(yt=this._lottie)==null||yt.playSegments([0,this._lottie.totalFrames],!0);}),this.addEventListeners(),this._container&&(this._container.__lottie=this._lottie),this._setPlayerState(()=>({direction:W,speed:ot})),_&&!q&&(g===!1&&W===-1?this.play():this.setCurrentState("playing")),this._updateTestData();}async _getLottiePlayerInstance(){var t;let e=(t=this._animationConfig.renderer)!=null?t:"svg",i;if(this._worker)return e!=="svg"&&li("Worker is only supported with svg renderer. Change or remove renderer prop to get rid of this warning."),i=await Promise.resolve().then(()=>(yl(),gl)),i.default;switch(e){case"svg":{this._light?i=await Promise.resolve().then(()=>(bl(),vl)):i=await Promise.resolve().then(()=>(xl(),_l));break}case"canvas":{this._light?i=await Promise.resolve().then(()=>(Sl(),Pl)):i=await Promise.resolve().then(()=>(Al(),El));break}case"html":{this._light?i=await Promise.resolve().then(()=>(kl(),Cl)):i=await Promise.resolve().then(()=>(Ml(),Tl));break}default:throw new Error(`Invalid renderer: ${e}`)}return i.default}_getActiveAnimationId(){var t,e,i,s;let r=this._dotLottieLoader.manifest;return (s=(i=(t=this._activeAnimationId)!=null?t:r==null?void 0:r.activeAnimationId)!=null?i:(e=r==null?void 0:r.animations[0])==null?void 0:e.id)!=null?s:void 0}async load(t){if(this._currentState==="loading"){li("Loading in progress..");return}try{if(this.setCurrentState("loading"),typeof this._src=="string")if(vo(this._src)){let i=JSON.parse(this._src);this._dotLottieLoader.loadFromLottieJSON(i);}else {let i=new URL(this._src,window.location.href);await this._dotLottieLoader.loadFromUrl(i.toString());}else if(typeof this._src=="object"&&Jr(this._src))this._dotLottieLoader.loadFromLottieJSON(this._src);else throw Ie("Invalid src provided");if(!this._dotLottieLoader.manifest)throw Ie("No manifest found");let e=this._getActiveAnimationId();if(!e)throw Ie("No active animation found");await this._setCurrentAnimation(e),await this.render(t);}catch(e){this.setCurrentState("error"),e instanceof Error&&er(`Error loading animation: ${e.message}`);}}setErrorState(t){this.setCurrentState("error"),er(t);}_requireValidDirection(t){if(t!==-1&&t!==1)throw Ie("Direction can only be -1 (backwards) or 1 (forwards)")}_requireValidIntermission(t){if(t<0||!Number.isInteger(t))throw Ie("intermission must be a positive number")}_requireValidLoop(t){if(typeof t=="number"&&(!Number.isInteger(t)||t<0))throw Ie("loop must be a positive number or boolean")}_requireValidSpeed(t){if(typeof t!="number")throw Ie("speed must be a number")}_requireValidBackground(t){if(typeof t!="string")throw Ie("background must be a string")}_requireValidAutoplay(t){if(typeof t!="boolean")throw Ie("autoplay must be a boolean")}_requireValidPlaybackOptions(t){t.direction&&this._requireValidDirection(t.direction),t.intermission&&this._requireValidIntermission(t.intermission),t.loop&&this._requireValidLoop(t.loop),t.speed&&this._requireValidSpeed(t.speed);}};});Bo();An();qn();Tn();ca();qs();var Yn=window,Jn=Yn.ShadowRoot&&(Yn.ShadyCSS===void 0||Yn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Oo=Symbol(),wl=new WeakMap,ln=class{constructor(e,i,s){if(this._$cssResult$=!0,s!==Oo)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=i;}get styleSheet(){let e=this.o,i=this.t;if(Jn&&e===void 0){let s=i!==void 0&&i.length===1;s&&(e=wl.get(i)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&wl.set(i,e));}return e}toString(){return this.cssText}},Dl=t=>new ln(typeof t=="string"?t:t+"",void 0,Oo),zo=(t,...e)=>{let i=t.length===1?t[0]:e.reduce((s,r,a)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[a+1],t[0]);return new ln(i,t,Oo)},No=(t,e)=>{Jn?t.adoptedStyleSheets=e.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet):e.forEach(i=>{let s=document.createElement("style"),r=Yn.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=i.cssText,t.appendChild(s);});},Un=Jn?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let i="";for(let s of e.cssRules)i+=s.cssText;return Dl(i)})(t):t;var Go,Zn=window,Fl=Zn.trustedTypes,Dc=Fl?Fl.emptyScript:"",Il=Zn.reactiveElementPolyfillSupport,Ho={toAttribute(t,e){switch(e){case Boolean:t=t?Dc:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t);}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=t!==null;break;case Number:i=t===null?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch{i=null;}}return i}},Ll=(t,e)=>e!==t&&(e==e||t==t),jo={attribute:!0,type:String,converter:Ho,reflect:!1,hasChanged:Ll},qo="finalized",ur=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu();}static addInitializer(e){var i;this.finalize(),((i=this.h)!==null&&i!==void 0?i:this.h=[]).push(e);}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((i,s)=>{let r=this._$Ep(s,i);r!==void 0&&(this._$Ev.set(r,s),e.push(r));}),e}static createProperty(e,i=jo){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(e,i),!i.noAccessor&&!this.prototype.hasOwnProperty(e)){let s=typeof e=="symbol"?Symbol():"__"+e,r=this.getPropertyDescriptor(e,s,i);r!==void 0&&Object.defineProperty(this.prototype,e,r);}}static getPropertyDescriptor(e,i,s){return {get(){return this[i]},set(r){let a=this[e];this[i]=r,this.requestUpdate(e,a,s);},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||jo}static finalize(){if(this.hasOwnProperty(qo))return !1;this[qo]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let i=this.properties,s=[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)];for(let r of s)this.createProperty(r,i[r]);}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let i=[];if(Array.isArray(e)){let s=new Set(e.flat(1/0).reverse());for(let r of s)i.unshift(Un(r));}else e!==void 0&&i.push(Un(e));return i}static _$Ep(e,i){let s=i.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(i=>i(this));}addController(e){var i,s;((i=this._$ES)!==null&&i!==void 0?i:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((s=e.hostConnected)===null||s===void 0||s.call(e));}removeController(e){var i;(i=this._$ES)===null||i===void 0||i.splice(this._$ES.indexOf(e)>>>0,1);}_$Eg(){this.constructor.elementProperties.forEach((e,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i]);});}createRenderRoot(){var e;let i=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return No(i,this.constructor.elementStyles),i}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var s;return (s=i.hostConnected)===null||s===void 0?void 0:s.call(i)});}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(i=>{var s;return (s=i.hostDisconnected)===null||s===void 0?void 0:s.call(i)});}attributeChangedCallback(e,i,s){this._$AK(e,s);}_$EO(e,i,s=jo){var r;let a=this.constructor._$Ep(e,s);if(a!==void 0&&s.reflect===!0){let n=(((r=s.converter)===null||r===void 0?void 0:r.toAttribute)!==void 0?s.converter:Ho).toAttribute(i,s.type);this._$El=e,n==null?this.removeAttribute(a):this.setAttribute(a,n),this._$El=null;}}_$AK(e,i){var s;let r=this.constructor,a=r._$Ev.get(e);if(a!==void 0&&this._$El!==a){let n=r.getPropertyOptions(a),p=typeof n.converter=="function"?{fromAttribute:n.converter}:((s=n.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?n.converter:Ho;this._$El=a,this[a]=p.fromAttribute(i,n.type),this._$El=null;}}requestUpdate(e,i,s){let r=!0;e!==void 0&&(((s=s||this.constructor.getPropertyOptions(e)).hasChanged||Ll)(this[e],i)?(this._$AL.has(e)||this._$AL.set(e,i),s.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,s))):r=!1),!this.isUpdatePending&&r&&(this._$E_=this._$Ej());}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_;}catch(i){Promise.reject(i);}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((r,a)=>this[a]=r),this._$Ei=void 0);let i=!1,s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var a;return (a=r.hostUpdate)===null||a===void 0?void 0:a.call(r)}),this.update(s)):this._$Ek();}catch(r){throw i=!1,this._$Ek(),r}i&&this._$AE(s);}willUpdate(e){}_$AE(e){var i;(i=this._$ES)===null||i===void 0||i.forEach(s=>{var r;return (r=s.hostUpdated)===null||r===void 0?void 0:r.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e);}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return !0}update(e){this._$EC!==void 0&&(this._$EC.forEach((i,s)=>this._$EO(s,this[s],i)),this._$EC=void 0),this._$Ek();}updated(e){}firstUpdated(e){}};ur[qo]=!0,ur.elementProperties=new Map,ur.elementStyles=[],ur.shadowRootOptions={mode:"open"},Il==null||Il({ReactiveElement:ur}),((Go=Zn.reactiveElementVersions)!==null&&Go!==void 0?Go:Zn.reactiveElementVersions=[]).push("1.6.3");var $o,Kn=window,Sa=Kn.trustedTypes,Vl=Sa?Sa.createPolicy("lit-html",{createHTML:t=>t}):void 0,Xo="$lit$",Lr=`lit$${(Math.random()+"").slice(9)}$`,jl="?"+Lr,Fc=`<${jl}>`,Qr=document,fn=()=>Qr.createComment(""),cn=t=>t===null||typeof t!="object"&&typeof t!="function",Hl=Array.isArray,Ic=t=>Hl(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",Wo=`[ +`),s={},r,a=0,n=0;nthis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e=this.animationData.layers,i,s=e.length,r=t.layers,a,n=r.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(t){this.triggerRenderFrameError(t);}},AnimationItem.prototype.play=function(t){t&&this.name!==t||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},AnimationItem.prototype.pause=function(t){t&&this.name!==t||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(this.isPaused===!0?this.play():this.pause());},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(i=!0,e=0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"));}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart");},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,i!==-1&&this.goToAndStop(i,!0);},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),_typeof$4(t[0])==="object"){var i,s=t.length;for(i=0;i=0;V-=1)e[V].animation.destroy(D);}function W(D,V,S){var R=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),tt,J=R.length;for(tt=0;tt0?_=W:g=W;while(Math.abs(q)>a&&++ot=r?w(f,mt,g,_):gt===0?mt:v(f,z,z+h,g,_)}},t}(),pooling=function(){function t(e){return e.concat(createSizedArray(e.length))}return {double:t}}(),poolFactory=function(){return function(t,e,i){var s=0,r=t,a=createSizedArray(r),n={newElement:p,release:h};function p(){var y;return s?(s-=1,y=a[s]):y=e(),y}function h(y){s===r&&(a=pooling.double(a),r*=2),i&&i(y),a[s]=y,s+=1;}return n}}(),bezierLengthPool=function(){function t(){return {addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,t)}(),segmentsLengthPool=function(){function t(){return {lengths:[],totalLength:0}}function e(i){var s,r=i.lengths.length;for(s=0;s-.001&&f<.001}function i(l,E,b,v,w,u,f,g,_){if(b===0&&u===0&&_===0)return e(l,E,v,w,f,g);var k=t.sqrt(t.pow(v-l,2)+t.pow(w-E,2)+t.pow(u-b,2)),z=t.sqrt(t.pow(f-l,2)+t.pow(g-E,2)+t.pow(_-b,2)),q=t.sqrt(t.pow(f-v,2)+t.pow(g-w,2)+t.pow(_-u,2)),W;return k>z?k>q?W=k-z-q:W=q-z-k:q>z?W=q-z-k:W=z-k-q,W>-1e-4&&W<1e-4}var s=function(){return function(l,E,b,v){var w=getDefaultCurveSegments(),u,f,g,_,k,z=0,q,W=[],ot=[],mt=bezierLengthPool.newElement();for(g=b.length,u=0;uf?-1:1,k=!0;k;)if(v[u]<=f&&v[u+1]>f?(g=(f-v[u])/(v[u+1]-v[u]),k=!1):u+=_,u<0||u>=w-1){if(u===w-1)return b[u];k=!1;}return b[u]+(b[u+1]-b[u])*g}function y(l,E,b,v,w,u){var f=h(w,u),g=1-f,_=t.round((g*g*g*l[0]+(f*g*g+g*f*g+g*g*f)*b[0]+(f*f*g+g*f*f+f*g*f)*v[0]+f*f*f*E[0])*1e3)/1e3,k=t.round((g*g*g*l[1]+(f*g*g+g*f*g+g*g*f)*b[1]+(f*f*g+g*f*f+f*g*f)*v[1]+f*f*f*E[1])*1e3)/1e3;return [_,k]}var P=createTypedArray("float32",8);function c(l,E,b,v,w,u,f){w<0?w=0:w>1&&(w=1);var g=h(w,f);u=u>1?1:u;var _=h(u,f),k,z=l.length,q=1-g,W=1-_,ot=q*q*q,mt=g*q*q*3,gt=g*g*q*3,ut=g*g*g,Ct=q*q*W,ht=g*q*W+q*g*W+q*q*_,yt=g*g*W+q*g*_+g*q*_,D=g*g*_,V=q*W*W,S=g*W*W+q*_*W+q*W*_,R=g*_*W+q*_*_+g*W*_,tt=g*_*_,J=W*W*W,Gt=_*W*W+W*_*W+W*W*_,Vt=_*_*W+W*_*_+_*W*_,Xt=_*_*_;for(k=0;k=y.t-i){h.h&&(h=y),r=0;break}if(y.t-i>t){r=a;break}a=u||t=u?_.points.length-1:0;for(l=_.points[k].point.length,c=0;c=W&&z=u)s[0]=g[0],s[1]=g[1],s[2]=g[2];else if(t<=f)s[0]=h.s[0],s[1]=h.s[1],s[2]=h.s[2];else {var ht=createQuaternion(h.s),yt=createQuaternion(g),D=(t-f)/(u-f);quaternionToEuler(s,slerp(ht,yt,D));}else for(a=0;a=u?E=1:t1e-6?(l=Math.acos(E),b=Math.sin(l),v=Math.sin((1-i)*l)/b,w=Math.sin(i*l)/b):(v=1-i,w=i),s[0]=v*r+w*h,s[1]=v*a+w*y,s[2]=v*n+w*P,s[3]=v*p+w*c,s}function quaternionToEuler(t,e){var i=e[0],s=e[1],r=e[2],a=e[3],n=Math.atan2(2*s*a-2*i*r,1-2*s*s-2*r*r),p=Math.asin(2*i*s+2*r*a),h=Math.atan2(2*i*a-2*s*r,1-2*i*i-2*r*r);t[0]=n/degToRads,t[1]=p/degToRads,t[2]=h/degToRads;}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,s=t[2]*degToRads,r=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(s/2),p=Math.sin(e/2),h=Math.sin(i/2),y=Math.sin(s/2),P=r*a*n-p*h*y,c=p*h*n+r*a*y,l=p*a*n+r*h*y,E=r*h*n-p*a*y;return [c,l,E,P]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s;}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if(this.propType==="unidimensional")e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i1e-5&&(this.v[i]=e,this._mdf=!0),i+=1;}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[];break}(!a[s]||a[s]&&!r)&&(a[s]=pointPool.newElement()),a[s][0]=t,a[s][1]=e;},ShapePath.prototype.setTripleAt=function(t,e,i,s,r,a,n,p){this.setXYAt(t,e,"v",n,p),this.setXYAt(i,s,"o",n,p),this.setXYAt(r,a,"i",n,p);},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,r=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),r=1);var a=this._length-1,n=this._length,p;for(p=r;p=ht[ht.length-1].t-this.offsetTime)k=ht[ht.length-1].s?ht[ht.length-1].s[0]:ht[ht.length-2].e[0],q=!0;else {for(var yt=_,D=ht.length-1,V=!0,S,R,tt;V&&(S=ht[yt],R=ht[yt+1],!(R.t-this.offsetTime>u));)yt=R.t-this.offsetTime)ut=1;else if(ug&&u>g)||(this._caching.lastIndex=_0||S>-1e-6&&S<0?s(S*R)/R:S}function V(){var S=this.props,R=D(S[0]),tt=D(S[1]),J=D(S[4]),Gt=D(S[5]),Vt=D(S[12]),Xt=D(S[13]);return "matrix("+R+","+tt+","+J+","+Gt+","+Vt+","+Xt+")"}return function(){this.reset=r,this.rotate=a,this.rotateX=n,this.rotateY=p,this.rotateZ=h,this.skew=P,this.skewFromAxis=c,this.shear=y,this.scale=l,this.setTransform=E,this.translate=b,this.transform=v,this.multiply=w,this.applyToPoint=k,this.applyToX=z,this.applyToY=q,this.applyToZ=W,this.applyToPointArray=Ct,this.applyToTriplePoints=ut,this.applyToPointStringified=ht,this.toCSS=yt,this.to2dCSS=V,this.clone=g,this.cloneFromProps=_,this.equals=f,this.inversePoints=gt,this.inversePoint=mt,this.getInverseMatrix=ot,this._t=this.transform,this.isIdentity=u,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset();}}();function _typeof$3(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(e){return typeof e}:_typeof$3=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(t)}var lottie={};function setLocation(t){setLocationHref(t);}function searchAnimations(){animationManager.searchAnimations();}function setSubframeRendering(t){setSubframeEnabled(t);}function setPrefix(t){setIdPrefix(t);}function loadAnimation(t){return animationManager.loadAnimation(t)}function setQuality(t){if(typeof t=="string")switch(t){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else !isNaN(t)&&t>1&&setDefaultCurveSegments(t);}function inBrowser(){return typeof navigator<"u"}function installPlugin(t,e){t==="expressions"&&setExpressionsPlugin(e);}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations());}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i"u"?"undefined":_typeof$3(exports))==="object"&&typeof module<"u")&&!(typeof define=="function"&&define.amd)&&(window.bodymovin=lottie);}catch(t){}var ShapeModifiers=function(){var t={},e={};t.registerModifier=i,t.getModifier=s;function i(r,a){e[r]||(e[r]=a);}function s(r,a,n){return new e[r](a,n)}return t}();function ShapeModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated();}},ShapeModifier.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0);},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties());},extendPrototype([DynamicPropertyContainer],ShapeModifier);function TrimModifier(){}extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(t,e){this.s=PropertyFactory.getProp(t,e.s,0,.01,this),this.e=PropertyFactory.getProp(t,e.e,0,.01,this),this.o=PropertyFactory.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length;},TrimModifier.prototype.addShapeToModifier=function(t){t.pathsData=[];},TrimModifier.prototype.calculateShapeEdges=function(t,e,i,s,r){var a=[];e<=1?a.push({s:t,e}):t>=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n=[],p,h=a.length,y;for(p=0;ps+i)){var P,c;y.s*r<=s?P=0:P=(y.s*r-s)/i,y.e*r>=s+i?c=1:c=(y.e*r-s)/i,n.push([P,c]);}return n.length||n.push([0,0]),n},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e1?e=1+s:this.s.v<0?e=0+s:e=this.s.v+s,this.e.v>1?i=1+s:this.e.v<0?i=0+s:i=this.e.v+s,e>i){var r=e;e=i,i=r;}e=Math.round(e*1e4)*1e-4,i=Math.round(i*1e4)*1e-4,this.sValue=e,this.eValue=i;}else e=this.sValue,i=this.eValue;var a,n,p=this.shapes.length,h,y,P,c,l,E=0;if(i===e)for(n=0;n=0;n-=1)if(v=this.shapes[n],v.shape._mdf){for(w=v.localShapeCollection,w.releaseShapes(),this.m===2&&p>1?(_=this.calculateShapeEdges(e,i,v.totalShapeLength,g,E),g+=v.totalShapeLength):_=[[u,f]],y=_.length,h=0;h=1?b.push({s:v.totalShapeLength*(u-1),e:v.totalShapeLength*(f-1)}):(b.push({s:v.totalShapeLength*u,e:v.totalShapeLength}),b.push({s:0,e:v.totalShapeLength*(f-1)}));var k=this.addShapes(v,b[0]);if(b[0].s!==b[0].e){if(b.length>1){var z=v.shape.paths.shapes[v.shape.paths._length-1];if(z.c){var q=k.pop();this.addPaths(k,w),k=this.addShapes(v,b[1],q);}else this.addPaths(k,w),k=this.addShapes(v,b[1]);}this.addPaths(k,w);}}v.shape.paths=w;}}},TrimModifier.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;ie.e){i.c=!1;break}else e.s<=y&&e.e>=y+P.addedLength?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[p],r[a].v[p],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[p],r[a].o[p-1],r[a].i[p],(e.s-y)/P.addedLength,(e.e-y)/P.addedLength,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1),y+=P.addedLength,c+=1;if(r[a].c&&l.length){if(P=l[p-1],y<=e.e){var u=l[p-1].addedLength;e.s<=y&&e.e>=y+u?(this.addSegment(r[a].v[p-1],r[a].o[p-1],r[a].i[0],r[a].v[0],i,c,w),w=!1):(E=bez.getNewSegment(r[a].v[p-1],r[a].v[0],r[a].o[p-1],r[a].i[0],(e.s-y)/u,(e.e-y)/u,l[p-1]),this.addSegmentFromArray(E,i,c,w),w=!1,i.c=!1);}else i.c=!1;y+=P.addedLength,c+=1;}if(i._length&&(i.setXYAt(i.v[v][0],i.v[v][1],"i",v),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),y>e.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(P=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/y,0),c=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/y,0)):(P=this.p.pv,c=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/y,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){P=[],c=[];var l=this.px,E=this.py;l._caching.lastFrame+l.offsetTime<=l.keyframes[0].t?(P[0]=l.getValueAtTime((l.keyframes[0].t+.01)/y,0),P[1]=E.getValueAtTime((E.keyframes[0].t+.01)/y,0),c[0]=l.getValueAtTime(l.keyframes[0].t/y,0),c[1]=E.getValueAtTime(E.keyframes[0].t/y,0)):l._caching.lastFrame+l.offsetTime>=l.keyframes[l.keyframes.length-1].t?(P[0]=l.getValueAtTime(l.keyframes[l.keyframes.length-1].t/y,0),P[1]=E.getValueAtTime(E.keyframes[E.keyframes.length-1].t/y,0),c[0]=l.getValueAtTime((l.keyframes[l.keyframes.length-1].t-.01)/y,0),c[1]=E.getValueAtTime((E.keyframes[E.keyframes.length-1].t-.01)/y,0)):(P=[l.pv,E.pv],c[0]=l.getValueAtTime((l._caching.lastFrame+l.offsetTime-.01)/y,l.offsetTime),c[1]=E.getValueAtTime((E._caching.lastFrame+E.offsetTime-.01)/y,E.offsetTime));}else c=t,P=c;this.v.rotate(-Math.atan2(P[1]-c[1],P[0]-c[0]));}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);}this.frameId=this.elem.globalData.frameId;}}function s(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4);}function r(){}function a(h){this._addDynamicProperty(h),this.elem.addDynamicProperty(h),this._isDirty=!0;}function n(h,y,P){if(this.elem=h,this.frameId=-1,this.propType="transform",this.data=y,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(P||h),y.p&&y.p.s?(this.px=PropertyFactory.getProp(h,y.p.x,0,0,this),this.py=PropertyFactory.getProp(h,y.p.y,0,0,this),y.p.z&&(this.pz=PropertyFactory.getProp(h,y.p.z,0,0,this))):this.p=PropertyFactory.getProp(h,y.p||{k:[0,0,0]},1,0,this),y.rx){if(this.rx=PropertyFactory.getProp(h,y.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(h,y.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(h,y.rz,0,degToRads,this),y.or.k[0].ti){var c,l=y.or.k.length;for(c=0;c0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0);},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e0?Math.floor(l):Math.ceil(l),v=this.pMatrix.props,w=this.rMatrix.props,u=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var f=0;if(l>0){for(;fb;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),f-=1;E&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-E,!0),f-=E);}s=this.data.m===1?0:this._currentCopies-1,r=this.data.m===1?1:-1,a=this._currentCopies;for(var g,_;a;){if(e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,_=i.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),f!==0){for((s!==0&&r===1||s!==this._currentCopies-1&&r===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],w[8],w[9],w[10],w[11],w[12],w[13],w[14],w[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),g=0;g<_;g+=1)i[g]=this.matrix.props[g];this.matrix.reset();}else for(this.matrix.reset(),g=0;g<_;g+=1)i[g]=this.matrix.props[g];f+=1,a-=1,s+=r;}}else for(a=this._currentCopies,s=0,r=1;a;)e=this.elemsData[s].it,i=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,a-=1,s+=r;return n},RepeaterModifier.prototype.addShape=function(){};function RoundCornersModifier(){}extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length;},RoundCornersModifier.prototype.processPath=function(t,e){var i=shapePool.newElement();i.c=t.c;var s,r=t._length,a,n,p,h,y,P,c=0,l,E,b,v,w,u;for(s=0;s0&&s<1?[e]:[]:[e-s,e+s].filter(function(r){return r>0&&r<1})},PolynomialBezier.prototype.split=function(t){if(t<=0)return [singlePoint(this.points[0]),this];if(t>=1)return [this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),i=lerpPoint(this.points[1],this.points[2],t),s=lerpPoint(this.points[2],this.points[3],t),r=lerpPoint(e,i,t),a=lerpPoint(i,s,t),n=lerpPoint(r,a,t);return [new PolynomialBezier(this.points[0],e,r,n,!0),new PolynomialBezier(n,a,s,this.points[3],!0)]};function extrema(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var r=s;s=i,i=r;}for(var a=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),n=0;n0&&a[n]<1){var p=t.point(a[n])[e];ps&&(s=p);}return {min:i,max:s}}PolynomialBezier.prototype.bounds=function(){return {x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return {left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}};function intersectData(t,e,i){var s=t.boundingBox();return {cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function splitData(t){var e=t.bez.split(.5);return [intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return Math.abs(t.cx-e.cx)*2=a||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s){r.push([t.t,e.t]);return}var n=splitData(t),p=splitData(e);intersectsImpl(n[0],p[0],i+1,s,r,a),intersectsImpl(n[0],p[1],i+1,s,r,a),intersectsImpl(n[1],p[0],i+1,s,r,a),intersectsImpl(n[1],p[1],i+1,s,r,a);}}PolynomialBezier.prototype.intersections=function(t,e,i){e===void 0&&(e=2),i===void 0&&(i=7);var s=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,s,i),s},PolynomialBezier.shapeSegment=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[i],t.v[i],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[i],t.i[i],t.o[e],t.v[e],!0)};function crossProduct(t,e){return [t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,i,s){var r=[t[0],t[1],1],a=[e[0],e[1],1],n=[i[0],i[1],1],p=[s[0],s[1],1],h=crossProduct(crossProduct(r,a),crossProduct(n,p));return floatZero(h[2])?null:[h[0]/h[2],h[1]/h[2]]}function polarOffset(t,e,i){return [t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0;};function setPoint(t,e,i,s,r,a,n){var p=i-Math.PI/2,h=i+Math.PI/2,y=e[0]+Math.cos(i)*s*r,P=e[1]-Math.sin(i)*s*r;t.setTripleAt(y,P,y+Math.cos(p)*a,P-Math.sin(p)*a,y+Math.cos(h)*n,P-Math.sin(h)*n,t.length());}function getPerpendicularVector(t,e){var i=[e[0]-t[0],e[1]-t[1]],s=-Math.PI*.5,r=[Math.cos(s)*i[0]-Math.sin(s)*i[1],Math.sin(s)*i[0]+Math.cos(s)*i[1]];return r}function getProjectingAngle(t,e){var i=e===0?t.length()-1:e-1,s=(e+1)%t.length(),r=t.v[i],a=t.v[s],n=getPerpendicularVector(r,a);return Math.atan2(0,1)-Math.atan2(n[1],n[0])}function zigZagCorner(t,e,i,s,r,a,n){var p=getProjectingAngle(e,i),h=e.v[i%e._length],y=e.v[i===0?e._length-1:i-1],P=e.v[(i+1)%e._length],c=a===2?Math.sqrt(Math.pow(h[0]-y[0],2)+Math.pow(h[1]-y[1],2)):0,l=a===2?Math.sqrt(Math.pow(h[0]-P[0],2)+Math.pow(h[1]-P[1],2)):0;setPoint(t,e.v[i%e._length],p,n,s,l/((r+1)*2),c/((r+1)*2));}function zigZagSegment(t,e,i,s,r,a){for(var n=0;n1&&e.length>1&&(r=getIntersection(t[0],e[e.length-1]),r)?[[t[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[i,s]}function pruneIntersections(t){for(var e,i=1;i1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var i=t.inflectionPoints(),s,r,a,n;if(i.length===0)return [offsetSegment(t,e)];if(i.length===1||floatEqual(i[1],1))return a=t.split(i[0]),s=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(r,e)];a=t.split(i[0]),s=a[0];var p=(i[1]-i[0])/(1-i[0]);return a=a[1].split(p),n=a[0],r=a[1],[offsetSegment(s,e),offsetSegment(n,e),offsetSegment(r,e)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(t,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(t,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=this.amount.effectsSequence.length!==0;},OffsetPathModifier.prototype.processPath=function(t,e,i,s){var r=shapePool.newElement();r.c=t.c;var a=t.length();t.c||(a-=1);var n,p,h,y=[];for(n=0;n=0;n-=1)h=PolynomialBezier.shapeSegmentInverted(t,n),y.push(offsetSegmentSplit(h,e));y=pruneIntersections(y);var P=null,c=null;for(n=0;n0&&(Gt=!1),Gt){var Ht=createTag("style");Ht.setAttribute("f-forigin",S[R].fOrigin),Ht.setAttribute("f-origin",S[R].origin),Ht.setAttribute("f-family",S[R].fFamily),Ht.type="text/css",Ht.innerText="@font-face {font-family: "+S[R].fFamily+"; font-style: normal; src: url('"+S[R].fPath+"');}",V.appendChild(Ht);}}else if(S[R].fOrigin==="g"||S[R].origin===1){for(Vt=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),Xt=0;Xt=55296&&S<=56319){var R=D.charCodeAt(1);R>=56320&&R<=57343&&(V=(S-55296)*1024+R-56320+65536);}return V}function z(D,V){var S=D.toString(16)+V.toString(16);return c.indexOf(S)!==-1}function q(D){return D===h}function W(D){return D===p}function ot(D){var V=k(D);return V>=y&&V<=P}function mt(D){return ot(D.substr(0,2))&&ot(D.substr(2,2))}function gt(D){return i.indexOf(D)!==-1}function ut(D,V){var S=k(D.substr(V,2));if(S!==s)return !1;var R=0;for(V+=2;R<5;){if(S=k(D.substr(V,2)),Sn)return !1;R+=1,V+=2;}return k(D.substr(V,2))===r}function Ct(){this.isLoaded=!0;}var ht=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this);};ht.isModifier=z,ht.isZeroWidthJoiner=q,ht.isFlagEmoji=mt,ht.isRegionalCode=ot,ht.isCombinedCharacter=gt,ht.isRegionalFlag=ut,ht.isVariationSelector=W,ht.BLACK_FLAG_CODE_POINT=s;var yt={addChars:u,addFonts:w,getCharData:f,getFontByName:_,measureText:g,checkLoadedFonts:b,setIsLoaded:Ct};return ht.prototype=yt,ht}();function SlotManager(t){this.animationData=t;}SlotManager.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t};function slotFactory(t){return new SlotManager(t)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[];},addRenderableComponent:function(t){this.renderableComponents.indexOf(t)===-1&&this.renderableComponents.push(t);},removeRenderableComponent:function(t){this.renderableComponents.indexOf(t)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1);},prepareRenderableFrame:function(t){this.checkLayerLimits(t);},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show());},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide());},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0));},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1;},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1;},AudioElement.prototype.resume=function(){this._canPlay=!0;},AudioElement.prototype.setRate=function(t){this.audio.rate(t);},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume);},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(t){var e,i=this.layers.length,s;for(this.completeLayers=!0,e=i-1;e>=0;e-=1)this.elements[e]||(s=this.layers[e],s.ip-s.st<=t-this.layers[e].st&&s.op-s.st>t-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements();},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",l),this.element.maskedElement.setAttribute(f,"url("+getLocationHref()+"#"+l+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this);}MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.renderFrame=function(t){var e=this.element.finalTransform.mat,i,s=this.masksProperties.length;for(i=0;i1&&(s+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==s){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+s:s),i.elem.setAttribute("d",n)),i.lastPath=s;}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null;};var filtersFactory=function(){var t={};t.createFilter=e,t.createAlphaToLuminanceFilter=i;function e(s,r){var a=createNS("filter");return a.setAttribute("id",s),r!==!0&&(a.setAttribute("filterUnits","objectBoundingBox"),a.setAttribute("x","0%"),a.setAttribute("y","0%"),a.setAttribute("width","100%"),a.setAttribute("height","100%")),a}function i(){var s=createNS("feColorMatrix");return s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),s}return t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return (/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(t){var e,i="SourceGraphic",s=t.data.ef?t.data.ef.length:0,r=createElementID(),a=filtersFactory.createFilter(r,!0),n=0;this.filters=[];var p;for(e=0;e=0&&(i=this.shapeModifiers[t].processShapes(this._isFirstFrame),!i);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i.01)return !1;i+=1;}return !0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return !1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t0;)u=l.transformers[ot].mProps._mdf||u,W-=1,ot-=1;if(u)for(W=k-l.styles[g].lvl,ot=l.transformers.length-1;W>0;)q.multiply(l.transformers[ot].mProps.v),W-=1,ot-=1;}else q=t;if(z=l.sh.paths,v=z._length,u){for(w="",b=0;b=1?Ct=.99:Ct<=-1&&(Ct=-.99);var ht=gt*Ct,yt=Math.cos(ut+l.a.v)*ht+w[0],D=Math.sin(ut+l.a.v)*ht+w[1];b.setAttribute("fx",yt),b.setAttribute("fy",D),v&&!l.g._collapsable&&(l.of.setAttribute("fx",yt),l.of.setAttribute("fy",D));}}}function P(c,l,E){var b=l.style,v=l.d;v&&(v._mdf||E)&&v.dashStr&&(b.pElem.setAttribute("stroke-dasharray",v.dashStr),b.pElem.setAttribute("stroke-dashoffset",v.dashoffset[0])),l.c&&(l.c._mdf||E)&&b.pElem.setAttribute("stroke","rgb("+bmFloor(l.c.v[0])+","+bmFloor(l.c.v[1])+","+bmFloor(l.c.v[2])+")"),(l.o._mdf||E)&&b.pElem.setAttribute("stroke-opacity",l.o.v),(l.w._mdf||E)&&(b.pElem.setAttribute("stroke-width",l.w.v),b.msElem&&b.msElem.setAttribute("stroke-width",l.w.v));}return i}();function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[];}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes();},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e=this.shapes.length,i,s,r=this.stylesList.length,a,n=[],p=!1;for(s=0;s1&&p&&this.setShapesAsAnimated(n);}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e=0;h-=1){if(w=this.searchProcessedElement(t[h]),w?e[h]=i[w-1]:t[h]._render=n,t[h].ty==="fl"||t[h].ty==="st"||t[h].ty==="gf"||t[h].ty==="gs"||t[h].ty==="no")w?e[h].style.closed=!1:e[h]=this.createStyleElement(t[h],r),t[h]._render&&e[h].style.pElem.parentNode!==s&&s.appendChild(e[h].style.pElem),l.push(e[h].style);else if(t[h].ty==="gr"){if(!w)e[h]=this.createGroupElement(t[h]);else for(c=e[h].it.length,P=0;P1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this);},TextProperty.prototype.getValue=function(t){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!t)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var s,r=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(s=0;se);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e=[],i=0,s=t.length,r,a,n=!1,p=!1,h="";i=55296&&r<=56319?FontManager.isRegionalFlag(t,i)?h=t.substr(i,14):(a=t.charCodeAt(i+1),a>=56320&&a<=57343&&(FontManager.isModifier(r,a)?(h=t.substr(i,2),n=!0):FontManager.isFlagEmoji(t.substr(i,4))?h=t.substr(i,4):h=t.substr(i,2))):r>56319?(a=t.charCodeAt(i+1),FontManager.isVariationSelector(r)&&(n=!0)):FontManager.isZeroWidthJoiner(r)&&(n=!0,p=!0),n?(e[e.length-1]+=h,n=!1):e.push(h),i+=h.length;return e},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e=this.elem.globalData.fontManager,i=this.data,s=[],r,a,n,p=0,h,y=i.m.g,P=0,c=0,l=0,E=[],b=0,v=0,w,u,f=e.getFontByName(t.f),g,_=0,k=getFontProperties(f);t.fWeight=k.weight,t.fStyle=k.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),a=t.finalText.length,t.finalLineHeight=t.lh;var z=t.tr/1e3*t.finalSize,q;if(t.sz)for(var W=!0,ot=t.sz[0],mt=t.sz[1],gt,ut;W;){ut=this.buildFinalText(t.t),gt=0,b=0,a=ut.length,z=t.tr/1e3*t.finalSize;var Ct=-1;for(r=0;rot&&ut[r]!==" "?(Ct===-1?a+=1:r=Ct,gt+=t.finalLineHeight||t.finalSize*1.2,ut.splice(r,Ct===r?1:0,"\r"),Ct=-1,b=0):(b+=_,b+=z);gt+=f.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&mtv?b:v,b=-2*z,h="",n=!0,l+=1):h=yt,e.chars?(g=e.getCharData(yt,f.fStyle,e.getFontByName(t.f).fFamily),_=n?0:g.w*t.finalSize/100):_=e.measureText(h,t.f,t.finalSize),yt===" "?ht+=_+z:(b+=_+z+ht,ht=0),s.push({l:_,an:_,add:P,n,anIndexes:[],val:h,line:l,animatorJustifyOffset:0}),y==2){if(P+=_,h===""||h===" "||r===a-1){for((h===""||h===" ")&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;p+=1,P=0;}}else if(y==3){if(P+=_,h===""||r===a-1){for(h===""&&(P-=_);c<=r;)s[c].an=P,s[c].ind=p,s[c].extra=_,c+=1;P=0,p+=1;}}else s[p].ind=p,s[p].extra=0,p+=1;if(t.l=s,v=b>v?b:v,E.push(b),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0;}t.lineWidths=E;var D=i.a,V,S;u=D.length;var R,tt,J=[];for(w=0;w0?n=this.ne.v/100:p=-this.ne.v/100,this.xe.v>0?h=1-this.xe.v/100:y=1+this.xe.v/100;var P=BezierFactory.getBezierEasing(n,p,h,y).get,c=0,l=this.finalS,E=this.finalE,b=this.data.sh;if(b===2)E===l?c=a>=E?1:0:c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===3)E===l?c=a>=E?0:1:c=1-t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c=P(c);else if(b===4)E===l?c=0:(c=t(0,e(.5/(E-l)+(a-l)/(E-l),1)),c<.5?c*=2:c=1-2*(c-.5)),c=P(c);else if(b===5){if(E===l)c=0;else {var v=E-l;a=e(t(0,a+.5-l),E-l);var w=-v/2+a,u=v/2;c=Math.sqrt(1-w*w/(u*u));}c=P(c);}else b===6?(E===l?c=0:(a=e(t(0,a+.5-l),E-l),c=(1+Math.cos(Math.PI+Math.PI*2*a/(E-l)))/2),c=P(c)):(a>=i(l)&&(a-l<0?c=t(0,e(e(E,1)-(l-a),1)):c=t(0,e(E-a,1))),c=P(c));if(this.sm.v!==100){var f=this.sm.v*.01;f===0&&(f=1e-8);var g=.5-f*.5;c1&&(c=1));}return c*this.a.v},getValue:function(a){this.iterateDynamicProperties(),this._mdf=a||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,a&&this.data.r===2&&(this.e.v=this._currentTextLength);var n=this.data.r===2?1:100/this.data.totalChars,p=this.o.v/n,h=this.s.v/n+p,y=this.e.v/n+p;if(h>y){var P=h;h=y,y=P;}this.finalS=h,this.finalE=y;}},extendPrototype([DynamicPropertyContainer],s);function r(a,n,p){return new s(a,n)}return {getTextSelectorProp:r}}();function TextAnimatorDataProperty(t,e,i){var s={propType:!1},r=PropertyFactory.getProp,a=e.a;this.a={r:a.r?r(t,a.r,0,degToRads,i):s,rx:a.rx?r(t,a.rx,0,degToRads,i):s,ry:a.ry?r(t,a.ry,0,degToRads,i):s,sk:a.sk?r(t,a.sk,0,degToRads,i):s,sa:a.sa?r(t,a.sa,0,degToRads,i):s,s:a.s?r(t,a.s,1,.01,i):s,a:a.a?r(t,a.a,1,0,i):s,o:a.o?r(t,a.o,0,.01,i):s,p:a.p?r(t,a.p,1,0,i):s,sw:a.sw?r(t,a.sw,0,0,i):s,sc:a.sc?r(t,a.sc,1,0,i):s,fc:a.fc?r(t,a.fc,1,0,i):s,fh:a.fh?r(t,a.fh,0,0,i):s,fs:a.fs?r(t,a.fs,0,.01,i):s,fb:a.fb?r(t,a.fb,0,.01,i):s,t:a.t?r(t,a.t,0,0,i):s},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t;}function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i);}TextAnimatorProperty.prototype.searchProperties=function(){var t,e=this._textData.a.length,i,s=PropertyFactory.getProp;for(t=0;t=b+oe||!k?(ot=(b+oe-w)/v.partialLength,Xt=_.point[0]+(v.point[0]-_.point[0])*ot,Ht=_.point[1]+(v.point[1]-_.point[1])*ot,a.translate(-i[0]*l[P].an*.005,-(i[1]*ht)*.01),u=!1):k&&(w+=v.partialLength,f+=1,f>=k.length&&(f=0,g+=1,z[g]?k=z[g].points:gt.v.c?(f=0,g=0,k=z[g].points):(w-=v.partialLength,k=null)),k&&(_=v,v=k[f],q=v.partialLength));Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0);}else Vt=l[P].an/2-l[P].add,a.translate(-Vt,0,0),a.translate(-i[0]*l[P].an*.005,-i[1]*ht*.01,0);for(S=0;St?this.textSpans[t].span:createNS(p?"g":"text"),g<=t){if(h.setAttribute("stroke-linecap","butt"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=h,p){var k=createNS("g");h.appendChild(k),this.textSpans[t].childSpan=k;}this.textSpans[t].span=h,this.layerElement.appendChild(h);}h.style.display="inherit";}if(y.reset(),c&&(n[t].n&&(l=-v,E+=i.yOffset,E+=b?1:0,b=!1),this.applyTextPropertiesToMatrix(i,y,n[t].line,l,E),l+=n[t].l||0,l+=v),p){_=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily);var z;if(_.t===1)z=new SVGCompElement(_.data,this.globalData,this);else {var q=emptyShapeData;_.data&&_.data.shapes&&(q=this.buildShapeData(_.data,i.finalSize)),z=new SVGShapeElement(q,this.globalData,this);}if(this.textSpans[t].glyph){var W=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(W.layerElement),W.destroy();}this.textSpans[t].glyph=z,z._debug=!0,z.prepareFrame(0),z.renderFrame(),this.textSpans[t].childSpan.appendChild(z.layerElement),_.t===1&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")");}else c&&h.setAttribute("transform","translate("+y.props[12]+","+y.props[13]+")"),h.textContent=n[t].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");}c&&h&&h.setAttribute("d",P);}for(;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0));}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t0&&h<1&&r[l].push(this.calculateF(h,t,e,i,s,l))):(y=n*n-4*p*a,y>=0&&(P=(-n+bmSqrt(y))/(2*a),P>0&&P<1&&r[l].push(this.calculateF(P,t,e,i,s,l)),c=(-n-bmSqrt(y))/(2*a),c>0&&c<1&&r[l].push(this.calculateF(c,t,e,i,s,l)))));this.shapeBoundingBox.left=bmMin.apply(null,r[0]),this.shapeBoundingBox.top=bmMin.apply(null,r[1]),this.shapeBoundingBox.right=bmMax.apply(null,r[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,r[1]);},HShapeElement.prototype.calculateF=function(t,e,i,s,r,a){return bmPow(1-t,3)*e[a]+3*bmPow(1-t,2)*t*i[a]+3*(1-t)*bmPow(t,2)*s[a]+bmPow(t,3)*r[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var i,s=t.length;for(i=0;ii&&(i=r);}i*=t.mult;}else i=t.v*t.mult;e.x-=i,e.xMax+=i,e.y-=i,e.yMax+=i;},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax=0;e-=1){var s=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-s.p.v[0],-s.p.v[1],s.p.v[2]),this.mat.rotateX(-s.or.v[0]).rotateY(-s.or.v[1]).rotateZ(s.or.v[2]),this.mat.rotateX(-s.rx.v).rotateY(-s.ry.v).rotateZ(s.rz.v),this.mat.scale(1/s.s.v[0],1/s.s.v[1],1/s.s.v[2]),this.mat.translate(s.a.v[0],s.a.v[1],s.a.v[2]);}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var r;this.p?r=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:r=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)),n=[r[0]/a,r[1]/a,r[2]/a],p=Math.sqrt(n[2]*n[2]+n[0]*n[0]),h=Math.atan2(n[1],p),y=Math.atan2(n[0],-n[2]);this.mat.rotateY(y).rotateX(-h);}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var P=!this._prevMat.equals(this.mat);if((P||this.pe._mdf)&&this.comp.threeDElements){i=this.comp.threeDElements.length;var c,l,E;for(e=0;e=t)return this.threeDElements[e].perspectiveElem;e+=1;}return null},HybridRendererBase.prototype.createThreeDContainer=function(t,e){var i=createTag("div"),s,r;styleDiv(i);var a=createTag("div");if(styleDiv(a),e==="3d"){s=i.style,s.width=this.globalData.compSize.w+"px",s.height=this.globalData.compSize.h+"px";var n="50% 50%";s.webkitTransformOrigin=n,s.mozTransformOrigin=n,s.transformOrigin=n,r=a.style;var p="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";r.transform=p,r.webkitTransform=p;}i.appendChild(a);var h={container:a,perspectiveElem:i,startPos:t,endPos:t,type:e};return this.threeDElements.push(h),h},HybridRendererBase.prototype.build3dContainers=function(){var t,e=this.layers.length,i,s="";for(t=0;t=0;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem);},HybridRendererBase.prototype.addTo3dContainer=function(t,e){for(var i=0,s=this.threeDElements.length;ii?(r=t/this.globalData.compSize.w,a=t/this.globalData.compSize.w,n=0,p=(e-this.globalData.compSize.h*(t/this.globalData.compSize.w))/2):(r=e/this.globalData.compSize.h,a=e/this.globalData.compSize.h,n=(t-this.globalData.compSize.w*(e/this.globalData.compSize.h))/2,p=0);var h=this.resizerElem.style;h.webkitTransform="matrix3d("+r+",0,0,0,0,"+a+",0,0,0,0,1,0,"+n+","+p+",0,1)",h.transform=h.webkitTransform;},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none";},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block";},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else {var t=this.globalData.compSize.w,e=this.globalData.compSize.h,i,s=this.threeDElements.length;for(i=0;i=y;)mt/=2,gt/=2,ut>>>=1;return (mt+ut)/gt};return ot.int32=function(){return W.g(4)|0},ot.quick=function(){return W.g(4)/4294967296},ot.double=ot,w(f(W.S),t),(_.pass||k||function(mt,gt,ut,Ct){return Ct&&(Ct.S&&b(Ct,W),mt.state=function(){return b(W,{})}),ut?(e[n]=mt,gt):mt})(ot,q,"global"in _?_.global:this==e,_.state)}e["seed"+n]=l;function E(g){var _,k=g.length,z=this,q=0,W=z.i=z.j=0,ot=z.S=[];for(k||(g=[k++]);qi){var s=i;i=e,e=s;}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if(typeof t=="number"||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var i,s=Math.min(t.length,e.length),r=0;for(i=0;i.5?y/(2-r-a):y/(r+a),r){case e:n=(i-s)/y+(i1&&(i-=1),i<1/6?t+(e-t)*6*i:i<1/2?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e=t[0],i=t[1],s=t[2],r,a,n;if(i===0)r=s,n=s,a=s;else {var p=s<.5?s*(1+i):s+i-s*i,h=2*s-p;r=hue2rgb(h,p,e+1/3),a=hue2rgb(h,p,e),n=hue2rgb(h,p,e-1/3);}return [r,a,n,t[3]]}function linear(t,e,i,s,r){if((s===void 0||r===void 0)&&(s=e,r=i,e=0,i=1),i=i)return r;var n=i===e?0:(t-e)/(i-e);if(!s.length)return s+(r-s)*n;var p,h=s.length,y=createTypedArray("float32",h);for(p=0;p1){for(r=0;r1?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(r)){var p,h=r.length,y=createTypedArray("float32",h);for(p=0;pdata.k[e].t&&tdata.k[e+1].t-t?(s=e+2,r=data.k[e+1].t):(s=e+1,r=data.k[e].t);break}s===-1&&(s=e+1,r=data.k[e].t);}var a={};return a.index=s,a.time=r/elem.comp.globalData.frameRate,a}function key(t){var e,i,s;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(s=r.length,i=0;iw.length-1)&&(E=w.length-1),g=w[w.length-1-E].t,f=u-g);var _,k,z;if(l==="pingpong"){var q=Math.floor((v-g)/f);if(q%2!==0)return this.getValueAtTime((f-(v-g)%f+g)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(g/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(u/this.comp.globalData.frameRate,0),mt=this.getValueAtTime(((v-g)%f+g)/this.comp.globalData.frameRate,0),gt=Math.floor((v-g)/f);if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_=u)return this.pv;var f,g;b?(E?f=Math.abs(this.elem.comp.globalData.frameRate*E):f=Math.max(0,this.elem.data.op-u),g=u+f):((!E||E>w.length-1)&&(E=w.length-1),g=w[E].t,f=g-u);var _,k,z;if(l==="pingpong"){var q=Math.floor((u-v)/f);if(q%2===0)return this.getValueAtTime(((u-v)%f+u)/this.comp.globalData.frameRate,0)}else if(l==="offset"){var W=this.getValueAtTime(u/this.comp.globalData.frameRate,0),ot=this.getValueAtTime(g/this.comp.globalData.frameRate,0),mt=this.getValueAtTime((f-(u-v)%f+u)/this.comp.globalData.frameRate,0),gt=Math.floor((u-v)/f)+1;if(this.pv.length){for(z=new Array(W.length),k=z.length,_=0;_1?(w-v)/(E-1):1,f=0,g=0,_;this.pv.length?_=createTypedArray("float32",this.pv.length):_=0;for(var k;fu){var z=f,q=b.c&&f===g-1?0:f+1,W=(u-_)/w[f].addedLength;k=bez.getPointInSegment(b.v[z],b.v[q],b.o[z],b.i[q],W,w[f]);break}else _+=w[f].addedLength;f+=1;}return k||(k=b.c?[b.v[0][0],b.v[0][1]]:[b.v[b._length-1][0],b.v[b._length-1][1]]),k},vectorOnPath:function(l,E,b){l==1?l=this.v.c:l==0&&(l=.999);var v=this.pointOnPath(l,E),w=this.pointOnPath(l+.001,E),u=w[0]-v[0],f=w[1]-v[1],g=Math.sqrt(Math.pow(u,2)+Math.pow(f,2));if(g===0)return [0,0];var _=b==="tangent"?[u/g,f/g]:[-f/g,u/g];return _},tangentOnPath:function(l,E){return this.vectorOnPath(l,E,"tangent")},normalOnPath:function(l,E){return this.vectorOnPath(l,E,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([P],h),extendPrototype([P],y),y.prototype.getValueAtTime=p,y.prototype.initiateExpression=ExpressionManager.initiateExpression;var c=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(l,E,b,v,w){var u=c(l,E,b,v,w);return u.propertyIndex=E.ix,u.lock=!1,b===3?expressionHelpers.searchExpressions(l,E.pt,u):b===4&&expressionHelpers.searchExpressions(l,E.ks,u),u.k&&l.addDynamicProperty(u),u};}function initialize$1(){addPropertyDecorator();}function addDecorator(){function t(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(e,i){var s=this.calculateExpression(i);if(e.t!==s){var r={};return this.copyData(r,e),r.t=s.toString(),r.__complete=!1,r}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),i=this.searchExpressions();return this.kf=e||i,this.kf},TextProperty.prototype.searchExpressions=t;}function initialize(){addDecorator();}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function t(e,i){var s=createNS("feMerge");s.setAttribute("result",e);var r,a;for(a=0;a=y?c=b<0?s:r:c=s+E*Math.pow((p-t)/b,1/i),P[l]=c,l+=1,a+=256/(n-1);return P.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e));}};function SVGDropShadowEffect(t,e,i,s,r){var a=e.container.globalData.renderConfig.filterSize,n=e.data.fs||a;t.setAttribute("x",n.x||a.x),t.setAttribute("y",n.y||a.y),t.setAttribute("width",n.width||a.width),t.setAttribute("height",n.height||a.height),this.filterManager=e;var p=createNS("feGaussianBlur");p.setAttribute("in","SourceAlpha"),p.setAttribute("result",s+"_drop_shadow_1"),p.setAttribute("stdDeviation","0"),this.feGaussianBlur=p,t.appendChild(p);var h=createNS("feOffset");h.setAttribute("dx","25"),h.setAttribute("dy","0"),h.setAttribute("in",s+"_drop_shadow_1"),h.setAttribute("result",s+"_drop_shadow_2"),this.feOffset=h,t.appendChild(h);var y=createNS("feFlood");y.setAttribute("flood-color","#00ff00"),y.setAttribute("flood-opacity","1"),y.setAttribute("result",s+"_drop_shadow_3"),this.feFlood=y,t.appendChild(y);var P=createNS("feComposite");P.setAttribute("in",s+"_drop_shadow_3"),P.setAttribute("in2",s+"_drop_shadow_2"),P.setAttribute("operator","in"),P.setAttribute("result",s+"_drop_shadow_4"),t.appendChild(P);var c=this.createMergeNode(s,[s+"_drop_shadow_4",r]);t.appendChild(c);}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(e[0]*255),Math.round(e[1]*255),Math.round(e[2]*255)));}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,s=(this.filterManager.effectElements[2].p.v-90)*degToRads,r=i*Math.cos(s),a=i*Math.sin(s);this.feOffset.setAttribute("dx",r),this.feOffset.setAttribute("dy",a);}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=i,i.matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement;}SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,i=_svgMatteSymbols.length;e{An();qn();Tn();ca();wc={name:"@dotlottie/common",version:"0.7.11",type:"module",description:"",author:"Afsal , Sam Osborne ",license:"MIT",engines:{node:">18.0.0"},module:"dist/index.js",main:"dist/index.js",types:"dist/index.d.ts",files:["dist"],keywords:[],scripts:{build:"tsup",dev:"tsup --watch",lint:"eslint .","type-check":"tsc --noEmit"},dependencies:{"@dotlottie/dotlottie-js":"^0.7.0","@preact/signals-core":"^1.2.3",howler:"^2.2.3","lottie-web":"^5.12.2",xstate:"^4.38.1"},devDependencies:{"@lottiefiles/lottie-types":"^1.2.0","@types/howler":"^2.2.8",tsup:"^7.2.0",typescript:"^4.7.4"},publishConfig:{access:"public"}},sr=(t=>(t.Complete="complete",t.DataFail="data_fail",t.DataReady="data_ready",t.Error="error",t.Frame="frame",t.Freeze="freeze",t.LoopComplete="loopComplete",t.Pause="pause",t.Play="play",t.Ready="ready",t.Stop="stop",t.VisibilityChange="visibilityChange",t))(sr||{}),Ir=(t=>(t.Completed="completed",t.Error="error",t.Fetching="fetching",t.Frozen="frozen",t.Initial="initial",t.Loading="loading",t.Paused="paused",t.Playing="playing",t.Ready="ready",t.Stopped="stopped",t))(Ir||{}),exports.PlayMode=(t=>(t.Bounce="bounce",t.Normal="normal",t))(exports.PlayMode||{}),cs={autoplay:!1,direction:1,hover:!1,intermission:0,loop:!1,playMode:"normal",speed:1,defaultTheme:""},Wn={activeStateId:"",autoplay:!1,currentState:"initial",frame:0,seeker:0,direction:1,hover:!1,loop:!1,playMode:"normal",speed:1,background:"transparent",intermission:0,currentAnimationId:void 0,visibilityPercentage:0},Xn=class{_lottie;_src;_animationConfig;_prevUserPlaybackOptions={};_userPlaybackOptions;_hover=!1;_loop=!1;_counter=0;_intermission=0;_counterInterval=null;_container=null;_name;_mode="normal";_background="transparent";_animation;_defaultTheme;_activeAnimationId;_currentAnimationId;_testId;_listeners=new Map;_currentState="initial";_stateBeforeFreeze="initial";state=new Bh(Wn);_light=!1;_worker=!1;_dotLottieLoader=new Dh;_activeStateId;_inInteractiveMode=!1;_scrollTicking=!1;_scrollCallback=void 0;_onShowIntersectionObserver=void 0;_visibilityPercentage=0;_audios=[];_stateMachineManager;constructor(t,e,i){typeof t=="string"?this._src=t:this._src=Ua(t),i!=null&&i.testId&&(this._testId=i.testId),this._defaultTheme=(i==null?void 0:i.defaultTheme)||"",this._userPlaybackOptions=this._validatePlaybackOptions(i||{}),typeof(i==null?void 0:i.activeAnimationId)=="string"&&(this._activeAnimationId=i.activeAnimationId),this._container=e||null,typeof(i==null?void 0:i.background)=="string"&&this.setBackground(i.background),typeof(i==null?void 0:i.activeStateId)<"u"&&(this._activeStateId=i.activeStateId);let{rendererSettings:s,...r}=i||{};this._animationConfig={loop:!1,autoplay:!1,renderer:"svg",rendererSettings:{clearCanvas:!0,progressiveLoad:!0,hideOnTransparent:!0,filterSize:{width:"200%",height:"200%",x:"-50%",y:"-50%"},...s},...r},i!=null&&i.light&&(this._light=i.light),i!=null&&i.worker&&(this._worker=i.worker),this._listenToHover(),this._listenToVisibilityChange();}_listenToHover(){var t,e,i,s;let r=()=>{this._hover&&this.currentState!=="playing"&&this.play();},a=()=>{this._hover&&this.currentState==="playing"&&this.stop();};(t=this._container)==null||t.removeEventListener("mouseenter",r),(e=this._container)==null||e.removeEventListener("mouseleave",a),(i=this._container)==null||i.addEventListener("mouseleave",a),(s=this._container)==null||s.addEventListener("mouseenter",r);}_onVisibilityChange(){!this._lottie||typeof document>"u"||(document.hidden&&this.currentState==="playing"?this.freeze():this.currentState==="frozen"&&this.unfreeze());}_listenToVisibilityChange(){typeof document<"u"&&typeof document.hidden<"u"&&document.addEventListener("visibilitychange",()=>this._onVisibilityChange());}_getOption(t){var e;if(typeof this._userPlaybackOptions[t]<"u")return this._userPlaybackOptions[t];let i=(e=this._dotLottieLoader.manifest)==null?void 0:e.animations.find(s=>s.id===this._currentAnimationId);return i&&typeof i[t]<"u"?i[t]:cs[t]}_getPlaybackOptions(){let t={};for(let e in cs)typeof cs[e]<"u"&&(t[e]=this._getOption(e));return t}_setPlayerState(t){var e,i,s;let r=t(this._getPlaybackOptions());try{fo._parse(r);}catch{li(`Invalid PlaybackOptions, ${JSON.stringify(r,null,2)}`);return}typeof r.defaultTheme<"u"&&(this._defaultTheme=r.defaultTheme),typeof r.playMode<"u"&&(this._mode=r.playMode),typeof r.intermission<"u"&&(this._intermission=r.intermission),typeof r.hover<"u"&&(this._hover=r.hover),typeof r.loop<"u"&&(this.clearCountTimer(),this._loop=r.loop,this._counter=0,(e=this._lottie)==null||e.setLoop(typeof r.loop=="number"?!0:r.loop)),typeof r.speed<"u"&&((i=this._lottie)==null||i.setSpeed(r.speed)),typeof r.autoplay<"u"&&this._lottie&&(this._lottie.autoplay=r.autoplay),typeof r.direction<"u"&&((s=this._lottie)==null||s.setDirection(r.direction));}_getOptionsFromAnimation(t){let{id:e,...i}=t;return {...cs,...i}}_updateTestData(){!this._testId||!this._lottie||(window.dotLottiePlayer||(window.dotLottiePlayer={[this._testId]:{}}),window.dotLottiePlayer[this._testId]={direction:this._lottie.playDirection,currentState:this._currentState,loop:this.loop,mode:this._mode,speed:this._lottie.playSpeed});}setContainer(t){t!==this._container&&(this._container=t,this.setBackground(this._background),this._listenToHover());}get currentState(){return this._currentState}clearCountTimer(){this._counterInterval&&clearInterval(this._counterInterval);}setCurrentState(t){this._currentState=t,this._notify(),this._updateTestData();}static isPathJSON(t){var e;return ((e=t.split(".").pop())==null?void 0:e.toLowerCase())==="json"}get src(){return this._src}updateSrc(t){this._src!==t&&(typeof t=="string"?this._src=t:this._src=Ua(t),this._activeAnimationId=void 0,this._currentAnimationId=void 0,this.load());}get intermission(){return this._intermission}get hover(){return this._hover}setHover(t){typeof t=="boolean"&&(this._hover=t,this._userPlaybackOptions.hover=t,this._notify());}setIntermission(t){this._intermission=t,this._userPlaybackOptions.intermission=t,this._notify();}get mode(){return this._mode}get animations(){return this._dotLottieLoader.animationsMap}get themes(){return this._dotLottieLoader.themeMap}setMode(t){typeof t=="string"&&(this._mode=t,this._userPlaybackOptions.playMode=t,this._setPlayerState(()=>({playMode:t})),this._notify(),this._updateTestData());}get container(){if(this._container)return this._container}goToAndPlay(t,e,i){if(!this._lottie||["loading"].includes(this._currentState)){li("goToAndPlay() Can't use whilst loading.");return}this._lottie.goToAndPlay(t,e,i),this.setCurrentState("playing");}goToAndStop(t,e,i){if(!this._lottie||["loading"].includes(this._currentState)){li("goToAndStop() Can't use whilst loading.");return}this._lottie.goToAndStop(t,e,i),this.setCurrentState("stopped");}seek(t){if(!this._lottie||["loading"].includes(this._currentState)){li("seek() Can't use whilst loading.");return}let e=t;typeof e=="number"&&(e=Math.round(e));let i=/^(\d+)(%?)$/u.exec(e.toString());if(!i)return;let s=i[2]==="%"?this.totalFrames*Number(i[1])/100:i[1];s!==void 0&&(this._lottie.goToAndPlay(s,!0),this.currentState==="playing"?this.play():this.currentState==="frozen"?this.freeze():this.pause());}_areNumbersInRange(t,e){return t>=0&&t<=1&&e>=0&&e<=1}_updatePosition(t,e,i){let[s,r]=t!=null?t:[0,this.totalFrames-1],[a,n]=e!=null?e:[0,1];if(!this._areNumbersInRange(a,n)){er("threshold values must be between 0 and 1");return}if(this.container){let{height:p,top:h}=this.container.getBoundingClientRect(),y=window.innerHeight-h,P=window.innerHeight+p,c=y/P,l=s+Math.round((c-a)/(n-a)*(r-s));i&&i(c),this.goToAndStop(l,!0),(l>=r||c>=n)&&this._handleAnimationComplete();}this._scrollTicking=!1;}_requestTick(t,e,i){this._scrollTicking||(requestAnimationFrame(()=>this._updatePosition(t,e,i)),this._scrollTicking=!0);}playOnScroll(t){this.stop(),this._scrollCallback&&this.stopPlayOnScroll(),this._scrollCallback=()=>this._requestTick(t==null?void 0:t.segments,t==null?void 0:t.threshold,t==null?void 0:t.positionCallback),window.addEventListener("scroll",this._scrollCallback);}stopPlayOnScroll(){this._scrollCallback&&(window.removeEventListener("scroll",this._scrollCallback),this._scrollCallback=void 0);}stopPlayOnShow(){this._onShowIntersectionObserver&&(this._onShowIntersectionObserver.disconnect(),this._onShowIntersectionObserver=void 0);}addIntersectionObserver(t){if(!this.container)throw Ie("Can't play on show, player container element not available.");let e={root:null,rootMargin:"0px",threshold:t!=null&&t.threshold?t.threshold:[0,1]},i=s=>{s.forEach(r=>{var a,n;this._visibilityPercentage=r.intersectionRatio*100,r.isIntersecting?(t!=null&&t.callbackOnIntersect&&t.callbackOnIntersect(this._visibilityPercentage),(a=this._container)==null||a.dispatchEvent(new Event("visibilityChange"))):t!=null&&t.callbackOnIntersect&&(t.callbackOnIntersect(0),(n=this._container)==null||n.dispatchEvent(new Event("visibilityChange")));});};this._onShowIntersectionObserver=new IntersectionObserver(i,e),this._onShowIntersectionObserver.observe(this.container);}playOnShow(t){var e;if(this.stop(),!this.container)throw Ie("Can't play on show, player container element not available.");this._onShowIntersectionObserver&&this.stopPlayOnShow(),this.addIntersectionObserver({threshold:(e=t==null?void 0:t.threshold)!=null?e:[],callbackOnIntersect:i=>{i===0?this.pause():this.play();}});}_validatePlaybackOptions(t){if(!t)return {};let e={};for(let[i,s]of Object.entries(t))switch(i){case"autoplay":typeof s=="boolean"&&(e.autoplay=s);break;case"direction":typeof s=="number"&&[1,-1].includes(s)&&(e.direction=s);break;case"loop":(typeof s=="boolean"||typeof s=="number")&&(e.loop=s);break;case"playMode":typeof s=="string"&&["normal","bounce"].includes(s)&&(e.playMode=s);break;case"speed":typeof s=="number"&&(e.speed=s);break;case"themeColor":typeof s=="string"&&(e.themeColor=s);break;case"hover":typeof s=="boolean"&&(e.hover=s);break;case"intermission":typeof s=="number"&&(e.intermission=s);break;case"defaultTheme":typeof s=="string"&&(e.defaultTheme=s);break}return this._requireValidPlaybackOptions(e),e}_requireAnimationsInTheManifest(){var t;if(!((t=this._dotLottieLoader.manifest)!=null&&t.animations.length))throw Ie("No animations found in manifest.")}_requireAnimationsToBeLoaded(){if(this._dotLottieLoader.animationsMap.size===0)throw Ie("No animations have been loaded.")}async play(t,e){var i,s;if(["initial","loading"].includes(this._currentState)){li("Player unable to play whilst loading.");return}if(this._requireAnimationsInTheManifest(),this._requireAnimationsToBeLoaded(),this._lottie&&!t){this._lottie.playDirection===-1&&this._lottie.currentFrame===0?this._lottie.goToAndPlay(this._lottie.totalFrames,!0):this._lottie.play(),this.setCurrentState("playing");return}if(typeof t=="number"){let r=(i=this._dotLottieLoader.manifest)==null?void 0:i.animations[t];if(!r)throw Ie("animation not found.");typeof e=="function"?await this.render({id:r.id,...e(this._getPlaybackOptions(),this._getOptionsFromAnimation(r))}):await this.render({id:r.id});}if(typeof t=="string"){let r=(s=this._dotLottieLoader.manifest)==null?void 0:s.animations.find(a=>a.id===t);if(!r)throw Ie("animation not found.");typeof e=="function"?await this.render({id:r.id,...e(this._getPlaybackOptions(),this._getOptionsFromAnimation(r))}):await this.render({id:r.id});}}playSegments(t,e){if(!this._lottie||["loading"].includes(this._currentState)){li("playSegments() Can't use whilst loading.");return}this._lottie.playSegments(t,e),this.setCurrentState("playing");}resetSegments(t){if(!this._lottie||["loading"].includes(this._currentState)){li("resetSegments() Can't use whilst loading.");return}this._lottie.resetSegments(t);}togglePlay(){this.currentState==="playing"?this.pause():this.play();}_getAnimationByIdOrIndex(t){var e,i;if(this._requireAnimationsInTheManifest(),this._requireAnimationsToBeLoaded(),typeof t=="number"){let s=(e=this._dotLottieLoader.manifest)==null?void 0:e.animations[t];if(!s)throw Ie("animation not found.");return s}if(typeof t=="string"){let s=(i=this._dotLottieLoader.manifest)==null?void 0:i.animations.find(r=>r.id===t);if(!s)throw Ie("animation not found.");return s}throw Ie("first param must be a number or string")}get activeAnimationId(){return this._getActiveAnimationId()}get currentAnimationId(){return this._currentAnimationId}get activeStateId(){return this._activeStateId}async _startInteractivity(t){if(!this._inInteractiveMode){er("Can't start interactivity. Not in interactive mode. Call enterInteractiveMode(stateId: string) to start.");return}if(this._dotLottieLoader.stateMachinesMap.size===0&&await this._dotLottieLoader.getStateMachines(),this._dotLottieLoader.stateMachinesMap.size===0)throw Ie("No interactivity states are available.");if(t==="undefined")throw Ie("stateId is not specified.");this._stateMachineManager||(this._stateMachineManager=await ul(Array.from(this._dotLottieLoader.stateMachinesMap.values()),this)),this._stateMachineManager.start(t);}enterInteractiveMode(t){var e;if(t)this._inInteractiveMode||(this._prevUserPlaybackOptions={...this._userPlaybackOptions}),this._inInteractiveMode&&((e=this._stateMachineManager)==null||e.stop()),this._activeStateId=t,this._inInteractiveMode=!0,this._startInteractivity(t);else throw Ie("stateId must be a non-empty string.")}exitInteractiveMode(){var t;this._inInteractiveMode&&(this._inInteractiveMode=!1,this._activeStateId="",(t=this._stateMachineManager)==null||t.stop(),this._userPlaybackOptions={},this._userPlaybackOptions={...this._prevUserPlaybackOptions},this._prevUserPlaybackOptions={},this.reset());}reset(){var t;let e=this._getActiveAnimationId(),i=(t=this._dotLottieLoader.manifest)==null?void 0:t.animations.find(s=>s.id===e);if(this._inInteractiveMode&&this.exitInteractiveMode(),!i)throw Ie("animation not found.");this.play(e);}previous(t){if(!this._dotLottieLoader.manifest||!this._dotLottieLoader.manifest.animations.length)throw Ie("manifest not found.");if(this._inInteractiveMode){li("previous() is not supported in interactive mode.");return}let e=this._dotLottieLoader.manifest.animations.findIndex(s=>s.id===this._currentAnimationId);if(e===-1)throw Ie("animation not found.");let i=this._dotLottieLoader.manifest.animations[(e-1+this._dotLottieLoader.manifest.animations.length)%this._dotLottieLoader.manifest.animations.length];if(!i||!i.id)throw Ie("animation not found.");typeof t=="function"?this.render({id:i.id,...t(this._getPlaybackOptions(),this._getOptionsFromAnimation(i))}):this.render({id:i.id});}next(t){if(!this._dotLottieLoader.manifest||!this._dotLottieLoader.manifest.animations.length)throw Ie("manifest not found.");if(this._inInteractiveMode){li("next() is not supported in interactive mode.");return}let e=this._dotLottieLoader.manifest.animations.findIndex(s=>s.id===this._currentAnimationId);if(e===-1)throw Ie("animation not found.");let i=this._dotLottieLoader.manifest.animations[(e+1)%this._dotLottieLoader.manifest.animations.length];if(!i||!i.id)throw Ie("animation not found.");typeof t=="function"?this.render({id:i.id,...t(this._getPlaybackOptions(),this._getOptionsFromAnimation(i))}):this.render({id:i.id});}getManifest(){return this._dotLottieLoader.manifest}resize(){if(!this._lottie||["loading"].includes(this._currentState)){li("resize() Can't use whilst loading.");return}this._lottie.resize();}stop(){if(!this._lottie||["loading"].includes(this._currentState)){li("stop() Can't use whilst loading.");return}this.clearCountTimer(),this._counter=0,this._setPlayerState(()=>({direction:this._getOption("direction")})),this._lottie.stop(),this.setCurrentState("stopped");}pause(){if(!this._lottie||["loading"].includes(this._currentState)){li("pause() Can't use whilst loading.");return}this.clearCountTimer(),this._lottie.pause(),this.setCurrentState("paused");}freeze(){if(!this._lottie||["loading"].includes(this._currentState)){li("freeze() Can't use whilst loading.");return}this.currentState!=="frozen"&&(this._stateBeforeFreeze=this.currentState),this._lottie.pause(),this.setCurrentState("frozen");}unfreeze(){if(!this._lottie||["loading"].includes(this._currentState)){li("unfreeze() Can't use whilst loading.");return}this._stateBeforeFreeze==="playing"?this.play():this.pause();}destroy(){var t,e;(t=this._container)!=null&&t.__lottie&&(this._container.__lottie.destroy(),this._container.__lottie=null),this._audios.length&&(this._audios.forEach(i=>{i.unload();}),this._audios=[]),this.clearCountTimer(),typeof document<"u"&&document.removeEventListener("visibilitychange",()=>this._onVisibilityChange()),this._counter=0,(e=this._lottie)==null||e.destroy(),this._lottie=void 0;}getAnimationInstance(){return this._lottie}static getLottieWebVersion(){return `${wc.dependencies["lottie-web"]}`}addEventListener(t,e){var i,s,r;this._listeners.has(t)||this._listeners.set(t,new Set),(i=this._listeners.get(t))==null||i.add(e);try{t==="complete"?(s=this._container)==null||s.addEventListener(t,e):(r=this._lottie)==null||r.addEventListener(t,e);}catch(a){er(`addEventListener ${a}`);}}getState(){var t,e,i,s,r,a,n;return {autoplay:(e=(t=this._lottie)==null?void 0:t.autoplay)!=null?e:!1,currentState:this._currentState,frame:this._frame,visibilityPercentage:this._visibilityPercentage,seeker:this._seeker,direction:(s=(i=this._lottie)==null?void 0:i.playDirection)!=null?s:1,hover:this._hover,loop:this._loop||!1,playMode:this._mode,speed:(a=(r=this._lottie)==null?void 0:r.playSpeed)!=null?a:1,background:this._background,intermission:this._intermission,defaultTheme:this._defaultTheme,currentAnimationId:this._currentAnimationId,activeStateId:(n=this._activeStateId)!=null?n:""}}_notify(){this.state.setState(this.getState());}get totalFrames(){var t;return ((t=this._lottie)==null?void 0:t.totalFrames)||0}get direction(){return this._lottie?this._lottie.playDirection:1}setDirection(t){this._requireValidDirection(t),this._setPlayerState(()=>({direction:t})),this._userPlaybackOptions.direction=t;}get speed(){var t;return ((t=this._lottie)==null?void 0:t.playSpeed)||1}setSpeed(t){this._requireValidSpeed(t),this._setPlayerState(()=>({speed:t})),this._userPlaybackOptions.speed=t;}get autoplay(){var t,e;return (e=(t=this._lottie)==null?void 0:t.autoplay)!=null?e:!1}setAutoplay(t){if(this._requireValidAutoplay(t),!this._lottie||["loading"].includes(this._currentState)){li("setAutoplay() Can't use whilst loading.");return}this._setPlayerState(()=>({autoplay:t})),this._userPlaybackOptions.autoplay=t;}toggleAutoplay(){if(!this._lottie||["loading"].includes(this._currentState)){li("toggleAutoplay() Can't use whilst loading.");return}this.setAutoplay(!this._lottie.autoplay);}get defaultTheme(){return this._defaultTheme}setDefaultTheme(t){this._setPlayerState(()=>({defaultTheme:t})),this._userPlaybackOptions.defaultTheme=t,this._animation&&this.render();}get loop(){return this._loop}setLoop(t){this._requireValidLoop(t),this._setPlayerState(()=>({loop:t})),this._userPlaybackOptions.loop=t;}toggleLoop(){if(!this._lottie||["loading"].includes(this._currentState)){li("toggleLoop() Can't use whilst loading.");return}this.setLoop(!this._loop);}get background(){return this._background}setBackground(t){this._requireValidBackground(t),this._background=t,this._container&&(this._container.style.backgroundColor=t);}get _frame(){return this._lottie?this.currentState==="completed"?this.direction===-1?0:this._lottie.totalFrames:this._lottie.currentFrame:0}get _seeker(){return this._lottie?this._frame/this._lottie.totalFrames*100:0}async revertToManifestValues(t){var e;let i;!Array.isArray(t)||t.length===0?i=["autoplay","defaultTheme","direction","hover","intermission","loop","playMode","speed","activeAnimationId"]:i=t;let s=!1;if(i.includes("activeAnimationId")){let r=(e=this._dotLottieLoader.manifest)==null?void 0:e.activeAnimationId,a=this._getAnimationByIdOrIndex(r||0);this._activeAnimationId=r,await this._setCurrentAnimation(a.id),s=!0;}i.forEach(r=>{switch(r){case"autoplay":delete this._userPlaybackOptions.autoplay,this.setAutoplay(this._getOption("autoplay"));break;case"defaultTheme":delete this._userPlaybackOptions.defaultTheme,this.setDefaultTheme(this._getOption("defaultTheme"));break;case"direction":delete this._userPlaybackOptions.direction,this.setDirection(this._getOption("direction"));break;case"hover":delete this._userPlaybackOptions.hover,this.setHover(this._getOption("hover"));break;case"intermission":delete this._userPlaybackOptions.intermission,this.setIntermission(this._getOption("intermission"));break;case"loop":delete this._userPlaybackOptions.loop,this.setLoop(this._getOption("loop"));break;case"playMode":delete this._userPlaybackOptions.playMode,this.setMode(this._getOption("playMode")),this.setDirection(this._getOption("direction"));break;case"speed":delete this._userPlaybackOptions.speed,this.setSpeed(this._getOption("speed"));break}}),s&&this.render();}removeEventListener(t,e){var i,s,r;try{t==="complete"?(i=this._container)==null||i.removeEventListener(t,e):(s=this._lottie)==null||s.removeEventListener(t,e),(r=this._listeners.get(t))==null||r.delete(e);}catch(a){er("removeEventListener",a);}}_handleAnimationComplete(){var t;typeof this._loop=="number"&&this.stop();let e=this.direction===-1?0:this.totalFrames-1;this.goToAndStop(e,!0),this._counter=0,this.clearCountTimer(),this.setCurrentState("completed"),(t=this._container)==null||t.dispatchEvent(new Event("complete"));}addEventListeners(){var t;if(!this._lottie||["loading"].includes(this._currentState)){li("addEventListeners() Can't use whilst loading.");return}this._lottie.addEventListener("enterFrame",()=>{var e;if(!this._lottie){li("enterFrame event : Lottie is undefined.");return}Math.floor(this._lottie.currentFrame)===0&&this.direction===-1&&((e=this._container)==null||e.dispatchEvent(new Event("complete")),this.loop||this.setCurrentState("completed")),this._notify();}),this._lottie.addEventListener("loopComplete",()=>{var e;if(!this._lottie){li("loopComplete event : Lottie is undefined.");return}(e=this._container)==null||e.dispatchEvent(new Event("loopComplete")),this.intermission>0&&this.pause();let i=this._lottie.playDirection;if(typeof this._loop=="number"&&this._loop>0&&(this._counter+=this._mode==="bounce"?.5:1,this._counter>=this._loop)){this._handleAnimationComplete();return}this._mode==="bounce"&&typeof i=="number"&&(i=Number(i)*-1);let s=i===-1?this._lottie.totalFrames-1:0;this.intermission?(this.goToAndPlay(s,!0),this.pause(),this._counterInterval=window.setTimeout(()=>{this._lottie&&(this._setPlayerState(()=>({direction:i})),this.goToAndPlay(s,!0));},this._intermission)):(this._setPlayerState(()=>({direction:i})),this.goToAndPlay(i===-1?this.totalFrames-1:0,!0));}),this._lottie.addEventListener("complete",()=>{if(this._lottie&&this._loop===!1&&this._mode==="bounce"){if(this._counter+=.5,this._counter>=1){this._handleAnimationComplete();return}this._counterInterval=window.setTimeout(()=>{if(!this._lottie)return;let e=this._lottie.playDirection;this._mode==="bounce"&&typeof e=="number"&&(e=Number(e)*-1);let i=e===-1?this.totalFrames-1:0;this._setPlayerState(()=>({direction:e})),this.goToAndPlay(i,!0);},this._intermission);}else this._handleAnimationComplete();});for(let[e,i]of this._listeners)if(e==="complete")for(let s of i)(t=this._container)==null||t.addEventListener(e,s);else for(let s of i)this._lottie.addEventListener(e,s);}async _setCurrentAnimation(t){this._currentState="loading";let e=await this._dotLottieLoader.getAnimation(t);this._currentAnimationId=t,this._animation=e,this._currentState="ready";}async _getAudioFactory(){if(this._animation&&yo(this._animation)){let{DotLottieAudio:t}=await Promise.resolve().then(()=>(dl(),ml));return e=>{let i=new t({src:[e]});return this._audios.push(i),i}}return null}async render(t){var e,i,s,r,a,n,p,h,y,P,c,l,E,b,v,w,u,f;if(t!=null&&t.id)await this._setCurrentAnimation(t.id);else if(!this._animation)throw Ie("no animation selected");let g=(e=cs.loop)!=null?e:!1,_=(i=cs.autoplay)!=null?i:!1,k=(s=cs.playMode)!=null?s:"normal",z=(r=cs.intermission)!=null?r:0,q=(a=cs.hover)!=null?a:!1,W=(n=cs.direction)!=null?n:1,ot=(p=cs.speed)!=null?p:1,mt=(h=cs.defaultTheme)!=null?h:"";g=(y=t==null?void 0:t.loop)!=null?y:this._getOption("loop"),_=(P=t==null?void 0:t.autoplay)!=null?P:this._getOption("autoplay"),k=(c=t==null?void 0:t.playMode)!=null?c:this._getOption("playMode"),z=(l=t==null?void 0:t.intermission)!=null?l:this._getOption("intermission"),q=(E=t==null?void 0:t.hover)!=null?E:this._getOption("hover"),W=(b=t==null?void 0:t.direction)!=null?b:this._getOption("direction"),ot=(v=t==null?void 0:t.speed)!=null?v:this._getOption("speed"),mt=(w=t==null?void 0:t.defaultTheme)!=null?w:this._getOption("defaultTheme");let gt={...this._animationConfig,autoplay:q?!1:_,loop:typeof g=="number"?!0:g,renderer:this._worker?"svg":(u=this._animationConfig.renderer)!=null?u:"svg"},[ut,Ct,ht]=await Promise.all([this._dotLottieLoader.getTheme(mt),this._getLottiePlayerInstance(),this._getAudioFactory()]);if(ut&&this._animation?(this._animation=Ua(this._animation),this._animation.slots=ut):this._animation=await this._dotLottieLoader.getAnimation((f=this._currentAnimationId)!=null?f:""),this._activeStateId&&!this._inInteractiveMode){this.enterInteractiveMode(this._activeStateId);return}this.destroy(),this._setPlayerState(()=>({defaultTheme:mt,playMode:k,intermission:z,hover:q,loop:g})),ht?this._lottie=Ct.loadAnimation({...gt,container:this._container,animationData:this._animation,audioFactory:ht}):this._lottie=Ct.loadAnimation({...gt,container:this._container,animationData:this._animation}),typeof this._lottie.resetSegments>"u"&&(this._lottie.resetSegments=()=>{var yt;(yt=this._lottie)==null||yt.playSegments([0,this._lottie.totalFrames],!0);}),this.addEventListeners(),this._container&&(this._container.__lottie=this._lottie),this._setPlayerState(()=>({direction:W,speed:ot})),_&&!q&&(g===!1&&W===-1?this.play():this.setCurrentState("playing")),this._updateTestData();}async _getLottiePlayerInstance(){var t;let e=(t=this._animationConfig.renderer)!=null?t:"svg",i;if(this._worker)return e!=="svg"&&li("Worker is only supported with svg renderer. Change or remove renderer prop to get rid of this warning."),i=await Promise.resolve().then(()=>(yl(),gl)),i.default;switch(e){case"svg":{this._light?i=await Promise.resolve().then(()=>(bl(),vl)):i=await Promise.resolve().then(()=>(xl(),_l));break}case"canvas":{this._light?i=await Promise.resolve().then(()=>(Sl(),Pl)):i=await Promise.resolve().then(()=>(Al(),El));break}case"html":{this._light?i=await Promise.resolve().then(()=>(kl(),Cl)):i=await Promise.resolve().then(()=>(Ml(),Tl));break}default:throw new Error(`Invalid renderer: ${e}`)}return i.default}_getActiveAnimationId(){var t,e,i,s;let r=this._dotLottieLoader.manifest;return (s=(i=(t=this._activeAnimationId)!=null?t:r==null?void 0:r.activeAnimationId)!=null?i:(e=r==null?void 0:r.animations[0])==null?void 0:e.id)!=null?s:void 0}async load(t){if(this._currentState==="loading"){li("Loading in progress..");return}try{if(this.setCurrentState("loading"),typeof this._src=="string")if(vo(this._src)){let i=JSON.parse(this._src);this._dotLottieLoader.loadFromLottieJSON(i);}else {let i=new URL(this._src,window.location.href);await this._dotLottieLoader.loadFromUrl(i.toString());}else if(typeof this._src=="object"&&Jr(this._src))this._dotLottieLoader.loadFromLottieJSON(this._src);else throw Ie("Invalid src provided");if(!this._dotLottieLoader.manifest)throw Ie("No manifest found");let e=this._getActiveAnimationId();if(!e)throw Ie("No active animation found");await this._setCurrentAnimation(e),await this.render(t);}catch(e){this.setCurrentState("error"),e instanceof Error&&er(`Error loading animation: ${e.message}`);}}setErrorState(t){this.setCurrentState("error"),er(t);}_requireValidDirection(t){if(t!==-1&&t!==1)throw Ie("Direction can only be -1 (backwards) or 1 (forwards)")}_requireValidIntermission(t){if(t<0||!Number.isInteger(t))throw Ie("intermission must be a positive number")}_requireValidLoop(t){if(typeof t=="number"&&(!Number.isInteger(t)||t<0))throw Ie("loop must be a positive number or boolean")}_requireValidSpeed(t){if(typeof t!="number")throw Ie("speed must be a number")}_requireValidBackground(t){if(typeof t!="string")throw Ie("background must be a string")}_requireValidAutoplay(t){if(typeof t!="boolean")throw Ie("autoplay must be a boolean")}_requireValidPlaybackOptions(t){t.direction&&this._requireValidDirection(t.direction),t.intermission&&this._requireValidIntermission(t.intermission),t.loop&&this._requireValidLoop(t.loop),t.speed&&this._requireValidSpeed(t.speed);}};});Bo();An();qn();Tn();ca();qs();var Yn=window,Jn=Yn.ShadowRoot&&(Yn.ShadyCSS===void 0||Yn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Oo=Symbol(),wl=new WeakMap,ln=class{constructor(e,i,s){if(this._$cssResult$=!0,s!==Oo)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=i;}get styleSheet(){let e=this.o,i=this.t;if(Jn&&e===void 0){let s=i!==void 0&&i.length===1;s&&(e=wl.get(i)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&wl.set(i,e));}return e}toString(){return this.cssText}},Dl=t=>new ln(typeof t=="string"?t:t+"",void 0,Oo),zo=(t,...e)=>{let i=t.length===1?t[0]:e.reduce((s,r,a)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[a+1],t[0]);return new ln(i,t,Oo)},No=(t,e)=>{Jn?t.adoptedStyleSheets=e.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet):e.forEach(i=>{let s=document.createElement("style"),r=Yn.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=i.cssText,t.appendChild(s);});},Un=Jn?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let i="";for(let s of e.cssRules)i+=s.cssText;return Dl(i)})(t):t;var Go,Zn=window,Fl=Zn.trustedTypes,Dc=Fl?Fl.emptyScript:"",Il=Zn.reactiveElementPolyfillSupport,Ho={toAttribute(t,e){switch(e){case Boolean:t=t?Dc:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t);}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=t!==null;break;case Number:i=t===null?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch{i=null;}}return i}},Ll=(t,e)=>e!==t&&(e==e||t==t),jo={attribute:!0,type:String,converter:Ho,reflect:!1,hasChanged:Ll},qo="finalized",ur=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu();}static addInitializer(e){var i;this.finalize(),((i=this.h)!==null&&i!==void 0?i:this.h=[]).push(e);}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((i,s)=>{let r=this._$Ep(s,i);r!==void 0&&(this._$Ev.set(r,s),e.push(r));}),e}static createProperty(e,i=jo){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(e,i),!i.noAccessor&&!this.prototype.hasOwnProperty(e)){let s=typeof e=="symbol"?Symbol():"__"+e,r=this.getPropertyDescriptor(e,s,i);r!==void 0&&Object.defineProperty(this.prototype,e,r);}}static getPropertyDescriptor(e,i,s){return {get(){return this[i]},set(r){let a=this[e];this[i]=r,this.requestUpdate(e,a,s);},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||jo}static finalize(){if(this.hasOwnProperty(qo))return !1;this[qo]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let i=this.properties,s=[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)];for(let r of s)this.createProperty(r,i[r]);}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let i=[];if(Array.isArray(e)){let s=new Set(e.flat(1/0).reverse());for(let r of s)i.unshift(Un(r));}else e!==void 0&&i.push(Un(e));return i}static _$Ep(e,i){let s=i.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(i=>i(this));}addController(e){var i,s;((i=this._$ES)!==null&&i!==void 0?i:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((s=e.hostConnected)===null||s===void 0||s.call(e));}removeController(e){var i;(i=this._$ES)===null||i===void 0||i.splice(this._$ES.indexOf(e)>>>0,1);}_$Eg(){this.constructor.elementProperties.forEach((e,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i]);});}createRenderRoot(){var e;let i=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return No(i,this.constructor.elementStyles),i}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var s;return (s=i.hostConnected)===null||s===void 0?void 0:s.call(i)});}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(i=>{var s;return (s=i.hostDisconnected)===null||s===void 0?void 0:s.call(i)});}attributeChangedCallback(e,i,s){this._$AK(e,s);}_$EO(e,i,s=jo){var r;let a=this.constructor._$Ep(e,s);if(a!==void 0&&s.reflect===!0){let n=(((r=s.converter)===null||r===void 0?void 0:r.toAttribute)!==void 0?s.converter:Ho).toAttribute(i,s.type);this._$El=e,n==null?this.removeAttribute(a):this.setAttribute(a,n),this._$El=null;}}_$AK(e,i){var s;let r=this.constructor,a=r._$Ev.get(e);if(a!==void 0&&this._$El!==a){let n=r.getPropertyOptions(a),p=typeof n.converter=="function"?{fromAttribute:n.converter}:((s=n.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?n.converter:Ho;this._$El=a,this[a]=p.fromAttribute(i,n.type),this._$El=null;}}requestUpdate(e,i,s){let r=!0;e!==void 0&&(((s=s||this.constructor.getPropertyOptions(e)).hasChanged||Ll)(this[e],i)?(this._$AL.has(e)||this._$AL.set(e,i),s.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,s))):r=!1),!this.isUpdatePending&&r&&(this._$E_=this._$Ej());}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_;}catch(i){Promise.reject(i);}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((r,a)=>this[a]=r),this._$Ei=void 0);let i=!1,s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var a;return (a=r.hostUpdate)===null||a===void 0?void 0:a.call(r)}),this.update(s)):this._$Ek();}catch(r){throw i=!1,this._$Ek(),r}i&&this._$AE(s);}willUpdate(e){}_$AE(e){var i;(i=this._$ES)===null||i===void 0||i.forEach(s=>{var r;return (r=s.hostUpdated)===null||r===void 0?void 0:r.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e);}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return !0}update(e){this._$EC!==void 0&&(this._$EC.forEach((i,s)=>this._$EO(s,this[s],i)),this._$EC=void 0),this._$Ek();}updated(e){}firstUpdated(e){}};ur[qo]=!0,ur.elementProperties=new Map,ur.elementStyles=[],ur.shadowRootOptions={mode:"open"},Il==null||Il({ReactiveElement:ur}),((Go=Zn.reactiveElementVersions)!==null&&Go!==void 0?Go:Zn.reactiveElementVersions=[]).push("1.6.3");var $o,Kn=window,Sa=Kn.trustedTypes,Vl=Sa?Sa.createPolicy("lit-html",{createHTML:t=>t}):void 0,Xo="$lit$",Lr=`lit$${(Math.random()+"").slice(9)}$`,jl="?"+Lr,Fc=`<${jl}>`,Qr=document,fn=()=>Qr.createComment(""),cn=t=>t===null||typeof t!="object"&&typeof t!="function",Hl=Array.isArray,Ic=t=>Hl(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",Wo=`[ \f\r]`,pn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Rl=/-->/g,Bl=/>/g,Zr=RegExp(`>|${Wo}(?:([^\\s"'>=/]+)(${Wo}*=${Wo}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ol=/'/g,zl=/"/g,ql=/^(?:script|style|textarea|title)$/i,$l=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),Ne=$l(1),ta=Symbol.for("lit-noChange"),Hi=Symbol.for("lit-nothing"),Nl=new WeakMap,Kr=Qr.createTreeWalker(Qr,129,null,!1);function Wl(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vl!==void 0?Vl.createHTML(e):e}var Lc=(t,e)=>{let i=t.length-1,s=[],r,a=e===2?"":"",n=pn;for(let p=0;p"?(n=r!=null?r:pn,c=-1):P[1]===void 0?c=-2:(c=n.lastIndex-P[2].length,y=P[1],n=P[3]===void 0?Zr:P[3]==='"'?zl:Ol):n===zl||n===Ol?n=Zr:n===Rl||n===Bl?n=pn:(n=Zr,r=void 0);let E=n===Zr&&t[p+1].startsWith("/>")?" ":"";a+=n===pn?h+Fc:c>=0?(s.push(y),h.slice(0,c)+Xo+h.slice(c)+Lr+E):h+Lr+(c===-2?(s.push(void 0),p):E);}return [Wl(t,a+(t[i]||"")+(e===2?"":"")),s]},un=class t{constructor({strings:e,_$litType$:i},s){let r;this.parts=[];let a=0,n=0,p=e.length-1,h=this.parts,[y,P]=Lc(e,i);if(this.el=t.createElement(y,s),Kr.currentNode=this.el.content,i===2){let c=this.el.content,l=c.firstChild;l.remove(),c.append(...l.childNodes);}for(;(r=Kr.nextNode())!==null&&h.length0){r.textContent=Sa?Sa.emptyScript:"";for(let E=0;E2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=Hi;}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,i=this,s,r){let a=this.strings,n=!1;if(a===void 0)e=Ea(this,e,i,0),n=!cn(e)||e!==this._$AH&&e!==ta,n&&(this._$AH=e);else {let p=e,h,y;for(e=a[0],h=0;h{var s,r;let a=(s=i==null?void 0:i.renderBefore)!==null&&s!==void 0?s:e,n=a._$litPart$;if(n===void 0){let p=(r=i==null?void 0:i.renderBefore)!==null&&r!==void 0?r:null;a._$litPart$=n=new mn(e.insertBefore(fn(),p),p,void 0,i!=null?i:{});}return n._$AI(t),n};var Qo,th;var Vr=class extends ur{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){var e,i;let s=super.createRenderRoot();return (e=(i=this.renderOptions).renderBefore)!==null&&e!==void 0||(i.renderBefore=s.firstChild),s}update(e){let i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Xl(i,this.renderRoot,this.renderOptions);}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0);}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1);}render(){return ta}};Vr.finalized=!0,Vr._$litElement$=!0,(Qo=globalThis.litElementHydrateSupport)===null||Qo===void 0||Qo.call(globalThis,{LitElement:Vr});var Yl=globalThis.litElementPolyfillSupport;Yl==null||Yl({LitElement:Vr});((th=globalThis.litElementVersions)!==null&&th!==void 0?th:globalThis.litElementVersions=[]).push("3.3.3");var Rc=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t);}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this));},finisher(i){i.createProperty(e.key,t);}},Bc=(t,e,i)=>{e.constructor.createProperty(i,t);};function Bi(t){return (e,i)=>i!==void 0?Bc(t,e,i):Rc(t,e)}function Jl(t){return Bi({...t,state:!0})}var ea=({finisher:t,descriptor:e})=>(i,s)=>{var r;if(s===void 0){let a=(r=i.originalKey)!==null&&r!==void 0?r:i.key,n=e!=null?{kind:"method",placement:"prototype",key:a,descriptor:e(i.key)}:{...i,key:a};return t!=null&&(n.finisher=function(p){t(p,a);}),n}{let a=i.constructor;e!==void 0&&Object.defineProperty(i,s,e(s)),t==null||t(a,s);}};function Ul(t,e){return ea({descriptor:i=>{let s={get(){var r,a;return (a=(r=this.renderRoot)===null||r===void 0?void 0:r.querySelector(t))!==null&&a!==void 0?a:null},enumerable:!0,configurable:!0};if(e){let r=typeof i=="symbol"?Symbol():"__"+i;s.get=function(){var a,n;return this[r]===void 0&&(this[r]=(n=(a=this.renderRoot)===null||a===void 0?void 0:a.querySelector(t))!==null&&n!==void 0?n:null),this[r]};}return s}})}var eh;((eh=window.HTMLSlotElement)===null||eh===void 0?void 0:eh.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(i=>i.nodeType===Node.ELEMENT_NODE);var Zl={name:"@dotlottie/player-component",version:"2.7.12",description:"dotLottie animation player web component.",repository:"https://github.com/dotlottie/player-component.git",homepage:"https://dotlottie.io/players",bugs:"https://github.com/dotlottie/player-component/issues",author:"Jawish Hameed ",license:"MIT",main:"dist/dotlottie-player.js",module:"dist/dotlottie-player.mjs",types:"dist/dotlottie-player.d.ts",files:["dist"],keywords:["dotlottie","animation","web component","component","lit-element","player"],scripts:{build:"tsup","cypress:open":"cypress open --component",dev:"tsup --watch",lint:"eslint .","lint:fix":"eslint --fix",test:"cypress run --component","type-check":"tsc --noEmit"},dependencies:{"@dotlottie/common":"workspace:*",lit:"^2.7.5"},devDependencies:{"@vitejs/plugin-legacy":"^4.1.0","axe-core":"^4.7.2",cypress:"^12.11.0","cypress-axe":"^1.4.0","cypress-ct-lit":"^0.3.2","lottie-web":"^5.12.2",terser:"^5.19.0",tsup:"^7.2.0",typescript:"^4.7.4",vite:"^4.3.9"},publishConfig:{access:"public"},browserslist:["> 3%"]};var Kl=zo` @font-face { diff --git a/assets/lottie/lottie-player.min.js b/assets/lottie/lottie-player.min.js index 9fc6ac8dc..fd90517c3 100644 --- a/assets/lottie/lottie-player.min.js +++ b/assets/lottie/lottie-player.min.js @@ -73,5 +73,5 @@ var n$1=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e) * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function o(t,e,r){var i,s=t;return"object"==typeof t?(s=t.slot,i=t):i={flatten:e},r?l({slot:s,flatten:e,selector:r}):o$1({descriptor:t=>({get(){var t,e,r="slot"+(s?"[name=".concat(s,"]"):":not([name])"),a=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(r);return null!==(e=null==a?void 0:a.assignedNodes(i))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function getDefaultExportFromNamespaceIfPresent(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function getDefaultExportFromNamespaceIfNotNamed(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")&&1===Object.keys(t).length?t.default:t}function getAugmentedNamespace(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})})),e}function commonjsRequire(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var lottie$1={exports:{}};(function(module,exports){var factory;"undefined"!=typeof navigator&&(factory=function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(t){_useWebWorker=!!t},getWebWorker=function(){return _useWebWorker},setLocationHref=function(t){locationHref=t},getLocationHref=function(){return locationHref};function createTag(t){return document.createElement(t)}function extendPrototype(t,e){var r,i,s=t.length;for(r=0;r1?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[2]+=e,r[2]>1?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(t,e){var r=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return r[0]+=e/360,r[0]>1?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var t,e,r=[];for(t=0;t<256;t+=1)e=t.toString(16),r[t]=1===e.length?"0"+e:e;return function(t,e,i){return t<0&&(t=0),e<0&&(e=0),i<0&&(i=0),"#"+r[t]+r[e]+r[i]}}(),setSubframeEnabled=function(t){subframeEnabled=!!t},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(t){expressionsPlugin=t},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(t){expressionsInterfaces=t},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(t){defaultCurveSegments=t},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(t){idPrefix$1=t},getIdPrefix=function(){return idPrefix$1};function createNS(t){return document.createElementNS(svgNS,t)}function _typeof$5(t){return _typeof$5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$5(t)}var dataManager=function(){var t,e,r=1,i=[],s={onmessage:function(){},postMessage:function(e){t({data:e})}},_workerSelf={postMessage:function(t){s.onmessage({data:t})}};function a(){e||(e=function(e){if(window.Worker&&window.Blob&&getWebWorker()){var r=new Blob(["var _workerSelf = self; self.onmessage = ",e.toString()],{type:"text/javascript"}),i=URL.createObjectURL(r);return new Worker(i)}return t=e,s}((function(t){if(_workerSelf.dataManager||(_workerSelf.dataManager=function(){function t(s,a){var n,o,l,h,p,f,u=s.length;for(o=0;o=0;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)i(t[e].ks.k);else for(a=t[e].ks.k.length,s=0;sr[0]||!(r[0]>t[0])&&(t[1]>r[1]||!(r[1]>t[1])&&(t[2]>r[2]||!(r[2]>t[2])&&null))}var a,n=function(){var t=[4,4,14];function e(t){var e,r,i,s=t.length;for(e=0;e=0;r-=1)if("sh"===t[r].ty)if(t[r].ks.k.i)t[r].ks.k.c=t[r].closed;else for(s=t[r].ks.k.length,i=0;i500)&&(this._imageLoaded(),clearInterval(r)),e+=1}.bind(this),50)}function a(t){var e={assetData:t},r=i(t,this.assetsPath,this.path);return dataManager.loadData(r,function(t){e.img=t,this._footageLoaded()}.bind(this),function(){e.img={},this._footageLoaded()}.bind(this)),e}function n(){this._imageLoaded=e.bind(this),this._footageLoaded=r.bind(this),this.testImageLoaded=s.bind(this),this.createFootageData=a.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return n.prototype={loadAssets:function(t,e){var r;this.imagesLoadedCb=e;var i=t.length;for(r=0;rthis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;rthis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(t){for(var e,r=0;r=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(r=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"===_typeof$4(t[0])){var r,i=t.length;for(r=0;r=0;r-=1)e[r].animation.destroy(t)},t.freeze=function(){n=!0},t.unfreeze=function(){n=!1,d()},t.setVolume=function(t,r){var s;for(s=0;s=.001?function(t,e,r,i){for(var s=0;s<4;++s){var a=l(e,r,i);if(0===a)return e;e-=(o(e,r,i)-t)/a}return e}(t,h,e,i):0===p?h:function(t,e,r,i,s){var a,n,l=0;do{(a=o(n=e+(r-e)/2,i,s)-t)>0?r=n:e=n}while(Math.abs(a)>1e-7&&++l<10);return n}(t,a,a+r,e,i)}},t}(),pooling={double:function(t){return t.concat(createSizedArray(t.length))}},poolFactory=function(t,e,r){var i=0,s=t,a=createSizedArray(s);return{newElement:function(){return i?a[i-=1]:e()},release:function(t){i===s&&(a=pooling.double(a),s*=2),r&&r(t),a[i]=t,i+=1}}},bezierLengthPool=poolFactory(8,(function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}})),segmentsLengthPool=poolFactory(8,(function(){return{lengths:[],totalLength:0}}),(function(t){var e,r=t.lengths.length;for(e=0;e-.001&&n<.001}var r=function(t,e,r,i){var s,a,n,o,l,h,p=getDefaultCurveSegments(),c=0,f=[],u=[],d=bezierLengthPool.newElement();for(n=r.length,s=0;sn?-1:1,h=!0;h;)if(i[a]<=n&&i[a+1]>n?(o=(n-i[a])/(i[a+1]-i[a]),h=!1):a+=l,a<0||a>=s-1){if(a===s-1)return r[a];h=!1}return r[a]+(r[a+1]-r[a])*o}var l=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,i=segmentsLengthPool.newElement(),s=t.c,a=t.v,n=t.o,o=t.i,l=t._length,h=i.lengths,p=0;for(e=0;e1&&(a=1);var p,c=o(a,h),f=o(n=n>1?1:n,h),u=e.length,d=1-c,m=1-f,y=d*d*d,g=c*d*d*3,v=c*c*d*3,b=c*c*c,_=d*d*m,P=c*d*m+d*c*m+d*d*f,x=c*c*m+d*c*f+c*d*f,S=c*c*f,E=d*m*m,C=c*m*m+d*f*m+d*m*f,A=c*f*m+d*f*f+c*m*f,w=c*f*f,k=m*m*m,T=f*m*m+m*f*m+m*m*f,M=f*f*m+m*f*f+f*m*f,D=f*f*f;for(p=0;pu?f>d?f-u-d:d-u-f:d>u?d-u-f:u-f-d)>-1e-4&&c<1e-4}}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(t,e){var r,i=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var s,a,n,o,l,h,p,c,f,u=e.lastIndex,d=u,m=this.keyframes.length-1,y=!0;y;){if(s=this.keyframes[d],a=this.keyframes[d+1],d===m-1&&t>=a.t-i){s.h&&(s=a),u=0;break}if(a.t-i>t){u=d;break}d=v||t=v?_.points.length-1:0;for(l=_.points[P].point.length,o=0;o=E&&S=v?(r[0]=g[0],r[1]=g[1],r[2]=g[2]):t<=b?(r[0]=s.s[0],r[1]=s.s[1],r[2]=s.s[2]):quaternionToEuler(r,slerp(createQuaternion(s.s),createQuaternion(g),(t-b)/(v-b)));else for(d=0;d=v?h=1:t1e-6?(i=Math.acos(s),a=Math.sin(i),n=Math.sin((1-r)*i)/a,o=Math.sin(r*i)/a):(n=1-r,o=r),l[0]=n*h+o*u,l[1]=n*p+o*d,l[2]=n*c+o*m,l[3]=n*f+o*y,l}function quaternionToEuler(t,e){var r=e[0],i=e[1],s=e[2],a=e[3],n=Math.atan2(2*i*a-2*r*s,1-2*i*i-2*s*s),o=Math.asin(2*r*i+2*s*a),l=Math.atan2(2*r*a-2*i*s,1-2*r*r-2*s*s);t[0]=n/degToRads,t[1]=o/degToRads,t[2]=l/degToRads}function createQuaternion(t){var e=t[0]*degToRads,r=t[1]*degToRads,i=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(r/2),n=Math.cos(i/2),o=Math.sin(e/2),l=Math.sin(r/2),h=Math.sin(i/2);return[o*l*n+s*a*h,o*a*n+s*l*h,s*l*n-o*a*h,s*a*n-o*l*h]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=r&&t>=r||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if("unidimensional"===this.propType)e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var r=0,i=this.v.length;r1e-5&&(this.v[r]=e,this._mdf=!0),r+=1}function processEffectsSequence(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(t=0;t=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}(!a[i]||a[i]&&!s)&&(a[i]=pointPool.newElement()),a[i][0]=t,a[i][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,i,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(r,i,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,r=this.o,i=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],r[0][0],r[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a=u[u.length-1].t-this.offsetTime)i=u[u.length-1].s?u[u.length-1].s[0]:u[u.length-2].e[0],a=!0;else{for(var d,m,y,g=f,v=u.length-1,b=!0;b&&(d=u[g],!((m=u[g+1]).t-this.offsetTime>t));)g=m.t-this.offsetTime)p=1;else if(ti&&e>i)||(this._caching.lastIndex=s0||t>-1e-6&&t<0?i(1e4*t)/1e4:t}function I(){var t=this.props;return"matrix("+F(t[0])+","+F(t[1])+","+F(t[4])+","+F(t[5])+","+F(t[12])+","+F(t[13])+")"}return function(){this.reset=s,this.rotate=a,this.rotateX=n,this.rotateY=o,this.rotateZ=l,this.skew=p,this.skewFromAxis=c,this.shear=h,this.scale=f,this.setTransform=u,this.translate=d,this.transform=m,this.multiply=y,this.applyToPoint=P,this.applyToX=x,this.applyToY=S,this.applyToZ=E,this.applyToPointArray=T,this.applyToTriplePoints=k,this.applyToPointStringified=M,this.toCSS=D,this.to2dCSS=I,this.clone=b,this.cloneFromProps=_,this.equals=v,this.inversePoints=w,this.inversePoint=A,this.getInverseMatrix=C,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(t){return _typeof$3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$3(t)}var lottie={},standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="";function setLocation(t){setLocationHref(t)}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(t){setSubframeEnabled(t)}function setPrefix(t){setIdPrefix(t)}function loadAnimation(t){return!0===standalone&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(t)&&t>1&&setDefaultCurveSegments(t);getDefaultCurveSegments()>=50?roundValues(!1):roundValues(!0)}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&setExpressionsPlugin(e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),r=0;r=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,l=[],h=a.length;for(n=0;ni+r||(p=o.s*s<=i?0:(o.s*s-i)/r,c=o.e*s>=i+r?1:(o.e*s-i)/r,l.push([p,c]))}return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(t){var e,r=t.length;for(e=0;e1?1+a:this.s.v<0?0+a:this.s.v+a)>(r=this.e.v>1?1+a:this.e.v<0?0+a:this.e.v+a)){var n=e;e=r,r=n}e=1e-4*Math.round(1e4*e),r=1e-4*Math.round(1e4*r),this.sValue=e,this.eValue=r}else e=this.sValue,r=this.eValue;var o,l,h,p,c,f=this.shapes.length,u=0;if(r===e)for(s=0;s=0;s-=1)if((d=this.shapes[s]).shape._mdf){for((m=d.localShapeCollection).releaseShapes(),2===this.m&&f>1?(g=this.calculateShapeEdges(e,r,d.totalShapeLength,_,u),_+=d.totalShapeLength):g=[[v,b]],l=g.length,o=0;o=1?y.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(b-1)}):(y.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),y.push({s:0,e:d.totalShapeLength*(b-1)}));var P=this.addShapes(d,y[0]);if(y[0].s!==y[0].e){if(y.length>1)if(d.shape.paths.shapes[d.shape.paths._length-1].c){var x=P.pop();this.addPaths(P,m),P=this.addShapes(d,y[1],x)}else this.addPaths(P,m),P=this.addShapes(d,y[1]);this.addPaths(P,m)}}d.shape.paths=m}}},TrimModifier.prototype.addPaths=function(t,e){var r,i=t.length;for(r=0;re.e){r.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[s],f[i].v[s],r,o,y),y=!1):(h=bez.getNewSegment(f[i].v[s-1],f[i].v[s],f[i].o[s-1],f[i].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,l[s-1]),this.addSegmentFromArray(h,r,o,y),y=!1,r.c=!1),d+=n.addedLength,o+=1}if(f[i].c&&l.length){if(n=l[s-1],d<=e.e){var g=l[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[0],f[i].v[0],r,o,y),y=!1):(h=bez.getNewSegment(f[i].v[s-1],f[i].v[0],f[i].o[s-1],f[i].i[0],(e.s-d)/g,(e.e-d)/g,l[s-1]),this.addSegmentFromArray(h,r,o,y),y=!1,r.c=!1)}else r.c=!1;d+=n.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[p][0],r.v[p][1],"i",p),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),d>e.e)break;i=this.p.keyframes[this.p.keyframes.length-1].t?(i=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/r,0),s=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/r,0)):(i=this.p.pv,s=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/r,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){i=[],s=[];var a=this.px,n=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(i[0]=a.getValueAtTime((a.keyframes[0].t+.01)/r,0),i[1]=n.getValueAtTime((n.keyframes[0].t+.01)/r,0),s[0]=a.getValueAtTime(a.keyframes[0].t/r,0),s[1]=n.getValueAtTime(n.keyframes[0].t/r,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(i[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/r,0),i[1]=n.getValueAtTime(n.keyframes[n.keyframes.length-1].t/r,0),s[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/r,0),s[1]=n.getValueAtTime((n.keyframes[n.keyframes.length-1].t-.01)/r,0)):(i=[a.pv,n.pv],s[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/r,a.offsetTime),s[1]=n.getValueAtTime((n._caching.lastFrame+n.offsetTime-.01)/r,n.offsetTime))}else i=s=t;this.v.rotate(-Math.atan2(i[1]-s[1],i[0]-s[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],e),e.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},e.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,r,i){return new e(t,r,i)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function floatEqual(t,e){return 1e5*Math.abs(t-e)<=Math.min(Math.abs(t),Math.abs(e))}function floatZero(t){return Math.abs(t)<=1e-5}function lerp(t,e,r){return t*(1-r)+e*r}function lerpPoint(t,e,r){return[lerp(t[0],e[0],r),lerp(t[1],e[1],r)]}function quadRoots(t,e,r){if(0===t)return[];var i=e*e-4*t*r;if(i<0)return[];var s=-e/(2*t);if(0===i)return[s];var a=Math.sqrt(i)/(2*t);return[s-a,s+a]}function polynomialCoefficients(t,e,r,i){return[3*e-t-3*r+i,3*t-6*e+3*r,-3*t+3*e,t]}function singlePoint(t){return new PolynomialBezier(t,t,t,t,!1)}function PolynomialBezier(t,e,r,i,s){s&&pointEqual(t,e)&&(e=lerpPoint(t,i,1/3)),s&&pointEqual(r,i)&&(r=lerpPoint(t,i,2/3));var a=polynomialCoefficients(t[0],e[0],r[0],i[0]),n=polynomialCoefficients(t[1],e[1],r[1],i[1]);this.a=[a[0],n[0]],this.b=[a[1],n[1]],this.c=[a[2],n[2]],this.d=[a[3],n[3]],this.points=[t,e,r,i]}function extrema(t,e){var r=t.points[0][e],i=t.points[t.points.length-1][e];if(r>i){var s=i;i=r,r=s}for(var a=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),n=0;n0&&a[n]<1){var o=t.point(a[n])[e];oi&&(i=o)}return{min:r,max:i}}function intersectData(t,e,r){var i=t.boundingBox();return{cx:i.cx,cy:i.cy,width:i.width,height:i.height,bez:t,t:(e+r)/2,t1:e,t2:r}}function splitData(t){var e=t.bez.split(.5);return[intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return 2*Math.abs(t.cx-e.cx)=a||t.width<=i&&t.height<=i&&e.width<=i&&e.height<=i)s.push([t.t,e.t]);else{var n=splitData(t),o=splitData(e);intersectsImpl(n[0],o[0],r+1,i,s,a),intersectsImpl(n[0],o[1],r+1,i,s,a),intersectsImpl(n[1],o[0],r+1,i,s,a),intersectsImpl(n[1],o[1],r+1,i,s,a)}}function crossProduct(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,r,i){var s=[t[0],t[1],1],a=[e[0],e[1],1],n=[r[0],r[1],1],o=[i[0],i[1],1],l=crossProduct(crossProduct(s,a),crossProduct(n,o));return floatZero(l[2])?null:[l[0]/l[2],l[1]/l[2]]}function polarOffset(t,e,r){return[t[0]+Math.cos(e)*r,t[1]-Math.sin(e)*r]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}function setPoint(t,e,r,i,s,a,n){var o=r-Math.PI/2,l=r+Math.PI/2,h=e[0]+Math.cos(r)*i*s,p=e[1]-Math.sin(r)*i*s;t.setTripleAt(h,p,h+Math.cos(o)*a,p-Math.sin(o)*a,h+Math.cos(l)*n,p-Math.sin(l)*n,t.length())}function getPerpendicularVector(t,e){var r=[e[0]-t[0],e[1]-t[1]],i=.5*-Math.PI;return[Math.cos(i)*r[0]-Math.sin(i)*r[1],Math.sin(i)*r[0]+Math.cos(i)*r[1]]}function getProjectingAngle(t,e){var r=0===e?t.length()-1:e-1,i=(e+1)%t.length(),s=getPerpendicularVector(t.v[r],t.v[i]);return Math.atan2(0,1)-Math.atan2(s[1],s[0])}function zigZagCorner(t,e,r,i,s,a,n){var o=getProjectingAngle(e,r),l=e.v[r%e._length],h=e.v[0===r?e._length-1:r-1],p=e.v[(r+1)%e._length],c=2===a?Math.sqrt(Math.pow(l[0]-h[0],2)+Math.pow(l[1]-h[1],2)):0,f=2===a?Math.sqrt(Math.pow(l[0]-p[0],2)+Math.pow(l[1]-p[1],2)):0;setPoint(t,e.v[r%e._length],o,n,i,f/(2*(s+1)),c/(2*(s+1)),a)}function zigZagSegment(t,e,r,i,s,a){for(var n=0;n1&&e.length>1&&(s=getIntersection(t[0],e[e.length-1]))?[[t[0].split(s[0])[0]],[e[e.length-1].split(s[1])[1]]]:[r,i]}function pruneIntersections(t){for(var e,r=1;r1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var r,i,s,a,n=t.inflectionPoints();if(0===n.length)return[offsetSegment(t,e)];if(1===n.length||floatEqual(n[1],1))return r=(s=t.split(n[0]))[0],i=s[1],[offsetSegment(r,e),offsetSegment(i,e)];r=(s=t.split(n[0]))[0];var o=(n[1]-n[0])/(1-n[0]);return a=(s=s[1].split(o))[0],i=s[1],[offsetSegment(r,e),offsetSegment(a,e),offsetSegment(i,e)]}function OffsetPathModifier(){}function getFontProperties(t){for(var e=t.fStyle?t.fStyle.split(" "):[],r="normal",i="normal",s=e.length,a=0;a0;)r-=1,this._elements.unshift(e[r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,r=t.length;for(e=0;e0?Math.floor(f):Math.ceil(f),m=this.pMatrix.props,y=this.rMatrix.props,g=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v,b,_=0;if(f>0){for(;_d;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),_-=1;u&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-u,!0),_-=u)}for(i=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(b=(r=(e=this.elemsData[i].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(i/(this._currentCopies-1)),0!==_){for((0!==i&&1===s||i!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),v=0;v0&&i<1?[e]:[]:[e-i,e+i].filter((function(t){return t>0&&t<1}))},PolynomialBezier.prototype.split=function(t){if(t<=0)return[singlePoint(this.points[0]),this];if(t>=1)return[this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),r=lerpPoint(this.points[1],this.points[2],t),i=lerpPoint(this.points[2],this.points[3],t),s=lerpPoint(e,r,t),a=lerpPoint(r,i,t),n=lerpPoint(s,a,t);return[new PolynomialBezier(this.points[0],e,s,n,!0),new PolynomialBezier(n,a,i,this.points[3],!0)]},PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return{left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}},PolynomialBezier.prototype.intersections=function(t,e,r){void 0===e&&(e=2),void 0===r&&(r=7);var i=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,i,r),i},PolynomialBezier.shapeSegment=function(t,e){var r=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[r],t.v[r],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var r=(e+1)%t.length();return new PolynomialBezier(t.v[r],t.i[r],t.o[e],t.v[e],!0)},extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},ZigZagModifier.prototype.processPath=function(t,e,r,i){var s=t._length,a=shapePool.newElement();if(a.c=t.c,t.c||(s-=1),0===s)return a;var n=-1,o=PolynomialBezier.shapeSegment(t,0);zigZagCorner(a,t,0,e,r,i,n);for(var l=0;l=0;a-=1)o=PolynomialBezier.shapeSegmentInverted(t,a),h.push(offsetSegmentSplit(o,e));h=pruneIntersections(h);var p=null,c=null;for(a=0;a=55296&&r<=56319){var i=t.charCodeAt(1);i>=56320&&i<=57343&&(e=1024*(r-55296)+i-56320+65536)}return e}function o(t){var e=n(t);return e>=127462&&e<=127487}var l=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};l.isModifier=function(t,e){var r=t.toString(16)+e.toString(16);return-1!==i.indexOf(r)},l.isZeroWidthJoiner=function(t){return 8205===t},l.isFlagEmoji=function(t){return o(t.substr(0,2))&&o(t.substr(2,2))},l.isRegionalCode=o,l.isCombinedCharacter=function(t){return-1!==e.indexOf(t)},l.isRegionalFlag=function(t,e){var i=n(t.substr(e,2));if(i!==r)return!1;var s=0;for(e+=2;s<5;){if((i=n(t.substr(e,2)))<917601||i>917626)return!1;s+=1,e+=2}return 917631===n(t.substr(e,2))},l.isVariationSelector=function(t){return 65039===t},l.BLACK_FLAG_CODE_POINT=r;var h={addChars:function(t){if(t){var e;this.chars||(this.chars=[]);var r,i,s=t.length,a=this.chars.length;for(e=0;e0&&(p=!1),p){var c=createTag("style");c.setAttribute("f-forigin",i[r].fOrigin),c.setAttribute("f-origin",i[r].origin),c.setAttribute("f-family",i[r].fFamily),c.type="text/css",c.innerText="@font-face {font-family: "+i[r].fFamily+"; font-style: normal; src: url('"+i[r].fPath+"');}",e.appendChild(c)}}else if("g"===i[r].fOrigin||1===i[r].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),h=0;ht?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(t){var e,r,i=this.layers.length;for(this.completeLayers=!0,e=i-1;e>=0;e-=1)this.elements[e]||(r=this.layers[e]).ip-r.st<=t-this.layers[e].st&&r.op-r.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:default:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+getLocationHref()+"#"+y+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}TransformElement.prototype={initTransform:function(){var t=new Matrix;this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:t,localMat:t,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,r=0,i=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r1&&(a+=" C"+e.o[i-1][0]+","+e.o[i-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),r.lastPath!==a){var n="";r.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),r.elem.setAttribute("d",n)),r.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var t={createFilter:function(t,e){var r=createNS("filter");return r.setAttribute("id",t),!0!==e&&(r.setAttribute("filterUnits","objectBoundingBox"),r.setAttribute("x","0%"),r.setAttribute("y","0%"),r.setAttribute("width","100%"),r.setAttribute("height","100%")),r},createAlphaToLuminanceFilter:function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),t}};return t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!=typeof OffscreenCanvas};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(t){var e,r,i="SourceGraphic",s=t.data.ef?t.data.ef.length:0,a=createElementID(),n=filtersFactory.createFilter(a,!0),o=0;for(this.filters=[],e=0;e=0&&!this.shapeModifiers[t].processShapes(this._isFirstFrame);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,r=0,i=e.length;r.01)return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t0;)l=i.transformers[d].mProps._mdf||l,u-=1,d-=1;if(l)for(u=y-i.styles[p].lvl,d=i.transformers.length-1;u>0;)f.multiply(i.transformers[d].mProps.v),u-=1,d-=1}else f=t;if(n=(c=i.sh.paths)._length,l){for(o="",a=0;a=1?v=.99:v<=-1&&(v=-.99);var b=o*v,_=Math.cos(g+e.a.v)*b+p[0],P=Math.sin(g+e.a.v)*b+p[1];l.setAttribute("fx",_),l.setAttribute("fy",P),h&&!e.g._collapsable&&(e.of.setAttribute("fx",_),e.of.setAttribute("fy",P))}}function l(t,e,r){var i=e.style,s=e.d;s&&(s._mdf||r)&&s.dashStr&&(i.pElem.setAttribute("stroke-dasharray",s.dashStr),i.pElem.setAttribute("stroke-dashoffset",s.dashoffset[0])),e.c&&(e.c._mdf||r)&&i.pElem.setAttribute("stroke","rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||r)&&i.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||r)&&(i.pElem.setAttribute("stroke-width",e.w.v),i.msElem&&i.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){switch(t.ty){case"fl":return a;case"gf":return o;case"gs":return n;case"st":return l;case"sh":case"el":case"rc":case"sr":return s;case"tr":return r;case"no":return i;default:return null}}}}();function SVGShapeElement(t,e,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,r),this.prevViewData=[]}function LetterProps(t,e,r,i,s,a){this.o=t,this.sw=e,this.sc=r,this.fc=i,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!r,fc:!!i,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,e.d&&e.d.sid&&(e.d=t.globalData.slotManager.getProp(e.d)),this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,r,i,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(r=0;r1&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,r=t.length;for(e=0;e=0;o-=1){if((f=this.searchProcessedElement(t[o]))?e[o]=r[f-1]:t[o]._render=n,"fl"===t[o].ty||"st"===t[o].ty||"gf"===t[o].ty||"gs"===t[o].ty||"no"===t[o].ty)f?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],s),t[o]._render&&e[o].style.pElem.parentNode!==i&&i.appendChild(e[o].style.pElem),m.push(e[o].style);else if("gr"===t[o].ty){if(f)for(h=e[o].it.length,l=0;l1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var i;this.lock=!0,this._mdf=!1;var s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(i=0;ie);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,r,i=[],s=0,a=t.length,n=!1,o=!1,l="";s=55296&&e<=56319?FontManager.isRegionalFlag(t,s)?l=t.substr(s,14):(r=t.charCodeAt(s+1))>=56320&&r<=57343&&(FontManager.isModifier(e,r)?(l=t.substr(s,2),n=!0):l=FontManager.isFlagEmoji(t.substr(s,4))?t.substr(s,4):t.substr(s,2)):e>56319?(r=t.charCodeAt(s+1),FontManager.isVariationSelector(e)&&(n=!0)):FontManager.isZeroWidthJoiner(e)&&(n=!0,o=!0),n?(i[i.length-1]+=l,n=!1):i.push(l),s+=l.length;return i},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,r,i,s,a,n,o,l=this.elem.globalData.fontManager,h=this.data,p=[],c=0,f=h.m.g,u=0,d=0,m=0,y=[],g=0,v=0,b=l.getFontByName(t.f),_=0,P=getFontProperties(b);t.fWeight=P.weight,t.fStyle=P.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),r=t.finalText.length,t.finalLineHeight=t.lh;var x,S=t.tr/1e3*t.finalSize;if(t.sz)for(var E,C,A=!0,w=t.sz[0],k=t.sz[1];A;){E=0,g=0,r=(C=this.buildFinalText(t.t)).length,S=t.tr/1e3*t.finalSize;var T=-1;for(e=0;ew&&" "!==C[e]?(-1===T?r+=1:e=T,E+=t.finalLineHeight||1.2*t.finalSize,C.splice(e,T===e?1:0,"\r"),T=-1,g=0):(g+=_,g+=S);E+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&kv?g:v,g=-2*S,s="",i=!0,m+=1):s=M,l.chars?(o=l.getCharData(M,b.fStyle,l.getFontByName(t.f).fFamily),_=i?0:o.w*t.finalSize/100):_=l.measureText(s,t.f,t.finalSize)," "===M?D+=_+S:(g+=_+S+D,D=0),p.push({l:_,an:_,add:u,n:i,anIndexes:[],val:s,line:m,animatorJustifyOffset:0}),2==f){if(u+=_,""===s||" "===s||e===r-1){for(""!==s&&" "!==s||(u-=_);d<=e;)p[d].an=u,p[d].ind=c,p[d].extra=_,d+=1;c+=1,u=0}}else if(3==f){if(u+=_,""===s||e===r-1){for(""===s&&(u-=_);d<=e;)p[d].an=u,p[d].ind=c,p[d].extra=_,d+=1;u=0,c+=1}}else p[c].ind=c,p[c].extra=0,c+=1;if(t.l=p,v=g>v?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var F,I,R,L,V=h.a;n=V.length;var B=[];for(a=0;a0?s=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?n=1-this.xe.v/100:o=1+this.xe.v/100;var l=BezierFactory.getBezierEasing(s,a,n,o).get,h=0,p=this.finalS,c=this.finalE,f=this.data.sh;if(2===f)h=l(h=c===p?i>=c?1:0:t(0,e(.5/(c-p)+(i-p)/(c-p),1)));else if(3===f)h=l(h=c===p?i>=c?0:1:1-t(0,e(.5/(c-p)+(i-p)/(c-p),1)));else if(4===f)c===p?h=0:(h=t(0,e(.5/(c-p)+(i-p)/(c-p),1)))<.5?h*=2:h=1-2*(h-.5),h=l(h);else if(5===f){if(c===p)h=0;else{var u=c-p,d=-u/2+(i=e(t(0,i+.5-p),c-p)),m=u/2;h=Math.sqrt(1-d*d/(m*m))}h=l(h)}else 6===f?(c===p?h=0:(i=e(t(0,i+.5-p),c-p),h=(1+Math.cos(Math.PI+2*Math.PI*i/(c-p)))/2),h=l(h)):(i>=r(p)&&(h=t(0,e(i-p<0?e(c,1)-(p-i):c-i,1))),h=l(h));if(100!==this.sm.v){var y=.01*this.sm.v;0===y&&(y=1e-8);var g=.5-.5*y;h1&&(h=1)}return h*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/e,i=this.s.v/e+r,s=this.e.v/e+r;if(i>s){var a=i;i=s,s=a}this.finalS=i,this.finalE=s}},extendPrototype([DynamicPropertyContainer],i),{getTextSelectorProp:function(t,e,r){return new i(t,e,r)}}}();function TextAnimatorDataProperty(t,e,r){var i={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,r):i,rx:a.rx?s(t,a.rx,0,degToRads,r):i,ry:a.ry?s(t,a.ry,0,degToRads,r):i,sk:a.sk?s(t,a.sk,0,degToRads,r):i,sa:a.sa?s(t,a.sa,0,degToRads,r):i,s:a.s?s(t,a.s,1,.01,r):i,a:a.a?s(t,a.a,1,0,r):i,o:a.o?s(t,a.o,0,.01,r):i,p:a.p?s(t,a.p,1,0,r):i,sw:a.sw?s(t,a.sw,0,0,r):i,sc:a.sc?s(t,a.sc,1,0,r):i,fc:a.fc?s(t,a.fc,1,0,r):i,fh:a.fh?s(t,a.fh,0,0,r):i,fs:a.fs?s(t,a.fs,0,.01,r):i,fb:a.fb?s(t,a.fb,0,.01,r):i,t:a.t?s(t,a.t,0,0,r):i},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,r),this.s.t=e.s.t}function TextAnimatorProperty(t,e,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,r=this._textData.a.length,i=PropertyFactory.getProp;for(t=0;t=o+ot||!d?(v=(o+ot-h)/l.partialLength,O=u.point[0]+(l.point[0]-u.point[0])*v,$=u.point[1]+(l.point[1]-u.point[1])*v,E.translate(-P[0]*w[s].an*.005,-P[1]*L*.01),p=!1):d&&(h+=l.partialLength,(c+=1)>=d.length&&(c=0,m[f+=1]?d=m[f].points:_.v.c?(c=0,d=m[f=0].points):(h-=l.partialLength,d=null)),d&&(u=l,y=(l=d[c]).partialLength));B=w[s].an/2-w[s].add,E.translate(-B,0,0)}else B=w[s].an/2-w[s].add,E.translate(-B,0,0),E.translate(-P[0]*w[s].an*.005,-P[1]*L*.01,0);for(D=0;Dt?this.textSpans[t].span:createNS(l?"g":"text"),y<=t){if(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=n,l){var g=createNS("g");n.appendChild(g),this.textSpans[t].childSpan=g}this.textSpans[t].span=n,this.layerElement.appendChild(n)}n.style.display="inherit"}if(h.reset(),p&&(o[t].n&&(c=-d,f+=r.yOffset,f+=u?1:0,u=!1),this.applyTextPropertiesToMatrix(r,h,o[t].line,c,f),c+=o[t].l||0,c+=d),l){var v;if(1===(m=this.globalData.fontManager.getCharData(r.finalText[t],i.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily)).t)v=new SVGCompElement(m.data,this.globalData,this);else{var b=emptyShapeData;m.data&&m.data.shapes&&(b=this.buildShapeData(m.data,r.finalSize)),v=new SVGShapeElement(b,this.globalData,this)}if(this.textSpans[t].glyph){var _=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(_.layerElement),_.destroy()}this.textSpans[t].glyph=v,v._debug=!0,v.prepareFrame(0),v.renderFrame(),this.textSpans[t].childSpan.appendChild(v.layerElement),1===m.t&&this.textSpans[t].childSpan.setAttribute("transform","scale("+r.finalSize/100+","+r.finalSize/100+")")}else p&&n.setAttribute("transform","translate("+h.props[12]+","+h.props[13]+")"),n.textContent=o[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}p&&n&&n.setAttribute("d","")}else{var P=this.textContainer,x="start";switch(r.j){case 1:x="end";break;case 2:x="middle";break;default:x="start"}P.setAttribute("text-anchor",x),P.setAttribute("letter-spacing",d);var S=this.buildTextContents(r.finalText);for(e=S.length,f=r.ps?r.ps[1]+r.ascent:0,t=0;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t=0;r-=1)t.finalTransform.multiply(t.transforms[r].transform.mProps.v);t._mdf=s},processSequences:function(t){var e,r=this.sequenceList.length;for(e=0;e=1){this.buffers=[];var t=this.globalData.canvasContext,e=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(e);var r=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(r),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(t){t.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var t=this.buffers[0].getContext("2d");this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var t=this.buffers[1],e=t.getContext("2d");if(this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var r=assetLoader.getLumaCanvas(this.canvasContext.canvas);r.getContext("2d").drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(r,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(t,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(t){if(!this.hidden&&!this.data.hd&&(1!==this.data.td||t)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var e=0===this.data.ty;this.prepareLayer(),this.globalData.renderer.save(e),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(e),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(t,e){var r={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},i={};if("fl"===t.ty||"st"===t.ty?(i.c=PropertyFactory.getProp(this,t.c,1,255,this),i.c.k||(r.co="rgb("+bmFloor(i.c.v[0])+","+bmFloor(i.c.v[1])+","+bmFloor(i.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(i.s=PropertyFactory.getProp(this,t.s,1,null,this),i.e=PropertyFactory.getProp(this,t.e,1,null,this),i.h=PropertyFactory.getProp(this,t.h||{k:0},0,.01,this),i.a=PropertyFactory.getProp(this,t.a||{k:0},0,degToRads,this),i.g=new GradientProperty(this,t.g,this)),i.o=PropertyFactory.getProp(this,t.o,0,.01,this),"st"===t.ty||"gs"===t.ty){if(r.lc=lineCapEnum[t.lc||2],r.lj=lineJoinEnum[t.lj||2],1==t.lj&&(r.ml=t.ml),i.w=PropertyFactory.getProp(this,t.w,0,null,this),i.w.k||(r.wi=i.w.v),t.d){var s=new DashProperty(this,t.d,"canvas",this);i.d=s,i.d.k||(r.da=i.d.dashArray,r.do=i.d.dashoffset[0])}}else r.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(r),i.style=r,i},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)}}},CVShapeElement.prototype.createShapeElement=function(t){var e=new CVShapeData(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t=0;a-=1){if((l=this.searchProcessedElement(t[a]))?e[a]=r[l-1]:t[a]._shouldRender=i,"fl"===t[a].ty||"st"===t[a].ty||"gf"===t[a].ty||"gs"===t[a].ty)l?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],d),f.push(e[a].style);else if("gr"===t[a].ty){if(l)for(o=e[a].it.length,n=0;n=0;s-=1)"tr"===e[s].ty?(a=r[s].transform,this.renderShapeTransform(t,a)):"sh"===e[s].ty||"el"===e[s].ty||"rc"===e[s].ty||"sr"===e[s].ty?this.renderPath(e[s],r[s]):"fl"===e[s].ty?this.renderFill(e[s],r[s],a):"st"===e[s].ty?this.renderStroke(e[s],r[s],a):"gf"===e[s].ty||"gs"===e[s].ty?this.renderGradientFill(e[s],r[s],a):"gr"===e[s].ty?this.renderShape(a,e[s].it,r[s].it):e[s].ty;i&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var r,i,s,a=t.trNodes,n=e.paths,o=n._length;a.length=0;var l=t.transforms.finalTransform;for(s=0;s=1?c=.99:c<=-1&&(c=-.99);var f=h*c,u=Math.cos(p+e.a.v)*f+o[0],d=Math.sin(p+e.a.v)*f+o[1];i=n.createRadialGradient(u,d,0,o[0],o[1],h)}var m=t.g.p,y=e.g.c,g=1;for(a=0;ao&&"xMidYMid slice"===l||ns&&"meet"===o||as&&"slice"===o)?(r-this.transformCanvas.w*(i/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===h&&(as&&"slice"===o)?(r-this.transformCanvas.w*(i/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===p&&(a>s&&"meet"===o||as&&"meet"===o||a=0;t-=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){var r;this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var i=this.layers.length;for(this.completeLayers||this.checkLayers(t),r=i-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(t-this.layers[r].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=i-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){var r=this.createItem(this.layers[t],this,this.globalData);e[t]=r,r.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"},CVContextData.prototype.duplicate=function(){var t=2*this._length,e=0;for(e=this._length;e=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t;for(t=this.layers.length-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){var t=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var e=this.finalTransform.mat.toCSS();t.transform=e,t.webkitTransform=e}this.finalTransform._opMdf&&(t.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?((t=createNS("rect")).setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((t=createTag("div")).style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},HShapeElement.prototype.getTransformedPoint=function(t,e){var r,i=t.length;for(r=0;r0&&o<1&&c[f].push(this.calculateF(o,t,e,r,i,f)):(l=a*a-4*n*s)>=0&&((h=(-a+bmSqrt(l))/(2*s))>0&&h<1&&c[f].push(this.calculateF(h,t,e,r,i,f)),(p=(-a-bmSqrt(l))/(2*s))>0&&p<1&&c[f].push(this.calculateF(p,t,e,r,i,f))));this.shapeBoundingBox.left=bmMin.apply(null,c[0]),this.shapeBoundingBox.top=bmMin.apply(null,c[1]),this.shapeBoundingBox.right=bmMax.apply(null,c[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,c[1])},HShapeElement.prototype.calculateF=function(t,e,r,i,s,a){return bmPow(1-t,3)*e[a]+3*bmPow(1-t,2)*t*r[a]+3*(1-t)*bmPow(t,2)*i[a]+bmPow(t,3)*s[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var r,i=t.length;for(r=0;rr&&(r=s)}r*=t.mult}else r=t.v*t.mult;e.x-=r,e.xMax+=r,e.y-=r,e.yMax+=r},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax=0;t-=1){var i=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-i.p.v[0],-i.p.v[1],i.p.v[2]),this.mat.rotateX(-i.or.v[0]).rotateY(-i.or.v[1]).rotateZ(i.or.v[2]),this.mat.rotateX(-i.rx.v).rotateY(-i.ry.v).rotateZ(i.rz.v),this.mat.scale(1/i.s.v[0],1/i.s.v[1],1/i.s.v[2]),this.mat.translate(i.a.v[0],i.a.v[1],i.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var s;s=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2)+Math.pow(s[2],2)),n=[s[0]/a,s[1]/a,s[2]/a],o=Math.sqrt(n[2]*n[2]+n[0]*n[0]),l=Math.atan2(n[1],o),h=Math.atan2(n[0],-n[2]);this.mat.rotateY(h).rotateX(-l)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var p=!this._prevMat.equals(this.mat);if((p||this.pe._mdf)&&this.comp.threeDElements){var c,f,u;for(e=this.comp.threeDElements.length,t=0;t=t)return this.threeDElements[e].perspectiveElem;e+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(t,e){var r,i,s=createTag("div");styleDiv(s);var a=createTag("div");if(styleDiv(a),"3d"===e){(r=s.style).width=this.globalData.compSize.w+"px",r.height=this.globalData.compSize.h+"px";var n="50% 50%";r.webkitTransformOrigin=n,r.mozTransformOrigin=n,r.transformOrigin=n;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(i=a.style).transform=o,i.webkitTransform=o}s.appendChild(a);var l={container:a,perspectiveElem:s,startPos:t,endPos:t,type:e};return this.threeDElements.push(l),l},HybridRendererBase.prototype.build3dContainers=function(){var t,e,r=this.layers.length,i="";for(t=0;t=0;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(t,e){for(var r=0,i=this.threeDElements.length;rn?(t=s/this.globalData.compSize.w,e=s/this.globalData.compSize.w,r=0,i=(a-this.globalData.compSize.h*(s/this.globalData.compSize.w))/2):(t=a/this.globalData.compSize.h,e=a/this.globalData.compSize.h,r=(s-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,i=0);var o=this.resizerElem.style;o.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+r+","+i+",0,1)",o.transform=o.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,r=this.globalData.compSize.h,i=this.threeDElements.length;for(t=0;t=n;)t/=2,e/=2,r>>>=1;return(t+r)/e};return v.int32=function(){return 0|g.g(4)},v.quick=function(){return g.g(4)/4294967296},v.double=v,c(f(g.S),t),(u.pass||d||function(t,r,i,s){return s&&(s.S&&h(s,g),t.state=function(){return h(g,{})}),i?(e.random=t,r):t})(v,y,"global"in u?u.global:this==e,u.state)},c(e.random(),t)}function initialize$2(t){seedRandom([],t)}var propTypes={SHAPE:"shape"};function _typeof$1(t){return _typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$1(t)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null,_lottieGlobal={};function resetFrame(){_lottieGlobal={}}function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||e instanceof Number||"boolean"===t||"string"===t}function $bm_neg(t){var e=_typeof$1(t);if("number"===e||t instanceof Number||"boolean"===e)return-t;if($bm_isInstanceOfArray(t)){var r,i=t.length,s=[];for(r=0;rr){var i=r;r=e,e=i}return Math.min(Math.max(t,e),r)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);var r;e||(e=helperLengthArray);var i=Math.min(t.length,e.length),s=0;for(r=0;r.5?h/(2-n-o):h/(n+o),n){case i:e=(s-a)/h+(s1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function hslToRgb(t){var e,r,i,s=t[0],a=t[1],n=t[2];if(0===a)e=n,i=n,r=n;else{var o=n<.5?n*(1+a):n+a-n*a,l=2*n-o;e=hue2rgb(l,o,s+1/3),r=hue2rgb(l,o,s),i=hue2rgb(l,o,s-1/3)}return[e,r,i,t[3]]}function linear(t,e,r,i,s){if(void 0!==i&&void 0!==s||(i=e,s=r,e=0,r=1),r=r)return s;var n,o=r===e?0:(t-e)/(r-e);if(!i.length)return i+(s-i)*o;var l=i.length,h=createTypedArray("float32",l);for(n=0;n1){for(i=0;i1?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(s)){var o,l=s.length,h=createTypedArray("float32",l);for(o=0;odata.k[e].t&&tdata.k[e+1].t-t?(r=e+2,i=data.k[e+1].t):(r=e+1,i=data.k[e].t);break}}-1===r&&(r=e+1,i=data.k[e].t)}else r=0,i=0;var a={};return a.index=r,a.time=i/elem.comp.globalData.frameRate,a}function key(t){var e,r,i;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(i=s.length,r=0;rh.length-1)&&(e=h.length-1),i=p-(s=h[h.length-1-e].t)),"pingpong"===t){if(Math.floor((l-s)/i)%2!=0)return this.getValueAtTime((i-(l-s)%i+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var c=this.getValueAtTime(s/this.comp.globalData.frameRate,0),f=this.getValueAtTime(p/this.comp.globalData.frameRate,0),u=this.getValueAtTime(((l-s)%i+s)/this.comp.globalData.frameRate,0),d=Math.floor((l-s)/i);if(this.pv.length){for(n=(o=new Array(c.length)).length,a=0;a=p)return this.pv;if(r?s=p+(i=e?Math.abs(this.elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-p)):((!e||e>h.length-1)&&(e=h.length-1),i=(s=h[e].t)-p),"pingpong"===t){if(Math.floor((p-l)/i)%2==0)return this.getValueAtTime(((p-l)%i+p)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var c=this.getValueAtTime(p/this.comp.globalData.frameRate,0),f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),u=this.getValueAtTime((i-(p-l)%i+p)/this.comp.globalData.frameRate,0),d=Math.floor((p-l)/i)+1;if(this.pv.length){for(n=(o=new Array(c.length)).length,a=0;a1?(s+t-a)/(e-1):1,o=0,l=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;on){var p=o,c=r.c&&o===l-1?0:o+1,f=(n-h)/a[o].addedLength;i=bez.getPointInSegment(r.v[p],r.v[c],r.o[p],r.i[c],f,a[o]);break}h+=a[o].addedLength,o+=1}return i||(i=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),i},vectorOnPath:function(t,e,r){1==t?t=this.v.c:0==t&&(t=.999);var i=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-i[0],n=s[1]-i[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===r?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([h],o),extendPrototype([h],l),l.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime=h?u<0?i:s:i+f*Math.pow((a-t)/u,1/r),p[c]=n,c+=1,o+=256/255;return p.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,r=this.filterManager.effectElements;this.feFuncRComposed&&(t||r[3].p._mdf||r[4].p._mdf||r[5].p._mdf||r[6].p._mdf||r[7].p._mdf)&&(e=this.getTableValue(r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v,r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||r[10].p._mdf||r[11].p._mdf||r[12].p._mdf||r[13].p._mdf||r[14].p._mdf)&&(e=this.getTableValue(r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v,r[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||r[17].p._mdf||r[18].p._mdf||r[19].p._mdf||r[20].p._mdf||r[21].p._mdf)&&(e=this.getTableValue(r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v,r[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||r[24].p._mdf||r[25].p._mdf||r[26].p._mdf||r[27].p._mdf||r[28].p._mdf)&&(e=this.getTableValue(r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v,r[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||r[31].p._mdf||r[32].p._mdf||r[33].p._mdf||r[34].p._mdf||r[35].p._mdf)&&(e=this.getTableValue(r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v,r[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var r=this.filterManager.effectElements[3].p.v,i=(this.filterManager.effectElements[2].p.v-90)*degToRads,s=r*Math.cos(i),a=r*Math.sin(i);this.feOffset.setAttribute("dx",s),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,r){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=r,r.matteElement=createNS("g"),r.matteElement.appendChild(r.layerElement),r.matteElement.appendChild(r.transformedElement),r.baseElement=r.matteElement}function SVGGaussianBlurEffect(t,e,r,i){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","300%"),t.setAttribute("height","300%"),this.filterManager=e;var s=createNS("feGaussianBlur");s.setAttribute("result",i),t.appendChild(s),this.feGaussianBlur=s}function TransformEffect(){}function SVGTransformEffect(t,e){this.init(e)}function CVTransformEffect(t){this.init(t)}return SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,r=_svgMatteSymbols.length;e=4",lerna:"^4.0.0","lint-staged":"^12.3.2","parcel-bundler":"^1.12.4",prettier:"^2.3.0",rollup:"^2.23.0","rollup-plugin-copy":"^3.3.0","rollup-plugin-filesize":"^9.0.2","rollup-plugin-serve":"^1.0.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.31.1","rollup-plugin-uglify":"^6.0.4","rollup-plugin-visualizer":"^5.5.4","semantic-release":"^19.0.2",shx:"^0.3.4","source-map-support":"^0.5.21","ts-node":"^10.4.0",typescript:"^4.5.5","unicode-canonical-property-names-ecmascript":"^2.0.0"},files=["dist/"],keywords=["lottie","animation","lottiefiles","web component","component","lit-element","player","telegram sticker","tgs"],browserslist=["> 3%"],publishConfig={access:"public",provenance:!0},husky={hooks:{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},nyc={extends:"@istanbuljs/nyc-config-typescript",all:!0},packageManager="yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447",_package={name:name,version:version,description:description,main:main,module:module,types:types,homepage:homepage,repository:repository,bugs:bugs,author:author,license:license,scripts:scripts,dependencies:dependencies,devDependencies:devDependencies,files:files,keywords:keywords,browserslist:browserslist,publishConfig:publishConfig,husky:husky,"lint-staged":{"src/**/*.{css,scss,md}":["prettier --write"],"src/**/*.{js,jsx,ts,tsx,json}":["eslint . --ext .ts,.tsx,.js --fix"]},nyc:nyc,packageManager:packageManager},_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,PlayerState,PlayMode,PlayerEvents;function parseSrc(t){if("object"==typeof t)return t;try{return JSON.parse(t)}catch(e){return new URL(t,window.location.href).toString()}}function isLottie(t){return["v","ip","op","layers","fr","w","h"].every((e=>Object.prototype.hasOwnProperty.call(t,e)))}function fromURL(t){return _fromURL.apply(this,arguments)}function _fromURL(){return(_fromURL=_asyncToGenerator((function*(t){if("string"!=typeof t)throw new Error("The url value must be a string");var e;try{var r=new URL(t),i=yield fetch(r.toString());e=yield i.json()}catch(t){throw new Error("An error occurred while trying to load the Lottie file from URL")}return e}))).apply(this,arguments)}exports.PlayerState=void 0,PlayerState=exports.PlayerState||(exports.PlayerState={}),PlayerState.Destroyed="destroyed",PlayerState.Error="error",PlayerState.Frozen="frozen",PlayerState.Loading="loading",PlayerState.Paused="paused",PlayerState.Playing="playing",PlayerState.Stopped="stopped",exports.PlayMode=void 0,PlayMode=exports.PlayMode||(exports.PlayMode={}),PlayMode.Bounce="bounce",PlayMode.Normal="normal",exports.PlayerEvents=void 0,PlayerEvents=exports.PlayerEvents||(exports.PlayerEvents={}),PlayerEvents.Complete="complete",PlayerEvents.Destroyed="destroyed",PlayerEvents.Error="error",PlayerEvents.Frame="frame",PlayerEvents.Freeze="freeze",PlayerEvents.Load="load",PlayerEvents.Loop="loop",PlayerEvents.Pause="pause",PlayerEvents.Play="play",PlayerEvents.Ready="ready",PlayerEvents.Rendered="rendered",PlayerEvents.Stop="stop",exports.LottiePlayer=class extends s{constructor(){super(...arguments),this.autoplay=!1,this.background="transparent",this.controls=!1,this.currentState=exports.PlayerState.Loading,this.description="Lottie animation",this.direction=1,this.disableCheck=!1,this.disableShadowDOM=!1,this.hover=!1,this.intermission=1,this.loop=!1,this.mode=exports.PlayMode.Normal,this.preserveAspectRatio="xMidYMid meet",this.renderer="svg",this.speed=1,this._io=void 0,this._counter=1,this._onVisibilityChange=()=>{!0===document.hidden&&this.currentState===exports.PlayerState.Playing?this.freeze():this.currentState===exports.PlayerState.Frozen&&this.play()}}load(t){var e=this;return _asyncToGenerator((function*(){var r={container:e.container,loop:!1,autoplay:!1,renderer:e.renderer,rendererSettings:Object.assign({preserveAspectRatio:e.preserveAspectRatio,clearCanvas:!1,progressiveLoad:!0,hideOnTransparent:!0},e.viewBoxSize&&{viewBoxSize:e.viewBoxSize})};try{var i=parseSrc(t),s={},a="string"==typeof i?"path":"animationData";e._lottie&&e._lottie.destroy(),e.webworkers&&lottie$1.exports.useWebWorker(!0),e._lottie=lottie$1.exports.loadAnimation(Object.assign(Object.assign({},r),{[a]:i})),e._attachEventListeners(),e.disableCheck||("path"===a?(s=yield fromURL(i),a="animationData"):s=i,isLottie(s)||(e.currentState=exports.PlayerState.Error,e.dispatchEvent(new CustomEvent(exports.PlayerEvents.Error))))}catch(t){e.currentState=exports.PlayerState.Error,e.dispatchEvent(new CustomEvent(exports.PlayerEvents.Error))}}))()}getLottie(){return this._lottie}getVersions(){return{lottieWebVersion:dependencies["lottie-web"],lottiePlayerVersion:version}}play(){this._lottie&&(this._lottie.play(),this.currentState=exports.PlayerState.Playing,this.dispatchEvent(new CustomEvent(exports.PlayerEvents.Play)))}pause(){this._lottie&&(this._lottie.pause(),this.currentState=exports.PlayerState.Paused,this.dispatchEvent(new CustomEvent(exports.PlayerEvents.Pause)))}stop(){this._lottie&&(this._counter=1,this._lottie.stop(),this.currentState=exports.PlayerState.Stopped,this.dispatchEvent(new CustomEvent(exports.PlayerEvents.Stop)))}destroy(){this._lottie&&(this._lottie.destroy(),this._lottie=null,this.currentState=exports.PlayerState.Destroyed,this.dispatchEvent(new CustomEvent(exports.PlayerEvents.Destroyed)),this.remove())}seek(t){if(this._lottie){var e=/^(\d+)(%?)$/.exec(t.toString());if(e){var r="%"===e[2]?this._lottie.totalFrames*Number(e[1])/100:Number(e[1]);this.seeker=r,this.currentState===exports.PlayerState.Playing?this._lottie.goToAndPlay(r,!0):(this._lottie.goToAndStop(r,!0),this._lottie.pause())}}}snapshot(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shadowRoot){var e=this.shadowRoot.querySelector(".animation svg"),r=(new XMLSerializer).serializeToString(e);if(t){var i=document.createElement("a");i.href="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(r)),i.download="download_".concat(this.seeker,".svg"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}return r}}setSpeed(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this._lottie&&this._lottie.setSpeed(t)}setDirection(t){this._lottie&&this._lottie.setDirection(t)}setLooping(t){this._lottie&&(this.loop=t,this._lottie.loop=t)}togglePlay(){return this.currentState===exports.PlayerState.Playing?this.pause():this.play()}toggleLooping(){this.setLooping(!this.loop)}resize(){this._lottie&&this._lottie.resize()}static get styles(){return styles}disconnectedCallback(){this.isConnected||(this._io&&(this._io.disconnect(),this._io=void 0),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.destroy())}render(){var t=this.controls?"main controls":"main",e=this.controls?"animation controls":"animation";return $(_templateObject||(_templateObject=_taggedTemplateLiteral([' \n \n ',"\n
\n ","\n "])),t,this.description,e,this.background,this.currentState===exports.PlayerState.Error?$(_templateObject2||(_templateObject2=_taggedTemplateLiteral(['
⚠️
']))):void 0,this.controls&&!this.disableShadowDOM?this.renderControls():void 0)}createRenderRoot(){return this.disableShadowDOM&&(this.style.display="block"),this.disableShadowDOM?this:super.createRenderRoot()}firstUpdated(){"IntersectionObserver"in window&&(this._io=new IntersectionObserver((t=>{t[0].isIntersecting?this.currentState===exports.PlayerState.Frozen&&this.play():this.currentState===exports.PlayerState.Playing&&this.freeze()})),this._io.observe(this.container)),void 0!==document.hidden&&document.addEventListener("visibilitychange",this._onVisibilityChange),this.src&&this.load(this.src),this.dispatchEvent(new CustomEvent(exports.PlayerEvents.Rendered))}renderControls(){var t=this.currentState===exports.PlayerState.Playing,e=this.currentState===exports.PlayerState.Paused,r=this.currentState===exports.PlayerState.Stopped;return $(_templateObject3||(_templateObject3=_taggedTemplateLiteral(['\n \n \n ','\n \n \n \n \n \n \n \n \n \n '])),this.togglePlay,t||e?"active":"",$(t?_templateObject4||(_templateObject4=_taggedTemplateLiteral(['