Files
open-kimi-ppt-skill/editor/neo-ppt/assets/resvg-wasm-legacy-D8pfsh6P.js
T

1 line
8.0 KiB
JavaScript

System.register([],function(t,e){var n,r,_,i,o,s,a,g,w,c,b,u,d,f,l,h,p;function y(t){_===r.length&&r.push(r.length+1);const e=_;return _=r[e],r[e]=t,e}function m(t){return r[t]}function v(t){const e=m(t);return function(t){t<132||(r[t]=_,_=t)}(t),e}function x(){return null!==o&&0!==o.byteLength||(o=new Uint8Array(n.memory.buffer)),o}function B(t,e,n){if(void 0===n){const n=s.encode(t),r=e(n.length,1)>>>0;return x().subarray(r,r+n.length).set(n),i=n.length,r}let r=t.length,_=e(r,1)>>>0;const o=x();let g=0;for(;g<r;g++){const e=t.charCodeAt(g);if(e>127)break;o[_+g]=e}if(g!==r){0!==g&&(t=t.slice(g)),_=n(_,r,r=g+3*t.length,1)>>>0;const e=x().subarray(_+g,_+r);g+=a(t,e).written,_=n(_,r,g,1)>>>0}return i=g,_}function A(t){return null==t}function R(){return null!==g&&0!==g.byteLength||(g=new Int32Array(n.memory.buffer)),g}function k(t,e){return t>>>=0,w.decode(x().subarray(t,t+e))}function E(){const t={wbg:{}};return t.wbg.__wbg_new_28c511d9baebfa89=function(t,e){return y(new Error(k(t,e)))},t.wbg.__wbindgen_memory=function(){return y(n.memory)},t.wbg.__wbg_buffer_12d079cc21e14bdb=function(t){return y(m(t).buffer)},t.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb=function(t,e,n){return y(new Uint8Array(m(t),e>>>0,n>>>0))},t.wbg.__wbindgen_object_drop_ref=function(t){v(t)},t.wbg.__wbg_new_63b92bc8671ed464=function(t){return y(new Uint8Array(m(t)))},t.wbg.__wbg_values_839f3396d5aac002=function(t){return y(m(t).values())},t.wbg.__wbg_next_196c84450b364254=function(){return function(t,e){try{return t.apply(this,e)}catch(r){n.__wbindgen_exn_store(y(r))}}(function(t){return y(m(t).next())},arguments)},t.wbg.__wbg_done_298b57d23c0fc80c=function(t){return m(t).done},t.wbg.__wbg_value_d93c65011f51a456=function(t){return y(m(t).value)},t.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6=function(t){let e;try{e=m(t)instanceof Uint8Array}catch(n){e=!1}return e},t.wbg.__wbindgen_string_get=function(t,e){const r=m(e),_="string"==typeof r?r:void 0;var o=A(_)?0:B(_,n.__wbindgen_malloc,n.__wbindgen_realloc),s=i;R()[t/4+1]=s,R()[t/4+0]=o},t.wbg.__wbg_new_16b304a2cfa7ff4a=function(){return y(new Array)},t.wbg.__wbindgen_string_new=function(t,e){return y(k(t,e))},t.wbg.__wbg_push_a5b05aedc7234f9f=function(t,e){return m(t).push(m(e))},t.wbg.__wbg_length_c20a40f15020d68a=function(t){return m(t).length},t.wbg.__wbg_set_a47bac70306a19a7=function(t,e,n){m(t).set(m(e),n>>>0)},t.wbg.__wbindgen_throw=function(t,e){throw new Error(k(t,e))},t}async function T(t){if(void 0!==n)return n;void 0===t&&(t=new URL("index_bg.wasm",void 0));const e=E();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:r,module:_}=await async function(t,e){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(n){if("application/wasm"==t.headers.get("Content-Type"))throw n;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",n)}const r=await t.arrayBuffer();return await WebAssembly.instantiate(r,e)}{const n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}(await t,e);return function(t,e){return n=t.exports,T.__wbindgen_wasm_module=e,g=null,o=null,n}(r,_)}return{setters:[],execute:function(){(r=new Array(128).fill(void 0)).push(void 0,null,!0,!1),_=r.length,i=0,o=null,s="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},a="function"==typeof s.encodeInto?function(t,e){return s.encodeInto(t,e)}:function(t,e){const n=s.encode(t);return e.set(n),{read:t.length,written:n.length}},g=null,w="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}},"undefined"!=typeof TextDecoder&&w.decode(),c="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>n.__wbg_bbox_free(t>>>0)),b=class t{static __wrap(e){e>>>=0;const n=Object.create(t.prototype);return n.__wbg_ptr=e,c.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,c.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_bbox_free(t)}get x(){return n.__wbg_get_bbox_x(this.__wbg_ptr)}set x(t){n.__wbg_set_bbox_x(this.__wbg_ptr,t)}get y(){return n.__wbg_get_bbox_y(this.__wbg_ptr)}set y(t){n.__wbg_set_bbox_y(this.__wbg_ptr,t)}get width(){return n.__wbg_get_bbox_width(this.__wbg_ptr)}set width(t){n.__wbg_set_bbox_width(this.__wbg_ptr,t)}get height(){return n.__wbg_get_bbox_height(this.__wbg_ptr)}set height(t){n.__wbg_set_bbox_height(this.__wbg_ptr,t)}},u="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>n.__wbg_renderedimage_free(t>>>0)),d=class t{static __wrap(e){e>>>=0;const n=Object.create(t.prototype);return n.__wbg_ptr=e,u.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,u.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_renderedimage_free(t)}get width(){return n.renderedimage_width(this.__wbg_ptr)>>>0}get height(){return n.renderedimage_height(this.__wbg_ptr)>>>0}asPng(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.renderedimage_asPng(r,this.__wbg_ptr);var t=R()[r/4+0],e=R()[r/4+1];if(R()[r/4+2])throw v(e);return v(t)}finally{n.__wbindgen_add_to_stack_pointer(16)}}get pixels(){return v(n.renderedimage_pixels(this.__wbg_ptr))}},f="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>n.__wbg_resvg_free(t>>>0)),l=class{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,f.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_resvg_free(t)}constructor(t,e,r){try{const g=n.__wbindgen_add_to_stack_pointer(-16);var _=A(e)?0:B(e,n.__wbindgen_malloc,n.__wbindgen_realloc),o=i;n.resvg_new(g,y(t),_,o,A(r)?0:y(r));var s=R()[g/4+0],a=R()[g/4+1];if(R()[g/4+2])throw v(a);return this.__wbg_ptr=s>>>0,this}finally{n.__wbindgen_add_to_stack_pointer(16)}}get width(){return n.resvg_width(this.__wbg_ptr)}get height(){return n.resvg_height(this.__wbg_ptr)}render(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.resvg_render(r,this.__wbg_ptr);var t=R()[r/4+0],e=R()[r/4+1];if(R()[r/4+2])throw v(e);return d.__wrap(t)}finally{n.__wbindgen_add_to_stack_pointer(16)}}toString(){let t,e;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.resvg_toString(i,this.__wbg_ptr);var r=R()[i/4+0],_=R()[i/4+1];return t=r,e=_,k(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(t,e,1)}}innerBBox(){const t=n.resvg_innerBBox(this.__wbg_ptr);return 0===t?void 0:b.__wrap(t)}getBBox(){const t=n.resvg_getBBox(this.__wbg_ptr);return 0===t?void 0:b.__wrap(t)}cropByBBox(t){!function(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`);t.ptr}(t,b),n.resvg_cropByBBox(this.__wbg_ptr,t.__wbg_ptr)}imagesToResolve(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.resvg_imagesToResolve(r,this.__wbg_ptr);var t=R()[r/4+0],e=R()[r/4+1];if(R()[r/4+2])throw v(e);return v(t)}finally{n.__wbindgen_add_to_stack_pointer(16)}}resolveImage(t,e){try{const _=n.__wbindgen_add_to_stack_pointer(-16),o=B(t,n.__wbindgen_malloc,n.__wbindgen_realloc),s=i;n.resvg_resolveImage(_,this.__wbg_ptr,o,s,y(e));var r=R()[_/4+0];if(R()[_/4+1])throw v(r)}finally{n.__wbindgen_add_to_stack_pointer(16)}}},h=T,p=!1,t("initWasm",async t=>{if(p)throw new Error("Already initialized. The `initWasm()` function can be used only once.");await h(await t),p=!0}),t("Resvg",class extends l{constructor(t,e){if(!p)throw new Error("Wasm has not been initialized. Call `initWasm()` function.");const n=e?.font;if(n&&(r=n,Object.prototype.hasOwnProperty.call(r,"fontBuffers"))){const r={...e,font:{...n,fontBuffers:void 0}};super(t,JSON.stringify(r),n.fontBuffers)}else super(t,JSON.stringify(e));var r}})}}});