tiro-notes 0.52.0 → 0.52.2
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/client/asset-manifest.json +2 -2
- package/client/index.html +1 -1
- package/client/static/js/{main.c51240f2.chunk.js → main.dd3b9cb6.chunk.js} +1 -1
- package/package.json +1 -1
- package/server/tiro-server.js +1 -1
- package/server/tiro-server.js.LICENSE.txt +11 -0
- package/server/841.tiro-server.js +0 -2
- package/server/841.tiro-server.js.LICENSE.txt +0 -1
|
@@ -4,6 +4,15 @@ object-assign
|
|
|
4
4
|
@license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
/*!
|
|
8
|
+
* Timm
|
|
9
|
+
*
|
|
10
|
+
* Immutability helpers with fast reads and acceptable writes.
|
|
11
|
+
*
|
|
12
|
+
* @copyright Guillermo Grau Panea 2016
|
|
13
|
+
* @license MIT
|
|
14
|
+
*/
|
|
15
|
+
|
|
7
16
|
/*!
|
|
8
17
|
* accepts
|
|
9
18
|
* Copyright(c) 2014 Jonathan Ong
|
|
@@ -284,6 +293,8 @@ object-assign
|
|
|
284
293
|
|
|
285
294
|
/*! https://mths.be/utf8js v2.1.2 by @mathias */
|
|
286
295
|
|
|
296
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
297
|
+
|
|
287
298
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
288
299
|
|
|
289
300
|
/**
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 841.tiro-server.js.LICENSE.txt */
|
|
2
|
-
exports.id=841,exports.ids=[841],exports.modules={72614(e,t,i){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;t.splice(1,0,i,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(r=n))}),t.splice(r,0,i)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=i(28153)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},28153(e,t,i){e.exports=function(e){function t(e){let i,r,o,a=null;function s(...e){if(!s.enabled)return;const n=s,r=Number(new Date),o=r-(i||r);n.diff=o,n.prev=i,n.curr=r,i=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(i,r)=>{if("%%"===i)return"%";a++;const o=t.formatters[r];if("function"==typeof o){const t=e[a];i=o.call(n,t),e.splice(a,1),a--}return i}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(r!==t.namespaces&&(r=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,i){const n=t(this.namespace+(void 0===i?":":i)+e);return n.log=this.log,n}function r(e,t){let i=0,n=0,r=-1,o=0;for(;i<e.length;)if(n<t.length&&(t[n]===e[i]||"*"===t[n]))"*"===t[n]?(r=n,o=i,n++):(i++,n++);else{if(-1===r)return!1;n=r+1,o++,i=o}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const i=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of i)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const i of t.skips)if(r(e,i))return!1;for(const i of t.names)if(r(e,i))return!0;return!1},t.humanize=i(848),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(i=>{t[i]=e[i]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let i=0;for(let t=0;t<e.length;t++)i=(i<<5)-i+e.charCodeAt(t),i|=0;return t.colors[Math.abs(i)%t.colors.length]},t.enable(t.load()),t}},28950(e,t,i){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=i(72614):e.exports=i(80108)},80108(e,t,i){const n=i(52018),r=i(39023);t.init=function(e){e.inspectOpts={};const i=Object.keys(t.inspectOpts);for(let n=0;n<i.length;n++)e.inspectOpts[i[n]]=t.inspectOpts[i[n]]},t.log=function(...e){return process.stderr.write(r.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(i){const{namespace:n,useColors:r}=this;if(r){const t=this.color,r="[3"+(t<8?t:"8;5;"+t),o=` ${r};1m${n} [0m`;i[0]=o+i[0].split("\n").join("\n"+o),i.push(r+"m+"+e.exports.humanize(this.diff)+"[0m")}else i[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+n+" "+i[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=i(27687);e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const i=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[i]=n,e},{}),e.exports=i(28153)(t);const{formatters:o}=e.exports;o.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},o.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}},848(e){var t=1e3,i=60*t,n=60*i,r=24*n,o=7*r;function a(e,t,i,n){var r=t>=1.5*i;return Math.round(e/i)+" "+n+(r?"s":"")}e.exports=function(e,s){s=s||{};var c,f,p=typeof e;if("string"===p&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(a){var s=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return s*o;case"days":case"day":case"d":return s*r;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*i;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===p&&isFinite(e))return s.long?(c=e,(f=Math.abs(c))>=r?a(c,f,r,"day"):f>=n?a(c,f,n,"hour"):f>=i?a(c,f,i,"minute"):f>=t?a(c,f,t,"second"):c+" ms"):function(e){var o=Math.abs(e);return o>=r?Math.round(e/r)+"d":o>=n?Math.round(e/n)+"h":o>=i?Math.round(e/i)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},251(e,t){t.L=function(e,t,i,n,r){var o,a,s=8*r-n-1,c=(1<<s)-1,f=c>>1,p=-7,m=i?r-1:0,h=i?-1:1,u=e[t+m];for(m+=h,o=u&(1<<-p)-1,u>>=-p,p+=s;p>0;o=256*o+e[t+m],m+=h,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=256*a+e[t+m],m+=h,p-=8);if(0===o)o=1-f;else{if(o===c)return a?NaN:1/0*(u?-1:1);a+=Math.pow(2,n),o-=f}return(u?-1:1)*a*Math.pow(2,o-n)},t.M=function(e,t,i,n,r,o){var a,s,c,f=8*o-r-1,p=(1<<f)-1,m=p>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,u=n?0:o-1,l=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=p):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+m>=1?h/c:h*Math.pow(2,1-m))*c>=2&&(a++,c/=2),a+m>=p?(s=0,a=p):a+m>=1?(s=(t*c-1)*Math.pow(2,r),a+=m):(s=t*Math.pow(2,m-1)*Math.pow(2,r),a=0));r>=8;e[i+u]=255&s,u+=l,s/=256,r-=8);for(a=a<<r|s,f+=r;f>0;e[i+u]=255&a,u+=l,a/=256,f-=8);e[i+u-l]|=128*d}},7841(e,t,i){"use strict";i.d(t,{fileTypeFromBuffer:()=>we}),i(37830),i(57075),i(51455),i(73024);class n extends Error{constructor(){super("End-Of-Stream"),this.name="EndOfStreamError"}}class r extends Error{constructor(e="The operation was aborted"){super(e),this.name="AbortError"}}class o{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(e,t=!1){const i=await this.read(e,t);return this.peekQueue.push(e.subarray(0,i)),i}async read(e,t=!1){if(0===e.length)return 0;let i=this.readFromPeekBuffer(e);if(this.endOfStream||(i+=await this.readRemainderFromStream(e.subarray(i),t)),0===i&&!t)throw new n;return i}readFromPeekBuffer(e){let t=e.length,i=0;for(;this.peekQueue.length>0&&t>0;){const n=this.peekQueue.pop();if(!n)throw new Error("peekData should be defined");const r=Math.min(n.length,t);e.set(n.subarray(0,r),i),i+=r,t-=r,r<n.length&&this.peekQueue.push(n.subarray(r))}return i}async readRemainderFromStream(e,t){let i=0;for(;i<e.length&&!this.endOfStream;){if(this.interrupted)throw new r;const n=await this.readFromStream(e.subarray(i),t);if(0===n)break;i+=n}if(!t&&i<e.length)throw new n;return i}}class a extends o{constructor(e){super(),this.reader=e}async abort(){return this.close()}async close(){this.reader.releaseLock()}}class s extends a{async readFromStream(e,t){if(0===e.length)return 0;const i=await this.reader.read(new Uint8Array(e.length),{min:t?void 0:e.length});return i.done&&(this.endOfStream=i.done),i.value?(e.set(i.value),i.value.length):0}}class c extends o{constructor(e){super(),this.reader=e,this.buffer=null}writeChunk(e,t){const i=Math.min(t.length,e.length);return e.set(t.subarray(0,i)),i<t.length?this.buffer=t.subarray(i):this.buffer=null,i}async readFromStream(e,t){if(0===e.length)return 0;let i=0;for(this.buffer&&(i+=this.writeChunk(e,this.buffer));i<e.length&&!this.endOfStream;){const t=await this.reader.read();if(t.done){this.endOfStream=!0;break}t.value&&(i+=this.writeChunk(e.subarray(i),t.value))}if(!t&&0===i&&this.endOfStream)throw new n;return i}abort(){return this.interrupted=!0,this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}class f{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e?.onClose,e?.abortSignal&&e.abortSignal.addEventListener("abort",()=>{this.abort()})}async readToken(e,t=this.position){const i=new Uint8Array(e.len);if(await this.readBuffer(i,{position:t})<e.len)throw new n;return e.get(i,0)}async peekToken(e,t=this.position){const i=new Uint8Array(e.len);if(await this.peekBuffer(i,{position:t})<e.len)throw new n;return e.get(i,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new n;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new n;return e.get(this.numBuffer,0)}async ignore(e){if(e<0)throw new RangeError("ignore length must be ≥ 0 bytes");if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){await this.abort(),await(this.onClose?.())}normalizeOptions(e,t){if(!this.supportsRandomAccess()&&t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return{mayBeLess:!1,offset:0,length:e.length,position:this.position,...t}}abort(){return Promise.resolve()}}class p extends f{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.fileInfo??{}}async readBuffer(e,t){const i=this.normalizeOptions(e,t),r=i.position-this.position;if(r>0)return await this.ignore(r),this.readBuffer(e,t);if(r<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===i.length)return 0;const o=await this.streamReader.read(e.subarray(0,i.length),i.mayBeLess);if(this.position+=o,(!t||!t.mayBeLess)&&o<i.length)throw new n;return o}async peekBuffer(e,t){const i=this.normalizeOptions(e,t);let r=0;if(i.position){const t=i.position-this.position;if(t>0){const n=new Uint8Array(i.length+t);return r=await this.peekBuffer(n,{mayBeLess:i.mayBeLess}),e.set(n.subarray(t)),r-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(i.length>0){try{r=await this.streamReader.peek(e.subarray(0,i.length),i.mayBeLess)}catch(e){if(t?.mayBeLess&&e instanceof n)return 0;throw e}if(!i.mayBeLess&&r<i.length)throw new n}return r}async ignore(e){if(e<0)throw new RangeError("ignore length must be ≥ 0 bytes");const t=Math.min(256e3,e),i=new Uint8Array(t);let n=0;for(;n<e;){const r=e-n,o=await this.readBuffer(i,{length:Math.min(t,r)});if(o<0)return o;n+=o}return n}abort(){return this.streamReader.abort()}async close(){return this.streamReader.close()}supportsRandomAccess(){return!1}}class m extends f{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){t?.position&&(this.position=t.position);const i=await this.peekBuffer(e,t);return this.position+=i,i}async peekBuffer(e,t){const i=this.normalizeOptions(e,t),r=Math.min(this.uint8Array.length-i.position,i.length);if(!i.mayBeLess&&r<i.length)throw new n;return e.set(this.uint8Array.subarray(i.position,i.position+r)),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}class h extends f{constructor(e,t){super(t),this.blob=e,this.fileInfo={...t?.fileInfo??{},size:e.size,mimeType:e.type}}async readBuffer(e,t){t?.position&&(this.position=t.position);const i=await this.peekBuffer(e,t);return this.position+=i,i}async peekBuffer(e,t){const i=this.normalizeOptions(e,t),r=Math.min(this.blob.size-i.position,i.length);if(!i.mayBeLess&&r<i.length)throw new n;const o=await this.blob.slice(i.position,i.position+r).arrayBuffer();return e.set(new Uint8Array(o)),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}i(251);const u={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},l={};for(const[e,t]of Object.entries(u))l[t]=Number.parseInt(e,10);let d;const g=32768,x=65533;function w(e,t){0!==t.length&&(e.push(String.fromCharCode.apply(null,t)),t.length=0)}function k(e,t,i){t.push(i),t.length>=g&&w(e,t)}function y(e,t,i){i<=65535?k(e,t,i):(k(e,t,55296+((i-=65536)>>10)),k(e,t,56320+(1023&i)))}function b(e){return new DataView(e.buffer,e.byteOffset)}const v={len:1,get:(e,t)=>b(e).getUint8(t),put:(e,t,i)=>(b(e).setUint8(t,i),t+1)},C={len:2,get:(e,t)=>b(e).getUint16(t,!0),put:(e,t,i)=>(b(e).setUint16(t,i,!0),t+2)},z={len:2,get:(e,t)=>b(e).getUint16(t),put:(e,t,i)=>(b(e).setUint16(t,i),t+2)},S={len:4,get:(e,t)=>b(e).getUint32(t,!0),put:(e,t,i)=>(b(e).setUint32(t,i,!0),t+4)},F={len:4,get:(e,t)=>b(e).getUint32(t),put:(e,t,i)=>(b(e).setUint32(t,i),t+4)},T={len:4,get:(e,t)=>b(e).getInt32(t),put:(e,t,i)=>(b(e).setInt32(t,i),t+4)},E={len:8,get:(e,t)=>b(e).getBigUint64(t,!0),put:(e,t,i)=>(b(e).setBigUint64(t,i,!0),t+8)};class B{constructor(e,t){this.len=e,this.encoding=t}get(e,t=0){return function(e,t="utf-8"){switch(t.toLowerCase()){case"utf-8":case"utf8":{const t=function(){if(void 0!==globalThis.TextDecoder)return null!=d?d:d=new globalThis.TextDecoder("utf-8")}();return t?t.decode(e):function(e){const t=[],i=[];let n=0;for(e.length>=3&&239===e[0]&&187===e[1]&&191===e[2]&&(n=3);n<e.length;){const r=e[n];if(r<=127){k(t,i,r),n++;continue}if(r<194||r>244){k(t,i,x),n++;continue}if(r<=223){if(n+1>=e.length){k(t,i,x),n++;continue}const o=e[n+1];if(128!=(192&o)){k(t,i,x),n++;continue}k(t,i,(31&r)<<6|63&o),n+=2;continue}if(r<=239){if(n+2>=e.length){k(t,i,x),n++;continue}const o=e[n+1],a=e[n+2];if(128!=(192&o)||128!=(192&a)||224===r&&o<160||237===r&&o>=160){k(t,i,x),n++;continue}k(t,i,(15&r)<<12|(63&o)<<6|63&a),n+=3;continue}if(n+3>=e.length){k(t,i,x),n++;continue}const o=e[n+1],a=e[n+2],s=e[n+3];128!=(192&o)||128!=(192&a)||128!=(192&s)||240===r&&o<144||244===r&&o>143?(k(t,i,x),n++):(y(t,i,(7&r)<<18|(63&o)<<12|(63&a)<<6|63&s),n+=4)}return w(t,i),t.join("")}(e)}case"utf-16le":return function(e){const t=[],i=[],n=e.length;let r=0;for(;r+1<n;){const o=e[r]|e[r+1]<<8;if(r+=2,o>=55296&&o<=56319)if(r+1<n){const n=e[r]|e[r+1]<<8;n>=56320&&n<=57343?(k(t,i,o),k(t,i,n),r+=2):k(t,i,x)}else k(t,i,x);else k(t,i,o>=56320&&o<=57343?x:o)}return r<n&&k(t,i,x),w(t,i),t.join("")}(e);case"us-ascii":case"ascii":return function(e){const t=[];for(let i=0;i<e.length;i+=g){const n=Math.min(e.length,i+g),r=new Array(n-i);for(let t=i,o=0;t<n;t++,o++)r[o]=127&e[t];t.push(String.fromCharCode.apply(null,r))}return t.join("")}(e);case"latin1":case"iso-8859-1":return function(e){const t=[];for(let i=0;i<e.length;i+=g){const n=Math.min(e.length,i+g),r=new Array(n-i);for(let t=i,o=0;t<n;t++,o++)r[o]=e[t];t.push(String.fromCharCode.apply(null,r))}return t.join("")}(e);case"windows-1252":return function(e){const t=[];let i="";for(let n=0;n<e.length;n++){const r=e[n],o=r>=128&&r<=159?u[r]:void 0;i+=null!=o?o:String.fromCharCode(r),i.length>=g&&(t.push(i),i="")}return i&&t.push(i),t.join("")}(e);default:throw new RangeError(`Encoding '${t}' not supported`)}}(e.subarray(t,t+this.len),this.encoding)}}var A=i(28950);const I=67324752,M=33639248,L={get:e=>({signature:S.get(e,0),compressedSize:S.get(e,8),uncompressedSize:S.get(e,12)}),len:16},D={get(e){const t=C.get(e,6);return{signature:S.get(e,0),minVersion:C.get(e,4),dataDescriptor:!!(8&t),compressedMethod:C.get(e,8),compressedSize:S.get(e,18),uncompressedSize:S.get(e,22),filenameLength:C.get(e,26),extraFieldLength:C.get(e,28),filename:null}},len:30},O={get:e=>({signature:S.get(e,0),nrOfThisDisk:C.get(e,4),nrOfThisDiskWithTheStart:C.get(e,6),nrOfEntriesOnThisDisk:C.get(e,8),nrOfEntriesOfSize:C.get(e,10),sizeOfCd:S.get(e,12),offsetOfStartOfCd:S.get(e,16),zipFileCommentLength:C.get(e,20)}),len:22},j={get(e){const t=C.get(e,8);return{signature:S.get(e,0),minVersion:C.get(e,6),dataDescriptor:!!(8&t),compressedMethod:C.get(e,10),compressedSize:S.get(e,20),uncompressedSize:S.get(e,24),filenameLength:C.get(e,28),extraFieldLength:C.get(e,30),fileCommentLength:C.get(e,32),relativeOffsetOfLocalHeader:S.get(e,42),filename:null}},len:46};function U(e){const t=new Uint8Array(S.len);return S.put(t,0,e),t}const P=A("tokenizer:inflate"),R=262144,N=U(134695760),$=U(101010256);class q{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(R)}async isZip(){return await this.peekSignature()===I}peekSignature(){return this.tokenizer.peekToken(S)}async findEndOfCentralDirectoryLocator(){const e=this.tokenizer,t=Math.min(16384,e.fileInfo.size),i=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(i,{position:e.fileInfo.size-t});for(let n=i.length-4;n>=0;n--)if(i[n]===$[0]&&i[n+1]===$[1]&&i[n+2]===$[2]&&i[n+3]===$[3])return e.fileInfo.size-t+n;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess())return void P("Cannot reading central-directory without random-read support");P("Reading central-directory...");const e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){P("Central-directory 32-bit signature found");const i=await this.tokenizer.readToken(O,t),n=[];this.tokenizer.setPosition(i.offsetOfStartOfCd);for(let e=0;e<i.nrOfEntriesOfSize;++e){const t=await this.tokenizer.readToken(j);if(t.signature!==M)throw new Error("Expected Central-File-Header signature");t.filename=await this.tokenizer.readToken(new B(t.filenameLength,"utf-8")),await this.tokenizer.ignore(t.extraFieldLength),await this.tokenizer.ignore(t.fileCommentLength),n.push(t),P(`Add central-directory file-entry: n=${e+1}/${n.length}: filename=${n[e].filename}`)}return this.tokenizer.setPosition(e),n}this.tokenizer.setPosition(e)}async unzip(e){const t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let i=!1;do{const t=await this.readLocalFileHeader();if(!t)break;const n=e(t);let r;if(i=!!n.stop,await this.tokenizer.ignore(t.extraFieldLength),t.dataDescriptor&&0===t.compressedSize){const e=[];let i=R;P("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let r=-1;for(;r<0&&i===R;){i=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),r=Z(this.syncBuffer.subarray(0,i),N);const t=r>=0?r:i;if(n.handler){const i=new Uint8Array(t);await this.tokenizer.readBuffer(i),e.push(i)}else await this.tokenizer.ignore(t)}P(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),n.handler&&await this.inflate(t,_(e),n.handler)}else n.handler?(P(`Reading compressed-file-data: ${t.compressedSize} bytes`),r=new Uint8Array(t.compressedSize),await this.tokenizer.readBuffer(r),await this.inflate(t,r,n.handler)):(P(`Ignoring compressed-file-data: ${t.compressedSize} bytes`),await this.tokenizer.ignore(t.compressedSize));if(P(`Reading data-descriptor at pos=${this.tokenizer.position}`),t.dataDescriptor&&134695760!==(await this.tokenizer.readToken(L)).signature)throw new Error("Expected data-descriptor-signature at position "+(this.tokenizer.position-L.len))}while(!i)}async iterateOverCentralDirectory(e,t){for(const i of e){const e=t(i);if(e.handler){this.tokenizer.setPosition(i.relativeOffsetOfLocalHeader);const t=await this.readLocalFileHeader();if(t){await this.tokenizer.ignore(t.extraFieldLength);const n=new Uint8Array(i.compressedSize);await this.tokenizer.readBuffer(n),await this.inflate(t,n,e.handler)}}if(e.stop)break}}async inflate(e,t,i){if(0===e.compressedMethod)return i(t);if(8!==e.compressedMethod)throw new Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);return P(`Decompress filename=${e.filename}, compressed-size=${t.length}`),i(await q.decompressDeflateRaw(t))}static async decompressDeflateRaw(e){const t=new ReadableStream({start(t){t.enqueue(e),t.close()}}),i=new DecompressionStream("deflate-raw"),n=t.pipeThrough(i);try{const e=new Response(n),t=await e.arrayBuffer();return new Uint8Array(t)}catch(e){const t=e instanceof Error?`Failed to deflate ZIP entry: ${e.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(t)}}async readLocalFileHeader(){const e=await this.tokenizer.peekToken(S);if(e===I){const e=await this.tokenizer.readToken(D);return e.filename=await this.tokenizer.readToken(new B(e.filenameLength,"utf-8")),e}if(e===M)return!1;if(3759263696===e)throw new Error("Encrypted ZIP");throw new Error("Unexpected signature")}}function Z(e,t){const i=e.length,n=t.length;if(n>i)return-1;for(let r=0;r<=i-n;r++){let i=!0;for(let o=0;o<n;o++)if(e[r+o]!==t[o]){i=!1;break}if(i)return r}return-1}function _(e){const t=e.reduce((e,t)=>e+t.length,0),i=new Uint8Array(t);let n=0;for(const t of e)i.set(t,n),n+=t.length;return i}class W{constructor(e){this.tokenizer=e}inflate(){const e=this.tokenizer;return new ReadableStream({async pull(t){const i=new Uint8Array(1024),n=await e.readBuffer(i,{mayBeLess:!0});0!==n?t.enqueue(i.subarray(0,n)):t.close()}}).pipeThrough(new DecompressionStream("gzip"))}}function G(e){const{byteLength:t}=e;return 6===t?e.getUint16(0)*2**32+e.getUint32(2):5===t?e.getUint8(0)*2**32+e.getUint32(1):4===t?e.getUint32(0):3===t?65536*e.getUint8(0)+e.getUint16(1):2===t?e.getUint16(0):1===t?e.getUint8(0):void 0}Object.prototype.toString,new globalThis.TextDecoder("utf8"),new globalThis.TextEncoder,Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const V={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},H=4100,Q=1048576,J=16777216,X=Q,K=J,Y=J,ee=Q,te=J,ie=Q,ne=Q,re=Q,oe=J,ae=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),se=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],ce=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]);class fe extends Error{}function pe(e,t,i){if(!Number.isFinite(e)||e<0||e>t)throw new fe(`${i} has invalid size ${e} (maximum ${t} bytes)`);return e}async function me(e,t,{maximumLength:i=16777216,reason:n="skip"}={}){const r=pe(t,i,n);await e.ignore(r)}async function he(e,t,i,{maximumLength:n=t.length,reason:r="read"}={}){const o=pe(i?.length??t.length,n,r);return e.readBuffer(t,{...i,length:o})}const ue=134695760;function le(e,t){if(e.length<16)return-1;const i=e.length-16;for(let n=0;n<=i;n++)if(S.get(e,n)===ue&&S.get(e,n+8)===t+n)return n;return-1}function de(e){return!!(32&e.codePointAt(0))}function ge(e,t){return be(e.tokenizer)?Math.max(0,J-(e.tokenizer.position-t)):Math.max(0,Q-e.knownSizeDescriptorScannedBytes)}async function xe(e,t,{shouldBuffer:i,maximumDescriptorLength:n=1048576}={}){if(t.dataDescriptor&&0===t.compressedSize)return async function(e,{shouldBuffer:t,maximumLength:i=1048576}={}){const{syncBuffer:n}=e,{length:r}=n,o=[];let a=0;for(;;){const s=await e.tokenizer.peekBuffer(n,{mayBeLess:!0}),c=le(n.subarray(0,s),a),f=c>=0?0:s===r?Math.min(15,s-1):0,p=c>=0?c:s-f;if(0===p)break;if(a+=p,a>i)throw new Error(`ZIP entry compressed data exceeds ${i} bytes`);if(t){const t=new Uint8Array(p);await e.tokenizer.readBuffer(t),o.push(t)}else await e.tokenizer.ignore(p);if(c>=0)break}if(be(e.tokenizer)||(e.knownSizeDescriptorScannedBytes+=a),t)return function(e,t){const i=new Uint8Array(t);let n=0;for(const t of e)i.set(t,n),n+=t.length;return i}(o,a)}(e,{shouldBuffer:i,maximumLength:n});if(!i)return void await me(e.tokenizer,t.compressedSize,{maximumLength:be(e.tokenizer)?Q:e.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});const r=function(e){const t=e.fileInfo.size,i=Number.isFinite(t)?Math.max(0,t-e.position):Number.MAX_SAFE_INTEGER;return Math.min(i,2147483647)}(e.tokenizer);if(!Number.isFinite(t.compressedSize)||t.compressedSize<0||t.compressedSize>r)throw new Error(`ZIP entry compressed data exceeds ${r} bytes`);const o=new Uint8Array(t.compressedSize);return await e.tokenizer.readBuffer(o),o}async function we(e,t){return new Se(t).fromBuffer(e)}function ke(e){switch(e=e.toLowerCase()){case"application/epub+zip":return{ext:"epub",mime:e};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:e};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:e};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:e};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:e};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:e};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:e};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:e};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:e};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:e};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:e};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:e};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:e};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:e};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:e};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:e};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"}}}function ye(e,t,i){i={offset:0,...i};for(const[n,r]of t.entries())if(i.mask){if(r!==(i.mask[n]&e[n+i.offset]))return!1}else if(r!==e[n+i.offset])return!1;return!0}function be(e){const t=e.fileInfo.size;return!Number.isFinite(t)||t===Number.MAX_SAFE_INTEGER}function ve(e,t,i){return be(e)&&e.position-t>i}function Ce(e,t=1048576){const i=[e.compressedSize,e.uncompressedSize];for(const e of i)if(!Number.isFinite(e)||e<0||e>t)return!1;return!0}function ze(e){if(e.hasContentTypesEntry&&!e.hasUnparseableContentTypes&&!e.isParsingContentTypes&&!e.hasParsedContentTypesEntry)return e.hasWordDirectory?{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:e.hasPresentationDirectory?{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:e.hasSpreadsheetDirectory?{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}:e.hasThreeDimensionalModelEntry?{ext:"3mf",mime:"model/3mf"}:void 0}q.prototype.inflate=async function(e,t,i){if(0===e.compressedMethod)return i(t);if(8!==e.compressedMethod)throw new Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);return i(await async function(e,{maximumLength:t=1048576}={}){const i=new ReadableStream({start(t){t.enqueue(e),t.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),n=[];let r=0;try{for(;;){const{done:e,value:o}=await i.read();if(e)break;if(r+=o.length,r>t)throw await i.cancel(),new Error(`ZIP entry decompressed data exceeds ${t} bytes`);n.push(o)}}finally{i.releaseLock()}const o=new Uint8Array(r);let a=0;for(const e of n)o.set(e,a),a+=e.length;return o}(t,{maximumLength:Q}))},q.prototype.unzip=async function(e){let t=!1,i=0;const n=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(ve(this.tokenizer,n,J))throw new fe("ZIP stream probing exceeds 16777216 bytes");const r=await this.readLocalFileHeader();if(!r)break;if(i++,i>1024)throw new Error("ZIP entry count exceeds 1024");const o=e(r);t=Boolean(o.stop),await this.tokenizer.ignore(r.extraFieldLength);const a=await xe(this,r,{shouldBuffer:Boolean(o.handler),maximumDescriptorLength:Math.min(Q,ge(this,n))});if(o.handler&&await this.inflate(r,a,o.handler),r.dataDescriptor){const e=new Uint8Array(16);if(await this.tokenizer.readBuffer(e),S.get(e,0)!==ue)throw new Error("Expected data-descriptor-signature at position "+(this.tokenizer.position-e.length))}if(ve(this.tokenizer,n,J))throw new fe("ZIP stream probing exceeds 16777216 bytes")}while(!t)};class Se{constructor(e){const t=(i=e?.mpegOffsetTolerance,Number.isFinite(i)?Math.max(0,Math.min(4098,Math.trunc(i))):0);var i;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 function(e){const t=e?.streamReader;if("WebStreamByobReader"!==t?.constructor?.name)return e;const{reader:i}=t,n=async()=>{await i.cancel(),i.releaseLock()};return t.close=n,t.abort=async()=>{t.interrupted=!0,await n()},e}(function(e,t){const i=function(e){try{const t=e.getReader({mode:"byob"});return t instanceof ReadableStreamDefaultReader?new c(t):new s(t)}catch(t){if(t instanceof TypeError)return new c(e.getReader());throw t}}(e),n=t??{},r=n.onClose;return n.onClose=async()=>{if(await i.close(),r)return r()},new p(i,n)}(e,this.getTokenizerOptions()))}async parseTokenizer(e,t=0){this.detectionReentryCount=t;const i=e.position;for(const t of this.detectors){let r;try{r=await t.detect(e)}catch(e){if(e instanceof n)return;if(e instanceof fe)return;throw e}if(r)return r;if(i!==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}\``);const t=e instanceof Uint8Array?e:new Uint8Array(e);var i,n;if(t?.length>1)return this.fromTokenizer((i=t,n=this.getTokenizerOptions(),new m(i,n)))}async fromBlob(e){this.options.signal?.throwIfAborted();const t=function(e,t){return new h(e,t)}(e,this.getTokenizerOptions());return this.fromTokenizer(t)}async fromStream(e){this.options.signal?.throwIfAborted();const t=this.createTokenizerFromWebStream(e);return this.fromTokenizer(t)}async toDetectionStream(e,t){const i=function(e){return Number.isFinite(e)?Math.max(1,Math.trunc(e)):H}(t?.sampleSize??H);let r,o;const a=e.getReader({mode:"byob"});try{const{value:e,done:t}=await function(e,t,i){return void 0===i?e.read(t):(i.throwIfAborted(),new Promise((n,r)=>{const o=()=>{i.removeEventListener("abort",a)},a=()=>{const t=i.reason;o(),(async()=>{try{await e.cancel(t)}catch{}})(),r(t)};i.addEventListener("abort",a,{once:!0}),(async()=>{try{const i=await e.read(t);o(),n(i)}catch(e){o(),r(e)}})()}))}(a,new Uint8Array(i),this.options.signal);if(o=e,!t&&e)try{r=await this.fromBuffer(e.subarray(0,i))}catch(e){if(!(e instanceof n))throw e;r=void 0}o=e}finally{a.releaseLock()}const s=new TransformStream({async start(e){e.enqueue(o)},transform(e,t){t.enqueue(e)}}),c=e.pipeThrough(s);return c.fileType=r,c}async detectGzip(e){if(this.gzipProbeDepth>=1)return{ext:"gz",mime:"application/gzip"};const t=function(e,t){const i=e.getReader();let n=0,r=!1,o=!1;const a=async e=>{r||o||(o=!0,await i.cancel(e))};return new ReadableStream({async pull(e){if(n>=t)return e.close(),void await a();const{done:o,value:s}=await i.read();if(o||!s)return r=!0,void e.close();const c=t-n;if(s.length>c)return e.enqueue(s.subarray(0,c)),n+=c,e.close(),void await a();e.enqueue(s),n+=s.length},async cancel(e){await a(e)}})}(new W(e).inflate(),K),i=be(e);let n,r,o,a;if(i){const e=new AbortController;n=setTimeout(()=>{e.abort(new DOMException("Operation timed out after 100 ms","TimeoutError"))},100),r=void 0===this.options.signal?e.signal:AbortSignal.any([this.options.signal,e.signal]),o=new Se({...this.options,signal:r}),o.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{a=await(o??this).fromStream(t)}catch(e){if("AbortError"===e?.name&&"TimeoutError"!==r?.reason?.name)throw e}finally{clearTimeout(n),i||this.gzipProbeDepth--}return"tar"===a?.ext?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(e,t){return ye(this.buffer,e,t)}checkString(e,t){return this.check(function(e,t){if("utf-16le"===t){const t=[];for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);t.push(255&n,n>>8&255)}return t}if("utf-16be"===t){const t=[];for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);t.push(n>>8&255,255&n)}return t}return[...e].map(e=>e.charCodeAt(0))}(e,t?.encoding),t)}detectConfident=async e=>{if(this.buffer=new Uint8Array(H),void 0===e.fileInfo.size&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,be(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])){if(this.detectionReentryCount>=256)return;return 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 me(e,6,{maximumLength:6,reason:"ID3 header prefix"});const t=await e.readToken(V),i=be(e);if(!Number.isFinite(t)||t<0||i&&(t>Y||e.position+t>Y))return;if(e.position+t>e.fileInfo.size){if(i)return;return{ext:"mp3",mime:"audio/mpeg"}}try{await me(e,t,{maximumLength:i?Y:e.fileInfo.size,reason:"ID3 payload"})}catch(r){if(r instanceof n)return;throw r}if(this.detectionReentryCount>=256)return;return this.detectionReentryCount++,this.parseTokenizer(e,this.detectionReentryCount)}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===this.buffer[0]||70===this.buffer[0])&&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 o;const a={hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1};try{await new q(e).unzip(e=>{!function(e,t){t.startsWith("word/")&&(e.hasWordDirectory=!0),t.startsWith("ppt/")&&(e.hasPresentationDirectory=!0),t.startsWith("xl/")&&(e.hasSpreadsheetDirectory=!0),t.startsWith("3D/")&&t.endsWith(".model")&&(e.hasThreeDimensionalModelEntry=!0)}(a,e.filename);const t="[Content_Types].xml"===e.filename,i=ze(a);if(!t&&i)return o=i,{stop:!0};switch(e.filename){case"META-INF/mozilla.rsa":return o={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return o={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return Ce(e,X)?{async handler(e){const t=new TextDecoder("utf-8").decode(e).trim();o=ke(t)},stop:!0}:{};case"[Content_Types].xml":return a.hasContentTypesEntry=!0,Ce(e,X)?(a.isParsingContentTypes=!0,{async handler(e){const t=function(e){const t=e.indexOf('.main+xml"');if(-1===t){const t="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return e.includes(`ContentType="${t}"`)?t:void 0}const i=e.slice(0,t),n=i.lastIndexOf('"');return i.slice(n+1)}(new TextDecoder("utf-8").decode(e));t&&(o=ke(t)),a.hasParsedContentTypesEntry=!0,a.isParsingContentTypes=!1},stop:!0}):(a.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(e.filename)?(o={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(s){if(!function(e){if(e instanceof n)return!0;if(e instanceof fe)return!0;if(!(e instanceof Error))return!1;if(ae.has(e.message))return!0;if(ce.has(e.code))return!0;for(const t of se)if(e.message.startsWith(t))return!0;return!1}(s))throw s;a.isParsingContentTypes&&(a.isParsingContentTypes=!1,a.hasUnparseableContentTypes=!0)}return o??ze(a)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);const c=new Uint8Array(8);return await e.readBuffer(c),ye(c,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:ye(c,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:ye(c,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:ye(c,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:ye(c,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:ye(c,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(3===this.buffer[2]||5===this.buffer[2]||7===this.buffer[2])&&(4===this.buffer[3]||6===this.buffer[3]||8===this.buffer[3]))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])){const f=await this.readTiffHeader(!1);if(f)return f}if(this.check([77,77])){const p=await this.readTiffHeader(!0);if(p)return p}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function m(){const t=await e.peekNumber(v);let i=128,n=0;for(;0===(t&i)&&0!==i;)++n,i>>=1;const r=new Uint8Array(n+1);return await he(e,r,void 0,{maximumLength:r.length,reason:"EBML field"}),r}async function h(){const e=await m(),t=await m();t[0]^=128>>t.length-1;const i=Math.min(6,t.length),n=new DataView(e.buffer),r=new DataView(t.buffer,t.length-i,i);return{id:G(n),len:G(r)}}async function u(t){let i=0;for(;t>0;){if(i++,i>256)return;if(ve(e,d,J))return;const n=e.position,r=await h();if(17026===r.id){if(r.len>64)return;const t=pe(r.len,64,"EBML DocType");return(await e.readToken(new B(t))).replaceAll(/\00.*$/g,"")}if(be(e)&&(!Number.isFinite(r.len)||r.len<0||r.len>ee))return;if(await me(e,r.len,{maximumLength:be(e)?ee:e.fileInfo.size,reason:"EBML payload"}),--t,e.position<=n)return}}const l=await h(),d=e.position;switch(await u(l.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])){const g=F.get(this.buffer,4),x=z.get(this.buffer,6);if(g>0&&g<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(x>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])&&(0===this.buffer[6]||1===this.buffer[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){const w=new B(4,"latin1").get(this.buffer,2);if(w.match("^d*")&&w>=1e3&&w<=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),"debian-binary"===await e.readToken(new B(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&["\n","\r","\t"," ","\0"].some(e=>this.checkString(e,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){const k={ext:"png",mime:"image/png"},y={ext:"apng",mime:"image/apng"};async function b(){return{length:await e.readToken(T),type:await e.readToken(new B(4,"latin1"))}}await e.ignore(8);const C=be(e),S=e.position;let A=0,I=!1;do{if(A++,A>512)break;if(ve(e,S,te))break;const M=e.position,L=await b();if(L.length<0)return;if("IHDR"===L.type){if(13!==L.length)return;I=!0}switch(L.type){case"IDAT":return k;case"acTL":return y;default:if(!I&&"CgBI"!==L.type)return;if(C&&L.length>ie)return I&&de(L.type)?k:void 0;try{await me(e,L.length+4,{maximumLength:C?1048580:e.fileInfo.size,reason:"PNG chunk payload"})}catch(D){if(!C&&(D instanceof fe||D instanceof n))return k;throw D}}if(e.position<=M)break}while(e.position+8<e.fileInfo.size);return k}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})&&96&this.buffer[8]){const O=new B(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(O){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 O.startsWith("3g")?O.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString("REGEDIT4\r\n"))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 j=!1;try{async function U(){const t=new Uint8Array(16);return await he(e,t,void 0,{maximumLength:t.length,reason:"ASF header GUID"}),{id:t,size:Number(await e.readToken(E))}}await me(e,30,{maximumLength:30,reason:"ASF header prelude"});const P=be(e),R=e.position;let N=0;for(;e.position+24<e.fileInfo.size&&(N++,!(N>512))&&!ve(e,R,J);){const $=e.position,Z=await U();let _=Z.size-24;if(!Number.isFinite(_)||_<0){j=!0;break}if(ye(Z.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const W=new Uint8Array(16);if(_-=await he(e,W,void 0,{maximumLength:W.length,reason:"ASF stream type GUID"}),ye(W,[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(ye(W,[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(P&&_>ne){j=!0;break}if(await me(e,_,{maximumLength:P?ne:e.fileInfo.size,reason:"ASF header payload"}),e.position<=$){j=!0;break}}}catch(Q){if(!(Q instanceof n||Q instanceof fe))throw Q;be(e)&&(j=!0)}if(j)return;return{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 B(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){const K=new DataView(this.buffer.buffer).getUint32(12,!0);if(K>12&&this.buffer.length>=K+16)try{const re=(new TextDecoder).decode(this.buffer.subarray(16,K+16));if(JSON.parse(re).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})&&function(e,t=0){const i=Number.parseInt(new B(6).get(e,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(i))return!1;let n=256;for(let i=t;i<t+148;i++)n+=e[i];for(let i=t+156;i<t+512;i++)n+=e[i];return i===n}(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){const oe="utf-16le";return this.checkString("<?xml ",{offset:2,encoding:oe})?{ext:"xml",mime:"application/xml"}:this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:oe})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:this.checkString("Windows Registry Editor Version 5.00\r\n",{offset:2,encoding:oe})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}return this.checkString("-----BEGIN PGP MESSAGE-----")?{ext:"pgp",mime:"application/pgp-encrypted"}:void 0};detectImprecise=async e=>{this.buffer=new Uint8Array(H);const t=function(e){return Number.isFinite(e)?Math.max(0,e):Number.MAX_SAFE_INTEGER}(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 e=0;e<=this.options.mpegOffsetTolerance;++e){const t=this.scanMpeg(e);if(t)return t}};async readTiffTag(e){const t=await this.tokenizer.readToken(e?z:C);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"}}}async readTiffIFD(e){const t=await this.tokenizer.readToken(e?z:C);if(!(t>512||be(this.tokenizer)&&2+12*t>oe))for(let i=0;i<t;++i){const t=await this.readTiffTag(e);if(t)return t}}async readTiffHeader(e){const t={ext:"tif",mime:"image/tiff"},i=(e?z:C).get(this.buffer,2),r=(e?F:S).get(this.buffer,4);if(42===i){if(r>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r>=8){const t=(e?z:C).get(this.buffer,8),i=(e?z:C).get(this.buffer,10);if(28===t&&254===i||31===t&&11===i)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(be(this.tokenizer)&&r>re)return t;const i=be(this.tokenizer)?oe:this.tokenizer.fileInfo.size;try{await me(this.tokenizer,r,{maximumLength:i,reason:"TIFF IFD offset"})}catch(e){if(e instanceof n)return;throw e}let o;try{o=await this.readTiffIFD(e)}catch(e){if(e instanceof n)return;throw e}return o??t}if(43===i)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"};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"}}}}new Set(["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"]),new Set(["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"])}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|