@lottiefiles/dotlottie-wc
Version:
Web component wrapper around the dotlottie-web library
108 lines (93 loc) • 24.6 kB
JavaScript
var _t=Object.freeze,rt=Object.defineProperty,Jt=Object.defineProperties;var Wt=Object.getOwnPropertyDescriptors;var At=Object.getOwnPropertySymbols;var Kt=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable;var it=(i,t,e)=>t in i?rt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,K=(i,t)=>{for(var e in t||(t={}))Kt.call(t,e)&&it(i,e,t[e]);if(At)for(var e of At(t))Zt.call(t,e)&&it(i,e,t[e]);return i},Z=(i,t)=>Jt(i,Wt(t)),h=(i,t)=>rt(i,"name",{value:t,configurable:!0});var f=(i,t,e)=>it(i,typeof t!="symbol"?t+"":t,e);var nt=(i,t)=>_t(rt(i,"raw",{value:_t(i.slice())}));var G=globalThis,Q=G.ShadowRoot&&(G.ShadyCSS===void 0||G.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),St=new WeakMap,R,at=(R=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o,e=this.t;if(Q&&t===void 0){let o=e!==void 0&&e.length===1;o&&(t=St.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&St.set(e,t));}return t}toString(){return this.cssText}},h(R,"n"),R),bt=h(i=>new at(typeof i=="string"?i:i+"",void 0,ht),"r"),dt=h((i,...t)=>{let e=i.length===1?i[0]:t.reduce((o,s,n)=>o+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[n+1],i[0]);return new at(e,i,ht)},"i"),lt=h((i,t)=>{if(Q)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let o=document.createElement("style"),s=G.litNonce;s!==void 0&&o.setAttribute("nonce",s),o.textContent=e.cssText,i.appendChild(o);}},"S"),X=Q?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let o of t.cssRules)e+=o.cssText;return bt(e)})(i):i;var {is:Gt,defineProperty:Qt,getOwnPropertyDescriptor:Xt,getOwnPropertyNames:Yt,getOwnPropertySymbols:te,getPrototypeOf:ee}=Object,S=globalThis,Et=S.trustedTypes,se=Et?Et.emptyScript:"",ct=S.reactiveElementPolyfillSupport,q=h((i,t)=>i,"d"),z={toAttribute(i,t){switch(t){case Boolean:i=i?se:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i);}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i);}catch(o){e=null;}}return e}},Y=h((i,t)=>!Gt(i,t),"f"),vt={attribute:!0,type:String,converter:z,reflect:!1,hasChanged:Y};(Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(S.litPropertyMetadata)!=null||(S.litPropertyMetadata=new WeakMap);var U,E=(U=class extends HTMLElement{static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=vt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let o=Symbol(),s=this.getPropertyDescriptor(t,o,e);s!==void 0&&Qt(this.prototype,t,s);}}static getPropertyDescriptor(t,e,o){var r;let{get:s,set:n}=(r=Xt(this.prototype,t))!=null?r:{get(){return this[e]},set(d){this[e]=d;}};return {get(){return s==null?void 0:s.call(this)},set(d){let a=s==null?void 0:s.call(this);n.call(this,d),this.requestUpdate(t,a,o);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return (e=this.elementProperties.get(t))!=null?e:vt}static _$Ei(){if(this.hasOwnProperty(q("elementProperties")))return;let t=ee(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(q("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(q("properties"))){let e=this.properties,o=[...Yt(e),...te(e)];for(let s of o)this.createProperty(s,e[s]);}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[o,s]of e)this.elementProperties.set(o,s);}this._$Eh=new Map;for(let[e,o]of this.elementProperties){let s=this._$Eu(e,o);s!==void 0&&this._$Eh.set(s,e);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let o=new Set(t.flat(1/0).reverse());for(let s of o)e.unshift(X(s));}else t!==void 0&&e.push(X(t));return e}static _$Eu(t,e){let o=e.attribute;return o===!1?void 0:typeof o=="string"?o:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev();}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this));}addController(t){var e,o;((e=this._$EO)!=null?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((o=t.hostConnected)==null||o.call(t));}removeController(t){var e;(e=this._$EO)==null||e.delete(t);}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let o of e.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t);}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return lt(t,this.constructor.elementStyles),t}connectedCallback(){var e;(this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(o=>{var s;return (s=o.hostConnected)==null?void 0:s.call(o)});}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var o;return (o=e.hostDisconnected)==null?void 0:o.call(e)});}attributeChangedCallback(t,e,o){this._$AK(t,o);}_$EC(t,e){var n;let o=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,o);if(s!==void 0&&o.reflect===!0){let r=(((n=o.converter)==null?void 0:n.toAttribute)!==void 0?o.converter:z).toAttribute(e,o.type);this._$Em=t,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null;}}_$AK(t,e){var n;let o=this.constructor,s=o._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let r=o.getPropertyOptions(s),d=typeof r.converter=="function"?{fromAttribute:r.converter}:((n=r.converter)==null?void 0:n.fromAttribute)!==void 0?r.converter:z;this._$Em=s,this[s]=d.fromAttribute(e,r.type),this._$Em=null;}}requestUpdate(t,e,o){var s;if(t!==void 0){if(o!=null||(o=this.constructor.getPropertyOptions(t)),!((s=o.hasChanged)!=null?s:Y)(this[t],e))return;this.P(t,e,o);}this.isUpdatePending===!1&&(this._$ES=this._$ET());}P(t,e,o){var s;this._$AL.has(t)||this._$AL.set(t,e),o.reflect===!0&&this._$Em!==t&&((s=this._$Ej)!=null?s:this._$Ej=new Set).add(t);}async _$ET(){this.isUpdatePending=!0;try{await this._$ES;}catch(e){Promise.reject(e);}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[r,d]of this._$Ep)this[r]=d;this._$Ep=void 0;}let n=this.constructor.elementProperties;if(n.size>0)for(let[r,d]of n)d.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],d);}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(n=>{var r;return (r=n.hostUpdate)==null?void 0:r.call(n)}),this.update(e)):this._$EU();}catch(n){throw t=!1,this._$EU(),n}t&&this._$AE(e);}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(o=>{var s;return (s=o.hostUpdated)==null?void 0:s.call(o)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return !0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU();}updated(t){}firstUpdated(t){}},h(U,"b"),U),wt;E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[q("elementProperties")]=new Map,E[q("finalized")]=new Map,ct==null||ct({ReactiveElement:E}),((wt=S.reactiveElementVersions)!=null?wt:S.reactiveElementVersions=[]).push("2.0.4");var F=globalThis,tt=F.trustedTypes,Ot=tt?tt.createPolicy("lit-html",{createHTML:h(i=>i,"createHTML")}):void 0,Tt="$lit$",b="lit$".concat(Math.random().toFixed(9).slice(2),"$"),Ht="?"+b,oe="<".concat(Ht,">"),O=document,V=h(()=>O.createComment(""),"l"),J=h(i=>i===null||typeof i!="object"&&typeof i!="function","c"),mt=Array.isArray,ie=h(i=>mt(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function","u"),pt="[ \n\f\r]",D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pt=/-->/g,Rt=/>/g,v=RegExp(">|".concat(pt,"(?:([^\\s\"'>=/]+)(").concat(pt,"*=").concat(pt,"*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),Ut=/'/g,Lt=/"/g,kt=/^(?:script|style|textarea|title)$/i,yt=h(i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),"y"),jt=yt(1);yt(2);yt(3);var P=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Nt=new WeakMap,C=O.createTreeWalker(O,129);function Mt(i,t){if(!mt(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ot!==void 0?Ot.createHTML(t):t}h(Mt,"P");var re=h((i,t)=>{let e=i.length-1,o=[],s,n=t===2?"<svg>":t===3?"<math>":"",r=D;for(let d=0;d<e;d++){let a=i[d],p,c,l=-1,_=0;for(;_<a.length&&(r.lastIndex=_,c=r.exec(a),c!==null);)_=r.lastIndex,r===D?c[1]==="!--"?r=Pt:c[1]!==void 0?r=Rt:c[2]!==void 0?(kt.test(c[2])&&(s=RegExp("</"+c[2],"g")),r=v):c[3]!==void 0&&(r=v):r===v?c[0]===">"?(r=s!=null?s:D,l=-1):c[1]===void 0?l=-2:(l=r.lastIndex-c[2].length,p=c[1],r=c[3]===void 0?v:c[3]==='"'?Lt:Ut):r===Lt||r===Ut?r=v:r===Pt||r===Rt?r=D:(r=v,s=void 0);let A=r===v&&i[d+1].startsWith("/>")?" ":"";n+=r===D?a+oe:l>=0?(o.push(p),a.slice(0,l)+Tt+a.slice(l)+b+A):a+b+(l===-2?d:A);}return [Mt(i,n+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),o]},"V"),x,ft=(x=class{constructor({strings:t,_$litType$:e},o){let s;this.parts=[];let n=0,r=0,d=t.length-1,a=this.parts,[p,c]=re(t,e);if(this.el=x.createElement(p,o),C.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes);}for(;(s=C.nextNode())!==null&&a.length<d;){if(s.nodeType===1){if(s.hasAttributes())for(let l of s.getAttributeNames())if(l.endsWith(Tt)){let _=c[r++],A=s.getAttribute(l).split(b),W=/([.?@])?(.*)/.exec(_);a.push({type:1,index:n,name:W[2],strings:A,ctor:W[1]==="."?he:W[1]==="?"?ae:W[1]==="@"?de:et}),s.removeAttribute(l);}else l.startsWith(b)&&(a.push({type:6,index:n}),s.removeAttribute(l));if(kt.test(s.tagName)){let l=s.textContent.split(b),_=l.length-1;if(_>0){s.textContent=tt?tt.emptyScript:"";for(let A=0;A<_;A++)s.append(l[A],V()),C.nextNode(),a.push({type:2,index:++n});s.append(l[_],V());}}}else if(s.nodeType===8)if(s.data===Ht)a.push({type:2,index:n});else {let l=-1;for(;(l=s.data.indexOf(b,l+1))!==-1;)a.push({type:7,index:n}),l+=b.length-1;}n++;}}static createElement(t,e){let o=O.createElement("template");return o.innerHTML=t,o}},h(x,"N"),x);function j(i,t,e=i,o){var r,d,a;if(t===P)return t;let s=o!==void 0?(r=e._$Co)==null?void 0:r[o]:e._$Cl,n=J(t)?void 0:t._$litDirective$;return (s==null?void 0:s.constructor)!==n&&((d=s==null?void 0:s._$AO)==null||d.call(s,!1),n===void 0?s=void 0:(s=new n(i),s._$AT(i,e,o)),o!==void 0?((a=e._$Co)!=null?a:e._$Co=[])[o]=s:e._$Cl=s),s!==void 0&&(t=j(i,s._$AS(i,t.values),s,o)),t}h(j,"S");var L,ne=(L=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var p;let{el:{content:e},parts:o}=this._$AD,s=((p=t==null?void 0:t.creationScope)!=null?p:O).importNode(e,!0);C.currentNode=s;let n=C.nextNode(),r=0,d=0,a=o[0];for(;a!==void 0;){if(r===a.index){let c;a.type===2?c=new gt(n,n.nextSibling,this,t):a.type===1?c=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(c=new le(n,this,t)),this._$AV.push(c),a=o[++d];}r!==(a==null?void 0:a.index)&&(n=C.nextNode(),r++);}return C.currentNode=O,s}p(t){let e=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(t,o,e),e+=o.strings.length-2):o._$AI(t[e])),e++;}},h(L,"M"),L),w,gt=(w=class{get _$AU(){var t,e;return (e=(t=this._$AM)==null?void 0:t._$AU)!=null?e:this._$Cv}constructor(t,e,o,s){var n;this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=o,this.options=s,this._$Cv=(n=s==null?void 0:s.isConnected)!=null?n:!0;}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=j(this,t,e),J(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ie(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==u&&J(this._$AH)?this._$AA.nextSibling.data=t:this.T(O.createTextNode(t)),this._$AH=t;}$(t){var n;let{values:e,_$litType$:o}=t,s=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=ft.createElement(Mt(o.h,o.h[0]),this.options)),o);if(((n=this._$AH)==null?void 0:n._$AD)===s)this._$AH.p(e);else {let r=new ne(s,this),d=r.u(this.options);r.p(e),this.T(d),this._$AH=r;}}_$AC(t){let e=Nt.get(t.strings);return e===void 0&&Nt.set(t.strings,e=new ft(t)),e}k(t){mt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,o,s=0;for(let n of t)s===e.length?e.push(o=new w(this.O(V()),this.O(V()),this,this.options)):o=e[s],o._$AI(n),s++;s<e.length&&(this._$AR(o&&o._$AB.nextSibling,s),e.length=s);}_$AR(t=this._$AA.nextSibling,e){var o;for((o=this._$AP)==null?void 0:o.call(this,!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s;}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t));}},h(w,"R"),w),N,et=(N=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,o,s,n){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=u;}_$AI(t,e=this,o,s){let n=this.strings,r=!1;if(n===void 0)t=j(this,t,e,0),r=!J(t)||t!==this._$AH&&t!==P,r&&(this._$AH=t);else {let d=t,a,p;for(t=n[0],a=0;a<n.length-1;a++)p=j(this,d[o+a],e,a),p===P&&(p=this._$AH[a]),r||(r=!J(p)||p!==this._$AH[a]),p===u?t=u:t!==u&&(t+=(p!=null?p:"")+n[a+1]),this._$AH[a]=p;}r&&!s&&this.j(t);}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"");}},h(N,"k"),N),I,he=(I=class extends et{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===u?void 0:t;}},h(I,"H"),I),T,ae=(T=class extends et{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u);}},h(T,"I"),T),H,de=(H=class extends et{constructor(t,e,o,s,n){super(t,e,o,s,n),this.type=5;}_$AI(t,e=this){var r;if((t=(r=j(this,t,e,0))!=null?r:u)===P)return;let o=this._$AH,s=t===u&&o!==u||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==u&&(o===u||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){var e,o;typeof this._$AH=="function"?this._$AH.call((o=(e=this.options)==null?void 0:e.host)!=null?o:this.element,t):this._$AH.handleEvent(t);}},h(H,"L"),H),k,le=(k=class{constructor(t,e,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=o;}get _$AU(){return this._$AM._$AU}_$AI(t){j(this,t);}},h(k,"z"),k);var ut=F.litHtmlPolyfillSupport,It;ut==null||ut(ft,gt),((It=F.litHtmlVersions)!=null?It:F.litHtmlVersions=[]).push("3.2.1");var Bt=h((i,t,e)=>{var n,r;let o=(n=e==null?void 0:e.renderBefore)!=null?n:t,s=o._$litPart$;if(s===void 0){let d=(r=e==null?void 0:e.renderBefore)!=null?r:null;o._$litPart$=s=new gt(t.insertBefore(V(),d),d,void 0,e!=null?e:{});}return s._$AI(i),s},"B");var B,M=(B=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){var e;let t=super.createRenderRoot();return ((e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Bt(e,this.renderRoot,this.renderOptions);}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0);}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1);}render(){return P}},h(B,"r"),B),qt;M._$litElement$=!0,M.finalized=!0,(qt=globalThis.litElementHydrateSupport)==null||qt.call(globalThis,{LitElement:M});var $t=globalThis.litElementPolyfillSupport;$t==null||$t({LitElement:M});var zt;((zt=globalThis.litElementVersions)!=null?zt:globalThis.litElementVersions=[]).push("4.1.1");var He=h(i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t);}):customElements.define(i,t);},"t");var ce={attribute:!0,type:String,converter:z,reflect:!1,hasChanged:Y},pe=h((i=ce,t,e)=>{let{kind:o,metadata:s}=e,n=globalThis.litPropertyMetadata.get(s);if(n===void 0&&globalThis.litPropertyMetadata.set(s,n=new Map),n.set(e.name,i),o==="accessor"){let{name:r}=e;return {set(d){let a=t.get.call(this);t.set.call(this,d),this.requestUpdate(r,a,i);},init(d){return d!==void 0&&this.P(r,void 0,i),d}}}if(o==="setter"){let{name:r}=e;return function(d){let a=this[r];t.call(this,d),this.requestUpdate(r,a,i);}}throw Error("Unsupported decorator location: "+o)},"r");function m(i){return (t,e)=>typeof e=="object"?pe(i,t,e):((o,s,n)=>{let r=s.hasOwnProperty(n);return s.constructor.createProperty(n,r?Z(K({},o),{wrapped:!0}):o),r?Object.getOwnPropertyDescriptor(s,n):void 0})(i,t,e)}h(m,"n");function Dt(i){return m(Z(K({},i),{state:!0,attribute:!1}))}h(Dt,"r");function g(i,t,e,o){var s=arguments.length,n=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,t,e,o);else for(var d=i.length-1;d>=0;d--)(r=i[d])&&(n=(s<3?r(n):s>3?r(t,e,n):r(t,e))||n);return s>3&&n&&Object.defineProperty(t,e,n),n}h(g,"_ts_decorate");function $(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)}h($,"_ts_metadata");var Ft,Vt,ot=class ot extends M{constructor(){super();f(this,"animationId");f(this,"src");f(this,"data");f(this,"loop");f(this,"autoplay");f(this,"speed");f(this,"segment");f(this,"mode");f(this,"marker");f(this,"backgroundColor");f(this,"renderConfig");f(this,"useFrameInterpolation");f(this,"themeId");f(this,"workerId");f(this,"dotLottie",null);}_init(){var o;let e=document.createElement("canvas");(o=this.shadowRoot)==null||o.appendChild(e),this.dotLottie=this._createDotLottieInstance({canvas:e,src:this.src,data:this.data,loop:this.loop,autoplay:this.autoplay,speed:this.speed,segment:this.segment,mode:this.mode,renderConfig:this.renderConfig,useFrameInterpolation:this.useFrameInterpolation,themeId:this.themeId,workerId:this.workerId});}connectedCallback(){super.connectedCallback(),this._init();}adoptedCallback(){this._init();}disconnectedCallback(){var e,o,s;super.disconnectedCallback(),(e=this.dotLottie)==null||e.destroy(),this.dotLottie=null,(s=(o=this.shadowRoot)==null?void 0:o.querySelector("canvas"))==null||s.remove();}attributeChangedCallback(e,o,s){if(super.attributeChangedCallback(e,o,s),!(!this.dotLottie||o===s)){if(e==="segment"){let n=JSON.parse(s!=null?s:"[]");Array.isArray(n)&&n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"?this.dotLottie.setSegment(n[0],n[1]):this.dotLottie.setSegment(0,this.dotLottie.totalFrames);}e==="mode"&&this.dotLottie.setMode(s||"forward"),e==="speed"&&this.dotLottie.setSpeed(s?Number(s):1),e==="loop"&&this.dotLottie.setLoop(!!s),e==="useframeinterpolation"&&this.dotLottie.setUseFrameInterpolation(typeof s=="string"?JSON.parse(s):!0),e==="themeid"&&this.dotLottie.setTheme(s!=null?s:""),e==="backgroundcolor"&&this.dotLottie.setBackgroundColor(s!=null?s:""),e==="renderconfig"&&this.dotLottie.setRenderConfig(JSON.parse(s!=null?s:"{}")),e==="animationid"&&s&&this.dotLottie.loadAnimation(s),e==="marker"&&this.dotLottie.setMarker(s!=null?s:""),e==="src"&&s&&this.dotLottie.load({src:s,data:this.data,loop:this.loop,autoplay:this.autoplay,speed:this.speed,segment:this.segment,mode:this.mode,renderConfig:this.renderConfig,useFrameInterpolation:this.useFrameInterpolation,themeId:this.themeId}),e==="data"&&s&&this.dotLottie.load({src:this.src,data:s,loop:this.loop,autoplay:this.autoplay,speed:this.speed,segment:this.segment,mode:this.mode,renderConfig:this.renderConfig,useFrameInterpolation:this.useFrameInterpolation,themeId:this.themeId});}}render(){return jt(Vt||(Vt=nt(["<slot></slot>"])))}};h(ot,"AbstractDotLottieWC"),f(ot,"styles",dt(Ft||(Ft=nt(["\n :host {\n display: block;\n position: relative;\n }\n\n :host > canvas {\n width: 100%;\n height: 100%;\n }\n "]))));var y=ot;g([m({type:String}),$("design:type",String)],y.prototype,"animationId",void 0);g([m({type:String}),$("design:type",Object)],y.prototype,"src",void 0);g([m({type:String}),$("design:type",Object)],y.prototype,"data",void 0);g([m({type:Boolean}),$("design:type",Object)],y.prototype,"loop",void 0);g([m({type:Boolean}),$("design:type",Object)],y.prototype,"autoplay",void 0);g([m({type:Number}),$("design:type",Object)],y.prototype,"speed",void 0);g([m({type:Array}),$("design:type",Object)],y.prototype,"segment",void 0);g([m({type:String}),$("design:type",Object)],y.prototype,"mode",void 0);g([m({type:String}),$("design:type",Object)],y.prototype,"marker",void 0);g([m({type:String}),$("design:type",Object)],y.prototype,"backgroundColor",void 0);g([m({type:Object}),$("design:type",Object)],y.prototype,"renderConfig",void 0);g([m({type:Boolean}),$("design:type",Object)],y.prototype,"useFrameInterpolation",void 0);g([m({type:String}),$("design:type",Object)],y.prototype,"themeId",void 0);g([m({type:String}),$("design:type",String)],y.prototype,"workerId",void 0);g([Dt(),$("design:type",Object)],y.prototype,"dotLottie",void 0);/*! Bundled license information:
@lit/reactive-element/css-tag.js:
(**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/reactive-element.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
lit-html/lit-html.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
lit-element/lit-element.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
lit-html/is-server.js:
(**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/decorators/custom-element.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/decorators/property.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/decorators/state.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/decorators/event-options.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/decorators/base.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/decorators/query.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/decorators/query-all.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/decorators/query-async.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/decorators/query-assigned-elements.js:
(**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
@lit/reactive-element/decorators/query-assigned-nodes.js:
(**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
*/export{h as a,He as b,y as c};//# sourceMappingURL=chunk-YNB4TPCL.js.map
//# sourceMappingURL=chunk-YNB4TPCL.js.map