@silurus/ooxml-legacy-office 0.89.11 → 0.90.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.
- package/dist/doc.mjs +1 -1
- package/dist/legacy-doc-source-module.mjs +1 -1
- package/dist/legacy-ppt-source-module.mjs +1 -1
- package/dist/{legacy-source-Dds5PgNt.js → legacy-source-CFRuXN53.js} +1 -1
- package/dist/legacy-xls-source-module.mjs +1 -1
- package/dist/legacy_doc_direct_bg.wasm +0 -0
- package/dist/legacy_ppt_direct_bg.wasm +0 -0
- package/dist/legacy_xls_direct_bg.wasm +0 -0
- package/dist/ppt.mjs +1 -1
- package/dist/xls.mjs +1 -1
- package/package.json +4 -4
package/dist/doc.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./legacy-source-
|
|
1
|
+
import { n as e, r as t, t as n } from "./legacy-source-CFRuXN53.js";
|
|
2
2
|
//#region src/wasm-direct-doc/legacy_doc_direct_bg.wasm?url
|
|
3
3
|
var r = new URL("legacy_doc_direct_bg.wasm", import.meta.url).href, i = new URL("legacy-doc-source-module.mjs", import.meta.url).href;
|
|
4
4
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};function r(e,t){return typeof e==`string`?e.startsWith(`LEGACY_UNSUPPORTED_ENCRYPTION:`)?Error(`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`):e.startsWith(`UNSUPPORTED:`)?Error(`MODEL_SOURCE_UNSUPPORTED:${JSON.stringify({format:t,reason:`source-subset`})}`):Error(e):e}var i=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function a(e){let t=globalThis.WebAssembly?.RuntimeError;return t&&e instanceof t||e instanceof RangeError?!0:e instanceof Error?e.name===`RuntimeError`||e.name===`CompileError`||e.name===`LinkError`||e.name===`InternalError`||e.name===`OOMError`:!1}function o(e){try{if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let t=Reflect.get(e,`__destroy_into_raw`);typeof t==`function`&&Reflect.apply(t,e,[])}catch{}}const s=new WeakMap,c=new Set([`http:`,`https:`,`file:`,`blob:`,`data:`]);function l(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`);let n;try{n=new URL(e)}catch{throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`)}if(!c.has(n.protocol))throw TypeError(`${t} wasmUrl protocol is unsupported`);return e}function u(e){let t,n,c,u,d=()=>c??u?.failure,g=t=>{if(!a(t))throw h(t);let n=d()??new i(`${e.label} WASM runtime trapped and is unavailable`);if(u){u.failure??=n;for(let e of u.live)e.invalidate();u.live.clear()}else c=n;throw n},_=t=>{let n=d();if(n)throw n;try{return t()}catch(t){return g(e.format?r(t,e.format):t)}},v=r=>t?r===n?t:Promise.reject(Error(`${e.label} source engine is pinned to another WASM URL`)):(n=r,t=e.loadGlue().then(async t=>{if(u=s.get(t),u||(u={live:new Set},s.set(t,u)),u.failure)throw u.failure;try{let n=await e.resolveWasm(r);await t.default({module_or_path:n})}catch(e){return g(e)}return t}),t);return Object.freeze({async open(t,n,r){let i=d();if(i)throw i;let a=l(n,e.label);m(r,e.label);let c;try{c=await p(v(a),r,e.label)}catch(e){return g(e)}if(u=s.get(c),!u)throw Error(`${e.label} source runtime identity is unavailable`);if(u.failure)throw u.failure;m(r,e.label);let h;try{h=_(()=>e.construct(c,t)),m(r,e.label)}catch(t){if(h)try{f(h,e.closeNative,_)}catch{}throw t}let y=!1,b=h,x={invalidate(){let e=b;b=void 0,o(e)}};return u.live.add(x),{archive:new Proxy(h,{get(t,n){let r=b;if(!r)throw d()??Error(`${e.label} source archive is closed`);let i=_(()=>Reflect.get(r,n,r));return typeof i==`function`?(...t)=>{let r=b;if(!r)throw d()??Error(`${e.label} source archive is closed`);return _(()=>{let e=Reflect.get(r,n,r);return Reflect.apply(e,r,t)})}:i}}),sourceByteLength:t.byteLength,closeArchive(){if(y)return;y=!0,u?.live.delete(x);let t=b;b=void 0,t&&f(t,e.closeNative,_)}}}})}async function d(e){let t=new URL(e),n=globalThis.process;if(t.protocol===`file:`&&n?.versions?.node){let{readFile:e}=await import(`node:fs/promises`);return e(t)}return t}function f(e,t,n){let r,s=!1;try{n(()=>t(e))}catch(e){s=!0,r=e}if(a(r)||r instanceof i)o(e);else try{n(()=>e.free())}catch(t){s||(s=!0,r=t),(a(t)||t instanceof i)&&o(e)}if(s)throw r}function p(e,t,n){return t?(m(t,n),new Promise((r,i)=>{let a=()=>{o();try{m(t,n)}catch(e){i(e)}},o=()=>t.removeEventListener(`abort`,a);t.addEventListener(`abort`,a,{once:!0}),e.then(e=>{o(),r(e)},e=>{o(),i(e)})})):e}function m(e,t){if(!e?.aborted)return;let n=Error(`${t} direct source was aborted`);throw n.name=`AbortError`,n}function h(e){return typeof e==`string`?Error(e):e}function g(e,t,n){if(n!==void 0&&(!Number.isSafeInteger(n)||n<=0||n>268435456))throw RangeError(`legacy DOC model budget is invalid`);return u({label:`legacy DOC`,format:`doc`,loadGlue:e,resolveWasm:t,construct:(e,t)=>new e.LegacyDocDocument(t,n),closeNative:e=>e.close_document_session()})}function _(e){return e.revision_markup_in_print?.()===!0&&e.has_revision_marks?.()===!0?{showTrackedChanges:!0}:{}}function v(e,t){if(e!==void 0){if(typeof e!=`number`||!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} maxInputBytes is invalid`);return e}}function y(e,t){if(typeof e!=`object`||!e)throw TypeError(`${t} source module config must be an object`);let n=e;for(let e of Object.keys(n))if(e!==`wasmUrl`&&e!==`maxInputBytes`)throw TypeError(`${t} source module config has an unknown field`);let r=v(n.maxInputBytes,t);if(typeof n.wasmUrl!=`string`)throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`);return{wasmUrl:n.wasmUrl,...r===void 0?{}:{maxInputBytes:r}}}var b=n({LegacyDocDocument:()=>F,default:()=>N,initSync:()=>M,reinit:()=>P});function x(){return{__proto__:null,"./legacy_doc_direct_bg.js":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(w(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(w(e,t))}finally{W.__wbindgen_free(n,r,1)}},__wbg_length_9f1775224cf1d815:function(e){return e.length},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_prototypesetcall_a6b02eb00b0f4ce2:function(e,t,n){Uint8Array.prototype.set.call(S(e,t),n)},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=D(n,W.__wbindgen_malloc,W.__wbindgen_realloc),i=U;C().setInt32(e+4,i,!0),C().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return w(e,t)},__wbindgen_init_externref_table:function(){let e=W.__wbindgen_externrefs,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)}}}}function S(e,t){return e>>>=0,T().subarray(e/1,e/1+t)}function C(){return(L===null||L.buffer.detached===!0||L.buffer.detached===void 0&&L.buffer!==W.memory.buffer)&&(L=new DataView(W.memory.buffer)),L}function w(e,t){return e>>>=0,k(e,t)}function T(){return(R===null||R.byteLength===0)&&(R=new Uint8Array(W.memory.buffer)),R}function E(e){return e==null}function D(e,t,n){if(n===void 0){let n=H.encode(e),r=t(n.length,1)>>>0;return T().subarray(r,r+n.length).set(n),U=n.length,r}let r=e.length,i=t(r,1)>>>0,a=T(),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=T().subarray(i+o,i+r),a=H.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return U=o,i}function O(e){let t=W.__wbindgen_externrefs.get(e);return W.__externref_table_dealloc(e),t}function k(e,t){return V+=t,V>=B&&(z=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),z.decode(),V=t),z.decode(T().subarray(e,e+t))}function A(e,t){return W=e.exports,L=null,R=null,W.__wbindgen_start(),W}async function j(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.ok&&n(e.type)&&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 r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}function M(e){if(W!==void 0)return W;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=x();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),A(new WebAssembly.Instance(e,t),e)}async function N(e){if(W!==void 0)return W;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`));let t=x();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await j(await e,t);return A(n,r)}async function P(e){return W=void 0,L=null,R=null,N(e)}var F,I,L,R,z,B,V,H,U,W,G=t(()=>{F=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,I.unregister(this),e}free(){let e=this.__destroy_into_raw();W.__wbg_legacydocdocument_free(e,0)}acknowledge_document_chunk(e,t,n){let r=W.legacydocdocument_acknowledge_document_chunk(this.__wbg_ptr,e,t,n);if(r[1])throw O(r[0])}assert_healthy(){let e=W.legacydocdocument_assert_healthy(this.__wbg_ptr);if(e[1])throw O(e[0])}cancel_document_cursor(){let e=W.legacydocdocument_cancel_document_cursor(this.__wbg_ptr);if(e[1])throw O(e[0])}close_document_session(){W.legacydocdocument_close_document_session(this.__wbg_ptr)}document_chunk_done(){let e=W.legacydocdocument_document_chunk_done(this.__wbg_ptr);if(e[2])throw O(e[1]);return e[0]!==0}extract_image(e){let t=D(e,W.__wbindgen_malloc,W.__wbindgen_realloc),n=U,r=W.legacydocdocument_extract_image(this.__wbg_ptr,t,n);if(r[3])throw O(r[2]);var i=S(r[0],r[1]).slice();return W.__wbindgen_free(r[0],r[1]*1,1),i}has_revision_marks(){return W.legacydocdocument_has_revision_marks(this.__wbg_ptr)!==0}image_mime_type(e){let t,n;try{let a=D(e,W.__wbindgen_malloc,W.__wbindgen_realloc),o=U,s=W.legacydocdocument_image_mime_type(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,O(s[2]);return t=r,n=i,w(r,i)}finally{W.__wbindgen_free(t,n,1)}}constructor(e,t){let n=W.legacydocdocument_new(e,E(t)?4294967297:t>>>0);if(n[2])throw O(n[1]);return this.__wbg_ptr=n[0]>>>0,I.register(this,this.__wbg_ptr,this),this}open_document_cursor(e,t){let n=W.legacydocdocument_open_document_cursor(this.__wbg_ptr,e,t);if(n[1])throw O(n[0])}pull_document_chunk(e,t,n,r){let i=W.legacydocdocument_pull_document_chunk(this.__wbg_ptr,e,t,n,r);if(i[3])throw O(i[2]);var a=S(i[0],i[1]).slice();return W.__wbindgen_free(i[0],i[1]*1,1),a}revision_markup_in_print(){return W.legacydocdocument_revision_markup_in_print(this.__wbg_ptr)!==0}revision_markup_on_screen(){return W.legacydocdocument_revision_markup_on_screen(this.__wbg_ptr)!==0}},Symbol.dispose&&(F.prototype[Symbol.dispose]=F.prototype.free),I=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>W.__wbg_legacydocdocument_free(e>>>0,1)),L=null,R=null,z=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),z.decode(),B=2146435072,V=0,H=new TextEncoder,`encodeInto`in H||(H.encodeInto=function(e,t){let n=H.encode(e);return t.set(n),{read:e.length,written:n.length}}),U=0});const K=g(()=>Promise.resolve().then(()=>(G(),b)),d);async function q(e,t,n){let{wasmUrl:r,maxInputBytes:i}=y(t,`legacy DOC`);if(i!==void 0&&e.byteLength>i)throw RangeError(`legacy DOC input exceeds the configured size limit`);let a=await K.open(e,r,n);try{return Object.freeze({archive:a.archive,viewDefaults:_(a.archive),close:()=>a.closeArchive()})}catch(e){try{a.closeArchive()}catch{}throw e}}export{q as openModelSource};
|
|
1
|
+
var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function i(e){let t=globalThis.WebAssembly?.RuntimeError;return t&&e instanceof t||e instanceof RangeError?!0:e instanceof Error?e.name===`RuntimeError`||e.name===`CompileError`||e.name===`LinkError`||e.name===`InternalError`||e.name===`OOMError`:!1}function a(e){try{if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let t=Reflect.get(e,`__destroy_into_raw`);typeof t==`function`&&Reflect.apply(t,e,[])}catch{}}const o=new WeakMap,s=new Set([`http:`,`https:`,`file:`,`blob:`,`data:`]);function c(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`);let n;try{n=new URL(e)}catch{throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`)}if(!s.has(n.protocol))throw TypeError(`${t} wasmUrl protocol is unsupported`);return e}function l(e){let t,n,s,l,u=()=>s??l?.failure,h=t=>{if(!i(t))throw m(t);let n=u()??new r(`${e.label} WASM runtime trapped and is unavailable`);if(l){l.failure??=n;for(let e of l.live)e.invalidate();l.live.clear()}else s=n;throw n},g=t=>{let n=u();if(n)throw n;try{return t()}catch(t){return h(e.mapNativeError?e.mapNativeError(t):t)}},_=r=>t?r===n?t:Promise.reject(Error(`${e.label} source engine is pinned to another WASM URL`)):(n=r,t=e.loadGlue().then(async t=>{if(l=o.get(t),l||(l={live:new Set},o.set(t,l)),l.failure)throw l.failure;try{let n=await e.resolveWasm(r);await t.default({module_or_path:n})}catch(e){return h(e)}return t}),t);return Object.freeze({async open(t,n,r,i){let s=u();if(s)throw s;let m=c(n,e.label);p(r,e.label);let v;try{v=await f(_(m),r,e.label)}catch(e){return h(e)}if(l=o.get(v),!l)throw Error(`${e.label} source runtime identity is unavailable`);if(l.failure)throw l.failure;p(r,e.label);let y;try{y=g(()=>e.construct(v,t,i)),p(r,e.label)}catch(t){if(y)try{d(y,e.closeNative,g)}catch{}throw t}let b=!1,x=y,S={invalidate(){let e=x;x=void 0,a(e)}};return l.live.add(S),{archive:new Proxy(y,{get(t,n){let r=x;if(!r)throw u()??Error(`${e.label} source archive is closed`);let i=g(()=>Reflect.get(r,n,r));return typeof i==`function`?(...t)=>{let r=x;if(!r)throw u()??Error(`${e.label} source archive is closed`);return g(()=>{let e=Reflect.get(r,n,r);return Reflect.apply(e,r,t)})}:i}}),sourceByteLength:t.byteLength,closeArchive(){if(b)return;b=!0,l?.live.delete(S);let t=x;x=void 0,t&&d(t,e.closeNative,g)}}}})}async function u(e){let t=new URL(e),n=globalThis.process;if(t.protocol===`file:`&&n?.versions?.node){let{readFile:e}=await import(`node:fs/promises`);return e(t)}return t}function d(e,t,n){let o,s=!1;try{n(()=>t(e))}catch(e){s=!0,o=e}if(i(o)||o instanceof r)a(e);else try{n(()=>e.free())}catch(t){s||(s=!0,o=t),(i(t)||t instanceof r)&&a(e)}if(s)throw o}function f(e,t,n){return t?(p(t,n),new Promise((r,i)=>{let a=()=>{o();try{p(t,n)}catch(e){i(e)}},o=()=>t.removeEventListener(`abort`,a);t.addEventListener(`abort`,a,{once:!0}),e.then(e=>{o(),r(e)},e=>{o(),i(e)})})):e}function p(e,t){if(!e?.aborted)return;let n=Error(`${t} direct source was aborted`);throw n.name=`AbortError`,n}function m(e){return typeof e==`string`?Error(e):e}function h(e,t){return typeof e==`string`?e.startsWith(`LEGACY_UNSUPPORTED_ENCRYPTION:`)?Error(`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`):e.startsWith(`UNSUPPORTED:`)?Error(`MODEL_SOURCE_UNSUPPORTED:${JSON.stringify({format:t,reason:`source-subset`})}`):Error(e):e}function g(e,t,n){if(n!==void 0&&(!Number.isSafeInteger(n)||n<=0||n>268435456))throw RangeError(`legacy DOC model budget is invalid`);return l({label:`legacy DOC`,mapNativeError:e=>h(e,`doc`),loadGlue:e,resolveWasm:t,construct:(e,t)=>new e.LegacyDocDocument(t,n),closeNative:e=>e.close_document_session()})}function _(e){return e.revision_markup_in_print?.()===!0&&e.has_revision_marks?.()===!0?{showTrackedChanges:!0}:{}}function v(e,t){if(e!==void 0){if(typeof e!=`number`||!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} maxInputBytes is invalid`);return e}}function y(e,t){if(typeof e!=`object`||!e)throw TypeError(`${t} source module config must be an object`);let n=e;for(let e of Object.keys(n))if(e!==`wasmUrl`&&e!==`maxInputBytes`)throw TypeError(`${t} source module config has an unknown field`);let r=v(n.maxInputBytes,t);if(typeof n.wasmUrl!=`string`)throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`);return{wasmUrl:n.wasmUrl,...r===void 0?{}:{maxInputBytes:r}}}var b=n({LegacyDocDocument:()=>F,default:()=>N,initSync:()=>M,reinit:()=>P});function x(){return{__proto__:null,"./legacy_doc_direct_bg.js":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(w(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(w(e,t))}finally{W.__wbindgen_free(n,r,1)}},__wbg_length_9f1775224cf1d815:function(e){return e.length},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_prototypesetcall_a6b02eb00b0f4ce2:function(e,t,n){Uint8Array.prototype.set.call(S(e,t),n)},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=D(n,W.__wbindgen_malloc,W.__wbindgen_realloc),i=U;C().setInt32(e+4,i,!0),C().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return w(e,t)},__wbindgen_init_externref_table:function(){let e=W.__wbindgen_externrefs,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)}}}}function S(e,t){return e>>>=0,T().subarray(e/1,e/1+t)}function C(){return(L===null||L.buffer.detached===!0||L.buffer.detached===void 0&&L.buffer!==W.memory.buffer)&&(L=new DataView(W.memory.buffer)),L}function w(e,t){return e>>>=0,k(e,t)}function T(){return(R===null||R.byteLength===0)&&(R=new Uint8Array(W.memory.buffer)),R}function E(e){return e==null}function D(e,t,n){if(n===void 0){let n=H.encode(e),r=t(n.length,1)>>>0;return T().subarray(r,r+n.length).set(n),U=n.length,r}let r=e.length,i=t(r,1)>>>0,a=T(),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=T().subarray(i+o,i+r),a=H.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return U=o,i}function O(e){let t=W.__wbindgen_externrefs.get(e);return W.__externref_table_dealloc(e),t}function k(e,t){return V+=t,V>=B&&(z=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),z.decode(),V=t),z.decode(T().subarray(e,e+t))}function A(e,t){return W=e.exports,L=null,R=null,W.__wbindgen_start(),W}async function j(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.ok&&n(e.type)&&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 r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}function M(e){if(W!==void 0)return W;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=x();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),A(new WebAssembly.Instance(e,t),e)}async function N(e){if(W!==void 0)return W;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`));let t=x();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await j(await e,t);return A(n,r)}async function P(e){return W=void 0,L=null,R=null,N(e)}var F,I,L,R,z,B,V,H,U,W,G=t(()=>{F=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,I.unregister(this),e}free(){let e=this.__destroy_into_raw();W.__wbg_legacydocdocument_free(e,0)}acknowledge_document_chunk(e,t,n){let r=W.legacydocdocument_acknowledge_document_chunk(this.__wbg_ptr,e,t,n);if(r[1])throw O(r[0])}assert_healthy(){let e=W.legacydocdocument_assert_healthy(this.__wbg_ptr);if(e[1])throw O(e[0])}cancel_document_cursor(){let e=W.legacydocdocument_cancel_document_cursor(this.__wbg_ptr);if(e[1])throw O(e[0])}close_document_session(){W.legacydocdocument_close_document_session(this.__wbg_ptr)}document_chunk_done(){let e=W.legacydocdocument_document_chunk_done(this.__wbg_ptr);if(e[2])throw O(e[1]);return e[0]!==0}extract_image(e){let t=D(e,W.__wbindgen_malloc,W.__wbindgen_realloc),n=U,r=W.legacydocdocument_extract_image(this.__wbg_ptr,t,n);if(r[3])throw O(r[2]);var i=S(r[0],r[1]).slice();return W.__wbindgen_free(r[0],r[1]*1,1),i}has_revision_marks(){return W.legacydocdocument_has_revision_marks(this.__wbg_ptr)!==0}image_mime_type(e){let t,n;try{let a=D(e,W.__wbindgen_malloc,W.__wbindgen_realloc),o=U,s=W.legacydocdocument_image_mime_type(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,O(s[2]);return t=r,n=i,w(r,i)}finally{W.__wbindgen_free(t,n,1)}}constructor(e,t){let n=W.legacydocdocument_new(e,E(t)?4294967297:t>>>0);if(n[2])throw O(n[1]);return this.__wbg_ptr=n[0]>>>0,I.register(this,this.__wbg_ptr,this),this}open_document_cursor(e,t){let n=W.legacydocdocument_open_document_cursor(this.__wbg_ptr,e,t);if(n[1])throw O(n[0])}pull_document_chunk(e,t,n,r){let i=W.legacydocdocument_pull_document_chunk(this.__wbg_ptr,e,t,n,r);if(i[3])throw O(i[2]);var a=S(i[0],i[1]).slice();return W.__wbindgen_free(i[0],i[1]*1,1),a}revision_markup_in_print(){return W.legacydocdocument_revision_markup_in_print(this.__wbg_ptr)!==0}revision_markup_on_screen(){return W.legacydocdocument_revision_markup_on_screen(this.__wbg_ptr)!==0}},Symbol.dispose&&(F.prototype[Symbol.dispose]=F.prototype.free),I=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>W.__wbg_legacydocdocument_free(e>>>0,1)),L=null,R=null,z=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),z.decode(),B=2146435072,V=0,H=new TextEncoder,`encodeInto`in H||(H.encodeInto=function(e,t){let n=H.encode(e);return t.set(n),{read:e.length,written:n.length}}),U=0});const K=g(()=>Promise.resolve().then(()=>(G(),b)),u);async function q(e,t,n){let{wasmUrl:r,maxInputBytes:i}=y(t,`legacy DOC`);if(i!==void 0&&e.byteLength>i)throw RangeError(`legacy DOC input exceeds the configured size limit`);let a=await K.open(e,r,n);try{return Object.freeze({archive:a.archive,viewDefaults:_(a.archive),close:()=>a.closeArchive()})}catch(e){try{a.closeArchive()}catch{}throw e}}export{q as openModelSource};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};function r(e,t){return typeof e==`string`?e.startsWith(`LEGACY_UNSUPPORTED_ENCRYPTION:`)?Error(`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`):e.startsWith(`UNSUPPORTED:`)?Error(`MODEL_SOURCE_UNSUPPORTED:${JSON.stringify({format:t,reason:`source-subset`})}`):Error(e):e}var i=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function a(e){let t=globalThis.WebAssembly?.RuntimeError;return t&&e instanceof t||e instanceof RangeError?!0:e instanceof Error?e.name===`RuntimeError`||e.name===`CompileError`||e.name===`LinkError`||e.name===`InternalError`||e.name===`OOMError`:!1}function o(e){try{if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let t=Reflect.get(e,`__destroy_into_raw`);typeof t==`function`&&Reflect.apply(t,e,[])}catch{}}const s=new WeakMap,c=new Set([`http:`,`https:`,`file:`,`blob:`,`data:`]);function l(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`);let n;try{n=new URL(e)}catch{throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`)}if(!c.has(n.protocol))throw TypeError(`${t} wasmUrl protocol is unsupported`);return e}function u(e){let t,n,c,u,d=()=>c??u?.failure,g=t=>{if(!a(t))throw h(t);let n=d()??new i(`${e.label} WASM runtime trapped and is unavailable`);if(u){u.failure??=n;for(let e of u.live)e.invalidate();u.live.clear()}else c=n;throw n},_=t=>{let n=d();if(n)throw n;try{return t()}catch(t){return g(e.format?r(t,e.format):t)}},v=r=>t?r===n?t:Promise.reject(Error(`${e.label} source engine is pinned to another WASM URL`)):(n=r,t=e.loadGlue().then(async t=>{if(u=s.get(t),u||(u={live:new Set},s.set(t,u)),u.failure)throw u.failure;try{let n=await e.resolveWasm(r);await t.default({module_or_path:n})}catch(e){return g(e)}return t}),t);return Object.freeze({async open(t,n,r){let i=d();if(i)throw i;let a=l(n,e.label);m(r,e.label);let c;try{c=await p(v(a),r,e.label)}catch(e){return g(e)}if(u=s.get(c),!u)throw Error(`${e.label} source runtime identity is unavailable`);if(u.failure)throw u.failure;m(r,e.label);let h;try{h=_(()=>e.construct(c,t)),m(r,e.label)}catch(t){if(h)try{f(h,e.closeNative,_)}catch{}throw t}let y=!1,b=h,x={invalidate(){let e=b;b=void 0,o(e)}};return u.live.add(x),{archive:new Proxy(h,{get(t,n){let r=b;if(!r)throw d()??Error(`${e.label} source archive is closed`);let i=_(()=>Reflect.get(r,n,r));return typeof i==`function`?(...t)=>{let r=b;if(!r)throw d()??Error(`${e.label} source archive is closed`);return _(()=>{let e=Reflect.get(r,n,r);return Reflect.apply(e,r,t)})}:i}}),sourceByteLength:t.byteLength,closeArchive(){if(y)return;y=!0,u?.live.delete(x);let t=b;b=void 0,t&&f(t,e.closeNative,_)}}}})}async function d(e){let t=new URL(e),n=globalThis.process;if(t.protocol===`file:`&&n?.versions?.node){let{readFile:e}=await import(`node:fs/promises`);return e(t)}return t}function f(e,t,n){let r,s=!1;try{n(()=>t(e))}catch(e){s=!0,r=e}if(a(r)||r instanceof i)o(e);else try{n(()=>e.free())}catch(t){s||(s=!0,r=t),(a(t)||t instanceof i)&&o(e)}if(s)throw r}function p(e,t,n){return t?(m(t,n),new Promise((r,i)=>{let a=()=>{o();try{m(t,n)}catch(e){i(e)}},o=()=>t.removeEventListener(`abort`,a);t.addEventListener(`abort`,a,{once:!0}),e.then(e=>{o(),r(e)},e=>{o(),i(e)})})):e}function m(e,t){if(!e?.aborted)return;let n=Error(`${t} direct source was aborted`);throw n.name=`AbortError`,n}function h(e){return typeof e==`string`?Error(e):e}function g(e,t){return u({label:`legacy PPT`,format:`ppt`,loadGlue:e,resolveWasm:t,construct:(e,t)=>new e.LegacyPptPresentation(t),closeNative:e=>e.close_presentation_session()})}function _(e,t){if(e!==void 0){if(typeof e!=`number`||!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} maxInputBytes is invalid`);return e}}function v(e,t){if(typeof e!=`object`||!e)throw TypeError(`${t} source module config must be an object`);let n=e;for(let e of Object.keys(n))if(e!==`wasmUrl`&&e!==`maxInputBytes`)throw TypeError(`${t} source module config has an unknown field`);let r=_(n.maxInputBytes,t);if(typeof n.wasmUrl!=`string`)throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`);return{wasmUrl:n.wasmUrl,...r===void 0?{}:{maxInputBytes:r}}}var y=n({LegacyPptPresentation:()=>N,default:()=>j,initSync:()=>A,reinit:()=>M});function b(){return{__proto__:null,"./legacy_ppt_direct_bg.js":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(C(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(C(e,t))}finally{H.__wbindgen_free(n,r,1)}},__wbg_length_9f1775224cf1d815:function(e){return e.length},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_prototypesetcall_a6b02eb00b0f4ce2:function(e,t,n){Uint8Array.prototype.set.call(x(e,t),n)},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=T(n,H.__wbindgen_malloc,H.__wbindgen_realloc),i=V;S().setInt32(e+4,i,!0),S().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return C(e,t)},__wbindgen_init_externref_table:function(){let e=H.__wbindgen_externrefs,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)}}}}function x(e,t){return e>>>=0,w().subarray(e/1,e/1+t)}function S(){return(F===null||F.buffer.detached===!0||F.buffer.detached===void 0&&F.buffer!==H.memory.buffer)&&(F=new DataView(H.memory.buffer)),F}function C(e,t){return e>>>=0,D(e,t)}function w(){return(I===null||I.byteLength===0)&&(I=new Uint8Array(H.memory.buffer)),I}function T(e,t,n){if(n===void 0){let n=B.encode(e),r=t(n.length,1)>>>0;return w().subarray(r,r+n.length).set(n),V=n.length,r}let r=e.length,i=t(r,1)>>>0,a=w(),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=w().subarray(i+o,i+r),a=B.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return V=o,i}function E(e){let t=H.__wbindgen_externrefs.get(e);return H.__externref_table_dealloc(e),t}function D(e,t){return z+=t,z>=R&&(L=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),L.decode(),z=t),L.decode(w().subarray(e,e+t))}function O(e,t){return H=e.exports,F=null,I=null,H.__wbindgen_start(),H}async function k(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.ok&&n(e.type)&&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 r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}function A(e){if(H!==void 0)return H;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=b();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),O(new WebAssembly.Instance(e,t),e)}async function j(e){if(H!==void 0)return H;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`));let t=b();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await k(await e,t);return O(n,r)}async function M(e){return H=void 0,F=null,I=null,j(e)}var N,P,F,I,L,R,z,B,V,H,U=t(()=>{N=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,P.unregister(this),e}free(){let e=this.__destroy_into_raw();H.__wbg_legacypptpresentation_free(e,0)}acknowledge_slide(e,t){let n=H.legacypptpresentation_acknowledge_slide(this.__wbg_ptr,e,t);if(n[1])throw E(n[0])}assert_healthy(){let e=H.legacypptpresentation_assert_healthy(this.__wbg_ptr);if(e[1])throw E(e[0])}cancel_slide(){let e=H.legacypptpresentation_cancel_slide(this.__wbg_ptr);if(e[1])throw E(e[0])}close_presentation_session(){let e=H.legacypptpresentation_close_presentation_session(this.__wbg_ptr);if(e[1])throw E(e[0])}extract_image(e){let t=T(e,H.__wbindgen_malloc,H.__wbindgen_realloc),n=V,r=H.legacypptpresentation_extract_image(this.__wbg_ptr,t,n);if(r[3])throw E(r[2]);var i=x(r[0],r[1]).slice();return H.__wbindgen_free(r[0],r[1]*1,1),i}constructor(e){let t=H.legacypptpresentation_new(e);if(t[2])throw E(t[1]);return this.__wbg_ptr=t[0]>>>0,P.register(this,this.__wbg_ptr,this),this}presentation_bootstrap(){let e=H.legacypptpresentation_presentation_bootstrap(this.__wbg_ptr);if(e[3])throw E(e[2]);var t=x(e[0],e[1]).slice();return H.__wbindgen_free(e[0],e[1]*1,1),t}pull_slide(e,t,n,r){let i=H.legacypptpresentation_pull_slide(this.__wbg_ptr,e,t,n,r);if(i[3])throw E(i[2]);var a=x(i[0],i[1]).slice();return H.__wbindgen_free(i[0],i[1]*1,1),a}slide_cursor_resource_usage(){let e=H.legacypptpresentation_slide_cursor_resource_usage(this.__wbg_ptr);if(e[3])throw E(e[2]);var t=x(e[0],e[1]).slice();return H.__wbindgen_free(e[0],e[1]*1,1),t}},Symbol.dispose&&(N.prototype[Symbol.dispose]=N.prototype.free),P=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>H.__wbg_legacypptpresentation_free(e>>>0,1)),F=null,I=null,L=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),L.decode(),R=2146435072,z=0,B=new TextEncoder,`encodeInto`in B||(B.encodeInto=function(e,t){let n=B.encode(e);return t.set(n),{read:e.length,written:n.length}}),V=0});const W=g(()=>Promise.resolve().then(()=>(U(),y)),d);async function G(e,t,n){let{wasmUrl:r,maxInputBytes:i}=v(t,`legacy PPT`);if(i!==void 0&&e.byteLength>i)throw RangeError(`legacy PPT input exceeds the configured size limit`);let a=await W.open(e,r,n);return Object.freeze({archive:a.archive,close:()=>a.closeArchive()})}export{G as openModelSource};
|
|
1
|
+
var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function i(e){let t=globalThis.WebAssembly?.RuntimeError;return t&&e instanceof t||e instanceof RangeError?!0:e instanceof Error?e.name===`RuntimeError`||e.name===`CompileError`||e.name===`LinkError`||e.name===`InternalError`||e.name===`OOMError`:!1}function a(e){try{if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let t=Reflect.get(e,`__destroy_into_raw`);typeof t==`function`&&Reflect.apply(t,e,[])}catch{}}const o=new WeakMap,s=new Set([`http:`,`https:`,`file:`,`blob:`,`data:`]);function c(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`);let n;try{n=new URL(e)}catch{throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`)}if(!s.has(n.protocol))throw TypeError(`${t} wasmUrl protocol is unsupported`);return e}function l(e){let t,n,s,l,u=()=>s??l?.failure,h=t=>{if(!i(t))throw m(t);let n=u()??new r(`${e.label} WASM runtime trapped and is unavailable`);if(l){l.failure??=n;for(let e of l.live)e.invalidate();l.live.clear()}else s=n;throw n},g=t=>{let n=u();if(n)throw n;try{return t()}catch(t){return h(e.mapNativeError?e.mapNativeError(t):t)}},_=r=>t?r===n?t:Promise.reject(Error(`${e.label} source engine is pinned to another WASM URL`)):(n=r,t=e.loadGlue().then(async t=>{if(l=o.get(t),l||(l={live:new Set},o.set(t,l)),l.failure)throw l.failure;try{let n=await e.resolveWasm(r);await t.default({module_or_path:n})}catch(e){return h(e)}return t}),t);return Object.freeze({async open(t,n,r,i){let s=u();if(s)throw s;let m=c(n,e.label);p(r,e.label);let v;try{v=await f(_(m),r,e.label)}catch(e){return h(e)}if(l=o.get(v),!l)throw Error(`${e.label} source runtime identity is unavailable`);if(l.failure)throw l.failure;p(r,e.label);let y;try{y=g(()=>e.construct(v,t,i)),p(r,e.label)}catch(t){if(y)try{d(y,e.closeNative,g)}catch{}throw t}let b=!1,x=y,S={invalidate(){let e=x;x=void 0,a(e)}};return l.live.add(S),{archive:new Proxy(y,{get(t,n){let r=x;if(!r)throw u()??Error(`${e.label} source archive is closed`);let i=g(()=>Reflect.get(r,n,r));return typeof i==`function`?(...t)=>{let r=x;if(!r)throw u()??Error(`${e.label} source archive is closed`);return g(()=>{let e=Reflect.get(r,n,r);return Reflect.apply(e,r,t)})}:i}}),sourceByteLength:t.byteLength,closeArchive(){if(b)return;b=!0,l?.live.delete(S);let t=x;x=void 0,t&&d(t,e.closeNative,g)}}}})}async function u(e){let t=new URL(e),n=globalThis.process;if(t.protocol===`file:`&&n?.versions?.node){let{readFile:e}=await import(`node:fs/promises`);return e(t)}return t}function d(e,t,n){let o,s=!1;try{n(()=>t(e))}catch(e){s=!0,o=e}if(i(o)||o instanceof r)a(e);else try{n(()=>e.free())}catch(t){s||(s=!0,o=t),(i(t)||t instanceof r)&&a(e)}if(s)throw o}function f(e,t,n){return t?(p(t,n),new Promise((r,i)=>{let a=()=>{o();try{p(t,n)}catch(e){i(e)}},o=()=>t.removeEventListener(`abort`,a);t.addEventListener(`abort`,a,{once:!0}),e.then(e=>{o(),r(e)},e=>{o(),i(e)})})):e}function p(e,t){if(!e?.aborted)return;let n=Error(`${t} direct source was aborted`);throw n.name=`AbortError`,n}function m(e){return typeof e==`string`?Error(e):e}function h(e,t){return typeof e==`string`?e.startsWith(`LEGACY_UNSUPPORTED_ENCRYPTION:`)?Error(`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`):e.startsWith(`UNSUPPORTED:`)?Error(`MODEL_SOURCE_UNSUPPORTED:${JSON.stringify({format:t,reason:`source-subset`})}`):Error(e):e}function g(e,t){return l({label:`legacy PPT`,mapNativeError:e=>h(e,`ppt`),loadGlue:e,resolveWasm:t,construct:(e,t)=>new e.LegacyPptPresentation(t),closeNative:e=>e.close_presentation_session()})}function _(e,t){if(e!==void 0){if(typeof e!=`number`||!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} maxInputBytes is invalid`);return e}}function v(e,t){if(typeof e!=`object`||!e)throw TypeError(`${t} source module config must be an object`);let n=e;for(let e of Object.keys(n))if(e!==`wasmUrl`&&e!==`maxInputBytes`)throw TypeError(`${t} source module config has an unknown field`);let r=_(n.maxInputBytes,t);if(typeof n.wasmUrl!=`string`)throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`);return{wasmUrl:n.wasmUrl,...r===void 0?{}:{maxInputBytes:r}}}var y=n({LegacyPptPresentation:()=>N,default:()=>j,initSync:()=>A,reinit:()=>M});function b(){return{__proto__:null,"./legacy_ppt_direct_bg.js":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(C(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(C(e,t))}finally{H.__wbindgen_free(n,r,1)}},__wbg_length_9f1775224cf1d815:function(e){return e.length},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_prototypesetcall_a6b02eb00b0f4ce2:function(e,t,n){Uint8Array.prototype.set.call(x(e,t),n)},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=T(n,H.__wbindgen_malloc,H.__wbindgen_realloc),i=V;S().setInt32(e+4,i,!0),S().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return C(e,t)},__wbindgen_init_externref_table:function(){let e=H.__wbindgen_externrefs,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)}}}}function x(e,t){return e>>>=0,w().subarray(e/1,e/1+t)}function S(){return(F===null||F.buffer.detached===!0||F.buffer.detached===void 0&&F.buffer!==H.memory.buffer)&&(F=new DataView(H.memory.buffer)),F}function C(e,t){return e>>>=0,D(e,t)}function w(){return(I===null||I.byteLength===0)&&(I=new Uint8Array(H.memory.buffer)),I}function T(e,t,n){if(n===void 0){let n=B.encode(e),r=t(n.length,1)>>>0;return w().subarray(r,r+n.length).set(n),V=n.length,r}let r=e.length,i=t(r,1)>>>0,a=w(),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=w().subarray(i+o,i+r),a=B.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return V=o,i}function E(e){let t=H.__wbindgen_externrefs.get(e);return H.__externref_table_dealloc(e),t}function D(e,t){return z+=t,z>=R&&(L=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),L.decode(),z=t),L.decode(w().subarray(e,e+t))}function O(e,t){return H=e.exports,F=null,I=null,H.__wbindgen_start(),H}async function k(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.ok&&n(e.type)&&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 r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}function A(e){if(H!==void 0)return H;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=b();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),O(new WebAssembly.Instance(e,t),e)}async function j(e){if(H!==void 0)return H;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`));let t=b();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await k(await e,t);return O(n,r)}async function M(e){return H=void 0,F=null,I=null,j(e)}var N,P,F,I,L,R,z,B,V,H,U=t(()=>{N=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,P.unregister(this),e}free(){let e=this.__destroy_into_raw();H.__wbg_legacypptpresentation_free(e,0)}acknowledge_slide(e,t){let n=H.legacypptpresentation_acknowledge_slide(this.__wbg_ptr,e,t);if(n[1])throw E(n[0])}assert_healthy(){let e=H.legacypptpresentation_assert_healthy(this.__wbg_ptr);if(e[1])throw E(e[0])}cancel_slide(){let e=H.legacypptpresentation_cancel_slide(this.__wbg_ptr);if(e[1])throw E(e[0])}close_presentation_session(){let e=H.legacypptpresentation_close_presentation_session(this.__wbg_ptr);if(e[1])throw E(e[0])}extract_image(e){let t=T(e,H.__wbindgen_malloc,H.__wbindgen_realloc),n=V,r=H.legacypptpresentation_extract_image(this.__wbg_ptr,t,n);if(r[3])throw E(r[2]);var i=x(r[0],r[1]).slice();return H.__wbindgen_free(r[0],r[1]*1,1),i}constructor(e){let t=H.legacypptpresentation_new(e);if(t[2])throw E(t[1]);return this.__wbg_ptr=t[0]>>>0,P.register(this,this.__wbg_ptr,this),this}presentation_bootstrap(){let e=H.legacypptpresentation_presentation_bootstrap(this.__wbg_ptr);if(e[3])throw E(e[2]);var t=x(e[0],e[1]).slice();return H.__wbindgen_free(e[0],e[1]*1,1),t}pull_slide(e,t,n,r){let i=H.legacypptpresentation_pull_slide(this.__wbg_ptr,e,t,n,r);if(i[3])throw E(i[2]);var a=x(i[0],i[1]).slice();return H.__wbindgen_free(i[0],i[1]*1,1),a}slide_cursor_resource_usage(){let e=H.legacypptpresentation_slide_cursor_resource_usage(this.__wbg_ptr);if(e[3])throw E(e[2]);var t=x(e[0],e[1]).slice();return H.__wbindgen_free(e[0],e[1]*1,1),t}},Symbol.dispose&&(N.prototype[Symbol.dispose]=N.prototype.free),P=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>H.__wbg_legacypptpresentation_free(e>>>0,1)),F=null,I=null,L=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),L.decode(),R=2146435072,z=0,B=new TextEncoder,`encodeInto`in B||(B.encodeInto=function(e,t){let n=B.encode(e);return t.set(n),{read:e.length,written:n.length}}),V=0});const W=g(()=>Promise.resolve().then(()=>(U(),y)),u);async function G(e,t,n){let{wasmUrl:r,maxInputBytes:i}=v(t,`legacy PPT`);if(i!==void 0&&e.byteLength>i)throw RangeError(`legacy PPT input exceeds the configured size limit`);let a=await W.open(e,r,n);return Object.freeze({archive:a.archive,close:()=>a.closeArchive()})}export{G as openModelSource};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};function r(e,t){return typeof e==`string`?e.startsWith(`LEGACY_UNSUPPORTED_ENCRYPTION:`)?Error(`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`):e.startsWith(`UNSUPPORTED:`)?Error(`MODEL_SOURCE_UNSUPPORTED:${JSON.stringify({format:t,reason:`source-subset`})}`):Error(e):e}var i=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function a(e){let t=globalThis.WebAssembly?.RuntimeError;return t&&e instanceof t||e instanceof RangeError?!0:e instanceof Error?e.name===`RuntimeError`||e.name===`CompileError`||e.name===`LinkError`||e.name===`InternalError`||e.name===`OOMError`:!1}function o(e){try{if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let t=Reflect.get(e,`__destroy_into_raw`);typeof t==`function`&&Reflect.apply(t,e,[])}catch{}}const s=new WeakMap,c=new Set([`http:`,`https:`,`file:`,`blob:`,`data:`]);function l(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`);let n;try{n=new URL(e)}catch{throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`)}if(!c.has(n.protocol))throw TypeError(`${t} wasmUrl protocol is unsupported`);return e}function u(e){let t,n,c,u,d=()=>c??u?.failure,g=t=>{if(!a(t))throw h(t);let n=d()??new i(`${e.label} WASM runtime trapped and is unavailable`);if(u){u.failure??=n;for(let e of u.live)e.invalidate();u.live.clear()}else c=n;throw n},_=t=>{let n=d();if(n)throw n;try{return t()}catch(t){return g(e.format?r(t,e.format):t)}},v=r=>t?r===n?t:Promise.reject(Error(`${e.label} source engine is pinned to another WASM URL`)):(n=r,t=e.loadGlue().then(async t=>{if(u=s.get(t),u||(u={live:new Set},s.set(t,u)),u.failure)throw u.failure;try{let n=await e.resolveWasm(r);await t.default({module_or_path:n})}catch(e){return g(e)}return t}),t);return Object.freeze({async open(t,n,r){let i=d();if(i)throw i;let a=l(n,e.label);m(r,e.label);let c;try{c=await p(v(a),r,e.label)}catch(e){return g(e)}if(u=s.get(c),!u)throw Error(`${e.label} source runtime identity is unavailable`);if(u.failure)throw u.failure;m(r,e.label);let h;try{h=_(()=>e.construct(c,t)),m(r,e.label)}catch(t){if(h)try{f(h,e.closeNative,_)}catch{}throw t}let y=!1,b=h,x={invalidate(){let e=b;b=void 0,o(e)}};return u.live.add(x),{archive:new Proxy(h,{get(t,n){let r=b;if(!r)throw d()??Error(`${e.label} source archive is closed`);let i=_(()=>Reflect.get(r,n,r));return typeof i==`function`?(...t)=>{let r=b;if(!r)throw d()??Error(`${e.label} source archive is closed`);return _(()=>{let e=Reflect.get(r,n,r);return Reflect.apply(e,r,t)})}:i}}),sourceByteLength:t.byteLength,closeArchive(){if(y)return;y=!0,u?.live.delete(x);let t=b;b=void 0,t&&f(t,e.closeNative,_)}}}})}async function d(e){let t=new URL(e),n=globalThis.process;if(t.protocol===`file:`&&n?.versions?.node){let{readFile:e}=await import(`node:fs/promises`);return e(t)}return t}function f(e,t,n){let r,s=!1;try{n(()=>t(e))}catch(e){s=!0,r=e}if(a(r)||r instanceof i)o(e);else try{n(()=>e.free())}catch(t){s||(s=!0,r=t),(a(t)||t instanceof i)&&o(e)}if(s)throw r}function p(e,t,n){return t?(m(t,n),new Promise((r,i)=>{let a=()=>{o();try{m(t,n)}catch(e){i(e)}},o=()=>t.removeEventListener(`abort`,a);t.addEventListener(`abort`,a,{once:!0}),e.then(e=>{o(),r(e)},e=>{o(),i(e)})})):e}function m(e,t){if(!e?.aborted)return;let n=Error(`${t} direct source was aborted`);throw n.name=`AbortError`,n}function h(e){return typeof e==`string`?Error(e):e}function g(e,t){return u({label:`legacy XLS`,format:`xls`,loadGlue:e,resolveWasm:t,construct:(e,t)=>new e.LegacyXlsWorkbook(t),closeNative:e=>e.close_workbook_session()})}function _(e,t){if(e!==void 0){if(typeof e!=`number`||!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} maxInputBytes is invalid`);return e}}function v(e,t){if(typeof e!=`object`||!e)throw TypeError(`${t} source module config must be an object`);let n=e;for(let e of Object.keys(n))if(e!==`wasmUrl`&&e!==`maxInputBytes`)throw TypeError(`${t} source module config has an unknown field`);let r=_(n.maxInputBytes,t);if(typeof n.wasmUrl!=`string`)throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`);return{wasmUrl:n.wasmUrl,...r===void 0?{}:{maxInputBytes:r}}}var y=n({LegacyXlsWorkbook:()=>P,default:()=>M,initSync:()=>j,reinit:()=>N});function b(){return{__proto__:null,"./legacy_xls_direct_bg.js":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(C(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(C(e,t))}finally{U.__wbindgen_free(n,r,1)}},__wbg_length_9f1775224cf1d815:function(e){return e.length},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_prototypesetcall_a6b02eb00b0f4ce2:function(e,t,n){Uint8Array.prototype.set.call(x(e,t),n)},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=E(n,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H;S().setInt32(e+4,i,!0),S().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return C(e,t)},__wbindgen_init_externref_table:function(){let e=U.__wbindgen_externrefs,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)}}}}function x(e,t){return e>>>=0,w().subarray(e/1,e/1+t)}function S(){return(I===null||I.buffer.detached===!0||I.buffer.detached===void 0&&I.buffer!==U.memory.buffer)&&(I=new DataView(U.memory.buffer)),I}function C(e,t){return e>>>=0,O(e,t)}function w(){return(L===null||L.byteLength===0)&&(L=new Uint8Array(U.memory.buffer)),L}function T(e){return e==null}function E(e,t,n){if(n===void 0){let n=V.encode(e),r=t(n.length,1)>>>0;return w().subarray(r,r+n.length).set(n),H=n.length,r}let r=e.length,i=t(r,1)>>>0,a=w(),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=w().subarray(i+o,i+r),a=V.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return H=o,i}function D(e){let t=U.__wbindgen_externrefs.get(e);return U.__externref_table_dealloc(e),t}function O(e,t){return B+=t,B>=z&&(R=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),R.decode(),B=t),R.decode(w().subarray(e,e+t))}function k(e,t){return U=e.exports,I=null,L=null,U.__wbindgen_start(),U}async function A(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.ok&&n(e.type)&&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 r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}function j(e){if(U!==void 0)return U;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=b();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),k(new WebAssembly.Instance(e,t),e)}async function M(e){if(U!==void 0)return U;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`));let t=b();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await A(await e,t);return k(n,r)}async function N(e){return U=void 0,I=null,L=null,M(e)}var P,F,I,L,R,z,B,V,H,U,W=t(()=>{P=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,F.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_legacyxlsworkbook_free(e,0)}acknowledge_sheet_cursor_terminal(){let e=U.legacyxlsworkbook_acknowledge_sheet_cursor_terminal(this.__wbg_ptr);if(e[1])throw D(e[0])}assert_healthy(){let e=U.legacyxlsworkbook_assert_healthy(this.__wbg_ptr);if(e[1])throw D(e[0])}cancel_sheet_cursor(){U.legacyxlsworkbook_cancel_sheet_cursor(this.__wbg_ptr)}close_sheet_cursor(){U.legacyxlsworkbook_close_sheet_cursor(this.__wbg_ptr)}close_workbook_session(){let e=U.legacyxlsworkbook_close_workbook_session(this.__wbg_ptr);if(e[1])throw D(e[0])}configure_host_layout(e){let t=U.legacyxlsworkbook_configure_host_layout(this.__wbg_ptr,!T(e),T(e)?0:e);if(t[1])throw D(t[0])}extract_image(e){let t=E(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.legacyxlsworkbook_extract_image(this.__wbg_ptr,t,n);if(r[3])throw D(r[2]);var i=x(r[0],r[1]).slice();return U.__wbindgen_free(r[0],r[1]*1,1),i}host_layout_request(){let e=U.legacyxlsworkbook_host_layout_request(this.__wbg_ptr);if(e[3])throw D(e[2]);var t=x(e[0],e[1]).slice();return U.__wbindgen_free(e[0],e[1]*1,1),t}constructor(e){let t=U.legacyxlsworkbook_new(e);if(t[2])throw D(t[1]);return this.__wbg_ptr=t[0]>>>0,F.register(this,this.__wbg_ptr,this),this}open_sheet_cursor(e,t){let n=E(t,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.legacyxlsworkbook_open_sheet_cursor(this.__wbg_ptr,e,n,r);if(i[1])throw D(i[0])}parse(){let e=U.legacyxlsworkbook_parse(this.__wbg_ptr);if(e[3])throw D(e[2]);var t=x(e[0],e[1]).slice();return U.__wbindgen_free(e[0],e[1]*1,1),t}pull_sheet_cursor(e){let t=U.legacyxlsworkbook_pull_sheet_cursor(this.__wbg_ptr,e);if(t[3])throw D(t[2]);var n=x(t[0],t[1]).slice();return U.__wbindgen_free(t[0],t[1]*1,1),n}sheet_cursor_pull_finished(){return U.legacyxlsworkbook_sheet_cursor_pull_finished(this.__wbg_ptr)!==0}},Symbol.dispose&&(P.prototype[Symbol.dispose]=P.prototype.free),F=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_legacyxlsworkbook_free(e>>>0,1)),I=null,L=null,R=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),R.decode(),z=2146435072,B=0,V=new TextEncoder,`encodeInto`in V||(V.encodeInto=function(e,t){let n=V.encode(e);return t.set(n),{read:e.length,written:n.length}}),H=0});const G=g(()=>Promise.resolve().then(()=>(W(),y)),d);async function K(e,t,n){let{wasmUrl:r,maxInputBytes:i}=v(t,`legacy XLS`);if(i!==void 0&&e.byteLength>i)throw RangeError(`legacy XLS input exceeds the configured size limit`);let a=await G.open(e,r,n);return Object.freeze({archive:a.archive,close:()=>a.closeArchive()})}export{K as openModelSource};
|
|
1
|
+
var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function i(e){let t=globalThis.WebAssembly?.RuntimeError;return t&&e instanceof t||e instanceof RangeError?!0:e instanceof Error?e.name===`RuntimeError`||e.name===`CompileError`||e.name===`LinkError`||e.name===`InternalError`||e.name===`OOMError`:!1}function a(e){try{if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let t=Reflect.get(e,`__destroy_into_raw`);typeof t==`function`&&Reflect.apply(t,e,[])}catch{}}const o=new WeakMap,s=new Set([`http:`,`https:`,`file:`,`blob:`,`data:`]);function c(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e)throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`);let n;try{n=new URL(e)}catch{throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`)}if(!s.has(n.protocol))throw TypeError(`${t} wasmUrl protocol is unsupported`);return e}function l(e){let t,n,s,l,u=()=>s??l?.failure,h=t=>{if(!i(t))throw m(t);let n=u()??new r(`${e.label} WASM runtime trapped and is unavailable`);if(l){l.failure??=n;for(let e of l.live)e.invalidate();l.live.clear()}else s=n;throw n},g=t=>{let n=u();if(n)throw n;try{return t()}catch(t){return h(e.mapNativeError?e.mapNativeError(t):t)}},_=r=>t?r===n?t:Promise.reject(Error(`${e.label} source engine is pinned to another WASM URL`)):(n=r,t=e.loadGlue().then(async t=>{if(l=o.get(t),l||(l={live:new Set},o.set(t,l)),l.failure)throw l.failure;try{let n=await e.resolveWasm(r);await t.default({module_or_path:n})}catch(e){return h(e)}return t}),t);return Object.freeze({async open(t,n,r,i){let s=u();if(s)throw s;let m=c(n,e.label);p(r,e.label);let v;try{v=await f(_(m),r,e.label)}catch(e){return h(e)}if(l=o.get(v),!l)throw Error(`${e.label} source runtime identity is unavailable`);if(l.failure)throw l.failure;p(r,e.label);let y;try{y=g(()=>e.construct(v,t,i)),p(r,e.label)}catch(t){if(y)try{d(y,e.closeNative,g)}catch{}throw t}let b=!1,x=y,S={invalidate(){let e=x;x=void 0,a(e)}};return l.live.add(S),{archive:new Proxy(y,{get(t,n){let r=x;if(!r)throw u()??Error(`${e.label} source archive is closed`);let i=g(()=>Reflect.get(r,n,r));return typeof i==`function`?(...t)=>{let r=x;if(!r)throw u()??Error(`${e.label} source archive is closed`);return g(()=>{let e=Reflect.get(r,n,r);return Reflect.apply(e,r,t)})}:i}}),sourceByteLength:t.byteLength,closeArchive(){if(b)return;b=!0,l?.live.delete(S);let t=x;x=void 0,t&&d(t,e.closeNative,g)}}}})}async function u(e){let t=new URL(e),n=globalThis.process;if(t.protocol===`file:`&&n?.versions?.node){let{readFile:e}=await import(`node:fs/promises`);return e(t)}return t}function d(e,t,n){let o,s=!1;try{n(()=>t(e))}catch(e){s=!0,o=e}if(i(o)||o instanceof r)a(e);else try{n(()=>e.free())}catch(t){s||(s=!0,o=t),(i(t)||t instanceof r)&&a(e)}if(s)throw o}function f(e,t,n){return t?(p(t,n),new Promise((r,i)=>{let a=()=>{o();try{p(t,n)}catch(e){i(e)}},o=()=>t.removeEventListener(`abort`,a);t.addEventListener(`abort`,a,{once:!0}),e.then(e=>{o(),r(e)},e=>{o(),i(e)})})):e}function p(e,t){if(!e?.aborted)return;let n=Error(`${t} direct source was aborted`);throw n.name=`AbortError`,n}function m(e){return typeof e==`string`?Error(e):e}function h(e,t){return typeof e==`string`?e.startsWith(`LEGACY_UNSUPPORTED_ENCRYPTION:`)?Error(`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`):e.startsWith(`UNSUPPORTED:`)?Error(`MODEL_SOURCE_UNSUPPORTED:${JSON.stringify({format:t,reason:`source-subset`})}`):Error(e):e}function g(e,t){return l({label:`legacy XLS`,mapNativeError:e=>h(e,`xls`),loadGlue:e,resolveWasm:t,construct:(e,t)=>new e.LegacyXlsWorkbook(t),closeNative:e=>e.close_workbook_session()})}function _(e,t){if(e!==void 0){if(typeof e!=`number`||!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} maxInputBytes is invalid`);return e}}function v(e,t){if(typeof e!=`object`||!e)throw TypeError(`${t} source module config must be an object`);let n=e;for(let e of Object.keys(n))if(e!==`wasmUrl`&&e!==`maxInputBytes`)throw TypeError(`${t} source module config has an unknown field`);let r=_(n.maxInputBytes,t);if(typeof n.wasmUrl!=`string`)throw TypeError(`${t} wasmUrl must be a nonempty absolute URL`);return{wasmUrl:n.wasmUrl,...r===void 0?{}:{maxInputBytes:r}}}var y=n({LegacyXlsWorkbook:()=>P,default:()=>M,initSync:()=>j,reinit:()=>N});function b(){return{__proto__:null,"./legacy_xls_direct_bg.js":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(C(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(C(e,t))}finally{U.__wbindgen_free(n,r,1)}},__wbg_length_9f1775224cf1d815:function(e){return e.length},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_prototypesetcall_a6b02eb00b0f4ce2:function(e,t,n){Uint8Array.prototype.set.call(x(e,t),n)},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=E(n,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H;S().setInt32(e+4,i,!0),S().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return C(e,t)},__wbindgen_init_externref_table:function(){let e=U.__wbindgen_externrefs,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)}}}}function x(e,t){return e>>>=0,w().subarray(e/1,e/1+t)}function S(){return(I===null||I.buffer.detached===!0||I.buffer.detached===void 0&&I.buffer!==U.memory.buffer)&&(I=new DataView(U.memory.buffer)),I}function C(e,t){return e>>>=0,O(e,t)}function w(){return(L===null||L.byteLength===0)&&(L=new Uint8Array(U.memory.buffer)),L}function T(e){return e==null}function E(e,t,n){if(n===void 0){let n=V.encode(e),r=t(n.length,1)>>>0;return w().subarray(r,r+n.length).set(n),H=n.length,r}let r=e.length,i=t(r,1)>>>0,a=w(),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=w().subarray(i+o,i+r),a=V.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return H=o,i}function D(e){let t=U.__wbindgen_externrefs.get(e);return U.__externref_table_dealloc(e),t}function O(e,t){return B+=t,B>=z&&(R=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),R.decode(),B=t),R.decode(w().subarray(e,e+t))}function k(e,t){return U=e.exports,I=null,L=null,U.__wbindgen_start(),U}async function A(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.ok&&n(e.type)&&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 r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}function j(e){if(U!==void 0)return U;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=b();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),k(new WebAssembly.Instance(e,t),e)}async function M(e){if(U!==void 0)return U;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`));let t=b();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await A(await e,t);return k(n,r)}async function N(e){return U=void 0,I=null,L=null,M(e)}var P,F,I,L,R,z,B,V,H,U,W=t(()=>{P=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,F.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_legacyxlsworkbook_free(e,0)}acknowledge_sheet_cursor_terminal(){let e=U.legacyxlsworkbook_acknowledge_sheet_cursor_terminal(this.__wbg_ptr);if(e[1])throw D(e[0])}assert_healthy(){let e=U.legacyxlsworkbook_assert_healthy(this.__wbg_ptr);if(e[1])throw D(e[0])}cancel_sheet_cursor(){U.legacyxlsworkbook_cancel_sheet_cursor(this.__wbg_ptr)}close_sheet_cursor(){U.legacyxlsworkbook_close_sheet_cursor(this.__wbg_ptr)}close_workbook_session(){let e=U.legacyxlsworkbook_close_workbook_session(this.__wbg_ptr);if(e[1])throw D(e[0])}configure_host_layout(e){let t=U.legacyxlsworkbook_configure_host_layout(this.__wbg_ptr,!T(e),T(e)?0:e);if(t[1])throw D(t[0])}extract_image(e){let t=E(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.legacyxlsworkbook_extract_image(this.__wbg_ptr,t,n);if(r[3])throw D(r[2]);var i=x(r[0],r[1]).slice();return U.__wbindgen_free(r[0],r[1]*1,1),i}host_layout_request(){let e=U.legacyxlsworkbook_host_layout_request(this.__wbg_ptr);if(e[3])throw D(e[2]);var t=x(e[0],e[1]).slice();return U.__wbindgen_free(e[0],e[1]*1,1),t}constructor(e){let t=U.legacyxlsworkbook_new(e);if(t[2])throw D(t[1]);return this.__wbg_ptr=t[0]>>>0,F.register(this,this.__wbg_ptr,this),this}open_sheet_cursor(e,t){let n=E(t,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.legacyxlsworkbook_open_sheet_cursor(this.__wbg_ptr,e,n,r);if(i[1])throw D(i[0])}parse(){let e=U.legacyxlsworkbook_parse(this.__wbg_ptr);if(e[3])throw D(e[2]);var t=x(e[0],e[1]).slice();return U.__wbindgen_free(e[0],e[1]*1,1),t}pull_sheet_cursor(e){let t=U.legacyxlsworkbook_pull_sheet_cursor(this.__wbg_ptr,e);if(t[3])throw D(t[2]);var n=x(t[0],t[1]).slice();return U.__wbindgen_free(t[0],t[1]*1,1),n}sheet_cursor_pull_finished(){return U.legacyxlsworkbook_sheet_cursor_pull_finished(this.__wbg_ptr)!==0}},Symbol.dispose&&(P.prototype[Symbol.dispose]=P.prototype.free),F=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_legacyxlsworkbook_free(e>>>0,1)),I=null,L=null,R=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),R.decode(),z=2146435072,B=0,V=new TextEncoder,`encodeInto`in V||(V.encodeInto=function(e,t){let n=V.encode(e);return t.set(n),{read:e.length,written:n.length}}),H=0});const G=g(()=>Promise.resolve().then(()=>(W(),y)),u);async function K(e,t,n){let{wasmUrl:r,maxInputBytes:i}=v(t,`legacy XLS`);if(i!==void 0&&e.byteLength>i)throw RangeError(`legacy XLS input exceeds the configured size limit`);let a=await G.open(e,r,n);return Object.freeze({archive:a.archive,close:()=>a.closeArchive()})}export{K as openModelSource};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/ppt.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./legacy-source-
|
|
1
|
+
import { n as e, r as t, t as n } from "./legacy-source-CFRuXN53.js";
|
|
2
2
|
//#region src/wasm-direct-ppt/legacy_ppt_direct_bg.wasm?url
|
|
3
3
|
var r = new URL("legacy_ppt_direct_bg.wasm", import.meta.url).href, i = new URL("legacy-ppt-source-module.mjs", import.meta.url).href;
|
|
4
4
|
//#endregion
|
package/dist/xls.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./legacy-source-
|
|
1
|
+
import { n as e, r as t, t as n } from "./legacy-source-CFRuXN53.js";
|
|
2
2
|
//#region src/wasm-direct-xls/legacy_xls_direct_bg.wasm?url
|
|
3
3
|
var r = new URL("legacy_xls_direct_bg.wasm", import.meta.url).href, i = new URL("legacy-xls-source-module.mjs", import.meta.url).href;
|
|
4
4
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silurus/ooxml-legacy-office",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.90.0",
|
|
4
4
|
"description": "Optional legacy Office (DOC/XLS/PPT) model sources for @silurus/ooxml",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Yuki Yokotani <silurus.dev@gmail.com>",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"typescript": "^7.0.2",
|
|
40
40
|
"vite": "^8.0.8",
|
|
41
41
|
"vitest": "^4.1.4",
|
|
42
|
-
"@silurus/ooxml-core": "0.
|
|
43
|
-
"@silurus/ooxml": "0.
|
|
42
|
+
"@silurus/ooxml-core": "0.90.0",
|
|
43
|
+
"@silurus/ooxml": "0.90.0"
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
46
46
|
"dist",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"wasm"
|
|
62
62
|
],
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@silurus/ooxml": "0.
|
|
64
|
+
"@silurus/ooxml": "0.90.0"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"wasm:direct-doc": "cd parser && wasm-pack build --target web --out-dir ../src/wasm-direct-doc --out-name legacy_doc_direct --features direct-doc && node ../../../scripts/append-wasm-reinit.mjs ../src/wasm-direct-doc/legacy_doc_direct.js",
|