@lottiefiles/dotlottie-wc
Version:
Web component wrapper around the dotlottie-web library
44 lines • 84.4 kB
JavaScript
function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=class{requestAnimationFrame(e){return requestAnimationFrame(e)}cancelAnimationFrame(e){cancelAnimationFrame(e)}},a=class{constructor(){r(this,`_lastHandleId`,0),r(this,`_lastImmediate`,null)}requestAnimationFrame(e){return this._lastHandleId>=2**53-1&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{e(performance.now())}),this._lastHandleId}cancelAnimationFrame(e){this._lastImmediate&&clearImmediate(this._lastImmediate)}},o=class{constructor(){r(this,`_strategy`,void 0),this._strategy=typeof requestAnimationFrame==`function`?new i:new a}requestAnimationFrame(e){return this._strategy.requestAnimationFrame(e)}cancelAnimationFrame(e){this._strategy.cancelAnimationFrame(e)}};const s=typeof window<`u`&&window.document!==void 0,c=new Uint8Array([80,75,3,4]),l=[`v`,`ip`,`op`,`layers`,`fr`,`w`,`h`];let u;const d=Array(128).fill(void 0);d.push(void 0,null,!0,!1);function f(e){return d[e]}let p=d.length;function m(e){p===d.length&&d.push(d.length+1);let t=p;return p=d[t],d[t]=e,t}function h(e,t){try{return e.apply(this,t)}catch(e){u.__wbindgen_export_0(m(e))}}function g(e){return e==null}const ee=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&ee.decode();let _=null;function v(){return(_===null||_.byteLength===0)&&(_=new Uint8Array(u.memory.buffer)),_}function y(e,t){return e>>>=0,ee.decode(v().subarray(e,e+t))}let b=0;const x=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},te=typeof x.encodeInto==`function`?function(e,t){return x.encodeInto(e,t)}:function(e,t){let n=x.encode(e);return t.set(n),{read:e.length,written:n.length}};function S(e,t,n){if(n===void 0){let n=x.encode(e),r=t(n.length,1)>>>0;return v().subarray(r,r+n.length).set(n),b=n.length,r}let r=e.length,i=t(r,1)>>>0,a=v(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=v().subarray(i+o,i+r),a=te(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return b=o,i}let C=null;function w(){return(C===null||C.buffer.detached===!0||C.buffer.detached===void 0&&C.buffer!==u.memory.buffer)&&(C=new DataView(u.memory.buffer)),C}function ne(e,t){let n=t(e.length*1,1)>>>0;return v().set(e,n/1),b=e.length,n}function re(e){e<132||(d[e]=p,p=e)}function T(e){let t=f(e);return re(e),t}const ie=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>{u.__wbindgen_export_4.get(e.dtor)(e.a,e.b)});function ae(e,t,n,r){let i={a:e,b:t,cnt:1,dtor:n},a=(...e)=>{i.cnt++;let t=i.a;i.a=0;try{return r(t,i.b,...e)}finally{--i.cnt===0?(u.__wbindgen_export_4.get(i.dtor)(t,i.b),ie.unregister(i)):i.a=t}};return a.original=i,ie.register(a,i,i),a}function oe(e,t){let n=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),r=b,i=ne(t,u.__wbindgen_export_1),a=b;return u.register_font(n,r,i,a)!==0}let E=null;function se(){return(E===null||E.byteLength===0)&&(E=new Float32Array(u.memory.buffer)),E}function ce(e,t){let n=t(e.length*4,4)>>>0;return se().set(e,n/4),b=e.length,n}function le(e,t){let n=t(e.length*4,4)>>>0,r=w();for(let t=0;t<e.length;t++)r.setUint32(n+4*t,m(e[t]),!0);return b=e.length,n}function ue(e,t,n){u.__wbindgen_export_5(e,t,m(n))}const D=Object.freeze({Forward:0,0:`Forward`,Reverse:1,1:`Reverse`,Bounce:2,2:`Bounce`,ReverseBounce:3,3:`ReverseBounce`}),O=Object.freeze({Idle:0,0:`Idle`,Playing:1,1:`Playing`,Paused:2,2:`Paused`,Stopped:3,3:`Stopped`,Tweening:4,4:`Tweening`}),de=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>u.__wbg_dotlottieplayerwasm_free(e>>>0,1));var fe=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,de.unregister(this),e}free(){let e=this.__destroy_into_raw();u.__wbg_dotlottieplayerwasm_free(e,0)}clear_slot(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;return u.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,t,n)!==0}layout_fit(){let e,t;try{let i=u.__wbindgen_add_to_stack_pointer(-16);u.dotlottieplayerwasm_layout_fit(i,this.__wbg_ptr);var n=w().getInt32(i+0,!0),r=w().getInt32(i+4,!0);return e=n,t=r,y(n,r)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_3(e,t,1)}}loop_count(){return u.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){return T(u.dotlottieplayerwasm_poll_event(this.__wbg_ptr))}reset_slot(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;return u.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,t,n)!==0}set_layout(e,t,n){let r=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),i=b;return u.dotlottieplayerwasm_set_layout(this.__wbg_ptr,r,i,t,n)!==0}set_marker(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;u.dotlottieplayerwasm_set_marker(this.__wbg_ptr,t,n)}clear_slots(){return u.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)!==0}is_complete(){return u.dotlottieplayerwasm_is_complete(this.__wbg_ptr)!==0}reset_slots(){return u.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)!==0}reset_theme(){return u.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)!==0}segment_end(){return u.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_quality(e){return u.dotlottieplayerwasm_set_quality(this.__wbg_ptr,e)!==0}set_segment(e,t){return u.dotlottieplayerwasm_set_segment(this.__wbg_ptr,e,t)!==0}sm_set_seed(e){return u.dotlottieplayerwasm_sm_set_seed(this.__wbg_ptr,e)!==0}static unload_font(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;return u.dotlottieplayerwasm_unload_font(t,n)!==0}animation_id(){try{let n=u.__wbindgen_add_to_stack_pointer(-16);u.dotlottieplayerwasm_animation_id(n,this.__wbg_ptr);var e=w().getInt32(n+0,!0),t=w().getInt32(n+4,!0);let r;return e!==0&&(r=y(e,t).slice(),u.__wbindgen_export_3(e,t*1,1)),r}finally{u.__wbindgen_add_to_stack_pointer(16)}}audio_volume(){return u.dotlottieplayerwasm_audio_volume(this.__wbg_ptr)}background_a(){return u.dotlottieplayerwasm_background_a(this.__wbg_ptr)}background_b(){return u.dotlottieplayerwasm_background_b(this.__wbg_ptr)}background_g(){return u.dotlottieplayerwasm_background_g(this.__wbg_ptr)}background_r(){return u.dotlottieplayerwasm_background_r(this.__wbg_ptr)}clear_marker(){u.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}emit_on_loop(){u.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}get_slot_ids(){return T(u.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr))}get_slot_str(e){try{let r=u.__wbindgen_add_to_stack_pointer(-16),i=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),a=b;u.dotlottieplayerwasm_get_slot_str(r,this.__wbg_ptr,i,a);var t=w().getInt32(r+0,!0),n=w().getInt32(r+4,!0);let o;return t!==0&&(o=y(t,n).slice(),u.__wbindgen_export_3(t,n*1,1)),o}finally{u.__wbindgen_add_to_stack_pointer(16)}}marker_names(){return T(u.dotlottieplayerwasm_marker_names(this.__wbg_ptr))}set_autoplay(e){u.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,e)}set_slot_str(e,t){let n=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),r=b,i=S(t,u.__wbindgen_export_1,u.__wbindgen_export_2),a=b;return u.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,n,r,i,a)!==0}set_viewport(e,t,n,r){return u.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,e,t,n,r)!==0}total_frames(){return u.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}clear_segment(){return u.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)!==0}current_frame(){return u.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}get_slot_type(e){try{let r=u.__wbindgen_add_to_stack_pointer(-16),i=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),a=b;u.dotlottieplayerwasm_get_slot_type(r,this.__wbg_ptr,i,a);var t=w().getInt32(r+0,!0),n=w().getInt32(r+4,!0);let o;return t!==0&&(o=y(t,n).slice(),u.__wbindgen_export_3(t,n*1,1)),o}finally{u.__wbindgen_add_to_stack_pointer(16)}}get_slots_str(){let e,t;try{let i=u.__wbindgen_add_to_stack_pointer(-16);u.dotlottieplayerwasm_get_slots_str(i,this.__wbg_ptr);var n=w().getInt32(i+0,!0),r=w().getInt32(i+4,!0);return e=n,t=r,y(n,r)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_3(e,t,1)}}get_transform(){return T(u.dotlottieplayerwasm_get_transform(this.__wbg_ptr))}segment_start(){return u.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;return u.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,t,n)!==0}set_text_slot(e,t){let n=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),r=b,i=S(t,u.__wbindgen_export_1,u.__wbindgen_export_2),a=b;return u.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,n,r,i,a)!==0}set_transform(e){let t=ce(e,u.__wbindgen_export_1),n=b;return u.dotlottieplayerwasm_set_transform(this.__wbg_ptr,t,n)!==0}sm_get_inputs(){return T(u.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr))}sm_poll_event(){return T(u.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr))}sm_post_click(e,t){u.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,e,t)}animation_size(){return T(u.dotlottieplayerwasm_animation_size(this.__wbg_ptr))}current_marker(){try{let n=u.__wbindgen_add_to_stack_pointer(-16);u.dotlottieplayerwasm_current_marker(n,this.__wbg_ptr);var e=w().getInt32(n+0,!0),t=w().getInt32(n+4,!0);let r;return e!==0&&(r=y(e,t).slice(),u.__wbindgen_export_3(e,t*1,1)),r}finally{u.__wbindgen_add_to_stack_pointer(16)}}layout_align_x(){return u.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return u.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}load_animation(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;return u.dotlottieplayerwasm_load_animation(this.__wbg_ptr,t,n)!==0}loop_animation(){return u.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)!==0}set_background(e,t,n,r){return u.dotlottieplayerwasm_set_background(this.__wbg_ptr,e,t,n,r)!==0}set_color_slot(e,t,n,r){let i=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),a=b;return u.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,a,t,n,r)!==0}set_image_slot(e,t){let n=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),r=b,i=S(t,u.__wbindgen_export_1,u.__wbindgen_export_2),a=b;return u.dotlottieplayerwasm_set_image_slot(this.__wbg_ptr,n,r,i,a)!==0}set_loop_count(e){u.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,e)}set_theme_data(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;return u.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,t,n)!==0}sm_reset_input(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;u.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,t,n)}manifest_string(){let e,t;try{let i=u.__wbindgen_add_to_stack_pointer(-16);u.dotlottieplayerwasm_manifest_string(i,this.__wbg_ptr);var n=w().getInt32(i+0,!0),r=w().getInt32(i+4,!0);return e=n,t=r,y(n,r)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_3(e,t,1)}}set_scalar_slot(e,t){let n=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),r=b;return u.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,n,r,t)!==0}set_vector_slot(e,t,n){let r=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),i=b;return u.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,r,i,t,n)!==0}setup_sw_target(e,t){return u.dotlottieplayerwasm_setup_sw_target(this.__wbg_ptr,e,t)!==0}get_pixel_buffer(){return T(u.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr))}set_audio_volume(e){u.dotlottieplayerwasm_set_audio_volume(this.__wbg_ptr,e)}sm_current_state(){let e,t;try{let i=u.__wbindgen_add_to_stack_pointer(-16);u.dotlottieplayerwasm_sm_current_state(i,this.__wbg_ptr);var n=w().getInt32(i+0,!0),r=w().getInt32(i+4,!0);return e=n,t=r,y(n,r)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_3(e,t,1)}}state_machine_id(){try{let n=u.__wbindgen_add_to_stack_pointer(-16);u.dotlottieplayerwasm_state_machine_id(n,this.__wbg_ptr);var e=w().getInt32(n+0,!0),t=w().getInt32(n+4,!0);let r;return e!==0&&(r=y(e,t).slice(),u.__wbindgen_export_3(e,t*1,1)),r}finally{u.__wbindgen_add_to_stack_pointer(16)}}get_state_machine(e){try{let r=u.__wbindgen_add_to_stack_pointer(-16),i=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),a=b;u.dotlottieplayerwasm_get_state_machine(r,this.__wbg_ptr,i,a);var t=w().getInt32(r+0,!0),n=w().getInt32(r+4,!0);let o;return t!==0&&(o=y(t,n).slice(),u.__wbindgen_export_3(t,n*1,1)),o}finally{u.__wbindgen_add_to_stack_pointer(16)}}set_position_slot(e,t,n){let r=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),i=b;return u.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,r,i,t,n)!==0}current_loop_count(){return u.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}set_asset_resolver(e){u.dotlottieplayerwasm_set_asset_resolver(this.__wbg_ptr,g(e)?0:m(e))}sm_framework_setup(){return T(u.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr))}sm_post_pointer_up(e,t){u.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,e,t)}state_machine_load(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;return u.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,t,n)!==0}load_dotlottie_data(e){let t=ne(e,u.__wbindgen_export_1),n=b;return u.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,t,n)!==0}sm_get_string_input(e){try{let r=u.__wbindgen_add_to_stack_pointer(-16),i=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),a=b;u.dotlottieplayerwasm_sm_get_string_input(r,this.__wbg_ptr,i,a);var t=w().getInt32(r+0,!0),n=w().getInt32(r+4,!0);let o;return t!==0&&(o=y(t,n).slice(),u.__wbindgen_export_3(t,n*1,1)),o}finally{u.__wbindgen_add_to_stack_pointer(16)}}sm_set_string_input(e,t){let n=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),r=b,i=S(t,u.__wbindgen_export_1,u.__wbindgen_export_2),a=b;return u.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,n,r,i,a)!==0}sm_get_boolean_input(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b,r=u.dotlottieplayerwasm_sm_get_boolean_input(this.__wbg_ptr,t,n);return r===16777215?void 0:r!==0}sm_get_numeric_input(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b,r=u.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,t,n);return r===4294967297?void 0:r}sm_post_pointer_down(e,t){u.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,e,t)}sm_post_pointer_exit(e,t){u.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,e,t)}sm_post_pointer_move(e,t){u.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,e,t)}sm_set_boolean_input(e,t){let n=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),r=b;return u.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,n,r,t)!==0}sm_set_numeric_input(e,t){let n=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),r=b;return u.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,n,r,t)!==0}state_machine_unload(){u.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_post_pointer_enter(e,t){u.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,e,t)}load_animation_from_id(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;return u.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,t,n)!==0}sm_poll_internal_event(){return T(u.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr))}use_frame_interpolation(){return u.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)!==0}reset_current_loop_count(){u.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}sm_override_current_state(e,t){let n=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),r=b;return u.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,n,r,t)!==0}state_machine_load_from_id(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;return u.dotlottieplayerwasm_state_machine_load_from_id(this.__wbg_ptr,t,n)!==0}set_use_frame_interpolation(e){u.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,e)}constructor(){let e=u.dotlottieplayerwasm_new();return this.__wbg_ptr=e>>>0,de.register(this,this.__wbg_ptr,this),this}mode(){return u.dotlottieplayerwasm_mode(this.__wbg_ptr)}play(){return u.dotlottieplayerwasm_play(this.__wbg_ptr)!==0}stop(){return u.dotlottieplayerwasm_stop(this.__wbg_ptr)!==0}tick(e){return u.dotlottieplayerwasm_tick(this.__wbg_ptr,e)!==0}pause(){return u.dotlottieplayerwasm_pause(this.__wbg_ptr)!==0}speed(){return u.dotlottieplayerwasm_speed(this.__wbg_ptr)}width(){return u.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return u.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}render(){return u.dotlottieplayerwasm_render(this.__wbg_ptr)!==0}status(){return u.dotlottieplayerwasm_status(this.__wbg_ptr)}markers(){return T(u.dotlottieplayerwasm_markers(this.__wbg_ptr))}sm_fire(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;return u.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,t,n)!==0}sm_stop(){return u.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)!==0}sm_tick(e){return u.dotlottieplayerwasm_sm_tick(this.__wbg_ptr,e)!==0}autoplay(){return u.dotlottieplayerwasm_autoplay(this.__wbg_ptr)!==0}duration(){return u.dotlottieplayerwasm_duration(this.__wbg_ptr)}set_loop(e){u.dotlottieplayerwasm_set_loop(this.__wbg_ptr,e)}set_mode(e){u.dotlottieplayerwasm_set_mode(this.__wbg_ptr,e)}sm_start(e,t){let n=le(t,u.__wbindgen_export_1),r=b;return u.dotlottieplayerwasm_sm_start(this.__wbg_ptr,e,n,r)!==0}theme_id(){try{let n=u.__wbindgen_add_to_stack_pointer(-16);u.dotlottieplayerwasm_theme_id(n,this.__wbg_ptr);var e=w().getInt32(n+0,!0),t=w().getInt32(n+4,!0);let r;return e!==0&&(r=y(e,t).slice(),u.__wbindgen_export_3(e,t*1,1)),r}finally{u.__wbindgen_add_to_stack_pointer(16)}}load_font(e,t){let n=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),r=b,i=ne(t,u.__wbindgen_export_1),a=b;return u.dotlottieplayerwasm_load_font(this.__wbg_ptr,n,r,i,a)!==0}set_frame(e){return u.dotlottieplayerwasm_set_frame(this.__wbg_ptr,e)!==0}set_speed(e){u.dotlottieplayerwasm_set_speed(this.__wbg_ptr,e)}set_theme(e){let t=S(e,u.__wbindgen_export_1,u.__wbindgen_export_2),n=b;return u.dotlottieplayerwasm_set_theme(this.__wbg_ptr,t,n)!==0}sm_status(){let e,t;try{let i=u.__wbindgen_add_to_stack_pointer(-16);u.dotlottieplayerwasm_sm_status(i,this.__wbg_ptr);var n=w().getInt32(i+0,!0),r=w().getInt32(i+4,!0);return e=n,t=r,y(n,r)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_3(e,t,1)}}};async function pe(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.headers.get(`Content-Type`)!=`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function me(){let e={};return e.wbg={},e.wbg.__wbg_appendChild_8204974b7328bf98=function(){return h(function(e,t){return m(f(e).appendChild(f(t)))},arguments)},e.wbg.__wbg_body_942ea927546a04ba=function(e){let t=f(e).body;return g(t)?0:m(t)},e.wbg.__wbg_buffer_609cc3eee51ed158=function(e){let t=f(e).buffer;return m(t)},e.wbg.__wbg_call_672a4d21634d4a24=function(){return h(function(e,t){return m(f(e).call(f(t)))},arguments)},e.wbg.__wbg_call_7cccdd69e0791ae2=function(){return h(function(e,t,n){return m(f(e).call(f(t),f(n)))},arguments)},e.wbg.__wbg_catch_a6e601879b2610e9=function(e,t){return m(f(e).catch(f(t)))},e.wbg.__wbg_createElement_8c9931a732ee2fea=function(){return h(function(e,t,n){return m(f(e).createElement(y(t,n)))},arguments)},e.wbg.__wbg_createObjectURL_6e98d2f9c7bd9764=function(){return h(function(e,t){let n=S(URL.createObjectURL(f(t)),u.__wbindgen_export_1,u.__wbindgen_export_2),r=b;w().setInt32(e+4,r,!0),w().setInt32(e+0,n,!0)},arguments)},e.wbg.__wbg_currentTime_7940fe39798a1ca0=function(e){return f(e).currentTime},e.wbg.__wbg_data_d1ed736c1e42b10e=function(e,t){let n=f(t).data,r=ne(n,u.__wbindgen_export_1),i=b;w().setInt32(e+4,i,!0),w().setInt32(e+0,r,!0)},e.wbg.__wbg_document_d249400bd7bd996d=function(e){let t=f(e).document;return g(t)?0:m(t)},e.wbg.__wbg_drawImage_803dcc46897223c9=function(){return h(function(e,t,n,r){f(e).drawImage(f(t),n,r)},arguments)},e.wbg.__wbg_duration_4d32c501d87796c1=function(e){return f(e).duration},e.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,t){let n,r;try{n=e,r=t,console.error(y(e,t))}finally{u.__wbindgen_export_3(n,r,1)}},e.wbg.__wbg_getContext_e9cf379449413580=function(){return h(function(e,t,n){let r=f(e).getContext(y(t,n));return g(r)?0:m(r)},arguments)},e.wbg.__wbg_getImageData_c02374a30b126dab=function(){return h(function(e,t,n,r,i){return m(f(e).getImageData(t,n,r,i))},arguments)},e.wbg.__wbg_instanceof_CanvasRenderingContext2d_df82a4d3437bf1cc=function(e){let t;try{t=f(e)instanceof CanvasRenderingContext2D}catch{t=!1}return t},e.wbg.__wbg_instanceof_HtmlCanvasElement_2ea67072a7624ac5=function(e){let t;try{t=f(e)instanceof HTMLCanvasElement}catch{t=!1}return t},e.wbg.__wbg_instanceof_HtmlVideoElement_7f414b32f362e317=function(e){let t;try{t=f(e)instanceof HTMLVideoElement}catch{t=!1}return t},e.wbg.__wbg_instanceof_Window_def73ea0955fc569=function(e){let t;try{t=f(e)instanceof Window}catch{t=!1}return t},e.wbg.__wbg_length_a446193dc22c12f8=function(e){return f(e).length},e.wbg.__wbg_load_2671477a3293aadb=function(e){f(e).load()},e.wbg.__wbg_new_405e22f390576ce2=function(){return m({})},e.wbg.__wbg_new_78feb108b6472713=function(){return m([])},e.wbg.__wbg_new_8a6f238a6ece86ea=function(){return m(Error())},e.wbg.__wbg_new_a12002a7f91c75be=function(e){return m(new Uint8Array(f(e)))},e.wbg.__wbg_newnoargs_105ed471475aaf50=function(e,t){return m(Function(y(e,t)))},e.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(e,t,n){return m(new Uint8Array(f(e),t>>>0,n>>>0))},e.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(e){return m(new Float32Array(e>>>0))},e.wbg.__wbg_newwithsrc_20307ca7e8762a81=function(){return h(function(e,t){return m(new Audio(y(e,t)))},arguments)},e.wbg.__wbg_newwithu8arraysequenceandoptions_068570c487f69127=function(){return h(function(e,t){return m(new Blob(f(e),f(t)))},arguments)},e.wbg.__wbg_pause_b74c96d69f769518=function(){return h(function(e){f(e).pause()},arguments)},e.wbg.__wbg_paused_9b2affc0a8a62e86=function(e){return f(e).paused},e.wbg.__wbg_play_f6ec5fc4e84b0d26=function(){return h(function(e){return m(f(e).play())},arguments)},e.wbg.__wbg_push_737cfc8c1432c2c6=function(e,t){return f(e).push(f(t))},e.wbg.__wbg_readyState_017c08aa5e73517e=function(e){return f(e).readyState},e.wbg.__wbg_remove_e2d2659f3128c045=function(e){f(e).remove()},e.wbg.__wbg_revokeObjectURL_27267efebeb457c7=function(){return h(function(e,t){URL.revokeObjectURL(y(e,t))},arguments)},e.wbg.__wbg_seeking_c0427be38e698dcd=function(e){return f(e).seeking},e.wbg.__wbg_setAttribute_2704501201f15687=function(){return h(function(e,t,n,r,i){f(e).setAttribute(y(t,n),y(r,i))},arguments)},e.wbg.__wbg_set_65595bdd868b3009=function(e,t,n){f(e).set(f(t),n>>>0)},e.wbg.__wbg_set_bb8cecf6a62b9f46=function(){return h(function(e,t,n){return Reflect.set(f(e),f(t),f(n))},arguments)},e.wbg.__wbg_setcssText_e018c236104b0233=function(e,t,n){f(e).cssText=y(t,n)},e.wbg.__wbg_setcurrentTime_64727eddd3966512=function(e,t){f(e).currentTime=t},e.wbg.__wbg_setheight_da683a33fa99843c=function(e,t){f(e).height=t>>>0},e.wbg.__wbg_setindex_4e73afdcd9bb95cd=function(e,t,n){f(e)[t>>>0]=n},e.wbg.__wbg_setmuted_e93fc48340c43e67=function(e,t){f(e).muted=t!==0},e.wbg.__wbg_setplaybackRate_f5c3b8896f82425e=function(e,t){f(e).playbackRate=t},e.wbg.__wbg_setpreload_d2fb02758e3f8e3a=function(e,t,n){f(e).preload=y(t,n)},e.wbg.__wbg_setsrc_3a759736e2659904=function(e,t,n){f(e).src=y(t,n)},e.wbg.__wbg_settype_39ed370d3edd403c=function(e,t,n){f(e).type=y(t,n)},e.wbg.__wbg_setvolume_3895e06a030ca4f7=function(e,t){f(e).volume=t},e.wbg.__wbg_setwidth_c5fed9f5e7f0b406=function(e,t){f(e).width=t>>>0},e.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,t){let n=f(t).stack,r=S(n,u.__wbindgen_export_1,u.__wbindgen_export_2),i=b;w().setInt32(e+4,i,!0),w().setInt32(e+0,r,!0)},e.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07=function(){let e=typeof global>`u`?null:global;return g(e)?0:m(e)},e.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0=function(){let e=typeof globalThis>`u`?null:globalThis;return g(e)?0:m(e)},e.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819=function(){let e=typeof self>`u`?null:self;return g(e)?0:m(e)},e.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40=function(){let e=typeof window>`u`?null:window;return g(e)?0:m(e)},e.wbg.__wbg_style_fb30c14e5815805c=function(e){let t=f(e).style;return m(t)},e.wbg.__wbg_videoHeight_3a43327a766c1f03=function(e){return f(e).videoHeight},e.wbg.__wbg_videoWidth_4b400cf6f4744a4d=function(e){return f(e).videoWidth},e.wbg.__wbindgen_cb_drop=function(e){let t=T(e).original;return t.cnt--==1?(t.a=0,!0):!1},e.wbg.__wbindgen_closure_wrapper109=function(e,t,n){return m(ae(e,t,7,ue))},e.wbg.__wbindgen_is_null=function(e){return f(e)===null},e.wbg.__wbindgen_is_undefined=function(e){return f(e)===void 0},e.wbg.__wbindgen_memory=function(){let e=u.memory;return m(e)},e.wbg.__wbindgen_number_new=function(e){return m(e)},e.wbg.__wbindgen_object_clone_ref=function(e){return m(f(e))},e.wbg.__wbindgen_object_drop_ref=function(e){T(e)},e.wbg.__wbindgen_string_get=function(e,t){let n=f(t),r=typeof n==`string`?n:void 0;var i=g(r)?0:S(r,u.__wbindgen_export_1,u.__wbindgen_export_2),a=b;w().setInt32(e+4,a,!0),w().setInt32(e+0,i,!0)},e.wbg.__wbindgen_string_new=function(e,t){return m(y(e,t))},e.wbg.__wbindgen_throw=function(e,t){throw Error(y(e,t))},e}function he(e,t){return u=e.exports,ge.__wbindgen_wasm_module=t,C=null,E=null,_=null,u}async function ge(e){if(u!==void 0)return u;if(e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`)),e===void 0)throw Error(`WASM module URL must be provided via DotLottieWasmLoader or setWasmUrl().`);let t=me();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await pe(await e,t);return he(n,r)}var _e=class{constructor(){r(this,`_eventListeners`,new Map)}addEventListener(e,t){let n=this._eventListeners.get(e);n||(n=new Set,this._eventListeners.set(e,n)),n.add(t)}removeEventListener(e,t){let n=this._eventListeners.get(e);n&&(t?(n.delete(t),n.size===0&&this._eventListeners.delete(e)):this._eventListeners.delete(e))}dispatch(e){this._eventListeners.get(e.type)?.forEach(t=>t(e))}removeAllEventListeners(){this._eventListeners.clear()}},k=class e{static _initializeObserver(){e._observer||(e._observer=new IntersectionObserver(t=>{t.forEach(t=>{let n=e._observedCanvases.get(t.target);n&&(t.isIntersecting?n.unfreeze():n.freeze())})},{threshold:0}))}static observe(t,n){e._initializeObserver(),!e._observedCanvases.has(t)&&(e._observedCanvases.set(t,n),e._observer?.observe(t))}static unobserve(t){e._observer?.unobserve(t),e._observedCanvases.delete(t),e._observedCanvases.size===0&&(e._observer?.disconnect(),e._observer=null)}};r(k,`_observer`,null),r(k,`_observedCanvases`,new Map);var A=class e{static _initializeObserver(){e._observer||(e._observer=new ResizeObserver(t=>{t.forEach(t=>{let n=e._observedCanvases.get(t.target);if(!n)return;let[r,i]=n;clearTimeout(i);let a=setTimeout(()=>{r.resize()},100);e._observedCanvases.set(t.target,[r,a])})}))}static observe(t,n){e._initializeObserver(),!e._observedCanvases.has(t)&&(e._observedCanvases.set(t,[n,0]),e._observer?.observe(t))}static unobserve(t){let n=e._observedCanvases.get(t);if(n){let e=n[1];e&&clearTimeout(e)}e._observer?.unobserve(t),e._observedCanvases.delete(t),!e._observedCanvases.size&&e._observer&&(e._observer.disconnect(),e._observer=null)}};r(A,`_observer`,null),r(A,`_observedCanvases`,new Map);function ve(e){return/^#([\da-f]{6}|[\da-f]{8})$/iu.test(e)}function ye(e){if(!ve(e))return[0,0,0,0];let t=e.replace(`#`,``);return t=t.length===6?`${t}ff`:t,[parseInt(t.slice(0,2),16)/255,parseInt(t.slice(2,4),16)/255,parseInt(t.slice(4,6),16)/255,parseInt(t.slice(6,8),16)/255]}function be(e){if(e.byteLength<4)return!1;let t=new Uint8Array(e.slice(0,c.byteLength));for(let e=0;e<c.length;e+=1)if(c[e]!==t[e])return!1;return!0}function xe(e){return l.every(t=>Object.hasOwn(e,t))}function Se(e){return typeof e==`string`?/^\s*\{/u.test(e)&&/\}\s*$/u.test(e):xe(e)}function Ce(){return 1+((s?window.devicePixelRatio:1)-1)*.75}function we(e){let t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth;return!(t.bottom<0||t.top>n||t.right<0||t.left>r)}function j(e){let t=e.target;if(t instanceof HTMLCanvasElement){let n=t.getBoundingClientRect();if(n.width===0||n.height===0||t.width===0||t.height===0)return null;let r=t.width/n.width,i=t.height/n.height,a=(e.clientX-n.left)*r,o=(e.clientY-n.top)*i;return!Number.isFinite(a)||!Number.isFinite(o)||Number.isNaN(a)||Number.isNaN(o)?null:{x:a,y:o}}return null}function Te(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`Failed to read image slot source`)),r.onload=()=>t(r.result),r.readAsDataURL(e)})}async function Ee(e){if(!/^https?:\/\//i.test(e))return e;let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch image slot source from URL: ${e}. ${t.status}: ${t.statusText}`);return Te(await t.blob())}function De(e){let t=e.replace(`OpenUrl: `,``),n=t.indexOf(` | Target: `),r,i;n===-1?(r=t,i=`_blank`):(r=t.substring(0,n),i=t.substring(n+11)),window.open(r,i)}function Oe(e,t,n){let r=null,i=t,a=n;async function o(t){await e({module_or_path:t})}async function s(t){let n=await fetch(t);if(!n.ok)throw Error(`fetch ${t} responded with ${n.status} ${n.statusText}`);await e({module_or_path:await n.arrayBuffer()})}async function c(e,t){try{return await e(t),null}catch(e){return e}}return{load(){if(!r){let e=i,t=null;t=(async()=>{let n=await c(o,e);if(!n)return;console.warn(`Primary WASM load failed from ${e}: ${n.message}`);let i=null;if(a!==null){if(console.warn(`Attempting to load WASM from backup URL: ${a}`),i=await c(o,a),!i)return;console.warn(`Backup WASM load failed from ${a}: ${i.message}`)}console.warn(`Retrying WASM load with buffered instantiation`);let l=await c(s,e);if(l&&(console.warn(`Buffered WASM load from ${e} failed: ${l.message}`),!(a!==null&&(l=await c(s,a),!l))))throw console.error(`Primary WASM URL failed: ${n.message}`),i&&console.error(`Backup WASM URL failed: ${i.message}`),console.error(`Buffered fallback failed: ${l.message}`),r===t&&(r=null),Error(`WASM loading failed from all sources.`)})(),r=t}return r},setWasmUrl(e){if(typeof e!=`string`||e.trim()===``)throw TypeError(`setWasmUrl() expects a non-empty URL string`);a=null,e!==i&&(i=e,r=null)}}}let ke=null;function M(){return ke??(ke=Oe(ge,`https://cdn.jsdelivr.net/npm/@lottiefiles/dotlottie-web@0.80.0/dist/dotlottie-player.wasm`,`https://unpkg.com/@lottiefiles/dotlottie-web@0.80.0/dist/dotlottie-player.wasm`)),ke}const Ae=e=>{switch(e){case`reverse`:return D.Reverse;case`bounce`:return D.Bounce;case`reverse-bounce`:return D.ReverseBounce;default:return D.Forward}},je=e=>{switch(e){case D.Reverse:return`reverse`;case D.Bounce:return`bounce`;case D.ReverseBounce:return`reverse-bounce`;default:return`forward`}},Me=e=>{switch(e){case`contain`:return`contain`;case`cover`:return`cover`;case`fill`:return`fill`;case`fit-height`:return`fit-height`;case`fit-width`:return`fit-width`;case`none`:return`none`;default:return`contain`}};var Ne=class{constructor(e){r(this,`_canvas`,null),r(this,`_pendingLoad`,null),r(this,`_srcFetchAbort`,null),r(this,`_context`,null),r(this,`_eventManager`,void 0),r(this,`_animationFrameId`,null),r(this,`_frameManager`,void 0),r(this,`_boundAnimationLoop`,void 0),r(this,`_dotLottieCore`,null),r(this,`_stateMachineId`,``),r(this,`_stateMachineConfig`,null),r(this,`_isStateMachineRunning`,!1),r(this,`_renderConfig`,{}),r(this,`_isFrozen`,!1),r(this,`_backgroundColor`,null),r(this,`_lastFrameTime`,null),r(this,`_boundOnClick`,null),r(this,`_boundOnPointerUp`,null),r(this,`_boundOnPointerDown`,null),r(this,`_boundOnPointerMove`,null),r(this,`_boundOnPointerEnter`,null),r(this,`_boundOnPointerLeave`,null),r(this,`_bufferMismatchCount`,0),r(this,`_lastExpectedBufferSize`,0),r(this,`_cachedImageData`,null),r(this,`_cachedImageDataBuffer`,null),r(this,`_cachedImageDataByteOffset`,0),r(this,`_marker`,``),r(this,`_segment`,null),this._canvas=e.canvas??null,this._eventManager=new _e,this._frameManager=new o,this._boundAnimationLoop=this._animationLoop.bind(this),this._renderConfig={...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||Ce(),freezeOnOffscreen:e.renderConfig?.freezeOnOffscreen??!0};let t=null;e.src&&!e.data&&(this._srcFetchAbort=new AbortController,t=this._fetchData(e.src,this._srcFetchAbort.signal),t.catch(()=>{})),this._initWasm().then(()=>{this._dotLottieCore=this._createCore(),this._dotLottieCore.set_autoplay(e.autoplay??!1),this._dotLottieCore.set_loop(e.loop??!1),this._dotLottieCore.set_loop_count(e.loopCount??0),this._dotLottieCore.set_mode(Ae(e.mode??`forward`)),this._dotLottieCore.set_speed(e.speed??1),this._dotLottieCore.set_use_frame_interpolation(e.useFrameInterpolation??!0),e.segment&&e.segment.length===2&&(this._segment=[e.segment[0],e.segment[1]],this._dotLottieCore.set_segment(this._segment[0],this._segment[1])),this._marker=e.marker??``,this._marker&&this._dotLottieCore.set_marker(this._marker),this._dotLottieCore.set_layout(e.layout?.fit??`contain`,e.layout?.align?.[0]??.5,e.layout?.align?.[1]??.5),this._applyAssetResolver(e.assetResolver??null),this._stateMachineId=e.stateMachineId??``,this._stateMachineConfig=e.stateMachineConfig??null,this._onCoreCreated(),this._eventManager.dispatch({type:`ready`}),e.data?this._canvas?this._loadFromData(e.data):this._pendingLoad={data:e.data}:e.src&&(this._canvas?this._loadFromSrc(e.src,t):this._pendingLoad={src:e.src,dataPromise:t}),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor)}).catch(e=>{this._srcFetchAbort?.abort(),console.error(`[dotlottie-web] Initialization failed:`,e),this._eventManager.dispatch({type:`loadError`,error:Error(`Failed to load wasm module: ${e}`)})})}async _initWasm(){return M().load()}_createCore(){return new fe}_onCoreCreated(){}_setupTarget(e,t){return this._dotLottieCore?this._dotLottieCore.setup_sw_target(e,t):!1}_drainPlayerEvents({skipFrame:e=!1}={}){if(this._dotLottieCore)for(;;){let t=this._dotLottieCore.poll_event();if(t==null)break;switch(t.type){case`Load`:setTimeout(()=>this._eventManager.dispatch({type:`load`}),0);break;case`LoadError`:setTimeout(()=>this._eventManager.dispatch({type:`loadError`,error:Error(`failed to load`)}),0);break;case`Play`:queueMicrotask(()=>this._eventManager.dispatch({type:`play`}));break;case`Pause`:queueMicrotask(()=>this._eventManager.dispatch({type:`pause`}));break;case`Stop`:queueMicrotask(()=>this._eventManager.dispatch({type:`stop`}));break;case`Frame`:{let n=t.frameNo??0;e||queueMicrotask(()=>this._eventManager.dispatch({type:`frame`,currentFrame:n}));break}case`Render`:{let n=t.frameNo??0;e||queueMicrotask(()=>this._eventManager.dispatch({type:`render`,currentFrame:n}));break}case`Loop`:{let e=t.loopCount??0;queueMicrotask(()=>this._eventManager.dispatch({type:`loop`,loopCount:e}));break}case`Complete`:queueMicrotask(()=>this._eventManager.dispatch({type:`complete`}));break;default:break}}}_discardPlayerEvents(){for(;this._dotLottieCore?.poll_event()!=null;);}_drainSmEvents(){if(this._dotLottieCore){for(;;){let e=this._dotLottieCore.sm_poll_event();if(e==null)break;switch(e.type){case`Start`:queueMicrotask(()=>{this._isStateMachineRunning=!0,this._eventManager.dispatch({type:`stateMachineStart`}),this._startAnimationLoop()});break;case`Stop`:queueMicrotask(()=>{this._isStateMachineRunning=!1,this._eventManager.dispatch({type:`stateMachineStop`}),this._dotLottieCore?.status()!==O.Playing&&this._stopAnimationLoop()});break;case`CustomEvent`:this._eventManager.dispatch({type:`stateMachineCustomEvent`,eventName:e.message??``});break;case`BooleanInputChange`:this._eventManager.dispatch({type:`stateMachineBooleanInputValueChange`,inputName:e.name??``,newValue:e.newValue,oldValue:e.oldValue});break;case`NumericInputChange`:this._eventManager.dispatch({type:`stateMachineNumericInputValueChange`,inputName:e.name??``,newValue:e.newValue,oldValue:e.oldValue});break;case`StringInputChange`:this._eventManager.dispatch({type:`stateMachineStringInputValueChange`,inputName:e.name??``,newValue:e.newValue,oldValue:e.oldValue});break;case`InputFired`:this._eventManager.dispatch({type:`stateMachineInputFired`,inputName:e.name??``});break;case`Transition`:this._eventManager.dispatch({type:`stateMachineTransition`,fromState:e.previousState??``,toState:e.newState??``});break;case`StateEntered`:this._eventManager.dispatch({type:`stateMachineStateEntered`,state:e.state??``});break;case`StateExit`:this._eventManager.dispatch({type:`stateMachineStateExit`,state:e.state??``});break;case`Error`:this._eventManager.dispatch({type:`stateMachineError`,error:e.message??``});break;default:break}}for(;;){let e=this._dotLottieCore.sm_poll_internal_event();if(e==null)break;if(e.type===`Message`){let t=e.message??``;s&&t.startsWith(`OpenUrl: `)?De(t):this._eventManager.dispatch({type:`stateMachineInternalMessage`,message:t})}}}}_dispatchError(e){console.error(e),this._eventManager.dispatch({type:`loadError`,error:Error(e)})}async _fetchData(e,t=null){let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`Failed to fetch animation data from URL: ${e}. ${n.status}: ${n.statusText}`);let r=await n.arrayBuffer();return be(r)?r:new TextDecoder().decode(r)}_loadFromData(e){if(this._dotLottieCore===null)return;if(!this._canvas){console.warn(`[dotlottie-web] Cannot load animation without canvas. Call setCanvas() first.`);return}this._syncCanvasSize(),this._setupTarget(this._canvas.width,this._canvas.height);let t=!1;if(typeof e==`string`){if(t=this._dotLottieCore.load_animation(e),!t&&!Se(e)){this._discardPlayerEvents(),this._dispatchError(`Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.`);return}}else if(e instanceof ArrayBuffer){if(!be(e)){this._dispatchError(`Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.`);return}t=this._dotLottieCore.load_dotlottie_data(new Uint8Array(e))}else if(typeof e==`object`){if(!Se(e)){this._dispatchError(`Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.`);return}t=this._dotLottieCore.load_animation(JSON.stringify(e))}else{this._dispatchError(`Unsupported data type for animation data. Expected:
- string (Lottie JSON),
- ArrayBuffer (dotLottie),
- object (Lottie JSON).
Received: ${typeof e}`);return}if(t){if(this._renderConfig.quality!==void 0&&this._dotLottieCore.set_quality(this._renderConfig.quality),this._drainPlayerEvents({skipFrame:!!this._marker||!!this._segment}),this._marker&&this._dotLottieCore.set_marker(this._marker),this._segment){this._dotLottieCore.set_segment(this._segment[0],this._segment[1]);let e=je(this._dotLottieCore.mode()),t=e===`reverse`||e===`reverse-bounce`?this._segment[1]:this._segment[0];this._dotLottieCore.set_frame(t)}setTimeout(()=>{this._eventManager.dispatch({type:`frame`,currentFrame:this.currentFrame})},0),this._dotLottieCore.render(),this._drainPlayerEvents(),this._draw(),this._stateMachineId?this.stateMachineLoad(this._stateMachineId)&&this.stateMachineStart()&&this._startAnimationLoop():this._dotLottieCore.status()===O.Playing&&this._startAnimationLoop(),s&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.freezeOnOffscreen&&(k.observe(this._canvas,this),we(this._canvas)||this.freeze()),this._renderConfig.autoResize&&A.observe(this._canvas,this))}else this._drainPlayerEvents()}_loadFromSrc(e,t){(t??this._fetchData(e)).then(e=>this._loadFromData(e)).catch(t=>this._dispatchError(`Failed to load animation data from URL: ${e}. ${t}`))}get buffer(){return this._dotLottieCore?this._dotLottieCore.get_pixel_buffer():null}get activeAnimationId(){return this._dotLottieCore?.animation_id()??void 0}get activeThemeId(){return this._dotLottieCore?.theme_id()??void 0}get layout(){if(this._dotLottieCore)return{align:[this._dotLottieCore.layout_align_x(),this._dotLottieCore.layout_align_y()],fit:Me(this._dotLottieCore.layout_fit())}}get marker(){return this._dotLottieCore?.current_marker()??``}get manifest(){try{let e=this._dotLottieCore?.manifest_string();if(this._dotLottieCore===null||!e)return null;let t=JSON.parse(e);return Object.keys(t).length===0?null:t}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){if(this._dotLottieCore)return[this._dotLottieCore.segment_start(),this._dotLottieCore.segment_end()]}get loop(){return this._dotLottieCore?.loop_animation()??!1}get mode(){return this._dotLottieCore?je(this._dotLottieCore.mode()):`forward`}get isFrozen(){return this._isFrozen}get isStateMachineRunning(){return this._isStateMachineRunning}get backgroundColor(){return this._backgroundColor??``}get autoplay(){return this._dotLottieCore?.autoplay()??!1}get useFrameInterpolation(){return this._dotLottieCore?.use_frame_interpolation()??!1}get speed(){return this._dotLottieCore?.speed()??0}get isReady(){return this._dotLottieCore!==null}get isLoaded(){return(this._dotLottieCore?.status()??O.Idle)!==O.Idle}get isPlaying(){return this._dotLottieCore?.status()===O.Playing}get isPaused(){return this._dotLottieCore?.status()===O.Paused}get isStopped(){return this._dotLottieCore?.status()===O.Stopped}get currentFrame(){return this._dotLottieCore?Math.round(this._dotLottieCore.current_frame()*100)/100:0}get loopCount(){return this._dotLottieCore?.current_loop_count()??0}get totalFrames(){return this._dotLottieCore?.total_frames()??0}get duration(){return(this._dotLottieCore?.duration()??0)/1e3}get canvas(){return this._canvas}load(e){this._dotLottieCore!==null&&(this._stopAnimationLoop(),this._cleanupCanvas(),this._isFrozen=!1,this._dotLottieCore.set_autoplay(e.autoplay??!1),this._dotLottieCore.set_loop(e.loop??!1),this._dotLottieCore.set_loop_count(e.loopCount??0),this._dotLottieCore.set_mode(Ae(e.mode??`forward`)),this._dotLottieCore.set_speed(e.speed??1),this._dotLottieCore.set_use_frame_interpolation(e.useFrameInterpolation??!0),e.segment&&e.segment.length===2?(this._segment=[e.segment[0],e.segment[1]],this._dotLottieCore.set_segment(this._segment[0],this._segment[1])):(this._segment=null,this._dotLottieCore.clear_segment()),this._marker=e.marker??``,this._marker?this._dotLottieCore.set_marker(this._marker):this._dotLottieCore.clear_marker(),this._dotLottieCore.set_layout(e.layout?.fit??`contain`,e.layout?.align?.[0]??.5,e.layout?.align?.[1]??.5),this._applyAssetResolver(e.assetResolver??null),e.data?this._canvas?this._loadFromData(e.data):this._pendingLoad={data:e.data}:e.src&&(this._canvas?this._loadFromSrc(e.src):this._pendingLoad={src:e.src}),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor))}_draw(){if(this._dotLottieCore===null||this._canvas===null||(!this._context&&`getContext`in this._canvas&&typeof this._canvas.getContext==`function`&&(!s||typeof HTMLCanvasElement<`u`&&this._canvas instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&this._canvas instanceof OffscreenCanvas)&&(this._context=this._canvas.getContext(`2d`)),!this._context))return;let e=this._dotLottieCore.get_pixel_buffer(),t=this._canvas.width,n=this._canvas.height,r=t*n*4;if(e.byteLength!==r){this._lastExpectedBufferSize===r?this._bufferMismatchCount+=1:(this._bufferMismatchCount=1,this._lastExpectedBufferSize=r),this._bufferMismatchCount===10&&console.warn(`[dotlottie-web] Persistent buffer size mismatch detected. Expected ${r} bytes for canvas ${t}x${n}, but got ${e.byteLength} bytes. This may indicate a WASM memory allocation issue or invalid canvas dimensions.`);return}this._bufferMismatchCount=0,this._lastExpectedBufferSize=r;let i=this._cachedImageData;if(!(i!==null&&i.width===t&&i.height===n&&i.data.byteLength===r&&this._cachedImageDataBuffer===e.buffer&&this._cachedImageDataByteOffset===e.byteOffset)){if(typeof ImageData>`u`)this._cachedImageData=this._context.createImageData(t,n);else{let r=new Uint8ClampedArray(e.buffer,e.byteOffset,e.byteLength);this._cachedImageData=new ImageData(r,t,n)}this._cachedImageDataBuffer=e.buffer,this._cachedImageDataByteOffset=e.byteOffset}if(typeof ImageData>`u`){let t=new Uint8ClampedArray(e.buffer,e.byteOffset,e.byteLength);this._cachedImageData.data.set(t)}this._context.putImageData(this._cachedImageData,0,0)}_cleanupCanvas(){this._canvas&&s&&this._canvas instanceof HTMLCanvasElement&&(k.unobserve(this._canvas),A.unobserve(this._canvas),this._cleanupStateMachineListeners())}_initializeCanvas(){this._setupRendererOnCanvas(),this._canvas&&s&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded&&(this._renderConfig.freezeOnOffscreen&&(k.observe(this._canvas,this),we(this._canvas)||this.freeze()),this._renderConfig.autoResize&&A.observe(this._canvas,this),this._isStateMachineRunning&&this._setupStateMachineListeners()),this._canvas&&this._dotLottieCore&&this.isLoaded&&this._setupTarget(this._canvas.width,this._canvas.height)&&(this._dotLottieCore.render(),this._draw())}_setupRendererOnCanvas(){this._context=null}_stopAnimationLoop(){this._animationFrameId!==null&&(this._frameManager.cancelAnimationFrame(this._animationFrameId),this._animationFrameId=null),this._lastFrameTime=null}_startAnimationLoop(){this._animationFrameId===null&&this._dotLottieCore&&!this._isFrozen&&(this._dotLottieCore.status()===O.Playing||this._isStateMachineRunning)&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._boundAnimationLoop))}_animationLoop(e){if(this._dotLottieCore===null){this._stopAnimationLoop();return}if(this._dotLottieCore.status()!==O.Playing&&!this._isStateMachineRunning){this._stopAnimationLoop();return}try{let t=this._lastFrameTime===null?0:e-this._lastFrameTime;this._lastFrameTime=e;let n=this._isStateMachineRunning?this._dotLottieCore.sm_tick(t):this._dotLottieCore.tick(t);this._isStateMachineRunning?this._drainSmEvents():this._drainPlayerEvents(),n&&this._draw(),this._animationFrameId=this._frameManager.requestAnimationFrame(this._boundAnimationLoop)}catch(e){console.error(`Error in animation frame:`,e),this._eventManager.dispatch({type:`renderError`,error:e}),e instanceof WebAssembly.RuntimeError&&this.destroy()}}play(){if(this._dotLottieCore===null||!this.isLoaded)return;this._stopAnimationLoop();let e=this._dotLottieCore.play();this._drainPlayerEvents(),(e||this._dotLottieCore.status()===O.Playing)&&(this._isFrozen=!1,this._startAnimationLoop()),this._canvas&&s&&this._canvas instanceof HTMLCanvasElement&&this._renderConfig.freezeOnOffscreen&&!we(this._canvas)&&this.freeze()}pause(){this._dotLottieCore!==null&&(this._dotLottieCore.pause(),this._drainPlayerEvents(),this._stopAnimationLoop())}stop(){if(this._dotLottieCore===null)return;let e=this._dotLottieCore.stop();this._drainPlayerEvents(),this._stopAnimationLoop(),e&&(this._eventManager.dispatch({type:`frame`,currentFrame:this.currentFrame}),this._dotLottieCore.render(),this._draw())}setFrame(e){if(this._dotLottieCore!==null&&this._dotLottieCore.set_frame(e)){let e=this._dotLottieCore.render();this._drainPlayerEvents(),e&&this._draw()}}setSpeed(e){this._dotLottieCore!==null&&this._dotLottieCore.set_speed(e)}setBackgroundColor(e){if(this._dotLottieCore!==null){if(s&&this._canvas instanceof HTMLCanvasElement)this._canvas.style.backgroundColor=e;else{let[t,n,r,i]=ye(e);this._dotLottieCore.set_background(t,n,r,i)}this._backgroundColor=e}}setLoop(e){this._dotLottieCore!==null&&this._dotLottieCore.set_loop(e)}setLoopCount(e){this._dotLottieCore!==null&&this._dotLottieCore.set_loop_count(e)}setUseFrameInterpolation(e){this._dotLottieCore!==null&&this._dotLottieCore.set_use_frame_interpolation(e)}_applyAssetResolver(e){if(this._dotLottieCore!==null){if(e===null){this._dotLottieCore.set_asset_resolver(null);return}this._dotLottieCore.set_asset_resolver(t=>{try{return e(t)??null}catch(e){return console.error(`[dotlottie-web] assetResolver threw for "${t}":`,e),null}})}}addEventListener(e,t){this._eventManager.addEventListener(e,t)}removeEventListener(e,t){this._eventManager.removeEventListener(e,t)}destroy(){this._stopAnimationLoop(),this._isStateMachineRunning=!1,this._cleanupCanvas(),this._srcFetchAbort?.abort(),this._srcFetchAbort=null,this._pendingLoad=null;let e=this._dotLottieCore;if(this._dotLottieCore=null,this._context=null,e)try{e.free()}catch(e){console.warn(`[dotlottie-web] Error freeing wasm core during destroy:`,e)}this._eventManager.dispatch({type:`destroy`}),this._eventManager.removeAllEventListeners(),this._cleanupStateMachineListeners()}freeze(){this._animationFrameId!==null&&(this._stopAnimationLoop(),this._isFrozen=!0,this._eventManager.dispatch({type:`freeze`}))}unfreeze(){this._animationFrameId===null&&(this._isFrozen=!1,this._eventManager.dispatch({type:`unfreeze`}),this._startAnimationLoop())}_syncCanvasSize(){if(!(s&&this._canvas instanceof HTMLCanvasElement))return;let e=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:t,width:n}=this._canvas.getBoundingClientRect();t!==0&&n!==0&&(this._canvas.width=n*e,this._canvas.height=t*e)}resize(){!this._dotLottieCore||!this.isLoaded||!this._canvas||(this._syncCanvasSize(),this._setupTarget(this._canvas.width,this._canvas.height)&&(this._dotLottieCore.render(),this._draw()))}setCanvas(e){if(!(!e||this._canvas===e)&&(this._canvas&&this._cleanupCanvas(),this._canvas=e,this._initializeCanvas(),this._pendingLoad)){let e=this._pendingLoad;this._pendingLoad=null,e.data?this._loadFromData(e.data):e.src&&this._loadFromSrc(e.src,e.dataPromise)}}setTransform(e){if(!this._dotLottieCore)return!1;let t=this._dotLottieCore.set_transform(new Float32Array(e));return t&&this._dotLottieCore.render()&&this._draw(),t}getTransform(){if(!this._dotLottieCore)return;let e=this._dotLottieCore.get_transform();return Array.from(e)}setSegment(e,t){this._dotLottieCore!==null&&(this._segment=[e,t],this._dotLottieCore.set_segment(e,t))}resetSegment(){this._dotLottieCore!==null&&(this._segment=null,this._dotLottieCore.clear_segment())}setMode(e){this._dotLottieCore!==null&&this._dotLottieCore.set_mode(Ae(e))}setRenderConfig(e){let{devicePixelRatio:t,freezeOnOffscreen:n,quality:r,...i}=e;this._renderConfig={...this._renderConfig,...i,devicePixelRatio:t||Ce(),freezeOnOffscreen:n??!0,...r!==void 0&&{quality:r}},r!==void 0&&this._dotLottieCore&&this._dotLottieCore.set_quality(r),s&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.autoResize?A.observe(this._canvas,this):A.unobserve(this._canvas),this._renderConfig.freezeOnOffscreen?(k.observe(this._canvas,this),we(this._canvas)||this.freeze()):(k.unobserve(this._canvas),this._isFrozen&&this.unfreeze()))}loadAnimation(e){this._dotLottieCore===null||this._dotLottieCore.animation_id()===e||!this._canvas||(this._syncCanvasSize(),this._setupTarget(this._canvas.width,this._canvas.height),this._dotLottieCore.load_animation_from_id(e)?(this._renderConfig.quality!==void 0&&this._dotLottieCore.set_quality(this._renderConfig.quality),this._drainPlayerEvents(),this._dotLottieCore.render(),this._draw()):this._dispatchError(`Failed to load animation with id: ${e}`))}setMarker(e){this._dotLottieCore!==null&&(this.markers().some(t=>t.name===e)?(this._marker=e,this._dotLottieCore.set_marker(e)):(this._marker=``,this._segment=null,this._dotLottieCore.clear_marker(),this._dotLottieCore.clear_segment()))}markers(){let e=this._dotLottieCore?.markers();return e&&Array.isArray(e)?e:[]}setTheme(e){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.set_theme(e);return t&&(this._dotLottieCore.render(),this._draw()),t}resetTheme(){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.reset_theme();return e&&(this._dotLottieCore.render(),this._draw()),e}setThemeData(e){if(this._dotLottieCore===null)return!1;let t=typeof e==`string`?e:JSON.stringify(e),n=this._dotLottieCore.set_theme_data(t);return n&&(this._dotLottieCore.render(),this._draw()),n}setSlots(e){this._dotLottieCore!==null&&this._dotLottieCore.set_slots_str(JSON.stringify(e))&&(this._dotLottieCore.render(),this._draw())}_isKeyframeArray(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`object`&&e[0]!==null&&`t`in e[0]&&`s`in e[0]}getSlotIds(){if(!this._dotLottieCore)return[];let e=this._dotLottieCore.get_slot_ids();return Array.isArray(e)?e:[]}getSlotType(e){if(!this._dotLottieCore)return;let t=this._dotLottieCore.get_slot_type(e);if(t)return t}getSlot(e){if(!this._dotLottieCore)return;let t=this._dotLottieCore.get_slot_str(e);if(t)try{return JSON.parse(t)}catch{return}}getSlots(){if(!this._dotLottieCore)return{};try{return JSON.parse(this._dotLottieCore.get_slots_str())}catch{return{}}}setColorSlot(e,t){if(this._dotLottieCore===null)return!1;let n=this._isKeyframeArray(t),r=JSON.stringify({a:+!!n,k:t}),i=this._dotLottieCore.set_slot_str(e,r);return this._dotLottieCore.render(),this._draw(),i}setScalarSlot(e,t){if(this._dotLottieCore===null)return!1;let n=JSON.stringify({a:typeof t==`number`?0:1,k:t}),r=this._dotLottieCore.set_slot_str(e,n);return this._dotLottieCore.render(),this._draw(),r}setVectorSlot(e,t){if(this._dotLottieCore===null)return!1;let n=this._isKeyframeArray(t),r=JSON.stringify({a:+!!n,k:t}),i=this._dotLottieCore.set_slot_str(e,r);return this._dotLottieCore.render(),this._draw(),i}setGradientSlot(e,t,n){if(this._dotLottieCore===null)return!1;let r=this._isKeyframeArray(t),i=JSON.stringify({k:{a:+!!r,k:t},p:n}),a=this._dotLottieCore.set_slot_str(e,i);return this._dotLottieCore.render(),this._draw(),a}setTextSlot(e,t){if(this._dotLottieCore===null)return!1;let n=this._dotLottieCore.get_slot_str(e),r=t;if(n){let e=JSON.parse(n);if(e&&`k`in e&&Array.isArray(e.k)){let n=e.k[0];`s`in n&&typeof n.s==`object`&&(r={...n.s,...t})}}let i=JSON.stringify({a:0,k:[{t:0,s:r}]}),a=this._dotLottieCore.set_slot_str(e,i);return this._dotLottieCore.render(),this._draw(),a}async setImageSlot(e,t){if(this._dotLottieCore===null)return!1;let n=await Ee(t);if(this._dotLottieCore===null)return!1;let r=this._dotLottieCore.set_image_slot(e,n);return this._dotLottieCore.render(),this._draw(),r}resetSlot(e){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.reset_slot(e);return this._dotLottieCore.render(),this._draw(),t}clearSlot(e){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.clear_slot(e);return this._dotLottieCore.render(),this._draw(),t}resetSlots(){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.reset_slots();return this._dotLottieCore.render(),this._draw(),e}clearSlots(){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.clear_slots();return this._dotLottieCore.render(),this._draw(),e}setLayout(e){this._dotLottieCore!==null&&this._dotLottieCore.set_layout(e.fit??`contain`,e.align?.[0]??.5,e.align?.[1]??.5)}setViewport(e,t,n,r){return this._dotLottieCore===null?!1:this._dotLottieCore.set_viewport(e,t,n,r)}static setWasmUrl(e){M().setWasmUrl(e)}static preload(){return M().load()}static async registerFont(e,t){try{await M().load();let n;if(typeof t==`string`){let e=await fetch(t);if(!e.ok)return console.error(`Failed to fetch font from URL: ${t}. Status: ${e.status}`),!1;n=new Uint8Array(await e.arrayBuffer())}else n=t instanceof Uint8Array?t:new Uint8Array(t);let r=oe(e,n);return r||console.error(`Failed to register font "${e}". Font data may be invalid.`),r}catch(t){return console.error(`Error registering font "${e}":`,t),!1}}animationSize(){let e=this._dotLottieCore?.animation_size();return{width:e?.[0]??0,height:e?.[1]??0}}stateMachineLoad(e){return this._dotLottieCore?this._dotLottieCore.state_machine_load_from_id(e):!1}stateMachineLoadData(e){return this._dotLottieCore?this._dotLottieCore.state_machine_load(e):!1}stateMachineSetConfig(e){this._stateMachineConfig=e}stateMachineStart(){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.sm_start(this._stateMachineConfig?.openUrlPolicy?.requireUserInteraction??!0,this._stateMachineConfig?.openUrlPolicy?.whitelist??[]);return this._drainSmEvents(),e&&(this._isStateMachineRunning=!0,this._setupStateMachineListeners(),this._startAnimationLoop()),e}stateMachineStop(){if(!this._dotLottieCore)return!1;let e=this._dotLottieCore.sm_stop();return this._drainSmEvents(),e&&(this._isStateMachineRunning=!1,this._cleanupStateMachineListeners(),this._dotLottieCore.status()!==O.Playing&&this._stopAnimationLoop()),e}stateMachineGetStatus(){return this._dotLottieCore?.sm_status()??``}stateMachineGetCurrentState(){return this._dotLottieCore?.sm_current_state()??``}stateMachineGetActiveId(){return this._dotLottieCore?.state_machine_id()??``}stateMachineOverrideState(e,t=!1){return this._dotLottieCore?.sm_override_current_state(e,t)??!1}stateMachineSetSeed(e){return this._dotLottieCore?.sm_set_seed(BigInt(Math.trunc(e)))??!1}stateMachineGet(e){return this._dotLottieCore?.get_state_machine(e)??``}stateMachineGetListeners(){if(!this._dotLottieCore)return[];let e=this._dotLottieCore.sm_framework_setup();return Array.isArray(e)?e:[]}stateMachineSetBooleanInput(e,t){return this._dotLottieCore?.sm_set_boolean_input(e,t)??!1}stateMachineSetNumericInput(e,t){return this._dotLottieCore?.sm_set_numeric_input(e,t)??!1}stateMachineSetStringInput(e,t){return this._dotLottieCore?.sm_set_string_input(e,t)??!1}stateMachineGetBooleanInput(e){return this._dotLottieCore?.sm_get_boolean_input(e)??void 0}stateMachineGetNumericInput(e){return this._dotLottieCore?.sm_get_numeric_input(e)??void 0}stateMachineGetStringInput(e){return this._dotLottieCore?.sm_get_string_input(e)??void 0}stateMachineGetInputs(){if(!this._dotLottieCore)return[];let e=this._dotLottieCore.sm_get_inputs();return Array.isArray(e)?e:[]}stateMachineFireEvent(e){this._dotLottieCore?.sm_fire(e)}stateMachinePostClickEvent(e,t){this._dotLottieCore?.sm_post_click(e,t)}stateMachinePostPointerUpEvent(e,t){this._dotLottieCore?.sm_post_pointer_up(e,t)}stateMachinePostPointerDownEvent(e,t){this._dotLottieCore?.sm_post_pointer_down(e,t)}stateMachinePostPointerMoveEvent(e,t){this._dotLottieCore?.sm_post_pointer_move(e,t)}stateMachinePostPointerEnterEvent(e,t){this._dotLottieCore?.sm_post_pointer_enter(e,t)}stateMachinePostPointerExitEvent(e,t){this._dotLottieCore?.sm_post_pointer_exit(e,t)}_onClick(e){let t=j(e);t&&this.stateMachinePostClickEvent(t.x,t.y)}_onPointerUp(e){let t=j(e);t&&this.stateMachinePostPointerUpEvent(t.x,t.y)}_onPointerDown(e){let t=j(e);t&&this.stateMachinePostPointerDownEvent(t.x,t.y)}_onPointerMove(e){let t=j(e);t&&this.stateMachinePostPointerMoveEvent(t.x,t.y)}_onPointerEnter(e){let t=j(e);t&&this.stateMachinePostPointerEnterEvent(t.x,t.y)}_onPointerLeave(e){let t=j(e);t&&this.stateMachinePostPointerExitEvent(t.x,t.y)}_setupStateMachineListeners(){if(s&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieCore!==null&&this.isLoaded){let e=this.stateMachineGetListeners();this._cleanupStateMachineListeners(),e.includes(`Click`)&&(this._boundOnClick=this._onClick.bind(this),this._canvas.addEventListener(`click`,this._boundOnClick)),e.includes(`PointerUp`)&&(this._boundOnPointerUp=this._onPointerUp.bind(this),this._canvas.addEventListener(`pointerup`,this._boundOnPointerUp)),e.includes(`PointerDown`)&&(this._boundOnPointerDown=this._onPointerDown.bind(this),this._canvas.addEventListener(`pointerdown`,this._boundOnPointerDown)),e.includes(`PointerMove`)&&(this._boundOnPointerMove=this._onPointerMove.bind(this),this._canvas.addEventListener(`pointermove`,this._boundOnPointerMove)),e.includes(`PointerEnter`)&&(this._boundOnPointerEnter=this._onPointerEnter.bind(this),this._canvas.addEventListener(`pointerenter`,this._boundOnPointerEnter)),e.includes(`PointerExit`)&&(this._boundOnPointerLeave=this._onPointerLeave.bind(this),this._canvas.addEventListener(`pointerleave`,this._boundOnPointerLeave))}}_cleanupStateMachineListeners(){s&&this._canvas instanceof HTMLCanvasElement&&(this._boundOnClick&&(this._canvas.removeEventListener(`click`,this._boundOnClick),this._boundOnClick=null),this._boundOnPointerUp&&(this._canvas.removeEventListener(`pointerup`,this._boundOnPointerUp),this._boundOnPointerUp=null),this._boundOnPointerDown&&(this._canvas.removeEventListener(`pointerdown`,this._boundOnPointerDown),this._boundOnPointerDown=null),this._boundOnPointerMove&&(this._canvas.removeEventListener(`pointermove`,this._boundOnPointerMove),this._boundOnPointerMove=null),this._boundOnPointerEnter&&(this._canvas.removeEventListener(`pointerenter`,this._boundOnPointerEnter),this._boundOnPointerEnter=null),this._boundOnPointerLeave&&(this._canvas.removeEventListener(`pointerleave`,this._boundOnPointerLeave),this._boundOnPointerLeave=null))}};
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const Pe=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer((()=>{customElements.define(e,t)}))},N=globalThis,Fe=N.ShadowRoot&&(N.ShadyCSS===void 0||N.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,Ie=Symbol(),Le=new WeakMap;var Re=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Ie)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Fe&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Le.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Le.set(t,e))}return e}toString(){return this.cssText}};const ze=e=>new Re(typeof e==`string`?e:e+``,void 0,Ie),Be=(e,...t)=>new Re(e.length===1?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1]),e[0]),e,Ie),Ve=(e,t)=>{if(Fe)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let n of t){let t=document.createElement(`style`),r=N.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},He=Fe?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return ze(t)})(e):e;var Ue;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const{is:We,defineProperty:Ge,getOwnPropertyDescriptor:Ke,getOwnPropertyNames:qe,getOwnPropertySymbols:Je,getPrototypeOf:Ye}=Object,P=globalThis,Xe=P.trustedTypes,Ze=Xe?Xe.emptyScript:``,Qe=P.reactiveElementPolyfillSupport,F=(e,t)=>e,I={toAttribute(e,t){switch(t){case Boolean:e=e?Ze:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},$e=(e,t)=>!We(e,t),et={attribute:!0,type:String,converter:I,reflect:!1,useDefault:!1,hasChanged:$e};(Ue=Symbol).metadata??(Ue.metadata=Symbol(`metadata`)),P.litPropertyMetadata??(P.litPropertyMetadata=new WeakMap);var L=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=et){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&Ge(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=Ke(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??et}static _$Ei(){if(this.hasOwnProperty(F(`elementProperties`)))return;let e=Ye(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(F(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(F(`properties`))){let e=this.properties,t=[...qe(e),...Je(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(He(e))}else e!==void 0&&t.push(He(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ve(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?I:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?I:e.converter;this._$Em=r,this[r]=i.fromAttribute(t,e.type)??this._$Ej?.get(r)??null,this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){let r=this.constructor,i=this[e];if(n??(n=r.getPropertyOptions(e)),!((n.hasChanged??$e)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(e){}firstUpdated(e){}};L.elementStyles=[],L.shadowRootOptions={mode:`open`},L[F(`elementProperties`)]=new Map,L[F(`finalized`)]=new Map,Qe?.({ReactiveElement:L}),(P.reactiveElementVersions??(P.reactiveElementVersions=[])).push(`2.1.0`);
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const tt={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:$e},nt=(e=tt,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error(`Unsupported decorator location: `+r)};function R(e){return(t,n)=>typeof n==`object`?nt(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/function rt(e){return R({...e,state:!0,attribute:!1})}
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const it=globalThis,z=it.trustedTypes,at=z?z.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,ot=`$lit$`,B=`lit$${Math.random().toFixed(9).slice(2)}$`,st=`?`+B,ct=`<${st}>`,V=document,H=()=>V.createComment(``),U=e=>e===null||typeof e!=`object`&&typeof e!=`function`,lt=Array.isArray,ut=e=>lt(e)||typeof e?.[Symbol.iterator]==`function`,dt=`[
\f\r]`,W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ft=/-->/g,pt=/>/g,G=RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),mt=/'/g,ht=/"/g,gt=/^(?:script|style|textarea|title)$/i,_t=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),K=Symbol.for(`lit-noChange`),q=Symbol.for(`lit-nothing`),vt=new WeakMap,J=V.createTreeWalker(V,129);function yt(e,t){if(!lt(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return at===void 0?t:at.createHTML(t)}const bt=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=W;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===W?c[1]===`!--`?o=ft:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=G):(gt.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=G):o=pt:o===G?c[0]===`>`?(o=i??W,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?G:c[3]===`"`?ht:mt):o===ht||o===mt?o=G:o===ft||o===pt?o=W:(o=G,i=void 0);let d=o===G&&e[t+1].startsWith(`/>`)?` `:``;a+=o===W?n+ct:l>=0?(r.push(s),n.slice(0,l)+ot+n.slice(l)+B+d):n+B+(l===-2?t:d)}return[yt(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]};var xt=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=bt(t,n);if(this.el=e.createElement(l,r),J.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=J.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(ot)){let t=u[o++],n=i.getAttribute(e).split(B),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Tt:r[1]===`?`?Et:r[1]===`@`?Dt:wt}),i.removeAttribute(e)}else e.startsWith(B)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(gt.test(i.tagName)){let e=i.textContent.split(B),t=e.length-1;if(t>0){i.textContent=z?z.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],H()),J.nextNode(),c.push({type:2,index:++a});i.append(e[t],H())}}}else if(i.nodeType===8)if(i.data===st)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(B,e+1))!==-1;)c.push({type:7,index:a}),e+=B.length-1}a++}}static createElement(e,t){let n=V.createElement(`template`);return n.innerHTML=e,n}};function Y(e,t,n=e,r){if(t===K)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=U(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??(n._$Co=[]))[r]=i),i!==void 0&&(t=Y(e,i._$AS(e,t.values),i,r)),t}var St=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??V).importNode(t,!0);J.currentNode=r;let i=J.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new Ct(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Ot(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=J.nextNode(),a++)}return J.currentNode=V,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},Ct=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=q,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Y(this,e,t),U(e)?e===q||e==null||e===``?(this._$AH!==q&&this._$AR(),this._$AH=q):e!==this._$AH&&e!==K&&this._(e):e._$litType$===void 0?e.nodeType===void 0?ut(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==q&&U(this._$AH)?this._$AA.nextSibling.data=e:this.T(V.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=xt.createElement(yt(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new St(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=vt.get(e.strings);return t===void 0&&vt.set(e.strings,t=new xt(e)),t}k(t){lt(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(H()),this.O(H()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},wt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=q,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=q}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=Y(this,e,t,0),a=!U(e)||e!==this._$AH&&e!==K,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=Y(this,r[n+o],t,o),s===K&&(s=this._$AH[o]),a||(a=!U(s)||s!==this._$AH[o]),s===q?e=q:e!==q&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===q?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Tt=class extends wt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===q?void 0:e}},Et=class extends wt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==q)}},Dt=class extends wt{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=Y(this,e,t,0)??q)===K)return;let n=this._$AH,r=e===q&&n!==q||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==q&&(n===q||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Ot=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Y(this,e)}};const kt=it.litHtmlPolyfillSupport;kt?.(xt,Ct),(it.litHtmlVersions??(it.litHtmlVersions=[])).push(`3.3.0`);const At=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new Ct(t.insertBefore(H(),e),e,void 0,n??{})}return i._$AI(e),i},jt=globalThis;var X=class extends L{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;let t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=At(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return K}};X._$litElement$=!0,X.finalized=!0,jt.litElementHydrateSupport?.({LitElement:X});const Mt=jt.litElementPolyfillSupport;Mt?.({LitElement:X}),(jt.litElementVersions??(jt.litElementVersions=[])).push(`4.2.0`);function Z(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function Q(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var $=class extends X{constructor(...e){super(...e),this.dotLottie=null}_isPlayerReady(){return this.dotLottie?.isReady??!1}get animationId(){return this._isPlayerReady()?this.dotLottie?.activeAnimationId:this._animationId}set animationId(e){this._animationId=e,e&&this.dotLottie&&this.dotLottie.activeAnimationId!==e&&this.dotLottie.loadAnimation(e)}get loop(){return this._isPlayerReady()?this.dotLottie?.loop:this._loop}set loop(e){this._loop=e,this.dotLottie?.setLoop(e??!1)}get loopCount(){return this._loopCount}set loopCount(e){this._loopCount=e,this.dotLottie?.setLoopCount(e??0)}get autoplay(){return this._isPlayerReady()?this.dotLottie?.autoplay:this._autoplay}set autoplay(e){this._autoplay=e}get speed(){return this._isPlayerReady()?this.dotLottie?.speed:this._speed}set speed(e){this._speed=e,this.dotLottie?.setSpeed(e??1)}get segment(){return this._isPlayerReady()?this.dotLottie?.segment:this._segment}set segment(e){this._segment=e,this.dotLottie&&(Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`?this.dotLottie.setSegment(e[0],e[1]):this.dotLottie.resetSegment())}get mode(){return this._isPlayerReady()?this.dotLottie?.mode:this._mode}set mode(e){this._mode=e,this.dotLottie?.setMode(e||`forward`)}get marker(){return this._isPlayerReady()?this.dotLottie?.marker:this._marker}set marker(e){this._marker=e,this.dotLottie?.setMarker(e??``)}get backgroundColor(){return this._isPlayerReady()?this.dotLottie?.backgroundColor:this._backgroundColor}set backgroundColor(e){this._backgroundColor=e,this.dotLottie?.setBackgroundColor(e??``)}get renderConfig(){return this._isPlayerReady()?this.dotLottie?.renderConfig:this._renderConfig}set renderConfig(e){this._renderConfig=e,this.dotLottie?.setRenderConfig(e??{})}get useFrameInterpolation(){return this._isPlayerReady()?this.dotLottie?.useFrameInterpolation:this._useFrameInterpolation}set useFrameInterpolation(e){this._useFrameInterpolation=e,this.dotLottie?.setUseFrameInterpolation(e??!0)}get themeId(){return this._isPlayerReady()?this.dotLottie?.activeThemeId:this._themeId}set themeId(e){this._themeId=e,this.dotLottie?.setTheme(e??``)}_declaredConfig(){return{loop:this._loop,loopCount:this._loopCount,autoplay:this._autoplay,speed:this._speed,segment:this._segment,marker:this._marker,mode:this._mode,renderConfig:this._renderConfig,useFrameInterpolation:this._useFrameInterpolation,themeId:this._themeId,backgroundColor:this._backgroundColor,stateMachineConfig:this.stateMachineConfig,stateMachineId:this.stateMachineId}}_init(){let e=document.createElement(`canvas`);this.shadowRoot?.appendChild(e),this.dotLottie=this._createDotLottieInstance({...this._declaredConfig(),canvas:e,src:this.src,data:this.data,animationId:this._animationId,workerId:this.workerId})}connectedCallback(){super.connectedCallback(),this._init()}adoptedCallback(){this._init()}disconnectedCallback(){super.disconnectedCallback(),this.dotLottie?.destroy(),this.dotLottie=null,this.shadowRoot?.querySelector(`canvas`)?.remove()}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),!(!this.dotLottie||t===n)&&(e===`src`&&n&&this.dotLottie.load({...this._declaredConfig(),src:n,data:this.data}),e===`data`&&n&&this.dotLottie.load({...this._declaredConfig(),src:this.src,data:n,animationId:this._animationId}),e===`statemachineid`&&this.dotLottie.isLoaded&&(n?this.dotLottie.stateMachineLoad(n)&&this.dotLottie.stateMachineStart():this.dotLottie.stateMachineStop()),e===`statemachineconfig`&&this.dotLottie.stateMachineSetConfig(n?JSON.parse(n):null))}render(){return _t`<slot></slot>`}};$.styles=Be`
:host {
display: block;
position: relative;
}
:host > canvas {
width: 100%;
height: 100%;
}
`,Q([R({type:String}),Z(`design:type`,Object),Z(`design:paramtypes`,[])],$.prototype,`animationId`,null),Q([R({type:String}),Z(`design:type`,Object)],$.prototype,`src`,void 0),Q([R({type:String}),Z(`design:type`,Object)],$.prototype,`data`,void 0),Q([R({type:Boolean}),Z(`design:type`,Object),Z(`design:paramtypes`,[])],$.prototype,`loop`,null),Q([R({type:Number}),Z(`design:type`,Object),Z(`design:paramtypes`,[])],$.prototype,`loopCount`,null),Q([R({type:Boolean}),Z(`design:type`,Object),Z(`design:paramtypes`,[])],$.prototype,`autoplay`,null),Q([R({type:Number}),Z(`design:type`,Object),Z(`design:paramtypes`,[])],$.prototype,`speed`,null),Q([R({type:Array}),Z(`design:type`,Object),Z(`design:paramtypes`,[])],$.prototype,`segment`,null),Q([R({type:String}),Z(`design:type`,Object),Z(`design:paramtypes`,[])],$.prototype,`mode`,null),Q([R({type:String}),Z(`design:type`,Object),Z(`design:paramtypes`,[])],$.prototype,`marker`,null),Q([R({type:String}),Z(`design:type`,Object),Z(`design:paramtypes`,[])],$.prototype,`backgroundColor`,null),Q([R({type:Object}),Z(`design:type`,Object),Z(`design:paramtypes`,[])],$.prototype,`renderConfig`,null),Q([R({type:Boolean,converter:{fromAttribute:e=>e===null?void 0:e!==`false`}}),Z(`design:type`,Object),Z(`design:paramtypes`,[])],$.prototype,`useFrameInterpolation`,null),Q([R({type:String}),Z(`design:type`,Object),Z(`design:paramtypes`,[])],$.prototype,`themeId`,null),Q([R({type:String}),Z(`design:type`,String)],$.prototype,`workerId`,void 0),Q([R({type:String}),Z(`design:type`,Object)],$.prototype,`stateMachineId`,void 0),Q([R({type:Object}),Z(`design:type`,Object)],$.prototype,`stateMachineConfig`,void 0),Q([rt(),Z(`design:type`,Object)],$.prototype,`dotLottie`,void 0);const Nt=e=>{Ne.setWasmUrl(e)};let Pt=class extends ${_createDotLottieInstance(e){return new Ne(e)}};Pt=Q([Pe(`dotlottie-wc`)],Pt);export{Pt as DotLottieWC,Nt as setWasmUrl};
//# sourceMappingURL=dotlottie-wc.js.map