@yukino.js/yukino 0.0.21-dev → 0.0.22
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/README.md +1 -1
- package/dist/{anthropic-LB4T3BEN.js → anthropic-5FTO3Q7W.js} +1 -1
- package/dist/browser/dist/static/{highlight-KNDEBJWF.js → highlight-7IMT657L.js} +9 -9
- package/dist/browser/dist/static/index.css +2 -2
- package/dist/browser/dist/static/index.js +81 -75
- package/dist/browser/dist/static/webapi-433PWHPB.js +4 -0
- package/dist/{chunk-NPIMUWFO.js → chunk-3FNHYMQD.js} +1 -1
- package/dist/{chunk-D6YQITPD.js → chunk-4UBQFHOG.js} +1 -1
- package/dist/{chunk-N7G2FDAI.js → chunk-5JFKXDO6.js} +1 -1
- package/dist/chunk-6YD572HB.js +4 -0
- package/dist/{chunk-XDERLDVW.js → chunk-7R67JSKQ.js} +1 -1
- package/dist/{chunk-FNQMXCCE.js → chunk-D5XGRVMZ.js} +1 -1
- package/dist/{chunk-WKKH2UE5.js → chunk-FOFOAOHI.js} +1 -1
- package/dist/{chunk-QYUIIFJY.js → chunk-GQKXEVHQ.js} +1 -1
- package/dist/{chunk-5D3QKHYQ.js → chunk-HNVICTWL.js} +1 -1
- package/dist/{chunk-7WP7SERS.js → chunk-HQ6FH7CR.js} +1 -1
- package/dist/{chunk-P6K7EQHF.js → chunk-I2KB6I3D.js} +2 -2
- package/dist/chunk-KBRCX7GE.js +30 -0
- package/dist/chunk-LLPVYWAK.js +10 -0
- package/dist/{chunk-2N7OIUQW.js → chunk-TVVVY2T4.js} +173 -173
- package/dist/{chunk-6SWKDCK3.js → chunk-WXCPYSJ3.js} +1 -1
- package/dist/{chunk-57IGGFHK.js → chunk-XB5QPPSI.js} +1 -1
- package/dist/{chunk-EQABLL4S.js → chunk-YWUBKWGK.js} +1 -1
- package/dist/{devtools-UVGRIXO2.js → devtools-BODX7K3L.js} +1 -1
- package/dist/{esm-HB7M3TZY.js → esm-4BJKCG42.js} +1 -1
- package/dist/{esm-63A57VQM.js → esm-AWTGQAUK.js} +1 -1
- package/dist/{esm-FURF4AWD.js → esm-JKMLEWEU.js} +1 -1
- package/dist/{esm-46K5BSA6.js → esm-MG7NDA4I.js} +1 -1
- package/dist/{esm-73AG4F4H.js → esm-NCNRWOJD.js} +1 -1
- package/dist/{esm-QAEO3U72.js → esm-QVP2GBDR.js} +1 -1
- package/dist/esm-ZR7DS25X.js +225 -0
- package/dist/file-type-Z4DPJWZH.js +12 -0
- package/dist/getMachineId-bsd-RSPO2LUX.js +4 -0
- package/dist/getMachineId-bsd-YMN7H6LU.js +4 -0
- package/dist/getMachineId-darwin-AOWQPOSH.js +5 -0
- package/dist/getMachineId-darwin-FEQVNOUN.js +5 -0
- package/dist/{getMachineId-win-2ZKMVYDE.js → getMachineId-win-H5SABCRW.js} +1 -1
- package/dist/{getMachineId-win-JOM5JSRW.js → getMachineId-win-RV3BPBHF.js} +1 -1
- package/dist/image-worker.js +1 -1
- package/dist/lib/{chunk-XVXFUSSS.js → chunk-IOPSBIYR.js} +1 -1
- package/dist/lib/index.d.ts +802 -802
- package/dist/lib/index.js +19 -17
- package/dist/lib/{providers-2NPR2VR4.js → providers-U3O7GOPH.js} +1 -1
- package/dist/{main-OMIZDIYB.js → main-BIBLUWZX.js} +219 -213
- package/dist/main.js +2 -2
- package/dist/{openai-UOCUBMFA.js → openai-AYEJOJTA.js} +1 -1
- package/dist/{providers-G5SKN22T.js → providers-USI6GYZC.js} +9 -9
- package/dist/{server-Z742CQSK.js → server-RGAJNHA4.js} +1 -1
- package/dist/{server-ESDMJACZ.js → server-XHQ7YJGI.js} +2 -2
- package/dist/{src-CHQYSTW5.js → src-E2NOTM6J.js} +1 -1
- package/dist/{src-HH6MC5CF.js → src-EBGRLYAR.js} +1 -1
- package/dist/{src-YWYPK5QA.js → src-HBBKRA75.js} +1 -1
- package/dist/src-P77FB5XW.js +12 -0
- package/dist/{turndown.es-NQ3KDXM7.js → turndown.es-E6SHSU5B.js} +13 -13
- package/package.json +2 -2
- package/dist/browser/dist/static/webapi-HZESKPJE.js +0 -4
- package/dist/chunk-5AOJ5ZSQ.js +0 -30
- package/dist/chunk-VM4YKTHC.js +0 -10
- package/dist/chunk-WKTO7XPO.js +0 -4
- package/dist/esm-6D27H27M.js +0 -225
- package/dist/file-type-PSFVPAEH.js +0 -12
- package/dist/getMachineId-bsd-2MDOCJCH.js +0 -4
- package/dist/getMachineId-bsd-L5XEQF74.js +0 -4
- package/dist/getMachineId-darwin-SMQEPEZ2.js +0 -5
- package/dist/getMachineId-darwin-V3OSZDJX.js +0 -5
- package/dist/src-P2WNZ6IY.js +0 -12
- /package/dist/{chunk-HKQWGX5S.js → chunk-UJIMMEIV.js} +0 -0
- /package/dist/{getMachineId-linux-OWR5YFVH.js → getMachineId-linux-337SESKP.js} +0 -0
- /package/dist/{getMachineId-linux-C4WJW6ZL.js → getMachineId-linux-P6HXMSZR.js} +0 -0
- /package/dist/{getMachineId-unsupported-M7AEHRA4.js → getMachineId-unsupported-52TDEFNE.js} +0 -0
- /package/dist/{getMachineId-unsupported-J7U5FNFT.js → getMachineId-unsupported-FWRH7XFO.js} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
+
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
+
import{b as ht}from"./chunk-CKOUBYG6.js";import"./chunk-VU3JWAJR.js";import{c as ft,e as ye}from"./chunk-7MKA3SHV.js";var Ce=ft(fe=>{"use strict";fe.read=function(i,e,t,r,n){var o,s,a=n*8-r-1,h=(1<<a)-1,c=h>>1,f=-7,p=t?n-1:0,k=t?-1:1,d=i[e+p];for(p+=k,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=o*256+i[e+p],p+=k,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=s*256+i[e+p],p+=k,f-=8);if(o===0)o=1-c;else{if(o===h)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-c}return(d?-1:1)*s*Math.pow(2,o-r)};fe.write=function(i,e,t,r,n,o){var s,a,h,c=o*8-n-1,f=(1<<c)-1,p=f>>1,k=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,g=r?1:-1,W=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),s+p>=1?e+=k/h:e+=k*Math.pow(2,1-p),e*h>=2&&(s++,h/=2),s+p>=f?(a=0,s=f):s+p>=1?(a=(e*h-1)*Math.pow(2,n),s=s+p):(a=e*Math.pow(2,p-1)*Math.pow(2,n),s=0));n>=8;i[t+d]=a&255,d+=g,a/=256,n-=8);for(s=s<<n|a,c+=n;c>0;i[t+d]=s&255,d+=g,s/=256,c-=8);i[t+d-g]|=W*128}});import{ReadableStream as yi}from"stream/web";import{pipeline as ot,PassThrough as ki,Readable as st}from"stream";import bi from"fs/promises";import{constants as at}from"fs";import{stat as gt}from"fs/promises";var pt="End-Of-Stream",m=class extends Error{constructor(){super(pt),this.name="EndOfStreamError"}},v=class extends Error{constructor(e="The operation was aborted"){super(e),this.name="AbortError"}};function L(i){if(i?.aborted)throw new v}var _=class extends RangeError{constructor(e,t){super(`Requested buffer size ${e} exceeds maxBufferSize ${t}`),this.requestedSize=e,this.maxBufferSize=t,this.name="BufferSizeError"}};function I(i){let e=i?.maxBufferSize??Number.POSITIVE_INFINITY;if(e!==Number.POSITIVE_INFINITY&&(!Number.isSafeInteger(e)||e<=0))throw new RangeError("maxBufferSize must be a positive safe integer or Infinity");return e}var C=class{constructor(e){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[],this.onCloseCallback=e?.onClose}async peek(e,t=!1){let r=await this.read(e,t);return this.peekQueue.push(e.subarray(0,r)),r}async read(e,t=!1){if(e.length===0)return 0;let r=this.readFromPeekBuffer(e);if(this.endOfStream||(r+=await this.readRemainderFromStream(e.subarray(r),t)),r===0&&!t)throw new m;return r}readFromPeekBuffer(e){let t=e.length,r=0;for(;this.peekQueue.length>0&&t>0;){let n=this.peekQueue.pop();if(!n)throw new Error("peekData should be defined");let o=Math.min(n.length,t);e.set(n.subarray(0,o),r),r+=o,t-=o,o<n.length&&this.peekQueue.push(n.subarray(o))}return r}async readRemainderFromStream(e,t){let r=0;for(;r<e.length&&!this.endOfStream;){if(this.interrupted)throw new v;let n=await this.readFromStream(e.subarray(r),t);if(n===0)break;r+=n}if(!t&&r<e.length)throw new m;return r}close(){return this.closePromise??(this.closePromise=Promise.resolve().then(async()=>{await this.closeResource(),await this.onCloseCallback?.()})),this.closePromise}closeResource(){return this.abort()}};var J=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise((e,t)=>{this.reject=t,this.resolve=e})}};function ke(){this.removeListener("close",be)}function be(){this.removeListener("error",ke)}var V=class extends C{constructor(e,t){if(super(t),this.s=e,this.pendingRequests=new Set,this.onEnd=()=>{this.endOfStream=!0,this.removeLifecycleListeners(),this.s.once("error",ke),this.s.once("close",be);for(let r of this.pendingRequests)this.removeRequest(r),r.deferred.resolve(0)},this.onError=r=>this.reject(r),this.onClose=()=>{this.removeLifecycleListeners(),this.endOfStream||this.abort()},!e.read||!e.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",this.onEnd),this.s.once("error",this.onError),this.s.once("close",this.onClose)}async readFromStream(e,t){if(e.length===0)return 0;let r=this.s.read(e.length);if(r)return e.set(r),r.length;let n={buffer:e,mayBeLess:t,deferred:new J,onReadable:()=>this.readDeferred(n)};return this.pendingRequests.add(n),this.s.once("readable",n.onReadable),n.deferred.promise}readDeferred(e){if(!(this.interrupted||!this.pendingRequests.has(e)))try{let t=this.s.read(e.buffer.length);if(!this.pendingRequests.has(e))return;t?(e.buffer.set(t),this.removeRequest(e),e.deferred.resolve(t.length)):this.s.once("readable",e.onReadable)}catch(t){this.reject(t instanceof Error?t:new Error(String(t)))}}removeRequest(e){this.s.removeListener("readable",e.onReadable),this.pendingRequests.delete(e)}removeLifecycleListeners(){this.s.removeListener("end",this.onEnd),this.s.removeListener("error",this.onError),this.s.removeListener("close",this.onClose)}reject(e){this.removeLifecycleListeners(),this.interrupted=!0,this.peekQueue=[];for(let t of this.pendingRequests)this.removeRequest(t),t.deferred.reject(e)}async abort(){this.reject(new v)}};var ee=class extends C{constructor(e,t){super(t),this.reader=e,this.released=!1}async abort(){this.released||(this.reader.releaseLock(),this.released=!0)}};var H=class extends ee{async readFromStream(e,t){if(e.length===0)return 0;let r=await this.reader.read(new Uint8Array(e.length),{min:t?void 0:e.length});return r.done&&(this.endOfStream=r.done),r.value?(e.set(r.value),r.value.length):0}};var j=class extends C{constructor(e,t){super(t),this.reader=e,this.buffer=null}writeChunk(e,t){let r=Math.min(t.length,e.length);return e.set(t.subarray(0,r)),r<t.length?this.buffer=t.subarray(r):this.buffer=null,r}async readFromStream(e,t){if(e.length===0)return 0;let r=0;for(this.buffer&&(r+=this.writeChunk(e,this.buffer));r<e.length&&!this.endOfStream;){let n=await this.reader.read();if(n.done){this.endOfStream=!0;break}n.value&&(r+=this.writeChunk(e.subarray(r),n.value))}if(!t&&r===0&&this.endOfStream)throw new m;return r}abort(){return this.interrupted=!0,this.reader.cancel()}async closeResource(){try{await this.abort()}finally{this.reader.releaseLock()}}};function se(i,e){try{let t=i.getReader({mode:"byob"});return t instanceof ReadableStreamDefaultReader?new j(t,e):new H(t,e)}catch(t){if(t instanceof TypeError)return new j(i.getReader(),e);throw t}}var T=class{constructor(e){this.numBuffer=new Uint8Array(10),this.position=0,this.maxBufferSize=I(e),L(e?.abortSignal),this.onClose=e?.onClose,e?.abortSignal&&this.addAbortListener(e.abortSignal,()=>{this.abort().catch(()=>{})})}addAbortListener(e,t){this.abortSignal=e,this.abortListener=t,e.addEventListener("abort",t,{once:!0})}removeAbortListener(){this.abortListener&&this.abortSignal?.removeEventListener("abort",this.abortListener),this.abortSignal=void 0,this.abortListener=void 0}async readToken(e,t=this.position){this.validateTokenRead(e.len,t);let r=new Uint8Array(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new m;return e.get(r,0)}async peekToken(e,t=this.position){let r=t??this.position;this.validateTokenRead(e.len,r,!0);let n=new Uint8Array(e.len);if(await this.peekBuffer(n,{position:r})<e.len)throw new m;return e.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new m;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new m;return e.get(this.numBuffer,0)}async ignore(e){if(e<0)throw new RangeError("ignore length must be \u2265 0 bytes");if(this.validateLength(e,"ignore length"),this.validateLength(this.position+e,"end position"),this.fileInfo.size!==void 0){let t=Math.max(0,this.fileInfo.size-this.position);if(e>t)return this.position+=t,t}return this.position+=e,e}close(){return this.closePromise||(this.removeAbortListener(),this.closePromise=Promise.resolve().then(()=>this.closeOnce())),this.closePromise}async closeOnce(){await this.abort(),await this.onClose?.()}validateLength(e,t){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)}validateBufferSize(e){if(this.validateLength(e,"buffer length"),e>this.maxBufferSize)throw new _(e,this.maxBufferSize)}validateTokenRead(e,t,r=!1){if(this.validateBufferSize(e),this.validateLength(t,"position"),this.validateLength(t+e,"end position"),!this.supportsRandomAccess()&&t<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(r&&!this.supportsRandomAccess()&&this.validateBufferSize(e+t-this.position),this.fileInfo.size!==void 0&&e>this.fileInfo.size-t)throw new m}normalizeOptions(e,t){let r=t?.length??e.length,n=t?.position??this.position;if(this.validateLength(r,"length"),this.validateLength(n,"position"),this.validateLength(n+r,"end position"),r>e.length)throw new RangeError("length must not exceed the target buffer length");if(!this.supportsRandomAccess()&&n<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return{length:r,position:n,mayBeLess:t?.mayBeLess??!1}}abort(){return this.removeAbortListener(),Promise.resolve()}};var te=class extends T{constructor(e,t){super(t),this.blob=e,this.fileInfo={...t?.fileInfo??{},size:e.size,mimeType:e.type}}async readBuffer(e,t){let r=this.normalizeOptions(e,t),n=await this.peekBuffer(e,r);return this.position=r.position+n,n}async peekBuffer(e,t){let r=this.normalizeOptions(e,t),n=Math.max(0,Math.min(this.blob.size-r.position,r.length));if(!r.mayBeLess&&n<r.length)throw new m;for(let o=0;o<n;){let s=Math.min(this.maxBufferSize,n-o),a=r.position+o,h=await this.blob.slice(a,a+s).arrayBuffer();e.set(new Uint8Array(h),o),o+=s}return n}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.validateLength(e,"position"),this.position=e}};var ie=class extends T{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){let r=this.normalizeOptions(e,t),n=await this.peekBuffer(e,r);return this.position=r.position+n,n}async peekBuffer(e,t){let r=this.normalizeOptions(e,t),n=Math.max(0,Math.min(this.uint8Array.length-r.position,r.length));if(!r.mayBeLess&&n<r.length)throw new m;return e.set(this.uint8Array.subarray(r.position,r.position+n)),n}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.validateLength(e,"position"),this.position=e}};var mt=256e3,G=class extends T{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.fileInfo??{}}async readBuffer(e,t){let r=this.normalizeOptions(e,t),n=r.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(r.length===0)return 0;let o=0;for(;o<r.length;){let s=Math.min(this.maxBufferSize,r.length-o),a=await this.streamReader.read(e.subarray(o,o+s),!0);if(o+=a,this.position+=a,a<s)break}if(!r.mayBeLess&&o<r.length)throw new m;return o}async peekBuffer(e,t){let r=this.normalizeOptions(e,t);if(r.length===0)return 0;if(this.fileInfo.size!==void 0&&r.position>=this.fileInfo.size){if(r.mayBeLess)return 0;throw new m}let n=r.length+r.position-this.position;this.validateBufferSize(n);let o=0;if(r.position){let s=r.position-this.position;if(s>0){let a=new Uint8Array(r.length+s);o=await this.peekBuffer(a,{mayBeLess:r.mayBeLess});let h=Math.max(0,o-s);return e.set(a.subarray(s,s+h)),h}if(s<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{let s=new Uint8Array(r.length);o=await this.streamReader.peek(s,!0),e.set(s.subarray(0,o))}catch(s){if(t?.mayBeLess&&s instanceof m)return 0;throw s}if(!r.mayBeLess&&o<r.length)throw new m}return o}async ignore(e){if(e<0)throw new RangeError("ignore length must be \u2265 0 bytes");if(this.validateLength(e,"ignore length"),this.validateLength(this.position+e,"end position"),e>0&&this.fileInfo.size!==void 0&&e>this.fileInfo.size-this.position)throw new m;let t=Math.min(mt,this.maxBufferSize,e),r=new Uint8Array(t),n=0;for(;n<e;){let o=e-n,s=await this.readBuffer(r,{length:Math.min(t,o)});if(s<0)return s;n+=s}return n}abort(){return this.removeAbortListener(),this.streamReader.abort()}async close(){return this.removeAbortListener(),this.streamReader.close()}supportsRandomAccess(){return!1}};function Se(i,e){I(e),L(e?.abortSignal);let t=new V(i);return new G(t,e)}function Ee(i,e){I(e),L(e?.abortSignal);let t=se(i);return new G(t,e)}function Te(i,e){return new ie(i,e)}function ve(i,e){return new te(i,e)}import{constants as Be}from"fs";import dt from"fs/promises";var Q=class extends Error{constructor(e){super(`Not a regular file: ${e}`),this.path=e,this.name="NotRegularFileError"}};var R=class i extends T{static async fromFile(e,t){I(t),L(t?.abortSignal);let r=t?.regularFileOnly?Be.O_RDONLY|Be.O_NONBLOCK:"r",n=await dt.open(e,r);try{let o=await n.stat();if(t?.regularFileOnly&&!o.isFile())throw new Q(e);return new i(n,{...t,fileInfo:{...t?.fileInfo,path:e,size:o.size}})}catch(o){throw await n.close(),o}}constructor(e,t){super(t),this.fileHandle=e,this.fileInfo=t.fileInfo}async readBuffer(e,t){let r=this.normalizeOptions(e,t);return this.position=r.position,this.readBufferAt(e,r,!0)}async peekBuffer(e,t){return this.readBufferAt(e,this.normalizeOptions(e,t),!1)}async readBufferAt(e,t,r){let n=0;for(;n<t.length;){let o=await this.fileHandle.read(e,n,t.length-n,t.position+n);if(n+=o.bytesRead,r&&(this.position+=o.bytesRead),o.bytesRead===0)break}if(!t.mayBeLess&&n<t.length)throw new m;return n}async closeOnce(){await this.fileHandle.close(),await super.closeOnce()}setPosition(e){this.validateLength(e,"position"),this.position=e}supportsRandomAccess(){return!0}};async function wt(i){i.pending!==!0||i.destroyed||i.errored!==null||await new Promise(e=>{let t=()=>{i.removeListener("open",t),i.removeListener("error",t),i.removeListener("close",t),e()};i.once("open",t),i.once("error",t),i.once("close",t)})}async function Ae(i,e){let t=Se(i,e);try{if(i.path){let r=await gt(i.path);t.fileInfo.path=i.path,t.fileInfo.size=r.size}return t}catch(r){throw await wt(i),await t.close(),r}}var Zr=R.fromFile;var Fe={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},ae={};for(let[i,e]of Object.entries(Fe))ae[e]=Number.parseInt(i,10);var $,q;function kt(){if($===void 0)try{$=typeof globalThis.TextDecoder>"u"?null:new globalThis.TextDecoder("utf-8")}catch{$=null}return $??void 0}function bt(){if(q===void 0)try{q=typeof globalThis.TextEncoder>"u"?null:new globalThis.TextEncoder}catch{q=null}return q??void 0}var Z=32*1024,S=65533;function ze(i,e="utf-8"){switch(e.toLowerCase()){case"utf-8":case"utf8":{let t=kt();return t?t.decode(i):Et(i)}case"utf-16le":return Tt(i);case"us-ascii":case"ascii":return vt(i);case"latin1":case"iso-8859-1":return Bt(i);case"windows-1252":return At(i);default:throw new RangeError(`Encoding '${e}' not supported`)}}function Ie(i="",e="utf-8"){switch(e.toLowerCase()){case"utf-8":case"utf8":{let t=bt();return t?t.encode(i):Ft(i)}case"utf-16le":return zt(i);case"us-ascii":case"ascii":return It(i);case"latin1":case"iso-8859-1":return Ct(i);case"windows-1252":return Dt(i);default:throw new RangeError(`Encoding '${e}' not supported`)}}function ce(i,e){e.length!==0&&(i.push(String.fromCharCode.apply(null,e)),e.length=0)}function b(i,e,t){e.push(t),e.length>=Z&&ce(i,e)}function St(i,e,t){if(t<=65535){b(i,e,t);return}t-=65536,b(i,e,55296+(t>>10)),b(i,e,56320+(t&1023))}function Et(i){let e=[],t=[],r=0;for(i.length>=3&&i[0]===239&&i[1]===187&&i[2]===191&&(r=3);r<i.length;){let n=i[r];if(n<=127){b(e,t,n),r++;continue}if(n<194||n>244){b(e,t,S),r++;continue}let o=n<=223?2:n<=239?3:4,s=n&127>>o,a=n===224?160:n===240?144:128,h=n===237?159:n===244?143:191,c=1;for(r++;c<o&&r<i.length;){let f=i[r];if(f<a||f>h)break;s=s<<6|f&63,c++,r++,a=128,h=191}St(e,t,c===o?s:S)}return ce(e,t),e.join("")}function Tt(i){let e=[],t=[],r=i.length,n=0;for(r>=2&&i[0]===255&&i[1]===254&&(n=2);n+1<r;){let o=i[n]|i[n+1]<<8;if(n+=2,o>=55296&&o<=56319){if(n+1<r){let s=i[n]|i[n+1]<<8;s>=56320&&s<=57343?(b(e,t,o),b(e,t,s),n+=2):b(e,t,S)}else b(e,t,S);continue}if(o>=56320&&o<=57343){b(e,t,S);continue}b(e,t,o)}return n<r&&b(e,t,S),ce(e,t),e.join("")}function vt(i){let e=[];for(let t=0;t<i.length;t+=Z){let r=Math.min(i.length,t+Z),n=new Array(r-t);for(let o=t,s=0;o<r;o++,s++)n[s]=i[o]&127;e.push(String.fromCharCode.apply(null,n))}return e.join("")}function Bt(i){let e=[];for(let t=0;t<i.length;t+=Z){let r=Math.min(i.length,t+Z),n=new Array(r-t);for(let o=t,s=0;o<r;o++,s++)n[s]=i[o];e.push(String.fromCharCode.apply(null,n))}return e.join("")}function At(i){let e=[],t="";for(let r=0;r<i.length;r++){let n=i[r],o=n>=128&&n<=159?Fe[n]:void 0;t+=o??String.fromCharCode(n),t.length>=Z&&(e.push(t),t="")}return t&&e.push(t),e.join("")}function Ft(i){let e=[];for(let t=0;t<i.length;t++){let r=i.charCodeAt(t);if(r>=55296&&r<=56319)if(t+1<i.length){let n=i.charCodeAt(t+1);n>=56320&&n<=57343?(r=65536+(r-55296<<10)+(n-56320),t++):r=S}else r=S;else r>=56320&&r<=57343&&(r=S);r<128?e.push(r):r<2048?e.push(192|r>>6,128|r&63):r<65536?e.push(224|r>>12,128|r>>6&63,128|r&63):e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|r&63)}return new Uint8Array(e)}function zt(i){let e=[];for(let r=0;r<i.length;r++){let n=i.charCodeAt(r);if(n>=55296&&n<=56319){if(r+1<i.length){let o=i.charCodeAt(r+1);o>=56320&&o<=57343?(e.push(n,o),r++):e.push(S)}else e.push(S);continue}if(n>=56320&&n<=57343){e.push(S);continue}e.push(n)}let t=new Uint8Array(e.length*2);for(let r=0;r<e.length;r++){let n=e[r],o=r*2;t[o]=n&255,t[o+1]=n>>>8}return t}function It(i){let e=new Uint8Array(i.length);for(let t=0;t<i.length;t++)e[t]=i.charCodeAt(t)&127;return e}function Ct(i){let e=new Uint8Array(i.length);for(let t=0;t<i.length;t++)e[t]=i.charCodeAt(t)&255;return e}function Dt(i){let e=new Uint8Array(i.length);for(let t=0;t<i.length;t++){let r=i[t],n=r.charCodeAt(0);if(ae[r]!==void 0){e[t]=ae[r];continue}if(n>=0&&n<=127||n>=160&&n<=255){e[t]=n;continue}e[t]=63}return e}var De=ye(Ce(),1);function w(i){return new DataView(i.buffer,i.byteOffset)}var Le={len:1,get(i,e){return w(i).getUint8(e)},put(i,e,t){return w(i).setUint8(e,t),e+1}},l={len:2,get(i,e){return w(i).getUint16(e,!0)},put(i,e,t){return w(i).setUint16(e,t,!0),e+2}},U={len:2,get(i,e){return w(i).getUint16(e)},put(i,e,t){return w(i).setUint16(e,t),e+2}};var u={len:4,get(i,e){return w(i).getUint32(e,!0)},put(i,e,t){return w(i).setUint32(e,t,!0),e+4}},he={len:4,get(i,e){return w(i).getUint32(e)},put(i,e,t){return w(i).setUint32(e,t),e+4}};var Re={len:4,get(i,e){return w(i).getInt32(e)},put(i,e,t){return w(i).setInt32(e,t),e+4}};var Ue={len:8,get(i,e){return w(i).getBigUint64(e,!0)},put(i,e,t){return w(i).setBigUint64(e,t,!0),e+8}};var y=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t=0){let r=e.subarray(t,t+this.len);return ze(r,this.encoding)}put(e,t,r){let n=Ie(r,this.encoding);if(n.length!==this.len)throw new RangeError(`Expected an encoded value of ${this.len} byte(s), got ${n.length}`);return e.set(n,t),t+this.len}};var Ne=ye(ht(),1);var O={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},pe={get(i){return{signature:u.get(i,0),compressedSize:u.get(i,8),uncompressedSize:u.get(i,12)}},len:16},Oe={get(i){let e=l.get(i,6);return{signature:u.get(i,0),minVersion:l.get(i,4),dataDescriptor:!!(e&8),compressedMethod:l.get(i,8),compressedSize:u.get(i,18),uncompressedSize:u.get(i,22),filenameLength:l.get(i,26),extraFieldLength:l.get(i,28),filename:null}},len:30},Me={get(i){return{signature:u.get(i,0),nrOfThisDisk:l.get(i,4),nrOfThisDiskWithTheStart:l.get(i,6),nrOfEntriesOnThisDisk:l.get(i,8),nrOfEntriesOfSize:l.get(i,10),sizeOfCd:u.get(i,12),offsetOfStartOfCd:u.get(i,16),zipFileCommentLength:l.get(i,20)}},len:22},Pe={get(i){let e=l.get(i,8);return{signature:u.get(i,0),minVersion:l.get(i,6),dataDescriptor:!!(e&8),compressedMethod:l.get(i,10),compressedSize:u.get(i,20),uncompressedSize:u.get(i,24),filenameLength:l.get(i,28),extraFieldLength:l.get(i,30),fileCommentLength:l.get(i,32),relativeOffsetOfLocalHeader:u.get(i,42),filename:null}},len:46};function _e(i){let e=new Uint8Array(u.len);return u.put(e,0,i),e}var B=(0,Ne.default)("tokenizer:inflate"),me=256*1024,Rt=_e(O.DataDescriptor),re=_e(O.EndOfCentralDirectory),M=class i{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(me)}async isZip(){return await this.peekSignature()===O.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(u)}async findEndOfCentralDirectoryLocator(){let e=this.tokenizer,t=Math.min(16*1024,e.fileInfo.size),r=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(r,{position:e.fileInfo.size-t});for(let n=r.length-4;n>=0;n--)if(r[n]===re[0]&&r[n+1]===re[1]&&r[n+2]===re[2]&&r[n+3]===re[3])return e.fileInfo.size-t+n;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){B("Cannot reading central-directory without random-read support");return}B("Reading central-directory...");let e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){B("Central-directory 32-bit signature found");let r=await this.tokenizer.readToken(Me,t),n=[];this.tokenizer.setPosition(r.offsetOfStartOfCd);for(let o=0;o<r.nrOfEntriesOfSize;++o){let s=await this.tokenizer.readToken(Pe);if(s.signature!==O.CentralFileHeader)throw new Error("Expected Central-File-Header signature");s.filename=await this.tokenizer.readToken(new y(s.filenameLength,"utf-8")),await this.tokenizer.ignore(s.extraFieldLength),await this.tokenizer.ignore(s.fileCommentLength),n.push(s),B(`Add central-directory file-entry: n=${o+1}/${n.length}: filename=${n[o].filename}`)}return this.tokenizer.setPosition(e),n}this.tokenizer.setPosition(e)}async unzip(e){let t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let r=!1;do{let n=await this.readLocalFileHeader();if(!n)break;let o=e(n);r=!!o.stop;let s;if(await this.tokenizer.ignore(n.extraFieldLength),n.dataDescriptor&&n.compressedSize===0){let a=[],h=me;B("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let c=-1;for(;c<0&&h===me;){h=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),c=Ut(this.syncBuffer.subarray(0,h),Rt);let f=c>=0?c:h;if(o.handler){let p=new Uint8Array(f);await this.tokenizer.readBuffer(p),a.push(p)}else await this.tokenizer.ignore(f)}B(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),o.handler&&await this.inflate(n,Ot(a),o.handler)}else o.handler?(B(`Reading compressed-file-data: ${n.compressedSize} bytes`),s=new Uint8Array(n.compressedSize),await this.tokenizer.readBuffer(s),await this.inflate(n,s,o.handler)):(B(`Ignoring compressed-file-data: ${n.compressedSize} bytes`),await this.tokenizer.ignore(n.compressedSize));if(B(`Reading data-descriptor at pos=${this.tokenizer.position}`),n.dataDescriptor&&(await this.tokenizer.readToken(pe)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-pe.len}`)}while(!r)}async iterateOverCentralDirectory(e,t){for(let r of e){let n=t(r);if(n.handler){this.tokenizer.setPosition(r.relativeOffsetOfLocalHeader);let o=await this.readLocalFileHeader();if(o){await this.tokenizer.ignore(o.extraFieldLength);let s=new Uint8Array(r.compressedSize);await this.tokenizer.readBuffer(s),await this.inflate(o,s,n.handler)}}if(n.stop)break}}async inflate(e,t,r){if(e.compressedMethod===0)return r(t);if(e.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);B(`Decompress filename=${e.filename}, compressed-size=${t.length}`);let n=await i.decompressDeflateRaw(t);return r(n)}static async decompressDeflateRaw(e){let t=new ReadableStream({start(o){o.enqueue(e),o.close()}}),r=new DecompressionStream("deflate-raw"),n=t.pipeThrough(r);try{let s=await new Response(n).arrayBuffer();return new Uint8Array(s)}catch(o){let s=o instanceof Error?`Failed to deflate ZIP entry: ${o.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(s)}}async readLocalFileHeader(){let e=await this.tokenizer.peekToken(u);if(e===O.LocalFileHeader){let t=await this.tokenizer.readToken(Oe);return t.filename=await this.tokenizer.readToken(new y(t.filenameLength,"utf-8")),t}if(e===O.CentralFileHeader)return!1;throw e===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}};function Ut(i,e){let t=i.length,r=e.length;if(r>t)return-1;for(let n=0;n<=t-r;n++){let o=!0;for(let s=0;s<r;s++)if(i[n+s]!==e[s]){o=!1;break}if(o)return n}return-1}function Ot(i){let e=i.reduce((n,o)=>n+o.length,0),t=new Uint8Array(e),r=0;for(let n of i)t.set(n,r),r+=n.length;return t}var K=class{constructor(e){this.tokenizer=e}inflate(){let e=this.tokenizer;return new ReadableStream({async pull(t){let r=new Uint8Array(1024),n=await e.readBuffer(r,{mayBeLess:!0});if(n===0){t.close();return}t.enqueue(r.subarray(0,n))}}).pipeThrough(new DecompressionStream("gzip"))}};var an={utf8:new globalThis.TextDecoder("utf8")};var cn=new globalThis.TextEncoder;var fn=Array.from({length:256},(i,e)=>e.toString(16).padStart(2,"0"));function ue(i){let{byteLength:e}=i;if(e===6)return i.getUint16(0)*2**32+i.getUint32(2);if(e===5)return i.getUint8(0)*2**32+i.getUint32(1);if(e===4)return i.getUint32(0);if(e===3)return i.getUint8(0)*2**16+i.getUint16(1);if(e===2)return i.getUint16(0);if(e===1)return i.getUint8(0)}function je(i,e){if(e==="utf-16le"){let t=[];for(let r=0;r<i.length;r++){let n=i.charCodeAt(r);t.push(n&255,n>>8&255)}return t}if(e==="utf-16be"){let t=[];for(let r=0;r<i.length;r++){let n=i.charCodeAt(r);t.push(n>>8&255,n&255)}return t}return[...i].map(t=>t.charCodeAt(0))}function $e(i,e=0){let t=Number.parseInt(new y(6).get(i,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(t))return!1;let r=256;for(let n=e;n<e+148;n++)r+=i[n];for(let n=e+156;n<e+512;n++)r+=i[n];return t===r}var qe={get:(i,e)=>i[e+3]&127|i[e+2]<<7|i[e+1]<<14|i[e]<<21,len:4};var Ze=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],We=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"];var P=4100,Mt=P-2,F=1024*1024,Ve=1024,Pt=2**31-1,E=16*1024*1024,oe=F,He=F,Nt=E,_t=1,Ge=100,le=E,Qe=64,Ke=oe,jt=256,$t=512,qt=E,Zt=512,Wt=512,Ye=256,Xe=oe,Je=oe,Vt=oe,et=E,Ht=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),Gt=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],Qt=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),z=class extends Error{};function Kt(i){let e=i?.streamReader;if(e?.constructor?.name!=="WebStreamByobReader")return i;let{reader:t}=e,r=async()=>{await t.cancel(),t.releaseLock()};return e.close=r,e.abort=async()=>{e.interrupted=!0,await r()},i}function de(i,e,t){if(!Number.isFinite(i)||i<0||i>e)throw new z(`${t} has invalid size ${i} (maximum ${e} bytes)`);return i}async function D(i,e,{maximumLength:t=E,reason:r="skip"}={}){let n=de(e,t,r);await i.ignore(n)}async function xe(i,e,t,{maximumLength:r=e.length,reason:n="read"}={}){let o=t?.length??e.length,s=de(o,r,n);return i.readBuffer(e,{...t,length:s})}async function Yt(i,{maximumLength:e=F}={}){let n=new ReadableStream({start(c){c.enqueue(i),c.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),o=[],s=0;try{for(;;){let{done:c,value:f}=await n.read();if(c)break;if(s+=f.length,s>e)throw await n.cancel(),new Error(`ZIP entry decompressed data exceeds ${e} bytes`);o.push(f)}}finally{n.releaseLock()}let a=new Uint8Array(s),h=0;for(let c of o)a.set(c,h),h+=c.length;return a}var nt=134695760,ne=16,Xt=ne-1;function Jt(i,e){if(i.length<ne)return-1;let t=i.length-ne;for(let r=0;r<=t;r++)if(u.get(i,r)===nt&&u.get(i,r+8)===e+r)return r;return-1}function ei(i){return(i.codePointAt(0)&32)!==0}function ti(i,e){let t=new Uint8Array(e),r=0;for(let n of i)t.set(n,r),r+=n.length;return t}async function ii(i,{shouldBuffer:e,maximumLength:t=F}={}){let{syncBuffer:r}=i,{length:n}=r,o=[],s=0;for(;;){let a=await i.tokenizer.peekBuffer(r,{mayBeLess:!0}),h=Jt(r.subarray(0,a),s),c=h>=0?0:a===n?Math.min(Xt,a-1):0,f=h>=0?h:a-c;if(f===0)break;if(s+=f,s>t)throw new Error(`ZIP entry compressed data exceeds ${t} bytes`);if(e){let p=new Uint8Array(f);await i.tokenizer.readBuffer(p),o.push(p)}else await i.tokenizer.ignore(f);if(h>=0)break}if(x(i.tokenizer)||(i.knownSizeDescriptorScannedBytes+=s),!!e)return ti(o,s)}function ri(i,e){return x(i.tokenizer)?Math.max(0,E-(i.tokenizer.position-e)):Math.max(0,F-i.knownSizeDescriptorScannedBytes)}async function ni(i,e,{shouldBuffer:t,maximumDescriptorLength:r=F}={}){if(e.dataDescriptor&&e.compressedSize===0)return ii(i,{shouldBuffer:t,maximumLength:r});if(!t){await D(i.tokenizer,e.compressedSize,{maximumLength:x(i.tokenizer)?F:i.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let n=pi(i.tokenizer);if(!Number.isFinite(e.compressedSize)||e.compressedSize<0||e.compressedSize>n)throw new Error(`ZIP entry compressed data exceeds ${n} bytes`);let o=new Uint8Array(e.compressedSize);return await i.tokenizer.readBuffer(o),o}M.prototype.inflate=async function(i,e,t){if(i.compressedMethod===0)return t(e);if(i.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${i.compressedMethod}`);let r=await Yt(e,{maximumLength:F});return t(r)};M.prototype.unzip=async function(i){let e=!1,t=0,r=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(Y(this.tokenizer,r,E))throw new z(`ZIP stream probing exceeds ${E} bytes`);let n=await this.readLocalFileHeader();if(!n)break;if(t++,t>Ve)throw new Error(`ZIP entry count exceeds ${Ve}`);let o=i(n);e=!!o.stop,await this.tokenizer.ignore(n.extraFieldLength);let s=await ni(this,n,{shouldBuffer:!!o.handler,maximumDescriptorLength:Math.min(F,ri(this,r))});if(o.handler&&await this.inflate(n,s,o.handler),n.dataDescriptor){let a=new Uint8Array(ne);if(await this.tokenizer.readBuffer(a),u.get(a,0)!==nt)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-a.length}`)}if(Y(this.tokenizer,r,E))throw new z(`ZIP stream probing exceeds ${E} bytes`)}while(!e)};function oi(i,e){let t=i.getReader(),r=0,n=!1,o=!1,s=async a=>{n||o||(o=!0,await t.cancel(a))};return new ReadableStream({async pull(a){if(r>=e){a.close(),await s();return}let{done:h,value:c}=await t.read();if(h||!c){n=!0,a.close();return}let f=e-r;if(c.length>f){a.enqueue(c.subarray(0,f)),r+=f,a.close(),await s();return}a.enqueue(c),r+=c.length},async cancel(a){await s(a)}})}async function si(i,e){return new N(e).fromBuffer(i)}async function ai(i,e){return new N(e).fromBlob(i)}function tt(i){switch(i=i.toLowerCase(),i){case"application/epub+zip":return{ext:"epub",mime:i};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:i};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:i};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:i};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:i};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:i};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:i};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:i};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:i};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:i};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:i};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:i};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:i};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:i};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:i};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:i};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function A(i,e,t){t={offset:0,...t};for(let[r,n]of e.entries())if(t.mask){if(n!==(t.mask[r]&i[r+t.offset]))return!1}else if(n!==i[r+t.offset])return!1;return!0}function ge(i){return Number.isFinite(i)?Math.max(1,Math.trunc(i)):P}function ci(i,e,t){return t===void 0?i.read(e):(t.throwIfAborted(),new Promise((r,n)=>{let o=()=>{t.removeEventListener("abort",s)},s=()=>{let a=t.reason;o(),(async()=>{try{await i.cancel(a)}catch{}})(),n(a)};t.addEventListener("abort",s,{once:!0}),(async()=>{try{let a=await i.read(e);o(),r(a)}catch(a){o(),n(a)}})()}))}function fi(i){return Number.isFinite(i)?Math.max(0,Math.min(Mt,Math.trunc(i))):0}function hi(i){return Number.isFinite(i)?Math.max(0,i):Number.MAX_SAFE_INTEGER}function x(i){let e=i.fileInfo.size;return!Number.isFinite(e)||e===Number.MAX_SAFE_INTEGER}function Y(i,e,t){return x(i)&&i.position-e>t}function pi(i){let e=i.fileInfo.size,t=Number.isFinite(e)?Math.max(0,e-i.position):Number.MAX_SAFE_INTEGER;return Math.min(t,Pt)}function mi(i){if(i instanceof m||i instanceof z)return!0;if(!(i instanceof Error))return!1;if(Ht.has(i.message)||Qt.has(i.code))return!0;for(let e of Gt)if(i.message.startsWith(e))return!0;return!1}function it(i,e=F){let t=[i.compressedSize,i.uncompressedSize];for(let r of t)if(!Number.isFinite(r)||r<0||r>e)return!1;return!0}function ui(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function li(i,e){e.startsWith("word/")&&(i.hasWordDirectory=!0),e.startsWith("ppt/")&&(i.hasPresentationDirectory=!0),e.startsWith("xl/")&&(i.hasSpreadsheetDirectory=!0),e.startsWith("3D/")&&e.endsWith(".model")&&(i.hasThreeDimensionalModelEntry=!0)}function rt(i){if(!(!i.hasContentTypesEntry||i.hasUnparseableContentTypes||i.isParsingContentTypes||i.hasParsedContentTypesEntry)){if(i.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(i.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(i.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(i.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}}function xi(i){let e=i.indexOf('.main+xml"');if(e===-1){let n="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return i.includes(`ContentType="${n}"`)?n:void 0}let t=i.slice(0,e),r=t.lastIndexOf('"');return t.slice(r+1)}async function di(i,e){return new N(e).fromTokenizer(i)}var N=class i{constructor(e){let t=fi(e?.mpegOffsetTolerance);this.options={...e,mpegOffsetTolerance:t},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(e){return Kt(Ee(e,this.getTokenizerOptions()))}async parseTokenizer(e,t=0){this.detectionReentryCount=t;let r=e.position;for(let n of this.detectors){let o;try{o=await n.detect(e)}catch(s){if(s instanceof m||s instanceof z)return;throw s}if(o)return o;if(r!==e.position)return}}async fromTokenizer(e){try{return await this.parseTokenizer(e)}finally{await e.close()}}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t?.length>1)return this.fromTokenizer(Te(t,this.getTokenizerOptions()))}async fromBlob(e){this.options.signal?.throwIfAborted();let t=ve(e,this.getTokenizerOptions());return this.fromTokenizer(t)}async fromStream(e){this.options.signal?.throwIfAborted();let t=this.createTokenizerFromWebStream(e);return this.fromTokenizer(t)}async toDetectionStream(e,t){let r=ge(t?.sampleSize??P),n,o,s=e.getReader({mode:"byob"});try{let{value:c,done:f}=await ci(s,new Uint8Array(r),this.options.signal);if(o=c,!f&&c)try{n=await this.fromBuffer(c.subarray(0,r))}catch(p){if(!(p instanceof m))throw p;n=void 0}o=c}finally{s.releaseLock()}let a=new TransformStream({async start(c){c.enqueue(o)},transform(c,f){f.enqueue(c)}}),h=e.pipeThrough(a);return h.fileType=n,h}async detectGzip(e){if(this.gzipProbeDepth>=_t)return{ext:"gz",mime:"application/gzip"};let t=new K(e),r=oi(t.inflate(),Nt),n=x(e),o,s,a,h;if(n){let c=new AbortController;o=setTimeout(()=>{c.abort(new DOMException(`Operation timed out after ${Ge} ms`,"TimeoutError"))},Ge),s=this.options.signal===void 0?c.signal:AbortSignal.any([this.options.signal,c.signal]),a=new i({...this.options,signal:s}),a.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{h=await(a??this).fromStream(r)}catch(c){if(c?.name==="AbortError"&&s?.reason?.name!=="TimeoutError")throw c}finally{clearTimeout(o),n||this.gzipProbeDepth--}return h?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(e,t){return A(this.buffer,e,t)}checkString(e,t){return this.check(je(e,t?.encoding),t)}detectConfident=async e=>{if(this.buffer=new Uint8Array(P),e.fileInfo.size===void 0&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,x(e)&&(await e.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(e);if(await e.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.detectionReentryCount>=Ye?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(e));if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(e);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await D(e,6,{maximumLength:6,reason:"ID3 header prefix"});let t=await e.readToken(qe),r=x(e);if(!Number.isFinite(t)||t<0||r&&(t>le||e.position+t>le))return;if(e.position+t>e.fileInfo.size)return r?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await D(e,t,{maximumLength:r?le:e.fileInfo.size,reason:"ID3 payload"})}catch(n){if(n instanceof m)return;throw n}return this.detectionReentryCount>=Ye?void 0:(this.detectionReentryCount++,this.parseTokenizer(e,this.detectionReentryCount))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let t,r=ui();try{await new M(e).unzip(n=>{li(r,n.filename);let o=n.filename==="[Content_Types].xml",s=rt(r);if(!o&&s)return t=s,{stop:!0};switch(n.filename){case"META-INF/mozilla.rsa":return t={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return t={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return it(n,He)?{async handler(a){let h=new TextDecoder("utf-8").decode(a).trim();t=tt(h)},stop:!0}:{};case"[Content_Types].xml":return r.hasContentTypesEntry=!0,it(n,He)?(r.isParsingContentTypes=!0,{async handler(a){let h=new TextDecoder("utf-8").decode(a),c=xi(h);c&&(t=tt(c)),r.hasParsedContentTypesEntry=!0,r.isParsingContentTypes=!1},stop:!0}):(r.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(n.filename)?(t={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(n){if(!mi(n))throw n;r.isParsingContentTypes&&(r.isParsingContentTypes=!1,r.hasUnparseableContentTypes=!0)}return t??rt(r)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);let t=new Uint8Array(8);return await e.readBuffer(t),A(t,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:A(t,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:A(t,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:A(t,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:A(t,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:A(t,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let t=await this.readTiffHeader(!1);if(t)return t}if(this.check([77,77])){let t=await this.readTiffHeader(!0);if(t)return t}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function t(){let h=await e.peekNumber(Le),c=128,f=0;for(;(h&c)===0&&c!==0;)++f,c>>=1;let p=new Uint8Array(f+1);return await xe(e,p,void 0,{maximumLength:p.length,reason:"EBML field"}),p}async function r(){let h=await t(),c=await t();c[0]^=128>>c.length-1;let f=Math.min(6,c.length),p=new DataView(h.buffer),k=new DataView(c.buffer,c.length-f,f);return{id:ue(p),len:ue(k)}}async function n(h){let c=0;for(;h>0;){if(c++,c>jt||Y(e,s,E))return;let f=e.position,p=await r();if(p.id===17026){if(p.len>Qe)return;let k=de(p.len,Qe,"EBML DocType");return(await e.readToken(new y(k))).replaceAll(/\00.*$/g,"")}if(x(e)&&(!Number.isFinite(p.len)||p.len<0||p.len>Ke)||(await D(e,p.len,{maximumLength:x(e)?Ke:e.fileInfo.size,reason:"EBML payload"}),--h,e.position<=f))return}}let o=await r(),s=e.position;switch(await n(o.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let t=he.get(this.buffer,4),r=U.get(this.buffer,6);if(t>0&&t<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(r>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){let t=new y(4,"latin1").get(this.buffer,2);if(t.match("^d*")&&t>=1e3&&t<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>"))return await e.ignore(8),await e.readToken(new y(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[`
|
|
5
|
+
`,"\r"," "," ","\0"].some(t=>this.checkString(t,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){let t={ext:"png",mime:"image/png"},r={ext:"apng",mime:"image/apng"};await e.ignore(8);async function n(){return{length:await e.readToken(Re),type:await e.readToken(new y(4,"latin1"))}}let o=x(e),s=e.position,a=0,h=!1;do{if(a++,a>$t||Y(e,s,qt))break;let c=e.position,f=await n();if(f.length<0)return;if(f.type==="IHDR"){if(f.length!==13)return;h=!0}switch(f.type){case"IDAT":return t;case"acTL":return r;default:if(!h&&f.type!=="CgBI")return;if(o&&f.length>Xe)return h&&ei(f.type)?t:void 0;try{await D(e,f.length+4,{maximumLength:o?Xe+4:e.fileInfo.size,reason:"PNG chunk payload"})}catch(p){if(!o&&(p instanceof z||p instanceof m))return t;throw p}}if(e.position<=c)break}while(e.position+8<e.fileInfo.size);return t}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/vnd.apache.arrow.file"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&(this.buffer[8]&96)!==0){let t=new y(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(t){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return t.startsWith("3g")?t.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString(`REGEDIT4\r
|
|
6
|
+
`))return{ext:"reg",mime:"application/x-ms-regedit"};if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){let t=!1;try{async function r(){let a=new Uint8Array(16);return await xe(e,a,void 0,{maximumLength:a.length,reason:"ASF header GUID"}),{id:a,size:Number(await e.readToken(Ue))}}await D(e,30,{maximumLength:30,reason:"ASF header prelude"});let n=x(e),o=e.position,s=0;for(;e.position+24<e.fileInfo.size&&(s++,!(s>Zt||Y(e,o,E)));){let a=e.position,h=await r(),c=h.size-24;if(!Number.isFinite(c)||c<0){t=!0;break}if(A(h.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let f=new Uint8Array(16);if(c-=await xe(e,f,void 0,{maximumLength:f.length,reason:"ASF stream type GUID"}),A(f,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(A(f,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}if(n&&c>Je){t=!0;break}if(await D(e,c,{maximumLength:n?Je:e.fileInfo.size,reason:"ASF header payload"}),e.position<=a){t=!0;break}}}catch(r){if(r instanceof m||r instanceof z)x(e)&&(t=!0);else throw r}return t?void 0:{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new y(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.checkString("<?xml ",{offset:2,encoding:"utf-16be"})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){let t=new DataView(this.buffer.buffer).getUint32(12,!0);if(t>12&&this.buffer.length>=t+16)try{let r=new TextDecoder().decode(this.buffer.subarray(16,t+16));if(JSON.parse(r).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:"jmp",mime:"application/x-jmp-data"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&$e(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){let t="utf-16le";return this.checkString("<?xml ",{offset:2,encoding:t})?{ext:"xml",mime:"application/xml"}:this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:t})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:this.checkString(`Windows Registry Editor Version 5.00\r
|
|
7
|
+
`,{offset:2,encoding:t})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async e=>{this.buffer=new Uint8Array(P);let t=hi(e.fileInfo.size);if(await e.peekBuffer(this.buffer,{length:Math.min(8,t),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,t),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let r=0;r<=this.options.mpegOffsetTolerance;++r){let n=this.scanMpeg(r);if(n)return n}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?U:l);switch(await this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(e){let t=await this.tokenizer.readToken(e?U:l);if(!(t>Wt)&&!(x(this.tokenizer)&&2+t*12>et))for(let r=0;r<t;++r){let n=await this.readTiffTag(e);if(n)return n}}async readTiffHeader(e){let t={ext:"tif",mime:"image/tiff"},r=(e?U:l).get(this.buffer,2),n=(e?he:u).get(this.buffer,4);if(r===42){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8){let a=(e?U:l).get(this.buffer,8),h=(e?U:l).get(this.buffer,10);if(a===28&&h===254||a===31&&h===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(x(this.tokenizer)&&n>Vt)return t;let o=x(this.tokenizer)?et:this.tokenizer.fileInfo.size;try{await D(this.tokenizer,n,{maximumLength:o,reason:"TIFF IFD offset"})}catch(a){if(a instanceof m)return;throw a}let s;try{s=await this.readTiffIFD(e)}catch(a){if(a instanceof m)return;throw a}return s??t}if(r===43)return t}scanMpeg(e){if(this.check([255,224],{offset:e,mask:[255,224]})){if(this.check([16],{offset:e+1,mask:[22]}))return this.check([8],{offset:e+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:e+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:e+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:e+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},gi=new Set(Ze),wi=new Set(We);function Si(i){return!(i instanceof RangeError)||i.message!=="offset is out of bounds"||typeof i.stack!="string"?!1:/strtok3[/\\]lib[/\\]stream[/\\]/.test(i.stack)}var X=class extends N{async fromStream(e){this.options.signal?.throwIfAborted();let t=await(e instanceof yi?this.createTokenizerFromWebStream(e):Ae(e,this.getTokenizerOptions()));try{return await super.fromTokenizer(t)}catch(r){if(Si(r))return;throw r}finally{e instanceof st&&!e.destroyed&&e.destroy()}}async fromFile(e){this.options.signal?.throwIfAborted();let t=await bi.open(e,at.O_RDONLY|at.O_NONBLOCK),r=await t.stat();if(!r.isFile()){await t.close();return}let n=new R(t,{...this.getTokenizerOptions(),fileInfo:{path:e,size:r.size}});return super.fromTokenizer(n)}async toDetectionStream(e,t={}){if(!(e instanceof st))return super.toDetectionStream(e,t);let{sampleSize:r=P}=t,{signal:n}=this.options,o=ge(r);return n?.throwIfAborted(),new Promise((s,a)=>{let h=!1,c=()=>{e.off("error",p),e.off("readable",d),n?.removeEventListener("abort",k)},f=(g,W)=>{h||(h=!0,c(),g(W))},p=g=>{f(a,g)},k=()=>{e.destroyed||e.destroy(),f(a,n.reason)},d=()=>{(async()=>{try{let g=new ki,W=ot?ot(e,g,()=>{}):e.pipe(g),ct=e.read(o)??e.read()??new Uint8Array(0);try{g.fileType=await this.fromBuffer(ct)}catch(we){we instanceof m?g.fileType=void 0:f(a,we)}f(s,W)}catch(g){f(a,g)}})()};e.on("error",p),e.once("readable",d),n?.addEventListener("abort",k,{once:!0})})}};async function Tn(i,e){return new X(e).fromFile(i,e)}async function vn(i,e){return new X(e).fromStream(i)}async function Bn(i,e={}){return new X(e).toDetectionStream(i,e)}export{X as FileTypeParser,ai as fileTypeFromBlob,si as fileTypeFromBuffer,Tn as fileTypeFromFile,vn as fileTypeFromStream,di as fileTypeFromTokenizer,Bn as fileTypeStream,gi as supportedExtensions,wi as supportedMimeTypes};
|
|
8
|
+
/*! Bundled license information:
|
|
9
|
+
|
|
10
|
+
ieee754/index.js:
|
|
11
|
+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
12
|
+
*/
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
+
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
+
import{b as r}from"./chunk-D5XGRVMZ.js";import{n as t,q as i}from"./chunk-456FRBGE.js";import"./chunk-7MKA3SHV.js";import{promises as n}from"fs";i();var o=5e3;async function a(){try{return(await n.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(e){t.debug(`error reading machine id: ${e}`)}try{return(await r("/bin/kenv",["-q","smbios.system.uuid"],{timeout:o})).stdout.trim()}catch(e){t.debug(`error reading machine id: ${e}`)}}export{a as getMachineId};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
+
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
+
import{b as r}from"./chunk-4UBQFHOG.js";import{n as t}from"./chunk-U6NE2CTP.js";import"./chunk-7MKA3SHV.js";import{promises as i}from"fs";var n=5e3;async function u(){try{return(await i.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(e){t.debug(`error reading machine id: ${e}`)}try{return(await r("/bin/kenv",["-q","smbios.system.uuid"],{timeout:n})).stdout.trim()}catch(e){t.debug(`error reading machine id: ${e}`)}}export{u as getMachineId};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
+
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
+
import{b as n}from"./chunk-D5XGRVMZ.js";import{n as r,q as o}from"./chunk-456FRBGE.js";import"./chunk-7MKA3SHV.js";o();var s=5e3;async function a(){try{let t=(await n("/usr/sbin/ioreg",["-rd1","-c","IOPlatformExpertDevice"],{timeout:s})).stdout.split(`
|
|
5
|
+
`).find(c=>c.includes("IOPlatformUUID"));if(!t)return;let i=t.split('" = "');if(i.length===2)return i[1].slice(0,-1)}catch(e){r.debug(`error reading machine id: ${e}`)}}export{a as getMachineId};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
+
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
+
import{b as n}from"./chunk-4UBQFHOG.js";import{n as r}from"./chunk-U6NE2CTP.js";import"./chunk-7MKA3SHV.js";var o=5e3;async function u(){try{let t=(await n("/usr/sbin/ioreg",["-rd1","-c","IOPlatformExpertDevice"],{timeout:o})).stdout.split(`
|
|
5
|
+
`).find(c=>c.includes("IOPlatformUUID"));if(!t)return;let i=t.split('" = "');if(i.length===2)return i[1].slice(0,-1)}catch(e){r.debug(`error reading machine id: ${e}`)}}export{u as getMachineId};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
3
|
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{a as s}from"./chunk-
|
|
4
|
+
import{a as s}from"./chunk-4UBQFHOG.js";import{n}from"./chunk-U6NE2CTP.js";import"./chunk-7MKA3SHV.js";import*as r from"process";async function d(){let c="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";r.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in r.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let i=(await s(`${e} ${c}`)).stdout.split("REG_SZ");if(i.length===2)return i[1].trim()}catch(t){n.debug(`error reading machine id: ${t}`)}}export{d as getMachineId};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
3
|
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{a as s}from"./chunk-
|
|
4
|
+
import{a as s}from"./chunk-D5XGRVMZ.js";import{n,q as o}from"./chunk-456FRBGE.js";import"./chunk-7MKA3SHV.js";import*as r from"process";o();async function m(){let c="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";r.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in r.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let i=(await s(`${e} ${c}`)).stdout.split("REG_SZ");if(i.length===2)return i[1].trim()}catch(t){n.debug(`error reading machine id: ${t}`)}}export{m as getMachineId};
|