@lottiefiles/dotlottie-web 0.78.0 → 0.78.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});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,d=0,f=null;function p(){return(f===null||f.byteLength===0)&&(f=new Uint8Array(u.memory.buffer)),f}const m=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},ee=typeof m.encodeInto==`function`?function(e,t){return m.encodeInto(e,t)}:function(e,t){let n=m.encode(e);return t.set(n),{read:e.length,written:n.length}};function h(e,t,n){if(n===void 0){let n=m.encode(e),r=t(n.length,1)>>>0;return p().subarray(r,r+n.length).set(n),d=n.length,r}let r=e.length,i=t(r,1)>>>0,a=p(),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=p().subarray(i+o,i+r),a=ee(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return d=o,i}let g=null;function _(){return(g===null||g.buffer.detached===!0||g.buffer.detached===void 0&&g.buffer!==u.memory.buffer)&&(g=new DataView(u.memory.buffer)),g}function v(e){let t=u.__externref_table_alloc_command_export();return u.__wbindgen_export_4.set(t,e),t}function y(e,t){try{return e.apply(this,t)}catch(e){let t=v(e);u.__wbindgen_exn_store_command_export(t)}}const b=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&b.decode();function x(e,t){return e>>>=0,b.decode(p().subarray(e,e+t))}function S(e){return e==null}let C=null;function w(){return(C===null||C.byteLength===0)&&(C=new Float32Array(u.memory.buffer)),C}function T(e,t){let n=t(e.length*4,4)>>>0;return w().set(e,n/4),d=e.length,n}function E(e,t){let n=t(e.length*1,1)>>>0;return p().set(e,n/1),d=e.length,n}function te(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=v(e[t]);_().setUint32(n+4*t,r,!0)}return d=e.length,n}function ne(e,t){let n=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),r=d,i=E(t,u.__wbindgen_malloc_command_export),a=d;return u.register_font(n,r,i,a)!==0}const D=Object.freeze({Forward:0,0:`Forward`,Reverse:1,1:`Reverse`,Bounce:2,2:`Bounce`,ReverseBounce:3,3:`ReverseBounce`}),O=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>u.__wbg_dotlottieplayerwasm_free(e>>>0,1));var re=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,O.unregister(this),e}free(){let e=this.__destroy_into_raw();u.__wbg_dotlottieplayerwasm_free(e,0)}clear_slot(e){let t=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;return u.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,t,n)!==0}is_playing(){return u.dotlottieplayerwasm_is_playing(this.__wbg_ptr)!==0}is_stopped(){return u.dotlottieplayerwasm_is_stopped(this.__wbg_ptr)!==0}layout_fit(){let e,t;try{let n=u.dotlottieplayerwasm_layout_fit(this.__wbg_ptr);return e=n[0],t=n[1],x(n[0],n[1])}finally{u.__wbindgen_free_command_export(e,t,1)}}loop_count(){return u.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){return u.dotlottieplayerwasm_poll_event(this.__wbg_ptr)}reset_slot(e){let t=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;return u.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,t,n)!==0}set_layout(e,t,n){let r=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),i=d;return u.dotlottieplayerwasm_set_layout(this.__wbg_ptr,r,i,t,n)!==0}set_marker(e){let t=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;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}is_tweening(){return u.dotlottieplayerwasm_is_tweening(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=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;return u.dotlottieplayerwasm_unload_font(t,n)!==0}animation_id(){let e=u.dotlottieplayerwasm_animation_id(this.__wbg_ptr),t;return e[0]!==0&&(t=x(e[0],e[1]).slice(),u.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}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 u.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr)}get_slot_str(e){let t=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d,r=u.dotlottieplayerwasm_get_slot_str(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=x(r[0],r[1]).slice(),u.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}marker_names(){return 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=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),r=d,i=h(t,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),a=d;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){let t=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d,r=u.dotlottieplayerwasm_get_slot_type(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=x(r[0],r[1]).slice(),u.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}get_slots_str(){let e,t;try{let n=u.dotlottieplayerwasm_get_slots_str(this.__wbg_ptr);return e=n[0],t=n[1],x(n[0],n[1])}finally{u.__wbindgen_free_command_export(e,t,1)}}get_transform(){return u.dotlottieplayerwasm_get_transform(this.__wbg_ptr)}segment_start(){return u.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(e){let t=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;return u.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,t,n)!==0}set_text_slot(e,t){let n=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),r=d,i=h(t,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),a=d;return u.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,n,r,i,a)!==0}set_transform(e){let t=T(e,u.__wbindgen_malloc_command_export),n=d;return u.dotlottieplayerwasm_set_transform(this.__wbg_ptr,t,n)!==0}sm_get_inputs(){return u.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr)}sm_poll_event(){return 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 u.dotlottieplayerwasm_animation_size(this.__wbg_ptr)}current_marker(){let e=u.dotlottieplayerwasm_current_marker(this.__wbg_ptr),t;return e[0]!==0&&(t=x(e[0],e[1]).slice(),u.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}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=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;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=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),a=d;return u.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,a,t,n,r)!==0}set_image_slot(e,t){let n=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),r=d,i=h(t,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),a=d;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=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;return u.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,t,n)!==0}sm_reset_input(e){let t=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;u.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,t,n)}manifest_string(){let e,t;try{let n=u.dotlottieplayerwasm_manifest_string(this.__wbg_ptr);return e=n[0],t=n[1],x(n[0],n[1])}finally{u.__wbindgen_free_command_export(e,t,1)}}set_scalar_slot(e,t){let n=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),r=d;return u.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,n,r,t)!==0}set_vector_slot(e,t,n){let r=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),i=d;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 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 n=u.dotlottieplayerwasm_sm_current_state(this.__wbg_ptr);return e=n[0],t=n[1],x(n[0],n[1])}finally{u.__wbindgen_free_command_export(e,t,1)}}state_machine_id(){let e=u.dotlottieplayerwasm_state_machine_id(this.__wbg_ptr),t;return e[0]!==0&&(t=x(e[0],e[1]).slice(),u.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}get_state_machine(e){let t=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d,r=u.dotlottieplayerwasm_get_state_machine(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=x(r[0],r[1]).slice(),u.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}set_position_slot(e,t,n){let r=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),i=d;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}sm_framework_setup(){return 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=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;return u.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,t,n)!==0}load_dotlottie_data(e){let t=E(e,u.__wbindgen_malloc_command_export),n=d;return u.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,t,n)!==0}sm_get_string_input(e){let t=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d,r=u.dotlottieplayerwasm_sm_get_string_input(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=x(r[0],r[1]).slice(),u.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}sm_set_string_input(e,t){let n=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),r=d,i=h(t,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),a=d;return u.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,n,r,i,a)!==0}sm_get_boolean_input(e){let t=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d,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=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d,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=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),r=d;return u.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,n,r,t)!==0}sm_set_numeric_input(e,t){let n=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),r=d;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=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;return u.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,t,n)!==0}sm_poll_internal_event(){return 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=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),r=d;return u.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,n,r,t)!==0}state_machine_load_from_id(e){let t=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;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,O.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}markers(){return u.dotlottieplayerwasm_markers(this.__wbg_ptr)}sm_fire(e){let t=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;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=te(t,u.__wbindgen_malloc_command_export),r=d;return u.dotlottieplayerwasm_sm_start(this.__wbg_ptr,e,n,r)!==0}theme_id(){let e=u.dotlottieplayerwasm_theme_id(this.__wbg_ptr),t;return e[0]!==0&&(t=x(e[0],e[1]).slice(),u.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}is_loaded(){return u.dotlottieplayerwasm_is_loaded(this.__wbg_ptr)!==0}is_paused(){return u.dotlottieplayerwasm_is_paused(this.__wbg_ptr)!==0}load_font(e,t){let n=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),r=d,i=E(t,u.__wbindgen_malloc_command_export),a=d;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=h(e,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),n=d;return u.dotlottieplayerwasm_set_theme(this.__wbg_ptr,t,n)!==0}sm_status(){let e,t;try{let n=u.dotlottieplayerwasm_sm_status(this.__wbg_ptr);return e=n[0],t=n[1],x(n[0],n[1])}finally{u.__wbindgen_free_command_export(e,t,1)}}};async function ie(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 ae(){let e={};return e.wbg={},e.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},e.wbg.__wbg_createObjectURL_6e98d2f9c7bd9764=function(){return y(function(e,t){let n=h(URL.createObjectURL(t),u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),r=d;_().setInt32(e+4,r,!0),_().setInt32(e+0,n,!0)},arguments)},e.wbg.__wbg_ended_b873fb75d0c13ca7=function(e){return e.ended},e.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,t){let n,r;try{n=e,r=t,console.error(x(e,t))}finally{u.__wbindgen_free_command_export(n,r,1)}},e.wbg.__wbg_new_405e22f390576ce2=function(){return{}},e.wbg.__wbg_new_78feb108b6472713=function(){return[]},e.wbg.__wbg_new_8a6f238a6ece86ea=function(){return Error()},e.wbg.__wbg_new_a12002a7f91c75be=function(e){return new Uint8Array(e)},e.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(e,t,n){return new Uint8Array(e,t>>>0,n>>>0)},e.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(e){return new Float32Array(e>>>0)},e.wbg.__wbg_newwithsrc_20307ca7e8762a81=function(){return y(function(e,t){return new Audio(x(e,t))},arguments)},e.wbg.__wbg_newwithu8arraysequenceandoptions_068570c487f69127=function(){return y(function(e,t){return new Blob(e,t)},arguments)},e.wbg.__wbg_pause_b74c96d69f769518=function(){return y(function(e){e.pause()},arguments)},e.wbg.__wbg_play_f6ec5fc4e84b0d26=function(){return y(function(e){return e.play()},arguments)},e.wbg.__wbg_push_737cfc8c1432c2c6=function(e,t){return e.push(t)},e.wbg.__wbg_revokeObjectURL_27267efebeb457c7=function(){return y(function(e,t){URL.revokeObjectURL(x(e,t))},arguments)},e.wbg.__wbg_set_bb8cecf6a62b9f46=function(){return y(function(e,t,n){return Reflect.set(e,t,n)},arguments)},e.wbg.__wbg_setcurrentTime_64727eddd3966512=function(e,t){e.currentTime=t},e.wbg.__wbg_setindex_4e73afdcd9bb95cd=function(e,t,n){e[t>>>0]=n},e.wbg.__wbg_settype_39ed370d3edd403c=function(e,t,n){e.type=x(t,n)},e.wbg.__wbg_setvolume_3895e06a030ca4f7=function(e,t){e.volume=t},e.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,t){let n=t.stack,r=h(n,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),i=d;_().setInt32(e+4,i,!0),_().setInt32(e+0,r,!0)},e.wbg.__wbindgen_init_externref_table=function(){let e=u.__wbindgen_export_4,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},e.wbg.__wbindgen_memory=function(){return u.memory},e.wbg.__wbindgen_number_new=function(e){return e},e.wbg.__wbindgen_string_get=function(e,t){let n=t,r=typeof n==`string`?n:void 0;var i=S(r)?0:h(r,u.__wbindgen_malloc_command_export,u.__wbindgen_realloc_command_export),a=d;_().setInt32(e+4,a,!0),_().setInt32(e+0,i,!0)},e.wbg.__wbindgen_string_new=function(e,t){return x(e,t)},e.wbg.__wbindgen_throw=function(e,t){throw Error(x(e,t))},e}function oe(e,t){return u=e.exports,k.__wbindgen_wasm_module=t,g=null,C=null,f=null,u.__wbindgen_start(),u}async function k(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=ae();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await ie(await e,t);return oe(n,r)}var A=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()}},j=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(j,`_observer`,null),r(j,`_observedCanvases`,new Map);var M=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(M,`_observer`,null),r(M,`_observedCanvases`,new Map);function N(e){return/^#([\da-f]{6}|[\da-f]{8})$/iu.test(e)}function P(e){if(!N(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 F(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 I(e){return l.every(t=>Object.hasOwn(e,t))}function L(e){return typeof e==`string`?/^\s*\{/u.test(e)&&/\}\s*$/u.test(e):I(e)}function R(){return 1+((s?window.devicePixelRatio:1)-1)*.75}function z(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 B(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 V(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 H(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 V(await t.blob())}function U(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 se(e,t,n){let r=null,i=t;async function a(t){await e({module_or_path:t})}async function o(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()})}return{load(){if(!r){let e=i,t=n;r=(async()=>{let n,i;try{await a(e);return}catch(r){n=r,console.warn(`Primary WASM load failed from ${e}: ${r.message}`),console.warn(`Attempting to load WASM from backup URL: ${t}`)}try{await a(t);return}catch(e){i=e,console.warn(`Backup WASM load failed from ${t}: ${e.message}`)}console.warn(`Retrying WASM load with buffered instantiation`);try{await o(e);return}catch(t){console.warn(`Buffered WASM load from ${e} failed: ${t.message}`)}try{await o(t);return}catch(e){throw console.error(`Primary WASM URL failed: ${n.message}`),console.error(`Backup WASM URL failed: ${i.message}`),console.error(`Buffered fallback failed: ${e.message}`),r=null,Error(`WASM loading failed from all sources.`)}})()}return r},setWasmUrl(e){e!==i&&(i=e,r=null)}}}let W=null;function G(){return W??(W=se(k,`https://cdn.jsdelivr.net/npm/@lottiefiles/dotlottie-web@0.78.0/dist/dotlottie-player.wasm`,`https://unpkg.com/@lottiefiles/dotlottie-web@0.78.0/dist/dotlottie-player.wasm`)),W}const K=e=>{switch(e){case`reverse`:return D.Reverse;case`bounce`:return D.Bounce;case`reverse-bounce`:return D.ReverseBounce;default:return D.Forward}},q=e=>{switch(e){case D.Reverse:return`reverse`;case D.Bounce:return`bounce`;case D.ReverseBounce:return`reverse-bounce`;default:return`forward`}},ce=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 le=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 A,this._frameManager=new o,this._boundAnimationLoop=this._animationLoop.bind(this),this._renderConfig={...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||R(),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(K(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._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 G().load()}_createCore(){return new re}_onCoreCreated(){}_setupTarget(e,t){return this._dotLottieCore?this._dotLottieCore.setup_sw_target(e,t):!1}_drainPlayerEvents({skipFrame:e=!1}={}){if(!this._dotLottieCore)return;let t;for(;(t=this._dotLottieCore.poll_event())!=null;){let n=t;switch(n.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`:e||queueMicrotask(()=>this._eventManager.dispatch({type:`frame`,currentFrame:n.frameNo??0}));break;case`Render`:e||queueMicrotask(()=>this._eventManager.dispatch({type:`render`,currentFrame:n.frameNo??0}));break;case`Loop`:queueMicrotask(()=>this._eventManager.dispatch({type:`loop`,loopCount:n.loopCount??0}));break;case`Complete`:queueMicrotask(()=>this._eventManager.dispatch({type:`complete`}));break;default:break}}}_discardPlayerEvents(){for(;this._dotLottieCore?.poll_event()!=null;);}_drainSmEvents(){if(!this._dotLottieCore)return;let e;for(;(e=this._dotLottieCore.sm_poll_event())!=null;){let t=e;switch(t.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?.is_playing()||this._stopAnimationLoop()});break;case`CustomEvent`:this._eventManager.dispatch({type:`stateMachineCustomEvent`,eventName:t.message??``});break;case`BooleanInputChange`:this._eventManager.dispatch({type:`stateMachineBooleanInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`NumericInputChange`:this._eventManager.dispatch({type:`stateMachineNumericInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`StringInputChange`:this._eventManager.dispatch({type:`stateMachineStringInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`InputFired`:this._eventManager.dispatch({type:`stateMachineInputFired`,inputName:t.name??``});break;case`Transition`:this._eventManager.dispatch({type:`stateMachineTransition`,fromState:t.previousState??``,toState:t.newState??``});break;case`StateEntered`:this._eventManager.dispatch({type:`stateMachineStateEntered`,state:t.state??``});break;case`StateExit`:this._eventManager.dispatch({type:`stateMachineStateExit`,state:t.state??``});break;case`Error`:this._eventManager.dispatch({type:`stateMachineError`,error:t.message??``});break;default:break}}let t;for(;(t=this._dotLottieCore.sm_poll_internal_event())!=null;){let e=t;if(e.type===`Message`){let t=e.message??``;s&&t.startsWith(`OpenUrl: `)?U(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 F(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&&!L(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(!F(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(!L(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:
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});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]),ee=[`v`,`ip`,`op`,`layers`,`fr`,`w`,`h`];let l,u=0,d=null;function f(){return(d===null||d.byteLength===0)&&(d=new Uint8Array(l.memory.buffer)),d}const p=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},m=typeof p.encodeInto==`function`?function(e,t){return p.encodeInto(e,t)}:function(e,t){let n=p.encode(e);return t.set(n),{read:e.length,written:n.length}};function h(e,t,n){if(n===void 0){let n=p.encode(e),r=t(n.length,1)>>>0;return f().subarray(r,r+n.length).set(n),u=n.length,r}let r=e.length,i=t(r,1)>>>0,a=f(),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=f().subarray(i+o,i+r),a=m(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return u=o,i}let g=null;function _(){return(g===null||g.buffer.detached===!0||g.buffer.detached===void 0&&g.buffer!==l.memory.buffer)&&(g=new DataView(l.memory.buffer)),g}function v(e){let t=l.__externref_table_alloc_command_export();return l.__wbindgen_export_4.set(t,e),t}function y(e,t){try{return e.apply(this,t)}catch(e){let t=v(e);l.__wbindgen_exn_store_command_export(t)}}const b=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&b.decode();function x(e,t){return e>>>=0,b.decode(f().subarray(e,e+t))}function S(e){return e==null}let C=null;function w(){return(C===null||C.byteLength===0)&&(C=new Float32Array(l.memory.buffer)),C}function T(e,t){let n=t(e.length*4,4)>>>0;return w().set(e,n/4),u=e.length,n}function E(e,t){let n=t(e.length*1,1)>>>0;return f().set(e,n/1),u=e.length,n}function te(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=v(e[t]);_().setUint32(n+4*t,r,!0)}return u=e.length,n}function ne(e,t){let n=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),r=u,i=E(t,l.__wbindgen_malloc_command_export),a=u;return l.register_font(n,r,i,a)!==0}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`}),k=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>l.__wbg_dotlottieplayerwasm_free(e>>>0,1));var re=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,k.unregister(this),e}free(){let e=this.__destroy_into_raw();l.__wbg_dotlottieplayerwasm_free(e,0)}clear_slot(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;return l.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,t,n)!==0}layout_fit(){let e,t;try{let n=l.dotlottieplayerwasm_layout_fit(this.__wbg_ptr);return e=n[0],t=n[1],x(n[0],n[1])}finally{l.__wbindgen_free_command_export(e,t,1)}}loop_count(){return l.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){return l.dotlottieplayerwasm_poll_event(this.__wbg_ptr)}reset_slot(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;return l.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,t,n)!==0}set_layout(e,t,n){let r=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),i=u;return l.dotlottieplayerwasm_set_layout(this.__wbg_ptr,r,i,t,n)!==0}set_marker(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;l.dotlottieplayerwasm_set_marker(this.__wbg_ptr,t,n)}clear_slots(){return l.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)!==0}is_complete(){return l.dotlottieplayerwasm_is_complete(this.__wbg_ptr)!==0}reset_slots(){return l.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)!==0}reset_theme(){return l.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)!==0}segment_end(){return l.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_quality(e){return l.dotlottieplayerwasm_set_quality(this.__wbg_ptr,e)!==0}set_segment(e,t){return l.dotlottieplayerwasm_set_segment(this.__wbg_ptr,e,t)!==0}sm_set_seed(e){return l.dotlottieplayerwasm_sm_set_seed(this.__wbg_ptr,e)!==0}static unload_font(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;return l.dotlottieplayerwasm_unload_font(t,n)!==0}animation_id(){let e=l.dotlottieplayerwasm_animation_id(this.__wbg_ptr),t;return e[0]!==0&&(t=x(e[0],e[1]).slice(),l.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}audio_volume(){return l.dotlottieplayerwasm_audio_volume(this.__wbg_ptr)}background_a(){return l.dotlottieplayerwasm_background_a(this.__wbg_ptr)}background_b(){return l.dotlottieplayerwasm_background_b(this.__wbg_ptr)}background_g(){return l.dotlottieplayerwasm_background_g(this.__wbg_ptr)}background_r(){return l.dotlottieplayerwasm_background_r(this.__wbg_ptr)}clear_marker(){l.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}emit_on_loop(){l.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}get_slot_ids(){return l.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr)}get_slot_str(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u,r=l.dotlottieplayerwasm_get_slot_str(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=x(r[0],r[1]).slice(),l.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}marker_names(){return l.dotlottieplayerwasm_marker_names(this.__wbg_ptr)}set_autoplay(e){l.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,e)}set_slot_str(e,t){let n=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),r=u,i=h(t,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),a=u;return l.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,n,r,i,a)!==0}set_viewport(e,t,n,r){return l.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,e,t,n,r)!==0}total_frames(){return l.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}clear_segment(){return l.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)!==0}current_frame(){return l.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}get_slot_type(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u,r=l.dotlottieplayerwasm_get_slot_type(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=x(r[0],r[1]).slice(),l.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}get_slots_str(){let e,t;try{let n=l.dotlottieplayerwasm_get_slots_str(this.__wbg_ptr);return e=n[0],t=n[1],x(n[0],n[1])}finally{l.__wbindgen_free_command_export(e,t,1)}}get_transform(){return l.dotlottieplayerwasm_get_transform(this.__wbg_ptr)}segment_start(){return l.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;return l.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,t,n)!==0}set_text_slot(e,t){let n=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),r=u,i=h(t,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),a=u;return l.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,n,r,i,a)!==0}set_transform(e){let t=T(e,l.__wbindgen_malloc_command_export),n=u;return l.dotlottieplayerwasm_set_transform(this.__wbg_ptr,t,n)!==0}sm_get_inputs(){return l.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr)}sm_poll_event(){return l.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr)}sm_post_click(e,t){l.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,e,t)}animation_size(){return l.dotlottieplayerwasm_animation_size(this.__wbg_ptr)}current_marker(){let e=l.dotlottieplayerwasm_current_marker(this.__wbg_ptr),t;return e[0]!==0&&(t=x(e[0],e[1]).slice(),l.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}layout_align_x(){return l.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return l.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}load_animation(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;return l.dotlottieplayerwasm_load_animation(this.__wbg_ptr,t,n)!==0}loop_animation(){return l.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)!==0}set_background(e,t,n,r){return l.dotlottieplayerwasm_set_background(this.__wbg_ptr,e,t,n,r)!==0}set_color_slot(e,t,n,r){let i=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),a=u;return l.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,a,t,n,r)!==0}set_image_slot(e,t){let n=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),r=u,i=h(t,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),a=u;return l.dotlottieplayerwasm_set_image_slot(this.__wbg_ptr,n,r,i,a)!==0}set_loop_count(e){l.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,e)}set_theme_data(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;return l.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,t,n)!==0}sm_reset_input(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;l.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,t,n)}manifest_string(){let e,t;try{let n=l.dotlottieplayerwasm_manifest_string(this.__wbg_ptr);return e=n[0],t=n[1],x(n[0],n[1])}finally{l.__wbindgen_free_command_export(e,t,1)}}set_scalar_slot(e,t){let n=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),r=u;return l.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,n,r,t)!==0}set_vector_slot(e,t,n){let r=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),i=u;return l.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,r,i,t,n)!==0}setup_sw_target(e,t){return l.dotlottieplayerwasm_setup_sw_target(this.__wbg_ptr,e,t)!==0}get_pixel_buffer(){return l.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr)}set_audio_volume(e){l.dotlottieplayerwasm_set_audio_volume(this.__wbg_ptr,e)}sm_current_state(){let e,t;try{let n=l.dotlottieplayerwasm_sm_current_state(this.__wbg_ptr);return e=n[0],t=n[1],x(n[0],n[1])}finally{l.__wbindgen_free_command_export(e,t,1)}}state_machine_id(){let e=l.dotlottieplayerwasm_state_machine_id(this.__wbg_ptr),t;return e[0]!==0&&(t=x(e[0],e[1]).slice(),l.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}get_state_machine(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u,r=l.dotlottieplayerwasm_get_state_machine(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=x(r[0],r[1]).slice(),l.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}set_position_slot(e,t,n){let r=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),i=u;return l.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,r,i,t,n)!==0}current_loop_count(){return l.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}sm_framework_setup(){return l.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr)}sm_post_pointer_up(e,t){l.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,e,t)}state_machine_load(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;return l.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,t,n)!==0}load_dotlottie_data(e){let t=E(e,l.__wbindgen_malloc_command_export),n=u;return l.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,t,n)!==0}sm_get_string_input(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u,r=l.dotlottieplayerwasm_sm_get_string_input(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=x(r[0],r[1]).slice(),l.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}sm_set_string_input(e,t){let n=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),r=u,i=h(t,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),a=u;return l.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,n,r,i,a)!==0}sm_get_boolean_input(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u,r=l.dotlottieplayerwasm_sm_get_boolean_input(this.__wbg_ptr,t,n);return r===16777215?void 0:r!==0}sm_get_numeric_input(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u,r=l.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,t,n);return r===4294967297?void 0:r}sm_post_pointer_down(e,t){l.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,e,t)}sm_post_pointer_exit(e,t){l.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,e,t)}sm_post_pointer_move(e,t){l.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,e,t)}sm_set_boolean_input(e,t){let n=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),r=u;return l.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,n,r,t)!==0}sm_set_numeric_input(e,t){let n=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),r=u;return l.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,n,r,t)!==0}state_machine_unload(){l.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_post_pointer_enter(e,t){l.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,e,t)}load_animation_from_id(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;return l.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,t,n)!==0}sm_poll_internal_event(){return l.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr)}use_frame_interpolation(){return l.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)!==0}reset_current_loop_count(){l.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}sm_override_current_state(e,t){let n=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),r=u;return l.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,n,r,t)!==0}state_machine_load_from_id(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;return l.dotlottieplayerwasm_state_machine_load_from_id(this.__wbg_ptr,t,n)!==0}set_use_frame_interpolation(e){l.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,e)}constructor(){let e=l.dotlottieplayerwasm_new();return this.__wbg_ptr=e>>>0,k.register(this,this.__wbg_ptr,this),this}mode(){return l.dotlottieplayerwasm_mode(this.__wbg_ptr)}play(){return l.dotlottieplayerwasm_play(this.__wbg_ptr)!==0}stop(){return l.dotlottieplayerwasm_stop(this.__wbg_ptr)!==0}tick(e){return l.dotlottieplayerwasm_tick(this.__wbg_ptr,e)!==0}pause(){return l.dotlottieplayerwasm_pause(this.__wbg_ptr)!==0}speed(){return l.dotlottieplayerwasm_speed(this.__wbg_ptr)}width(){return l.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return l.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}render(){return l.dotlottieplayerwasm_render(this.__wbg_ptr)!==0}status(){return l.dotlottieplayerwasm_status(this.__wbg_ptr)}markers(){return l.dotlottieplayerwasm_markers(this.__wbg_ptr)}sm_fire(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;return l.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,t,n)!==0}sm_stop(){return l.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)!==0}sm_tick(e){return l.dotlottieplayerwasm_sm_tick(this.__wbg_ptr,e)!==0}autoplay(){return l.dotlottieplayerwasm_autoplay(this.__wbg_ptr)!==0}duration(){return l.dotlottieplayerwasm_duration(this.__wbg_ptr)}set_loop(e){l.dotlottieplayerwasm_set_loop(this.__wbg_ptr,e)}set_mode(e){l.dotlottieplayerwasm_set_mode(this.__wbg_ptr,e)}sm_start(e,t){let n=te(t,l.__wbindgen_malloc_command_export),r=u;return l.dotlottieplayerwasm_sm_start(this.__wbg_ptr,e,n,r)!==0}theme_id(){let e=l.dotlottieplayerwasm_theme_id(this.__wbg_ptr),t;return e[0]!==0&&(t=x(e[0],e[1]).slice(),l.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}load_font(e,t){let n=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),r=u,i=E(t,l.__wbindgen_malloc_command_export),a=u;return l.dotlottieplayerwasm_load_font(this.__wbg_ptr,n,r,i,a)!==0}set_frame(e){return l.dotlottieplayerwasm_set_frame(this.__wbg_ptr,e)!==0}set_speed(e){l.dotlottieplayerwasm_set_speed(this.__wbg_ptr,e)}set_theme(e){let t=h(e,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),n=u;return l.dotlottieplayerwasm_set_theme(this.__wbg_ptr,t,n)!==0}sm_status(){let e,t;try{let n=l.dotlottieplayerwasm_sm_status(this.__wbg_ptr);return e=n[0],t=n[1],x(n[0],n[1])}finally{l.__wbindgen_free_command_export(e,t,1)}}};async function ie(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 ae(){let e={};return e.wbg={},e.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},e.wbg.__wbg_createObjectURL_6e98d2f9c7bd9764=function(){return y(function(e,t){let n=h(URL.createObjectURL(t),l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),r=u;_().setInt32(e+4,r,!0),_().setInt32(e+0,n,!0)},arguments)},e.wbg.__wbg_ended_b873fb75d0c13ca7=function(e){return e.ended},e.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,t){let n,r;try{n=e,r=t,console.error(x(e,t))}finally{l.__wbindgen_free_command_export(n,r,1)}},e.wbg.__wbg_new_405e22f390576ce2=function(){return{}},e.wbg.__wbg_new_78feb108b6472713=function(){return[]},e.wbg.__wbg_new_8a6f238a6ece86ea=function(){return Error()},e.wbg.__wbg_new_a12002a7f91c75be=function(e){return new Uint8Array(e)},e.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(e,t,n){return new Uint8Array(e,t>>>0,n>>>0)},e.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(e){return new Float32Array(e>>>0)},e.wbg.__wbg_newwithsrc_20307ca7e8762a81=function(){return y(function(e,t){return new Audio(x(e,t))},arguments)},e.wbg.__wbg_newwithu8arraysequenceandoptions_068570c487f69127=function(){return y(function(e,t){return new Blob(e,t)},arguments)},e.wbg.__wbg_pause_b74c96d69f769518=function(){return y(function(e){e.pause()},arguments)},e.wbg.__wbg_play_f6ec5fc4e84b0d26=function(){return y(function(e){return e.play()},arguments)},e.wbg.__wbg_push_737cfc8c1432c2c6=function(e,t){return e.push(t)},e.wbg.__wbg_revokeObjectURL_27267efebeb457c7=function(){return y(function(e,t){URL.revokeObjectURL(x(e,t))},arguments)},e.wbg.__wbg_set_bb8cecf6a62b9f46=function(){return y(function(e,t,n){return Reflect.set(e,t,n)},arguments)},e.wbg.__wbg_setcurrentTime_64727eddd3966512=function(e,t){e.currentTime=t},e.wbg.__wbg_setindex_4e73afdcd9bb95cd=function(e,t,n){e[t>>>0]=n},e.wbg.__wbg_settype_39ed370d3edd403c=function(e,t,n){e.type=x(t,n)},e.wbg.__wbg_setvolume_3895e06a030ca4f7=function(e,t){e.volume=t},e.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,t){let n=t.stack,r=h(n,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),i=u;_().setInt32(e+4,i,!0),_().setInt32(e+0,r,!0)},e.wbg.__wbindgen_init_externref_table=function(){let e=l.__wbindgen_export_4,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},e.wbg.__wbindgen_memory=function(){return l.memory},e.wbg.__wbindgen_number_new=function(e){return e},e.wbg.__wbindgen_string_get=function(e,t){let n=t,r=typeof n==`string`?n:void 0;var i=S(r)?0:h(r,l.__wbindgen_malloc_command_export,l.__wbindgen_realloc_command_export),a=u;_().setInt32(e+4,a,!0),_().setInt32(e+0,i,!0)},e.wbg.__wbindgen_string_new=function(e,t){return x(e,t)},e.wbg.__wbindgen_throw=function(e,t){throw Error(x(e,t))},e}function oe(e,t){return l=e.exports,A.__wbindgen_wasm_module=t,g=null,C=null,d=null,l.__wbindgen_start(),l}async function A(e){if(l!==void 0)return l;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=ae();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await ie(await e,t);return oe(n,r)}var j=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()}},M=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(M,`_observer`,null),r(M,`_observedCanvases`,new Map);var N=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(N,`_observer`,null),r(N,`_observedCanvases`,new Map);function P(e){return/^#([\da-f]{6}|[\da-f]{8})$/iu.test(e)}function F(e){if(!P(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 I(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 L(e){return ee.every(t=>Object.hasOwn(e,t))}function R(e){return typeof e==`string`?/^\s*\{/u.test(e)&&/\}\s*$/u.test(e):L(e)}function z(){return 1+((s?window.devicePixelRatio:1)-1)*.75}function B(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 V(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 se(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 H(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 se(await t.blob())}function U(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 ce(e,t,n){let r=null,i=t;async function a(t){await e({module_or_path:t})}async function o(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()})}return{load(){if(!r){let e=i,t=n;r=(async()=>{let n,i;try{await a(e);return}catch(r){n=r,console.warn(`Primary WASM load failed from ${e}: ${r.message}`),console.warn(`Attempting to load WASM from backup URL: ${t}`)}try{await a(t);return}catch(e){i=e,console.warn(`Backup WASM load failed from ${t}: ${e.message}`)}console.warn(`Retrying WASM load with buffered instantiation`);try{await o(e);return}catch(t){console.warn(`Buffered WASM load from ${e} failed: ${t.message}`)}try{await o(t);return}catch(e){throw console.error(`Primary WASM URL failed: ${n.message}`),console.error(`Backup WASM URL failed: ${i.message}`),console.error(`Buffered fallback failed: ${e.message}`),r=null,Error(`WASM loading failed from all sources.`)}})()}return r},setWasmUrl(e){e!==i&&(i=e,r=null)}}}let W=null;function G(){return W??(W=ce(A,`https://cdn.jsdelivr.net/npm/@lottiefiles/dotlottie-web@0.78.1/dist/dotlottie-player.wasm`,`https://unpkg.com/@lottiefiles/dotlottie-web@0.78.1/dist/dotlottie-player.wasm`)),W}const K=e=>{switch(e){case`reverse`:return D.Reverse;case`bounce`:return D.Bounce;case`reverse-bounce`:return D.ReverseBounce;default:return D.Forward}},q=e=>{switch(e){case D.Reverse:return`reverse`;case D.Bounce:return`bounce`;case D.ReverseBounce:return`reverse-bounce`;default:return`forward`}},le=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 ue=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 j,this._frameManager=new o,this._boundAnimationLoop=this._animationLoop.bind(this),this._renderConfig={...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||z(),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(K(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._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 G().load()}_createCore(){return new re}_onCoreCreated(){}_setupTarget(e,t){return this._dotLottieCore?this._dotLottieCore.setup_sw_target(e,t):!1}_drainPlayerEvents({skipFrame:e=!1}={}){if(!this._dotLottieCore)return;let t;for(;(t=this._dotLottieCore.poll_event())!=null;){let n=t;switch(n.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`:e||queueMicrotask(()=>this._eventManager.dispatch({type:`frame`,currentFrame:n.frameNo??0}));break;case`Render`:e||queueMicrotask(()=>this._eventManager.dispatch({type:`render`,currentFrame:n.frameNo??0}));break;case`Loop`:queueMicrotask(()=>this._eventManager.dispatch({type:`loop`,loopCount:n.loopCount??0}));break;case`Complete`:queueMicrotask(()=>this._eventManager.dispatch({type:`complete`}));break;default:break}}}_discardPlayerEvents(){for(;this._dotLottieCore?.poll_event()!=null;);}_drainSmEvents(){if(!this._dotLottieCore)return;let e;for(;(e=this._dotLottieCore.sm_poll_event())!=null;){let t=e;switch(t.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:t.message??``});break;case`BooleanInputChange`:this._eventManager.dispatch({type:`stateMachineBooleanInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`NumericInputChange`:this._eventManager.dispatch({type:`stateMachineNumericInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`StringInputChange`:this._eventManager.dispatch({type:`stateMachineStringInputValueChange`,inputName:t.name??``,newValue:t.newValue,oldValue:t.oldValue});break;case`InputFired`:this._eventManager.dispatch({type:`stateMachineInputFired`,inputName:t.name??``});break;case`Transition`:this._eventManager.dispatch({type:`stateMachineTransition`,fromState:t.previousState??``,toState:t.newState??``});break;case`StateEntered`:this._eventManager.dispatch({type:`stateMachineStateEntered`,state:t.state??``});break;case`StateExit`:this._eventManager.dispatch({type:`stateMachineStateExit`,state:t.state??``});break;case`Error`:this._eventManager.dispatch({type:`stateMachineError`,error:t.message??``});break;default:break}}let t;for(;(t=this._dotLottieCore.sm_poll_internal_event())!=null;){let e=t;if(e.type===`Message`){let t=e.message??``;s&&t.startsWith(`OpenUrl: `)?U(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 I(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&&!R(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(!I(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(!R(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:
2
2
  - string (Lottie JSON),
3
3
  - ArrayBuffer (dotLottie),
4
4
  - object (Lottie JSON).
5
- 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=q(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.is_playing()&&this._startAnimationLoop(),s&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.freezeOnOffscreen&&(j.observe(this._canvas,this),z(this._canvas)||this.freeze()),this._renderConfig.autoResize&&M.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:ce(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?q(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?.is_loaded()??!1}get isPlaying(){return this._dotLottieCore?.is_playing()??!1}get isPaused(){return this._dotLottieCore?.is_paused()??!1}get isStopped(){return this._dotLottieCore?.is_stopped()??!1}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(K(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),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&&(j.unobserve(this._canvas),M.unobserve(this._canvas),this._cleanupStateMachineListeners())}_initializeCanvas(){this._setupRendererOnCanvas(),this._canvas&&s&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded&&(this._renderConfig.freezeOnOffscreen&&(j.observe(this._canvas,this),z(this._canvas)||this.freeze()),this._renderConfig.autoResize&&M.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.is_playing()||this._isStateMachineRunning)&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._boundAnimationLoop))}_animationLoop(e){if(this._dotLottieCore===null){this._stopAnimationLoop();return}if(!this._dotLottieCore.is_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.is_playing())&&(this._isFrozen=!1,this._startAnimationLoop()),this._canvas&&s&&this._canvas instanceof HTMLCanvasElement&&this._renderConfig.freezeOnOffscreen&&!z(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]=P(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)}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(K(e))}setRenderConfig(e){let{devicePixelRatio:t,freezeOnOffscreen:n,quality:r,...i}=e;this._renderConfig={...this._renderConfig,...i,devicePixelRatio:t||R(),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?M.observe(this._canvas,this):M.unobserve(this._canvas),this._renderConfig.freezeOnOffscreen?(j.observe(this._canvas,this),z(this._canvas)||this.freeze()):(j.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 H(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){G().setWasmUrl(e)}static preload(){return G().load()}static async registerFont(e,t){try{await G().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=ne(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.is_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=B(e);t&&this.stateMachinePostClickEvent(t.x,t.y)}_onPointerUp(e){let t=B(e);t&&this.stateMachinePostPointerUpEvent(t.x,t.y)}_onPointerDown(e){let t=B(e);t&&this.stateMachinePostPointerDownEvent(t.x,t.y)}_onPointerMove(e){let t=B(e);t&&this.stateMachinePostPointerMoveEvent(t.x,t.y)}_onPointerEnter(e){let t=B(e);t&&this.stateMachinePostPointerEnterEvent(t.x,t.y)}_onPointerLeave(e){let t=B(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))}},ue=class{constructor(){if(typeof Worker>`u`)throw Error(`Worker is not supported in this environment.`);let e=new Blob(['"use strict";(()=>{var dt=Object.defineProperty;var lt=(n,t,e)=>t in n?dt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var l=(n,t,e)=>lt(n,typeof t!="symbol"?t+"":t,e);var D=class{requestAnimationFrame(t){return requestAnimationFrame(t)}cancelAnimationFrame(t){cancelAnimationFrame(t)}},z=class{constructor(){l(this,"_lastHandleId",0);l(this,"_lastImmediate",null)}requestAnimationFrame(t){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{t(performance.now())}),this._lastHandleId}cancelAnimationFrame(t){this._lastImmediate&&clearImmediate(this._lastImmediate)}},T=class{constructor(){l(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new D:new z}requestAnimationFrame(t){return this._strategy.requestAnimationFrame(t)}cancelAnimationFrame(t){this._strategy.cancelAnimationFrame(t)}};var g=typeof window<"u"&&typeof window.document<"u";var A=new Uint8Array([80,75,3,4]),Y=["v","ip","op","layers","fr","w","h"],V="0.78.0",U="@lottiefiles/dotlottie-web",X=.75,Z=4;var o,c=0,S=null;function R(){return(S===null||S.byteLength===0)&&(S=new Uint8Array(o.memory.buffer)),S}var F=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},pt=typeof F.encodeInto=="function"?function(n,t){return F.encodeInto(n,t)}:function(n,t){let e=F.encode(n);return t.set(e),{read:n.length,written:e.length}};function p(n,t,e){if(e===void 0){let d=F.encode(n),u=t(d.length,1)>>>0;return R().subarray(u,u+d.length).set(d),c=d.length,u}let r=n.length,s=t(r,1)>>>0,i=R(),_=0;for(;_<r;_++){let d=n.charCodeAt(_);if(d>127)break;i[s+_]=d}if(_!==r){_!==0&&(n=n.slice(_)),s=e(s,r,r=_+n.length*3,1)>>>0;let d=R().subarray(s+_,s+r),u=pt(n,d);_+=u.written,s=e(s,r,_,1)>>>0}return c=_,s}var M=null;function C(){return(M===null||M.buffer.detached===!0||M.buffer.detached===void 0&&M.buffer!==o.memory.buffer)&&(M=new DataView(o.memory.buffer)),M}function q(n){let t=o.__externref_table_alloc_command_export();return o.__wbindgen_export_4.set(t,n),t}function E(n,t){try{return n.apply(this,t)}catch(e){let r=q(e);o.__wbindgen_exn_store_command_export(r)}}var tt=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&tt.decode();function h(n,t){return n=n>>>0,tt.decode(R().subarray(n,n+t))}function ut(n){return n==null}var x=null;function ht(){return(x===null||x.byteLength===0)&&(x=new Float32Array(o.memory.buffer)),x}function mt(n,t){let e=t(n.length*4,4)>>>0;return ht().set(n,e/4),c=n.length,e}function N(n,t){let e=t(n.length*1,1)>>>0;return R().set(n,e/1),c=n.length,e}function ft(n,t){let e=t(n.length*4,4)>>>0;for(let r=0;r<n.length;r++){let s=q(n[r]);C().setUint32(e+4*r,s,!0)}return c=n.length,e}function et(n,t){let e=p(n,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=N(t,o.__wbindgen_malloc_command_export),i=c;return o.register_font(e,r,s,i)!==0}var v=Object.freeze({Forward:0,0:"Forward",Reverse:1,1:"Reverse",Bounce:2,2:"Bounce",ReverseBounce:3,3:"ReverseBounce"}),Q=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>o.__wbg_dotlottieplayerwasm_free(n>>>0,1)),O=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,Q.unregister(this),t}free(){let t=this.__destroy_into_raw();o.__wbg_dotlottieplayerwasm_free(t,0)}clear_slot(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,e,r)!==0}is_playing(){return o.dotlottieplayerwasm_is_playing(this.__wbg_ptr)!==0}is_stopped(){return o.dotlottieplayerwasm_is_stopped(this.__wbg_ptr)!==0}layout_fit(){let t,e;try{let r=o.dotlottieplayerwasm_layout_fit(this.__wbg_ptr);return t=r[0],e=r[1],h(r[0],r[1])}finally{o.__wbindgen_free_command_export(t,e,1)}}loop_count(){return o.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){return o.dotlottieplayerwasm_poll_event(this.__wbg_ptr)}reset_slot(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,e,r)!==0}set_layout(t,e,r){let s=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),i=c;return o.dotlottieplayerwasm_set_layout(this.__wbg_ptr,s,i,e,r)!==0}set_marker(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;o.dotlottieplayerwasm_set_marker(this.__wbg_ptr,e,r)}clear_slots(){return o.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)!==0}is_complete(){return o.dotlottieplayerwasm_is_complete(this.__wbg_ptr)!==0}is_tweening(){return o.dotlottieplayerwasm_is_tweening(this.__wbg_ptr)!==0}reset_slots(){return o.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)!==0}reset_theme(){return o.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)!==0}segment_end(){return o.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_quality(t){return o.dotlottieplayerwasm_set_quality(this.__wbg_ptr,t)!==0}set_segment(t,e){return o.dotlottieplayerwasm_set_segment(this.__wbg_ptr,t,e)!==0}sm_set_seed(t){return o.dotlottieplayerwasm_sm_set_seed(this.__wbg_ptr,t)!==0}static unload_font(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_unload_font(e,r)!==0}animation_id(){let t=o.dotlottieplayerwasm_animation_id(this.__wbg_ptr),e;return t[0]!==0&&(e=h(t[0],t[1]).slice(),o.__wbindgen_free_command_export(t[0],t[1]*1,1)),e}audio_volume(){return o.dotlottieplayerwasm_audio_volume(this.__wbg_ptr)}background_a(){return o.dotlottieplayerwasm_background_a(this.__wbg_ptr)}background_b(){return o.dotlottieplayerwasm_background_b(this.__wbg_ptr)}background_g(){return o.dotlottieplayerwasm_background_g(this.__wbg_ptr)}background_r(){return o.dotlottieplayerwasm_background_r(this.__wbg_ptr)}clear_marker(){o.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}emit_on_loop(){o.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}get_slot_ids(){return o.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr)}get_slot_str(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=o.dotlottieplayerwasm_get_slot_str(this.__wbg_ptr,e,r),i;return s[0]!==0&&(i=h(s[0],s[1]).slice(),o.__wbindgen_free_command_export(s[0],s[1]*1,1)),i}marker_names(){return o.dotlottieplayerwasm_marker_names(this.__wbg_ptr)}set_autoplay(t){o.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,t)}set_slot_str(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c,i=p(e,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),_=c;return o.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,r,s,i,_)!==0}set_viewport(t,e,r,s){return o.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,t,e,r,s)!==0}total_frames(){return o.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}clear_segment(){return o.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)!==0}current_frame(){return o.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}get_slot_type(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=o.dotlottieplayerwasm_get_slot_type(this.__wbg_ptr,e,r),i;return s[0]!==0&&(i=h(s[0],s[1]).slice(),o.__wbindgen_free_command_export(s[0],s[1]*1,1)),i}get_slots_str(){let t,e;try{let r=o.dotlottieplayerwasm_get_slots_str(this.__wbg_ptr);return t=r[0],e=r[1],h(r[0],r[1])}finally{o.__wbindgen_free_command_export(t,e,1)}}get_transform(){return o.dotlottieplayerwasm_get_transform(this.__wbg_ptr)}segment_start(){return o.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,e,r)!==0}set_text_slot(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c,i=p(e,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),_=c;return o.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,r,s,i,_)!==0}set_transform(t){let e=mt(t,o.__wbindgen_malloc_command_export),r=c;return o.dotlottieplayerwasm_set_transform(this.__wbg_ptr,e,r)!==0}sm_get_inputs(){return o.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr)}sm_poll_event(){return o.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr)}sm_post_click(t,e){o.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,t,e)}animation_size(){return o.dotlottieplayerwasm_animation_size(this.__wbg_ptr)}current_marker(){let t=o.dotlottieplayerwasm_current_marker(this.__wbg_ptr),e;return t[0]!==0&&(e=h(t[0],t[1]).slice(),o.__wbindgen_free_command_export(t[0],t[1]*1,1)),e}layout_align_x(){return o.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return o.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}load_animation(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_load_animation(this.__wbg_ptr,e,r)!==0}loop_animation(){return o.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)!==0}set_background(t,e,r,s){return o.dotlottieplayerwasm_set_background(this.__wbg_ptr,t,e,r,s)!==0}set_color_slot(t,e,r,s){let i=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),_=c;return o.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,_,e,r,s)!==0}set_image_slot(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c,i=p(e,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),_=c;return o.dotlottieplayerwasm_set_image_slot(this.__wbg_ptr,r,s,i,_)!==0}set_loop_count(t){o.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,t)}set_theme_data(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,e,r)!==0}sm_reset_input(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;o.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,e,r)}manifest_string(){let t,e;try{let r=o.dotlottieplayerwasm_manifest_string(this.__wbg_ptr);return t=r[0],e=r[1],h(r[0],r[1])}finally{o.__wbindgen_free_command_export(t,e,1)}}set_scalar_slot(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c;return o.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,r,s,e)!==0}set_vector_slot(t,e,r){let s=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),i=c;return o.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,s,i,e,r)!==0}setup_sw_target(t,e){return o.dotlottieplayerwasm_setup_sw_target(this.__wbg_ptr,t,e)!==0}get_pixel_buffer(){return o.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr)}set_audio_volume(t){o.dotlottieplayerwasm_set_audio_volume(this.__wbg_ptr,t)}sm_current_state(){let t,e;try{let r=o.dotlottieplayerwasm_sm_current_state(this.__wbg_ptr);return t=r[0],e=r[1],h(r[0],r[1])}finally{o.__wbindgen_free_command_export(t,e,1)}}state_machine_id(){let t=o.dotlottieplayerwasm_state_machine_id(this.__wbg_ptr),e;return t[0]!==0&&(e=h(t[0],t[1]).slice(),o.__wbindgen_free_command_export(t[0],t[1]*1,1)),e}get_state_machine(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=o.dotlottieplayerwasm_get_state_machine(this.__wbg_ptr,e,r),i;return s[0]!==0&&(i=h(s[0],s[1]).slice(),o.__wbindgen_free_command_export(s[0],s[1]*1,1)),i}set_position_slot(t,e,r){let s=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),i=c;return o.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,s,i,e,r)!==0}current_loop_count(){return o.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}sm_framework_setup(){return o.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr)}sm_post_pointer_up(t,e){o.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,t,e)}state_machine_load(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,e,r)!==0}load_dotlottie_data(t){let e=N(t,o.__wbindgen_malloc_command_export),r=c;return o.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,e,r)!==0}sm_get_string_input(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=o.dotlottieplayerwasm_sm_get_string_input(this.__wbg_ptr,e,r),i;return s[0]!==0&&(i=h(s[0],s[1]).slice(),o.__wbindgen_free_command_export(s[0],s[1]*1,1)),i}sm_set_string_input(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c,i=p(e,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),_=c;return o.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,r,s,i,_)!==0}sm_get_boolean_input(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=o.dotlottieplayerwasm_sm_get_boolean_input(this.__wbg_ptr,e,r);return s===16777215?void 0:s!==0}sm_get_numeric_input(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=o.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,e,r);return s===4294967297?void 0:s}sm_post_pointer_down(t,e){o.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,t,e)}sm_post_pointer_exit(t,e){o.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,t,e)}sm_post_pointer_move(t,e){o.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,t,e)}sm_set_boolean_input(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c;return o.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,r,s,e)!==0}sm_set_numeric_input(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c;return o.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,r,s,e)!==0}state_machine_unload(){o.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_post_pointer_enter(t,e){o.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,t,e)}load_animation_from_id(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,e,r)!==0}sm_poll_internal_event(){return o.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr)}use_frame_interpolation(){return o.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)!==0}reset_current_loop_count(){o.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}sm_override_current_state(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c;return o.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,r,s,e)!==0}state_machine_load_from_id(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_state_machine_load_from_id(this.__wbg_ptr,e,r)!==0}set_use_frame_interpolation(t){o.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,t)}constructor(){let t=o.dotlottieplayerwasm_new();return this.__wbg_ptr=t>>>0,Q.register(this,this.__wbg_ptr,this),this}mode(){return o.dotlottieplayerwasm_mode(this.__wbg_ptr)}play(){return o.dotlottieplayerwasm_play(this.__wbg_ptr)!==0}stop(){return o.dotlottieplayerwasm_stop(this.__wbg_ptr)!==0}tick(t){return o.dotlottieplayerwasm_tick(this.__wbg_ptr,t)!==0}pause(){return o.dotlottieplayerwasm_pause(this.__wbg_ptr)!==0}speed(){return o.dotlottieplayerwasm_speed(this.__wbg_ptr)}width(){return o.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return o.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}render(){return o.dotlottieplayerwasm_render(this.__wbg_ptr)!==0}markers(){return o.dotlottieplayerwasm_markers(this.__wbg_ptr)}sm_fire(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,e,r)!==0}sm_stop(){return o.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)!==0}sm_tick(t){return o.dotlottieplayerwasm_sm_tick(this.__wbg_ptr,t)!==0}autoplay(){return o.dotlottieplayerwasm_autoplay(this.__wbg_ptr)!==0}duration(){return o.dotlottieplayerwasm_duration(this.__wbg_ptr)}set_loop(t){o.dotlottieplayerwasm_set_loop(this.__wbg_ptr,t)}set_mode(t){o.dotlottieplayerwasm_set_mode(this.__wbg_ptr,t)}sm_start(t,e){let r=ft(e,o.__wbindgen_malloc_command_export),s=c;return o.dotlottieplayerwasm_sm_start(this.__wbg_ptr,t,r,s)!==0}theme_id(){let t=o.dotlottieplayerwasm_theme_id(this.__wbg_ptr),e;return t[0]!==0&&(e=h(t[0],t[1]).slice(),o.__wbindgen_free_command_export(t[0],t[1]*1,1)),e}is_loaded(){return o.dotlottieplayerwasm_is_loaded(this.__wbg_ptr)!==0}is_paused(){return o.dotlottieplayerwasm_is_paused(this.__wbg_ptr)!==0}load_font(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c,i=N(e,o.__wbindgen_malloc_command_export),_=c;return o.dotlottieplayerwasm_load_font(this.__wbg_ptr,r,s,i,_)!==0}set_frame(t){return o.dotlottieplayerwasm_set_frame(this.__wbg_ptr,t)!==0}set_speed(t){o.dotlottieplayerwasm_set_speed(this.__wbg_ptr,t)}set_theme(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_set_theme(this.__wbg_ptr,e,r)!==0}sm_status(){let t,e;try{let r=o.dotlottieplayerwasm_sm_status(this.__wbg_ptr);return t=r[0],e=r[1],h(r[0],r[1])}finally{o.__wbindgen_free_command_export(t,e,1)}}};async function gt(n,t){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,t)}catch(r){if(n.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",r);else throw r}let e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}else{let e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}function wt(){let n={};return n.wbg={},n.wbg.__wbg_buffer_609cc3eee51ed158=function(t){return t.buffer},n.wbg.__wbg_createObjectURL_6e98d2f9c7bd9764=function(){return E(function(t,e){let r=URL.createObjectURL(e),s=p(r,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),i=c;C().setInt32(t+4,i,!0),C().setInt32(t+0,s,!0)},arguments)},n.wbg.__wbg_ended_b873fb75d0c13ca7=function(t){return t.ended},n.wbg.__wbg_error_7534b8e9a36f1ab4=function(t,e){let r,s;try{r=t,s=e,console.error(h(t,e))}finally{o.__wbindgen_free_command_export(r,s,1)}},n.wbg.__wbg_new_405e22f390576ce2=function(){return new Object},n.wbg.__wbg_new_78feb108b6472713=function(){return new Array},n.wbg.__wbg_new_8a6f238a6ece86ea=function(){return new Error},n.wbg.__wbg_new_a12002a7f91c75be=function(t){return new Uint8Array(t)},n.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(t,e,r){return new Uint8Array(t,e>>>0,r>>>0)},n.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(t){return new Float32Array(t>>>0)},n.wbg.__wbg_newwithsrc_20307ca7e8762a81=function(){return E(function(t,e){return new Audio(h(t,e))},arguments)},n.wbg.__wbg_newwithu8arraysequenceandoptions_068570c487f69127=function(){return E(function(t,e){return new Blob(t,e)},arguments)},n.wbg.__wbg_pause_b74c96d69f769518=function(){return E(function(t){t.pause()},arguments)},n.wbg.__wbg_play_f6ec5fc4e84b0d26=function(){return E(function(t){return t.play()},arguments)},n.wbg.__wbg_push_737cfc8c1432c2c6=function(t,e){return t.push(e)},n.wbg.__wbg_revokeObjectURL_27267efebeb457c7=function(){return E(function(t,e){URL.revokeObjectURL(h(t,e))},arguments)},n.wbg.__wbg_set_bb8cecf6a62b9f46=function(){return E(function(t,e,r){return Reflect.set(t,e,r)},arguments)},n.wbg.__wbg_setcurrentTime_64727eddd3966512=function(t,e){t.currentTime=e},n.wbg.__wbg_setindex_4e73afdcd9bb95cd=function(t,e,r){t[e>>>0]=r},n.wbg.__wbg_settype_39ed370d3edd403c=function(t,e,r){t.type=h(e,r)},n.wbg.__wbg_setvolume_3895e06a030ca4f7=function(t,e){t.volume=e},n.wbg.__wbg_stack_0ed75d68575b0f3c=function(t,e){let r=e.stack,s=p(r,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),i=c;C().setInt32(t+4,i,!0),C().setInt32(t+0,s,!0)},n.wbg.__wbindgen_init_externref_table=function(){let t=o.__wbindgen_export_4,e=t.grow(4);t.set(0,void 0),t.set(e+0,void 0),t.set(e+1,null),t.set(e+2,!0),t.set(e+3,!1)},n.wbg.__wbindgen_memory=function(){return o.memory},n.wbg.__wbindgen_number_new=function(t){return t},n.wbg.__wbindgen_string_get=function(t,e){let r=e,s=typeof r=="string"?r:void 0;var i=ut(s)?0:p(s,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),_=c;C().setInt32(t+4,_,!0),C().setInt32(t+0,i,!0)},n.wbg.__wbindgen_string_new=function(t,e){return h(t,e)},n.wbg.__wbindgen_throw=function(t,e){throw new Error(h(t,e))},n}function vt(n,t){return o=n.exports,nt.__wbindgen_wasm_module=t,M=null,x=null,S=null,o.__wbindgen_start(),o}async function nt(n){if(o!==void 0)return o;if(typeof n<"u"&&(Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof n>"u")throw new Error("WASM module URL must be provided via DotLottieWasmLoader or setWasmUrl().");let t=wt();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));let{instance:e,module:r}=await gt(await n,t);return vt(e,r)}var rt=nt;var B=class{constructor(){l(this,"_eventListeners",new Map)}addEventListener(t,e){let r=this._eventListeners.get(t);r||(r=new Set,this._eventListeners.set(t,r)),r.add(e)}removeEventListener(t,e){let r=this._eventListeners.get(t);r&&(e?(r.delete(e),r.size===0&&this._eventListeners.delete(t)):this._eventListeners.delete(t))}dispatch(t){this._eventListeners.get(t.type)?.forEach(r=>r(t))}removeAllEventListeners(){this._eventListeners.clear()}};var f=class f{static _initializeObserver(){if(f._observer)return;let t=e=>{e.forEach(r=>{let s=f._observedCanvases.get(r.target);s&&(r.isIntersecting?s.unfreeze():s.freeze())})};f._observer=new IntersectionObserver(t,{threshold:0})}static observe(t,e){f._initializeObserver(),!f._observedCanvases.has(t)&&(f._observedCanvases.set(t,e),f._observer?.observe(t))}static unobserve(t){f._observer?.unobserve(t),f._observedCanvases.delete(t),f._observedCanvases.size===0&&(f._observer?.disconnect(),f._observer=null)}};l(f,"_observer",null),l(f,"_observedCanvases",new Map);var b=f;var m=class m{static _initializeObserver(){if(m._observer)return;let t=e=>{e.forEach(r=>{let s=m._observedCanvases.get(r.target);if(!s)return;let[i,_]=s;clearTimeout(_);let d=setTimeout(()=>{i.resize()},100);m._observedCanvases.set(r.target,[i,d])})};m._observer=new ResizeObserver(t)}static observe(t,e){m._initializeObserver(),!m._observedCanvases.has(t)&&(m._observedCanvases.set(t,[e,0]),m._observer?.observe(t))}static unobserve(t){let e=m._observedCanvases.get(t);if(e){let r=e[1];r&&clearTimeout(r)}m._observer?.unobserve(t),m._observedCanvases.delete(t),!m._observedCanvases.size&&m._observer&&(m._observer.disconnect(),m._observer=null)}};l(m,"_observer",null),l(m,"_observedCanvases",new Map);var y=m;function bt(n){return/^#([\\da-f]{6}|[\\da-f]{8})$/iu.test(n)}function ot(n){if(!bt(n))return[0,0,0,0];let t=n.replace("#","");t=t.length===6?`${t}ff`:t;let e=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,s=parseInt(t.slice(4,6),16)/255,i=parseInt(t.slice(6,8),16)/255;return[e,r,s,i]}function W(n){if(n.byteLength<4)return!1;let t=new Uint8Array(n.slice(0,A.byteLength));for(let e=0;e<A.length;e+=1)if(A[e]!==t[e])return!1;return!0}function yt(n){return Y.every(t=>Object.hasOwn(n,t))}function G(n){return typeof n=="string"?/^\\s*\\{/u.test(n)&&/\\}\\s*$/u.test(n):yt(n)}function H(){return 1+((g?window.devicePixelRatio:1)-1)*X}function k(n){let t=n.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth;return!(t.bottom<0||t.top>e||t.right<0||t.left>r)}function L(n){let t=n.target;if(t instanceof HTMLCanvasElement){let e=t.getBoundingClientRect();if(e.width===0||e.height===0||t.width===0||t.height===0)return null;let r=t.width/e.width,s=t.height/e.height,i=(n.clientX-e.left)*r,_=(n.clientY-e.top)*s;return!Number.isFinite(i)||!Number.isFinite(_)||Number.isNaN(i)||Number.isNaN(_)?null:{x:i,y:_}}return null}function Et(n){return new Promise((t,e)=>{let r=new FileReader;r.onerror=()=>e(r.error??new Error("Failed to read image slot source")),r.onload=()=>t(r.result),r.readAsDataURL(n)})}async function st(n){if(!/^https?:\\/\\//i.test(n))return n;let t=await fetch(n);if(!t.ok)throw new Error(`Failed to fetch image slot source from URL: ${n}. ${t.status}: ${t.statusText}`);return Et(await t.blob())}function it(n){let t=n.replace("OpenUrl: ",""),e=t.indexOf(" | Target: "),r,s;e===-1?(r=t,s="_blank"):(r=t.substring(0,e),s=t.substring(e+11)),window.open(r,s)}function at(n,t,e){let r=null,s=t;async function i(d){await n({module_or_path:d})}async function _(d){let u=await fetch(d);if(!u.ok)throw new Error(`fetch ${d} responded with ${u.status} ${u.statusText}`);let P=await u.arrayBuffer();await n({module_or_path:P})}return{load(){if(!r){let d=s,u=e;r=(async()=>{let P,K;try{await i(d);return}catch(w){P=w,console.warn(`Primary WASM load failed from ${d}: ${w.message}`),console.warn(`Attempting to load WASM from backup URL: ${u}`)}try{await i(u);return}catch(w){K=w,console.warn(`Backup WASM load failed from ${u}: ${w.message}`)}console.warn("Retrying WASM load with buffered instantiation");try{await _(d);return}catch(w){console.warn(`Buffered WASM load from ${d} failed: ${w.message}`)}try{await _(u);return}catch(w){throw console.error(`Primary WASM URL failed: ${P.message}`),console.error(`Backup WASM URL failed: ${K.message}`),console.error(`Buffered fallback failed: ${w.message}`),r=null,new Error("WASM loading failed from all sources.")}})()}return r},setWasmUrl(d){d!==s&&(s=d,r=null)}}}var ct=null;function $(){return ct??(ct=at(rt,`https://cdn.jsdelivr.net/npm/${U}@${V}/dist/dotlottie-player.wasm`,`https://unpkg.com/${U}@${V}/dist/dotlottie-player.wasm`)),ct}var J=n=>{switch(n){case"reverse":return v.Reverse;case"bounce":return v.Bounce;case"reverse-bounce":return v.ReverseBounce;default:return v.Forward}},_t=n=>{switch(n){case v.Reverse:return"reverse";case v.Bounce:return"bounce";case v.ReverseBounce:return"reverse-bounce";default:return"forward"}},Mt=n=>{switch(n){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"}},I=class{constructor(t){l(this,"_canvas",null);l(this,"_pendingLoad",null);l(this,"_srcFetchAbort",null);l(this,"_context",null);l(this,"_eventManager");l(this,"_animationFrameId",null);l(this,"_frameManager");l(this,"_boundAnimationLoop");l(this,"_dotLottieCore",null);l(this,"_stateMachineId","");l(this,"_stateMachineConfig",null);l(this,"_isStateMachineRunning",!1);l(this,"_renderConfig",{});l(this,"_isFrozen",!1);l(this,"_backgroundColor",null);l(this,"_lastFrameTime",null);l(this,"_boundOnClick",null);l(this,"_boundOnPointerUp",null);l(this,"_boundOnPointerDown",null);l(this,"_boundOnPointerMove",null);l(this,"_boundOnPointerEnter",null);l(this,"_boundOnPointerLeave",null);l(this,"_bufferMismatchCount",0);l(this,"_lastExpectedBufferSize",0);l(this,"_cachedImageData",null);l(this,"_cachedImageDataBuffer",null);l(this,"_cachedImageDataByteOffset",0);l(this,"_marker","");l(this,"_segment",null);this._canvas=t.canvas??null,this._eventManager=new B,this._frameManager=new T,this._boundAnimationLoop=this._animationLoop.bind(this),this._renderConfig={...t.renderConfig,devicePixelRatio:t.renderConfig?.devicePixelRatio||H(),freezeOnOffscreen:t.renderConfig?.freezeOnOffscreen??!0};let e=null;t.src&&!t.data&&(this._srcFetchAbort=new AbortController,e=this._fetchData(t.src,this._srcFetchAbort.signal),e.catch(()=>{})),this._initWasm().then(()=>{this._dotLottieCore=this._createCore(),this._dotLottieCore.set_autoplay(t.autoplay??!1),this._dotLottieCore.set_loop(t.loop??!1),this._dotLottieCore.set_loop_count(t.loopCount??0),this._dotLottieCore.set_mode(J(t.mode??"forward")),this._dotLottieCore.set_speed(t.speed??1),this._dotLottieCore.set_use_frame_interpolation(t.useFrameInterpolation??!0),t.segment&&t.segment.length===2&&(this._segment=[t.segment[0],t.segment[1]],this._dotLottieCore.set_segment(this._segment[0],this._segment[1])),this._marker=t.marker??"",this._marker&&this._dotLottieCore.set_marker(this._marker),this._dotLottieCore.set_layout(t.layout?.fit??"contain",t.layout?.align?.[0]??.5,t.layout?.align?.[1]??.5),this._stateMachineId=t.stateMachineId??"",this._stateMachineConfig=t.stateMachineConfig??null,this._onCoreCreated(),this._eventManager.dispatch({type:"ready"}),t.data?this._canvas?this._loadFromData(t.data):this._pendingLoad={data:t.data}:t.src&&(this._canvas?this._loadFromSrc(t.src,e):this._pendingLoad={src:t.src,dataPromise:e}),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor)}).catch(r=>{this._srcFetchAbort?.abort(),console.error("[dotlottie-web] Initialization failed:",r),this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${r}`)})})}async _initWasm(){return $().load()}_createCore(){return new O}_onCoreCreated(){}_setupTarget(t,e){return this._dotLottieCore?this._dotLottieCore.setup_sw_target(t,e):!1}_drainPlayerEvents({skipFrame:t=!1}={}){if(!this._dotLottieCore)return;let e;for(;(e=this._dotLottieCore.poll_event())!==null&&e!==void 0;){let r=e;switch(r.type){case"Load":setTimeout(()=>this._eventManager.dispatch({type:"load"}),0);break;case"LoadError":setTimeout(()=>this._eventManager.dispatch({type:"loadError",error:new 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":t||queueMicrotask(()=>this._eventManager.dispatch({type:"frame",currentFrame:r.frameNo??0}));break;case"Render":t||queueMicrotask(()=>this._eventManager.dispatch({type:"render",currentFrame:r.frameNo??0}));break;case"Loop":queueMicrotask(()=>this._eventManager.dispatch({type:"loop",loopCount:r.loopCount??0}));break;case"Complete":queueMicrotask(()=>this._eventManager.dispatch({type:"complete"}));break;default:break}}}_discardPlayerEvents(){for(;this._dotLottieCore?.poll_event()!=null;);}_drainSmEvents(){if(!this._dotLottieCore)return;let t;for(;(t=this._dotLottieCore.sm_poll_event())!==null&&t!==void 0;){let r=t;switch(r.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?.is_playing()||this._stopAnimationLoop()});break;case"CustomEvent":this._eventManager.dispatch({type:"stateMachineCustomEvent",eventName:r.message??""});break;case"BooleanInputChange":this._eventManager.dispatch({type:"stateMachineBooleanInputValueChange",inputName:r.name??"",newValue:r.newValue,oldValue:r.oldValue});break;case"NumericInputChange":this._eventManager.dispatch({type:"stateMachineNumericInputValueChange",inputName:r.name??"",newValue:r.newValue,oldValue:r.oldValue});break;case"StringInputChange":this._eventManager.dispatch({type:"stateMachineStringInputValueChange",inputName:r.name??"",newValue:r.newValue,oldValue:r.oldValue});break;case"InputFired":this._eventManager.dispatch({type:"stateMachineInputFired",inputName:r.name??""});break;case"Transition":this._eventManager.dispatch({type:"stateMachineTransition",fromState:r.previousState??"",toState:r.newState??""});break;case"StateEntered":this._eventManager.dispatch({type:"stateMachineStateEntered",state:r.state??""});break;case"StateExit":this._eventManager.dispatch({type:"stateMachineStateExit",state:r.state??""});break;case"Error":this._eventManager.dispatch({type:"stateMachineError",error:r.message??""});break;default:break}}let e;for(;(e=this._dotLottieCore.sm_poll_internal_event())!==null&&e!==void 0;){let r=e;if(r.type==="Message"){let s=r.message??"";g&&s.startsWith("OpenUrl: ")?it(s):this._eventManager.dispatch({type:"stateMachineInternalMessage",message:s})}}}_dispatchError(t){console.error(t),this._eventManager.dispatch({type:"loadError",error:new Error(t)})}async _fetchData(t,e=null){let r=await fetch(t,{signal:e});if(!r.ok)throw new Error(`Failed to fetch animation data from URL: ${t}. ${r.status}: ${r.statusText}`);let s=await r.arrayBuffer();return W(s)?s:new TextDecoder().decode(s)}_loadFromData(t){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 e=!1;if(typeof t=="string"){if(e=this._dotLottieCore.load_animation(t),!e&&!G(t)){this._discardPlayerEvents(),this._dispatchError("Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.");return}}else if(t instanceof ArrayBuffer){if(!W(t)){this._dispatchError("Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.");return}e=this._dotLottieCore.load_dotlottie_data(new Uint8Array(t))}else if(typeof t=="object"){if(!G(t)){this._dispatchError("Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.");return}e=this._dotLottieCore.load_animation(JSON.stringify(t))}else{this._dispatchError(`Unsupported data type for animation data. Expected:\n - string (Lottie JSON),\n - ArrayBuffer (dotLottie),\n - object (Lottie JSON).\n Received: ${typeof t}`);return}if(e){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 r=_t(this._dotLottieCore.mode()),s=r==="reverse"||r==="reverse-bounce"?this._segment[1]:this._segment[0];this._dotLottieCore.set_frame(s)}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.is_playing()&&this._startAnimationLoop(),g&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.freezeOnOffscreen&&(b.observe(this._canvas,this),k(this._canvas)||this.freeze()),this._renderConfig.autoResize&&y.observe(this._canvas,this))}else this._drainPlayerEvents()}_loadFromSrc(t,e){(e??this._fetchData(t)).then(r=>this._loadFromData(r)).catch(r=>this._dispatchError(`Failed to load animation data from URL: ${t}. ${r}`))}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:Mt(this._dotLottieCore.layout_fit())}}get marker(){return this._dotLottieCore?.current_marker()??""}get manifest(){try{let t=this._dotLottieCore?.manifest_string();if(this._dotLottieCore===null||!t)return null;let e=JSON.parse(t);return Object.keys(e).length===0?null:e}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?_t(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?.is_loaded()??!1}get isPlaying(){return this._dotLottieCore?.is_playing()??!1}get isPaused(){return this._dotLottieCore?.is_paused()??!1}get isStopped(){return this._dotLottieCore?.is_stopped()??!1}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(t){this._dotLottieCore!==null&&(this._stopAnimationLoop(),this._cleanupCanvas(),this._isFrozen=!1,this._dotLottieCore.set_autoplay(t.autoplay??!1),this._dotLottieCore.set_loop(t.loop??!1),this._dotLottieCore.set_loop_count(t.loopCount??0),this._dotLottieCore.set_mode(J(t.mode??"forward")),this._dotLottieCore.set_speed(t.speed??1),this._dotLottieCore.set_use_frame_interpolation(t.useFrameInterpolation??!0),t.segment&&t.segment.length===2?(this._segment=[t.segment[0],t.segment[1]],this._dotLottieCore.set_segment(this._segment[0],this._segment[1])):(this._segment=null,this._dotLottieCore.clear_segment()),this._marker=t.marker??"",this._marker?this._dotLottieCore.set_marker(this._marker):this._dotLottieCore.clear_marker(),this._dotLottieCore.set_layout(t.layout?.fit??"contain",t.layout?.align?.[0]??.5,t.layout?.align?.[1]??.5),t.data?this._canvas?this._loadFromData(t.data):this._pendingLoad={data:t.data}:t.src&&(this._canvas?this._loadFromSrc(t.src):this._pendingLoad={src:t.src}),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor))}_draw(){if(this._dotLottieCore===null||this._canvas===null||(!this._context&&"getContext"in this._canvas&&typeof this._canvas.getContext=="function"&&(!g||typeof HTMLCanvasElement<"u"&&this._canvas instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&this._canvas instanceof OffscreenCanvas)&&(this._context=this._canvas.getContext("2d")),!this._context))return;let t=this._dotLottieCore.get_pixel_buffer(),e=this._canvas.width,r=this._canvas.height,s=e*r*Z;if(t.byteLength!==s){this._lastExpectedBufferSize===s?this._bufferMismatchCount+=1:(this._bufferMismatchCount=1,this._lastExpectedBufferSize=s),this._bufferMismatchCount===10&&console.warn(`[dotlottie-web] Persistent buffer size mismatch detected. Expected ${s} bytes for canvas ${e}x${r}, but got ${t.byteLength} bytes. This may indicate a WASM memory allocation issue or invalid canvas dimensions.`);return}this._bufferMismatchCount=0,this._lastExpectedBufferSize=s;let i=this._cachedImageData;if(!(i!==null&&i.width===e&&i.height===r&&i.data.byteLength===s&&this._cachedImageDataBuffer===t.buffer&&this._cachedImageDataByteOffset===t.byteOffset)){if(typeof ImageData>"u")this._cachedImageData=this._context.createImageData(e,r);else{let d=new Uint8ClampedArray(t.buffer,t.byteOffset,t.byteLength);this._cachedImageData=new ImageData(d,e,r)}this._cachedImageDataBuffer=t.buffer,this._cachedImageDataByteOffset=t.byteOffset}if(typeof ImageData>"u"){let d=new Uint8ClampedArray(t.buffer,t.byteOffset,t.byteLength);this._cachedImageData.data.set(d)}this._context.putImageData(this._cachedImageData,0,0)}_cleanupCanvas(){this._canvas&&g&&this._canvas instanceof HTMLCanvasElement&&(b.unobserve(this._canvas),y.unobserve(this._canvas),this._cleanupStateMachineListeners())}_initializeCanvas(){this._setupRendererOnCanvas(),this._canvas&&g&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded&&(this._renderConfig.freezeOnOffscreen&&(b.observe(this._canvas,this),k(this._canvas)||this.freeze()),this._renderConfig.autoResize&&y.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.is_playing()||this._isStateMachineRunning)&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._boundAnimationLoop))}_animationLoop(t){if(this._dotLottieCore===null){this._stopAnimationLoop();return}if(!this._dotLottieCore.is_playing()&&!this._isStateMachineRunning){this._stopAnimationLoop();return}try{let e=this._lastFrameTime!==null?t-this._lastFrameTime:0;this._lastFrameTime=t;let r=this._isStateMachineRunning?this._dotLottieCore.sm_tick(e):this._dotLottieCore.tick(e);this._isStateMachineRunning?this._drainSmEvents():this._drainPlayerEvents(),r&&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 t=this._dotLottieCore.play();this._drainPlayerEvents(),(t||this._dotLottieCore.is_playing())&&(this._isFrozen=!1,this._startAnimationLoop()),this._canvas&&g&&this._canvas instanceof HTMLCanvasElement&&this._renderConfig.freezeOnOffscreen&&!k(this._canvas)&&this.freeze()}pause(){this._dotLottieCore!==null&&(this._dotLottieCore.pause(),this._drainPlayerEvents(),this._stopAnimationLoop())}stop(){if(this._dotLottieCore===null)return;let t=this._dotLottieCore.stop();this._drainPlayerEvents(),this._stopAnimationLoop(),t&&(this._eventManager.dispatch({type:"frame",currentFrame:this.currentFrame}),this._dotLottieCore.render(),this._draw())}setFrame(t){if(this._dotLottieCore===null)return;if(this._dotLottieCore.set_frame(t)){let r=this._dotLottieCore.render();this._drainPlayerEvents(),r&&this._draw()}}setSpeed(t){this._dotLottieCore!==null&&this._dotLottieCore.set_speed(t)}setBackgroundColor(t){if(this._dotLottieCore!==null){if(g&&this._canvas instanceof HTMLCanvasElement)this._canvas.style.backgroundColor=t;else{let[e,r,s,i]=ot(t);this._dotLottieCore.set_background(e,r,s,i)}this._backgroundColor=t}}setLoop(t){this._dotLottieCore!==null&&this._dotLottieCore.set_loop(t)}setLoopCount(t){this._dotLottieCore!==null&&this._dotLottieCore.set_loop_count(t)}setUseFrameInterpolation(t){this._dotLottieCore!==null&&this._dotLottieCore.set_use_frame_interpolation(t)}addEventListener(t,e){this._eventManager.addEventListener(t,e)}removeEventListener(t,e){this._eventManager.removeEventListener(t,e)}destroy(){this._stopAnimationLoop(),this._isStateMachineRunning=!1,this._cleanupCanvas(),this._srcFetchAbort?.abort(),this._srcFetchAbort=null,this._pendingLoad=null;let t=this._dotLottieCore;if(this._dotLottieCore=null,this._context=null,t)try{t.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(!(g&&this._canvas instanceof HTMLCanvasElement))return;let t=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:e,width:r}=this._canvas.getBoundingClientRect();e!==0&&r!==0&&(this._canvas.width=r*t,this._canvas.height=e*t)}resize(){if(!this._dotLottieCore||!this.isLoaded||!this._canvas)return;this._syncCanvasSize(),this._setupTarget(this._canvas.width,this._canvas.height)&&(this._dotLottieCore.render(),this._draw())}setCanvas(t){if(!(!t||this._canvas===t)&&(this._canvas&&this._cleanupCanvas(),this._canvas=t,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(t){if(!this._dotLottieCore)return!1;let e=this._dotLottieCore.set_transform(new Float32Array(t));return e&&this._dotLottieCore.render()&&this._draw(),e}getTransform(){if(!this._dotLottieCore)return;let t=this._dotLottieCore.get_transform();return Array.from(t)}setSegment(t,e){this._dotLottieCore!==null&&(this._segment=[t,e],this._dotLottieCore.set_segment(t,e))}resetSegment(){this._dotLottieCore!==null&&(this._segment=null,this._dotLottieCore.clear_segment())}setMode(t){this._dotLottieCore!==null&&this._dotLottieCore.set_mode(J(t))}setRenderConfig(t){let{devicePixelRatio:e,freezeOnOffscreen:r,quality:s,...i}=t;this._renderConfig={...this._renderConfig,...i,devicePixelRatio:e||H(),freezeOnOffscreen:r??!0,...s!==void 0&&{quality:s}},s!==void 0&&this._dotLottieCore&&this._dotLottieCore.set_quality(s),g&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.autoResize?y.observe(this._canvas,this):y.unobserve(this._canvas),this._renderConfig.freezeOnOffscreen?(b.observe(this._canvas,this),k(this._canvas)||this.freeze()):(b.unobserve(this._canvas),this._isFrozen&&this.unfreeze()))}loadAnimation(t){if(this._dotLottieCore===null||this._dotLottieCore.animation_id()===t||!this._canvas)return;this._syncCanvasSize(),this._setupTarget(this._canvas.width,this._canvas.height),this._dotLottieCore.load_animation_from_id(t)?(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: ${t}`)}setMarker(t){if(this._dotLottieCore===null)return;this.markers().some(s=>s.name===t)?(this._marker=t,this._dotLottieCore.set_marker(t)):(this._marker="",this._segment=null,this._dotLottieCore.clear_marker(),this._dotLottieCore.clear_segment())}markers(){let t=this._dotLottieCore?.markers();return t&&Array.isArray(t)?t:[]}setTheme(t){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.set_theme(t);return e&&(this._dotLottieCore.render(),this._draw()),e}resetTheme(){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.reset_theme();return t&&(this._dotLottieCore.render(),this._draw()),t}setThemeData(t){if(this._dotLottieCore===null)return!1;let e=typeof t=="string"?t:JSON.stringify(t),r=this._dotLottieCore.set_theme_data(e);return r&&(this._dotLottieCore.render(),this._draw()),r}setSlots(t){this._dotLottieCore!==null&&this._dotLottieCore.set_slots_str(JSON.stringify(t))&&(this._dotLottieCore.render(),this._draw())}_isKeyframeArray(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="object"&&t[0]!==null&&"t"in t[0]&&"s"in t[0]}getSlotIds(){if(!this._dotLottieCore)return[];let t=this._dotLottieCore.get_slot_ids();return Array.isArray(t)?t:[]}getSlotType(t){if(!this._dotLottieCore)return;let e=this._dotLottieCore.get_slot_type(t);if(e)return e}getSlot(t){if(!this._dotLottieCore)return;let e=this._dotLottieCore.get_slot_str(t);if(e)try{return JSON.parse(e)}catch{return}}getSlots(){if(!this._dotLottieCore)return{};try{return JSON.parse(this._dotLottieCore.get_slots_str())}catch{return{}}}setColorSlot(t,e){if(this._dotLottieCore===null)return!1;let r=this._isKeyframeArray(e),s=JSON.stringify({a:r?1:0,k:e}),i=this._dotLottieCore.set_slot_str(t,s);return this._dotLottieCore.render(),this._draw(),i}setScalarSlot(t,e){if(this._dotLottieCore===null)return!1;let s=JSON.stringify({a:typeof e!="number"?1:0,k:e}),i=this._dotLottieCore.set_slot_str(t,s);return this._dotLottieCore.render(),this._draw(),i}setVectorSlot(t,e){if(this._dotLottieCore===null)return!1;let r=this._isKeyframeArray(e),s=JSON.stringify({a:r?1:0,k:e}),i=this._dotLottieCore.set_slot_str(t,s);return this._dotLottieCore.render(),this._draw(),i}setGradientSlot(t,e,r){if(this._dotLottieCore===null)return!1;let s=this._isKeyframeArray(e),i=JSON.stringify({k:{a:s?1:0,k:e},p:r}),_=this._dotLottieCore.set_slot_str(t,i);return this._dotLottieCore.render(),this._draw(),_}setTextSlot(t,e){if(this._dotLottieCore===null)return!1;let r=this._dotLottieCore.get_slot_str(t),s=e;if(r){let d=JSON.parse(r);if(d&&"k"in d&&Array.isArray(d.k)){let u=d.k[0];"s"in u&&typeof u.s=="object"&&(s={...u.s,...e})}}let i=JSON.stringify({a:0,k:[{t:0,s}]}),_=this._dotLottieCore.set_slot_str(t,i);return this._dotLottieCore.render(),this._draw(),_}async setImageSlot(t,e){if(this._dotLottieCore===null)return!1;let r=await st(e);if(this._dotLottieCore===null)return!1;let s=this._dotLottieCore.set_image_slot(t,r);return this._dotLottieCore.render(),this._draw(),s}resetSlot(t){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.reset_slot(t);return this._dotLottieCore.render(),this._draw(),e}clearSlot(t){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.clear_slot(t);return this._dotLottieCore.render(),this._draw(),e}resetSlots(){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.reset_slots();return this._dotLottieCore.render(),this._draw(),t}clearSlots(){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.clear_slots();return this._dotLottieCore.render(),this._draw(),t}setLayout(t){this._dotLottieCore!==null&&this._dotLottieCore.set_layout(t.fit??"contain",t.align?.[0]??.5,t.align?.[1]??.5)}setViewport(t,e,r,s){return this._dotLottieCore===null?!1:this._dotLottieCore.set_viewport(t,e,r,s)}static setWasmUrl(t){$().setWasmUrl(t)}static preload(){return $().load()}static async registerFont(t,e){try{await $().load();let r;if(typeof e=="string"){let i=await fetch(e);if(!i.ok)return console.error(`Failed to fetch font from URL: ${e}. Status: ${i.status}`),!1;r=new Uint8Array(await i.arrayBuffer())}else e instanceof Uint8Array?r=e:r=new Uint8Array(e);let s=et(t,r);return s||console.error(`Failed to register font "${t}". Font data may be invalid.`),s}catch(r){return console.error(`Error registering font "${t}":`,r),!1}}animationSize(){let t=this._dotLottieCore?.animation_size();return{width:t?.[0]??0,height:t?.[1]??0}}stateMachineLoad(t){return this._dotLottieCore?this._dotLottieCore.state_machine_load_from_id(t):!1}stateMachineLoadData(t){return this._dotLottieCore?this._dotLottieCore.state_machine_load(t):!1}stateMachineSetConfig(t){this._stateMachineConfig=t}stateMachineStart(){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.sm_start(this._stateMachineConfig?.openUrlPolicy?.requireUserInteraction??!0,this._stateMachineConfig?.openUrlPolicy?.whitelist??[]);return this._drainSmEvents(),t&&(this._isStateMachineRunning=!0,this._setupStateMachineListeners(),this._startAnimationLoop()),t}stateMachineStop(){if(!this._dotLottieCore)return!1;let t=this._dotLottieCore.sm_stop();return this._drainSmEvents(),t&&(this._isStateMachineRunning=!1,this._cleanupStateMachineListeners(),this._dotLottieCore.is_playing()||this._stopAnimationLoop()),t}stateMachineGetStatus(){return this._dotLottieCore?.sm_status()??""}stateMachineGetCurrentState(){return this._dotLottieCore?.sm_current_state()??""}stateMachineGetActiveId(){return this._dotLottieCore?.state_machine_id()??""}stateMachineOverrideState(t,e=!1){return this._dotLottieCore?.sm_override_current_state(t,e)??!1}stateMachineSetSeed(t){return this._dotLottieCore?.sm_set_seed(BigInt(Math.trunc(t)))??!1}stateMachineGet(t){return this._dotLottieCore?.get_state_machine(t)??""}stateMachineGetListeners(){if(!this._dotLottieCore)return[];let t=this._dotLottieCore.sm_framework_setup();return Array.isArray(t)?t:[]}stateMachineSetBooleanInput(t,e){return this._dotLottieCore?.sm_set_boolean_input(t,e)??!1}stateMachineSetNumericInput(t,e){return this._dotLottieCore?.sm_set_numeric_input(t,e)??!1}stateMachineSetStringInput(t,e){return this._dotLottieCore?.sm_set_string_input(t,e)??!1}stateMachineGetBooleanInput(t){return this._dotLottieCore?.sm_get_boolean_input(t)??void 0}stateMachineGetNumericInput(t){return this._dotLottieCore?.sm_get_numeric_input(t)??void 0}stateMachineGetStringInput(t){return this._dotLottieCore?.sm_get_string_input(t)??void 0}stateMachineGetInputs(){if(!this._dotLottieCore)return[];let t=this._dotLottieCore.sm_get_inputs();return Array.isArray(t)?t:[]}stateMachineFireEvent(t){this._dotLottieCore?.sm_fire(t)}stateMachinePostClickEvent(t,e){this._dotLottieCore?.sm_post_click(t,e)}stateMachinePostPointerUpEvent(t,e){this._dotLottieCore?.sm_post_pointer_up(t,e)}stateMachinePostPointerDownEvent(t,e){this._dotLottieCore?.sm_post_pointer_down(t,e)}stateMachinePostPointerMoveEvent(t,e){this._dotLottieCore?.sm_post_pointer_move(t,e)}stateMachinePostPointerEnterEvent(t,e){this._dotLottieCore?.sm_post_pointer_enter(t,e)}stateMachinePostPointerExitEvent(t,e){this._dotLottieCore?.sm_post_pointer_exit(t,e)}_onClick(t){let e=L(t);e&&this.stateMachinePostClickEvent(e.x,e.y)}_onPointerUp(t){let e=L(t);e&&this.stateMachinePostPointerUpEvent(e.x,e.y)}_onPointerDown(t){let e=L(t);e&&this.stateMachinePostPointerDownEvent(e.x,e.y)}_onPointerMove(t){let e=L(t);e&&this.stateMachinePostPointerMoveEvent(e.x,e.y)}_onPointerEnter(t){let e=L(t);e&&this.stateMachinePostPointerEnterEvent(e.x,e.y)}_onPointerLeave(t){let e=L(t);e&&this.stateMachinePostPointerExitEvent(e.x,e.y)}_setupStateMachineListeners(){if(g&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieCore!==null&&this.isLoaded){let t=this.stateMachineGetListeners();this._cleanupStateMachineListeners(),t.includes("Click")&&(this._boundOnClick=this._onClick.bind(this),this._canvas.addEventListener("click",this._boundOnClick)),t.includes("PointerUp")&&(this._boundOnPointerUp=this._onPointerUp.bind(this),this._canvas.addEventListener("pointerup",this._boundOnPointerUp)),t.includes("PointerDown")&&(this._boundOnPointerDown=this._onPointerDown.bind(this),this._canvas.addEventListener("pointerdown",this._boundOnPointerDown)),t.includes("PointerMove")&&(this._boundOnPointerMove=this._onPointerMove.bind(this),this._canvas.addEventListener("pointermove",this._boundOnPointerMove)),t.includes("PointerEnter")&&(this._boundOnPointerEnter=this._onPointerEnter.bind(this),this._canvas.addEventListener("pointerenter",this._boundOnPointerEnter)),t.includes("PointerExit")&&(this._boundOnPointerLeave=this._onPointerLeave.bind(this),this._canvas.addEventListener("pointerleave",this._boundOnPointerLeave))}}_cleanupStateMachineListeners(){g&&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))}};var a=new Map,Ct={ready:n=>t=>{let e={id:"",method:"onReady",result:{instanceId:n,event:t}};self.postMessage(e)},complete:n=>t=>{let e={id:"",method:"onComplete",result:{instanceId:n,event:t}};self.postMessage(e)},load:n=>t=>{let r={id:"",method:"onLoad",result:{instanceId:n,event:t}};self.postMessage(r)},loadError:n=>t=>{let r={id:"",method:"onLoadError",result:{instanceId:n,event:t}};self.postMessage(r)},renderError:n=>t=>{let r={id:"",method:"onRenderError",result:{instanceId:n,event:t}};self.postMessage(r)},loop:n=>t=>{let r={id:"",method:"onLoop",result:{instanceId:n,event:t}};self.postMessage(r)},play:n=>t=>{let r={id:"",method:"onPlay",result:{instanceId:n,event:t}};self.postMessage(r)},pause:n=>t=>{let r={id:"",method:"onPause",result:{instanceId:n,event:t}};self.postMessage(r)},stop:n=>t=>{let r={id:"",method:"onStop",result:{instanceId:n,event:t}};self.postMessage(r)},frame:n=>t=>{let r={id:"",method:"onFrame",result:{instanceId:n,event:t}};self.postMessage(r)},render:n=>t=>{let r={id:"",method:"onRender",result:{instanceId:n,event:t}};self.postMessage(r)},freeze:n=>t=>{let r={id:"",method:"onFreeze",result:{instanceId:n,event:t}};self.postMessage(r)},unfreeze:n=>t=>{let r={id:"",method:"onUnfreeze",result:{instanceId:n,event:t}};self.postMessage(r)},destroy:n=>t=>{let r={id:"",method:"onDestroy",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStart:n=>t=>{let r={id:"",method:"onStateMachineStart",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStop:n=>t=>{let r={id:"",method:"onStateMachineStop",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineTransition:n=>t=>{let r={id:"",method:"onStateMachineTransition",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStateEntered:n=>t=>{let r={id:"",method:"onStateMachineStateEntered",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStateExit:n=>t=>{let r={id:"",method:"onStateMachineStateExit",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineCustomEvent:n=>t=>{let r={id:"",method:"onStateMachineCustomEvent",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineError:n=>t=>{let r={id:"",method:"onStateMachineError",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineBooleanInputValueChange:n=>t=>{let r={id:"",method:"onStateMachineBooleanInputValueChange",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineNumericInputValueChange:n=>t=>{let r={id:"",method:"onStateMachineNumericInputValueChange",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStringInputValueChange:n=>t=>{let r={id:"",method:"onStateMachineStringInputValueChange",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineInputFired:n=>t=>{let r={id:"",method:"onStateMachineInputFired",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineInternalMessage:n=>t=>{let r={id:"",method:"onStateMachineInternalMessage",result:{instanceId:n,event:t}};self.postMessage(r)}},j={setTransform(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setTransform(n.params.transform)},getTransform(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getTransform()},getDotLottieInstanceState(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return{state:{loopCount:e.loopCount,isLoaded:e.isLoaded,isPaused:e.isPaused,isPlaying:e.isPlaying,isStopped:e.isStopped,isFrozen:e.isFrozen,loop:e.loop,mode:e.mode,speed:e.speed,currentFrame:e.currentFrame,totalFrames:e.totalFrames,duration:e.duration,useFrameInterpolation:e.useFrameInterpolation,renderConfig:e.renderConfig,marker:e.marker,backgroundColor:e.backgroundColor,markers:e.markers(),activeAnimationId:e.activeAnimationId,activeThemeId:e.activeThemeId,autoplay:e.autoplay,segment:e.segment,layout:e.layout,isReady:e.isReady,manifest:e.manifest}}},setLayout(n){let t=n.params.instanceId,e=n.params.layout,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setLayout(e)},stateMachineGetListeners(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetListeners()},stateMachineStart(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineStart()},stateMachineStop(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineStop()},stateMachineLoad(n){let t=n.params.instanceId,e=n.params.stateMachineId,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineLoad(e)},stateMachineLoadData(n){let t=n.params.instanceId,e=n.params.stateMachineData,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineLoadData(e)},stateMachinePostClickEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachinePostClickEvent(e,r)},stateMachinePostPointerUpEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachinePostPointerUpEvent(e,r)},stateMachinePostPointerDownEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachinePostPointerDownEvent(e,r)},stateMachinePostPointerMoveEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachinePostPointerMoveEvent(e,r)},stateMachinePostPointerEnterEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachinePostPointerEnterEvent(e,r)},stateMachinePostPointerExitEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachinePostPointerExitEvent(e,r)},stateMachineSetNumericInput:n=>{let t=n.params.instanceId,e=n.params.name,r=n.params.value,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachineSetNumericInput(e,r)},stateMachineSetBooleanInput:n=>{let t=n.params.instanceId,e=n.params.name,r=n.params.value,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachineSetBooleanInput(e,r)},stateMachineSetConfig:n=>{let t=n.params.instanceId,e=n.params.config,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.stateMachineSetConfig(e)},stateMachineSetStringInput:n=>{let t=n.params.instanceId,e=n.params.name,r=n.params.value,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachineSetStringInput(e,r)},stateMachineGetNumericInput:n=>{let t=n.params.instanceId,e=n.params.name,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineGetNumericInput(e)},stateMachineGetBooleanInput:n=>{let t=n.params.instanceId,e=n.params.name,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineGetBooleanInput(e)},stateMachineGetStringInput:n=>{let t=n.params.instanceId,e=n.params.name,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineGetStringInput(e)},stateMachineGetInputs:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetInputs()},stateMachineFireEvent:n=>{let t=n.params.instanceId,e=n.params.name,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineFireEvent(e)},stateMachineGetStatus:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetStatus()},stateMachineGetCurrentState:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetCurrentState()},stateMachineGetActiveId:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetActiveId()},stateMachineOverrideState:n=>{let t=n.params.instanceId,e=n.params.state,r=n.params.immediate,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachineOverrideState(e,r)},stateMachineSetSeed:n=>{let t=n.params.instanceId,e=n.params.seed,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineSetSeed(e)},stateMachineGet:n=>{let t=n.params.instanceId,e=n.params.stateMachineId,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineGet(e)},create:n=>{let t=n.params.instanceId,e=n.params.config,r=n.params.width,s=n.params.height;if(a.has(t))throw new Error(`Instance with id ${t} already exists.`);let i=new I(e);return i.canvas&&(i.canvas.height=s,i.canvas.width=r),a.set(t,i),["complete","frame","load","loadError","renderError","loop","pause","play","stop","destroy","freeze","unfreeze","render","ready","stateMachineStart","stateMachineStop","stateMachineTransition","stateMachineStateEntered","stateMachineStateExit","stateMachineCustomEvent","stateMachineError","stateMachineBooleanInputValueChange","stateMachineNumericInputValueChange","stateMachineStringInputValueChange","stateMachineInputFired","stateMachineInternalMessage"].forEach(d=>{i.addEventListener(d,Ct[d](t))}),{instanceId:t}},destroy:n=>{let t=n.params.instanceId,e=a.get(t);e&&(e.destroy(),a.delete(t))},freeze:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.freeze()},load:n=>{let t=n.params.instanceId,e=n.params.config,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.load(e)},loadAnimation:n=>{let t=n.params.instanceId,e=n.params.animationId,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.loadAnimation(e)},setTheme:n=>{let t=n.params.instanceId,e=n.params.themeId,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.setTheme(e)},setThemeData:n=>{let t=n.params.instanceId,e=n.params.themeData,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.setThemeData(e)},pause:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.pause()},play:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.play()},registerFont:async n=>{let{fontName:t,fontSource:e}=n.params;return I.registerFont(t,e)},resize:n=>{let t=n.params.instanceId,e=n.params.width,r=n.params.height,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);s.canvas&&(s.canvas.height=r,s.canvas.width=e),s.resize()},setBackgroundColor:n=>{let t=n.params.instanceId,e=n.params.backgroundColor,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setBackgroundColor(e)},setSlots:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.setSlots(n.params.slots)},getSlotIds:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getSlotIds()},getSlotType:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getSlotType(n.params.slotId)},getSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getSlot(n.params.slotId)},getSlots:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getSlots()},setColorSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setColorSlot(n.params.slotId,n.params.value)},setScalarSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setScalarSlot(n.params.slotId,n.params.value)},setVectorSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setVectorSlot(n.params.slotId,n.params.value)},setGradientSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setGradientSlot(n.params.slotId,n.params.value,n.params.colorStopCount)},setTextSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setTextSlot(n.params.slotId,n.params.value)},setImageSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setImageSlot(n.params.slotId,n.params.src)},resetSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.resetSlot(n.params.slotId)},clearSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.clearSlot(n.params.slotId)},resetSlots:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.resetSlots()},clearSlots:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.clearSlots()},setFrame:n=>{let t=n.params.instanceId,e=n.params.frame,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setFrame(e)},setMode:n=>{let t=n.params.instanceId,e=n.params.mode,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setMode(e)},setRenderConfig:n=>{let t=n.params.instanceId,e=n.params.renderConfig,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setRenderConfig(e)},setSegment:n=>{let t=n.params.instanceId,e=n.params.segment,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setSegment(e[0],e[1])},resetSegment:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.resetSegment()},setSpeed:n=>{let t=n.params.instanceId,e=n.params.speed,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setSpeed(e)},setUseFrameInterpolation:n=>{let t=n.params.instanceId,e=n.params.useFrameInterpolation,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setUseFrameInterpolation(e)},setWasmUrl:n=>{I.setWasmUrl(n.params.url)},stop:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.stop()},unfreeze:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.unfreeze()},setViewport(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=n.params.width,i=n.params.height,_=a.get(t);if(!_)throw new Error(`Instance with id ${t} does not exist.`);return _.setViewport(e,r,s,i)},animationSize(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);let{height:r,width:s}=e.animationSize();return{height:r,width:s}},setMarker(n){let t=n.params.instanceId,e=n.params.marker,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setMarker(e)},setLoop(n){let t=n.params.instanceId,e=n.params.loop,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setLoop(e)},setLoopCount(n){let t=n.params.instanceId,e=n.params.loopCount,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setLoopCount(e)}};function Lt(n){let t=n.method;if(Object.hasOwn(j,t)&&typeof j[t]=="function")return j[t](n);throw new Error(`Method ${String(t)} is not implemented in commands.`)}self.onmessage=async n=>{try{let t=await Lt(n.data),e={id:n.data.id,method:n.data.method,result:t};self.postMessage(e)}catch(t){let e={id:n.data.id,method:n.data.method,error:t.message};self.postMessage(e)}};var It="",Qt=It;})();\n'],{type:`application/javascript`}),t=URL.createObjectURL(e),n=new Worker(t);return URL.revokeObjectURL(t),n}},de=class{constructor(){r(this,`_workers`,new Map),r(this,`_animationWorkerMap`,new Map),r(this,`_eventHandlers`,new Map),r(this,`_rpcHandlers`,new Map),r(this,`_routeMessage`,e=>{let t=e.data;if(t.id){let n=this._rpcHandlers.get(t.id);n&&n(e);return}let n=t.result?.instanceId;if(n){let t=this._eventHandlers.get(n);t&&t(e)}})}getWorker(e){let t=this._workers.get(e);return t||(t=new ue,t.addEventListener(`message`,this._routeMessage),this._workers.set(e,t)),t}assignAnimationToWorker(e,t){this._animationWorkerMap.set(e,t)}unassignAnimationFromWorker(e){this._animationWorkerMap.delete(e)}sendMessage(e,t,n){this.getWorker(e).postMessage(t,n||[])}broadcastMessage(e,t){this._workers.forEach(n=>{n.postMessage(e,t||[])})}terminateWorker(e){let t=this._workers.get(e);t&&(t.removeEventListener(`message`,this._routeMessage),t.terminate(),this._workers.delete(e))}registerEventHandler(e,t){this._eventHandlers.set(e,t)}unregisterEventHandler(e){this._eventHandlers.delete(e)}registerRpcReplyHandler(e,t){this._rpcHandlers.set(e,t)}unregisterRpcReplyHandler(e){this._rpcHandlers.delete(e)}};function J(e,t){if(typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement){let{height:n,width:r}=e.getBoundingClientRect();if(n!==0&&r!==0)return{width:r*t,height:n*t}}return{width:e.width,height:e.height}}function Y(){return Date.now().toString(36)+Math.random().toString(36).substr(2,9)}let X=null;function Z(){return X??(X=new de),X}let Q=``;const $=new Map;var fe=class{constructor(e){if(r(this,`_eventManager`,new A),r(this,`_id`,void 0),r(this,`_workerId`,void 0),r(this,`_worker`,void 0),r(this,`_canvas`,void 0),r(this,`_dotLottieInstanceState`,{loopCount:0,markers:[],autoplay:!1,backgroundColor:``,currentFrame:0,duration:0,loop:!1,mode:`forward`,segment:[0,0],speed:1,totalFrames:0,isLoaded:!1,isPlaying:!1,isPaused:!1,isStopped:!0,isFrozen:!1,useFrameInterpolation:!1,renderConfig:{devicePixelRatio:R()},activeAnimationId:``,activeThemeId:``,layout:void 0,marker:``,isReady:!1,manifest:null}),r(this,`_created`,!1),r(this,`_retired`,!1),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,`_pendingConfig`,null),e.canvas){let t=typeof HTMLCanvasElement<`u`&&e.canvas instanceof HTMLCanvasElement,n=typeof OffscreenCanvas<`u`&&e.canvas instanceof OffscreenCanvas;if(!t&&!n)throw Error(`Worker-based DotLottie requires HTMLCanvasElement or OffscreenCanvas`)}this._canvas=e.canvas??null,this._id=`dotlottie-${Y()}`,this._workerId=e.workerId||`defaultWorker`,this._worker=Z().getWorker(this._workerId),Z().assignAnimationToWorker(this._id,this._workerId),Q&&this._sendMessage(`setWasmUrl`,{url:Q});let t={...e,renderConfig:{...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||R(),freezeOnOffscreen:e.renderConfig?.freezeOnOffscreen??!0}};this._pendingConfig=t,this._canvas&&(this._create(t),this._pendingConfig=null),Z().registerEventHandler(this._id,this._handleWorkerEvent.bind(this))}async _handleWorkerEvent(e){let t=e.data;if(!t.id&&(t.method===`onLoad`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event),s&&this._canvas instanceof HTMLCanvasElement&&(this._dotLottieInstanceState.renderConfig.freezeOnOffscreen&&(j.observe(this._canvas,this),z(this._canvas)||await this.freeze()),this._dotLottieInstanceState.renderConfig.autoResize&&M.observe(this._canvas,this))),t.method===`onComplete`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onDestroy`&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),t.method===`onUnfreeze`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._dotLottieInstanceState.isFrozen=!1,this._eventManager.dispatch(t.result.event)),t.method===`onFrame`&&t.result.instanceId===this._id&&(this._dotLottieInstanceState.currentFrame=t.result.event.currentFrame,this._eventManager.dispatch(t.result.event)),t.method===`onRender`&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),t.method===`onFreeze`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onPause`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onPlay`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStop`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onLoadError`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onRenderError`&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),t.method===`onReady`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onLoop`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStart`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._setupStateMachineListeners(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStop`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._cleanupStateMachineListeners(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineTransition`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStateEntered`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStateExit`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineCustomEvent`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineError`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineBooleanInputValueChange`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineNumericInputValueChange`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStringInputValueChange`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineInputFired`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineInternalMessage`&&t.result.instanceId===this._id)){await this._updateDotLottieInstanceState();let e=t.result.event;e.message.startsWith(`OpenUrl: `)&&U(e.message)}}async _create(e){if(!this._canvas)return;let t;if(this._canvas instanceof HTMLCanvasElement){let n=$.get(this._canvas);if(n&&n.workerId===this._workerId){await this._adopt(n,e);return}t=this._canvas.transferControlToOffscreen(),$.set(this._canvas,{destroyTimer:null,facade:this,instanceId:this._id,workerId:this._workerId})}else t=this._canvas;let{instanceId:n}=await this._sendMessage(`create`,{instanceId:this._id,config:{...e,canvas:t},...J(this._canvas,e.renderConfig?.devicePixelRatio||R())},[t]);if(n!==this._id)throw Error(`Instance ID mismatch`);this._retired||(this._created=!0,await this._updateDotLottieInstanceState())}async _adopt(e,t){e.destroyTimer===null?e.facade._retire():(clearTimeout(e.destroyTimer),e.destroyTimer=null),Z().unassignAnimationFromWorker(this._id),this._id=e.instanceId,Z().assignAnimationToWorker(this._id,this._workerId),e.facade=this,this._created=!0;let{canvas:n,...r}=t;await this._sendMessage(`load`,{config:r,instanceId:this._id}),await this._updateDotLottieInstanceState()}_retire(){this._retired=!0,this._created&&(this._created=!1,this._cleanupStateMachineListeners(),this._eventManager.dispatch({type:`destroy`}),this._eventManager.removeAllEventListeners(),s&&this._canvas instanceof HTMLCanvasElement&&(j.unobserve(this._canvas),M.unobserve(this._canvas)))}get loopCount(){return this._dotLottieInstanceState.loopCount}get isLoaded(){return this._dotLottieInstanceState.isLoaded}get isPlaying(){return this._dotLottieInstanceState.isPlaying}get isPaused(){return this._dotLottieInstanceState.isPaused}get isStopped(){return this._dotLottieInstanceState.isStopped}get currentFrame(){return this._dotLottieInstanceState.currentFrame}get isFrozen(){return this._dotLottieInstanceState.isFrozen}get totalFrames(){return this._dotLottieInstanceState.totalFrames}get segment(){return this._dotLottieInstanceState.segment}get speed(){return this._dotLottieInstanceState.speed}get duration(){return this._dotLottieInstanceState.duration}get isReady(){return this._dotLottieInstanceState.isReady}get mode(){return this._dotLottieInstanceState.mode}get canvas(){return this._canvas}async setCanvas(e){let t=typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement,n=typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas;if(!t&&!n)throw Error(`Worker-based DotLottie requires HTMLCanvasElement or OffscreenCanvas`);if(this._canvas!==e){if(this._created&&this._canvas!==null)throw Error(`Cannot change canvas after worker instance is already created with a different canvas.`);this._canvas=e,!this._created&&this._pendingConfig&&(await this._create(this._pendingConfig),this._pendingConfig=null)}}get autoplay(){return this._dotLottieInstanceState.autoplay}get backgroundColor(){return this._dotLottieInstanceState.backgroundColor}get loop(){return this._dotLottieInstanceState.loop}get useFrameInterpolation(){return this._dotLottieInstanceState.useFrameInterpolation}get renderConfig(){return this._dotLottieInstanceState.renderConfig}get manifest(){return this._dotLottieInstanceState.manifest}get activeAnimationId(){return this._dotLottieInstanceState.activeAnimationId}get marker(){return this._dotLottieInstanceState.marker}get activeThemeId(){return this._dotLottieInstanceState.activeThemeId}get layout(){return this._dotLottieInstanceState.layout}async play(){this._created&&(await this._sendMessage(`play`,{instanceId:this._id}),await this._updateDotLottieInstanceState(),s&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieInstanceState.renderConfig.freezeOnOffscreen&&!z(this._canvas)&&await this.freeze())}async pause(){this._created&&(await this._sendMessage(`pause`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async stop(){this._created&&(await this._sendMessage(`stop`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async setSpeed(e){this._created&&(await this._sendMessage(`setSpeed`,{instanceId:this._id,speed:e}),await this._updateDotLottieInstanceState())}async setMode(e){this._created&&(await this._sendMessage(`setMode`,{instanceId:this._id,mode:e}),await this._updateDotLottieInstanceState())}async setFrame(e){this._created&&(await this._sendMessage(`setFrame`,{frame:e,instanceId:this._id}),await this._updateDotLottieInstanceState())}async setSegment(e,t){this._created&&(await this._sendMessage(`setSegment`,{instanceId:this._id,segment:[e,t]}),await this._updateDotLottieInstanceState())}async resetSegment(){this._created&&(await this._sendMessage(`resetSegment`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async setRenderConfig(e){if(!this._created)return;let{devicePixelRatio:t,freezeOnOffscreen:n,quality:r,...i}=e;await this._sendMessage(`setRenderConfig`,{instanceId:this._id,renderConfig:{...this._dotLottieInstanceState.renderConfig,...i,devicePixelRatio:t||R(),freezeOnOffscreen:n??!0,...r!==void 0&&{quality:r}}}),await this._updateDotLottieInstanceState(),s&&this._canvas instanceof HTMLCanvasElement&&(this._dotLottieInstanceState.renderConfig.autoResize?M.observe(this._canvas,this):M.unobserve(this._canvas),this._dotLottieInstanceState.renderConfig.freezeOnOffscreen?(j.observe(this._canvas,this),z(this._canvas)||await this.freeze()):(j.unobserve(this._canvas),this._dotLottieInstanceState.isFrozen&&await this.unfreeze()))}async setUseFrameInterpolation(e){this._created&&(await this._sendMessage(`setUseFrameInterpolation`,{instanceId:this._id,useFrameInterpolation:e}),await this._updateDotLottieInstanceState())}async setTheme(e){if(!this._created)return!1;let t=await this._sendMessage(`setTheme`,{instanceId:this._id,themeId:e});return await this._updateDotLottieInstanceState(),t}async load(e){if(!this._created){this._pendingConfig&&(this._pendingConfig={...this._pendingConfig,...e});return}await this._sendMessage(`load`,{config:e,instanceId:this._id}),await this._updateDotLottieInstanceState()}async setLoop(e){this._created&&(await this._sendMessage(`setLoop`,{instanceId:this._id,loop:e}),await this._updateDotLottieInstanceState())}async setLoopCount(e){this._created&&(await this._sendMessage(`setLoopCount`,{instanceId:this._id,loopCount:e}),await this._updateDotLottieInstanceState())}async resize(){if(!this._created||!this._canvas)return;let{height:e,width:t}=J(this._canvas,this._dotLottieInstanceState.renderConfig.devicePixelRatio||R());await this._sendMessage(`resize`,{height:e,instanceId:this._id,width:t}),await this._updateDotLottieInstanceState()}async destroy(){if(!this._created)return;let e=this._canvas,t=e instanceof HTMLCanvasElement?$.get(e):void 0;this._retire(),t&&t.facade===this?t.destroyTimer=setTimeout(()=>{$.delete(e),this._finalizeDestroy()},0):await this._finalizeDestroy()}async _finalizeDestroy(){Z().unregisterEventHandler(this._id),Z().unassignAnimationFromWorker(this._id),await this._sendMessage(`destroy`,{instanceId:this._id})}async freeze(){this._created&&(await this._sendMessage(`freeze`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async unfreeze(){this._created&&(await this._sendMessage(`unfreeze`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async setBackgroundColor(e){this._created&&(await this._sendMessage(`setBackgroundColor`,{instanceId:this._id,backgroundColor:e}),await this._updateDotLottieInstanceState())}async loadAnimation(e){this._created&&(await this._sendMessage(`loadAnimation`,{animationId:e,instanceId:this._id}),await this._updateDotLottieInstanceState())}async setLayout(e){this._created&&(await this._sendMessage(`setLayout`,{instanceId:this._id,layout:e}),await this._updateDotLottieInstanceState())}async setSlots(e){this._created&&await this._sendMessage(`setSlots`,{instanceId:this._id,slots:e})}async getSlotIds(){return this._created?this._sendMessage(`getSlotIds`,{instanceId:this._id}):[]}async getSlotType(e){if(this._created)return this._sendMessage(`getSlotType`,{instanceId:this._id,slotId:e})}async getSlot(e){if(this._created)return this._sendMessage(`getSlot`,{instanceId:this._id,slotId:e})}async getSlots(){return this._created?this._sendMessage(`getSlots`,{instanceId:this._id}):{}}async setColorSlot(e,t){return this._created?this._sendMessage(`setColorSlot`,{instanceId:this._id,slotId:e,value:t}):!1}async setScalarSlot(e,t){return this._created?this._sendMessage(`setScalarSlot`,{instanceId:this._id,slotId:e,value:t}):!1}async setVectorSlot(e,t){return this._created?this._sendMessage(`setVectorSlot`,{instanceId:this._id,slotId:e,value:t}):!1}async setGradientSlot(e,t,n){return this._created?this._sendMessage(`setGradientSlot`,{instanceId:this._id,slotId:e,value:t,colorStopCount:n}):!1}async setTextSlot(e,t){return this._created?this._sendMessage(`setTextSlot`,{instanceId:this._id,slotId:e,value:t}):!1}async setImageSlot(e,t){if(!this._created)return!1;let n=await H(t);return this._sendMessage(`setImageSlot`,{instanceId:this._id,slotId:e,src:n})}async resetSlot(e){return this._created?this._sendMessage(`resetSlot`,{instanceId:this._id,slotId:e}):!1}async clearSlot(e){return this._created?this._sendMessage(`clearSlot`,{instanceId:this._id,slotId:e}):!1}async resetSlots(){return this._created?this._sendMessage(`resetSlots`,{instanceId:this._id}):!1}async clearSlots(){return this._created?this._sendMessage(`clearSlots`,{instanceId:this._id}):!1}async _updateDotLottieInstanceState(){if(!this._created)return;let e=await this._sendMessage(`getDotLottieInstanceState`,{instanceId:this._id});this._dotLottieInstanceState=e.state}markers(){return this._dotLottieInstanceState.markers}async setMarker(e){this._created&&(await this._sendMessage(`setMarker`,{instanceId:this._id,marker:e}),await this._updateDotLottieInstanceState())}async setThemeData(e){if(!this._created)return!1;let t=await this._sendMessage(`setThemeData`,{instanceId:this._id,themeData:e});return await this._updateDotLottieInstanceState(),t}async setViewport(e,t,n,r){return this._created?this._sendMessage(`setViewport`,{x:e,y:t,width:n,height:r,instanceId:this._id}):!1}async animationSize(){return this._created?this._sendMessage(`animationSize`,{instanceId:this._id}):{height:0,width:0}}async setTransform(e){return this._created?this._sendMessage(`setTransform`,{instanceId:this._id,transform:e}):!1}async getTransform(){if(this._created)return this._sendMessage(`getTransform`,{instanceId:this._id})}async _sendMessage(e,t,n){let r={id:`dotlottie-request-${Y()}`,method:e,params:t};return new Promise((t,i)=>{Z().registerRpcReplyHandler(r.id,n=>{Z().unregisterRpcReplyHandler(r.id);let a=n.data;a.error?i(Error(`Failed to execute method ${e}: ${a.error}`)):t(a.result)}),this._worker.postMessage(r,n||[])})}addEventListener(e,t){this._eventManager.addEventListener(e,t)}removeEventListener(e,t){this._eventManager.removeEventListener(e,t)}static setWasmUrl(e){Q=e}static async registerFont(e,t){try{let n=Y();return Z().broadcastMessage({id:n,method:`registerFont`,params:{fontName:e,fontSource:t}}),!0}catch(t){return console.error(`Error broadcasting registerFont for "${e}":`,t),!1}}async stateMachineLoad(e){if(!this._created)return!1;let t=await this._sendMessage(`stateMachineLoad`,{instanceId:this._id,stateMachineId:e});return await this._updateDotLottieInstanceState(),t}async stateMachineLoadData(e){if(!this._created)return!1;let t=await this._sendMessage(`stateMachineLoadData`,{instanceId:this._id,stateMachineData:e});return await this._updateDotLottieInstanceState(),t}async stateMachineStart(){if(!this._created)return!1;let e=await this._sendMessage(`stateMachineStart`,{instanceId:this._id});return e&&(this._setupStateMachineListeners(),await this._updateDotLottieInstanceState()),e}async stateMachineStop(){return this._created?(this._cleanupStateMachineListeners(),this._sendMessage(`stateMachineStop`,{instanceId:this._id})):!1}async stateMachineSetNumericInput(e,t){return this._created?this._sendMessage(`stateMachineSetNumericInput`,{instanceId:this._id,name:e,value:t}):!1}async stateMachineSetBooleanInput(e,t){return this._created?this._sendMessage(`stateMachineSetBooleanInput`,{instanceId:this._id,name:e,value:t}):!1}async stateMachineSetConfig(e){this._created&&this._sendMessage(`stateMachineSetConfig`,{instanceId:this._id,config:e})}async stateMachineSetStringInput(e,t){return this._created?this._sendMessage(`stateMachineSetStringInput`,{instanceId:this._id,name:e,value:t}):!1}async stateMachineGetNumericInput(e){if(this._created)return this._sendMessage(`stateMachineGetNumericInput`,{instanceId:this._id,name:e})}async stateMachineGetBooleanInput(e){if(this._created)return this._sendMessage(`stateMachineGetBooleanInput`,{instanceId:this._id,name:e})}async stateMachineGetStringInput(e){if(this._created)return this._sendMessage(`stateMachineGetStringInput`,{instanceId:this._id,name:e})}async stateMachineGetInputs(){if(this._created)return this._sendMessage(`stateMachineGetInputs`,{instanceId:this._id})}async stateMachineFireEvent(e){this._created&&this._sendMessage(`stateMachineFireEvent`,{instanceId:this._id,name:e})}async stateMachineGetStatus(){return this._created?this._sendMessage(`stateMachineGetStatus`,{instanceId:this._id}):``}async stateMachineGetCurrentState(){return this._created?this._sendMessage(`stateMachineGetCurrentState`,{instanceId:this._id}):``}async stateMachineGetActiveId(){return this._created?this._sendMessage(`stateMachineGetActiveId`,{instanceId:this._id}):``}async stateMachineOverrideState(e,t=!1){return this._created?this._sendMessage(`stateMachineOverrideState`,{instanceId:this._id,state:e,immediate:t}):!1}async stateMachineSetSeed(e){return this._created?this._sendMessage(`stateMachineSetSeed`,{instanceId:this._id,seed:e}):!1}async stateMachineGet(e){return this._created?this._sendMessage(`stateMachineGet`,{instanceId:this._id,stateMachineId:e}):``}async stateMachineGetListeners(){return this._created?this._sendMessage(`stateMachineGetListeners`,{instanceId:this._id}):[]}async stateMachinePostClickEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostClickEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerUpEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerUpEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerDownEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerDownEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerMoveEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerMoveEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerEnterEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerEnterEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerExitEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerExitEvent`,{instanceId:this._id,x:e,y:t})}_onClick(e){let t=B(e);t&&this._sendMessage(`stateMachinePostClickEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerUp(e){let t=B(e);t&&this._sendMessage(`stateMachinePostPointerUpEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerDown(e){let t=B(e);t&&this._sendMessage(`stateMachinePostPointerDownEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerMove(e){let t=B(e);t&&this._sendMessage(`stateMachinePostPointerMoveEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerEnter(e){let t=B(e);t&&this._sendMessage(`stateMachinePostPointerEnterEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerLeave(e){let t=B(e);t&&this._sendMessage(`stateMachinePostPointerExitEvent`,{instanceId:this._id,x:t.x,y:t.y})}async _setupStateMachineListeners(){if(s&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded){let e=await this._sendMessage(`stateMachineGetListeners`,{instanceId:this._id});if(e.length===0)return;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))}};exports.DotLottie=le,exports.DotLottieWorker=fe;
5
+ 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=q(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&&(M.observe(this._canvas,this),B(this._canvas)||this.freeze()),this._renderConfig.autoResize&&N.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:le(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?q(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(K(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),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&&(M.unobserve(this._canvas),N.unobserve(this._canvas),this._cleanupStateMachineListeners())}_initializeCanvas(){this._setupRendererOnCanvas(),this._canvas&&s&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded&&(this._renderConfig.freezeOnOffscreen&&(M.observe(this._canvas,this),B(this._canvas)||this.freeze()),this._renderConfig.autoResize&&N.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&&!B(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]=F(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)}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(K(e))}setRenderConfig(e){let{devicePixelRatio:t,freezeOnOffscreen:n,quality:r,...i}=e;this._renderConfig={...this._renderConfig,...i,devicePixelRatio:t||z(),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?N.observe(this._canvas,this):N.unobserve(this._canvas),this._renderConfig.freezeOnOffscreen?(M.observe(this._canvas,this),B(this._canvas)||this.freeze()):(M.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 H(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){G().setWasmUrl(e)}static preload(){return G().load()}static async registerFont(e,t){try{await G().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=ne(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=V(e);t&&this.stateMachinePostClickEvent(t.x,t.y)}_onPointerUp(e){let t=V(e);t&&this.stateMachinePostPointerUpEvent(t.x,t.y)}_onPointerDown(e){let t=V(e);t&&this.stateMachinePostPointerDownEvent(t.x,t.y)}_onPointerMove(e){let t=V(e);t&&this.stateMachinePostPointerMoveEvent(t.x,t.y)}_onPointerEnter(e){let t=V(e);t&&this.stateMachinePostPointerEnterEvent(t.x,t.y)}_onPointerLeave(e){let t=V(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))}},de=class{constructor(){if(typeof Worker>`u`)throw Error(`Worker is not supported in this environment.`);let e=new Blob(['"use strict";(()=>{var lt=Object.defineProperty;var pt=(n,t,e)=>t in n?lt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var l=(n,t,e)=>pt(n,typeof t!="symbol"?t+"":t,e);var z=class{requestAnimationFrame(t){return requestAnimationFrame(t)}cancelAnimationFrame(t){cancelAnimationFrame(t)}},V=class{constructor(){l(this,"_lastHandleId",0);l(this,"_lastImmediate",null)}requestAnimationFrame(t){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{t(performance.now())}),this._lastHandleId}cancelAnimationFrame(t){this._lastImmediate&&clearImmediate(this._lastImmediate)}},A=class{constructor(){l(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new z:new V}requestAnimationFrame(t){return this._strategy.requestAnimationFrame(t)}cancelAnimationFrame(t){this._strategy.cancelAnimationFrame(t)}};var g=typeof window<"u"&&typeof window.document<"u";var F=new Uint8Array([80,75,3,4]),X=["v","ip","op","layers","fr","w","h"],U="0.78.1",N="@lottiefiles/dotlottie-web",Z=.75,Q=4;var o,c=0,x=null;function P(){return(x===null||x.byteLength===0)&&(x=new Uint8Array(o.memory.buffer)),x}var O=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},ut=typeof O.encodeInto=="function"?function(n,t){return O.encodeInto(n,t)}:function(n,t){let e=O.encode(n);return t.set(e),{read:n.length,written:e.length}};function p(n,t,e){if(e===void 0){let d=O.encode(n),u=t(d.length,1)>>>0;return P().subarray(u,u+d.length).set(d),c=d.length,u}let r=n.length,s=t(r,1)>>>0,i=P(),_=0;for(;_<r;_++){let d=n.charCodeAt(_);if(d>127)break;i[s+_]=d}if(_!==r){_!==0&&(n=n.slice(_)),s=e(s,r,r=_+n.length*3,1)>>>0;let d=P().subarray(s+_,s+r),u=ut(n,d);_+=u.written,s=e(s,r,_,1)>>>0}return c=_,s}var C=null;function L(){return(C===null||C.buffer.detached===!0||C.buffer.detached===void 0&&C.buffer!==o.memory.buffer)&&(C=new DataView(o.memory.buffer)),C}function tt(n){let t=o.__externref_table_alloc_command_export();return o.__wbindgen_export_4.set(t,n),t}function M(n,t){try{return n.apply(this,t)}catch(e){let r=tt(e);o.__wbindgen_exn_store_command_export(r)}}var et=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&et.decode();function h(n,t){return n=n>>>0,et.decode(P().subarray(n,n+t))}function ht(n){return n==null}var R=null;function mt(){return(R===null||R.byteLength===0)&&(R=new Float32Array(o.memory.buffer)),R}function ft(n,t){let e=t(n.length*4,4)>>>0;return mt().set(n,e/4),c=n.length,e}function W(n,t){let e=t(n.length*1,1)>>>0;return P().set(n,e/1),c=n.length,e}function gt(n,t){let e=t(n.length*4,4)>>>0;for(let r=0;r<n.length;r++){let s=tt(n[r]);L().setUint32(e+4*r,s,!0)}return c=n.length,e}function nt(n,t){let e=p(n,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=W(t,o.__wbindgen_malloc_command_export),i=c;return o.register_font(e,r,s,i)!==0}var b=Object.freeze({Forward:0,0:"Forward",Reverse:1,1:"Reverse",Bounce:2,2:"Bounce",ReverseBounce:3,3:"ReverseBounce"}),w=Object.freeze({Idle:0,0:"Idle",Playing:1,1:"Playing",Paused:2,2:"Paused",Stopped:3,3:"Stopped",Tweening:4,4:"Tweening"}),q=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>o.__wbg_dotlottieplayerwasm_free(n>>>0,1)),B=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,q.unregister(this),t}free(){let t=this.__destroy_into_raw();o.__wbg_dotlottieplayerwasm_free(t,0)}clear_slot(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,e,r)!==0}layout_fit(){let t,e;try{let r=o.dotlottieplayerwasm_layout_fit(this.__wbg_ptr);return t=r[0],e=r[1],h(r[0],r[1])}finally{o.__wbindgen_free_command_export(t,e,1)}}loop_count(){return o.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){return o.dotlottieplayerwasm_poll_event(this.__wbg_ptr)}reset_slot(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,e,r)!==0}set_layout(t,e,r){let s=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),i=c;return o.dotlottieplayerwasm_set_layout(this.__wbg_ptr,s,i,e,r)!==0}set_marker(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;o.dotlottieplayerwasm_set_marker(this.__wbg_ptr,e,r)}clear_slots(){return o.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)!==0}is_complete(){return o.dotlottieplayerwasm_is_complete(this.__wbg_ptr)!==0}reset_slots(){return o.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)!==0}reset_theme(){return o.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)!==0}segment_end(){return o.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_quality(t){return o.dotlottieplayerwasm_set_quality(this.__wbg_ptr,t)!==0}set_segment(t,e){return o.dotlottieplayerwasm_set_segment(this.__wbg_ptr,t,e)!==0}sm_set_seed(t){return o.dotlottieplayerwasm_sm_set_seed(this.__wbg_ptr,t)!==0}static unload_font(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_unload_font(e,r)!==0}animation_id(){let t=o.dotlottieplayerwasm_animation_id(this.__wbg_ptr),e;return t[0]!==0&&(e=h(t[0],t[1]).slice(),o.__wbindgen_free_command_export(t[0],t[1]*1,1)),e}audio_volume(){return o.dotlottieplayerwasm_audio_volume(this.__wbg_ptr)}background_a(){return o.dotlottieplayerwasm_background_a(this.__wbg_ptr)}background_b(){return o.dotlottieplayerwasm_background_b(this.__wbg_ptr)}background_g(){return o.dotlottieplayerwasm_background_g(this.__wbg_ptr)}background_r(){return o.dotlottieplayerwasm_background_r(this.__wbg_ptr)}clear_marker(){o.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}emit_on_loop(){o.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}get_slot_ids(){return o.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr)}get_slot_str(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=o.dotlottieplayerwasm_get_slot_str(this.__wbg_ptr,e,r),i;return s[0]!==0&&(i=h(s[0],s[1]).slice(),o.__wbindgen_free_command_export(s[0],s[1]*1,1)),i}marker_names(){return o.dotlottieplayerwasm_marker_names(this.__wbg_ptr)}set_autoplay(t){o.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,t)}set_slot_str(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c,i=p(e,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),_=c;return o.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,r,s,i,_)!==0}set_viewport(t,e,r,s){return o.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,t,e,r,s)!==0}total_frames(){return o.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}clear_segment(){return o.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)!==0}current_frame(){return o.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}get_slot_type(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=o.dotlottieplayerwasm_get_slot_type(this.__wbg_ptr,e,r),i;return s[0]!==0&&(i=h(s[0],s[1]).slice(),o.__wbindgen_free_command_export(s[0],s[1]*1,1)),i}get_slots_str(){let t,e;try{let r=o.dotlottieplayerwasm_get_slots_str(this.__wbg_ptr);return t=r[0],e=r[1],h(r[0],r[1])}finally{o.__wbindgen_free_command_export(t,e,1)}}get_transform(){return o.dotlottieplayerwasm_get_transform(this.__wbg_ptr)}segment_start(){return o.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,e,r)!==0}set_text_slot(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c,i=p(e,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),_=c;return o.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,r,s,i,_)!==0}set_transform(t){let e=ft(t,o.__wbindgen_malloc_command_export),r=c;return o.dotlottieplayerwasm_set_transform(this.__wbg_ptr,e,r)!==0}sm_get_inputs(){return o.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr)}sm_poll_event(){return o.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr)}sm_post_click(t,e){o.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,t,e)}animation_size(){return o.dotlottieplayerwasm_animation_size(this.__wbg_ptr)}current_marker(){let t=o.dotlottieplayerwasm_current_marker(this.__wbg_ptr),e;return t[0]!==0&&(e=h(t[0],t[1]).slice(),o.__wbindgen_free_command_export(t[0],t[1]*1,1)),e}layout_align_x(){return o.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return o.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}load_animation(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_load_animation(this.__wbg_ptr,e,r)!==0}loop_animation(){return o.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)!==0}set_background(t,e,r,s){return o.dotlottieplayerwasm_set_background(this.__wbg_ptr,t,e,r,s)!==0}set_color_slot(t,e,r,s){let i=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),_=c;return o.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,_,e,r,s)!==0}set_image_slot(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c,i=p(e,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),_=c;return o.dotlottieplayerwasm_set_image_slot(this.__wbg_ptr,r,s,i,_)!==0}set_loop_count(t){o.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,t)}set_theme_data(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,e,r)!==0}sm_reset_input(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;o.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,e,r)}manifest_string(){let t,e;try{let r=o.dotlottieplayerwasm_manifest_string(this.__wbg_ptr);return t=r[0],e=r[1],h(r[0],r[1])}finally{o.__wbindgen_free_command_export(t,e,1)}}set_scalar_slot(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c;return o.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,r,s,e)!==0}set_vector_slot(t,e,r){let s=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),i=c;return o.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,s,i,e,r)!==0}setup_sw_target(t,e){return o.dotlottieplayerwasm_setup_sw_target(this.__wbg_ptr,t,e)!==0}get_pixel_buffer(){return o.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr)}set_audio_volume(t){o.dotlottieplayerwasm_set_audio_volume(this.__wbg_ptr,t)}sm_current_state(){let t,e;try{let r=o.dotlottieplayerwasm_sm_current_state(this.__wbg_ptr);return t=r[0],e=r[1],h(r[0],r[1])}finally{o.__wbindgen_free_command_export(t,e,1)}}state_machine_id(){let t=o.dotlottieplayerwasm_state_machine_id(this.__wbg_ptr),e;return t[0]!==0&&(e=h(t[0],t[1]).slice(),o.__wbindgen_free_command_export(t[0],t[1]*1,1)),e}get_state_machine(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=o.dotlottieplayerwasm_get_state_machine(this.__wbg_ptr,e,r),i;return s[0]!==0&&(i=h(s[0],s[1]).slice(),o.__wbindgen_free_command_export(s[0],s[1]*1,1)),i}set_position_slot(t,e,r){let s=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),i=c;return o.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,s,i,e,r)!==0}current_loop_count(){return o.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}sm_framework_setup(){return o.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr)}sm_post_pointer_up(t,e){o.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,t,e)}state_machine_load(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,e,r)!==0}load_dotlottie_data(t){let e=W(t,o.__wbindgen_malloc_command_export),r=c;return o.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,e,r)!==0}sm_get_string_input(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=o.dotlottieplayerwasm_sm_get_string_input(this.__wbg_ptr,e,r),i;return s[0]!==0&&(i=h(s[0],s[1]).slice(),o.__wbindgen_free_command_export(s[0],s[1]*1,1)),i}sm_set_string_input(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c,i=p(e,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),_=c;return o.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,r,s,i,_)!==0}sm_get_boolean_input(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=o.dotlottieplayerwasm_sm_get_boolean_input(this.__wbg_ptr,e,r);return s===16777215?void 0:s!==0}sm_get_numeric_input(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c,s=o.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,e,r);return s===4294967297?void 0:s}sm_post_pointer_down(t,e){o.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,t,e)}sm_post_pointer_exit(t,e){o.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,t,e)}sm_post_pointer_move(t,e){o.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,t,e)}sm_set_boolean_input(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c;return o.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,r,s,e)!==0}sm_set_numeric_input(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c;return o.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,r,s,e)!==0}state_machine_unload(){o.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_post_pointer_enter(t,e){o.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,t,e)}load_animation_from_id(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,e,r)!==0}sm_poll_internal_event(){return o.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr)}use_frame_interpolation(){return o.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)!==0}reset_current_loop_count(){o.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}sm_override_current_state(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c;return o.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,r,s,e)!==0}state_machine_load_from_id(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_state_machine_load_from_id(this.__wbg_ptr,e,r)!==0}set_use_frame_interpolation(t){o.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,t)}constructor(){let t=o.dotlottieplayerwasm_new();return this.__wbg_ptr=t>>>0,q.register(this,this.__wbg_ptr,this),this}mode(){return o.dotlottieplayerwasm_mode(this.__wbg_ptr)}play(){return o.dotlottieplayerwasm_play(this.__wbg_ptr)!==0}stop(){return o.dotlottieplayerwasm_stop(this.__wbg_ptr)!==0}tick(t){return o.dotlottieplayerwasm_tick(this.__wbg_ptr,t)!==0}pause(){return o.dotlottieplayerwasm_pause(this.__wbg_ptr)!==0}speed(){return o.dotlottieplayerwasm_speed(this.__wbg_ptr)}width(){return o.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return o.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}render(){return o.dotlottieplayerwasm_render(this.__wbg_ptr)!==0}status(){return o.dotlottieplayerwasm_status(this.__wbg_ptr)}markers(){return o.dotlottieplayerwasm_markers(this.__wbg_ptr)}sm_fire(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,e,r)!==0}sm_stop(){return o.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)!==0}sm_tick(t){return o.dotlottieplayerwasm_sm_tick(this.__wbg_ptr,t)!==0}autoplay(){return o.dotlottieplayerwasm_autoplay(this.__wbg_ptr)!==0}duration(){return o.dotlottieplayerwasm_duration(this.__wbg_ptr)}set_loop(t){o.dotlottieplayerwasm_set_loop(this.__wbg_ptr,t)}set_mode(t){o.dotlottieplayerwasm_set_mode(this.__wbg_ptr,t)}sm_start(t,e){let r=gt(e,o.__wbindgen_malloc_command_export),s=c;return o.dotlottieplayerwasm_sm_start(this.__wbg_ptr,t,r,s)!==0}theme_id(){let t=o.dotlottieplayerwasm_theme_id(this.__wbg_ptr),e;return t[0]!==0&&(e=h(t[0],t[1]).slice(),o.__wbindgen_free_command_export(t[0],t[1]*1,1)),e}load_font(t,e){let r=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),s=c,i=W(e,o.__wbindgen_malloc_command_export),_=c;return o.dotlottieplayerwasm_load_font(this.__wbg_ptr,r,s,i,_)!==0}set_frame(t){return o.dotlottieplayerwasm_set_frame(this.__wbg_ptr,t)!==0}set_speed(t){o.dotlottieplayerwasm_set_speed(this.__wbg_ptr,t)}set_theme(t){let e=p(t,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),r=c;return o.dotlottieplayerwasm_set_theme(this.__wbg_ptr,e,r)!==0}sm_status(){let t,e;try{let r=o.dotlottieplayerwasm_sm_status(this.__wbg_ptr);return t=r[0],e=r[1],h(r[0],r[1])}finally{o.__wbindgen_free_command_export(t,e,1)}}};async function wt(n,t){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,t)}catch(r){if(n.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",r);else throw r}let e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}else{let e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}function vt(){let n={};return n.wbg={},n.wbg.__wbg_buffer_609cc3eee51ed158=function(t){return t.buffer},n.wbg.__wbg_createObjectURL_6e98d2f9c7bd9764=function(){return M(function(t,e){let r=URL.createObjectURL(e),s=p(r,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),i=c;L().setInt32(t+4,i,!0),L().setInt32(t+0,s,!0)},arguments)},n.wbg.__wbg_ended_b873fb75d0c13ca7=function(t){return t.ended},n.wbg.__wbg_error_7534b8e9a36f1ab4=function(t,e){let r,s;try{r=t,s=e,console.error(h(t,e))}finally{o.__wbindgen_free_command_export(r,s,1)}},n.wbg.__wbg_new_405e22f390576ce2=function(){return new Object},n.wbg.__wbg_new_78feb108b6472713=function(){return new Array},n.wbg.__wbg_new_8a6f238a6ece86ea=function(){return new Error},n.wbg.__wbg_new_a12002a7f91c75be=function(t){return new Uint8Array(t)},n.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(t,e,r){return new Uint8Array(t,e>>>0,r>>>0)},n.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(t){return new Float32Array(t>>>0)},n.wbg.__wbg_newwithsrc_20307ca7e8762a81=function(){return M(function(t,e){return new Audio(h(t,e))},arguments)},n.wbg.__wbg_newwithu8arraysequenceandoptions_068570c487f69127=function(){return M(function(t,e){return new Blob(t,e)},arguments)},n.wbg.__wbg_pause_b74c96d69f769518=function(){return M(function(t){t.pause()},arguments)},n.wbg.__wbg_play_f6ec5fc4e84b0d26=function(){return M(function(t){return t.play()},arguments)},n.wbg.__wbg_push_737cfc8c1432c2c6=function(t,e){return t.push(e)},n.wbg.__wbg_revokeObjectURL_27267efebeb457c7=function(){return M(function(t,e){URL.revokeObjectURL(h(t,e))},arguments)},n.wbg.__wbg_set_bb8cecf6a62b9f46=function(){return M(function(t,e,r){return Reflect.set(t,e,r)},arguments)},n.wbg.__wbg_setcurrentTime_64727eddd3966512=function(t,e){t.currentTime=e},n.wbg.__wbg_setindex_4e73afdcd9bb95cd=function(t,e,r){t[e>>>0]=r},n.wbg.__wbg_settype_39ed370d3edd403c=function(t,e,r){t.type=h(e,r)},n.wbg.__wbg_setvolume_3895e06a030ca4f7=function(t,e){t.volume=e},n.wbg.__wbg_stack_0ed75d68575b0f3c=function(t,e){let r=e.stack,s=p(r,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),i=c;L().setInt32(t+4,i,!0),L().setInt32(t+0,s,!0)},n.wbg.__wbindgen_init_externref_table=function(){let t=o.__wbindgen_export_4,e=t.grow(4);t.set(0,void 0),t.set(e+0,void 0),t.set(e+1,null),t.set(e+2,!0),t.set(e+3,!1)},n.wbg.__wbindgen_memory=function(){return o.memory},n.wbg.__wbindgen_number_new=function(t){return t},n.wbg.__wbindgen_string_get=function(t,e){let r=e,s=typeof r=="string"?r:void 0;var i=ht(s)?0:p(s,o.__wbindgen_malloc_command_export,o.__wbindgen_realloc_command_export),_=c;L().setInt32(t+4,_,!0),L().setInt32(t+0,i,!0)},n.wbg.__wbindgen_string_new=function(t,e){return h(t,e)},n.wbg.__wbindgen_throw=function(t,e){throw new Error(h(t,e))},n}function bt(n,t){return o=n.exports,rt.__wbindgen_wasm_module=t,C=null,R=null,x=null,o.__wbindgen_start(),o}async function rt(n){if(o!==void 0)return o;if(typeof n<"u"&&(Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof n>"u")throw new Error("WASM module URL must be provided via DotLottieWasmLoader or setWasmUrl().");let t=vt();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));let{instance:e,module:r}=await wt(await n,t);return bt(e,r)}var ot=rt;var $=class{constructor(){l(this,"_eventListeners",new Map)}addEventListener(t,e){let r=this._eventListeners.get(t);r||(r=new Set,this._eventListeners.set(t,r)),r.add(e)}removeEventListener(t,e){let r=this._eventListeners.get(t);r&&(e?(r.delete(e),r.size===0&&this._eventListeners.delete(t)):this._eventListeners.delete(t))}dispatch(t){this._eventListeners.get(t.type)?.forEach(r=>r(t))}removeAllEventListeners(){this._eventListeners.clear()}};var f=class f{static _initializeObserver(){if(f._observer)return;let t=e=>{e.forEach(r=>{let s=f._observedCanvases.get(r.target);s&&(r.isIntersecting?s.unfreeze():s.freeze())})};f._observer=new IntersectionObserver(t,{threshold:0})}static observe(t,e){f._initializeObserver(),!f._observedCanvases.has(t)&&(f._observedCanvases.set(t,e),f._observer?.observe(t))}static unobserve(t){f._observer?.unobserve(t),f._observedCanvases.delete(t),f._observedCanvases.size===0&&(f._observer?.disconnect(),f._observer=null)}};l(f,"_observer",null),l(f,"_observedCanvases",new Map);var y=f;var m=class m{static _initializeObserver(){if(m._observer)return;let t=e=>{e.forEach(r=>{let s=m._observedCanvases.get(r.target);if(!s)return;let[i,_]=s;clearTimeout(_);let d=setTimeout(()=>{i.resize()},100);m._observedCanvases.set(r.target,[i,d])})};m._observer=new ResizeObserver(t)}static observe(t,e){m._initializeObserver(),!m._observedCanvases.has(t)&&(m._observedCanvases.set(t,[e,0]),m._observer?.observe(t))}static unobserve(t){let e=m._observedCanvases.get(t);if(e){let r=e[1];r&&clearTimeout(r)}m._observer?.unobserve(t),m._observedCanvases.delete(t),!m._observedCanvases.size&&m._observer&&(m._observer.disconnect(),m._observer=null)}};l(m,"_observer",null),l(m,"_observedCanvases",new Map);var E=m;function yt(n){return/^#([\\da-f]{6}|[\\da-f]{8})$/iu.test(n)}function st(n){if(!yt(n))return[0,0,0,0];let t=n.replace("#","");t=t.length===6?`${t}ff`:t;let e=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,s=parseInt(t.slice(4,6),16)/255,i=parseInt(t.slice(6,8),16)/255;return[e,r,s,i]}function G(n){if(n.byteLength<4)return!1;let t=new Uint8Array(n.slice(0,F.byteLength));for(let e=0;e<F.length;e+=1)if(F[e]!==t[e])return!1;return!0}function Et(n){return X.every(t=>Object.hasOwn(n,t))}function H(n){return typeof n=="string"?/^\\s*\\{/u.test(n)&&/\\}\\s*$/u.test(n):Et(n)}function J(){return 1+((g?window.devicePixelRatio:1)-1)*Z}function k(n){let t=n.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth;return!(t.bottom<0||t.top>e||t.right<0||t.left>r)}function I(n){let t=n.target;if(t instanceof HTMLCanvasElement){let e=t.getBoundingClientRect();if(e.width===0||e.height===0||t.width===0||t.height===0)return null;let r=t.width/e.width,s=t.height/e.height,i=(n.clientX-e.left)*r,_=(n.clientY-e.top)*s;return!Number.isFinite(i)||!Number.isFinite(_)||Number.isNaN(i)||Number.isNaN(_)?null:{x:i,y:_}}return null}function Mt(n){return new Promise((t,e)=>{let r=new FileReader;r.onerror=()=>e(r.error??new Error("Failed to read image slot source")),r.onload=()=>t(r.result),r.readAsDataURL(n)})}async function it(n){if(!/^https?:\\/\\//i.test(n))return n;let t=await fetch(n);if(!t.ok)throw new Error(`Failed to fetch image slot source from URL: ${n}. ${t.status}: ${t.statusText}`);return Mt(await t.blob())}function at(n){let t=n.replace("OpenUrl: ",""),e=t.indexOf(" | Target: "),r,s;e===-1?(r=t,s="_blank"):(r=t.substring(0,e),s=t.substring(e+11)),window.open(r,s)}function ct(n,t,e){let r=null,s=t;async function i(d){await n({module_or_path:d})}async function _(d){let u=await fetch(d);if(!u.ok)throw new Error(`fetch ${d} responded with ${u.status} ${u.statusText}`);let T=await u.arrayBuffer();await n({module_or_path:T})}return{load(){if(!r){let d=s,u=e;r=(async()=>{let T,Y;try{await i(d);return}catch(v){T=v,console.warn(`Primary WASM load failed from ${d}: ${v.message}`),console.warn(`Attempting to load WASM from backup URL: ${u}`)}try{await i(u);return}catch(v){Y=v,console.warn(`Backup WASM load failed from ${u}: ${v.message}`)}console.warn("Retrying WASM load with buffered instantiation");try{await _(d);return}catch(v){console.warn(`Buffered WASM load from ${d} failed: ${v.message}`)}try{await _(u);return}catch(v){throw console.error(`Primary WASM URL failed: ${T.message}`),console.error(`Backup WASM URL failed: ${Y.message}`),console.error(`Buffered fallback failed: ${v.message}`),r=null,new Error("WASM loading failed from all sources.")}})()}return r},setWasmUrl(d){d!==s&&(s=d,r=null)}}}var _t=null;function D(){return _t??(_t=ct(ot,`https://cdn.jsdelivr.net/npm/${N}@${U}/dist/dotlottie-player.wasm`,`https://unpkg.com/${N}@${U}/dist/dotlottie-player.wasm`)),_t}var j=n=>{switch(n){case"reverse":return b.Reverse;case"bounce":return b.Bounce;case"reverse-bounce":return b.ReverseBounce;default:return b.Forward}},dt=n=>{switch(n){case b.Reverse:return"reverse";case b.Bounce:return"bounce";case b.ReverseBounce:return"reverse-bounce";default:return"forward"}},Ct=n=>{switch(n){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"}},S=class{constructor(t){l(this,"_canvas",null);l(this,"_pendingLoad",null);l(this,"_srcFetchAbort",null);l(this,"_context",null);l(this,"_eventManager");l(this,"_animationFrameId",null);l(this,"_frameManager");l(this,"_boundAnimationLoop");l(this,"_dotLottieCore",null);l(this,"_stateMachineId","");l(this,"_stateMachineConfig",null);l(this,"_isStateMachineRunning",!1);l(this,"_renderConfig",{});l(this,"_isFrozen",!1);l(this,"_backgroundColor",null);l(this,"_lastFrameTime",null);l(this,"_boundOnClick",null);l(this,"_boundOnPointerUp",null);l(this,"_boundOnPointerDown",null);l(this,"_boundOnPointerMove",null);l(this,"_boundOnPointerEnter",null);l(this,"_boundOnPointerLeave",null);l(this,"_bufferMismatchCount",0);l(this,"_lastExpectedBufferSize",0);l(this,"_cachedImageData",null);l(this,"_cachedImageDataBuffer",null);l(this,"_cachedImageDataByteOffset",0);l(this,"_marker","");l(this,"_segment",null);this._canvas=t.canvas??null,this._eventManager=new $,this._frameManager=new A,this._boundAnimationLoop=this._animationLoop.bind(this),this._renderConfig={...t.renderConfig,devicePixelRatio:t.renderConfig?.devicePixelRatio||J(),freezeOnOffscreen:t.renderConfig?.freezeOnOffscreen??!0};let e=null;t.src&&!t.data&&(this._srcFetchAbort=new AbortController,e=this._fetchData(t.src,this._srcFetchAbort.signal),e.catch(()=>{})),this._initWasm().then(()=>{this._dotLottieCore=this._createCore(),this._dotLottieCore.set_autoplay(t.autoplay??!1),this._dotLottieCore.set_loop(t.loop??!1),this._dotLottieCore.set_loop_count(t.loopCount??0),this._dotLottieCore.set_mode(j(t.mode??"forward")),this._dotLottieCore.set_speed(t.speed??1),this._dotLottieCore.set_use_frame_interpolation(t.useFrameInterpolation??!0),t.segment&&t.segment.length===2&&(this._segment=[t.segment[0],t.segment[1]],this._dotLottieCore.set_segment(this._segment[0],this._segment[1])),this._marker=t.marker??"",this._marker&&this._dotLottieCore.set_marker(this._marker),this._dotLottieCore.set_layout(t.layout?.fit??"contain",t.layout?.align?.[0]??.5,t.layout?.align?.[1]??.5),this._stateMachineId=t.stateMachineId??"",this._stateMachineConfig=t.stateMachineConfig??null,this._onCoreCreated(),this._eventManager.dispatch({type:"ready"}),t.data?this._canvas?this._loadFromData(t.data):this._pendingLoad={data:t.data}:t.src&&(this._canvas?this._loadFromSrc(t.src,e):this._pendingLoad={src:t.src,dataPromise:e}),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor)}).catch(r=>{this._srcFetchAbort?.abort(),console.error("[dotlottie-web] Initialization failed:",r),this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${r}`)})})}async _initWasm(){return D().load()}_createCore(){return new B}_onCoreCreated(){}_setupTarget(t,e){return this._dotLottieCore?this._dotLottieCore.setup_sw_target(t,e):!1}_drainPlayerEvents({skipFrame:t=!1}={}){if(!this._dotLottieCore)return;let e;for(;(e=this._dotLottieCore.poll_event())!==null&&e!==void 0;){let r=e;switch(r.type){case"Load":setTimeout(()=>this._eventManager.dispatch({type:"load"}),0);break;case"LoadError":setTimeout(()=>this._eventManager.dispatch({type:"loadError",error:new 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":t||queueMicrotask(()=>this._eventManager.dispatch({type:"frame",currentFrame:r.frameNo??0}));break;case"Render":t||queueMicrotask(()=>this._eventManager.dispatch({type:"render",currentFrame:r.frameNo??0}));break;case"Loop":queueMicrotask(()=>this._eventManager.dispatch({type:"loop",loopCount:r.loopCount??0}));break;case"Complete":queueMicrotask(()=>this._eventManager.dispatch({type:"complete"}));break;default:break}}}_discardPlayerEvents(){for(;this._dotLottieCore?.poll_event()!=null;);}_drainSmEvents(){if(!this._dotLottieCore)return;let t;for(;(t=this._dotLottieCore.sm_poll_event())!==null&&t!==void 0;){let r=t;switch(r.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()!==w.Playing&&this._stopAnimationLoop()});break;case"CustomEvent":this._eventManager.dispatch({type:"stateMachineCustomEvent",eventName:r.message??""});break;case"BooleanInputChange":this._eventManager.dispatch({type:"stateMachineBooleanInputValueChange",inputName:r.name??"",newValue:r.newValue,oldValue:r.oldValue});break;case"NumericInputChange":this._eventManager.dispatch({type:"stateMachineNumericInputValueChange",inputName:r.name??"",newValue:r.newValue,oldValue:r.oldValue});break;case"StringInputChange":this._eventManager.dispatch({type:"stateMachineStringInputValueChange",inputName:r.name??"",newValue:r.newValue,oldValue:r.oldValue});break;case"InputFired":this._eventManager.dispatch({type:"stateMachineInputFired",inputName:r.name??""});break;case"Transition":this._eventManager.dispatch({type:"stateMachineTransition",fromState:r.previousState??"",toState:r.newState??""});break;case"StateEntered":this._eventManager.dispatch({type:"stateMachineStateEntered",state:r.state??""});break;case"StateExit":this._eventManager.dispatch({type:"stateMachineStateExit",state:r.state??""});break;case"Error":this._eventManager.dispatch({type:"stateMachineError",error:r.message??""});break;default:break}}let e;for(;(e=this._dotLottieCore.sm_poll_internal_event())!==null&&e!==void 0;){let r=e;if(r.type==="Message"){let s=r.message??"";g&&s.startsWith("OpenUrl: ")?at(s):this._eventManager.dispatch({type:"stateMachineInternalMessage",message:s})}}}_dispatchError(t){console.error(t),this._eventManager.dispatch({type:"loadError",error:new Error(t)})}async _fetchData(t,e=null){let r=await fetch(t,{signal:e});if(!r.ok)throw new Error(`Failed to fetch animation data from URL: ${t}. ${r.status}: ${r.statusText}`);let s=await r.arrayBuffer();return G(s)?s:new TextDecoder().decode(s)}_loadFromData(t){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 e=!1;if(typeof t=="string"){if(e=this._dotLottieCore.load_animation(t),!e&&!H(t)){this._discardPlayerEvents(),this._dispatchError("Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.");return}}else if(t instanceof ArrayBuffer){if(!G(t)){this._dispatchError("Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.");return}e=this._dotLottieCore.load_dotlottie_data(new Uint8Array(t))}else if(typeof t=="object"){if(!H(t)){this._dispatchError("Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.");return}e=this._dotLottieCore.load_animation(JSON.stringify(t))}else{this._dispatchError(`Unsupported data type for animation data. Expected:\n - string (Lottie JSON),\n - ArrayBuffer (dotLottie),\n - object (Lottie JSON).\n Received: ${typeof t}`);return}if(e){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 r=dt(this._dotLottieCore.mode()),s=r==="reverse"||r==="reverse-bounce"?this._segment[1]:this._segment[0];this._dotLottieCore.set_frame(s)}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()===w.Playing&&this._startAnimationLoop(),g&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.freezeOnOffscreen&&(y.observe(this._canvas,this),k(this._canvas)||this.freeze()),this._renderConfig.autoResize&&E.observe(this._canvas,this))}else this._drainPlayerEvents()}_loadFromSrc(t,e){(e??this._fetchData(t)).then(r=>this._loadFromData(r)).catch(r=>this._dispatchError(`Failed to load animation data from URL: ${t}. ${r}`))}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:Ct(this._dotLottieCore.layout_fit())}}get marker(){return this._dotLottieCore?.current_marker()??""}get manifest(){try{let t=this._dotLottieCore?.manifest_string();if(this._dotLottieCore===null||!t)return null;let e=JSON.parse(t);return Object.keys(e).length===0?null:e}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?dt(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()??w.Idle)!==w.Idle}get isPlaying(){return this._dotLottieCore?.status()===w.Playing}get isPaused(){return this._dotLottieCore?.status()===w.Paused}get isStopped(){return this._dotLottieCore?.status()===w.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(t){this._dotLottieCore!==null&&(this._stopAnimationLoop(),this._cleanupCanvas(),this._isFrozen=!1,this._dotLottieCore.set_autoplay(t.autoplay??!1),this._dotLottieCore.set_loop(t.loop??!1),this._dotLottieCore.set_loop_count(t.loopCount??0),this._dotLottieCore.set_mode(j(t.mode??"forward")),this._dotLottieCore.set_speed(t.speed??1),this._dotLottieCore.set_use_frame_interpolation(t.useFrameInterpolation??!0),t.segment&&t.segment.length===2?(this._segment=[t.segment[0],t.segment[1]],this._dotLottieCore.set_segment(this._segment[0],this._segment[1])):(this._segment=null,this._dotLottieCore.clear_segment()),this._marker=t.marker??"",this._marker?this._dotLottieCore.set_marker(this._marker):this._dotLottieCore.clear_marker(),this._dotLottieCore.set_layout(t.layout?.fit??"contain",t.layout?.align?.[0]??.5,t.layout?.align?.[1]??.5),t.data?this._canvas?this._loadFromData(t.data):this._pendingLoad={data:t.data}:t.src&&(this._canvas?this._loadFromSrc(t.src):this._pendingLoad={src:t.src}),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor))}_draw(){if(this._dotLottieCore===null||this._canvas===null||(!this._context&&"getContext"in this._canvas&&typeof this._canvas.getContext=="function"&&(!g||typeof HTMLCanvasElement<"u"&&this._canvas instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&this._canvas instanceof OffscreenCanvas)&&(this._context=this._canvas.getContext("2d")),!this._context))return;let t=this._dotLottieCore.get_pixel_buffer(),e=this._canvas.width,r=this._canvas.height,s=e*r*Q;if(t.byteLength!==s){this._lastExpectedBufferSize===s?this._bufferMismatchCount+=1:(this._bufferMismatchCount=1,this._lastExpectedBufferSize=s),this._bufferMismatchCount===10&&console.warn(`[dotlottie-web] Persistent buffer size mismatch detected. Expected ${s} bytes for canvas ${e}x${r}, but got ${t.byteLength} bytes. This may indicate a WASM memory allocation issue or invalid canvas dimensions.`);return}this._bufferMismatchCount=0,this._lastExpectedBufferSize=s;let i=this._cachedImageData;if(!(i!==null&&i.width===e&&i.height===r&&i.data.byteLength===s&&this._cachedImageDataBuffer===t.buffer&&this._cachedImageDataByteOffset===t.byteOffset)){if(typeof ImageData>"u")this._cachedImageData=this._context.createImageData(e,r);else{let d=new Uint8ClampedArray(t.buffer,t.byteOffset,t.byteLength);this._cachedImageData=new ImageData(d,e,r)}this._cachedImageDataBuffer=t.buffer,this._cachedImageDataByteOffset=t.byteOffset}if(typeof ImageData>"u"){let d=new Uint8ClampedArray(t.buffer,t.byteOffset,t.byteLength);this._cachedImageData.data.set(d)}this._context.putImageData(this._cachedImageData,0,0)}_cleanupCanvas(){this._canvas&&g&&this._canvas instanceof HTMLCanvasElement&&(y.unobserve(this._canvas),E.unobserve(this._canvas),this._cleanupStateMachineListeners())}_initializeCanvas(){this._setupRendererOnCanvas(),this._canvas&&g&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded&&(this._renderConfig.freezeOnOffscreen&&(y.observe(this._canvas,this),k(this._canvas)||this.freeze()),this._renderConfig.autoResize&&E.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()===w.Playing||this._isStateMachineRunning)&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._boundAnimationLoop))}_animationLoop(t){if(this._dotLottieCore===null){this._stopAnimationLoop();return}if(this._dotLottieCore.status()!==w.Playing&&!this._isStateMachineRunning){this._stopAnimationLoop();return}try{let e=this._lastFrameTime!==null?t-this._lastFrameTime:0;this._lastFrameTime=t;let r=this._isStateMachineRunning?this._dotLottieCore.sm_tick(e):this._dotLottieCore.tick(e);this._isStateMachineRunning?this._drainSmEvents():this._drainPlayerEvents(),r&&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 t=this._dotLottieCore.play();this._drainPlayerEvents(),(t||this._dotLottieCore.status()===w.Playing)&&(this._isFrozen=!1,this._startAnimationLoop()),this._canvas&&g&&this._canvas instanceof HTMLCanvasElement&&this._renderConfig.freezeOnOffscreen&&!k(this._canvas)&&this.freeze()}pause(){this._dotLottieCore!==null&&(this._dotLottieCore.pause(),this._drainPlayerEvents(),this._stopAnimationLoop())}stop(){if(this._dotLottieCore===null)return;let t=this._dotLottieCore.stop();this._drainPlayerEvents(),this._stopAnimationLoop(),t&&(this._eventManager.dispatch({type:"frame",currentFrame:this.currentFrame}),this._dotLottieCore.render(),this._draw())}setFrame(t){if(this._dotLottieCore===null)return;if(this._dotLottieCore.set_frame(t)){let r=this._dotLottieCore.render();this._drainPlayerEvents(),r&&this._draw()}}setSpeed(t){this._dotLottieCore!==null&&this._dotLottieCore.set_speed(t)}setBackgroundColor(t){if(this._dotLottieCore!==null){if(g&&this._canvas instanceof HTMLCanvasElement)this._canvas.style.backgroundColor=t;else{let[e,r,s,i]=st(t);this._dotLottieCore.set_background(e,r,s,i)}this._backgroundColor=t}}setLoop(t){this._dotLottieCore!==null&&this._dotLottieCore.set_loop(t)}setLoopCount(t){this._dotLottieCore!==null&&this._dotLottieCore.set_loop_count(t)}setUseFrameInterpolation(t){this._dotLottieCore!==null&&this._dotLottieCore.set_use_frame_interpolation(t)}addEventListener(t,e){this._eventManager.addEventListener(t,e)}removeEventListener(t,e){this._eventManager.removeEventListener(t,e)}destroy(){this._stopAnimationLoop(),this._isStateMachineRunning=!1,this._cleanupCanvas(),this._srcFetchAbort?.abort(),this._srcFetchAbort=null,this._pendingLoad=null;let t=this._dotLottieCore;if(this._dotLottieCore=null,this._context=null,t)try{t.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(!(g&&this._canvas instanceof HTMLCanvasElement))return;let t=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:e,width:r}=this._canvas.getBoundingClientRect();e!==0&&r!==0&&(this._canvas.width=r*t,this._canvas.height=e*t)}resize(){if(!this._dotLottieCore||!this.isLoaded||!this._canvas)return;this._syncCanvasSize(),this._setupTarget(this._canvas.width,this._canvas.height)&&(this._dotLottieCore.render(),this._draw())}setCanvas(t){if(!(!t||this._canvas===t)&&(this._canvas&&this._cleanupCanvas(),this._canvas=t,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(t){if(!this._dotLottieCore)return!1;let e=this._dotLottieCore.set_transform(new Float32Array(t));return e&&this._dotLottieCore.render()&&this._draw(),e}getTransform(){if(!this._dotLottieCore)return;let t=this._dotLottieCore.get_transform();return Array.from(t)}setSegment(t,e){this._dotLottieCore!==null&&(this._segment=[t,e],this._dotLottieCore.set_segment(t,e))}resetSegment(){this._dotLottieCore!==null&&(this._segment=null,this._dotLottieCore.clear_segment())}setMode(t){this._dotLottieCore!==null&&this._dotLottieCore.set_mode(j(t))}setRenderConfig(t){let{devicePixelRatio:e,freezeOnOffscreen:r,quality:s,...i}=t;this._renderConfig={...this._renderConfig,...i,devicePixelRatio:e||J(),freezeOnOffscreen:r??!0,...s!==void 0&&{quality:s}},s!==void 0&&this._dotLottieCore&&this._dotLottieCore.set_quality(s),g&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.autoResize?E.observe(this._canvas,this):E.unobserve(this._canvas),this._renderConfig.freezeOnOffscreen?(y.observe(this._canvas,this),k(this._canvas)||this.freeze()):(y.unobserve(this._canvas),this._isFrozen&&this.unfreeze()))}loadAnimation(t){if(this._dotLottieCore===null||this._dotLottieCore.animation_id()===t||!this._canvas)return;this._syncCanvasSize(),this._setupTarget(this._canvas.width,this._canvas.height),this._dotLottieCore.load_animation_from_id(t)?(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: ${t}`)}setMarker(t){if(this._dotLottieCore===null)return;this.markers().some(s=>s.name===t)?(this._marker=t,this._dotLottieCore.set_marker(t)):(this._marker="",this._segment=null,this._dotLottieCore.clear_marker(),this._dotLottieCore.clear_segment())}markers(){let t=this._dotLottieCore?.markers();return t&&Array.isArray(t)?t:[]}setTheme(t){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.set_theme(t);return e&&(this._dotLottieCore.render(),this._draw()),e}resetTheme(){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.reset_theme();return t&&(this._dotLottieCore.render(),this._draw()),t}setThemeData(t){if(this._dotLottieCore===null)return!1;let e=typeof t=="string"?t:JSON.stringify(t),r=this._dotLottieCore.set_theme_data(e);return r&&(this._dotLottieCore.render(),this._draw()),r}setSlots(t){this._dotLottieCore!==null&&this._dotLottieCore.set_slots_str(JSON.stringify(t))&&(this._dotLottieCore.render(),this._draw())}_isKeyframeArray(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="object"&&t[0]!==null&&"t"in t[0]&&"s"in t[0]}getSlotIds(){if(!this._dotLottieCore)return[];let t=this._dotLottieCore.get_slot_ids();return Array.isArray(t)?t:[]}getSlotType(t){if(!this._dotLottieCore)return;let e=this._dotLottieCore.get_slot_type(t);if(e)return e}getSlot(t){if(!this._dotLottieCore)return;let e=this._dotLottieCore.get_slot_str(t);if(e)try{return JSON.parse(e)}catch{return}}getSlots(){if(!this._dotLottieCore)return{};try{return JSON.parse(this._dotLottieCore.get_slots_str())}catch{return{}}}setColorSlot(t,e){if(this._dotLottieCore===null)return!1;let r=this._isKeyframeArray(e),s=JSON.stringify({a:r?1:0,k:e}),i=this._dotLottieCore.set_slot_str(t,s);return this._dotLottieCore.render(),this._draw(),i}setScalarSlot(t,e){if(this._dotLottieCore===null)return!1;let s=JSON.stringify({a:typeof e!="number"?1:0,k:e}),i=this._dotLottieCore.set_slot_str(t,s);return this._dotLottieCore.render(),this._draw(),i}setVectorSlot(t,e){if(this._dotLottieCore===null)return!1;let r=this._isKeyframeArray(e),s=JSON.stringify({a:r?1:0,k:e}),i=this._dotLottieCore.set_slot_str(t,s);return this._dotLottieCore.render(),this._draw(),i}setGradientSlot(t,e,r){if(this._dotLottieCore===null)return!1;let s=this._isKeyframeArray(e),i=JSON.stringify({k:{a:s?1:0,k:e},p:r}),_=this._dotLottieCore.set_slot_str(t,i);return this._dotLottieCore.render(),this._draw(),_}setTextSlot(t,e){if(this._dotLottieCore===null)return!1;let r=this._dotLottieCore.get_slot_str(t),s=e;if(r){let d=JSON.parse(r);if(d&&"k"in d&&Array.isArray(d.k)){let u=d.k[0];"s"in u&&typeof u.s=="object"&&(s={...u.s,...e})}}let i=JSON.stringify({a:0,k:[{t:0,s}]}),_=this._dotLottieCore.set_slot_str(t,i);return this._dotLottieCore.render(),this._draw(),_}async setImageSlot(t,e){if(this._dotLottieCore===null)return!1;let r=await it(e);if(this._dotLottieCore===null)return!1;let s=this._dotLottieCore.set_image_slot(t,r);return this._dotLottieCore.render(),this._draw(),s}resetSlot(t){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.reset_slot(t);return this._dotLottieCore.render(),this._draw(),e}clearSlot(t){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.clear_slot(t);return this._dotLottieCore.render(),this._draw(),e}resetSlots(){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.reset_slots();return this._dotLottieCore.render(),this._draw(),t}clearSlots(){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.clear_slots();return this._dotLottieCore.render(),this._draw(),t}setLayout(t){this._dotLottieCore!==null&&this._dotLottieCore.set_layout(t.fit??"contain",t.align?.[0]??.5,t.align?.[1]??.5)}setViewport(t,e,r,s){return this._dotLottieCore===null?!1:this._dotLottieCore.set_viewport(t,e,r,s)}static setWasmUrl(t){D().setWasmUrl(t)}static preload(){return D().load()}static async registerFont(t,e){try{await D().load();let r;if(typeof e=="string"){let i=await fetch(e);if(!i.ok)return console.error(`Failed to fetch font from URL: ${e}. Status: ${i.status}`),!1;r=new Uint8Array(await i.arrayBuffer())}else e instanceof Uint8Array?r=e:r=new Uint8Array(e);let s=nt(t,r);return s||console.error(`Failed to register font "${t}". Font data may be invalid.`),s}catch(r){return console.error(`Error registering font "${t}":`,r),!1}}animationSize(){let t=this._dotLottieCore?.animation_size();return{width:t?.[0]??0,height:t?.[1]??0}}stateMachineLoad(t){return this._dotLottieCore?this._dotLottieCore.state_machine_load_from_id(t):!1}stateMachineLoadData(t){return this._dotLottieCore?this._dotLottieCore.state_machine_load(t):!1}stateMachineSetConfig(t){this._stateMachineConfig=t}stateMachineStart(){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.sm_start(this._stateMachineConfig?.openUrlPolicy?.requireUserInteraction??!0,this._stateMachineConfig?.openUrlPolicy?.whitelist??[]);return this._drainSmEvents(),t&&(this._isStateMachineRunning=!0,this._setupStateMachineListeners(),this._startAnimationLoop()),t}stateMachineStop(){if(!this._dotLottieCore)return!1;let t=this._dotLottieCore.sm_stop();return this._drainSmEvents(),t&&(this._isStateMachineRunning=!1,this._cleanupStateMachineListeners(),this._dotLottieCore.status()!==w.Playing&&this._stopAnimationLoop()),t}stateMachineGetStatus(){return this._dotLottieCore?.sm_status()??""}stateMachineGetCurrentState(){return this._dotLottieCore?.sm_current_state()??""}stateMachineGetActiveId(){return this._dotLottieCore?.state_machine_id()??""}stateMachineOverrideState(t,e=!1){return this._dotLottieCore?.sm_override_current_state(t,e)??!1}stateMachineSetSeed(t){return this._dotLottieCore?.sm_set_seed(BigInt(Math.trunc(t)))??!1}stateMachineGet(t){return this._dotLottieCore?.get_state_machine(t)??""}stateMachineGetListeners(){if(!this._dotLottieCore)return[];let t=this._dotLottieCore.sm_framework_setup();return Array.isArray(t)?t:[]}stateMachineSetBooleanInput(t,e){return this._dotLottieCore?.sm_set_boolean_input(t,e)??!1}stateMachineSetNumericInput(t,e){return this._dotLottieCore?.sm_set_numeric_input(t,e)??!1}stateMachineSetStringInput(t,e){return this._dotLottieCore?.sm_set_string_input(t,e)??!1}stateMachineGetBooleanInput(t){return this._dotLottieCore?.sm_get_boolean_input(t)??void 0}stateMachineGetNumericInput(t){return this._dotLottieCore?.sm_get_numeric_input(t)??void 0}stateMachineGetStringInput(t){return this._dotLottieCore?.sm_get_string_input(t)??void 0}stateMachineGetInputs(){if(!this._dotLottieCore)return[];let t=this._dotLottieCore.sm_get_inputs();return Array.isArray(t)?t:[]}stateMachineFireEvent(t){this._dotLottieCore?.sm_fire(t)}stateMachinePostClickEvent(t,e){this._dotLottieCore?.sm_post_click(t,e)}stateMachinePostPointerUpEvent(t,e){this._dotLottieCore?.sm_post_pointer_up(t,e)}stateMachinePostPointerDownEvent(t,e){this._dotLottieCore?.sm_post_pointer_down(t,e)}stateMachinePostPointerMoveEvent(t,e){this._dotLottieCore?.sm_post_pointer_move(t,e)}stateMachinePostPointerEnterEvent(t,e){this._dotLottieCore?.sm_post_pointer_enter(t,e)}stateMachinePostPointerExitEvent(t,e){this._dotLottieCore?.sm_post_pointer_exit(t,e)}_onClick(t){let e=I(t);e&&this.stateMachinePostClickEvent(e.x,e.y)}_onPointerUp(t){let e=I(t);e&&this.stateMachinePostPointerUpEvent(e.x,e.y)}_onPointerDown(t){let e=I(t);e&&this.stateMachinePostPointerDownEvent(e.x,e.y)}_onPointerMove(t){let e=I(t);e&&this.stateMachinePostPointerMoveEvent(e.x,e.y)}_onPointerEnter(t){let e=I(t);e&&this.stateMachinePostPointerEnterEvent(e.x,e.y)}_onPointerLeave(t){let e=I(t);e&&this.stateMachinePostPointerExitEvent(e.x,e.y)}_setupStateMachineListeners(){if(g&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieCore!==null&&this.isLoaded){let t=this.stateMachineGetListeners();this._cleanupStateMachineListeners(),t.includes("Click")&&(this._boundOnClick=this._onClick.bind(this),this._canvas.addEventListener("click",this._boundOnClick)),t.includes("PointerUp")&&(this._boundOnPointerUp=this._onPointerUp.bind(this),this._canvas.addEventListener("pointerup",this._boundOnPointerUp)),t.includes("PointerDown")&&(this._boundOnPointerDown=this._onPointerDown.bind(this),this._canvas.addEventListener("pointerdown",this._boundOnPointerDown)),t.includes("PointerMove")&&(this._boundOnPointerMove=this._onPointerMove.bind(this),this._canvas.addEventListener("pointermove",this._boundOnPointerMove)),t.includes("PointerEnter")&&(this._boundOnPointerEnter=this._onPointerEnter.bind(this),this._canvas.addEventListener("pointerenter",this._boundOnPointerEnter)),t.includes("PointerExit")&&(this._boundOnPointerLeave=this._onPointerLeave.bind(this),this._canvas.addEventListener("pointerleave",this._boundOnPointerLeave))}}_cleanupStateMachineListeners(){g&&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))}};var a=new Map,Lt={ready:n=>t=>{let e={id:"",method:"onReady",result:{instanceId:n,event:t}};self.postMessage(e)},complete:n=>t=>{let e={id:"",method:"onComplete",result:{instanceId:n,event:t}};self.postMessage(e)},load:n=>t=>{let r={id:"",method:"onLoad",result:{instanceId:n,event:t}};self.postMessage(r)},loadError:n=>t=>{let r={id:"",method:"onLoadError",result:{instanceId:n,event:t}};self.postMessage(r)},renderError:n=>t=>{let r={id:"",method:"onRenderError",result:{instanceId:n,event:t}};self.postMessage(r)},loop:n=>t=>{let r={id:"",method:"onLoop",result:{instanceId:n,event:t}};self.postMessage(r)},play:n=>t=>{let r={id:"",method:"onPlay",result:{instanceId:n,event:t}};self.postMessage(r)},pause:n=>t=>{let r={id:"",method:"onPause",result:{instanceId:n,event:t}};self.postMessage(r)},stop:n=>t=>{let r={id:"",method:"onStop",result:{instanceId:n,event:t}};self.postMessage(r)},frame:n=>t=>{let r={id:"",method:"onFrame",result:{instanceId:n,event:t}};self.postMessage(r)},render:n=>t=>{let r={id:"",method:"onRender",result:{instanceId:n,event:t}};self.postMessage(r)},freeze:n=>t=>{let r={id:"",method:"onFreeze",result:{instanceId:n,event:t}};self.postMessage(r)},unfreeze:n=>t=>{let r={id:"",method:"onUnfreeze",result:{instanceId:n,event:t}};self.postMessage(r)},destroy:n=>t=>{let r={id:"",method:"onDestroy",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStart:n=>t=>{let r={id:"",method:"onStateMachineStart",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStop:n=>t=>{let r={id:"",method:"onStateMachineStop",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineTransition:n=>t=>{let r={id:"",method:"onStateMachineTransition",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStateEntered:n=>t=>{let r={id:"",method:"onStateMachineStateEntered",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStateExit:n=>t=>{let r={id:"",method:"onStateMachineStateExit",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineCustomEvent:n=>t=>{let r={id:"",method:"onStateMachineCustomEvent",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineError:n=>t=>{let r={id:"",method:"onStateMachineError",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineBooleanInputValueChange:n=>t=>{let r={id:"",method:"onStateMachineBooleanInputValueChange",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineNumericInputValueChange:n=>t=>{let r={id:"",method:"onStateMachineNumericInputValueChange",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStringInputValueChange:n=>t=>{let r={id:"",method:"onStateMachineStringInputValueChange",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineInputFired:n=>t=>{let r={id:"",method:"onStateMachineInputFired",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineInternalMessage:n=>t=>{let r={id:"",method:"onStateMachineInternalMessage",result:{instanceId:n,event:t}};self.postMessage(r)}},K={setTransform(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setTransform(n.params.transform)},getTransform(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getTransform()},getDotLottieInstanceState(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return{state:{loopCount:e.loopCount,isLoaded:e.isLoaded,isPaused:e.isPaused,isPlaying:e.isPlaying,isStopped:e.isStopped,isFrozen:e.isFrozen,loop:e.loop,mode:e.mode,speed:e.speed,currentFrame:e.currentFrame,totalFrames:e.totalFrames,duration:e.duration,useFrameInterpolation:e.useFrameInterpolation,renderConfig:e.renderConfig,marker:e.marker,backgroundColor:e.backgroundColor,markers:e.markers(),activeAnimationId:e.activeAnimationId,activeThemeId:e.activeThemeId,autoplay:e.autoplay,segment:e.segment,layout:e.layout,isReady:e.isReady,manifest:e.manifest}}},setLayout(n){let t=n.params.instanceId,e=n.params.layout,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setLayout(e)},stateMachineGetListeners(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetListeners()},stateMachineStart(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineStart()},stateMachineStop(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineStop()},stateMachineLoad(n){let t=n.params.instanceId,e=n.params.stateMachineId,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineLoad(e)},stateMachineLoadData(n){let t=n.params.instanceId,e=n.params.stateMachineData,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineLoadData(e)},stateMachinePostClickEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachinePostClickEvent(e,r)},stateMachinePostPointerUpEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachinePostPointerUpEvent(e,r)},stateMachinePostPointerDownEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachinePostPointerDownEvent(e,r)},stateMachinePostPointerMoveEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachinePostPointerMoveEvent(e,r)},stateMachinePostPointerEnterEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachinePostPointerEnterEvent(e,r)},stateMachinePostPointerExitEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachinePostPointerExitEvent(e,r)},stateMachineSetNumericInput:n=>{let t=n.params.instanceId,e=n.params.name,r=n.params.value,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachineSetNumericInput(e,r)},stateMachineSetBooleanInput:n=>{let t=n.params.instanceId,e=n.params.name,r=n.params.value,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachineSetBooleanInput(e,r)},stateMachineSetConfig:n=>{let t=n.params.instanceId,e=n.params.config,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.stateMachineSetConfig(e)},stateMachineSetStringInput:n=>{let t=n.params.instanceId,e=n.params.name,r=n.params.value,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachineSetStringInput(e,r)},stateMachineGetNumericInput:n=>{let t=n.params.instanceId,e=n.params.name,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineGetNumericInput(e)},stateMachineGetBooleanInput:n=>{let t=n.params.instanceId,e=n.params.name,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineGetBooleanInput(e)},stateMachineGetStringInput:n=>{let t=n.params.instanceId,e=n.params.name,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineGetStringInput(e)},stateMachineGetInputs:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetInputs()},stateMachineFireEvent:n=>{let t=n.params.instanceId,e=n.params.name,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineFireEvent(e)},stateMachineGetStatus:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetStatus()},stateMachineGetCurrentState:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetCurrentState()},stateMachineGetActiveId:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetActiveId()},stateMachineOverrideState:n=>{let t=n.params.instanceId,e=n.params.state,r=n.params.immediate,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);return s.stateMachineOverrideState(e,r)},stateMachineSetSeed:n=>{let t=n.params.instanceId,e=n.params.seed,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineSetSeed(e)},stateMachineGet:n=>{let t=n.params.instanceId,e=n.params.stateMachineId,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineGet(e)},create:n=>{let t=n.params.instanceId,e=n.params.config,r=n.params.width,s=n.params.height;if(a.has(t))throw new Error(`Instance with id ${t} already exists.`);let i=new S(e);return i.canvas&&(i.canvas.height=s,i.canvas.width=r),a.set(t,i),["complete","frame","load","loadError","renderError","loop","pause","play","stop","destroy","freeze","unfreeze","render","ready","stateMachineStart","stateMachineStop","stateMachineTransition","stateMachineStateEntered","stateMachineStateExit","stateMachineCustomEvent","stateMachineError","stateMachineBooleanInputValueChange","stateMachineNumericInputValueChange","stateMachineStringInputValueChange","stateMachineInputFired","stateMachineInternalMessage"].forEach(d=>{i.addEventListener(d,Lt[d](t))}),{instanceId:t}},destroy:n=>{let t=n.params.instanceId,e=a.get(t);e&&(e.destroy(),a.delete(t))},freeze:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.freeze()},load:n=>{let t=n.params.instanceId,e=n.params.config,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.load(e)},loadAnimation:n=>{let t=n.params.instanceId,e=n.params.animationId,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.loadAnimation(e)},setTheme:n=>{let t=n.params.instanceId,e=n.params.themeId,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.setTheme(e)},setThemeData:n=>{let t=n.params.instanceId,e=n.params.themeData,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.setThemeData(e)},pause:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.pause()},play:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.play()},registerFont:async n=>{let{fontName:t,fontSource:e}=n.params;return S.registerFont(t,e)},resize:n=>{let t=n.params.instanceId,e=n.params.width,r=n.params.height,s=a.get(t);if(!s)throw new Error(`Instance with id ${t} does not exist.`);s.canvas&&(s.canvas.height=r,s.canvas.width=e),s.resize()},setBackgroundColor:n=>{let t=n.params.instanceId,e=n.params.backgroundColor,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setBackgroundColor(e)},setSlots:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.setSlots(n.params.slots)},getSlotIds:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getSlotIds()},getSlotType:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getSlotType(n.params.slotId)},getSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getSlot(n.params.slotId)},getSlots:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getSlots()},setColorSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setColorSlot(n.params.slotId,n.params.value)},setScalarSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setScalarSlot(n.params.slotId,n.params.value)},setVectorSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setVectorSlot(n.params.slotId,n.params.value)},setGradientSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setGradientSlot(n.params.slotId,n.params.value,n.params.colorStopCount)},setTextSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setTextSlot(n.params.slotId,n.params.value)},setImageSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setImageSlot(n.params.slotId,n.params.src)},resetSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.resetSlot(n.params.slotId)},clearSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.clearSlot(n.params.slotId)},resetSlots:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.resetSlots()},clearSlots:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.clearSlots()},setFrame:n=>{let t=n.params.instanceId,e=n.params.frame,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setFrame(e)},setMode:n=>{let t=n.params.instanceId,e=n.params.mode,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setMode(e)},setRenderConfig:n=>{let t=n.params.instanceId,e=n.params.renderConfig,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setRenderConfig(e)},setSegment:n=>{let t=n.params.instanceId,e=n.params.segment,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setSegment(e[0],e[1])},resetSegment:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.resetSegment()},setSpeed:n=>{let t=n.params.instanceId,e=n.params.speed,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setSpeed(e)},setUseFrameInterpolation:n=>{let t=n.params.instanceId,e=n.params.useFrameInterpolation,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setUseFrameInterpolation(e)},setWasmUrl:n=>{S.setWasmUrl(n.params.url)},stop:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.stop()},unfreeze:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.unfreeze()},setViewport(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,s=n.params.width,i=n.params.height,_=a.get(t);if(!_)throw new Error(`Instance with id ${t} does not exist.`);return _.setViewport(e,r,s,i)},animationSize(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);let{height:r,width:s}=e.animationSize();return{height:r,width:s}},setMarker(n){let t=n.params.instanceId,e=n.params.marker,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setMarker(e)},setLoop(n){let t=n.params.instanceId,e=n.params.loop,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setLoop(e)},setLoopCount(n){let t=n.params.instanceId,e=n.params.loopCount,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setLoopCount(e)}};function It(n){let t=n.method;if(Object.hasOwn(K,t)&&typeof K[t]=="function")return K[t](n);throw new Error(`Method ${String(t)} is not implemented in commands.`)}self.onmessage=async n=>{try{let t=await It(n.data),e={id:n.data.id,method:n.data.method,result:t};self.postMessage(e)}catch(t){let e={id:n.data.id,method:n.data.method,error:t.message};self.postMessage(e)}};var St="",qt=St;})();\n'],{type:`application/javascript`}),t=URL.createObjectURL(e),n=new Worker(t);return URL.revokeObjectURL(t),n}},fe=class{constructor(){r(this,`_workers`,new Map),r(this,`_animationWorkerMap`,new Map),r(this,`_eventHandlers`,new Map),r(this,`_rpcHandlers`,new Map),r(this,`_routeMessage`,e=>{let t=e.data;if(t.id){let n=this._rpcHandlers.get(t.id);n&&n(e);return}let n=t.result?.instanceId;if(n){let t=this._eventHandlers.get(n);t&&t(e)}})}getWorker(e){let t=this._workers.get(e);return t||(t=new de,t.addEventListener(`message`,this._routeMessage),this._workers.set(e,t)),t}assignAnimationToWorker(e,t){this._animationWorkerMap.set(e,t)}unassignAnimationFromWorker(e){this._animationWorkerMap.delete(e)}sendMessage(e,t,n){this.getWorker(e).postMessage(t,n||[])}broadcastMessage(e,t){this._workers.forEach(n=>{n.postMessage(e,t||[])})}terminateWorker(e){let t=this._workers.get(e);t&&(t.removeEventListener(`message`,this._routeMessage),t.terminate(),this._workers.delete(e))}registerEventHandler(e,t){this._eventHandlers.set(e,t)}unregisterEventHandler(e){this._eventHandlers.delete(e)}registerRpcReplyHandler(e,t){this._rpcHandlers.set(e,t)}unregisterRpcReplyHandler(e){this._rpcHandlers.delete(e)}};function J(e,t){if(typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement){let{height:n,width:r}=e.getBoundingClientRect();if(n!==0&&r!==0)return{width:r*t,height:n*t}}return{width:e.width,height:e.height}}function Y(){return Date.now().toString(36)+Math.random().toString(36).substr(2,9)}let X=null;function Z(){return X??(X=new fe),X}let Q=``;const $=new Map;var pe=class{constructor(e){if(r(this,`_eventManager`,new j),r(this,`_id`,void 0),r(this,`_workerId`,void 0),r(this,`_worker`,void 0),r(this,`_canvas`,void 0),r(this,`_dotLottieInstanceState`,{loopCount:0,markers:[],autoplay:!1,backgroundColor:``,currentFrame:0,duration:0,loop:!1,mode:`forward`,segment:[0,0],speed:1,totalFrames:0,isLoaded:!1,isPlaying:!1,isPaused:!1,isStopped:!0,isFrozen:!1,useFrameInterpolation:!1,renderConfig:{devicePixelRatio:z()},activeAnimationId:``,activeThemeId:``,layout:void 0,marker:``,isReady:!1,manifest:null}),r(this,`_created`,!1),r(this,`_retired`,!1),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,`_pendingConfig`,null),e.canvas){let t=typeof HTMLCanvasElement<`u`&&e.canvas instanceof HTMLCanvasElement,n=typeof OffscreenCanvas<`u`&&e.canvas instanceof OffscreenCanvas;if(!t&&!n)throw Error(`Worker-based DotLottie requires HTMLCanvasElement or OffscreenCanvas`)}this._canvas=e.canvas??null,this._id=`dotlottie-${Y()}`,this._workerId=e.workerId||`defaultWorker`,this._worker=Z().getWorker(this._workerId),Z().assignAnimationToWorker(this._id,this._workerId),Q&&this._sendMessage(`setWasmUrl`,{url:Q});let t={...e,renderConfig:{...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||z(),freezeOnOffscreen:e.renderConfig?.freezeOnOffscreen??!0}};this._pendingConfig=t,this._canvas&&(this._create(t),this._pendingConfig=null),Z().registerEventHandler(this._id,this._handleWorkerEvent.bind(this))}async _handleWorkerEvent(e){let t=e.data;if(!t.id&&(t.method===`onLoad`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event),s&&this._canvas instanceof HTMLCanvasElement&&(this._dotLottieInstanceState.renderConfig.freezeOnOffscreen&&(M.observe(this._canvas,this),B(this._canvas)||await this.freeze()),this._dotLottieInstanceState.renderConfig.autoResize&&N.observe(this._canvas,this))),t.method===`onComplete`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onDestroy`&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),t.method===`onUnfreeze`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._dotLottieInstanceState.isFrozen=!1,this._eventManager.dispatch(t.result.event)),t.method===`onFrame`&&t.result.instanceId===this._id&&(this._dotLottieInstanceState.currentFrame=t.result.event.currentFrame,this._eventManager.dispatch(t.result.event)),t.method===`onRender`&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),t.method===`onFreeze`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onPause`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onPlay`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStop`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onLoadError`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onRenderError`&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),t.method===`onReady`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onLoop`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStart`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._setupStateMachineListeners(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStop`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._cleanupStateMachineListeners(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineTransition`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStateEntered`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStateExit`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineCustomEvent`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineError`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineBooleanInputValueChange`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineNumericInputValueChange`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineStringInputValueChange`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineInputFired`&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method===`onStateMachineInternalMessage`&&t.result.instanceId===this._id)){await this._updateDotLottieInstanceState();let e=t.result.event;e.message.startsWith(`OpenUrl: `)&&U(e.message)}}async _create(e){if(!this._canvas)return;let t;if(this._canvas instanceof HTMLCanvasElement){let n=$.get(this._canvas);if(n&&n.workerId===this._workerId){await this._adopt(n,e);return}t=this._canvas.transferControlToOffscreen(),$.set(this._canvas,{destroyTimer:null,facade:this,instanceId:this._id,workerId:this._workerId})}else t=this._canvas;let{instanceId:n}=await this._sendMessage(`create`,{instanceId:this._id,config:{...e,canvas:t},...J(this._canvas,e.renderConfig?.devicePixelRatio||z())},[t]);if(n!==this._id)throw Error(`Instance ID mismatch`);this._retired||(this._created=!0,await this._updateDotLottieInstanceState())}async _adopt(e,t){e.destroyTimer===null?e.facade._retire():(clearTimeout(e.destroyTimer),e.destroyTimer=null),Z().unassignAnimationFromWorker(this._id),this._id=e.instanceId,Z().assignAnimationToWorker(this._id,this._workerId),e.facade=this,this._created=!0;let{canvas:n,...r}=t;await this._sendMessage(`load`,{config:r,instanceId:this._id}),await this._updateDotLottieInstanceState()}_retire(){this._retired=!0,this._created&&(this._created=!1,this._cleanupStateMachineListeners(),this._eventManager.dispatch({type:`destroy`}),this._eventManager.removeAllEventListeners(),s&&this._canvas instanceof HTMLCanvasElement&&(M.unobserve(this._canvas),N.unobserve(this._canvas)))}get loopCount(){return this._dotLottieInstanceState.loopCount}get isLoaded(){return this._dotLottieInstanceState.isLoaded}get isPlaying(){return this._dotLottieInstanceState.isPlaying}get isPaused(){return this._dotLottieInstanceState.isPaused}get isStopped(){return this._dotLottieInstanceState.isStopped}get currentFrame(){return this._dotLottieInstanceState.currentFrame}get isFrozen(){return this._dotLottieInstanceState.isFrozen}get totalFrames(){return this._dotLottieInstanceState.totalFrames}get segment(){return this._dotLottieInstanceState.segment}get speed(){return this._dotLottieInstanceState.speed}get duration(){return this._dotLottieInstanceState.duration}get isReady(){return this._dotLottieInstanceState.isReady}get mode(){return this._dotLottieInstanceState.mode}get canvas(){return this._canvas}async setCanvas(e){let t=typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement,n=typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas;if(!t&&!n)throw Error(`Worker-based DotLottie requires HTMLCanvasElement or OffscreenCanvas`);if(this._canvas!==e){if(this._created&&this._canvas!==null)throw Error(`Cannot change canvas after worker instance is already created with a different canvas.`);this._canvas=e,!this._created&&this._pendingConfig&&(await this._create(this._pendingConfig),this._pendingConfig=null)}}get autoplay(){return this._dotLottieInstanceState.autoplay}get backgroundColor(){return this._dotLottieInstanceState.backgroundColor}get loop(){return this._dotLottieInstanceState.loop}get useFrameInterpolation(){return this._dotLottieInstanceState.useFrameInterpolation}get renderConfig(){return this._dotLottieInstanceState.renderConfig}get manifest(){return this._dotLottieInstanceState.manifest}get activeAnimationId(){return this._dotLottieInstanceState.activeAnimationId}get marker(){return this._dotLottieInstanceState.marker}get activeThemeId(){return this._dotLottieInstanceState.activeThemeId}get layout(){return this._dotLottieInstanceState.layout}async play(){this._created&&(await this._sendMessage(`play`,{instanceId:this._id}),await this._updateDotLottieInstanceState(),s&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieInstanceState.renderConfig.freezeOnOffscreen&&!B(this._canvas)&&await this.freeze())}async pause(){this._created&&(await this._sendMessage(`pause`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async stop(){this._created&&(await this._sendMessage(`stop`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async setSpeed(e){this._created&&(await this._sendMessage(`setSpeed`,{instanceId:this._id,speed:e}),await this._updateDotLottieInstanceState())}async setMode(e){this._created&&(await this._sendMessage(`setMode`,{instanceId:this._id,mode:e}),await this._updateDotLottieInstanceState())}async setFrame(e){this._created&&(await this._sendMessage(`setFrame`,{frame:e,instanceId:this._id}),await this._updateDotLottieInstanceState())}async setSegment(e,t){this._created&&(await this._sendMessage(`setSegment`,{instanceId:this._id,segment:[e,t]}),await this._updateDotLottieInstanceState())}async resetSegment(){this._created&&(await this._sendMessage(`resetSegment`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async setRenderConfig(e){if(!this._created)return;let{devicePixelRatio:t,freezeOnOffscreen:n,quality:r,...i}=e;await this._sendMessage(`setRenderConfig`,{instanceId:this._id,renderConfig:{...this._dotLottieInstanceState.renderConfig,...i,devicePixelRatio:t||z(),freezeOnOffscreen:n??!0,...r!==void 0&&{quality:r}}}),await this._updateDotLottieInstanceState(),s&&this._canvas instanceof HTMLCanvasElement&&(this._dotLottieInstanceState.renderConfig.autoResize?N.observe(this._canvas,this):N.unobserve(this._canvas),this._dotLottieInstanceState.renderConfig.freezeOnOffscreen?(M.observe(this._canvas,this),B(this._canvas)||await this.freeze()):(M.unobserve(this._canvas),this._dotLottieInstanceState.isFrozen&&await this.unfreeze()))}async setUseFrameInterpolation(e){this._created&&(await this._sendMessage(`setUseFrameInterpolation`,{instanceId:this._id,useFrameInterpolation:e}),await this._updateDotLottieInstanceState())}async setTheme(e){if(!this._created)return!1;let t=await this._sendMessage(`setTheme`,{instanceId:this._id,themeId:e});return await this._updateDotLottieInstanceState(),t}async load(e){if(!this._created){this._pendingConfig&&(this._pendingConfig={...this._pendingConfig,...e});return}await this._sendMessage(`load`,{config:e,instanceId:this._id}),await this._updateDotLottieInstanceState()}async setLoop(e){this._created&&(await this._sendMessage(`setLoop`,{instanceId:this._id,loop:e}),await this._updateDotLottieInstanceState())}async setLoopCount(e){this._created&&(await this._sendMessage(`setLoopCount`,{instanceId:this._id,loopCount:e}),await this._updateDotLottieInstanceState())}async resize(){if(!this._created||!this._canvas)return;let{height:e,width:t}=J(this._canvas,this._dotLottieInstanceState.renderConfig.devicePixelRatio||z());await this._sendMessage(`resize`,{height:e,instanceId:this._id,width:t}),await this._updateDotLottieInstanceState()}async destroy(){if(!this._created)return;let e=this._canvas,t=e instanceof HTMLCanvasElement?$.get(e):void 0;this._retire(),t&&t.facade===this?t.destroyTimer=setTimeout(()=>{$.delete(e),this._finalizeDestroy()},0):await this._finalizeDestroy()}async _finalizeDestroy(){Z().unregisterEventHandler(this._id),Z().unassignAnimationFromWorker(this._id),await this._sendMessage(`destroy`,{instanceId:this._id})}async freeze(){this._created&&(await this._sendMessage(`freeze`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async unfreeze(){this._created&&(await this._sendMessage(`unfreeze`,{instanceId:this._id}),await this._updateDotLottieInstanceState())}async setBackgroundColor(e){this._created&&(await this._sendMessage(`setBackgroundColor`,{instanceId:this._id,backgroundColor:e}),await this._updateDotLottieInstanceState())}async loadAnimation(e){this._created&&(await this._sendMessage(`loadAnimation`,{animationId:e,instanceId:this._id}),await this._updateDotLottieInstanceState())}async setLayout(e){this._created&&(await this._sendMessage(`setLayout`,{instanceId:this._id,layout:e}),await this._updateDotLottieInstanceState())}async setSlots(e){this._created&&await this._sendMessage(`setSlots`,{instanceId:this._id,slots:e})}async getSlotIds(){return this._created?this._sendMessage(`getSlotIds`,{instanceId:this._id}):[]}async getSlotType(e){if(this._created)return this._sendMessage(`getSlotType`,{instanceId:this._id,slotId:e})}async getSlot(e){if(this._created)return this._sendMessage(`getSlot`,{instanceId:this._id,slotId:e})}async getSlots(){return this._created?this._sendMessage(`getSlots`,{instanceId:this._id}):{}}async setColorSlot(e,t){return this._created?this._sendMessage(`setColorSlot`,{instanceId:this._id,slotId:e,value:t}):!1}async setScalarSlot(e,t){return this._created?this._sendMessage(`setScalarSlot`,{instanceId:this._id,slotId:e,value:t}):!1}async setVectorSlot(e,t){return this._created?this._sendMessage(`setVectorSlot`,{instanceId:this._id,slotId:e,value:t}):!1}async setGradientSlot(e,t,n){return this._created?this._sendMessage(`setGradientSlot`,{instanceId:this._id,slotId:e,value:t,colorStopCount:n}):!1}async setTextSlot(e,t){return this._created?this._sendMessage(`setTextSlot`,{instanceId:this._id,slotId:e,value:t}):!1}async setImageSlot(e,t){if(!this._created)return!1;let n=await H(t);return this._sendMessage(`setImageSlot`,{instanceId:this._id,slotId:e,src:n})}async resetSlot(e){return this._created?this._sendMessage(`resetSlot`,{instanceId:this._id,slotId:e}):!1}async clearSlot(e){return this._created?this._sendMessage(`clearSlot`,{instanceId:this._id,slotId:e}):!1}async resetSlots(){return this._created?this._sendMessage(`resetSlots`,{instanceId:this._id}):!1}async clearSlots(){return this._created?this._sendMessage(`clearSlots`,{instanceId:this._id}):!1}async _updateDotLottieInstanceState(){if(!this._created)return;let e=await this._sendMessage(`getDotLottieInstanceState`,{instanceId:this._id});this._dotLottieInstanceState=e.state}markers(){return this._dotLottieInstanceState.markers}async setMarker(e){this._created&&(await this._sendMessage(`setMarker`,{instanceId:this._id,marker:e}),await this._updateDotLottieInstanceState())}async setThemeData(e){if(!this._created)return!1;let t=await this._sendMessage(`setThemeData`,{instanceId:this._id,themeData:e});return await this._updateDotLottieInstanceState(),t}async setViewport(e,t,n,r){return this._created?this._sendMessage(`setViewport`,{x:e,y:t,width:n,height:r,instanceId:this._id}):!1}async animationSize(){return this._created?this._sendMessage(`animationSize`,{instanceId:this._id}):{height:0,width:0}}async setTransform(e){return this._created?this._sendMessage(`setTransform`,{instanceId:this._id,transform:e}):!1}async getTransform(){if(this._created)return this._sendMessage(`getTransform`,{instanceId:this._id})}async _sendMessage(e,t,n){let r={id:`dotlottie-request-${Y()}`,method:e,params:t};return new Promise((t,i)=>{Z().registerRpcReplyHandler(r.id,n=>{Z().unregisterRpcReplyHandler(r.id);let a=n.data;a.error?i(Error(`Failed to execute method ${e}: ${a.error}`)):t(a.result)}),this._worker.postMessage(r,n||[])})}addEventListener(e,t){this._eventManager.addEventListener(e,t)}removeEventListener(e,t){this._eventManager.removeEventListener(e,t)}static setWasmUrl(e){Q=e}static async registerFont(e,t){try{let n=Y();return Z().broadcastMessage({id:n,method:`registerFont`,params:{fontName:e,fontSource:t}}),!0}catch(t){return console.error(`Error broadcasting registerFont for "${e}":`,t),!1}}async stateMachineLoad(e){if(!this._created)return!1;let t=await this._sendMessage(`stateMachineLoad`,{instanceId:this._id,stateMachineId:e});return await this._updateDotLottieInstanceState(),t}async stateMachineLoadData(e){if(!this._created)return!1;let t=await this._sendMessage(`stateMachineLoadData`,{instanceId:this._id,stateMachineData:e});return await this._updateDotLottieInstanceState(),t}async stateMachineStart(){if(!this._created)return!1;let e=await this._sendMessage(`stateMachineStart`,{instanceId:this._id});return e&&(this._setupStateMachineListeners(),await this._updateDotLottieInstanceState()),e}async stateMachineStop(){return this._created?(this._cleanupStateMachineListeners(),this._sendMessage(`stateMachineStop`,{instanceId:this._id})):!1}async stateMachineSetNumericInput(e,t){return this._created?this._sendMessage(`stateMachineSetNumericInput`,{instanceId:this._id,name:e,value:t}):!1}async stateMachineSetBooleanInput(e,t){return this._created?this._sendMessage(`stateMachineSetBooleanInput`,{instanceId:this._id,name:e,value:t}):!1}async stateMachineSetConfig(e){this._created&&this._sendMessage(`stateMachineSetConfig`,{instanceId:this._id,config:e})}async stateMachineSetStringInput(e,t){return this._created?this._sendMessage(`stateMachineSetStringInput`,{instanceId:this._id,name:e,value:t}):!1}async stateMachineGetNumericInput(e){if(this._created)return this._sendMessage(`stateMachineGetNumericInput`,{instanceId:this._id,name:e})}async stateMachineGetBooleanInput(e){if(this._created)return this._sendMessage(`stateMachineGetBooleanInput`,{instanceId:this._id,name:e})}async stateMachineGetStringInput(e){if(this._created)return this._sendMessage(`stateMachineGetStringInput`,{instanceId:this._id,name:e})}async stateMachineGetInputs(){if(this._created)return this._sendMessage(`stateMachineGetInputs`,{instanceId:this._id})}async stateMachineFireEvent(e){this._created&&this._sendMessage(`stateMachineFireEvent`,{instanceId:this._id,name:e})}async stateMachineGetStatus(){return this._created?this._sendMessage(`stateMachineGetStatus`,{instanceId:this._id}):``}async stateMachineGetCurrentState(){return this._created?this._sendMessage(`stateMachineGetCurrentState`,{instanceId:this._id}):``}async stateMachineGetActiveId(){return this._created?this._sendMessage(`stateMachineGetActiveId`,{instanceId:this._id}):``}async stateMachineOverrideState(e,t=!1){return this._created?this._sendMessage(`stateMachineOverrideState`,{instanceId:this._id,state:e,immediate:t}):!1}async stateMachineSetSeed(e){return this._created?this._sendMessage(`stateMachineSetSeed`,{instanceId:this._id,seed:e}):!1}async stateMachineGet(e){return this._created?this._sendMessage(`stateMachineGet`,{instanceId:this._id,stateMachineId:e}):``}async stateMachineGetListeners(){return this._created?this._sendMessage(`stateMachineGetListeners`,{instanceId:this._id}):[]}async stateMachinePostClickEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostClickEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerUpEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerUpEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerDownEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerDownEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerMoveEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerMoveEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerEnterEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerEnterEvent`,{instanceId:this._id,x:e,y:t})}async stateMachinePostPointerExitEvent(e,t){if(this._created)return this._sendMessage(`stateMachinePostPointerExitEvent`,{instanceId:this._id,x:e,y:t})}_onClick(e){let t=V(e);t&&this._sendMessage(`stateMachinePostClickEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerUp(e){let t=V(e);t&&this._sendMessage(`stateMachinePostPointerUpEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerDown(e){let t=V(e);t&&this._sendMessage(`stateMachinePostPointerDownEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerMove(e){let t=V(e);t&&this._sendMessage(`stateMachinePostPointerMoveEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerEnter(e){let t=V(e);t&&this._sendMessage(`stateMachinePostPointerEnterEvent`,{instanceId:this._id,x:t.x,y:t.y})}_onPointerLeave(e){let t=V(e);t&&this._sendMessage(`stateMachinePostPointerExitEvent`,{instanceId:this._id,x:t.x,y:t.y})}async _setupStateMachineListeners(){if(s&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded){let e=await this._sendMessage(`stateMachineGetListeners`,{instanceId:this._id});if(e.length===0)return;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))}};exports.DotLottie=ue,exports.DotLottieWorker=pe;
6
6
  //# sourceMappingURL=index.cjs.map