needle-cloud 2.4.4 → 2.4.5

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.
@@ -0,0 +1 @@
1
+ import e from"node-fetch";import{File as n}from"@web-std/file";import t,{randomUUID as o}from"node:crypto";import{Command as i,Option as a}from"commander";import s,{existsSync as r,statSync as c,readFileSync as l,readdirSync as p,appendFileSync as u,mkdirSync as d,writeFileSync as m,lstatSync as f,readFile as h}from"fs";import g from"open";import v,{randomUUID as x}from"crypto";import b from"buffer";import y,{resolve as w,join as _,relative as k,sep as j,isAbsolute as S,dirname as $}from"path";import T from"ora";import{existsSync as E,mkdirSync as O,renameSync as C,realpathSync as R,statSync as N,rename as z,openSync as A,readSync as L,closeSync as U,createReadStream as I,readFileSync as F,writeFileSync as P,watch as q}from"node:fs";import{writeFile as W}from"node:fs/promises";import B,{homedir as D}from"node:os";import M,{join as G}from"node:path";import J,{TextEncoder as H}from"util";import K,{Readable as Y}from"stream";import V from"http";import Z from"https";import X from"url";import Q from"assert";import ee from"tty";import ne,{homedir as te,tmpdir as oe}from"os";import ie from"zlib";import{EventEmitter as ae}from"events";import{createInterface as se}from"node:readline/promises";import re from"dotenv";import ce from"@logto/node";import{createInterface as le}from"node:readline";import{Readable as pe}from"node:stream";import{createGzip as ue}from"node:zlib";import{Router as de}from"express";import me,{WebSocketServer as fe}from"ws";import{execFileSync as he}from"child_process";import{minimatch as ge}from"minimatch";import ve from"body-parser";import{execFileSync as xe}from"node:child_process";const be="STRING",ye="BOOLEAN",we="NUMBER",_e="ARRAY";function ke(e){return e.replace(/[-_](\w)/g,(e,n)=>n.toUpperCase())}function je(e){const n=e.match(/--[\w-]+/g);return n?n[n.length-1]:e.split(/[\s,]+/)[0]}function Se(e){return ke(je(e).replace(/^--/,""))}function $e(e){return ke(e.replace(/[[\]<>]/g,"").replace(/\.\.\.$/,"").trim())}function Te(e,n){if(null==e)return e;switch(n){case ye:{if("boolean"==typeof e)return e;const n=String(e).toLowerCase();return""===n||!["false","0","no","off"].includes(n)&&(!!["true","1","yes","on"].includes(n)||Boolean(e))}case we:{const n=Number(e);return Number.isNaN(n)?e:n}case _e:return Array.isArray(e)?e:String(e).split(",");case be:return Array.isArray(e)?e:String(e);default:return e}}const Ee={error:(...e)=>console.error(...e),warn:(...e)=>console.warn(...e),info:(...e)=>console.log(...e),debug:(...e)=>console.debug(...e),log:(...e)=>console.log(...e)};class Oe{constructor(e,n){this.name=e,this.description=null!=n?n:"",this.visible=!0,this.strictOptions=!0,this._aliases=[],this._helpTexts=[],this._action=void 0,this.options=[],this.args=[]}alias(e){return this._aliases.push(e),this}getAliases(){return[...this._aliases]}configure(e={}){return void 0!==e.visible&&(this.visible=!1!==e.visible),void 0!==e.strictOptions&&(this.strictOptions=!1!==e.strictOptions),this}hide(){return this.visible=!1,this}help(e){return e&&this._helpTexts.push(e),this}option(e,n,t={}){return this.options.push({synopsis:e,description:null!=n?n:"",name:Se(e),validator:t.validator,default:t.default,required:!0===t.required,hidden:!0===t.hidden}),this}argument(e,n,t={}){return this.args.push({synopsis:e,description:null!=n?n:"",name:$e(e),validator:t.validator,default:t.default}),this}action(e){return this._action=e,this}isHelpCommand(){return!1}}class Ce{constructor(){this.STRING=be,this.BOOLEAN=ye,this.NUMBER=we,this.ARRAY=_e,this._version=void 0,this._description=void 0,this._name="needle-cloud",this._commands=[],this._exitOverride=!1}version(e){return this._version=e,this}description(e){return this._description=e,this}name(e){return this._name=e,this}command(e,n){const t=new Oe(e,n);return this._commands.push(t),t}getCommands(){return[...this._commands]}exitOverride(){return this._exitOverride=!0,this}async run(e){return this._build().parseAsync(null!=e?e:process.argv.slice(2),{from:"user"})}_build(){const e=new i(this._name);this._version&&e.version(this._version),this._description&&e.description(this._description),this._exitOverride&&e.exitOverride();const n=new Map,t=o=>{if(1===o.length)return e;const a=o.slice(0,-1).join(" ");let s=n.get(a);return s||(s=new i(o[o.length-2]),this._exitOverride&&s.exitOverride(),n.set(a,s),t(o.slice(0,-1)).addCommand(s)),s};for(const e of this._commands){const o=e.name.split(/\s+/),s=n.get(e.name),r=null!=s?s:new i(o[o.length-1]);n.set(e.name,r),r.description(e.description);for(const n of e._aliases)r.alias(n);for(const n of e._helpTexts)r.addHelpText("after","\n"+n);this._exitOverride&&r.exitOverride(),e.strictOptions||(r.allowUnknownOption(!0),r.allowExcessArguments(!0));for(const n of e.args)r.argument(n.synopsis,n.description);for(const n of e.options){let e=n.synopsis;n.validator&&!je(e).startsWith("--no-")&&(e=/[<[]/.test(e)?e.replace(/<([\w-]+)>/,"[$1]"):`${e} [value]`);const t=new a(e,n.description);n.hidden&&t.hideHelp(),n.required&&t.makeOptionMandatory(),r.addOption(t)}e._action&&r.action(async(...n)=>{var t;const o=null!=(t=n[e.args.length])?t:{},i={};e.args.forEach((e,t)=>{const o=n[t];i[e.name]=Te(void 0===o?e.default:o,e.validator)});const a={};for(const n of e.options){if(je(n.synopsis).startsWith("--no-")){const e=ke(je(n.synopsis).replace(/^--no-/,""));a[n.name]=!1===o[e];continue}const e=o[n.name];a[n.name]=Te(void 0===e?n.default:e,n.validator)}for(const[e,n]of Object.entries(o))e in a||(a[e]=n);await e._action({args:i,options:a,logger:Ee,command:r})}),s||t(o).addCommand(r,{hidden:!e.visible})}return e}}function Re(){return new Ce}var Ne={program:Re(),createProgram:Re,STRING:be,BOOLEAN:ye,NUMBER:we,ARRAY:_e};const ze={status:"/v1/status",version:"/v1/version",api:"/v1/api",usage:{get:"/v1/usage"},affiliate:{get:"/v1/affiliate/get",link_clicked:"/v1/affiliate/link_clicked"},account:{public_key:"/v1/account/public_key",post_machine:"/v1/account/machine",connect:"/v1/account/connect",get_licenses:"/v1/account/get/licenses",set_license_active:"/v1/account/set_license_active",set_licenses_active:"/v1/account/set_licenses_active",buy_licenses:"/v1/account/buy_licenses",update_licenses:"/v1/account/update_licenses",update_payment_method:"/v1/account/update_payment_method",get_billing:"/v1/account/get_billing",resume_subscription:"/v1/account/resume_subscription",cancel_subscription:"/v1/account/cancel_subscription",start_billingportal_session:"/v1/account/start_billingportal_session",post_preferences:"/v1/account/preferences",get_preferences:"/v1/account/preferences"},ai:{llmstxt:"/v1/ai/llmstxt",chat:"/v1/ai/chat",chat_personal:"/v1/ai/chat/personal",list_chats:"/v1/ai/chat/list",chat_tool_result:"/v1/ai/chat/tool-result",chat_stop:"/v1/ai/chat/stop",ask:"/v1/ai/ask",post_settings:"/v1/ai/chat/settings",ws:"/v1/ws",cli_ws:"/v1/cli/ws"},organizations:{get:"/v1/organizations/get",orgs_details:"/v1/organizations/details",licenses:"/v1/organizations/licenses",get_invitations:"/v1/organizations/get_invitations"},events:{get:"/v1/events/get",post:"/v1/events/post",list:"/v1/events/list"},reports:{get:"/v1/reports/get",post:"/v1/reports/post"},diagnostics:{download_failed:"/v1/diagnostics/download-failed"},questionnaire:{get:"/v1/questionnaires/get",post:"/v1/questionnaires/post"},roadmap:{get:"/v1/roadmap/get",post_vote:"/v1/roadmap/post"},tokens:{create:"/v1/tokens/create",delete:"/v1/tokens/delete",list:"/v1/tokens/list"},get:{stats:"/v1/get/stats",jobs:"/v1/list/jobs",deployments:"/v1/list/deployments",discounts:"/v1/get/discounts"},files:{entry:"/v1/files/:identifier/:version/",file:"/v1/files/:identifier/:version/*"},view:{get_analytics:"/v1/view/analytics",get_public_info:"/v1/view/public/info",post_version:"/v1/view/post_version"},content:{root:"/v1/content",download:"/v1/content/download",detail:"/v1/content/:identifier",update:"/v1/content/:identifier",delete:"/v1/content/:identifier",restore:"/v1/content/:identifier/restore",visits:"/v1/content/:identifier/visits",domains:"/v1/content/:identifier/domains",domain_item:"/v1/content/:identifier/domains/:hostname",domain_verify:"/v1/content/:identifier/domains/:hostname/verify"},analytics:{content_list:"/v1/analytics/content-list"},public:{content_list:"/v1/public/content",content_detail:"/v1/public/content/:identifier"},collections:{list:"/v1/collections/list",get:"/v1/collections/get",create:"/v1/collections/create",update:"/v1/collections/update",delete:"/v1/collections/delete",add_item:"/v1/collections/add-item",remove_item:"/v1/collections/remove-item",reorder_items:"/v1/collections/reorder-items"},upload:{request:"/v1/upload/request",request_put_url:"/v1/upload/put",update_results:"/v1/upload/results",done:"/v1/upload/done",cancel:"/v1/upload/cancel",multipart_create:"/v1/upload/multipart/create",multipart_part_urls:"/v1/upload/multipart/part-urls",multipart_complete:"/v1/upload/multipart/complete",multipart_abort:"/v1/upload/multipart/abort"},jobs:{create:"/v1/jobs/create",get_id:"/v1/jobs/get_id",request_start:"/v1/jobs/request_start",presigned_url:"/v1/jobs/presigned-url",presigned_urls:"/v1/jobs/presigned-urls",download_urls:"/v1/jobs/download-urls",request_restart:"/v1/jobs/restart",delete:"/v1/jobs/delete",post_update:"/v1/jobs/update",post_results_stats:"/v1/jobs/results_stats",post_usage:"/v1/jobs/post_usage",get_status:"/v1/jobs/status",get_org:"/v1/jobs/org",query:"/v1/jobs/query",request_job_that_needs_stats:"/v1/jobs/job_needs_stats"},worker:{ping:"/v1/worker/ping",get_available_count:"/v1/worker/get_available_count",post_available_info:"/v1/worker/post_available_info",get_available_info:"/v1/worker/get_available_info"},local_projects:{get:{user:"/v1/local_projects/user",by_id:"/v1/local_projects/"},post:"/v1/local_projects"}};function Ae(e){const n={authorization:"Bearer "+e.authToken};return e.org&&(n["x-needle-cloud-org"]=e.org),e.roles&&(n.roles=e.roles.join(",")),e.roles_org&&(n.roles_org=e.roles_org.join(",")),n}const Le={credentials:"omit"};function Ue(e,n){return function(){return e.apply(n,arguments)}}const{toString:Ie}=Object.prototype,{getPrototypeOf:Fe}=Object,Pe=(qe=Object.create(null),e=>{const n=Ie.call(e);return qe[n]||(qe[n]=n.slice(8,-1).toLowerCase())});var qe;const We=e=>(e=e.toLowerCase(),n=>Pe(n)===e),Be=e=>n=>typeof n===e,{isArray:De}=Array,Me=Be("undefined"),Ge=We("ArrayBuffer"),Je=Be("string"),He=Be("function"),Ke=Be("number"),Ye=e=>null!==e&&"object"==typeof e,Ve=e=>{if("object"!==Pe(e))return!1;const n=Fe(e);return!(null!==n&&n!==Object.prototype&&null!==Object.getPrototypeOf(n)||Symbol.toStringTag in e||Symbol.iterator in e)},Ze=We("Date"),Xe=We("File"),Qe=We("Blob"),en=We("FileList"),nn=We("URLSearchParams"),[tn,on,an,sn]=["ReadableStream","Request","Response","Headers"].map(We);function rn(e,n,{allOwnKeys:t=!1}={}){if(null==e)return;let o,i;if("object"!=typeof e&&(e=[e]),De(e))for(o=0,i=e.length;o<i;o++)n.call(null,e[o],o,e);else{const i=t?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let s;for(o=0;o<a;o++)s=i[o],n.call(null,e[s],s,e)}}function cn(e,n){n=n.toLowerCase();const t=Object.keys(e);let o,i=t.length;for(;i-- >0;)if(o=t[i],n===o.toLowerCase())return o;return null}const ln="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,pn=e=>!Me(e)&&e!==ln,un=(dn="undefined"!=typeof Uint8Array&&Fe(Uint8Array),e=>dn&&e instanceof dn);var dn;const mn=We("HTMLFormElement"),fn=(({hasOwnProperty:e})=>(n,t)=>e.call(n,t))(Object.prototype),hn=We("RegExp"),gn=(e,n)=>{const t=Object.getOwnPropertyDescriptors(e),o={};rn(t,(t,i)=>{let a;!1!==(a=n(t,i,e))&&(o[i]=a||t)}),Object.defineProperties(e,o)},vn="abcdefghijklmnopqrstuvwxyz",xn="0123456789",bn={DIGIT:xn,ALPHA:vn,ALPHA_DIGIT:vn+vn.toUpperCase()+xn},yn=We("AsyncFunction"),wn=(_n="function"==typeof setImmediate,kn=He(ln.postMessage),_n?setImmediate:kn?(jn=`axios@${Math.random()}`,Sn=[],ln.addEventListener("message",({source:e,data:n})=>{e===ln&&n===jn&&Sn.length&&Sn.shift()()},!1),e=>{Sn.push(e),ln.postMessage(jn,"*")}):e=>setTimeout(e));var _n,kn,jn,Sn;const $n="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ln):"undefined"!=typeof process&&process.nextTick||wn;var Tn={isArray:De,isArrayBuffer:Ge,isBuffer:function(e){return null!==e&&!Me(e)&&null!==e.constructor&&!Me(e.constructor)&&He(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let n;return e&&("function"==typeof FormData&&e instanceof FormData||He(e.append)&&("formdata"===(n=Pe(e))||"object"===n&&He(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let n;return n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Ge(e.buffer),n},isString:Je,isNumber:Ke,isBoolean:e=>!0===e||!1===e,isObject:Ye,isPlainObject:Ve,isReadableStream:tn,isRequest:on,isResponse:an,isHeaders:sn,isUndefined:Me,isDate:Ze,isFile:Xe,isBlob:Qe,isRegExp:hn,isFunction:He,isStream:e=>Ye(e)&&He(e.pipe),isURLSearchParams:nn,isTypedArray:un,isFileList:en,forEach:rn,merge:function e(){const{caseless:n}=pn(this)&&this||{},t={},o=(o,i)=>{const a=n&&cn(t,i)||i;t[a]=Ve(t[a])&&Ve(o)?e(t[a],o):Ve(o)?e({},o):De(o)?o.slice():o};for(let e=0,n=arguments.length;e<n;e++)arguments[e]&&rn(arguments[e],o);return t},extend:(e,n,t,{allOwnKeys:o}={})=>(rn(n,(n,o)=>{e[o]=t&&He(n)?Ue(n,t):n},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,n,t,o)=>{e.prototype=Object.create(n.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:n.prototype}),t&&Object.assign(e.prototype,t)},toFlatObject:(e,n,t,o)=>{let i,a,s;const r={};if(n=n||{},null==e)return n;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],o&&!o(s,e,n)||r[s]||(n[s]=e[s],r[s]=!0);e=!1!==t&&Fe(e)}while(e&&(!t||t(e,n))&&e!==Object.prototype);return n},kindOf:Pe,kindOfTest:We,endsWith:(e,n,t)=>{e=String(e),(void 0===t||t>e.length)&&(t=e.length);const o=e.indexOf(n,t-=n.length);return-1!==o&&o===t},toArray:e=>{if(!e)return null;if(De(e))return e;let n=e.length;if(!Ke(n))return null;const t=new Array(n);for(;n-- >0;)t[n]=e[n];return t},forEachEntry:(e,n)=>{const t=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=t.next())&&!o.done;){const t=o.value;n.call(e,t[0],t[1])}},matchAll:(e,n)=>{let t;const o=[];for(;null!==(t=e.exec(n));)o.push(t);return o},isHTMLForm:mn,hasOwnProperty:fn,hasOwnProp:fn,reduceDescriptors:gn,freezeMethods:e=>{gn(e,(n,t)=>{if(He(e)&&-1!==["arguments","caller","callee"].indexOf(t))return!1;He(e[t])&&(n.enumerable=!1,"writable"in n?n.writable=!1:n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")}))})},toObjectSet:(e,n)=>{const t={},o=e=>{e.forEach(e=>{t[e]=!0})};return De(e)?o(e):o(String(e).split(n)),t},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,t){return n.toUpperCase()+t}),noop:()=>{},toFiniteNumber:(e,n)=>null!=e&&Number.isFinite(e=+e)?e:n,findKey:cn,global:ln,isContextDefined:pn,ALPHABET:bn,generateString:(e=16,n=bn.ALPHA_DIGIT)=>{let t="";const{length:o}=n;for(;e--;)t+=n[Math.random()*o|0];return t},isSpecCompliantForm:function(e){return!!(e&&He(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const n=new Array(10),t=(e,o)=>{if(Ye(e)){if(n.indexOf(e)>=0)return;if(!("toJSON"in e)){n[o]=e;const i=De(e)?[]:{};return rn(e,(e,n)=>{const a=t(e,o+1);!Me(a)&&(i[n]=a)}),n[o]=void 0,i}}return e};return t(e,0)},isAsyncFn:yn,isThenable:e=>e&&(Ye(e)||He(e))&&He(e.then)&&He(e.catch),setImmediate:wn,asap:$n};function En(e,n,t,o,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",n&&(this.code=n),t&&(this.config=t),o&&(this.request=o),i&&(this.response=i)}Tn.inherits(En,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Tn.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const On=En.prototype,Cn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Cn[e]={value:e}}),Object.defineProperties(En,Cn),Object.defineProperty(On,"isAxiosError",{value:!0}),En.from=(e,n,t,o,i,a)=>{const s=Object.create(On);return Tn.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),En.call(s,e.message,n,t,o,i),s.cause=e,s.name=e.name,a&&Object.assign(s,a),s};var Rn=K.Stream,Nn=zn;function zn(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}J.inherits(zn,Rn),zn.create=function(e,n){var t=new this;for(var o in n=n||{})t[o]=n[o];t.source=e;var i=e.emit;return e.emit=function(){return t._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),t.pauseStream&&e.pause(),t},Object.defineProperty(zn.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),zn.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},zn.prototype.resume=function(){this._released||this.release(),this.source.resume()},zn.prototype.pause=function(){this.source.pause()},zn.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},zn.prototype.pipe=function(){var e=Rn.prototype.pipe.apply(this,arguments);return this.resume(),e},zn.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},zn.prototype._checkIfMaxDataSizeExceeded=function(){this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize||(this._maxDataSizeExceeded=!0,this.emit("error",new Error("DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.")))};var An=K.Stream,Ln=Un;function Un(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}J.inherits(Un,An),Un.create=function(e){var n=new this;for(var t in e=e||{})n[t]=e[t];return n},Un.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},Un.prototype.append=function(e){if(Un.isStreamLike(e)){if(!(e instanceof Nn)){var n=Nn.create(e,{maxDataSize:Infinity,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=n}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},Un.prototype.pipe=function(e,n){return An.prototype.pipe.call(this,e,n),this.resume(),e},Un.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},Un.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){Un.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},Un.prototype._pipeNext=function(e){if(this._currentStream=e,Un.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});this.write(e),this._getNext()},Un.prototype._handleErrors=function(e){var n=this;e.on("error",function(e){n._emitError(e)})},Un.prototype.write=function(e){this.emit("data",e)},Un.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},Un.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},Un.prototype.end=function(){this._reset(),this.emit("end")},Un.prototype.destroy=function(){this._reset(),this.emit("close")},Un.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},Un.prototype._checkDataSize=function(){this._updateDataSize(),this.dataSize<=this.maxDataSize||this._emitError(new Error("DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded."))},Un.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(n){n.dataSize&&(e.dataSize+=n.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},Un.prototype._emitError=function(e){this._reset(),this.emit("error",e)};var In="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Fn(e){var n={exports:{}};return e(n,n.exports),n.exports}var Pn={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}},qn=Fn(function(e,n){var t,o,i,a=y.extname,s=/^\s*([^;\s]*)(?:;|\s|$)/,r=/^text\//i;function c(e){if(!e||"string"!=typeof e)return!1;var n=s.exec(e),t=n&&Pn[n[1].toLowerCase()];return t&&t.charset?t.charset:!(!n||!r.test(n[1]))&&"UTF-8"}n.charset=c,n.charsets={lookup:c},n.contentType=function(e){if(!e||"string"!=typeof e)return!1;var t=-1===e.indexOf("/")?n.lookup(e):e;if(!t)return!1;if(-1===t.indexOf("charset")){var o=n.charset(t);o&&(t+="; charset="+o.toLowerCase())}return t},n.extension=function(e){if(!e||"string"!=typeof e)return!1;var t=s.exec(e),o=t&&n.extensions[t[1].toLowerCase()];return!(!o||!o.length)&&o[0]},n.extensions=Object.create(null),n.lookup=function(e){if(!e||"string"!=typeof e)return!1;var t=a("x."+e).toLowerCase().substr(1);return t&&n.types[t]||!1},n.types=Object.create(null),t=n.extensions,o=n.types,i=["nginx","apache",void 0,"iana"],Object.keys(Pn).forEach(function(e){var n=Pn[e],a=n.extensions;if(a&&a.length){t[e]=a;for(var s=0;s<a.length;s++){var r=a[s];if(o[r]){var c=i.indexOf(Pn[o[r]].source),l=i.indexOf(n.source);if("application/octet-stream"!==o[r]&&(c>l||c===l&&"application/"===o[r].substr(0,12)))continue}o[r]=e}}})}),Wn=function(e){var n="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;n?n(e):setTimeout(e,0)},Bn=function(e){var n=!1;return Wn(function(){n=!0}),function(t,o){n?e(t,o):Wn(function(){e(t,o)})}},Dn=function(e){Object.keys(e.jobs).forEach(Mn.bind(e)),e.jobs={}};function Mn(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var Gn=function(e,n,t,o){var i=t.keyedList?t.keyedList[t.index]:t.index;t.jobs[i]=function(e,n,t,o){return 2==e.length?e(t,Bn(o)):e(t,n,Bn(o))}(n,i,e[i],function(e,n){i in t.jobs&&(delete t.jobs[i],e?Dn(t):t.results[i]=n,o(e,t.results))})},Jn=function(e,n){var t=!Array.isArray(e),o={index:0,keyedList:t||n?Object.keys(e):null,jobs:{},results:t?{}:[],size:t?Object.keys(e).length:e.length};return n&&o.keyedList.sort(t?n:function(t,o){return n(e[t],e[o])}),o},Hn=function(e){Object.keys(this.jobs).length&&(this.index=this.size,Dn(this),Bn(e)(null,this.results))},Kn=function(e,n,t,o){var i=Jn(e,t);return Gn(e,n,i,function t(a,s){a?o(a,s):(i.index++,i.index<(i.keyedList||e).length?Gn(e,n,i,t):o(null,i.results))}),Hn.bind(i,o)};function Yn(e,n){return e<n?-1:e>n?1:0}Kn.ascending=Yn,Kn.descending=function(e,n){return-1*Yn(e,n)};var Vn=function(e,n){return Object.keys(n).forEach(function(t){e[t]=e[t]||n[t]}),e},Zn=X.parse,Xn=K.Stream,Qn=et;function et(e){if(!(this instanceof et))return new et(e);for(var n in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Ln.call(this),e=e||{})this[n]=e[n]}J.inherits(et,Ln),et.LINE_BREAK="\r\n",et.DEFAULT_CONTENT_TYPE="application/octet-stream",et.prototype.append=function(e,n,t){"string"==typeof(t=t||{})&&(t={filename:t});var o=Ln.prototype.append.bind(this);if("number"==typeof n&&(n=""+n),J.isArray(n))this._error(new Error("Arrays are not supported."));else{var i=this._multiPartHeader(e,n,t),a=this._multiPartFooter();o(i),o(n),o(a),this._trackLength(i,n,t)}},et.prototype._trackLength=function(e,n,t){var o=0;null!=t.knownLength?o+=+t.knownLength:Buffer.isBuffer(n)?o=n.length:"string"==typeof n&&(o=Buffer.byteLength(n)),this._valueLength+=o,this._overheadLength+=Buffer.byteLength(e)+et.LINE_BREAK.length,n&&(n.path||n.readable&&n.hasOwnProperty("httpVersion")||n instanceof Xn)&&(t.knownLength||this._valuesToMeasure.push(n))},et.prototype._lengthRetriever=function(e,n){e.hasOwnProperty("fd")?null!=e.end&&Infinity!=e.end&&null!=e.start?n(null,e.end+1-(e.start?e.start:0)):s.stat(e.path,function(t,o){t?n(t):n(null,o.size-(e.start?e.start:0))}):e.hasOwnProperty("httpVersion")?n(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",function(t){e.pause(),n(null,+t.headers["content-length"])}),e.resume()):n("Unknown stream")},et.prototype._multiPartHeader=function(e,n,t){if("string"==typeof t.header)return t.header;var o,i=this._getContentDisposition(n,t),a=this._getContentType(n,t),s="",r={"Content-Disposition":["form-data",'name="'+e+'"'].concat(i||[]),"Content-Type":[].concat(a||[])};for(var c in"object"==typeof t.header&&Vn(r,t.header),r)r.hasOwnProperty(c)&&null!=(o=r[c])&&(Array.isArray(o)||(o=[o]),o.length&&(s+=c+": "+o.join("; ")+et.LINE_BREAK));return"--"+this.getBoundary()+et.LINE_BREAK+s+et.LINE_BREAK},et.prototype._getContentDisposition=function(e,n){var t,o;return"string"==typeof n.filepath?t=y.normalize(n.filepath).replace(/\\/g,"/"):n.filename||e.name||e.path?t=y.basename(n.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(t=y.basename(e.client._httpMessage.path||"")),t&&(o='filename="'+t+'"'),o},et.prototype._getContentType=function(e,n){var t=n.contentType;return!t&&e.name&&(t=qn.lookup(e.name)),!t&&e.path&&(t=qn.lookup(e.path)),!t&&e.readable&&e.hasOwnProperty("httpVersion")&&(t=e.headers["content-type"]),t||!n.filepath&&!n.filename||(t=qn.lookup(n.filepath||n.filename)),t||"object"!=typeof e||(t=et.DEFAULT_CONTENT_TYPE),t},et.prototype._multiPartFooter=function(){return function(e){var n=et.LINE_BREAK;0===this._streams.length&&(n+=this._lastBoundary()),e(n)}.bind(this)},et.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+et.LINE_BREAK},et.prototype.getHeaders=function(e){var n,t={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t},et.prototype.setBoundary=function(e){this._boundary=e},et.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},et.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),n=this.getBoundary(),t=0,o=this._streams.length;t<o;t++)"function"!=typeof this._streams[t]&&(e=Buffer.isBuffer(this._streams[t])?Buffer.concat([e,this._streams[t]]):Buffer.concat([e,Buffer.from(this._streams[t])]),"string"==typeof this._streams[t]&&this._streams[t].substring(2,n.length+2)===n||(e=Buffer.concat([e,Buffer.from(et.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},et.prototype._generateBoundary=function(){for(var e="--------------------------",n=0;n<24;n++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},et.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},et.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},et.prototype.getLength=function(e){var n=this._overheadLength+this._valueLength;this._streams.length&&(n+=this._lastBoundary().length),this._valuesToMeasure.length?function(e,n,t){for(var o=Jn(e);o.index<(o.keyedList||e).length;)Gn(e,n,o,function(e,n){e?t(e,n):0!==Object.keys(o.jobs).length||t(null,o.results)}),o.index++;Hn.bind(o,t)}(this._valuesToMeasure,this._lengthRetriever,function(t,o){t?e(t):(o.forEach(function(e){n+=e}),e(null,n))}):process.nextTick(e.bind(this,null,n))},et.prototype.submit=function(e,n){var t,o,i={method:"post"};return"string"==typeof e?(e=Zn(e),o=Vn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(o=Vn(e,i)).port||(o.port="https:"==o.protocol?443:80),o.headers=this.getHeaders(e.headers),t="https:"==o.protocol?Z.request(o):V.request(o),this.getLength(function(e,o){if(e&&"Unknown stream"!==e)this._error(e);else if(o&&t.setHeader("Content-Length",o),this.pipe(t),n){var i,a=function(e,o){return t.removeListener("error",a),t.removeListener("response",i),n.call(this,e,o)};i=a.bind(this,null),t.on("error",a),t.on("response",i)}}.bind(this)),t},et.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},et.prototype.toString=function(){return"[object FormData]"};var nt=Qn;function tt(e){return Tn.isPlainObject(e)||Tn.isArray(e)}function ot(e){return Tn.endsWith(e,"[]")?e.slice(0,-2):e}function it(e,n,t){return e?e.concat(n).map(function(e,n){return e=ot(e),!t&&n?"["+e+"]":e}).join(t?".":""):n}const at=Tn.toFlatObject(Tn,{},null,function(e){return/^is[A-Z]/.test(e)});function st(e,n,t){if(!Tn.isObject(e))throw new TypeError("target must be an object");n=n||new(nt||FormData);const o=(t=Tn.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,n){return!Tn.isUndefined(n[e])})).metaTokens,i=t.visitor||l,a=t.dots,s=t.indexes,r=(t.Blob||"undefined"!=typeof Blob&&Blob)&&Tn.isSpecCompliantForm(n);if(!Tn.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Tn.isDate(e))return e.toISOString();if(!r&&Tn.isBlob(e))throw new En("Blob is not supported. Use a Buffer instead.");return Tn.isArrayBuffer(e)||Tn.isTypedArray(e)?r&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,t,i){let r=e;if(e&&!i&&"object"==typeof e)if(Tn.endsWith(t,"{}"))t=o?t:t.slice(0,-2),e=JSON.stringify(e);else if(Tn.isArray(e)&&function(e){return Tn.isArray(e)&&!e.some(tt)}(e)||(Tn.isFileList(e)||Tn.endsWith(t,"[]"))&&(r=Tn.toArray(e)))return t=ot(t),r.forEach(function(e,o){!Tn.isUndefined(e)&&null!==e&&n.append(!0===s?it([t],o,a):null===s?t:t+"[]",c(e))}),!1;return!!tt(e)||(n.append(it(i,t,a),c(e)),!1)}const p=[],u=Object.assign(at,{defaultVisitor:l,convertValue:c,isVisitable:tt});if(!Tn.isObject(e))throw new TypeError("data must be an object");return function e(t,o){if(!Tn.isUndefined(t)){if(-1!==p.indexOf(t))throw Error("Circular reference detected in "+o.join("."));p.push(t),Tn.forEach(t,function(t,a){!0===(!(Tn.isUndefined(t)||null===t)&&i.call(n,t,Tn.isString(a)?a.trim():a,o,u))&&e(t,o?o.concat(a):[a])}),p.pop()}}(e),n}function rt(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return n[e]})}function ct(e,n){this._pairs=[],e&&st(e,this,n)}const lt=ct.prototype;function pt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ut(e,n,t){if(!n)return e;const o=t&&t.encode||pt,i=t&&t.serialize;let a;if(a=i?i(n,t):Tn.isURLSearchParams(n)?n.toString():new ct(n,t).toString(o),a){const n=e.indexOf("#");-1!==n&&(e=e.slice(0,n)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}lt.append=function(e,n){this._pairs.push([e,n])},lt.toString=function(e){const n=e?function(n){return e.call(this,n,rt)}:rt;return this._pairs.map(function(e){return n(e[0])+"="+n(e[1])},"").join("&")};var dt=class{constructor(){this.handlers=[]}use(e,n,t){return this.handlers.push({fulfilled:e,rejected:n,synchronous:!!t&&t.synchronous,runWhen:t?t.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Tn.forEach(this.handlers,function(n){null!==n&&e(n)})}},mt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ft={isNode:!0,classes:{URLSearchParams:X.URLSearchParams,FormData:nt,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};const ht="undefined"!=typeof window&&"undefined"!=typeof document,gt=(vt="undefined"!=typeof navigator&&navigator.product,ht&&["ReactNative","NativeScript","NS"].indexOf(vt)<0);var vt,xt={__proto__:null,hasBrowserEnv:ht,hasStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,hasStandardBrowserEnv:gt,origin:ht&&window.location.href||"http://localhost",...ft};function bt(e){function n(e,t,o,i){let a=e[i++];if("__proto__"===a)return!0;const s=Number.isFinite(+a),r=i>=e.length;return a=!a&&Tn.isArray(o)?o.length:a,r?(o[a]=Tn.hasOwnProp(o,a)?[o[a],t]:t,!s):(o[a]&&Tn.isObject(o[a])||(o[a]=[]),n(e,t,o[a],i)&&Tn.isArray(o[a])&&(o[a]=function(e){const n={},t=Object.keys(e);let o;const i=t.length;let a;for(o=0;o<i;o++)a=t[o],n[a]=e[a];return n}(o[a])),!s)}if(Tn.isFormData(e)&&Tn.isFunction(e.entries)){const t={};return Tn.forEachEntry(e,(e,o)=>{n(function(e){return Tn.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),o,t,0)}),t}return null}const yt={transitional:mt,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const t=n.getContentType()||"",o=t.indexOf("application/json")>-1,i=Tn.isObject(e);if(i&&Tn.isHTMLForm(e)&&(e=new FormData(e)),Tn.isFormData(e))return o?JSON.stringify(bt(e)):e;if(Tn.isArrayBuffer(e)||Tn.isBuffer(e)||Tn.isStream(e)||Tn.isFile(e)||Tn.isBlob(e)||Tn.isReadableStream(e))return e;if(Tn.isArrayBufferView(e))return e.buffer;if(Tn.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(t.indexOf("application/x-www-form-urlencoded")>-1)return function(e,n){return st(e,new xt.classes.URLSearchParams,Object.assign({visitor:function(e,n,t,o){return xt.isNode&&Tn.isBuffer(e)?(this.append(n,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},n))}(e,this.formSerializer).toString();if((a=Tn.isFileList(e))||t.indexOf("multipart/form-data")>-1){const n=this.env&&this.env.FormData;return st(a?{"files[]":e}:e,n&&new n,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),function(e,n,t){if(Tn.isString(e))try{return(0,JSON.parse)(e),Tn.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const n=this.transitional||yt.transitional,t=n&&n.forcedJSONParsing,o="json"===this.responseType;if(Tn.isResponse(e)||Tn.isReadableStream(e))return e;if(e&&Tn.isString(e)&&(t&&!this.responseType||o)){const t=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(e){if(t){if("SyntaxError"===e.name)throw En.from(e,En.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xt.classes.FormData,Blob:xt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Tn.forEach(["delete","get","head","post","put","patch"],e=>{yt.headers[e]={}});var wt=yt;const _t=Tn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),kt=Symbol("internals");function jt(e){return e&&String(e).trim().toLowerCase()}function St(e){return!1===e||null==e?e:Tn.isArray(e)?e.map(St):String(e)}function $t(e,n,t,o,i){return Tn.isFunction(o)?o.call(this,n,t):(i&&(n=t),Tn.isString(n)?Tn.isString(o)?-1!==n.indexOf(o):Tn.isRegExp(o)?o.test(n):void 0:void 0)}class Tt{constructor(e){e&&this.set(e)}set(e,n,t){const o=this;function i(e,n,t){const i=jt(n);if(!i)throw new Error("header name must be a non-empty string");const a=Tn.findKey(o,i);(!a||void 0===o[a]||!0===t||void 0===t&&!1!==o[a])&&(o[a||n]=St(e))}const a=(e,n)=>Tn.forEach(e,(e,t)=>i(e,t,n));if(Tn.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(Tn.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const n={};let t,o,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),t=e.substring(0,i).trim().toLowerCase(),o=e.substring(i+1).trim(),!t||n[t]&&_t[t]||("set-cookie"===t?n[t]?n[t].push(o):n[t]=[o]:n[t]=n[t]?n[t]+", "+o:o)}),n})(e),n);else if(Tn.isHeaders(e))for(const[n,o]of e.entries())i(o,n,t);else null!=e&&i(n,e,t);return this}get(e,n){if(e=jt(e)){const t=Tn.findKey(this,e);if(t){const e=this[t];if(!n)return e;if(!0===n)return function(e){const n=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=t.exec(e);)n[o[1]]=o[2];return n}(e);if(Tn.isFunction(n))return n.call(this,e,t);if(Tn.isRegExp(n))return n.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=jt(e)){const t=Tn.findKey(this,e);return!(!t||void 0===this[t]||n&&!$t(0,this[t],t,n))}return!1}delete(e,n){const t=this;let o=!1;function i(e){if(e=jt(e)){const i=Tn.findKey(t,e);!i||n&&!$t(0,t[i],i,n)||(delete t[i],o=!0)}}return Tn.isArray(e)?e.forEach(i):i(e),o}clear(e){const n=Object.keys(this);let t=n.length,o=!1;for(;t--;){const i=n[t];e&&!$t(0,this[i],i,e,!0)||(delete this[i],o=!0)}return o}normalize(e){const n=this,t={};return Tn.forEach(this,(o,i)=>{const a=Tn.findKey(t,i);if(a)return n[a]=St(o),void delete n[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,t)=>n.toUpperCase()+t)}(i):String(i).trim();s!==i&&delete n[i],n[s]=St(o),t[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return Tn.forEach(this,(t,o)=>{null!=t&&!1!==t&&(n[o]=e&&Tn.isArray(t)?t.join(", "):t)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const t=new this(e);return n.forEach(e=>t.set(e)),t}static accessor(e){const n=(this[kt]=this[kt]={accessors:{}}).accessors,t=this.prototype;function o(e){const o=jt(e);n[o]||(function(e,n){const t=Tn.toCamelCase(" "+n);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+t,{value:function(e,t,i){return this[o].call(this,n,e,t,i)},configurable:!0})})}(t,e),n[o]=!0)}return Tn.isArray(e)?e.forEach(o):o(e),this}}Tt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Tn.reduceDescriptors(Tt.prototype,({value:e},n)=>{let t=n[0].toUpperCase()+n.slice(1);return{get:()=>e,set(e){this[t]=e}}}),Tn.freezeMethods(Tt);var Et=Tt;function Ot(e,n){const t=this||wt,o=n||t,i=Et.from(o.headers);let a=o.data;return Tn.forEach(e,function(e){a=e.call(t,a,i.normalize(),n?n.status:void 0)}),i.normalize(),a}function Ct(e){return!(!e||!e.__CANCEL__)}function Rt(e,n,t){En.call(this,null==e?"canceled":e,En.ERR_CANCELED,n,t),this.name="CanceledError"}function Nt(e,n,t){const o=t.config.validateStatus;t.status&&o&&!o(t.status)?n(new En("Request failed with status code "+t.status,[En.ERR_BAD_REQUEST,En.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t)):e(t)}function zt(e,n){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(n)?function(e,n){return n?e.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):e}(e,n):n}Tn.inherits(Rt,En,{__CANCEL__:!0});var At=X.parse,Lt={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},Ut=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function It(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var Ft=1e3,Pt=60*Ft,qt=60*Pt,Wt=24*qt,Bt=7*Wt,Dt=function(e,n){n=n||{};var t=typeof e;if("string"===t&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var n=/^(-?(?:\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(n){var t=parseFloat(n[1]);switch((n[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*t;case"weeks":case"week":case"w":return t*Bt;case"days":case"day":case"d":return t*Wt;case"hours":case"hour":case"hrs":case"hr":case"h":return t*qt;case"minutes":case"minute":case"mins":case"min":case"m":return t*Pt;case"seconds":case"second":case"secs":case"sec":case"s":return t*Ft;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}(e);if("number"===t&&isFinite(e))return n.long?function(e){var n=Math.abs(e);return n>=Wt?Mt(e,n,Wt,"day"):n>=qt?Mt(e,n,qt,"hour"):n>=Pt?Mt(e,n,Pt,"minute"):n>=Ft?Mt(e,n,Ft,"second"):e+" ms"}(e):function(e){var n=Math.abs(e);return n>=Wt?Math.round(e/Wt)+"d":n>=qt?Math.round(e/qt)+"h":n>=Pt?Math.round(e/Pt)+"m":n>=Ft?Math.round(e/Ft)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Mt(e,n,t,o){var i=n>=1.5*t;return Math.round(e/t)+" "+o+(i?"s":"")}var Gt=function(e){function n(e){let o,i,a,s=null;function r(...e){if(!r.enabled)return;const t=r,i=Number(new Date);t.diff=i-(o||i),t.prev=o,t.curr=i,o=i,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(o,i)=>{if("%%"===o)return"%";a++;const s=n.formatters[i];return"function"==typeof s&&(o=s.call(t,e[a]),e.splice(a,1),a--),o}),n.formatArgs.call(t,e),(t.log||n.log).apply(t,e)}return r.namespace=e,r.useColors=n.useColors(),r.color=n.selectColor(e),r.extend=t,r.destroy=n.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==n.namespaces&&(i=n.namespaces,a=n.enabled(e)),a),set:e=>{s=e}}),"function"==typeof n.init&&n.init(r),r}function t(e,t){const o=n(this.namespace+(void 0===t?":":t)+e);return o.log=this.log,o}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){const e=[...n.names.map(o),...n.skips.map(o).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.namespaces=e,n.names=[],n.skips=[];const o=("string"==typeof e?e:"").split(/[\s,]+/),i=o.length;for(t=0;t<i;t++)o[t]&&("-"===(e=o[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.slice(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,o;for(t=0,o=n.skips.length;t<o;t++)if(n.skips[t].test(e))return!1;for(t=0,o=n.names.length;t<o;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=Dt,n.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(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]},n.enable(n.load()),n},Jt=Fn(function(e,n){n.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;n.splice(1,0,t,"color: inherit");let o=0,i=0;n[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(o++,"%c"===e&&(i=o))}),n.splice(i,0,t)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("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&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.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`."))}})(),n.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"],n.log=console.debug||console.log||(()=>{}),e.exports=Gt(n);const{formatters:t}=e.exports;t.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}),Ht=(e,n=process.argv)=>{const t=e.startsWith("-")?"":1===e.length?"-":"--",o=n.indexOf(t+e),i=n.indexOf("--");return-1!==o&&(-1===i||o<i)};const{env:Kt}=process;let Yt;function Vt(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Zt(e,n){if(0===Yt)return 0;if(Ht("color=16m")||Ht("color=full")||Ht("color=truecolor"))return 3;if(Ht("color=256"))return 2;if(e&&!n&&void 0===Yt)return 0;const t=Yt||0;if("dumb"===Kt.TERM)return t;if("win32"===process.platform){const e=ne.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in Kt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in Kt)||"codeship"===Kt.CI_NAME?1:t;if("TEAMCITY_VERSION"in Kt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Kt.TEAMCITY_VERSION)?1:0;if("truecolor"===Kt.COLORTERM)return 3;if("TERM_PROGRAM"in Kt){const e=parseInt((Kt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Kt.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Kt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Kt.TERM)||"COLORTERM"in Kt?1:t}Ht("no-color")||Ht("no-colors")||Ht("color=false")||Ht("color=never")?Yt=0:(Ht("color")||Ht("colors")||Ht("color=true")||Ht("color=always"))&&(Yt=1),"FORCE_COLOR"in Kt&&(Yt="true"===Kt.FORCE_COLOR?1:"false"===Kt.FORCE_COLOR?0:0===Kt.FORCE_COLOR.length?1:Math.min(parseInt(Kt.FORCE_COLOR,10),3));var Xt,Qt={supportsColor:function(e){return Vt(Zt(e,e&&e.isTTY))},stdout:Vt(Zt(!0,ee.isatty(1))),stderr:Vt(Zt(!0,ee.isatty(2)))},eo=Fn(function(e,n){n.init=function(e){e.inspectOpts={};const t=Object.keys(n.inspectOpts);for(let o=0;o<t.length;o++)e.inspectOpts[t[o]]=n.inspectOpts[t[o]]},n.log=function(...e){return process.stderr.write(J.format(...e)+"\n")},n.formatArgs=function(t){const{namespace:o,useColors:i}=this;if(i){const n=this.color,i="[3"+(n<8?n:"8;5;"+n),a=` ${i};1m${o} `;t[0]=a+t[0].split("\n").join("\n"+a),t.push(i+"m+"+e.exports.humanize(this.diff)+"")}else t[0]=(n.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+o+" "+t[0]},n.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},n.load=function(){return process.env.DEBUG},n.useColors=function(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):ee.isatty(process.stderr.fd)},n.destroy=J.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{Qt&&(Qt.stderr||Qt).level>=2&&(n.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){}n.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,n)=>{const t=n.substring(6).toLowerCase().replace(/_([a-z])/g,(e,n)=>n.toUpperCase());let o=process.env[n];return o=!!/^(yes|on|true|enabled)$/i.test(o)||!/^(no|off|false|disabled)$/i.test(o)&&("null"===o?null:Number(o)),e[t]=o,e},{}),e.exports=Gt(n);const{formatters:t}=e.exports;t.o=function(e){return this.inspectOpts.colors=this.useColors,J.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},t.O=function(e){return this.inspectOpts.colors=this.useColors,J.inspect(e,this.inspectOpts)}}),no=Fn(function(e){e.exports="undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Jt:eo}),to=function(){if(!Xt){try{Xt=no("follow-redirects")}catch(e){}"function"!=typeof Xt&&(Xt=function(){})}Xt.apply(null,arguments)},oo=X.URL,io=K.Writable,ao=!1;try{Q(new oo)}catch(e){ao="ERR_INVALID_URL"===e.code}var so=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],ro=["abort","aborted","connect","error","socket","timeout"],co=Object.create(null);ro.forEach(function(e){co[e]=function(n,t,o){this._redirectable.emit(e,n,t,o)}});var lo=ko("ERR_INVALID_URL","Invalid URL",TypeError),po=ko("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),uo=ko("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",po),mo=ko("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),fo=ko("ERR_STREAM_WRITE_AFTER_END","write after end"),ho=io.prototype.destroy||xo;function go(e,n){io.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],n&&this.on("response",n);var t=this;this._onNativeResponse=function(e){try{t._processResponse(e)}catch(e){t.emit("error",e instanceof po?e:new po({cause:e}))}},this._performRequest()}function vo(e){var n={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(e).forEach(function(o){var i=o+":",a=t[i]=e[o],s=n[o]=Object.create(a);Object.defineProperties(s,{request:{value:function(e,o,a){return oo&&e instanceof oo?e=wo(e):So(e)?e=wo(bo(e)):(a=o,o=yo(e),e={protocol:i}),$o(o)&&(a=o,o=null),(o=Object.assign({maxRedirects:n.maxRedirects,maxBodyLength:n.maxBodyLength},e,o)).nativeProtocols=t,So(o.host)||So(o.hostname)||(o.hostname="::1"),Q.equal(o.protocol,i,"protocol mismatch"),to("options",o),new go(o,a)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,n,t){var o=s.request(e,n,t);return o.end(),o},configurable:!0,enumerable:!0,writable:!0}})}),n}function xo(){}function bo(e){var n;if(ao)n=new oo(e);else if(!So((n=yo(X.parse(e))).protocol))throw new lo({input:e});return n}function yo(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new lo({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new lo({input:e.href||e});return e}function wo(e,n){var t=n||{};for(var o of so)t[o]=e[o];return t.hostname.startsWith("[")&&(t.hostname=t.hostname.slice(1,-1)),""!==t.port&&(t.port=Number(t.port)),t.path=t.search?t.pathname+t.search:t.pathname,t}function _o(e,n){var t;for(var o in n)e.test(o)&&(t=n[o],delete n[o]);return null==t?void 0:String(t).trim()}function ko(e,n,t){function o(t){Error.captureStackTrace(this,this.constructor),Object.assign(this,t||{}),this.code=e,this.message=this.cause?n+": "+this.cause.message:n}return o.prototype=new(t||Error),Object.defineProperties(o.prototype,{constructor:{value:o,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),o}function jo(e,n){for(var t of ro)e.removeListener(t,co[t]);e.on("error",xo),e.destroy(n)}function So(e){return"string"==typeof e||e instanceof String}function $o(e){return"function"==typeof e}(go.prototype=Object.create(io.prototype)).abort=function(){jo(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},go.prototype.destroy=function(e){return jo(this._currentRequest,e),ho.call(this,e),this},go.prototype.write=function(e,n,t){if(this._ending)throw new fo;if(!(So(e)||"object"==typeof(o=e)&&"length"in o))throw new TypeError("data should be a string, Buffer or Uint8Array");var o;$o(n)&&(t=n,n=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:n}),this._currentRequest.write(e,n,t)):(this.emit("error",new mo),this.abort()):t&&t()},go.prototype.end=function(e,n,t){if($o(e)?(t=e,e=n=null):$o(n)&&(t=n,n=null),e){var o=this,i=this._currentRequest;this.write(e,n,function(){o._ended=!0,i.end(null,null,t)}),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,t)},go.prototype.setHeader=function(e,n){this._options.headers[e]=n,this._currentRequest.setHeader(e,n)},go.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},go.prototype.setTimeout=function(e,n){var t=this;function o(n){n.setTimeout(e),n.removeListener("timeout",n.destroy),n.addListener("timeout",n.destroy)}function i(n){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),a()},e),o(n)}function a(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",a),t.removeListener("error",a),t.removeListener("response",a),t.removeListener("close",a),n&&t.removeListener("timeout",n),t.socket||t._currentRequest.removeListener("socket",i)}return n&&this.on("timeout",n),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",o),this.on("abort",a),this.on("error",a),this.on("response",a),this.on("close",a),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){go.prototype[e]=function(n,t){return this._currentRequest[e](n,t)}}),["aborted","connection","socket"].forEach(function(e){Object.defineProperty(go.prototype,e,{get:function(){return this._currentRequest[e]}})}),go.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var n=e.path.indexOf("?");n<0?e.pathname=e.path:(e.pathname=e.path.substring(0,n),e.search=e.path.substring(n))}},go.prototype._performRequest=function(){var e=this._options.protocol,n=this._options.nativeProtocols[e];if(!n)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var t=e.slice(0,-1);this._options.agent=this._options.agents[t]}var o=this._currentRequest=n.request(this._options,this._onNativeResponse);for(var i of(o._redirectable=this,ro))o.on(i,co[i]);if(this._currentUrl=/^\//.test(this._options.path)?X.format(this._options):this._options.path,this._isRedirect){var a=0,s=this,r=this._requestBodyBuffers;!function e(n){if(o===s._currentRequest)if(n)s.emit("error",n);else if(a<r.length){var t=r[a++];o.finished||o.write(t.data,t.encoding,e)}else s._ended&&o.end()}()}},go.prototype._processResponse=function(e){var n=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:n});var t,o=e.headers.location;if(!o||!1===this._options.followRedirects||n<300||n>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(jo(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new uo;var i=this._options.beforeRedirect;i&&(t=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var a=this._options.method;((301===n||302===n)&&"POST"===this._options.method||303===n&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],_o(/^content-/i,this._options.headers));var s=_o(/^host$/i,this._options.headers),r=bo(this._currentUrl),c=s||r.host,l=/^\w+:/.test(o)?this._currentUrl:X.format(Object.assign(r,{host:c})),p=function(e,n){return ao?new oo(e,n):bo(X.resolve(n,e))}(o,l);to("redirecting to",p.href),this._isRedirect=!0,wo(p,this._options),(p.protocol!==r.protocol&&"https:"!==p.protocol||p.host!==c&&!function(e,n){Q(So(e)&&So(n));var t=e.length-n.length-1;return t>0&&"."===e[t]&&e.endsWith(n)}(p.host,c))&&_o(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),$o(i)&&(i(this._options,{headers:e.headers,statusCode:n},{url:l,method:a,headers:t}),this._sanitizeOptions(this._options)),this._performRequest()};var To=vo({http:V,https:Z});To.wrap=vo;const Eo="1.7.4";function Oo(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}const Co=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/,Ro=Symbol("internals");var No=class extends K.Transform{constructor(e){super({readableHighWaterMark:(e=Tn.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(e,n)=>!Tn.isUndefined(n[e]))).chunkSize});const n=this[Ro]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",e=>{"progress"===e&&(n.isCaptured||(n.isCaptured=!0))})}_read(e){const n=this[Ro];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,t){const o=this[Ro],i=o.maxRate,a=this.readableHighWaterMark,s=o.timeWindow,r=i/(1e3/s),c=!1!==o.minChunkSize?Math.max(o.minChunkSize,.01*r):0,l=(e,n)=>{const t=Buffer.byteLength(e);o.bytesSeen+=t,o.bytes+=t,o.isCaptured&&this.emit("progress",o.bytesSeen),this.push(e)?process.nextTick(n):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(n)}},p=(e,n)=>{const t=Buffer.byteLength(e);let p,u=null,d=a,m=0;if(i){const e=Date.now();(!o.ts||(m=e-o.ts)>=s)&&(o.ts=e,p=r-o.bytes,o.bytes=p<0?-p:0,m=0),p=r-o.bytes}if(i){if(p<=0)return setTimeout(()=>{n(null,e)},s-m);p<d&&(d=p)}d&&t>d&&t-d>c&&(u=e.subarray(d),e=e.subarray(0,d)),l(e,u?()=>{process.nextTick(n,null,u)}:n)};p(e,function e(n,o){if(n)return t(n);o?p(o,e):t(null)})}};const{asyncIterator:zo}=Symbol;var Ao=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[zo]?yield*e[zo]():yield e};const Lo=Tn.ALPHABET.ALPHA_DIGIT+"-_",Uo=new H,Io="\r\n",Fo=Uo.encode(Io);class Po{constructor(e,n){const{escapeName:t}=this.constructor,o=Tn.isString(n);let i=`Content-Disposition: form-data; name="${t(e)}"${!o&&n.name?`; filename="${t(n.name)}"`:""}${Io}`;o?n=Uo.encode(String(n).replace(/\r?\n|\r\n?/g,Io)):i+=`Content-Type: ${n.type||"application/octet-stream"}${Io}`,this.headers=Uo.encode(i+Io),this.contentLength=o?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+2,this.name=e,this.value=n}async*encode(){yield this.headers;const{value:e}=this;Tn.isTypedArray(e)?yield e:yield*Ao(e),yield Fo}static escapeName(e){return String(e).replace(/[\r\n"]/g,e=>({"\r":"%0D","\n":"%0A",'"':"%22"}[e]))}}var qo=class extends K.Transform{__transform(e,n,t){this.push(e),t()}_transform(e,n,t){if(0!==e.length&&(this._transform=this.__transform,120!==e[0])){const e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,n)}this.__transform(e,n,t)}},Wo=(e,n)=>Tn.isAsyncFn(e)?function(...t){const o=t.pop();e.apply(this,t).then(e=>{try{n?o(null,...n(e)):o(null,e)}catch(e){o(e)}},o)}:e;const Bo=(e,n,t=3)=>{let o=0;const i=function(e,n){e=e||10;const t=new Array(e),o=new Array(e);let i,a=0,s=0;return n=void 0!==n?n:1e3,function(r){const c=Date.now(),l=o[s];i||(i=c),t[a]=r,o[a]=c;let p=s,u=0;for(;p!==a;)u+=t[p++],p%=e;if(a=(a+1)%e,a===s&&(s=(s+1)%e),c-i<n)return;const d=l&&c-l;return d?Math.round(1e3*u/d):void 0}}(50,250);return function(e,n){let t,o,i=0,a=1e3/n;const s=(n,a=Date.now())=>{i=a,t=null,o&&(clearTimeout(o),o=null),e.apply(null,n)};return[(...e)=>{const n=Date.now(),r=n-i;r>=a?s(e,n):(t=e,o||(o=setTimeout(()=>{o=null,s(t)},a-r)))},()=>t&&s(t)]}(t=>{const a=t.loaded,s=t.lengthComputable?t.total:void 0,r=a-o,c=i(r);o=a,e({loaded:a,total:s,progress:s?a/s:void 0,bytes:r,rate:c||void 0,estimated:c&&s&&a<=s?(s-a)/c:void 0,event:t,lengthComputable:null!=s,[n?"download":"upload"]:!0})},t)},Do=(e,n)=>{const t=null!=e;return[o=>n[0]({lengthComputable:t,total:e,loaded:o}),n[1]]},Mo=e=>(...n)=>Tn.asap(()=>e(...n)),Go={flush:ie.constants.Z_SYNC_FLUSH,finishFlush:ie.constants.Z_SYNC_FLUSH},Jo={flush:ie.constants.BROTLI_OPERATION_FLUSH,finishFlush:ie.constants.BROTLI_OPERATION_FLUSH},Ho=Tn.isFunction(ie.createBrotliDecompress),{http:Ko,https:Yo}=To,Vo=/https:?/,Zo=xt.protocols.map(e=>e+":"),Xo=(e,[n,t])=>(e.on("end",t).on("error",t),n);function Qo(e,n){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,n)}function ei(e,n,t){let o=n;if(!o&&!1!==o){const e=function(e){var n="string"==typeof e?At(e):e||{},t=n.protocol,o=n.host,i=n.port;if("string"!=typeof o||!o||"string"!=typeof t)return"";if(t=t.split(":",1)[0],!function(e,n){var t=(It("npm_config_no_proxy")||It("no_proxy")).toLowerCase();return!t||"*"!==t&&t.split(/[,\s]/).every(function(t){if(!t)return!0;var o=t.match(/^(.+):(\d+)$/),i=o?o[1]:t,a=o?parseInt(o[2]):0;return!(!a||a===n)||(/^[.*]/.test(i)?("*"===i.charAt(0)&&(i=i.slice(1)),!Ut.call(e,i)):e!==i)})}(o=o.replace(/:\d*$/,""),i=parseInt(i)||Lt[t]||0))return"";var a=It("npm_config_"+t+"_proxy")||It(t+"_proxy")||It("npm_config_proxy")||It("all_proxy");return a&&-1===a.indexOf("://")&&(a=t+"://"+a),a}(t);e&&(o=new URL(e))}if(o){if(o.username&&(o.auth=(o.username||"")+":"+(o.password||"")),o.auth){(o.auth.username||o.auth.password)&&(o.auth=(o.auth.username||"")+":"+(o.auth.password||""));const n=Buffer.from(o.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.headers.host=e.hostname+(e.port?":"+e.port:"");const n=o.hostname||o.host;e.hostname=n,e.host=n,e.port=o.port,e.path=t,o.protocol&&(e.protocol=o.protocol.includes(":")?o.protocol:`${o.protocol}:`)}e.beforeRedirects.proxy=function(e){ei(e,n,e.href)}}const ni="undefined"!=typeof process&&"process"===Tn.kindOf(process),ti=(e,n)=>(({address:e,family:n})=>{if(!Tn.isString(e))throw TypeError("address must be a string");return{address:e,family:n||(e.indexOf(".")<0?6:4)}})(Tn.isObject(e)?e:{address:e,family:n});var oi=ni&&function(e){return n=async function(n,t,o){let{data:i,lookup:a,family:s}=e;const{responseType:r,responseEncoding:c}=e,l=e.method.toUpperCase();let p,u,d=!1;if(a){const e=Wo(a,e=>Tn.isArray(e)?e:[e]);a=(n,t,o)=>{e(n,t,(e,n,i)=>{if(e)return o(e);const a=Tn.isArray(n)?n.map(e=>ti(e)):[ti(n,i)];t.all?o(e,a):o(e,a[0].address,a[0].family)})}}const m=new ae,f=()=>{e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h),m.removeAllListeners()};function h(n){m.emit("abort",!n||n.type?new Rt(null,e,u):n)}o((e,n)=>{p=!0,n&&(d=!0,f())}),m.once("abort",t),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h)));const g=zt(e.baseURL,e.url),v=new URL(g,Tn.hasBrowserEnv?xt.origin:void 0),x=v.protocol||Zo[0];if("data:"===x){let o;if("GET"!==l)return Nt(n,t,{status:405,statusText:"method not allowed",headers:{},config:e});try{o=function(e,n,t){const o=t&&t.Blob||xt.classes.Blob,i=Oo(e);if(void 0===n&&o&&(n=!0),"data"===i){e=i.length?e.slice(i.length+1):e;const t=Co.exec(e);if(!t)throw new En("Invalid URL",En.ERR_INVALID_URL);const a=t[1],s=t[2],r=Buffer.from(decodeURIComponent(t[3]),s?"base64":"utf8");if(n){if(!o)throw new En("Blob is not supported",En.ERR_NOT_SUPPORT);return new o([r],{type:a})}return r}throw new En("Unsupported protocol "+i,En.ERR_NOT_SUPPORT)}(e.url,"blob"===r,{Blob:e.env&&e.env.Blob})}catch(n){throw En.from(n,En.ERR_BAD_REQUEST,e)}return"text"===r?(o=o.toString(c),c&&"utf8"!==c||(o=Tn.stripBOM(o))):"stream"===r&&(o=K.Readable.from(o)),Nt(n,t,{data:o,status:200,statusText:"OK",headers:new Et,config:e})}if(-1===Zo.indexOf(x))return t(new En("Unsupported protocol "+x,En.ERR_BAD_REQUEST,e));const b=Et.from(e.headers).normalize();b.set("User-Agent","axios/"+Eo,!1);const{onUploadProgress:y,onDownloadProgress:w}=e,_=e.maxRate;let k,j;if(Tn.isSpecCompliantForm(i)){const e=b.getContentType(/boundary=([-_\w\d]{10,70})/i);i=((e,n,t)=>{const{tag:o="form-data-boundary",size:i=25,boundary:a=o+"-"+Tn.generateString(i,Lo)}=t||{};if(!Tn.isFormData(e))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");const s=Uo.encode("--"+a+Io),r=Uo.encode("--"+a+"--"+Io+Io);let c=r.byteLength;const l=Array.from(e.entries()).map(([e,n])=>{const t=new Po(e,n);return c+=t.size,t});c+=s.byteLength*l.length,c=Tn.toFiniteNumber(c);const p={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(c)&&(p["Content-Length"]=c),n&&n(p),Y.from(async function*(){for(const e of l)yield s,yield*e.encode();yield r}())})(i,e=>{b.set(e)},{tag:`axios-${Eo}-boundary`,boundary:e&&e[1]||void 0})}else if(Tn.isFormData(i)&&Tn.isFunction(i.getHeaders)){if(b.set(i.getHeaders()),!b.hasContentLength())try{const e=await J.promisify(i.getLength).call(i);Number.isFinite(e)&&e>=0&&b.setContentLength(e)}catch(e){}}else if(Tn.isBlob(i))i.size&&b.setContentType(i.type||"application/octet-stream"),b.setContentLength(i.size||0),i=K.Readable.from(Ao(i));else if(i&&!Tn.isStream(i)){if(Buffer.isBuffer(i));else if(Tn.isArrayBuffer(i))i=Buffer.from(new Uint8Array(i));else{if(!Tn.isString(i))return t(new En("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",En.ERR_BAD_REQUEST,e));i=Buffer.from(i,"utf-8")}if(b.setContentLength(i.length,!1),e.maxBodyLength>-1&&i.length>e.maxBodyLength)return t(new En("Request body larger than maxBodyLength limit",En.ERR_BAD_REQUEST,e))}const S=Tn.toFiniteNumber(b.getContentLength());let $,T;Tn.isArray(_)?(k=_[0],j=_[1]):k=j=_,i&&(y||k)&&(Tn.isStream(i)||(i=K.Readable.from(i,{objectMode:!1})),i=K.pipeline([i,new No({maxRate:Tn.toFiniteNumber(k)})],Tn.noop),y&&i.on("progress",Xo(i,Do(S,Bo(Mo(y),!1,3))))),e.auth&&($=(e.auth.username||"")+":"+(e.auth.password||"")),!$&&v.username&&($=v.username+":"+v.password),$&&b.delete("authorization");try{T=ut(v.pathname+v.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(n){const o=new Error(n.message);return o.config=e,o.url=e.url,o.exists=!0,t(o)}b.set("Accept-Encoding","gzip, compress, deflate"+(Ho?", br":""),!1);const E={path:T,method:l,headers:b.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:$,protocol:x,family:s,beforeRedirect:Qo,beforeRedirects:{}};let O;!Tn.isUndefined(a)&&(E.lookup=a),e.socketPath?E.socketPath=e.socketPath:(E.hostname=v.hostname,E.port=v.port,ei(E,e.proxy,x+"//"+v.hostname+(v.port?":"+v.port:"")+E.path));const C=Vo.test(E.protocol);if(E.agent=C?e.httpsAgent:e.httpAgent,e.transport?O=e.transport:0===e.maxRedirects?O=C?Z:V:(e.maxRedirects&&(E.maxRedirects=e.maxRedirects),e.beforeRedirect&&(E.beforeRedirects.config=e.beforeRedirect),O=C?Yo:Ko),E.maxBodyLength=e.maxBodyLength>-1?e.maxBodyLength:Infinity,e.insecureHTTPParser&&(E.insecureHTTPParser=e.insecureHTTPParser),u=O.request(E,function(o){if(u.destroyed)return;const i=[o],a=+o.headers["content-length"];if(w||j){const e=new No({maxRate:Tn.toFiniteNumber(j)});w&&e.on("progress",Xo(e,Do(a,Bo(Mo(w),!0,3)))),i.push(e)}let s=o;const p=o.req||u;if(!1!==e.decompress&&o.headers["content-encoding"])switch("HEAD"!==l&&204!==o.statusCode||delete o.headers["content-encoding"],(o.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":i.push(ie.createUnzip(Go)),delete o.headers["content-encoding"];break;case"deflate":i.push(new qo),i.push(ie.createUnzip(Go)),delete o.headers["content-encoding"];break;case"br":Ho&&(i.push(ie.createBrotliDecompress(Jo)),delete o.headers["content-encoding"])}s=i.length>1?K.pipeline(i,Tn.noop):i[0];const h=K.finished(s,()=>{h(),f()}),g={status:o.statusCode,statusText:o.statusMessage,headers:new Et(o.headers),config:e,request:p};if("stream"===r)g.data=s,Nt(n,t,g);else{const o=[];let i=0;s.on("data",function(n){o.push(n),i+=n.length,e.maxContentLength>-1&&i>e.maxContentLength&&(d=!0,s.destroy(),t(new En("maxContentLength size of "+e.maxContentLength+" exceeded",En.ERR_BAD_RESPONSE,e,p)))}),s.on("aborted",function(){if(d)return;const n=new En("maxContentLength size of "+e.maxContentLength+" exceeded",En.ERR_BAD_RESPONSE,e,p);s.destroy(n),t(n)}),s.on("error",function(n){u.destroyed||t(En.from(n,null,e,p))}),s.on("end",function(){try{let e=1===o.length?o[0]:Buffer.concat(o);"arraybuffer"!==r&&(e=e.toString(c),c&&"utf8"!==c||(e=Tn.stripBOM(e))),g.data=e}catch(n){return t(En.from(n,null,e,g.request,g))}Nt(n,t,g)})}m.once("abort",e=>{s.destroyed||(s.emit("error",e),s.destroy())})}),m.once("abort",e=>{t(e),u.destroy(e)}),u.on("error",function(n){t(En.from(n,null,e,u))}),u.on("socket",function(e){e.setKeepAlive(!0,6e4)}),e.timeout){const n=parseInt(e.timeout,10);if(Number.isNaN(n))return void t(new En("error trying to parse `config.timeout` to int",En.ERR_BAD_OPTION_VALUE,e,u));u.setTimeout(n,function(){if(p)return;let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),t(new En(n,(e.transitional||mt).clarifyTimeoutError?En.ETIMEDOUT:En.ECONNABORTED,e,u)),h()})}if(Tn.isStream(i)){let n=!1,t=!1;i.on("end",()=>{n=!0}),i.once("error",e=>{t=!0,u.destroy(e)}),i.on("close",()=>{n||t||h(new Rt("Request stream has been aborted",e,u))}),i.pipe(u)}else u.end(i)},new Promise((e,t)=>{let o,i;const a=(e,n)=>{i||(i=!0,o&&o(e,n))},s=e=>{a(e,!0),t(e)};n(n=>{a(n),e(n)},s,e=>o=e).catch(s)});var n},ii=xt.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let t;function o(t){let o=t;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){const n=Tn.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0},ai=xt.hasStandardBrowserEnv?{write(e,n,t,o,i,a){const s=[e+"="+encodeURIComponent(n)];Tn.isNumber(t)&&s.push("expires="+new Date(t).toGMTString()),Tn.isString(o)&&s.push("path="+o),Tn.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};const si=e=>e instanceof Et?{...e}:e;function ri(e,n){n=n||{};const t={};function o(e,n,t){return Tn.isPlainObject(e)&&Tn.isPlainObject(n)?Tn.merge.call({caseless:t},e,n):Tn.isPlainObject(n)?Tn.merge({},n):Tn.isArray(n)?n.slice():n}function i(e,n,t){return Tn.isUndefined(n)?Tn.isUndefined(e)?void 0:o(void 0,e,t):o(e,n,t)}function a(e,n){if(!Tn.isUndefined(n))return o(void 0,n)}function s(e,n){return Tn.isUndefined(n)?Tn.isUndefined(e)?void 0:o(void 0,e):o(void 0,n)}function r(t,i,a){return a in n?o(t,i):a in e?o(void 0,t):void 0}const c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:r,headers:(e,n)=>i(si(e),si(n),!0)};return Tn.forEach(Object.keys(Object.assign({},e,n)),function(o){const a=c[o]||i,s=a(e[o],n[o],o);Tn.isUndefined(s)&&a!==r||(t[o]=s)}),t}var ci=e=>{const n=ri({},e);let t,{data:o,withXSRFToken:i,xsrfHeaderName:a,xsrfCookieName:s,headers:r,auth:c}=n;if(n.headers=r=Et.from(r),n.url=ut(zt(n.baseURL,n.url),e.params,e.paramsSerializer),c&&r.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Tn.isFormData(o))if(xt.hasStandardBrowserEnv||xt.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(!1!==(t=r.getContentType())){const[e,...n]=t?t.split(";").map(e=>e.trim()).filter(Boolean):[];r.setContentType([e||"multipart/form-data",...n].join("; "))}if(xt.hasStandardBrowserEnv&&(i&&Tn.isFunction(i)&&(i=i(n)),i||!1!==i&&ii(n.url))){const e=a&&s&&ai.read(s);e&&r.set(a,e)}return n},li="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(n,t){const o=ci(e);let i=o.data;const a=Et.from(o.headers).normalize();let s,r,c,l,p,{responseType:u,onUploadProgress:d,onDownloadProgress:m}=o;function f(){l&&l(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(s),o.signal&&o.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function g(){if(!h)return;const o=Et.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());Nt(function(e){n(e),f()},function(e){t(e),f()},{data:u&&"text"!==u&&"json"!==u?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:o,config:e,request:h}),h=null}h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout,"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(g)},h.onabort=function(){h&&(t(new En("Request aborted",En.ECONNABORTED,e,h)),h=null)},h.onerror=function(){t(new En("Network Error",En.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let n=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";o.timeoutErrorMessage&&(n=o.timeoutErrorMessage),t(new En(n,(o.transitional||mt).clarifyTimeoutError?En.ETIMEDOUT:En.ECONNABORTED,e,h)),h=null},void 0===i&&a.setContentType(null),"setRequestHeader"in h&&Tn.forEach(a.toJSON(),function(e,n){h.setRequestHeader(n,e)}),Tn.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),u&&"json"!==u&&(h.responseType=o.responseType),m&&([c,p]=Bo(m,!0),h.addEventListener("progress",c)),d&&h.upload&&([r,l]=Bo(d),h.upload.addEventListener("progress",r),h.upload.addEventListener("loadend",l)),(o.cancelToken||o.signal)&&(s=n=>{h&&(t(!n||n.type?new Rt(null,e,h):n),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(s),o.signal&&(o.signal.aborted?s():o.signal.addEventListener("abort",s)));const v=Oo(o.url);v&&-1===xt.protocols.indexOf(v)?t(new En("Unsupported protocol "+v+":",En.ERR_BAD_REQUEST,e)):h.send(i||null)})},pi=(e,n)=>{let t,o=new AbortController;const i=function(e){if(!t){t=!0,s();const n=e instanceof Error?e:this.reason;o.abort(n instanceof En?n:new Rt(n instanceof Error?n.message:n))}};let a=n&&setTimeout(()=>{i(new En(`timeout ${n} of ms exceeded`,En.ETIMEDOUT))},n);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e&&(e.removeEventListener?e.removeEventListener("abort",i):e.unsubscribe(i))}),e=null)};e.forEach(e=>e&&e.addEventListener&&e.addEventListener("abort",i));const{signal:r}=o;return r.unsubscribe=s,[r,()=>{a&&clearTimeout(a),a=null}]};const ui=function*(e,n){let t=e.byteLength;if(!n||t<n)return void(yield e);let o,i=0;for(;i<t;)o=i+n,yield e.slice(i,o),i=o},di=(e,n,t,o,i)=>{const a=async function*(e,n,t){for await(const o of e)yield*ui(ArrayBuffer.isView(o)?o:await t(String(o)),n)}(e,n,i);let s,r=0,c=e=>{s||(s=!0,o&&o(e))};return new ReadableStream({async pull(e){try{const{done:n,value:o}=await a.next();if(n)return c(),void e.close();if(t){let e=r+=o.byteLength;t(e)}e.enqueue(new Uint8Array(o))}catch(e){throw c(e),e}},cancel:e=>(c(e),a.return())},{highWaterMark:2})},mi="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,fi=mi&&"function"==typeof ReadableStream,hi=mi&&("function"==typeof TextEncoder?(gi=new TextEncoder,e=>gi.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var gi;const vi=(e,...n)=>{try{return!!e(...n)}catch(e){return!1}},xi=fi&&vi(()=>{let e=!1;const n=new Request(xt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!n}),bi=fi&&vi(()=>Tn.isReadableStream(new Response("").body)),yi={stream:bi&&(e=>e.body)};var wi;mi&&(wi=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!yi[e]&&(yi[e]=Tn.isFunction(wi[e])?n=>n[e]():(n,t)=>{throw new En(`Response type '${e}' is not supported`,En.ERR_NOT_SUPPORT,t)})}));var _i=mi&&(async e=>{let{url:n,method:t,data:o,signal:i,cancelToken:a,timeout:s,onDownloadProgress:r,onUploadProgress:c,responseType:l,headers:p,withCredentials:u="same-origin",fetchOptions:d}=ci(e);l=l?(l+"").toLowerCase():"text";let m,f,[h,g]=i||a||s?pi([i,a],s):[];const v=()=>{!m&&setTimeout(()=>{h&&h.unsubscribe()}),m=!0};let x;try{if(c&&xi&&"get"!==t&&"head"!==t&&0!==(x=await(async(e,n)=>{const t=Tn.toFiniteNumber(e.getContentLength());return null==t?(async e=>null==e?0:Tn.isBlob(e)?e.size:Tn.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:Tn.isArrayBufferView(e)||Tn.isArrayBuffer(e)?e.byteLength:(Tn.isURLSearchParams(e)&&(e+=""),Tn.isString(e)?(await hi(e)).byteLength:void 0))(n):t})(p,o))){let e,t=new Request(n,{method:"POST",body:o,duplex:"half"});if(Tn.isFormData(o)&&(e=t.headers.get("content-type"))&&p.setContentType(e),t.body){const[e,n]=Do(x,Bo(Mo(c)));o=di(t.body,65536,e,n,hi)}}Tn.isString(u)||(u=u?"include":"omit"),f=new Request(n,{...d,signal:h,method:t.toUpperCase(),headers:p.normalize().toJSON(),body:o,duplex:"half",credentials:u});let i=await fetch(f);const a=bi&&("stream"===l||"response"===l);if(bi&&(r||a)){const e={};["status","statusText","headers"].forEach(n=>{e[n]=i[n]});const n=Tn.toFiniteNumber(i.headers.get("content-length")),[t,o]=r&&Do(n,Bo(Mo(r),!0))||[];i=new Response(di(i.body,65536,t,()=>{o&&o(),a&&v()},hi),e)}l=l||"text";let s=await yi[Tn.findKey(yi,l)||"text"](i,e);return!a&&v(),g&&g(),await new Promise((n,t)=>{Nt(n,t,{data:s,headers:Et.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:f})})}catch(n){if(v(),n&&"TypeError"===n.name&&/fetch/i.test(n.message))throw Object.assign(new En("Network Error",En.ERR_NETWORK,e,f),{cause:n.cause||n});throw En.from(n,n&&n.code,e,f)}});const ki={http:oi,xhr:li,fetch:_i};Tn.forEach(ki,(e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch(e){}Object.defineProperty(e,"adapterName",{value:n})}});const ji=e=>`- ${e}`,Si=e=>Tn.isFunction(e)||null===e||!1===e;var $i=e=>{e=Tn.isArray(e)?e:[e];const{length:n}=e;let t,o;const i={};for(let a=0;a<n;a++){let n;if(t=e[a],o=t,!Si(t)&&(o=ki[(n=String(t)).toLowerCase()],void 0===o))throw new En(`Unknown adapter '${n}'`);if(o)break;i[n||"#"+a]=o}if(!o){const e=Object.entries(i).map(([e,n])=>`adapter ${e} `+(!1===n?"is not supported by the environment":"is not available in the build"));throw new En("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(ji).join("\n"):" "+ji(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function Ti(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Rt(null,e)}function Ei(e){return Ti(e),e.headers=Et.from(e.headers),e.data=Ot.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),$i(e.adapter||wt.adapter)(e).then(function(n){return Ti(e),n.data=Ot.call(e,e.transformResponse,n),n.headers=Et.from(n.headers),n},function(n){return Ct(n)||(Ti(e),n&&n.response&&(n.response.data=Ot.call(e,e.transformResponse,n.response),n.response.headers=Et.from(n.response.headers))),Promise.reject(n)})}const Oi={};["object","boolean","number","function","string","symbol"].forEach((e,n)=>{Oi[e]=function(t){return typeof t===e||"a"+(n<1?"n ":" ")+e}});const Ci={};Oi.transitional=function(e,n,t){function o(e,n){return"[Axios v1.7.4] Transitional option '"+e+"'"+n+(t?". "+t:"")}return(t,i,a)=>{if(!1===e)throw new En(o(i," has been removed"+(n?" in "+n:"")),En.ERR_DEPRECATED);return n&&!Ci[i]&&(Ci[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),!e||e(t,i,a)}};var Ri={assertOptions:function(e,n,t){if("object"!=typeof e)throw new En("options must be an object",En.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let i=o.length;for(;i-- >0;){const a=o[i],s=n[a];if(s){const n=e[a],t=void 0===n||s(n,a,e);if(!0!==t)throw new En("option "+a+" must be "+t,En.ERR_BAD_OPTION_VALUE)}else if(!0!==t)throw new En("Unknown option "+a,En.ERR_BAD_OPTION)}},validators:Oi};const Ni=Ri.validators;class zi{constructor(e){this.defaults=e,this.interceptors={request:new dt,response:new dt}}async request(e,n){try{return await this._request(e,n)}catch(e){if(e instanceof Error){let n;Error.captureStackTrace?Error.captureStackTrace(n={}):n=new Error;const t=n.stack?n.stack.replace(/^.+\n/,""):"";try{e.stack?t&&!String(e.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+t):e.stack=t}catch(e){}}throw e}}_request(e,n){"string"==typeof e?(n=n||{}).url=e:n=e||{},n=ri(this.defaults,n);const{transitional:t,paramsSerializer:o,headers:i}=n;void 0!==t&&Ri.assertOptions(t,{silentJSONParsing:Ni.transitional(Ni.boolean),forcedJSONParsing:Ni.transitional(Ni.boolean),clarifyTimeoutError:Ni.transitional(Ni.boolean)},!1),null!=o&&(Tn.isFunction(o)?n.paramsSerializer={serialize:o}:Ri.assertOptions(o,{encode:Ni.function,serialize:Ni.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&Tn.merge(i.common,i[n.method]);i&&Tn.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),n.headers=Et.concat(a,i);const s=[];let r=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(r=r&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let p,u=0;if(!r){const e=[Ei.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),p=e.length,l=Promise.resolve(n);u<p;)l=l.then(e[u++],e[u++]);return l}p=s.length;let d=n;for(u=0;u<p;){const e=s[u++],n=s[u++];try{d=e(d)}catch(e){n.call(this,e);break}}try{l=Ei.call(this,d)}catch(e){return Promise.reject(e)}for(u=0,p=c.length;u<p;)l=l.then(c[u++],c[u++]);return l}getUri(e){return ut(zt((e=ri(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}Tn.forEach(["delete","get","head","options"],function(e){zi.prototype[e]=function(n,t){return this.request(ri(t||{},{method:e,url:n,data:(t||{}).data}))}}),Tn.forEach(["post","put","patch"],function(e){function n(n){return function(t,o,i){return this.request(ri(i||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:t,data:o}))}}zi.prototype[e]=n(),zi.prototype[e+"Form"]=n(!0)});var Ai=zi;class Li{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(e){n=e});const t=this;this.promise.then(e=>{if(!t._listeners)return;let n=t._listeners.length;for(;n-- >0;)t._listeners[n](e);t._listeners=null}),this.promise.then=e=>{let n;const o=new Promise(e=>{t.subscribe(e),n=e}).then(e);return o.cancel=function(){t.unsubscribe(n)},o},e(function(e,o,i){t.reason||(t.reason=new Rt(e,o,i),n(t.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);-1!==n&&this._listeners.splice(n,1)}static source(){let e;return{token:new Li(function(n){e=n}),cancel:e}}}var Ui=Li;const Ii={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ii).forEach(([e,n])=>{Ii[n]=e});var Fi=Ii;const Pi=function e(n){const t=new Ai(n),o=Ue(Ai.prototype.request,t);return Tn.extend(o,Ai.prototype,t,{allOwnKeys:!0}),Tn.extend(o,t,null,{allOwnKeys:!0}),o.create=function(t){return e(ri(n,t))},o}(wt);Pi.Axios=Ai,Pi.CanceledError=Rt,Pi.CancelToken=Ui,Pi.isCancel=Ct,Pi.VERSION=Eo,Pi.toFormData=st,Pi.AxiosError=En,Pi.Cancel=Pi.CanceledError,Pi.all=function(e){return Promise.all(e)},Pi.spread=function(e){return function(n){return e.apply(null,n)}},Pi.isAxiosError=function(e){return Tn.isObject(e)&&!0===e.isAxiosError},Pi.mergeConfig=ri,Pi.AxiosHeaders=Et,Pi.formToJSON=e=>bt(Tn.isHTMLForm(e)?new FormData(e):e),Pi.getAdapter=$i,Pi.HttpStatusCode=Fi,Pi.default=Pi;var qi=Pi;const{CanceledError:Wi}=qi,Bi=/screenshot(\-\d+?)?\.needle\.(webp|png|jpg|jpeg)/;async function Di(e,n){const t=n.baseUrl+ze.jobs.post_update,o={...Ae(n),job_id:e.identifier,status:e.status},i={status_message:e.status_message,error:e.error,progress:e.progress},a=await fetch(t,{...Le,method:"POST",headers:o,body:JSON.stringify(i)}).catch(e=>(console.error(e),null));return!!a&&a.ok}async function Mi(e,n){const t=n.baseUrl+ze.jobs.get_status,o={...Ae(n),job_id:e,org:n.org},i=await fetch(t,{...Le,method:"GET",headers:o}).catch(e=>(n.verbose?console.error("Failed to get job status",e):console.error("Failed to get job status",e.message),null));return i?i.ok?await i.json():(console.error("Failed to get status",i.status,await i.text()),null):null}const Gi=5242880,Ji=1e4,Hi=16777216,Ki=67108864;function Yi(e){return new Promise(n=>setTimeout(n,e))}var Vi=Fn(function(e){!function(){var n="input is invalid type",t="object"==typeof window,o=t?window:{};o.JS_MD5_NO_WINDOW&&(t=!1);var i=!t&&"object"==typeof self,a=!o.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?o=In:i&&(o=self);var s,r=!o.JS_MD5_NO_COMMON_JS&&e.exports,c=!o.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),p=[128,32768,8388608,-2147483648],u=[0,8,16,24],d=["hex","array","digest","buffer","arrayBuffer","base64"],m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),f=[];if(c){var h=new ArrayBuffer(68);s=new Uint8Array(h),f=new Uint32Array(h)}var g=Array.isArray;!o.JS_MD5_NO_NODE_JS&&g||(g=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var x=ArrayBuffer.isView;!c||!o.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&x||(x=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e){var t=typeof e;if("string"===t)return[e,!0];if("object"!==t||null===e)throw new Error(n);if(c&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!g(e)&&!x(e))throw new Error(n);return[e,!1]},w=function(e){return function(n){return new k(!0).update(n)[e]()}},_=function(e){return function(n,t){return new j(n,!0).update(t)[e]()}};function k(e){if(e)f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f,this.buffer8=s;else if(c){var n=new ArrayBuffer(68);this.buffer8=new Uint8Array(n),this.blocks=new Uint32Array(n)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function j(e,n){var t,o=y(e);if(e=o[0],o[1]){var i,a=[],s=e.length,r=0;for(t=0;t<s;++t)(i=e.charCodeAt(t))<128?a[r++]=i:i<2048?(a[r++]=192|i>>>6,a[r++]=128|63&i):i<55296||i>=57344?(a[r++]=224|i>>>12,a[r++]=128|i>>>6&63,a[r++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++t)),a[r++]=240|i>>>18,a[r++]=128|i>>>12&63,a[r++]=128|i>>>6&63,a[r++]=128|63&i);e=a}e.length>64&&(e=new k(!0).update(e).array());var c=[],l=[];for(t=0;t<64;++t){var p=e[t]||0;c[t]=92^p,l[t]=54^p}k.call(this,n),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=n}k.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");for(var n,t,o=y(e),i=o[1],a=0,s=(e=o[0]).length,r=this.blocks,l=this.buffer8;a<s;){if(this.hashed&&(this.hashed=!1,r[0]=r[16],r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),i)if(c)for(t=this.start;a<s&&t<64;++a)(n=e.charCodeAt(a))<128?l[t++]=n:n<2048?(l[t++]=192|n>>>6,l[t++]=128|63&n):n<55296||n>=57344?(l[t++]=224|n>>>12,l[t++]=128|n>>>6&63,l[t++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++a)),l[t++]=240|n>>>18,l[t++]=128|n>>>12&63,l[t++]=128|n>>>6&63,l[t++]=128|63&n);else for(t=this.start;a<s&&t<64;++a)(n=e.charCodeAt(a))<128?r[t>>>2]|=n<<u[3&t++]:n<2048?(r[t>>>2]|=(192|n>>>6)<<u[3&t++],r[t>>>2]|=(128|63&n)<<u[3&t++]):n<55296||n>=57344?(r[t>>>2]|=(224|n>>>12)<<u[3&t++],r[t>>>2]|=(128|n>>>6&63)<<u[3&t++],r[t>>>2]|=(128|63&n)<<u[3&t++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++a)),r[t>>>2]|=(240|n>>>18)<<u[3&t++],r[t>>>2]|=(128|n>>>12&63)<<u[3&t++],r[t>>>2]|=(128|n>>>6&63)<<u[3&t++],r[t>>>2]|=(128|63&n)<<u[3&t++]);else if(c)for(t=this.start;a<s&&t<64;++a)l[t++]=e[a];else for(t=this.start;a<s&&t<64;++a)r[t>>>2]|=e[a]<<u[3&t++];this.lastByteIndex=t,this.bytes+=t-this.start,t>=64?(this.start=t-64,this.hash(),this.hashed=!0):this.start=t}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},k.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,n=this.lastByteIndex;e[n>>>2]|=p[3&n],n>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},k.prototype.hash=function(){var e,n,t,o,i,a,s=this.blocks;this.first?n=((n=((e=((e=s[0]-680876937)<<7|e>>>25)-271733879|0)^(t=((t=(-271733879^(o=((o=(-1732584194^2004318071&e)+s[1]-117830708)<<12|o>>>20)+e|0)&(-271733879^e))+s[2]-1126478375)<<17|t>>>15)+o|0)&(o^e))+s[3]-1316259209)<<22|n>>>10)+t|0:(e=this.h0,n=this.h1,n=((n+=((e=((e+=((o=this.h3)^n&((t=this.h2)^o))+s[0]-680876936)<<7|e>>>25)+n|0)^(t=((t+=(n^(o=((o+=(t^e&(n^t))+s[1]-389564586)<<12|o>>>20)+e|0)&(e^n))+s[2]+606105819)<<17|t>>>15)+o|0)&(o^e))+s[3]-1044525330)<<22|n>>>10)+t|0),n=((n+=((e=((e+=(o^n&(t^o))+s[4]-176418897)<<7|e>>>25)+n|0)^(t=((t+=(n^(o=((o+=(t^e&(n^t))+s[5]+1200080426)<<12|o>>>20)+e|0)&(e^n))+s[6]-1473231341)<<17|t>>>15)+o|0)&(o^e))+s[7]-45705983)<<22|n>>>10)+t|0,n=((n+=((e=((e+=(o^n&(t^o))+s[8]+1770035416)<<7|e>>>25)+n|0)^(t=((t+=(n^(o=((o+=(t^e&(n^t))+s[9]-1958414417)<<12|o>>>20)+e|0)&(e^n))+s[10]-42063)<<17|t>>>15)+o|0)&(o^e))+s[11]-1990404162)<<22|n>>>10)+t|0,n=((n+=((e=((e+=(o^n&(t^o))+s[12]+1804603682)<<7|e>>>25)+n|0)^(t=((t+=(n^(o=((o+=(t^e&(n^t))+s[13]-40341101)<<12|o>>>20)+e|0)&(e^n))+s[14]-1502002290)<<17|t>>>15)+o|0)&(o^e))+s[15]+1236535329)<<22|n>>>10)+t|0,n=((n+=((o=((o+=(n^t&((e=((e+=(t^o&(n^t))+s[1]-165796510)<<5|e>>>27)+n|0)^n))+s[6]-1069501632)<<9|o>>>23)+e|0)^e&((t=((t+=(e^n&(o^e))+s[11]+643717713)<<14|t>>>18)+o|0)^o))+s[0]-373897302)<<20|n>>>12)+t|0,n=((n+=((o=((o+=(n^t&((e=((e+=(t^o&(n^t))+s[5]-701558691)<<5|e>>>27)+n|0)^n))+s[10]+38016083)<<9|o>>>23)+e|0)^e&((t=((t+=(e^n&(o^e))+s[15]-660478335)<<14|t>>>18)+o|0)^o))+s[4]-405537848)<<20|n>>>12)+t|0,n=((n+=((o=((o+=(n^t&((e=((e+=(t^o&(n^t))+s[9]+568446438)<<5|e>>>27)+n|0)^n))+s[14]-1019803690)<<9|o>>>23)+e|0)^e&((t=((t+=(e^n&(o^e))+s[3]-187363961)<<14|t>>>18)+o|0)^o))+s[8]+1163531501)<<20|n>>>12)+t|0,n=((n+=((o=((o+=(n^t&((e=((e+=(t^o&(n^t))+s[13]-1444681467)<<5|e>>>27)+n|0)^n))+s[2]-51403784)<<9|o>>>23)+e|0)^e&((t=((t+=(e^n&(o^e))+s[7]+1735328473)<<14|t>>>18)+o|0)^o))+s[12]-1926607734)<<20|n>>>12)+t|0,n=((n+=((a=(o=((o+=((i=n^t)^(e=((e+=(i^o)+s[5]-378558)<<4|e>>>28)+n|0))+s[8]-2022574463)<<11|o>>>21)+e|0)^e)^(t=((t+=(a^n)+s[11]+1839030562)<<16|t>>>16)+o|0))+s[14]-35309556)<<23|n>>>9)+t|0,n=((n+=((a=(o=((o+=((i=n^t)^(e=((e+=(i^o)+s[1]-1530992060)<<4|e>>>28)+n|0))+s[4]+1272893353)<<11|o>>>21)+e|0)^e)^(t=((t+=(a^n)+s[7]-155497632)<<16|t>>>16)+o|0))+s[10]-1094730640)<<23|n>>>9)+t|0,n=((n+=((a=(o=((o+=((i=n^t)^(e=((e+=(i^o)+s[13]+681279174)<<4|e>>>28)+n|0))+s[0]-358537222)<<11|o>>>21)+e|0)^e)^(t=((t+=(a^n)+s[3]-722521979)<<16|t>>>16)+o|0))+s[6]+76029189)<<23|n>>>9)+t|0,n=((n+=((a=(o=((o+=((i=n^t)^(e=((e+=(i^o)+s[9]-640364487)<<4|e>>>28)+n|0))+s[12]-421815835)<<11|o>>>21)+e|0)^e)^(t=((t+=(a^n)+s[15]+530742520)<<16|t>>>16)+o|0))+s[2]-995338651)<<23|n>>>9)+t|0,n=((n+=((o=((o+=(n^((e=((e+=(t^(n|~o))+s[0]-198630844)<<6|e>>>26)+n|0)|~t))+s[7]+1126891415)<<10|o>>>22)+e|0)^((t=((t+=(e^(o|~n))+s[14]-1416354905)<<15|t>>>17)+o|0)|~e))+s[5]-57434055)<<21|n>>>11)+t|0,n=((n+=((o=((o+=(n^((e=((e+=(t^(n|~o))+s[12]+1700485571)<<6|e>>>26)+n|0)|~t))+s[3]-1894986606)<<10|o>>>22)+e|0)^((t=((t+=(e^(o|~n))+s[10]-1051523)<<15|t>>>17)+o|0)|~e))+s[1]-2054922799)<<21|n>>>11)+t|0,n=((n+=((o=((o+=(n^((e=((e+=(t^(n|~o))+s[8]+1873313359)<<6|e>>>26)+n|0)|~t))+s[15]-30611744)<<10|o>>>22)+e|0)^((t=((t+=(e^(o|~n))+s[6]-1560198380)<<15|t>>>17)+o|0)|~e))+s[13]+1309151649)<<21|n>>>11)+t|0,n=((n+=((o=((o+=(n^((e=((e+=(t^(n|~o))+s[4]-145523070)<<6|e>>>26)+n|0)|~t))+s[11]-1120210379)<<10|o>>>22)+e|0)^((t=((t+=(e^(o|~n))+s[2]+718787259)<<15|t>>>17)+o|0)|~e))+s[9]-343485551)<<21|n>>>11)+t|0,this.first?(this.h0=e+1732584193|0,this.h1=n-271733879|0,this.h2=t-1732584194|0,this.h3=o+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+n|0,this.h2=this.h2+t|0,this.h3=this.h3+o|0)},k.prototype.toString=k.prototype.hex=function(){this.finalize();var e=this.h0,n=this.h1,t=this.h2,o=this.h3;return l[e>>>4&15]+l[15&e]+l[e>>>12&15]+l[e>>>8&15]+l[e>>>20&15]+l[e>>>16&15]+l[e>>>28&15]+l[e>>>24&15]+l[n>>>4&15]+l[15&n]+l[n>>>12&15]+l[n>>>8&15]+l[n>>>20&15]+l[n>>>16&15]+l[n>>>28&15]+l[n>>>24&15]+l[t>>>4&15]+l[15&t]+l[t>>>12&15]+l[t>>>8&15]+l[t>>>20&15]+l[t>>>16&15]+l[t>>>28&15]+l[t>>>24&15]+l[o>>>4&15]+l[15&o]+l[o>>>12&15]+l[o>>>8&15]+l[o>>>20&15]+l[o>>>16&15]+l[o>>>28&15]+l[o>>>24&15]},k.prototype.array=k.prototype.digest=function(){this.finalize();var e=this.h0,n=this.h1,t=this.h2,o=this.h3;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&n,n>>>8&255,n>>>16&255,n>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&o,o>>>8&255,o>>>16&255,o>>>24&255]},k.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),n=new Uint32Array(e);return n[0]=this.h0,n[1]=this.h1,n[2]=this.h2,n[3]=this.h3,e},k.prototype.buffer=k.prototype.arrayBuffer,k.prototype.base64=function(){for(var e,n,t,o="",i=this.array(),a=0;a<15;)e=i[a++],n=i[a++],t=i[a++],o+=m[e>>>2]+m[63&(e<<4|n>>>4)]+m[63&(n<<2|t>>>6)]+m[63&t];return o+(m[(e=i[a])>>>2]+m[e<<4&63]+"==")},(j.prototype=new k).finalize=function(){if(k.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();k.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),k.prototype.finalize.call(this)}};var S=function(){var e=w("hex");a&&(e=function(e){var t,i=v,a=b.Buffer;return t=a.from&&!o.JS_MD5_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(o){if("string"==typeof o)return i.createHash("md5").update(o,"utf8").digest("hex");if(null==o)throw new Error(n);return o.constructor===ArrayBuffer&&(o=new Uint8Array(o)),g(o)||x(o)||o.constructor===a?i.createHash("md5").update(t(o)).digest("hex"):e(o)}}(e)),e.create=function(){return new k},e.update=function(n){return e.create().update(n)};for(var t=0;t<d.length;++t){var i=d[t];e[i]=w(i)}return e}();S.md5=S,S.md5.hmac=function(){var e=_("hex");e.create=function(e){return new j(e)},e.update=function(n,t){return e.create(n).update(t)};for(var n=0;n<d.length;++n){var t=d[n];e[t]=_(t)}return e}(),r?e.exports=S:o.md5=S}()});function Zi(e,n=0){return na(e,n,2).getUint16(0,!0)}function Xi(e,n=0){return na(e,n,4).getUint32(0,!0)}function Qi(e,n=0,t=e.byteLength){const o=e.slice(n,n+t);return ta.decode(new Uint8Array(o))}function ea(e,n,t=0){if(e.length<n.length+t)return!1;for(const[o,i]of n.entries())if(null!==i&&i!==e[o+t])return!1;return!0}function na(e,n,t){const o=e.slice(n,n+t);return new DataView(new Uint8Array(o).buffer)}const ta=new TextDecoder("utf8"),oa=[["db","application/vnd.sqlite3",[83,81,76,105,116,101,32,102,111,114,109,97,116,32,51,0]],["woff","font/woff",[119,79,70,70]],["woff2","font/woff2",[119,79,70,50]],["bmp","image/bmp",[66,77]],["gif","image/gif",[71,73,70,56,55,97]],["gif","image/gif",[71,73,70,56,57,97]],["heic","image/heic",[102,116,121,112,104,101,105],{offset:4}],["heic","image/heic",[102,116,121,112,109],{offset:4}],["ico","image/x-icon",[0,0,1,0]],["jpg","image/jpeg",[255,216,255]],["pdf","application/pdf",[37,80,68,70,45]],["png","image/png",[137,80,78,71,13,10,26,10]],["7z","application/x-7z-compressed",[55,122,188,175,39,28]],["rar","application/x-rar-compressed",[82,97,114,33,26,7,0]],["rar","application/x-rar-compressed",[82,97,114,33,26,7,1,0]],["rtf","application/rtf",[123,92,114,116,102,49]],["bz2","application/x-bzip2",[66,90,104]],["gz","application/gzip",[31,139]],["tar","application/x-tar",[117,115,116,97,114,0,48,48],{offset:257}],["tar","application/x-tar",[117,115,116,97,114,32,32,0],{offset:257}],["tif","image/tiff",[73,73,42,0]],["tiff","image/tiff",[77,77,0,42]],["zip","application/zip",[80,75,3,4],{exact:!1}],["zip","application/zip",[80,75,5,6]],["mp3","audio/mp3",[255,251]],["mp3","audio/mp3",[255,243]],["mp3","audio/mp3",[255,242]],["mp3","audio/mp3",[73,68,51]],["mp4","video/mp4",[102,116,121,112,105,115,111,109],{offset:4}],["avi","video/x-msvideo",[82,73,70,70,null,null,null,null,65,86,73,32]],["wav","audio/wav",[82,73,70,70,null,null,null,null,87,65,86,69]],["ogx","application/ogg",[79,103,103,83],{exact:!1},[["oga","audio/ogg",[127,70,76,65,67],{offset:28}],["ogg","audio/ogg",[1,118,111,114,98,105,115],{offset:28}],["ogm","video/ogg",[1,118,105,100,101,111,0],{offset:28}],["ogv","video/ogg",[128,116,104,101,111,114,97],{offset:28}]]],["webp","image/webp",[82,73,70,70,null,null,null,null,87,69,66,80]],["psd","image/vnd.adobe.photoshop",[56,66,80,83]],["flac","audio/x-flac",[102,76,97,67]],["wasm","application/wasm",[0,97,115,109]],["deb","application/x-deb",[33,60,97,114,99,104,62,10]],["exe","application/x-msdownload",[77,90]],["exe","application/x-msdownload",[90,77]],["class","application/java-vm",[202,254,186,190]]];function ia(e){return e.flatMap(([e,n,t,o={},i=[]])=>[[e,n,t,o],...i])}function aa(e,n){const t=Zi(e,26),o=Qi(e,30,t),[i]=o.split("/"),a=o.endsWith(".xml");return"META-INF"===i?{ext:"jar",mime:"application/java-archive"}:"ppt"===i&&a?{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:"word"===i&&a?{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:"xl"===i&&a?{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}:"mimetype"===i?function(e,n){const t=Xi(e,18),o=Xi(e,22),i=Zi(e,28);if(t===o){const o=Qi(e,30+n+i,t);if("application/vnd.oasis.opendocument.presentation"===o)return{ext:"odp",mime:o};if("application/vnd.oasis.opendocument.spreadsheet"===o)return{ext:"ods",mime:o};if("application/vnd.oasis.opendocument.text"===o)return{ext:"odt",mime:o};if("application/epub+zip"===o)return{ext:"epub",mime:o}}}(e,t)??n:n}const sa=function(e){return ia(e).map(([e,n,t,{offset:o=0}={}])=>t.length+o).reduce((e,n)=>n>e?n:e,0)}(oa);function ra(e,n){for(const[t,o,i,{exact:a=!0,offset:s=0}={},r=[]]of n)if(ea(e,i,s)){if("zip"===t&&!a)return aa(e.buffer,{ext:t,mime:o});if(!a&&r.length)for(const[n,t,o,{offset:i=0}={}]of r)if(ea(e,o,i))return{ext:n,mime:t};return{ext:t,mime:o}}}function ca(e,n,t=void 0){const o=function(e,n,t){let o=0;for(;;){let n=e.indexOf("\\",o);if(-1===n)break;o=n+1,e=e.replace("\\","/")}return e}(e).split("/").pop()||e,i=(null==t?void 0:t.type)||pa(n,e),a=new File([n],o,{type:i});return a.path=e,a}function la(e){const n=Vi.md5.create();return n.update(e),n.base64()}function pa(e,n=void 0){const t=function(e,{extra:n=!1,hint:t}={}){const o=new Uint8Array(e.slice(0,sa));if(t){const e=function(e,{ext:n,mime:t}){return n||t?ia(e).filter(e=>e[0]===n||e[1]===t):[]}(oa,t);if(e.length>0){const n=ra(o,e);if(void 0!==n)return n}}return ra(o,oa)||(n?function(e){return function(e){try{const n=Qi(e);if(!function(e){for(let n=0;n<e.length;n++)try{const t=e.charCodeAt(n);if(65533===t||t<=8)return!1}catch{return!1}return!0}(n))return;try{return JSON.parse(n),{ext:"json",mime:"application/json"}}catch{return{ext:"txt",mime:"text/plain"}}}catch{return}}(e)}(e):void 0)}(e);if(t)return t.mime;const o=new Uint8Array(e).subarray(0,4);let i="";for(var a=0;a<o.length;a++)i+=o[a].toString(16);let s="unknown";switch(i){case"676c5446":s="model/gltf-binary";break;case"89504e47":s="image/png";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":s="image/jpeg";break;default:s="unknown"}return"unknown"===s&&"string"==typeof n&&(s=function(e){const n=e.toLowerCase();let t="";return n.endsWith(".html")||n.endsWith(".html.gz")||n.endsWith(".html.br")?t="text/html":n.endsWith(".js")||n.endsWith(".js.gz")||n.endsWith(".js.br")||n.endsWith(".mjs")||n.endsWith(".mjs.gz")||n.endsWith(".mjs.br")||n.endsWith(".cjs")||n.endsWith(".cjs.gz")||n.endsWith(".cjs.br")?t="application/javascript":n.endsWith(".wasm")?t="application/wasm":n.endsWith(".css")||n.endsWith(".css.gz")||n.endsWith(".css.br")?t="text/css":n.endsWith(".json")?t="application/json":n.endsWith(".txt")?t="text/plain":n.endsWith(".md")?t="text/markdown":n.endsWith(".yaml")||n.endsWith(".yml")?t="application/yaml":n.endsWith(".bin")?t="application/octet-stream":n.endsWith(".png")?t="image/png":n.endsWith(".jpg")||n.endsWith(".jpeg")?t="image/jpeg":n.endsWith(".gif")?t="image/gif":n.endsWith(".webp")?t="image/webp":n.endsWith(".avif")?t="image/avif":n.endsWith(".bmp")?t="image/bmp":n.endsWith(".tiff")||n.endsWith(".tif")?t="image/tiff":n.endsWith(".ico")?t="image/x-icon":n.endsWith(".svg")?t="image/svg+xml":n.endsWith(".xml")?t="application/xml":n.endsWith(".hdr")?t="image/vnd.radiance":n.endsWith(".exr")?t="image/x-exr":n.endsWith(".ktx2")?t="image/ktx2":n.endsWith(".ktx")?t="image/ktx":n.endsWith(".dds")?t="image/vnd-ms.dds":n.endsWith(".ogg")?t="audio/ogg":n.endsWith(".mp3")?t="audio/mpeg":n.endsWith(".wav")?t="audio/wave":n.endsWith(".flac")?t="audio/flac":n.endsWith(".m4a")?t="audio/mp4":n.endsWith(".aac")?t="audio/aac":n.endsWith(".mp4")?t="video/mp4":n.endsWith(".webm")?t="video/webm":n.endsWith(".mov")?t="video/quicktime":n.endsWith(".woff2")?t="font/woff2":n.endsWith(".woff")?t="font/woff":n.endsWith(".ttf")?t="font/ttf":n.endsWith(".otf")?t="font/otf":n.endsWith(".zip")?t="application/zip":n.endsWith(".glb")?t="model/gltf-binary":n.endsWith(".gltf")?t="model/gltf+json":n.endsWith(".vrm")?t="model/gltf-binary":n.endsWith(".usdz")?t="model/vnd.usdz+zip":n.endsWith(".usda")?t="model/vnd.usd-usda":n.endsWith(".usdc")?t="model/vnd.usd-usdc":n.endsWith(".usd")?t="model/vnd.usd-usd":n.endsWith(".mtl")?t="model/mtl":n.endsWith(".obj")?t="model/obj":n.endsWith(".fbx")?t="model/vnd.autodesk.fbx":n.endsWith(".stl")?t="model/stl":n.endsWith(".mtlx")?t="application/materialx+xml":n.endsWith(".ply")?t="model/ply":n.endsWith(".dae")?t="model/vnd.collada+xml":n.endsWith(".3mf")?t="model/3mf":(n.endsWith(".splat")||n.endsWith(".spz")||n.endsWith(".ksplat")||n.endsWith(".sog")||n.endsWith(".sogs"))&&(t="application/octet-stream"),t}(n)),s}function ua(e,n){const t=e.toLowerCase();return"application/gzip"===n||"application/brotli"===n?(t.endsWith(".html.gz")||t.endsWith(".html.br")?(n="text/html",e=e.substring(0,e.length-3)):t.endsWith(".js.gz")||t.endsWith(".js.br")||t.endsWith(".mjs.gz")||t.endsWith(".mjs.br")||t.endsWith(".cjs.gz")||t.endsWith(".cjs.br")?(n="application/javascript",e=e.substring(0,e.length-3)):t.endsWith(".css.gz")||t.endsWith(".css.br")?(n="text/css",e=e.substring(0,e.length-3)):t.endsWith(".json.gz")||t.endsWith(".json.br")?(n="text/json",e=e.substring(0,e.length-3)):t.endsWith(".txt.gz")||t.endsWith(".txt.br")?(n="text/plain",e=e.substring(0,e.length-3)):t.endsWith(".wasm.gz")||t.endsWith(".wasm.br")?(n="application/wasm",e=e.substring(0,e.length-3)):t.endsWith(".bin.gz")||t.endsWith(".bin.br")?(n="application/octet-stream",e=e.substring(0,e.length-3)):t.endsWith(".png.gz")||t.endsWith(".png.br")?(n="image/png",e=e.substring(0,e.length-3)):t.endsWith(".jpg.gz")||t.endsWith(".jpg.br")||t.endsWith(".jpeg.gz")||t.endsWith(".jpeg.br")?(n="image/jpeg",e=e.substring(0,e.length-3)):t.endsWith(".gif.gz")||t.endsWith(".gif.br")?(n="image/gif",e=e.substring(0,e.length-3)):t.endsWith(".webp.gz")||t.endsWith(".webp.br")?(n="image/webp",e=e.substring(0,e.length-3)):t.endsWith(".svg.gz")||t.endsWith(".svg.br")?(n="image/svg+xml",e=e.substring(0,e.length-3)):t.endsWith(".xml.gz")||t.endsWith(".xml.br")?(n="application/xml",e=e.substring(0,e.length-3)):t.endsWith(".ico.gz")||t.endsWith(".ico.br")?(n="image/x-icon",e=e.substring(0,e.length-3)):t.endsWith(".avif.gz")||t.endsWith(".avif.br")?(n="image/avif",e=e.substring(0,e.length-3)):t.endsWith(".bmp.gz")||t.endsWith(".bmp.br")?(n="image/bmp",e=e.substring(0,e.length-3)):t.endsWith(".tiff.gz")||t.endsWith(".tiff.br")||t.endsWith(".tif.gz")||t.endsWith(".tif.br")?(n="image/tiff",e=e.substring(0,e.length-3)):t.endsWith(".hdr.gz")||t.endsWith(".hdr.br")?(n="image/vnd.radiance",e=e.substring(0,e.length-3)):t.endsWith(".exr.gz")||t.endsWith(".exr.br")?(n="image/x-exr",e=e.substring(0,e.length-3)):t.endsWith(".ktx2.gz")||t.endsWith(".ktx2.br")?(n="image/ktx2",e=e.substring(0,e.length-3)):t.endsWith(".ktx.gz")||t.endsWith(".ktx.br")?(n="image/ktx",e=e.substring(0,e.length-3)):t.endsWith(".dds.gz")||t.endsWith(".dds.br")?(n="image/vnd-ms.dds",e=e.substring(0,e.length-3)):t.endsWith(".webm.gz")||t.endsWith(".webm.br")?(n="video/webm",e=e.substring(0,e.length-3)):t.endsWith(".mp4.gz")||t.endsWith(".mp4.br")?(n="video/mp4",e=e.substring(0,e.length-3)):t.endsWith(".mov.gz")||t.endsWith(".mov.br")?(n="video/quicktime",e=e.substring(0,e.length-3)):t.endsWith(".mp3.gz")||t.endsWith(".mp3.br")?(n="audio/mpeg",e=e.substring(0,e.length-3)):t.endsWith(".wav.gz")||t.endsWith(".wav.br")?(n="audio/wave",e=e.substring(0,e.length-3)):t.endsWith(".ogg.gz")||t.endsWith(".ogg.br")?(n="audio/ogg",e=e.substring(0,e.length-3)):t.endsWith(".flac.gz")||t.endsWith(".flac.br")?(n="audio/flac",e=e.substring(0,e.length-3)):t.endsWith(".m4a.gz")||t.endsWith(".m4a.br")?(n="audio/mp4",e=e.substring(0,e.length-3)):t.endsWith(".aac.gz")||t.endsWith(".aac.br")?(n="audio/aac",e=e.substring(0,e.length-3)):t.endsWith(".woff2.gz")||t.endsWith(".woff2.br")?(n="font/woff2",e=e.substring(0,e.length-3)):t.endsWith(".woff.gz")||t.endsWith(".woff.br")?(n="font/woff",e=e.substring(0,e.length-3)):t.endsWith(".ttf.gz")||t.endsWith(".ttf.br")?(n="font/ttf",e=e.substring(0,e.length-3)):t.endsWith(".otf.gz")||t.endsWith(".otf.br")?(n="font/otf",e=e.substring(0,e.length-3)):t.endsWith(".md.gz")||t.endsWith(".md.br")?(n="text/markdown",e=e.substring(0,e.length-3)):t.endsWith(".yaml.gz")||t.endsWith(".yaml.br")||t.endsWith(".yml.gz")||t.endsWith(".yml.br")?(n="application/yaml",e=e.substring(0,e.length-3)):t.endsWith(".zip.gz")||t.endsWith(".zip.br")?(n="application/zip",e=e.substring(0,e.length-3)):t.endsWith(".glb.gz")||t.endsWith(".glb.br")?(n="model/gltf-binary",e=e.substring(0,e.length-3)):t.endsWith(".gltf.gz")||t.endsWith(".gltf.br")?(n="model/gltf+json",e=e.substring(0,e.length-3)):t.endsWith(".vrm.gz")||t.endsWith(".vrm.br")?(n="model/gltf-binary",e=e.substring(0,e.length-3)):t.endsWith(".usdz.gz")||t.endsWith(".usdz.br")?(n="model/vnd.usdz+zip",e=e.substring(0,e.length-3)):t.endsWith(".usda.gz")||t.endsWith(".usda.br")?(n="model/vnd.usd-usda",e=e.substring(0,e.length-3)):t.endsWith(".usdc.gz")||t.endsWith(".usdc.br")?(n="model/vnd.usd-usdc",e=e.substring(0,e.length-3)):t.endsWith(".usd.gz")||t.endsWith(".usd.br")?(n="model/vnd.usd-usd",e=e.substring(0,e.length-3)):t.endsWith(".obj.gz")||t.endsWith(".obj.br")?(n="model/obj",e=e.substring(0,e.length-3)):t.endsWith(".mtl.gz")||t.endsWith(".mtl.br")?(n="model/mtl",e=e.substring(0,e.length-3)):t.endsWith(".stl.gz")||t.endsWith(".stl.br")?(n="model/stl",e=e.substring(0,e.length-3)):t.endsWith(".mtlx.gz")||t.endsWith(".mtlx.br")?(n="application/materialx+xml",e=e.substring(0,e.length-3)):t.endsWith(".ply.gz")||t.endsWith(".ply.br")?(n="model/ply",e=e.substring(0,e.length-3)):t.endsWith(".dae.gz")||t.endsWith(".dae.br")?(n="model/vnd.collada+xml",e=e.substring(0,e.length-3)):t.endsWith(".3mf.gz")||t.endsWith(".3mf.br")?(n="model/3mf",e=e.substring(0,e.length-3)):(t.endsWith(".splat.gz")||t.endsWith(".splat.br")||t.endsWith(".spz.gz")||t.endsWith(".spz.br")||t.endsWith(".ksplat.gz")||t.endsWith(".ksplat.br")||t.endsWith(".sog.gz")||t.endsWith(".sog.br")||t.endsWith(".sogs.gz")||t.endsWith(".sogs.br"))&&(n="application/octet-stream",e=e.substring(0,e.length-3)),{filename:e,mimetype:n}):null}function da(e,n=void 0,t=!0){const o=Math.abs(e);if(o>=1099511627776){let o=t?" TB":"";return(e/1099511627776).toFixed(void 0===n?2:n)+o}if(o>=1073741824){let o=t?" GB":"";return(e/1073741824).toFixed(void 0===n?2:n)+o}if(o>=1048576){let o=t?" MB":"";return(e/1048576).toFixed(void 0===n?1:n)+o}if(o>=1024){let o=t?" KB":"";return(e/1024).toFixed(void 0===n?0:n)+o}let i=t?" B":"";return e.toFixed(0)+i}function ma(e){return e.split("/").reduce((e,n)=>("."===n||(".."===n?e.pop():null!=n&&n.length&&e.push(n)),e),[]).join("/")}function fa(e,n){let t=n;for(;t<e.length&&0!==e[t];)t++;return t>=e.length?null:new TextDecoder("latin1").decode(e.subarray(n,t))}async function ha(e){return new Promise(n=>setTimeout(n,e))}function ga(e,n,t=void 0){e instanceof Date&&(e=e.getTime()),n instanceof Date&&(n=n.getTime());let o=n-e,i=o>0;const a=!1!==(null==t?void 0:t.prefix),s=!1!==(null==t?void 0:t.suffix);let r="",c="";o<0&&(o=-o);const l=Math.floor(o/1e3),p=Math.floor(l/60),u=Math.floor(p/60),d=Math.floor(u/24);if(null!=(null==t?void 0:t.limitInDays)&&d>=t.limitInDays)return a&&(r="on "),`${r}${new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}${c}`;r=a?i?"":"in ":"",c=s&&i?" ago":"";const m=Math.floor(d/30),f=Math.floor(m/12);return 1===f?`${r}1 year${c}`:f>1?`${r}${Math.floor(f)} years${c}`:1===m?`${r}1 month${c}`:m>1?`${r}${Math.floor(m)} months${c}`:1===d?i&&null!=t&&t.allowSimple?"yesterday":`${r}1 day${c}`:d>1?`${r}${Math.floor(d)} days${c}`:1===u?`${r}1 hour${c}`:u>1?`${r}${Math.floor(u)} hours${c}`:1===p?`${r}1 minute${c}`:p>1?`${r}${Math.floor(p)} minutes${c}`:null!=t&&t.allowSimple&&l<10?"just now":`${r}${l.toFixed(0)} seconds${c}`}const va=/^image_(?<image_lod>\d+)_|^mesh_lod_(?<mesh_lod>\d+)_/;function xa(e){return e.includes("\\u")?JSON.parse(`"${e}"`):decodeURIComponent(e)}function ba(e){let n=null,t="";const o=e.filter(e=>"index.html"===e.name.toLowerCase()||"index.html.gz"===e.name.toLowerCase()||"index.html.br"===e.name.toLowerCase());if(1===o.length)return n=o[0],n;const i=e.filter(e=>e.name.toLowerCase().endsWith(".html")||e.name.toLowerCase().endsWith(".htm")||e.name.toLowerCase().endsWith(".html.gz")||e.name.toLowerCase().endsWith(".html.br"));if(1===i.length)return i[0];if(i.length>1){const e=new Map;for(const n of i){const t=n.path.split("/");let o=e.get(t.length);o||(o=[],e.set(t.length,o)),o.push(n)}const o=Array.from(e.keys()).sort((e,n)=>e-n);if(o.length>0)for(const t of o){const o=e.get(t);if(!o)continue;const i=o.find(e=>"index.html"===e.name.toLowerCase()||"index.html.gz"===e.name.toLowerCase()||"index.html.br"===e.name.toLowerCase());return i?(n=i,n):(n=o[0],n)}return t="Invalid upload: Multiple HTML files found but could not determine root.",console.error(t,i.map(e=>e.path||e.name)),{error:t}}const a=e.filter(e=>e.name.toLowerCase().endsWith(".glb")||e.name.toLowerCase().endsWith(".gltf")||e.name.toLowerCase().endsWith(".vrm"));if(a.length>1){const e=function(e){const n=new Array,t=/(mesh_lod|image)_\d_(.{1,50})/;for(const o of e){if(t.test(o.name))continue;const e=o.name.toLowerCase();(e.endsWith(".gltf")||e.endsWith(".vrm")||e.endsWith(".glb"))&&n.push(o)}return 1==n.length?n[0]:null!=(o=_a(n)[0])?o:null;var o}(a);return e?(n=e,n):(t="Invalid upload: Multiple glb/glTF/vrm files found. This is currently not supported.",console.error(t,a.map(e=>e.path||e.name)),{error:t})}if(1===a.length)return n=a[0],n;const s=e.filter(e=>e.name.toLowerCase().endsWith(".usdz")||e.name.toLowerCase().endsWith(".usd")||e.name.toLowerCase().endsWith(".usda")||e.name.toLowerCase().endsWith(".usdc"));if(s.length>=1)return n=function(e){var n;const t=_a(e),o=["usda","usdz","usd","usdc"];for(const e of o){const n=t.find(n=>n.name.toLowerCase().endsWith(`.${e}`));if(n)return n}return null!=(n=t[0])?n:null}(s),n;const r=e.filter(e=>e.name.toLowerCase().endsWith(".fbx"));if(r.length>1)return t="Invalid upload: Multiple fbx files found. This is currently not supported.",console.error(t,r),{error:t};if(1===r.length)return n=r[0],n;const c=e.filter(e=>e.name.toLowerCase().endsWith(".obj"));if(c.length>1)return t="Invalid upload: Multiple obj files found. This is currently not supported.",console.error(t,c),{error:t};if(1===c.length)return n=c[0],n;const l=e.filter(e=>e.name.toLowerCase().endsWith(".stl"));if(l.length>1)return t="Invalid upload: Multiple stl files found. This is currently not supported.",console.error(t,l),{error:t};if(1===l.length)return n=l[0],n;const p=e.filter(e=>{const n=e.name.toLowerCase();return n.endsWith(".ply")||n.endsWith(".splat")||n.endsWith(".spz")||n.endsWith(".ksplat")||n.endsWith(".sog")||n.endsWith(".sogs")});if(p.length>1)return t="Invalid upload: Multiple splat files found. Upload them as separate content items.",console.error(t,p.map(e=>e.path||e.name)),{error:t};if(1===p.length)return n=p[0],n;if(1===e.length&&!e[0].arrayBuffer&&e[0].path.toLowerCase().startsWith("http"))return n=e[0],n;const u=e.filter(e=>e.name.toLowerCase().endsWith("package.json"));if(1===u.length)return n=u[0],n;if(u.length>1)return t="Invalid upload: Multiple package.json files found. This is currently not supported.",console.error(t,u),{error:t};const d=e.filter(e=>e.name.toLowerCase().endsWith(".mtlx"));if(d.length>1)return t="Invalid upload: Multiple mtlx files found. This is currently not supported.",console.error(t,d),{error:t};if(1===d.length)return n=d[0],n;const m=e.filter(e=>{const n=e.name.toLowerCase();return n.endsWith(".exr")||n.endsWith(".hdr")||n.endsWith(".hdri")});return m.length>1?(t="Invalid upload: Multiple HDRI files found. Upload them as separate content items.",console.error(t,m.map(e=>e.path||e.name)),{error:t}):1===m.length?(n=m[0],n):n||{error:"No supported file to upload found..."}}const ya=new Set(["glb","gltf","vrm"]),wa=new Set(["fbx","obj","stl","usd","usda","usdz"]);function _a(e){let n=Infinity,t=[];for(const o of e){const e=o.path.split("/").length;e<n?(n=e,t=[o]):e===n&&t.push(o)}return t}class ka{constructor(e,n){this.totalFiles=e,this.estimatedTotalSize=n,this.uploadedSize=0,this.startTime=Date.now(),this.lastUpdateTime=this.startTime,this.lastUploadedSize=0,this.speedEMA=null,this.emaFactor=.1,this.smoothedRemainingTime=null,this.recentSpeeds=new Array,this.maxRecentSpeeds=20,this.initialEstimateThreshold=.05}updateProgress(e){const n=Date.now(),t=(n-this.lastUpdateTime)/1e3,o=e-this.lastUploadedSize;if(this.uploadedSize=e,t>0&&o>0){this.recentSpeeds.push(o/t),this.recentSpeeds.length>this.maxRecentSpeeds&&this.recentSpeeds.shift();const e=this.recentSpeeds.reduce((e,n)=>e+n,0)/this.recentSpeeds.length;this.speedEMA=null===this.speedEMA?e:this.emaFactor*e+(1-this.emaFactor)*this.speedEMA}this.lastUpdateTime=n,this.lastUploadedSize=e;const i=this.uploadedSize/this.estimatedTotalSize,a=(n-this.startTime)/1e3,s=this.speedEMA&&this.speedEMA>0?this.speedEMA:this.uploadedSize/a;let r;if(r=s>0?(this.estimatedTotalSize-this.uploadedSize)/s:Infinity,i>=this.initialEstimateThreshold)if(null===this.smoothedRemainingTime)this.smoothedRemainingTime=r;else{const e=.1;this.smoothedRemainingTime=(1-e)*this.smoothedRemainingTime+e*r}else this.smoothedRemainingTime=a/i-a;return this.smoothedRemainingTime=Math.max(this.smoothedRemainingTime,(this.estimatedTotalSize-this.uploadedSize)/s),{progress:100*i,estimatedTimeRemaining:Math.round(this.smoothedRemainingTime),estimatedTimeRemainingString:this.smoothedRemainingTime>3?this.__formatTime(this.smoothedRemainingTime):"few seconds"}}__formatTime(e){if(!isFinite(e))return"Calculating...";if(e<60)return`${Math.round(e)}sec`;const n=Math.floor(e/60);if(n<60)return`${n}min`;const t=Math.floor(n/60);if(t<24)return`${t}h ${n%60}min`;const o=Math.floor(t/24);return o<=10?`${o}d`:"Calculating..."}}async function ja(e){const n=await import("./pako.esm-01431bd2.js"),t=await e.arrayBuffer(),o=n.gzip(new Uint8Array(t)).buffer.slice(0);if(o.byteLength>51200&&o.byteLength>=t.byteLength){if(t.byteLength>0)return null}else if(!(o instanceof ArrayBuffer))return console.error("gzipCompress: Invalid ArrayBuffer"),{error:`Gzip compressing failed for "${e.name}" (unexpected result)`};return ca(`${"path"in e?e.path:e.name}.gz`,o,{type:"application/gzip"})}async function Sa(e,n,t=void 0){const o=async function(e,n,t){var o,i,a,s,r,c,l,p,u,d,m,f,h,g,v;const{files:x,skipped:b}=function(e){const n=[];return{files:e.filter(e=>{const t=e.name||"";return!(!t||t.endsWith("/"))||(n.push({name:t,reason:"directory-entry"}),!1)}),skipped:n}}(n.files);for(const e of b)console.warn(`[upload] Skipping directory entry: "${e.name}"`);n.files=x;const y=(null==(o=t)?void 0:o.loglevel)||"none";if(!x.length)return"none"!=y&&console.error("No files to upload"),{success:!1,error:"No files to upload"};if(!n.entrypoint){const e=ba(x);if(null==e)return{success:!1,error:"No entrypoint file found"};if("object"==typeof e&&"error"in e)return{success:!1,error:e.error};"info"===y&&console.log("Entrypoint: "+e.name),n.entrypoint=e}n.entrypoint&&!x.includes(n.entrypoint)&&x.push(n.entrypoint);const w=await async function(e){if(e.length>5e3)return{success:!1,error:"Too many files. Maximum filecount is 5000"};let n=0,t=0,o=0,i=0;for(let c=e.length-1;c>=0;c--){const l=e[c];if(n+=l.size,n>1073741824)return{success:!1,error:`Total file size exceeds limit of ${1024..toFixed(0)} MB. Please reduce the size of your upload.`};const p=l.name.toLocaleLowerCase();if(".ds_store"!==p){if(p.endsWith(".gltf")?o++:p.endsWith(".glb")?(r=p)&&va.test(r)||i++:p.endsWith(".vrm")&&t++,p.endsWith(".gltf")){var a;o+=1,console.log(`Found glTF file ${l.name}. Will check if all dependencies are available\n`,e);const n=await l.text(),t=n.matchAll(/"uri"\s*:\s*"(?<value>.*?)"/g);if(!t)continue;const i=JSON.parse(n);if("2.0"!==i.asset.version)return console.warn("⚠ glTF version is not 2.0. This is currently not supported."),{success:!1,error:`glTF version ${i.asset.version} is unsupported.Please use glTF 2.0.`};const r=null==(a=l.path)?void 0:a.split("/"),c=r.splice(0,r.length-1).join("/");for(const n of t){var s;const t=null==(s=n.groups)?void 0:s.value;if(t){let n=!1;if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("www.")){console.log(`✅ Found remote dependency ${t} `);break}if(t.startsWith("data:")){console.log(`✅ Found embedded dependency ${t} `);break}{const o=ma(`${c}/${xa(t)}`);console.log('❓ Check if local dependency exists "'+o+'"');for(const t of e){if(t.webkitRelativePath===o||t.name==o){n=!0,console.log(`✅ Found dependency in name or webkit: ${t.name} || ${t.webkitRelativePath} `);break}if(t.path===o){n=!0,console.log(`✅ Found dependency in path: ${t.path} `);break}}}if(!n)return console.warn("⚠ Missing dependency "+t,c),{success:!1,error:"Missing resource: "+t}}}}}else e.splice(c,1)}var r;return{success:!0,vrm_count:t,gltf_count:o,glb_count:i}}(x);if("error"in w)return{success:!1,error:w.error||"Failed to validate files"};if(null!=(i=n.entrypoint)&&i.name.endsWith(".htm")||null!=(a=n.entrypoint)&&a.name.endsWith(".html")||null!=(s=n.entrypoint)&&s.name.endsWith(".html.gz")||null!=(r=n.entrypoint)&&r.name.endsWith(".html.br"))t||(t={}),t.type="deployment";else if(w.vrm_count>10)return{success:!1,error:"Multiple model files found - this is not supported for asset uploads. Please upload a single model file only."};if(n.raw)"none"!=y&&console.warn("Raw upload - skipping gzip compression of files");else for(let e=0;e<x.length;e++){const o=x[e],i=o.name.toLowerCase();if(i.endsWith(".html")||i.endsWith(".js")||i.endsWith(".css")){var _,k;"none"!==(null==(_=t)?void 0:_.loglevel)&&console.log(`gZip compressing file: ${o.name}`);const i=await ja(o).catch(e=>({error:`Error compressing ${o.name}: ${e.message}`}));if(null===i){var j;"none"!==(null==(j=t)?void 0:j.loglevel)&&console.error(`Did not compress file: ${o.name}`);continue}if("error"in i)return{success:!1,error:i.error,status:500};if(!i)return{success:!1,error:`Failed to compress ${o.name}`,status:500};const a=n.entrypoint===o;x[e]=i,a&&(n.entrypoint=i),"none"!==(null==(k=t)?void 0:k.loglevel)&&console.log(`gZip compressed file: ${o.name} ${a?"(entrypoint)":""}`)}}x.sort((e,n)=>e.name.includes(".needle")&&!n.name.includes(".needle")?-1:!e.name.includes(".needle")&&n.name.includes(".needle")?1:0);const{baseUrl:S,authToken:$}=e,T="Bearer "+$,E={...Ae(e),triggered_by:n.triggered_by,filename:`${encodeURIComponent(n.entrypoint.name)}`,"total-files":x.length.toString(),"total-files-size":x.reduce((e,n)=>e+n.size,0).toString()};null!=(c=t)&&c.content_id&&(E.content_id=t.content_id),null!=(l=t)&&l.type&&(E.type=t.type),null!=(p=t)&&p.name&&(E.name=encodeURIComponent(t.name)),null!=(u=t)&&u.parent_job_id&&(E.parent_job_id=t.parent_job_id);const O={entrypoint:(null==(d=n.entrypoint)?void 0:d.path)||(null==(m=n.entrypoint)?void 0:m.name),files:[]};null!=(f=t)&&f.content_type&&(O.content_type=t.content_type);const C={outputs:[O]},R=[];for(let e=0;e<x.length;e++){var N,z,A;const n=x[e];let o=n.path||n.webkitRelativePath||n.name;if(null!=(N=o)&&N.includes(":"))throw new Error(`Invalid filename: ${o}`);let i=await n.arrayBuffer();const a=n.size;let s=n.type;if(null!=(z=s)&&z.length&&"unknown"!==s.toLowerCase()||(s=pa(i,o)),"deployment"===(null==(A=t)?void 0:A.type)){const e=ua(o,s);e&&(o=e.filename,s=e.mimetype)}const r=la(i);R[e]=i,O.files[e]={filename:o,content_type:s,content_length:a,content_md5:r}}try{const e=await async function(e){var n,t,o,i,a;if(!e||"function"!=typeof e.slice||"number"!=typeof e.size)return null;const s=Math.min(e.size,65536);if(s<=0)return null;let r;try{const n=await e.slice(0,s).arrayBuffer();r=new Uint8Array(n)}catch{return null}return null!=(n=null!=(t=null!=(o=null!=(i=null!=(a=function(e){if(e.length<24)return null;if(137!==e[0]||80!==e[1]||78!==e[2]||71!==e[3])return null;if(13!==e[4]||10!==e[5]||26!==e[6]||10!==e[7])return null;const n=new DataView(e.buffer,e.byteOffset),t=n.getUint32(16,!1),o=n.getUint32(20,!1);return t&&o?{width:t,height:o}:null}(r))?a:function(e){if(e.length<28)return null;const n=[171,75,84,88,32,50,48,187,13,10,26,10];for(let t=0;t<n.length;t++)if(e[t]!==n[t])return null;const t=new DataView(e.buffer,e.byteOffset),o=t.getUint32(20,!0),i=t.getUint32(24,!0);return o&&i?{width:o,height:i}:null}(r))?i:function(e){if(e.length<16)return null;if(118!==e[0]||47!==e[1]||49!==e[2]||1!==e[3])return null;const n=new DataView(e.buffer,e.byteOffset);let t=8;for(;t<e.length;){const o=fa(e,t);if(null===o)return null;if(0===o.length)return null;t+=o.length+1;const i=fa(e,t);if(null===i)return null;if(t+=i.length+1,t+4>e.length)return null;const a=n.getInt32(t,!0);if(t+=4,a<0||t+a>e.length)return null;if("dataWindow"===o&&"box2i"===i&&16===a){const e=n.getInt32(t,!0),o=n.getInt32(t+4,!0),i=n.getInt32(t+8,!0)-e+1,a=n.getInt32(t+12,!0)-o+1;return i<=0||a<=0?null:{width:i,height:a}}t+=a}return null}(r))?o:function(e){if(e.length<30)return null;if(82!==e[0]||73!==e[1]||70!==e[2]||70!==e[3])return null;if(87!==e[8]||69!==e[9]||66!==e[10]||80!==e[11])return null;const n=String.fromCharCode(e[12],e[13],e[14],e[15]);if("VP8 "===n){const n=16383&(e[26]|e[27]<<8),t=16383&(e[28]|e[29]<<8);return n&&t?{width:n,height:t}:null}return"VP8L"===n?47!==e[20]?null:{width:1+(16383&(e[21]|e[22]<<8)),height:1+(16383&(e[22]>>6|e[23]<<2|(15&e[24])<<10))}:"VP8X"===n?{width:1+(e[24]|e[25]<<8|e[26]<<16),height:1+(e[27]|e[28]<<8|e[29]<<16)}:null}(r))?t:function(e){if(e.length<4)return null;if(255!==e[0]||216!==e[1])return null;let n=2;for(;n<e.length-8;){for(;n<e.length&&255===e[n];)n++;if(n>=e.length)return null;const t=e[n++];if(1===t||t>=208&&t<=217)continue;if(n+2>e.length)return null;const o=e[n]<<8|e[n+1];if(o<2||n+o>e.length)return null;if(t>=192&&t<=207&&196!==t&&200!==t&&204!==t){if(n+7>e.length)return null;const t=e[n+3]<<8|e[n+4],o=e[n+5]<<8|e[n+6];return o&&t?{width:o,height:t}:null}n+=o}return null}(r))?n:function(e){if(e.length<10)return null;if(35!==e[0]||63!==e[1])return null;const n=new TextDecoder("latin1").decode(e.subarray(0,Math.min(e.length,4096))).match(/[+-]Y\s+(\d+)\s+[+-]X\s+(\d+)/);if(!n)return null;const t=parseInt(n[1],10),o=parseInt(n[2],10);return o&&t?{width:o,height:t}:null}(r)}(n.entrypoint);e&&(O.width=e.width,O.height=e.height)}catch(e){"debug"===y&&console.warn("readImageResolution failed; uploading without dimensions",e)}const L=await fetch(S+ze.upload.request,{...Le,method:"POST",headers:E,body:JSON.stringify(C)}).catch(e=>"fetch failed"==e.message||"Failed to fetch"==e.message?`Network error. Make sure you are connected to the internet and ${S} is reachable.`:(console.error("Failed to begin upload\n",e),null));if(null===L||"string"==typeof L)return{success:!1,error:L||"Failed to begin upload"};if(!L.ok){const e=await L.text();if(e.startsWith("{")){const n=JSON.parse(e);if("error"in n)return{success:!1,status:L.status,error:n.error}}return"none"!=y&&console.error("Failed to begin upload\n",L.status,e),{success:!1,status:L.status,error:`${e}`}}const U=await L.json();"debug"===y&&console.debug("BeginResponse",U);const I=x.reduce((e,n)=>e+n.size,0);var F;if("exists"===U.type)return"none"!=y&&console.log("Upload already exists",U.id),null!=(F=t)&&F.onStart&&t.onStart(U.id,U.content_id),{success:!0,uploadSkipped:!0,id:U.id,type:U.job_type,content_id:U.content_id,filesUploaded:x.length,totalSize:I,url:U.url};const P=n.entrypoint.webkitRelativePath||n.entrypoint.name;let q=0;null==(h=t)||null==(h=h.abort)||h.addEventListener("abort",async()=>{console.log("Upload aborted: Cancelling upload"),await fetch(S+ze.upload.cancel,{...Le,method:"POST",headers:{authorization:T,id:U.id}})});let W=!1,B=Date.now();function D(n,t,o=!1){if(!o&&Date.now()-B<1e3)return!1;if(W&&"completed"!==t)return void("none"!=y&&console.warn("Invalid status update..."));B=Date.now();const i=Math.floor(q/I*100);return"debug"===y&&console.log("SET STATUS: "+t,n,i),Di({identifier:U.id,status:t,status_message:n,progress:i},e),!0}null!=(g=t)&&g.onStart&&t.onStart(U.id,U.content_id);const M=Date.now(),G=new ka(x.length,I/1024/1024),J=new Array;let H=!1;const K=[...x],Y=x.length,V=function(e,n=25e3){let t=!1;const o=setInterval(()=>{if(!t)try{const n=e();n&&"function"==typeof n.then&&n.catch(e=>{console.warn("[upload] heartbeat tick failed:",e)})}catch(e){console.warn("[upload] heartbeat tick threw:",e)}},n);return o&&"function"==typeof o.unref&&o.unref(),function(){t||(t=!0,clearInterval(o))}}(()=>D("Upload in progress","running",!0));try{for(let o=0;o<K.length;o++){var Z;if(null!=(Z=t)&&null!=(Z=Z.abort)&&Z.aborted){console.debug("Upload aborted");break}if(H){console.debug("Upload failed");break}if(J.length<10){console.debug(`Uploading file ${o}/${x.length}: ${x[o].name}`);let i=0,a=0;const s=O.files[o],r=s.filename,c=R[o],l=s.content_length,p=s.content_type,u=x[o],d=u.name.endsWith(".gz")?"gzip":u.name.endsWith(".br")?"br":void 0,m=Oa({uploadId:U.id,uploadRequestPUTUrl:U.request_put_url,entrypointPath:P,file:x[o],fileName:r,fileMd5:s.content_md5,fileBuffer:c,fileType:p,content_encoding:d,fileSize:l,fileIndex:o,fileNumber:o+1,fileCount:Y,loglevel:y,experimental:n.experimental,args:e,options:t,onProgress:e=>{var n;const s=e.progress||0;i=x[o].size*s;const c=i-a;if(a=i,q+=c,null!=(n=t)&&n.progress){const e=q/I,n=x.length,i=x[o].size,a=(Date.now()-M)/1e3,c=G.updateProgress(q/1024/1024);t.progress({uploadedBytes:q,totalBytes:I,progress01:e,fileName:x[o].name,fileSize:i,fileProgress01:s,fileIndex:o,totalFiles:n,estimatedTimeLeftDisplay:c.estimatedTimeRemainingString,estimatedTimeLeft:c.estimatedTimeRemaining,elapsedTime:a}),D(`Uploading file ${o+1}/${n} (${r}): ${(100*s).toFixed(0)}% of ${da(I)}. Finished in approx. ${c.estimatedTimeRemainingString}`,"running",!1)}}}).then(e=>{if(!0!==e)return e;for(let e=J.length-1;e>=0;e--)J[e]===m&&J.splice(e,1);D(`Uploaded ${da(q)+" of "+da(I)} for ${x[o].name}`,"running")}).catch(e=>{var n;null!=(n=t)&&null!=(n=n.abort)&&n.aborted?console.warn("Upload aborted"):(console.error(e.message),H=!0)});J.push(m)}J.length>=10&&await Promise.race(J)}await Promise.all(J).catch(e=>{var n;null!=(n=t)&&null!=(n=n.abort)&&n.aborted?console.warn("Upload aborted"):(console.error(e.message),H=!0)})}finally{V()}if(H)return await Di({identifier:U.id,status:"failed",error:"Failed to upload files"},e),{success:!1,error:"Failed to upload files"};if(null!=(v=t)&&null!=(v=v.abort)&&v.aborted)return await Di({identifier:U.id,status:"canceled",status_message:"Upload aborted",error:"Upload aborted"},e),{success:!1,error:"Upload aborted"};W=!0,console.log(`Upload Done: All files uploaded to ${U.id}`);const X={...Ae(e),id:U.id};"none"!=y&&console.log("Completing upload - notify server");let Q=null;for(let e=0;e<5;e++){var ee;await ha(1e3*e);const n=AbortSignal.timeout(6e4+5e3*e);if(Q=await fetch(S+ze.upload.done,{...Le,method:"POST",headers:X,signal:n}).catch(n=>(console.error(`Failed to complete upload (${e+1} / 5)`,n.message),null)),!0===(null==(ee=Q)?void 0:ee.ok))break;var ne;"none"!=y&&e<4&&console.warn(`Failed to complete upload (${(null==(ne=Q)?void 0:ne.status)||"no status"}): will retry in 1 second`)}if(!Q)return console.error("Failed to complete upload"),{success:!1,error:"Failed to complete upload"};if(!Q.ok){if(524===Q.status)return console.error("Failed to complete upload: Gateway Timeout"),{success:!1,error:"Failed to complete upload: Gateway Timeout"};{const e=await Q.text();return console.error(`Failed to complete upload (${Q.status}): ${e}`),{success:!1,error:"Failed to complete upload"}}}"none"!=y&&console.log("Upload complete");const te=await Q.json();return{success:!0,type:te.type,uploadSkipped:!1,id:te.id,content_id:te.content_id,url:te.url,filesUploaded:x.length,totalSize:I}}(e,n,t);return await o.finally(()=>{})}function $a(e){if(!e)return"unknown upload error";const n=[];try{const i=e.response,a=null==i?void 0:i.status,s=null==i?void 0:i.statusText;a&&n.push(`HTTP ${a}${s?" "+s:""}`);const r=null==i?void 0:i.data;if(null!=r){var t,o;let e;if("string"==typeof r)e=r;else try{e=JSON.stringify(r)}catch{e=String(r)}const i=null==(t=e.match(/<Code>([^<]+)<\/Code>/))?void 0:t[1],a=null==(o=e.match(/<Message>([^<]+)<\/Message>/))?void 0:o[1];i?n.push(`S3 ${i}${a?": "+a:""}`):e&&n.push(e.slice(0,200))}e.message&&n.push(String(e.message))}catch{}return 0===n.length&&e.message&&n.push(String(e.message)),n.length?n.join(" — "):"unknown upload error"}const Ta=12e4;function Ea(e,n){let t=null,o=!1;const i=()=>{t&&(clearTimeout(t),t=null)};return{reset:()=>{o||(i(),t=setTimeout(()=>{o=!0,t=null,n()},e))},cancel:i}}async function Oa(e){if(e.fileSize>=Ki)return async function(e){const{uploadId:n,entrypointPath:t,file:o,fileName:i,fileMd5:a,fileType:s,content_encoding:r,fileSize:c,args:l,options:p,onProgress:u,partSize:d,concurrency:m,maxRetries:f,retryDelayMs:h,putPart:g}=e,{baseUrl:v}=l,x=()=>({...Ae(l),"Content-Type":"application/json",org:l.org,job_id:n}),b={...x(),filesize:c.toString()},y=JSON.stringify({filename:i,entrypoint:t,"content-type":s,"content-md5":a,"content-encoding":r,output_index:0});async function w(e,n,t){const o=await fetch(e,{...Le,method:"POST",headers:n,body:JSON.stringify(t)});if(!o.ok)throw new Error(`${e} ${o.status}: ${await o.text().catch(()=>"")}`);return o.json()}return await async function(e){const{size:n,slice:t,partSize:o=Hi,concurrency:i=4,maxRetries:a=5,retryDelayMs:s=1e3,createUpload:r,getPartUrls:c,putPart:l,completeUpload:p,abortUpload:u,onProgress:d,signal:m,checkCancelled:f}=e,h=async()=>{if(m&&m.aborted)return!0;if(f)try{return!!await f()}catch{return!1}return!1};if(await h())throw new Error("Upload aborted");const g=function(e,n=Hi){if(!Number.isFinite(e)||e<=0)return[];let t=Math.max(n,Gi,Math.ceil(e/Ji));const o=[];let i=0,a=1;for(;i<e;){const n=Math.min(i+t,e);o.push({partNumber:a,start:i,end:n,size:n-i}),i=n,a++}return o}(n,o);if(0===g.length)throw new Error("Nothing to upload (size <= 0)");const{upload_id:v,key:x}=await r(),b=await c(v,x,g.map(e=>e.partNumber)),y=new Map(b.map(e=>[e.part_number,e.url])),w=[];let _=0,k=null;const j=async e=>{const n=y.get(e.partNumber);if(!n)throw new Error(`Missing presigned url for part ${e.partNumber}`);let o;for(let i=0;i<=a;i++){if(await h())throw new Error("Upload aborted");i>0&&s>0&&await Yi(s*i);try{const o=t(e.start,e.end),i=await l({url:n,payload:o,partNumber:e.partNumber,size:e.size,signal:m});if(!i)throw new Error(`No ETag returned for part ${e.partNumber}`);return w.push({part_number:e.partNumber,etag:i}),_+=e.size,void(d&&d(_))}catch(e){if(o=e,await h())throw e}}throw o||new Error(`Failed to upload part ${e.partNumber}`)},S=[...g],$=Math.max(1,Math.min(i,g.length));if(await Promise.all(Array.from({length:$},()=>(async()=>{for(;S.length>0;){if(k||await h())return;const e=S.shift();if(!e)return;try{await j(e)}catch(e){return void(k=k||e)}}})())),k||await h())throw await u(v,x).catch(()=>{}),k||new Error("Upload aborted");return w.sort((e,n)=>e.part_number-n.part_number),await p(v,x,w),{ok:!0,key:x,upload_id:v,parts:g.length}}({size:c,partSize:d,concurrency:m,maxRetries:f,retryDelayMs:h,slice:(e,n)=>o.slice(e,n),signal:null==p?void 0:p.abort,onProgress:e=>{u&&u({loaded:e,total:c,progress:c?e/c:0})},createUpload:async()=>{const e=await fetch(v+ze.upload.multipart_create,{...Le,method:"POST",headers:b,body:y});if(!e.ok)throw new Error(`multipart/create ${e.status}: ${await e.text().catch(()=>"")}`);const n=await e.json();return{upload_id:n.upload_id,key:n.key}},getPartUrls:async(e,n,t)=>(await w(v+ze.upload.multipart_part_urls,x(),{key:n,upload_id:e,part_numbers:t})).urls,putPart:g||(({url:e,payload:n,partNumber:t,signal:o})=>async function({url:e,payload:n,partNumber:t,contentType:o,signal:i}){const a=i,s=new AbortController;let r=!1;const c=()=>s.abort();a&&(a.aborted?s.abort():a.addEventListener("abort",c,{once:!0}));const l=Ea(Ta,()=>{r=!0,s.abort()});l.reset();try{var p,u;const t=await qi.put(e,n,{...Le,withCredentials:!1,signal:s.signal,headers:{"Content-Type":o},onUploadProgress:()=>l.reset()});if(200!==t.status)throw new Error($a({response:t}));const i=(null==(p=t.headers)?void 0:p.etag)||(null==(u=t.headers)?void 0:u.ETag);if(!i)throw new Error("part PUT returned no ETag (is the bucket's CORS exposeHeaders:etag set?)");return i}catch(e){if(null!=a&&a.aborted)throw e;if(r)throw new Error(`Part ${t} stalled: no progress for ${Ta/1e3}s`);throw new Error($a(e))}finally{l.cancel(),a&&a.removeEventListener("abort",c)}}({url:e,payload:n,partNumber:t,signal:o,contentType:s})),completeUpload:async(e,n,t)=>w(v+ze.upload.multipart_complete,x(),{key:n,upload_id:e,parts:t}),abortUpload:async(e,n)=>{await fetch(v+ze.upload.multipart_abort,{...Le,method:"POST",headers:x(),body:JSON.stringify({key:n,upload_id:e})}).catch(()=>{})}}),!0}(e);const{uploadId:n,uploadRequestPUTUrl:t,entrypointPath:o,file:i,fileName:a,fileBuffer:s,fileMd5:r,fileSize:c,fileType:l,content_encoding:p,fileIndex:u,fileNumber:d,fileCount:m,loglevel:f,args:h,options:g,experimental:v}=e;"info"===f&&console.log(`Uploading file "${i.name}" type=${l} (${c}) ${i.type} with hash ${r}`);const x={...Ae(h),"Content-Type":"application/json",org:h.org,job_id:n,filesize:c.toString(),progress:(u/m*100).toFixed(0)},b={filename:a,entrypoint:o,"content-type":l,"content-md5":r,"content-encoding":p,output_index:0};"debug"===f&&console.debug("Requesting presigned URL with headers",x);const y=JSON.stringify(b);let w=null,_="";for(let e=0;e<5;e++){var k;if(null!=w)break;if(null!=g&&null!=(k=g.abort)&&k.aborted)throw new Error("Upload aborted");await ha(200*e),w=await fetch(t,{...Le,method:"POST",headers:x,body:y}).then(async e=>e.ok?await e.json():(_=await e.text(),console.log(t),console.warn(`Failed to get presigned url for "${a}" "${l}" (${e.status}).\n→ Retrying...`),null)).catch(e=>(_=e.message,console.warn("Failed to get presigned url "+e.message+", retrying..."),null))}if(null==w)throw new Error(`Failed to get presigned url for "${a}" "${l}" \n${_}`);const j=w.presigned_url;var S=!1;let $=null;for(let n=0;n<5;n++){var T;if(n>0&&("none"!==f&&console.log(`Retry PUT #${n} for file ${a}`),await ha(1e3*n)),null!=g&&null!=(T=g.abort)&&T.aborted)throw new Wi("Upload aborted");const t={"Content-Type":l,"Content-MD5":r};v&&(t["Content-Length"]=c.toString()),p&&(t["Content-Encoding"]=p),0===n&&"none"!=f&&console.log(`Uploading file ${d}/${m}: ${a}`),"debug"===f&&console.debug("PUT with headers",t);const o=new AbortController;let u=!1;const h=()=>o.abort();null!=g&&g.abort&&(g.abort.aborted?o.abort():g.abort.addEventListener("abort",h,{once:!0}));const x=Ea(Ta,()=>{u=!0,o.abort()});x.reset();const b=await qi.put(j,s,{...Le,withCredentials:!1,signal:o.signal,headers:t,onUploadProgress:n=>{x.reset(),e.onProgress(n)}}).catch(e=>{var n;if(null!=g&&null!=(n=g.abort)&&n.aborted)throw new Wi("Upload aborted");return u?($=`stalled: no upload progress for ${Ta/1e3}s`,"none"!==f&&console.error(`Upload stalled (PUT) (${d}, ${a}) after ${Ta/1e3}s with no progress`),null):($=$a(e),e instanceof Wi||("none"!==f&&console.error(`Failed to upload file (PUT) (${d}, ${a}) "${$}"`),"debug"===f&&(console.log(t,{fileSize:c}),e.response?console.debug(e.response):console.debug(e))),null)}).finally(()=>{x.cancel(),null!=g&&g.abort&&g.abort.removeEventListener("abort",h)});if(b){if(200!==b.status){$=$a({response:b}),console.debug(`Failed (${b.status} ${b.status}) to upload file ${i.name} to "${w.path}". Retrying...`);continue}S=!0,"info"===f&&console.log(`Uploaded file ${d}/${m} "${a}" (${l}, ${da(c)})`);break}}var E;if(!S)throw console.error("Failed to upload file "+a),await Di({identifier:n,status:"failed",status_message:`Failed to upload file (${a}): ${null==(E=$)?void 0:E.substring(0,200)}`,error:"Failed to upload file "+a},h),new Error("Failed to upload file "+a);return!0}async function Ca(e,n,t){const o=e.baseUrl+ze.jobs.presigned_url,i=await fetch(o,{...Le,method:"POST",headers:{...Ae(e),job_id:n},body:JSON.stringify(t)}).catch(e=>(console.error(e),null));return i&&i.ok?await i.text():(console.error("Failed to get presigned download URL",null==i?void 0:i.status),null)}async function Ra(e,n){const t=e.baseUrl+ze.jobs.create,o={...Ae(e),"content-type":"application/json"},i={type:"ai-material",triggered_by:e.trigger_type,parameters:{...n}},a=await fetch(t,{...Le,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();return console.error(`Failed to request texture generation (${a.status}): ${e}`),{error:e||`Request failed (${a.status})`}}return await a.json().catch(e=>(console.error(e),null))}async function Na(e,n={}){const t=new URL(e.baseUrl+ze.content.root);n.content_type&&t.searchParams.set("content_type",n.content_type),n.content_format&&t.searchParams.set("content_format",n.content_format),n.search&&t.searchParams.set("search",n.search),n.tags&&t.searchParams.set("tags",n.tags),n.types&&t.searchParams.set("types",n.types),n.trash&&t.searchParams.set("trash","true"),n.is_public&&t.searchParams.set("is_public","true"),n.page&&t.searchParams.set("page",String(n.page)),n.limit&&t.searchParams.set("limit",String(n.limit)),n.collection_id&&t.searchParams.set("collection_id",n.collection_id),n.offset&&t.searchParams.set("offset",String(n.offset));const o=Ae(e),i=await fetch(t,{...Le,method:"GET",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to list content (${i.status}): ${e}`)}return await i.json()}async function za(e,n){const t=`${e.baseUrl}${ze.content.root}/${n}`,o=Ae(e),i=await fetch(t,{...Le,method:"GET",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to get content (${i.status}): ${e}`)}return await i.json()}const Aa=1179937895,La=1313821514,Ua={schema:{name:"load_needle_engine_skill",description:'Load the Needle Engine skill: authoritative coding guidelines, component patterns, the Unity/Blender-to-web export workflow, and reference docs. Load this BEFORE answering ANY Needle Engine coding or workflow question — do NOT answer from prior knowledge, which is frequently wrong about how Needle actually works (for example: the relationship between Unity C# scripts and TypeScript components, and what the editor export does — Needle does NOT auto-convert C# logic to TypeScript). ALWAYS load first when the user: shares or asks about Unity C# code (a MonoBehaviour, the Needle.Engine.* namespace) or Blender scripts in a Needle context; asks how a Unity or Blender component maps to, converts to, ports to, or works in Needle Engine or TypeScript; asks about components, lifecycle, serialization, XR, networking, deployment, or the export/codegen pipeline; or reports a Needle Engine bug or error. Do NOT load for greetings or small talk that contains no technical question — wait for the actual question first. Without arguments loads the main skill file. Use the "file" parameter to load specific reference files (e.g. "references/api.md", "references/components.md"). Call without arguments first to discover available references.',inputSchema:{type:"object",properties:{file:{type:"string",description:'File to load relative to the skill root, e.g. "references/api.md". Defaults to the main skill file.'}},additionalProperties:!1,required:[]}},async execute(e){const n=(null==e?void 0:e.file)||"SKILL.md";if(n.includes("..")||n.startsWith("/"))return{error:"Invalid file path."};try{const e="https://raw.githubusercontent.com/needle-tools/ai/main/providers/claude/plugin/skills/needle-engine/"+encodeURI(n),t=new AbortController,o=setTimeout(()=>t.abort(),5e3),i=await fetch(e,{signal:t.signal,redirect:"follow"});return clearTimeout(o),i.ok?{content:await i.text()}:{error:`Could not fetch '${n}' (HTTP ${i.status})`}}catch(e){return{error:`Error fetching skill: ${e.message}`}}}};function Ia(e){let n,t=null,o="";for(const i of e.split("\n"))i.startsWith("event: ")?t=i.slice(7).trim():i.startsWith("data: ")?o=i.slice(6):i.startsWith("id: ")&&(n=parseInt(i.slice(4).trim(),10));if(!t)return null;let i=null;switch(t){case"delta":i={type:"delta",content:decodeURIComponent(o)};break;case"message":i={type:"message",content:decodeURIComponent(o)};break;case"status":i={type:"status",message:decodeURIComponent(o)};break;case"error":i={type:"error",message:decodeURIComponent(o)};break;case"stopped":i={type:"stopped"};break;case"tool_call":i={type:"tool_call",...JSON.parse(o)};break;case"tool_result":i={type:"tool_result",...JSON.parse(o)};break;case"elicitation":i={type:"elicitation",...JSON.parse(o)};break;case"done":{const e=JSON.parse(o),{chat_url:n,...t}=e;i={type:"done",token_usage:t},n&&(i.chat_url=n);break}case"message_id":i={type:"message_id",message_id:decodeURIComponent(o)};break;case"chat_id":i={type:"chat_id",chat_id:decodeURIComponent(o)}}return i&&void 0!==n&&(i.id=n),i}function Fa(e,n){const t=Ae(e);return null!=n&&n.personal&&(t["x-needle-ai-chat"]="personal"),null!=n&&n.instanceId&&(t["x-needle-instance-id"]=n.instanceId),t}function Pa(e,n){return n.stream?async function*(e,n){const t=new URL(e.baseUrl+ze.ai.chat),o=Fa(e,n);o["Content-Type"]="application/json";const i={type:"new_message",slug:n.slug,message:n.message,stream:!0,source:n.source,full_url:n.full_url,pathname:n.pathname,context:n.context},a=await fetch(t,{...Le,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();throw new Error(`Failed to stream chat message (${a.status}): ${e}`)}if(!a.body)throw new Error("Response body is null — streaming not supported in this environment");yield*async function*(e){const n=e.getReader(),t=new TextDecoder;let o="";try{for(;;){const{done:e,value:i}=await n.read();if(e)break;o+=t.decode(i,{stream:!0});const a=o.split("\n\n");o=a.pop()||"";for(const e of a){const n=Ia(e);n&&(yield n)}}if(o.trim()){const e=Ia(o);e&&(yield e)}}finally{n.releaseLock()}}(a.body)}(e,n):async function(e,n){const t=new URL(e.baseUrl+ze.ai.chat),o=Fa(e,n);o["Content-Type"]="application/json";const i={type:"new_message",slug:n.slug,message:n.message,stream:!1,source:n.source,full_url:n.full_url,pathname:n.pathname,context:n.context},a=await fetch(t,{...Le,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();throw new Error(`Failed to send chat message (${a.status}): ${e}`)}return await a.json()}(e,n)}const qa=()=>"https://cloud.needle.tools/account",Wa=()=>"https://cloud.needle.tools/edit";function Ba(e){return g(e)}const Da=["node_modules",".git",".vscode",".vercel",".github",".idea"];function Ma(e,n,t=null,o="",i=0){if(null===t){if(i>0)throw new Error("result must be provided if level > 0. Did you forget to pass it?");t={files:[],total_size:0}}if(0===i){if(!r(n))throw new Error(`Directory or file "${n}" does not exist.`);if(c(n).isFile()){const e=ca(n,l(n));return e.path=e.name,t.files.push(e),t.entrypoint=e,t}}else if(i>20)throw new Error("Recursion depth too high. Are you sure you are providing the correct directory?");const a=p(n,{withFileTypes:!0});for(const i of a)if(0==i.isDirectory()){if("optimization"===e&&0==((s=(s=i.name).toLowerCase()).endsWith(".glb")||s.endsWith(".gltf")||s.endsWith(".vrm")||s.endsWith(".usdz")||s.endsWith(".usd")||s.endsWith(".fbx")))continue;const a=ca(o+i.name,l(n+"/"+i.name));if(t.files.push(a),t.total_size+=a.size,t.total_size>1073741824)throw new Error(`Collected filesize exceeds ${1024..toFixed(0)} MB. Are you sure you are providing the correct directory?`);if(t.files.length>1e4)throw new Error(`Too many files (${t.files.length}): The maximum filecount is 10,000.`)}var s;for(const s of a)if(s.isDirectory()){if(Da.includes(s.name))continue;Ma(e,n+"/"+s.name,t,o+s.name+"/",i+1)}return t}const Ga=new RegExp("\\beyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\b","g"),Ja=new RegExp("\\b[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\\b","gi"),Ha=new RegExp("(Authorization:\\s*)([^\\s,;\"']+(?:\\s+[^\\s,;\"']+)?)","gi"),Ka=new RegExp("\\bBearer\\s+([A-Za-z0-9._\\-=]+)","g"),Ya=new RegExp("([?&]token=)([^&\\s\"'<>]+)","g"),Va=new RegExp("<redacted:\\d+ch>","g");function Za(e){if("string"!=typeof e)return e;if(0===e.length)return e;if(Va.test(e)&&(Va.lastIndex=0,!function(e){Ga.lastIndex=0,Ja.lastIndex=0,Ha.lastIndex=0,Ka.lastIndex=0,Ya.lastIndex=0;const n=Ga.test(e)||Ja.test(e)||Ha.test(e)||Ka.test(e)||Ya.test(e);return Ga.lastIndex=0,Ja.lastIndex=0,Ha.lastIndex=0,Ka.lastIndex=0,Ya.lastIndex=0,n}(e.replace(Va,""))))return e;Va.lastIndex=0;let n=e;return n=n.replace(Ha,(e,n,t)=>`${n}<redacted:${t.length}ch>`),n=n.replace(Ya,(e,n,t)=>`${n}<redacted:${t.length}ch>`),n=n.replace(Ka,(e,n)=>`<redacted:${("Bearer "+n).length}ch>`),n=n.replace(Ga,e=>`<redacted:${e.length}ch>`),n=n.replace(Ja,e=>`<redacted:${e.length}ch>`),n}const Xa=["cli.log","cli.prev.log"],Qa=M.join(B.homedir(),".needle","cli","logs");O(Qa,{recursive:!0});try{!function(e,n){const t={migrated:[],skipped:[]};if(!e||!n)return t;if(M.resolve(e)===M.resolve(n))return t;if(!E(e))return t;for(const o of Xa){const i=M.join(e,o);if(E(i))try{O(n,{recursive:!0});const e=M.join(n,o);if(E(e)){const e=M.join(n,o.replace(/\.log$/,"")+".legacy.log");C(i,e),t.skipped.push(o)}else C(i,e),t.migrated.push(o)}catch(e){console.error(`[needle-cloud] Failed to migrate legacy log ${o}: ${e instanceof Error?e.message:e}`)}}}(M.join(R(B.tmpdir()),"Needle","Cloud","logs"),Qa)}catch(e){console.error(`[needle-cloud] legacy log migration check failed: ${e instanceof Error?e.message:e}`)}const es=M.resolve(Qa,"cli.log");if(E(es)){const e=N(es),n=e.mtimeMs;if(Date.now()-n>432e5||e.size>52428800){const e=ts();z(es,e,n=>{n?console.error(`Failed to rename log file: ${n.message}`):console.log(`Log file renamed to ${e}`)})}}function ns(){return es}function ts(){return M.resolve(Qa,"cli.prev.log")}async function os(e,n){return e=Za(e),e=`[${(new Date).toISOString()}] ${e}`,null!=n&&n.emptyLineBefore&&(e="\n"+e),W(es,e+"\n",{flag:"a"}).then(()=>!0).catch(e=>(console.error(`Failed to write to log file: ${e.message}`),!1))}var is={__proto__:null,getLogFilePath:ns,getPrevLogsFilePath:ts,getPipelineLogFilePath:function(){return M.join(B.homedir(),".needle","optimization-pipeline","logs","pipeline.log")},writeToLogFile:os};function as(e,n,t){process.env.GITHUB_ACTIONS&&(process.env.GITHUB_OUTPUT?u(process.env.GITHUB_OUTPUT,`${e}=${n}\n`):null==t||t.logger.warn("GITHUB_OUTPUT environment variable is not set. Cannot set output variables."))}async function ss(e){var n;e.directory=y.resolve(e.directory);let{files:t,entrypoint:o}=Ma("deployment",e.directory);if(e.entrypoint&&(o=t.find(n=>n.path===e.entrypoint),!o))return void T().fail(`Entrypoint "${e.entrypoint}" not found. Please make sure you provide a valid entrypoint.`);if(!o){const e=ba(t);if("error"in e)return os(`[Deployment] Error determining entrypoint: ${e.error}`),void T().fail(`Error: ${e.error}`);o=e}if(!(t.length>0&&o&&(o.name.toLowerCase().endsWith(".html")||o.name.toLowerCase().endsWith(".html.gz")||o.name.toLowerCase().endsWith(".html.br"))))return os("[Deployment] Deployment is not valid: No .html file found."),void T().fail("Deployment is not valid: No .html file found.");if(!o)return os("[Deployment] No entrypoint found. Please provide an index.html file in your project."),void T().fail("No entrypoint found. Please provide an index.html file in your project.");const i=null!=(n=e.endpoint)&&n.length?e.endpoint:"https://cloud.needle.tools/api";let a=e.name;a||(a=rs(e.directory)||void 0);let s=null==i?void 0:i.includes("localhost");const r=a?` of "${a}"`:"",c=T().start(`Begin deployment${r} ${s?"(local)":""} of ${t.length} files...`);c.spinner="earth",await ha(50);let l=-1;os(`Deployment started${r} ${s?"(local)":""} of ${t.length} files...`);const p=await Sa({baseUrl:i,authToken:e.token,org:e.org_id},{triggered_by:"cli",files:t,entrypoint:o,experimental:e.experimental,raw:e.raw},{name:a,type:"deployment",loglevel:e.verbose?"debug":"none",progress:e=>{if(e.fileIndex!==l){l=e.fileIndex;const n=e.totalBytes/1024/1024;c.text=`Uploading file ${e.fileIndex+1} of ${e.totalFiles} files: ${(e.uploadedBytes/1024/1024).toFixed(1)} / ${n.toFixed(1)} MB. Total progress: ${(100*e.progress01).toFixed(1)} %. Time passed: ${e.elapsedTime.toFixed(0)}sec. About ${e.estimatedTimeLeftDisplay} until complete.`}}}).catch(e=>(c.fail(e),null));if(null!=p&&!0===p.success){c.succeed(`🚀 Deployment${r} successful (${p.content_id}/${p.id})`);let n="";n=p.url?p.url:"https://cloud.needle.tools/view/"+p.content_id+"/"+p.id,console.log("🔗 View the deployment at: "+n),e.open&&Ba(n);try{as("deployment_url",n,{logger:e.logger}),as("edit_id",p.content_id,{logger:e.logger})}catch(n){e.logger.error("Error writing output for CI: "+n)}}else c.fail(`${null==p?void 0:p.error}`)}function rs(e,n=0){if(n>10)return null;const t=y.join(e,"needle.config.json");if(r(t)){const n=y.join(e,"package.json");if(r(n)){var o;const e=l(n,"utf8"),t=JSON.parse(e);if(null!=(o=t.name)&&o.length)return t.name}return y.basename(e)}const i=y.dirname(e);return i===e?null:rs(i,n+1)}async function cs(e){if(!e.outDir)throw new Error("Output directory is required");const n=T("Downloading results...").start(),t=await async function(e){const n=await async function(e){if(!e.identifier)return null;const n={...Ae(e)},t={job_id:e.identifier,fields:e.fields,content_format:e.content_format},o=e.baseUrl+ze.jobs.query,i=await fetch(o,{...Le,method:"POST",headers:n,body:JSON.stringify(t)}).catch(e=>(console.error(e),null));if(null==i)return null;if(!i.ok)return console.error("Failed to get job",i.status,await i.text()),null;const a=await i.json().catch(e=>(console.error(e),null));return null==a?null:a.job}({baseUrl:e.baseUrl,authToken:e.authToken,org:e.org,identifier:e.identifier,fields:["results"],content_format:e.content_format});if(null==n||!n.results)return{error:`Job ${e.identifier} did not produce any result files`};const t=n.results;if(!t.bucket||!t.directory)return{error:`Job ${e.identifier} has incomplete result data`};const o=[];for(const n of t.files){if((i=n.filename).startsWith(".extras/")||i.startsWith(".extras\\")||i.endsWith("screenshot.needle.webp")||Bi.test(i)||i.endsWith(".needle.log"))continue;const a=`${t.directory}/${n.filename}`,s=await Ca(e,e.identifier,{bucket:t.bucket,key:a});if(!s){console.error(`Failed to get presigned URL for: ${n.filename}`);continue}const r=await fetch(s).catch(e=>(console.error(e),null));if(!r||!r.ok){console.error(`Failed to download (${null==r?void 0:r.status} | ${null==r?void 0:r.statusText}): ${n.filename}`);continue}const c=await r.arrayBuffer().catch(e=>(console.error(e),null));if(!c)return{error:`Failed to read downloaded file: ${n.filename}`};o.push({filename:n.filename,data:c})}var i;return{files:o}}({baseUrl:e.baseUrl,authToken:e.authToken,org:e.org,identifier:e.identifier,content_format:e.content_format});if("error"in t)return n.fail(t.error),{error:t.error};const o=[];for(const i of t.files){n.text=`Downloading ${i.filename}`,r(e.outDir)||d(e.outDir,{recursive:!0});let a=i.filename;if(e.filename){const n=i.filename.substring(i.filename.lastIndexOf("."));if(1===t.files.length)a=e.filename.includes(".")?e.filename:e.filename+n;else{const n=i.filename.substring(i.filename.lastIndexOf(".")),t=i.filename.substring(0,i.filename.lastIndexOf("."));a=e.filename+"-"+t+n}}const s=e.outDir+"/"+a,c=s.split("/").slice(0,-1).join("/");r(c)||d(c,{recursive:!0}),e.verbose&&console.log(`Writing ${i.filename} (${(i.data.byteLength/1024).toFixed(2)} KB) to "${s}"`),m(s,Buffer.from(i.data)),o.push(s)}return n.succeed(`Downloaded ${o.length} ${1===o.length?"file":"files"}: ${o.join(", ")}`),e.verbose&&console.log("Downloaded files:\n",o),{success:!0,paths:o}}async function ls(e){const{token:n,org_id:t,slug:o,message:i,stream:a}=e;if(a){const e=Pa({baseUrl:"https://cloud.needle.tools/api",authToken:n,org:t},{slug:o,message:i,stream:!0,source:"cli"});for await(const n of e)switch(n.type){case"delta":process.stdout.write(n.content);break;case"message":break;case"status":process.stdout.write(`[${n.message}]\n`);break;case"error":return void T().fail(n.message);case"tool_call":process.stdout.write(`[tool: ${n.name}]\n`);break;case"done":process.stdout.write("\n")}}else{const e=T("Thinking...").start(),a=await Pa({baseUrl:"https://cloud.needle.tools/api",authToken:n,org:t},{slug:o,message:i,stream:!1,source:"cli"});e.stop(),console.log(a.content)}}async function ps(e){const n=new URL((e.endpoint||"https://cloud.needle.tools/api")+ze.get.deployments);n.searchParams.append("offset",e.offset.toString()),n.searchParams.append("limit",e.limit.toString()),e.names&&n.searchParams.append("name",e.names.map(e=>e.trim()).join(","));const t=await fetch(n,{method:"GET",headers:{...Ae({authToken:e.authToken,org:e.org})}});return t.ok?await t.json():{status:t.status,error:await t.text()}}const us=["#e06c75","#d19a66","#e5c07b","#98c379","#7ec8a4","#56b6c2","#61afef","#528bff","#c678dd","#e88de4","#be5046","#d4976c","#b5cea8","#4ec9b0","#9cdcfe","#c8ae9d"];function ds(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t)|0;const[t,o,i]=function(e){const n=parseInt(e.slice(1),16);return[n>>16&255,n>>8&255,255&n]}(us[Math.abs(n)%us.length]);return`[38;2;${t};${o};${i}m${e}`}function ms(e){return`${e}`}const fs=8424,hs="http://localhost:8424",gs=/^\[(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)\]\s?(.*)$/,vs=/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2}):\s*(.*)$/,xs=[[/^\[MCP\]|^MCP (New session|websocket server|Request|SSE|Bridge)|^Unknown MCP/,"mcp"],[/^Needle Cloud connection:|^Cloud tool (request|result|error):/,"cloud"],[/^Denied:/,"denial"],[/^Local (server|token)|^Starting Needle CLI server|^Restarting auth server|^Server is running|^Running server uses different/,"server"],[/^OIDC:|^Sign in|^Sign out|^User logged in|^Logged in successfully|^Token refresh failed|^Failed to validate (login|logout)|^Getting access token|^No access token|^ERR: Missing NEEDLE_CLOUD_TOKEN|^Too many logins|^WARN: You do not have a default organization|^User signed in|^Error during sign in/,"auth"],[/^Settings(:| changed)/,"settings"],[/^\[Deployment\]|^Deployment started/,"deployment"],[/^\[generate-material\]/,"ai"],[/^Active project changed|^Error saving project info/,"project"]],bs=[[/^ERR:|^ERROR:|^Error\b|^Failed\b/,"error"],[/\bconnection: error\b|\bFailed to\b|\b(Token refresh failed)\b|\b(rejected|terminating|pong timeout)\b/i,"error"],[/^WARN:|^WARNING:|^Warning\b/,"warn"]];function ys(e){for(const[n,t]of xs)if(n.test(e))return t;return"general"}function ws(e){for(const[n,t]of bs)if(n.test(e))return t;return"info"}const _s=new RegExp("\\b([A-Z][A-Z0-9_]*(?:_KEY|_TOKEN|_SECRET|_PASSWORD))=([^\\s,;\"']+)","g"),ks=new RegExp("\\b(User(?:name)?:\\s*)([A-Za-z0-9._\\-]{1,64})","g"),js=new RegExp("\\b[A-Za-z0-9._%+\\-]+@[A-Za-z0-9.\\-]+\\.[A-Za-z]{2,}\\b","g"),Ss=52428800;function $s(e,n){if(!E(e))return null;if(n<=0)return"";const{size:t}=N(e);if(0===t)return"";const o=t>n?t-n:0,i=t-o,a=Buffer.allocUnsafe(i),s=A(e,"r");try{let e=0;for(;e<i;){const n=L(s,a,e,i-e,o+e);if(0===n)break;e+=n}}finally{U(s)}if(o>0){const e=a.indexOf(10);return-1===e?"":a.slice(e+1).toString("utf8")}return a.toString("utf8")}async function*Ts(e){const n=le({input:I(e,{encoding:"utf8"}),crlfDelay:Infinity});for await(const e of n)yield e}function Es(e,n,t,o){var i,a;if(0===e.length)return[];const s=function(e){if("string"!=typeof e)return{ts:null,level:"info",source:"general",message:""};let n=null,t=e,o=e.match(gs);if(o)n=o[1],t=o[2];else if(o=e.match(vs),o){const e=new Date(`${o[1]}T${o[2]}`);Number.isNaN(e.getTime())||(n=e.toISOString(),t=o[3])}return{ts:n,level:ws(t),source:ys(t),message:t}}(e),r=null!=(i=null!=(a=s.ts)?a:t)?i:null,c=s.level,l=null!=n?n:s.source;return function(e){if("string"!=typeof e)return[e];if(e.length<=16384)return[e];const n=e.length,t=Math.max(1,16344),o=Math.ceil(n/t),i=[];for(let a=0;a<o;a++){const s=a*t,r=e.slice(s,s+t);i.push(`${r} [chunk ${a+1}/${o} of ${n} bytes]`)}return i}(function(e,n){if("string"!=typeof e)return e;if(0===e.length)return e;let t=Za(e);return t=function(e,n){if(!n)return e;const t=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\\/g,"\\\\+"),o=new RegExp(t,"gi");return e.replace(o,"~")}(t,null==n?void 0:n.homeDir),t=function(e){return e.replace(_s,(e,n,t)=>`${n}=<redacted:${t.length}ch>`)}(t),t=function(e){return e.replace(ks,(e,n,t)=>`${n}<redacted:${t.length}ch>`)}(t),t=function(e){return e.replace(js,e=>`<redacted:${e.length}ch>`)}(t),t}(s.message,o)).map(e=>({ts:r,level:c,source:l,message:e}))}const Os="https://haystack.needle.tools/api/ingest/logs",Cs="https://haystack.needle.tools";async function Rs(e){try{return await e.json()}catch{return null}}async function Ns(e){try{return await e.text()}catch{return""}}function zs(e){const n=e instanceof Error?e.message:String(e),t=e&&"object"==typeof e?e.cause:void 0;let o=n;if(t){const e=t instanceof Error?t.message:String(t),n="object"==typeof t&&null!==t?t.code:void 0;o=n?`${e} (${n})`:e}return`Network error reaching ${Os}: ${o}`}var As,Ls={__proto__:null,HAYSTACK_RESOURCE:Cs,runSendLogs:async function(e,n){var t;let o=await n.getAccessToken();if(!o&&n.recoverAuth)try{n.stdout.write("Updating sign-in (your stored permissions need a one-time refresh)...\n"),o=await n.recoverAuth()}catch{o=null}if(!o)return{ok:!1,error:"Not signed in. Run `needle-cloud login` first, then retry."};const i={type:"meta",...n.meta,mode:e.mode,...e.note?{note:e.note}:{}},a=n.findActiveEditorLog(),s=function(e){const n=pe.from(async function*(e){if(yield JSON.stringify(e.meta)+"\n",e.prevLogPath&&E(e.prevLogPath)){let n=null;for await(const t of Ts(e.prevLogPath)){const o=Es(t,null,n,e.redactOpts);for(const e of o)e.ts&&(n=e.ts),yield JSON.stringify(e)+"\n"}}if(e.cliLogPath&&E(e.cliLogPath)){let n=null;for await(const t of Ts(e.cliLogPath)){const o=Es(t,null,n,e.redactOpts);for(const e of o)e.ts&&(n=e.ts),yield JSON.stringify(e)+"\n"}}if(e.editor){var n,t;const o=null!=(n=e.editor.tailBytes)?n:Ss,i=null!=(t=e.editor.paths)?t:e.editor.path?[e.editor.path]:[];for(const n of i){const t=$s(n,o);if(!t)continue;let i=null;try{i=N(n).mtime.toISOString()}catch{}for(const n of t.split("\n")){const t=Es(n,e.editor.editor,i,e.redactOpts);for(const e of t)e.ts&&(i=e.ts),yield JSON.stringify(e)+"\n"}}}if(e.pipelineLogPath&&E(e.pipelineLogPath)){var o;const n=null!=(o=e.pipelineTailBytes)?o:Ss,t=$s(e.pipelineLogPath,n);if(t){let n=null;try{n=N(e.pipelineLogPath).mtime.toISOString()}catch{}for(const o of t.split("\n")){const t=Es(o,"gltf-build-pipeline",n,e.redactOpts);for(const e of t)e.ts&&(n=e.ts),yield JSON.stringify(e)+"\n"}}}}(e),{objectMode:!1});return n.pipe(ue())}({meta:i,cliLogPath:n.paths.cliLogPath,prevLogPath:n.paths.prevLogPath,editor:a,pipelineLogPath:null!=(t=n.paths.pipelineLogPath)?t:null,redactOpts:{homeDir:n.paths.homeDir}});if(e.dryRun){const{gunzipSync:e}=await import("node:zlib"),t=[];for await(const e of s)t.push(e);const o=e(Buffer.concat(t)).toString("utf8");return n.stdout.write(o),{ok:!0}}let r,c;try{const e=[];for await(const n of s)e.push(n);r=Buffer.concat(e)}catch(e){return{ok:!1,error:`Failed to build upload payload: ${e instanceof Error?e.message:String(e)}`}}try{c=await n.fetch(Os,{method:"POST",body:r,headers:{Authorization:`Bearer ${o}`,"Content-Type":"application/x-ndjson","Content-Encoding":"gzip"}})}catch(e){return{ok:!1,error:zs(e)}}if(401===c.status){const e=await Ns(c);return{ok:!1,error:`401 Unauthorized from ${Os}: ${e&&e.length>0?e:"no reason given"} (try \`needle-cloud login\` if your sign-in expired; if you're already signed in, the server may not accept this token's issuer/audience)`}}if(429===c.status){const e=await Ns(c);return{ok:!1,error:`429 Rate-limited: ${e&&e.length>0?e:"no reason given"}. You've hit the upload quota for this account; try again later.`}}if(413===c.status){const e=await Rs(c);return{ok:!0,refId:null==e?void 0:e.ref_id,truncated:!0}}if(!c.ok){const e=await Ns(c);return(400===(l=c.status)||l>=500)&&await async function({token:e,fetch:n,baseMeta:t,status:o,bodyText:i}){const{gzipSync:a}=await import("node:zlib"),s={type:"meta",...t,mode:"crash",note:"send-logs upload error follow-up"},r={ts:(new Date).toISOString(),level:"error",source:"send-logs",message:`Upload failed: status=${o} body=${(null!=i?i:"").slice(0,1024)}`},c=JSON.stringify(s)+"\n"+JSON.stringify(r)+"\n",l=a(Buffer.from(c,"utf8"));await n(Os,{method:"POST",body:l,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/x-ndjson","Content-Encoding":"gzip"}})}({token:o,fetch:n.fetch,baseMeta:n.meta,status:c.status,bodyText:e}).catch(()=>{}),{ok:!1,error:`Server returned ${c.status}: ${e}`}}var l;const p=await Rs(c);return{ok:!0,refId:null==p?void 0:p.ref_id,truncated:Boolean(null==p?void 0:p.truncated)}}};const Us={appId:"2stnsoa6a1b0gwc7lra55",appSecret:"seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",endpoint:"https://auth.needle.tools",resources:["https://cloud.needle.tools/api",Cs],scopes:["openid","profile","email","roles","urn:logto:scope:organizations","urn:logto:scope:organization_roles","identities","custom_data","all","read","write","delete","upload","download","invite","editor","cli:logs:write"]},Is={getAccessToken:!0,fetchUserInfo:!0,resource:null==(As=Us.resources)?void 0:As[0],resources:Us.resources||[],scopes:Us.scopes||[]};function Fs(e="default"){return null==e?`${hs}/?signed-out=1`:"too-many-logins"===e?`${hs}/?too-many-logins=1`:"error"===e?`${hs}/?error=1`:`${hs}/?signed-out=1`}var Ps;function qs(){Bs.clear(),s.existsSync(Gs)&&s.rmSync(Gs,{recursive:!0}),s.existsSync(Js)&&s.rmSync(Js,{recursive:!0})}const Ws=process.argv.includes("--debug-auth"),Bs=new Map;let Ds=null==(Ps=Us.resources)?void 0:Ps[0];if(Ds)try{Ds=new URL(Ds).hostname}catch(e){Ws&&console.error("Invalid resource URL",Ds)}let Ms=Ds||"-";Ms=Ms.replace(/[^a-zA-Z0-9\.\-]/g,"");const Gs=y.join(te(),".needle",".auth",Ms),Js=`${oe()}/Needle/Cloud/.auth/${Ms}`;!function(){if(s.existsSync(Js)){Ws&&console.debug("Migrating auth data from legacy location",Js,"→",Gs);try{s.existsSync(Gs)||s.mkdirSync(Gs,{recursive:!0,mode:448});for(const e of s.readdirSync(Js)){const n=y.join(Js,e),t=y.join(Gs,e);s.statSync(n).isFile()&&!s.existsSync(t)&&(s.copyFileSync(n,t),s.chmodSync(t,384))}s.rmSync(Js,{recursive:!0}),Ws&&console.debug("Legacy auth data migrated successfully")}catch(e){Ws&&console.error("Failed to migrate legacy auth data",e)}}}();const Hs={accessToken:`${Gs}/accessToken`,refreshToken:`${Gs}/refreshToken`,idToken:`${Gs}/idToken`,signInSession:`${Gs}/signInSession`};function Ks(e){return Hs[e]||`${Gs}/${e}`}const Ys=new class{constructor(){this.basePath=Gs}async setItem(e,n){Ws&&console.debug("\n- SET ITEM",e,n),s.existsSync(this.basePath)||s.mkdirSync(this.basePath,{recursive:!0,mode:448});const t=Ks(e);t&&s.writeFileSync(t,n,{mode:384}),Bs.set(e,n)}async getItem(e){Ws&&console.debug("\n- GET ITEM",e);const n=Bs.get(e);if(void 0===n){const n=Ks(e);if(n){if(s.existsSync(n)){const t=s.readFileSync(n,"utf8");return Bs.set(e,t),t}}else console.error(`Unknown token name: ${e}`);return null}return String(n)}async removeItem(e){Ws&&console.debug("\n- REMOVE ITEM",e),Bs.delete(e);const n=Ks(e);if(n&&s.existsSync(n)){try{const e=s.statSync(n).size;e>0&&s.writeFileSync(n,Buffer.alloc(e,0),{mode:384})}catch{}s.rmSync(n)}}};let Vs=null;function Zs(){return Vs||(Vs=new ce(Us,{storage:Ys,navigate:()=>{}})),Vs}function Xs(){Vs=null}let Qs=Promise.resolve();function er(e){const n=Qs.then(e,e);return Qs=n.then(()=>{},()=>{}),n}async function nr(e){return tr(Zs(),e)}async function tr(e,n){try{const t=await er(()=>e.getAccessToken(n));return null!=t?t:null}catch(e){return function(e){return Boolean(e)&&"object"==typeof e&&"not_authenticated"===e.code}(e)||(os(`Token refresh failed for resource ${n}: ${e instanceof Error?e.message:e}`),or(e)&&(os(`Token refresh: clearing dead grant for resource ${n}`),qs(),Vs=null)),null}}function or(e){var n,t;if(!e||"object"!=typeof e)return!1;const o=e,i=e=>{if("string"!=typeof e)return!1;const n=e.replace(/^oidc\./,"");return"invalid_grant"===n||"invalid_target"===n};return i(o.code)||i(null==(n=o.data)?void 0:n.error)||i(null==(t=o.data)?void 0:t.code)}async function ir(){return nr(Is.resource)}function ar(){return cr(Zs())}async function sr(e){var n;if(!e)return{status:401,error:"Not authenticated"};const t=null==(n=e.userInfo)?void 0:n.custom_data;return t?t.default_org?t.default_org:(console.warn("WARN: You do not have a default organization set. Please visit your Needle Cloud account settings and then try again."),os("WARN: You do not have a default organization set. Please visit your Needle Cloud account settings and then try again."),null):null}function rr(e){return new ce(Us,{storage:Ys,navigate:n=>{if(null==e.navigate)throw new Error("Can not navigate");e.navigate(n)}})}function cr(e){return function(e,n){return er(()=>e.getContext(n))}(e,Is).then(n=>{const t=n;return t.client=e,t}).catch(async e=>{const n=e instanceof Error?e.message:String(e);return"oidc.invalid_token"==e.code||"oidc.invalid_grant"==e.code?(os(`OIDC: ${e.code} – token refresh failed, clearing stale tokens`),qs(),Vs=null,console.error("Session expired – please log in again: npx needle-cloud login")):e.code?(console.error(e.code),os(`OIDC: ${e.code} – ${n}`)):os(`OIDC: getContext failed – ${n}`),null})}var lr={__proto__:null,resetSharedClient:Xs,tryGetFreshAccessTokenForResource:nr,acquireAccessToken:tr,shouldClearAuthOnError:or,tryGetFreshAccessToken:ir,tryGetUser:ar,tryGetDefaultOrgId:sr,createNodeClient:rr,getUserFromClient:cr};let pr=null;function ur(e){var n;const t=null==(n=e.userInfo)?void 0:n.custom_data;if(!t)return[];const o=t.machines;return o?o.map(e=>e.name):[]}let dr=Date.now();async function mr(e){var n;const t=Date.now();t-dr>3e4&&"client"in e&&(dr=t,await e.client.fetchUserInfo().catch(console.error));const o=null==(n=e.userInfo)?void 0:n.custom_data;if(!o)return!1;if(pr||await fr(),!pr)return console.error("Failed to get machine id"),!0;const i=o.machines;if(!i)return!1;const a=i.some(e=>e.id===pr);return a}async function fr(){return pr||await import("node-machine-id").then(async e=>{const n=await e.default.machineId(!1);pr=n}),pr}function hr(){return ne.userInfo().username+"@"+ne.hostname()}async function gr(e,n={signout:!1}){if(e.accessToken){const o={machine_id:await fr(),machine_name:hr(),platform:ne.platform(),arch:ne.arch()},i=await fetch("https://cloud.needle.tools/api"+ze.account.post_machine,{method:"POST",headers:{Authorization:"Bearer "+e.accessToken,"Content-Type":"application/json"},body:JSON.stringify(o)}).catch(e=>{var n,t;const o=(null==e||null==(n=e.cause)?void 0:n.code)||(null==e||null==(t=e.cause)?void 0:t.message)||(null==e?void 0:e.message)||"connection refused";return console.error(`Failed to validate login: ${o} - Make sure https://cloud.needle.tools/api is reachable`),os(`Failed to validate login: "${o}" - Make sure https://cloud.needle.tools/api is reachable.`),{status:502,error:`Failed to validate login at 'https://cloud.needle.tools/api' (${o}) - make sure this URL is reachable.`}});if(!i)return!1;if("error"in i)return i;let a=!0;if(403===i.status){const e=await i.text();if(e.trimStart().startsWith("{")){const n=JSON.parse(e);n.logins&&(a=!1,os("Too many logins from different machines"),T().fail("You have reached the maximum number of allowed logins\n"),T().warn(`Please logout from one of the following machines:\n- ${n.logins.join("\n- ")}\n`))}}var t;return!!a||(n.signout&&(qs(),"client"in e&&(null==(t=e.client)||t.signOut(Fs("too-many-logins")))),!1)}return!0}let vr=null;function xr(){if(vr)return vr;{const e=wr();return vr=e,e}}const br="projects.json";function yr(){const e=process.env.HOME||process.env.USERPROFILE||process.cwd(),n=_(e,".needle");return r(n)||d(n,{recursive:!0}),_(n,br)}function wr(){const e=yr();if(!r(e))return{entries:[]};const n=l(e,"utf-8");try{const e=JSON.parse(n);return vr=e,e}catch(e){return console.error("Failed to parse project info file:",e),{entries:[]}}}const _r=JSON.parse(l(new URL("../package.json",import.meta.url),"utf-8"));function kr(){return _r.version}const jr=process.env.NEEDLE_SEARCH_ENDPOINT||"https://search.needle.tools",Sr=process.env.NEEDLE_SEARCH_API_KEY||"da5737c00d6822c32a1b9e3b5dab094bfc17e205aef2f7f3e1a0fd4ebc77b79f",$r=[{name:"needle_cloud_me",description:"Get current Needle Cloud user information",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},{name:"needle_search",description:"Search Needle Engine documentation, forum posts, and community discussions. Returns relevant content ranked by semantic similarity. Use this to find information about Needle Engine features, APIs, components, workflows, and troubleshooting.\n\nIMPORTANT: If search results seem irrelevant or low-quality (scores below 0.6, or results don't match the topic), retry with different search terms — up to 3 total attempts. Try varying your query: use specific class/method names, try shorter keyword-based queries, or rephrase the question. Do NOT guess or fabricate answers based on poor search results.",inputSchema:{type:"object",properties:{query:{type:"string",description:'What to search for, e.g. "how to add physics components" or "WebXR hand tracking" or "deploy to vercel"'},limit:{type:"number",description:"Maximum number of results to return (1-20, default 5)"}},additionalProperties:!1,required:["query"]}}],Tr={needle_cloud_me:async function(e){try{const e=await ar(),n=null==e?void 0:e.userInfo;return n?JSON.stringify({id:n.sub,name:n.name||n.preferred_username,email:n.email,profile_picture:n.picture}):"No user is currently logged in."}catch(e){return"Error retrieving user: "+(e instanceof Error?e.message:String(e))}},needle_search:async function(n){const t=n.query;if(!t||"string"!=typeof t)return{content:[{type:"text",text:"Error: query parameter is required."}]};const o=Math.min(Math.max(Number(n.limit)||5,1),20),i=`${jr}/api/semantic-search?q=${encodeURIComponent(t)}&limit=${o}`,a={Accept:"application/json"};Sr&&(a.Authorization=`Bearer ${Sr}`);try{const n=await e(i,{headers:a,signal:AbortSignal.timeout(15e3)});if(!n.ok){const e=await n.text().catch(()=>"");return{content:[{type:"text",text:`Search API error (${n.status}): ${e}`}]}}const o=await n.json();if(!o.results||0===o.results.length)return{content:[{type:"text",text:`No results found for: "${t}"`}]};const s=o.results.map((e,n)=>`## [${n+1}] ${e.title} (score: ${e.score})\nSource: ${e.source}${e.url?` — ${e.url}`:""}\n\n`+e.content+(e.truncated?`\n\n> Content truncated (${e.content.length} of ${e.contentLength} chars shown).${e.url?` Full content: ${e.url}`:""}`:"")).join("\n\n---\n\n");return{content:[{type:"text",text:`Found ${o.results.length} results for "${t}" (${o.durationMs}ms):\n\n${s}`}]}}catch(e){return{content:[{type:"text",text:`Search failed: ${e instanceof Error?e.message:String(e)}`}]}}}},Er=new Map;function Or(e,n){const t=$r.findIndex(n=>n.name===e);-1!==t&&($r.splice(t,1),delete Tr[e],n())}function Cr(e,n,t,o){const i=$r.findIndex(n=>n.name===e.name);if(-1!==i&&$r.splice(i,1),$r.push(e),Tr[e.name]=n,Rr.delete(e.name),null!=t&&t.source){const n=Er.get(t.source)||new Set;n.add(e.name),Er.set(t.source,n)}o()}const Rr=new Map;async function Nr(e,n){const t=Tr[e];if(!t){const n=Rr.get(e);if(n)return{isError:!0,content:[{type:"text",text:`This tool is currently unavailable because "${n}" disconnected. Please reconnect (e.g. reopen the browser tab) and try again. You should also call tools/list to refresh your available tools.`}]};throw new Error(`Tool "${e}" is not registered.`)}const o=await t(n);if("string"==typeof o)return{content:[{type:"text",text:o}]};if("object"==typeof o)return Array.isArray(o.content)?o:{content:[{type:"text",text:JSON.stringify(o)}]};throw new Error(`Invalid tool result type for tool "${e}".`)}const zr=200,Ar=2e3,Lr=new RegExp("^[A-Za-z0-9_./*?\\[\\]{},\\-]+$");function Ur({pattern:e,glob:n,root:t,maxResults:o}){if("string"!=typeof e)throw new Error("invalid pattern: must be a string");if(e.length>Ar)throw new Error(`invalid pattern: exceeds ${Ar} characters`);if(null!=n&&""!==n){if("string"!=typeof n)throw new Error("invalid glob: must be a string");if(n.length>zr)throw new Error(`invalid glob: exceeds ${zr} characters`);if(!Lr.test(n))throw new Error("invalid glob: contains disallowed characters")}const i=["-rn"];return n&&i.push(`--include=${n}`),i.push(`--max-count=${o}`,"-E",e,t),i}function Ir(e){try{const n=new RegExp(e,"i");return{test:e=>n.test(e),mode:"regex"}}catch{const n=e.toLowerCase();return{test:e=>e.toLowerCase().includes(n),mode:"literal"}}}function Fr(e={}){Cr({name:"files_editor_log_path",description:"Get the filepath to the editor log file on disk (this may be Unity or Blender)",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const n={content:[]},t=xr();if(t){const e=null==t?void 0:t.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0];if(null!=e&&e.log_location){const t=c(e.log_location).mtime;n.content.push({type:"text",text:`${e.log_location} (last modified: ${t.toLocaleString()})`})}else{let t="No recent project with known log location known.";e&&(t+=" Recent project is "+(null==e?void 0:e.project_location)),n.content.push({type:"text",text:t})}}return n},{source:"cli"},()=>{}),Cr({name:"files_editor_project_path",description:"Get the filepath to the currently opened project in the editor (this may be Unity or Blender)",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const n={content:[]},t=xr();if(t){const e=null==t?void 0:t.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0];n.content.push(null!=e&&e.project_location?{type:"text",text:e.project_location}:{type:"text",text:"No recent project with known project location known."})}return n},{source:"cli"},()=>{}),Cr({name:"files_editor_scene_path",description:"Get the filepath to the currently opened scene in the editor (Unity or Blender). Use this to find out which scene the user is working on.",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const n={content:[]},t=xr();if(t){const e=null==t?void 0:t.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0];n.content.push(null!=e&&e.scene_location?{type:"text",text:e.scene_location}:{type:"text",text:"No recent project with known scene location known."})}return n},{source:"cli"},()=>{}),Cr({name:"files_web_project_path",description:"Get the filepath to the web project directory (the Needle Engine web frontend project).",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const n={content:[]},t=xr();if(t){const e=null==t?void 0:t.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0];n.content.push(null!=e&&e.web_location?{type:"text",text:e.web_location}:{type:"text",text:"No recent project with known web project location known."})}return n},{source:"cli"},()=>{}),Cr({name:"files_read",description:"Read a file from the user's local project on disk (editor project or web project). The path must be relative to the project root or an absolute path inside the project. Returns the file contents (or a portion if offset/limit are specified). Use 'filter' to search for specific terms within the file.",inputSchema:{type:"object",properties:{path:{type:"string",description:"File path (relative to project root, or absolute within the project)"},offset:{type:"number",description:"Line number to start reading from (1-based, default: 1). In filter mode: number of matches to skip."},limit:{type:"number",description:"Maximum number of lines to return (default: 200, max: 1000). In filter mode: max matches to return."},filter:{type:"string",description:'Regex to search for in the file (case-insensitive, e.g. "error|warning"). Falls back to a literal substring match if the pattern isn\'t valid regex. Returns matching lines with line numbers instead of sequential content.'}},additionalProperties:!1,required:["path"]}},async e=>{const n=Br(e.path);if(!n)return{content:[{type:"text",text:"Error: path is outside the project directory."}]};try{const t=c(n.resolved).mtime.toISOString(),o=l(n.resolved,"utf-8").split("\n");if(e.filter){const i=Ir(e.filter),a=[];for(let e=0;e<o.length;e++)i.test(o[e])&&a.push(`${e+1}: ${o[e]}`);const s=a.length,r=Math.max(0,e.offset||0),c=Math.min(Math.max(e.limit||200,1),1e3),l=a.slice(r,r+c);return{content:[{type:"text",text:`File: ${n.resolved} (modified: ${t}) — filter="${e.filter}" (${i.mode}) → ${s} matches (showing ${r+1}-${r+l.length}) in ${o.length} lines\n`+l.join("\n")}]}}const i=Math.max(1,e.offset||1),a=Math.min(e.limit||200,1e3),s=o.slice(i-1,i-1+a),r=s.map((e,n)=>`${i+n}: ${e}`).join("\n");return{content:[{type:"text",text:`File: ${n.resolved} (${o.length} lines, modified: ${t}, showing ${i}-${i+s.length-1})\n`+r}]}}catch(e){return{content:[{type:"text",text:`Error reading file: ${e.message}`}]}}},{source:"cli"},()=>{}),Cr({name:"files_grep",description:"Search for a pattern in the user's local project files on disk (editor project and web project) using grep. Returns matching lines with file paths and line numbers. Note: runtime-only things (e.g. node-material shaders) have no source files — read those with the inspector_* tools instead.",inputSchema:{type:"object",properties:{pattern:{type:"string",description:"Search pattern (regular expression)"},glob:{type:"string",description:"File glob filter, e.g. '*.ts' or '*.cs' (optional)"},max_results:{type:"number",description:"Maximum number of matching lines to return (default: 50)"}},additionalProperties:!1,required:["pattern"]}},async e=>{const n=Wr();if(0===n.length)return{content:[{type:"text",text:"Error: no active project found."}]};const t=Math.min(e.max_results||50,200),o=[];try{Ur({pattern:e.pattern,glob:e.glob,root:".",maxResults:t})}catch(e){return{content:[{type:"text",text:`Error: ${e.message}`}]}}for(const a of n)try{const n=Ur({pattern:e.pattern,glob:e.glob,root:a,maxResults:t});let s="";try{s=he("grep",n,{encoding:"utf-8",maxBuffer:1048576,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch(e){if(1!==(null==e?void 0:e.status))throw e;var i;s=(null==(i=e.stdout)||null==i.toString?void 0:i.toString())||""}if(s.trim()){const e=s.trim().split("\n").map(e=>e.startsWith(a)?e.substring(a.length+1):e);o.push(...e)}}catch{}if(0===o.length){const t=n.length>0?`\nSearched in:\n${n.join("\n")}`:"\nNo project directories available to search.";return{content:[{type:"text",text:`No matches found for pattern: ${e.pattern}${t}`}]}}const a=o.slice(0,t);return{content:[{type:"text",text:`Found ${o.length} matches${o.length>t?` (showing first ${t})`:""}:\n`+a.join("\n")}]}},{source:"cli"},()=>{}),Cr({name:"files_list",description:"List files in the user's local project directories on disk matching an optional glob pattern. By default searches both the editor project (Unity/Blender) and the web project. Use the 'project' parameter to target a specific one. Results are prefixed with <web_project>/..., <unity>/..., or <blender>/... so you know which root each file belongs to.",inputSchema:{type:"object",properties:{path:{type:"string",description:"Subdirectory to list (relative to the selected project root, default: root)"},pattern:{type:"string",description:"Glob pattern to filter files, e.g. '*.ts' or '*.glb'. Supports multiple patterns separated by '|', e.g. '*.gltf|*.glb' (optional)"},recursive:{type:"boolean",description:"Whether to list files recursively (default: false)"},project:{type:"string",enum:["web","editor"],description:"Which project root to search: 'web' for the Needle Engine web project (use this for exported assets, source files, node_modules), 'editor' for the Unity/Blender project. Omit to search both."}},additionalProperties:!1,required:[]}},async e=>{const n=Pr();if(!n)return{content:[{type:"text",text:"Error: no active project found."}]};const t="blender"===n.editor?"<blender>":"unity"===n.editor?"<unity>":"<editor_project>",o=[];if(e.project&&"editor"!==e.project||!n.project_location||o.push({root:w(n.project_location),label:t}),e.project&&"web"!==e.project||!n.web_location||o.push({root:w(n.web_location),label:"<web_project>"}),0===o.length)return{content:[{type:"text",text:"Error: no active project found."}]};const i=[];for(const{root:n,label:t}of o){const o=e.path?qr(e.path,n):n;if(o)try{var a;const s=Mr(o,n,null!=(a=e.recursive)&&a,e.pattern,0);i.push(...s.map(e=>({file:e,root:n,label:t})))}catch{}}if(0===i.length)return{content:[{type:"text",text:"No files found."+(o.length>0?`\nSearched in:\n${o.map(e=>`${e.label} → ${e.root}`).join("\n")}`:"\nNo project directories available to search.")}]};const s=i.slice(0,500).map(e=>`${e.label}/${k(e.root,e.file)}`);return{content:[{type:"text",text:`Found ${i.length} files${i.length>500?" (showing first 500)":""}:\n`+s.join("\n")}]}},{source:"cli"},()=>{}),Cr({name:"files_read_editor_log",description:"Read or search the Unity or Blender editor log file. By default reads the last N lines. Use the 'filter' parameter to search for specific terms (e.g. error messages, warnings, component names) across the entire log.",inputSchema:{type:"object",properties:{lines:{type:"number",description:"Number of lines to read from the end of the log (default: 100, max: 500). Ignored when filter is set."},filter:{type:"string",description:'Regex to search for in the log (case-insensitive, e.g. "error|exception|warning"). Falls back to a literal substring match if the pattern isn\'t valid regex. Returns all matching lines from the entire log instead of just the tail.'},offset:{type:"number",description:"Number of matching results to skip from the start (default: 0). Only used with filter."},limit:{type:"number",description:"Maximum number of matching results to return (default: 200, max: 500). Only used with filter."}},additionalProperties:!1,required:[]}},async e=>{const n=Pr();var t;if(null==n||!n.log_location)return os(`read_editor_log: no editor log file known (project: ${null!=(t=null==n?void 0:n.project_location)?t:"none"})`),{content:[{type:"text",text:"Error: no editor log file known. Is a Unity or Blender project open?"}]};try{const t=l(n.log_location,"utf-8").split("\n");let o,i;if(e.filter){const n=Ir(e.filter);o=[];for(let e=0;e<t.length;e++)n.test(t[e])&&o.push(`L${e+1}: ${t[e]}`);const a=o.length,s=Math.max(0,e.offset||0),r=Math.min(Math.max(e.limit||200,1),500);o=o.slice(s,s+r),i=`filter="${e.filter}" (${n.mode}) → ${a} matches (showing ${s+1}-${s+o.length}) in ${t.length} total lines`}else{const n=Math.min(Math.max(e.lines||100,1),500);o=t.slice(-n),i=`last ${n} of ${t.length} lines`}const a="unity"===n.editor?function(e){const n=[],t=new Map;let o=!1,i=0;for(const a of e){if(/^\s+at\s/.test(a)||/^\s*(UnityEngine\.|System\.|Unity\.)/.test(a)||/^\s+\w+[\w.<>]+\s*\(/.test(a)){o||(o=!0,i=0),i++,i<=3?n.push(a):4===i&&n.push(" ... (stack trace truncated)");continue}if(o=!1,i=0,!a.trim())continue;const e=t.get(a)||0;if(t.set(a,e+1),0===e)n.push(a);else if(1===e)n.push(` [repeated ${e+1}x] ${a}`);else{const t=n.length-1;t>=0&&n[t].startsWith(" [repeated")&&(n[t]=` [repeated ${e+1}x] ${a}`)}}return n}(o):o,s=5e4;let r=a.join("\n"),c="";if(r.length>s){r=r.substring(r.length-s);const e=r.indexOf("\n");e>0&&(r=r.substring(e+1)),c=" (output truncated to last ~50KB)"}return{content:[{type:"text",text:`Editor log: ${n.log_location} (${i}, ${a.length} after processing, editor: ${n.editor})${c}:\n`+r}]}}catch(e){return{content:[{type:"text",text:`Error reading log: ${e.message}`}]}}},{source:"cli"},()=>{}),Cr({name:"files_read_gltf",description:"Read and summarize a glTF or GLB file from the user's local project on disk. Without a query, returns a structured summary including nodes, meshes, materials, animations, extensions, and compression/optimization hints. Use 'query' to drill into specific parts using JSON pointer paths. Use '*' as a wildcard for array indices or object keys. For GLB files, extracts the JSON chunk and skips binary data.",inputSchema:{type:"object",properties:{path:{type:"string",description:"File path to a .gltf or .glb file (relative to project root, or absolute path)"},query:{type:"string",description:"JSON pointer path to extract a specific part of the glTF, e.g. '/nodes/0', '/materials', '/extensions/NEEDLE_progressive', '/materials/*/extensions'. Use '*' as a wildcard for array indices or object keys."}},additionalProperties:!1,required:["path"]}},async e=>{let n=Br(e.path);if(!n)return{content:[{type:"text",text:"Error: path is outside the project directory."}]};if(!r(n.resolved))return{content:[{type:"text",text:`Error: file not found: ${n.resolved}`}]};try{const t=function(e){const n=e.toLowerCase();if(n.endsWith(".gltf")){const n=l(e,"utf-8");return JSON.parse(n)}if(n.endsWith(".glb")){const n=l(e);if(n.length<20)return null;if(1179937895!==n.readUInt32LE(0))return null;const t=n.readUInt32LE(12);if(1313821514!==n.readUInt32LE(16))return null;const o=n.toString("utf-8",20,20+t);return JSON.parse(o)}return null}(n.resolved);if(!t)return{content:[{type:"text",text:"Error: could not parse glTF/GLB file."}]};const o=5e4;if(e.query){const i=Dr(t,e.query.replace(/^\//,"").split("/"));if(void 0===i)return{content:[{type:"text",text:`No data found at pointer: ${e.query}`}]};let a=JSON.stringify(i),s=!1;return a.length>o&&(a=a.substring(0,o),s=!0),{content:[{type:"text",text:`${e.query} in ${n.resolved}`+(s?` (truncated to ${o} chars)`:"")+"\n"+a}]}}let i=function(e,n){var t,o,i,a,s,r,c,l,p,u,d,m,f;const h=[`glTF: ${n}`];if(e.asset){const n=[];e.asset.version&&n.push(`v${e.asset.version}`),e.asset.generator&&n.push(e.asset.generator),h.push(`Asset: ${n.join(", ")}`)}if(null!=(t=e.extensionsUsed)&&t.length&&h.push(`Extensions used: ${e.extensionsUsed.join(", ")}`),null!=(o=e.extensionsRequired)&&o.length&&h.push(`Extensions required: ${e.extensionsRequired.join(", ")}`),null!=(i=e.scenes)&&i.length&&h.push(`Scenes: ${e.scenes.length}${void 0!==e.scene?` (default: ${e.scene})`:""}`),null!=(a=e.nodes)&&a.length){var g,v,x;h.push(`\nNodes (${e.nodes.length}):`);const n=null!=(g=null==(v=e.scenes)||null==(v=v[null!=(x=e.scene)?x:0])?void 0:v.nodes)?g:[],t=new Set,o=(n,i)=>{if(i>6||t.has(n))return;t.add(n);const a=e.nodes[n];if(!a)return;const s=" ".repeat(i),r=[];if(void 0!==a.mesh&&r.push(`mesh:${a.mesh}`),void 0!==a.camera&&r.push(`camera:${a.camera}`),void 0!==a.skin&&r.push(`skin:${a.skin}`),a.extensions&&r.push(`ext:[${Object.keys(a.extensions).join(",")}]`),h.push(`${s}- ${a.name||`node_${n}`}${r.length?` (${r.join(", ")})`:""}`),a.children)for(const e of a.children)o(e,i+1)};for(const e of n)o(e,1);t.size<e.nodes.length&&t.size>0&&h.push(` ... and ${e.nodes.length-t.size} more nodes`)}if(null!=(s=e.meshes)&&s.length){h.push(`\nMeshes (${e.meshes.length}):`);for(const n of e.meshes.slice(0,30)){var b,y;const e=null!=(b=null==(y=n.primitives)?void 0:y.length)?b:0;h.push(` - ${n.name||"(unnamed)"} (${e} primitive${1!==e?"s":""})`)}e.meshes.length>30&&h.push(` ... and ${e.meshes.length-30} more`)}if(null!=(r=e.materials)&&r.length){h.push(`\nMaterials (${e.materials.length}):`);for(const n of e.materials.slice(0,30)){const e=n.name||"(unnamed)",t=[];n.pbrMetallicRoughness&&t.push("PBR"),n.alphaMode&&"OPAQUE"!==n.alphaMode&&t.push(n.alphaMode),n.doubleSided&&t.push("doubleSided"),n.extensions&&t.push(`ext:[${Object.keys(n.extensions).join(",")}]`),h.push(` - ${e}${t.length?` (${t.join(", ")})`:""}`)}e.materials.length>30&&h.push(` ... and ${e.materials.length-30} more`)}if(null!=(c=e.textures)&&c.length&&h.push(`Textures: ${e.textures.length}`),null!=(l=e.images)&&l.length&&h.push(`Images: ${e.images.length}`),null!=(p=e.animations)&&p.length){h.push(`\nAnimations (${e.animations.length}):`);for(const n of e.animations.slice(0,20)){var w,_;const e=null!=(w=null==(_=n.channels)?void 0:_.length)?w:0;h.push(` - ${n.name||"(unnamed)"} (${e} channel${1!==e?"s":""})`)}e.animations.length>20&&h.push(` ... and ${e.animations.length-20} more`)}if(null!=(u=e.skins)&&u.length){h.push(`\nSkins (${e.skins.length}):`);for(const n of e.skins.slice(0,10)){var k,j;h.push(` - ${n.name||"(unnamed)"} (${null!=(k=null==(j=n.joints)?void 0:j.length)?k:0} joints)`)}}if(null!=(d=e.cameras)&&d.length){h.push(`\nCameras (${e.cameras.length}):`);for(const n of e.cameras)h.push(` - ${n.name||"(unnamed)"} (${n.type})`)}if(null!=(m=e.buffers)&&m.length){const n=e.buffers.reduce((e,n)=>e+(n.byteLength||0),0);h.push(`\nBuffers: ${e.buffers.length} (${(n/1024/1024).toFixed(1)} MB total)`)}return null!=(f=e.accessors)&&f.length&&h.push(`Accessors: ${e.accessors.length}`),h.join("\n")}(t,n.resolved);return i.length>o&&(i=i.substring(0,o)+"\n... (truncated)"),{content:[{type:"text",text:i}]}}catch(e){return{content:[{type:"text",text:`Error reading glTF: ${e.message}`}]}}},{source:"cli"},()=>{}),Cr(Ua.schema,async e=>{const n=await Ua.execute(e);return"error"in n?{content:[{type:"text",text:n.error}]}:{content:[{type:"text",text:n.content}]}},{source:"cli"},()=>{}),null!=e&&e.logToolCount&&os(`[MCP] registered ${$r.length} built-in tools: ${$r.map(e=>e.name).join(", ")}`)}function Pr(){var e;const n=xr();return null!=n&&null!=(e=n.entries)&&e.length?n.entries.sort((e,n)=>n.last_accessed-e.last_accessed)[0]:null}function qr(e,n){const t=w(n,e),o=w(n);return t.startsWith(o+j)||t===o?t:null}function Wr(){const e=Pr();if(!e)return[];const n=[];return e.project_location&&n.push(w(e.project_location)),e.web_location&&n.push(w(e.web_location)),n}function Br(e){const n=Wr();for(const t of n){const n=qr(e,t);if(n&&r(n))return{resolved:n,root:t}}for(const t of n){const n=qr(e,t);if(n)return{resolved:n,root:t}}const t=w(e);for(const e of n)if(t.startsWith(e+j)||t===e)return{resolved:t,root:e};return null}function Dr(e,n){if(0===n.length||null==e)return e;const[t,...o]=n;if("*"!==t)return Dr(e[/^\d+$/.test(t)?Number(t):t],o);if(Array.isArray(e)){const n=e.map(e=>Dr(e,o)).filter(e=>void 0!==e);return n.length>0?n:void 0}if("object"==typeof e){const n={};for(const t of Object.keys(e)){const i=Dr(e[t],o);void 0!==i&&(n[t]=i)}return Object.keys(n).length>0?n:void 0}}function Mr(e,n,t,o,i){if(i>10)return[];const a=[],s=p(e,{withFileTypes:!0}),r="node_modules"===(e.split("/").pop()||e.split("\\").pop()||"");for(const c of s){if(r){if(".needle"!==c.name&&".vite"!==c.name)continue}else{if("Library"===c.name)continue;if(c.name.startsWith(".")||"node_modules"===c.name){if(!t)continue;if(c.name.startsWith("."))continue}}const s=_(e,c.name);if(c.isDirectory())t&&a.push(...Mr(s,n,!0,o,i+1));else{if(o&&!o.split("|").map(e=>(e=e.trim()).startsWith(".")&&!e.startsWith("*.")?"*"+e:e).filter(Boolean).some(e=>ge(c.name,e,{nocase:!0})))continue;a.push(s)}}return a}const Gr="settings.json";function Jr(){return G(D(),".needle")}function Hr(e){const n=G(null!=e?e:Jr(),Gr);if(!E(n))return{};try{const e=JSON.parse(F(n,"utf-8"));return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}catch{return{}}}function Kr(e){return"disabled"===Hr(e).remote_ai_tools}function Yr(e,n){if(!E(e))try{O(e,{recursive:!0})}catch{}let t=null,o=null;try{t=q(e,{persistent:!1},(e,t)=>{t&&t.toString()!==Gr||(o&&clearTimeout(o),o=setTimeout(()=>{o=null;try{n()}catch{}},50))}),null==t.on||t.on("error",()=>{})}catch{}return()=>{o&&(clearTimeout(o),o=null);try{var e;null==(e=t)||e.close()}catch{}t=null}}var Vr={__proto__:null,KNOWN_SETTINGS:{remote_ai_tools:{displayName:"Remote AI tools",default:"enabled",description:"Allow Needle Cloud AI chat to dispatch tool calls (file reads, search, etc.) to this machine.",command:"needle-cloud settings remote-ai-tools <true|false>"}},defaultSettingsDir:Jr,readSettings:Hr,writeSetting:function(e,n,t){const o=Hr(e);null===t?delete o[n]:o[n]=t,O(e,{recursive:!0}),P(G(e,Gr),JSON.stringify(o,null,2)+"\n","utf-8")},areRemoteAiToolsDisabled:Kr,watchSettings:Yr};const Zr=2e3,Xr=6e4,Qr=25e3,ec=1e4,nc=o();let tc=null,oc=null,ic=null,ac=null,sc=Zr,rc=!1,cc=!1;function lc(){tc||(Kr()?os("Needle Cloud connection: skipped (remote_ai_tools disabled in settings)"):(rc=!1,oc&&(clearTimeout(oc),oc=null),sc=Zr,uc()))}function pc(e){rc=!0,dc(),oc&&(clearTimeout(oc),oc=null),tc?(os(`Needle Cloud connection: closing (reason: ${null!=e?e:"shutdown"})`),tc.close(1e3,null!=e?e:"shutdown"),tc=null):e&&os(`Needle Cloud connection: disconnect requested (reason: ${e}) — no active connection`)}async function uc(){let e=await ir();if(e||(e=function(){const e=Ks("accessToken");if(s.existsSync(e)){const n=s.readFileSync(e,"utf8");if(n){const e=JSON.parse(n),t=null==e?void 0:e["@https://cloud.needle.tools/api"];return null==t?void 0:t.token}}return null}(),e&&os("Needle Cloud connection: using cached token (refresh failed)")),!e)return cc||(os("Needle Cloud connection: skipped (not logged in)"),cc=!0),void mc(!0);cc=!1;const n="https://cloud.needle.tools/api".replace(/^http/,"ws")+"/v1/cli/ws?token="+encodeURIComponent(e)+"&instance="+encodeURIComponent(nc);os("Needle Cloud connection: connecting...");const t=`needle-cloud/${kr()} Node/${process.versions.node}`;tc=new me(n,{headers:{"User-Agent":t,Origin:"cli://needle-cloud"}}),tc.on("open",()=>{sc=Zr,os("Needle Cloud connection: established"),function(){var e,n,t,o,i;if(!tc||tc.readyState!==me.OPEN)return;const a=xr(),s=null==a||null==(e=a.entries)||null==(e=e.sort((e,n)=>n.last_accessed-e.last_accessed))?void 0:e[0],r={type:"presence",editor:null!=(n=null==s?void 0:s.editor)?n:"unknown",project:null!=(t=null==s?void 0:s.project_location)?t:null,scene:null!=(o=null==s?void 0:s.scene_location)?o:null,web_project:null!=(i=null==s?void 0:s.web_location)?i:null,cli_version:kr()};tc.send(JSON.stringify(r))}(),function(){if(!tc||tc.readyState!==me.OPEN)return;try{Fr()}catch(e){os(`Needle Cloud connection: registerServerTools failed: ${e}`)}const e=$r.map(e=>e.name);os(`Needle Cloud connection: sending ${e.length} tools: ${e.join(", ")}`),tc.send(JSON.stringify({type:"tools",tools:$r.map(e=>({name:e.name,description:e.description,inputSchema:e.inputSchema}))}))}(),dc(),ic=setInterval(()=>{tc&&tc.readyState===me.OPEN&&(tc.ping(),ac=setTimeout(()=>{os("Needle Cloud connection: pong timeout, terminating"),tc&&tc.terminate()},ec))},Qr)}),tc.on("pong",()=>{ac&&(clearTimeout(ac),ac=null)}),tc.on("message",e=>{try{const t=JSON.parse(e.toString());var n;"execute_tool"===t.type&&t.requestId&&t.toolName&&async function(e,n,t){os(`Cloud tool request: ${n}(${Object.keys(t).length>0?" "+Object.entries(t).map(([e,n])=>`${e}=${JSON.stringify(n)}`).join(", "):""}) [${e}]`);const o=Date.now();try{var i,a;const s=await Nr(n,t);os(`Cloud tool result: ${n} → ${null!=(i=null==s||null==(a=s.content)?void 0:a.reduce((e,n)=>{var t;return e+((null==(t=n.text)?void 0:t.length)||0)},0))?i:0} chars in ${Date.now()-o}ms [${e}]`),tc&&tc.readyState===me.OPEN&&tc.send(JSON.stringify({type:"tool_result",requestId:e,result:s}))}catch(t){const i=t instanceof Error?t.message:String(t);os(`Cloud tool error: ${n} → ${i} in ${Date.now()-o}ms [${e}]`),tc&&tc.readyState===me.OPEN&&tc.send(JSON.stringify({type:"tool_result",requestId:e,error:i}))}}(t.requestId,t.toolName,null!=(n=t.args)?n:{})}catch{}}),tc.on("close",(e,n)=>{const t=(null==n?void 0:n.toString())||"";os(`Needle Cloud connection: closed (code=${e}${t?" "+t:""})`),dc(),tc=null,rc||mc()}),tc.on("error",e=>{os(`Needle Cloud connection: error - ${e.message||"connection refused"} (is https://cloud.needle.tools/api reachable?)`)})}function dc(){ic&&(clearInterval(ic),ic=null),ac&&(clearTimeout(ac),ac=null)}function mc(e=!1){rc||oc||(e||os(`Needle Cloud connection: reconnecting in ${sc/1e3}s`),oc=setTimeout(()=>{oc=null,uc()},sc),sc=Math.min(2*sc,Xr))}const fc=e=>{const n=de();return n.use("/:action",async(n,t,o)=>{const{action:i}=n.params,a=rr({navigate:e=>{t.redirect(e)}});switch(i){case"sign-in":e.invalid_login=!1,e.invalid_login_type=null,e.error=void 0,os("Sign in..."),await a.clearAllTokens(),Xs();try{await a.signIn(`${hs}/auth-callback`)}catch(e){const n=null==e?void 0:e.cause,o=`Sign-in failed: ${null!=n&&n.code?`${n.code}${n.address?` (${n.address}:${n.port})`:""}`:(null==e?void 0:e.message)||"unknown error"}`;return os(o),console.error(o),t.status(502).send(o)}break;case"sign-out":{var s,r;const n=await ar(),t=(null==n||null==(s=n.userInfo)?void 0:s.sub)||(null==n||null==(r=n.claims)?void 0:r.sub),o=null==n?void 0:n.accessToken;os(`Sign out... (${t})`),t&&o&&await async function(e){return!e.accessToken||import("node-machine-id").then(async n=>{const t=await fr();return pr=t,await fetch("https://cloud.needle.tools/api"+ze.account.post_machine,{method:"POST",headers:{Authorization:"Bearer "+e.accessToken,"Content-Type":"application/json"},body:JSON.stringify({action:"logout",machine_id:t,machine_name:hr()})}).catch(e=>{os(`Failed to validate logout: ${e.message} - Make sure https://cloud.needle.tools/api is reachable`),console.error(`Failed to validate logout: ${e.message} - Make sure https://cloud.needle.tools/api is reachable`)}),!0})}({userId:t,accessToken:o}).catch(e=>{console.error(e),os(`Failed to validate logout: ${e}`)}),e.invalid_login=!1,e.invalid_login_type=null,e.error=void 0,console.log("User signed out"+(t?`: ${t}`:"")),await a.signOut(Fs()),Xs();break}case"auth-callback":if(n.url){const o=await a.handleSignInCallback(`${hs}${n.originalUrl}`).catch(e=>({error:e}));if(Xs(),o&&"error"in o){os(`Error during sign in: ${o.error}`);const e=o.error instanceof Error?o.error.message:String(o.error);t.redirect(hs+"?cancelled&message="+encodeURIComponent(e))}else{var c,l,p,u;const n=await ar();if(null!=n&&n.isAuthenticated){var d,m;e.invalid_login=!1,e.user_email=(null==(d=n.claims)?void 0:d.email)||(null==(m=n.userInfo)?void 0:m.email)||null,e.logged_in_machine_names=[...ur(n)];const o=await gr(n,{signout:!0});if(!o)return e.invalid_login=!0,e.invalid_login_type="too-many-logins",t.redirect(Fs("too-many-logins"));if("object"==typeof o&&"error"in o)return e.invalid_login=!0,e.invalid_login_type="error",e.error=o.error,t.redirect(Fs("error"));Xs()}console.log(`User logged in: ${(null==n||null==(c=n.userInfo)?void 0:c.sub)||(null==n||null==(l=n.claims)?void 0:l.sub)}`),os(`User logged in: ${(null==n||null==(p=n.userInfo)?void 0:p.sub)||(null==n||null==(u=n.claims)?void 0:u.sub)}`),lc(),t.redirect(hs)}}break;default:o()}}),n};function hc(e){var n,t,o,i;if(!e)return"";let a=(null==(n=e.claims)?void 0:n.name)||(null==(t=e.userInfo)?void 0:t.name)||(null==(o=e.claims)?void 0:o.username)||"";var s,r;return(!a||a.length<=0)&&null!=(i=e.claims)&&i.email?(r=null==(s=e.claims)?void 0:s.email)?(r=(r=(r=(r=r.split("@")[0]).replace(/[^a-zA-Z0-9]/g," ")).replace(/\s+/g," ")).split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),r):r:a}async function gc(e,n=null){var t,o;if(!e)return{status:500,error:"User is not provided"};if(!e.isAuthenticated)return{status:403,error:"User is not authenticated"};const i=(null==(t=e.claims)?void 0:t.sub)||(null==(o=e.userInfo)?void 0:o.sub);n===i&&(n=null);let a=null;if(null==n)a=e.accessToken;else if(null!=n){var s;let t=null==e||null==(s=e.userInfo)||null==(s=s.organization_data)?void 0:s.find(e=>e.id===n);if(!t){var r;const o=n.toLowerCase();t=null==e||null==(r=e.userInfo)||null==(r=r.organization_data)?void 0:r.find(e=>e.name.toLowerCase()===o)}if(!t)return{status:403,error:`User is not part of team "${n}"`};n=t.id,a=await e.client.getOrganizationToken(t.id).catch(e=>{var o;return console.error(`Error getting organization token for "${null==(o=t)?void 0:o.name}" (${n}): ${e.message}`),null})}return a?{authToken:a,org:n}:{status:403,error:"No access token found"}}const vc=function(){return async(e,n,t)=>{const o=await ar();Object.defineProperty(e,"user",{enumerable:!0,get:()=>o}),t()}},xc=`${hs}/mcp`,bc="2025-06-18",yc={name:"Needle Cloud MCP",version:"1.0.0"};function wc(e){return{jsonrpc:"2.0",id:e,result:{protocolVersion:bc,capabilities:{tools:{listChanged:!0}},serverInfo:yc}}}async function _c(e,n){const t=!0===(null==n?void 0:n.proxy),{method:o,params:i,id:a}=e;if("initialize"===o)return wc(null!=a?a:0);if("ping"===o)return{jsonrpc:"2.0",id:a,result:{}};if("notifications/initialized"===o||"notifications/cancelled"===o)return null;if("tools/list"===o){try{Fr()}catch{}let e=$r;if(t){const n=await async function(){try{var e,n;const t=await fetch(xc,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/list"}),signal:AbortSignal.timeout(2e3)});return t.ok&&null!=(e=null==(n=(await t.json()).result)?void 0:n.tools)?e:[]}catch{return[]}}();if(n.length>0){const t=new Set($r.map(e=>e.name));e=[...$r,...n.filter(e=>!t.has(e.name))]}}return{jsonrpc:"2.0",id:a,result:{tools:e}}}if("tools/call"===o){const e=null==i?void 0:i.name;try{Fr()}catch{}try{return{jsonrpc:"2.0",id:a,result:await Nr(e,(null==i?void 0:i.arguments)||{})}}catch(n){if(t)try{const n=await async function(e,n){const t=await fetch(xc,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:e,arguments:n}}),signal:AbortSignal.timeout(35e3)}),o=await t.json();if(o.error)throw new Error(o.error.message);return o.result}(e,(null==i?void 0:i.arguments)||{});return{jsonrpc:"2.0",id:a,result:n}}catch{}return{jsonrpc:"2.0",id:a,error:{code:-32603,message:`Tool execution failed: ${n.message}`}}}}return{jsonrpc:"2.0",id:null!=a?a:null,error:{code:-32601,message:`Method '${o}' not found`}}}function kc(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}let jc=!1;const Sc=de(),$c=new Set,Tc=new Map;let Ec=0;function Oc(){const e=[];for(const[n,{connectedAt:t,userAgent:o}]of Tc)e.push({id:n,connectedAt:t,userAgent:o});return e}function Cc(e,n,t){if((n.headers.accept||"").includes("text/event-stream")){t.setHeader("Content-Type","text/event-stream"),t.setHeader("Cache-Control","no-cache"),t.setHeader("Connection","keep-alive"),t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id"),t.flushHeaders(),t.write(": connected\n\n");const o=n.headers["user-agent"]||"";return Tc.set(e,{id:e,client:t,connectedAt:Date.now(),userAgent:o}),console.log(`[MCP] SSE client connected (ID: ${e}) ${o}. Total clients: ${Tc.size}`),os(`MCP SSE client connected (ID: ${e}) ${o}. Total clients: ${Tc.size}`),n.on("close",()=>{console.log(`[MCP] SSE client disconnected (ID: ${e}): ${o}`),os(`MCP SSE client disconnected (ID: ${e}): ${o}`),Tc.delete(e)}),!0}return!1}function Rc(e){if(!Array.isArray(e))return console.error("Invalid input: paths should be an array of strings."),null;for(const n of e)if(!1!==r(n))try{const e=Nc(n);if(e)return e}catch(e){}}function Nc(e){const n=_(e,".git");if(r(n)){const e=function(e){const n=f(e);if(n.isDirectory())return _(e,"config");if(n.isFile()){const n=l(e,"utf-8").trim().match(/^gitdir:\s*(.+)$/);if(n){let t=n[1].trim();S(t)||(t=w($(e),t));const o=_(t,"config");if(r(o))return o;const i=_(t,"commondir");if(r(i)){let e=l(i,"utf-8").trim();return S(e)||(e=w(t,e)),_(e,"config")}}}return null}(n);if(e&&r(e)){const n=function(e){const n=l(e,"utf-8"),t=/\[remote\s+"(?<name>.+?)"\].+?url\s*=\s*(?<url>.+?)$/gms,o=[];let i;for(;null!==(i=t.exec(n));)if(i.groups){const e=i.groups.name,n=i.groups.url.trim();n.length&&o.push({name:e,url:n})}const a=o.find(e=>"origin"===e.name)||o.find(e=>"upstream"===e.name)||o[0];return a?a.url:null}(e);if(n)return n}}const t=_(e,".plastic");if(r(t)){const e=_(t,"replicas.db");if(r(e)){const n=l(e,"utf-8").split("\n");for(const e of n){const n=e.split("=");if(2===n.length&&"repo"===n[0].trim()){const e=n[1].trim();if(e.length)return e}}}}const o=_(e,"..");return o===e?null:Nc(o)}Sc.get("/mcp",async(e,n)=>{if(Cc(Ec++,e,n))return;const t=function(e){const n=[...$r].sort((e,n)=>e.name.localeCompare(n.name)),t=n.map(e=>`\n <div class="tool">\n <span class="tool-name">${kc(e.name)}</span>\n <span class="tool-desc">${kc(function(e){const n=e.indexOf("\n");return-1===n?e:e.slice(0,n)}(e.description))}</span>\n </div>`).join("\n");return`<!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <title>Needle MCP Server</title>\n <style>\n * { box-sizing: border-box; }\n body {\n background: #f0f4ef;\n font-family: system-ui, -apple-system, sans-serif;\n line-height: 1.6;\n padding: 20px 24px;\n max-width: 960px;\n margin: 0 auto;\n color: #1a1a1a;\n }\n header {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 8px;\n }\n h2 {\n margin-top: 1.2em;\n margin-bottom: 0.4em;\n }\n a { color: inherit; }\n img.logo {\n height: 2em;\n width: auto;\n }\n .badge {\n font-size: 0.75em;\n background: #d0d4cf;\n padding: 2px 8px;\n border-radius: 10px;\n vertical-align: middle;\n font-weight: normal;\n }\n .tools-info {\n color: #555;\n font-size: 0.9rem;\n margin-top: 0;\n margin-bottom: 10px;\n }\n\n /* Tool items */\n .tool {\n background: #fff;\n border: 1px solid #d8dcd7;\n border-radius: 6px;\n margin-bottom: 6px;\n padding: 10px 14px;\n display: flex;\n align-items: baseline;\n gap: 10px;\n }\n .tool-name {\n font-weight: 600;\n white-space: nowrap;\n }\n .tool-desc {\n color: #555;\n font-size: 0.9rem;\n }\n</style>\n</head>\n<body>\n <header>\n <img class="logo" src="https://cdn.needle.tools/static/branding/logo_needle.png" alt="Needle Logo" />\n <strong>Needle MCP Server</strong>\n </header>\n\n <p>The Needle MCP server is alive and running.</p>\n\n <h2>Usage</h2>\n <p><a href="https://fwd.needle.tools/mcp">Open Documentation</a></p>\n\n <h2>Available Tools <span class="badge">${n.length}</span></h2>\n <p class="tools-info">These tools are available to AI agents connected via the Model Context Protocol (MCP).</p>\n ${t}\n</body>\n</html>`}();n.status(200).header("Content-Type","text/html; charset=utf-8").send(t)}),Sc.post("/mcp",async(e,n)=>{const t=e.headers.accept||"",o=e.headers["user-agent"]||"",{method:i,id:a}=e.body;console.log(`[MCP] Received request from ${o} (${i}) (ID: ${a})`),n.setHeader("Content-Type","application/json"),n.setHeader("Access-Control-Allow-Origin","*"),n.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Mcp-Session-Id"),n.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id");try{if("initialize"===i&&t.includes("text/event-stream")){const t=void 0!==a?a:Ec++;if(Cc(t,e,n)){jc=!0;const e=wc(t);return void n.write(`data: ${JSON.stringify(e)}\n\n`)}}const r=await _c(e.body);if("initialize"===i){jc=!0;const e=x();$c.add(e),n.setHeader("Mcp-Session-Id",e),console.log(`[MCP] New session created: ${e} for ${o}`),os(`MCP New session: ${e} for ${o}`)}if(null===r)return n.status(204).end();if(os(`MCP Request: ${i}`),"tools/list"===i){var s;const e=(null==(s=r.result)||null==(s=s.tools)?void 0:s.map(e=>e.name))||[];console.log(`[MCP] Sending tools/list: ${e.length} tools [${e.join(", ")}]`)}else{const e=JSON.stringify(r);console.log(`[MCP] Sending response for ${i}:`,e.length>500?e.substring(0,500)+" [...]":e)}n.json(r)}catch(e){console.error("[MCP] Error processing request:",e);const t={jsonrpc:"2.0",error:{code:-32603,message:"Internal server error",data:"development"===process.env.NODE_ENV?e.stack:void 0},id:a||null};n.json(t)}}),Sc.options("/mcp",(e,n)=>{n.setHeader("Access-Control-Allow-Origin","*"),n.setHeader("Access-Control-Allow-Methods","GET, POST, OPTIONS, DELETE"),n.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Mcp-Session-Id"),n.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id"),n.status(204).end()});let zc=!1;function Ac(e,n={}){zc&&process.stdout.write(JSON.stringify({jsonrpc:"2.0",method:e,params:n})+"\n")}var Lc={__proto__:null,sendStdioNotification:Ac,startStdio:function(){zc=!0,process.stdin.resume();const e=le({input:process.stdin,terminal:!1});e.on("line",async e=>{const n=e.trim();if(!n)return;let t;try{t=JSON.parse(n)}catch{return void process.stdout.write(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}})+"\n")}const o=await _c(t,{proxy:!0});null!==o&&process.stdout.write(JSON.stringify(o)+"\n")}),e.on("close",()=>{zc=!1,process.exit(0)})}};let Uc=null;function Ic(){Uc&&clearTimeout(Uc),Uc=setTimeout(()=>{!function(e,n={}){if(0===Tc.size)return;const t=`data: ${JSON.stringify({jsonrpc:"2.0",method:"notifications/tools/list_changed",params:n})}\n\n`;for(const[e,{client:n}]of Tc)try{n.write(t)}catch(n){console.error(`[MCP] Error sending notification to client (${e}):`,n),Tc.delete(e)}}(),Ac("notifications/tools/list_changed")},10)}const Fc=new Set(["https://cloud.needle.tools","https://needle.tools","https://engine.needle.tools","https://docs.needle.tools","chrome-extension://kjcepmifiddcepiocokclhibpkgcdomk","chrome-extension://jonplpbnhmanoekkgcepnedhghflblmo"]),Pc=new Set(["localhost","127.0.0.1","[::1]","::1"]);function qc(e){if("string"!=typeof e||0===e.length)return!1;if(Fc.has(e))return!0;let n;try{n=new URL(e)}catch{return!1}if("/"!==n.pathname&&""!==n.pathname)return!1;if(""!==n.search||""!==n.hash)return!1;if("http:"!==n.protocol&&"https:"!==n.protocol)return!1;const t=n.hostname.toLowerCase();return!!Pc.has(t)||"::1"===t}const Wc="[MCP]",Bc=new Array,Dc="2026-08-03T16:15:16.972Z";var Mc={__proto__:null,BUILD_TIME:Dc};const{json:Gc}=ve;function Jc(e){const n=null==e?void 0:e.cause;return null!=n&&n.code?`${n.code}${n.address?` (${n.address}:${n.port})`:""}`:null!=n&&n.message?n.message:null!=e&&e.code?e.code:null!=e&&e.message&&"fetch failed"!==e.message?e.message:"connection refused or network unreachable"}async function Hc(n={restart:!1}){const t=await e(hs).catch(e=>({ok:!1})),i="/sign-in",a="/api/authenticated",s="/api/projects",c="/api/content",l={baseUrl:hs,port:fs,isHost:!1,auth_endpoints:{"sign-in":`${hs}${i}`,"sign-out":`${hs}/sign-out`,"is-authenticated":`${hs}${a}`}};let p=t.ok;if(p){var u;const f=await e(`${hs}/api/info`).catch(()=>null);if(null!=f&&f.ok){const g=await f.json().catch(()=>null);null!=g&&g.api_endpoint&&"https://cloud.needle.tools/api"!==g.api_endpoint&&(os(`Running server uses different API endpoint (${g.api_endpoint} vs https://cloud.needle.tools/api), restarting...`),n||(n={}),n.restart=!0)}if(!0===(null==(u=n)?void 0:u.restart)){os("Restarting auth server...");const v=`${hs}/restart`;n.ora&&(n.ora.text="Sending restart request to server");const x=new AbortController;setTimeout(()=>x.abort(),1e4);let b={};try{const w=_(te(),".needle","local-server-token"),k=JSON.parse((await import("fs")).readFileSync(w,"utf-8"));k.token&&(b={Authorization:`Bearer ${k.token}`})}catch{}const y=await e(v,{method:"post",signal:x.signal,headers:b}).catch(e=>({ok:!1,status:400,error:e}));if(y.ok)return await ha(300),Hc({restart:!1});console.error("Failed to restart server",y.status),os(`Failed to restart server: ${y.status}`)}}if(!p){process.title="Needle CLI server";const j=await import("express").catch(e=>{throw console.error("Error starting the auth server (express not found)",e),os("Error starting the auth server"),new Error("Failed to load express module")});if(!j)throw os("Error loading auth server module"),new Error("Failed to load express module");os(`Starting Needle CLI server ${kr()} (built ${Dc})... (Using api at https://cloud.needle.tools/api)`,{emptyLineBefore:!0}),l.isHost=!0;let S=null;const $={invalid_login:!1,invalid_login_type:null,user_email:null,logged_in_machine_names:[]};let T=j.default();T.use(Gc({limit:"10mb"}));const C=_(te(),".needle"),R=function(e,n){var t;const i=G(e,"local-server-token"),a=null!=(t=function(e){if(!E(e))return null;try{const n=F(e,"utf-8");if(0===n.length)return null;const t=JSON.parse(n);if(t&&"string"==typeof t.token&&t.token.length>0)return t.token}catch{}return null}(i))?t:o();O(e,{recursive:!0});const s=JSON.stringify({token:a,pid:process.pid,port:n},null,2);if(P(i,s,{encoding:"utf-8",mode:384}),"win32"===process.platform)try{const e=process.env.USERNAME||process.env.USER||"";e&&xe("icacls",[i,"/inheritance:r","/grant:r",`${e}:(F)`],{stdio:"ignore",timeout:5e3})}catch{}return a}(C,fs);os(`Local token written to ${_(C,"local-server-token")}`);const N=function(e,n=5e3){const t=new Map,o=Math.max(1,Math.round(n/1e3));return(i,a)=>{const s=Date.now(),r=t.get(i);if(!r||s-r.lastLog>n){var c;const n=null!=(c=null==r?void 0:r.suppressed)?c:0;e(n>0?`${a} [+${n} similar in last ${o}s]`:a),t.set(i,{lastLog:s,suppressed:0})}else r.suppressed++}}(e=>os(`Denied: ${e}`),5e3);T.use(function(e){const n=null==e?void 0:e.onDenied;return(e,t,o)=>{var i,a;if("OPTIONS"===e.method)return o();const s=null==(i=e.headers)?void 0:i.origin,r=null==(a=e.headers)?void 0:a["sec-fetch-site"];if("none"===r||"same-origin"===r)return o();if(s){if(qc(s))return o();if(n)try{var c,l,p,u;const t=null!=(c=null==(l=e.headers)?void 0:l["user-agent"])?c:"unknown",o=null!=(p=null!=(u=e.path)?u:e.url)?p:"?";n(`origin|${s}|${o}`,`denied origin=${s} path=${o} ua="${t}"`)}catch{}return t.status(403).send("Forbidden: origin not allowed")}return o()}}({onDenied:N}));const z=new Set(["/","/sign-in","/sign-out","/auth-callback","/api/info","/api/authenticated","/api/public_key","/mcp","/register"]),A="needle_local";T.use((e,n,t)=>{var o,i,a;if("OPTIONS"===e.method)return t();if(z.has(e.path))return t();if(e.path.startsWith("/mcp/"))return t();if(e.path.startsWith("/.well-known/"))return t();const s=null==(o=e.headers)?void 0:o.authorization;if(s){const e=s.split(" ");if(2===e.length&&"Bearer"===e[0]&&e[1]===R)return t()}if((null==(i=e.query)?void 0:i.token)===R)return t();const r=((null==(a=e.headers)?void 0:a.cookie)||"").split(";").map(e=>e.trim()).find(e=>e.startsWith(A+"="));if(r&&r.split("=")[1]===R)return t();try{var c,l;const n=null!=(c=null==(l=e.headers)?void 0:l["user-agent"])?c:"unknown";N(`token|${n}|${e.path}`,`path=${e.path} ua="${n}" — no valid token or cookie`)}catch{}return n.status(401).send("Unauthorized: token required")}),T.use(fc($)),n.ora?(n.ora.start("Starting MCP server..."),n.ora.succeed(`MCP server available at ${hs}/mcp`)):console.log(`\nMCP server available at ${hs}/mcp .`),T.use(Sc);const L="\n <title>Needle Cloud</title>\n <link rel=\"icon\" href=\"https://cdn.needle.tools/static/branding/favicon.ico\" type=\"image/x-icon\">\n <style>\n body { \n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-size: 18px;\n padding: 2rem;\n background: #f0f4ef;\n }\n a {\n color: rgb(120, 76, 223);\n }\n .main_panel {\n display: flex;\n flex-direction: column;\n gap: .5rem;\n justify-content: flex-start;\n align-items: center;\n width: min(80ch, 90vw);\n margin: 0 auto;\n\n height: 100%;\n\n & img.logo {\n height: 3rem;\n margin-bottom: 1rem;\n }\n }\n .secondary {\n color: rgba(0, 0, 0, .5);\n }\n .error-details {\n font-size: 12px;\n color: rgba(0, 0, 0, .5);\n }\n .error-details a {\n color: inherit;\n }\n </style>",U=`<div class="main_panel"><img class="logo" src="https://cdn.needle.tools/static/branding/logo_needle.png" alt="Needle Logo" title="Needle Logo (${kr()})"/>`,I="</div>";let q="";T.get("/",vc(),async(e,n)=>{var t,o;if(null!=(t=e.user)&&t.isAuthenticated?n.cookie(A,R,{httpOnly:!0,sameSite:"strict",path:"/"}):n.clearCookie(A,{path:"/"}),n.set({"Content-Type":"text/html; charset=utf-8"}),n.write(L),null!=e.query.cancelled)return n.end("Login cancelled. You can close this window now."),void os("Login cancelled by user");if(null!=e.query["too-many-logins"]&&$.logged_in_machine_names.length){var a;const e=qa();let t="<div>";return t+="<strong>You have reached the maximum number of allowed device logins!</strong><br/><br/>",t+=(null==(a=$.logged_in_machine_names)?void 0:a.map(e=>`• ${e}`).join("<br/>"))+"<br/><br/>",t+=`1) Go to <a href="${e}#device-logins" target="_blank">Needle Cloud device logins</a> and logout one of your devices.<br/>\n 2) Then <a href="${i}">sign-in on this machine</a>.<br/><br/>`,t+="</div>",n.status(406),n.end(U+t+I),void os(`Login failed: Too many logins from different machines: [${$.logged_in_machine_names.join(", ")}]`)}if(null!=e.query.error)return n.status(500),void n.end(`${U}\n <div>\n <strong>An error occurred</strong>: Please make sure <i>https://cloud.needle.tools/api</i> and <i>https://auth.needle.tools</i> are reachable and not blocked by your firewall or network. After that please try to <a href="${i}">sign-in</a> again.\n <br/><span class="error-details">If the issue persists, please contact support and include the log file: <a title="Link to local log file. Please copy this url and open it in your file explorer or terminal" href="file://${ns()}" target="_blank">${ns()}</a></span>\n </div>\n ${I}`);if(null!=(o=e.user)&&o.isAuthenticated){var s;if(!await mr(e.user)){if($.invalid_login=!0,$.logged_in_machine_names=[...ur(e.user)],qs(),os("Cleared stored auth data"),"client"in e.user){const n=e.user;await n.client.clearAccessToken(),await n.client.clearAllTokens(),os("Cleared all tokens")}return n.end(`${U}<div>You have been logged out from this machine. You can close this window now or try to <a href="${i}">sign in</a> again</div>${I}`)}$.invalid_login=!1,n.end(`${U}\n <div>\n Hi ${hc(e.user)} — you logged in successfully. You can close this window now.\n </div>\n ${I}`);const t=`Logged in successfully as ${hc(e.user)} (${null==(s=e.user.userInfo)?void 0:s.sub})`;return void(q!==t&&(q=t,os(q)))}let r=`<span><a href="${i}">Sign in</a> to your Needle account</span>`;"1"===e.query["signed-out"]&&(r=`<span class="secondary">You have been signed out successfully.</span>${r}`),n.write(U+r+I),n.end()}),T.post("/restart",(e,t)=>{var o;n.ora&&(n.ora.text="Received restart event. This instance will close"),null==(o=S)||o.close(e=>{e&&console.error(e)}),setTimeout(()=>{process.exit(0)},100),t.status(200).end("Server is restarting"),os("Server is restarting\n")}),T.get("/api/logs",async(e,n)=>{const t=ns();r(t)?h(t,"utf-8",(e,o)=>{if(e)return console.error(e),void n.status(500).end("Failed to read log file");n.set({"Content-Type":"text/plain; charset=utf-8"});const i=o.split("\n").filter(e=>e.length>0).reverse().join("\n");let a=`--- Needle CLI v${kr()} (built ${Dc}) Log File (newest first) ---\n${t}\n\n`;a+=i,n.status(200).end(a)}):n.status(404).end("Log file not found")}),T.get("/api/info",(e,n)=>{n.json({api_endpoint:"https://cloud.needle.tools/api",version:kr()})}),T.get(a,vc(),async(e,n)=>{var t;if(!0===$.invalid_login){const e=Kc($);return n.status(e.status).json(e)}$.invalid_login=!1,n.status(null!=(t=e.user)&&t.isAuthenticated?200:400).send()}),T.get("/api/user",vc(),async(e,n)=>{var t;const o=e.user;if(null==o||!o.isAuthenticated){if(!0===$.invalid_login){const e=Kc($);return n.status(e.status).json(e)}return n.status(401).json({error:"Not authenticated"})}if($.invalid_login=!1,!await mr(o))return qs(),n.status(403).json({error:"You have been logged out from this machine"});if(null==o||!o.claims)return n.status(400).json({error:"User claims not found"});if(null==o||!o.userInfo)return n.status(400).json({error:"User info not found"});const i=null==o||null==(t=o.claims)?void 0:t.organization_roles,a=null==o?void 0:o.userInfo.custom_data,s={authenticated:o.isAuthenticated,id:o.userInfo.sub,name:hc(o),email:o.claims.email||o.userInfo.email||"",profile_picture:o.userInfo.picture||"",default_org_id:(null==a?void 0:a.default_org)||"none",orgs:[]},r=["manage","owner","member","developer"];o.userInfo.organization_data&&(s.orgs=o.userInfo.organization_data.map(e=>{var n;const t={id:e.id,name:e.name,roles:(null==i?void 0:i.filter(n=>n.startsWith(e.id)).map(e=>e.split(":")[1]))||[],canWrite:!1};return t.canWrite=null==(n=t.roles)?void 0:n.some(e=>r.includes(e)),t}).sort((e,n)=>e.id===s.default_org_id?-1:n.id===s.default_org_id?1:e.name.localeCompare(n.name))),n.json(s)}),T.get("/api/license",vc(),async(n,t)=>{var o,i,a;const s=null==(o=n.query.token)?void 0:o.toString(),r=null==(i=n.query.org)?void 0:i.toString();let c=null;if(s)c={authToken:s};else{const e=await ar();if(!e||!e.isAuthenticated)return t.status(401).json({error:"Not authenticated",code:"not_authenticated"});if(!await mr(e))return qs(),t.status(403).json({error:"Invalid login"});c=await gc(e,r||null).catch(e=>({status:500,error:e.message}))}if(!c)return t.status(500).json({error:"Failed to fetch licenses (Missing auth)"});if("error"in c)return t.status(c.status).json({error:c.error});const l=Ae(c),p=null==(a=n.query.integration)?void 0:a.toLocaleString(),u={...l,"x-needle":"cli","x-needle-integration":null!=p&&p.length?p:"unknown"},d=await e(`https://cloud.needle.tools/api${ze.account.get_licenses}`,{method:"GET",headers:u}).catch(e=>{const n=Jc(e);return console.error("Failed to fetch licenses:",n),os(`Failed to fetch licenses: "${n}" - is https://cloud.needle.tools/api reachable?`),null});if(!d)return t.status(502).json({error:"Failed to fetch licenses: upstream API unreachable"});if(d.ok){const e=await d.json();return void 0===e.can_use_editor&&(e.can_use_editor=!0),t.json(e)}return t.status(d.status).json({error:d.statusText})}),T.get("/api/deployments",vc(),async(e,n)=>{var t;const o=await ar();if(!o||!o.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const i=null==(t=e.query.org)?void 0:t.toString(),a=await gc(o,i).catch(e=>({status:500,error:e.message}));if("error"in a)return n.status(a.status).json({error:a.error});if(i&&!a.org)return n.status(400).json({error:"Organization not found"});const s=await ps({endpoint:"https://cloud.needle.tools/api",authToken:a.authToken,org:a.org||void 0,limit:20,offset:0,names:void 0}).catch(e=>(console.error("List Deployments error: "+e.message),{status:502,error:"Failed to list deployments: upstream API unreachable"}));if("error"in s)return n.status(s.status).json({error:s.error});for(const e of s.deployments)e.editUrl=`${Wa()}/${e.id}`;const r={...s};return n.json(r)}),T.get(c,vc(),async(e,n)=>{var t,o,i,a,s,r,c,l;const p=await ar();if(!p||!p.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const u=(null==(t=e.query.org)?void 0:t.toString())||(null==(o=p.userInfo)||null==(o=o.custom_data)?void 0:o.default_org)||void 0,d=await gc(p,u).catch(e=>({status:500,error:e.message}));if("error"in d)return n.status(d.status).json({error:d.error});const m={content_type:(null==(i=e.query.content_type)?void 0:i.toString())||void 0,content_format:(null==(a=e.query.content_format)?void 0:a.toString())||void 0,search:(null==(s=e.query.search)?void 0:s.toString())||void 0,tags:(null==(r=e.query.tags)?void 0:r.toString())||void 0,types:(null==(c=e.query.types)?void 0:c.toString())||void 0,trash:"true"===e.query.trash||void 0,collection_id:(null==(l=e.query.collection_id)?void 0:l.toString())||void 0,limit:e.query.limit?parseInt(e.query.limit.toString()):void 0,page:e.query.page?parseInt(e.query.page.toString()):void 0,offset:e.query.offset?parseInt(e.query.offset.toString()):void 0},f=await Na({baseUrl:"https://cloud.needle.tools/api",authToken:d.authToken,org:d.org||void 0},m).catch(e=>(console.error("List content error: "+e.message),{status:502,error:"Failed to list content: upstream API unreachable"}));return"error"in f?n.status(f.status).json({error:f.error}):n.json(f)}),T.get(c+"/:identifier",vc(),async(e,n)=>{var t,o;const i=await ar();if(!i||!i.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const a=(null==(t=e.query.org)?void 0:t.toString())||(null==(o=i.userInfo)||null==(o=o.custom_data)?void 0:o.default_org)||void 0,s=await gc(i,a).catch(e=>({status:500,error:e.message}));if("error"in s)return n.status(s.status).json({error:s.error});const r=await za({baseUrl:"https://cloud.needle.tools/api",authToken:s.authToken,org:s.org||void 0},e.params.identifier).catch(e=>(console.error("Get content error: "+e.message),{status:502,error:"Failed to get content: upstream API unreachable"}));return"error"in r?n.status(r.status).json({error:r.error}):n.json(r)}),T.get(s,vc(),async(n,t)=>{const o=await ar();if(!o||!o.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const i=`https://cloud.needle.tools/api${ze.local_projects.get.user}`,a=await e(i,{method:"GET",headers:{Authorization:`Bearer ${o.accessToken}`}}).catch(e=>(console.error("Failed to fetch projects:",Jc(e)),null));if(!a)return t.status(502).json({error:"Failed to fetch projects: upstream API unreachable"});if(!a.ok)return t.status(a.status).json({error:a.statusText});const s=await a.json().catch(e=>console.error(e));return t.json(s)}),T.get(s+"/:id",vc(),async(n,t)=>{var o;const i=await ar();if(!i||!i.isAuthenticated)return t.status(401).json({error:"Not authenticated"});let a=null==(o=n.query.org)?void 0:o.toString();const s=await gc(i,a).catch(e=>({status:500,error:e.message}));if(!s)return t.status(500).json({error:"Failed to fetch projects"});if("error"in s)return t.status(s.status).json({error:s.error});const r=Ae(s),c=`https://cloud.needle.tools/api${ze.local_projects.get.by_id}${encodeURIComponent(n.params.id)}`,l=await e(c,{method:"GET",headers:{...r}}).catch(e=>(console.error("Failed to fetch project:",Jc(e)),null));if(!l)return t.status(502).json({error:"Failed to fetch project: upstream API unreachable. Please try again later or contact hi@needle.tools"});if(!l.ok)return t.status(l.status).json({error:l.statusText});const p=await l.json().catch(e=>(console.error(e),null));return p?t.json(p):t.status(500).json({error:"Failed to parse data. Please try again later or contact hi@needle.tools"})}),T.post("/api/projects",vc(),async(n,t)=>{const o=await ar();if(!o||!o.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const i="string"==typeof n.body?JSON.parse(n.body):n.body,a={machine_id:await fr(),project_id:i.project_id,project_name:i.project_name,scene_name:i.scene_name,web_project_path:i.web_project_path,editor_name:i.editor_name,editor_version:i.editor_version};if(!a.project_id||!a.project_name)return t.status(400).json({error:"Invalid request"});const s=`https://cloud.needle.tools/api${ze.local_projects.post}`,r=await e(s,{method:"POST",headers:{Authorization:`Bearer ${o.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify(a)}).catch(e=>(console.error("Failed to upsert project:",Jc(e)),null));return r?r.ok?t.send("OK"):t.status(r.status).json({error:r.statusText}):t.status(502).json({error:"Failed to upsert project: upstream API unreachable"})}),T.get("/api/public_key",vc(),async(n,t)=>{var o,i;const a=await ar();if(!a||!a.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const s=null==(o=n.query.org)?void 0:o.toString(),r=await gc(a,s).catch(e=>({error:e.message,status:500}));if(!r)return t.status(500).json({error:"Failed to fetch public key"});if("error"in r)return t.status(r.status).json({error:r.error});const c={project_id:(null==(i=n.query.project_id)?void 0:i.toString())||void 0,machine_id:await fr()},l=await e(`https://cloud.needle.tools/api${ze.account.public_key}`,{method:"POST",headers:{...Ae(r),"Content-Type":"application/json"},body:JSON.stringify(c)}).catch(e=>(console.error("Failed to fetch public key:",Jc(e)),null));if(!l)return t.status(502).json({error:"Failed to fetch public key: upstream API unreachable"});if(l.ok){const e=await l.json().catch(console.error);return null!=e&&e.public_key?t.json(e):t.status(500).json({error:"Failed to fetch public key"})}return t.status(l.status).json({error:l.statusText})}),T.get("/api/local_project_id",async(e,n)=>{const t=e.query.paths;if(!t)return n.status(400).json({error:"Missing paths"});let o=[];"string"==typeof t?o=t.split(",").map(e=>e.trim()).filter(e=>e.length>0):Array.isArray(t)&&(o=t.map(e=>e.toString().trim()).filter(e=>e.length>0));const i=Rc(o);return i?n.json({project_id:i}):n.status(404).json({error:"Project ID not found"})}),T.post("/api/project/info",vc(),async(e,n)=>{(function(e){try{!function(e){var n,t,o,i;const a={last_accessed:Date.now(),editor:null!=(n=e.scene_path)&&n.endsWith(".unity")?"unity":null!=(t=e.scene_path)&&t.endsWith(".blend")?"blender":"unknown",editor_version:e.editor_version,editor_installation_path:e.editor_installation_path,log_location:e.editor_log_path,project_location:e.unity_project_path||e.blender_project_path||e.scene_path,scene_location:e.scene_path,web_location:e.web_project_path,needle_engine_integration_location:e.needle_sourcecode_location},s=yr();let r=wr();const c=r.entries.findIndex(e=>e.project_location===a.project_location),l=null==(o=r.entries[0])?void 0:o.project_location;-1!==c?r.entries[c]=a:r.entries.push(a),r.entries.sort((e,n)=>n.last_accessed-e.last_accessed),r.entries.length>30&&(r.entries=r.entries.slice(0,30));const p=null==(i=r.entries[0])?void 0:i.project_location;p&&p!==l&&os(`Active project changed: ${l||"(none)"} → ${p}`);try{vr=r;const e=JSON.stringify(r);m(s,e,"utf-8")}catch(e){console.error("Failed to save project info:",e)}}(e)}catch(e){os("Error saving project info: "+e)}})("string"==typeof e.body?JSON.parse(e.body):e.body),n.send("OK")});let W=null;const B=new Promise(e=>W=e);let D=!1;if(S=T.listen(fs,()=>{null==W||W()}),S.on("error",e=>{if("EADDRINUSE"===(null==e?void 0:e.code))return os(`License server port ${fs} already in use — a server is already running; not starting a second one.`),D=!0,l.isHost=!1,void(null==W||W());console.error("[needle] License server failed to start:",(null==e?void 0:e.message)||e),os(`License server failed to start: ${(null==e?void 0:e.message)||e}`),process.exit(1)}),function(e,n){e.on("connection",e=>{const t=e.remoteAddress;if(!function(e){if(!e)return!1;const n=e.includes("%")?e.slice(0,e.indexOf("%")):e;return"127.0.0.1"===n||"::1"===n||"::ffff:127.0.0.1"===n}(t)){try{null==n||n(`Local server: rejected non-loopback connection from ${t||"unknown"}`)}catch{}e.destroy()}})}(S,os),S.on("close",d),process.on("exit",d),process.on("SIGINT",()=>{d(),process.exit(0)}),await B.catch(e=>{console.error(e),os(`Error starting the auth server (promise failed): ${e.message}`)}),D)return l;function d(){os("Cleaning up auth server...")}(function(e,n){const t=new fe({server:e,path:"/mcp/ws",verifyClient:({req:e},n)=>{var t;const o=null==(t=e.headers)?void 0:t.origin;if(o&&!qc(o))return os(`${Wc} rejected WS upgrade: disallowed origin ${o}`),void n(!1,403,"Forbidden: origin not allowed");n(!0)}});os("MCP websocket server created.");let o=0,i=new Map;t.on("connection",e=>{const n=++o;Bc.push(e),console.log(`${Wc} client connected (#${n})`),os(`${Wc} client connected (#${n})`),e.on("close",()=>{const t=Bc.indexOf(e);-1!==t&&Bc.splice(t,1);const o=i.get(n);if(o){for(const e of o)Or(e,Ic);i.delete(n)}console.log(`${Wc} client disconnected (#${n})`),os(`${Wc} client disconnected (#${n})`)});const t=new Map;e.on("message",o=>{try{const a=o.toString(),s=JSON.parse(a);switch(s.command){default:console.log(`${Wc} Unknown command: ${s.command}`),os(`Unknown MCP websocket command received: ${s.command}`);break;case"get_connected_clients":!function(n,t){const o={clients:[...Oc()],command:"mcp_server_response",messageId:"messageId"in n?n.messageId:void 0};e.send(JSON.stringify(o))}(s);break;case"register_tools":{const o=s.tools,a=s.source;a&&function(e,n){const t=Er.get(e);if(t&&t.size>0){console.log(`[MCP] Removing ${t.size} tools registered from ${e}`);let o=!1;for(const n of t){const t=$r.findIndex(e=>e.name===n);-1!==t&&($r.splice(t,1),delete Tr[n],Rr.set(n,e),o=!0)}Er.delete(e),o&&n()}}(a,Ic);const r=a||"unknown";console.log(`${Wc} ${r} registered ${o.length} tool${1===o.length?"":"s"}`),os(`${Wc} ${r} registered ${o.length} tool${1===o.length?"":"s"}`);const c=i.get(n)||new Set;i.set(n,c);for(const n of o)c.add(n.name),Cr(n,async o=>{console.log(`Tool ${n.name} executed via WebSocket with args:`,o);const i=`${n.name}-${Date.now()}-${Math.random()}`;return await new Promise((a,s)=>{const r=setTimeout(()=>{t.has(i)&&(console.error(`${Wc} Tool execution timed out for tool: ${n.name}`),t.delete(i),s(new Error(`Tool execution timed out for tool: ${n.name}`)))},3e4);t.set(i,{resolve:e=>{a(e),clearTimeout(r)},reject:s}),e.send(JSON.stringify({command:"execute_tool",toolName:n.name,args:o,requestId:i}))})},{source:a},Ic);break}case"tool_result":{const e=s.requestId,n=s.result;if(console.log(`${Wc} Received tool result for requestId: ${e}`,n),t.has(e)){const o=t.get(e);null==o||o.resolve(n),t.delete(e)}else console.error(`${Wc} No pending tool execution found for requestId: ${e}`);break}}}catch(e){console.error(`${Wc} Error processing WebSocket message:`,e)}})})})(S),Fr({logToolCount:!0}),lc();const M=Yr(C,()=>{Kr()?(os("Settings changed: remote_ai_tools disabled — closing cloud connection"),pc("remote_ai_tools setting disabled")):(os("Settings changed: remote_ai_tools enabled — opening cloud connection"),lc())});process.on("exit",()=>{M(),pc("process exit")})}return l}function Kc(e){let n="";return n=e.error?e.error:e.logged_in_machine_names.length>0?`You're already authenticated on ${e.logged_in_machine_names.length} other machine(s)${e.user_email?` with ${e.user_email}`:""}. Please logout from other machines first on ${qa()}. You're currently logged in on: ${e.logged_in_machine_names.join(", ")}`:"An unknown error occured.",{status:403,error:n}}async function Yc(e={headless:!1,silent:!1,clearAuthData:!1}){return!0===e.clearAuthData&&await qs(),Zc("sign-in",{...e})}function Vc(e={}){return Zc("sign-out",{...e})}function Zc(n,t){return new Promise(async(o,i)=>{let a=!1;if("sign-in"==n){const e=await ar();if(null!=e&&e.isAuthenticated&&e.accessToken)return await gr(e)?(a=!0,t.ora&&(t.ora.text=`Authorized as ${hc(e)}`),"gotoAccountPage"in t&&!0===t.gotoAccountPage&&(t.ora&&(t.ora.text="Opening account page in the browser"),Ba(qa()),await new Promise(e=>setTimeout(e,2e3))),o(e)):o(null);if(!0===t.headless)return o(null)}else if("sign-out"==n&&!0===t.headless){a=!0,qs();const n=await Hc(),t=await e(n.auth_endpoints["sign-out"],{follow:2});return o(t.ok)}const s=await Hc();switch(t.timeout||(t.timeout=6e5),"number"==typeof t.timeout&&t.timeout>0&&setTimeout(()=>{a||(t.ora&&t.ora.fail('Timeout "'+n+'"'),o(null))},t.timeout),n){case"sign-in":const e=s.auth_endpoints["sign-in"];setTimeout(()=>Ba(e),300),t.ora&&(t.ora.text=`Please authenticate in the browser: ${e}`),setTimeout(l,2e3);break;case"sign-out":qs(),Ba(s.auth_endpoints["sign-out"]),setTimeout(l,2e3)}let r=0;const c=10;function l(){e(s.auth_endpoints["is-authenticated"]).then(async e=>{if(200===e.status||400===e.status||403===e.status)switch(n){case"sign-in":if(200===e.status){const e=await ar();return e&&!await gr(e)?o(null):(a=!0,t.ora&&e&&(t.ora.text="User is authenticated"),o(e))}if(403===e.status){t.ora&&t.ora.fail("Authentication failed");const n=await e.text();if(n.startsWith("{")){const e=JSON.parse(n);if("logged_in_machine_names"in e&&Array.isArray(e.logged_in_machine_names)){const n=e.logged_in_machine_names;T().fail(`You're already authenticated on ${n.length} other machine(s). Please logout from other machines first. You're currently logged in on: ${n.join(", ")}`)}}return o(null)}break;case"sign-out":if(400===e.status)return a=!0,qs(),t.ora&&(t.ora.text="User is signed-out"),o(!0)}else if(r++,r>c)return t.ora?t.ora.fail(`Failed to complete auth flow. Please try again. Make sure that port ${s.port} is not blocked`):t.silent||console.error(`Failed to complete auth flow. Please try again. Make sure that port ${s.port} is not blocked`),o(null);setTimeout(l,1e3)}).catch(e=>{r>=10&&console.debug("Error polling auth status: "+e.message)})}})}const Xc=/token|secret|password|authorization|api[-_]?key|access[-_]?key|private[-_]?key|client[-_]?secret/i;function Qc(e,n){return async function(t){const o=function(e,n){const t=[];if(e&&Object.keys(e).length>0&&t.push(`args=${el(e)}`),n&&Object.keys(n).length>0){const e=Object.fromEntries(Object.entries(n).map(([e,n])=>Xc.test(e)?[e,"<redacted>"]:[e,n]));t.push(`options=${el(e)}`)}return t.join(" ")}(null==t?void 0:t.args,null==t?void 0:t.options);os(`CLI action: ${e}${o?" "+o:""}`);const i=Date.now();try{const o=await n(t);return os(`CLI action: ${e} succeeded in ${Date.now()-i}ms`),o}catch(n){const t=n instanceof Error?n.message:String(n);throw os(`CLI action: ${e} failed in ${Date.now()-i}ms: ${t}`),n}}}function el(e){try{return JSON.stringify(e,(e,n)=>"bigint"==typeof n?n.toString():"function"==typeof n?"<fn>":n)}catch{return"<unserializable>"}}globalThis.fetch||(globalThis.fetch=e),globalThis.File||(globalThis.File=n),globalThis.crypto||(globalThis.crypto=t.webcrypto);const nl=process.argv.includes("--silent"),tl=JSON.parse(l(new URL("../package.json",import.meta.url),"utf-8")),ol="The access token to use. Use the login command or get a token from https://cloud.needle.tools. You can pass the access token with your command or set the environment variable NEEDLE_CLOUD_TOKEN";async function il(e,n=null,t=!0){let o,i=null==e?void 0:e.toString();var a;if(i||(re.config(),process.env.NEEDLE_CLOUD_TOKEN&&(i=process.env.NEEDLE_CLOUD_TOKEN,null!=(a=i)&&a.length&&console.log("Using NEEDLE_CLOUD_TOKEN token from env"))),""===i||"true"===i){const e=(await import("node:readline")).createInterface({input:process.stdin}),n=10;let t,i="",a=!1;return new Promise(s=>{const r="Paste your https://cloud.needle.tools/team#token access token here:",c=T({text:r,interval:200,spinner:"moon"}).start();process.stdin.setRawMode(!0),process.stdin.on("data",l=>{const p=l.toString();""===p&&process.exit();const u="\n"===p||"\r"===p;if(!u&&"\n"!==p&&"\r"!==p){""===p||"\b"===p?i=i.slice(0,-1):i+=p;const e=i.replace(/./g,"*");c.text=`${r} ${e}`}clearTimeout(t),t=setTimeout(()=>{if(!a&&(u||i.trim().length>n)){process.stdin.setRawMode(!1),e.close(),a=!0;const n=i.trim();if(n.length>0){const e=n.slice(3,-3).replace(/./g,"*");c.succeed("Access token received: "+e)}else c.fail("No access token provided");s({accessToken:n,org_id:o})}},150)})})}if(!i){let e;await async function(){const e=await ar();return null==e?void 0:e.isAuthenticated}()||(e=nl?void 0:T("No access token found. Please sign in to authenticate...").start()),os("No access token provided, attempting login. Org: "+n);const a=Yc({headless:!t,ora:e,timeout:12e4}),d=await a;var s;if(d&&!await mr(d)?(null==(s=e)||s.fail("You are not logged in from this machine. Please login again."),await Vc({headless:!0}),process.exit(1)):e&&(os("User logged in via getAccessToken "+(null==d?void 0:d.isAuthenticated)),d?e.succeed("Logged in"):e.fail("Login failed")),null!=d&&d.isAuthenticated){var r;if(null==n){const e=await sr(d);"string"==typeof e&&(n=e)}else n===(null==(r=d.userInfo)?void 0:r.sub)&&(n=null);if(n){var c,l,p;if(o=null==(c=d.userInfo)||null==(c=c.organization_data)||null==(c=c.find(e=>e.id===n))?void 0:c.id,o||(n=null==(l=n.toString())?void 0:l.toLowerCase(),null!=o||(o=null==(p=d.userInfo)||null==(p=p.organization_data)||null==(p=p.find(e=>e.name.toLowerCase()===n))?void 0:p.id)),!o)throw new Error(`ERR: You (${hc(d)}) are not a member of the team "${n}" or the team does not exist. Please check the team name/id and try again.`);i=await(null==d?void 0:d.client.getOrganizationToken(o)),os("Getting access token for org "+o+", "+i.substring(0,8)+"...")}else{var u;os("Getting access token for user "+(null==(u=d.userInfo)?void 0:u.sub)),i=null==d?void 0:d.accessToken}}}return i||(console.error("ERR: Missing NEEDLE_CLOUD_TOKEN token. Please provide the access token argument or set the environment variable NEEDLE_CLOUD_TOKEN. Get an access token for your team at https://cloud.needle.tools/team"),os("ERR: Missing NEEDLE_CLOUD_TOKEN token. Org: "+o),process.exit(403)),{accessToken:i,org_id:o}}const al=Ne.program;async function sl(){const{spawn:e}=await import("node:child_process");e(process.execPath,[process.argv[1],"start","--integration","cli-login"],{stdio:"inherit",env:{...process.env,NEEDLE_CLOUD_TOKEN:process.env.NEEDLE_CLOUD_TOKEN||""}}),await new Promise(e=>setTimeout(e,1e3))}al.version(tl.version).description("Command-line interface (CLI) for Needle Cloud"),al.command("version","Print the CLI version").configure({visible:!1}).action(()=>{nl||console.log(`☁ Needle CLI — ${tl.version}, Node ${process.version}`)}),al.command("start","Starts the Needle Auth server").alias("start-server").configure({visible:!1,strictOptions:!1}).help("Start the local server for Needle Cloud. This is required to authenticate with Needle Cloud and access your account and data.").option("--restart <restart>","Restarts the server",{required:!1,validator:al.BOOLEAN,default:!1}).option("--integration <integration>","Hint for the process which integration triggered this command",{required:!1,validator:al.STRING}).action(async({options:e})=>{const n=e.integration,t=nl?void 0:T("Starting Needle License server "+(n?`(from ${n})`:"")).start();Hc({ora:t,restart:e.restart}).catch(e=>{console.error("Failed to start server:",e),null==t||t.fail("Failed to start server: "+e.message),process.exit(1)}).then(e=>{null!=e&&e.baseUrl&&e.isHost?null==t||t.succeed(`Server started on ${e.baseUrl} (v${kr()}, built ${function(e){if("string"!=typeof Dc||0===Dc.length)return"unknown";const n=new Date(Dc);if(Number.isNaN(n.getTime()))return"unknown";const t=e=>String(e).padStart(2,"0");return`${n.getFullYear()}-${t(n.getMonth()+1)}-${t(n.getDate())} ${t(n.getHours())}:${t(n.getMinutes())}`}()})`):!1===(null==e?void 0:e.isHost)?(n||null==t||t.warn(`Server is running on ${e.baseUrl||e.port}`),process.exit(0)):(null==t||t.fail("Failed to start server"),process.exit(1))})}),al.command("settings","Show current Needle CLI settings").action(async()=>{const{readSettings:e,KNOWN_SETTINGS:n}=await Promise.resolve().then(function(){return Vr}),t=e();for(const[e,o]of Object.entries(n)){const n=t[e],i=void 0!==n?String(n):o.default;console.log(`\n ${"enabled"===i?"[x]":"[ ]"} ${o.displayName}: ${i}${void 0===n?" (default)":""}`),console.log(` ${o.description}`),console.log(` Change: ${o.command}`)}console.log("")}),al.command("settings remote-ai-tools","Enable or disable cloud AI tool dispatch to this machine").help("When disabled, the CLI does NOT connect to the Needle Cloud AI tool dispatcher (wss://cloud.needle.tools/v1/cli/ws), so cloud-side AI chats cannot invoke tools (file reads, grep, etc.) on this machine. The local /mcp/ws endpoint used by Unity/Blender stays available. Setting persists in ~/.needle/settings.json.").argument("<enabled>","true to enable, false to disable",{validator:al.BOOLEAN}).action(Qc("settings remote-ai-tools",async({args:e})=>{const{writeSetting:n,defaultSettingsDir:t}=await Promise.resolve().then(function(){return Vr}),o=e.enabled,i=t();o?(n(i,"remote_ai_tools",null),console.log("Remote AI tools enabled (default)."),os("Settings: remote_ai_tools set to enabled (default) via CLI command")):(n(i,"remote_ai_tools","disabled"),console.log("Remote AI tools disabled. The cloud AI chat will not be able to dispatch tools to this machine."),os("Settings: remote_ai_tools set to disabled via CLI command"))})),al.command("mcp","Start MCP server for AI agents (stdio transport)").help('Start the Needle Cloud MCP server using stdio transport.\nThis is the standard way to connect AI agents (Claude Desktop, Cursor, VS Code, etc.).\n\nAdd to your MCP client config:\n{\n "mcpServers": {\n "needle": {\n "command": "npx",\n "args": ["-y", "needle-cloud", "mcp"]\n }\n }\n}').action(Qc("mcp",async()=>{const{startStdio:e}=await Promise.resolve().then(function(){return Lc});e()})),al.command("get-project-id","Gets the project id for a local project").configure({visible:!1,strictOptions:!1}).argument("<paths...>","The path to the local project (web project directory)").action(async({args:e})=>{const n=Rc(e.paths);n?console.log(`Found project ID: "${n}"`):console.log("No project ID found.")}),al.command("send-logs","Upload CLI, editor, and optimization-pipeline logs to Needle (secrets and sensitive info redacted)").help("Stream the current and previous CLI log, the most recent editor log (Unity or Blender), and the optimization-pipeline log to Needle for support diagnosis. Before upload, tokens, Bearer/Authorization values, UUIDs, home-directory paths, email addresses, Username/User fields, and *_KEY / *_TOKEN / *_SECRET / *_PASSWORD env-var values are redacted (replaced with <redacted:Nch> so the length is preserved for debugging). Returns a reference ID to paste into your bug report. Requires sign-in; the upload is tagged with your Needle account.").option("--crash <crash>","Mark this upload as a crash report (uses the crash-mode daily quota)",{required:!1,validator:al.BOOLEAN,default:!1}).option("--note <note>","One-line note attached to the upload",{required:!1}).option("--dry-run <dryRun>","Print the redacted payload without uploading",{required:!1,validator:al.BOOLEAN,default:!1}).action(Qc("send-logs",async({options:e})=>{var n,t,o,i,a,s,r;const{runSendLogs:c,HAYSTACK_RESOURCE:l}=await Promise.resolve().then(function(){return Ls}),{tryGetFreshAccessTokenForResource:p}=await Promise.resolve().then(function(){return lr}),{findActiveEditorLog:u}=await import("./cli.send-logs.discovery-a99400e6.js"),{getLogFilePath:d,getPrevLogsFilePath:m,getPipelineLogFilePath:f}=await Promise.resolve().then(function(){return is}),{homedir:h,platform:g}=await import("os"),{existsSync:v}=await import("fs"),{BUILD_TIME:x}=await Promise.resolve().then(function(){return Mc}),{getNodeVersion:b,getNpmVersion:y,getArch:w,getOsRelease:_,getCpuCount:k,getTotalMemoryMb:j,getTzOffsetMinutes:S,isCi:$,isTty:E}=await import("./cli.runtime-465aa7a3.js"),O=null!=(n=null!=(t=null==(o=e.crash)||null==o.valueOf?void 0:o.valueOf())?t:e.crash)&&n?"crash":"normal",C=e.note,R=null!=(i=null!=(a=null==(s=e.dryRun)||null==s.valueOf?void 0:s.valueOf())?a:e.dryRun)&&i,N=d(),z=m(),A=f(),L={getAccessToken:()=>p(l),fetch:globalThis.fetch,paths:{cliLogPath:v(N)?N:null,prevLogPath:v(z)?z:null,pipelineLogPath:v(A)?A:null,homeDir:h()},meta:{cli_version:kr(),build_time:x,os:g(),os_release:_(),arch:w(),node_version:b(),npm_version:null!=(r=y())?r:"unknown",cpu_count:k(),total_memory_mb:j(),tz_offset_minutes:S(),is_ci:$(),is_tty:E()},findActiveEditorLog:u,stdout:process.stdout,stderr:process.stderr},U=R?"Building payload (dry-run)":"Uploading logs",I=nl?void 0:T(U).start();L.recoverAuth=async()=>{null==I||I.stop();try{await sl();const e=await Yc({clearAuthData:!0,silent:nl,ora:void 0});if(null==e||!e.isAuthenticated)return null}catch(e){return os(`send-logs: auto-recovery login failed: ${e instanceof Error?e.message:e}`),null}finally{null==I||I.start(U)}return await p(l)};const F=await c({mode:O,note:C,dryRun:R},L);F.ok?R?null==I||I.succeed("Dry-run payload printed above. Nothing was uploaded."):F.truncated?(null==I||I.warn(`Uploaded (truncated at server cap). Reference: ${F.refId}`),console.log(`Share ${F.refId} in your bug report.`)):(null==I||I.succeed(`Uploaded. Reference: ${F.refId}`),console.log(`Share ${F.refId} in your bug report.`)):(null==I||I.fail(F.error||"Upload failed"),process.exitCode=1)})),al.command("login","Login to Needle Cloud").help("Login to Needle Cloud. If you are already logged in, this will refresh the access token.").option("--headless <headless>","The headless process will not open a browser window to login. If the user is not authorized then no auth flow can be started. Use this if you only want to **check** if the user is authenticated",{required:!1,validator:al.BOOLEAN,default:!1}).option("--clear <clear>","Refresh the access token",{required:!1,validator:al.BOOLEAN,default:!1}).action(async({options:e})=>{await sl();const n=e.headless.valueOf()||!1,t=e.clear.valueOf()||!1,o=nl?void 0:T("Login").start();await Yc({headless:n,silent:nl,clearAuthData:t,ora:o}).then(async e=>{null!=e&&e.isAuthenticated?null==o||o.succeed("Successfully logged in as "+hc(e)):0==n?null!=e&&e.claims||null!=e&&e.userInfo?null==o||o.warn(`You (${hc(e)}) are not authenticated...`):null==o||o.fail("Login failed"):nl||null==o||o.warn("Not logged in"),process.exit(null!=e&&e.isAuthenticated?0:1)})}),al.command("logout","Logout of Needle Cloud").help("Logout of Needle Cloud (if you have logged in before).").option("--headless <headless>","Headless will not open a browser window to logout",{required:!1,validator:al.BOOLEAN,default:!1}).action(async({options:e})=>{await sl();const n=e.headless.valueOf()||!1;await Vc({headless:n}).then(e=>{e?T("Logged out").succeed():T("Logout failed").fail(),process.exit(e?0:1)})}),al.command("me","Prints your user information").help("Prints basic informaton about the logged in Needle Cloud account (your account)").action(async({})=>{const e=nl?void 0:T("Query user data").start(),n=await ar();if(null!=n&&n.isAuthenticated&&await mr(n)){const a=n.userInfo||n.claims;var t,o,i;a?(null==e||e.succeed(`You are logged in as ${hc(n)}`),console.log(`- Name: ${hc(n)}`),console.log(`- ID: ${a.sub}`),a.email&&console.log(`- Email: ${a.email}`),a.phone_number&&console.log(`- Phone: ${a.phone_number}`),null!=(t=n.userInfo)&&t.organization_data&&console.log(`- Teams [${null==(o=n.userInfo)?void 0:o.organization_data.length}]: ${null==(i=n.userInfo)?void 0:i.organization_data.sort((e,n)=>e.name.localeCompare(n.name)).map(e=>e.name).join(", ")}`)):null==e||e.fail("Failed to get user data")}else null==e||e.warn("You are not logged in")}),al.command("get-pro","Start license flow for Needle Engine PRO").configure({visible:!1,strictArgsCount:!1,strictOptions:!1}).option("--org <org>","The team to purchase the license for",{validator:al.STRING}).action(Qc("get-pro",async({options:e})=>{var n;let t=(null==(n=e.org)?void 0:n.toString())||null;const o=T().start("Start Needle Engine PRO purchase flow"),i=function(e){e=e||{};const n="undefined"!=typeof window?window.location:null;"current_page"===e.baseUrl&&(e.baseUrl=null==n?void 0:n.href);let t=e.pathname||(null==n?void 0:n.pathname),o=e.baseUrl||(null==n?void 0:n.href);if(!t||!o)return null;const i=new URL(t,o);return n&&(i.search=n.search),e.license||(e.license="needle-engine:pro"),i.searchParams.set("purchase_intent",e.license),e.account_id&&i.searchParams.set("account_id",e.account_id),e.return_url&&i.searchParams.set("return_url",e.return_url),e.checkout_if_possible&&i.searchParams.set("checkout_if_possible","true"),e.show_all_cards&&i.searchParams.set("show_all_cards","true"),e.affiliate_id&&i.searchParams.set("affiliate_id",e.affiliate_id),e.tracking_id&&i.searchParams.set("tracking_id",e.tracking_id),i}({baseUrl:"https://cloud.needle.tools",pathname:t?`/team/${t}`:"/account",account_id:t,license:"needle-engine:pro",return_url:null});if(!i)return void o.fail("Failed to get purchase url - please visit https://cloud.needle.tools");const a=i.toString();o.succeed(`Started Needle Engine PRO purchase flow: opening browser at ${a}`),Ba(a)}));const rl={account:{url:qa}},cl=`"${Object.keys(rl).join('", "')}"`;al.command("open",`Open a page in the default browser. Options are: ${cl}`).argument("<page>",`The page to open. Options are: ${cl}`,{validator:al.STRING}).configure({strictOptions:!1,strictArgsCount:!1,visible:!1}).help("").action(async({args:e,logger:n})=>{const t=e.page.toString(),o=rl[t];o?"url"in o?Ba(o.url()):n.error(`Unknown argument: ${t}`):n.error(`Unknown argument: ${t}. Options are: ${cl}`)}),al.command("list-deployments","Get a list of deployed websites").configure({visible:!1}).help("").option("--token <token>",ol,{validator:al.STRING}).option("--org <org>","The organization name or id to authenticate for",{required:!1,validator:al.STRING}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:al.STRING}).option("--limit <limit>","Limit the number of deployments to show (min: 0, max: 100)",{validator:al.NUMBER,default:10}).option("--offset <offset>","The offset for deployments (default: 0, min: 0)",{validator:al.NUMBER,default:0}).option("--format <format>","The output format. Options: cli (default), json",{validator:al.STRING,default:"cli",hidden:!0}).option("--name","Filter by one or multiple deployment names (separated by ;)",{validator:al.STRING}).action(async({options:e,logger:n})=>{var t,o,i;const{accessToken:a,org_id:s}=await il(e.token,e.org),r=(null==(t=e.endpoint)?void 0:t.toString())||"https://cloud.needle.tools/api",c=e.limit.valueOf(),l=e.offset.valueOf(),p=(null==(o=e.format)?void 0:o.toString())||"cli",u=(null==(i=e.name)?void 0:i.toString())||void 0;if(c<0)return void n.error("The limit can not be negative");if(c>100)return void n.error("The limit can not be higher than 100");const d=T("Query deployments").start(),m=await ps({endpoint:r,authToken:a,org:s,limit:c,offset:l,names:null==u?void 0:u.split(";")}).catch(e=>{n.error(e)});if(m&&"error"in m)d.fail(m.error+" (status: "+m.status+")");else if(m){if("json"===p){d.succeed(`Found ${m.deployments.length} deployments`);const e=JSON.stringify(m.deployments);return void console.log(e)}m.deployments.length>0?(d.succeed(`Found ${m.deployments.length} deployments`),m.deployments.forEach((e,t)=>{n.info(`${t+c*l}: ${e.name} – ${e.url}`)})):d.warn("No deployments found"),process.exit(0)}else d.fail("Failed to query deployments"),process.exit(1)}),al.command("list","List content items (3d assets, deployments, materials, etc.)").alias("list-content").help('List content items stored in Needle Cloud.\n\nUse --type to filter by content type (e.g. "material", "3d-asset", "deployment").\nUse --format to filter by output format (e.g. "glb", "textures").').option("--token <token>",ol,{validator:al.STRING}).option("--org <org>","The organization name or id to authenticate for",{required:!1,validator:al.STRING}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:al.STRING}).option("--type <type>","Filter by content type (e.g. material, 3d-asset, deployment)",{required:!1,validator:al.STRING}).option("--format <format>","Filter by output format (e.g. glb, textures)",{required:!1,validator:al.STRING}).option("--search <search>","Search by name, title or description",{required:!1,validator:al.STRING}).option("--limit <limit>","Max number of items to show (default: 20, max: 100)",{validator:al.NUMBER,default:20}).option("--offset <offset>","Offset for pagination (default: 0)",{validator:al.NUMBER,default:0}).option("--output <output>","Output style: cli (default), json",{validator:al.STRING,default:"cli"}).action(async({options:e,logger:n})=>{var t,o,i,a,s,r,c,l,p;const{accessToken:u,org_id:d}=await il(e.token,e.org),m=(null==(t=e.endpoint)?void 0:t.toString())||"https://cloud.needle.tools/api",f=Math.min(null!=(o=null==(i=e.limit)?void 0:i.valueOf())?o:20,100),h=null!=(a=null==(s=e.offset)?void 0:s.valueOf())?a:0,g=(null==(r=e.output)?void 0:r.toString())||"cli",v=(null==(c=e.type)?void 0:c.toString())||void 0,x=(null==(l=e.format)?void 0:l.toString())||void 0,b=(null==(p=e.search)?void 0:p.toString())||void 0,y=T("Querying content...").start();try{const e=await Na({baseUrl:m,authToken:u,org:d},{content_type:v,content_format:x,search:b,limit:f,offset:h});if("json"===g)return y.succeed(`Found ${e.items.length} of ${e.total} items`),void console.log(JSON.stringify(e.items,null,2));0===e.items.length&&(y.warn("No content found"+(v?` (type: ${v})`:"")+(x?` (format: ${x})`:"")),process.exit(0)),y.succeed(`Found ${e.items.length} of ${e.total} items`);const t=e.items.map(e=>{var n;const t=e.title||"(untitled)";return{id:e.identifier,type:e.content_type||"?",formats:null!=(n=e.content_formats)&&n.length?e.content_formats.join(", "):"",name:t.length>20?t.slice(0,17)+"...":t,versions:String(e.version_count||0),date:e.created_at?ga(new Date(e.created_at),new Date,{allowSimple:!0,limitInDays:2}):""}}),o={id:Math.max(2,...t.map(e=>e.id.length)),type:Math.max(4,...t.map(e=>e.type.length)),formats:Math.max(7,...t.map(e=>e.formats.length)),name:Math.max(4,...t.map(e=>e.name.length))},i=ms(` ${"ID".padEnd(o.id)} ${"TYPE".padEnd(o.type)} ${"FORMATS".padEnd(o.formats)} ${"NAME".padEnd(o.name)} ${"#".padStart(3)} AGE`);n.info(i);for(const e of t){const t=ds(e.type).padEnd(o.type+11),i=(e.formats?e.formats.split(", "):[]).map(e=>ds(e)).join(", ")+" ".repeat(Math.max(0,o.formats-e.formats.length));n.info(` ${ms(e.id.padEnd(o.id))} ${t} ${i} ${e.name.padEnd(o.name)} ${e.versions.padStart(3)} ${ms(e.date)}`)}e.total>h+f&&n.info(` ... ${e.total-h-f} more (use --offset ${h+f})`),process.exit(0)}catch(e){y.fail(e.message),process.exit(1)}}),al.command("download","Download a content item by identifier").help('Download files from a content item.\n\nUse --format to select which output format to download (e.g. "glb", "textures").\n\nUsage:\n needle-cloud download <identifier> [directory]\n needle-cloud download abc123 --format glb').argument("<identifier>","Content item identifier",{validator:al.STRING}).argument("[directory]","Output directory (default: current directory)",{default:"."}).option("--token <token>",ol,{validator:al.STRING}).option("--org <org>","The organization name or id to authenticate for",{required:!1,validator:al.STRING}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:al.STRING}).option("--format <format>","Output format to download (e.g. glb, textures)",{required:!1,validator:al.STRING}).option("--name <name>","Output filename (without extension)",{required:!1,validator:al.STRING}).option("--verbose","Show detailed download info",{required:!1,validator:al.BOOLEAN,default:!1}).action(async({args:e,options:n,logger:t})=>{var o,i,a,s,r,c;const{accessToken:l,org_id:p}=await il(n.token,n.org),u=(null==(o=n.endpoint)?void 0:o.toString())||"https://cloud.needle.tools/api",d=e.identifier.toString(),m=(null==(i=e.directory)?void 0:i.toString())||".",f=(null==(a=n.name)?void 0:a.toString())||void 0,h=null!=(s=null==(r=n.verbose)?void 0:r.valueOf())&&s,g=(null==(c=n.format)?void 0:c.toString())||void 0,v=T("Looking up content...").start();try{var x;const e={baseUrl:u,authToken:l,org:p},n=await za(e,d).catch(()=>null);if(!n)return void v.fail(`Content not found: "${d}". Use the exact content identifier (see list-content).`);const o=null==(x=n.versions)?void 0:x[0];if(!o)return void v.fail(`Content "${n.title||n.name}" has no versions`);let i=o.identifier;if(g){let e=!1;for(const t of n.versions){if(t.content_format===g){i=t.identifier,e=!0;break}const n=t.variants.find(e=>e.content_format===g);if(n){i=n.identifier,e=!0;break}}if(!e)return void v.fail(`No output with format "${g}" found for "${n.title||n.name}"`)}v.text=`Downloading "${n.title||n.name}"${g?` (format: ${g})`:""}...`,v.stop();const a=await cs({baseUrl:u,authToken:l,org:p,identifier:i,outDir:m,filename:f,verbose:h,content_format:g});"error"in a&&t.error(a.error)}catch(e){v.fail(e.message)}}),al.command("deploy","Deploy a website to Needle").help("").argument("<directory>","The directory to deploy",{validator:al.STRING}).option("--token <token>",ol,{validator:al.STRING}).option("--team <team>","The team name or id to deploy to (not needed when using token/accesstoken)",{required:!1,validator:al.STRING}).option("--org <org>","The organization name or id to deloy to (not needed when using token/accesstoken)",{required:!1,validator:al.STRING,hidden:!0}).option("--name <name>","The project name. This name will also be used in your website URL",{required:!1,validator:al.STRING}).option("--entrypoint <entrypoint>",'The entrypoint file to use (e.g. "index.html"). This is useful if you want to deploy a folder with multiple HTML files and you want to configure which file to load initially or if you have multiple model files in one folder',{required:!1,validator:al.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:al.STRING,hidden:!0}).option("--open","Open the deployment in the default browser",{default:!0,validator:al.BOOLEAN}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:al.BOOLEAN,default:!1,hidden:!0}).option("--experimental","Use the experimental upload API. Mostly used for debugging (default: false)",{required:!1,validator:al.BOOLEAN,default:!1,hidden:!0}).option("--raw","Use raw to disallow modifications like gzip compression on upload",{required:!1,validator:al.BOOLEAN,default:!1,hidden:!0}).action(Qc("deploy",async({args:e,options:n,logger:t})=>{var o,i,a;const s=n.open,{accessToken:r,org_id:c}=await il(n.token,n.team||n.org),l=n.verbose.valueOf(),p=n.experimental.valueOf()||!1,u=n.raw.valueOf()||!1;await ss({logger:t,endpoint:(null==(o=n.endpoint)?void 0:o.toString())||void 0,token:r,org_id:c,directory:e.directory.toString(),name:(null==(i=n.name)?void 0:i.toString())||void 0,entrypoint:(null==(a=n.entrypoint)?void 0:a.toString())||void 0,open:s,verbose:l||!1,experimental:p||!1,raw:u||!1})})),al.command("optimize","Optimize glTF, GLB, VRM, FBX, USD files").help("").option("--token <token>",ol,{validator:al.STRING}).option("--team <team>","The team name or id to upload the file to",{required:!1,validator:al.STRING}).option("--org <org>","The organization name or id to upload the file to",{required:!1,validator:al.STRING,hidden:!0}).argument("<path>","The full path to a file or directory that should be optimized",{validator:al.STRING}).option("--outdir <outdir>","The output directory for the optimized file(s). If set your optimized asset files will automatically be downloaded to this directory.",{required:!1,validator:al.STRING}).option("--name <name>","The optimization project name / unique identifier. This can also be the view id of previous uploads.",{required:!1,validator:al.STRING}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:al.BOOLEAN,default:!1}).option("--progressive","Use Needle progressive loading",{required:!1,validator:al.BOOLEAN,default:!0}).option("--usecase <usecase>",'The use case for the optimization. This can be "product" (default) or "world".',{required:!1,validator:al.STRING,default:"product"}).action(Qc("optimize",async({args:e,options:n,logger:t})=>{var o,i,a,s;const l=n.verbose.valueOf(),{accessToken:p,org_id:u}=await il(n.token,n.team||n.org);if(p!=n.token){const e=await ar();null!=e&&e.isAuthenticated?u||(T("Please provide an organization id to optimize files...").fail(),process.exit(1)):(T("Please login to optimize files...").fail(),process.exit(1));const n=await async function(e,n){const t=e.baseUrl+ze.account.get_licenses,o={...{...n},...Ae(e)},i=await fetch(t,{...Le,method:"GET",headers:o}).catch(e=>(console.error(e),null));return i?i.ok?(await i.json()).licenses:(console.error(i.statusText,await i.text()),[]):[]}({baseUrl:"https://cloud.needle.tools/api",authToken:p,org:u},{type:"org",org_id:u});(!n||n.length<=0||!n.find(e=>"Needle Engine"===e.type&&("pro"===e.license||"enterprise"===e.license)))&&(T("Update to Needle PRO or Enterprise required to optimize files via CLI. Visit https://cloud.needle.tools/get-pro").fail(),process.exit(1))}const d=(null==(o=n.progressive)?void 0:o.valueOf())||!0,m=(null==(i=n.usecase)?void 0:i.toString())||"product",f=await async function(e){if(e.outDir){var n;if((null==(n=e.outDir)?void 0:n.length)<=0){const e="Output Directory is invalid";return T().fail(e),{error:e}}if(r(e.outDir)&&c(e.outDir).isFile()){const e="The output directory is a file - it must be a directory";return T().fail(e),{error:e}}}const t=e.fileOrDirectory;if(!r(t))return T().fail(`File not found: ${t}`),{error:"File not found"};if(!e.token||e.token.length<=1||"string"!=typeof e.token||"true"===e.token)return{error:`Missing access token. Create a token at ${qa()}`};if(void 0!==e.name&&e.name&&(e.name.length<=0||"true"===e.name||"false"===e.name))return{error:`Name is not valid: "${e.name}". Please provide a valid name`};e.fileOrDirectory=w(e.fileOrDirectory);const o=T(`Gathering files ${e.fileOrDirectory}`).start();let i=null;try{i=Ma("optimization",e.fileOrDirectory)}catch(n){return T().fail(`${n.message||`Failed to collect files in ${e.fileOrDirectory}`}`),{error:"Failed to collect files"}}o.text=`Uploading ${i.files.length} files for optimization:\n- ${i.files.map(e=>e.path||e.name).join("\n -")}`;const a="https://cloud.needle.tools/api";e.verbose&&console.log("Using endpoint:",a);const s=function(e){var n,t;if(function(e){return e.some(e=>{let n=e.name.toLowerCase();return!!(n.endsWith(".html")||n.endsWith(".htm")||n.endsWith(".html.gz")||n.endsWith(".html.br"))||"mimetype"in e&&"text/html"===e.mimetype})}(e))return{kind:"deployment",contentType:void 0,uploadType:"deployment",canOptimize:!1,canConvertToGLB:!1};if(function(e){if(!e||1!==e.length)return!1;const n=e[0].name;return"string"==typeof(t=n)&&0!==t.length&&t.toLowerCase().endsWith(".exr")||function(e){if("string"!=typeof e||0===e.length)return!1;const n=e.toLowerCase();return n.endsWith(".hdr")||n.endsWith(".hdri")}(n)||function(e){return"string"==typeof e&&0!==e.length&&/\.pmrem(\d+x\d+)?\.ktx2$/i.test(e)}(n);var t}(e))return{kind:"environment-texture",contentType:"hdri",uploadType:void 0,canOptimize:!1,canConvertToGLB:!1};const o=null!=(n=null==(t=e[0])||null==(t=t.name.split(".").pop())?void 0:t.toLowerCase())?n:"";return{kind:"asset",contentType:"3d-asset",uploadType:void 0,canOptimize:e.some(e=>{var n;const t=null==(n=e.name.split(".").pop())?void 0:n.toLowerCase();return null!=t&&ya.has(t)}),canConvertToGLB:wa.has(o)}}(i.files);let l=s.contentType;if("asset"===s.kind&&1===i.files.length){const n=i.files[0].name.toLowerCase();if(n.endsWith(".glb")||n.endsWith(".gltf"))try{const n=i.files[0].path||i.files[0].name,t=await async function(e){return e.toLowerCase().endsWith(".gltf")?async function(e){const{readFile:n}=await import("node:fs/promises"),t=await n(e,"utf-8");return JSON.parse(t)}(e):async function(e){const{open:n}=await import("node:fs/promises"),t=await n(e,"r");try{const e=Buffer.alloc(20),{bytesRead:n}=await t.read(e,0,e.length,0);if(n<e.length)throw new Error("File too small to be a GLB");const o=new DataView(e.buffer,e.byteOffset,e.byteLength);if(o.getUint32(0,!0)!==Aa)throw new Error("Not a GLB (magic mismatch)");const i=o.getUint32(12,!0);if(o.getUint32(16,!0)!==La)throw new Error("First chunk is not JSON");const a=20+i,s=Buffer.alloc(a),{bytesRead:r}=await t.read(s,0,a,0);if(r<a)throw new Error("File truncated — JSON chunk could not be read in full");return function(e){const n=e instanceof Uint8Array?e:new Uint8Array(e);if(n.byteLength<20)throw new Error("Buffer too small to be a GLB");const t=new DataView(n.buffer,n.byteOffset,n.byteLength);if(t.getUint32(0,!0)!==Aa)throw new Error("Not a GLB (magic mismatch)");const o=t.getUint32(12,!0);if(t.getUint32(16,!0)!==La)throw new Error("First chunk is not JSON");const i=20+o;if(i>n.byteLength)throw new Error("JSON chunk exceeds buffer length");const a=n.subarray(20,i),s=(new TextDecoder).decode(a);return JSON.parse(s)}(s)}finally{await t.close()}}(e)}(n);"material"===function(e){return function(e){if(!e)return!1;const n=!e.nodes||0===e.nodes.length,t=!e.meshes||0===e.meshes.length,o=Array.isArray(e.materials)&&1===e.materials.length;return n&&t&&o}(e)?"material":"3d-asset"}(t)&&(l="material",e.verbose&&console.log(`Detected material-only asset: ${n}`))}catch(n){e.verbose&&console.warn("Failed to inspect asset for material detection:",n.message)}}const p=await Sa({baseUrl:a,authToken:e.token,org:e.org_id},{triggered_by:"cli",files:i.files,entrypoint:i.entrypoint},{type:s.uploadType||"upload",name:e.name,content_type:l,loglevel:e.verbose?"debug":"none",progress:e=>{o.text=`Uploading ${e.fileName} - finished in approx. ${e.estimatedTimeLeftDisplay}, ${100*e.progress01}%`}});if(0==p.success){const e=`${p.error||"Unknown error: could not start upload"}`;return o.fail(e),{error:e,noprint:!0}}if(p.success){const n=`${Wa()}/${p.content_id}?select_team=1`;o.succeed(p.uploadSkipped?`Files have already been uploaded to ${n}`:`Uploaded ${i.files.length} files for optimization to ${n}`);const t=await async function(e,n={progressive:!0}){const t=e.baseUrl+ze.jobs.create,o={...Ae(e),"content-type":"application/json"},i={type:"optimization",job_id:e.id,triggered_by:e.trigger_type,parameters:{...n}},a=await fetch(t,{...Le,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();return console.error(`Failed to request optimization (${a.status}): ${e} `),null}return await a.json().catch(e=>(console.error(e),null))}({baseUrl:a,authToken:e.token,org:e.org_id,id:p.id,trigger_type:"cli"},{progressive:e.progressive,usecase:"product",pipeline_version:"latest"});if(!t)return{error:"Failed to send optimization request"};if("error"in t){const e=`Failed to optimize: ${t.error}`;return console.error(e),{error:e}}{const n=t.job,o=T(`Optimization requested for ${n.name||n.identifier}`).start();let i=!1;for(o.color="gray";;){if("completed"===t.job.status){var u;i=!0,o.succeed(`${null!=(u=t.message)?u:"Optimization completed"}`);break}let s=2e3;const r=await Mi(n.identifier,{baseUrl:a,authToken:e.token,org:t.job.org});if("new"!==(null==r?void 0:r.status)&&"pending"!==(null==r?void 0:r.status)||(o.text="Your asset is queued - waiting for optimization to start",o.color="yellow",s=2e3),"running"===(null==r?void 0:r.status))o.text=`Your asset is being optimized: ${r.progress?`${r.progress}%`:""} ${r.status_message?`— ${r.status_message}`:""}`,o.color="cyan",s=1e3;else if("stalled"===(null==r?void 0:r.status))s=2500;else{if("completed"===(null==r?void 0:r.status)){i=!0,o.succeed(`Your asset has finished optimizing: ${r.status_message}`);break}if("canceled"===(null==r?void 0:r.status))return o.fail(`Optimization cancelled: ${r.error}`),{error:r.error||"Optimization cancelled"};if("failed"===(null==r?void 0:r.status))return o.fail(`Optimization failed: ${r.error}`),console.error(`Optimization failed: ${r.error}`),{error:r.error||"Optimization failed"}}await ha(s)}if(i){if(e.outDir){const t=await cs({baseUrl:a,authToken:e.token,org:e.org_id,identifier:n.identifier,outDir:e.outDir,verbose:e.verbose});if("error"in t)return{error:t.error}}else T().succeed(`Asset successfully optimized: https://cloud.needle.tools/edit/${n.content_id} (To download optimized files, use the --outdir option)`);return{success:!0}}}}return{error:"Unknown error"}}({logger:t,token:p,org_id:u,fileOrDirectory:e.path.toString(),name:(null==(a=n.name)?void 0:a.toString())||void 0,progressive:d,usecase:m,outDir:(null==(s=n.outdir)?void 0:s.toString())||void 0,verbose:l||!1}).catch(e=>{console.error(e),process.exit(1)});Array.isArray(f)?process.exit(0):"error"in f&&(f.noprint||console.error(f.error),process.exit(1))})),al.command("generate-material","Generate a PBR material from a text prompt").help("").argument("<prompt>","The text prompt describing the material to generate",{validator:al.STRING}).option("--token <token>",ol,{validator:al.STRING}).option("--team <team>","The team name or id",{required:!1,validator:al.STRING}).option("--org <org>","The organization name or id",{required:!1,validator:al.STRING,hidden:!0}).option("--resolution <resolution>","The material texture resolution (256, 512, 1k, 2k, 4k)",{default:"512",required:!1,validator:al.STRING}).option("--name <name>","Output filename",{required:!1,validator:al.STRING}).option("--outdir <outdir>","Output directory to download the generated file(s) to. If not set, the job ID is printed instead.",{required:!1,validator:al.STRING}).action(Qc("generate-material",async({args:e,options:n,logger:t})=>{var o,i,a;const{accessToken:s,org_id:r}=await il(n.token,n.team||n.org),c=e.prompt.toString(),l=null==(o=n.resolution)?void 0:o.toString(),p=null==(i=n.outdir)?void 0:i.toString(),u=null==(a=n.name)?void 0:a.toString(),d=await async function(e){if(!e.token||e.token.length<=1||"string"!=typeof e.token||"true"===e.token)return{error:`Missing access token. Create a token at ${qa()}`};if(!e.prompt||e.prompt.length<=0)return{error:"A prompt is required"};const n="https://cloud.needle.tools/api";os(`[generate-material] Starting request to ${n}, prompt="${e.prompt}", resolution=${e.resolution||512}`,{emptyLineBefore:!0});const t=T("Requesting material generation...").start(),o=await Promise.race([Ra({baseUrl:n,authToken:e.token,org:e.org_id,trigger_type:"cli"},{prompt:e.prompt,resolution:e.resolution||512}).catch(e=>({error:e.message||"Request failed"})),new Promise(e=>setTimeout(()=>e({error:"Request timed out after 30s. Please try again."}),3e4))]);if("error"in o)return os(`[generate-material] Request failed: ${o.error}`),t.fail(o.error),{error:o.error};const i=o.job;if(os(`[generate-material] Job created: ${i.identifier}, status=${i.status}`),"canceled"===i.status)return os(`[generate-material] Job canceled: ${i.status_message||"quota exceeded"}`),t.fail(i.status_message||"Material generation was canceled (quota exceeded)"),{error:i.status_message||"Quota exceeded"};t.succeed(`Material generation requested: ${i.identifier}`);const a=T("Waiting for material generation...").start();for(a.color="gray";;){if("completed"===i.status){a.succeed("Material generation completed");break}let t=2e3;const o=await Mi(i.identifier,{baseUrl:n,authToken:e.token,org:i.org});if("new"===(null==o?void 0:o.status)||"pending"===(null==o?void 0:o.status))a.text="Your material is queued - waiting for generation to start",a.color="yellow",t=2e3;else if("running"===(null==o?void 0:o.status))a.text=`Generating material: ${o.progress?`${o.progress}%`:""} ${o.status_message?`— ${o.status_message}`:""}`,a.color="cyan",t=1e3;else{if("completed"===(null==o?void 0:o.status)){os(`[generate-material] Job completed: ${i.identifier}`),a.succeed(`Material generation completed: ${o.status_message||""}`);break}if("canceled"===(null==o?void 0:o.status))return os(`[generate-material] Job canceled: ${i.identifier}, error=${o.error}`),a.fail(`Material generation canceled: ${o.error||""}`),{error:o.error||"Material generation canceled"};if("failed"===(null==o?void 0:o.status))return os(`[generate-material] Job failed: ${i.identifier}, error=${o.error}`),a.fail(`Material generation failed: ${o.error||""}`),{error:o.error||"Material generation failed"}}await ha(t)}if(e.outDir){const t=await cs({baseUrl:n,authToken:e.token,org:e.org_id,identifier:i.identifier,outDir:e.outDir,filename:e.outputName});if("error"in t)return{error:t.error}}return{success:!0,identifier:i.identifier}}({logger:t,token:s,org_id:r,prompt:c,resolution:l,outputName:u,outDir:p});"error"in d&&(d.error&&t.error(d.error),process.exit(1)),!p&&d.identifier&&console.log(d.identifier),process.exit(0)})),al.command("ask","Send a message to the Needle Cloud AI").help("Send a message to the Needle Cloud AI chat.\n\nWithout a message argument, starts an interactive session.\nBy default streams the response to the terminal. Use --no-stream for a single JSON response.\nUse --slug to continue an existing chat conversation.\nDefault slug is <your-user-id>-cli (persistent across sessions).").argument("[message...]","The message to send (omit for interactive mode)").option("--token <token>",ol,{validator:al.STRING}).option("--org <org>","The organization name or id to authenticate for",{required:!1,validator:al.STRING}).option("--slug <slug>","Chat slug to continue an existing conversation",{required:!1,validator:al.STRING}).option("--no-stream","Disable streaming (returns full response at once)",{required:!1,validator:al.BOOLEAN,default:!1}).action(Qc("ask",async({args:e,options:n})=>{var t,o;const{accessToken:i,org_id:a}=await il(n.token,n.org),s=Array.isArray(e.message)?e.message:e.message?[e.message]:[],r=s.length?s.join(" "):void 0,c=(null==(t=n.slug)?void 0:t.toString())||void 0,l=(null==(o=n.noStream)?void 0:o.valueOf())||!1;await async function(e){const{token:n,org_id:t,message:o,slug:i,stream:a}=e,s=i||function(e){try{const n=e.split(".")[1],t=JSON.parse(Buffer.from(n,"base64url").toString());if(t.sub)return t.sub+"-cli"}catch{}return"cli-"+Math.random().toString(36).slice(2,10)}(n);await async function(e){const{token:n,org_id:t,slug:o,stream:i,initialMessage:a}=e,s=se({input:process.stdin,output:process.stdout});console.log(`Needle Cloud AI (chat: ${o})`),console.log('Type your message. Press Ctrl+C or type "exit" to quit.\n');try{for(a&&(console.log(`> ${a}`),await ls({token:n,org_id:t,slug:o,message:a,stream:i}),console.log(""));;){const e=(await s.question("> ")).trim();if(e){if("exit"===e||"quit"===e)break;await ls({token:n,org_id:t,slug:o,message:e,stream:i}),console.log("")}}}finally{s.close()}}({token:n,org_id:t,slug:s,stream:a,initialMessage:o})}({token:i,org_id:a,message:r,slug:c,stream:!l}),process.exit(0)}));export{xr as g,al as p};