@aarsteinmedia/dotlottie-player 6.2.3 → 6.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  Changelog was only added since [3.2.3], so it's not exhaustive. [Please report any missing noteable changes to us](https://github.com/aarsteinmedia/dotlottie-player/issues), and we'll add them promptly.
9
9
 
10
- ## [6.2.3] - 11-11-2025
10
+ ## [6.2.4] - 11-11-2025
11
11
 
12
12
  ### Changed
13
13
 
package/dist/canvas.d.ts CHANGED
@@ -58,10 +58,10 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
58
58
  get description(): string | null;
59
59
  set direction(value: AnimationDirection);
60
60
  get direction(): AnimationDirection;
61
- set dontFreezeOnBlur(value: boolean);
62
- get dontFreezeOnBlur(): boolean;
63
- set hover(value: boolean);
64
- get hover(): boolean;
61
+ set dontFreezeOnBlur(value: HTMLBooleanAttribute);
62
+ get dontFreezeOnBlur(): HTMLBooleanAttribute;
63
+ set hover(value: HTMLBooleanAttribute);
64
+ get hover(): HTMLBooleanAttribute;
65
65
  set intermission(value: number);
66
66
  get intermission(): number;
67
67
  get isDotLottie(): boolean;
package/dist/canvas.js CHANGED
@@ -444,7 +444,7 @@ const notImplemented = 'Method is not implemented';
444
444
  /**
445
445
  * Whether to freeze animation when window loses focus.
446
446
  */ set dontFreezeOnBlur(value) {
447
- this.setAttribute('dontFreezeOnBlur', value.toString());
447
+ this.setAttribute('dontFreezeOnBlur', Boolean(value).toString());
448
448
  }
449
449
  get dontFreezeOnBlur() {
450
450
  const val = this.getAttribute('dontFreezeOnBlur');
@@ -453,7 +453,7 @@ const notImplemented = 'Method is not implemented';
453
453
  /**
454
454
  * Whether to play on mouseover.
455
455
  */ set hover(value) {
456
- this.setAttribute('hover', value.toString());
456
+ this.setAttribute('hover', Boolean(value).toString());
457
457
  }
458
458
  get hover() {
459
459
  const val = this.getAttribute('hover');
package/dist/full.d.ts CHANGED
@@ -59,10 +59,10 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
59
59
  get description(): string | null;
60
60
  set direction(value: AnimationDirection);
61
61
  get direction(): AnimationDirection;
62
- set dontFreezeOnBlur(value: boolean);
63
- get dontFreezeOnBlur(): boolean;
64
- set hover(value: boolean);
65
- get hover(): boolean;
62
+ set dontFreezeOnBlur(value: HTMLBooleanAttribute);
63
+ get dontFreezeOnBlur(): HTMLBooleanAttribute;
64
+ set hover(value: HTMLBooleanAttribute);
65
+ get hover(): HTMLBooleanAttribute;
66
66
  set intermission(value: number);
67
67
  get intermission(): number;
68
68
  get isDotLottie(): boolean;
package/dist/full.js CHANGED
@@ -444,7 +444,7 @@ const notImplemented = 'Method is not implemented';
444
444
  /**
445
445
  * Whether to freeze animation when window loses focus.
446
446
  */ set dontFreezeOnBlur(value) {
447
- this.setAttribute('dontFreezeOnBlur', value.toString());
447
+ this.setAttribute('dontFreezeOnBlur', Boolean(value).toString());
448
448
  }
449
449
  get dontFreezeOnBlur() {
450
450
  const val = this.getAttribute('dontFreezeOnBlur');
@@ -453,7 +453,7 @@ const notImplemented = 'Method is not implemented';
453
453
  /**
454
454
  * Whether to play on mouseover.
455
455
  */ set hover(value) {
456
- this.setAttribute('hover', value.toString());
456
+ this.setAttribute('hover', Boolean(value).toString());
457
457
  }
458
458
  get hover() {
459
459
  const val = this.getAttribute('hover');
package/dist/light.d.ts CHANGED
@@ -58,10 +58,10 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
58
58
  get description(): string | null;
59
59
  set direction(value: AnimationDirection);
60
60
  get direction(): AnimationDirection;
61
- set dontFreezeOnBlur(value: boolean);
62
- get dontFreezeOnBlur(): boolean;
63
- set hover(value: boolean);
64
- get hover(): boolean;
61
+ set dontFreezeOnBlur(value: HTMLBooleanAttribute);
62
+ get dontFreezeOnBlur(): HTMLBooleanAttribute;
63
+ set hover(value: HTMLBooleanAttribute);
64
+ get hover(): HTMLBooleanAttribute;
65
65
  set intermission(value: number);
66
66
  get intermission(): number;
67
67
  get isDotLottie(): boolean;
package/dist/light.js CHANGED
@@ -444,7 +444,7 @@ const notImplemented = 'Method is not implemented';
444
444
  /**
445
445
  * Whether to freeze animation when window loses focus.
446
446
  */ set dontFreezeOnBlur(value) {
447
- this.setAttribute('dontFreezeOnBlur', value.toString());
447
+ this.setAttribute('dontFreezeOnBlur', Boolean(value).toString());
448
448
  }
449
449
  get dontFreezeOnBlur() {
450
450
  const val = this.getAttribute('dontFreezeOnBlur');
@@ -453,7 +453,7 @@ const notImplemented = 'Method is not implemented';
453
453
  /**
454
454
  * Whether to play on mouseover.
455
455
  */ set hover(value) {
456
- this.setAttribute('hover', value.toString());
456
+ this.setAttribute('hover', Boolean(value).toString());
457
457
  }
458
458
  get hover() {
459
459
  const val = this.getAttribute('hover');
package/dist/svg.d.ts CHANGED
@@ -58,10 +58,10 @@ declare abstract class DotLottiePlayerBase extends PropertyCallbackElement {
58
58
  get description(): string | null;
59
59
  set direction(value: AnimationDirection);
60
60
  get direction(): AnimationDirection;
61
- set dontFreezeOnBlur(value: boolean);
62
- get dontFreezeOnBlur(): boolean;
63
- set hover(value: boolean);
64
- get hover(): boolean;
61
+ set dontFreezeOnBlur(value: HTMLBooleanAttribute);
62
+ get dontFreezeOnBlur(): HTMLBooleanAttribute;
63
+ set hover(value: HTMLBooleanAttribute);
64
+ get hover(): HTMLBooleanAttribute;
65
65
  set intermission(value: number);
66
66
  get intermission(): number;
67
67
  get isDotLottie(): boolean;
package/dist/svg.js CHANGED
@@ -444,7 +444,7 @@ const notImplemented = 'Method is not implemented';
444
444
  /**
445
445
  * Whether to freeze animation when window loses focus.
446
446
  */ set dontFreezeOnBlur(value) {
447
- this.setAttribute('dontFreezeOnBlur', value.toString());
447
+ this.setAttribute('dontFreezeOnBlur', Boolean(value).toString());
448
448
  }
449
449
  get dontFreezeOnBlur() {
450
450
  const val = this.getAttribute('dontFreezeOnBlur');
@@ -453,7 +453,7 @@ const notImplemented = 'Method is not implemented';
453
453
  /**
454
454
  * Whether to play on mouseover.
455
455
  */ set hover(value) {
456
- this.setAttribute('hover', value.toString());
456
+ this.setAttribute('hover', Boolean(value).toString());
457
457
  }
458
458
  get hover() {
459
459
  const val = this.getAttribute('hover');
@@ -67,4 +67,4 @@
67
67
  d="M14.016 5.016H18v13.969h-3.984V5.016zM6 18.984V5.015h3.984v13.969H6z"
68
68
  />
69
69
  </svg>
70
- `;async function nH(){if(!this.shadow||!this.template)throw Error("No Shadow Element or Template");this.template.innerHTML=`<div class="animation-container main" data-controls="${this.controls??!1}" lang="${this.description?document.documentElement.lang:"en"}" aria-label="${this.description??"Lottie animation"}" data-loaded="${this._playerState.loaded}"><figure class="animation" style="background:${this.background}">${this.playerState===nG.Error?`<div class="error"><svg preserveAspectRatio="${N.Cover}" xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080" style="white-space:preserve"><path fill="#fff" d="M0 0h1920v1080H0z"/><path fill="#3a6d8b" d="M1190.2 531 1007 212.4c-22-38.2-77.2-38-98.8.5L729.5 531.3c-21.3 37.9 6.1 84.6 49.5 84.6l361.9.3c43.7 0 71.1-47.3 49.3-85.2zM937.3 288.7c.2-7.5 3.3-23.9 23.2-23.9 16.3 0 23 16.1 23 23.5 0 55.3-10.7 197.2-12.2 214.5-.1 1-.9 1.7-1.9 1.7h-18.3c-1 0-1.8-.7-1.9-1.7-1.4-17.5-13.4-162.9-11.9-214.1zm24.2 283.8c-13.1 0-23.7-10.6-23.7-23.7s10.6-23.7 23.7-23.7 23.7 10.6 23.7 23.7-10.6 23.7-23.7 23.7zM722.1 644h112.6v34.4h-70.4V698h58.8v31.7h-58.8v22.6h72.4v36.2H722.1V644zm162 57.1h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6zm78.9 0h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5H963v15.6zm39.5 36.2c0-31.3 22.2-54.8 56.6-54.8 34.4 0 56.2 23.5 56.2 54.8s-21.8 54.6-56.2 54.6c-34.4-.1-56.6-23.3-56.6-54.6zm74 0c0-17.4-6.1-29.1-17.8-29.1-11.7 0-17.4 11.7-17.4 29.1 0 17.4 5.7 29.1 17.4 29.1s17.8-11.8 17.8-29.1zm83.1-36.2h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6z"/><path fill="none" d="M718.9 807.7h645v285.4h-645z"/><text fill="#3a6d8b" style="text-align:center;position:absolute;left:100%;font-size:47px;font-family:system-ui,-apple-system,BlinkMacSystemFont,'.SFNSText-Regular',sans-serif" x="50%" y="848.017" text-anchor="middle">${this._errorMessage}</text></svg></div>`:""}</figure><slot name="controls"></slot></div>`,this.shadow.adoptedStyleSheets=[await nJ.styles()],this.shadow.appendChild(this.template.content.cloneNode(!0))}let nY=t=>{let e={message:"Unknown error",status:R?500:400};return t&&"object"==typeof t&&("message"in t&&"string"==typeof t.message&&(e.message=t.message),"status"in t&&(e.status=Number(t.status))),e},nU="Method is not implemented";class nJ extends nA{static get observedAttributes(){return["animateOnScroll","autoplay","controls","direction","hover","loop","mode","playOnClick","playOnVisible","selector","speed","src","subframe"]}static get observedProperties(){return["playerState","_isSettingsOpen","_seeker","_currentAnimation","_animations"]}static get styles(){return async()=>{let t=new CSSStyleSheet;return await t.replace("* {\n box-sizing: border-box;\n}\n\n:host {\n --lottie-player-toolbar-height: 35px;\n --lottie-player-toolbar-background-color: #fff;\n --lottie-player-toolbar-icon-color: #000;\n --lottie-player-toolbar-icon-hover-color: #000;\n --lottie-player-toolbar-icon-active-color: #4285f4;\n --lottie-player-seeker-track-color: rgb(0 0 0 / 20%);\n --lottie-player-seeker-thumb-color: #4285f4;\n --lottie-player-seeker-display: block;\n\n width: 100%;\n height: 100%;\n\n &:not([hidden]) {\n display: block;\n }\n\n .main {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n\n .animation {\n width: 100%;\n height: 100%;\n display: flex;\n margin: 0;\n padding: 0;\n }\n\n [data-controls='true'] .animation {\n height: calc(100% - 35px);\n }\n\n .animation-container {\n position: relative;\n }\n\n .popover {\n position: absolute;\n right: 5px;\n bottom: 40px;\n background-color: var(--lottie-player-toolbar-background-color);\n border-radius: 5px;\n padding: 10px 15px;\n border: solid 2px var(--lottie-player-toolbar-icon-color);\n animation: fade-in 0.2s ease-in-out;\n\n &::before {\n content: '';\n right: 10px;\n border: 7px solid transparent;\n margin-right: -7px;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n top: 100%;\n border-top-color: var(--lottie-player-toolbar-icon-color);\n }\n }\n\n .error {\n display: flex;\n margin: auto;\n justify-content: center;\n height: 100%;\n align-items: center;\n\n & svg {\n width: 100%;\n height: auto;\n }\n }\n\n .toolbar {\n display: flex;\n place-items: center center;\n background: var(--lottie-player-toolbar-background-color);\n margin: 0;\n height: 35px;\n padding: 5px;\n border-radius: 5px;\n gap: 5px;\n\n &.has-error {\n pointer-events: none;\n opacity: 0.5;\n }\n\n & button {\n cursor: pointer;\n fill: var(--lottie-player-toolbar-icon-color);\n color: var(--lottie-player-toolbar-icon-color);\n background: none;\n border: 0;\n padding: 0;\n outline: 0;\n height: 100%;\n margin: 0;\n align-items: center;\n gap: 5px;\n opacity: 0.9;\n\n &:not([hidden]) {\n display: flex;\n }\n\n &:hover {\n opacity: 1;\n }\n\n &[data-active='true'] {\n opacity: 1;\n fill: var(--lottie-player-toolbar-icon-active-color);\n }\n\n &:disabled {\n opacity: 0.5;\n }\n\n &:focus {\n outline: 0;\n }\n\n & svg {\n pointer-events: none;\n\n & > * {\n fill: inherit;\n }\n }\n\n &.disabled svg {\n display: none;\n }\n }\n }\n\n .progress-container {\n position: relative;\n width: 100%;\n\n &.simple {\n margin-right: 12px;\n }\n }\n\n .seeker {\n appearance: none;\n outline: none;\n width: 100%;\n height: 20px;\n border-radius: 3px;\n border: 0;\n cursor: pointer;\n background-color: transparent;\n\n display: var(--lottie-player-seeker-display);\n color: var(--lottie-player-seeker-thumb-color);\n margin: 0;\n padding: 7.5px 0;\n position: relative;\n z-index: 1;\n\n &::-webkit-slider-runnable-track,\n &::-webkit-slider-thumb {\n appearance: none;\n outline: none;\n }\n\n &::-webkit-slider-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n border: 0;\n background-color: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -webkit-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-webkit-slider-thumb,\n &:focus::-webkit-slider-thumb {\n transform: scale(1);\n }\n\n &::-moz-range-progress {\n background-color: var(--lottie-player-seeker-thumb-color);\n height: 5px;\n border-radius: 3px;\n }\n\n &::-moz-range-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: var(--lottie-player-seeker-thumb-color);\n border: 0;\n cursor: pointer;\n -moz-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-moz-range-thumb,\n &:focus::-moz-range-thumb {\n transform: scale(1);\n }\n\n &::-ms-track {\n width: 100%;\n height: 5px;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n border-radius: 3px;\n }\n\n &::-ms-fill-lower {\n background-color: var(--lottie-player-seeker-thumb-color);\n border-radius: 3px;\n }\n\n &::-ms-thumb {\n border: 0;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -ms-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-ms-thumb {\n transform: scale(1);\n }\n\n &:focus {\n &::-ms-thumb {\n transform: scale(1);\n }\n\n &::-ms-fill-lower,\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n }\n }\n }\n\n & progress {\n appearance: none;\n outline: none;\n position: absolute;\n width: 100%;\n height: 5px;\n border-radius: 3px;\n border: 0;\n top: 0;\n left: 0;\n margin: 7.5px 0;\n background-color: var(--lottie-player-seeker-track-color);\n pointer-events: none;\n\n &::-webkit-progress-inner-element {\n border-radius: 3px;\n overflow: hidden;\n }\n\n &::-webkit-slider-runnable-track {\n background-color: transparent;\n }\n\n &::-webkit-progress-value {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n }\n\n & *::-moz-progress-bar {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n}\n\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --lottie-player-toolbar-background-color: #000;\n --lottie-player-toolbar-icon-color: #fff;\n --lottie-player-toolbar-icon-hover-color: #fff;\n --lottie-player-seeker-track-color: rgb(255 255 255 / 60%);\n }\n}\n"),t}}set animateOnScroll(t){this.setAttribute("animateOnScroll",(!!t).toString())}get animateOnScroll(){let t=this.getAttribute("animateOnScroll");return"true"===t||""===t||"1"===t}get animations(){return this._animations}set autoplay(t){this.setAttribute("autoplay",(!!t).toString())}get autoplay(){let t=this.getAttribute("autoplay");return"true"===t||""===t||"1"===t}set background(t){this.setAttribute("background",t)}get background(){return this.getAttribute("background")||"transparent"}set controls(t){this.setAttribute("controls",(!!t).toString())}get controls(){let t=this.getAttribute("controls");return"true"===t||""===t||"1"===t}set count(t){this.setAttribute("count",t.toString())}get count(){let t=this.getAttribute("count");return t?Number(t):0}get currentAnimation(){return this._currentAnimation}set delay(t){this.setAttribute("delay",t.toString())}get delay(){let t=this.getAttribute("delay");return t?Number(t):0}set description(t){t&&this.setAttribute("description",t)}get description(){return this.getAttribute("description")}set direction(t){this.setAttribute("direction",t.toString())}get direction(){let t=Number(this.getAttribute("direction"));return -1===t?t:1}set dontFreezeOnBlur(t){this.setAttribute("dontFreezeOnBlur",t.toString())}get dontFreezeOnBlur(){let t=this.getAttribute("dontFreezeOnBlur");return"true"===t||""===t||"1"===t}set hover(t){this.setAttribute("hover",t.toString())}get hover(){let t=this.getAttribute("hover");return"true"===t||""===t||"1"===t}set intermission(t){this.setAttribute("intermission",t.toString())}get intermission(){let t=Number(this.getAttribute("intermission"));return isNaN(t)?0:t}get isDotLottie(){return this._isDotLottie}set loop(t){this.setAttribute("loop",(!!t).toString())}get loop(){let t=this.getAttribute("loop");return"true"===t||""===t||"1"===t}set mode(t){this.setAttribute("mode",t)}get mode(){let t=this.getAttribute("mode");return t===L.Bounce?t:L.Normal}set mouseout(t){this.setAttribute("mouseout",t)}get mouseout(){let t=this.getAttribute("mouseout");switch(t){case nB.Void:case nB.Pause:case nB.Reverse:return t;default:return nB.Stop}}set objectfit(t){this.setAttribute("objectfit",t)}get objectfit(){let t=this.getAttribute("objectfit");return t&&Object.values(nz).includes(t)?t:nz.Contain}set once(t){this.setAttribute("once",(!!t).toString())}get once(){let t=this.getAttribute("once");return"true"===t||""===t||"1"===t}set playOnClick(t){this.setAttribute("playOnClick",(!!t).toString())}get playOnClick(){let t=this.getAttribute("playOnClick");return"true"===t||""===t||"1"===t}set playOnVisible(t){this.setAttribute("playOnVisible",(!!t).toString())}get playOnVisible(){let t=this.getAttribute("playOnVisible");return"true"===t||""===t||"1"===t}set preserveAspectRatio(t){this.setAttribute("preserveAspectRatio",t||N.Contain)}get preserveAspectRatio(){let t=this.getAttribute("preserveAspectRatio");return t&&Object.values(N).includes(t)?t:null}set renderer(t){this.setAttribute("renderer",t)}get renderer(){let t=this.getAttribute("renderer");return t===V.Canvas||t===V.HTML?t:V.SVG}set selector(t){t?this.setAttribute("selector",t):this.removeAttribute("selector")}get selector(){return this.getAttribute("selector")}set simple(t){this.setAttribute("simple",(!!t).toString())}get simple(){let t=this.getAttribute("simple");return"true"===t||""===t||"1"===t}set speed(t){this.setAttribute("speed",t.toString())}get speed(){let t=this.getAttribute("speed");return null===t||isNaN(Number(t))?1:Number(t)}set src(t){this.setAttribute("src",t||"")}get src(){return this.getAttribute("src")}set subframe(t){this.setAttribute("subframe",(!!t).toString())}get subframe(){let t=this.getAttribute("subframe");return"true"===t||""===t||"1"===t}constructor(){super(),this.isLight=!1,this.playerState=nG.Loading,this._container=null,this._errorMessage="Something went wrong",this._identifier=this.id||g(),this._isSettingsOpen=!1,this._playerState={count:0,loaded:!1,prev:nG.Loading,scrollTimeout:null,scrollY:0,visible:!1},this._render=nH,this._renderControls=nj,this._seeker=0,this._animations=[],this._currentAnimation=0,this._isBounce=!1,this._isDotLottie=!1,this._lottieInstance=null,this._multiAnimationSettings=[],this._complete=this._complete.bind(this),this._dataFailed=this._dataFailed.bind(this),this._dataReady=this._dataReady.bind(this),this._DOMLoaded=this._DOMLoaded.bind(this),this._enterFrame=this._enterFrame.bind(this),this._freeze=this._freeze.bind(this),this._handleBlur=this._handleBlur.bind(this),this._handleClick=this._handleClick.bind(this),this._handleScroll=this._handleScroll.bind(this),this._handleSeekChange=this._handleSeekChange.bind(this),this._handleWindowBlur=this._handleWindowBlur.bind(this),this._loopComplete=this._loopComplete.bind(this),this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._switchInstance=this._switchInstance.bind(this),this._handleSettingsClick=this._handleSettingsClick.bind(this),this.togglePlay=this.togglePlay.bind(this),this.stop=this.stop.bind(this),this.prev=this.prev.bind(this),this.next=this.next.bind(this),this._renderControls=this._renderControls.bind(this),this.snapshot=this.snapshot.bind(this),this.toggleLoop=this.toggleLoop.bind(this),this.toggleBoomerang=this.toggleBoomerang.bind(this),this.destroy=this.destroy.bind(this),this.template=document.createElement("template"),this.shadow=this.attachShadow({mode:"open"})}addAnimation(t){throw Error(nU)}async attributeChangedCallback(t,e,s){if(this._lottieInstance&&this.shadow&&this._container)switch(t){case"animateOnScroll":if(""===s||s){this._lottieInstance.autoplay=!1,addEventListener("scroll",this._handleScroll,{capture:!0,passive:!0});return}removeEventListener("scroll",this._handleScroll,!0);break;case"autoplay":if(this.animateOnScroll||this.playOnVisible)return;if(""===s||s)return void this.play();this.stop();break;case"controls":this._renderControls();break;case"direction":if(-1===Number(s))return void this.setDirection(-1);this.setDirection(1);break;case"hover":if(""===s||s){this._container.addEventListener("mouseenter",this._mouseEnter),this._container.addEventListener("mouseleave",this._mouseLeave);return}this._container.removeEventListener("mouseenter",this._mouseEnter),this._container.removeEventListener("mouseleave",this._mouseLeave);break;case"loop":{let t=this.shadow.querySelector(".toggleLoop");t instanceof HTMLButtonElement&&(t.dataset.active=s),this.setLoop(""===s||!!s);break}case"mode":{let t=this.shadow.querySelector(".toggleBoomerang");t instanceof HTMLButtonElement&&(t.dataset.active=(s===L.Bounce).toString()),this._isBounce=s===L.Bounce;break}case"playOnClick":if(""===s||s){this._lottieInstance.autoplay=!1,this._container.addEventListener("click",this._handleClick);return}this._container.removeEventListener("click",this._handleClick);break;case"playOnVisible":(""===s||s)&&(this._lottieInstance.autoplay=!1);break;case"selector":{let t=document.getElementById(this.selector??"");t?.addEventListener("click",this._handleClick);break}case"speed":{let t=Number(s);t&&!isNaN(t)&&this.setSpeed(t);break}case"src":await this.load(s);break;case"subframe":this.setSubframe(""===s||!!s)}}connectedCallback(){super.connectedCallback();try{(async()=>{if(await this._render(),!this.shadow)throw Error("Missing Shadow element");this._container=this.shadow.querySelector(".animation"),await this.load(this.src),void 0!==document.hidden&&document.addEventListener("visibilitychange",this._onVisibilityChange),this._addIntersectionObserver(),this.dispatchEvent(new CustomEvent($.Rendered))})()}catch(t){console.error(t),this.dispatchEvent(new CustomEvent($.Error))}}convert(t){throw Error(nU)}destroy(){this._lottieInstance?.destroy&&(this.playerState=nG.Destroyed,this._lottieInstance.destroy(),this._lottieInstance=null,this.dispatchEvent(new CustomEvent($.Destroyed)),this.remove(),document.removeEventListener("visibilitychange",this._onVisibilityChange))}disconnectedCallback(){this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.destroy()}getLottie(){return this._lottieInstance}getManifest(){return this._manifest}getMultiAnimationSettings(){return this._multiAnimationSettings}getSegment(){return this._segment}async load(t){try{if(!this.shadowRoot||!t)return;this.source=t;let{animations:e,isDotLottie:s,manifest:i}=await nP(t);if(!e||e.some(t=>!["v","ip","op","layers","fr","w","h"].every(e=>Object.hasOwn(t,e))))throw Error("Broken or corrupted file");let r=this.parentElement?.querySelector('script[type="application/ld+json"]');if(r){let t=JSON.parse(r.innerHTML);t.selector&&(this.selector=t.selector),t.segment&&this.setSegment(t.segment),t.multiAnimationSettings&&this.setMultiAnimationSettings(t.multiAnimationSettings)}this._isBounce=this.mode===L.Bounce,this._multiAnimationSettings.length>0&&this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===L.Bounce);let a=i?.animations[0];a&&(a.autoplay=!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,a.loop=this.loop),this._isDotLottie=s,this._animations=e,this._manifest=i??{animations:[{autoplay:!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,direction:this.direction,id:g(),loop:this.loop,mode:this.mode,speed:this.speed}]},this._lottieInstance?.destroy(),this.playerState=nG.Stopped,!this.animateOnScroll&&(this.autoplay||this._multiAnimationSettings[this._currentAnimation]?.autoplay||this.playOnVisible)&&(this.playerState=nG.Playing),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:e[this._currentAnimation]}),this._addEventListeners();let n=this._multiAnimationSettings[this._currentAnimation]?.speed??this.speed,o=this._multiAnimationSettings[this._currentAnimation]?.direction??this.direction;if(this._lottieInstance.setSpeed(n),this._lottieInstance.setDirection(o),this._lottieInstance.setSubframe(!!this.subframe),(this.autoplay||this.animateOnScroll||this.playOnVisible)&&-1===this.direction&&this.seek("99%"),this._renderControls(),this.autoplay||this.playOnVisible){let t=this.shadow?.querySelector(".togglePlay");t&&(t.innerHTML=nW)}}catch(t){console.error(t),this._errorMessage=nY(t).message,this.playerState=nG.Error,this.dispatchEvent(new CustomEvent($.Error))}}loadAnimation(t){throw Error(nU)}next(){this._currentAnimation++,this._switchInstance()}pause(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent($.Pause))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?nG.Error:nG.Paused}}play(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.play(),this.dispatchEvent(new CustomEvent($.Play))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?nG.Error:nG.Playing}}prev(){this._currentAnimation--,this._switchInstance(!0)}propertyChangedCallback(t,e,s){if(!this.shadow)return;let i=this.shadow.querySelector(".togglePlay"),r=this.shadow.querySelector(".stop"),a=this.shadow.querySelector(".prev"),n=this.shadow.querySelector(".next"),o=this.shadow.querySelector(".seeker"),h=this.shadow.querySelector("progress"),l=this.shadow.querySelector(".popover"),p=this.shadow.querySelector(".convert"),c=this.shadow.querySelector(".snapshot");i instanceof HTMLButtonElement&&r instanceof HTMLButtonElement&&n instanceof HTMLButtonElement&&a instanceof HTMLButtonElement&&o instanceof HTMLInputElement&&h instanceof HTMLProgressElement&&("playerState"===t&&(i.dataset.active=(s===nG.Playing||s===nG.Paused).toString(),r.dataset.active=(s===nG.Stopped).toString(),s===nG.Playing?i.innerHTML=nW:i.innerHTML=nN),"_seeker"===t&&"number"==typeof s&&(o.value=s.toString(),o.ariaValueNow=s.toString(),h.value=s),"_animations"===t&&Array.isArray(s)&&this._currentAnimation+1<s.length&&(n.hidden=!1),"_currentAnimation"===t&&"number"==typeof s&&(n.hidden=s+1>=this._animations.length,a.hidden=!s),"_isSettingsOpen"===t&&"boolean"==typeof s&&l instanceof HTMLDivElement&&p instanceof HTMLButtonElement&&c instanceof HTMLButtonElement&&(l.hidden=!s,p.hidden=this.isLight,c.hidden=this.renderer!==V.SVG))}async reload(){this._lottieInstance&&this.src&&(this._lottieInstance.destroy(),await this.load(this.src))}seek(t){if(!this._lottieInstance)return;let e=t.toString().match(/^(\d+)(%?)$/);if(!e)return;let s=Math.round("%"===e[2]?this._lottieInstance.totalFrames*Number(e[1])/100:Number(e[1]));if(this._seeker=s,this.playerState===nG.Playing||this.playerState===nG.Frozen&&this._playerState.prev===nG.Playing){this._lottieInstance.goToAndPlay(s,!0),this.playerState=nG.Playing;return}this._lottieInstance.goToAndStop(s,!0),this._lottieInstance.pause()}setCount(t){this.count=t}setDirection(t){this._lottieInstance&&this._lottieInstance.setDirection(t)}setLoop(t){this._lottieInstance&&this._lottieInstance.setLoop(t)}setMultiAnimationSettings(t){this._multiAnimationSettings=t}setSegment(t){this._segment=t}setSpeed(t=1){this._lottieInstance&&this._lottieInstance.setSpeed(t)}setSubframe(t){this._lottieInstance&&this._lottieInstance.setSubframe(t)}snapshot(t=!0,e="AM Lottie"){try{var s,i;let r,a,n,o;if(!this.shadowRoot)throw Error("Unknown error");let h=this.shadowRoot.querySelector(".animation svg");if(!h)throw Error("Could not retrieve animation from DOM");let l=h instanceof Node?new XMLSerializer().serializeToString(h):null;if(!l)throw Error("Could not serialize SVG element");return t&&(i={mimeType:"image/svg+xml",name:`${s=this.src||e,(t=>{let e;if("string"==typeof t&&t&&((e=t?.split("/").pop()?.lastIndexOf("."))??0)>1&&t&&t.length-1>(e??0))return t.split(".").pop()?.toLowerCase()})(s),`${s.split("/").pop()?.replace(/\.[^.]*$/,"").replaceAll(/\W+/g,"-")}`}-${((this._seeker??0)+1).toString().padStart(3,"0")}.svg`},r=new Blob([l],{type:i?.mimeType}),a=i?.name||g(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=a,o.hidden=!0,document.body.appendChild(o),o.click(),setTimeout(()=>{o.remove(),URL.revokeObjectURL(n)},1e3)),l}catch(t){return console.error(t),null}}stop(){if(this._lottieInstance){this._playerState.prev=this.playerState,this._playerState.count=0;try{this._lottieInstance.stop(),this.dispatchEvent(new CustomEvent($.Stop))}finally{this.playerState=nG.Stopped}}}toggleBoomerang(){let t=this._multiAnimationSettings[this._currentAnimation]??{};if(void 0!==t.mode){if(t.mode===L.Normal){t.mode=L.Bounce,this._isBounce=!0;return}t.mode=L.Normal,this._isBounce=!1;return}if(this.mode===L.Normal){this.mode=L.Bounce,this._isBounce=!0;return}this.mode=L.Normal,this._isBounce=!1}toggleLoop(){let t=!this.loop;this.loop=t,this.setLoop(t)}togglePlay(){if(!this._lottieInstance)return;let{currentFrame:t,playDirection:e,totalFrames:s}=this._lottieInstance;if(this.playerState===nG.Playing)return void this.pause();if(this.playerState!==nG.Completed)return void this.play();if(this.playerState=nG.Playing,this._isBounce){this.setDirection(-1*e),this._lottieInstance.goToAndPlay(t,!0);return}-1===e?this._lottieInstance.goToAndPlay(s,!0):this._lottieInstance.goToAndPlay(0,!0)}_freeze(){if(this._lottieInstance){this._playerState.prev=this.playerState;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent($.Freeze))}finally{this.playerState=nG.Frozen}}}_handleBlur(){setTimeout(()=>{this._toggleSettings(!1)},200)}_handleClick(){(this.playOnClick||this.selector)&&this.togglePlay()}_handleSeekChange({target:t}){!(!(t instanceof HTMLInputElement)||!this._lottieInstance||isNaN(Number(t.value)))&&this.seek(Math.round(Number(t.value)/100*this._lottieInstance.totalFrames))}_handleSettingsClick({target:t}){this._toggleSettings(),t instanceof HTMLElement&&t.focus()}setOptions(t){throw Error("Method not implemented")}_addEventListeners(){this._toggleEventListeners("add")}_addIntersectionObserver(){if(this._container&&!this._intersectionObserver){if(!("IntersectionObserver"in window)){this._intersectionObserverFallback(),removeEventListener("scroll",this._intersectionObserverFallback,!0),addEventListener("scroll",this._intersectionObserverFallback,{capture:!0,passive:!0});return}this._intersectionObserver=new IntersectionObserver(t=>{let{length:e}=t;for(let s=0;s<e;s++){if(!t[s]?.isIntersecting||document.hidden){this.playerState===nG.Playing&&this._freeze(),this._playerState.visible=!1;continue}this.animateOnScroll||this.playOnVisible||this.playerState!==nG.Frozen||this.play(),this.playOnVisible&&(this.playerState!==nG.Completed||this.once?setTimeout(()=>{this.play()},this.delay):(this.playerState=nG.Playing,this._lottieInstance?.goToAndPlay(1===this.direction?0:this._lottieInstance.totalFrames))),!this._playerState.scrollY&&(t[s]?.boundingClientRect.y||0)>0&&(this._playerState.scrollY=scrollY),this._playerState.visible=!0}}),this._intersectionObserver.observe(this._container)}}_complete(){if(!this._lottieInstance)return;if(this._animations.length>1){if(this._multiAnimationSettings[this._currentAnimation+1]?.autoplay)return void this.next();if(this.loop&&this._currentAnimation===this._animations.length-1){this._currentAnimation=0,this._switchInstance();return}}let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.playerState=nG.Completed,this.dispatchEvent(new CustomEvent($.Complete,{detail:{frame:t,seeker:this._seeker}}))}_dataFailed(){this.playerState=nG.Error,this.dispatchEvent(new CustomEvent($.Error))}_dataReady(){this.dispatchEvent(new CustomEvent($.Load))}_DOMLoaded(){this._playerState.loaded=!0,this.dispatchEvent(new CustomEvent($.Ready))}_enterFrame(){if(!this._lottieInstance)return;let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.dispatchEvent(new CustomEvent($.Frame,{detail:{frame:t,seeker:this._seeker}}))}_getOptions(){if(!this._container)throw Error("Container not rendered");let t=this.preserveAspectRatio??(t=>{switch(t){case nz.Contain:case nz.ScaleDown:return N.Contain;case nz.Cover:return N.Cover;case nz.Fill:return N.Initial;case nz.None:return N.None;default:return N.Contain}})(this.objectfit),e=this._multiAnimationSettings.length>0?this._multiAnimationSettings[this._currentAnimation]:void 0,s=this._manifest?.animations[this._currentAnimation],i=!!this.loop;s?.loop!==void 0&&(i=!!s.loop),e?.loop!==void 0&&(i=!!e.loop);let r=!!this.autoplay;s?.autoplay!==void 0&&(r=!!s.autoplay),e?.autoplay!==void 0&&(r=!!e.autoplay),this.animateOnScroll&&(r=!1);let a=this._segment;return this._segment?.every(t=>t>0)&&(a=[this._segment[0]-1,this._segment[1]-1]),this._segment?.some(t=>t<0)&&(a=void 0),this.setOptions({container:this._container,hasAutoplay:r,hasLoop:i,initialSegment:a,preserveAspectRatio:t,rendererType:this.renderer})}_handleScroll(){if(!this.animateOnScroll||!this._lottieInstance)return;if(R)return void console.warn("DotLottie: Scroll animations might not work properly in a Server Side Rendering context. Try to wrap this in a client component.");if(!this._playerState.visible)return;this._playerState.scrollTimeout&&clearTimeout(this._playerState.scrollTimeout),this._playerState.scrollTimeout=setTimeout(()=>{this.playerState=nG.Paused},400);let{totalFrames:t}=this._lottieInstance,e=scrollY-this._playerState.scrollY;scrollY<=this._playerState.scrollY&&(e=this._playerState.scrollY-scrollY);let s=((t,e=0,s=100)=>{let i=e,r=s;if(i>r){let t=r;r=i,i=t}return Math.min(Math.max(t,i),r)})(e/innerHeight*(t-1),0,t);requestAnimationFrame(()=>{if(s>=t){this.playerState=nG.Paused;return}this.playerState=nG.Playing,this._lottieInstance?.goToAndStop(s,!0)})}_handleWindowBlur({type:t}){this.dontFreezeOnBlur||(this.playerState===nG.Playing&&"blur"===t&&this._freeze(),this.playerState===nG.Frozen&&"focus"===t&&this.play())}_intersectionObserverFallback(){if(!this._container)return;let{bottom:t,left:e,right:s,top:i}=this._container.getBoundingClientRect();this._playerState.visible=i>=0&&e>=0&&t<=innerHeight&&s<=innerWidth,(this.autoplay||this.playOnVisible||this.playerState===nG.Playing||this.playerState===nG.Frozen)&&(this._playerState.visible?this.play():this._freeze())}_loopComplete(){if(!this._lottieInstance)return;let{playDirection:t,totalFrames:e}=this._lottieInstance,s=this._segment?this._segment[0]:0,i=this._segment?this._segment[0]:e;if(this.count&&(this._isBounce?this._playerState.count+=.5:this._playerState.count+=1,this._playerState.count>=this.count)){this.setLoop(!1),this.playerState=nG.Completed,this.dispatchEvent(new CustomEvent($.Complete));return}return(this.dispatchEvent(new CustomEvent($.Loop)),this._isBounce)?(this._lottieInstance.goToAndStop(-1===t?s:.99*i,!0),this._lottieInstance.setDirection(-1*t),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission)):(this._lottieInstance.goToAndStop(-1===t?.99*i:s,!0),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission))}_mouseEnter(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window)){if(this.mouseout===nB.Reverse&&this._lottieInstance.setDirection(1),this.playerState===nG.Completed){this._lottieInstance.goToAndPlay(0,!0),this.playerState=nG.Playing;return}this.playerState!==nG.Playing&&this.play()}}_mouseLeave(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window))switch(this.mouseout){case nB.Void:break;case nB.Pause:this.pause();break;case nB.Reverse:this._lottieInstance.setDirection(-1),this.play();break;default:this.stop()}}_onVisibilityChange(){document.hidden&&this.playerState===nG.Playing?this._freeze():this.playerState===nG.Frozen&&this.play()}_removeEventListeners(){this._toggleEventListeners("remove")}_switchInstance(t=!1){if(this._animations[this._currentAnimation])try{if(this._lottieInstance&&this._lottieInstance.destroy(),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:this._animations[this._currentAnimation]}),this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===L.Bounce),this._removeEventListeners(),this._addEventListeners(),this.dispatchEvent(new CustomEvent(t?$.Previous:$.Next)),this._multiAnimationSettings[this._currentAnimation]?.autoplay??this.autoplay){if(this.animateOnScroll){this._lottieInstance.goToAndStop(0,!0),this.playerState=nG.Paused;return}this._lottieInstance.goToAndPlay(0,!0),this.playerState=nG.Playing;return}this._lottieInstance.goToAndStop(0,!0),this.playerState=nG.Stopped}catch(t){this._errorMessage=nY(t).message,this.playerState=nG.Error,this.dispatchEvent(new CustomEvent($.Error))}}_toggleEventListeners(t){let e="add"===t?"addEventListener":"removeEventListener";if(this._lottieInstance&&(this._lottieInstance[e]("enterFrame",this._enterFrame),this._lottieInstance[e]("complete",this._complete),this._lottieInstance[e]("loopComplete",this._loopComplete),this._lottieInstance[e]("DOMLoaded",this._DOMLoaded),this._lottieInstance[e]("data_ready",this._dataReady),this._lottieInstance[e]("data_failed",this._dataFailed)),this.selector){let t=document.getElementById(this.selector);t?this.hover?(t[e]("mouseenter",this._mouseEnter),t[e]("mouseleave",this._mouseLeave)):t[e]("click",this._handleClick):this.selector=null}this._container&&!this.selector&&(this.hover&&(this._container[e]("mouseenter",this._mouseEnter),this._container[e]("mouseleave",this._mouseLeave)),this.playOnClick&&this._container[e]("click",this._handleClick)),window[e]("focus",this._handleWindowBlur,{capture:!1,passive:!0}),window[e]("blur",this._handleWindowBlur,{capture:!1,passive:!0}),this.animateOnScroll&&window[e]("scroll",this._handleScroll,{capture:!0,passive:!0})}_toggleSettings(t){if(void 0===t){this._isSettingsOpen=!this._isSettingsOpen;return}this._isSettingsOpen=t}}class nX extends nJ{get renderer(){return V.SVG}constructor(){super(),this.loadAnimation=r5,this.isLight=!0}setOptions({container:t,hasAutoplay:e,hasLoop:s,initialSegment:i,preserveAspectRatio:r}){return{autoplay:e,container:t,initialSegment:i,loop:s,renderer:V.Canvas,rendererSettings:{clearCanvas:!0,imagePreserveAspectRatio:r,preserveAspectRatio:r,progressiveLoad:!0}}}}globalThis.dotLottiePlayer=()=>new nX,R||customElements.define(nq,nX),t.MouseOut=nB,t.PlayMode=L,t.PlayerEvents=$,t.PlayerState=nG,t.default=nX,t.tagName=nq,Object.defineProperty(t,"__esModule",{value:!0})}(this["@aarsteinmedia/dotlottie-player"]=this["@aarsteinmedia/dotlottie-player"]||{});
70
+ `;async function nH(){if(!this.shadow||!this.template)throw Error("No Shadow Element or Template");this.template.innerHTML=`<div class="animation-container main" data-controls="${this.controls??!1}" lang="${this.description?document.documentElement.lang:"en"}" aria-label="${this.description??"Lottie animation"}" data-loaded="${this._playerState.loaded}"><figure class="animation" style="background:${this.background}">${this.playerState===nG.Error?`<div class="error"><svg preserveAspectRatio="${N.Cover}" xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080" style="white-space:preserve"><path fill="#fff" d="M0 0h1920v1080H0z"/><path fill="#3a6d8b" d="M1190.2 531 1007 212.4c-22-38.2-77.2-38-98.8.5L729.5 531.3c-21.3 37.9 6.1 84.6 49.5 84.6l361.9.3c43.7 0 71.1-47.3 49.3-85.2zM937.3 288.7c.2-7.5 3.3-23.9 23.2-23.9 16.3 0 23 16.1 23 23.5 0 55.3-10.7 197.2-12.2 214.5-.1 1-.9 1.7-1.9 1.7h-18.3c-1 0-1.8-.7-1.9-1.7-1.4-17.5-13.4-162.9-11.9-214.1zm24.2 283.8c-13.1 0-23.7-10.6-23.7-23.7s10.6-23.7 23.7-23.7 23.7 10.6 23.7 23.7-10.6 23.7-23.7 23.7zM722.1 644h112.6v34.4h-70.4V698h58.8v31.7h-58.8v22.6h72.4v36.2H722.1V644zm162 57.1h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6zm78.9 0h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5H963v15.6zm39.5 36.2c0-31.3 22.2-54.8 56.6-54.8 34.4 0 56.2 23.5 56.2 54.8s-21.8 54.6-56.2 54.6c-34.4-.1-56.6-23.3-56.6-54.6zm74 0c0-17.4-6.1-29.1-17.8-29.1-11.7 0-17.4 11.7-17.4 29.1 0 17.4 5.7 29.1 17.4 29.1s17.8-11.8 17.8-29.1zm83.1-36.2h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6z"/><path fill="none" d="M718.9 807.7h645v285.4h-645z"/><text fill="#3a6d8b" style="text-align:center;position:absolute;left:100%;font-size:47px;font-family:system-ui,-apple-system,BlinkMacSystemFont,'.SFNSText-Regular',sans-serif" x="50%" y="848.017" text-anchor="middle">${this._errorMessage}</text></svg></div>`:""}</figure><slot name="controls"></slot></div>`,this.shadow.adoptedStyleSheets=[await nJ.styles()],this.shadow.appendChild(this.template.content.cloneNode(!0))}let nY=t=>{let e={message:"Unknown error",status:R?500:400};return t&&"object"==typeof t&&("message"in t&&"string"==typeof t.message&&(e.message=t.message),"status"in t&&(e.status=Number(t.status))),e},nU="Method is not implemented";class nJ extends nA{static get observedAttributes(){return["animateOnScroll","autoplay","controls","direction","hover","loop","mode","playOnClick","playOnVisible","selector","speed","src","subframe"]}static get observedProperties(){return["playerState","_isSettingsOpen","_seeker","_currentAnimation","_animations"]}static get styles(){return async()=>{let t=new CSSStyleSheet;return await t.replace("* {\n box-sizing: border-box;\n}\n\n:host {\n --lottie-player-toolbar-height: 35px;\n --lottie-player-toolbar-background-color: #fff;\n --lottie-player-toolbar-icon-color: #000;\n --lottie-player-toolbar-icon-hover-color: #000;\n --lottie-player-toolbar-icon-active-color: #4285f4;\n --lottie-player-seeker-track-color: rgb(0 0 0 / 20%);\n --lottie-player-seeker-thumb-color: #4285f4;\n --lottie-player-seeker-display: block;\n\n width: 100%;\n height: 100%;\n\n &:not([hidden]) {\n display: block;\n }\n\n .main {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n\n .animation {\n width: 100%;\n height: 100%;\n display: flex;\n margin: 0;\n padding: 0;\n }\n\n [data-controls='true'] .animation {\n height: calc(100% - 35px);\n }\n\n .animation-container {\n position: relative;\n }\n\n .popover {\n position: absolute;\n right: 5px;\n bottom: 40px;\n background-color: var(--lottie-player-toolbar-background-color);\n border-radius: 5px;\n padding: 10px 15px;\n border: solid 2px var(--lottie-player-toolbar-icon-color);\n animation: fade-in 0.2s ease-in-out;\n\n &::before {\n content: '';\n right: 10px;\n border: 7px solid transparent;\n margin-right: -7px;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n top: 100%;\n border-top-color: var(--lottie-player-toolbar-icon-color);\n }\n }\n\n .error {\n display: flex;\n margin: auto;\n justify-content: center;\n height: 100%;\n align-items: center;\n\n & svg {\n width: 100%;\n height: auto;\n }\n }\n\n .toolbar {\n display: flex;\n place-items: center center;\n background: var(--lottie-player-toolbar-background-color);\n margin: 0;\n height: 35px;\n padding: 5px;\n border-radius: 5px;\n gap: 5px;\n\n &.has-error {\n pointer-events: none;\n opacity: 0.5;\n }\n\n & button {\n cursor: pointer;\n fill: var(--lottie-player-toolbar-icon-color);\n color: var(--lottie-player-toolbar-icon-color);\n background: none;\n border: 0;\n padding: 0;\n outline: 0;\n height: 100%;\n margin: 0;\n align-items: center;\n gap: 5px;\n opacity: 0.9;\n\n &:not([hidden]) {\n display: flex;\n }\n\n &:hover {\n opacity: 1;\n }\n\n &[data-active='true'] {\n opacity: 1;\n fill: var(--lottie-player-toolbar-icon-active-color);\n }\n\n &:disabled {\n opacity: 0.5;\n }\n\n &:focus {\n outline: 0;\n }\n\n & svg {\n pointer-events: none;\n\n & > * {\n fill: inherit;\n }\n }\n\n &.disabled svg {\n display: none;\n }\n }\n }\n\n .progress-container {\n position: relative;\n width: 100%;\n\n &.simple {\n margin-right: 12px;\n }\n }\n\n .seeker {\n appearance: none;\n outline: none;\n width: 100%;\n height: 20px;\n border-radius: 3px;\n border: 0;\n cursor: pointer;\n background-color: transparent;\n\n display: var(--lottie-player-seeker-display);\n color: var(--lottie-player-seeker-thumb-color);\n margin: 0;\n padding: 7.5px 0;\n position: relative;\n z-index: 1;\n\n &::-webkit-slider-runnable-track,\n &::-webkit-slider-thumb {\n appearance: none;\n outline: none;\n }\n\n &::-webkit-slider-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n border: 0;\n background-color: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -webkit-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-webkit-slider-thumb,\n &:focus::-webkit-slider-thumb {\n transform: scale(1);\n }\n\n &::-moz-range-progress {\n background-color: var(--lottie-player-seeker-thumb-color);\n height: 5px;\n border-radius: 3px;\n }\n\n &::-moz-range-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: var(--lottie-player-seeker-thumb-color);\n border: 0;\n cursor: pointer;\n -moz-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-moz-range-thumb,\n &:focus::-moz-range-thumb {\n transform: scale(1);\n }\n\n &::-ms-track {\n width: 100%;\n height: 5px;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n border-radius: 3px;\n }\n\n &::-ms-fill-lower {\n background-color: var(--lottie-player-seeker-thumb-color);\n border-radius: 3px;\n }\n\n &::-ms-thumb {\n border: 0;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -ms-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-ms-thumb {\n transform: scale(1);\n }\n\n &:focus {\n &::-ms-thumb {\n transform: scale(1);\n }\n\n &::-ms-fill-lower,\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n }\n }\n }\n\n & progress {\n appearance: none;\n outline: none;\n position: absolute;\n width: 100%;\n height: 5px;\n border-radius: 3px;\n border: 0;\n top: 0;\n left: 0;\n margin: 7.5px 0;\n background-color: var(--lottie-player-seeker-track-color);\n pointer-events: none;\n\n &::-webkit-progress-inner-element {\n border-radius: 3px;\n overflow: hidden;\n }\n\n &::-webkit-slider-runnable-track {\n background-color: transparent;\n }\n\n &::-webkit-progress-value {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n }\n\n & *::-moz-progress-bar {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n}\n\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --lottie-player-toolbar-background-color: #000;\n --lottie-player-toolbar-icon-color: #fff;\n --lottie-player-toolbar-icon-hover-color: #fff;\n --lottie-player-seeker-track-color: rgb(255 255 255 / 60%);\n }\n}\n"),t}}set animateOnScroll(t){this.setAttribute("animateOnScroll",(!!t).toString())}get animateOnScroll(){let t=this.getAttribute("animateOnScroll");return"true"===t||""===t||"1"===t}get animations(){return this._animations}set autoplay(t){this.setAttribute("autoplay",(!!t).toString())}get autoplay(){let t=this.getAttribute("autoplay");return"true"===t||""===t||"1"===t}set background(t){this.setAttribute("background",t)}get background(){return this.getAttribute("background")||"transparent"}set controls(t){this.setAttribute("controls",(!!t).toString())}get controls(){let t=this.getAttribute("controls");return"true"===t||""===t||"1"===t}set count(t){this.setAttribute("count",t.toString())}get count(){let t=this.getAttribute("count");return t?Number(t):0}get currentAnimation(){return this._currentAnimation}set delay(t){this.setAttribute("delay",t.toString())}get delay(){let t=this.getAttribute("delay");return t?Number(t):0}set description(t){t&&this.setAttribute("description",t)}get description(){return this.getAttribute("description")}set direction(t){this.setAttribute("direction",t.toString())}get direction(){let t=Number(this.getAttribute("direction"));return -1===t?t:1}set dontFreezeOnBlur(t){this.setAttribute("dontFreezeOnBlur",(!!t).toString())}get dontFreezeOnBlur(){let t=this.getAttribute("dontFreezeOnBlur");return"true"===t||""===t||"1"===t}set hover(t){this.setAttribute("hover",(!!t).toString())}get hover(){let t=this.getAttribute("hover");return"true"===t||""===t||"1"===t}set intermission(t){this.setAttribute("intermission",t.toString())}get intermission(){let t=Number(this.getAttribute("intermission"));return isNaN(t)?0:t}get isDotLottie(){return this._isDotLottie}set loop(t){this.setAttribute("loop",(!!t).toString())}get loop(){let t=this.getAttribute("loop");return"true"===t||""===t||"1"===t}set mode(t){this.setAttribute("mode",t)}get mode(){let t=this.getAttribute("mode");return t===L.Bounce?t:L.Normal}set mouseout(t){this.setAttribute("mouseout",t)}get mouseout(){let t=this.getAttribute("mouseout");switch(t){case nB.Void:case nB.Pause:case nB.Reverse:return t;default:return nB.Stop}}set objectfit(t){this.setAttribute("objectfit",t)}get objectfit(){let t=this.getAttribute("objectfit");return t&&Object.values(nz).includes(t)?t:nz.Contain}set once(t){this.setAttribute("once",(!!t).toString())}get once(){let t=this.getAttribute("once");return"true"===t||""===t||"1"===t}set playOnClick(t){this.setAttribute("playOnClick",(!!t).toString())}get playOnClick(){let t=this.getAttribute("playOnClick");return"true"===t||""===t||"1"===t}set playOnVisible(t){this.setAttribute("playOnVisible",(!!t).toString())}get playOnVisible(){let t=this.getAttribute("playOnVisible");return"true"===t||""===t||"1"===t}set preserveAspectRatio(t){this.setAttribute("preserveAspectRatio",t||N.Contain)}get preserveAspectRatio(){let t=this.getAttribute("preserveAspectRatio");return t&&Object.values(N).includes(t)?t:null}set renderer(t){this.setAttribute("renderer",t)}get renderer(){let t=this.getAttribute("renderer");return t===V.Canvas||t===V.HTML?t:V.SVG}set selector(t){t?this.setAttribute("selector",t):this.removeAttribute("selector")}get selector(){return this.getAttribute("selector")}set simple(t){this.setAttribute("simple",(!!t).toString())}get simple(){let t=this.getAttribute("simple");return"true"===t||""===t||"1"===t}set speed(t){this.setAttribute("speed",t.toString())}get speed(){let t=this.getAttribute("speed");return null===t||isNaN(Number(t))?1:Number(t)}set src(t){this.setAttribute("src",t||"")}get src(){return this.getAttribute("src")}set subframe(t){this.setAttribute("subframe",(!!t).toString())}get subframe(){let t=this.getAttribute("subframe");return"true"===t||""===t||"1"===t}constructor(){super(),this.isLight=!1,this.playerState=nG.Loading,this._container=null,this._errorMessage="Something went wrong",this._identifier=this.id||g(),this._isSettingsOpen=!1,this._playerState={count:0,loaded:!1,prev:nG.Loading,scrollTimeout:null,scrollY:0,visible:!1},this._render=nH,this._renderControls=nj,this._seeker=0,this._animations=[],this._currentAnimation=0,this._isBounce=!1,this._isDotLottie=!1,this._lottieInstance=null,this._multiAnimationSettings=[],this._complete=this._complete.bind(this),this._dataFailed=this._dataFailed.bind(this),this._dataReady=this._dataReady.bind(this),this._DOMLoaded=this._DOMLoaded.bind(this),this._enterFrame=this._enterFrame.bind(this),this._freeze=this._freeze.bind(this),this._handleBlur=this._handleBlur.bind(this),this._handleClick=this._handleClick.bind(this),this._handleScroll=this._handleScroll.bind(this),this._handleSeekChange=this._handleSeekChange.bind(this),this._handleWindowBlur=this._handleWindowBlur.bind(this),this._loopComplete=this._loopComplete.bind(this),this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._switchInstance=this._switchInstance.bind(this),this._handleSettingsClick=this._handleSettingsClick.bind(this),this.togglePlay=this.togglePlay.bind(this),this.stop=this.stop.bind(this),this.prev=this.prev.bind(this),this.next=this.next.bind(this),this._renderControls=this._renderControls.bind(this),this.snapshot=this.snapshot.bind(this),this.toggleLoop=this.toggleLoop.bind(this),this.toggleBoomerang=this.toggleBoomerang.bind(this),this.destroy=this.destroy.bind(this),this.template=document.createElement("template"),this.shadow=this.attachShadow({mode:"open"})}addAnimation(t){throw Error(nU)}async attributeChangedCallback(t,e,s){if(this._lottieInstance&&this.shadow&&this._container)switch(t){case"animateOnScroll":if(""===s||s){this._lottieInstance.autoplay=!1,addEventListener("scroll",this._handleScroll,{capture:!0,passive:!0});return}removeEventListener("scroll",this._handleScroll,!0);break;case"autoplay":if(this.animateOnScroll||this.playOnVisible)return;if(""===s||s)return void this.play();this.stop();break;case"controls":this._renderControls();break;case"direction":if(-1===Number(s))return void this.setDirection(-1);this.setDirection(1);break;case"hover":if(""===s||s){this._container.addEventListener("mouseenter",this._mouseEnter),this._container.addEventListener("mouseleave",this._mouseLeave);return}this._container.removeEventListener("mouseenter",this._mouseEnter),this._container.removeEventListener("mouseleave",this._mouseLeave);break;case"loop":{let t=this.shadow.querySelector(".toggleLoop");t instanceof HTMLButtonElement&&(t.dataset.active=s),this.setLoop(""===s||!!s);break}case"mode":{let t=this.shadow.querySelector(".toggleBoomerang");t instanceof HTMLButtonElement&&(t.dataset.active=(s===L.Bounce).toString()),this._isBounce=s===L.Bounce;break}case"playOnClick":if(""===s||s){this._lottieInstance.autoplay=!1,this._container.addEventListener("click",this._handleClick);return}this._container.removeEventListener("click",this._handleClick);break;case"playOnVisible":(""===s||s)&&(this._lottieInstance.autoplay=!1);break;case"selector":{let t=document.getElementById(this.selector??"");t?.addEventListener("click",this._handleClick);break}case"speed":{let t=Number(s);t&&!isNaN(t)&&this.setSpeed(t);break}case"src":await this.load(s);break;case"subframe":this.setSubframe(""===s||!!s)}}connectedCallback(){super.connectedCallback();try{(async()=>{if(await this._render(),!this.shadow)throw Error("Missing Shadow element");this._container=this.shadow.querySelector(".animation"),await this.load(this.src),void 0!==document.hidden&&document.addEventListener("visibilitychange",this._onVisibilityChange),this._addIntersectionObserver(),this.dispatchEvent(new CustomEvent($.Rendered))})()}catch(t){console.error(t),this.dispatchEvent(new CustomEvent($.Error))}}convert(t){throw Error(nU)}destroy(){this._lottieInstance?.destroy&&(this.playerState=nG.Destroyed,this._lottieInstance.destroy(),this._lottieInstance=null,this.dispatchEvent(new CustomEvent($.Destroyed)),this.remove(),document.removeEventListener("visibilitychange",this._onVisibilityChange))}disconnectedCallback(){this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.destroy()}getLottie(){return this._lottieInstance}getManifest(){return this._manifest}getMultiAnimationSettings(){return this._multiAnimationSettings}getSegment(){return this._segment}async load(t){try{if(!this.shadowRoot||!t)return;this.source=t;let{animations:e,isDotLottie:s,manifest:i}=await nP(t);if(!e||e.some(t=>!["v","ip","op","layers","fr","w","h"].every(e=>Object.hasOwn(t,e))))throw Error("Broken or corrupted file");let r=this.parentElement?.querySelector('script[type="application/ld+json"]');if(r){let t=JSON.parse(r.innerHTML);t.selector&&(this.selector=t.selector),t.segment&&this.setSegment(t.segment),t.multiAnimationSettings&&this.setMultiAnimationSettings(t.multiAnimationSettings)}this._isBounce=this.mode===L.Bounce,this._multiAnimationSettings.length>0&&this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===L.Bounce);let a=i?.animations[0];a&&(a.autoplay=!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,a.loop=this.loop),this._isDotLottie=s,this._animations=e,this._manifest=i??{animations:[{autoplay:!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,direction:this.direction,id:g(),loop:this.loop,mode:this.mode,speed:this.speed}]},this._lottieInstance?.destroy(),this.playerState=nG.Stopped,!this.animateOnScroll&&(this.autoplay||this._multiAnimationSettings[this._currentAnimation]?.autoplay||this.playOnVisible)&&(this.playerState=nG.Playing),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:e[this._currentAnimation]}),this._addEventListeners();let n=this._multiAnimationSettings[this._currentAnimation]?.speed??this.speed,o=this._multiAnimationSettings[this._currentAnimation]?.direction??this.direction;if(this._lottieInstance.setSpeed(n),this._lottieInstance.setDirection(o),this._lottieInstance.setSubframe(!!this.subframe),(this.autoplay||this.animateOnScroll||this.playOnVisible)&&-1===this.direction&&this.seek("99%"),this._renderControls(),this.autoplay||this.playOnVisible){let t=this.shadow?.querySelector(".togglePlay");t&&(t.innerHTML=nW)}}catch(t){console.error(t),this._errorMessage=nY(t).message,this.playerState=nG.Error,this.dispatchEvent(new CustomEvent($.Error))}}loadAnimation(t){throw Error(nU)}next(){this._currentAnimation++,this._switchInstance()}pause(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent($.Pause))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?nG.Error:nG.Paused}}play(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.play(),this.dispatchEvent(new CustomEvent($.Play))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?nG.Error:nG.Playing}}prev(){this._currentAnimation--,this._switchInstance(!0)}propertyChangedCallback(t,e,s){if(!this.shadow)return;let i=this.shadow.querySelector(".togglePlay"),r=this.shadow.querySelector(".stop"),a=this.shadow.querySelector(".prev"),n=this.shadow.querySelector(".next"),o=this.shadow.querySelector(".seeker"),h=this.shadow.querySelector("progress"),l=this.shadow.querySelector(".popover"),p=this.shadow.querySelector(".convert"),c=this.shadow.querySelector(".snapshot");i instanceof HTMLButtonElement&&r instanceof HTMLButtonElement&&n instanceof HTMLButtonElement&&a instanceof HTMLButtonElement&&o instanceof HTMLInputElement&&h instanceof HTMLProgressElement&&("playerState"===t&&(i.dataset.active=(s===nG.Playing||s===nG.Paused).toString(),r.dataset.active=(s===nG.Stopped).toString(),s===nG.Playing?i.innerHTML=nW:i.innerHTML=nN),"_seeker"===t&&"number"==typeof s&&(o.value=s.toString(),o.ariaValueNow=s.toString(),h.value=s),"_animations"===t&&Array.isArray(s)&&this._currentAnimation+1<s.length&&(n.hidden=!1),"_currentAnimation"===t&&"number"==typeof s&&(n.hidden=s+1>=this._animations.length,a.hidden=!s),"_isSettingsOpen"===t&&"boolean"==typeof s&&l instanceof HTMLDivElement&&p instanceof HTMLButtonElement&&c instanceof HTMLButtonElement&&(l.hidden=!s,p.hidden=this.isLight,c.hidden=this.renderer!==V.SVG))}async reload(){this._lottieInstance&&this.src&&(this._lottieInstance.destroy(),await this.load(this.src))}seek(t){if(!this._lottieInstance)return;let e=t.toString().match(/^(\d+)(%?)$/);if(!e)return;let s=Math.round("%"===e[2]?this._lottieInstance.totalFrames*Number(e[1])/100:Number(e[1]));if(this._seeker=s,this.playerState===nG.Playing||this.playerState===nG.Frozen&&this._playerState.prev===nG.Playing){this._lottieInstance.goToAndPlay(s,!0),this.playerState=nG.Playing;return}this._lottieInstance.goToAndStop(s,!0),this._lottieInstance.pause()}setCount(t){this.count=t}setDirection(t){this._lottieInstance&&this._lottieInstance.setDirection(t)}setLoop(t){this._lottieInstance&&this._lottieInstance.setLoop(t)}setMultiAnimationSettings(t){this._multiAnimationSettings=t}setSegment(t){this._segment=t}setSpeed(t=1){this._lottieInstance&&this._lottieInstance.setSpeed(t)}setSubframe(t){this._lottieInstance&&this._lottieInstance.setSubframe(t)}snapshot(t=!0,e="AM Lottie"){try{var s,i;let r,a,n,o;if(!this.shadowRoot)throw Error("Unknown error");let h=this.shadowRoot.querySelector(".animation svg");if(!h)throw Error("Could not retrieve animation from DOM");let l=h instanceof Node?new XMLSerializer().serializeToString(h):null;if(!l)throw Error("Could not serialize SVG element");return t&&(i={mimeType:"image/svg+xml",name:`${s=this.src||e,(t=>{let e;if("string"==typeof t&&t&&((e=t?.split("/").pop()?.lastIndexOf("."))??0)>1&&t&&t.length-1>(e??0))return t.split(".").pop()?.toLowerCase()})(s),`${s.split("/").pop()?.replace(/\.[^.]*$/,"").replaceAll(/\W+/g,"-")}`}-${((this._seeker??0)+1).toString().padStart(3,"0")}.svg`},r=new Blob([l],{type:i?.mimeType}),a=i?.name||g(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=a,o.hidden=!0,document.body.appendChild(o),o.click(),setTimeout(()=>{o.remove(),URL.revokeObjectURL(n)},1e3)),l}catch(t){return console.error(t),null}}stop(){if(this._lottieInstance){this._playerState.prev=this.playerState,this._playerState.count=0;try{this._lottieInstance.stop(),this.dispatchEvent(new CustomEvent($.Stop))}finally{this.playerState=nG.Stopped}}}toggleBoomerang(){let t=this._multiAnimationSettings[this._currentAnimation]??{};if(void 0!==t.mode){if(t.mode===L.Normal){t.mode=L.Bounce,this._isBounce=!0;return}t.mode=L.Normal,this._isBounce=!1;return}if(this.mode===L.Normal){this.mode=L.Bounce,this._isBounce=!0;return}this.mode=L.Normal,this._isBounce=!1}toggleLoop(){let t=!this.loop;this.loop=t,this.setLoop(t)}togglePlay(){if(!this._lottieInstance)return;let{currentFrame:t,playDirection:e,totalFrames:s}=this._lottieInstance;if(this.playerState===nG.Playing)return void this.pause();if(this.playerState!==nG.Completed)return void this.play();if(this.playerState=nG.Playing,this._isBounce){this.setDirection(-1*e),this._lottieInstance.goToAndPlay(t,!0);return}-1===e?this._lottieInstance.goToAndPlay(s,!0):this._lottieInstance.goToAndPlay(0,!0)}_freeze(){if(this._lottieInstance){this._playerState.prev=this.playerState;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent($.Freeze))}finally{this.playerState=nG.Frozen}}}_handleBlur(){setTimeout(()=>{this._toggleSettings(!1)},200)}_handleClick(){(this.playOnClick||this.selector)&&this.togglePlay()}_handleSeekChange({target:t}){!(!(t instanceof HTMLInputElement)||!this._lottieInstance||isNaN(Number(t.value)))&&this.seek(Math.round(Number(t.value)/100*this._lottieInstance.totalFrames))}_handleSettingsClick({target:t}){this._toggleSettings(),t instanceof HTMLElement&&t.focus()}setOptions(t){throw Error("Method not implemented")}_addEventListeners(){this._toggleEventListeners("add")}_addIntersectionObserver(){if(this._container&&!this._intersectionObserver){if(!("IntersectionObserver"in window)){this._intersectionObserverFallback(),removeEventListener("scroll",this._intersectionObserverFallback,!0),addEventListener("scroll",this._intersectionObserverFallback,{capture:!0,passive:!0});return}this._intersectionObserver=new IntersectionObserver(t=>{let{length:e}=t;for(let s=0;s<e;s++){if(!t[s]?.isIntersecting||document.hidden){this.playerState===nG.Playing&&this._freeze(),this._playerState.visible=!1;continue}this.animateOnScroll||this.playOnVisible||this.playerState!==nG.Frozen||this.play(),this.playOnVisible&&(this.playerState!==nG.Completed||this.once?setTimeout(()=>{this.play()},this.delay):(this.playerState=nG.Playing,this._lottieInstance?.goToAndPlay(1===this.direction?0:this._lottieInstance.totalFrames))),!this._playerState.scrollY&&(t[s]?.boundingClientRect.y||0)>0&&(this._playerState.scrollY=scrollY),this._playerState.visible=!0}}),this._intersectionObserver.observe(this._container)}}_complete(){if(!this._lottieInstance)return;if(this._animations.length>1){if(this._multiAnimationSettings[this._currentAnimation+1]?.autoplay)return void this.next();if(this.loop&&this._currentAnimation===this._animations.length-1){this._currentAnimation=0,this._switchInstance();return}}let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.playerState=nG.Completed,this.dispatchEvent(new CustomEvent($.Complete,{detail:{frame:t,seeker:this._seeker}}))}_dataFailed(){this.playerState=nG.Error,this.dispatchEvent(new CustomEvent($.Error))}_dataReady(){this.dispatchEvent(new CustomEvent($.Load))}_DOMLoaded(){this._playerState.loaded=!0,this.dispatchEvent(new CustomEvent($.Ready))}_enterFrame(){if(!this._lottieInstance)return;let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.dispatchEvent(new CustomEvent($.Frame,{detail:{frame:t,seeker:this._seeker}}))}_getOptions(){if(!this._container)throw Error("Container not rendered");let t=this.preserveAspectRatio??(t=>{switch(t){case nz.Contain:case nz.ScaleDown:return N.Contain;case nz.Cover:return N.Cover;case nz.Fill:return N.Initial;case nz.None:return N.None;default:return N.Contain}})(this.objectfit),e=this._multiAnimationSettings.length>0?this._multiAnimationSettings[this._currentAnimation]:void 0,s=this._manifest?.animations[this._currentAnimation],i=!!this.loop;s?.loop!==void 0&&(i=!!s.loop),e?.loop!==void 0&&(i=!!e.loop);let r=!!this.autoplay;s?.autoplay!==void 0&&(r=!!s.autoplay),e?.autoplay!==void 0&&(r=!!e.autoplay),this.animateOnScroll&&(r=!1);let a=this._segment;return this._segment?.every(t=>t>0)&&(a=[this._segment[0]-1,this._segment[1]-1]),this._segment?.some(t=>t<0)&&(a=void 0),this.setOptions({container:this._container,hasAutoplay:r,hasLoop:i,initialSegment:a,preserveAspectRatio:t,rendererType:this.renderer})}_handleScroll(){if(!this.animateOnScroll||!this._lottieInstance)return;if(R)return void console.warn("DotLottie: Scroll animations might not work properly in a Server Side Rendering context. Try to wrap this in a client component.");if(!this._playerState.visible)return;this._playerState.scrollTimeout&&clearTimeout(this._playerState.scrollTimeout),this._playerState.scrollTimeout=setTimeout(()=>{this.playerState=nG.Paused},400);let{totalFrames:t}=this._lottieInstance,e=scrollY-this._playerState.scrollY;scrollY<=this._playerState.scrollY&&(e=this._playerState.scrollY-scrollY);let s=((t,e=0,s=100)=>{let i=e,r=s;if(i>r){let t=r;r=i,i=t}return Math.min(Math.max(t,i),r)})(e/innerHeight*(t-1),0,t);requestAnimationFrame(()=>{if(s>=t){this.playerState=nG.Paused;return}this.playerState=nG.Playing,this._lottieInstance?.goToAndStop(s,!0)})}_handleWindowBlur({type:t}){this.dontFreezeOnBlur||(this.playerState===nG.Playing&&"blur"===t&&this._freeze(),this.playerState===nG.Frozen&&"focus"===t&&this.play())}_intersectionObserverFallback(){if(!this._container)return;let{bottom:t,left:e,right:s,top:i}=this._container.getBoundingClientRect();this._playerState.visible=i>=0&&e>=0&&t<=innerHeight&&s<=innerWidth,(this.autoplay||this.playOnVisible||this.playerState===nG.Playing||this.playerState===nG.Frozen)&&(this._playerState.visible?this.play():this._freeze())}_loopComplete(){if(!this._lottieInstance)return;let{playDirection:t,totalFrames:e}=this._lottieInstance,s=this._segment?this._segment[0]:0,i=this._segment?this._segment[0]:e;if(this.count&&(this._isBounce?this._playerState.count+=.5:this._playerState.count+=1,this._playerState.count>=this.count)){this.setLoop(!1),this.playerState=nG.Completed,this.dispatchEvent(new CustomEvent($.Complete));return}return(this.dispatchEvent(new CustomEvent($.Loop)),this._isBounce)?(this._lottieInstance.goToAndStop(-1===t?s:.99*i,!0),this._lottieInstance.setDirection(-1*t),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission)):(this._lottieInstance.goToAndStop(-1===t?.99*i:s,!0),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission))}_mouseEnter(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window)){if(this.mouseout===nB.Reverse&&this._lottieInstance.setDirection(1),this.playerState===nG.Completed){this._lottieInstance.goToAndPlay(0,!0),this.playerState=nG.Playing;return}this.playerState!==nG.Playing&&this.play()}}_mouseLeave(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window))switch(this.mouseout){case nB.Void:break;case nB.Pause:this.pause();break;case nB.Reverse:this._lottieInstance.setDirection(-1),this.play();break;default:this.stop()}}_onVisibilityChange(){document.hidden&&this.playerState===nG.Playing?this._freeze():this.playerState===nG.Frozen&&this.play()}_removeEventListeners(){this._toggleEventListeners("remove")}_switchInstance(t=!1){if(this._animations[this._currentAnimation])try{if(this._lottieInstance&&this._lottieInstance.destroy(),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:this._animations[this._currentAnimation]}),this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===L.Bounce),this._removeEventListeners(),this._addEventListeners(),this.dispatchEvent(new CustomEvent(t?$.Previous:$.Next)),this._multiAnimationSettings[this._currentAnimation]?.autoplay??this.autoplay){if(this.animateOnScroll){this._lottieInstance.goToAndStop(0,!0),this.playerState=nG.Paused;return}this._lottieInstance.goToAndPlay(0,!0),this.playerState=nG.Playing;return}this._lottieInstance.goToAndStop(0,!0),this.playerState=nG.Stopped}catch(t){this._errorMessage=nY(t).message,this.playerState=nG.Error,this.dispatchEvent(new CustomEvent($.Error))}}_toggleEventListeners(t){let e="add"===t?"addEventListener":"removeEventListener";if(this._lottieInstance&&(this._lottieInstance[e]("enterFrame",this._enterFrame),this._lottieInstance[e]("complete",this._complete),this._lottieInstance[e]("loopComplete",this._loopComplete),this._lottieInstance[e]("DOMLoaded",this._DOMLoaded),this._lottieInstance[e]("data_ready",this._dataReady),this._lottieInstance[e]("data_failed",this._dataFailed)),this.selector){let t=document.getElementById(this.selector);t?this.hover?(t[e]("mouseenter",this._mouseEnter),t[e]("mouseleave",this._mouseLeave)):t[e]("click",this._handleClick):this.selector=null}this._container&&!this.selector&&(this.hover&&(this._container[e]("mouseenter",this._mouseEnter),this._container[e]("mouseleave",this._mouseLeave)),this.playOnClick&&this._container[e]("click",this._handleClick)),window[e]("focus",this._handleWindowBlur,{capture:!1,passive:!0}),window[e]("blur",this._handleWindowBlur,{capture:!1,passive:!0}),this.animateOnScroll&&window[e]("scroll",this._handleScroll,{capture:!0,passive:!0})}_toggleSettings(t){if(void 0===t){this._isSettingsOpen=!this._isSettingsOpen;return}this._isSettingsOpen=t}}class nX extends nJ{get renderer(){return V.SVG}constructor(){super(),this.loadAnimation=r5,this.isLight=!0}setOptions({container:t,hasAutoplay:e,hasLoop:s,initialSegment:i,preserveAspectRatio:r}){return{autoplay:e,container:t,initialSegment:i,loop:s,renderer:V.Canvas,rendererSettings:{clearCanvas:!0,imagePreserveAspectRatio:r,preserveAspectRatio:r,progressiveLoad:!0}}}}globalThis.dotLottiePlayer=()=>new nX,R||customElements.define(nq,nX),t.MouseOut=nB,t.PlayMode=L,t.PlayerEvents=$,t.PlayerState=nG,t.default=nX,t.tagName=nq,Object.defineProperty(t,"__esModule",{value:!0})}(this["@aarsteinmedia/dotlottie-player"]=this["@aarsteinmedia/dotlottie-player"]||{});
@@ -67,4 +67,4 @@
67
67
  d="M14.016 5.016H18v13.969h-3.984V5.016zM6 18.984V5.015h3.984v13.969H6z"
68
68
  />
69
69
  </svg>
70
- `;async function nK(){if(!this.shadow||!this.template)throw Error("No Shadow Element or Template");this.template.innerHTML=`<div class="animation-container main" data-controls="${this.controls??!1}" lang="${this.description?document.documentElement.lang:"en"}" aria-label="${this.description??"Lottie animation"}" data-loaded="${this._playerState.loaded}"><figure class="animation" style="background:${this.background}">${this.playerState===nY.Error?`<div class="error"><svg preserveAspectRatio="${L.Cover}" xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080" style="white-space:preserve"><path fill="#fff" d="M0 0h1920v1080H0z"/><path fill="#3a6d8b" d="M1190.2 531 1007 212.4c-22-38.2-77.2-38-98.8.5L729.5 531.3c-21.3 37.9 6.1 84.6 49.5 84.6l361.9.3c43.7 0 71.1-47.3 49.3-85.2zM937.3 288.7c.2-7.5 3.3-23.9 23.2-23.9 16.3 0 23 16.1 23 23.5 0 55.3-10.7 197.2-12.2 214.5-.1 1-.9 1.7-1.9 1.7h-18.3c-1 0-1.8-.7-1.9-1.7-1.4-17.5-13.4-162.9-11.9-214.1zm24.2 283.8c-13.1 0-23.7-10.6-23.7-23.7s10.6-23.7 23.7-23.7 23.7 10.6 23.7 23.7-10.6 23.7-23.7 23.7zM722.1 644h112.6v34.4h-70.4V698h58.8v31.7h-58.8v22.6h72.4v36.2H722.1V644zm162 57.1h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6zm78.9 0h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5H963v15.6zm39.5 36.2c0-31.3 22.2-54.8 56.6-54.8 34.4 0 56.2 23.5 56.2 54.8s-21.8 54.6-56.2 54.6c-34.4-.1-56.6-23.3-56.6-54.6zm74 0c0-17.4-6.1-29.1-17.8-29.1-11.7 0-17.4 11.7-17.4 29.1 0 17.4 5.7 29.1 17.4 29.1s17.8-11.8 17.8-29.1zm83.1-36.2h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6z"/><path fill="none" d="M718.9 807.7h645v285.4h-645z"/><text fill="#3a6d8b" style="text-align:center;position:absolute;left:100%;font-size:47px;font-family:system-ui,-apple-system,BlinkMacSystemFont,'.SFNSText-Regular',sans-serif" x="50%" y="848.017" text-anchor="middle">${this._errorMessage}</text></svg></div>`:""}</figure><slot name="controls"></slot></div>`,this.shadow.adoptedStyleSheets=[await n0.styles()],this.shadow.appendChild(this.template.content.cloneNode(!0))}let nZ=t=>{let e={message:"Unknown error",status:N?500:400};return t&&"object"==typeof t&&("message"in t&&"string"==typeof t.message&&(e.message=t.message),"status"in t&&(e.status=Number(t.status))),e},nQ="Method is not implemented";class n0 extends n${static get observedAttributes(){return["animateOnScroll","autoplay","controls","direction","hover","loop","mode","playOnClick","playOnVisible","selector","speed","src","subframe"]}static get observedProperties(){return["playerState","_isSettingsOpen","_seeker","_currentAnimation","_animations"]}static get styles(){return async()=>{let t=new CSSStyleSheet;return await t.replace("* {\n box-sizing: border-box;\n}\n\n:host {\n --lottie-player-toolbar-height: 35px;\n --lottie-player-toolbar-background-color: #fff;\n --lottie-player-toolbar-icon-color: #000;\n --lottie-player-toolbar-icon-hover-color: #000;\n --lottie-player-toolbar-icon-active-color: #4285f4;\n --lottie-player-seeker-track-color: rgb(0 0 0 / 20%);\n --lottie-player-seeker-thumb-color: #4285f4;\n --lottie-player-seeker-display: block;\n\n width: 100%;\n height: 100%;\n\n &:not([hidden]) {\n display: block;\n }\n\n .main {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n\n .animation {\n width: 100%;\n height: 100%;\n display: flex;\n margin: 0;\n padding: 0;\n }\n\n [data-controls='true'] .animation {\n height: calc(100% - 35px);\n }\n\n .animation-container {\n position: relative;\n }\n\n .popover {\n position: absolute;\n right: 5px;\n bottom: 40px;\n background-color: var(--lottie-player-toolbar-background-color);\n border-radius: 5px;\n padding: 10px 15px;\n border: solid 2px var(--lottie-player-toolbar-icon-color);\n animation: fade-in 0.2s ease-in-out;\n\n &::before {\n content: '';\n right: 10px;\n border: 7px solid transparent;\n margin-right: -7px;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n top: 100%;\n border-top-color: var(--lottie-player-toolbar-icon-color);\n }\n }\n\n .error {\n display: flex;\n margin: auto;\n justify-content: center;\n height: 100%;\n align-items: center;\n\n & svg {\n width: 100%;\n height: auto;\n }\n }\n\n .toolbar {\n display: flex;\n place-items: center center;\n background: var(--lottie-player-toolbar-background-color);\n margin: 0;\n height: 35px;\n padding: 5px;\n border-radius: 5px;\n gap: 5px;\n\n &.has-error {\n pointer-events: none;\n opacity: 0.5;\n }\n\n & button {\n cursor: pointer;\n fill: var(--lottie-player-toolbar-icon-color);\n color: var(--lottie-player-toolbar-icon-color);\n background: none;\n border: 0;\n padding: 0;\n outline: 0;\n height: 100%;\n margin: 0;\n align-items: center;\n gap: 5px;\n opacity: 0.9;\n\n &:not([hidden]) {\n display: flex;\n }\n\n &:hover {\n opacity: 1;\n }\n\n &[data-active='true'] {\n opacity: 1;\n fill: var(--lottie-player-toolbar-icon-active-color);\n }\n\n &:disabled {\n opacity: 0.5;\n }\n\n &:focus {\n outline: 0;\n }\n\n & svg {\n pointer-events: none;\n\n & > * {\n fill: inherit;\n }\n }\n\n &.disabled svg {\n display: none;\n }\n }\n }\n\n .progress-container {\n position: relative;\n width: 100%;\n\n &.simple {\n margin-right: 12px;\n }\n }\n\n .seeker {\n appearance: none;\n outline: none;\n width: 100%;\n height: 20px;\n border-radius: 3px;\n border: 0;\n cursor: pointer;\n background-color: transparent;\n\n display: var(--lottie-player-seeker-display);\n color: var(--lottie-player-seeker-thumb-color);\n margin: 0;\n padding: 7.5px 0;\n position: relative;\n z-index: 1;\n\n &::-webkit-slider-runnable-track,\n &::-webkit-slider-thumb {\n appearance: none;\n outline: none;\n }\n\n &::-webkit-slider-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n border: 0;\n background-color: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -webkit-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-webkit-slider-thumb,\n &:focus::-webkit-slider-thumb {\n transform: scale(1);\n }\n\n &::-moz-range-progress {\n background-color: var(--lottie-player-seeker-thumb-color);\n height: 5px;\n border-radius: 3px;\n }\n\n &::-moz-range-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: var(--lottie-player-seeker-thumb-color);\n border: 0;\n cursor: pointer;\n -moz-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-moz-range-thumb,\n &:focus::-moz-range-thumb {\n transform: scale(1);\n }\n\n &::-ms-track {\n width: 100%;\n height: 5px;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n border-radius: 3px;\n }\n\n &::-ms-fill-lower {\n background-color: var(--lottie-player-seeker-thumb-color);\n border-radius: 3px;\n }\n\n &::-ms-thumb {\n border: 0;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -ms-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-ms-thumb {\n transform: scale(1);\n }\n\n &:focus {\n &::-ms-thumb {\n transform: scale(1);\n }\n\n &::-ms-fill-lower,\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n }\n }\n }\n\n & progress {\n appearance: none;\n outline: none;\n position: absolute;\n width: 100%;\n height: 5px;\n border-radius: 3px;\n border: 0;\n top: 0;\n left: 0;\n margin: 7.5px 0;\n background-color: var(--lottie-player-seeker-track-color);\n pointer-events: none;\n\n &::-webkit-progress-inner-element {\n border-radius: 3px;\n overflow: hidden;\n }\n\n &::-webkit-slider-runnable-track {\n background-color: transparent;\n }\n\n &::-webkit-progress-value {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n }\n\n & *::-moz-progress-bar {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n}\n\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --lottie-player-toolbar-background-color: #000;\n --lottie-player-toolbar-icon-color: #fff;\n --lottie-player-toolbar-icon-hover-color: #fff;\n --lottie-player-seeker-track-color: rgb(255 255 255 / 60%);\n }\n}\n"),t}}set animateOnScroll(t){this.setAttribute("animateOnScroll",(!!t).toString())}get animateOnScroll(){let t=this.getAttribute("animateOnScroll");return"true"===t||""===t||"1"===t}get animations(){return this._animations}set autoplay(t){this.setAttribute("autoplay",(!!t).toString())}get autoplay(){let t=this.getAttribute("autoplay");return"true"===t||""===t||"1"===t}set background(t){this.setAttribute("background",t)}get background(){return this.getAttribute("background")||"transparent"}set controls(t){this.setAttribute("controls",(!!t).toString())}get controls(){let t=this.getAttribute("controls");return"true"===t||""===t||"1"===t}set count(t){this.setAttribute("count",t.toString())}get count(){let t=this.getAttribute("count");return t?Number(t):0}get currentAnimation(){return this._currentAnimation}set delay(t){this.setAttribute("delay",t.toString())}get delay(){let t=this.getAttribute("delay");return t?Number(t):0}set description(t){t&&this.setAttribute("description",t)}get description(){return this.getAttribute("description")}set direction(t){this.setAttribute("direction",t.toString())}get direction(){let t=Number(this.getAttribute("direction"));return -1===t?t:1}set dontFreezeOnBlur(t){this.setAttribute("dontFreezeOnBlur",t.toString())}get dontFreezeOnBlur(){let t=this.getAttribute("dontFreezeOnBlur");return"true"===t||""===t||"1"===t}set hover(t){this.setAttribute("hover",t.toString())}get hover(){let t=this.getAttribute("hover");return"true"===t||""===t||"1"===t}set intermission(t){this.setAttribute("intermission",t.toString())}get intermission(){let t=Number(this.getAttribute("intermission"));return isNaN(t)?0:t}get isDotLottie(){return this._isDotLottie}set loop(t){this.setAttribute("loop",(!!t).toString())}get loop(){let t=this.getAttribute("loop");return"true"===t||""===t||"1"===t}set mode(t){this.setAttribute("mode",t)}get mode(){let t=this.getAttribute("mode");return t===I.Bounce?t:I.Normal}set mouseout(t){this.setAttribute("mouseout",t)}get mouseout(){let t=this.getAttribute("mouseout");switch(t){case nH.Void:case nH.Pause:case nH.Reverse:return t;default:return nH.Stop}}set objectfit(t){this.setAttribute("objectfit",t)}get objectfit(){let t=this.getAttribute("objectfit");return t&&Object.values(nW).includes(t)?t:nW.Contain}set once(t){this.setAttribute("once",(!!t).toString())}get once(){let t=this.getAttribute("once");return"true"===t||""===t||"1"===t}set playOnClick(t){this.setAttribute("playOnClick",(!!t).toString())}get playOnClick(){let t=this.getAttribute("playOnClick");return"true"===t||""===t||"1"===t}set playOnVisible(t){this.setAttribute("playOnVisible",(!!t).toString())}get playOnVisible(){let t=this.getAttribute("playOnVisible");return"true"===t||""===t||"1"===t}set preserveAspectRatio(t){this.setAttribute("preserveAspectRatio",t||L.Contain)}get preserveAspectRatio(){let t=this.getAttribute("preserveAspectRatio");return t&&Object.values(L).includes(t)?t:null}set renderer(t){this.setAttribute("renderer",t)}get renderer(){let t=this.getAttribute("renderer");return t===$.Canvas||t===$.HTML?t:$.SVG}set selector(t){t?this.setAttribute("selector",t):this.removeAttribute("selector")}get selector(){return this.getAttribute("selector")}set simple(t){this.setAttribute("simple",(!!t).toString())}get simple(){let t=this.getAttribute("simple");return"true"===t||""===t||"1"===t}set speed(t){this.setAttribute("speed",t.toString())}get speed(){let t=this.getAttribute("speed");return null===t||isNaN(Number(t))?1:Number(t)}set src(t){this.setAttribute("src",t||"")}get src(){return this.getAttribute("src")}set subframe(t){this.setAttribute("subframe",(!!t).toString())}get subframe(){let t=this.getAttribute("subframe");return"true"===t||""===t||"1"===t}constructor(){super(),this.isLight=!1,this.playerState=nY.Loading,this._container=null,this._errorMessage="Something went wrong",this._identifier=this.id||g(),this._isSettingsOpen=!1,this._playerState={count:0,loaded:!1,prev:nY.Loading,scrollTimeout:null,scrollY:0,visible:!1},this._render=nK,this._renderControls=nJ,this._seeker=0,this._animations=[],this._currentAnimation=0,this._isBounce=!1,this._isDotLottie=!1,this._lottieInstance=null,this._multiAnimationSettings=[],this._complete=this._complete.bind(this),this._dataFailed=this._dataFailed.bind(this),this._dataReady=this._dataReady.bind(this),this._DOMLoaded=this._DOMLoaded.bind(this),this._enterFrame=this._enterFrame.bind(this),this._freeze=this._freeze.bind(this),this._handleBlur=this._handleBlur.bind(this),this._handleClick=this._handleClick.bind(this),this._handleScroll=this._handleScroll.bind(this),this._handleSeekChange=this._handleSeekChange.bind(this),this._handleWindowBlur=this._handleWindowBlur.bind(this),this._loopComplete=this._loopComplete.bind(this),this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._switchInstance=this._switchInstance.bind(this),this._handleSettingsClick=this._handleSettingsClick.bind(this),this.togglePlay=this.togglePlay.bind(this),this.stop=this.stop.bind(this),this.prev=this.prev.bind(this),this.next=this.next.bind(this),this._renderControls=this._renderControls.bind(this),this.snapshot=this.snapshot.bind(this),this.toggleLoop=this.toggleLoop.bind(this),this.toggleBoomerang=this.toggleBoomerang.bind(this),this.destroy=this.destroy.bind(this),this.template=document.createElement("template"),this.shadow=this.attachShadow({mode:"open"})}addAnimation(t){throw Error(nQ)}async attributeChangedCallback(t,e,s){if(this._lottieInstance&&this.shadow&&this._container)switch(t){case"animateOnScroll":if(""===s||s){this._lottieInstance.autoplay=!1,addEventListener("scroll",this._handleScroll,{capture:!0,passive:!0});return}removeEventListener("scroll",this._handleScroll,!0);break;case"autoplay":if(this.animateOnScroll||this.playOnVisible)return;if(""===s||s)return void this.play();this.stop();break;case"controls":this._renderControls();break;case"direction":if(-1===Number(s))return void this.setDirection(-1);this.setDirection(1);break;case"hover":if(""===s||s){this._container.addEventListener("mouseenter",this._mouseEnter),this._container.addEventListener("mouseleave",this._mouseLeave);return}this._container.removeEventListener("mouseenter",this._mouseEnter),this._container.removeEventListener("mouseleave",this._mouseLeave);break;case"loop":{let t=this.shadow.querySelector(".toggleLoop");t instanceof HTMLButtonElement&&(t.dataset.active=s),this.setLoop(""===s||!!s);break}case"mode":{let t=this.shadow.querySelector(".toggleBoomerang");t instanceof HTMLButtonElement&&(t.dataset.active=(s===I.Bounce).toString()),this._isBounce=s===I.Bounce;break}case"playOnClick":if(""===s||s){this._lottieInstance.autoplay=!1,this._container.addEventListener("click",this._handleClick);return}this._container.removeEventListener("click",this._handleClick);break;case"playOnVisible":(""===s||s)&&(this._lottieInstance.autoplay=!1);break;case"selector":{let t=document.getElementById(this.selector??"");t?.addEventListener("click",this._handleClick);break}case"speed":{let t=Number(s);t&&!isNaN(t)&&this.setSpeed(t);break}case"src":await this.load(s);break;case"subframe":this.setSubframe(""===s||!!s)}}connectedCallback(){super.connectedCallback();try{(async()=>{if(await this._render(),!this.shadow)throw Error("Missing Shadow element");this._container=this.shadow.querySelector(".animation"),await this.load(this.src),void 0!==document.hidden&&document.addEventListener("visibilitychange",this._onVisibilityChange),this._addIntersectionObserver(),this.dispatchEvent(new CustomEvent(F.Rendered))})()}catch(t){console.error(t),this.dispatchEvent(new CustomEvent(F.Error))}}convert(t){throw Error(nQ)}destroy(){this._lottieInstance?.destroy&&(this.playerState=nY.Destroyed,this._lottieInstance.destroy(),this._lottieInstance=null,this.dispatchEvent(new CustomEvent(F.Destroyed)),this.remove(),document.removeEventListener("visibilitychange",this._onVisibilityChange))}disconnectedCallback(){this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.destroy()}getLottie(){return this._lottieInstance}getManifest(){return this._manifest}getMultiAnimationSettings(){return this._multiAnimationSettings}getSegment(){return this._segment}async load(t){try{if(!this.shadowRoot||!t)return;this.source=t;let{animations:e,isDotLottie:s,manifest:i}=await nD(t);if(!e||e.some(t=>!["v","ip","op","layers","fr","w","h"].every(e=>Object.hasOwn(t,e))))throw Error("Broken or corrupted file");let r=this.parentElement?.querySelector('script[type="application/ld+json"]');if(r){let t=JSON.parse(r.innerHTML);t.selector&&(this.selector=t.selector),t.segment&&this.setSegment(t.segment),t.multiAnimationSettings&&this.setMultiAnimationSettings(t.multiAnimationSettings)}this._isBounce=this.mode===I.Bounce,this._multiAnimationSettings.length>0&&this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===I.Bounce);let a=i?.animations[0];a&&(a.autoplay=!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,a.loop=this.loop),this._isDotLottie=s,this._animations=e,this._manifest=i??{animations:[{autoplay:!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,direction:this.direction,id:g(),loop:this.loop,mode:this.mode,speed:this.speed}]},this._lottieInstance?.destroy(),this.playerState=nY.Stopped,!this.animateOnScroll&&(this.autoplay||this._multiAnimationSettings[this._currentAnimation]?.autoplay||this.playOnVisible)&&(this.playerState=nY.Playing),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:e[this._currentAnimation]}),this._addEventListeners();let n=this._multiAnimationSettings[this._currentAnimation]?.speed??this.speed,o=this._multiAnimationSettings[this._currentAnimation]?.direction??this.direction;if(this._lottieInstance.setSpeed(n),this._lottieInstance.setDirection(o),this._lottieInstance.setSubframe(!!this.subframe),(this.autoplay||this.animateOnScroll||this.playOnVisible)&&-1===this.direction&&this.seek("99%"),this._renderControls(),this.autoplay||this.playOnVisible){let t=this.shadow?.querySelector(".togglePlay");t&&(t.innerHTML=nX)}}catch(t){console.error(t),this._errorMessage=nZ(t).message,this.playerState=nY.Error,this.dispatchEvent(new CustomEvent(F.Error))}}loadAnimation(t){throw Error(nQ)}next(){this._currentAnimation++,this._switchInstance()}pause(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(F.Pause))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?nY.Error:nY.Paused}}play(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.play(),this.dispatchEvent(new CustomEvent(F.Play))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?nY.Error:nY.Playing}}prev(){this._currentAnimation--,this._switchInstance(!0)}propertyChangedCallback(t,e,s){if(!this.shadow)return;let i=this.shadow.querySelector(".togglePlay"),r=this.shadow.querySelector(".stop"),a=this.shadow.querySelector(".prev"),n=this.shadow.querySelector(".next"),o=this.shadow.querySelector(".seeker"),h=this.shadow.querySelector("progress"),l=this.shadow.querySelector(".popover"),p=this.shadow.querySelector(".convert"),c=this.shadow.querySelector(".snapshot");i instanceof HTMLButtonElement&&r instanceof HTMLButtonElement&&n instanceof HTMLButtonElement&&a instanceof HTMLButtonElement&&o instanceof HTMLInputElement&&h instanceof HTMLProgressElement&&("playerState"===t&&(i.dataset.active=(s===nY.Playing||s===nY.Paused).toString(),r.dataset.active=(s===nY.Stopped).toString(),s===nY.Playing?i.innerHTML=nX:i.innerHTML=nB),"_seeker"===t&&"number"==typeof s&&(o.value=s.toString(),o.ariaValueNow=s.toString(),h.value=s),"_animations"===t&&Array.isArray(s)&&this._currentAnimation+1<s.length&&(n.hidden=!1),"_currentAnimation"===t&&"number"==typeof s&&(n.hidden=s+1>=this._animations.length,a.hidden=!s),"_isSettingsOpen"===t&&"boolean"==typeof s&&l instanceof HTMLDivElement&&p instanceof HTMLButtonElement&&c instanceof HTMLButtonElement&&(l.hidden=!s,p.hidden=this.isLight,c.hidden=this.renderer!==$.SVG))}async reload(){this._lottieInstance&&this.src&&(this._lottieInstance.destroy(),await this.load(this.src))}seek(t){if(!this._lottieInstance)return;let e=t.toString().match(/^(\d+)(%?)$/);if(!e)return;let s=Math.round("%"===e[2]?this._lottieInstance.totalFrames*Number(e[1])/100:Number(e[1]));if(this._seeker=s,this.playerState===nY.Playing||this.playerState===nY.Frozen&&this._playerState.prev===nY.Playing){this._lottieInstance.goToAndPlay(s,!0),this.playerState=nY.Playing;return}this._lottieInstance.goToAndStop(s,!0),this._lottieInstance.pause()}setCount(t){this.count=t}setDirection(t){this._lottieInstance&&this._lottieInstance.setDirection(t)}setLoop(t){this._lottieInstance&&this._lottieInstance.setLoop(t)}setMultiAnimationSettings(t){this._multiAnimationSettings=t}setSegment(t){this._segment=t}setSpeed(t=1){this._lottieInstance&&this._lottieInstance.setSpeed(t)}setSubframe(t){this._lottieInstance&&this._lottieInstance.setSubframe(t)}snapshot(t=!0,e="AM Lottie"){try{var s,i;let r,a,n,o;if(!this.shadowRoot)throw Error("Unknown error");let h=this.shadowRoot.querySelector(".animation svg");if(!h)throw Error("Could not retrieve animation from DOM");let l=h instanceof Node?new XMLSerializer().serializeToString(h):null;if(!l)throw Error("Could not serialize SVG element");return t&&(i={mimeType:"image/svg+xml",name:`${s=this.src||e,(t=>{let e;if("string"==typeof t&&t&&((e=t?.split("/").pop()?.lastIndexOf("."))??0)>1&&t&&t.length-1>(e??0))return t.split(".").pop()?.toLowerCase()})(s),`${s.split("/").pop()?.replace(/\.[^.]*$/,"").replaceAll(/\W+/g,"-")}`}-${((this._seeker??0)+1).toString().padStart(3,"0")}.svg`},r=new Blob([l],{type:i?.mimeType}),a=i?.name||g(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=a,o.hidden=!0,document.body.appendChild(o),o.click(),setTimeout(()=>{o.remove(),URL.revokeObjectURL(n)},1e3)),l}catch(t){return console.error(t),null}}stop(){if(this._lottieInstance){this._playerState.prev=this.playerState,this._playerState.count=0;try{this._lottieInstance.stop(),this.dispatchEvent(new CustomEvent(F.Stop))}finally{this.playerState=nY.Stopped}}}toggleBoomerang(){let t=this._multiAnimationSettings[this._currentAnimation]??{};if(void 0!==t.mode){if(t.mode===I.Normal){t.mode=I.Bounce,this._isBounce=!0;return}t.mode=I.Normal,this._isBounce=!1;return}if(this.mode===I.Normal){this.mode=I.Bounce,this._isBounce=!0;return}this.mode=I.Normal,this._isBounce=!1}toggleLoop(){let t=!this.loop;this.loop=t,this.setLoop(t)}togglePlay(){if(!this._lottieInstance)return;let{currentFrame:t,playDirection:e,totalFrames:s}=this._lottieInstance;if(this.playerState===nY.Playing)return void this.pause();if(this.playerState!==nY.Completed)return void this.play();if(this.playerState=nY.Playing,this._isBounce){this.setDirection(-1*e),this._lottieInstance.goToAndPlay(t,!0);return}-1===e?this._lottieInstance.goToAndPlay(s,!0):this._lottieInstance.goToAndPlay(0,!0)}_freeze(){if(this._lottieInstance){this._playerState.prev=this.playerState;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(F.Freeze))}finally{this.playerState=nY.Frozen}}}_handleBlur(){setTimeout(()=>{this._toggleSettings(!1)},200)}_handleClick(){(this.playOnClick||this.selector)&&this.togglePlay()}_handleSeekChange({target:t}){!(!(t instanceof HTMLInputElement)||!this._lottieInstance||isNaN(Number(t.value)))&&this.seek(Math.round(Number(t.value)/100*this._lottieInstance.totalFrames))}_handleSettingsClick({target:t}){this._toggleSettings(),t instanceof HTMLElement&&t.focus()}setOptions(t){throw Error("Method not implemented")}_addEventListeners(){this._toggleEventListeners("add")}_addIntersectionObserver(){if(this._container&&!this._intersectionObserver){if(!("IntersectionObserver"in window)){this._intersectionObserverFallback(),removeEventListener("scroll",this._intersectionObserverFallback,!0),addEventListener("scroll",this._intersectionObserverFallback,{capture:!0,passive:!0});return}this._intersectionObserver=new IntersectionObserver(t=>{let{length:e}=t;for(let s=0;s<e;s++){if(!t[s]?.isIntersecting||document.hidden){this.playerState===nY.Playing&&this._freeze(),this._playerState.visible=!1;continue}this.animateOnScroll||this.playOnVisible||this.playerState!==nY.Frozen||this.play(),this.playOnVisible&&(this.playerState!==nY.Completed||this.once?setTimeout(()=>{this.play()},this.delay):(this.playerState=nY.Playing,this._lottieInstance?.goToAndPlay(1===this.direction?0:this._lottieInstance.totalFrames))),!this._playerState.scrollY&&(t[s]?.boundingClientRect.y||0)>0&&(this._playerState.scrollY=scrollY),this._playerState.visible=!0}}),this._intersectionObserver.observe(this._container)}}_complete(){if(!this._lottieInstance)return;if(this._animations.length>1){if(this._multiAnimationSettings[this._currentAnimation+1]?.autoplay)return void this.next();if(this.loop&&this._currentAnimation===this._animations.length-1){this._currentAnimation=0,this._switchInstance();return}}let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.playerState=nY.Completed,this.dispatchEvent(new CustomEvent(F.Complete,{detail:{frame:t,seeker:this._seeker}}))}_dataFailed(){this.playerState=nY.Error,this.dispatchEvent(new CustomEvent(F.Error))}_dataReady(){this.dispatchEvent(new CustomEvent(F.Load))}_DOMLoaded(){this._playerState.loaded=!0,this.dispatchEvent(new CustomEvent(F.Ready))}_enterFrame(){if(!this._lottieInstance)return;let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.dispatchEvent(new CustomEvent(F.Frame,{detail:{frame:t,seeker:this._seeker}}))}_getOptions(){if(!this._container)throw Error("Container not rendered");let t=this.preserveAspectRatio??(t=>{switch(t){case nW.Contain:case nW.ScaleDown:return L.Contain;case nW.Cover:return L.Cover;case nW.Fill:return L.Initial;case nW.None:return L.None;default:return L.Contain}})(this.objectfit),e=this._multiAnimationSettings.length>0?this._multiAnimationSettings[this._currentAnimation]:void 0,s=this._manifest?.animations[this._currentAnimation],i=!!this.loop;s?.loop!==void 0&&(i=!!s.loop),e?.loop!==void 0&&(i=!!e.loop);let r=!!this.autoplay;s?.autoplay!==void 0&&(r=!!s.autoplay),e?.autoplay!==void 0&&(r=!!e.autoplay),this.animateOnScroll&&(r=!1);let a=this._segment;return this._segment?.every(t=>t>0)&&(a=[this._segment[0]-1,this._segment[1]-1]),this._segment?.some(t=>t<0)&&(a=void 0),this.setOptions({container:this._container,hasAutoplay:r,hasLoop:i,initialSegment:a,preserveAspectRatio:t,rendererType:this.renderer})}_handleScroll(){if(!this.animateOnScroll||!this._lottieInstance)return;if(N)return void console.warn("DotLottie: Scroll animations might not work properly in a Server Side Rendering context. Try to wrap this in a client component.");if(!this._playerState.visible)return;this._playerState.scrollTimeout&&clearTimeout(this._playerState.scrollTimeout),this._playerState.scrollTimeout=setTimeout(()=>{this.playerState=nY.Paused},400);let{totalFrames:t}=this._lottieInstance,e=scrollY-this._playerState.scrollY;scrollY<=this._playerState.scrollY&&(e=this._playerState.scrollY-scrollY);let s=((t,e=0,s=100)=>{let i=e,r=s;if(i>r){let t=r;r=i,i=t}return Math.min(Math.max(t,i),r)})(e/innerHeight*(t-1),0,t);requestAnimationFrame(()=>{if(s>=t){this.playerState=nY.Paused;return}this.playerState=nY.Playing,this._lottieInstance?.goToAndStop(s,!0)})}_handleWindowBlur({type:t}){this.dontFreezeOnBlur||(this.playerState===nY.Playing&&"blur"===t&&this._freeze(),this.playerState===nY.Frozen&&"focus"===t&&this.play())}_intersectionObserverFallback(){if(!this._container)return;let{bottom:t,left:e,right:s,top:i}=this._container.getBoundingClientRect();this._playerState.visible=i>=0&&e>=0&&t<=innerHeight&&s<=innerWidth,(this.autoplay||this.playOnVisible||this.playerState===nY.Playing||this.playerState===nY.Frozen)&&(this._playerState.visible?this.play():this._freeze())}_loopComplete(){if(!this._lottieInstance)return;let{playDirection:t,totalFrames:e}=this._lottieInstance,s=this._segment?this._segment[0]:0,i=this._segment?this._segment[0]:e;if(this.count&&(this._isBounce?this._playerState.count+=.5:this._playerState.count+=1,this._playerState.count>=this.count)){this.setLoop(!1),this.playerState=nY.Completed,this.dispatchEvent(new CustomEvent(F.Complete));return}return(this.dispatchEvent(new CustomEvent(F.Loop)),this._isBounce)?(this._lottieInstance.goToAndStop(-1===t?s:.99*i,!0),this._lottieInstance.setDirection(-1*t),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission)):(this._lottieInstance.goToAndStop(-1===t?.99*i:s,!0),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission))}_mouseEnter(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window)){if(this.mouseout===nH.Reverse&&this._lottieInstance.setDirection(1),this.playerState===nY.Completed){this._lottieInstance.goToAndPlay(0,!0),this.playerState=nY.Playing;return}this.playerState!==nY.Playing&&this.play()}}_mouseLeave(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window))switch(this.mouseout){case nH.Void:break;case nH.Pause:this.pause();break;case nH.Reverse:this._lottieInstance.setDirection(-1),this.play();break;default:this.stop()}}_onVisibilityChange(){document.hidden&&this.playerState===nY.Playing?this._freeze():this.playerState===nY.Frozen&&this.play()}_removeEventListeners(){this._toggleEventListeners("remove")}_switchInstance(t=!1){if(this._animations[this._currentAnimation])try{if(this._lottieInstance&&this._lottieInstance.destroy(),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:this._animations[this._currentAnimation]}),this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===I.Bounce),this._removeEventListeners(),this._addEventListeners(),this.dispatchEvent(new CustomEvent(t?F.Previous:F.Next)),this._multiAnimationSettings[this._currentAnimation]?.autoplay??this.autoplay){if(this.animateOnScroll){this._lottieInstance.goToAndStop(0,!0),this.playerState=nY.Paused;return}this._lottieInstance.goToAndPlay(0,!0),this.playerState=nY.Playing;return}this._lottieInstance.goToAndStop(0,!0),this.playerState=nY.Stopped}catch(t){this._errorMessage=nZ(t).message,this.playerState=nY.Error,this.dispatchEvent(new CustomEvent(F.Error))}}_toggleEventListeners(t){let e="add"===t?"addEventListener":"removeEventListener";if(this._lottieInstance&&(this._lottieInstance[e]("enterFrame",this._enterFrame),this._lottieInstance[e]("complete",this._complete),this._lottieInstance[e]("loopComplete",this._loopComplete),this._lottieInstance[e]("DOMLoaded",this._DOMLoaded),this._lottieInstance[e]("data_ready",this._dataReady),this._lottieInstance[e]("data_failed",this._dataFailed)),this.selector){let t=document.getElementById(this.selector);t?this.hover?(t[e]("mouseenter",this._mouseEnter),t[e]("mouseleave",this._mouseLeave)):t[e]("click",this._handleClick):this.selector=null}this._container&&!this.selector&&(this.hover&&(this._container[e]("mouseenter",this._mouseEnter),this._container[e]("mouseleave",this._mouseLeave)),this.playOnClick&&this._container[e]("click",this._handleClick)),window[e]("focus",this._handleWindowBlur,{capture:!1,passive:!0}),window[e]("blur",this._handleWindowBlur,{capture:!1,passive:!0}),this.animateOnScroll&&window[e]("scroll",this._handleScroll,{capture:!0,passive:!0})}_toggleSettings(t){if(void 0===t){this._isSettingsOpen=!this._isSettingsOpen;return}this._isSettingsOpen=t}}class n1 extends n0{setOptions({container:t,hasAutoplay:e,hasLoop:s,initialSegment:i,preserveAspectRatio:r,rendererType:a}){let n={autoplay:e,container:t,initialSegment:i,loop:s,renderer:a,rendererSettings:{imagePreserveAspectRatio:r}};switch(this.renderer){case $.HTML:case $.SVG:n.rendererSettings={...n.rendererSettings,hideOnTransparent:!0,preserveAspectRatio:r,progressiveLoad:!0};break;case $.Canvas:n.rendererSettings={...n.rendererSettings,clearCanvas:!0,preserveAspectRatio:r,progressiveLoad:!0}}return n}constructor(...t){super(...t),this.addAnimation=nI,this.convert=nF,this.loadAnimation=r9}}globalThis.dotLottiePlayer=()=>new n1,N||customElements.define(nU,n1),t.MouseOut=nH,t.PlayMode=I,t.PlayerEvents=F,t.PlayerState=nY,t.default=n1,t.tagName=nU,Object.defineProperty(t,"__esModule",{value:!0})}(this["@aarsteinmedia/dotlottie-player"]=this["@aarsteinmedia/dotlottie-player"]||{});
70
+ `;async function nK(){if(!this.shadow||!this.template)throw Error("No Shadow Element or Template");this.template.innerHTML=`<div class="animation-container main" data-controls="${this.controls??!1}" lang="${this.description?document.documentElement.lang:"en"}" aria-label="${this.description??"Lottie animation"}" data-loaded="${this._playerState.loaded}"><figure class="animation" style="background:${this.background}">${this.playerState===nY.Error?`<div class="error"><svg preserveAspectRatio="${L.Cover}" xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080" style="white-space:preserve"><path fill="#fff" d="M0 0h1920v1080H0z"/><path fill="#3a6d8b" d="M1190.2 531 1007 212.4c-22-38.2-77.2-38-98.8.5L729.5 531.3c-21.3 37.9 6.1 84.6 49.5 84.6l361.9.3c43.7 0 71.1-47.3 49.3-85.2zM937.3 288.7c.2-7.5 3.3-23.9 23.2-23.9 16.3 0 23 16.1 23 23.5 0 55.3-10.7 197.2-12.2 214.5-.1 1-.9 1.7-1.9 1.7h-18.3c-1 0-1.8-.7-1.9-1.7-1.4-17.5-13.4-162.9-11.9-214.1zm24.2 283.8c-13.1 0-23.7-10.6-23.7-23.7s10.6-23.7 23.7-23.7 23.7 10.6 23.7 23.7-10.6 23.7-23.7 23.7zM722.1 644h112.6v34.4h-70.4V698h58.8v31.7h-58.8v22.6h72.4v36.2H722.1V644zm162 57.1h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6zm78.9 0h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5H963v15.6zm39.5 36.2c0-31.3 22.2-54.8 56.6-54.8 34.4 0 56.2 23.5 56.2 54.8s-21.8 54.6-56.2 54.6c-34.4-.1-56.6-23.3-56.6-54.6zm74 0c0-17.4-6.1-29.1-17.8-29.1-11.7 0-17.4 11.7-17.4 29.1 0 17.4 5.7 29.1 17.4 29.1s17.8-11.8 17.8-29.1zm83.1-36.2h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6z"/><path fill="none" d="M718.9 807.7h645v285.4h-645z"/><text fill="#3a6d8b" style="text-align:center;position:absolute;left:100%;font-size:47px;font-family:system-ui,-apple-system,BlinkMacSystemFont,'.SFNSText-Regular',sans-serif" x="50%" y="848.017" text-anchor="middle">${this._errorMessage}</text></svg></div>`:""}</figure><slot name="controls"></slot></div>`,this.shadow.adoptedStyleSheets=[await n0.styles()],this.shadow.appendChild(this.template.content.cloneNode(!0))}let nZ=t=>{let e={message:"Unknown error",status:N?500:400};return t&&"object"==typeof t&&("message"in t&&"string"==typeof t.message&&(e.message=t.message),"status"in t&&(e.status=Number(t.status))),e},nQ="Method is not implemented";class n0 extends n${static get observedAttributes(){return["animateOnScroll","autoplay","controls","direction","hover","loop","mode","playOnClick","playOnVisible","selector","speed","src","subframe"]}static get observedProperties(){return["playerState","_isSettingsOpen","_seeker","_currentAnimation","_animations"]}static get styles(){return async()=>{let t=new CSSStyleSheet;return await t.replace("* {\n box-sizing: border-box;\n}\n\n:host {\n --lottie-player-toolbar-height: 35px;\n --lottie-player-toolbar-background-color: #fff;\n --lottie-player-toolbar-icon-color: #000;\n --lottie-player-toolbar-icon-hover-color: #000;\n --lottie-player-toolbar-icon-active-color: #4285f4;\n --lottie-player-seeker-track-color: rgb(0 0 0 / 20%);\n --lottie-player-seeker-thumb-color: #4285f4;\n --lottie-player-seeker-display: block;\n\n width: 100%;\n height: 100%;\n\n &:not([hidden]) {\n display: block;\n }\n\n .main {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n\n .animation {\n width: 100%;\n height: 100%;\n display: flex;\n margin: 0;\n padding: 0;\n }\n\n [data-controls='true'] .animation {\n height: calc(100% - 35px);\n }\n\n .animation-container {\n position: relative;\n }\n\n .popover {\n position: absolute;\n right: 5px;\n bottom: 40px;\n background-color: var(--lottie-player-toolbar-background-color);\n border-radius: 5px;\n padding: 10px 15px;\n border: solid 2px var(--lottie-player-toolbar-icon-color);\n animation: fade-in 0.2s ease-in-out;\n\n &::before {\n content: '';\n right: 10px;\n border: 7px solid transparent;\n margin-right: -7px;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n top: 100%;\n border-top-color: var(--lottie-player-toolbar-icon-color);\n }\n }\n\n .error {\n display: flex;\n margin: auto;\n justify-content: center;\n height: 100%;\n align-items: center;\n\n & svg {\n width: 100%;\n height: auto;\n }\n }\n\n .toolbar {\n display: flex;\n place-items: center center;\n background: var(--lottie-player-toolbar-background-color);\n margin: 0;\n height: 35px;\n padding: 5px;\n border-radius: 5px;\n gap: 5px;\n\n &.has-error {\n pointer-events: none;\n opacity: 0.5;\n }\n\n & button {\n cursor: pointer;\n fill: var(--lottie-player-toolbar-icon-color);\n color: var(--lottie-player-toolbar-icon-color);\n background: none;\n border: 0;\n padding: 0;\n outline: 0;\n height: 100%;\n margin: 0;\n align-items: center;\n gap: 5px;\n opacity: 0.9;\n\n &:not([hidden]) {\n display: flex;\n }\n\n &:hover {\n opacity: 1;\n }\n\n &[data-active='true'] {\n opacity: 1;\n fill: var(--lottie-player-toolbar-icon-active-color);\n }\n\n &:disabled {\n opacity: 0.5;\n }\n\n &:focus {\n outline: 0;\n }\n\n & svg {\n pointer-events: none;\n\n & > * {\n fill: inherit;\n }\n }\n\n &.disabled svg {\n display: none;\n }\n }\n }\n\n .progress-container {\n position: relative;\n width: 100%;\n\n &.simple {\n margin-right: 12px;\n }\n }\n\n .seeker {\n appearance: none;\n outline: none;\n width: 100%;\n height: 20px;\n border-radius: 3px;\n border: 0;\n cursor: pointer;\n background-color: transparent;\n\n display: var(--lottie-player-seeker-display);\n color: var(--lottie-player-seeker-thumb-color);\n margin: 0;\n padding: 7.5px 0;\n position: relative;\n z-index: 1;\n\n &::-webkit-slider-runnable-track,\n &::-webkit-slider-thumb {\n appearance: none;\n outline: none;\n }\n\n &::-webkit-slider-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n border: 0;\n background-color: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -webkit-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-webkit-slider-thumb,\n &:focus::-webkit-slider-thumb {\n transform: scale(1);\n }\n\n &::-moz-range-progress {\n background-color: var(--lottie-player-seeker-thumb-color);\n height: 5px;\n border-radius: 3px;\n }\n\n &::-moz-range-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: var(--lottie-player-seeker-thumb-color);\n border: 0;\n cursor: pointer;\n -moz-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-moz-range-thumb,\n &:focus::-moz-range-thumb {\n transform: scale(1);\n }\n\n &::-ms-track {\n width: 100%;\n height: 5px;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n border-radius: 3px;\n }\n\n &::-ms-fill-lower {\n background-color: var(--lottie-player-seeker-thumb-color);\n border-radius: 3px;\n }\n\n &::-ms-thumb {\n border: 0;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -ms-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-ms-thumb {\n transform: scale(1);\n }\n\n &:focus {\n &::-ms-thumb {\n transform: scale(1);\n }\n\n &::-ms-fill-lower,\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n }\n }\n }\n\n & progress {\n appearance: none;\n outline: none;\n position: absolute;\n width: 100%;\n height: 5px;\n border-radius: 3px;\n border: 0;\n top: 0;\n left: 0;\n margin: 7.5px 0;\n background-color: var(--lottie-player-seeker-track-color);\n pointer-events: none;\n\n &::-webkit-progress-inner-element {\n border-radius: 3px;\n overflow: hidden;\n }\n\n &::-webkit-slider-runnable-track {\n background-color: transparent;\n }\n\n &::-webkit-progress-value {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n }\n\n & *::-moz-progress-bar {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n}\n\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --lottie-player-toolbar-background-color: #000;\n --lottie-player-toolbar-icon-color: #fff;\n --lottie-player-toolbar-icon-hover-color: #fff;\n --lottie-player-seeker-track-color: rgb(255 255 255 / 60%);\n }\n}\n"),t}}set animateOnScroll(t){this.setAttribute("animateOnScroll",(!!t).toString())}get animateOnScroll(){let t=this.getAttribute("animateOnScroll");return"true"===t||""===t||"1"===t}get animations(){return this._animations}set autoplay(t){this.setAttribute("autoplay",(!!t).toString())}get autoplay(){let t=this.getAttribute("autoplay");return"true"===t||""===t||"1"===t}set background(t){this.setAttribute("background",t)}get background(){return this.getAttribute("background")||"transparent"}set controls(t){this.setAttribute("controls",(!!t).toString())}get controls(){let t=this.getAttribute("controls");return"true"===t||""===t||"1"===t}set count(t){this.setAttribute("count",t.toString())}get count(){let t=this.getAttribute("count");return t?Number(t):0}get currentAnimation(){return this._currentAnimation}set delay(t){this.setAttribute("delay",t.toString())}get delay(){let t=this.getAttribute("delay");return t?Number(t):0}set description(t){t&&this.setAttribute("description",t)}get description(){return this.getAttribute("description")}set direction(t){this.setAttribute("direction",t.toString())}get direction(){let t=Number(this.getAttribute("direction"));return -1===t?t:1}set dontFreezeOnBlur(t){this.setAttribute("dontFreezeOnBlur",(!!t).toString())}get dontFreezeOnBlur(){let t=this.getAttribute("dontFreezeOnBlur");return"true"===t||""===t||"1"===t}set hover(t){this.setAttribute("hover",(!!t).toString())}get hover(){let t=this.getAttribute("hover");return"true"===t||""===t||"1"===t}set intermission(t){this.setAttribute("intermission",t.toString())}get intermission(){let t=Number(this.getAttribute("intermission"));return isNaN(t)?0:t}get isDotLottie(){return this._isDotLottie}set loop(t){this.setAttribute("loop",(!!t).toString())}get loop(){let t=this.getAttribute("loop");return"true"===t||""===t||"1"===t}set mode(t){this.setAttribute("mode",t)}get mode(){let t=this.getAttribute("mode");return t===I.Bounce?t:I.Normal}set mouseout(t){this.setAttribute("mouseout",t)}get mouseout(){let t=this.getAttribute("mouseout");switch(t){case nH.Void:case nH.Pause:case nH.Reverse:return t;default:return nH.Stop}}set objectfit(t){this.setAttribute("objectfit",t)}get objectfit(){let t=this.getAttribute("objectfit");return t&&Object.values(nW).includes(t)?t:nW.Contain}set once(t){this.setAttribute("once",(!!t).toString())}get once(){let t=this.getAttribute("once");return"true"===t||""===t||"1"===t}set playOnClick(t){this.setAttribute("playOnClick",(!!t).toString())}get playOnClick(){let t=this.getAttribute("playOnClick");return"true"===t||""===t||"1"===t}set playOnVisible(t){this.setAttribute("playOnVisible",(!!t).toString())}get playOnVisible(){let t=this.getAttribute("playOnVisible");return"true"===t||""===t||"1"===t}set preserveAspectRatio(t){this.setAttribute("preserveAspectRatio",t||L.Contain)}get preserveAspectRatio(){let t=this.getAttribute("preserveAspectRatio");return t&&Object.values(L).includes(t)?t:null}set renderer(t){this.setAttribute("renderer",t)}get renderer(){let t=this.getAttribute("renderer");return t===$.Canvas||t===$.HTML?t:$.SVG}set selector(t){t?this.setAttribute("selector",t):this.removeAttribute("selector")}get selector(){return this.getAttribute("selector")}set simple(t){this.setAttribute("simple",(!!t).toString())}get simple(){let t=this.getAttribute("simple");return"true"===t||""===t||"1"===t}set speed(t){this.setAttribute("speed",t.toString())}get speed(){let t=this.getAttribute("speed");return null===t||isNaN(Number(t))?1:Number(t)}set src(t){this.setAttribute("src",t||"")}get src(){return this.getAttribute("src")}set subframe(t){this.setAttribute("subframe",(!!t).toString())}get subframe(){let t=this.getAttribute("subframe");return"true"===t||""===t||"1"===t}constructor(){super(),this.isLight=!1,this.playerState=nY.Loading,this._container=null,this._errorMessage="Something went wrong",this._identifier=this.id||g(),this._isSettingsOpen=!1,this._playerState={count:0,loaded:!1,prev:nY.Loading,scrollTimeout:null,scrollY:0,visible:!1},this._render=nK,this._renderControls=nJ,this._seeker=0,this._animations=[],this._currentAnimation=0,this._isBounce=!1,this._isDotLottie=!1,this._lottieInstance=null,this._multiAnimationSettings=[],this._complete=this._complete.bind(this),this._dataFailed=this._dataFailed.bind(this),this._dataReady=this._dataReady.bind(this),this._DOMLoaded=this._DOMLoaded.bind(this),this._enterFrame=this._enterFrame.bind(this),this._freeze=this._freeze.bind(this),this._handleBlur=this._handleBlur.bind(this),this._handleClick=this._handleClick.bind(this),this._handleScroll=this._handleScroll.bind(this),this._handleSeekChange=this._handleSeekChange.bind(this),this._handleWindowBlur=this._handleWindowBlur.bind(this),this._loopComplete=this._loopComplete.bind(this),this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._switchInstance=this._switchInstance.bind(this),this._handleSettingsClick=this._handleSettingsClick.bind(this),this.togglePlay=this.togglePlay.bind(this),this.stop=this.stop.bind(this),this.prev=this.prev.bind(this),this.next=this.next.bind(this),this._renderControls=this._renderControls.bind(this),this.snapshot=this.snapshot.bind(this),this.toggleLoop=this.toggleLoop.bind(this),this.toggleBoomerang=this.toggleBoomerang.bind(this),this.destroy=this.destroy.bind(this),this.template=document.createElement("template"),this.shadow=this.attachShadow({mode:"open"})}addAnimation(t){throw Error(nQ)}async attributeChangedCallback(t,e,s){if(this._lottieInstance&&this.shadow&&this._container)switch(t){case"animateOnScroll":if(""===s||s){this._lottieInstance.autoplay=!1,addEventListener("scroll",this._handleScroll,{capture:!0,passive:!0});return}removeEventListener("scroll",this._handleScroll,!0);break;case"autoplay":if(this.animateOnScroll||this.playOnVisible)return;if(""===s||s)return void this.play();this.stop();break;case"controls":this._renderControls();break;case"direction":if(-1===Number(s))return void this.setDirection(-1);this.setDirection(1);break;case"hover":if(""===s||s){this._container.addEventListener("mouseenter",this._mouseEnter),this._container.addEventListener("mouseleave",this._mouseLeave);return}this._container.removeEventListener("mouseenter",this._mouseEnter),this._container.removeEventListener("mouseleave",this._mouseLeave);break;case"loop":{let t=this.shadow.querySelector(".toggleLoop");t instanceof HTMLButtonElement&&(t.dataset.active=s),this.setLoop(""===s||!!s);break}case"mode":{let t=this.shadow.querySelector(".toggleBoomerang");t instanceof HTMLButtonElement&&(t.dataset.active=(s===I.Bounce).toString()),this._isBounce=s===I.Bounce;break}case"playOnClick":if(""===s||s){this._lottieInstance.autoplay=!1,this._container.addEventListener("click",this._handleClick);return}this._container.removeEventListener("click",this._handleClick);break;case"playOnVisible":(""===s||s)&&(this._lottieInstance.autoplay=!1);break;case"selector":{let t=document.getElementById(this.selector??"");t?.addEventListener("click",this._handleClick);break}case"speed":{let t=Number(s);t&&!isNaN(t)&&this.setSpeed(t);break}case"src":await this.load(s);break;case"subframe":this.setSubframe(""===s||!!s)}}connectedCallback(){super.connectedCallback();try{(async()=>{if(await this._render(),!this.shadow)throw Error("Missing Shadow element");this._container=this.shadow.querySelector(".animation"),await this.load(this.src),void 0!==document.hidden&&document.addEventListener("visibilitychange",this._onVisibilityChange),this._addIntersectionObserver(),this.dispatchEvent(new CustomEvent(F.Rendered))})()}catch(t){console.error(t),this.dispatchEvent(new CustomEvent(F.Error))}}convert(t){throw Error(nQ)}destroy(){this._lottieInstance?.destroy&&(this.playerState=nY.Destroyed,this._lottieInstance.destroy(),this._lottieInstance=null,this.dispatchEvent(new CustomEvent(F.Destroyed)),this.remove(),document.removeEventListener("visibilitychange",this._onVisibilityChange))}disconnectedCallback(){this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.destroy()}getLottie(){return this._lottieInstance}getManifest(){return this._manifest}getMultiAnimationSettings(){return this._multiAnimationSettings}getSegment(){return this._segment}async load(t){try{if(!this.shadowRoot||!t)return;this.source=t;let{animations:e,isDotLottie:s,manifest:i}=await nD(t);if(!e||e.some(t=>!["v","ip","op","layers","fr","w","h"].every(e=>Object.hasOwn(t,e))))throw Error("Broken or corrupted file");let r=this.parentElement?.querySelector('script[type="application/ld+json"]');if(r){let t=JSON.parse(r.innerHTML);t.selector&&(this.selector=t.selector),t.segment&&this.setSegment(t.segment),t.multiAnimationSettings&&this.setMultiAnimationSettings(t.multiAnimationSettings)}this._isBounce=this.mode===I.Bounce,this._multiAnimationSettings.length>0&&this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===I.Bounce);let a=i?.animations[0];a&&(a.autoplay=!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,a.loop=this.loop),this._isDotLottie=s,this._animations=e,this._manifest=i??{animations:[{autoplay:!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,direction:this.direction,id:g(),loop:this.loop,mode:this.mode,speed:this.speed}]},this._lottieInstance?.destroy(),this.playerState=nY.Stopped,!this.animateOnScroll&&(this.autoplay||this._multiAnimationSettings[this._currentAnimation]?.autoplay||this.playOnVisible)&&(this.playerState=nY.Playing),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:e[this._currentAnimation]}),this._addEventListeners();let n=this._multiAnimationSettings[this._currentAnimation]?.speed??this.speed,o=this._multiAnimationSettings[this._currentAnimation]?.direction??this.direction;if(this._lottieInstance.setSpeed(n),this._lottieInstance.setDirection(o),this._lottieInstance.setSubframe(!!this.subframe),(this.autoplay||this.animateOnScroll||this.playOnVisible)&&-1===this.direction&&this.seek("99%"),this._renderControls(),this.autoplay||this.playOnVisible){let t=this.shadow?.querySelector(".togglePlay");t&&(t.innerHTML=nX)}}catch(t){console.error(t),this._errorMessage=nZ(t).message,this.playerState=nY.Error,this.dispatchEvent(new CustomEvent(F.Error))}}loadAnimation(t){throw Error(nQ)}next(){this._currentAnimation++,this._switchInstance()}pause(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(F.Pause))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?nY.Error:nY.Paused}}play(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.play(),this.dispatchEvent(new CustomEvent(F.Play))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?nY.Error:nY.Playing}}prev(){this._currentAnimation--,this._switchInstance(!0)}propertyChangedCallback(t,e,s){if(!this.shadow)return;let i=this.shadow.querySelector(".togglePlay"),r=this.shadow.querySelector(".stop"),a=this.shadow.querySelector(".prev"),n=this.shadow.querySelector(".next"),o=this.shadow.querySelector(".seeker"),h=this.shadow.querySelector("progress"),l=this.shadow.querySelector(".popover"),p=this.shadow.querySelector(".convert"),c=this.shadow.querySelector(".snapshot");i instanceof HTMLButtonElement&&r instanceof HTMLButtonElement&&n instanceof HTMLButtonElement&&a instanceof HTMLButtonElement&&o instanceof HTMLInputElement&&h instanceof HTMLProgressElement&&("playerState"===t&&(i.dataset.active=(s===nY.Playing||s===nY.Paused).toString(),r.dataset.active=(s===nY.Stopped).toString(),s===nY.Playing?i.innerHTML=nX:i.innerHTML=nB),"_seeker"===t&&"number"==typeof s&&(o.value=s.toString(),o.ariaValueNow=s.toString(),h.value=s),"_animations"===t&&Array.isArray(s)&&this._currentAnimation+1<s.length&&(n.hidden=!1),"_currentAnimation"===t&&"number"==typeof s&&(n.hidden=s+1>=this._animations.length,a.hidden=!s),"_isSettingsOpen"===t&&"boolean"==typeof s&&l instanceof HTMLDivElement&&p instanceof HTMLButtonElement&&c instanceof HTMLButtonElement&&(l.hidden=!s,p.hidden=this.isLight,c.hidden=this.renderer!==$.SVG))}async reload(){this._lottieInstance&&this.src&&(this._lottieInstance.destroy(),await this.load(this.src))}seek(t){if(!this._lottieInstance)return;let e=t.toString().match(/^(\d+)(%?)$/);if(!e)return;let s=Math.round("%"===e[2]?this._lottieInstance.totalFrames*Number(e[1])/100:Number(e[1]));if(this._seeker=s,this.playerState===nY.Playing||this.playerState===nY.Frozen&&this._playerState.prev===nY.Playing){this._lottieInstance.goToAndPlay(s,!0),this.playerState=nY.Playing;return}this._lottieInstance.goToAndStop(s,!0),this._lottieInstance.pause()}setCount(t){this.count=t}setDirection(t){this._lottieInstance&&this._lottieInstance.setDirection(t)}setLoop(t){this._lottieInstance&&this._lottieInstance.setLoop(t)}setMultiAnimationSettings(t){this._multiAnimationSettings=t}setSegment(t){this._segment=t}setSpeed(t=1){this._lottieInstance&&this._lottieInstance.setSpeed(t)}setSubframe(t){this._lottieInstance&&this._lottieInstance.setSubframe(t)}snapshot(t=!0,e="AM Lottie"){try{var s,i;let r,a,n,o;if(!this.shadowRoot)throw Error("Unknown error");let h=this.shadowRoot.querySelector(".animation svg");if(!h)throw Error("Could not retrieve animation from DOM");let l=h instanceof Node?new XMLSerializer().serializeToString(h):null;if(!l)throw Error("Could not serialize SVG element");return t&&(i={mimeType:"image/svg+xml",name:`${s=this.src||e,(t=>{let e;if("string"==typeof t&&t&&((e=t?.split("/").pop()?.lastIndexOf("."))??0)>1&&t&&t.length-1>(e??0))return t.split(".").pop()?.toLowerCase()})(s),`${s.split("/").pop()?.replace(/\.[^.]*$/,"").replaceAll(/\W+/g,"-")}`}-${((this._seeker??0)+1).toString().padStart(3,"0")}.svg`},r=new Blob([l],{type:i?.mimeType}),a=i?.name||g(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=a,o.hidden=!0,document.body.appendChild(o),o.click(),setTimeout(()=>{o.remove(),URL.revokeObjectURL(n)},1e3)),l}catch(t){return console.error(t),null}}stop(){if(this._lottieInstance){this._playerState.prev=this.playerState,this._playerState.count=0;try{this._lottieInstance.stop(),this.dispatchEvent(new CustomEvent(F.Stop))}finally{this.playerState=nY.Stopped}}}toggleBoomerang(){let t=this._multiAnimationSettings[this._currentAnimation]??{};if(void 0!==t.mode){if(t.mode===I.Normal){t.mode=I.Bounce,this._isBounce=!0;return}t.mode=I.Normal,this._isBounce=!1;return}if(this.mode===I.Normal){this.mode=I.Bounce,this._isBounce=!0;return}this.mode=I.Normal,this._isBounce=!1}toggleLoop(){let t=!this.loop;this.loop=t,this.setLoop(t)}togglePlay(){if(!this._lottieInstance)return;let{currentFrame:t,playDirection:e,totalFrames:s}=this._lottieInstance;if(this.playerState===nY.Playing)return void this.pause();if(this.playerState!==nY.Completed)return void this.play();if(this.playerState=nY.Playing,this._isBounce){this.setDirection(-1*e),this._lottieInstance.goToAndPlay(t,!0);return}-1===e?this._lottieInstance.goToAndPlay(s,!0):this._lottieInstance.goToAndPlay(0,!0)}_freeze(){if(this._lottieInstance){this._playerState.prev=this.playerState;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(F.Freeze))}finally{this.playerState=nY.Frozen}}}_handleBlur(){setTimeout(()=>{this._toggleSettings(!1)},200)}_handleClick(){(this.playOnClick||this.selector)&&this.togglePlay()}_handleSeekChange({target:t}){!(!(t instanceof HTMLInputElement)||!this._lottieInstance||isNaN(Number(t.value)))&&this.seek(Math.round(Number(t.value)/100*this._lottieInstance.totalFrames))}_handleSettingsClick({target:t}){this._toggleSettings(),t instanceof HTMLElement&&t.focus()}setOptions(t){throw Error("Method not implemented")}_addEventListeners(){this._toggleEventListeners("add")}_addIntersectionObserver(){if(this._container&&!this._intersectionObserver){if(!("IntersectionObserver"in window)){this._intersectionObserverFallback(),removeEventListener("scroll",this._intersectionObserverFallback,!0),addEventListener("scroll",this._intersectionObserverFallback,{capture:!0,passive:!0});return}this._intersectionObserver=new IntersectionObserver(t=>{let{length:e}=t;for(let s=0;s<e;s++){if(!t[s]?.isIntersecting||document.hidden){this.playerState===nY.Playing&&this._freeze(),this._playerState.visible=!1;continue}this.animateOnScroll||this.playOnVisible||this.playerState!==nY.Frozen||this.play(),this.playOnVisible&&(this.playerState!==nY.Completed||this.once?setTimeout(()=>{this.play()},this.delay):(this.playerState=nY.Playing,this._lottieInstance?.goToAndPlay(1===this.direction?0:this._lottieInstance.totalFrames))),!this._playerState.scrollY&&(t[s]?.boundingClientRect.y||0)>0&&(this._playerState.scrollY=scrollY),this._playerState.visible=!0}}),this._intersectionObserver.observe(this._container)}}_complete(){if(!this._lottieInstance)return;if(this._animations.length>1){if(this._multiAnimationSettings[this._currentAnimation+1]?.autoplay)return void this.next();if(this.loop&&this._currentAnimation===this._animations.length-1){this._currentAnimation=0,this._switchInstance();return}}let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.playerState=nY.Completed,this.dispatchEvent(new CustomEvent(F.Complete,{detail:{frame:t,seeker:this._seeker}}))}_dataFailed(){this.playerState=nY.Error,this.dispatchEvent(new CustomEvent(F.Error))}_dataReady(){this.dispatchEvent(new CustomEvent(F.Load))}_DOMLoaded(){this._playerState.loaded=!0,this.dispatchEvent(new CustomEvent(F.Ready))}_enterFrame(){if(!this._lottieInstance)return;let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.dispatchEvent(new CustomEvent(F.Frame,{detail:{frame:t,seeker:this._seeker}}))}_getOptions(){if(!this._container)throw Error("Container not rendered");let t=this.preserveAspectRatio??(t=>{switch(t){case nW.Contain:case nW.ScaleDown:return L.Contain;case nW.Cover:return L.Cover;case nW.Fill:return L.Initial;case nW.None:return L.None;default:return L.Contain}})(this.objectfit),e=this._multiAnimationSettings.length>0?this._multiAnimationSettings[this._currentAnimation]:void 0,s=this._manifest?.animations[this._currentAnimation],i=!!this.loop;s?.loop!==void 0&&(i=!!s.loop),e?.loop!==void 0&&(i=!!e.loop);let r=!!this.autoplay;s?.autoplay!==void 0&&(r=!!s.autoplay),e?.autoplay!==void 0&&(r=!!e.autoplay),this.animateOnScroll&&(r=!1);let a=this._segment;return this._segment?.every(t=>t>0)&&(a=[this._segment[0]-1,this._segment[1]-1]),this._segment?.some(t=>t<0)&&(a=void 0),this.setOptions({container:this._container,hasAutoplay:r,hasLoop:i,initialSegment:a,preserveAspectRatio:t,rendererType:this.renderer})}_handleScroll(){if(!this.animateOnScroll||!this._lottieInstance)return;if(N)return void console.warn("DotLottie: Scroll animations might not work properly in a Server Side Rendering context. Try to wrap this in a client component.");if(!this._playerState.visible)return;this._playerState.scrollTimeout&&clearTimeout(this._playerState.scrollTimeout),this._playerState.scrollTimeout=setTimeout(()=>{this.playerState=nY.Paused},400);let{totalFrames:t}=this._lottieInstance,e=scrollY-this._playerState.scrollY;scrollY<=this._playerState.scrollY&&(e=this._playerState.scrollY-scrollY);let s=((t,e=0,s=100)=>{let i=e,r=s;if(i>r){let t=r;r=i,i=t}return Math.min(Math.max(t,i),r)})(e/innerHeight*(t-1),0,t);requestAnimationFrame(()=>{if(s>=t){this.playerState=nY.Paused;return}this.playerState=nY.Playing,this._lottieInstance?.goToAndStop(s,!0)})}_handleWindowBlur({type:t}){this.dontFreezeOnBlur||(this.playerState===nY.Playing&&"blur"===t&&this._freeze(),this.playerState===nY.Frozen&&"focus"===t&&this.play())}_intersectionObserverFallback(){if(!this._container)return;let{bottom:t,left:e,right:s,top:i}=this._container.getBoundingClientRect();this._playerState.visible=i>=0&&e>=0&&t<=innerHeight&&s<=innerWidth,(this.autoplay||this.playOnVisible||this.playerState===nY.Playing||this.playerState===nY.Frozen)&&(this._playerState.visible?this.play():this._freeze())}_loopComplete(){if(!this._lottieInstance)return;let{playDirection:t,totalFrames:e}=this._lottieInstance,s=this._segment?this._segment[0]:0,i=this._segment?this._segment[0]:e;if(this.count&&(this._isBounce?this._playerState.count+=.5:this._playerState.count+=1,this._playerState.count>=this.count)){this.setLoop(!1),this.playerState=nY.Completed,this.dispatchEvent(new CustomEvent(F.Complete));return}return(this.dispatchEvent(new CustomEvent(F.Loop)),this._isBounce)?(this._lottieInstance.goToAndStop(-1===t?s:.99*i,!0),this._lottieInstance.setDirection(-1*t),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission)):(this._lottieInstance.goToAndStop(-1===t?.99*i:s,!0),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission))}_mouseEnter(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window)){if(this.mouseout===nH.Reverse&&this._lottieInstance.setDirection(1),this.playerState===nY.Completed){this._lottieInstance.goToAndPlay(0,!0),this.playerState=nY.Playing;return}this.playerState!==nY.Playing&&this.play()}}_mouseLeave(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window))switch(this.mouseout){case nH.Void:break;case nH.Pause:this.pause();break;case nH.Reverse:this._lottieInstance.setDirection(-1),this.play();break;default:this.stop()}}_onVisibilityChange(){document.hidden&&this.playerState===nY.Playing?this._freeze():this.playerState===nY.Frozen&&this.play()}_removeEventListeners(){this._toggleEventListeners("remove")}_switchInstance(t=!1){if(this._animations[this._currentAnimation])try{if(this._lottieInstance&&this._lottieInstance.destroy(),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:this._animations[this._currentAnimation]}),this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===I.Bounce),this._removeEventListeners(),this._addEventListeners(),this.dispatchEvent(new CustomEvent(t?F.Previous:F.Next)),this._multiAnimationSettings[this._currentAnimation]?.autoplay??this.autoplay){if(this.animateOnScroll){this._lottieInstance.goToAndStop(0,!0),this.playerState=nY.Paused;return}this._lottieInstance.goToAndPlay(0,!0),this.playerState=nY.Playing;return}this._lottieInstance.goToAndStop(0,!0),this.playerState=nY.Stopped}catch(t){this._errorMessage=nZ(t).message,this.playerState=nY.Error,this.dispatchEvent(new CustomEvent(F.Error))}}_toggleEventListeners(t){let e="add"===t?"addEventListener":"removeEventListener";if(this._lottieInstance&&(this._lottieInstance[e]("enterFrame",this._enterFrame),this._lottieInstance[e]("complete",this._complete),this._lottieInstance[e]("loopComplete",this._loopComplete),this._lottieInstance[e]("DOMLoaded",this._DOMLoaded),this._lottieInstance[e]("data_ready",this._dataReady),this._lottieInstance[e]("data_failed",this._dataFailed)),this.selector){let t=document.getElementById(this.selector);t?this.hover?(t[e]("mouseenter",this._mouseEnter),t[e]("mouseleave",this._mouseLeave)):t[e]("click",this._handleClick):this.selector=null}this._container&&!this.selector&&(this.hover&&(this._container[e]("mouseenter",this._mouseEnter),this._container[e]("mouseleave",this._mouseLeave)),this.playOnClick&&this._container[e]("click",this._handleClick)),window[e]("focus",this._handleWindowBlur,{capture:!1,passive:!0}),window[e]("blur",this._handleWindowBlur,{capture:!1,passive:!0}),this.animateOnScroll&&window[e]("scroll",this._handleScroll,{capture:!0,passive:!0})}_toggleSettings(t){if(void 0===t){this._isSettingsOpen=!this._isSettingsOpen;return}this._isSettingsOpen=t}}class n1 extends n0{setOptions({container:t,hasAutoplay:e,hasLoop:s,initialSegment:i,preserveAspectRatio:r,rendererType:a}){let n={autoplay:e,container:t,initialSegment:i,loop:s,renderer:a,rendererSettings:{imagePreserveAspectRatio:r}};switch(this.renderer){case $.HTML:case $.SVG:n.rendererSettings={...n.rendererSettings,hideOnTransparent:!0,preserveAspectRatio:r,progressiveLoad:!0};break;case $.Canvas:n.rendererSettings={...n.rendererSettings,clearCanvas:!0,preserveAspectRatio:r,progressiveLoad:!0}}return n}constructor(...t){super(...t),this.addAnimation=nI,this.convert=nF,this.loadAnimation=r9}}globalThis.dotLottiePlayer=()=>new n1,N||customElements.define(nU,n1),t.MouseOut=nH,t.PlayMode=I,t.PlayerEvents=F,t.PlayerState=nY,t.default=n1,t.tagName=nU,Object.defineProperty(t,"__esModule",{value:!0})}(this["@aarsteinmedia/dotlottie-player"]=this["@aarsteinmedia/dotlottie-player"]||{});
@@ -65,4 +65,4 @@
65
65
  d="M14.016 5.016H18v13.969h-3.984V5.016zM6 18.984V5.015h3.984v13.969H6z"
66
66
  />
67
67
  </svg>
68
- `;async function ah(){if(!this.shadow||!this.template)throw Error("No Shadow Element or Template");this.template.innerHTML=`<div class="animation-container main" data-controls="${this.controls??!1}" lang="${this.description?document.documentElement.lang:"en"}" aria-label="${this.description??"Lottie animation"}" data-loaded="${this._playerState.loaded}"><figure class="animation" style="background:${this.background}">${this.playerState===ar.Error?`<div class="error"><svg preserveAspectRatio="${F.Cover}" xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080" style="white-space:preserve"><path fill="#fff" d="M0 0h1920v1080H0z"/><path fill="#3a6d8b" d="M1190.2 531 1007 212.4c-22-38.2-77.2-38-98.8.5L729.5 531.3c-21.3 37.9 6.1 84.6 49.5 84.6l361.9.3c43.7 0 71.1-47.3 49.3-85.2zM937.3 288.7c.2-7.5 3.3-23.9 23.2-23.9 16.3 0 23 16.1 23 23.5 0 55.3-10.7 197.2-12.2 214.5-.1 1-.9 1.7-1.9 1.7h-18.3c-1 0-1.8-.7-1.9-1.7-1.4-17.5-13.4-162.9-11.9-214.1zm24.2 283.8c-13.1 0-23.7-10.6-23.7-23.7s10.6-23.7 23.7-23.7 23.7 10.6 23.7 23.7-10.6 23.7-23.7 23.7zM722.1 644h112.6v34.4h-70.4V698h58.8v31.7h-58.8v22.6h72.4v36.2H722.1V644zm162 57.1h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6zm78.9 0h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5H963v15.6zm39.5 36.2c0-31.3 22.2-54.8 56.6-54.8 34.4 0 56.2 23.5 56.2 54.8s-21.8 54.6-56.2 54.6c-34.4-.1-56.6-23.3-56.6-54.6zm74 0c0-17.4-6.1-29.1-17.8-29.1-11.7 0-17.4 11.7-17.4 29.1 0 17.4 5.7 29.1 17.4 29.1s17.8-11.8 17.8-29.1zm83.1-36.2h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6z"/><path fill="none" d="M718.9 807.7h645v285.4h-645z"/><text fill="#3a6d8b" style="text-align:center;position:absolute;left:100%;font-size:47px;font-family:system-ui,-apple-system,BlinkMacSystemFont,'.SFNSText-Regular',sans-serif" x="50%" y="848.017" text-anchor="middle">${this._errorMessage}</text></svg></div>`:""}</figure><slot name="controls"></slot></div>`,this.shadow.adoptedStyleSheets=[await am.styles()],this.shadow.appendChild(this.template.content.cloneNode(!0))}let al=t=>{let e={message:"Unknown error",status:N?500:400};return t&&"object"==typeof t&&("message"in t&&"string"==typeof t.message&&(e.message=t.message),"status"in t&&(e.status=Number(t.status))),e},ap="Method is not implemented";class am extends r2{static get observedAttributes(){return["animateOnScroll","autoplay","controls","direction","hover","loop","mode","playOnClick","playOnVisible","selector","speed","src","subframe"]}static get observedProperties(){return["playerState","_isSettingsOpen","_seeker","_currentAnimation","_animations"]}static get styles(){return async()=>{let t=new CSSStyleSheet;return await t.replace("* {\n box-sizing: border-box;\n}\n\n:host {\n --lottie-player-toolbar-height: 35px;\n --lottie-player-toolbar-background-color: #fff;\n --lottie-player-toolbar-icon-color: #000;\n --lottie-player-toolbar-icon-hover-color: #000;\n --lottie-player-toolbar-icon-active-color: #4285f4;\n --lottie-player-seeker-track-color: rgb(0 0 0 / 20%);\n --lottie-player-seeker-thumb-color: #4285f4;\n --lottie-player-seeker-display: block;\n\n width: 100%;\n height: 100%;\n\n &:not([hidden]) {\n display: block;\n }\n\n .main {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n\n .animation {\n width: 100%;\n height: 100%;\n display: flex;\n margin: 0;\n padding: 0;\n }\n\n [data-controls='true'] .animation {\n height: calc(100% - 35px);\n }\n\n .animation-container {\n position: relative;\n }\n\n .popover {\n position: absolute;\n right: 5px;\n bottom: 40px;\n background-color: var(--lottie-player-toolbar-background-color);\n border-radius: 5px;\n padding: 10px 15px;\n border: solid 2px var(--lottie-player-toolbar-icon-color);\n animation: fade-in 0.2s ease-in-out;\n\n &::before {\n content: '';\n right: 10px;\n border: 7px solid transparent;\n margin-right: -7px;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n top: 100%;\n border-top-color: var(--lottie-player-toolbar-icon-color);\n }\n }\n\n .error {\n display: flex;\n margin: auto;\n justify-content: center;\n height: 100%;\n align-items: center;\n\n & svg {\n width: 100%;\n height: auto;\n }\n }\n\n .toolbar {\n display: flex;\n place-items: center center;\n background: var(--lottie-player-toolbar-background-color);\n margin: 0;\n height: 35px;\n padding: 5px;\n border-radius: 5px;\n gap: 5px;\n\n &.has-error {\n pointer-events: none;\n opacity: 0.5;\n }\n\n & button {\n cursor: pointer;\n fill: var(--lottie-player-toolbar-icon-color);\n color: var(--lottie-player-toolbar-icon-color);\n background: none;\n border: 0;\n padding: 0;\n outline: 0;\n height: 100%;\n margin: 0;\n align-items: center;\n gap: 5px;\n opacity: 0.9;\n\n &:not([hidden]) {\n display: flex;\n }\n\n &:hover {\n opacity: 1;\n }\n\n &[data-active='true'] {\n opacity: 1;\n fill: var(--lottie-player-toolbar-icon-active-color);\n }\n\n &:disabled {\n opacity: 0.5;\n }\n\n &:focus {\n outline: 0;\n }\n\n & svg {\n pointer-events: none;\n\n & > * {\n fill: inherit;\n }\n }\n\n &.disabled svg {\n display: none;\n }\n }\n }\n\n .progress-container {\n position: relative;\n width: 100%;\n\n &.simple {\n margin-right: 12px;\n }\n }\n\n .seeker {\n appearance: none;\n outline: none;\n width: 100%;\n height: 20px;\n border-radius: 3px;\n border: 0;\n cursor: pointer;\n background-color: transparent;\n\n display: var(--lottie-player-seeker-display);\n color: var(--lottie-player-seeker-thumb-color);\n margin: 0;\n padding: 7.5px 0;\n position: relative;\n z-index: 1;\n\n &::-webkit-slider-runnable-track,\n &::-webkit-slider-thumb {\n appearance: none;\n outline: none;\n }\n\n &::-webkit-slider-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n border: 0;\n background-color: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -webkit-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-webkit-slider-thumb,\n &:focus::-webkit-slider-thumb {\n transform: scale(1);\n }\n\n &::-moz-range-progress {\n background-color: var(--lottie-player-seeker-thumb-color);\n height: 5px;\n border-radius: 3px;\n }\n\n &::-moz-range-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: var(--lottie-player-seeker-thumb-color);\n border: 0;\n cursor: pointer;\n -moz-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-moz-range-thumb,\n &:focus::-moz-range-thumb {\n transform: scale(1);\n }\n\n &::-ms-track {\n width: 100%;\n height: 5px;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n border-radius: 3px;\n }\n\n &::-ms-fill-lower {\n background-color: var(--lottie-player-seeker-thumb-color);\n border-radius: 3px;\n }\n\n &::-ms-thumb {\n border: 0;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -ms-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-ms-thumb {\n transform: scale(1);\n }\n\n &:focus {\n &::-ms-thumb {\n transform: scale(1);\n }\n\n &::-ms-fill-lower,\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n }\n }\n }\n\n & progress {\n appearance: none;\n outline: none;\n position: absolute;\n width: 100%;\n height: 5px;\n border-radius: 3px;\n border: 0;\n top: 0;\n left: 0;\n margin: 7.5px 0;\n background-color: var(--lottie-player-seeker-track-color);\n pointer-events: none;\n\n &::-webkit-progress-inner-element {\n border-radius: 3px;\n overflow: hidden;\n }\n\n &::-webkit-slider-runnable-track {\n background-color: transparent;\n }\n\n &::-webkit-progress-value {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n }\n\n & *::-moz-progress-bar {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n}\n\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --lottie-player-toolbar-background-color: #000;\n --lottie-player-toolbar-icon-color: #fff;\n --lottie-player-toolbar-icon-hover-color: #fff;\n --lottie-player-seeker-track-color: rgb(255 255 255 / 60%);\n }\n}\n"),t}}set animateOnScroll(t){this.setAttribute("animateOnScroll",(!!t).toString())}get animateOnScroll(){let t=this.getAttribute("animateOnScroll");return"true"===t||""===t||"1"===t}get animations(){return this._animations}set autoplay(t){this.setAttribute("autoplay",(!!t).toString())}get autoplay(){let t=this.getAttribute("autoplay");return"true"===t||""===t||"1"===t}set background(t){this.setAttribute("background",t)}get background(){return this.getAttribute("background")||"transparent"}set controls(t){this.setAttribute("controls",(!!t).toString())}get controls(){let t=this.getAttribute("controls");return"true"===t||""===t||"1"===t}set count(t){this.setAttribute("count",t.toString())}get count(){let t=this.getAttribute("count");return t?Number(t):0}get currentAnimation(){return this._currentAnimation}set delay(t){this.setAttribute("delay",t.toString())}get delay(){let t=this.getAttribute("delay");return t?Number(t):0}set description(t){t&&this.setAttribute("description",t)}get description(){return this.getAttribute("description")}set direction(t){this.setAttribute("direction",t.toString())}get direction(){let t=Number(this.getAttribute("direction"));return -1===t?t:1}set dontFreezeOnBlur(t){this.setAttribute("dontFreezeOnBlur",t.toString())}get dontFreezeOnBlur(){let t=this.getAttribute("dontFreezeOnBlur");return"true"===t||""===t||"1"===t}set hover(t){this.setAttribute("hover",t.toString())}get hover(){let t=this.getAttribute("hover");return"true"===t||""===t||"1"===t}set intermission(t){this.setAttribute("intermission",t.toString())}get intermission(){let t=Number(this.getAttribute("intermission"));return isNaN(t)?0:t}get isDotLottie(){return this._isDotLottie}set loop(t){this.setAttribute("loop",(!!t).toString())}get loop(){let t=this.getAttribute("loop");return"true"===t||""===t||"1"===t}set mode(t){this.setAttribute("mode",t)}get mode(){let t=this.getAttribute("mode");return t===I.Bounce?t:I.Normal}set mouseout(t){this.setAttribute("mouseout",t)}get mouseout(){let t=this.getAttribute("mouseout");switch(t){case ai.Void:case ai.Pause:case ai.Reverse:return t;default:return ai.Stop}}set objectfit(t){this.setAttribute("objectfit",t)}get objectfit(){let t=this.getAttribute("objectfit");return t&&Object.values(as).includes(t)?t:as.Contain}set once(t){this.setAttribute("once",(!!t).toString())}get once(){let t=this.getAttribute("once");return"true"===t||""===t||"1"===t}set playOnClick(t){this.setAttribute("playOnClick",(!!t).toString())}get playOnClick(){let t=this.getAttribute("playOnClick");return"true"===t||""===t||"1"===t}set playOnVisible(t){this.setAttribute("playOnVisible",(!!t).toString())}get playOnVisible(){let t=this.getAttribute("playOnVisible");return"true"===t||""===t||"1"===t}set preserveAspectRatio(t){this.setAttribute("preserveAspectRatio",t||F.Contain)}get preserveAspectRatio(){let t=this.getAttribute("preserveAspectRatio");return t&&Object.values(F).includes(t)?t:null}set renderer(t){this.setAttribute("renderer",t)}get renderer(){let t=this.getAttribute("renderer");return t===$.Canvas||t===$.HTML?t:$.SVG}set selector(t){t?this.setAttribute("selector",t):this.removeAttribute("selector")}get selector(){return this.getAttribute("selector")}set simple(t){this.setAttribute("simple",(!!t).toString())}get simple(){let t=this.getAttribute("simple");return"true"===t||""===t||"1"===t}set speed(t){this.setAttribute("speed",t.toString())}get speed(){let t=this.getAttribute("speed");return null===t||isNaN(Number(t))?1:Number(t)}set src(t){this.setAttribute("src",t||"")}get src(){return this.getAttribute("src")}set subframe(t){this.setAttribute("subframe",(!!t).toString())}get subframe(){let t=this.getAttribute("subframe");return"true"===t||""===t||"1"===t}constructor(){super(),this.isLight=!1,this.playerState=ar.Loading,this._container=null,this._errorMessage="Something went wrong",this._identifier=this.id||g(),this._isSettingsOpen=!1,this._playerState={count:0,loaded:!1,prev:ar.Loading,scrollTimeout:null,scrollY:0,visible:!1},this._render=ah,this._renderControls=an,this._seeker=0,this._animations=[],this._currentAnimation=0,this._isBounce=!1,this._isDotLottie=!1,this._lottieInstance=null,this._multiAnimationSettings=[],this._complete=this._complete.bind(this),this._dataFailed=this._dataFailed.bind(this),this._dataReady=this._dataReady.bind(this),this._DOMLoaded=this._DOMLoaded.bind(this),this._enterFrame=this._enterFrame.bind(this),this._freeze=this._freeze.bind(this),this._handleBlur=this._handleBlur.bind(this),this._handleClick=this._handleClick.bind(this),this._handleScroll=this._handleScroll.bind(this),this._handleSeekChange=this._handleSeekChange.bind(this),this._handleWindowBlur=this._handleWindowBlur.bind(this),this._loopComplete=this._loopComplete.bind(this),this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._switchInstance=this._switchInstance.bind(this),this._handleSettingsClick=this._handleSettingsClick.bind(this),this.togglePlay=this.togglePlay.bind(this),this.stop=this.stop.bind(this),this.prev=this.prev.bind(this),this.next=this.next.bind(this),this._renderControls=this._renderControls.bind(this),this.snapshot=this.snapshot.bind(this),this.toggleLoop=this.toggleLoop.bind(this),this.toggleBoomerang=this.toggleBoomerang.bind(this),this.destroy=this.destroy.bind(this),this.template=document.createElement("template"),this.shadow=this.attachShadow({mode:"open"})}addAnimation(t){throw Error(ap)}async attributeChangedCallback(t,e,s){if(this._lottieInstance&&this.shadow&&this._container)switch(t){case"animateOnScroll":if(""===s||s){this._lottieInstance.autoplay=!1,addEventListener("scroll",this._handleScroll,{capture:!0,passive:!0});return}removeEventListener("scroll",this._handleScroll,!0);break;case"autoplay":if(this.animateOnScroll||this.playOnVisible)return;if(""===s||s)return void this.play();this.stop();break;case"controls":this._renderControls();break;case"direction":if(-1===Number(s))return void this.setDirection(-1);this.setDirection(1);break;case"hover":if(""===s||s){this._container.addEventListener("mouseenter",this._mouseEnter),this._container.addEventListener("mouseleave",this._mouseLeave);return}this._container.removeEventListener("mouseenter",this._mouseEnter),this._container.removeEventListener("mouseleave",this._mouseLeave);break;case"loop":{let t=this.shadow.querySelector(".toggleLoop");t instanceof HTMLButtonElement&&(t.dataset.active=s),this.setLoop(""===s||!!s);break}case"mode":{let t=this.shadow.querySelector(".toggleBoomerang");t instanceof HTMLButtonElement&&(t.dataset.active=(s===I.Bounce).toString()),this._isBounce=s===I.Bounce;break}case"playOnClick":if(""===s||s){this._lottieInstance.autoplay=!1,this._container.addEventListener("click",this._handleClick);return}this._container.removeEventListener("click",this._handleClick);break;case"playOnVisible":(""===s||s)&&(this._lottieInstance.autoplay=!1);break;case"selector":{let t=document.getElementById(this.selector??"");t?.addEventListener("click",this._handleClick);break}case"speed":{let t=Number(s);t&&!isNaN(t)&&this.setSpeed(t);break}case"src":await this.load(s);break;case"subframe":this.setSubframe(""===s||!!s)}}connectedCallback(){super.connectedCallback();try{(async()=>{if(await this._render(),!this.shadow)throw Error("Missing Shadow element");this._container=this.shadow.querySelector(".animation"),await this.load(this.src),void 0!==document.hidden&&document.addEventListener("visibilitychange",this._onVisibilityChange),this._addIntersectionObserver(),this.dispatchEvent(new CustomEvent(L.Rendered))})()}catch(t){console.error(t),this.dispatchEvent(new CustomEvent(L.Error))}}convert(t){throw Error(ap)}destroy(){this._lottieInstance?.destroy&&(this.playerState=ar.Destroyed,this._lottieInstance.destroy(),this._lottieInstance=null,this.dispatchEvent(new CustomEvent(L.Destroyed)),this.remove(),document.removeEventListener("visibilitychange",this._onVisibilityChange))}disconnectedCallback(){this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.destroy()}getLottie(){return this._lottieInstance}getManifest(){return this._manifest}getMultiAnimationSettings(){return this._multiAnimationSettings}getSegment(){return this._segment}async load(t){try{if(!this.shadowRoot||!t)return;this.source=t;let{animations:e,isDotLottie:s,manifest:i}=await rQ(t);if(!e||e.some(t=>!["v","ip","op","layers","fr","w","h"].every(e=>Object.hasOwn(t,e))))throw Error("Broken or corrupted file");let r=this.parentElement?.querySelector('script[type="application/ld+json"]');if(r){let t=JSON.parse(r.innerHTML);t.selector&&(this.selector=t.selector),t.segment&&this.setSegment(t.segment),t.multiAnimationSettings&&this.setMultiAnimationSettings(t.multiAnimationSettings)}this._isBounce=this.mode===I.Bounce,this._multiAnimationSettings.length>0&&this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===I.Bounce);let a=i?.animations[0];a&&(a.autoplay=!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,a.loop=this.loop),this._isDotLottie=s,this._animations=e,this._manifest=i??{animations:[{autoplay:!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,direction:this.direction,id:g(),loop:this.loop,mode:this.mode,speed:this.speed}]},this._lottieInstance?.destroy(),this.playerState=ar.Stopped,!this.animateOnScroll&&(this.autoplay||this._multiAnimationSettings[this._currentAnimation]?.autoplay||this.playOnVisible)&&(this.playerState=ar.Playing),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:e[this._currentAnimation]}),this._addEventListeners();let n=this._multiAnimationSettings[this._currentAnimation]?.speed??this.speed,o=this._multiAnimationSettings[this._currentAnimation]?.direction??this.direction;if(this._lottieInstance.setSpeed(n),this._lottieInstance.setDirection(o),this._lottieInstance.setSubframe(!!this.subframe),(this.autoplay||this.animateOnScroll||this.playOnVisible)&&-1===this.direction&&this.seek("99%"),this._renderControls(),this.autoplay||this.playOnVisible){let t=this.shadow?.querySelector(".togglePlay");t&&(t.innerHTML=ao)}}catch(t){console.error(t),this._errorMessage=al(t).message,this.playerState=ar.Error,this.dispatchEvent(new CustomEvent(L.Error))}}loadAnimation(t){throw Error(ap)}next(){this._currentAnimation++,this._switchInstance()}pause(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(L.Pause))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?ar.Error:ar.Paused}}play(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.play(),this.dispatchEvent(new CustomEvent(L.Play))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?ar.Error:ar.Playing}}prev(){this._currentAnimation--,this._switchInstance(!0)}propertyChangedCallback(t,e,s){if(!this.shadow)return;let i=this.shadow.querySelector(".togglePlay"),r=this.shadow.querySelector(".stop"),a=this.shadow.querySelector(".prev"),n=this.shadow.querySelector(".next"),o=this.shadow.querySelector(".seeker"),h=this.shadow.querySelector("progress"),l=this.shadow.querySelector(".popover"),p=this.shadow.querySelector(".convert"),m=this.shadow.querySelector(".snapshot");i instanceof HTMLButtonElement&&r instanceof HTMLButtonElement&&n instanceof HTMLButtonElement&&a instanceof HTMLButtonElement&&o instanceof HTMLInputElement&&h instanceof HTMLProgressElement&&("playerState"===t&&(i.dataset.active=(s===ar.Playing||s===ar.Paused).toString(),r.dataset.active=(s===ar.Stopped).toString(),s===ar.Playing?i.innerHTML=ao:i.innerHTML=r9),"_seeker"===t&&"number"==typeof s&&(o.value=s.toString(),o.ariaValueNow=s.toString(),h.value=s),"_animations"===t&&Array.isArray(s)&&this._currentAnimation+1<s.length&&(n.hidden=!1),"_currentAnimation"===t&&"number"==typeof s&&(n.hidden=s+1>=this._animations.length,a.hidden=!s),"_isSettingsOpen"===t&&"boolean"==typeof s&&l instanceof HTMLDivElement&&p instanceof HTMLButtonElement&&m instanceof HTMLButtonElement&&(l.hidden=!s,p.hidden=this.isLight,m.hidden=this.renderer!==$.SVG))}async reload(){this._lottieInstance&&this.src&&(this._lottieInstance.destroy(),await this.load(this.src))}seek(t){if(!this._lottieInstance)return;let e=t.toString().match(/^(\d+)(%?)$/);if(!e)return;let s=Math.round("%"===e[2]?this._lottieInstance.totalFrames*Number(e[1])/100:Number(e[1]));if(this._seeker=s,this.playerState===ar.Playing||this.playerState===ar.Frozen&&this._playerState.prev===ar.Playing){this._lottieInstance.goToAndPlay(s,!0),this.playerState=ar.Playing;return}this._lottieInstance.goToAndStop(s,!0),this._lottieInstance.pause()}setCount(t){this.count=t}setDirection(t){this._lottieInstance&&this._lottieInstance.setDirection(t)}setLoop(t){this._lottieInstance&&this._lottieInstance.setLoop(t)}setMultiAnimationSettings(t){this._multiAnimationSettings=t}setSegment(t){this._segment=t}setSpeed(t=1){this._lottieInstance&&this._lottieInstance.setSpeed(t)}setSubframe(t){this._lottieInstance&&this._lottieInstance.setSubframe(t)}snapshot(t=!0,e="AM Lottie"){try{var s,i;let r,a,n,o;if(!this.shadowRoot)throw Error("Unknown error");let h=this.shadowRoot.querySelector(".animation svg");if(!h)throw Error("Could not retrieve animation from DOM");let l=h instanceof Node?new XMLSerializer().serializeToString(h):null;if(!l)throw Error("Could not serialize SVG element");return t&&(i={mimeType:"image/svg+xml",name:`${s=this.src||e,(t=>{let e;if("string"==typeof t&&t&&((e=t?.split("/").pop()?.lastIndexOf("."))??0)>1&&t&&t.length-1>(e??0))return t.split(".").pop()?.toLowerCase()})(s),`${s.split("/").pop()?.replace(/\.[^.]*$/,"").replaceAll(/\W+/g,"-")}`}-${((this._seeker??0)+1).toString().padStart(3,"0")}.svg`},r=new Blob([l],{type:i?.mimeType}),a=i?.name||g(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=a,o.hidden=!0,document.body.appendChild(o),o.click(),setTimeout(()=>{o.remove(),URL.revokeObjectURL(n)},1e3)),l}catch(t){return console.error(t),null}}stop(){if(this._lottieInstance){this._playerState.prev=this.playerState,this._playerState.count=0;try{this._lottieInstance.stop(),this.dispatchEvent(new CustomEvent(L.Stop))}finally{this.playerState=ar.Stopped}}}toggleBoomerang(){let t=this._multiAnimationSettings[this._currentAnimation]??{};if(void 0!==t.mode){if(t.mode===I.Normal){t.mode=I.Bounce,this._isBounce=!0;return}t.mode=I.Normal,this._isBounce=!1;return}if(this.mode===I.Normal){this.mode=I.Bounce,this._isBounce=!0;return}this.mode=I.Normal,this._isBounce=!1}toggleLoop(){let t=!this.loop;this.loop=t,this.setLoop(t)}togglePlay(){if(!this._lottieInstance)return;let{currentFrame:t,playDirection:e,totalFrames:s}=this._lottieInstance;if(this.playerState===ar.Playing)return void this.pause();if(this.playerState!==ar.Completed)return void this.play();if(this.playerState=ar.Playing,this._isBounce){this.setDirection(-1*e),this._lottieInstance.goToAndPlay(t,!0);return}-1===e?this._lottieInstance.goToAndPlay(s,!0):this._lottieInstance.goToAndPlay(0,!0)}_freeze(){if(this._lottieInstance){this._playerState.prev=this.playerState;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(L.Freeze))}finally{this.playerState=ar.Frozen}}}_handleBlur(){setTimeout(()=>{this._toggleSettings(!1)},200)}_handleClick(){(this.playOnClick||this.selector)&&this.togglePlay()}_handleSeekChange({target:t}){!(!(t instanceof HTMLInputElement)||!this._lottieInstance||isNaN(Number(t.value)))&&this.seek(Math.round(Number(t.value)/100*this._lottieInstance.totalFrames))}_handleSettingsClick({target:t}){this._toggleSettings(),t instanceof HTMLElement&&t.focus()}setOptions(t){throw Error("Method not implemented")}_addEventListeners(){this._toggleEventListeners("add")}_addIntersectionObserver(){if(this._container&&!this._intersectionObserver){if(!("IntersectionObserver"in window)){this._intersectionObserverFallback(),removeEventListener("scroll",this._intersectionObserverFallback,!0),addEventListener("scroll",this._intersectionObserverFallback,{capture:!0,passive:!0});return}this._intersectionObserver=new IntersectionObserver(t=>{let{length:e}=t;for(let s=0;s<e;s++){if(!t[s]?.isIntersecting||document.hidden){this.playerState===ar.Playing&&this._freeze(),this._playerState.visible=!1;continue}this.animateOnScroll||this.playOnVisible||this.playerState!==ar.Frozen||this.play(),this.playOnVisible&&(this.playerState!==ar.Completed||this.once?setTimeout(()=>{this.play()},this.delay):(this.playerState=ar.Playing,this._lottieInstance?.goToAndPlay(1===this.direction?0:this._lottieInstance.totalFrames))),!this._playerState.scrollY&&(t[s]?.boundingClientRect.y||0)>0&&(this._playerState.scrollY=scrollY),this._playerState.visible=!0}}),this._intersectionObserver.observe(this._container)}}_complete(){if(!this._lottieInstance)return;if(this._animations.length>1){if(this._multiAnimationSettings[this._currentAnimation+1]?.autoplay)return void this.next();if(this.loop&&this._currentAnimation===this._animations.length-1){this._currentAnimation=0,this._switchInstance();return}}let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.playerState=ar.Completed,this.dispatchEvent(new CustomEvent(L.Complete,{detail:{frame:t,seeker:this._seeker}}))}_dataFailed(){this.playerState=ar.Error,this.dispatchEvent(new CustomEvent(L.Error))}_dataReady(){this.dispatchEvent(new CustomEvent(L.Load))}_DOMLoaded(){this._playerState.loaded=!0,this.dispatchEvent(new CustomEvent(L.Ready))}_enterFrame(){if(!this._lottieInstance)return;let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.dispatchEvent(new CustomEvent(L.Frame,{detail:{frame:t,seeker:this._seeker}}))}_getOptions(){if(!this._container)throw Error("Container not rendered");let t=this.preserveAspectRatio??(t=>{switch(t){case as.Contain:case as.ScaleDown:return F.Contain;case as.Cover:return F.Cover;case as.Fill:return F.Initial;case as.None:return F.None;default:return F.Contain}})(this.objectfit),e=this._multiAnimationSettings.length>0?this._multiAnimationSettings[this._currentAnimation]:void 0,s=this._manifest?.animations[this._currentAnimation],i=!!this.loop;s?.loop!==void 0&&(i=!!s.loop),e?.loop!==void 0&&(i=!!e.loop);let r=!!this.autoplay;s?.autoplay!==void 0&&(r=!!s.autoplay),e?.autoplay!==void 0&&(r=!!e.autoplay),this.animateOnScroll&&(r=!1);let a=this._segment;return this._segment?.every(t=>t>0)&&(a=[this._segment[0]-1,this._segment[1]-1]),this._segment?.some(t=>t<0)&&(a=void 0),this.setOptions({container:this._container,hasAutoplay:r,hasLoop:i,initialSegment:a,preserveAspectRatio:t,rendererType:this.renderer})}_handleScroll(){if(!this.animateOnScroll||!this._lottieInstance)return;if(N)return void console.warn("DotLottie: Scroll animations might not work properly in a Server Side Rendering context. Try to wrap this in a client component.");if(!this._playerState.visible)return;this._playerState.scrollTimeout&&clearTimeout(this._playerState.scrollTimeout),this._playerState.scrollTimeout=setTimeout(()=>{this.playerState=ar.Paused},400);let{totalFrames:t}=this._lottieInstance,e=scrollY-this._playerState.scrollY;scrollY<=this._playerState.scrollY&&(e=this._playerState.scrollY-scrollY);let s=((t,e=0,s=100)=>{let i=e,r=s;if(i>r){let t=r;r=i,i=t}return Math.min(Math.max(t,i),r)})(e/innerHeight*(t-1),0,t);requestAnimationFrame(()=>{if(s>=t){this.playerState=ar.Paused;return}this.playerState=ar.Playing,this._lottieInstance?.goToAndStop(s,!0)})}_handleWindowBlur({type:t}){this.dontFreezeOnBlur||(this.playerState===ar.Playing&&"blur"===t&&this._freeze(),this.playerState===ar.Frozen&&"focus"===t&&this.play())}_intersectionObserverFallback(){if(!this._container)return;let{bottom:t,left:e,right:s,top:i}=this._container.getBoundingClientRect();this._playerState.visible=i>=0&&e>=0&&t<=innerHeight&&s<=innerWidth,(this.autoplay||this.playOnVisible||this.playerState===ar.Playing||this.playerState===ar.Frozen)&&(this._playerState.visible?this.play():this._freeze())}_loopComplete(){if(!this._lottieInstance)return;let{playDirection:t,totalFrames:e}=this._lottieInstance,s=this._segment?this._segment[0]:0,i=this._segment?this._segment[0]:e;if(this.count&&(this._isBounce?this._playerState.count+=.5:this._playerState.count+=1,this._playerState.count>=this.count)){this.setLoop(!1),this.playerState=ar.Completed,this.dispatchEvent(new CustomEvent(L.Complete));return}return(this.dispatchEvent(new CustomEvent(L.Loop)),this._isBounce)?(this._lottieInstance.goToAndStop(-1===t?s:.99*i,!0),this._lottieInstance.setDirection(-1*t),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission)):(this._lottieInstance.goToAndStop(-1===t?.99*i:s,!0),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission))}_mouseEnter(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window)){if(this.mouseout===ai.Reverse&&this._lottieInstance.setDirection(1),this.playerState===ar.Completed){this._lottieInstance.goToAndPlay(0,!0),this.playerState=ar.Playing;return}this.playerState!==ar.Playing&&this.play()}}_mouseLeave(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window))switch(this.mouseout){case ai.Void:break;case ai.Pause:this.pause();break;case ai.Reverse:this._lottieInstance.setDirection(-1),this.play();break;default:this.stop()}}_onVisibilityChange(){document.hidden&&this.playerState===ar.Playing?this._freeze():this.playerState===ar.Frozen&&this.play()}_removeEventListeners(){this._toggleEventListeners("remove")}_switchInstance(t=!1){if(this._animations[this._currentAnimation])try{if(this._lottieInstance&&this._lottieInstance.destroy(),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:this._animations[this._currentAnimation]}),this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===I.Bounce),this._removeEventListeners(),this._addEventListeners(),this.dispatchEvent(new CustomEvent(t?L.Previous:L.Next)),this._multiAnimationSettings[this._currentAnimation]?.autoplay??this.autoplay){if(this.animateOnScroll){this._lottieInstance.goToAndStop(0,!0),this.playerState=ar.Paused;return}this._lottieInstance.goToAndPlay(0,!0),this.playerState=ar.Playing;return}this._lottieInstance.goToAndStop(0,!0),this.playerState=ar.Stopped}catch(t){this._errorMessage=al(t).message,this.playerState=ar.Error,this.dispatchEvent(new CustomEvent(L.Error))}}_toggleEventListeners(t){let e="add"===t?"addEventListener":"removeEventListener";if(this._lottieInstance&&(this._lottieInstance[e]("enterFrame",this._enterFrame),this._lottieInstance[e]("complete",this._complete),this._lottieInstance[e]("loopComplete",this._loopComplete),this._lottieInstance[e]("DOMLoaded",this._DOMLoaded),this._lottieInstance[e]("data_ready",this._dataReady),this._lottieInstance[e]("data_failed",this._dataFailed)),this.selector){let t=document.getElementById(this.selector);t?this.hover?(t[e]("mouseenter",this._mouseEnter),t[e]("mouseleave",this._mouseLeave)):t[e]("click",this._handleClick):this.selector=null}this._container&&!this.selector&&(this.hover&&(this._container[e]("mouseenter",this._mouseEnter),this._container[e]("mouseleave",this._mouseLeave)),this.playOnClick&&this._container[e]("click",this._handleClick)),window[e]("focus",this._handleWindowBlur,{capture:!1,passive:!0}),window[e]("blur",this._handleWindowBlur,{capture:!1,passive:!0}),this.animateOnScroll&&window[e]("scroll",this._handleScroll,{capture:!0,passive:!0})}_toggleSettings(t){if(void 0===t){this._isSettingsOpen=!this._isSettingsOpen;return}this._isSettingsOpen=t}}class ad extends am{get renderer(){return $.SVG}constructor(){super(),this.loadAnimation=i_,this.isLight=!0}setOptions({container:t,hasAutoplay:e,hasLoop:s,initialSegment:i,preserveAspectRatio:r}){return{autoplay:e,container:t,initialSegment:i,loop:s,renderer:$.SVG,rendererSettings:{hideOnTransparent:!0,imagePreserveAspectRatio:r,preserveAspectRatio:r,progressiveLoad:!0}}}}globalThis.dotLottiePlayer=()=>new ad,N||customElements.define(aa,ad),t.MouseOut=ai,t.PlayMode=I,t.PlayerEvents=L,t.PlayerState=ar,t.default=ad,t.tagName=aa,Object.defineProperty(t,"__esModule",{value:!0})}(this["@aarsteinmedia/dotlottie-player"]=this["@aarsteinmedia/dotlottie-player"]||{});
68
+ `;async function ah(){if(!this.shadow||!this.template)throw Error("No Shadow Element or Template");this.template.innerHTML=`<div class="animation-container main" data-controls="${this.controls??!1}" lang="${this.description?document.documentElement.lang:"en"}" aria-label="${this.description??"Lottie animation"}" data-loaded="${this._playerState.loaded}"><figure class="animation" style="background:${this.background}">${this.playerState===ar.Error?`<div class="error"><svg preserveAspectRatio="${F.Cover}" xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080" style="white-space:preserve"><path fill="#fff" d="M0 0h1920v1080H0z"/><path fill="#3a6d8b" d="M1190.2 531 1007 212.4c-22-38.2-77.2-38-98.8.5L729.5 531.3c-21.3 37.9 6.1 84.6 49.5 84.6l361.9.3c43.7 0 71.1-47.3 49.3-85.2zM937.3 288.7c.2-7.5 3.3-23.9 23.2-23.9 16.3 0 23 16.1 23 23.5 0 55.3-10.7 197.2-12.2 214.5-.1 1-.9 1.7-1.9 1.7h-18.3c-1 0-1.8-.7-1.9-1.7-1.4-17.5-13.4-162.9-11.9-214.1zm24.2 283.8c-13.1 0-23.7-10.6-23.7-23.7s10.6-23.7 23.7-23.7 23.7 10.6 23.7 23.7-10.6 23.7-23.7 23.7zM722.1 644h112.6v34.4h-70.4V698h58.8v31.7h-58.8v22.6h72.4v36.2H722.1V644zm162 57.1h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6zm78.9 0h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5H963v15.6zm39.5 36.2c0-31.3 22.2-54.8 56.6-54.8 34.4 0 56.2 23.5 56.2 54.8s-21.8 54.6-56.2 54.6c-34.4-.1-56.6-23.3-56.6-54.6zm74 0c0-17.4-6.1-29.1-17.8-29.1-11.7 0-17.4 11.7-17.4 29.1 0 17.4 5.7 29.1 17.4 29.1s17.8-11.8 17.8-29.1zm83.1-36.2h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6z"/><path fill="none" d="M718.9 807.7h645v285.4h-645z"/><text fill="#3a6d8b" style="text-align:center;position:absolute;left:100%;font-size:47px;font-family:system-ui,-apple-system,BlinkMacSystemFont,'.SFNSText-Regular',sans-serif" x="50%" y="848.017" text-anchor="middle">${this._errorMessage}</text></svg></div>`:""}</figure><slot name="controls"></slot></div>`,this.shadow.adoptedStyleSheets=[await am.styles()],this.shadow.appendChild(this.template.content.cloneNode(!0))}let al=t=>{let e={message:"Unknown error",status:N?500:400};return t&&"object"==typeof t&&("message"in t&&"string"==typeof t.message&&(e.message=t.message),"status"in t&&(e.status=Number(t.status))),e},ap="Method is not implemented";class am extends r2{static get observedAttributes(){return["animateOnScroll","autoplay","controls","direction","hover","loop","mode","playOnClick","playOnVisible","selector","speed","src","subframe"]}static get observedProperties(){return["playerState","_isSettingsOpen","_seeker","_currentAnimation","_animations"]}static get styles(){return async()=>{let t=new CSSStyleSheet;return await t.replace("* {\n box-sizing: border-box;\n}\n\n:host {\n --lottie-player-toolbar-height: 35px;\n --lottie-player-toolbar-background-color: #fff;\n --lottie-player-toolbar-icon-color: #000;\n --lottie-player-toolbar-icon-hover-color: #000;\n --lottie-player-toolbar-icon-active-color: #4285f4;\n --lottie-player-seeker-track-color: rgb(0 0 0 / 20%);\n --lottie-player-seeker-thumb-color: #4285f4;\n --lottie-player-seeker-display: block;\n\n width: 100%;\n height: 100%;\n\n &:not([hidden]) {\n display: block;\n }\n\n .main {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n\n .animation {\n width: 100%;\n height: 100%;\n display: flex;\n margin: 0;\n padding: 0;\n }\n\n [data-controls='true'] .animation {\n height: calc(100% - 35px);\n }\n\n .animation-container {\n position: relative;\n }\n\n .popover {\n position: absolute;\n right: 5px;\n bottom: 40px;\n background-color: var(--lottie-player-toolbar-background-color);\n border-radius: 5px;\n padding: 10px 15px;\n border: solid 2px var(--lottie-player-toolbar-icon-color);\n animation: fade-in 0.2s ease-in-out;\n\n &::before {\n content: '';\n right: 10px;\n border: 7px solid transparent;\n margin-right: -7px;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n top: 100%;\n border-top-color: var(--lottie-player-toolbar-icon-color);\n }\n }\n\n .error {\n display: flex;\n margin: auto;\n justify-content: center;\n height: 100%;\n align-items: center;\n\n & svg {\n width: 100%;\n height: auto;\n }\n }\n\n .toolbar {\n display: flex;\n place-items: center center;\n background: var(--lottie-player-toolbar-background-color);\n margin: 0;\n height: 35px;\n padding: 5px;\n border-radius: 5px;\n gap: 5px;\n\n &.has-error {\n pointer-events: none;\n opacity: 0.5;\n }\n\n & button {\n cursor: pointer;\n fill: var(--lottie-player-toolbar-icon-color);\n color: var(--lottie-player-toolbar-icon-color);\n background: none;\n border: 0;\n padding: 0;\n outline: 0;\n height: 100%;\n margin: 0;\n align-items: center;\n gap: 5px;\n opacity: 0.9;\n\n &:not([hidden]) {\n display: flex;\n }\n\n &:hover {\n opacity: 1;\n }\n\n &[data-active='true'] {\n opacity: 1;\n fill: var(--lottie-player-toolbar-icon-active-color);\n }\n\n &:disabled {\n opacity: 0.5;\n }\n\n &:focus {\n outline: 0;\n }\n\n & svg {\n pointer-events: none;\n\n & > * {\n fill: inherit;\n }\n }\n\n &.disabled svg {\n display: none;\n }\n }\n }\n\n .progress-container {\n position: relative;\n width: 100%;\n\n &.simple {\n margin-right: 12px;\n }\n }\n\n .seeker {\n appearance: none;\n outline: none;\n width: 100%;\n height: 20px;\n border-radius: 3px;\n border: 0;\n cursor: pointer;\n background-color: transparent;\n\n display: var(--lottie-player-seeker-display);\n color: var(--lottie-player-seeker-thumb-color);\n margin: 0;\n padding: 7.5px 0;\n position: relative;\n z-index: 1;\n\n &::-webkit-slider-runnable-track,\n &::-webkit-slider-thumb {\n appearance: none;\n outline: none;\n }\n\n &::-webkit-slider-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n border: 0;\n background-color: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -webkit-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-webkit-slider-thumb,\n &:focus::-webkit-slider-thumb {\n transform: scale(1);\n }\n\n &::-moz-range-progress {\n background-color: var(--lottie-player-seeker-thumb-color);\n height: 5px;\n border-radius: 3px;\n }\n\n &::-moz-range-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: var(--lottie-player-seeker-thumb-color);\n border: 0;\n cursor: pointer;\n -moz-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-moz-range-thumb,\n &:focus::-moz-range-thumb {\n transform: scale(1);\n }\n\n &::-ms-track {\n width: 100%;\n height: 5px;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n border-radius: 3px;\n }\n\n &::-ms-fill-lower {\n background-color: var(--lottie-player-seeker-thumb-color);\n border-radius: 3px;\n }\n\n &::-ms-thumb {\n border: 0;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -ms-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-ms-thumb {\n transform: scale(1);\n }\n\n &:focus {\n &::-ms-thumb {\n transform: scale(1);\n }\n\n &::-ms-fill-lower,\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n }\n }\n }\n\n & progress {\n appearance: none;\n outline: none;\n position: absolute;\n width: 100%;\n height: 5px;\n border-radius: 3px;\n border: 0;\n top: 0;\n left: 0;\n margin: 7.5px 0;\n background-color: var(--lottie-player-seeker-track-color);\n pointer-events: none;\n\n &::-webkit-progress-inner-element {\n border-radius: 3px;\n overflow: hidden;\n }\n\n &::-webkit-slider-runnable-track {\n background-color: transparent;\n }\n\n &::-webkit-progress-value {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n }\n\n & *::-moz-progress-bar {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n}\n\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --lottie-player-toolbar-background-color: #000;\n --lottie-player-toolbar-icon-color: #fff;\n --lottie-player-toolbar-icon-hover-color: #fff;\n --lottie-player-seeker-track-color: rgb(255 255 255 / 60%);\n }\n}\n"),t}}set animateOnScroll(t){this.setAttribute("animateOnScroll",(!!t).toString())}get animateOnScroll(){let t=this.getAttribute("animateOnScroll");return"true"===t||""===t||"1"===t}get animations(){return this._animations}set autoplay(t){this.setAttribute("autoplay",(!!t).toString())}get autoplay(){let t=this.getAttribute("autoplay");return"true"===t||""===t||"1"===t}set background(t){this.setAttribute("background",t)}get background(){return this.getAttribute("background")||"transparent"}set controls(t){this.setAttribute("controls",(!!t).toString())}get controls(){let t=this.getAttribute("controls");return"true"===t||""===t||"1"===t}set count(t){this.setAttribute("count",t.toString())}get count(){let t=this.getAttribute("count");return t?Number(t):0}get currentAnimation(){return this._currentAnimation}set delay(t){this.setAttribute("delay",t.toString())}get delay(){let t=this.getAttribute("delay");return t?Number(t):0}set description(t){t&&this.setAttribute("description",t)}get description(){return this.getAttribute("description")}set direction(t){this.setAttribute("direction",t.toString())}get direction(){let t=Number(this.getAttribute("direction"));return -1===t?t:1}set dontFreezeOnBlur(t){this.setAttribute("dontFreezeOnBlur",(!!t).toString())}get dontFreezeOnBlur(){let t=this.getAttribute("dontFreezeOnBlur");return"true"===t||""===t||"1"===t}set hover(t){this.setAttribute("hover",(!!t).toString())}get hover(){let t=this.getAttribute("hover");return"true"===t||""===t||"1"===t}set intermission(t){this.setAttribute("intermission",t.toString())}get intermission(){let t=Number(this.getAttribute("intermission"));return isNaN(t)?0:t}get isDotLottie(){return this._isDotLottie}set loop(t){this.setAttribute("loop",(!!t).toString())}get loop(){let t=this.getAttribute("loop");return"true"===t||""===t||"1"===t}set mode(t){this.setAttribute("mode",t)}get mode(){let t=this.getAttribute("mode");return t===I.Bounce?t:I.Normal}set mouseout(t){this.setAttribute("mouseout",t)}get mouseout(){let t=this.getAttribute("mouseout");switch(t){case ai.Void:case ai.Pause:case ai.Reverse:return t;default:return ai.Stop}}set objectfit(t){this.setAttribute("objectfit",t)}get objectfit(){let t=this.getAttribute("objectfit");return t&&Object.values(as).includes(t)?t:as.Contain}set once(t){this.setAttribute("once",(!!t).toString())}get once(){let t=this.getAttribute("once");return"true"===t||""===t||"1"===t}set playOnClick(t){this.setAttribute("playOnClick",(!!t).toString())}get playOnClick(){let t=this.getAttribute("playOnClick");return"true"===t||""===t||"1"===t}set playOnVisible(t){this.setAttribute("playOnVisible",(!!t).toString())}get playOnVisible(){let t=this.getAttribute("playOnVisible");return"true"===t||""===t||"1"===t}set preserveAspectRatio(t){this.setAttribute("preserveAspectRatio",t||F.Contain)}get preserveAspectRatio(){let t=this.getAttribute("preserveAspectRatio");return t&&Object.values(F).includes(t)?t:null}set renderer(t){this.setAttribute("renderer",t)}get renderer(){let t=this.getAttribute("renderer");return t===$.Canvas||t===$.HTML?t:$.SVG}set selector(t){t?this.setAttribute("selector",t):this.removeAttribute("selector")}get selector(){return this.getAttribute("selector")}set simple(t){this.setAttribute("simple",(!!t).toString())}get simple(){let t=this.getAttribute("simple");return"true"===t||""===t||"1"===t}set speed(t){this.setAttribute("speed",t.toString())}get speed(){let t=this.getAttribute("speed");return null===t||isNaN(Number(t))?1:Number(t)}set src(t){this.setAttribute("src",t||"")}get src(){return this.getAttribute("src")}set subframe(t){this.setAttribute("subframe",(!!t).toString())}get subframe(){let t=this.getAttribute("subframe");return"true"===t||""===t||"1"===t}constructor(){super(),this.isLight=!1,this.playerState=ar.Loading,this._container=null,this._errorMessage="Something went wrong",this._identifier=this.id||g(),this._isSettingsOpen=!1,this._playerState={count:0,loaded:!1,prev:ar.Loading,scrollTimeout:null,scrollY:0,visible:!1},this._render=ah,this._renderControls=an,this._seeker=0,this._animations=[],this._currentAnimation=0,this._isBounce=!1,this._isDotLottie=!1,this._lottieInstance=null,this._multiAnimationSettings=[],this._complete=this._complete.bind(this),this._dataFailed=this._dataFailed.bind(this),this._dataReady=this._dataReady.bind(this),this._DOMLoaded=this._DOMLoaded.bind(this),this._enterFrame=this._enterFrame.bind(this),this._freeze=this._freeze.bind(this),this._handleBlur=this._handleBlur.bind(this),this._handleClick=this._handleClick.bind(this),this._handleScroll=this._handleScroll.bind(this),this._handleSeekChange=this._handleSeekChange.bind(this),this._handleWindowBlur=this._handleWindowBlur.bind(this),this._loopComplete=this._loopComplete.bind(this),this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._switchInstance=this._switchInstance.bind(this),this._handleSettingsClick=this._handleSettingsClick.bind(this),this.togglePlay=this.togglePlay.bind(this),this.stop=this.stop.bind(this),this.prev=this.prev.bind(this),this.next=this.next.bind(this),this._renderControls=this._renderControls.bind(this),this.snapshot=this.snapshot.bind(this),this.toggleLoop=this.toggleLoop.bind(this),this.toggleBoomerang=this.toggleBoomerang.bind(this),this.destroy=this.destroy.bind(this),this.template=document.createElement("template"),this.shadow=this.attachShadow({mode:"open"})}addAnimation(t){throw Error(ap)}async attributeChangedCallback(t,e,s){if(this._lottieInstance&&this.shadow&&this._container)switch(t){case"animateOnScroll":if(""===s||s){this._lottieInstance.autoplay=!1,addEventListener("scroll",this._handleScroll,{capture:!0,passive:!0});return}removeEventListener("scroll",this._handleScroll,!0);break;case"autoplay":if(this.animateOnScroll||this.playOnVisible)return;if(""===s||s)return void this.play();this.stop();break;case"controls":this._renderControls();break;case"direction":if(-1===Number(s))return void this.setDirection(-1);this.setDirection(1);break;case"hover":if(""===s||s){this._container.addEventListener("mouseenter",this._mouseEnter),this._container.addEventListener("mouseleave",this._mouseLeave);return}this._container.removeEventListener("mouseenter",this._mouseEnter),this._container.removeEventListener("mouseleave",this._mouseLeave);break;case"loop":{let t=this.shadow.querySelector(".toggleLoop");t instanceof HTMLButtonElement&&(t.dataset.active=s),this.setLoop(""===s||!!s);break}case"mode":{let t=this.shadow.querySelector(".toggleBoomerang");t instanceof HTMLButtonElement&&(t.dataset.active=(s===I.Bounce).toString()),this._isBounce=s===I.Bounce;break}case"playOnClick":if(""===s||s){this._lottieInstance.autoplay=!1,this._container.addEventListener("click",this._handleClick);return}this._container.removeEventListener("click",this._handleClick);break;case"playOnVisible":(""===s||s)&&(this._lottieInstance.autoplay=!1);break;case"selector":{let t=document.getElementById(this.selector??"");t?.addEventListener("click",this._handleClick);break}case"speed":{let t=Number(s);t&&!isNaN(t)&&this.setSpeed(t);break}case"src":await this.load(s);break;case"subframe":this.setSubframe(""===s||!!s)}}connectedCallback(){super.connectedCallback();try{(async()=>{if(await this._render(),!this.shadow)throw Error("Missing Shadow element");this._container=this.shadow.querySelector(".animation"),await this.load(this.src),void 0!==document.hidden&&document.addEventListener("visibilitychange",this._onVisibilityChange),this._addIntersectionObserver(),this.dispatchEvent(new CustomEvent(L.Rendered))})()}catch(t){console.error(t),this.dispatchEvent(new CustomEvent(L.Error))}}convert(t){throw Error(ap)}destroy(){this._lottieInstance?.destroy&&(this.playerState=ar.Destroyed,this._lottieInstance.destroy(),this._lottieInstance=null,this.dispatchEvent(new CustomEvent(L.Destroyed)),this.remove(),document.removeEventListener("visibilitychange",this._onVisibilityChange))}disconnectedCallback(){this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.destroy()}getLottie(){return this._lottieInstance}getManifest(){return this._manifest}getMultiAnimationSettings(){return this._multiAnimationSettings}getSegment(){return this._segment}async load(t){try{if(!this.shadowRoot||!t)return;this.source=t;let{animations:e,isDotLottie:s,manifest:i}=await rQ(t);if(!e||e.some(t=>!["v","ip","op","layers","fr","w","h"].every(e=>Object.hasOwn(t,e))))throw Error("Broken or corrupted file");let r=this.parentElement?.querySelector('script[type="application/ld+json"]');if(r){let t=JSON.parse(r.innerHTML);t.selector&&(this.selector=t.selector),t.segment&&this.setSegment(t.segment),t.multiAnimationSettings&&this.setMultiAnimationSettings(t.multiAnimationSettings)}this._isBounce=this.mode===I.Bounce,this._multiAnimationSettings.length>0&&this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===I.Bounce);let a=i?.animations[0];a&&(a.autoplay=!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,a.loop=this.loop),this._isDotLottie=s,this._animations=e,this._manifest=i??{animations:[{autoplay:!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,direction:this.direction,id:g(),loop:this.loop,mode:this.mode,speed:this.speed}]},this._lottieInstance?.destroy(),this.playerState=ar.Stopped,!this.animateOnScroll&&(this.autoplay||this._multiAnimationSettings[this._currentAnimation]?.autoplay||this.playOnVisible)&&(this.playerState=ar.Playing),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:e[this._currentAnimation]}),this._addEventListeners();let n=this._multiAnimationSettings[this._currentAnimation]?.speed??this.speed,o=this._multiAnimationSettings[this._currentAnimation]?.direction??this.direction;if(this._lottieInstance.setSpeed(n),this._lottieInstance.setDirection(o),this._lottieInstance.setSubframe(!!this.subframe),(this.autoplay||this.animateOnScroll||this.playOnVisible)&&-1===this.direction&&this.seek("99%"),this._renderControls(),this.autoplay||this.playOnVisible){let t=this.shadow?.querySelector(".togglePlay");t&&(t.innerHTML=ao)}}catch(t){console.error(t),this._errorMessage=al(t).message,this.playerState=ar.Error,this.dispatchEvent(new CustomEvent(L.Error))}}loadAnimation(t){throw Error(ap)}next(){this._currentAnimation++,this._switchInstance()}pause(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(L.Pause))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?ar.Error:ar.Paused}}play(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.play(),this.dispatchEvent(new CustomEvent(L.Play))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?ar.Error:ar.Playing}}prev(){this._currentAnimation--,this._switchInstance(!0)}propertyChangedCallback(t,e,s){if(!this.shadow)return;let i=this.shadow.querySelector(".togglePlay"),r=this.shadow.querySelector(".stop"),a=this.shadow.querySelector(".prev"),n=this.shadow.querySelector(".next"),o=this.shadow.querySelector(".seeker"),h=this.shadow.querySelector("progress"),l=this.shadow.querySelector(".popover"),p=this.shadow.querySelector(".convert"),m=this.shadow.querySelector(".snapshot");i instanceof HTMLButtonElement&&r instanceof HTMLButtonElement&&n instanceof HTMLButtonElement&&a instanceof HTMLButtonElement&&o instanceof HTMLInputElement&&h instanceof HTMLProgressElement&&("playerState"===t&&(i.dataset.active=(s===ar.Playing||s===ar.Paused).toString(),r.dataset.active=(s===ar.Stopped).toString(),s===ar.Playing?i.innerHTML=ao:i.innerHTML=r9),"_seeker"===t&&"number"==typeof s&&(o.value=s.toString(),o.ariaValueNow=s.toString(),h.value=s),"_animations"===t&&Array.isArray(s)&&this._currentAnimation+1<s.length&&(n.hidden=!1),"_currentAnimation"===t&&"number"==typeof s&&(n.hidden=s+1>=this._animations.length,a.hidden=!s),"_isSettingsOpen"===t&&"boolean"==typeof s&&l instanceof HTMLDivElement&&p instanceof HTMLButtonElement&&m instanceof HTMLButtonElement&&(l.hidden=!s,p.hidden=this.isLight,m.hidden=this.renderer!==$.SVG))}async reload(){this._lottieInstance&&this.src&&(this._lottieInstance.destroy(),await this.load(this.src))}seek(t){if(!this._lottieInstance)return;let e=t.toString().match(/^(\d+)(%?)$/);if(!e)return;let s=Math.round("%"===e[2]?this._lottieInstance.totalFrames*Number(e[1])/100:Number(e[1]));if(this._seeker=s,this.playerState===ar.Playing||this.playerState===ar.Frozen&&this._playerState.prev===ar.Playing){this._lottieInstance.goToAndPlay(s,!0),this.playerState=ar.Playing;return}this._lottieInstance.goToAndStop(s,!0),this._lottieInstance.pause()}setCount(t){this.count=t}setDirection(t){this._lottieInstance&&this._lottieInstance.setDirection(t)}setLoop(t){this._lottieInstance&&this._lottieInstance.setLoop(t)}setMultiAnimationSettings(t){this._multiAnimationSettings=t}setSegment(t){this._segment=t}setSpeed(t=1){this._lottieInstance&&this._lottieInstance.setSpeed(t)}setSubframe(t){this._lottieInstance&&this._lottieInstance.setSubframe(t)}snapshot(t=!0,e="AM Lottie"){try{var s,i;let r,a,n,o;if(!this.shadowRoot)throw Error("Unknown error");let h=this.shadowRoot.querySelector(".animation svg");if(!h)throw Error("Could not retrieve animation from DOM");let l=h instanceof Node?new XMLSerializer().serializeToString(h):null;if(!l)throw Error("Could not serialize SVG element");return t&&(i={mimeType:"image/svg+xml",name:`${s=this.src||e,(t=>{let e;if("string"==typeof t&&t&&((e=t?.split("/").pop()?.lastIndexOf("."))??0)>1&&t&&t.length-1>(e??0))return t.split(".").pop()?.toLowerCase()})(s),`${s.split("/").pop()?.replace(/\.[^.]*$/,"").replaceAll(/\W+/g,"-")}`}-${((this._seeker??0)+1).toString().padStart(3,"0")}.svg`},r=new Blob([l],{type:i?.mimeType}),a=i?.name||g(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=a,o.hidden=!0,document.body.appendChild(o),o.click(),setTimeout(()=>{o.remove(),URL.revokeObjectURL(n)},1e3)),l}catch(t){return console.error(t),null}}stop(){if(this._lottieInstance){this._playerState.prev=this.playerState,this._playerState.count=0;try{this._lottieInstance.stop(),this.dispatchEvent(new CustomEvent(L.Stop))}finally{this.playerState=ar.Stopped}}}toggleBoomerang(){let t=this._multiAnimationSettings[this._currentAnimation]??{};if(void 0!==t.mode){if(t.mode===I.Normal){t.mode=I.Bounce,this._isBounce=!0;return}t.mode=I.Normal,this._isBounce=!1;return}if(this.mode===I.Normal){this.mode=I.Bounce,this._isBounce=!0;return}this.mode=I.Normal,this._isBounce=!1}toggleLoop(){let t=!this.loop;this.loop=t,this.setLoop(t)}togglePlay(){if(!this._lottieInstance)return;let{currentFrame:t,playDirection:e,totalFrames:s}=this._lottieInstance;if(this.playerState===ar.Playing)return void this.pause();if(this.playerState!==ar.Completed)return void this.play();if(this.playerState=ar.Playing,this._isBounce){this.setDirection(-1*e),this._lottieInstance.goToAndPlay(t,!0);return}-1===e?this._lottieInstance.goToAndPlay(s,!0):this._lottieInstance.goToAndPlay(0,!0)}_freeze(){if(this._lottieInstance){this._playerState.prev=this.playerState;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(L.Freeze))}finally{this.playerState=ar.Frozen}}}_handleBlur(){setTimeout(()=>{this._toggleSettings(!1)},200)}_handleClick(){(this.playOnClick||this.selector)&&this.togglePlay()}_handleSeekChange({target:t}){!(!(t instanceof HTMLInputElement)||!this._lottieInstance||isNaN(Number(t.value)))&&this.seek(Math.round(Number(t.value)/100*this._lottieInstance.totalFrames))}_handleSettingsClick({target:t}){this._toggleSettings(),t instanceof HTMLElement&&t.focus()}setOptions(t){throw Error("Method not implemented")}_addEventListeners(){this._toggleEventListeners("add")}_addIntersectionObserver(){if(this._container&&!this._intersectionObserver){if(!("IntersectionObserver"in window)){this._intersectionObserverFallback(),removeEventListener("scroll",this._intersectionObserverFallback,!0),addEventListener("scroll",this._intersectionObserverFallback,{capture:!0,passive:!0});return}this._intersectionObserver=new IntersectionObserver(t=>{let{length:e}=t;for(let s=0;s<e;s++){if(!t[s]?.isIntersecting||document.hidden){this.playerState===ar.Playing&&this._freeze(),this._playerState.visible=!1;continue}this.animateOnScroll||this.playOnVisible||this.playerState!==ar.Frozen||this.play(),this.playOnVisible&&(this.playerState!==ar.Completed||this.once?setTimeout(()=>{this.play()},this.delay):(this.playerState=ar.Playing,this._lottieInstance?.goToAndPlay(1===this.direction?0:this._lottieInstance.totalFrames))),!this._playerState.scrollY&&(t[s]?.boundingClientRect.y||0)>0&&(this._playerState.scrollY=scrollY),this._playerState.visible=!0}}),this._intersectionObserver.observe(this._container)}}_complete(){if(!this._lottieInstance)return;if(this._animations.length>1){if(this._multiAnimationSettings[this._currentAnimation+1]?.autoplay)return void this.next();if(this.loop&&this._currentAnimation===this._animations.length-1){this._currentAnimation=0,this._switchInstance();return}}let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.playerState=ar.Completed,this.dispatchEvent(new CustomEvent(L.Complete,{detail:{frame:t,seeker:this._seeker}}))}_dataFailed(){this.playerState=ar.Error,this.dispatchEvent(new CustomEvent(L.Error))}_dataReady(){this.dispatchEvent(new CustomEvent(L.Load))}_DOMLoaded(){this._playerState.loaded=!0,this.dispatchEvent(new CustomEvent(L.Ready))}_enterFrame(){if(!this._lottieInstance)return;let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.dispatchEvent(new CustomEvent(L.Frame,{detail:{frame:t,seeker:this._seeker}}))}_getOptions(){if(!this._container)throw Error("Container not rendered");let t=this.preserveAspectRatio??(t=>{switch(t){case as.Contain:case as.ScaleDown:return F.Contain;case as.Cover:return F.Cover;case as.Fill:return F.Initial;case as.None:return F.None;default:return F.Contain}})(this.objectfit),e=this._multiAnimationSettings.length>0?this._multiAnimationSettings[this._currentAnimation]:void 0,s=this._manifest?.animations[this._currentAnimation],i=!!this.loop;s?.loop!==void 0&&(i=!!s.loop),e?.loop!==void 0&&(i=!!e.loop);let r=!!this.autoplay;s?.autoplay!==void 0&&(r=!!s.autoplay),e?.autoplay!==void 0&&(r=!!e.autoplay),this.animateOnScroll&&(r=!1);let a=this._segment;return this._segment?.every(t=>t>0)&&(a=[this._segment[0]-1,this._segment[1]-1]),this._segment?.some(t=>t<0)&&(a=void 0),this.setOptions({container:this._container,hasAutoplay:r,hasLoop:i,initialSegment:a,preserveAspectRatio:t,rendererType:this.renderer})}_handleScroll(){if(!this.animateOnScroll||!this._lottieInstance)return;if(N)return void console.warn("DotLottie: Scroll animations might not work properly in a Server Side Rendering context. Try to wrap this in a client component.");if(!this._playerState.visible)return;this._playerState.scrollTimeout&&clearTimeout(this._playerState.scrollTimeout),this._playerState.scrollTimeout=setTimeout(()=>{this.playerState=ar.Paused},400);let{totalFrames:t}=this._lottieInstance,e=scrollY-this._playerState.scrollY;scrollY<=this._playerState.scrollY&&(e=this._playerState.scrollY-scrollY);let s=((t,e=0,s=100)=>{let i=e,r=s;if(i>r){let t=r;r=i,i=t}return Math.min(Math.max(t,i),r)})(e/innerHeight*(t-1),0,t);requestAnimationFrame(()=>{if(s>=t){this.playerState=ar.Paused;return}this.playerState=ar.Playing,this._lottieInstance?.goToAndStop(s,!0)})}_handleWindowBlur({type:t}){this.dontFreezeOnBlur||(this.playerState===ar.Playing&&"blur"===t&&this._freeze(),this.playerState===ar.Frozen&&"focus"===t&&this.play())}_intersectionObserverFallback(){if(!this._container)return;let{bottom:t,left:e,right:s,top:i}=this._container.getBoundingClientRect();this._playerState.visible=i>=0&&e>=0&&t<=innerHeight&&s<=innerWidth,(this.autoplay||this.playOnVisible||this.playerState===ar.Playing||this.playerState===ar.Frozen)&&(this._playerState.visible?this.play():this._freeze())}_loopComplete(){if(!this._lottieInstance)return;let{playDirection:t,totalFrames:e}=this._lottieInstance,s=this._segment?this._segment[0]:0,i=this._segment?this._segment[0]:e;if(this.count&&(this._isBounce?this._playerState.count+=.5:this._playerState.count+=1,this._playerState.count>=this.count)){this.setLoop(!1),this.playerState=ar.Completed,this.dispatchEvent(new CustomEvent(L.Complete));return}return(this.dispatchEvent(new CustomEvent(L.Loop)),this._isBounce)?(this._lottieInstance.goToAndStop(-1===t?s:.99*i,!0),this._lottieInstance.setDirection(-1*t),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission)):(this._lottieInstance.goToAndStop(-1===t?.99*i:s,!0),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission))}_mouseEnter(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window)){if(this.mouseout===ai.Reverse&&this._lottieInstance.setDirection(1),this.playerState===ar.Completed){this._lottieInstance.goToAndPlay(0,!0),this.playerState=ar.Playing;return}this.playerState!==ar.Playing&&this.play()}}_mouseLeave(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window))switch(this.mouseout){case ai.Void:break;case ai.Pause:this.pause();break;case ai.Reverse:this._lottieInstance.setDirection(-1),this.play();break;default:this.stop()}}_onVisibilityChange(){document.hidden&&this.playerState===ar.Playing?this._freeze():this.playerState===ar.Frozen&&this.play()}_removeEventListeners(){this._toggleEventListeners("remove")}_switchInstance(t=!1){if(this._animations[this._currentAnimation])try{if(this._lottieInstance&&this._lottieInstance.destroy(),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:this._animations[this._currentAnimation]}),this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===I.Bounce),this._removeEventListeners(),this._addEventListeners(),this.dispatchEvent(new CustomEvent(t?L.Previous:L.Next)),this._multiAnimationSettings[this._currentAnimation]?.autoplay??this.autoplay){if(this.animateOnScroll){this._lottieInstance.goToAndStop(0,!0),this.playerState=ar.Paused;return}this._lottieInstance.goToAndPlay(0,!0),this.playerState=ar.Playing;return}this._lottieInstance.goToAndStop(0,!0),this.playerState=ar.Stopped}catch(t){this._errorMessage=al(t).message,this.playerState=ar.Error,this.dispatchEvent(new CustomEvent(L.Error))}}_toggleEventListeners(t){let e="add"===t?"addEventListener":"removeEventListener";if(this._lottieInstance&&(this._lottieInstance[e]("enterFrame",this._enterFrame),this._lottieInstance[e]("complete",this._complete),this._lottieInstance[e]("loopComplete",this._loopComplete),this._lottieInstance[e]("DOMLoaded",this._DOMLoaded),this._lottieInstance[e]("data_ready",this._dataReady),this._lottieInstance[e]("data_failed",this._dataFailed)),this.selector){let t=document.getElementById(this.selector);t?this.hover?(t[e]("mouseenter",this._mouseEnter),t[e]("mouseleave",this._mouseLeave)):t[e]("click",this._handleClick):this.selector=null}this._container&&!this.selector&&(this.hover&&(this._container[e]("mouseenter",this._mouseEnter),this._container[e]("mouseleave",this._mouseLeave)),this.playOnClick&&this._container[e]("click",this._handleClick)),window[e]("focus",this._handleWindowBlur,{capture:!1,passive:!0}),window[e]("blur",this._handleWindowBlur,{capture:!1,passive:!0}),this.animateOnScroll&&window[e]("scroll",this._handleScroll,{capture:!0,passive:!0})}_toggleSettings(t){if(void 0===t){this._isSettingsOpen=!this._isSettingsOpen;return}this._isSettingsOpen=t}}class ad extends am{get renderer(){return $.SVG}constructor(){super(),this.loadAnimation=i_,this.isLight=!0}setOptions({container:t,hasAutoplay:e,hasLoop:s,initialSegment:i,preserveAspectRatio:r}){return{autoplay:e,container:t,initialSegment:i,loop:s,renderer:$.SVG,rendererSettings:{hideOnTransparent:!0,imagePreserveAspectRatio:r,preserveAspectRatio:r,progressiveLoad:!0}}}}globalThis.dotLottiePlayer=()=>new ad,N||customElements.define(aa,ad),t.MouseOut=ai,t.PlayMode=I,t.PlayerEvents=L,t.PlayerState=ar,t.default=ad,t.tagName=aa,Object.defineProperty(t,"__esModule",{value:!0})}(this["@aarsteinmedia/dotlottie-player"]=this["@aarsteinmedia/dotlottie-player"]||{});
package/dist/unpkg-svg.js CHANGED
@@ -67,4 +67,4 @@
67
67
  d="M14.016 5.016H18v13.969h-3.984V5.016zM6 18.984V5.015h3.984v13.969H6z"
68
68
  />
69
69
  </svg>
70
- `;async function nS(){if(!this.shadow||!this.template)throw Error("No Shadow Element or Template");this.template.innerHTML=`<div class="animation-container main" data-controls="${this.controls??!1}" lang="${this.description?document.documentElement.lang:"en"}" aria-label="${this.description??"Lottie animation"}" data-loaded="${this._playerState.loaded}"><figure class="animation" style="background:${this.background}">${this.playerState===n_.Error?`<div class="error"><svg preserveAspectRatio="${$.Cover}" xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080" style="white-space:preserve"><path fill="#fff" d="M0 0h1920v1080H0z"/><path fill="#3a6d8b" d="M1190.2 531 1007 212.4c-22-38.2-77.2-38-98.8.5L729.5 531.3c-21.3 37.9 6.1 84.6 49.5 84.6l361.9.3c43.7 0 71.1-47.3 49.3-85.2zM937.3 288.7c.2-7.5 3.3-23.9 23.2-23.9 16.3 0 23 16.1 23 23.5 0 55.3-10.7 197.2-12.2 214.5-.1 1-.9 1.7-1.9 1.7h-18.3c-1 0-1.8-.7-1.9-1.7-1.4-17.5-13.4-162.9-11.9-214.1zm24.2 283.8c-13.1 0-23.7-10.6-23.7-23.7s10.6-23.7 23.7-23.7 23.7 10.6 23.7 23.7-10.6 23.7-23.7 23.7zM722.1 644h112.6v34.4h-70.4V698h58.8v31.7h-58.8v22.6h72.4v36.2H722.1V644zm162 57.1h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6zm78.9 0h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5H963v15.6zm39.5 36.2c0-31.3 22.2-54.8 56.6-54.8 34.4 0 56.2 23.5 56.2 54.8s-21.8 54.6-56.2 54.6c-34.4-.1-56.6-23.3-56.6-54.6zm74 0c0-17.4-6.1-29.1-17.8-29.1-11.7 0-17.4 11.7-17.4 29.1 0 17.4 5.7 29.1 17.4 29.1s17.8-11.8 17.8-29.1zm83.1-36.2h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6z"/><path fill="none" d="M718.9 807.7h645v285.4h-645z"/><text fill="#3a6d8b" style="text-align:center;position:absolute;left:100%;font-size:47px;font-family:system-ui,-apple-system,BlinkMacSystemFont,'.SFNSText-Regular',sans-serif" x="50%" y="848.017" text-anchor="middle">${this._errorMessage}</text></svg></div>`:""}</figure><slot name="controls"></slot></div>`,this.shadow.adoptedStyleSheets=[await nM.styles()],this.shadow.appendChild(this.template.content.cloneNode(!0))}let nx=t=>{let e={message:"Unknown error",status:N?500:400};return t&&"object"==typeof t&&("message"in t&&"string"==typeof t.message&&(e.message=t.message),"status"in t&&(e.status=Number(t.status))),e},nP="Method is not implemented";class nM extends nh{static get observedAttributes(){return["animateOnScroll","autoplay","controls","direction","hover","loop","mode","playOnClick","playOnVisible","selector","speed","src","subframe"]}static get observedProperties(){return["playerState","_isSettingsOpen","_seeker","_currentAnimation","_animations"]}static get styles(){return async()=>{let t=new CSSStyleSheet;return await t.replace("* {\n box-sizing: border-box;\n}\n\n:host {\n --lottie-player-toolbar-height: 35px;\n --lottie-player-toolbar-background-color: #fff;\n --lottie-player-toolbar-icon-color: #000;\n --lottie-player-toolbar-icon-hover-color: #000;\n --lottie-player-toolbar-icon-active-color: #4285f4;\n --lottie-player-seeker-track-color: rgb(0 0 0 / 20%);\n --lottie-player-seeker-thumb-color: #4285f4;\n --lottie-player-seeker-display: block;\n\n width: 100%;\n height: 100%;\n\n &:not([hidden]) {\n display: block;\n }\n\n .main {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n\n .animation {\n width: 100%;\n height: 100%;\n display: flex;\n margin: 0;\n padding: 0;\n }\n\n [data-controls='true'] .animation {\n height: calc(100% - 35px);\n }\n\n .animation-container {\n position: relative;\n }\n\n .popover {\n position: absolute;\n right: 5px;\n bottom: 40px;\n background-color: var(--lottie-player-toolbar-background-color);\n border-radius: 5px;\n padding: 10px 15px;\n border: solid 2px var(--lottie-player-toolbar-icon-color);\n animation: fade-in 0.2s ease-in-out;\n\n &::before {\n content: '';\n right: 10px;\n border: 7px solid transparent;\n margin-right: -7px;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n top: 100%;\n border-top-color: var(--lottie-player-toolbar-icon-color);\n }\n }\n\n .error {\n display: flex;\n margin: auto;\n justify-content: center;\n height: 100%;\n align-items: center;\n\n & svg {\n width: 100%;\n height: auto;\n }\n }\n\n .toolbar {\n display: flex;\n place-items: center center;\n background: var(--lottie-player-toolbar-background-color);\n margin: 0;\n height: 35px;\n padding: 5px;\n border-radius: 5px;\n gap: 5px;\n\n &.has-error {\n pointer-events: none;\n opacity: 0.5;\n }\n\n & button {\n cursor: pointer;\n fill: var(--lottie-player-toolbar-icon-color);\n color: var(--lottie-player-toolbar-icon-color);\n background: none;\n border: 0;\n padding: 0;\n outline: 0;\n height: 100%;\n margin: 0;\n align-items: center;\n gap: 5px;\n opacity: 0.9;\n\n &:not([hidden]) {\n display: flex;\n }\n\n &:hover {\n opacity: 1;\n }\n\n &[data-active='true'] {\n opacity: 1;\n fill: var(--lottie-player-toolbar-icon-active-color);\n }\n\n &:disabled {\n opacity: 0.5;\n }\n\n &:focus {\n outline: 0;\n }\n\n & svg {\n pointer-events: none;\n\n & > * {\n fill: inherit;\n }\n }\n\n &.disabled svg {\n display: none;\n }\n }\n }\n\n .progress-container {\n position: relative;\n width: 100%;\n\n &.simple {\n margin-right: 12px;\n }\n }\n\n .seeker {\n appearance: none;\n outline: none;\n width: 100%;\n height: 20px;\n border-radius: 3px;\n border: 0;\n cursor: pointer;\n background-color: transparent;\n\n display: var(--lottie-player-seeker-display);\n color: var(--lottie-player-seeker-thumb-color);\n margin: 0;\n padding: 7.5px 0;\n position: relative;\n z-index: 1;\n\n &::-webkit-slider-runnable-track,\n &::-webkit-slider-thumb {\n appearance: none;\n outline: none;\n }\n\n &::-webkit-slider-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n border: 0;\n background-color: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -webkit-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-webkit-slider-thumb,\n &:focus::-webkit-slider-thumb {\n transform: scale(1);\n }\n\n &::-moz-range-progress {\n background-color: var(--lottie-player-seeker-thumb-color);\n height: 5px;\n border-radius: 3px;\n }\n\n &::-moz-range-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: var(--lottie-player-seeker-thumb-color);\n border: 0;\n cursor: pointer;\n -moz-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-moz-range-thumb,\n &:focus::-moz-range-thumb {\n transform: scale(1);\n }\n\n &::-ms-track {\n width: 100%;\n height: 5px;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n border-radius: 3px;\n }\n\n &::-ms-fill-lower {\n background-color: var(--lottie-player-seeker-thumb-color);\n border-radius: 3px;\n }\n\n &::-ms-thumb {\n border: 0;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -ms-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-ms-thumb {\n transform: scale(1);\n }\n\n &:focus {\n &::-ms-thumb {\n transform: scale(1);\n }\n\n &::-ms-fill-lower,\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n }\n }\n }\n\n & progress {\n appearance: none;\n outline: none;\n position: absolute;\n width: 100%;\n height: 5px;\n border-radius: 3px;\n border: 0;\n top: 0;\n left: 0;\n margin: 7.5px 0;\n background-color: var(--lottie-player-seeker-track-color);\n pointer-events: none;\n\n &::-webkit-progress-inner-element {\n border-radius: 3px;\n overflow: hidden;\n }\n\n &::-webkit-slider-runnable-track {\n background-color: transparent;\n }\n\n &::-webkit-progress-value {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n }\n\n & *::-moz-progress-bar {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n}\n\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --lottie-player-toolbar-background-color: #000;\n --lottie-player-toolbar-icon-color: #fff;\n --lottie-player-toolbar-icon-hover-color: #fff;\n --lottie-player-seeker-track-color: rgb(255 255 255 / 60%);\n }\n}\n"),t}}set animateOnScroll(t){this.setAttribute("animateOnScroll",(!!t).toString())}get animateOnScroll(){let t=this.getAttribute("animateOnScroll");return"true"===t||""===t||"1"===t}get animations(){return this._animations}set autoplay(t){this.setAttribute("autoplay",(!!t).toString())}get autoplay(){let t=this.getAttribute("autoplay");return"true"===t||""===t||"1"===t}set background(t){this.setAttribute("background",t)}get background(){return this.getAttribute("background")||"transparent"}set controls(t){this.setAttribute("controls",(!!t).toString())}get controls(){let t=this.getAttribute("controls");return"true"===t||""===t||"1"===t}set count(t){this.setAttribute("count",t.toString())}get count(){let t=this.getAttribute("count");return t?Number(t):0}get currentAnimation(){return this._currentAnimation}set delay(t){this.setAttribute("delay",t.toString())}get delay(){let t=this.getAttribute("delay");return t?Number(t):0}set description(t){t&&this.setAttribute("description",t)}get description(){return this.getAttribute("description")}set direction(t){this.setAttribute("direction",t.toString())}get direction(){let t=Number(this.getAttribute("direction"));return -1===t?t:1}set dontFreezeOnBlur(t){this.setAttribute("dontFreezeOnBlur",t.toString())}get dontFreezeOnBlur(){let t=this.getAttribute("dontFreezeOnBlur");return"true"===t||""===t||"1"===t}set hover(t){this.setAttribute("hover",t.toString())}get hover(){let t=this.getAttribute("hover");return"true"===t||""===t||"1"===t}set intermission(t){this.setAttribute("intermission",t.toString())}get intermission(){let t=Number(this.getAttribute("intermission"));return isNaN(t)?0:t}get isDotLottie(){return this._isDotLottie}set loop(t){this.setAttribute("loop",(!!t).toString())}get loop(){let t=this.getAttribute("loop");return"true"===t||""===t||"1"===t}set mode(t){this.setAttribute("mode",t)}get mode(){let t=this.getAttribute("mode");return t===D.Bounce?t:D.Normal}set mouseout(t){this.setAttribute("mouseout",t)}get mouseout(){let t=this.getAttribute("mouseout");switch(t){case nv.Void:case nv.Pause:case nv.Reverse:return t;default:return nv.Stop}}set objectfit(t){this.setAttribute("objectfit",t)}get objectfit(){let t=this.getAttribute("objectfit");return t&&Object.values(nb).includes(t)?t:nb.Contain}set once(t){this.setAttribute("once",(!!t).toString())}get once(){let t=this.getAttribute("once");return"true"===t||""===t||"1"===t}set playOnClick(t){this.setAttribute("playOnClick",(!!t).toString())}get playOnClick(){let t=this.getAttribute("playOnClick");return"true"===t||""===t||"1"===t}set playOnVisible(t){this.setAttribute("playOnVisible",(!!t).toString())}get playOnVisible(){let t=this.getAttribute("playOnVisible");return"true"===t||""===t||"1"===t}set preserveAspectRatio(t){this.setAttribute("preserveAspectRatio",t||$.Contain)}get preserveAspectRatio(){let t=this.getAttribute("preserveAspectRatio");return t&&Object.values($).includes(t)?t:null}set renderer(t){this.setAttribute("renderer",t)}get renderer(){let t=this.getAttribute("renderer");return t===L.Canvas||t===L.HTML?t:L.SVG}set selector(t){t?this.setAttribute("selector",t):this.removeAttribute("selector")}get selector(){return this.getAttribute("selector")}set simple(t){this.setAttribute("simple",(!!t).toString())}get simple(){let t=this.getAttribute("simple");return"true"===t||""===t||"1"===t}set speed(t){this.setAttribute("speed",t.toString())}get speed(){let t=this.getAttribute("speed");return null===t||isNaN(Number(t))?1:Number(t)}set src(t){this.setAttribute("src",t||"")}get src(){return this.getAttribute("src")}set subframe(t){this.setAttribute("subframe",(!!t).toString())}get subframe(){let t=this.getAttribute("subframe");return"true"===t||""===t||"1"===t}constructor(){super(),this.isLight=!1,this.playerState=n_.Loading,this._container=null,this._errorMessage="Something went wrong",this._identifier=this.id||g(),this._isSettingsOpen=!1,this._playerState={count:0,loaded:!1,prev:n_.Loading,scrollTimeout:null,scrollY:0,visible:!1},this._render=nS,this._renderControls=nE,this._seeker=0,this._animations=[],this._currentAnimation=0,this._isBounce=!1,this._isDotLottie=!1,this._lottieInstance=null,this._multiAnimationSettings=[],this._complete=this._complete.bind(this),this._dataFailed=this._dataFailed.bind(this),this._dataReady=this._dataReady.bind(this),this._DOMLoaded=this._DOMLoaded.bind(this),this._enterFrame=this._enterFrame.bind(this),this._freeze=this._freeze.bind(this),this._handleBlur=this._handleBlur.bind(this),this._handleClick=this._handleClick.bind(this),this._handleScroll=this._handleScroll.bind(this),this._handleSeekChange=this._handleSeekChange.bind(this),this._handleWindowBlur=this._handleWindowBlur.bind(this),this._loopComplete=this._loopComplete.bind(this),this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._switchInstance=this._switchInstance.bind(this),this._handleSettingsClick=this._handleSettingsClick.bind(this),this.togglePlay=this.togglePlay.bind(this),this.stop=this.stop.bind(this),this.prev=this.prev.bind(this),this.next=this.next.bind(this),this._renderControls=this._renderControls.bind(this),this.snapshot=this.snapshot.bind(this),this.toggleLoop=this.toggleLoop.bind(this),this.toggleBoomerang=this.toggleBoomerang.bind(this),this.destroy=this.destroy.bind(this),this.template=document.createElement("template"),this.shadow=this.attachShadow({mode:"open"})}addAnimation(t){throw Error(nP)}async attributeChangedCallback(t,e,s){if(this._lottieInstance&&this.shadow&&this._container)switch(t){case"animateOnScroll":if(""===s||s){this._lottieInstance.autoplay=!1,addEventListener("scroll",this._handleScroll,{capture:!0,passive:!0});return}removeEventListener("scroll",this._handleScroll,!0);break;case"autoplay":if(this.animateOnScroll||this.playOnVisible)return;if(""===s||s)return void this.play();this.stop();break;case"controls":this._renderControls();break;case"direction":if(-1===Number(s))return void this.setDirection(-1);this.setDirection(1);break;case"hover":if(""===s||s){this._container.addEventListener("mouseenter",this._mouseEnter),this._container.addEventListener("mouseleave",this._mouseLeave);return}this._container.removeEventListener("mouseenter",this._mouseEnter),this._container.removeEventListener("mouseleave",this._mouseLeave);break;case"loop":{let t=this.shadow.querySelector(".toggleLoop");t instanceof HTMLButtonElement&&(t.dataset.active=s),this.setLoop(""===s||!!s);break}case"mode":{let t=this.shadow.querySelector(".toggleBoomerang");t instanceof HTMLButtonElement&&(t.dataset.active=(s===D.Bounce).toString()),this._isBounce=s===D.Bounce;break}case"playOnClick":if(""===s||s){this._lottieInstance.autoplay=!1,this._container.addEventListener("click",this._handleClick);return}this._container.removeEventListener("click",this._handleClick);break;case"playOnVisible":(""===s||s)&&(this._lottieInstance.autoplay=!1);break;case"selector":{let t=document.getElementById(this.selector??"");t?.addEventListener("click",this._handleClick);break}case"speed":{let t=Number(s);t&&!isNaN(t)&&this.setSpeed(t);break}case"src":await this.load(s);break;case"subframe":this.setSubframe(""===s||!!s)}}connectedCallback(){super.connectedCallback();try{(async()=>{if(await this._render(),!this.shadow)throw Error("Missing Shadow element");this._container=this.shadow.querySelector(".animation"),await this.load(this.src),void 0!==document.hidden&&document.addEventListener("visibilitychange",this._onVisibilityChange),this._addIntersectionObserver(),this.dispatchEvent(new CustomEvent(F.Rendered))})()}catch(t){console.error(t),this.dispatchEvent(new CustomEvent(F.Error))}}convert(t){throw Error(nP)}destroy(){this._lottieInstance?.destroy&&(this.playerState=n_.Destroyed,this._lottieInstance.destroy(),this._lottieInstance=null,this.dispatchEvent(new CustomEvent(F.Destroyed)),this.remove(),document.removeEventListener("visibilitychange",this._onVisibilityChange))}disconnectedCallback(){this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.destroy()}getLottie(){return this._lottieInstance}getManifest(){return this._manifest}getMultiAnimationSettings(){return this._multiAnimationSettings}getSegment(){return this._segment}async load(t){try{if(!this.shadowRoot||!t)return;this.source=t;let{animations:e,isDotLottie:s,manifest:i}=await na(t);if(!e||e.some(t=>!["v","ip","op","layers","fr","w","h"].every(e=>Object.hasOwn(t,e))))throw Error("Broken or corrupted file");let r=this.parentElement?.querySelector('script[type="application/ld+json"]');if(r){let t=JSON.parse(r.innerHTML);t.selector&&(this.selector=t.selector),t.segment&&this.setSegment(t.segment),t.multiAnimationSettings&&this.setMultiAnimationSettings(t.multiAnimationSettings)}this._isBounce=this.mode===D.Bounce,this._multiAnimationSettings.length>0&&this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===D.Bounce);let a=i?.animations[0];a&&(a.autoplay=!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,a.loop=this.loop),this._isDotLottie=s,this._animations=e,this._manifest=i??{animations:[{autoplay:!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,direction:this.direction,id:g(),loop:this.loop,mode:this.mode,speed:this.speed}]},this._lottieInstance?.destroy(),this.playerState=n_.Stopped,!this.animateOnScroll&&(this.autoplay||this._multiAnimationSettings[this._currentAnimation]?.autoplay||this.playOnVisible)&&(this.playerState=n_.Playing),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:e[this._currentAnimation]}),this._addEventListeners();let n=this._multiAnimationSettings[this._currentAnimation]?.speed??this.speed,o=this._multiAnimationSettings[this._currentAnimation]?.direction??this.direction;if(this._lottieInstance.setSpeed(n),this._lottieInstance.setDirection(o),this._lottieInstance.setSubframe(!!this.subframe),(this.autoplay||this.animateOnScroll||this.playOnVisible)&&-1===this.direction&&this.seek("99%"),this._renderControls(),this.autoplay||this.playOnVisible){let t=this.shadow?.querySelector(".togglePlay");t&&(t.innerHTML=nk)}}catch(t){console.error(t),this._errorMessage=nx(t).message,this.playerState=n_.Error,this.dispatchEvent(new CustomEvent(F.Error))}}loadAnimation(t){throw Error(nP)}next(){this._currentAnimation++,this._switchInstance()}pause(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(F.Pause))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?n_.Error:n_.Paused}}play(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.play(),this.dispatchEvent(new CustomEvent(F.Play))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?n_.Error:n_.Playing}}prev(){this._currentAnimation--,this._switchInstance(!0)}propertyChangedCallback(t,e,s){if(!this.shadow)return;let i=this.shadow.querySelector(".togglePlay"),r=this.shadow.querySelector(".stop"),a=this.shadow.querySelector(".prev"),n=this.shadow.querySelector(".next"),o=this.shadow.querySelector(".seeker"),h=this.shadow.querySelector("progress"),l=this.shadow.querySelector(".popover"),p=this.shadow.querySelector(".convert"),c=this.shadow.querySelector(".snapshot");i instanceof HTMLButtonElement&&r instanceof HTMLButtonElement&&n instanceof HTMLButtonElement&&a instanceof HTMLButtonElement&&o instanceof HTMLInputElement&&h instanceof HTMLProgressElement&&("playerState"===t&&(i.dataset.active=(s===n_.Playing||s===n_.Paused).toString(),r.dataset.active=(s===n_.Stopped).toString(),s===n_.Playing?i.innerHTML=nk:i.innerHTML=nd),"_seeker"===t&&"number"==typeof s&&(o.value=s.toString(),o.ariaValueNow=s.toString(),h.value=s),"_animations"===t&&Array.isArray(s)&&this._currentAnimation+1<s.length&&(n.hidden=!1),"_currentAnimation"===t&&"number"==typeof s&&(n.hidden=s+1>=this._animations.length,a.hidden=!s),"_isSettingsOpen"===t&&"boolean"==typeof s&&l instanceof HTMLDivElement&&p instanceof HTMLButtonElement&&c instanceof HTMLButtonElement&&(l.hidden=!s,p.hidden=this.isLight,c.hidden=this.renderer!==L.SVG))}async reload(){this._lottieInstance&&this.src&&(this._lottieInstance.destroy(),await this.load(this.src))}seek(t){if(!this._lottieInstance)return;let e=t.toString().match(/^(\d+)(%?)$/);if(!e)return;let s=Math.round("%"===e[2]?this._lottieInstance.totalFrames*Number(e[1])/100:Number(e[1]));if(this._seeker=s,this.playerState===n_.Playing||this.playerState===n_.Frozen&&this._playerState.prev===n_.Playing){this._lottieInstance.goToAndPlay(s,!0),this.playerState=n_.Playing;return}this._lottieInstance.goToAndStop(s,!0),this._lottieInstance.pause()}setCount(t){this.count=t}setDirection(t){this._lottieInstance&&this._lottieInstance.setDirection(t)}setLoop(t){this._lottieInstance&&this._lottieInstance.setLoop(t)}setMultiAnimationSettings(t){this._multiAnimationSettings=t}setSegment(t){this._segment=t}setSpeed(t=1){this._lottieInstance&&this._lottieInstance.setSpeed(t)}setSubframe(t){this._lottieInstance&&this._lottieInstance.setSubframe(t)}snapshot(t=!0,e="AM Lottie"){try{var s,i;let r,a,n,o;if(!this.shadowRoot)throw Error("Unknown error");let h=this.shadowRoot.querySelector(".animation svg");if(!h)throw Error("Could not retrieve animation from DOM");let l=h instanceof Node?new XMLSerializer().serializeToString(h):null;if(!l)throw Error("Could not serialize SVG element");return t&&(i={mimeType:"image/svg+xml",name:`${s=this.src||e,(t=>{let e;if("string"==typeof t&&t&&((e=t?.split("/").pop()?.lastIndexOf("."))??0)>1&&t&&t.length-1>(e??0))return t.split(".").pop()?.toLowerCase()})(s),`${s.split("/").pop()?.replace(/\.[^.]*$/,"").replaceAll(/\W+/g,"-")}`}-${((this._seeker??0)+1).toString().padStart(3,"0")}.svg`},r=new Blob([l],{type:i?.mimeType}),a=i?.name||g(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=a,o.hidden=!0,document.body.appendChild(o),o.click(),setTimeout(()=>{o.remove(),URL.revokeObjectURL(n)},1e3)),l}catch(t){return console.error(t),null}}stop(){if(this._lottieInstance){this._playerState.prev=this.playerState,this._playerState.count=0;try{this._lottieInstance.stop(),this.dispatchEvent(new CustomEvent(F.Stop))}finally{this.playerState=n_.Stopped}}}toggleBoomerang(){let t=this._multiAnimationSettings[this._currentAnimation]??{};if(void 0!==t.mode){if(t.mode===D.Normal){t.mode=D.Bounce,this._isBounce=!0;return}t.mode=D.Normal,this._isBounce=!1;return}if(this.mode===D.Normal){this.mode=D.Bounce,this._isBounce=!0;return}this.mode=D.Normal,this._isBounce=!1}toggleLoop(){let t=!this.loop;this.loop=t,this.setLoop(t)}togglePlay(){if(!this._lottieInstance)return;let{currentFrame:t,playDirection:e,totalFrames:s}=this._lottieInstance;if(this.playerState===n_.Playing)return void this.pause();if(this.playerState!==n_.Completed)return void this.play();if(this.playerState=n_.Playing,this._isBounce){this.setDirection(-1*e),this._lottieInstance.goToAndPlay(t,!0);return}-1===e?this._lottieInstance.goToAndPlay(s,!0):this._lottieInstance.goToAndPlay(0,!0)}_freeze(){if(this._lottieInstance){this._playerState.prev=this.playerState;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(F.Freeze))}finally{this.playerState=n_.Frozen}}}_handleBlur(){setTimeout(()=>{this._toggleSettings(!1)},200)}_handleClick(){(this.playOnClick||this.selector)&&this.togglePlay()}_handleSeekChange({target:t}){!(!(t instanceof HTMLInputElement)||!this._lottieInstance||isNaN(Number(t.value)))&&this.seek(Math.round(Number(t.value)/100*this._lottieInstance.totalFrames))}_handleSettingsClick({target:t}){this._toggleSettings(),t instanceof HTMLElement&&t.focus()}setOptions(t){throw Error("Method not implemented")}_addEventListeners(){this._toggleEventListeners("add")}_addIntersectionObserver(){if(this._container&&!this._intersectionObserver){if(!("IntersectionObserver"in window)){this._intersectionObserverFallback(),removeEventListener("scroll",this._intersectionObserverFallback,!0),addEventListener("scroll",this._intersectionObserverFallback,{capture:!0,passive:!0});return}this._intersectionObserver=new IntersectionObserver(t=>{let{length:e}=t;for(let s=0;s<e;s++){if(!t[s]?.isIntersecting||document.hidden){this.playerState===n_.Playing&&this._freeze(),this._playerState.visible=!1;continue}this.animateOnScroll||this.playOnVisible||this.playerState!==n_.Frozen||this.play(),this.playOnVisible&&(this.playerState!==n_.Completed||this.once?setTimeout(()=>{this.play()},this.delay):(this.playerState=n_.Playing,this._lottieInstance?.goToAndPlay(1===this.direction?0:this._lottieInstance.totalFrames))),!this._playerState.scrollY&&(t[s]?.boundingClientRect.y||0)>0&&(this._playerState.scrollY=scrollY),this._playerState.visible=!0}}),this._intersectionObserver.observe(this._container)}}_complete(){if(!this._lottieInstance)return;if(this._animations.length>1){if(this._multiAnimationSettings[this._currentAnimation+1]?.autoplay)return void this.next();if(this.loop&&this._currentAnimation===this._animations.length-1){this._currentAnimation=0,this._switchInstance();return}}let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.playerState=n_.Completed,this.dispatchEvent(new CustomEvent(F.Complete,{detail:{frame:t,seeker:this._seeker}}))}_dataFailed(){this.playerState=n_.Error,this.dispatchEvent(new CustomEvent(F.Error))}_dataReady(){this.dispatchEvent(new CustomEvent(F.Load))}_DOMLoaded(){this._playerState.loaded=!0,this.dispatchEvent(new CustomEvent(F.Ready))}_enterFrame(){if(!this._lottieInstance)return;let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.dispatchEvent(new CustomEvent(F.Frame,{detail:{frame:t,seeker:this._seeker}}))}_getOptions(){if(!this._container)throw Error("Container not rendered");let t=this.preserveAspectRatio??(t=>{switch(t){case nb.Contain:case nb.ScaleDown:return $.Contain;case nb.Cover:return $.Cover;case nb.Fill:return $.Initial;case nb.None:return $.None;default:return $.Contain}})(this.objectfit),e=this._multiAnimationSettings.length>0?this._multiAnimationSettings[this._currentAnimation]:void 0,s=this._manifest?.animations[this._currentAnimation],i=!!this.loop;s?.loop!==void 0&&(i=!!s.loop),e?.loop!==void 0&&(i=!!e.loop);let r=!!this.autoplay;s?.autoplay!==void 0&&(r=!!s.autoplay),e?.autoplay!==void 0&&(r=!!e.autoplay),this.animateOnScroll&&(r=!1);let a=this._segment;return this._segment?.every(t=>t>0)&&(a=[this._segment[0]-1,this._segment[1]-1]),this._segment?.some(t=>t<0)&&(a=void 0),this.setOptions({container:this._container,hasAutoplay:r,hasLoop:i,initialSegment:a,preserveAspectRatio:t,rendererType:this.renderer})}_handleScroll(){if(!this.animateOnScroll||!this._lottieInstance)return;if(N)return void console.warn("DotLottie: Scroll animations might not work properly in a Server Side Rendering context. Try to wrap this in a client component.");if(!this._playerState.visible)return;this._playerState.scrollTimeout&&clearTimeout(this._playerState.scrollTimeout),this._playerState.scrollTimeout=setTimeout(()=>{this.playerState=n_.Paused},400);let{totalFrames:t}=this._lottieInstance,e=scrollY-this._playerState.scrollY;scrollY<=this._playerState.scrollY&&(e=this._playerState.scrollY-scrollY);let s=((t,e=0,s=100)=>{let i=e,r=s;if(i>r){let t=r;r=i,i=t}return Math.min(Math.max(t,i),r)})(e/innerHeight*(t-1),0,t);requestAnimationFrame(()=>{if(s>=t){this.playerState=n_.Paused;return}this.playerState=n_.Playing,this._lottieInstance?.goToAndStop(s,!0)})}_handleWindowBlur({type:t}){this.dontFreezeOnBlur||(this.playerState===n_.Playing&&"blur"===t&&this._freeze(),this.playerState===n_.Frozen&&"focus"===t&&this.play())}_intersectionObserverFallback(){if(!this._container)return;let{bottom:t,left:e,right:s,top:i}=this._container.getBoundingClientRect();this._playerState.visible=i>=0&&e>=0&&t<=innerHeight&&s<=innerWidth,(this.autoplay||this.playOnVisible||this.playerState===n_.Playing||this.playerState===n_.Frozen)&&(this._playerState.visible?this.play():this._freeze())}_loopComplete(){if(!this._lottieInstance)return;let{playDirection:t,totalFrames:e}=this._lottieInstance,s=this._segment?this._segment[0]:0,i=this._segment?this._segment[0]:e;if(this.count&&(this._isBounce?this._playerState.count+=.5:this._playerState.count+=1,this._playerState.count>=this.count)){this.setLoop(!1),this.playerState=n_.Completed,this.dispatchEvent(new CustomEvent(F.Complete));return}return(this.dispatchEvent(new CustomEvent(F.Loop)),this._isBounce)?(this._lottieInstance.goToAndStop(-1===t?s:.99*i,!0),this._lottieInstance.setDirection(-1*t),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission)):(this._lottieInstance.goToAndStop(-1===t?.99*i:s,!0),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission))}_mouseEnter(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window)){if(this.mouseout===nv.Reverse&&this._lottieInstance.setDirection(1),this.playerState===n_.Completed){this._lottieInstance.goToAndPlay(0,!0),this.playerState=n_.Playing;return}this.playerState!==n_.Playing&&this.play()}}_mouseLeave(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window))switch(this.mouseout){case nv.Void:break;case nv.Pause:this.pause();break;case nv.Reverse:this._lottieInstance.setDirection(-1),this.play();break;default:this.stop()}}_onVisibilityChange(){document.hidden&&this.playerState===n_.Playing?this._freeze():this.playerState===n_.Frozen&&this.play()}_removeEventListeners(){this._toggleEventListeners("remove")}_switchInstance(t=!1){if(this._animations[this._currentAnimation])try{if(this._lottieInstance&&this._lottieInstance.destroy(),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:this._animations[this._currentAnimation]}),this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===D.Bounce),this._removeEventListeners(),this._addEventListeners(),this.dispatchEvent(new CustomEvent(t?F.Previous:F.Next)),this._multiAnimationSettings[this._currentAnimation]?.autoplay??this.autoplay){if(this.animateOnScroll){this._lottieInstance.goToAndStop(0,!0),this.playerState=n_.Paused;return}this._lottieInstance.goToAndPlay(0,!0),this.playerState=n_.Playing;return}this._lottieInstance.goToAndStop(0,!0),this.playerState=n_.Stopped}catch(t){this._errorMessage=nx(t).message,this.playerState=n_.Error,this.dispatchEvent(new CustomEvent(F.Error))}}_toggleEventListeners(t){let e="add"===t?"addEventListener":"removeEventListener";if(this._lottieInstance&&(this._lottieInstance[e]("enterFrame",this._enterFrame),this._lottieInstance[e]("complete",this._complete),this._lottieInstance[e]("loopComplete",this._loopComplete),this._lottieInstance[e]("DOMLoaded",this._DOMLoaded),this._lottieInstance[e]("data_ready",this._dataReady),this._lottieInstance[e]("data_failed",this._dataFailed)),this.selector){let t=document.getElementById(this.selector);t?this.hover?(t[e]("mouseenter",this._mouseEnter),t[e]("mouseleave",this._mouseLeave)):t[e]("click",this._handleClick):this.selector=null}this._container&&!this.selector&&(this.hover&&(this._container[e]("mouseenter",this._mouseEnter),this._container[e]("mouseleave",this._mouseLeave)),this.playOnClick&&this._container[e]("click",this._handleClick)),window[e]("focus",this._handleWindowBlur,{capture:!1,passive:!0}),window[e]("blur",this._handleWindowBlur,{capture:!1,passive:!0}),this.animateOnScroll&&window[e]("scroll",this._handleScroll,{capture:!0,passive:!0})}_toggleSettings(t){if(void 0===t){this._isSettingsOpen=!this._isSettingsOpen;return}this._isSettingsOpen=t}}class nA extends nM{get renderer(){return L.SVG}constructor(){super(),this.loadAnimation=rN,this.isLight=!0}setOptions({container:t,hasAutoplay:e,hasLoop:s,initialSegment:i,preserveAspectRatio:r}){return{autoplay:e,container:t,initialSegment:i,loop:s,renderer:L.SVG,rendererSettings:{hideOnTransparent:!0,imagePreserveAspectRatio:r,preserveAspectRatio:r,progressiveLoad:!0}}}}globalThis.dotLottiePlayer=()=>new nA,N||customElements.define(nw,nA),t.MouseOut=nv,t.PlayMode=D,t.PlayerEvents=F,t.PlayerState=n_,t.default=nA,t.tagName=nw,Object.defineProperty(t,"__esModule",{value:!0})}(this["@aarsteinmedia/dotlottie-player"]=this["@aarsteinmedia/dotlottie-player"]||{});
70
+ `;async function nS(){if(!this.shadow||!this.template)throw Error("No Shadow Element or Template");this.template.innerHTML=`<div class="animation-container main" data-controls="${this.controls??!1}" lang="${this.description?document.documentElement.lang:"en"}" aria-label="${this.description??"Lottie animation"}" data-loaded="${this._playerState.loaded}"><figure class="animation" style="background:${this.background}">${this.playerState===n_.Error?`<div class="error"><svg preserveAspectRatio="${$.Cover}" xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080" style="white-space:preserve"><path fill="#fff" d="M0 0h1920v1080H0z"/><path fill="#3a6d8b" d="M1190.2 531 1007 212.4c-22-38.2-77.2-38-98.8.5L729.5 531.3c-21.3 37.9 6.1 84.6 49.5 84.6l361.9.3c43.7 0 71.1-47.3 49.3-85.2zM937.3 288.7c.2-7.5 3.3-23.9 23.2-23.9 16.3 0 23 16.1 23 23.5 0 55.3-10.7 197.2-12.2 214.5-.1 1-.9 1.7-1.9 1.7h-18.3c-1 0-1.8-.7-1.9-1.7-1.4-17.5-13.4-162.9-11.9-214.1zm24.2 283.8c-13.1 0-23.7-10.6-23.7-23.7s10.6-23.7 23.7-23.7 23.7 10.6 23.7 23.7-10.6 23.7-23.7 23.7zM722.1 644h112.6v34.4h-70.4V698h58.8v31.7h-58.8v22.6h72.4v36.2H722.1V644zm162 57.1h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6zm78.9 0h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5H963v15.6zm39.5 36.2c0-31.3 22.2-54.8 56.6-54.8 34.4 0 56.2 23.5 56.2 54.8s-21.8 54.6-56.2 54.6c-34.4-.1-56.6-23.3-56.6-54.6zm74 0c0-17.4-6.1-29.1-17.8-29.1-11.7 0-17.4 11.7-17.4 29.1 0 17.4 5.7 29.1 17.4 29.1s17.8-11.8 17.8-29.1zm83.1-36.2h.6c8.3-12.9 18.2-17.8 31.3-17.8 3 0 5.1.4 6.3 1v32.6h-.8c-22.4-3.8-35.6 6.3-35.6 29.5v42.3h-38.2V685.5h36.4v15.6z"/><path fill="none" d="M718.9 807.7h645v285.4h-645z"/><text fill="#3a6d8b" style="text-align:center;position:absolute;left:100%;font-size:47px;font-family:system-ui,-apple-system,BlinkMacSystemFont,'.SFNSText-Regular',sans-serif" x="50%" y="848.017" text-anchor="middle">${this._errorMessage}</text></svg></div>`:""}</figure><slot name="controls"></slot></div>`,this.shadow.adoptedStyleSheets=[await nM.styles()],this.shadow.appendChild(this.template.content.cloneNode(!0))}let nx=t=>{let e={message:"Unknown error",status:N?500:400};return t&&"object"==typeof t&&("message"in t&&"string"==typeof t.message&&(e.message=t.message),"status"in t&&(e.status=Number(t.status))),e},nP="Method is not implemented";class nM extends nh{static get observedAttributes(){return["animateOnScroll","autoplay","controls","direction","hover","loop","mode","playOnClick","playOnVisible","selector","speed","src","subframe"]}static get observedProperties(){return["playerState","_isSettingsOpen","_seeker","_currentAnimation","_animations"]}static get styles(){return async()=>{let t=new CSSStyleSheet;return await t.replace("* {\n box-sizing: border-box;\n}\n\n:host {\n --lottie-player-toolbar-height: 35px;\n --lottie-player-toolbar-background-color: #fff;\n --lottie-player-toolbar-icon-color: #000;\n --lottie-player-toolbar-icon-hover-color: #000;\n --lottie-player-toolbar-icon-active-color: #4285f4;\n --lottie-player-seeker-track-color: rgb(0 0 0 / 20%);\n --lottie-player-seeker-thumb-color: #4285f4;\n --lottie-player-seeker-display: block;\n\n width: 100%;\n height: 100%;\n\n &:not([hidden]) {\n display: block;\n }\n\n .main {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n\n .animation {\n width: 100%;\n height: 100%;\n display: flex;\n margin: 0;\n padding: 0;\n }\n\n [data-controls='true'] .animation {\n height: calc(100% - 35px);\n }\n\n .animation-container {\n position: relative;\n }\n\n .popover {\n position: absolute;\n right: 5px;\n bottom: 40px;\n background-color: var(--lottie-player-toolbar-background-color);\n border-radius: 5px;\n padding: 10px 15px;\n border: solid 2px var(--lottie-player-toolbar-icon-color);\n animation: fade-in 0.2s ease-in-out;\n\n &::before {\n content: '';\n right: 10px;\n border: 7px solid transparent;\n margin-right: -7px;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n top: 100%;\n border-top-color: var(--lottie-player-toolbar-icon-color);\n }\n }\n\n .error {\n display: flex;\n margin: auto;\n justify-content: center;\n height: 100%;\n align-items: center;\n\n & svg {\n width: 100%;\n height: auto;\n }\n }\n\n .toolbar {\n display: flex;\n place-items: center center;\n background: var(--lottie-player-toolbar-background-color);\n margin: 0;\n height: 35px;\n padding: 5px;\n border-radius: 5px;\n gap: 5px;\n\n &.has-error {\n pointer-events: none;\n opacity: 0.5;\n }\n\n & button {\n cursor: pointer;\n fill: var(--lottie-player-toolbar-icon-color);\n color: var(--lottie-player-toolbar-icon-color);\n background: none;\n border: 0;\n padding: 0;\n outline: 0;\n height: 100%;\n margin: 0;\n align-items: center;\n gap: 5px;\n opacity: 0.9;\n\n &:not([hidden]) {\n display: flex;\n }\n\n &:hover {\n opacity: 1;\n }\n\n &[data-active='true'] {\n opacity: 1;\n fill: var(--lottie-player-toolbar-icon-active-color);\n }\n\n &:disabled {\n opacity: 0.5;\n }\n\n &:focus {\n outline: 0;\n }\n\n & svg {\n pointer-events: none;\n\n & > * {\n fill: inherit;\n }\n }\n\n &.disabled svg {\n display: none;\n }\n }\n }\n\n .progress-container {\n position: relative;\n width: 100%;\n\n &.simple {\n margin-right: 12px;\n }\n }\n\n .seeker {\n appearance: none;\n outline: none;\n width: 100%;\n height: 20px;\n border-radius: 3px;\n border: 0;\n cursor: pointer;\n background-color: transparent;\n\n display: var(--lottie-player-seeker-display);\n color: var(--lottie-player-seeker-thumb-color);\n margin: 0;\n padding: 7.5px 0;\n position: relative;\n z-index: 1;\n\n &::-webkit-slider-runnable-track,\n &::-webkit-slider-thumb {\n appearance: none;\n outline: none;\n }\n\n &::-webkit-slider-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n border: 0;\n background-color: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -webkit-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-webkit-slider-thumb,\n &:focus::-webkit-slider-thumb {\n transform: scale(1);\n }\n\n &::-moz-range-progress {\n background-color: var(--lottie-player-seeker-thumb-color);\n height: 5px;\n border-radius: 3px;\n }\n\n &::-moz-range-thumb {\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: var(--lottie-player-seeker-thumb-color);\n border: 0;\n cursor: pointer;\n -moz-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-moz-range-thumb,\n &:focus::-moz-range-thumb {\n transform: scale(1);\n }\n\n &::-ms-track {\n width: 100%;\n height: 5px;\n cursor: pointer;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n border-radius: 3px;\n }\n\n &::-ms-fill-lower {\n background-color: var(--lottie-player-seeker-thumb-color);\n border-radius: 3px;\n }\n\n &::-ms-thumb {\n border: 0;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background: var(--lottie-player-seeker-thumb-color);\n cursor: pointer;\n -ms-transition: transform 0.2s ease-in-out;\n transition: transform 0.2s ease-in-out;\n transform: scale(0);\n }\n\n &:hover::-ms-thumb {\n transform: scale(1);\n }\n\n &:focus {\n &::-ms-thumb {\n transform: scale(1);\n }\n\n &::-ms-fill-lower,\n &::-ms-fill-upper {\n background: var(--lottie-player-seeker-track-color);\n }\n }\n }\n\n & progress {\n appearance: none;\n outline: none;\n position: absolute;\n width: 100%;\n height: 5px;\n border-radius: 3px;\n border: 0;\n top: 0;\n left: 0;\n margin: 7.5px 0;\n background-color: var(--lottie-player-seeker-track-color);\n pointer-events: none;\n\n &::-webkit-progress-inner-element {\n border-radius: 3px;\n overflow: hidden;\n }\n\n &::-webkit-slider-runnable-track {\n background-color: transparent;\n }\n\n &::-webkit-progress-value {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n }\n\n & *::-moz-progress-bar {\n background-color: var(--lottie-player-seeker-thumb-color);\n }\n}\n\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --lottie-player-toolbar-background-color: #000;\n --lottie-player-toolbar-icon-color: #fff;\n --lottie-player-toolbar-icon-hover-color: #fff;\n --lottie-player-seeker-track-color: rgb(255 255 255 / 60%);\n }\n}\n"),t}}set animateOnScroll(t){this.setAttribute("animateOnScroll",(!!t).toString())}get animateOnScroll(){let t=this.getAttribute("animateOnScroll");return"true"===t||""===t||"1"===t}get animations(){return this._animations}set autoplay(t){this.setAttribute("autoplay",(!!t).toString())}get autoplay(){let t=this.getAttribute("autoplay");return"true"===t||""===t||"1"===t}set background(t){this.setAttribute("background",t)}get background(){return this.getAttribute("background")||"transparent"}set controls(t){this.setAttribute("controls",(!!t).toString())}get controls(){let t=this.getAttribute("controls");return"true"===t||""===t||"1"===t}set count(t){this.setAttribute("count",t.toString())}get count(){let t=this.getAttribute("count");return t?Number(t):0}get currentAnimation(){return this._currentAnimation}set delay(t){this.setAttribute("delay",t.toString())}get delay(){let t=this.getAttribute("delay");return t?Number(t):0}set description(t){t&&this.setAttribute("description",t)}get description(){return this.getAttribute("description")}set direction(t){this.setAttribute("direction",t.toString())}get direction(){let t=Number(this.getAttribute("direction"));return -1===t?t:1}set dontFreezeOnBlur(t){this.setAttribute("dontFreezeOnBlur",(!!t).toString())}get dontFreezeOnBlur(){let t=this.getAttribute("dontFreezeOnBlur");return"true"===t||""===t||"1"===t}set hover(t){this.setAttribute("hover",(!!t).toString())}get hover(){let t=this.getAttribute("hover");return"true"===t||""===t||"1"===t}set intermission(t){this.setAttribute("intermission",t.toString())}get intermission(){let t=Number(this.getAttribute("intermission"));return isNaN(t)?0:t}get isDotLottie(){return this._isDotLottie}set loop(t){this.setAttribute("loop",(!!t).toString())}get loop(){let t=this.getAttribute("loop");return"true"===t||""===t||"1"===t}set mode(t){this.setAttribute("mode",t)}get mode(){let t=this.getAttribute("mode");return t===D.Bounce?t:D.Normal}set mouseout(t){this.setAttribute("mouseout",t)}get mouseout(){let t=this.getAttribute("mouseout");switch(t){case nv.Void:case nv.Pause:case nv.Reverse:return t;default:return nv.Stop}}set objectfit(t){this.setAttribute("objectfit",t)}get objectfit(){let t=this.getAttribute("objectfit");return t&&Object.values(nb).includes(t)?t:nb.Contain}set once(t){this.setAttribute("once",(!!t).toString())}get once(){let t=this.getAttribute("once");return"true"===t||""===t||"1"===t}set playOnClick(t){this.setAttribute("playOnClick",(!!t).toString())}get playOnClick(){let t=this.getAttribute("playOnClick");return"true"===t||""===t||"1"===t}set playOnVisible(t){this.setAttribute("playOnVisible",(!!t).toString())}get playOnVisible(){let t=this.getAttribute("playOnVisible");return"true"===t||""===t||"1"===t}set preserveAspectRatio(t){this.setAttribute("preserveAspectRatio",t||$.Contain)}get preserveAspectRatio(){let t=this.getAttribute("preserveAspectRatio");return t&&Object.values($).includes(t)?t:null}set renderer(t){this.setAttribute("renderer",t)}get renderer(){let t=this.getAttribute("renderer");return t===L.Canvas||t===L.HTML?t:L.SVG}set selector(t){t?this.setAttribute("selector",t):this.removeAttribute("selector")}get selector(){return this.getAttribute("selector")}set simple(t){this.setAttribute("simple",(!!t).toString())}get simple(){let t=this.getAttribute("simple");return"true"===t||""===t||"1"===t}set speed(t){this.setAttribute("speed",t.toString())}get speed(){let t=this.getAttribute("speed");return null===t||isNaN(Number(t))?1:Number(t)}set src(t){this.setAttribute("src",t||"")}get src(){return this.getAttribute("src")}set subframe(t){this.setAttribute("subframe",(!!t).toString())}get subframe(){let t=this.getAttribute("subframe");return"true"===t||""===t||"1"===t}constructor(){super(),this.isLight=!1,this.playerState=n_.Loading,this._container=null,this._errorMessage="Something went wrong",this._identifier=this.id||g(),this._isSettingsOpen=!1,this._playerState={count:0,loaded:!1,prev:n_.Loading,scrollTimeout:null,scrollY:0,visible:!1},this._render=nS,this._renderControls=nE,this._seeker=0,this._animations=[],this._currentAnimation=0,this._isBounce=!1,this._isDotLottie=!1,this._lottieInstance=null,this._multiAnimationSettings=[],this._complete=this._complete.bind(this),this._dataFailed=this._dataFailed.bind(this),this._dataReady=this._dataReady.bind(this),this._DOMLoaded=this._DOMLoaded.bind(this),this._enterFrame=this._enterFrame.bind(this),this._freeze=this._freeze.bind(this),this._handleBlur=this._handleBlur.bind(this),this._handleClick=this._handleClick.bind(this),this._handleScroll=this._handleScroll.bind(this),this._handleSeekChange=this._handleSeekChange.bind(this),this._handleWindowBlur=this._handleWindowBlur.bind(this),this._loopComplete=this._loopComplete.bind(this),this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._switchInstance=this._switchInstance.bind(this),this._handleSettingsClick=this._handleSettingsClick.bind(this),this.togglePlay=this.togglePlay.bind(this),this.stop=this.stop.bind(this),this.prev=this.prev.bind(this),this.next=this.next.bind(this),this._renderControls=this._renderControls.bind(this),this.snapshot=this.snapshot.bind(this),this.toggleLoop=this.toggleLoop.bind(this),this.toggleBoomerang=this.toggleBoomerang.bind(this),this.destroy=this.destroy.bind(this),this.template=document.createElement("template"),this.shadow=this.attachShadow({mode:"open"})}addAnimation(t){throw Error(nP)}async attributeChangedCallback(t,e,s){if(this._lottieInstance&&this.shadow&&this._container)switch(t){case"animateOnScroll":if(""===s||s){this._lottieInstance.autoplay=!1,addEventListener("scroll",this._handleScroll,{capture:!0,passive:!0});return}removeEventListener("scroll",this._handleScroll,!0);break;case"autoplay":if(this.animateOnScroll||this.playOnVisible)return;if(""===s||s)return void this.play();this.stop();break;case"controls":this._renderControls();break;case"direction":if(-1===Number(s))return void this.setDirection(-1);this.setDirection(1);break;case"hover":if(""===s||s){this._container.addEventListener("mouseenter",this._mouseEnter),this._container.addEventListener("mouseleave",this._mouseLeave);return}this._container.removeEventListener("mouseenter",this._mouseEnter),this._container.removeEventListener("mouseleave",this._mouseLeave);break;case"loop":{let t=this.shadow.querySelector(".toggleLoop");t instanceof HTMLButtonElement&&(t.dataset.active=s),this.setLoop(""===s||!!s);break}case"mode":{let t=this.shadow.querySelector(".toggleBoomerang");t instanceof HTMLButtonElement&&(t.dataset.active=(s===D.Bounce).toString()),this._isBounce=s===D.Bounce;break}case"playOnClick":if(""===s||s){this._lottieInstance.autoplay=!1,this._container.addEventListener("click",this._handleClick);return}this._container.removeEventListener("click",this._handleClick);break;case"playOnVisible":(""===s||s)&&(this._lottieInstance.autoplay=!1);break;case"selector":{let t=document.getElementById(this.selector??"");t?.addEventListener("click",this._handleClick);break}case"speed":{let t=Number(s);t&&!isNaN(t)&&this.setSpeed(t);break}case"src":await this.load(s);break;case"subframe":this.setSubframe(""===s||!!s)}}connectedCallback(){super.connectedCallback();try{(async()=>{if(await this._render(),!this.shadow)throw Error("Missing Shadow element");this._container=this.shadow.querySelector(".animation"),await this.load(this.src),void 0!==document.hidden&&document.addEventListener("visibilitychange",this._onVisibilityChange),this._addIntersectionObserver(),this.dispatchEvent(new CustomEvent(F.Rendered))})()}catch(t){console.error(t),this.dispatchEvent(new CustomEvent(F.Error))}}convert(t){throw Error(nP)}destroy(){this._lottieInstance?.destroy&&(this.playerState=n_.Destroyed,this._lottieInstance.destroy(),this._lottieInstance=null,this.dispatchEvent(new CustomEvent(F.Destroyed)),this.remove(),document.removeEventListener("visibilitychange",this._onVisibilityChange))}disconnectedCallback(){this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=void 0),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.destroy()}getLottie(){return this._lottieInstance}getManifest(){return this._manifest}getMultiAnimationSettings(){return this._multiAnimationSettings}getSegment(){return this._segment}async load(t){try{if(!this.shadowRoot||!t)return;this.source=t;let{animations:e,isDotLottie:s,manifest:i}=await na(t);if(!e||e.some(t=>!["v","ip","op","layers","fr","w","h"].every(e=>Object.hasOwn(t,e))))throw Error("Broken or corrupted file");let r=this.parentElement?.querySelector('script[type="application/ld+json"]');if(r){let t=JSON.parse(r.innerHTML);t.selector&&(this.selector=t.selector),t.segment&&this.setSegment(t.segment),t.multiAnimationSettings&&this.setMultiAnimationSettings(t.multiAnimationSettings)}this._isBounce=this.mode===D.Bounce,this._multiAnimationSettings.length>0&&this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===D.Bounce);let a=i?.animations[0];a&&(a.autoplay=!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,a.loop=this.loop),this._isDotLottie=s,this._animations=e,this._manifest=i??{animations:[{autoplay:!this.animateOnScroll&&!this.playOnVisible&&this.autoplay,direction:this.direction,id:g(),loop:this.loop,mode:this.mode,speed:this.speed}]},this._lottieInstance?.destroy(),this.playerState=n_.Stopped,!this.animateOnScroll&&(this.autoplay||this._multiAnimationSettings[this._currentAnimation]?.autoplay||this.playOnVisible)&&(this.playerState=n_.Playing),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:e[this._currentAnimation]}),this._addEventListeners();let n=this._multiAnimationSettings[this._currentAnimation]?.speed??this.speed,o=this._multiAnimationSettings[this._currentAnimation]?.direction??this.direction;if(this._lottieInstance.setSpeed(n),this._lottieInstance.setDirection(o),this._lottieInstance.setSubframe(!!this.subframe),(this.autoplay||this.animateOnScroll||this.playOnVisible)&&-1===this.direction&&this.seek("99%"),this._renderControls(),this.autoplay||this.playOnVisible){let t=this.shadow?.querySelector(".togglePlay");t&&(t.innerHTML=nk)}}catch(t){console.error(t),this._errorMessage=nx(t).message,this.playerState=n_.Error,this.dispatchEvent(new CustomEvent(F.Error))}}loadAnimation(t){throw Error(nP)}next(){this._currentAnimation++,this._switchInstance()}pause(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(F.Pause))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?n_.Error:n_.Paused}}play(){if(!this._lottieInstance)return;this._playerState.prev=this.playerState;let t=!1;try{this._lottieInstance.play(),this.dispatchEvent(new CustomEvent(F.Play))}catch(e){t=!0,console.error(e)}finally{this.playerState=t?n_.Error:n_.Playing}}prev(){this._currentAnimation--,this._switchInstance(!0)}propertyChangedCallback(t,e,s){if(!this.shadow)return;let i=this.shadow.querySelector(".togglePlay"),r=this.shadow.querySelector(".stop"),a=this.shadow.querySelector(".prev"),n=this.shadow.querySelector(".next"),o=this.shadow.querySelector(".seeker"),h=this.shadow.querySelector("progress"),l=this.shadow.querySelector(".popover"),p=this.shadow.querySelector(".convert"),c=this.shadow.querySelector(".snapshot");i instanceof HTMLButtonElement&&r instanceof HTMLButtonElement&&n instanceof HTMLButtonElement&&a instanceof HTMLButtonElement&&o instanceof HTMLInputElement&&h instanceof HTMLProgressElement&&("playerState"===t&&(i.dataset.active=(s===n_.Playing||s===n_.Paused).toString(),r.dataset.active=(s===n_.Stopped).toString(),s===n_.Playing?i.innerHTML=nk:i.innerHTML=nd),"_seeker"===t&&"number"==typeof s&&(o.value=s.toString(),o.ariaValueNow=s.toString(),h.value=s),"_animations"===t&&Array.isArray(s)&&this._currentAnimation+1<s.length&&(n.hidden=!1),"_currentAnimation"===t&&"number"==typeof s&&(n.hidden=s+1>=this._animations.length,a.hidden=!s),"_isSettingsOpen"===t&&"boolean"==typeof s&&l instanceof HTMLDivElement&&p instanceof HTMLButtonElement&&c instanceof HTMLButtonElement&&(l.hidden=!s,p.hidden=this.isLight,c.hidden=this.renderer!==L.SVG))}async reload(){this._lottieInstance&&this.src&&(this._lottieInstance.destroy(),await this.load(this.src))}seek(t){if(!this._lottieInstance)return;let e=t.toString().match(/^(\d+)(%?)$/);if(!e)return;let s=Math.round("%"===e[2]?this._lottieInstance.totalFrames*Number(e[1])/100:Number(e[1]));if(this._seeker=s,this.playerState===n_.Playing||this.playerState===n_.Frozen&&this._playerState.prev===n_.Playing){this._lottieInstance.goToAndPlay(s,!0),this.playerState=n_.Playing;return}this._lottieInstance.goToAndStop(s,!0),this._lottieInstance.pause()}setCount(t){this.count=t}setDirection(t){this._lottieInstance&&this._lottieInstance.setDirection(t)}setLoop(t){this._lottieInstance&&this._lottieInstance.setLoop(t)}setMultiAnimationSettings(t){this._multiAnimationSettings=t}setSegment(t){this._segment=t}setSpeed(t=1){this._lottieInstance&&this._lottieInstance.setSpeed(t)}setSubframe(t){this._lottieInstance&&this._lottieInstance.setSubframe(t)}snapshot(t=!0,e="AM Lottie"){try{var s,i;let r,a,n,o;if(!this.shadowRoot)throw Error("Unknown error");let h=this.shadowRoot.querySelector(".animation svg");if(!h)throw Error("Could not retrieve animation from DOM");let l=h instanceof Node?new XMLSerializer().serializeToString(h):null;if(!l)throw Error("Could not serialize SVG element");return t&&(i={mimeType:"image/svg+xml",name:`${s=this.src||e,(t=>{let e;if("string"==typeof t&&t&&((e=t?.split("/").pop()?.lastIndexOf("."))??0)>1&&t&&t.length-1>(e??0))return t.split(".").pop()?.toLowerCase()})(s),`${s.split("/").pop()?.replace(/\.[^.]*$/,"").replaceAll(/\W+/g,"-")}`}-${((this._seeker??0)+1).toString().padStart(3,"0")}.svg`},r=new Blob([l],{type:i?.mimeType}),a=i?.name||g(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=a,o.hidden=!0,document.body.appendChild(o),o.click(),setTimeout(()=>{o.remove(),URL.revokeObjectURL(n)},1e3)),l}catch(t){return console.error(t),null}}stop(){if(this._lottieInstance){this._playerState.prev=this.playerState,this._playerState.count=0;try{this._lottieInstance.stop(),this.dispatchEvent(new CustomEvent(F.Stop))}finally{this.playerState=n_.Stopped}}}toggleBoomerang(){let t=this._multiAnimationSettings[this._currentAnimation]??{};if(void 0!==t.mode){if(t.mode===D.Normal){t.mode=D.Bounce,this._isBounce=!0;return}t.mode=D.Normal,this._isBounce=!1;return}if(this.mode===D.Normal){this.mode=D.Bounce,this._isBounce=!0;return}this.mode=D.Normal,this._isBounce=!1}toggleLoop(){let t=!this.loop;this.loop=t,this.setLoop(t)}togglePlay(){if(!this._lottieInstance)return;let{currentFrame:t,playDirection:e,totalFrames:s}=this._lottieInstance;if(this.playerState===n_.Playing)return void this.pause();if(this.playerState!==n_.Completed)return void this.play();if(this.playerState=n_.Playing,this._isBounce){this.setDirection(-1*e),this._lottieInstance.goToAndPlay(t,!0);return}-1===e?this._lottieInstance.goToAndPlay(s,!0):this._lottieInstance.goToAndPlay(0,!0)}_freeze(){if(this._lottieInstance){this._playerState.prev=this.playerState;try{this._lottieInstance.pause(),this.dispatchEvent(new CustomEvent(F.Freeze))}finally{this.playerState=n_.Frozen}}}_handleBlur(){setTimeout(()=>{this._toggleSettings(!1)},200)}_handleClick(){(this.playOnClick||this.selector)&&this.togglePlay()}_handleSeekChange({target:t}){!(!(t instanceof HTMLInputElement)||!this._lottieInstance||isNaN(Number(t.value)))&&this.seek(Math.round(Number(t.value)/100*this._lottieInstance.totalFrames))}_handleSettingsClick({target:t}){this._toggleSettings(),t instanceof HTMLElement&&t.focus()}setOptions(t){throw Error("Method not implemented")}_addEventListeners(){this._toggleEventListeners("add")}_addIntersectionObserver(){if(this._container&&!this._intersectionObserver){if(!("IntersectionObserver"in window)){this._intersectionObserverFallback(),removeEventListener("scroll",this._intersectionObserverFallback,!0),addEventListener("scroll",this._intersectionObserverFallback,{capture:!0,passive:!0});return}this._intersectionObserver=new IntersectionObserver(t=>{let{length:e}=t;for(let s=0;s<e;s++){if(!t[s]?.isIntersecting||document.hidden){this.playerState===n_.Playing&&this._freeze(),this._playerState.visible=!1;continue}this.animateOnScroll||this.playOnVisible||this.playerState!==n_.Frozen||this.play(),this.playOnVisible&&(this.playerState!==n_.Completed||this.once?setTimeout(()=>{this.play()},this.delay):(this.playerState=n_.Playing,this._lottieInstance?.goToAndPlay(1===this.direction?0:this._lottieInstance.totalFrames))),!this._playerState.scrollY&&(t[s]?.boundingClientRect.y||0)>0&&(this._playerState.scrollY=scrollY),this._playerState.visible=!0}}),this._intersectionObserver.observe(this._container)}}_complete(){if(!this._lottieInstance)return;if(this._animations.length>1){if(this._multiAnimationSettings[this._currentAnimation+1]?.autoplay)return void this.next();if(this.loop&&this._currentAnimation===this._animations.length-1){this._currentAnimation=0,this._switchInstance();return}}let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.playerState=n_.Completed,this.dispatchEvent(new CustomEvent(F.Complete,{detail:{frame:t,seeker:this._seeker}}))}_dataFailed(){this.playerState=n_.Error,this.dispatchEvent(new CustomEvent(F.Error))}_dataReady(){this.dispatchEvent(new CustomEvent(F.Load))}_DOMLoaded(){this._playerState.loaded=!0,this.dispatchEvent(new CustomEvent(F.Ready))}_enterFrame(){if(!this._lottieInstance)return;let{currentFrame:t,totalFrames:e}=this._lottieInstance;this._seeker=Math.round(t/e*100),this.dispatchEvent(new CustomEvent(F.Frame,{detail:{frame:t,seeker:this._seeker}}))}_getOptions(){if(!this._container)throw Error("Container not rendered");let t=this.preserveAspectRatio??(t=>{switch(t){case nb.Contain:case nb.ScaleDown:return $.Contain;case nb.Cover:return $.Cover;case nb.Fill:return $.Initial;case nb.None:return $.None;default:return $.Contain}})(this.objectfit),e=this._multiAnimationSettings.length>0?this._multiAnimationSettings[this._currentAnimation]:void 0,s=this._manifest?.animations[this._currentAnimation],i=!!this.loop;s?.loop!==void 0&&(i=!!s.loop),e?.loop!==void 0&&(i=!!e.loop);let r=!!this.autoplay;s?.autoplay!==void 0&&(r=!!s.autoplay),e?.autoplay!==void 0&&(r=!!e.autoplay),this.animateOnScroll&&(r=!1);let a=this._segment;return this._segment?.every(t=>t>0)&&(a=[this._segment[0]-1,this._segment[1]-1]),this._segment?.some(t=>t<0)&&(a=void 0),this.setOptions({container:this._container,hasAutoplay:r,hasLoop:i,initialSegment:a,preserveAspectRatio:t,rendererType:this.renderer})}_handleScroll(){if(!this.animateOnScroll||!this._lottieInstance)return;if(N)return void console.warn("DotLottie: Scroll animations might not work properly in a Server Side Rendering context. Try to wrap this in a client component.");if(!this._playerState.visible)return;this._playerState.scrollTimeout&&clearTimeout(this._playerState.scrollTimeout),this._playerState.scrollTimeout=setTimeout(()=>{this.playerState=n_.Paused},400);let{totalFrames:t}=this._lottieInstance,e=scrollY-this._playerState.scrollY;scrollY<=this._playerState.scrollY&&(e=this._playerState.scrollY-scrollY);let s=((t,e=0,s=100)=>{let i=e,r=s;if(i>r){let t=r;r=i,i=t}return Math.min(Math.max(t,i),r)})(e/innerHeight*(t-1),0,t);requestAnimationFrame(()=>{if(s>=t){this.playerState=n_.Paused;return}this.playerState=n_.Playing,this._lottieInstance?.goToAndStop(s,!0)})}_handleWindowBlur({type:t}){this.dontFreezeOnBlur||(this.playerState===n_.Playing&&"blur"===t&&this._freeze(),this.playerState===n_.Frozen&&"focus"===t&&this.play())}_intersectionObserverFallback(){if(!this._container)return;let{bottom:t,left:e,right:s,top:i}=this._container.getBoundingClientRect();this._playerState.visible=i>=0&&e>=0&&t<=innerHeight&&s<=innerWidth,(this.autoplay||this.playOnVisible||this.playerState===n_.Playing||this.playerState===n_.Frozen)&&(this._playerState.visible?this.play():this._freeze())}_loopComplete(){if(!this._lottieInstance)return;let{playDirection:t,totalFrames:e}=this._lottieInstance,s=this._segment?this._segment[0]:0,i=this._segment?this._segment[0]:e;if(this.count&&(this._isBounce?this._playerState.count+=.5:this._playerState.count+=1,this._playerState.count>=this.count)){this.setLoop(!1),this.playerState=n_.Completed,this.dispatchEvent(new CustomEvent(F.Complete));return}return(this.dispatchEvent(new CustomEvent(F.Loop)),this._isBounce)?(this._lottieInstance.goToAndStop(-1===t?s:.99*i,!0),this._lottieInstance.setDirection(-1*t),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission)):(this._lottieInstance.goToAndStop(-1===t?.99*i:s,!0),setTimeout(()=>{this.animateOnScroll||this._lottieInstance?.play()},this.intermission))}_mouseEnter(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window)){if(this.mouseout===nv.Reverse&&this._lottieInstance.setDirection(1),this.playerState===n_.Completed){this._lottieInstance.goToAndPlay(0,!0),this.playerState=n_.Playing;return}this.playerState!==n_.Playing&&this.play()}}_mouseLeave(){if(!(!this.hover||!this._lottieInstance||"ontouchstart"in window))switch(this.mouseout){case nv.Void:break;case nv.Pause:this.pause();break;case nv.Reverse:this._lottieInstance.setDirection(-1),this.play();break;default:this.stop()}}_onVisibilityChange(){document.hidden&&this.playerState===n_.Playing?this._freeze():this.playerState===n_.Frozen&&this.play()}_removeEventListeners(){this._toggleEventListeners("remove")}_switchInstance(t=!1){if(this._animations[this._currentAnimation])try{if(this._lottieInstance&&this._lottieInstance.destroy(),this._lottieInstance=this.loadAnimation({...this._getOptions(),animationData:this._animations[this._currentAnimation]}),this._multiAnimationSettings[this._currentAnimation]?.mode&&(this._isBounce=this._multiAnimationSettings[this._currentAnimation]?.mode===D.Bounce),this._removeEventListeners(),this._addEventListeners(),this.dispatchEvent(new CustomEvent(t?F.Previous:F.Next)),this._multiAnimationSettings[this._currentAnimation]?.autoplay??this.autoplay){if(this.animateOnScroll){this._lottieInstance.goToAndStop(0,!0),this.playerState=n_.Paused;return}this._lottieInstance.goToAndPlay(0,!0),this.playerState=n_.Playing;return}this._lottieInstance.goToAndStop(0,!0),this.playerState=n_.Stopped}catch(t){this._errorMessage=nx(t).message,this.playerState=n_.Error,this.dispatchEvent(new CustomEvent(F.Error))}}_toggleEventListeners(t){let e="add"===t?"addEventListener":"removeEventListener";if(this._lottieInstance&&(this._lottieInstance[e]("enterFrame",this._enterFrame),this._lottieInstance[e]("complete",this._complete),this._lottieInstance[e]("loopComplete",this._loopComplete),this._lottieInstance[e]("DOMLoaded",this._DOMLoaded),this._lottieInstance[e]("data_ready",this._dataReady),this._lottieInstance[e]("data_failed",this._dataFailed)),this.selector){let t=document.getElementById(this.selector);t?this.hover?(t[e]("mouseenter",this._mouseEnter),t[e]("mouseleave",this._mouseLeave)):t[e]("click",this._handleClick):this.selector=null}this._container&&!this.selector&&(this.hover&&(this._container[e]("mouseenter",this._mouseEnter),this._container[e]("mouseleave",this._mouseLeave)),this.playOnClick&&this._container[e]("click",this._handleClick)),window[e]("focus",this._handleWindowBlur,{capture:!1,passive:!0}),window[e]("blur",this._handleWindowBlur,{capture:!1,passive:!0}),this.animateOnScroll&&window[e]("scroll",this._handleScroll,{capture:!0,passive:!0})}_toggleSettings(t){if(void 0===t){this._isSettingsOpen=!this._isSettingsOpen;return}this._isSettingsOpen=t}}class nA extends nM{get renderer(){return L.SVG}constructor(){super(),this.loadAnimation=rN,this.isLight=!0}setOptions({container:t,hasAutoplay:e,hasLoop:s,initialSegment:i,preserveAspectRatio:r}){return{autoplay:e,container:t,initialSegment:i,loop:s,renderer:L.SVG,rendererSettings:{hideOnTransparent:!0,imagePreserveAspectRatio:r,preserveAspectRatio:r,progressiveLoad:!0}}}}globalThis.dotLottiePlayer=()=>new nA,N||customElements.define(nw,nA),t.MouseOut=nv,t.PlayMode=D,t.PlayerEvents=F,t.PlayerState=n_,t.default=nA,t.tagName=nw,Object.defineProperty(t,"__esModule",{value:!0})}(this["@aarsteinmedia/dotlottie-player"]=this["@aarsteinmedia/dotlottie-player"]||{});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aarsteinmedia/dotlottie-player",
3
- "version": "6.2.3",
3
+ "version": "6.2.4",
4
4
  "description": "Web Component for playing Lottie animations in your web app.",
5
5
  "type": "module",
6
6
  "exports": {