@lottiefiles/dotlottie-web 0.73.0 → 0.74.0

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.
@@ -1,4 +1,4 @@
1
- const e=typeof window<`u`&&window.document!==void 0,t=new Uint8Array([80,75,3,4]),n=[`v`,`ip`,`op`,`layers`,`fr`,`w`,`h`],r=`0.73.0`,i=`@lottiefiles/dotlottie-web`;function a(e){"@babel/helpers - typeof";return a=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},a(e)}function o(e,t){if(a(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(a(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ee(e){var t=o(e,`string`);return a(t)==`symbol`?t:t+``}function s(e,t,n){return(t=ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var te=class{requestAnimationFrame(e){return requestAnimationFrame(e)}cancelAnimationFrame(e){cancelAnimationFrame(e)}},ne=class{constructor(){s(this,`_lastHandleId`,0),s(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)}},re=class{constructor(){s(this,`_strategy`,void 0),this._strategy=typeof requestAnimationFrame==`function`?new te:new ne}requestAnimationFrame(e){return this._strategy.requestAnimationFrame(e)}cancelAnimationFrame(e){this._strategy.cancelAnimationFrame(e)}};let c;const l=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&l.decode();let u=null;function d(){return(u===null||u.byteLength===0)&&(u=new Uint8Array(c.memory.buffer)),u}function f(e,t){return e>>>=0,l.decode(d().subarray(e,e+t))}function ie(e){let t=c.__externref_table_alloc_command_export();return c.__wbindgen_export_3.set(t,e),t}function ae(e,t){try{return e.apply(this,t)}catch(e){let t=ie(e);c.__wbindgen_exn_store_command_export(t)}}let p=0;const m=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},oe=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 d().subarray(r,r+n.length).set(n),p=n.length,r}let r=e.length,i=t(r,1)>>>0,a=d(),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=d().subarray(i+o,i+r),a=oe(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return p=o,i}let g=null;function _(){return(g===null||g.buffer.detached===!0||g.buffer.detached===void 0&&g.buffer!==c.memory.buffer)&&(g=new DataView(c.memory.buffer)),g}function se(e){return e==null}let v=null;function ce(){return(v===null||v.byteLength===0)&&(v=new Float32Array(c.memory.buffer)),v}function le(e,t){let n=t(e.length*4,4)>>>0;return ce().set(e,n/4),p=e.length,n}function y(e,t){let n=t(e.length*1,1)>>>0;return d().set(e,n/1),p=e.length,n}function ue(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=ie(e[t]);_().setUint32(n+4*t,r,!0)}return p=e.length,n}function de(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p,i=y(t,c.__wbindgen_malloc_command_export),a=p;return c.register_font(n,r,i,a)!==0}const b=Object.freeze({Forward:0,0:`Forward`,Reverse:1,1:`Reverse`,Bounce:2,2:`Bounce`,ReverseBounce:3,3:`ReverseBounce`}),fe=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>c.__wbg_dotlottieplayerwasm_free(e>>>0,1));var pe=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,fe.unregister(this),e}free(){let e=this.__destroy_into_raw();c.__wbg_dotlottieplayerwasm_free(e,0)}clear_slot(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,t,n)!==0}is_playing(){return c.dotlottieplayerwasm_is_playing(this.__wbg_ptr)!==0}is_stopped(){return c.dotlottieplayerwasm_is_stopped(this.__wbg_ptr)!==0}layout_fit(){let e,t;try{let n=c.dotlottieplayerwasm_layout_fit(this.__wbg_ptr);return e=n[0],t=n[1],f(n[0],n[1])}finally{c.__wbindgen_free_command_export(e,t,1)}}loop_count(){return c.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){return c.dotlottieplayerwasm_poll_event(this.__wbg_ptr)}reset_slot(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,t,n)!==0}set_layout(e,t,n){let r=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),i=p;return c.dotlottieplayerwasm_set_layout(this.__wbg_ptr,r,i,t,n)!==0}set_marker(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;c.dotlottieplayerwasm_set_marker(this.__wbg_ptr,t,n)}clear_slots(){return c.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)!==0}is_complete(){return c.dotlottieplayerwasm_is_complete(this.__wbg_ptr)!==0}is_tweening(){return c.dotlottieplayerwasm_is_tweening(this.__wbg_ptr)!==0}reset_slots(){return c.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)!==0}reset_theme(){return c.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)!==0}segment_end(){return c.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_quality(e){return c.dotlottieplayerwasm_set_quality(this.__wbg_ptr,e)!==0}set_segment(e,t){return c.dotlottieplayerwasm_set_segment(this.__wbg_ptr,e,t)!==0}static unload_font(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_unload_font(t,n)!==0}animation_id(){let e=c.dotlottieplayerwasm_animation_id(this.__wbg_ptr),t;return e[0]!==0&&(t=f(e[0],e[1]).slice(),c.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}audio_volume(){return c.dotlottieplayerwasm_audio_volume(this.__wbg_ptr)}background_a(){return c.dotlottieplayerwasm_background_a(this.__wbg_ptr)}background_b(){return c.dotlottieplayerwasm_background_b(this.__wbg_ptr)}background_g(){return c.dotlottieplayerwasm_background_g(this.__wbg_ptr)}background_r(){return c.dotlottieplayerwasm_background_r(this.__wbg_ptr)}clear_marker(){c.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}emit_on_loop(){c.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}get_slot_ids(){return c.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr)}get_slot_str(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p,r=c.dotlottieplayerwasm_get_slot_str(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=f(r[0],r[1]).slice(),c.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}marker_names(){return c.dotlottieplayerwasm_marker_names(this.__wbg_ptr)}set_autoplay(e){c.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,e)}set_slot_str(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p,i=h(t,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),a=p;return c.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,n,r,i,a)!==0}set_viewport(e,t,n,r){return c.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,e,t,n,r)!==0}total_frames(){return c.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}clear_segment(){return c.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)!==0}current_frame(){return c.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}get_slot_type(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p,r=c.dotlottieplayerwasm_get_slot_type(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=f(r[0],r[1]).slice(),c.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}get_slots_str(){let e,t;try{let n=c.dotlottieplayerwasm_get_slots_str(this.__wbg_ptr);return e=n[0],t=n[1],f(n[0],n[1])}finally{c.__wbindgen_free_command_export(e,t,1)}}get_transform(){return c.dotlottieplayerwasm_get_transform(this.__wbg_ptr)}segment_start(){return c.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,t,n)!==0}set_text_slot(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p,i=h(t,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),a=p;return c.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,n,r,i,a)!==0}set_transform(e){let t=le(e,c.__wbindgen_malloc_command_export),n=p;return c.dotlottieplayerwasm_set_transform(this.__wbg_ptr,t,n)!==0}sm_get_inputs(){return c.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr)}sm_poll_event(){return c.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr)}sm_post_click(e,t){c.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,e,t)}animation_size(){return c.dotlottieplayerwasm_animation_size(this.__wbg_ptr)}current_marker(){let e=c.dotlottieplayerwasm_current_marker(this.__wbg_ptr),t;return e[0]!==0&&(t=f(e[0],e[1]).slice(),c.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}layout_align_x(){return c.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return c.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}load_animation(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_load_animation(this.__wbg_ptr,t,n)!==0}loop_animation(){return c.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)!==0}set_background(e,t,n,r){return c.dotlottieplayerwasm_set_background(this.__wbg_ptr,e,t,n,r)!==0}set_color_slot(e,t,n,r){let i=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),a=p;return c.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,a,t,n,r)!==0}set_loop_count(e){c.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,e)}set_theme_data(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,t,n)!==0}sm_reset_input(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;c.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,t,n)}manifest_string(){let e,t;try{let n=c.dotlottieplayerwasm_manifest_string(this.__wbg_ptr);return e=n[0],t=n[1],f(n[0],n[1])}finally{c.__wbindgen_free_command_export(e,t,1)}}set_scalar_slot(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p;return c.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,n,r,t)!==0}set_vector_slot(e,t,n){let r=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),i=p;return c.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,r,i,t,n)!==0}setup_sw_target(e,t){return c.dotlottieplayerwasm_setup_sw_target(this.__wbg_ptr,e,t)!==0}get_pixel_buffer(){return c.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr)}set_audio_volume(e){c.dotlottieplayerwasm_set_audio_volume(this.__wbg_ptr,e)}sm_current_state(){let e,t;try{let n=c.dotlottieplayerwasm_sm_current_state(this.__wbg_ptr);return e=n[0],t=n[1],f(n[0],n[1])}finally{c.__wbindgen_free_command_export(e,t,1)}}state_machine_id(){let e=c.dotlottieplayerwasm_state_machine_id(this.__wbg_ptr),t;return e[0]!==0&&(t=f(e[0],e[1]).slice(),c.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}get_state_machine(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p,r=c.dotlottieplayerwasm_get_state_machine(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=f(r[0],r[1]).slice(),c.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}set_position_slot(e,t,n){let r=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),i=p;return c.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,r,i,t,n)!==0}current_loop_count(){return c.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}sm_framework_setup(){return c.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr)}sm_post_pointer_up(e,t){c.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,e,t)}state_machine_load(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,t,n)!==0}load_dotlottie_data(e){let t=y(e,c.__wbindgen_malloc_command_export),n=p;return c.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,t,n)!==0}sm_get_string_input(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p,r=c.dotlottieplayerwasm_sm_get_string_input(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=f(r[0],r[1]).slice(),c.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}sm_set_string_input(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p,i=h(t,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),a=p;return c.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,n,r,i,a)!==0}sm_get_boolean_input(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p,r=c.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,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p,r=c.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,t,n);return r===4294967297?void 0:r}sm_post_pointer_down(e,t){c.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,e,t)}sm_post_pointer_exit(e,t){c.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,e,t)}sm_post_pointer_move(e,t){c.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,e,t)}sm_set_boolean_input(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p;return c.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,n,r,t)!==0}sm_set_numeric_input(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p;return c.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,n,r,t)!==0}state_machine_unload(){c.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_post_pointer_enter(e,t){c.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,e,t)}load_animation_from_id(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,t,n)!==0}sm_poll_internal_event(){return c.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr)}use_frame_interpolation(){return c.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)!==0}reset_current_loop_count(){c.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}sm_override_current_state(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p;return c.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,n,r,t)!==0}state_machine_load_from_id(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_state_machine_load_from_id(this.__wbg_ptr,t,n)!==0}set_use_frame_interpolation(e){c.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,e)}constructor(){let e=c.dotlottieplayerwasm_new();return this.__wbg_ptr=e>>>0,fe.register(this,this.__wbg_ptr,this),this}mode(){return c.dotlottieplayerwasm_mode(this.__wbg_ptr)}play(){return c.dotlottieplayerwasm_play(this.__wbg_ptr)!==0}stop(){return c.dotlottieplayerwasm_stop(this.__wbg_ptr)!==0}tick(e){return c.dotlottieplayerwasm_tick(this.__wbg_ptr,e)!==0}pause(){return c.dotlottieplayerwasm_pause(this.__wbg_ptr)!==0}speed(){return c.dotlottieplayerwasm_speed(this.__wbg_ptr)}width(){return c.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return c.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}render(){return c.dotlottieplayerwasm_render(this.__wbg_ptr)!==0}markers(){return c.dotlottieplayerwasm_markers(this.__wbg_ptr)}sm_fire(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,t,n)!==0}sm_stop(){return c.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)!==0}sm_tick(e){return c.dotlottieplayerwasm_sm_tick(this.__wbg_ptr,e)!==0}autoplay(){return c.dotlottieplayerwasm_autoplay(this.__wbg_ptr)!==0}duration(){return c.dotlottieplayerwasm_duration(this.__wbg_ptr)}set_loop(e){c.dotlottieplayerwasm_set_loop(this.__wbg_ptr,e)}set_mode(e){c.dotlottieplayerwasm_set_mode(this.__wbg_ptr,e)}sm_start(e,t){let n=ue(t,c.__wbindgen_malloc_command_export),r=p;return c.dotlottieplayerwasm_sm_start(this.__wbg_ptr,e,n,r)!==0}theme_id(){let e=c.dotlottieplayerwasm_theme_id(this.__wbg_ptr),t;return e[0]!==0&&(t=f(e[0],e[1]).slice(),c.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}is_loaded(){return c.dotlottieplayerwasm_is_loaded(this.__wbg_ptr)!==0}is_paused(){return c.dotlottieplayerwasm_is_paused(this.__wbg_ptr)!==0}load_font(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p,i=y(t,c.__wbindgen_malloc_command_export),a=p;return c.dotlottieplayerwasm_load_font(this.__wbg_ptr,n,r,i,a)!==0}set_frame(e){return c.dotlottieplayerwasm_set_frame(this.__wbg_ptr,e)!==0}set_speed(e){c.dotlottieplayerwasm_set_speed(this.__wbg_ptr,e)}set_theme(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_set_theme(this.__wbg_ptr,t,n)!==0}sm_status(){let e,t;try{let n=c.dotlottieplayerwasm_sm_status(this.__wbg_ptr);return e=n[0],t=n[1],f(n[0],n[1])}finally{c.__wbindgen_free_command_export(e,t,1)}}};async function me(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 he(){let e={};return e.wbg={},e.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},e.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,t){let n,r;try{n=e,r=t,console.error(f(e,t))}finally{c.__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_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_push_737cfc8c1432c2c6=function(e,t){return e.push(t)},e.wbg.__wbg_set_bb8cecf6a62b9f46=function(){return ae(function(e,t,n){return Reflect.set(e,t,n)},arguments)},e.wbg.__wbg_setindex_4e73afdcd9bb95cd=function(e,t,n){e[t>>>0]=n},e.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,t){let n=t.stack,r=h(n,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),i=p;_().setInt32(e+4,i,!0),_().setInt32(e+0,r,!0)},e.wbg.__wbindgen_init_externref_table=function(){let e=c.__wbindgen_export_3,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 c.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=se(r)?0:h(r,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),a=p;_().setInt32(e+4,a,!0),_().setInt32(e+0,i,!0)},e.wbg.__wbindgen_string_new=function(e,t){return f(e,t)},e.wbg.__wbindgen_throw=function(e,t){throw Error(f(e,t))},e}function ge(e,t){return c=e.exports,x.__wbindgen_wasm_module=t,g=null,v=null,u=null,c.__wbindgen_start(),c}async function x(e){if(c!==void 0)return c;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=he();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await me(await e,t);return ge(n,r)}var _e=class{constructor(){s(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()}},S=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)}};s(S,`_observer`,null),s(S,`_observedCanvases`,new Map);var C=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)}};s(C,`_observer`,null),s(C,`_observedCanvases`,new Map);function ve(e){return/^#([\da-f]{6}|[\da-f]{8})$/iu.test(e)}function ye(e){if(!ve(e))return[0,0,0,0];let t=e.replace(`#`,``);return t=t.length===6?`${t}ff`:t,[parseInt(t.slice(0,2),16)/255,parseInt(t.slice(2,4),16)/255,parseInt(t.slice(4,6),16)/255,parseInt(t.slice(6,8),16)/255]}function w(e){if(e.byteLength<4)return!1;let n=new Uint8Array(e.slice(0,t.byteLength));for(let e=0;e<t.length;e+=1)if(t[e]!==n[e])return!1;return!0}function T(e){return n.every(t=>Object.hasOwn(e,t))}function E(e){if(typeof e==`string`)try{return T(JSON.parse(e))}catch{return!1}else return T(e)}function D(){return 1+((e?window.devicePixelRatio:1)-1)*.75}function O(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 k(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 be(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 A(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)}}}const j=A(x,`https://cdn.jsdelivr.net/npm/${i}@${r}/dist/dotlottie-player.wasm`,`https://unpkg.com/${i}@${r}/dist/dotlottie-player.wasm`),M=e=>{switch(e){case`reverse`:return b.Reverse;case`bounce`:return b.Bounce;case`reverse-bounce`:return b.ReverseBounce;default:return b.Forward}},N=e=>{switch(e){case b.Reverse:return`reverse`;case b.Bounce:return`bounce`;case b.ReverseBounce:return`reverse-bounce`;default:return`forward`}},xe=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 Se=class{constructor(e){s(this,`_canvas`,null),s(this,`_pendingLoad`,null),s(this,`_context`,null),s(this,`_eventManager`,void 0),s(this,`_animationFrameId`,null),s(this,`_frameManager`,void 0),s(this,`_boundAnimationLoop`,void 0),s(this,`_dotLottieCore`,null),s(this,`_stateMachineId`,``),s(this,`_stateMachineConfig`,null),s(this,`_isStateMachineRunning`,!1),s(this,`_renderConfig`,{}),s(this,`_isFrozen`,!1),s(this,`_backgroundColor`,null),s(this,`_lastFrameTime`,null),s(this,`_boundOnClick`,null),s(this,`_boundOnPointerUp`,null),s(this,`_boundOnPointerDown`,null),s(this,`_boundOnPointerMove`,null),s(this,`_boundOnPointerEnter`,null),s(this,`_boundOnPointerLeave`,null),s(this,`_bufferMismatchCount`,0),s(this,`_lastExpectedBufferSize`,0),s(this,`_cachedImageData`,null),s(this,`_cachedImageDataBuffer`,null),s(this,`_cachedImageDataByteOffset`,0),s(this,`_marker`,``),s(this,`_segment`,null),this._canvas=e.canvas??null,this._eventManager=new _e,this._frameManager=new re,this._boundAnimationLoop=this._animationLoop.bind(this),this._renderConfig={...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||D(),freezeOnOffscreen:e.renderConfig?.freezeOnOffscreen??!0},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(M(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):this._pendingLoad={src:e.src}),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor)}).catch(e=>{console.error(`[dotlottie-web] Initialization failed:`,e),this._eventManager.dispatch({type:`loadError`,error:Error(`Failed to load wasm module: ${e}`)})})}async _initWasm(){return j.load()}_createCore(){return new pe}_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}}}_drainSmEvents(){if(!this._dotLottieCore)return;let t;for(;(t=this._dotLottieCore.sm_poll_event())!=null;){let e=t;switch(e.type){case`Start`:queueMicrotask(()=>{this._isStateMachineRunning=!0,this._eventManager.dispatch({type:`stateMachineStart`}),this._startAnimationLoop()});break;case`Stop`:queueMicrotask(()=>{this._isStateMachineRunning=!1,this._eventManager.dispatch({type:`stateMachineStop`}),this._dotLottieCore?.is_playing()||this._stopAnimationLoop()});break;case`CustomEvent`:this._eventManager.dispatch({type:`stateMachineCustomEvent`,eventName:e.message??``});break;case`BooleanInputChange`:this._eventManager.dispatch({type:`stateMachineBooleanInputValueChange`,inputName:e.name??``,newValue:e.newValue,oldValue:e.oldValue});break;case`NumericInputChange`:this._eventManager.dispatch({type:`stateMachineNumericInputValueChange`,inputName:e.name??``,newValue:e.newValue,oldValue:e.oldValue});break;case`StringInputChange`:this._eventManager.dispatch({type:`stateMachineStringInputValueChange`,inputName:e.name??``,newValue:e.newValue,oldValue:e.oldValue});break;case`InputFired`:this._eventManager.dispatch({type:`stateMachineInputFired`,inputName:e.name??``});break;case`Transition`:this._eventManager.dispatch({type:`stateMachineTransition`,fromState:e.previousState??``,toState:e.newState??``});break;case`StateEntered`:this._eventManager.dispatch({type:`stateMachineStateEntered`,state:e.state??``});break;case`StateExit`:this._eventManager.dispatch({type:`stateMachineStateExit`,state:e.state??``});break;case`Error`:this._eventManager.dispatch({type:`stateMachineError`,error:e.message??``});break;default:break}}let n;for(;(n=this._dotLottieCore.sm_poll_internal_event())!=null;){let t=n;if(t.type===`Message`){let n=t.message??``;e&&n.startsWith(`OpenUrl: `)?be(n):this._eventManager.dispatch({type:`stateMachineInternalMessage`,message:n})}}}_dispatchError(e){console.error(e),this._eventManager.dispatch({type:`loadError`,error:Error(e)})}async _fetchData(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch animation data from URL: ${e}. ${t.status}: ${t.statusText}`);let n=await t.arrayBuffer();return w(n)?n:new TextDecoder().decode(n)}_loadFromData(t){if(this._dotLottieCore===null)return;if(!this._canvas){console.warn(`[dotlottie-web] Cannot load animation without canvas. Call setCanvas() first.`);return}let n=this._canvas.width,r=this._canvas.height;this._setupTarget(n,r);let i=!1;if(typeof t==`string`){if(!E(t)){this._dispatchError(`Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.`);return}i=this._dotLottieCore.load_animation(t)}else if(t instanceof ArrayBuffer){if(!w(t)){this._dispatchError(`Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.`);return}i=this._dotLottieCore.load_dotlottie_data(new Uint8Array(t))}else if(typeof t==`object`){if(!E(t)){this._dispatchError(`Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.`);return}i=this._dotLottieCore.load_animation(JSON.stringify(t))}else{this._dispatchError(`Unsupported data type for animation data. Expected:
1
+ const e=typeof window<`u`&&window.document!==void 0,t=new Uint8Array([80,75,3,4]),n=[`v`,`ip`,`op`,`layers`,`fr`,`w`,`h`],r=`0.74.0`,i=`@lottiefiles/dotlottie-web`;function a(e){"@babel/helpers - typeof";return a=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},a(e)}function o(e,t){if(a(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(a(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ee(e){var t=o(e,`string`);return a(t)==`symbol`?t:t+``}function s(e,t,n){return(t=ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var te=class{requestAnimationFrame(e){return requestAnimationFrame(e)}cancelAnimationFrame(e){cancelAnimationFrame(e)}},ne=class{constructor(){s(this,`_lastHandleId`,0),s(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)}},re=class{constructor(){s(this,`_strategy`,void 0),this._strategy=typeof requestAnimationFrame==`function`?new te:new ne}requestAnimationFrame(e){return this._strategy.requestAnimationFrame(e)}cancelAnimationFrame(e){this._strategy.cancelAnimationFrame(e)}};let c;const l=typeof TextDecoder<`u`?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(`TextDecoder not available`)}};typeof TextDecoder<`u`&&l.decode();let u=null;function d(){return(u===null||u.byteLength===0)&&(u=new Uint8Array(c.memory.buffer)),u}function f(e,t){return e>>>=0,l.decode(d().subarray(e,e+t))}function ie(e){let t=c.__externref_table_alloc_command_export();return c.__wbindgen_export_3.set(t,e),t}function ae(e,t){try{return e.apply(this,t)}catch(e){let t=ie(e);c.__wbindgen_exn_store_command_export(t)}}let p=0;const m=typeof TextEncoder<`u`?new TextEncoder(`utf-8`):{encode:()=>{throw Error(`TextEncoder not available`)}},oe=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 d().subarray(r,r+n.length).set(n),p=n.length,r}let r=e.length,i=t(r,1)>>>0,a=d(),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=d().subarray(i+o,i+r),a=oe(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return p=o,i}let g=null;function _(){return(g===null||g.buffer.detached===!0||g.buffer.detached===void 0&&g.buffer!==c.memory.buffer)&&(g=new DataView(c.memory.buffer)),g}function se(e){return e==null}let v=null;function ce(){return(v===null||v.byteLength===0)&&(v=new Float32Array(c.memory.buffer)),v}function le(e,t){let n=t(e.length*4,4)>>>0;return ce().set(e,n/4),p=e.length,n}function y(e,t){let n=t(e.length*1,1)>>>0;return d().set(e,n/1),p=e.length,n}function ue(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=ie(e[t]);_().setUint32(n+4*t,r,!0)}return p=e.length,n}function de(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p,i=y(t,c.__wbindgen_malloc_command_export),a=p;return c.register_font(n,r,i,a)!==0}const b=Object.freeze({Forward:0,0:`Forward`,Reverse:1,1:`Reverse`,Bounce:2,2:`Bounce`,ReverseBounce:3,3:`ReverseBounce`}),fe=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>c.__wbg_dotlottieplayerwasm_free(e>>>0,1));var pe=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,fe.unregister(this),e}free(){let e=this.__destroy_into_raw();c.__wbg_dotlottieplayerwasm_free(e,0)}clear_slot(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,t,n)!==0}is_playing(){return c.dotlottieplayerwasm_is_playing(this.__wbg_ptr)!==0}is_stopped(){return c.dotlottieplayerwasm_is_stopped(this.__wbg_ptr)!==0}layout_fit(){let e,t;try{let n=c.dotlottieplayerwasm_layout_fit(this.__wbg_ptr);return e=n[0],t=n[1],f(n[0],n[1])}finally{c.__wbindgen_free_command_export(e,t,1)}}loop_count(){return c.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){return c.dotlottieplayerwasm_poll_event(this.__wbg_ptr)}reset_slot(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,t,n)!==0}set_layout(e,t,n){let r=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),i=p;return c.dotlottieplayerwasm_set_layout(this.__wbg_ptr,r,i,t,n)!==0}set_marker(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;c.dotlottieplayerwasm_set_marker(this.__wbg_ptr,t,n)}clear_slots(){return c.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)!==0}is_complete(){return c.dotlottieplayerwasm_is_complete(this.__wbg_ptr)!==0}is_tweening(){return c.dotlottieplayerwasm_is_tweening(this.__wbg_ptr)!==0}reset_slots(){return c.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)!==0}reset_theme(){return c.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)!==0}segment_end(){return c.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_quality(e){return c.dotlottieplayerwasm_set_quality(this.__wbg_ptr,e)!==0}set_segment(e,t){return c.dotlottieplayerwasm_set_segment(this.__wbg_ptr,e,t)!==0}static unload_font(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_unload_font(t,n)!==0}animation_id(){let e=c.dotlottieplayerwasm_animation_id(this.__wbg_ptr),t;return e[0]!==0&&(t=f(e[0],e[1]).slice(),c.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}audio_volume(){return c.dotlottieplayerwasm_audio_volume(this.__wbg_ptr)}background_a(){return c.dotlottieplayerwasm_background_a(this.__wbg_ptr)}background_b(){return c.dotlottieplayerwasm_background_b(this.__wbg_ptr)}background_g(){return c.dotlottieplayerwasm_background_g(this.__wbg_ptr)}background_r(){return c.dotlottieplayerwasm_background_r(this.__wbg_ptr)}clear_marker(){c.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}emit_on_loop(){c.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}get_slot_ids(){return c.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr)}get_slot_str(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p,r=c.dotlottieplayerwasm_get_slot_str(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=f(r[0],r[1]).slice(),c.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}marker_names(){return c.dotlottieplayerwasm_marker_names(this.__wbg_ptr)}set_autoplay(e){c.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,e)}set_slot_str(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p,i=h(t,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),a=p;return c.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,n,r,i,a)!==0}set_viewport(e,t,n,r){return c.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,e,t,n,r)!==0}total_frames(){return c.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}clear_segment(){return c.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)!==0}current_frame(){return c.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}get_slot_type(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p,r=c.dotlottieplayerwasm_get_slot_type(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=f(r[0],r[1]).slice(),c.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}get_slots_str(){let e,t;try{let n=c.dotlottieplayerwasm_get_slots_str(this.__wbg_ptr);return e=n[0],t=n[1],f(n[0],n[1])}finally{c.__wbindgen_free_command_export(e,t,1)}}get_transform(){return c.dotlottieplayerwasm_get_transform(this.__wbg_ptr)}segment_start(){return c.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,t,n)!==0}set_text_slot(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p,i=h(t,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),a=p;return c.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,n,r,i,a)!==0}set_transform(e){let t=le(e,c.__wbindgen_malloc_command_export),n=p;return c.dotlottieplayerwasm_set_transform(this.__wbg_ptr,t,n)!==0}sm_get_inputs(){return c.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr)}sm_poll_event(){return c.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr)}sm_post_click(e,t){c.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,e,t)}animation_size(){return c.dotlottieplayerwasm_animation_size(this.__wbg_ptr)}current_marker(){let e=c.dotlottieplayerwasm_current_marker(this.__wbg_ptr),t;return e[0]!==0&&(t=f(e[0],e[1]).slice(),c.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}layout_align_x(){return c.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return c.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}load_animation(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_load_animation(this.__wbg_ptr,t,n)!==0}loop_animation(){return c.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)!==0}set_background(e,t,n,r){return c.dotlottieplayerwasm_set_background(this.__wbg_ptr,e,t,n,r)!==0}set_color_slot(e,t,n,r){let i=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),a=p;return c.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,a,t,n,r)!==0}set_loop_count(e){c.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,e)}set_theme_data(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,t,n)!==0}sm_reset_input(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;c.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,t,n)}manifest_string(){let e,t;try{let n=c.dotlottieplayerwasm_manifest_string(this.__wbg_ptr);return e=n[0],t=n[1],f(n[0],n[1])}finally{c.__wbindgen_free_command_export(e,t,1)}}set_scalar_slot(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p;return c.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,n,r,t)!==0}set_vector_slot(e,t,n){let r=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),i=p;return c.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,r,i,t,n)!==0}setup_sw_target(e,t){return c.dotlottieplayerwasm_setup_sw_target(this.__wbg_ptr,e,t)!==0}get_pixel_buffer(){return c.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr)}set_audio_volume(e){c.dotlottieplayerwasm_set_audio_volume(this.__wbg_ptr,e)}sm_current_state(){let e,t;try{let n=c.dotlottieplayerwasm_sm_current_state(this.__wbg_ptr);return e=n[0],t=n[1],f(n[0],n[1])}finally{c.__wbindgen_free_command_export(e,t,1)}}state_machine_id(){let e=c.dotlottieplayerwasm_state_machine_id(this.__wbg_ptr),t;return e[0]!==0&&(t=f(e[0],e[1]).slice(),c.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}get_state_machine(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p,r=c.dotlottieplayerwasm_get_state_machine(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=f(r[0],r[1]).slice(),c.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}set_position_slot(e,t,n){let r=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),i=p;return c.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,r,i,t,n)!==0}current_loop_count(){return c.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}sm_framework_setup(){return c.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr)}sm_post_pointer_up(e,t){c.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,e,t)}state_machine_load(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,t,n)!==0}load_dotlottie_data(e){let t=y(e,c.__wbindgen_malloc_command_export),n=p;return c.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,t,n)!==0}sm_get_string_input(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p,r=c.dotlottieplayerwasm_sm_get_string_input(this.__wbg_ptr,t,n),i;return r[0]!==0&&(i=f(r[0],r[1]).slice(),c.__wbindgen_free_command_export(r[0],r[1]*1,1)),i}sm_set_string_input(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p,i=h(t,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),a=p;return c.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,n,r,i,a)!==0}sm_get_boolean_input(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p,r=c.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,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p,r=c.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,t,n);return r===4294967297?void 0:r}sm_post_pointer_down(e,t){c.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,e,t)}sm_post_pointer_exit(e,t){c.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,e,t)}sm_post_pointer_move(e,t){c.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,e,t)}sm_set_boolean_input(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p;return c.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,n,r,t)!==0}sm_set_numeric_input(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p;return c.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,n,r,t)!==0}state_machine_unload(){c.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_post_pointer_enter(e,t){c.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,e,t)}load_animation_from_id(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,t,n)!==0}sm_poll_internal_event(){return c.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr)}use_frame_interpolation(){return c.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)!==0}reset_current_loop_count(){c.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}sm_override_current_state(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p;return c.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,n,r,t)!==0}state_machine_load_from_id(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_state_machine_load_from_id(this.__wbg_ptr,t,n)!==0}set_use_frame_interpolation(e){c.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,e)}constructor(){let e=c.dotlottieplayerwasm_new();return this.__wbg_ptr=e>>>0,fe.register(this,this.__wbg_ptr,this),this}mode(){return c.dotlottieplayerwasm_mode(this.__wbg_ptr)}play(){return c.dotlottieplayerwasm_play(this.__wbg_ptr)!==0}stop(){return c.dotlottieplayerwasm_stop(this.__wbg_ptr)!==0}tick(e){return c.dotlottieplayerwasm_tick(this.__wbg_ptr,e)!==0}pause(){return c.dotlottieplayerwasm_pause(this.__wbg_ptr)!==0}speed(){return c.dotlottieplayerwasm_speed(this.__wbg_ptr)}width(){return c.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return c.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}render(){return c.dotlottieplayerwasm_render(this.__wbg_ptr)!==0}markers(){return c.dotlottieplayerwasm_markers(this.__wbg_ptr)}sm_fire(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,t,n)!==0}sm_stop(){return c.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)!==0}sm_tick(e){return c.dotlottieplayerwasm_sm_tick(this.__wbg_ptr,e)!==0}autoplay(){return c.dotlottieplayerwasm_autoplay(this.__wbg_ptr)!==0}duration(){return c.dotlottieplayerwasm_duration(this.__wbg_ptr)}set_loop(e){c.dotlottieplayerwasm_set_loop(this.__wbg_ptr,e)}set_mode(e){c.dotlottieplayerwasm_set_mode(this.__wbg_ptr,e)}sm_start(e,t){let n=ue(t,c.__wbindgen_malloc_command_export),r=p;return c.dotlottieplayerwasm_sm_start(this.__wbg_ptr,e,n,r)!==0}theme_id(){let e=c.dotlottieplayerwasm_theme_id(this.__wbg_ptr),t;return e[0]!==0&&(t=f(e[0],e[1]).slice(),c.__wbindgen_free_command_export(e[0],e[1]*1,1)),t}is_loaded(){return c.dotlottieplayerwasm_is_loaded(this.__wbg_ptr)!==0}is_paused(){return c.dotlottieplayerwasm_is_paused(this.__wbg_ptr)!==0}load_font(e,t){let n=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),r=p,i=y(t,c.__wbindgen_malloc_command_export),a=p;return c.dotlottieplayerwasm_load_font(this.__wbg_ptr,n,r,i,a)!==0}set_frame(e){return c.dotlottieplayerwasm_set_frame(this.__wbg_ptr,e)!==0}set_speed(e){c.dotlottieplayerwasm_set_speed(this.__wbg_ptr,e)}set_theme(e){let t=h(e,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),n=p;return c.dotlottieplayerwasm_set_theme(this.__wbg_ptr,t,n)!==0}sm_status(){let e,t;try{let n=c.dotlottieplayerwasm_sm_status(this.__wbg_ptr);return e=n[0],t=n[1],f(n[0],n[1])}finally{c.__wbindgen_free_command_export(e,t,1)}}};async function me(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 he(){let e={};return e.wbg={},e.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},e.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,t){let n,r;try{n=e,r=t,console.error(f(e,t))}finally{c.__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_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_push_737cfc8c1432c2c6=function(e,t){return e.push(t)},e.wbg.__wbg_set_bb8cecf6a62b9f46=function(){return ae(function(e,t,n){return Reflect.set(e,t,n)},arguments)},e.wbg.__wbg_setindex_4e73afdcd9bb95cd=function(e,t,n){e[t>>>0]=n},e.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,t){let n=t.stack,r=h(n,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),i=p;_().setInt32(e+4,i,!0),_().setInt32(e+0,r,!0)},e.wbg.__wbindgen_init_externref_table=function(){let e=c.__wbindgen_export_3,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 c.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=se(r)?0:h(r,c.__wbindgen_malloc_command_export,c.__wbindgen_realloc_command_export),a=p;_().setInt32(e+4,a,!0),_().setInt32(e+0,i,!0)},e.wbg.__wbindgen_string_new=function(e,t){return f(e,t)},e.wbg.__wbindgen_throw=function(e,t){throw Error(f(e,t))},e}function ge(e,t){return c=e.exports,x.__wbindgen_wasm_module=t,g=null,v=null,u=null,c.__wbindgen_start(),c}async function x(e){if(c!==void 0)return c;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=he();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await me(await e,t);return ge(n,r)}var _e=class{constructor(){s(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()}},S=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)}};s(S,`_observer`,null),s(S,`_observedCanvases`,new Map);var C=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)}};s(C,`_observer`,null),s(C,`_observedCanvases`,new Map);function ve(e){return/^#([\da-f]{6}|[\da-f]{8})$/iu.test(e)}function ye(e){if(!ve(e))return[0,0,0,0];let t=e.replace(`#`,``);return t=t.length===6?`${t}ff`:t,[parseInt(t.slice(0,2),16)/255,parseInt(t.slice(2,4),16)/255,parseInt(t.slice(4,6),16)/255,parseInt(t.slice(6,8),16)/255]}function w(e){if(e.byteLength<4)return!1;let n=new Uint8Array(e.slice(0,t.byteLength));for(let e=0;e<t.length;e+=1)if(t[e]!==n[e])return!1;return!0}function T(e){return n.every(t=>Object.hasOwn(e,t))}function E(e){if(typeof e==`string`)try{return T(JSON.parse(e))}catch{return!1}else return T(e)}function D(){return 1+((e?window.devicePixelRatio:1)-1)*.75}function O(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 k(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 be(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 A(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)}}}const j=A(x,`https://cdn.jsdelivr.net/npm/${i}@${r}/dist/dotlottie-player.wasm`,`https://unpkg.com/${i}@${r}/dist/dotlottie-player.wasm`),M=e=>{switch(e){case`reverse`:return b.Reverse;case`bounce`:return b.Bounce;case`reverse-bounce`:return b.ReverseBounce;default:return b.Forward}},N=e=>{switch(e){case b.Reverse:return`reverse`;case b.Bounce:return`bounce`;case b.ReverseBounce:return`reverse-bounce`;default:return`forward`}},xe=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 Se=class{constructor(e){s(this,`_canvas`,null),s(this,`_pendingLoad`,null),s(this,`_context`,null),s(this,`_eventManager`,void 0),s(this,`_animationFrameId`,null),s(this,`_frameManager`,void 0),s(this,`_boundAnimationLoop`,void 0),s(this,`_dotLottieCore`,null),s(this,`_stateMachineId`,``),s(this,`_stateMachineConfig`,null),s(this,`_isStateMachineRunning`,!1),s(this,`_renderConfig`,{}),s(this,`_isFrozen`,!1),s(this,`_backgroundColor`,null),s(this,`_lastFrameTime`,null),s(this,`_boundOnClick`,null),s(this,`_boundOnPointerUp`,null),s(this,`_boundOnPointerDown`,null),s(this,`_boundOnPointerMove`,null),s(this,`_boundOnPointerEnter`,null),s(this,`_boundOnPointerLeave`,null),s(this,`_bufferMismatchCount`,0),s(this,`_lastExpectedBufferSize`,0),s(this,`_cachedImageData`,null),s(this,`_cachedImageDataBuffer`,null),s(this,`_cachedImageDataByteOffset`,0),s(this,`_marker`,``),s(this,`_segment`,null),this._canvas=e.canvas??null,this._eventManager=new _e,this._frameManager=new re,this._boundAnimationLoop=this._animationLoop.bind(this),this._renderConfig={...e.renderConfig,devicePixelRatio:e.renderConfig?.devicePixelRatio||D(),freezeOnOffscreen:e.renderConfig?.freezeOnOffscreen??!0},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(M(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):this._pendingLoad={src:e.src}),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor)}).catch(e=>{console.error(`[dotlottie-web] Initialization failed:`,e),this._eventManager.dispatch({type:`loadError`,error:Error(`Failed to load wasm module: ${e}`)})})}async _initWasm(){return j.load()}_createCore(){return new pe}_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}}}_drainSmEvents(){if(!this._dotLottieCore)return;let t;for(;(t=this._dotLottieCore.sm_poll_event())!=null;){let e=t;switch(e.type){case`Start`:queueMicrotask(()=>{this._isStateMachineRunning=!0,this._eventManager.dispatch({type:`stateMachineStart`}),this._startAnimationLoop()});break;case`Stop`:queueMicrotask(()=>{this._isStateMachineRunning=!1,this._eventManager.dispatch({type:`stateMachineStop`}),this._dotLottieCore?.is_playing()||this._stopAnimationLoop()});break;case`CustomEvent`:this._eventManager.dispatch({type:`stateMachineCustomEvent`,eventName:e.message??``});break;case`BooleanInputChange`:this._eventManager.dispatch({type:`stateMachineBooleanInputValueChange`,inputName:e.name??``,newValue:e.newValue,oldValue:e.oldValue});break;case`NumericInputChange`:this._eventManager.dispatch({type:`stateMachineNumericInputValueChange`,inputName:e.name??``,newValue:e.newValue,oldValue:e.oldValue});break;case`StringInputChange`:this._eventManager.dispatch({type:`stateMachineStringInputValueChange`,inputName:e.name??``,newValue:e.newValue,oldValue:e.oldValue});break;case`InputFired`:this._eventManager.dispatch({type:`stateMachineInputFired`,inputName:e.name??``});break;case`Transition`:this._eventManager.dispatch({type:`stateMachineTransition`,fromState:e.previousState??``,toState:e.newState??``});break;case`StateEntered`:this._eventManager.dispatch({type:`stateMachineStateEntered`,state:e.state??``});break;case`StateExit`:this._eventManager.dispatch({type:`stateMachineStateExit`,state:e.state??``});break;case`Error`:this._eventManager.dispatch({type:`stateMachineError`,error:e.message??``});break;default:break}}let n;for(;(n=this._dotLottieCore.sm_poll_internal_event())!=null;){let t=n;if(t.type===`Message`){let n=t.message??``;e&&n.startsWith(`OpenUrl: `)?be(n):this._eventManager.dispatch({type:`stateMachineInternalMessage`,message:n})}}}_dispatchError(e){console.error(e),this._eventManager.dispatch({type:`loadError`,error:Error(e)})}async _fetchData(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch animation data from URL: ${e}. ${t.status}: ${t.statusText}`);let n=await t.arrayBuffer();return w(n)?n:new TextDecoder().decode(n)}_loadFromData(t){if(this._dotLottieCore===null)return;if(!this._canvas){console.warn(`[dotlottie-web] Cannot load animation without canvas. Call setCanvas() first.`);return}let n=this._canvas.width,r=this._canvas.height;this._setupTarget(n,r);let i=!1;if(typeof t==`string`){if(!E(t)){this._dispatchError(`Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.`);return}i=this._dotLottieCore.load_animation(t)}else if(t instanceof ArrayBuffer){if(!w(t)){this._dispatchError(`Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.`);return}i=this._dotLottieCore.load_dotlottie_data(new Uint8Array(t))}else if(typeof t==`object`){if(!E(t)){this._dispatchError(`Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.`);return}i=this._dotLottieCore.load_animation(JSON.stringify(t))}else{this._dispatchError(`Unsupported data type for animation data. Expected:
2
2
  - string (Lottie JSON),
3
3
  - ArrayBuffer (dotLottie),
4
4
  - object (Lottie JSON).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lottiefiles/dotlottie-web",
3
- "version": "0.73.0",
3
+ "version": "0.74.0",
4
4
  "type": "module",
5
5
  "description": "Lottie and DotLottie player for the web",
6
6
  "repository": {