needle-cloud 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -1
- package/README.md +46 -1
- package/dist/cli-65a6a5f1.js +1 -0
- package/dist/cli.esm.js +1 -1
- package/dist/cli.send-logs.discovery-0e806cf7.js +1 -0
- package/dist/index.d.ts +137 -19
- package/dist/index.esm.js +1 -1
- package/package.json +1 -2
- package/dist/cli-b841fbf0.js +0 -1
- package/dist/cli.send-logs.discovery-d2ef0523.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"node-fetch";import{File as t}from"@web-std/file";import n,{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{execFileSync as g}from"child_process";import v from"open";import x,{resolve as b,join as y,relative as w,sep as _,isAbsolute as k,dirname as S}from"path";import j from"ora";import{existsSync as T,mkdirSync as E,renameSync as $,realpathSync as O,statSync as R,rename as A,appendFileSync as C,openSync as N,readSync as P,closeSync as I,createReadStream as U,readFileSync as z,writeFileSync as L,watch as F}from"node:fs";import{writeFile as D}from"node:fs/promises";import q,{homedir as B}from"node:os";import M,{join as W}from"node:path";import G from"util";import H,{Readable as J}from"stream";import V from"http";import K from"https";import Y from"url";import Z,{randomUUID as X}from"crypto";import Q from"net";import ee from"tls";import te from"assert";import ne from"tty";import oe,{homedir as ie,tmpdir as ae}from"os";import se,{EventEmitter as re}from"events";import ce from"http2";import le from"zlib";import{createInterface as pe}from"node:readline/promises";import ue from"dotenv";import de from"@logto/node";import{createInterface as me}from"node:readline";import{Readable as fe}from"node:stream";import{createGzip as he}from"node:zlib";import{Router as ge}from"express";import ve,{WebSocketServer as xe}from"ws";import{minimatch as be}from"minimatch";import ye from"body-parser";import{execFileSync as we}from"node:child_process";const _e="STRING",ke="BOOLEAN",Se="NUMBER",je="ARRAY";function Te(e){return e.replace(/[-_](\w)/g,(e,t)=>t.toUpperCase())}function Ee(e){const t=e.match(/--[\w-]+/g);return t?t[t.length-1]:e.split(/[\s,]+/)[0]}function $e(e){return Te(Ee(e).replace(/^--/,""))}function Oe(e){return Te(e.replace(/[[\]<>]/g,"").replace(/\.\.\.$/,"").trim())}function Re(e,t){if(null==e)return e;switch(t){case ke:{if("boolean"==typeof e)return e;const t=String(e).toLowerCase();return""===t||!["false","0","no","off"].includes(t)&&(!!["true","1","yes","on"].includes(t)||Boolean(e))}case Se:{const t=Number(e);return Number.isNaN(t)?e:t}case je:return Array.isArray(e)?e:String(e).split(",");case _e:return Array.isArray(e)?e:String(e);default:return e}}const Ae={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 Ce{constructor(e,t){this.name=e,this.description=null!=t?t:"",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,t,n={}){return this.options.push({synopsis:e,description:null!=t?t:"",name:$e(e),validator:n.validator,default:n.default,required:!0===n.required,hidden:!0===n.hidden}),this}argument(e,t,n={}){return this.args.push({synopsis:e,description:null!=t?t:"",name:Oe(e),validator:n.validator,default:n.default}),this}action(e){return this._action=e,this}isHelpCommand(){return!1}}class Ne{constructor(){this.STRING=_e,this.BOOLEAN=ke,this.NUMBER=Se,this.ARRAY=je,this._version=void 0,this._description=void 0,this._name="needle-cloud",this._commands=[],this._exitOverride=!1,this._testHooks=null}version(e){return this._version=e,this}description(e){return this._description=e,this}name(e){return this._name=e,this}command(e,t){const n=new Ce(e,t);return this._commands.push(n),n}getCommands(){return[...this._commands]}exitOverride(){return this._exitOverride=!0,this}async run(e){const t=this._build();try{return await t.parseAsync(null!=e?e:process.argv.slice(2),{from:"user"})}catch(t){var n,o,i;if(this._exitOverride)throw t;const a=null!=(n=null==(o=this._testHooks)?void 0:o.error)?n:e=>console.error(e);return a(`error: ${t instanceof Error&&t.message||String(t)}`),(null!=e?e:process.argv).includes("--verbose")&&t instanceof Error&&t.stack&&a(t.stack),null!=(i=this._testHooks)&&i.exit?this._testHooks.exit(1):process.exit(1)}}_build(){const e=new i(this._name);this._version&&e.version(this._version),this._description&&e.description(this._description),this._exitOverride&&e.exitOverride();const t=new Map,n=o=>{if(1===o.length)return e;const a=o.slice(0,-1).join(" ");let s=t.get(a);return s||(s=new i(o[o.length-2]),this._exitOverride&&s.exitOverride(),t.set(a,s),n(o.slice(0,-1)).addCommand(s)),s};for(const e of this._commands){const o=e.name.split(/\s+/),s=t.get(e.name),r=null!=s?s:new i(o[o.length-1]);t.set(e.name,r),r.description(e.description);for(const t of e._aliases)r.alias(t);for(const t of e._helpTexts)r.addHelpText("after","\n"+t);this._exitOverride&&r.exitOverride(),e.strictOptions||(r.allowUnknownOption(!0),r.allowExcessArguments(!0));for(const t of e.args)r.argument(t.synopsis,t.description);for(const t of e.options){let e=t.synopsis;t.validator&&!Ee(e).startsWith("--no-")&&(e=/[<[]/.test(e)?e.replace(/<([\w-]+)>/,"[$1]"):`${e} [value]`);const n=new a(e,t.description);t.hidden&&n.hideHelp(),t.required&&n.makeOptionMandatory(),r.addOption(n)}e._action&&r.action(async(...t)=>{var n;const o=null!=(n=t[e.args.length])?n:{},i={};e.args.forEach((e,n)=>{const o=t[n];i[e.name]=Re(void 0===o?e.default:o,e.validator)});const a={};for(const t of e.options){if(Ee(t.synopsis).startsWith("--no-")){const e=Te(Ee(t.synopsis).replace(/^--no-/,""));a[t.name]=!1===o[e];continue}const e=o[t.name];a[t.name]=Re(void 0===e?t.default:e,t.validator)}for(const[e,t]of Object.entries(o))e in a||(a[e]=t);await e._action({args:i,options:a,logger:Ae,command:r})}),s||n(o).addCommand(r,{hidden:!e.visible})}return e}}function Pe(){return new Ne}var Ie={program:Pe(),createProgram:Pe,STRING:_e,BOOLEAN:ke,NUMBER:Se,ARRAY:je};const Ue={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",preview_invitation:"/v1/account/preview_invitation",update_payment_method:"/v1/account/update_payment_method",get_billing:"/v1/account/get_billing",generate_invoice:"/v1/account/generate_invoice",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"},payment:{info:"/v1/payment/info",create:"/v1/payment/create"},ai:{llmstxt:"/v1/ai/llmstxt",chat:"/v1/ai/chat",chat_personal:"/v1/ai/chat/personal",list_chats:"/v1/ai/chat/list",chat_image:"/v1/ai/chat/image",chat_tool_result:"/v1/ai/chat/tool-result",chat_stop:"/v1/ai/chat/stop",ask:"/v1/ai/ask",completions:"/v1/ai/completions",evaluate:"/v1/ai/evaluate",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"},projects:{create:"/v1/projects/create",list:"/v1/projects/list",head:"/v1/projects/head",push:"/v1/projects/push",pull:"/v1/projects/pull",delete:"/v1/projects/delete",restore:"/v1/projects/restore",archive:"/v1/projects/archive",unarchive:"/v1/projects/unarchive",clone:"/v1/projects/clone",update:"/v1/projects/update",blobs_check:"/v1/projects/blobs/check",blobs_upload:"/v1/projects/blobs/upload",blobs_complete:"/v1/projects/blobs/complete",blobs_download:"/v1/projects/blobs/download",revisions:"/v1/projects/revisions",revisions_update:"/v1/projects/revisions/update",deployments:"/v1/projects/deployments",promote:"/v1/projects/promote",promotions:"/v1/projects/promotions"},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 ze(e){const t={authorization:"Bearer "+e.authToken};return e.org&&(t["x-needle-cloud-org"]=e.org),e.roles&&(t.roles=e.roles.join(",")),e.roles_org&&(t.roles_org=e.roles_org.join(",")),t}const Le={credentials:"omit"};function Fe(e,t){return function(){return e.apply(t,arguments)}}const{toString:De}=Object.prototype,{getPrototypeOf:qe}=Object,{iterator:Be,toStringTag:Me}=Symbol,We=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ge=(e,t)=>{let n=e;const o=[];for(;null!=n&&n!==Object.prototype;){if(-1!==o.indexOf(n))return!1;if(o.push(n),We(n,t))return!0;n=qe(n)}return!1},He=(Je=Object.create(null),e=>{const t=De.call(e);return Je[t]||(Je[t]=t.slice(8,-1).toLowerCase())});var Je;const Ve=e=>(e=e.toLowerCase(),t=>He(t)===e),Ke=e=>t=>typeof t===e,{isArray:Ye}=Array,Ze=Ke("undefined");function Xe(e){return null!==e&&!Ze(e)&&null!==e.constructor&&!Ze(e.constructor)&&tt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Qe=Ve("ArrayBuffer"),et=Ke("string"),tt=Ke("function"),nt=Ke("number"),ot=e=>null!==e&&"object"==typeof e,it=e=>{if(!ot(e))return!1;const t=qe(e);return!(null!==t&&t!==Object.prototype&&null!==qe(t)||Ge(e,Me)||Ge(e,Be))},at=Ve("Date"),st=Ve("File"),rt=Ve("Blob"),ct=Ve("FileList"),lt=Ve("Set"),pt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},ut=void 0!==pt.FormData?pt.FormData:void 0,dt=Ve("URLSearchParams"),[mt,ft,ht,gt]=["ReadableStream","Request","Response","Headers"].map(Ve);function vt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let o,i;if("object"!=typeof e&&(e=[e]),Ye(e))for(o=0,i=e.length;o<i;o++)t.call(null,e[o],o,e);else{if(Xe(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let s;for(o=0;o<a;o++)s=i[o],t.call(null,e[s],s,e)}}function xt(e,t){if(Xe(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o,i=n.length;for(;i-- >0;)if(o=n[i],t===o.toLowerCase())return o;return null}const bt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,yt=e=>!Ze(e)&&e!==bt,wt=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&qe(Uint8Array)),_t=Ve("HTMLFormElement"),{propertyIsEnumerable:kt}=Object.prototype,St=Ve("RegExp"),jt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};vt(n,(n,i)=>{let a;!1!==(a=t(n,i,e))&&(o[i]=a||n)}),Object.defineProperties(e,o)},Tt=Ve("AsyncFunction"),Et=($t="function"==typeof setImmediate,Ot=tt(bt.postMessage),$t?setImmediate:Ot?(Rt=`axios@${Math.random()}`,At=[],bt.addEventListener("message",({source:e,data:t})=>{e===bt&&t===Rt&&At.length&&At.shift()()},!1),e=>{At.push(e),bt.postMessage(Rt,"*")}):e=>setTimeout(e));var $t,Ot,Rt,At;const Ct="undefined"!=typeof queueMicrotask?queueMicrotask.bind(bt):"undefined"!=typeof process&&process.nextTick||Et,Nt=e=>null!=e&&tt(e[Be]);var Pt={isArray:Ye,isArrayBuffer:Qe,isBuffer:Xe,isFormData:e=>{if(!e)return!1;if(ut&&e instanceof ut)return!0;const t=qe(e);if(!t||t===Object.prototype)return!1;if(!tt(e.append))return!1;const n=He(e);return"formdata"===n||"object"===n&&tt(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Qe(e.buffer),t},isString:et,isNumber:nt,isBoolean:e=>!0===e||!1===e,isObject:ot,isPlainObject:it,isEmptyObject:e=>{if(!ot(e)||Xe(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:mt,isRequest:ft,isResponse:ht,isHeaders:gt,isUndefined:Ze,isDate:at,isFile:st,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:rt,isRegExp:St,isFunction:tt,isStream:e=>ot(e)&&tt(e.pipe),isURLSearchParams:dt,isTypedArray:wt,isFileList:ct,forEach:vt,merge:function e(...t){const{caseless:n,skipUndefined:o}=yt(this)&&this||{},i={},a=(t,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;const s=n&&"string"==typeof a&&xt(i,a)||a,r=We(i,s)?i[s]:void 0;it(r)&&it(t)?i[s]=e(r,t):it(t)?i[s]=e({},t):Ye(t)?i[s]=t.slice():o&&Ze(t)||(i[s]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||Xe(n))continue;if(vt(n,a),"object"!=typeof n||Ye(n))continue;const o=Object.getOwnPropertySymbols(n);for(let e=0;e<o.length;e++){const t=o[e];kt.call(n,t)&&a(n[t],t)}}return i},extend:(e,t,n,{allOwnKeys:o}={})=>(vt(t,(t,o)=>{n&&tt(t)?Object.defineProperty(e,o,{__proto__:null,value:Fe(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{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,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let i,a,s;const r={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],o&&!o(s,e,t)||r[s]||(t[s]=e[s],r[s]=!0);e=!1!==n&&qe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:He,kindOfTest:Ve,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length);const o=e.indexOf(t,n-=t.length);return-1!==o&&o===n},toArray:e=>{if(!e)return null;if(Ye(e))return e;let t=e.length;if(!nt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Be]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:_t,hasOwnProperty:We,hasOwnProp:We,hasOwnInPrototypeChain:Ge,getSafeProp:(e,t)=>null!=e&&Ge(e,t)?e[t]:void 0,reduceDescriptors:jt,freezeMethods:e=>{jt(e,(t,n)=>{if(tt(e)&&["arguments","caller","callee"].includes(n))return!1;tt(e[n])&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},o=e=>{e.forEach(e=>{n[e]=!0})};return Ye(e)?o(e):o(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:xt,global:bt,isContextDefined:yt,isSpecCompliantForm:function(e){return!!(e&&tt(e.append)&&"FormData"===e[Me]&&e[Be])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(ot(e)){if(t.has(e))return;if(Xe(e))return e;if(!("toJSON"in e)){let o;if(t.add(e),lt(e)){o=[];for(const t of e){const e=n(t);!Ze(e)&&o.push(e)}}else o=Ye(e)?[]:{},vt(e,(e,t)=>{const i=n(e);!Ze(i)&&(o[t]=i)});return t.delete(e),o}}return e};return n(e)},isAsyncFn:Tt,isThenable:e=>e&&(ot(e)||tt(e))&&tt(e.then)&&tt(e.catch),setImmediate:Et,asap:Ct,isIterable:Nt,isSafeIterable:e=>null!=e&&Ge(e,Be)&&Nt(e)};const It=Pt.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"]),Ut=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),zt=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Lt(e,t){return Pt.isArray(e)?e.map(e=>Lt(e,t)):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function Ft(e){const t=Object.create(null);return Pt.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>Lt(e,zt))(e)}),t}const Dt=Symbol("internals");function qt(e){return e&&String(e).trim().toLowerCase()}function Bt(e){return!1===e||null==e?e:Pt.isArray(e)?e.map(Bt):(e=>Lt(e,Ut))(String(e))}const Mt=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Wt(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function Gt(e,t,n,o,i){return Pt.isFunction(o)?o.call(this,t,n):(i&&(t=n),Pt.isString(t)?Pt.isString(o)?-1!==t.indexOf(o):Pt.isRegExp(o)?o.test(t):void 0:void 0)}class Ht{constructor(e){e&&this.set(e)}set(e,t,n){const o=this;function i(e,t,n){const i=qt(t);if(!i)return;const a=Pt.findKey(o,i);(!a||void 0===o[a]||!0===n||void 0===n&&!1!==o[a])&&(o[a||t]=Bt(e))}const a=(e,t)=>Pt.forEach(e,(e,n)=>i(e,n,t));if(Pt.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Pt.isString(e)&&(e=e.trim())&&!(e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))(e))a((e=>{const t={};let n,o,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),o=e.substring(i+1).trim();const a=Pt.hasOwnProp(t,n);!n||a&&Pt.hasOwnProp(It,n)||("set-cookie"===n?a?t[n].push(o):t[n]=[o]:t[n]=a?t[n]+", "+o:o)}),t})(e),t);else if(Pt.isObject(e)&&Pt.isSafeIterable(e)){let n,o,i=Object.create(null);for(const t of e){if(!Pt.isArray(t))throw new TypeError("Object iterator must return a key-value pair");o=t[0],Pt.hasOwnProp(i,o)?(n=i[o],i[o]=Pt.isArray(n)?[...n,t[1]]:[n,t[1]]):i[o]=t[1]}a(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=qt(e)){const n=Pt.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}(e);if(Pt.isFunction(t))return t.call(this,e,n);if(Pt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=qt(e)){const n=Pt.findKey(this,e);return!(!n||void 0===this[n]||t&&!Gt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let o=!1;function i(e){if(e=qt(e)){const i=Pt.findKey(n,e);!i||t&&!Gt(0,n[i],i,t)||(delete n[i],o=!0)}}return Pt.isArray(e)?e.forEach(i):i(e),o}clear(e){const t=Object.keys(this);let n=t.length,o=!1;for(;n--;){const i=t[n];e&&!Gt(0,this[i],i,e,!0)||(delete this[i],o=!0)}return o}normalize(e){const t=this,n={};return Pt.forEach(this,(o,i)=>{const a=Pt.findKey(n,i);if(a)return t[a]=Bt(o),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=Bt(o),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Pt.forEach(this,(n,o)=>{null!=n&&!1!==n&&(t[o]=e&&Pt.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){const e=this.get("set-cookie");return Pt.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let o=0,i=!1,a=!1;function s(e){const i=Wt(n.slice(o,e)),a=i.indexOf("=");if(a<1)return;const s=Wt(i.slice(0,a));if(!Mt.test(s))return;const r=s.toLowerCase();if("__proto__"===r||"constructor"===r||"prototype"===r)return;const c=Wt(i.slice(a+1));t[r]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let o=1;o<t;o++){const i=e.charCodeAt(o);if(34===i)return e;if(92===i&&(o+=1,o>=t))return e;n+=e[o]}return n}(c)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);i?a?a=!1:92===t?a=!0:34===t&&(i=!1):34===t?i=!0:44!==t&&59!==t||(s(e),o=e+1)}return s(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Dt]=this[Dt]={accessors:{}}).accessors,n=this.prototype;function o(e){const o=qt(e);t[o]||(function(e,t){const n=Pt.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{__proto__:null,value:function(e,n,i){return this[o].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[o]=!0)}return Pt.isArray(e)?e.forEach(o):o(e),this}}Ht.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Pt.reduceDescriptors(Ht.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Pt.freezeMethods(Ht);var Jt=Ht;const Vt="[REDACTED ****]";class Kt extends Error{static from(e,t,n,o,i,a){let s=e.message;!s&&Pt.isArray(e.errors)&&e.errors.length&&(s=function(e){return e.errors.map(e=>{try{return function(e){try{return String(e)}catch(e){return""}}(e&&e.message?e.message:e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const r=new Kt(s,t||e.code,n,o,i);return Object.defineProperty(r,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),r.name=e.name,null!=e.status&&null==r.status&&(r.status=e.status),a&&Object.assign(r,a),r}constructor(e,t,n,o,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),i&&(this.response=i,this.status=i.status)}toJSON(){const e=this.config,t=e&&Pt.hasOwnProp(e,"redact")?e.redact:void 0,n=Pt.isArray(t)&&t.length>0?function(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),o=[],i=e=>{if(null===e||"object"!=typeof e)return e;if(Pt.isBuffer(e))return e;if(-1!==o.indexOf(e))return;let t;if(e instanceof Jt&&(e=e.toJSON()),o.push(e),Pt.isArray(e))t=[],e.forEach((e,n)=>{const o=i(e);Pt.isUndefined(o)||(t[n]=o)});else{if(!Pt.isPlainObject(e)&&function(e){if(Pt.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Pt.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return o.pop(),e;t=Object.create(null);for(const[o,a]of Object.entries(e)){const e=n.has(o.toLowerCase())?Vt:i(a);Pt.isUndefined(e)||(t[o]=e)}}return o.pop(),t};return i(e)}(e,t):Pt.toJSONObject(e);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:n,code:this.code,status:this.status}}}Kt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Kt.ERR_BAD_OPTION="ERR_BAD_OPTION",Kt.ECONNABORTED="ECONNABORTED",Kt.ETIMEDOUT="ETIMEDOUT",Kt.ECONNREFUSED="ECONNREFUSED",Kt.ERR_NETWORK="ERR_NETWORK",Kt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Kt.ERR_DEPRECATED="ERR_DEPRECATED",Kt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Kt.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Kt.ERR_CANCELED="ERR_CANCELED",Kt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Kt.ERR_INVALID_URL="ERR_INVALID_URL",Kt.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var Yt=Kt,Zt=H.Stream,Xt=Qt;function Qt(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}G.inherits(Qt,Zt),Qt.create=function(e,t){var n=new this;for(var o in t=t||{})n[o]=t[o];n.source=e;var i=e.emit;return e.emit=function(){return n._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),n.pauseStream&&e.pause(),n},Object.defineProperty(Qt.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),Qt.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},Qt.prototype.resume=function(){this._released||this.release(),this.source.resume()},Qt.prototype.pause=function(){this.source.pause()},Qt.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},Qt.prototype.pipe=function(){var e=Zt.prototype.pipe.apply(this,arguments);return this.resume(),e},Qt.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))},Qt.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 en=H.Stream,tn=nn;function nn(){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}G.inherits(nn,en),nn.create=function(e){var t=new this;for(var n in e=e||{})t[n]=e[n];return t},nn.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},nn.prototype.append=function(e){if(nn.isStreamLike(e)){if(!(e instanceof Xt)){var t=Xt.create(e,{maxDataSize:Infinity,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=t}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},nn.prototype.pipe=function(e,t){return en.prototype.pipe.call(this,e,t),this.resume(),e},nn.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}}},nn.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){nn.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},nn.prototype._pipeNext=function(e){if(this._currentStream=e,nn.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});this.write(e),this._getNext()},nn.prototype._handleErrors=function(e){var t=this;e.on("error",function(e){t._emitError(e)})},nn.prototype.write=function(e){this.emit("data",e)},nn.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},nn.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")},nn.prototype.end=function(){this._reset(),this.emit("end")},nn.prototype.destroy=function(){this._reset(),this.emit("close")},nn.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},nn.prototype._checkDataSize=function(){this._updateDataSize(),this.dataSize<=this.maxDataSize||this._emitError(new Error("DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded."))},nn.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},nn.prototype._emitError=function(e){this._reset(),this.emit("error",e)};var on="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function an(e){var t={exports:{}};return e(t,t.exports),t.exports}var sn={"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}},rn=an(function(e,t){var n,o,i,a=x.extname,s=/^\s*([^;\s]*)(?:;|\s|$)/,r=/^text\//i;function c(e){if(!e||"string"!=typeof e)return!1;var t=s.exec(e),n=t&&sn[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!r.test(t[1]))&&"UTF-8"}t.charset=c,t.charsets={lookup:c},t.contentType=function(e){if(!e||"string"!=typeof e)return!1;var n=-1===e.indexOf("/")?t.lookup(e):e;if(!n)return!1;if(-1===n.indexOf("charset")){var o=t.charset(n);o&&(n+="; charset="+o.toLowerCase())}return n},t.extension=function(e){if(!e||"string"!=typeof e)return!1;var n=s.exec(e),o=n&&t.extensions[n[1].toLowerCase()];return!(!o||!o.length)&&o[0]},t.extensions=Object.create(null),t.lookup=function(e){if(!e||"string"!=typeof e)return!1;var n=a("x."+e).toLowerCase().substr(1);return n&&t.types[n]||!1},t.types=Object.create(null),n=t.extensions,o=t.types,i=["nginx","apache",void 0,"iana"],Object.keys(sn).forEach(function(e){var t=sn[e],a=t.extensions;if(a&&a.length){n[e]=a;for(var s=0;s<a.length;s++){var r=a[s];if(o[r]){var c=i.indexOf(sn[o[r]].source),l=i.indexOf(t.source);if("application/octet-stream"!==o[r]&&(c>l||c===l&&"application/"===o[r].substr(0,12)))continue}o[r]=e}}})}),cn=function(e){var t="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;t?t(e):setTimeout(e,0)},ln=function(e){var t=!1;return cn(function(){t=!0}),function(n,o){t?e(n,o):cn(function(){e(n,o)})}},pn=function(e){Object.keys(e.jobs).forEach(un.bind(e)),e.jobs={}};function un(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var dn=function(e,t,n,o){var i=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[i]=function(e,t,n,o){return 2==e.length?e(n,ln(o)):e(n,t,ln(o))}(t,i,e[i],function(e,t){i in n.jobs&&(delete n.jobs[i],e?pn(n):n.results[i]=t,o(e,n.results))})},mn=function(e,t){var n=!Array.isArray(e),o={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};return t&&o.keyedList.sort(n?t:function(n,o){return t(e[n],e[o])}),o},fn=function(e){Object.keys(this.jobs).length&&(this.index=this.size,pn(this),ln(e)(null,this.results))},hn=function(e,t,n,o){var i=mn(e,n);return dn(e,t,i,function n(a,s){a?o(a,s):(i.index++,i.index<(i.keyedList||e).length?dn(e,t,i,n):o(null,i.results))}),fn.bind(i,o)};function gn(e,t){return e<t?-1:e>t?1:0}hn.ascending=gn,hn.descending=function(e,t){return-1*gn(e,t)};var vn=Object,xn=Error,bn=EvalError,yn=RangeError,wn=ReferenceError,_n=SyntaxError,kn=TypeError,Sn=URIError,jn=Math.abs,Tn=Math.floor,En=Math.max,$n=Math.min,On=Math.pow,Rn=Math.round,An=Number.isNaN||function(e){return e!=e},Cn=Object.getOwnPropertyDescriptor;if(Cn)try{Cn([],"length")}catch(e){Cn=null}var Nn=Cn,Pn=Object.defineProperty||!1;if(Pn)try{Pn({},"a",{value:1})}catch(e){Pn=!1}var In,Un=Pn,zn=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var o in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0},Ln="undefined"!=typeof Symbol&&Symbol,Fn="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null,Dn=vn,qn=Dn.getPrototypeOf||null,Bn=Object.prototype.toString,Mn=Math.max,Wn=function(e,t){for(var n=[],o=0;o<e.length;o+=1)n[o]=e[o];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},Gn=Function.prototype.bind||function(e){var t=this;if("function"!=typeof t||"[object Function]"!==Bn.apply(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n,o=function(e,t){for(var n=[],o=1,i=0;o<e.length;o+=1,i+=1)n[i]=e[o];return n}(arguments),i=Mn(0,t.length-o.length),a=[],s=0;s<i;s++)a[s]="$"+s;if(n=Function("binder","return function ("+function(e,t){for(var n="",o=0;o<e.length;o+=1)n+=e[o],o+1<e.length&&(n+=",");return n}(a)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof n){var i=t.apply(this,Wn(o,arguments));return Object(i)===i?i:this}return t.apply(e,Wn(o,arguments))}),t.prototype){var r=function(){};r.prototype=t.prototype,n.prototype=new r,r.prototype=null}return n},Hn=Function.prototype.call,Jn=Function.prototype.apply,Vn="undefined"!=typeof Reflect&&Reflect&&Reflect.apply||Gn.call(Hn,Jn),Kn=kn,Yn=Nn;try{In=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var Zn,Xn=!!In&&Yn&&Yn(Object.prototype,"__proto__"),Qn=Object,eo=Qn.getPrototypeOf,to=Xn&&"function"==typeof Xn.get?function(e){if(e.length<1||"function"!=typeof e[0])throw new Kn("a function is required");return Vn(Gn,Hn,e)}([Xn.get]):"function"==typeof eo&&function(e){return eo(null==e?e:Qn(e))},no=Fn?function(e){return Fn(e)}:qn?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return qn(e)}:to?function(e){return to(e)}:null,oo=Gn.call(Function.prototype.call,Object.prototype.hasOwnProperty),io=xn,ao=bn,so=yn,ro=wn,co=_n,lo=Sn,po=jn,uo=Tn,mo=En,fo=$n,ho=On,go=Rn,vo=Un,xo=oo,bo=Function,yo=function(e){try{return bo('"use strict"; return ('+e+").constructor;")()}catch(e){}},wo=function(){throw new Kn},_o=Yn?function(){try{return wo}catch(e){try{return Yn(arguments,"callee").get}catch(e){return wo}}}():wo,ko="function"==typeof Ln&&"function"==typeof Symbol&&"symbol"==typeof Ln("foo")&&"symbol"==typeof Symbol("bar")&&zn(),So={},jo="undefined"!=typeof Uint8Array&&no?no(Uint8Array):Zn,To={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?Zn:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?Zn:ArrayBuffer,"%ArrayIteratorPrototype%":ko&&no?no([][Symbol.iterator]()):Zn,"%AsyncFromSyncIteratorPrototype%":Zn,"%AsyncFunction%":So,"%AsyncGenerator%":So,"%AsyncGeneratorFunction%":So,"%AsyncIteratorPrototype%":So,"%Atomics%":"undefined"==typeof Atomics?Zn:Atomics,"%BigInt%":"undefined"==typeof BigInt?Zn:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?Zn:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?Zn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?Zn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":io,"%eval%":eval,"%EvalError%":ao,"%Float16Array%":"undefined"==typeof Float16Array?Zn:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?Zn:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?Zn:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?Zn:FinalizationRegistry,"%Function%":bo,"%GeneratorFunction%":So,"%Int8Array%":"undefined"==typeof Int8Array?Zn:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?Zn:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?Zn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ko&&no?no(no([][Symbol.iterator]())):Zn,"%JSON%":"object"==typeof JSON?JSON:Zn,"%Map%":"undefined"==typeof Map?Zn:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&ko&&no?no((new Map)[Symbol.iterator]()):Zn,"%Math%":Math,"%Number%":Number,"%Object%":Dn,"%Object.getOwnPropertyDescriptor%":Yn,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?Zn:Promise,"%Proxy%":"undefined"==typeof Proxy?Zn:Proxy,"%RangeError%":so,"%ReferenceError%":ro,"%Reflect%":"undefined"==typeof Reflect?Zn:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?Zn:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&ko&&no?no((new Set)[Symbol.iterator]()):Zn,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?Zn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ko&&no?no(""[Symbol.iterator]()):Zn,"%Symbol%":ko?Symbol:Zn,"%SyntaxError%":co,"%ThrowTypeError%":_o,"%TypedArray%":jo,"%TypeError%":Kn,"%Uint8Array%":"undefined"==typeof Uint8Array?Zn:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?Zn:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?Zn:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?Zn:Uint32Array,"%URIError%":lo,"%WeakMap%":"undefined"==typeof WeakMap?Zn:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?Zn:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?Zn:WeakSet,"%Function.prototype.call%":Hn,"%Function.prototype.apply%":Jn,"%Object.defineProperty%":vo,"%Object.getPrototypeOf%":qn,"%Math.abs%":po,"%Math.floor%":uo,"%Math.max%":mo,"%Math.min%":fo,"%Math.pow%":ho,"%Math.round%":go,"%Math.sign%":function(e){return An(e)||0===e?e:e<0?-1:1},"%Reflect.getPrototypeOf%":Fn};if(no)try{null.error}catch(e){var Eo=no(no(e));To["%Error.prototype%"]=Eo}var $o=function e(t){var n;if("%AsyncFunction%"===t)n=yo("async function () {}");else if("%GeneratorFunction%"===t)n=yo("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=yo("async function* () {}");else if("%AsyncGenerator%"===t){var o=e("%AsyncGeneratorFunction%");o&&(n=o.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&no&&(n=no(i.prototype))}return To[t]=n,n},Oo={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ro=Gn.call(Hn,Array.prototype.concat),Ao=Gn.call(Jn,Array.prototype.splice),Co=Gn.call(Hn,String.prototype.replace),No=Gn.call(Hn,String.prototype.slice),Po=Gn.call(Hn,RegExp.prototype.exec),Io=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Uo=/\\(\\)?/g,zo=function(e,t){var n,o=e;if(xo(Oo,o)&&(o="%"+(n=Oo[o])[0]+"%"),xo(To,o)){var i=To[o];if(i===So&&(i=$o(o)),void 0===i&&!t)throw new Kn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:i}}throw new co("intrinsic "+e+" does not exist!")},Lo=function(e,t){if("string"!=typeof e||0===e.length)throw new Kn("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new Kn('"allowMissing" argument must be a boolean');if(null===Po(/^%?[^%]*%?$/,e))throw new co("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=No(e,0,1),n=No(e,-1);if("%"===t&&"%"!==n)throw new co("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new co("invalid intrinsic syntax, expected opening `%`");var o=[];return Co(e,Io,function(e,t,n,i){o[o.length]=n?Co(i,Uo,"$1"):t||e}),o}(e),o=n.length>0?n[0]:"",i=zo("%"+o+"%",t),a=i.name,s=i.value,r=!1,c=i.alias;c&&(o=c[0],Ao(n,Ro([0,1],c)));for(var l=1,p=!0;l<n.length;l+=1){var u=n[l],d=No(u,0,1),m=No(u,-1);if(('"'===d||"'"===d||"`"===d||'"'===m||"'"===m||"`"===m)&&d!==m)throw new co("property names with quotes must have matching quotes");if("constructor"!==u&&p||(r=!0),xo(To,a="%"+(o+="."+u)+"%"))s=To[a];else if(null!=s){if(!(u in s)){if(!t)throw new Kn("base intrinsic for "+e+" exists, but the property is not available.");return}if(Yn&&l+1>=n.length){var f=Yn(s,u);s=(p=!!f)&&"get"in f&&!("originalValue"in f.get)?f.get:s[u]}else p=xo(s,u),s=s[u];p&&!r&&(To[a]=s)}}return s}("%Object.defineProperty%",!0),Fo=zn()&&Symbol.toStringTag?Symbol.toStringTag:null,Do=function(e,t){return Object.keys(t).forEach(function(n){e[n]=e[n]||t[n]}),e},qo=Y.parse,Bo=H.Stream;function Mo(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function Wo(e){if(!(this instanceof Wo))return new Wo(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],tn.call(this),e=e||{})this[t]=e[t]}G.inherits(Wo,tn),Wo.LINE_BREAK="\r\n",Wo.DEFAULT_CONTENT_TYPE="application/octet-stream",Wo.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var o=tn.prototype.append.bind(this);if("number"!=typeof t&&null!=t||(t=String(t)),Array.isArray(t))this._error(new Error("Arrays are not supported."));else{var i=this._multiPartHeader(e,t,n),a=this._multiPartFooter();o(i),o(t),o(a),this._trackLength(i,t,n)}},Wo.prototype._trackLength=function(e,t,n){var o=0;null!=n.knownLength?o+=Number(n.knownLength):Buffer.isBuffer(t)?o=t.length:"string"==typeof t&&(o=Buffer.byteLength(t)),this._valueLength+=o,this._overheadLength+=Buffer.byteLength(e)+Wo.LINE_BREAK.length,t&&(t.path||t.readable&&xo(t,"httpVersion")||t instanceof Bo)&&(n.knownLength||this._valuesToMeasure.push(t))},Wo.prototype._lengthRetriever=function(e,t){xo(e,"fd")?null!=e.end&&Infinity!=e.end&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):s.stat(e.path,function(n,o){n?t(n):t(null,o.size-(e.start?e.start:0))}):xo(e,"httpVersion")?t(null,Number(e.headers["content-length"])):xo(e,"httpModule")?(e.on("response",function(n){e.pause(),t(null,Number(n.headers["content-length"]))}),e.resume()):t("Unknown stream")},Wo.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var o,i=this._getContentDisposition(t,n),a=this._getContentType(t,n),s="",r={"Content-Disposition":["form-data",'name="'+Mo(e)+'"'].concat(i||[]),"Content-Type":[].concat(a||[])};for(var c in"object"==typeof n.header&&Do(r,n.header),r)if(xo(r,c)){if(null==(o=r[c]))continue;Array.isArray(o)||(o=[o]),o.length&&(s+=c+": "+o.join("; ")+Wo.LINE_BREAK)}return"--"+this.getBoundary()+Wo.LINE_BREAK+s+Wo.LINE_BREAK},Wo.prototype._getContentDisposition=function(e,t){var n;if("string"==typeof t.filepath?n=x.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?n=x.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&xo(e,"httpVersion")&&(n=x.basename(e.client._httpMessage.path||"")),n)return'filename="'+Mo(n)+'"'},Wo.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e&&e.name&&(n=rn.lookup(e.name)),!n&&e&&e.path&&(n=rn.lookup(e.path)),!n&&e&&e.readable&&xo(e,"httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=rn.lookup(t.filepath||t.filename)),!n&&e&&"object"==typeof e&&(n=Wo.DEFAULT_CONTENT_TYPE),n},Wo.prototype._multiPartFooter=function(){return function(e){var t=Wo.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},Wo.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Wo.LINE_BREAK},Wo.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)xo(e,t)&&(n[t.toLowerCase()]=e[t]);return n},Wo.prototype.setBoundary=function(e){if("string"!=typeof e)throw new TypeError("FormData boundary must be a string");this._boundary=e},Wo.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Wo.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,o=this._streams.length;n<o;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(Wo.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Wo.prototype._generateBoundary=function(){this._boundary="--------------------------"+Z.randomBytes(12).toString("hex")},Wo.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},Wo.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Wo.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?function(e,t,n){for(var o=mn(e);o.index<(o.keyedList||e).length;)dn(e,t,o,function(e,t){e?n(e,t):0!==Object.keys(o.jobs).length||n(null,o.results)}),o.index++;fn.bind(o,n)}(this._valuesToMeasure,this._lengthRetriever,function(n,o){n?e(n):(o.forEach(function(e){t+=e}),e(null,t))}):process.nextTick(e.bind(this,null,t))},Wo.prototype.submit=function(e,t){var n,o,i={method:"post"};return"string"==typeof e?(e=qo(e),o=Do({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(o=Do(e,i)).port||(o.port="https:"===o.protocol?443:80),o.headers=this.getHeaders(e.headers),n="https:"===o.protocol?K.request(o):V.request(o),this.getLength(function(e,o){if(e&&"Unknown stream"!==e)this._error(e);else if(o&&n.setHeader("Content-Length",o),this.pipe(n),t){var i,a=function(e,o){return n.removeListener("error",a),n.removeListener("response",i),t.call(this,e,o)};i=a.bind(this,null),n.on("error",a),n.on("response",i)}}.bind(this)),n},Wo.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Wo.prototype.toString=function(){return"[object FormData]"},function(e,t){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(void 0!==n&&"boolean"!=typeof n||void 0!==o&&"boolean"!=typeof o)throw new Kn("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");!Fo||!n&&xo(e,Fo)||(Lo?Lo(e,Fo,{configurable:!o,enumerable:!1,value:t,writable:!1}):e[Fo]=t)}(Wo.prototype,"FormData");var Go=Wo,Ho={isBufferAvailable:()=>"undefined"!=typeof Buffer,from:e=>Buffer.from(e)};const Jo=100;function Vo(e){return Pt.isPlainObject(e)||Pt.isArray(e)}function Ko(e){return Pt.endsWith(e,"[]")?e.slice(0,-2):e}function Yo(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ko(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Zo=Pt.toFlatObject(Pt,{},null,function(e){return/^is[A-Z]/.test(e)});function Xo(e,t,n){if(!Pt.isObject(e))throw new TypeError("target must be an object");t=t||new(Go||FormData);const o=(n=Pt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Pt.isUndefined(t[e])})).metaTokens,i=n.visitor||m,a=n.dots,s=n.indexes,r=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?Jo:n.maxDepth,l=r&&Pt.isSpecCompliantForm(t),p=[];if(!Pt.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(Pt.isDate(e))return e.toISOString();if(Pt.isBoolean(e))return e.toString();if(!l&&Pt.isBlob(e))throw new Yt("Blob is not supported. Use a Buffer instead.");if(Pt.isArrayBuffer(e)||Pt.isTypedArray(e)){if(l&&"function"==typeof r)return new r([e]);if(Ho&&Ho.isBufferAvailable())return Ho.from(e);throw new Yt("Blob is not supported. Use a Buffer instead.",Yt.ERR_NOT_SUPPORT)}return e}function d(e){if(e>c)throw new Yt("Object is too deeply nested ("+e+" levels). Max depth: "+c,Yt.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(e,n,i){let r=e;if(Pt.isReactNative(t)&&Pt.isReactNativeBlob(e))return t.append(Yo(i,n,a),u(e)),!1;if(e&&!i&&"object"==typeof e)if(Pt.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e,t){if(Infinity===c)return JSON.stringify(e);const n=[];return JSON.stringify(e,function(e,t){if(!Pt.isObject(t))return t;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(t),d(1+n.length-1),t})}(e);else if(Pt.isArray(e)&&function(e){return Pt.isArray(e)&&!e.some(Vo)}(e)||(Pt.isFileList(e)||Pt.endsWith(n,"[]"))&&(r=Pt.toArray(e)))return n=Ko(n),r.forEach(function(e,o){!Pt.isUndefined(e)&&null!==e&&t.append(!0===s?Yo([n],o,a):null===s?n:n+"[]",u(e))}),!1;return!!Vo(e)||(t.append(Yo(i,n,a),u(e)),!1)}const f=Object.assign(Zo,{defaultVisitor:m,convertValue:u,isVisitable:Vo});if(!Pt.isObject(e))throw new TypeError("data must be an object");return function e(n,o,a=0){if(!Pt.isUndefined(n)){if(d(a),-1!==p.indexOf(n))throw new Error("Circular reference detected in "+o.join("."));p.push(n),Pt.forEach(n,function(n,s){!0===(!(Pt.isUndefined(n)||null===n)&&i.call(t,n,Pt.isString(s)?s.trim():s,o,f))&&e(n,o?o.concat(s):[s],a+1)}),p.pop()}}(e),t}function Qo(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ei(e,t){this._pairs=[],e&&Xo(e,this,t)}const ti=ei.prototype;function ni(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oi(e,t,n){if(!t)return e;e=e||"";const o=Pt.isFunction(n)?{serialize:n}:n,i=Pt.getSafeProp(o,"encode")||ni,a=Pt.getSafeProp(o,"serialize");let s;if(s=a?a(t,o):Pt.isURLSearchParams(t)?t.toString():new ei(t,o).toString(i),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}ti.append=function(e,t){this._pairs.push([e,t])},ti.toString=function(e){const t=e?t=>e.call(this,t,Qo):Qo;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var ii=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Pt.forEach(this.handlers,function(t){null!==t&&e(t)})}},ai={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},si=Y.URLSearchParams;const ri="abcdefghijklmnopqrstuvwxyz",ci="0123456789",li={DIGIT:ci,ALPHA:ri,ALPHA_DIGIT:ri+ri.toUpperCase()+ci};var pi={isNode:!0,classes:{URLSearchParams:si,FormData:Go,Blob:"undefined"!=typeof Blob&&Blob||null},ALPHABET:li,generateString:(e=16,t=li.ALPHA_DIGIT)=>{let n="";const{length:o}=t,i=new Uint32Array(e);Z.randomFillSync(i);for(let a=0;a<e;a++)n+=t[i[a]%o];return n},protocols:["http","https","file","data"]};const ui="undefined"!=typeof window&&"undefined"!=typeof document,di="object"==typeof navigator&&navigator||void 0,mi=ui&&(!di||["ReactNative","NativeScript","NS"].indexOf(di.product)<0);var fi={__proto__:null,hasBrowserEnv:ui,hasStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,hasStandardBrowserEnv:mi,navigator:di,origin:ui&&window.location.href||"http://localhost",...pi};const hi=Jo;function gi(e){if(e>hi)throw new Yt("FormData field is too deeply nested ("+e+" levels). Max depth: "+hi,Yt.ERR_FORM_DATA_DEPTH_EXCEEDED)}function vi(e){function t(e,n,o,i){gi(i);let a=e[i++];if("__proto__"===a)return!0;const s=Number.isFinite(+a),r=i>=e.length;return a=!a&&Pt.isArray(o)?o.length:a,r?(o[a]=Pt.hasOwnProp(o,a)?Pt.isArray(o[a])?o[a].concat(n):[o[a],n]:n,!s):(Pt.hasOwnProp(o,a)&&Pt.isObject(o[a])||(o[a]=[]),t(e,n,o[a],i)&&Pt.isArray(o[a])&&(o[a]=function(e){const t={},n=Object.keys(e);let o;const i=n.length;let a;for(o=0;o<i;o++)a=n[o],t[a]=e[a];return t}(o[a])),!s)}if(Pt.isFormData(e)&&Pt.isFunction(e.entries)){const n={};return Pt.forEachEntry(e,(e,o)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let o;for(;null!==(o=n.exec(e));)gi(t.length),t.push("[]"===o[0]?"":o[1]||o[0]);return t}(e),o,n,0)}),n}return null}const xi=(e,t)=>null!=e&&Pt.hasOwnProp(e,t)?e[t]:void 0,bi={transitional:ai,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",o=n.indexOf("application/json")>-1,i=Pt.isObject(e);if(i&&Pt.isHTMLForm(e)&&(e=new FormData(e)),Pt.isFormData(e))return o?JSON.stringify(vi(e)):e;if(Pt.isArrayBuffer(e)||Pt.isBuffer(e)||Pt.isStream(e)||Pt.isFile(e)||Pt.isBlob(e)||Pt.isReadableStream(e))return e;if(Pt.isArrayBufferView(e))return e.buffer;if(Pt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){const t=xi(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Xo(e,new fi.classes.URLSearchParams,{visitor:function(e,t,n,o){return fi.isNode&&Pt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((a=Pt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=xi(this,"env"),o=n&&n.FormData;return Xo(a?{"files[]":e}:e,o&&new o,t)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(Pt.isString(e))try{return(0,JSON.parse)(e),Pt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=xi(this,"transitional")||bi.transitional,n=t&&t.forcedJSONParsing,o=xi(this,"responseType"),i="json"===o;if(Pt.isResponse(e)||Pt.isReadableStream(e))return e;if(e&&Pt.isString(e)&&(n&&!o||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,xi(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw Yt.from(e,Yt.ERR_BAD_RESPONSE,this,null,xi(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:fi.classes.FormData,Blob:fi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Pt.forEach(["delete","get","head","post","put","patch","query"],e=>{bi.headers[e]={}});var yi=bi;function wi(e,t){const n=this||yi,o=t||n,i=Jt.from(o.headers);let a=o.data;return Pt.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function _i(e){return!(!e||!e.__CANCEL__)}var ki=class extends Yt{constructor(e,t,n){super(null==e?"canceled":e,Yt.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Si(e,t,n){const o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(new Yt("Request failed with status code "+n.status,n.status>=400&&n.status<500?Yt.ERR_BAD_REQUEST:Yt.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const ji=/^https?:(?!\/\/)/i,Ti=/[\t\n\r]/g;function Ei(e,t){if("string"==typeof e){const n=function(e){return function(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}(e).replace(Ti,"")}(e);if(ji.test(n))throw new Yt(`Invalid URL ${JSON.stringify(function(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Vt}@`),n=t.indexOf("#"),o=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Vt}`);return-1===n?o:`${o}#${i=t.slice(n+1),i?i.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${Vt}`):i}`;var i}(n))}: missing "//" after protocol`,Yt.ERR_INVALID_URL,t)}}function $i(e,t,n,o){Ei(t,o);let i=!function(e){return"string"==typeof e&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(i||!1===n)?(Ei(e,o),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}var Oi={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function Ri(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var Ai=1e3,Ci=60*Ai,Ni=60*Ci,Pi=24*Ni,Ii=7*Pi,Ui=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\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(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return n*Ii;case"days":case"day":case"d":return n*Pi;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Ni;case"minutes":case"minute":case"mins":case"min":case"m":return n*Ci;case"seconds":case"second":case"secs":case"sec":case"s":return n*Ai;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=Pi?zi(e,t,Pi,"day"):t>=Ni?zi(e,t,Ni,"hour"):t>=Ci?zi(e,t,Ci,"minute"):t>=Ai?zi(e,t,Ai,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=Pi?Math.round(e/Pi)+"d":t>=Ni?Math.round(e/Ni)+"h":t>=Ci?Math.round(e/Ci)+"m":t>=Ai?Math.round(e/Ai)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function zi(e,t,n,o){var i=t>=1.5*n;return Math.round(e/n)+" "+o+(i?"s":"")}var Li=function(e){function t(e){let o,i,a,s=null;function r(...e){if(!r.enabled)return;const n=r,i=Number(new Date);n.diff=i-(o||i),n.prev=o,n.curr=i,o=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(o,i)=>{if("%%"===o)return"%";a++;const s=t.formatters[i];return"function"==typeof s&&(o=s.call(n,e[a]),e.splice(a,1),a--),o}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return r.namespace=e,r.useColors=t.useColors(),r.color=t.selectColor(e),r.extend=n,r.destroy=t.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,a=t.enabled(e)),a),set:e=>{s=e}}),"function"==typeof t.init&&t.init(r),r}function n(e,n){const o=t(this.namespace+(void 0===n?":":n)+e);return o.log=this.log,o}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const o=("string"==typeof e?e:"").split(/[\s,]+/),i=o.length;for(n=0;n<i;n++)o[n]&&("-"===(e=o[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,o;for(n=0,o=t.skips.length;n<o;n++)if(t.skips[n].test(e))return!1;for(n=0,o=t.names.length;n<o;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Ui,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},Fi=an(function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(o++,"%c"===e&&(i=o))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.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+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Li(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}),Di=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",o=t.indexOf(n+e),i=t.indexOf("--");return-1!==o&&(-1===i||o<i)};const{env:qi}=process;let Bi;function Mi(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Wi(e,t){if(0===Bi)return 0;if(Di("color=16m")||Di("color=full")||Di("color=truecolor"))return 3;if(Di("color=256"))return 2;if(e&&!t&&void 0===Bi)return 0;const n=Bi||0;if("dumb"===qi.TERM)return n;if("win32"===process.platform){const e=oe.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in qi)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in qi)||"codeship"===qi.CI_NAME?1:n;if("TEAMCITY_VERSION"in qi)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(qi.TEAMCITY_VERSION)?1:0;if("truecolor"===qi.COLORTERM)return 3;if("TERM_PROGRAM"in qi){const e=parseInt((qi.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(qi.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(qi.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(qi.TERM)||"COLORTERM"in qi?1:n}Di("no-color")||Di("no-colors")||Di("color=false")||Di("color=never")?Bi=0:(Di("color")||Di("colors")||Di("color=true")||Di("color=always"))&&(Bi=1),"FORCE_COLOR"in qi&&(Bi="true"===qi.FORCE_COLOR?1:"false"===qi.FORCE_COLOR?0:0===qi.FORCE_COLOR.length?1:Math.min(parseInt(qi.FORCE_COLOR,10),3));var Gi={supportsColor:function(e){return Mi(Wi(e,e&&e.isTTY))},stdout:Mi(Wi(!0,ne.isatty(1))),stderr:Mi(Wi(!0,ne.isatty(2)))},Hi=an(function(e,t){t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let o=0;o<n.length;o++)e.inspectOpts[n[o]]=t.inspectOpts[n[o]]},t.log=function(...e){return process.stderr.write(G.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:o,useColors:i}=this;if(i){const t=this.color,i="[3"+(t<8?t:"8;5;"+t),a=` ${i};1m${o} [0m`;n[0]=a+n[0].split("\n").join("\n"+a),n.push(i+"m+"+e.exports.humanize(this.diff)+"[0m")}else n[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+o+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):ne.isatty(process.stderr.fd)},t.destroy=G.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{Gi&&(Gi.stderr||Gi).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let o=process.env[t];return o=!!/^(yes|on|true|enabled)$/i.test(o)||!/^(no|off|false|disabled)$/i.test(o)&&("null"===o?null:Number(o)),e[n]=o,e},{}),e.exports=Li(t);const{formatters:n}=e.exports;n.o=function(e){return this.inspectOpts.colors=this.useColors,G.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},n.O=function(e){return this.inspectOpts.colors=this.useColors,G.inspect(e,this.inspectOpts)}}),Ji=an(function(e){e.exports="undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Fi:Hi}),Vi=/*#__PURE__*/Object.defineProperty({default:function(e){return function(t,n){return new Promise((o,i)=>{e.call(this,t,n,(e,t)=>{e?i(e):o(t)})})}}},"__esModule",{value:!0}),Ki=on&&on.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const Yi=Ki(Ji),Zi=Ki(Vi),Xi=Yi.default("agent-base");function Qi(){const{stack:e}=new Error;return"string"==typeof e&&e.split("\n").some(e=>-1!==e.indexOf("(https.js:")||-1!==e.indexOf("node:https:"))}function ea(e,t){return new ea.Agent(e,t)}!function(e){e.Agent=class extends se.EventEmitter{constructor(e,t){super();let n=t;"function"==typeof e?this.callback=e:e&&(n=e),this.timeout=null,n&&"number"==typeof n.timeout&&(this.timeout=n.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=Infinity,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return"number"==typeof this.explicitDefaultPort?this.explicitDefaultPort:Qi()?443:80}set defaultPort(e){this.explicitDefaultPort=e}get protocol(){return"string"==typeof this.explicitProtocol?this.explicitProtocol:Qi()?"https:":"http:"}set protocol(e){this.explicitProtocol=e}callback(e,t,n){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(e,t){const n=Object.assign({},t);"boolean"!=typeof n.secureEndpoint&&(n.secureEndpoint=Qi()),null==n.host&&(n.host="localhost"),null==n.port&&(n.port=n.secureEndpoint?443:80),null==n.protocol&&(n.protocol=n.secureEndpoint?"https:":"http:"),n.host&&n.path&&delete n.path,delete n.agent,delete n.hostname,delete n._defaultAgent,delete n.defaultPort,delete n.createConnection,e._last=!0,e.shouldKeepAlive=!1;let o=!1,i=null;const a=n.timeout||this.timeout,s=t=>{e._hadError||(e.emit("error",t),e._hadError=!0)},r=()=>{i=null,o=!0;const e=new Error(`A "socket" was not created for HTTP request before ${a}ms`);e.code="ETIMEOUT",s(e)},c=e=>{o||(null!==i&&(clearTimeout(i),i=null),s(e))},l=t=>{if(o)return;if(null!=i&&(clearTimeout(i),i=null),a=t,Boolean(a)&&"function"==typeof a.addRequest)return Xi("Callback returned another Agent instance %o",t.constructor.name),void t.addRequest(e,n);var a;if(t)return t.once("free",()=>{this.freeSocket(t,n)}),void e.onSocket(t);const r=new Error(`no Duplex stream was returned to agent-base for \`${e.method} ${e.path}\``);s(r)};if("function"==typeof this.callback){this.promisifiedCallback||(this.callback.length>=3?(Xi("Converting legacy callback function to promise"),this.promisifiedCallback=Zi.default(this.callback)):this.promisifiedCallback=this.callback),"number"==typeof a&&a>0&&(i=setTimeout(r,a)),"port"in n&&"number"!=typeof n.port&&(n.port=Number(n.port));try{Xi("Resolving socket for %o request: %o",n.protocol,`${e.method} ${e.path}`),Promise.resolve(this.promisifiedCallback(e,n)).then(l,c)}catch(e){Promise.reject(e).catch(c)}}else s(new Error("`callback` is not defined"))}freeSocket(e,t){Xi("Freeing socket %o %o",e.constructor.name,t),e.destroy()}destroy(){Xi("Destroying agent %o",this.constructor.name)}},e.prototype=e.Agent.prototype}(ea||(ea={}));var ta=ea;const na=(on&&on.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ji).default("https-proxy-agent:parse-proxy-response");var oa=/*#__PURE__*/Object.defineProperty({default:function(e){return new Promise((t,n)=>{let o=0;const i=[];function a(){const n=e.read();n?function(e){i.push(e),o+=e.length;const n=Buffer.concat(i,o);if(-1===n.indexOf("\r\n\r\n"))return na("have not received end of HTTP headers yet..."),void a();const s=n.toString("ascii",0,n.indexOf("\r\n")),r=+s.split(" ")[1];na("got proxy server response: %o",s),t({statusCode:r,buffered:n})}(n):e.once("readable",a)}function s(e){na("onclose had error %o",e)}function r(){na("onend")}e.on("error",function t(o){e.removeListener("end",r),e.removeListener("error",t),e.removeListener("close",s),e.removeListener("readable",a),na("onerror %o",o),n(o)}),e.on("close",s),e.on("end",r),a()})}},"__esModule",{value:!0}),ia=on&&on.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,a){function s(e){try{c(o.next(e))}catch(e){a(e)}}function r(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,r)}c((o=o.apply(e,t||[])).next())})},aa=on&&on.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const sa=aa(Q),ra=aa(ee),ca=aa(Y),la=aa(te),pa=aa(Ji),ua=aa(oa),da=pa.default("https-proxy-agent:agent");function ma(e){e.resume()}const fa=(on&&on.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(/*#__PURE__*/Object.defineProperty({default:class extends ta.Agent{constructor(e){let t;if(t="string"==typeof e?ca.default.parse(e):e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");da("creating new HttpsProxyAgent instance: %o",t),super(t);const n=Object.assign({},t);var o;this.secureProxy=t.secureProxy||"string"==typeof(o=n.protocol)&&/^https:?$/i.test(o),n.host=n.hostname||n.host,"string"==typeof n.port&&(n.port=parseInt(n.port,10)),!n.port&&n.host&&(n.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in n)&&(n.ALPNProtocols=["http 1.1"]),n.host&&n.path&&(delete n.path,delete n.pathname),this.proxy=n}callback(e,t){return ia(this,void 0,void 0,function*(){const{proxy:n,secureProxy:o}=this;let i;o?(da("Creating `tls.Socket`: %o",n),i=ra.default.connect(n)):(da("Creating `net.Socket`: %o",n),i=sa.default.connect(n));const a=Object.assign({},n.headers);let s=`CONNECT ${t.host}:${t.port} HTTP/1.1\r\n`;n.auth&&(a["Proxy-Authorization"]=`Basic ${Buffer.from(n.auth).toString("base64")}`);let{host:r,port:c,secureEndpoint:l}=t;(function(e,t){return Boolean(!t&&80===e||t&&443===e)})(c,l)||(r+=`:${c}`),a.Host=r,a.Connection="close";for(const e of Object.keys(a))s+=`${e}: ${a[e]}\r\n`;const p=ua.default(i);i.write(`${s}\r\n`);const{statusCode:u,buffered:d}=yield p;if(200===u){if(e.once("socket",ma),t.secureEndpoint){da("Upgrading socket connection to TLS");const e=t.servername||t.host;return ra.default.connect(Object.assign(Object.assign({},function(e,...t){const n={};let o;for(o in e)t.includes(o)||(n[o]=e[o]);return n}(t,"host","hostname","path","port")),{socket:i,servername:e}))}return i}i.destroy();const m=new sa.default.Socket({writable:!1});return m.readable=!0,e.once("socket",e=>{da("replaying proxy buffer for failed request"),la.default(e.listenerCount("data")>0),e.push(d),e.push(null)}),m})}}},"__esModule",{value:!0}));function ha(e){return new fa.default(e)}!function(e){e.HttpsProxyAgent=fa.default,e.prototype=fa.default.prototype}(ha||(ha={}));var ga,va,xa,ba,ya=ha,wa=function(){if(!ga){try{ga=Ji("follow-redirects")}catch(e){}"function"!=typeof ga&&(ga=function(){})}ga.apply(null,arguments)},_a=Y.URL,ka=H.Writable;va="undefined"!=typeof process,xa="undefined"!=typeof window&&"undefined"!=typeof document,ba=Ga(Error.captureStackTrace),va||!xa&&ba||console.warn("The follow-redirects package should be excluded from browser builds.");var Sa=!1;try{te(new _a(""))}catch(e){Sa="ERR_INVALID_URL"===e.code}var ja=["Authorization","Proxy-Authorization","Cookie"],Ta=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Ea=["abort","aborted","connect","error","socket","timeout"],$a=Object.create(null);Ea.forEach(function(e){$a[e]=function(t,n,o){this._redirectable.emit(e,t,n,o)}});var Oa=Ba("ERR_INVALID_URL","Invalid URL",TypeError),Ra=Ba("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Aa=Ba("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Ra),Ca=Ba("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Na=Ba("ERR_STREAM_WRITE_AFTER_END","write after end"),Pa=ka.prototype.destroy||za;function Ia(e,t){ka.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(e){try{n._processResponse(e)}catch(e){n.emit("error",e instanceof Ra?e:new Ra({cause:e}))}},this._headerFilter=new RegExp("^(?:"+ja.concat(e.sensitiveHeaders).map(Ha).join("|")+")$","i"),this._performRequest()}function Ua(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach(function(o){var i=o+":",a=n[i]=e[o],s=t[o]=Object.create(a);Object.defineProperties(s,{request:{value:function(e,o,a){return _a&&e instanceof _a?e=Da(e):Wa(e)?e=Da(La(e)):(a=o,o=Fa(e),e={protocol:i}),Ga(o)&&(a=o,o=null),(o=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,o)).nativeProtocols=n,Wa(o.host)||Wa(o.hostname)||(o.hostname="::1"),te.equal(o.protocol,i,"protocol mismatch"),wa("options",o),new Ia(o,a)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,n){var o=s.request(e,t,n);return o.end(),o},configurable:!0,enumerable:!0,writable:!0}})}),t}function za(){}function La(e){var t;if(Sa)t=new _a(e);else if(!Wa((t=Fa(Y.parse(e))).protocol))throw new Oa({input:e});return t}function Fa(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new Oa({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new Oa({input:e.href||e});return e}function Da(e,t){var n=t||{};for(var o of Ta)n[o]=e[o];return n.hostname.startsWith("[")&&(n.hostname=n.hostname.slice(1,-1)),""!==n.port&&(n.port=Number(n.port)),n.path=n.search?n.pathname+n.search:n.pathname,n}function qa(e,t){var n;for(var o in t)e.test(o)&&(n=t[o],delete t[o]);return null==n?void 0:String(n).trim()}function Ba(e,t,n){function o(n){Ga(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return o.prototype=new(n||Error),Object.defineProperties(o.prototype,{constructor:{value:o,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),o}function Ma(e,t){for(var n of Ea)e.removeListener(n,$a[n]);e.on("error",za),e.destroy(t)}function Wa(e){return"string"==typeof e||e instanceof String}function Ga(e){return"function"==typeof e}function Ha(e){return e.replace(/[\]\\/()*+?.$]/g,"\\$&")}(Ia.prototype=Object.create(ka.prototype)).abort=function(){Ma(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},Ia.prototype.destroy=function(e){return Ma(this._currentRequest,e),Pa.call(this,e),this},Ia.prototype.write=function(e,t,n){if(this._ending)throw new Na;if(!(Wa(e)||"object"==typeof(o=e)&&"length"in o))throw new TypeError("data should be a string, Buffer or Uint8Array");var o;Ga(t)&&(n=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n)):(this.emit("error",new Ca),this.abort()):n&&n()},Ia.prototype.end=function(e,t,n){if(Ga(e)?(n=e,e=t=null):Ga(t)&&(n=t,t=null),e){var o=this,i=this._currentRequest;this.write(e,t,function(){o._ended=!0,i.end(null,null,n)}),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},Ia.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},Ia.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},Ia.prototype.setTimeout=function(e,t){var n=this;function o(t){t.setTimeout(e),t.removeListener("timeout",t.destroy),t.addListener("timeout",t.destroy)}function i(t){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout(function(){n.emit("timeout"),a()},e),o(t)}function a(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",a),n.removeListener("error",a),n.removeListener("response",a),n.removeListener("close",a),t&&n.removeListener("timeout",t),n.socket||n._currentRequest.removeListener("socket",i)}return t&&this.on("timeout",t),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){Ia.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}}),["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Ia.prototype,e,{get:function(){return this._currentRequest[e]}})}),Ia.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.sensitiveHeaders instanceof Array||(e.sensitiveHeaders=[]),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},Ia.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var n=e.slice(0,-1);this._options.agent=this._options.agents[n]}var o=this._currentRequest=t.request(this._options,this._onNativeResponse);for(var i of(o._redirectable=this,Ea))o.on(i,$a[i]);if(this._currentUrl=/^\//.test(this._options.path)?Y.format(this._options):this._options.path,this._isRedirect){var a=0,s=this,r=this._requestBodyBuffers;!function e(t){if(o===s._currentRequest)if(t)s.emit("error",t);else if(a<r.length){var n=r[a++];o.finished||o.write(n.data,n.encoding,e)}else s._ended&&o.end()}()}},Ia.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n,o=e.headers.location;if(!o||!1===this._options.followRedirects||t<300||t>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(Ma(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Aa;var i=this._options.beforeRedirect;i&&(n=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var a=this._options.method;((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],qa(/^content-/i,this._options.headers));var s=qa(/^host$/i,this._options.headers),r=La(this._currentUrl),c=s||r.host,l=/^\w+:/.test(o)?this._currentUrl:Y.format(Object.assign(r,{host:c})),p=function(e,t){return Sa?new _a(e,t):La(Y.resolve(t,e))}(o,l);wa("redirecting to",p.href),this._isRedirect=!0,Da(p,this._options),(p.protocol!==r.protocol&&"https:"!==p.protocol||p.host!==c&&!function(e,t){te(Wa(e)&&Wa(t));var n=e.length-t.length-1;return n>0&&"."===e[n]&&e.endsWith(t)}(p.host,c))&&qa(this._headerFilter,this._options.headers),Ga(i)&&(i(this._options,{headers:e.headers,statusCode:t},{url:l,method:a,headers:n}),this._sanitizeOptions(this._options)),this._performRequest()};var Ja=Ua({http:V,https:K});Ja.wrap=Ua;const Va="1.19.0";function Ka(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}const Ya=/^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/,Za=["content-type","content-length"];function Xa(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{Za.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}const Qa=Symbol("internals");var es=class extends H.Transform{constructor(e){super({readableHighWaterMark:(e=Pt.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(e,t)=>!Pt.isUndefined(t[e]))).chunkSize});const t=this[Qa]={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&&(t.isCaptured||(t.isCaptured=!0))})}_read(e){const t=this[Qa];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){const o=this[Qa],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,t)=>{const n=Buffer.byteLength(e);o.bytesSeen+=n,o.bytes+=n,o.isCaptured&&this.emit("progress",o.bytesSeen),this.push(e)?process.nextTick(t):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(t)}},p=(e,t)=>{const n=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(()=>{t(null,e)},s-m);p<d&&(d=p)}d&&n>d&&n-d>c&&(u=e.subarray(d),e=e.subarray(0,d)),l(e,u?()=>{process.nextTick(t,null,u)}:t)};p(e,function e(t,o){if(t)return n(t);o?p(o,e):n(null)})}};const{asyncIterator:ts}=Symbol;var ns=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[ts]?yield*e[ts]():yield e};const os=fi.ALPHABET.ALPHA_DIGIT+"-_",is="function"==typeof TextEncoder?new TextEncoder:new G.TextEncoder,as="\r\n",ss=is.encode(as);class rs{constructor(e,t){const{escapeName:n}=this.constructor,o=Pt.isString(t);let i=`Content-Disposition: form-data; name="${n(e)}"${!o&&t.name?`; filename="${n(t.name)}"`:""}${as}`;o?t=is.encode(String(t).replace(/\r?\n|\r\n?/g,as)):i+=`Content-Type: ${String(t.type||"application/octet-stream").replace(/[\r\n]/g,"")}${as}`,this.headers=is.encode(i+as),this.contentLength=o?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+2,this.name=e,this.value=t}async*encode(){yield this.headers;const{value:e}=this;Pt.isTypedArray(e)?yield e:yield*ns(e),yield ss}static escapeName(e){return String(e).replace(/[\r\n"]/g,e=>({"\r":"%0D","\n":"%0A",'"':"%22"}[e]))}}var cs=class extends H.Transform{__transform(e,t,n){this.push(e),n()}_transform(e,t,n){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,t)}this.__transform(e,t,n)}},ls=(e,t)=>Pt.isAsyncFn(e)?function(...n){const o=n.pop();e.apply(this,n).then(e=>{try{t?o(null,...t(e)):o(null,e)}catch(e){o(e)}},o)}:e;const ps=new Set(["localhost","0.0.0.0"]),us=e=>{const t=e.split(".");return 4===t.length&&"127"===t[0]&&t.every(e=>/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255)},ds=e=>{if(/^0[xX][0-9a-fA-F]+$/.test(e)){const t=parseInt(e.slice(2),16);return Number.isFinite(t)?t:null}if(e.length>1&&/^0[0-7]+$/.test(e)){const t=parseInt(e,8);return Number.isFinite(t)?t:null}if(e.length>1&&/^0[0-9]+$/.test(e))return null;if(/^[0-9]+$/.test(e)){const t=parseInt(e,10);return Number.isFinite(t)?t:null}return null},ms=e=>/^0{1,4}$/.test(e),fs=e=>!!e&&(!!ps.has(e)||!!us(e)||!!(e=>{if("::"===e)return!0;const t=e.indexOf("::");if(-1!==t){if(t!==e.lastIndexOf("::"))return!1;const n=e.slice(0,t),o=e.slice(t+2),i=n?n.split(":"):[],a=o?o.split(":"):[];return i.length+a.length<8&&i.every(ms)&&a.every(ms)}const n=e.split(":");return 8===n.length&&n.every(ms)})(e)||(e=>{if("::1"===e)return!0;const t=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return us(t[1]);const n=e.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(n){const e=parseInt(n[1],16);return e>=32512&&e<=32767}const o=e.split(":");if(8===o.length){for(let e=0;e<7;e++)if(!/^0+$/.test(o[e]))return!1;return/^0*1$/.test(o[7])}return!1})(e)),hs={http:80,https:443,ws:80,wss:443,ftp:21},gs=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,vs=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,xs=e=>{if(!e)return e;"["===e.charAt(0)&&"]"===e.charAt(e.length-1)&&(e=e.slice(1,-1));const t=e.replace(/\.+$/,""),n=(e=>{if("string"!=typeof e||!e||-1!==e.indexOf(":"))return e;let t=e;if("["===t.charAt(0)&&"]"===t.charAt(t.length-1)&&(t=t.slice(1,-1)),t=t.replace(/\.+$/,""),!/^[0-9.xXa-fA-F]+$/.test(t))return e;const n=t.split(".");if(n.some(e=>""===e))return e;if(4===n.length){const t=n.map(ds);return t.some(e=>null===e||e<0||e>255)?e:t.join(".")}if(n.length>4)return e;if(1===n.length)return e;const o=n.slice(0,-1),i=4-o.length,a=ds(n[n.length-1]);if(null===a)return e;if(a<0||a>(1<<8*i)-1)return e;const s=new Array(i).fill(0);for(let e=i-1,t=a;e>=0;e--,t>>=8)s[e]=255&t;const r=o.map(ds);return r.some(e=>null===e||e<0||e>255)?e:[...r,...s].join(".")})(t);return n!==t?n:(e=>{if("string"!=typeof e||-1===e.indexOf(":"))return e;const t=e.match(gs);if(t)return t[1];const n=e.match(vs);if(n){const e=parseInt(n[1],16),t=parseInt(n[2],16);return`${e>>8}.${255&e}.${t>>8}.${255&t}`}return e})(t)},bs=(e,t,n=3)=>{let o=0;const i=function(e,t){e=e||10;const n=new Array(e),o=new Array(e);let i,a=0,s=0;return t=void 0!==t?t:1e3,function(r){const c=Date.now(),l=o[s];i||(i=c),n[a]=r,o[a]=c;let p=s,u=0;for(;p!==a;)u+=n[p++],p%=e;if(a=(a+1)%e,a===s&&(s=(s+1)%e),c-i<t)return;const d=l&&c-l;return d?Math.round(1e3*u/d):void 0}}(50,250);return function(n,a){let s,r,c=0,l=1e3/a;const p=(n,a=Date.now())=>{c=a,s=null,r&&(clearTimeout(r),r=null),(n=>{if(!n||"number"!=typeof n.loaded)return;const a=n.loaded,s=n.lengthComputable?n.total:void 0,r=Math.max(0,null!=s?Math.min(a,s):a),c=Math.max(0,r-o),l=i(c);o=Math.max(o,r),e({loaded:r,total:s,progress:s?r/s:void 0,bytes:c,rate:l||void 0,estimated:l&&s?(s-r)/l:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})})(...n)};return[(...e)=>{const t=Date.now(),n=t-c;n>=l?p(e,t):(s=e,r||(r=setTimeout(()=>{r=null,p(s)},l-n)))},()=>s&&p(s)]}(0,n)},ys=(e,t)=>{const n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},ws=(e,t=Pt.asap)=>(...n)=>t(()=>e(...n)),_s=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,ks=(e,t,n)=>t+2<n&&_s(e.charCodeAt(t+1))&&_s(e.charCodeAt(t+2)),Ss=e=>e<=57?e-48:(223&e)-55,js=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,Ts=e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)},Es=e=>{const t=e.length;let n=0,o=0,i=!1;for(let s=0;s<t;s++){let r=e.charCodeAt(s);37===r&&ks(e,s,t)&&(r=16*Ss(e.charCodeAt(s+1))+Ss(e.charCodeAt(s+2)),s+=2),9!==(a=r)&&10!==a&&12!==a&&13!==a&&32!==a&&(61!==r?!js(r)||o>0?i=!0:n++:o++)}var a;return i||o>2||o>0&&(n+o)%4!=0||n%4==1?Ts(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)},$s=(e,t)=>{if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const o=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(o))return t(i);let a=0;for(let e=0,t=i.length;e<t;e++){const n=i.charCodeAt(e);if(37===n&&ks(i,e,t))a+=1,e+=2;else if(n<128)a+=1;else if(n<2048)a+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=i.charCodeAt(e+1);t>=56320&&t<=57343?(a+=4,e++):a+=3}else a+=3}return a},Os={flush:le.constants.Z_SYNC_FLUSH,finishFlush:le.constants.Z_SYNC_FLUSH},Rs={flush:le.constants.BROTLI_OPERATION_FLUSH,finishFlush:le.constants.BROTLI_OPERATION_FLUSH},As={flush:le.constants.ZSTD_e_flush,finishFlush:le.constants.ZSTD_e_flush},Cs=Pt.isFunction(le.createBrotliDecompress),Ns=Pt.isFunction(le.createZstdDecompress),Ps="gzip, compress, deflate"+(Cs?", br":""),Is=Ps+(Ns?", zstd":""),Us="undefined"!=typeof process&&process.nextTick?process.nextTick.bind(process):Pt.asap,{http:zs,https:Ls}=Ja,Fs=/https:?/,Ds=Symbol("axios.http.socketListener"),qs=Symbol("axios.http.currentReq"),Bs=Symbol("axios.http.installedTunnel"),Ms=new Map,Ws=new WeakMap,Gs={22:21,24:5},Hs=fi.protocols.map(e=>e+":"),Js=e=>{if(!Pt.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},Vs=(e,[t,n])=>(e.on("end",n).on("error",n),t),Ks=new class{constructor(){this.sessions=Object.create(null)}getSession(e,t){t=Object.assign({sessionTimeout:1e3},t);let n=this.sessions[e];if(n){let e=n.length;for(let o=0;o<e;o++){const[e,i]=n[o];if(!e.destroyed&&!e.closed&&G.isDeepStrictEqual(i,t))return e}}const o=ce.connect(e,t);let i,a;const s=()=>{if(i)return;i=!0,a&&(clearTimeout(a),a=null);let t=n,s=t.length,r=s;for(;r--;)if(t[r][0]===o)return 1===s?delete this.sessions[e]:t.splice(r,1),void(o.closed||o.close())},r=o.request,{sessionTimeout:c}=t;if(null!=c){let e=0;o.request=function(){const t=r.apply(this,arguments);return e++,a&&(clearTimeout(a),a=null),t.once("close",()=>{--e||(a=setTimeout(()=>{a=null,s()},c))}),t}}o.once("close",s);let l=[o,t];return n?n.push(l):n=this.sessions[e]=[l],o}};function Ys(e,t,n){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.auth&&e.beforeRedirects.auth(e),e.beforeRedirects.sensitiveHeaders&&e.beforeRedirects.sensitiveHeaders(e,n),e.beforeRedirects.config&&e.beforeRedirects.config(e,t,n)}function Zs(e,t,n,o,i,a){let s=t;const r=function(e,t,n){return Fs.test(e.protocol)?n||K.globalAgent:t||V.globalAgent}(e,a,i);if(!s&&!1!==s&&!function(e,t=process.versions&&process.versions.node){if(!function(e=process.versions&&process.versions.node){if(!e)return!1;const[t,n]=e.split(".").map(e=>Number(e));return!(!Number.isInteger(t)||!Number.isInteger(n))&&(t>24||null!=Gs[t]&&n>=Gs[t])}(t))return!1;const n=e&&e.options;return Boolean(n&&Pt.hasOwnProp(n,"proxyEnv")&&null!=n.proxyEnv)}(r)){const e=function(e){var t=("string"==typeof e?function(e){try{return new URL(e)}catch{return null}}(e):e)||{},n=t.protocol,o=t.host,i=t.port;if("string"!=typeof o||!o||"string"!=typeof n)return"";if(n=n.split(":",1)[0],!function(e,t){var n=Ri("no_proxy").toLowerCase();return!n||"*"!==n&&n.split(/[,\s]/).every(function(n){if(!n)return!0;var o=n.match(/^(.+):(\d+)$/),i=o?o[1]:n,a=o?parseInt(o[2]):0;return!(!a||a===t)||(/^[.*]/.test(i)?("*"===i.charAt(0)&&(i=i.slice(1)),!e.endsWith(i)):e!==i)})}(o=o.replace(/:\d*$/,""),i=parseInt(i)||Oi[n]||0))return"";var a=Ri(n+"_proxy")||Ri("all_proxy");return a&&-1===a.indexOf("://")&&(a=n+"://"+a),a}(n);e&&(function(e){let t;try{t=new URL(e)}catch(e){return!1}const n=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!n)return!1;if("*"===n)return!0;const o=Number.parseInt(t.port,10)||hs[t.protocol.split(":",1)[0]]||0,i=xs(t.hostname.toLowerCase());return n.split(/[\s,]+/).some(e=>{if(!e)return!1;if("*"===e)return!0;let[t,n]=(e=>{let t=e,n=0;if("["===t.charAt(0)){const e=t.indexOf("]");if(-1!==e){const o=t.slice(1,e),i=t.slice(e+1);return":"===i.charAt(0)&&/^\d+$/.test(i.slice(1))&&(n=Number.parseInt(i.slice(1),10)),[o,n]}}const o=t.indexOf(":"),i=t.lastIndexOf(":");return-1!==o&&o===i&&/^\d+$/.test(t.slice(i+1))&&(n=Number.parseInt(t.slice(i+1),10),t=t.slice(0,i)),[t,n]})(e);return t=xs(t),!!t&&(!n||n===o)&&("*"===t.charAt(0)&&(t=t.slice(1)),"."===t.charAt(0)?i.endsWith(t):i===t||fs(i)&&fs(t))})}(n)||(s=new URL(e)))}if(o&&e.headers)for(const t of Object.keys(e.headers))"proxy-authorization"===t.toLowerCase()&&delete e.headers[t];if(o&&e.agent&&e.agent[Bs]&&(e.agent=void 0),s){const t=s instanceof URL,o=e=>t||Pt.hasOwnProp(s,e)?s[e]:void 0,a=o("username"),r=o("password");let c=Pt.hasOwnProp(s,"auth")?s.auth:void 0;if(a&&(c=(a||"")+":"+(r||"")),c){const e="object"==typeof c,t=e&&Pt.hasOwnProp(c,"username")?c.username:void 0,n=e&&Pt.hasOwnProp(c,"password")?c.password:void 0;if(Boolean(t||n))c=(t||"")+":"+(n||"");else if(e)throw new Yt("Invalid proxy authorization",Yt.ERR_BAD_OPTION,{proxy:s})}if(Fs.test(e.protocol)){if(!(i instanceof ya)){const t=o("hostname")||o("host"),n=o("port"),a=o("protocol"),s=a?a.includes(":")?a:`${a}:`:"http:",r=t&&t.includes(":")&&!t.startsWith("[")?`[${t}]`:t,l=new URL(`${s}//${r}${n?":"+n:""}`),p={protocol:l.protocol,hostname:l.hostname.replace(/^\[|\]$/g,""),port:l.port,auth:c&&"string"==typeof c?c:void 0};"https:"===l.protocol&&(p.ALPNProtocols=["http/1.1"]);const u=function(e,t){const n=e.protocol+"//"+e.hostname+":"+(e.port||"")+"#"+(e.auth||""),o=t?Ws.get(t)||Ws.set(t,new Map).get(t):Ms;let i=o.get(n);if(i)return i;const a=t&&t.options?{...t.options,...e}:e;if(i=new ya(a),t&&t.options){const e={...t.options},n=i.callback;i.callback=function(t,o){return n.call(this,t,{...e,...o})}}return i[Bs]=!0,o.set(n,i),i}(p,i);e.agent=u,e.agents&&(e.agents.https=u)}}else{if(c){const t=Buffer.from(c,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+t}let t=!1;for(const n of Object.keys(e.headers))if("host"===n.toLowerCase()){t=!0;break}t||(e.headers.host=e.hostname+(e.port?":"+e.port:""));const i=o("hostname")||o("host");e.hostname=i,e.host=i,e.port=o("port"),e.path=n;const a=o("protocol");a&&(e.protocol=a.includes(":")?a:`${a}:`)}}e.beforeRedirects.proxy=function(e){Zs(e,t,e.href,!0,i,a)}}const Xs="undefined"!=typeof process&&"process"===Pt.kindOf(process),Qs=(e,t)=>(({address:e,family:t})=>{if(!Pt.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}})(Pt.isObject(e)?e:{address:e,family:t}),er={request(e,t){const n=e.protocol+"//"+e.hostname+":"+(e.port||("https:"===e.protocol?443:80)),{http2Options:o,headers:i}=e,a=Ks.getSession(n,o),{HTTP2_HEADER_SCHEME:s,HTTP2_HEADER_METHOD:r,HTTP2_HEADER_PATH:c,HTTP2_HEADER_STATUS:l}=ce.constants,p={[s]:e.protocol.replace(":",""),[r]:e.method,[c]:e.path};Pt.forEach(i,(e,t)=>{":"!==t.charAt(0)&&(p[t]=e)});const u=a.request(p);return u.once("response",e=>{const n=u,o=(e=Object.assign({},e))[l];delete e[l],n.headers=e,n.statusCode=+o,t(n)}),u}};var tr,nr,or=Xs&&function(e){return t=async function(t,n,o){const i=t=>Pt.getSafeProp(e,t),a=i("transitional")||ai;let s=i("data"),r=i("lookup"),c=i("family"),l=i("httpVersion");void 0===l&&(l=1);let p=i("http2Options");const u=i("httpAgent"),d=i("httpsAgent"),m=i("proxy"),f=i("responseType"),h=i("responseEncoding"),g=i("socketPath"),v=i("method").toUpperCase(),x=i("maxRedirects"),y=i("maxBodyLength"),w=i("maxContentLength"),_=i("decompress");let k,S,j,T=!1;if(l=+l,Number.isNaN(l))throw TypeError(`Invalid protocol version: '${e.httpVersion}' is not a number`);if(1!==l&&2!==l)throw TypeError(`Unsupported protocol version '${l}'`);const E=2===l;if(r){const e=ls(r,e=>Pt.isArray(e)?e:[e]);r=(t,n,o)=>{e(t,n,(e,t,i)=>{if(e)return o(e);const a=Pt.isArray(t)?t.map(e=>Qs(e)):[Qs(t,i)];n.all?o(e,a):o(e,a[0].address,a[0].family)})}}const $=new re;function O(t){try{$.emit("abort",!t||t.type?new ki(null,e,S):t)}catch(e){}}function R(){j&&(clearTimeout(j),j=null)}$.once("abort",n);const A=()=>{R(),e.cancelToken&&e.cancelToken.unsubscribe(O),e.signal&&e.signal.removeEventListener("abort",O),$.removeAllListeners()};(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(O),e.signal&&(e.signal.aborted?O():e.signal.addEventListener("abort",O))),o((e,t)=>{if(k=!0,R(),t)return T=!0,void A();const{data:n}=e;if(n instanceof H.Readable||n instanceof H.Duplex){const e=H.finished(n,()=>{e(),A()})}else A()});const C=$i(i("baseURL"),i("url"),i("allowAbsoluteUrls"),e),N=new URL(C,g?"http://localhost":fi.hasBrowserEnv?fi.origin:void 0),P=N.protocol||Hs[0];if("data:"===P){if(w>-1){const t=function(e){return $s(e,Ts)}(String(i("url")||C||""));if(t>w)return n(new Yt("maxContentLength size of "+w+" exceeded",Yt.ERR_BAD_RESPONSE,e))}let o;if("GET"!==v)return Si(t,n,{status:405,statusText:"method not allowed",headers:{},config:e});try{o=function(e,t,n){const o=n&&n.Blob||fi.classes.Blob,i=Ka(e);if(void 0===t&&o&&(t=!0),"data"===i){e=i.length?e.slice(i.length+1):e;const n=Ya.exec(e);if(!n)throw new Yt("Invalid URL",Yt.ERR_INVALID_URL);const a=n[1],s=n[2],r=n[3]?"base64":"utf8",c=n[4];let l="";a?l=s?a+s:a:s&&(l="text/plain"+s);const p="base64"===r?Buffer.from(c,"base64"):Buffer.from(decodeURIComponent(c),r);if(t){if(!o)throw new Yt("Blob is not supported",Yt.ERR_NOT_SUPPORT);return new o([p],{type:l})}return p}throw new Yt("Unsupported protocol "+i,Yt.ERR_NOT_SUPPORT)}(i("url"),"blob"===f,{Blob:e.env&&e.env.Blob})}catch(t){throw Yt.from(t,Yt.ERR_BAD_REQUEST,e)}return"text"===f?(o=o.toString(h),h&&"utf8"!==h||(o=Pt.stripBOM(o))):"stream"===f&&(o=H.Readable.from(o)),Si(t,n,{data:o,status:200,statusText:"OK",headers:new Jt,config:e})}if(-1===Hs.indexOf(P))return n(new Yt("Unsupported protocol "+P,Yt.ERR_BAD_REQUEST,e));const I=Jt.from(e.headers).normalize();I.set("User-Agent","axios/"+Va,!1);const{onUploadProgress:U,onDownloadProgress:z}=e,L=e.maxRate;let F,D;if(Pt.isSpecCompliantForm(s)){const e=I.getContentType(/boundary=([-_\w\d]{10,70})/i);s=((e,t,n)=>{const{tag:o="form-data-boundary",size:i=25,boundary:a=o+"-"+fi.generateString(i,os)}=n||{};if(!Pt.isFormData(e))throw new TypeError("FormData instance required");if(a.length<1||a.length>70)throw new Error("boundary must be 1-70 characters long");const s=is.encode("--"+a+as),r=is.encode("--"+a+"--"+as);let c=r.byteLength;const l=Array.from(e.entries()).map(([e,t])=>{const n=new rs(e,t);return c+=n.size,n});c+=s.byteLength*l.length,c=Pt.toFiniteNumber(c);const p={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(c)&&(p["Content-Length"]=c),t&&t(p),J.from(async function*(){for(const e of l)yield s,yield*e.encode();yield r}())})(s,e=>{I.set(e)},{tag:`axios-${Va}-boundary`,boundary:e&&e[1]||void 0})}else if(Pt.isFormData(s)&&Pt.isFunction(s.getHeaders)&&s.getHeaders!==Object.prototype.getHeaders){if(Xa(I,s.getHeaders(),i("formDataHeaderPolicy")),!I.hasContentLength())try{const e=await G.promisify(s.getLength).call(s);Number.isFinite(e)&&e>=0&&I.setContentLength(e)}catch(e){}}else if(Pt.isBlob(s)||Pt.isFile(s))s.size&&I.setContentType(s.type||"application/octet-stream"),I.setContentLength(s.size||0),s=H.Readable.from(ns(s));else if(s&&!Pt.isStream(s)){if(Buffer.isBuffer(s));else if(Pt.isArrayBuffer(s))s=Buffer.from(new Uint8Array(s));else{if(!Pt.isString(s))return n(new Yt("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Yt.ERR_BAD_REQUEST,e));s=Buffer.from(s,"utf-8")}if(I.setContentLength(s.length,!1),y>-1&&s.length>y)return n(new Yt("Request body larger than maxBodyLength limit",Yt.ERR_BAD_REQUEST,e))}const q=Pt.toFiniteNumber(I.getContentLength());let B;Pt.isArray(L)?(F=L[0],D=L[1]):F=D=L,s&&(U||F)&&(Pt.isStream(s)||(s=H.Readable.from(s,{objectMode:!1})),s=H.pipeline([s,new es({maxRate:Pt.toFiniteNumber(F)})],Pt.noop),U&&s.on("progress",Vs(s,ys(q,bs(ws(U,Us),!1,3)))));const M=i("auth");let W;M&&(B=(Pt.getSafeProp(M,"username")||"")+":"+(Pt.getSafeProp(M,"password")||"")),B||!N.username&&!N.password||(B=Js(N.username)+":"+Js(N.password)),B&&I.delete("authorization");try{W=oi(N.pathname+N.search,i("params"),i("paramsSerializer")).replace(/^\?/,"")}catch(t){return n(Yt.from(t,Yt.ERR_BAD_REQUEST,e,null,null,{url:i("url"),exists:!0}))}I.set("Accept-Encoding",Pt.hasOwnProp(a,"advertiseZstdAcceptEncoding")&&!0===a.advertiseZstdAcceptEncoding?Is:Ps,!1);const Y=Object.assign(Object.create(null),{path:W,method:v,headers:Ft(I),agents:{http:u,https:d},auth:B,protocol:P,family:c,beforeRedirect:Ys,beforeRedirects:Object.create(null),http2Options:p});if(!Pt.isUndefined(r)&&(Y.lookup=r),g){if("string"!=typeof g)return n(new Yt("socketPath must be a string",Yt.ERR_BAD_OPTION_VALUE,e));const t=i("allowedSocketPaths");if(null!=t){const o=Array.isArray(t)?t:[t],i=b(g);if(!o.some(e=>"string"==typeof e&&b(e)===i))return n(new Yt(`socketPath "${g}" is not permitted by allowedSocketPaths`,Yt.ERR_BAD_OPTION_VALUE,e))}Y.socketPath=g}else Y.hostname=N.hostname.startsWith("[")?N.hostname.slice(1,-1):N.hostname,Y.port=N.port,Zs(Y,m,P+"//"+N.hostname+(N.port?":"+N.port:"")+Y.path,!1,d,u);let Z,X=!1,Q=!1;const ee=Fs.test(Y.protocol);if(null==Y.agent&&(Y.agent=ee?d:u),E)Z=er;else{const t=i("transport");if(t)Z=t;else if(0===x)Z=ee?K:V,X=!0;else{Q=!0,Y.sensitiveHeaders=[],x&&(Y.maxRedirects=x);const t=i("beforeRedirect");if(t&&(Y.beforeRedirects.config=t),B){const e=N.origin,t=B;Y.beforeRedirects.auth=function(n){try{new URL(n.href).origin===e&&(n.auth=t)}catch(e){}}}const o=i("sensitiveHeaders");if(null!=o){if(!Pt.isArray(o))return n(new Yt("sensitiveHeaders must be an array of strings",Yt.ERR_BAD_OPTION_VALUE,e));const t=new Set;for(const i of o){if(!Pt.isString(i))return n(new Yt("sensitiveHeaders must be an array of strings",Yt.ERR_BAD_OPTION_VALUE,e));t.add(i.toLowerCase())}t.size&&(Y.sensitiveHeaders=Array.from(t),Y.beforeRedirects.sensitiveHeaders=function(e,n){(function(e,t){if(!t)return!1;try{return new URL(t.url).origin===new URL(e.href).origin}catch(e){return!1}})(e,n)||function(e,t){e&&Object.keys(e).forEach(n=>{t.has(n.toLowerCase())&&delete e[n]})}(e.headers,t)})}Z=ee?Ls:zs}}Y.maxBodyLength=y>-1?y:Infinity,Y.insecureHTTPParser=Boolean(i("insecureHTTPParser")),S=Z.request(Y,function(o){if(R(),S.destroyed)return;const i=[o],a=Pt.toFiniteNumber(o.headers["content-length"]);if(z||D){const e=new es({maxRate:Pt.toFiniteNumber(D)});z&&e.on("progress",Vs(e,ys(a,bs(ws(z,Us),!0,3)))),i.push(e)}let s=o;const r=o.req||S;if(!1!==_&&o.headers["content-encoding"])switch("HEAD"!==v&&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(le.createUnzip(Os)),delete o.headers["content-encoding"];break;case"deflate":i.push(new cs),i.push(le.createUnzip(Os)),delete o.headers["content-encoding"];break;case"br":Cs&&(i.push(le.createBrotliDecompress(Rs)),delete o.headers["content-encoding"]);break;case"zstd":Ns&&(i.push(le.createZstdDecompress(As)),delete o.headers["content-encoding"])}s=i.length>1?H.pipeline(i,Pt.noop):i[0];const c={status:o.statusCode,statusText:o.statusMessage,headers:new Jt(o.headers),config:e,request:r};if("stream"===f){if(w>-1){const t=w,n=s;s=H.Readable.from(async function*(){let o=0;for await(const i of n){if(o+=i.length,o>t)throw new Yt("maxContentLength size of "+t+" exceeded",Yt.ERR_BAD_RESPONSE,e,r);yield i}}(),{objectMode:!1})}c.data=s,Si(t,n,c)}else{const o=[];let i=0;s.on("data",function(t){o.push(t),i+=t.length,w>-1&&i>w&&(T=!0,s.destroy(),O(new Yt("maxContentLength size of "+w+" exceeded",Yt.ERR_BAD_RESPONSE,e,r)))}),s.on("aborted",function(){if(T)return;const t=new Yt("stream has been aborted",Yt.ERR_BAD_RESPONSE,e,r,c);s.destroy(t),n(t)}),s.on("error",function(t){T||n(Yt.from(t,null,e,r,c))}),s.on("end",function(){try{let e=1===o.length?o[0]:Buffer.concat(o);"arraybuffer"!==f&&(e=e.toString(h),h&&"utf8"!==h||(e=Pt.stripBOM(e))),c.data=e}catch(t){return n(Yt.from(t,null,e,c.request,c))}Si(t,n,c)})}$.once("abort",e=>{s.destroyed||(s.emit("error",e),s.destroy())})}),$.once("abort",e=>{S.close?S.close():S.destroy(e)}),S.on("error",function(t){n(Yt.from(t,null,e,S))});const te=new Set;if(S.on("socket",function(e){"function"==typeof e.setKeepAlive&&e.setKeepAlive(!0,6e4),e[Ds]||(e.on("error",function(t){const n=e[qs];n&&!n.destroyed&&n.destroy(t)}),e[Ds]=!0),e[qs]=S,te.add(e)}),S.once("close",function(){R();for(const e of te)e[qs]===S&&(e[qs]=null);te.clear()}),i("timeout")){const t=parseInt(i("timeout"),10);if(Number.isNaN(t))return void O(new Yt("error trying to parse `config.timeout` to int",Yt.ERR_BAD_OPTION_VALUE,e,S));const n=function(){k||O(function(){const t=i("timeout");let n=t?"timeout of "+t+"ms exceeded":"timeout exceeded";const o=i("timeoutErrorMessage");return o&&(n=o),new Yt(n,a.clarifyTimeoutError?Yt.ETIMEDOUT:Yt.ECONNABORTED,e,S)}())};X&&t>0&&(j=setTimeout(n,t)),S.setTimeout(t,n)}else S.setTimeout(0);if(Pt.isStream(s)){let t=!1,n=!1;s.on("end",()=>{t=!0}),s.once("error",e=>{n=!0,S.destroy(e)}),s.on("close",()=>{t||n||O(new ki("Request stream has been aborted",e,S))});let o=s;if(y>-1&&!Q){const t=y;let n=0;o=H.pipeline([s,new H.Transform({transform(o,i,a){if(n+=o.length,n>t)return a(new Yt("Request body larger than maxBodyLength limit",Yt.ERR_BAD_REQUEST,e,S));a(null,o)}})],Pt.noop),o.on("error",e=>{S.destroyed||S.destroy(e)})}o.pipe(S)}else s&&S.write(s),S.end()},new Promise((e,n)=>{let o,i;const a=(e,t)=>{i||(i=!0,o&&o(e,t))},s=e=>{a(e,!0),n(e)};t(t=>{a(t),e(t)},s,e=>o=e).catch(s)});var t},ir=fi.hasStandardBrowserEnv?(tr=new URL(fi.origin),nr=fi.navigator&&/(msie|trident)/i.test(fi.navigator.userAgent),e=>(e=new URL(e,fi.origin),tr.protocol===e.protocol&&tr.host===e.host&&(nr||tr.port===e.port))):()=>!0,ar=fi.hasStandardBrowserEnv?{write(e,t,n,o,i,a,s){if("undefined"==typeof document)return;const r=[`${e}=${encodeURIComponent(t)}`];Pt.isNumber(n)&&r.push(`expires=${new Date(n).toUTCString()}`),Pt.isString(o)&&r.push(`path=${o}`),Pt.isString(i)&&r.push(`domain=${i}`),!0===a&&r.push("secure"),Pt.isString(s)&&r.push(`SameSite=${s}`),document.cookie=r.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const o=t[n].replace(/^\s+/,""),i=o.indexOf("=");if(-1!==i&&o.slice(0,i)===e)try{return decodeURIComponent(o.slice(i+1))}catch(e){return o.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};const sr=e=>e instanceof Jt?{...e}:e,rr=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function cr(e,t){e=e||{},t=t||{};const n=Object.create(null);function o(e,t,n,o){return Pt.isPlainObject(e)&&Pt.isPlainObject(t)?Pt.merge.call({caseless:o},e,t):Pt.isPlainObject(t)?Pt.merge({},t):Pt.isArray(t)?t.slice():t}function i(e,t,n,i){return Pt.isUndefined(t)?Pt.isUndefined(e)?void 0:o(void 0,e,0,i):o(e,t,0,i)}function a(e,t){if(!Pt.isUndefined(t))return o(void 0,t)}function s(e,t){return Pt.isUndefined(t)?Pt.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function r(n,i,a){return Pt.hasOwnProp(t,a)?o(n,i):Pt.hasOwnProp(e,a)?o(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!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,allowedSocketPaths:s,responseEncoding:s,validateStatus:r,headers:(e,t,n)=>i(sr(e),sr(t),0,!0)};return Pt.forEach(rr({...e,...t}),function(o){if("__proto__"===o||"constructor"===o||"prototype"===o)return;const a=Pt.hasOwnProp(c,o)?c[o]:i,s=a(Pt.hasOwnProp(e,o)?e[o]:void 0,Pt.hasOwnProp(t,o)?t[o]:void 0,o);Pt.isUndefined(s)&&a!==r||(n[o]=s)}),Pt.hasOwnProp(t,"validateStatus")&&Pt.isUndefined(t.validateStatus)&&!1===function(n){const o=Pt.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Pt.isUndefined(o)){if(!Pt.isPlainObject(o))return;if(Pt.hasOwnProp(o,n))return o[n]}const i=Pt.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Pt.isPlainObject(i)&&Pt.hasOwnProp(i,n))return i[n]}("validateStatusUndefinedResolves")&&(Pt.hasOwnProp(e,"validateStatus")?n.validateStatus=o(void 0,e.validateStatus):delete n.validateStatus),n}function lr(e){const t=cr({},e),n=e=>Pt.hasOwnProp(t,e)?t[e]:void 0,o=n("data");let i=n("withXSRFToken");const a=n("xsrfHeaderName"),s=n("xsrfCookieName");let r=n("headers");const c=n("auth"),l=n("baseURL"),p=n("allowAbsoluteUrls"),u=n("url");if(t.headers=r=Jt.from(r),t.url=oi($i(l,u,p,t),n("params"),n("paramsSerializer")),c){const t=Pt.getSafeProp(c,"username")||"",n=Pt.getSafeProp(c,"password")||"";try{r.set("Authorization","Basic "+btoa(t+":"+(n?(e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))(n):"")))}catch(t){throw Yt.from(t,Yt.ERR_BAD_OPTION_VALUE,e)}}if(Pt.isFormData(o)&&(fi.hasStandardBrowserEnv||fi.hasStandardBrowserWebWorkerEnv||Pt.isReactNative(o)?r.setContentType(void 0):Pt.isFunction(o.getHeaders)&&Xa(r,o.getHeaders(),n("formDataHeaderPolicy"))),fi.hasStandardBrowserEnv&&(Pt.isFunction(i)&&(i=i(t)),!0===i||null==i&&ir(t.url))){const e=a&&s&&ar.read(s);e&&r.set(a,e)}return t}var pr="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const o=lr(e);let i=o.data;const a=Jt.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=Jt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());Si(function(e){t(e),f()},function(e){n(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&&h.responseURL.startsWith("file:"))&&setTimeout(g)},h.onabort=function(){h&&(n(new Yt("Request aborted",Yt.ECONNABORTED,e,h)),f(),h=null)},h.onerror=function(t){const o=new Yt(t&&t.message?t.message:"Network Error",Yt.ERR_NETWORK,e,h);o.event=t||null,n(o),f(),h=null},h.ontimeout=function(){let t=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";o.timeoutErrorMessage&&(t=o.timeoutErrorMessage),n(new Yt(t,(o.transitional||ai).clarifyTimeoutError?Yt.ETIMEDOUT:Yt.ECONNABORTED,e,h)),f(),h=null},void 0===i&&a.setContentType(null),"setRequestHeader"in h&&Pt.forEach(Ft(a),function(e,t){h.setRequestHeader(t,e)}),Pt.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),u&&"json"!==u&&(h.responseType=o.responseType),m&&([c,p]=bs(m,!0),h.addEventListener("progress",c)),d&&h.upload&&([r,l]=bs(d),h.upload.addEventListener("progress",r),h.upload.addEventListener("loadend",l)),(o.cancelToken||o.signal)&&(s=t=>{h&&(n(!t||t.type?new ki(null,e,h):t),h.abort(),f(),h=null)},o.cancelToken&&o.cancelToken.subscribe(s),o.signal&&(o.signal.aborted?s():o.signal.addEventListener("abort",s)));const v=Ka(o.url);if(v&&!fi.protocols.includes(v))return n(new Yt("Unsupported protocol "+v+":",Yt.ERR_BAD_REQUEST,e)),void f();h.send(i||null)})},ur=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let o=!1;const i=function(e){if(!o){o=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Yt?t:new ki(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,i(new Yt(`timeout of ${t}ms exceeded`,Yt.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>{o||(e.aborted?i.call(e):e.addEventListener("abort",i,{once:!0}))});const{signal:r}=n;return r.unsubscribe=()=>Pt.asap(s),r};const dr=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let o,i=0;for(;i<n;)o=i+t,yield e.slice(i,o),i=o},mr=(e,t,n,o)=>{const i=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*dr(n,t)}(e,t);let a,s=0,r=e=>{a||(a=!0,o&&o(e))};return new ReadableStream({async pull(e){try{const{done:t,value:o}=await i.next();if(t)return r(),void e.close();if(n){let e=s+=o.byteLength;n(e)}e.enqueue(new Uint8Array(o))}catch(e){throw r(e),e}},cancel:e=>(r(e),i.return())},{highWaterMark:2})},{isFunction:fr}=Pt,hr=e=>{if(!Pt.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},gr=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},vr=e=>{const t=null!=Pt.global?Pt.global:globalThis,{ReadableStream:n,TextEncoder:o}=t;e=Pt.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:i,Request:a,Response:s}=e,r=i?fr(i):"function"==typeof fetch,c=fr(a),l=fr(s);if(!r)return!1;const p=r&&fr(n),u=r&&("function"==typeof o?(d=new o,e=>d.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer()));var d;const m=c&&p&&gr(()=>{let e=!1;const t=new a(fi.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),o=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!o}),f=l&&p&&gr(()=>Pt.isReadableStream(new s("").body)),h={stream:f&&(e=>e.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let o=t&&t[e];if(o)return o.call(t);throw new Yt(`Response type '${e}' is not supported`,Yt.ERR_NOT_SUPPORT,n)})});const g=async e=>{if(null==e)return 0;if(Pt.isBlob(e))return e.size;if(Pt.isSpecCompliantForm(e)){const t=new a(fi.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Pt.isArrayBufferView(e)||Pt.isArrayBuffer(e)?e.byteLength:(Pt.isURLSearchParams(e)&&(e+=""),Pt.isString(e)?(await u(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:r,signal:l,cancelToken:u,timeout:d,onDownloadProgress:v,onUploadProgress:x,responseType:b,headers:y,withCredentials:w="same-origin",fetchOptions:_,maxContentLength:k,maxBodyLength:S}=lr(e);const j=Pt.isNumber(k)&&k>-1,T=Pt.isNumber(S)&&S>-1;let E=i||fetch;b=b?(b+"").toLowerCase():"text";let $=ur([l,u&&u.toAbortSignal()],d),O=null;const R=$&&$.unsubscribe&&(()=>{$.unsubscribe()});let A,C=null;const N=()=>new Yt("Request body larger than maxBodyLength limit",Yt.ERR_BAD_REQUEST,e,O);try{let i;const l=Pt.hasOwnProp(e,"auth")?e.auth:void 0;if(l&&(i={username:Pt.getSafeProp(l,"username")||"",password:Pt.getSafeProp(l,"password")||""}),(e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,fi.origin);i||!e.username&&!e.password||(i={username:hr(e.username),password:hr(e.password)}),(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(i&&(y.delete("authorization"),y.set("Authorization","Basic "+btoa((e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))((i.username||"")+":"+(i.password||""))))),j&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){const t="string"==typeof e?e.indexOf("#"):-1;return $s(-1===t?e:e.slice(0,t),Es)}(t);if(n>k)throw new Yt("maxContentLength size of "+k+" exceeded",Yt.ERR_BAD_RESPONSE,e,O)}if(T&&"get"!==n&&"head"!==n){const e=await g(r);if("number"==typeof e&&isFinite(e)&&(A=e,e>S))throw N()}const u=T&&(Pt.isReadableStream(r)||Pt.isStream(r)),d=(e,t,n)=>mr(e,65536,e=>{if(T&&e>S)throw C=N();t&&t(e)},n);if(m&&"get"!==n&&"head"!==n&&(x||u)){if(A=null==A?await(async(e,t)=>{const n=Pt.toFiniteNumber(e.getContentLength());return null==n?g(t):n})(y,r):A,0!==A||u){let e,n=new a(t,{method:"POST",body:r,duplex:"half"});if(Pt.isFormData(r)&&(e=n.headers.get("content-type"))&&y.setContentType(e),n.body){const[e,t]=x&&ys(A,bs(ws(x)))||[];r=d(n.body,e,t)}}}else if(u&&!c&&p&&"get"!==n&&"head"!==n)r=d(r);else if(u&&c&&!m&&"get"!==n&&"head"!==n)throw new Yt("Stream request bodies are not supported by the current fetch implementation",Yt.ERR_NOT_SUPPORT,e,O);Pt.isString(w)||(w=w?"include":"omit");const P=c&&"credentials"in a.prototype;if(Pt.isFormData(r)){const e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete("content-type")}y.set("User-Agent","axios/"+Va,!1);const I={..._,signal:$,method:n.toUpperCase(),headers:Ft(y.normalize()),body:r,duplex:"half",credentials:P?w:void 0};O=c&&new a(t,I);let U=await(c?E(O,_):E(t,I));const z=Jt.from(U.headers);if(j){const t=Pt.toFiniteNumber(z.getContentLength());if(null!=t&&t>k)throw new Yt("maxContentLength size of "+k+" exceeded",Yt.ERR_BAD_RESPONSE,e,O)}const L=f&&("stream"===b||"response"===b);if(f&&U.body&&(v||j||L&&R)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=U[e]});const n=Pt.toFiniteNumber(z.getContentLength()),[o,i]=v&&ys(n,bs(ws(v),!0))||[];let a=0;U=new s(mr(U.body,65536,t=>{if(j&&(a=t,a>k))throw new Yt("maxContentLength size of "+k+" exceeded",Yt.ERR_BAD_RESPONSE,e,O);o&&o(t)},()=>{i&&i(),R&&R()}),t)}b=b||"text";let F=await h[Pt.findKey(h,b)||"text"](U,e);if(j&&!f&&!L){let t;if(null!=F&&("number"==typeof F.byteLength?t=F.byteLength:"number"==typeof F.size?t=F.size:"string"==typeof F&&(t="function"==typeof o?(new o).encode(F).byteLength:F.length)),"number"==typeof t&&t>k)throw new Yt("maxContentLength size of "+k+" exceeded",Yt.ERR_BAD_RESPONSE,e,O)}return!L&&R&&R(),await new Promise((t,n)=>{Si(t,n,{data:F,headers:Jt.from(U.headers),status:U.status,statusText:U.statusText,config:e,request:O})})}catch(t){if(R&&R(),$&&$.aborted&&$.reason instanceof Yt){const n=$.reason;throw n.config=e,O&&(n.request=O),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(C)throw O&&!C.request&&(C.request=O),C;if(t instanceof Yt)throw O&&!t.request&&(t.request=O),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new Yt("Network Error",Yt.ERR_NETWORK,e,O,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw Yt.from(t,t&&t.code,e,O,t&&t.response)}}},xr=new Map,br=e=>{let t=e&&e.env||{};const{fetch:n,Request:o,Response:i}=t,a=[o,i,n];let s,r,c=a.length,l=xr;for(;c--;)s=a[c],r=l.get(s),void 0===r&&l.set(s,r=c?new Map:vr(t)),l=r;return r};br();const yr={http:or,xhr:pr,fetch:{get:br}};Pt.forEach(yr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const wr=e=>`- ${e}`,_r=e=>Pt.isFunction(e)||null===e||!1===e;var kr=function(e,t){e=Pt.isArray(e)?e:[e];const{length:n}=e;let o,i;const a={};for(let s=0;s<n;s++){let n;if(o=e[s],i=o,!_r(o)&&(i=yr[(n=String(o)).toLowerCase()],void 0===i))throw new Yt(`Unknown adapter '${n}'`);if(i&&(Pt.isFunction(i)||(i=i.get(t))))break;a[n||"#"+s]=i}if(!i){const e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(wr).join("\n"):" "+wr(e[0]):"as no adapter specified";throw new Yt("There is no suitable adapter to dispatch the request "+t,Yt.ERR_NOT_SUPPORT)}return i};function Sr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ki(null,e)}function jr(e){return Sr(e),e.headers=Jt.from(e.headers),e.data=wi.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),kr(e.adapter||yi.adapter,e)(e).then(function(t){Sr(e),e.response=t;try{t.data=wi.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=Jt.from(t.headers),t},function(t){if(!_i(t)&&(Sr(e),t&&t.response)){e.response=t.response;try{t.response.data=wi.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=Jt.from(t.response.headers)}return Promise.reject(t)})}const Tr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Tr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Er={};Tr.transitional=function(e,t,n){function o(e,t){return"[Axios v"+Va+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new Yt(o(i," has been removed"+(t?" in "+t:"")),Yt.ERR_DEPRECATED);return t&&!Er[i]&&(Er[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}},Tr.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var $r={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new Yt("options must be an object",Yt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let i=o.length;for(;i-- >0;){const a=o[i],s=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(s){const t=e[a],n=void 0===t||s(t,a,e);if(!0!==n)throw new Yt("option "+a+" must be "+n,Yt.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Yt("Unknown option "+a,Yt.ERR_BAD_OPTION)}},validators:Tr};const Or=$r.validators;class Rr{constructor(e){this.defaults=e||{},this.interceptors={request:new ii,response:new ii}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),o=-1===t?-1:n.indexOf("\n",t+1),i=-1===o?"":n.slice(o+1);String(e.stack).endsWith(i)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=cr(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:i}=t;void 0!==n&&$r.assertOptions(n,{silentJSONParsing:Or.transitional(Or.boolean),forcedJSONParsing:Or.transitional(Or.boolean),clarifyTimeoutError:Or.transitional(Or.boolean),legacyInterceptorReqResOrdering:Or.transitional(Or.boolean),advertiseZstdAcceptEncoding:Or.transitional(Or.boolean),validateStatusUndefinedResolves:Or.transitional(Or.boolean)},!1),null!=o&&(Pt.isFunction(o)?t.paramsSerializer={serialize:o}:$r.assertOptions(o,{encode:Or.function,serialize:Or.function},!0)),void 0!==t.allowAbsoluteUrls||(t.allowAbsoluteUrls=void 0===this.defaults.allowAbsoluteUrls||this.defaults.allowAbsoluteUrls),$r.assertOptions(t,{baseUrl:Or.spelling("baseURL"),withXsrfToken:Or.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&Pt.merge(i.common,i[t.method]);i&&Pt.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete i[e]}),t.headers=Jt.concat(a,i);const s=[];let r=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;r=r&&e.synchronous;const n=t.transitional||ai;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(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=[jr.bind(this),void 0];for(e.unshift(...s),e.push(...c),p=e.length,l=Promise.resolve(t);u<p;)l=l.then(e[u++],e[u++]);return l}p=s.length;let d=t;for(;u<p;){const e=s[u++],t=s[u++];try{d=e?e(d):d}catch(e){if(!t){l=Promise.reject(e);break}try{const n=t.call(this,e);Pt.isThenable(n)&&(l=Promise.resolve(n).then(()=>jr.call(this,d)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=jr.call(this,d)}catch(e){l=Promise.reject(e)}for(u=0,p=c.length;u<p;)l=l.then(c[u++],c[u++]);return l}getUri(e){return oi($i((e=cr(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}Pt.forEach(["delete","get","head","options"],function(e){Rr.prototype[e]=function(t,n){return this.request(cr(n||{},{method:e,url:t,data:n&&Pt.hasOwnProp(n,"data")?n.data:void 0}))}}),Pt.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,o,i){return this.request(cr(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}Rr.prototype[e]=t(),"query"!==e&&(Rr.prototype[e+"Form"]=t(!0))});var Ar=Rr;class Cr{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const o=new Promise(e=>{n.subscribe(e),t=e}).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e(function(e,o,i){n.reason||(n.reason=new ki(e,o,i),t(n.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 t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Cr(function(t){e=t}),cancel:e}}}var Nr=Cr;const Pr={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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Pr).forEach(([e,t])=>{Pr[t]=e});var Ir=Pr;const Ur=function e(t){const n=new Ar(t),o=Fe(Ar.prototype.request,n);return Pt.extend(o,Ar.prototype,n,{allOwnKeys:!0}),Pt.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(cr(t,n))},o}(yi);Ur.Axios=Ar,Ur.CanceledError=ki,Ur.CancelToken=Nr,Ur.isCancel=_i,Ur.VERSION=Va,Ur.toFormData=Xo,Ur.AxiosError=Yt,Ur.Cancel=Ur.CanceledError,Ur.all=function(e){return Promise.all(e)},Ur.spread=function(e){return function(t){return e.apply(null,t)}},Ur.isAxiosError=function(e){return Pt.isObject(e)&&!0===e.isAxiosError},Ur.mergeConfig=cr,Ur.AxiosHeaders=Jt,Ur.formToJSON=e=>vi(Pt.isHTMLForm(e)?new FormData(e):e),Ur.getAdapter=kr,Ur.HttpStatusCode=Ir,Ur.default=Ur;var zr=Ur;const{CanceledError:Lr}=zr,Fr=/screenshot(\-\d+?)?\.needle\.(webp|png|jpg|jpeg)/;async function Dr(e,t){const n=t.baseUrl+Ue.jobs.post_update,o={...ze(t),job_id:e.identifier,status:e.status},i={status_message:e.status_message,error:e.error,progress:e.progress},a=await fetch(n,{...Le,method:"POST",headers:o,body:JSON.stringify(i)}).catch(e=>(console.error(e),null));return!!a&&a.ok}async function qr(e,t){const n=t.baseUrl+Ue.jobs.get_status,o={...ze(t),job_id:e,org:t.org},i=await fetch(n,{...Le,method:"GET",headers:o}).catch(e=>(t.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()),{failed:!0,httpStatus:i.status}):{failed:!0}}function Br(e={}){var t,n;const o=null!=(t=e.maxAuthFailures)?t:2,i=null!=(n=e.maxTransientFailures)?n:10;let a=0,s=0;return{record(e){if(e&&!0!==e.failed)return a=0,s=0,null;const t=null==e?void 0:e.httpStatus;return 401===t||403===t?(a++,a>=o?{abort:!0,reason:`Not authorized to read the job status (HTTP ${t}). Your access token is invalid or expired — run \`needle-cloud login\` or pass a fresh --token.`}:null):(s++,s>=i?{abort:!0,reason:`Could not read the job status after ${s} attempts${t?` (last: HTTP ${t})`:""}. The job may still be running — check it in the Needle Cloud dashboard.`}:null)}}}const Mr=6,Wr=1e3,Gr=15e3,Hr=9e4,Jr=new Set(["CERT_HAS_EXPIRED","UNABLE_TO_VERIFY_LEAF_SIGNATURE","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","ERR_TLS_CERT_ALTNAME_INVALID"]),Vr=new Set([408,429]);function Kr(e){var t;if(function(e){const t=null==e?void 0:e.name,n=null==e?void 0:e.code;return"CanceledError"===t||"AbortError"===t||"ERR_CANCELED"===n||"ABORT_ERR"===n}(e))return!1;const n=null==e||null==(t=e.response)?void 0:t.status;if("number"==typeof n&&n>0)return!!Vr.has(n)||!(n>=400&&n<500);const o=function(e){var t,n;const o=null!=(t=null==e?void 0:e.code)?t:null==e||null==(n=e.cause)?void 0:n.code;return"string"==typeof o&&o.length?o:null}(e);return!o||!Jr.has(o)}function Yr(e,t={}){const{baseMs:n=Wr,maxMs:o=Gr,random:i=Math.random}=t,a=Math.max(1,Math.floor(e)),s=Math.min(o,n*2**(a-1))/2;return Math.max(1,Math.round(s+i()*s))}async function Zr(e,t={}){const{maxAttempts:n=Mr,budgetMs:o=Hr,baseMs:i=Wr,maxMs:a=Gr,isRetryable:s=Kr,sleep:r=Xr,now:c=Date.now,random:l=Math.random,onRetry:p}=t,u=c();let d,m=0;for(;m<n;){m++;try{return{ok:!0,value:await e(m),attempts:m}}catch(e){if(d=e,!s(e))return{ok:!1,error:e,attempts:m,reason:"permanent"};if(m>=n)return{ok:!1,error:e,attempts:m,reason:"attempts-exhausted"};const t=Yr(m,{baseMs:i,maxMs:a,random:l});if(c()-u+t>=o)return{ok:!1,error:e,attempts:m,reason:"budget-exhausted"};null==p||p({attempt:m,waitMs:t,error:e}),await r(t)}}return{ok:!1,error:d,attempts:m,reason:"attempts-exhausted"}}function Xr(e){return new Promise(t=>setTimeout(t,e))}const Qr=5242880,ec=1e4,tc=16777216,nc=67108864;var oc=an(function(e,t){e.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(e,t){var n=e[0],o=e[1],i=e[2],a=e[3];o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&i|~o&a)+t[0]-680876936|0)<<7|n>>>25)+o|0)&o|~n&i)+t[1]-389564586|0)<<12|a>>>20)+n|0)&n|~a&o)+t[2]+606105819|0)<<17|i>>>15)+a|0)&a|~i&n)+t[3]-1044525330|0)<<22|o>>>10)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&i|~o&a)+t[4]-176418897|0)<<7|n>>>25)+o|0)&o|~n&i)+t[5]+1200080426|0)<<12|a>>>20)+n|0)&n|~a&o)+t[6]-1473231341|0)<<17|i>>>15)+a|0)&a|~i&n)+t[7]-45705983|0)<<22|o>>>10)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&i|~o&a)+t[8]+1770035416|0)<<7|n>>>25)+o|0)&o|~n&i)+t[9]-1958414417|0)<<12|a>>>20)+n|0)&n|~a&o)+t[10]-42063|0)<<17|i>>>15)+a|0)&a|~i&n)+t[11]-1990404162|0)<<22|o>>>10)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&i|~o&a)+t[12]+1804603682|0)<<7|n>>>25)+o|0)&o|~n&i)+t[13]-40341101|0)<<12|a>>>20)+n|0)&n|~a&o)+t[14]-1502002290|0)<<17|i>>>15)+a|0)&a|~i&n)+t[15]+1236535329|0)<<22|o>>>10)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&a|i&~a)+t[1]-165796510|0)<<5|n>>>27)+o|0)&i|o&~i)+t[6]-1069501632|0)<<9|a>>>23)+n|0)&o|n&~o)+t[11]+643717713|0)<<14|i>>>18)+a|0)&n|a&~n)+t[0]-373897302|0)<<20|o>>>12)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&a|i&~a)+t[5]-701558691|0)<<5|n>>>27)+o|0)&i|o&~i)+t[10]+38016083|0)<<9|a>>>23)+n|0)&o|n&~o)+t[15]-660478335|0)<<14|i>>>18)+a|0)&n|a&~n)+t[4]-405537848|0)<<20|o>>>12)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&a|i&~a)+t[9]+568446438|0)<<5|n>>>27)+o|0)&i|o&~i)+t[14]-1019803690|0)<<9|a>>>23)+n|0)&o|n&~o)+t[3]-187363961|0)<<14|i>>>18)+a|0)&n|a&~n)+t[8]+1163531501|0)<<20|o>>>12)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&a|i&~a)+t[13]-1444681467|0)<<5|n>>>27)+o|0)&i|o&~i)+t[2]-51403784|0)<<9|a>>>23)+n|0)&o|n&~o)+t[7]+1735328473|0)<<14|i>>>18)+a|0)&n|a&~n)+t[12]-1926607734|0)<<20|o>>>12)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o^i^a)+t[5]-378558|0)<<4|n>>>28)+o|0)^o^i)+t[8]-2022574463|0)<<11|a>>>21)+n|0)^n^o)+t[11]+1839030562|0)<<16|i>>>16)+a|0)^a^n)+t[14]-35309556|0)<<23|o>>>9)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o^i^a)+t[1]-1530992060|0)<<4|n>>>28)+o|0)^o^i)+t[4]+1272893353|0)<<11|a>>>21)+n|0)^n^o)+t[7]-155497632|0)<<16|i>>>16)+a|0)^a^n)+t[10]-1094730640|0)<<23|o>>>9)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o^i^a)+t[13]+681279174|0)<<4|n>>>28)+o|0)^o^i)+t[0]-358537222|0)<<11|a>>>21)+n|0)^n^o)+t[3]-722521979|0)<<16|i>>>16)+a|0)^a^n)+t[6]+76029189|0)<<23|o>>>9)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o^i^a)+t[9]-640364487|0)<<4|n>>>28)+o|0)^o^i)+t[12]-421815835|0)<<11|a>>>21)+n|0)^n^o)+t[15]+530742520|0)<<16|i>>>16)+a|0)^a^n)+t[2]-995338651|0)<<23|o>>>9)+i|0,o=((o+=((a=((a+=(o^((n=((n+=(i^(o|~a))+t[0]-198630844|0)<<6|n>>>26)+o|0)|~i))+t[7]+1126891415|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~o))+t[14]-1416354905|0)<<15|i>>>17)+a|0)|~n))+t[5]-57434055|0)<<21|o>>>11)+i|0,o=((o+=((a=((a+=(o^((n=((n+=(i^(o|~a))+t[12]+1700485571|0)<<6|n>>>26)+o|0)|~i))+t[3]-1894986606|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~o))+t[10]-1051523|0)<<15|i>>>17)+a|0)|~n))+t[1]-2054922799|0)<<21|o>>>11)+i|0,o=((o+=((a=((a+=(o^((n=((n+=(i^(o|~a))+t[8]+1873313359|0)<<6|n>>>26)+o|0)|~i))+t[15]-30611744|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~o))+t[6]-1560198380|0)<<15|i>>>17)+a|0)|~n))+t[13]+1309151649|0)<<21|o>>>11)+i|0,o=((o+=((a=((a+=(o^((n=((n+=(i^(o|~a))+t[4]-145523070|0)<<6|n>>>26)+o|0)|~i))+t[11]-1120210379|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~o))+t[2]+718787259|0)<<15|i>>>17)+a|0)|~n))+t[9]-343485551|0)<<21|o>>>11)+i|0,e[0]=n+e[0]|0,e[1]=o+e[1]|0,e[2]=i+e[2]|0,e[3]=a+e[3]|0}function o(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function i(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function a(e){var t,i,a,s,r,c,l=e.length,p=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=l;t+=64)n(p,o(e.substring(t-64,t)));for(i=(e=e.substring(t-64)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<i;t+=1)a[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(n(p,a),t=0;t<16;t+=1)a[t]=0;return s=(s=8*l).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(s[2],16),c=parseInt(s[1],16)||0,a[14]=r,a[15]=c,n(p,a),p}function s(e){var n,o="";for(n=0;n<4;n+=1)o+=t[e>>8*n+4&15]+t[e>>8*n&15];return o}function r(e){var t;for(t=0;t<e.length;t+=1)e[t]=s(e[t]);return e.join("")}function c(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function l(e){var t,n=[],o=e.length;for(t=0;t<o-1;t+=2)n.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,n)}function p(){this.reset()}return r(a("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(t,n){var o,i,a,s,r=this.byteLength,c=e(t,r),l=r;return void 0!==n&&(l=e(n,r)),c>l?new ArrayBuffer(0):(o=l-c,i=new ArrayBuffer(o),a=new Uint8Array(i),s=new Uint8Array(this,c,o),a.set(s),i)}}(),p.prototype.append=function(e){return this.appendBinary(c(e)),this},p.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,i=this._buff.length;for(t=64;t<=i;t+=64)n(this._hash,o(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},p.prototype.end=function(e){var t,n,o=this._buff,i=o.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)a[t>>2]|=o.charCodeAt(t)<<(t%4<<3);return this._finish(a,i),n=r(this._hash),e&&(n=l(n)),this.reset(),n},p.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},p.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},p.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},p.prototype._finish=function(e,t){var o,i,a,s=t;if(e[s>>2]|=128<<(s%4<<3),s>55)for(n(this._hash,e),s=0;s<16;s+=1)e[s]=0;o=(o=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(o[2],16),a=parseInt(o[1],16)||0,e[14]=i,e[15]=a,n(this._hash,e)},p.hash=function(e,t){return p.hashBinary(c(e),t)},p.hashBinary=function(e,t){var n=r(a(e));return t?l(n):n},(p.ArrayBuffer=function(){this.reset()}).prototype.append=function(e){var t,o,a,s,r=(o=this._buff.buffer,a=e,(s=new Uint8Array(o.byteLength+a.byteLength)).set(new Uint8Array(o)),s.set(new Uint8Array(a),o.byteLength),s),c=r.length;for(this._length+=e.byteLength,t=64;t<=c;t+=64)n(this._hash,i(r.subarray(t-64,t)));return this._buff=t-64<c?new Uint8Array(r.buffer.slice(t-64)):new Uint8Array(0),this},p.ArrayBuffer.prototype.end=function(e){var t,n,o=this._buff,i=o.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)a[t>>2]|=o[t]<<(t%4<<3);return this._finish(a,i),n=r(this._hash),e&&(n=l(n)),this.reset(),n},p.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.ArrayBuffer.prototype.getState=function(){var e=p.prototype.getState.call(this);return e.buff=String.fromCharCode.apply(null,new Uint8Array(e.buff)),e},p.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var n,o=e.length,i=new ArrayBuffer(o),a=new Uint8Array(i);for(n=0;n<o;n+=1)a[n]=e.charCodeAt(n);return a}(e.buff),p.prototype.setState.call(this,e)},p.ArrayBuffer.prototype.destroy=p.prototype.destroy,p.ArrayBuffer.prototype._finish=p.prototype._finish,p.ArrayBuffer.hash=function(e,t){var o=r(function(e){var t,o,a,s,r,c,l=e.length,p=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=l;t+=64)n(p,i(e.subarray(t-64,t)));for(o=(e=t-64<l?e.subarray(t-64):new Uint8Array(0)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<o;t+=1)a[t>>2]|=e[t]<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(n(p,a),t=0;t<16;t+=1)a[t]=0;return s=(s=8*l).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(s[2],16),c=parseInt(s[1],16)||0,a[14]=r,a[15]=c,n(p,a),p}(new Uint8Array(e)));return t?l(o):o},p}()}),ic=oc;function ac(e,t=0){return lc(e,t,2).getUint16(0,!0)}function sc(e,t=0){return lc(e,t,4).getUint32(0,!0)}function rc(e,t=0,n=e.byteLength){const o=e.slice(t,t+n);return pc.decode(new Uint8Array(o))}function cc(e,t,n=0){if(e.length<t.length+n)return!1;for(const[o,i]of t.entries())if(null!==i&&i!==e[o+n])return!1;return!0}function lc(e,t,n){const o=e.slice(t,t+n);return new DataView(new Uint8Array(o).buffer)}const pc=new TextDecoder("utf8"),uc=[["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 dc(e){return e.flatMap(([e,t,n,o={},i=[]])=>[[e,t,n,o],...i])}function mc(e,t){const n=ac(e,26),o=rc(e,30,n),[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,t){const n=sc(e,18),o=sc(e,22),i=ac(e,28);if(n===o){const o=rc(e,30+t+i,n);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,n)??t:t}const fc=function(e){return dc(e).map(([e,t,n,{offset:o=0}={}])=>n.length+o).reduce((e,t)=>t>e?t:e,0)}(uc);function hc(e,t){for(const[n,o,i,{exact:a=!0,offset:s=0}={},r=[]]of t)if(cc(e,i,s)){if("zip"===n&&!a)return mc(e.buffer,{ext:n,mime:o});if(!a&&r.length)for(const[t,n,o,{offset:i=0}={}]of r)if(cc(e,o,i))return{ext:t,mime:n};return{ext:n,mime:o}}}function gc(e,t,n=void 0){const o=function(e,t,n){let o=0;for(;;){let t=e.indexOf("\\",o);if(-1===t)break;o=t+1,e=e.replace("\\","/")}return e}(e).split("/").pop()||e,i=(null==n?void 0:n.type)||xc(t,e),a=new File([t],o,{type:i});return a.path=e,a}const vc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function xc(e,t=void 0){const n=function(e,{extra:t=!1,hint:n}={}){const o=new Uint8Array(e.slice(0,fc));if(n){const e=function(e,{ext:t,mime:n}){return t||n?dc(e).filter(e=>e[0]===t||e[1]===n):[]}(uc,n);if(e.length>0){const t=hc(o,e);if(void 0!==t)return t}}return hc(o,uc)||(t?function(e){return function(e){try{const t=rc(e);if(!function(e){for(let t=0;t<e.length;t++)try{const n=e.charCodeAt(t);if(65533===n||n<=8)return!1}catch{return!1}return!0}(t))return;try{return JSON.parse(t),{ext:"json",mime:"application/json"}}catch{return{ext:"txt",mime:"text/plain"}}}catch{return}}(e)}(e):void 0)}(e);if(n)return n.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 t&&(s=function(e){const t=e.toLowerCase();let n="";return t.endsWith(".html")||t.endsWith(".html.gz")||t.endsWith(".html.br")?n="text/html":t.endsWith(".js")||t.endsWith(".js.gz")||t.endsWith(".js.br")||t.endsWith(".mjs")||t.endsWith(".mjs.gz")||t.endsWith(".mjs.br")||t.endsWith(".cjs")||t.endsWith(".cjs.gz")||t.endsWith(".cjs.br")?n="application/javascript":t.endsWith(".wasm")?n="application/wasm":t.endsWith(".css")||t.endsWith(".css.gz")||t.endsWith(".css.br")?n="text/css":t.endsWith(".json")?n="application/json":t.endsWith(".txt")?n="text/plain":t.endsWith(".md")?n="text/markdown":t.endsWith(".yaml")||t.endsWith(".yml")?n="application/yaml":t.endsWith(".bin")?n="application/octet-stream":t.endsWith(".png")?n="image/png":t.endsWith(".jpg")||t.endsWith(".jpeg")?n="image/jpeg":t.endsWith(".gif")?n="image/gif":t.endsWith(".webp")?n="image/webp":t.endsWith(".avif")?n="image/avif":t.endsWith(".bmp")?n="image/bmp":t.endsWith(".tiff")||t.endsWith(".tif")?n="image/tiff":t.endsWith(".ico")?n="image/x-icon":t.endsWith(".svg")?n="image/svg+xml":t.endsWith(".xml")?n="application/xml":t.endsWith(".hdr")?n="image/vnd.radiance":t.endsWith(".exr")?n="image/x-exr":t.endsWith(".ktx2")?n="image/ktx2":t.endsWith(".ktx")?n="image/ktx":t.endsWith(".dds")?n="image/vnd-ms.dds":t.endsWith(".ogg")?n="audio/ogg":t.endsWith(".mp3")?n="audio/mpeg":t.endsWith(".wav")?n="audio/wave":t.endsWith(".flac")?n="audio/flac":t.endsWith(".m4a")?n="audio/mp4":t.endsWith(".aac")?n="audio/aac":t.endsWith(".mp4")?n="video/mp4":t.endsWith(".webm")?n="video/webm":t.endsWith(".mov")?n="video/quicktime":t.endsWith(".woff2")?n="font/woff2":t.endsWith(".woff")?n="font/woff":t.endsWith(".ttf")?n="font/ttf":t.endsWith(".otf")?n="font/otf":t.endsWith(".zip")?n="application/zip":t.endsWith(".glb")?n="model/gltf-binary":t.endsWith(".gltf")?n="model/gltf+json":t.endsWith(".vrm")?n="model/gltf-binary":t.endsWith(".usdz")?n="model/vnd.usdz+zip":t.endsWith(".usda")?n="model/vnd.usd-usda":t.endsWith(".usdc")?n="model/vnd.usd-usdc":t.endsWith(".usd")?n="model/vnd.usd-usd":t.endsWith(".mtl")?n="model/mtl":t.endsWith(".obj")?n="model/obj":t.endsWith(".fbx")?n="model/vnd.autodesk.fbx":t.endsWith(".stl")?n="model/stl":t.endsWith(".mtlx")?n="application/materialx+xml":t.endsWith(".ply")?n="model/ply":t.endsWith(".dae")?n="model/vnd.collada+xml":t.endsWith(".3mf")?n="model/3mf":(t.endsWith(".splat")||t.endsWith(".spz")||t.endsWith(".ksplat")||t.endsWith(".sog")||t.endsWith(".sogs"))&&(n="application/octet-stream"),n}(t)),s}function bc(e){return"string"==typeof e&&0!==e.length&&e.toLowerCase().endsWith(".exr")}function yc(e){if("string"!=typeof e||0===e.length)return!1;const t=e.toLowerCase();return t.endsWith(".hdr")||t.endsWith(".hdri")}function wc(e){return"string"==typeof e&&0!==e.length&&/\.pmrem(\d+x\d+)?\.ktx2$/i.test(e)}function _c(e,t){const n=e.toLowerCase();return"application/gzip"===t||"application/brotli"===t?(n.endsWith(".html.gz")||n.endsWith(".html.br")?(t="text/html",e=e.substring(0,e.length-3)):n.endsWith(".js.gz")||n.endsWith(".js.br")||n.endsWith(".mjs.gz")||n.endsWith(".mjs.br")||n.endsWith(".cjs.gz")||n.endsWith(".cjs.br")?(t="application/javascript",e=e.substring(0,e.length-3)):n.endsWith(".css.gz")||n.endsWith(".css.br")?(t="text/css",e=e.substring(0,e.length-3)):n.endsWith(".json.gz")||n.endsWith(".json.br")?(t="text/json",e=e.substring(0,e.length-3)):n.endsWith(".txt.gz")||n.endsWith(".txt.br")?(t="text/plain",e=e.substring(0,e.length-3)):n.endsWith(".wasm.gz")||n.endsWith(".wasm.br")?(t="application/wasm",e=e.substring(0,e.length-3)):n.endsWith(".bin.gz")||n.endsWith(".bin.br")?(t="application/octet-stream",e=e.substring(0,e.length-3)):n.endsWith(".png.gz")||n.endsWith(".png.br")?(t="image/png",e=e.substring(0,e.length-3)):n.endsWith(".jpg.gz")||n.endsWith(".jpg.br")||n.endsWith(".jpeg.gz")||n.endsWith(".jpeg.br")?(t="image/jpeg",e=e.substring(0,e.length-3)):n.endsWith(".gif.gz")||n.endsWith(".gif.br")?(t="image/gif",e=e.substring(0,e.length-3)):n.endsWith(".webp.gz")||n.endsWith(".webp.br")?(t="image/webp",e=e.substring(0,e.length-3)):n.endsWith(".svg.gz")||n.endsWith(".svg.br")?(t="image/svg+xml",e=e.substring(0,e.length-3)):n.endsWith(".xml.gz")||n.endsWith(".xml.br")?(t="application/xml",e=e.substring(0,e.length-3)):n.endsWith(".ico.gz")||n.endsWith(".ico.br")?(t="image/x-icon",e=e.substring(0,e.length-3)):n.endsWith(".avif.gz")||n.endsWith(".avif.br")?(t="image/avif",e=e.substring(0,e.length-3)):n.endsWith(".bmp.gz")||n.endsWith(".bmp.br")?(t="image/bmp",e=e.substring(0,e.length-3)):n.endsWith(".tiff.gz")||n.endsWith(".tiff.br")||n.endsWith(".tif.gz")||n.endsWith(".tif.br")?(t="image/tiff",e=e.substring(0,e.length-3)):n.endsWith(".hdr.gz")||n.endsWith(".hdr.br")?(t="image/vnd.radiance",e=e.substring(0,e.length-3)):n.endsWith(".exr.gz")||n.endsWith(".exr.br")?(t="image/x-exr",e=e.substring(0,e.length-3)):n.endsWith(".ktx2.gz")||n.endsWith(".ktx2.br")?(t="image/ktx2",e=e.substring(0,e.length-3)):n.endsWith(".ktx.gz")||n.endsWith(".ktx.br")?(t="image/ktx",e=e.substring(0,e.length-3)):n.endsWith(".dds.gz")||n.endsWith(".dds.br")?(t="image/vnd-ms.dds",e=e.substring(0,e.length-3)):n.endsWith(".webm.gz")||n.endsWith(".webm.br")?(t="video/webm",e=e.substring(0,e.length-3)):n.endsWith(".mp4.gz")||n.endsWith(".mp4.br")?(t="video/mp4",e=e.substring(0,e.length-3)):n.endsWith(".mov.gz")||n.endsWith(".mov.br")?(t="video/quicktime",e=e.substring(0,e.length-3)):n.endsWith(".mp3.gz")||n.endsWith(".mp3.br")?(t="audio/mpeg",e=e.substring(0,e.length-3)):n.endsWith(".wav.gz")||n.endsWith(".wav.br")?(t="audio/wave",e=e.substring(0,e.length-3)):n.endsWith(".ogg.gz")||n.endsWith(".ogg.br")?(t="audio/ogg",e=e.substring(0,e.length-3)):n.endsWith(".flac.gz")||n.endsWith(".flac.br")?(t="audio/flac",e=e.substring(0,e.length-3)):n.endsWith(".m4a.gz")||n.endsWith(".m4a.br")?(t="audio/mp4",e=e.substring(0,e.length-3)):n.endsWith(".aac.gz")||n.endsWith(".aac.br")?(t="audio/aac",e=e.substring(0,e.length-3)):n.endsWith(".woff2.gz")||n.endsWith(".woff2.br")?(t="font/woff2",e=e.substring(0,e.length-3)):n.endsWith(".woff.gz")||n.endsWith(".woff.br")?(t="font/woff",e=e.substring(0,e.length-3)):n.endsWith(".ttf.gz")||n.endsWith(".ttf.br")?(t="font/ttf",e=e.substring(0,e.length-3)):n.endsWith(".otf.gz")||n.endsWith(".otf.br")?(t="font/otf",e=e.substring(0,e.length-3)):n.endsWith(".md.gz")||n.endsWith(".md.br")?(t="text/markdown",e=e.substring(0,e.length-3)):n.endsWith(".yaml.gz")||n.endsWith(".yaml.br")||n.endsWith(".yml.gz")||n.endsWith(".yml.br")?(t="application/yaml",e=e.substring(0,e.length-3)):n.endsWith(".zip.gz")||n.endsWith(".zip.br")?(t="application/zip",e=e.substring(0,e.length-3)):n.endsWith(".glb.gz")||n.endsWith(".glb.br")?(t="model/gltf-binary",e=e.substring(0,e.length-3)):n.endsWith(".gltf.gz")||n.endsWith(".gltf.br")?(t="model/gltf+json",e=e.substring(0,e.length-3)):n.endsWith(".vrm.gz")||n.endsWith(".vrm.br")?(t="model/gltf-binary",e=e.substring(0,e.length-3)):n.endsWith(".usdz.gz")||n.endsWith(".usdz.br")?(t="model/vnd.usdz+zip",e=e.substring(0,e.length-3)):n.endsWith(".usda.gz")||n.endsWith(".usda.br")?(t="model/vnd.usd-usda",e=e.substring(0,e.length-3)):n.endsWith(".usdc.gz")||n.endsWith(".usdc.br")?(t="model/vnd.usd-usdc",e=e.substring(0,e.length-3)):n.endsWith(".usd.gz")||n.endsWith(".usd.br")?(t="model/vnd.usd-usd",e=e.substring(0,e.length-3)):n.endsWith(".obj.gz")||n.endsWith(".obj.br")?(t="model/obj",e=e.substring(0,e.length-3)):n.endsWith(".mtl.gz")||n.endsWith(".mtl.br")?(t="model/mtl",e=e.substring(0,e.length-3)):n.endsWith(".stl.gz")||n.endsWith(".stl.br")?(t="model/stl",e=e.substring(0,e.length-3)):n.endsWith(".mtlx.gz")||n.endsWith(".mtlx.br")?(t="application/materialx+xml",e=e.substring(0,e.length-3)):n.endsWith(".ply.gz")||n.endsWith(".ply.br")?(t="model/ply",e=e.substring(0,e.length-3)):n.endsWith(".dae.gz")||n.endsWith(".dae.br")?(t="model/vnd.collada+xml",e=e.substring(0,e.length-3)):n.endsWith(".3mf.gz")||n.endsWith(".3mf.br")?(t="model/3mf",e=e.substring(0,e.length-3)):(n.endsWith(".splat.gz")||n.endsWith(".splat.br")||n.endsWith(".spz.gz")||n.endsWith(".spz.br")||n.endsWith(".ksplat.gz")||n.endsWith(".ksplat.br")||n.endsWith(".sog.gz")||n.endsWith(".sog.br")||n.endsWith(".sogs.gz")||n.endsWith(".sogs.br"))&&(t="application/octet-stream",e=e.substring(0,e.length-3)),{filename:e,mimetype:t}):null}function kc(e,t=void 0,n=!0){const o=Math.abs(e);if(o>=1099511627776){let o=n?" TB":"";return(e/1099511627776).toFixed(void 0===t?2:t)+o}if(o>=1073741824){let o=n?" GB":"";return(e/1073741824).toFixed(void 0===t?2:t)+o}if(o>=1048576){let o=n?" MB":"";return(e/1048576).toFixed(void 0===t?1:t)+o}if(o>=1024){let o=n?" KB":"";return(e/1024).toFixed(void 0===t?0:t)+o}let i=n?" B":"";return e.toFixed(0)+i}function Sc(e){return e.split("/").reduce((e,t)=>("."===t||(".."===t?e.pop():null!=t&&t.length&&e.push(t)),e),[]).join("/")}const jc=1179937895,Tc=1313821514,Ec=12,$c=8;function Oc(e,t){let n=t;for(;n<e.length&&0!==e[n];)n++;return n>=e.length?null:new TextDecoder("latin1").decode(e.subarray(t,n))}async function Rc(e){return new Promise(t=>setTimeout(t,e))}function Ac(e,t,n=void 0){e instanceof Date&&(e=e.getTime()),t instanceof Date&&(t=t.getTime());let o=t-e,i=o>0;const a=!1!==(null==n?void 0:n.prefix),s=!1!==(null==n?void 0:n.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==n?void 0:n.limitInDays)&&d>=n.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!=n&&n.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!=n&&n.allowSimple&&l<10?"just now":`${r}${l.toFixed(0)} seconds${c}`}const Cc=/^image_(?<image_lod>\d+)_|^mesh_lod_(?<mesh_lod>\d+)_/;function Nc(e){return e.includes("\\u")?JSON.parse(`"${e}"`):decodeURIComponent(e)}function Pc(e){let t=null,n="";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 t=o[0],t;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 t of i){const n=t.path.split("/");let o=e.get(n.length);o||(o=[],e.set(n.length,o)),o.push(t)}const o=Array.from(e.keys()).sort((e,t)=>e-t);if(o.length>0)for(const n of o){const o=e.get(n);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?(t=i,t):(t=o[0],t)}return n="Invalid upload: Multiple HTML files found but could not determine root.",console.error(n,i.map(e=>e.path||e.name)),{error:n}}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 t=new Array,n=/(mesh_lod|image)_\d_(.{1,50})/;for(const o of e){if(n.test(o.name))continue;const e=o.name.toLowerCase();(e.endsWith(".gltf")||e.endsWith(".vrm")||e.endsWith(".glb"))&&t.push(o)}return 1==t.length?t[0]:null!=(o=zc(t)[0])?o:null;var o}(a);return e?(t=e,t):(n="Invalid upload: Multiple glb/glTF/vrm files found. This is currently not supported.",console.error(n,a.map(e=>e.path||e.name)),{error:n})}if(1===a.length)return t=a[0],t;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 t=function(e){var t;const n=zc(e),o=["usda","usdz","usd","usdc"];for(const e of o){const t=n.find(t=>t.name.toLowerCase().endsWith(`.${e}`));if(t)return t}return null!=(t=n[0])?t:null}(s),t;const r=e.filter(e=>e.name.toLowerCase().endsWith(".fbx"));if(r.length>1)return n="Invalid upload: Multiple fbx files found. This is currently not supported.",console.error(n,r),{error:n};if(1===r.length)return t=r[0],t;const c=e.filter(e=>e.name.toLowerCase().endsWith(".obj"));if(c.length>1)return n="Invalid upload: Multiple obj files found. This is currently not supported.",console.error(n,c),{error:n};if(1===c.length)return t=c[0],t;const l=e.filter(e=>e.name.toLowerCase().endsWith(".stl"));if(l.length>1)return n="Invalid upload: Multiple stl files found. This is currently not supported.",console.error(n,l),{error:n};if(1===l.length)return t=l[0],t;const p=e.filter(e=>{const t=e.name.toLowerCase();return t.endsWith(".ply")||t.endsWith(".splat")||t.endsWith(".spz")||t.endsWith(".ksplat")||t.endsWith(".sog")||t.endsWith(".sogs")});if(p.length>1)return n="Invalid upload: Multiple splat files found. Upload them as separate content items.",console.error(n,p.map(e=>e.path||e.name)),{error:n};if(1===p.length)return t=p[0],t;if(1===e.length&&!e[0].arrayBuffer&&e[0].path.toLowerCase().startsWith("http"))return t=e[0],t;const u=e.filter(e=>e.name.toLowerCase().endsWith("package.json"));if(1===u.length)return t=u[0],t;if(u.length>1)return n="Invalid upload: Multiple package.json files found. This is currently not supported.",console.error(n,u),{error:n};const d=e.filter(e=>e.name.toLowerCase().endsWith(".mtlx"));if(d.length>1)return n="Invalid upload: Multiple mtlx files found. This is currently not supported.",console.error(n,d),{error:n};if(1===d.length)return t=d[0],t;const m=e.filter(e=>{const t=e.name.toLowerCase();return bc(t)||yc(t)||wc(t)});return m.length>1?(n="Invalid upload: Multiple HDRI files found. Upload them as separate content items.",console.error(n,m.map(e=>e.path||e.name)),{error:n}):1===m.length?(t=m[0],t):t||{error:"No supported file to upload found..."}}const Ic=new Set(["glb","gltf","vrm"]),Uc=new Set(["fbx","obj","stl","usd","usda","usdz"]);function zc(e){let t=Infinity,n=[];for(const o of e){const e=o.path.split("/").length;e<t?(t=e,n=[o]):e===t&&n.push(o)}return n}class Lc{constructor(e,t){this.totalFiles=e,this.estimatedTotalSize=t,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 t=Date.now(),n=(t-this.lastUpdateTime)/1e3,o=e-this.lastUploadedSize;if(this.uploadedSize=e,n>0&&o>0){this.recentSpeeds.push(o/n),this.recentSpeeds.length>this.maxRecentSpeeds&&this.recentSpeeds.shift();const e=this.recentSpeeds.reduce((e,t)=>e+t,0)/this.recentSpeeds.length;this.speedEMA=null===this.speedEMA?e:this.emaFactor*e+(1-this.emaFactor)*this.speedEMA}this.lastUpdateTime=t,this.lastUploadedSize=e;const i=this.uploadedSize/this.estimatedTotalSize,a=(t-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 t=Math.floor(e/60);if(t<60)return`${t}min`;const n=Math.floor(t/60);if(n<24)return`${n}h ${t%60}min`;const o=Math.floor(n/24);return o<=10?`${o}d`:"Calculating..."}}const Fc=15e3;function Dc(e,t,n={setTimeout:setTimeout,clearTimeout:clearTimeout}){return function(o,i){const a=e.call(this,o,i);if(!a||"function"!=typeof a.once)return a;const s=n.setTimeout(()=>{const e=new Error(`connect timeout: no connection within ${t/1e3}s`);e.code="ETIMEDOUT",a.destroy(e)},t),r=()=>n.clearTimeout(s);return a.once("connect",r),a.once("secureConnect",r),a.once("error",r),a.once("close",r),a}}let qc;async function Bc(e={}){var t,n;if(!(null!=(t=e.isNode)?t:"undefined"!=typeof process&&null!=(n=process.versions)&&n.node))return{};if(qc)return qc;const[{default:o},{default:i}]=await Promise.all([import("node:http"),import("node:https")]),a=new o.Agent({keepAlive:!0}),s=new i.Agent({keepAlive:!0});for(const e of[a,s])e.createConnection=Dc(e.createConnection,Fc);return qc={httpAgent:a,httpsAgent:s},qc}async function Mc(e){const t=await import("./pako.esm-01431bd2.js"),n=await e.arrayBuffer(),o=t.gzip(new Uint8Array(n)).buffer.slice(0);if(o.byteLength>51200&&o.byteLength>=n.byteLength){if(n.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 gc(`${"path"in e?e.path:e.name}.gz`,o,{type:"application/gzip"})}const Wc=16777216;async function Gc(e,t,n=void 0){const o=async function(e,t,n){var o,i,a,s,r,c,l,p,u,d,m,f,h,g,v,x,b,y,w,_;let{files:k,skipped:S}=function(e){const t=[];return{files:e.filter(e=>{const n=e.name||"";return!(!n||n.endsWith("/"))||(t.push({name:n,reason:"directory-entry"}),!1)}),skipped:t}}(t.files);for(const e of S)console.warn(`[upload] Skipping directory entry: "${e.name}"`);t.files=k;const j=(null==(o=n)?void 0:o.loglevel)||"none";if(!k.length)return"none"!=j&&console.error("No files to upload"),{success:!1,error:"No files to upload"};if(!t.entrypoint){const e=Pc(k);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"===j&&console.log("Entrypoint: "+e.name),t.entrypoint=e}t.entrypoint&&!k.includes(t.entrypoint)&&k.push(t.entrypoint);const T=await async function(e){if(e.length>5e3)return{success:!1,error:"Too many files. Maximum filecount is 5000"};let t=0,n=0,o=0,i=0;for(let c=e.length-1;c>=0;c--){const l=e[c];if(t+=l.size,t>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)&&Cc.test(r)||i++:p.endsWith(".vrm")&&n++,p.endsWith(".gltf")){var a;o+=1,console.log(`Found glTF file ${l.name}. Will check if all dependencies are available\n`,e);const t=await l.text(),n=t.matchAll(/"uri"\s*:\s*"(?<value>.*?)"/g);if(!n)continue;const i=JSON.parse(t);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 t of n){var s;const n=null==(s=t.groups)?void 0:s.value;if(n){let t=!1;if(n.startsWith("http://")||n.startsWith("https://")||n.startsWith("www.")){console.log(`✅ Found remote dependency ${n} `);break}if(n.startsWith("data:")){console.log(`✅ Found embedded dependency ${n} `);break}{const o=Sc(`${c}/${Nc(n)}`);console.log('❓ Check if local dependency exists "'+o+'"');for(const n of e){if(n.webkitRelativePath===o||n.name==o){t=!0,console.log(`✅ Found dependency in name or webkit: ${n.name} || ${n.webkitRelativePath} `);break}if(n.path===o){t=!0,console.log(`✅ Found dependency in path: ${n.path} `);break}}}if(!t)return console.warn("⚠ Missing dependency "+n,c),{success:!1,error:"Missing resource: "+n}}}}}else e.splice(c,1)}var r;return{success:!0,vrm_count:n,gltf_count:o,glb_count:i}}(k);if("error"in T)return{success:!1,error:T.error||"Failed to validate files"};if(null!=(i=t.entrypoint)&&i.name.endsWith(".htm")||null!=(a=t.entrypoint)&&a.name.endsWith(".html")||null!=(s=t.entrypoint)&&s.name.endsWith(".html.gz")||null!=(r=t.entrypoint)&&r.name.endsWith(".html.br"))n||(n={}),n.type="deployment";else if(T.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."};const E=await async function(e,t={}){const{raw:n=!1,loglevel:o="none",entrypoint:i=null}=t,a=(...e)=>{"none"!==o&&console.log(...e)};if(n)return"none"!==o&&console.warn("Raw upload - skipping gzip compression of files"),{files:e,entrypoint:i};const s=new Set(e.map(Vc)),r=[];let c=i;for(const t of e){const n=Vc(t),p=t.name.toLowerCase();if(!Hc.some(e=>p.endsWith(e))){r.push(t);continue}const u=Jc.find(e=>s.has(`${n}${e}`));if(u){var l;a(`Skipping gzip compression, using pre-compressed file: ${n}${u}`),i===t&&(c=null!=(l=e.find(e=>Vc(e)===`${n}${u}`))?l:c);continue}a(`gZip compressing file: ${t.name}`);const d=await Mc(t).catch(e=>({error:`Error compressing ${t.name}: ${e.message}`}));if(null===d){"none"!==o&&console.error(`Did not compress file: ${t.name}`),r.push(t);continue}if("error"in d)return{files:e,entrypoint:i,error:d.error};if(!d)return{files:e,entrypoint:i,error:`Failed to compress ${t.name}`};const m=i===t;r.push(d),m&&(c=d),a(`gZip compressed file: ${t.name} ${m?"(entrypoint)":""}`)}return{files:r,entrypoint:c}}(k,{raw:t.raw,loglevel:null!=(c=null==(l=n)?void 0:l.loglevel)?c:j,entrypoint:t.entrypoint});if(E.error)return{success:!1,error:E.error,status:500};k=E.files,t.files=k,t.entrypoint=E.entrypoint,k.sort((e,t)=>e.name.includes(".needle")&&!t.name.includes(".needle")?-1:!e.name.includes(".needle")&&t.name.includes(".needle")?1:0);const{baseUrl:$,authToken:O}=e,R="Bearer "+O,A={...ze(e),triggered_by:t.triggered_by,filename:`${encodeURIComponent(t.entrypoint.name)}`,"total-files":k.length.toString(),"total-files-size":k.reduce((e,t)=>e+t.size,0).toString()};null!=(p=n)&&p.content_id&&(A.content_id=n.content_id),null!=(u=n)&&u.type&&(A.type=n.type),null!=(d=n)&&d.name&&(A.name=encodeURIComponent(n.name)),null!=(m=n)&&m.parent_job_id&&(A.parent_job_id=n.parent_job_id);const C={entrypoint:(null==(f=t.entrypoint)?void 0:f.path)||(null==(h=t.entrypoint)?void 0:h.name),files:[]};null!=(g=n)&&g.content_type&&(C.content_type=n.content_type);const N={outputs:[C],...t.metadata?{metadata:t.metadata}:{},...!1===(null==(v=n)?void 0:v.optimizations)?{optimizations:!1}:{},...!0===(null==(x=n)?void 0:x.verify)?{verify:!0}:{}},P=[];for(let e=0;e<k.length;e++){var I,U,z;const t=k[e];let o=t.path||t.webkitRelativePath||t.name;if(null!=(I=o)&&I.includes(":"))throw new Error(`Invalid filename: ${o}`);let i=await t.arrayBuffer();const a=t.size;let s=t.type;if(null!=(U=s)&&U.length&&"unknown"!==s.toLowerCase()||(s=xc(i,o)),"deployment"===(null==(z=n)?void 0:z.type)){const e=_c(o,s);e&&(o=e.filename,s=e.mimetype)}const r=function(e){let t="";for(let n=0;n<e.length;n+=3){const o=e.charCodeAt(n),i=n+1<e.length?e.charCodeAt(n+1):0,a=n+2<e.length?e.charCodeAt(n+2):0;t+=vc[o>>2]+vc[(3&o)<<4|i>>4]+(n+1<e.length?vc[(15&i)<<2|a>>6]:"=")+(n+2<e.length?vc[63&a]:"=")}return t}(ic.ArrayBuffer.hash(i,!0));P[e]=i,C.files[e]={filename:o,content_type:s,content_length:a,content_md5:r}}if("deployment"!==(null==(b=n)?void 0:b.type)){const e=t.entrypoint.name.toLowerCase();let o;if(e.endsWith(".glb")||e.endsWith(".gltf"))try{const n=P[k.indexOf(t.entrypoint)];o=function(e){return function(e){if(!e)return!1;const t=!e.nodes||0===e.nodes.length,n=!e.meshes||0===e.meshes.length,o=Array.isArray(e.materials)&&1===e.materials.length;return t&&n&&o}(e)?"material":"3d-asset"}(e.endsWith(".glb")?function(e){const t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.byteLength<Ec+$c)throw new Error("Buffer too small to be a GLB");const n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(n.getUint32(0,!0)!==jc)throw new Error("Not a GLB (magic mismatch)");const o=n.getUint32(Ec,!0);if(n.getUint32(Ec+4,!0)!==Tc)throw new Error("First chunk is not JSON");const i=Ec+$c,a=i+o;if(a>t.byteLength)throw new Error("JSON chunk exceeds buffer length");const s=t.subarray(i,a),r=(new TextDecoder).decode(s);return JSON.parse(r)}(n):JSON.parse((new TextDecoder).decode(n)))}catch(e){return{success:!1,error:`Failed to inspect "${t.entrypoint.name}": ${e.message}`}}else e.endsWith(".mtlx")?o="material":(bc(e)||yc(e)||wc(e))&&(o="hdri");if(o){var L;if(null!=(L=n)&&L.content_type&&n.content_type!==o)return{success:!1,error:`Content type mismatch: "${t.entrypoint.name}" contains "${o}" but "${n.content_type}" was requested.`};C.content_type=o}}try{const e=await async function(e){var t,n,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 t=await e.slice(0,s).arrayBuffer();r=new Uint8Array(t)}catch{return null}return null!=(t=null!=(n=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 t=new DataView(e.buffer,e.byteOffset),n=t.getUint32(16,!1),o=t.getUint32(20,!1);return n&&o?{width:n,height:o}:null}(r))?a:function(e){if(e.length<28)return null;const t=[171,75,84,88,32,50,48,187,13,10,26,10];for(let n=0;n<t.length;n++)if(e[n]!==t[n])return null;const n=new DataView(e.buffer,e.byteOffset),o=n.getUint32(20,!0),i=n.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 t=new DataView(e.buffer,e.byteOffset);let n=8;for(;n<e.length;){const o=Oc(e,n);if(null===o)return null;if(0===o.length)return null;n+=o.length+1;const i=Oc(e,n);if(null===i)return null;if(n+=i.length+1,n+4>e.length)return null;const a=t.getInt32(n,!0);if(n+=4,a<0||n+a>e.length)return null;if("dataWindow"===o&&"box2i"===i&&16===a){const e=t.getInt32(n,!0),o=t.getInt32(n+4,!0),i=t.getInt32(n+8,!0)-e+1,a=t.getInt32(n+12,!0)-o+1;return i<=0||a<=0?null:{width:i,height:a}}n+=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 t=String.fromCharCode(e[12],e[13],e[14],e[15]);if("VP8 "===t){const t=16383&(e[26]|e[27]<<8),n=16383&(e[28]|e[29]<<8);return t&&n?{width:t,height:n}:null}return"VP8L"===t?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"===t?{width:1+(e[24]|e[25]<<8|e[26]<<16),height:1+(e[27]|e[28]<<8|e[29]<<16)}:null}(r))?n:function(e){if(e.length<4)return null;if(255!==e[0]||216!==e[1])return null;let t=2;for(;t<e.length-8;){for(;t<e.length&&255===e[t];)t++;if(t>=e.length)return null;const n=e[t++];if(1===n||n>=208&&n<=217)continue;if(t+2>e.length)return null;const o=e[t]<<8|e[t+1];if(o<2||t+o>e.length)return null;if(n>=192&&n<=207&&196!==n&&200!==n&&204!==n){if(t+7>e.length)return null;const n=e[t+3]<<8|e[t+4],o=e[t+5]<<8|e[t+6];return o&&n?{width:o,height:n}:null}t+=o}return null}(r))?t:function(e){if(e.length<10)return null;if(35!==e[0]||63!==e[1])return null;const t=new TextDecoder("latin1").decode(e.subarray(0,Math.min(e.length,4096))).match(/[+-]Y\s+(\d+)\s+[+-]X\s+(\d+)/);if(!t)return null;const n=parseInt(t[1],10),o=parseInt(t[2],10);return o&&n?{width:o,height:n}:null}(r)}(t.entrypoint);e&&(C.width=e.width,C.height=e.height)}catch(e){"debug"===j&&console.warn("readImageResolution failed; uploading without dimensions",e)}const F=await fetch($+Ue.upload.request,{...Le,method:"POST",headers:A,body:JSON.stringify(N)}).catch(e=>"fetch failed"==e.message||"Failed to fetch"==e.message?`Network error. Make sure you are connected to the internet and ${$} is reachable.`:(console.error("Failed to begin upload\n",e),null));if(null===F||"string"==typeof F)return{success:!1,error:F||"Failed to begin upload"};if(!F.ok){const e=await F.text();if(e.startsWith("{")){const t=JSON.parse(e);if("error"in t)return{success:!1,status:F.status,error:t.error}}return"none"!=j&&console.error("Failed to begin upload\n",F.status,e),{success:!1,status:F.status,error:`${e}`}}const D=await F.json();"debug"===j&&console.debug("BeginResponse",D);const q=k.reduce((e,t)=>e+t.size,0);var B;if("exists"===D.type)return"none"!=j&&console.log("Upload already exists",D.id),null!=(B=n)&&B.onStart&&n.onStart(D.id,D.content_id),{success:!0,uploadSkipped:!0,id:D.id,type:D.job_type,content_id:D.content_id,filesUploaded:k.length,totalSize:q,url:D.url,edit_url:D.edit_url};const M=t.entrypoint.webkitRelativePath||t.entrypoint.name;let W=0;null==(y=n)||null==(y=y.abort)||y.addEventListener("abort",async()=>{console.log("Upload aborted: Cancelling upload"),await fetch($+Ue.upload.cancel,{...Le,method:"POST",headers:{authorization:R,id:D.id}})});let G=!1,H=Date.now();function J(t,n,o=!1){if(!o&&Date.now()-H<1e3)return!1;if(G&&"completed"!==n)return void("none"!=j&&console.warn("Invalid status update..."));H=Date.now();const i=Math.floor(W/q*100);return"debug"===j&&console.log("SET STATUS: "+n,t,i),Dr({identifier:D.id,status:n,status_message:t,progress:i},e),!0}null!=(w=n)&&w.onStart&&n.onStart(D.id,D.content_id);const V=Date.now(),K=new Lc(k.length,q/1024/1024),Y=new Array,Z=function(e){let t=0;for(const n of e)Number.isFinite(n)&&n>=0&&(t=Math.max(t,n));return t>=nc?2:t>=Wc?4:10}(C.files.map(e=>e.content_length));"debug"===j&&console.debug(`Upload file concurrency: ${Z}`);let X=!1;const Q=[...k],ee=k.length,te=function(e,t=25e3){let n=!1;const o=setInterval(()=>{if(!n)try{const t=e();t&&"function"==typeof t.then&&t.catch(e=>{console.warn("[upload] heartbeat tick failed:",e)})}catch(e){console.warn("[upload] heartbeat tick threw:",e)}},t);return o&&"function"==typeof o.unref&&o.unref(),function(){n||(n=!0,clearInterval(o))}}(()=>J("Upload in progress","running",!0));try{var ne;for(let o=0;o<Q.length;o++){var oe;if(!(X||null!=(oe=n)&&null!=(oe=oe.abort)&&oe.aborted)){if(Y.length<Z){console.debug(`Uploading file ${o}/${k.length}: ${k[o].name}`);let i=0,a=0;const s=C.files[o],r=s.filename,c=P[o],l=s.content_length,p=s.content_type,u=k[o],d=u.name.endsWith(".gz")?"gzip":u.name.endsWith(".br")?"br":void 0,m=ol({uploadId:D.id,uploadRequestPUTUrl:D.request_put_url,entrypointPath:M,file:k[o],fileName:r,fileMd5:s.content_md5,fileBuffer:c,fileType:p,content_encoding:d,fileSize:l,fileIndex:o,fileNumber:o+1,fileCount:ee,loglevel:j,experimental:t.experimental,args:e,options:n,onProgress:e=>{var t;const s=e.progress||0;i=k[o].size*s;const c=i-a;if(a=i,W+=c,null!=(t=n)&&t.progress){const e=W/q,t=k.length,i=k[o].size,a=(Date.now()-V)/1e3,c=K.updateProgress(W/1024/1024);n.progress({uploadedBytes:W,totalBytes:q,progress01:e,fileName:k[o].name,fileSize:i,fileProgress01:s,fileIndex:o,totalFiles:t,estimatedTimeLeftDisplay:c.estimatedTimeRemainingString,estimatedTimeLeft:c.estimatedTimeRemaining,elapsedTime:a}),J(`Uploading file ${o+1}/${t} (${r}): ${(100*s).toFixed(0)}% of ${kc(q)}. Finished in approx. ${c.estimatedTimeRemainingString}`,"running",!1)}}}).then(e=>{if(!0!==e)return e;for(let e=Y.length-1;e>=0;e--)Y[e]===m&&Y.splice(e,1);J(`Uploaded ${kc(W)+" of "+kc(q)} for ${k[o].name}`,"running")}).catch(e=>{var t;null!=(t=n)&&null!=(t=t.abort)&&t.aborted?console.warn("Upload aborted"):(console.error(e.message),X=!0)});Y.push(m)}Y.length>=Z&&await Promise.race(Y)}}null!=(ne=n)&&null!=(ne=ne.abort)&&ne.aborted?console.debug("Upload aborted"):X&&console.debug("Upload failed"),await Promise.all(Y).catch(e=>{var t;null!=(t=n)&&null!=(t=t.abort)&&t.aborted?console.warn("Upload aborted"):(console.error(e.message),X=!0)})}finally{te()}if(X)return await Dr({identifier:D.id,status:"failed",error:"Failed to upload files"},e),{success:!1,error:"Failed to upload files"};if(null!=(_=n)&&null!=(_=_.abort)&&_.aborted)return await Dr({identifier:D.id,status:"canceled",status_message:"Upload aborted",error:"Upload aborted"},e),{success:!1,error:"Upload aborted"};G=!0,console.log(`Upload Done: All files uploaded to ${D.id}`);const ie={...ze(e),id:D.id};"none"!=j&&console.log("Completing upload - notify server");let ae=null;for(let e=0;e<5;e++){var se;await Rc(1e3*e);const t=AbortSignal.timeout(6e4+5e3*e);if(ae=await fetch($+Ue.upload.done,{...Le,method:"POST",headers:ie,signal:t}).catch(t=>(console.error(`Failed to complete upload (${e+1} / 5)`,t.message),null)),!0===(null==(se=ae)?void 0:se.ok))break;if(ae&&ae.status>=400&&ae.status<500)break;var re;"none"!=j&&e<4&&console.warn(`Failed to complete upload (${(null==(re=ae)?void 0:re.status)||"no status"}): will retry in 1 second`)}if(!ae)return console.error("Failed to complete upload"),{success:!1,error:"Failed to complete upload"};if(!ae.ok){if(524===ae.status)return console.error("Failed to complete upload: Gateway Timeout"),{success:!1,error:"Failed to complete upload: Gateway Timeout"};{const e=await ae.text().catch(()=>"");return console.error(`Failed to complete upload (${ae.status}): ${e}`),{success:!1,error:`Failed to complete upload: ${e?e.substring(0,300):`status ${ae.status}`}`}}}"none"!=j&&console.log("Upload complete");const ce=await ae.json();return{success:!0,type:ce.type,uploadSkipped:!1,id:ce.id,content_id:ce.content_id,url:ce.url,edit_url:ce.edit_url,filesUploaded:k.length,totalSize:q}}(e,t,n);return await o.finally(()=>{})}const Hc=[".html",".js",".css"],Jc=[".gz",".br"];function Vc(e){return"path"in e&&e.path?e.path:e.name}function Kc(e){var t;const n=null==e||null==(t=e.config)?void 0:t.url;if(!n)return null;try{return new URL(n).host}catch{return null}}const Yc=400,Zc=255;function Xc(e){const t="string"==typeof e?e:String(null!=e?e:"");return t.length<=Zc?t:t.slice(0,Zc-1)+"…"}const Qc={ECONNRESET:"connection reset before the upload completed",ECONNREFUSED:"connection refused by the storage host",ECONNABORTED:"connection aborted — timed out or closed mid-request",ENOTFOUND:"DNS lookup failed for the storage host",EAI_AGAIN:"DNS lookup failed temporarily — resolver unavailable",ETIMEDOUT:"connection timed out",EPIPE:"connection closed while sending the file",EHOSTUNREACH:"storage host unreachable from this network",ENETUNREACH:"network unreachable",EPROTO:"TLS or protocol error",ERR_NETWORK:"network error — the request never reached the storage host",CERT_HAS_EXPIRED:"the TLS certificate for the storage host has expired",UNABLE_TO_VERIFY_LEAF_SIGNATURE:"the TLS certificate for the storage host could not be verified",DEPTH_ZERO_SELF_SIGNED_CERT:"a self-signed TLS certificate was presented for the storage host",SELF_SIGNED_CERT_IN_CHAIN:"a self-signed TLS certificate was presented for the storage host"};function el(e){if(!e)return"unknown upload error";const t=[];try{const i=e.response,a=null==i?void 0:i.status,s=null==i?void 0:i.statusText;a&&t.push(`HTTP ${a}${s?" "+s:""}`);const r=null==i?void 0:i.data;if(null!=r){var n,o;let i;if("string"==typeof r)i=r;else try{i=JSON.stringify(r)}catch{i=String(r)}const a=null==(n=i.match(/<Code>([^<]+)<\/Code>/))?void 0:n[1],s=null==(o=i.match(/<Message>([^<]+)<\/Message>/))?void 0:o[1];if(a)t.push(`S3 ${a}${s?": "+s:""}`);else if(function(e){return/^\s*(<!DOCTYPE\s+html|<html[\s>])/i.test(e)}(i)){const n=Kc(e);t.push("blocked by a network filter or proxy"+(n?` before it reached ${n}`:"")+" — ask your network administrator to allow this host")}else i&&t.push(i.slice(0,200))}let c=null;if(!i&&(c=function(e){var t,n;const o=null!=(t=null==e?void 0:e.code)?t:null==e||null==(n=e.cause)?void 0:n.code;return"string"==typeof o&&o.length?o:null}(e),c)){const n=Qc[c];t.push(n?`${c} (${n})`:c);const o=Kc(e);o&&t.push(`while uploading to ${o}`)}const l=e.message?String(e.message):"",p=a&&/^Request failed with status code \d+$/.test(l)||null!==c&&l.includes(c);l&&!p&&t.push(l)}catch{}return 0===t.length&&e.message&&t.push(String(e.message)),t.length?t.join(" — "):"unknown upload error"}const tl=12e4;function nl(e,t){let n=null,o=!1;const i=()=>{n&&(clearTimeout(n),n=null)};return{reset:()=>{o||(i(),n=setTimeout(()=>{o=!0,n=null,t()},e))},cancel:i}}async function ol(e){if(e.fileSize>=nc)return async function(e){const{uploadId:t,entrypointPath:n,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=()=>({...ze(l),"Content-Type":"application/json",org:l.org,job_id:t}),b={...x(),filesize:c.toString()},y=JSON.stringify({filename:i,entrypoint:n,"content-type":s,"content-md5":a,"content-encoding":r,output_index:0});async function w(e,t,n){const o=await fetch(e,{...Le,method:"POST",headers:t,body:JSON.stringify(n)});if(!o.ok)throw new Error(`${e} ${o.status}: ${await o.text().catch(()=>"")}`);return o.json()}return await async function(e){const{size:t,slice:n,partSize:o=tc,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,t=tc){if(!Number.isFinite(e)||e<=0)return[];let n=Math.max(t,Qr,Math.ceil(e/ec));const o=[];let i=0,a=1;for(;i<e;){const t=Math.min(i+n,e);o.push({partNumber:a,start:i,end:t,size:t-i}),i=t,a++}return o}(t,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 S=async e=>{const t=y.get(e.partNumber);if(!t)throw new Error(`Missing presigned url for part ${e.partNumber}`);let o=!1;const i=await Zr(async()=>{if(await h())throw o=!0,new Error("Upload aborted");try{const o=n(e.start,e.end),i=await l({url:t,payload:o,partNumber:e.partNumber,size:e.size,signal:m});if(!i)throw new Error(`No ETag returned for part ${e.partNumber}`);return i}catch(e){throw await h()&&(o=!0),e}},{maxAttempts:a+1,baseMs:s,isRetryable:e=>!o&&Kr(e),...s>0?{}:{sleep:async()=>{}}});if(!i.ok)throw i.error||new Error(`Failed to upload part ${e.partNumber}`);w.push({part_number:e.partNumber,etag:i.value}),_+=e.size,d&&d(_)},j=[...g],T=Math.max(1,Math.min(i,g.length));if(await Promise.all(Array.from({length:T},()=>(async()=>{for(;j.length>0;){if(k||await h())return;const e=j.shift();if(!e)return;try{await S(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,t)=>e.part_number-t.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,t)=>o.slice(e,t),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+Ue.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 t=await e.json();return{upload_id:t.upload_id,key:t.key}},getPartUrls:async(e,t,n)=>(await w(v+Ue.upload.multipart_part_urls,x(),{key:t,upload_id:e,part_numbers:n})).urls,putPart:g||(({url:e,payload:t,partNumber:n,signal:o})=>async function({url:e,payload:t,partNumber:n,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=nl(tl,()=>{r=!0,s.abort()});l.reset();try{var p,u;const n=await zr.put(e,t,{...Le,...await Bc(),withCredentials:!1,signal:s.signal,headers:{"Content-Type":o},onUploadProgress:()=>l.reset()});if(200!==n.status)throw new Error(el({response:n}));const i=(null==(p=n.headers)?void 0:p.etag)||(null==(u=n.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 ${n} stalled: no progress for ${tl/1e3}s`);throw new Error(el(e))}finally{l.cancel(),a&&a.removeEventListener("abort",c)}}({url:e,payload:t,partNumber:n,signal:o,contentType:s})),completeUpload:async(e,t,n)=>w(v+Ue.upload.multipart_complete,x(),{key:t,upload_id:e,parts:n}),abortUpload:async(e,t)=>{await fetch(v+Ue.upload.multipart_abort,{...Le,method:"POST",headers:x(),body:JSON.stringify({key:t,upload_id:e})}).catch(()=>{})}}),!0}(e);const{uploadId:t,uploadRequestPUTUrl:n,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={...ze(h),"Content-Type":"application/json",org:h.org,job_id:t,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,_="";const k=await Zr(async()=>{var e;if(null!=g&&null!=(e=g.abort)&&e.aborted)throw new Lr("Upload aborted");const t=await fetch(n,{...Le,method:"POST",headers:x,body:y});if(!t.ok){const e=await t.text().catch(()=>"");throw _=e,{response:{status:t.status,statusText:t.statusText,data:e}}}return await t.json()},{baseMs:500,onRetry:({attempt:e,waitMs:t,error:n})=>{console.warn(`Failed to get presigned url for "${a}" "${l}": ${el(n)}\n→ Retry #${e} in ${t}ms`)}});if(k.ok)w=k.value;else if(k.error instanceof Lr)throw k.error;if(null==w){const e=_||el(k.error);throw new Error(`Failed to get presigned url for "${a}" "${l}" \n${e}`)}const S=w.presigned_url;var j=!1;let T=null;const E=[];let $=0;const O=await Zr(async t=>{var n;if(null!=g&&null!=(n=g.abort)&&n.aborted)throw new Lr("Upload aborted");const o={"Content-Type":l,"Content-MD5":r};v&&(o["Content-Length"]=c.toString()),p&&(o["Content-Encoding"]=p),1===t&&"none"!=f&&console.log(`Uploading file ${d}/${m}: ${a}`),"debug"===f&&console.debug("PUT with headers",o);const i=new AbortController;let u=!1;const h=()=>i.abort();null!=g&&g.abort&&(g.abort.aborted?i.abort():g.abort.addEventListener("abort",h,{once:!0}));const x=nl(tl,()=>{u=!0,i.abort()});x.reset();try{const t=await zr.put(S,s,{...Le,...await Bc(),withCredentials:!1,signal:i.signal,headers:o,onUploadProgress:t=>{x.reset(),e.onProgress(t)}});if(200!==t.status)throw{response:t};return t}catch(e){var b;if(null!=g&&null!=(b=g.abort)&&b.aborted)throw new Lr("Upload aborted");if(u)throw T=`stalled: no upload progress for ${tl/1e3}s`,E.push(T),"none"!==f&&console.error(`Upload stalled (PUT) (${d}, ${a}) after ${tl/1e3}s with no progress`),new Error(T);throw T=el(e),E.push(T),e instanceof Lr||("none"!==f&&console.error(`Failed to upload file (PUT) (${d}, ${a}) "${T}"`),"debug"===f&&(console.log(o,{fileSize:c}),e.response?console.debug(e.response):console.debug(e))),e}finally{x.cancel(),null!=g&&g.abort&&g.abort.removeEventListener("abort",h)}},{onRetry:({attempt:e,waitMs:t})=>{"none"!==f&&console.log(`Retry PUT #${e} for file ${a} in ${t}ms`)}});if($=O.attempts,O.ok)j=!0,"info"===f&&console.log(`Uploaded file ${d}/${m} "${a}" (${l}, ${kc(c)})`);else if(O.error instanceof Lr)throw O.error;if(!j){var R;const e=null!=(R=function(e){if(!Array.isArray(e))return null;const t=[];for(const n of e){if("string"!=typeof n)continue;const e=n.trim();e&&!t.includes(e)&&t.push(e)}return t.length?t.join("; "):null}(E))?R:T,n=function(e,t,n){const o="string"==typeof t?t.trim():"",i="number"==typeof n&&n>1?` after ${n} attempts`:"";return o?`Failed to upload file ${e}${i}: ${o.length>Yc?o.slice(0,Yc)+"…":o}`:`Failed to upload file ${e}${i}`}(a,e,$);throw console.error(n),await Dr({identifier:t,status:"failed",status_message:Xc(n),error:"Failed to upload file "+a},h),new Error(n)}return!0}async function il(e,t,n){const o=e.baseUrl+Ue.jobs.presigned_url,i=await fetch(o,{...Le,method:"POST",headers:{...ze(e),job_id:t},body:JSON.stringify(n)}).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 al(e,t){const n=e.baseUrl+Ue.jobs.create,o={...ze(e),"content-type":"application/json"},i={type:"ai-material",triggered_by:e.trigger_type,parameters:{...t}},a=await fetch(n,{...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 sl(e,t={}){const n=new URL(e.baseUrl+Ue.content.root);t.content_type&&n.searchParams.set("content_type",t.content_type),t.content_format&&n.searchParams.set("content_format",t.content_format),t.search&&n.searchParams.set("search",t.search),t.tags&&n.searchParams.set("tags",t.tags),t.types&&n.searchParams.set("types",t.types),t.trash&&n.searchParams.set("trash","true"),t.is_public&&n.searchParams.set("is_public","true"),t.page&&n.searchParams.set("page",String(t.page)),t.limit&&n.searchParams.set("limit",String(t.limit)),t.collection_id&&n.searchParams.set("collection_id",t.collection_id),t.offset&&n.searchParams.set("offset",String(t.offset));const o=ze(e),i=await fetch(n,{...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 rl(e,t){const n=`${e.baseUrl}${Ue.content.root}/${t}`,o=ze(e),i=await fetch(n,{...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()}async function cl(e,t){const n=`${e.baseUrl}${Ue.content.root}/${t}`,o=ze(e),i=await fetch(n,{...Le,method:"DELETE",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to delete content (${i.status}): ${e}`)}return await i.json()}const ll={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 t=(null==e?void 0:e.file)||"SKILL.md";if(t.includes("..")||t.startsWith("/"))return{error:"Invalid file path."};try{const e="https://raw.githubusercontent.com/needle-tools/ai/main/providers/claude/plugin/skills/needle-engine/"+encodeURI(t),n=new AbortController,o=setTimeout(()=>n.abort(),5e3),i=await fetch(e,{signal:n.signal,redirect:"follow"});return clearTimeout(o),i.ok?{content:await i.text()}:{error:`Could not fetch '${t}' (HTTP ${i.status})`}}catch(e){return{error:`Error fetching skill: ${e.message}`}}}};function pl(e){let t,n=null,o="";for(const i of e.split("\n"))i.startsWith("event: ")?n=i.slice(7).trim():i.startsWith("data: ")?o=i.slice(6):i.startsWith("id: ")&&(t=parseInt(i.slice(4).trim(),10));if(!n)return null;let i=null;switch(n){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"notice":i={type:"notice",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:t,...n}=e;i={type:"done",token_usage:n},t&&(i.chat_url=t);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!==t&&(i.id=t),i}function ul(e,t){const n=ze(e);return null!=t&&t.personal&&(n["x-needle-ai-chat"]="personal"),null!=t&&t.instanceId&&(n["x-needle-instance-id"]=t.instanceId),n}function dl(e,t){return t.stream?async function*(e,t){const n=new URL(e.baseUrl+Ue.ai.chat),o=ul(e,t);o["Content-Type"]="application/json";const i={type:"new_message",slug:t.slug,message:t.message,stream:!0,source:t.source,full_url:t.full_url,pathname:t.pathname,context:t.context,disabled_tools:t.disabled_tools},a=await fetch(n,{...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 t=e.getReader(),n=new TextDecoder;let o="";try{for(;;){const{done:e,value:i}=await t.read();if(e)break;o+=n.decode(i,{stream:!0});const a=o.split("\n\n");o=a.pop()||"";for(const e of a){const t=pl(e);t&&(yield t)}}if(o.trim()){const e=pl(o);e&&(yield e)}}finally{t.releaseLock()}}(a.body)}(e,t):async function(e,t){const n=new URL(e.baseUrl+Ue.ai.chat),o=ul(e,t);o["Content-Type"]="application/json";const i={type:"new_message",slug:t.slug,message:t.message,stream:!1,source:t.source,full_url:t.full_url,pathname:t.pathname,context:t.context,disabled_tools:t.disabled_tools},a=await fetch(n,{...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,t)}const ml=200,fl=["github.com","gitlab.com","bitbucket.org"],hl=/[\w.+-]+@[\w-]+\.[\w.]+/;function gl(e){if(e)return hl.test(e)?void 0:e}function vl(e,t){return String(g("git",e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],...t?{cwd:t}:{}})||"").trim()}function xl(e,t){try{return vl(e,t)}catch{return""}}function bl(e){try{const t=vl(["rev-parse","HEAD"],e);if(!t)return null;const n=xl(["rev-parse","--abbrev-ref","HEAD"],e),o=xl(["log","-1","--pretty=%s"],e),i=gl(xl(["log","-1","--pretty=%an"],e)),a=xl(["status","--porcelain"],e).length>0,s=xl(["remote","get-url","origin"],e),r=t.slice(0,7),{repository:c,url:l}=function(e,t){if(!e)return{};const n=/^(?:https?:\/\/(?:[^@/]+@)?([^/]+)\/|git@([^:]+):)(.+?)(?:\.git)?$/.exec(e.trim());if(!n)return{};const o=(n[1]||n[2]||"").toLowerCase(),i=n[3];return i?fl.includes(o)?{repository:i,url:`https://${o}/${i}/${"bitbucket.org"===o?"commits":"commit"}/${t}`}:{repository:i}:{}}(s,t),p={type:"git",id:t,label:`${n||r}@${r}${a?" (dirty)":""}`};return n&&(p.branch=n),i&&(p.author=i),o&&(p.message=o.slice(0,ml)),a&&(p.dirty=!0),c&&(p.repository=c),l&&(p.url=l),p}catch{return null}}function yl(e){if("string"==typeof e)return e.trim()||void 0}const wl=()=>"https://cloud.needle.tools/account",_l=()=>"https://cloud.needle.tools/edit";function kl(e){return v(e)}const Sl=["node_modules",".git",".vscode",".vercel",".github",".idea"];function jl(e,t,n=null,o="",i=0){if(null===n){if(i>0)throw new Error("result must be provided if level > 0. Did you forget to pass it?");n={files:[],total_size:0}}if(0===i){if(!r(t))throw new Error(`Directory or file "${t}" does not exist.`);if(c(t).isFile()){const e=gc(t,l(t));return e.path=e.name,n.files.push(e),n.entrypoint=e,n}}else if(i>20)throw new Error("Recursion depth too high. Are you sure you are providing the correct directory?");const a=p(t,{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=gc(o+i.name,l(t+"/"+i.name));if(n.files.push(a),n.total_size+=a.size,n.total_size>1073741824)throw new Error(`Collected filesize exceeds ${1024..toFixed(0)} MB. Are you sure you are providing the correct directory?`);if(n.files.length>1e4)throw new Error(`Too many files (${n.files.length}): The maximum filecount is 10,000.`)}var s;for(const s of a)if(s.isDirectory()){if(Sl.includes(s.name))continue;jl(e,t+"/"+s.name,n,o+s.name+"/",i+1)}return n}const Tl=new RegExp("\\beyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\b","g"),El=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"),$l=new RegExp("(Authorization:\\s*)([^\\s,;\"']+(?:\\s+[^\\s,;\"']+)?)","gi"),Ol=new RegExp("\\bBearer\\s+([A-Za-z0-9._\\-=]+)","g"),Rl=new RegExp("([?&]token=)([^&\\s\"'<>]+)","g"),Al=new RegExp("<redacted:\\d+ch>","g");function Cl(e){if("string"!=typeof e)return e;if(0===e.length)return e;if(Al.test(e)&&(Al.lastIndex=0,!function(e){Tl.lastIndex=0,El.lastIndex=0,$l.lastIndex=0,Ol.lastIndex=0,Rl.lastIndex=0;const t=Tl.test(e)||El.test(e)||$l.test(e)||Ol.test(e)||Rl.test(e);return Tl.lastIndex=0,El.lastIndex=0,$l.lastIndex=0,Ol.lastIndex=0,Rl.lastIndex=0,t}(e.replace(Al,""))))return e;Al.lastIndex=0;let t=e;return t=t.replace($l,(e,t,n)=>`${t}<redacted:${n.length}ch>`),t=t.replace(Rl,(e,t,n)=>`${t}<redacted:${n.length}ch>`),t=t.replace(Ol,(e,t)=>`<redacted:${("Bearer "+t).length}ch>`),t=t.replace(Tl,e=>`<redacted:${e.length}ch>`),t=t.replace(El,e=>`<redacted:${e.length}ch>`),t}const Nl=["cli.log","cli.prev.log"],Pl=M.join(q.homedir(),".needle","cli","logs");E(Pl,{recursive:!0});try{!function(e,t){const n={migrated:[],skipped:[]};if(!e||!t)return n;if(M.resolve(e)===M.resolve(t))return n;if(!T(e))return n;for(const o of Nl){const i=M.join(e,o);if(T(i))try{E(t,{recursive:!0});const e=M.join(t,o);if(T(e)){const e=M.join(t,o.replace(/\.log$/,"")+".legacy.log");$(i,e),n.skipped.push(o)}else $(i,e),n.migrated.push(o)}catch(e){console.error(`[needle-cloud] Failed to migrate legacy log ${o}: ${e instanceof Error?e.message:e}`)}}}(M.join(O(q.tmpdir()),"Needle","Cloud","logs"),Pl)}catch(e){console.error(`[needle-cloud] legacy log migration check failed: ${e instanceof Error?e.message:e}`)}const Il=M.resolve(Pl,"cli.log");if(T(Il)){const e=R(Il),t=e.mtimeMs;if(Date.now()-t>432e5||e.size>52428800){const e=zl();A(Il,e,t=>{t?console.error(`Failed to rename log file: ${t.message}`):console.log(`Log file renamed to ${e}`)})}}function Ul(){return Il}function zl(){return M.resolve(Pl,"cli.prev.log")}function Ll(e,t){try{let n=Cl(String(null!=e?e:""));return n=`[${(new Date).toISOString()}] ${n}`,null!=t&&t.emptyLineBefore&&(n="\n"+n),C(Il,n+"\n"),!0}catch(e){return console.error(`Failed to write to log file: ${e instanceof Error?e.message:e}`),!1}}async function Fl(e,t){return e=Cl(e),e=`[${(new Date).toISOString()}] ${e}`,null!=t&&t.emptyLineBefore&&(e="\n"+e),D(Il,e+"\n",{flag:"a"}).then(()=>!0).catch(e=>(console.error(`Failed to write to log file: ${e.message}`),!1))}var Dl={__proto__:null,getLogFilePath:Ul,getPrevLogsFilePath:zl,getPipelineLogFilePath:function(){return M.join(q.homedir(),".needle","optimization-pipeline","logs","pipeline.log")},writeToLogFileSync:Ll,writeToLogFile:Fl};function ql(e,t,n){process.env.GITHUB_ACTIONS&&(process.env.GITHUB_OUTPUT?u(process.env.GITHUB_OUTPUT,`${e}=${t}\n`):null==n||n.logger.warn("GITHUB_OUTPUT environment variable is not set. Cannot set output variables."))}async function Bl(e){var t;e.directory=x.resolve(e.directory);let{files:n,entrypoint:o}=jl("deployment",e.directory);if(e.entrypoint&&(o=n.find(t=>t.path===e.entrypoint),!o))return process.exitCode=1,void j().fail(`Entrypoint "${e.entrypoint}" not found. Please make sure you provide a valid entrypoint.`);if(!o){const e=Pc(n);if("error"in e)return process.exitCode=1,Fl(`[Deployment] Error determining entrypoint: ${e.error}`),void j().fail(`Error: ${e.error}`);o=e}if(!(n.length>0&&o&&(o.name.toLowerCase().endsWith(".html")||o.name.toLowerCase().endsWith(".html.gz")||o.name.toLowerCase().endsWith(".html.br"))))return process.exitCode=1,Fl("[Deployment] Deployment is not valid: No .html file found."),void j().fail("Deployment is not valid: No .html file found.");if(!o)return process.exitCode=1,Fl("[Deployment] No entrypoint found. Please provide an index.html file in your project."),void j().fail("No entrypoint found. Please provide an index.html file in your project.");const i=null!=(t=e.endpoint)&&t.length?e.endpoint:"https://cloud.needle.tools/api";let a=e.name;a||(a=Ml(e.directory)||void 0);let s=null==i?void 0:i.includes("localhost");const r=a?` of "${a}"`:"",c=j().start(`Begin deployment${r} ${s?"(local)":""} of ${n.length} files...`);c.spinner="earth",await Rc(50);let l=-1,p=null;const u=e.noProvenance?null:function(e=process.env,t,n){try{return function(e=process.env,t){try{if(yl(e.NEEDLE_CLOUD_NO_PROVENANCE))return null;let n=bl(t);yl(e.GITHUB_ACTIONS)&&(n=function(e,t){var n,o;const i=yl(t.GITHUB_SHA),a=yl(t.GITHUB_REF_NAME),s=yl(t.GITHUB_REPOSITORY),r=null!=(n=yl(t.GITHUB_SERVER_URL))?n:"https://github.com";if(!i&&!a)return e;const c={type:"git",...null!=e?e:{}};i&&(c.id=i),a&&(c.branch=a),s&&(c.repository=s),s&&i&&(c.url=`${r}/${s}/commit/${i}`);const l=String(null!=(o=c.id)?o:"").slice(0,7);return l&&(c.label=`${a||l}@${l}${c.dirty?" (dirty)":""}`),c}(n,e));const o=function(e=process.env){var t;if(!yl(e.CI))return{type:"local"};if(!yl(e.GITHUB_ACTIONS))return{type:"ci"};const n={type:"github-actions"},o=yl(e.GITHUB_RUN_ID),i=yl(e.GITHUB_REPOSITORY),a=null!=(t=yl(e.GITHUB_SERVER_URL))?t:"https://github.com";o&&(n.id=o);const s=gl(yl(e.GITHUB_ACTOR));return s&&(n.actor=s),yl(e.GITHUB_EVENT_NAME)&&(n.event=yl(e.GITHUB_EVENT_NAME)),o&&i&&(n.url=`${a}/${i}/actions/runs/${o}`),n}(e);return n||"local"!==o.type?{...n?{source:n}:{},runner:o,client:{name:"needle-cloud-cli"}}:null}catch(e){var n;return console.warn(`[provenance] Could not determine provenance: ${null!=(n=null==e?void 0:e.message)?n:e}`),null}}(e,t&&bl(t)?t:n)}catch(e){var o;return console.warn(`[provenance] Could not determine provenance: ${null!=(o=null==e?void 0:e.message)?o:e}`),null}}(process.env,e.directory);if(null!=u&&u.source){var d;const{label:e,author:t}=u.source;Fl(`[provenance] ${e}${t?` by ${t}`:""} (${null==(d=u.runner)?void 0:d.type})`)}Fl(`Deployment started${r} ${s?"(local)":""} of ${n.length} files...`);const m=await Gc({baseUrl:i,authToken:e.token,org:e.org_id},{triggered_by:"cli",files:n,entrypoint:o,experimental:e.experimental,raw:e.raw,...u?{metadata:u}:{}},{name:a,type:"deployment",loglevel:e.verbose?"debug":"none",progress:e=>{if(e.fileIndex!==l){l=e.fileIndex;const t=e.totalBytes/1024/1024;c.text=`Uploading file ${e.fileIndex+1} of ${e.totalFiles} files: ${(e.uploadedBytes/1024/1024).toFixed(1)} / ${t.toFixed(1)} MB. Total progress: ${(100*e.progress01).toFixed(1)} %. Time passed: ${e.elapsedTime.toFixed(0)}sec. About ${e.estimatedTimeLeftDisplay} until complete.`}}}).catch(e=>(p=e instanceof Error?e.message:String(e),null));if(null!=m&&!0===m.success){c.succeed(`🚀 Deployment${r} successful (${m.content_id}/${m.id})`);let t="";t=m.url?m.url:"https://cloud.needle.tools/view/"+m.content_id+"/"+m.id,console.log("🔗 View the deployment at: "+t),e.open&&kl(t);try{ql("deployment_url",t,{logger:e.logger}),ql("edit_id",m.content_id,{logger:e.logger})}catch(t){e.logger.error("Error writing output for CI: "+t)}}else{process.exitCode=1;const e=p||(null==m?void 0:m.error)||"Deployment failed";Fl(`[Deployment] Failed: ${e}`),c.fail(e)}}function Ml(e,t=0){if(t>10)return null;const n=x.join(e,"needle.config.json");if(r(n)){const t=x.join(e,"package.json");if(r(t)){var o;const e=l(t,"utf8"),n=JSON.parse(e);if(null!=(o=n.name)&&o.length)return n.name}return x.basename(e)}const i=x.dirname(e);return i===e?null:Ml(i,t+1)}async function Wl(e,t={}){const n=t.purposeLabel?` ${t.purposeLabel}`:"";if(!r(e.fileOrDirectory))return j().fail(`File not found: ${e.fileOrDirectory}`),{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 ${wl()}`};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=b(e.fileOrDirectory);const o=j(`Gathering files ${e.fileOrDirectory}`).start();let i=null;try{i=jl("optimization",e.fileOrDirectory)}catch(t){return j().fail(`${t.message||`Failed to collect files in ${e.fileOrDirectory}`}`),{error:"Failed to collect files"}}o.text=`Uploading ${i.files.length} files${n}:\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 t,n;if(function(e){return e.some(e=>{let t=e.name.toLowerCase();return!!(t.endsWith(".html")||t.endsWith(".htm")||t.endsWith(".html.gz")||t.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(null==e||!e.length)return!1;const t=e.filter(e=>bc(e.name)||yc(e.name)||wc(e.name));return 1===t.length&&Pc(e)===t[0]}(e))return{kind:"environment-texture",contentType:"hdri",uploadType:void 0,canOptimize:!1,canConvertToGLB:!1};const o=null!=(t=null==(n=e[0])||null==(n=n.name.split(".").pop())?void 0:n.toLowerCase())?t:"";return{kind:"asset",contentType:"3d-asset",uploadType:void 0,canOptimize:e.some(e=>{var t;const n=null==(t=e.name.split(".").pop())?void 0:t.toLowerCase();return null!=n&&Ic.has(n)}),canConvertToGLB:Uc.has(o)}}(i.files),c="asset"===s.kind?void 0:s.contentType,l=await Gc({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:c,...!1===t.optimizations?{optimizations:!1}:{},loglevel:e.verbose?"debug":"none",progress:e=>{o.text=`Uploading ${e.fileName} - finished in approx. ${e.estimatedTimeLeftDisplay}, ${100*e.progress01}%`}});if(0==l.success){const e=`${l.error||"Unknown error: could not start upload"}`;return o.fail(e),{error:e,noprint:!0}}const p=l.edit_url||`${_l()}/${l.content_id}?select_team=1`;return o.succeed(l.uploadSkipped?`Files have already been uploaded to ${p}`:`Uploaded ${i.files.length} files${n} to ${p}`),{res:l,editUrl:p}}async function Gl(e){if(!e.outDir)throw new Error("Output directory is required");const t=j("Downloading results...").start(),n=await async function(e){const t=await async function(e){if(!e.identifier)return null;const t={...ze(e)},n={job_id:e.identifier,fields:e.fields,content_format:e.content_format},o=e.baseUrl+Ue.jobs.query,i=await fetch(o,{...Le,method:"POST",headers:t,body:JSON.stringify(n)}).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==t||!t.results)return{error:`Job ${e.identifier} did not produce any result files`};const n=t.results;if(!n.bucket||!n.directory)return{error:`Job ${e.identifier} has incomplete result data`};const o=[];for(const t of n.files){if((i=t.filename).startsWith(".extras/")||i.startsWith(".extras\\")||i.endsWith("screenshot.needle.webp")||Fr.test(i)||i.endsWith(".needle.log"))continue;const a=`${n.directory}/${t.filename}`,s=await il(e,e.identifier,{bucket:n.bucket,key:a});if(!s){console.error(`Failed to get presigned URL for: ${t.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}): ${t.filename}`);continue}const c=await r.arrayBuffer().catch(e=>(console.error(e),null));if(!c)return{error:`Failed to read downloaded file: ${t.filename}`};o.push({filename:t.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 n)return t.fail(n.error),{error:n.error};const o=[];for(const i of n.files){t.text=`Downloading ${i.filename}`,r(e.outDir)||d(e.outDir,{recursive:!0});let a=i.filename;if(e.filename){const t=i.filename.substring(i.filename.lastIndexOf("."));if(1===n.files.length)a=e.filename.includes(".")?e.filename:e.filename+t;else{const t=i.filename.substring(i.filename.lastIndexOf(".")),n=i.filename.substring(0,i.filename.lastIndexOf("."));a=e.filename+"-"+n+t}}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 t.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 Hl(e){const{token:t,org_id:n,slug:o,message:i,stream:a}=e;if(a){const e=dl({baseUrl:"https://cloud.needle.tools/api",authToken:t,org:n},{slug:o,message:i,stream:!0,source:"cli"});for await(const t of e)switch(t.type){case"delta":process.stdout.write(t.content);break;case"message":break;case"status":process.stdout.write(`[${t.message}]\n`);break;case"error":return void j().fail(t.message);case"tool_call":process.stdout.write(`[tool: ${t.name}]\n`);break;case"done":process.stdout.write("\n")}}else{const e=j("Thinking...").start(),a=await dl({baseUrl:"https://cloud.needle.tools/api",authToken:t,org:n},{slug:o,message:i,stream:!1,source:"cli"});e.stop(),console.log(a.content)}}async function Jl(e,t=cl){if(!e.identifier)throw new Error("A content identifier is required");return t({baseUrl:e.endpoint,authToken:e.authToken,org:e.org},e.identifier)}async function Vl(e){const t=new URL((e.endpoint||"https://cloud.needle.tools/api")+Ue.get.deployments);t.searchParams.append("offset",e.offset.toString()),t.searchParams.append("limit",e.limit.toString()),e.names&&t.searchParams.append("name",e.names.map(e=>e.trim()).join(","));const n=await fetch(t,{method:"GET",headers:{...ze({authToken:e.authToken,org:e.org})}});return n.ok?await n.json():{status:n.status,error:await n.text()}}const Kl=["#e06c75","#d19a66","#e5c07b","#98c379","#7ec8a4","#56b6c2","#61afef","#528bff","#c678dd","#e88de4","#be5046","#d4976c","#b5cea8","#4ec9b0","#9cdcfe","#c8ae9d"];function Yl(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;const[n,o,i]=function(e){const t=parseInt(e.slice(1),16);return[t>>16&255,t>>8&255,255&t]}(Kl[Math.abs(t)%Kl.length]);return`[38;2;${n};${o};${i}m${e}[0m`}function Zl(e){return`[2m${e}[0m`}const Xl=8424,Ql="http://localhost:8424",ep=/^\[(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)\]\s?(.*)$/,tp=/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2}):\s*(.*)$/,np=[[/^\[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"]],op=[[/^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 ip(e){for(const[t,n]of np)if(t.test(e))return n;return"general"}function ap(e){for(const[t,n]of op)if(t.test(e))return n;return"info"}const sp=new RegExp("\\b([A-Z][A-Z0-9_]*(?:_KEY|_TOKEN|_SECRET|_PASSWORD))=([^\\s,;\"']+)","g"),rp=new RegExp("\\b(User(?:name)?:\\s*)([A-Za-z0-9._\\-]{1,64})","g"),cp=new RegExp("\\b[A-Za-z0-9._%+\\-]+@[A-Za-z0-9.\\-]+\\.[A-Za-z]{2,}\\b","g"),lp=52428800;function pp(e,t){if(!T(e))return null;if(t<=0)return"";const{size:n}=R(e);if(0===n)return"";const o=n>t?n-t:0,i=n-o,a=Buffer.allocUnsafe(i),s=N(e,"r");try{let e=0;for(;e<i;){const t=P(s,a,e,i-e,o+e);if(0===t)break;e+=t}}finally{I(s)}if(o>0){const e=a.indexOf(10);return-1===e?"":a.slice(e+1).toString("utf8")}return a.toString("utf8")}async function*up(e){const t=me({input:U(e,{encoding:"utf8"}),crlfDelay:Infinity});for await(const e of t)yield e}function dp(e,t,n,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 t=null,n=e,o=e.match(ep);if(o)t=o[1],n=o[2];else if(o=e.match(tp),o){const e=new Date(`${o[1]}T${o[2]}`);Number.isNaN(e.getTime())||(t=e.toISOString(),n=o[3])}return{ts:t,level:ap(n),source:ip(n),message:n}}(e),r=null!=(i=null!=(a=s.ts)?a:n)?i:null,c=s.level,l=null!=t?t:s.source;return function(e){if("string"!=typeof e)return[e];if(e.length<=16384)return[e];const t=e.length,n=Math.max(1,16344),o=Math.ceil(t/n),i=[];for(let a=0;a<o;a++){const s=a*n,r=e.slice(s,s+n);i.push(`${r} [chunk ${a+1}/${o} of ${t} bytes]`)}return i}(function(e,t){if("string"!=typeof e)return e;if(0===e.length)return e;let n=Cl(e);return n=function(e,t){if(!t)return e;const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\\/g,"\\\\+"),o=new RegExp(n,"gi");return e.replace(o,"~")}(n,null==t?void 0:t.homeDir),n=function(e){return e.replace(sp,(e,t,n)=>`${t}=<redacted:${n.length}ch>`)}(n),n=function(e){return e.replace(rp,(e,t,n)=>`${t}<redacted:${n.length}ch>`)}(n),n=function(e){return e.replace(cp,e=>`<redacted:${e.length}ch>`)}(n),n}(s.message,o)).map(e=>({ts:r,level:c,source:l,message:e}))}const mp="https://haystack.needle.tools/api/ingest/logs",fp="https://haystack.needle.tools";async function hp(e){try{return await e.json()}catch{return null}}async function gp(e){try{return await e.text()}catch{return""}}function vp(e){const t=e instanceof Error?e.message:String(e),n=e&&"object"==typeof e?e.cause:void 0;let o=t;if(n){const e=n instanceof Error?n.message:String(n),t="object"==typeof n&&null!==n?n.code:void 0;o=t?`${e} (${t})`:e}return`Network error reaching ${mp}: ${o}`}var xp,bp={__proto__:null,HAYSTACK_RESOURCE:fp,runSendLogs:async function(e,t){var n;let o=await t.getAccessToken();if(!o&&t.recoverAuth)try{t.stdout.write("Updating sign-in (your stored permissions need a one-time refresh)...\n"),o=await t.recoverAuth()}catch{o=null}if(!o)return{ok:!1,error:"Not signed in. Run `needle-cloud login` first, then retry."};const i={type:"meta",...t.meta,mode:e.mode,...e.note?{note:e.note}:{}},a=t.findActiveEditorLog(),s=function(e){const t=fe.from(async function*(e){if(yield JSON.stringify(e.meta)+"\n",e.prevLogPath&&T(e.prevLogPath)){let t=null;for await(const n of up(e.prevLogPath)){const o=dp(n,null,t,e.redactOpts);for(const e of o)e.ts&&(t=e.ts),yield JSON.stringify(e)+"\n"}}if(e.cliLogPath&&T(e.cliLogPath)){let t=null;for await(const n of up(e.cliLogPath)){const o=dp(n,null,t,e.redactOpts);for(const e of o)e.ts&&(t=e.ts),yield JSON.stringify(e)+"\n"}}if(e.editor){var t,n;const o=null!=(t=e.editor.tailBytes)?t:lp,i=null!=(n=e.editor.paths)?n:e.editor.path?[e.editor.path]:[];for(const t of i){const n=pp(t,o);if(!n)continue;let i=null;try{i=R(t).mtime.toISOString()}catch{}for(const t of n.split("\n")){const n=dp(t,e.editor.editor,i,e.redactOpts);for(const e of n)e.ts&&(i=e.ts),yield JSON.stringify(e)+"\n"}}}if(e.pipelineLogPath&&T(e.pipelineLogPath)){var o;const t=null!=(o=e.pipelineTailBytes)?o:lp,n=pp(e.pipelineLogPath,t);if(n){let t=null;try{t=R(e.pipelineLogPath).mtime.toISOString()}catch{}for(const o of n.split("\n")){const n=dp(o,"gltf-build-pipeline",t,e.redactOpts);for(const e of n)e.ts&&(t=e.ts),yield JSON.stringify(e)+"\n"}}}}(e),{objectMode:!1});return t.pipe(he())}({meta:i,cliLogPath:t.paths.cliLogPath,prevLogPath:t.paths.prevLogPath,editor:a,pipelineLogPath:null!=(n=t.paths.pipelineLogPath)?n:null,redactOpts:{homeDir:t.paths.homeDir}});if(e.dryRun){const{gunzipSync:e}=await import("node:zlib"),n=[];for await(const e of s)n.push(e);const o=e(Buffer.concat(n)).toString("utf8");return t.stdout.write(o),{ok:!0}}let r,c;try{const e=[];for await(const t of s)e.push(t);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 t.fetch(mp,{method:"POST",body:r,headers:{Authorization:`Bearer ${o}`,"Content-Type":"application/x-ndjson","Content-Encoding":"gzip"}})}catch(e){return{ok:!1,error:vp(e)}}if(401===c.status){const e=await gp(c);return{ok:!1,error:`401 Unauthorized from ${mp}: ${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 gp(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 hp(c);return{ok:!0,refId:null==e?void 0:e.ref_id,truncated:!0}}if(!c.ok){const e=await gp(c);return(400===(l=c.status)||l>=500)&&await async function({token:e,fetch:t,baseMeta:n,status:o,bodyText:i}){const{gzipSync:a}=await import("node:zlib"),s={type:"meta",...n,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 t(mp,{method:"POST",body:l,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/x-ndjson","Content-Encoding":"gzip"}})}({token:o,fetch:t.fetch,baseMeta:t.meta,status:c.status,bodyText:e}).catch(()=>{}),{ok:!1,error:`Server returned ${c.status}: ${e}`}}var l;const p=await hp(c);return{ok:!0,refId:null==p?void 0:p.ref_id,truncated:Boolean(null==p?void 0:p.truncated)}}};const yp={appId:"2stnsoa6a1b0gwc7lra55",appSecret:"seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",endpoint:"https://auth.needle.tools",resources:["https://cloud.needle.tools/api",fp],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"]},wp={getAccessToken:!0,fetchUserInfo:!0,resource:null==(xp=yp.resources)?void 0:xp[0],resources:yp.resources||[],scopes:yp.scopes||[]};function _p(e="default"){return null==e?`${Ql}/?signed-out=1`:"too-many-logins"===e?`${Ql}/?too-many-logins=1`:"error"===e?`${Ql}/?error=1`:`${Ql}/?signed-out=1`}var kp;function Sp(){Tp.clear(),s.existsSync(Op)&&s.rmSync(Op,{recursive:!0}),s.existsSync(Rp)&&s.rmSync(Rp,{recursive:!0})}const jp=process.argv.includes("--debug-auth"),Tp=new Map;let Ep=null==(kp=yp.resources)?void 0:kp[0];if(Ep)try{Ep=new URL(Ep).hostname}catch(e){jp&&console.error("Invalid resource URL",Ep)}let $p=Ep||"-";$p=$p.replace(/[^a-zA-Z0-9\.\-]/g,"");const Op=x.join(ie(),".needle",".auth",$p),Rp=`${ae()}/Needle/Cloud/.auth/${$p}`;!function(){if(s.existsSync(Rp)){jp&&console.debug("Migrating auth data from legacy location",Rp,"→",Op);try{s.existsSync(Op)||s.mkdirSync(Op,{recursive:!0,mode:448});for(const e of s.readdirSync(Rp)){const t=x.join(Rp,e),n=x.join(Op,e);s.statSync(t).isFile()&&!s.existsSync(n)&&(s.copyFileSync(t,n),s.chmodSync(n,384))}s.rmSync(Rp,{recursive:!0}),jp&&console.debug("Legacy auth data migrated successfully")}catch(e){jp&&console.error("Failed to migrate legacy auth data",e)}}}();const Ap={accessToken:`${Op}/accessToken`,refreshToken:`${Op}/refreshToken`,idToken:`${Op}/idToken`,signInSession:`${Op}/signInSession`};function Cp(e){return Ap[e]||`${Op}/${e}`}const Np=new class{constructor(){this.basePath=Op}async setItem(e,t){jp&&console.debug("\n- SET ITEM",e,t),s.existsSync(this.basePath)||s.mkdirSync(this.basePath,{recursive:!0,mode:448});const n=Cp(e);n&&s.writeFileSync(n,t,{mode:384}),Tp.set(e,t)}async getItem(e){jp&&console.debug("\n- GET ITEM",e);const t=Tp.get(e);if(void 0===t){const t=Cp(e);if(t){if(s.existsSync(t)){const n=s.readFileSync(t,"utf8");return Tp.set(e,n),n}}else console.error(`Unknown token name: ${e}`);return null}return String(t)}async removeItem(e){jp&&console.debug("\n- REMOVE ITEM",e),Tp.delete(e);const t=Cp(e);if(t&&s.existsSync(t)){try{const e=s.statSync(t).size;e>0&&s.writeFileSync(t,Buffer.alloc(e,0),{mode:384})}catch{}s.rmSync(t)}}};let Pp=null;function Ip(){return Pp||(Pp=new de(yp,{storage:Np,navigate:()=>{}})),Pp}function Up(){Pp=null}let zp=Promise.resolve();function Lp(e){const t=zp.then(e,e);return zp=t.then(()=>{},()=>{}),t}async function Fp(e){return Dp(Ip(),e)}async function Dp(e,t){try{const n=await Lp(()=>e.getAccessToken(t));return null!=n?n:null}catch(e){return function(e){return Boolean(e)&&"object"==typeof e&&"not_authenticated"===e.code}(e)||(Fl(`Token refresh failed for resource ${t}: ${e instanceof Error?e.message:e}`),qp(e)&&(Fl(`Token refresh: clearing dead grant for resource ${t}`),Sp(),Pp=null)),null}}function qp(e){return function(e){var t,n;if(!e||"object"!=typeof e)return!1;const o=e,i=e=>{if("string"!=typeof e)return!1;const t=e.replace(/^oidc\./,"");return"invalid_grant"===t||"invalid_target"===t};return i(o.code)||i(null==(t=o.data)?void 0:t.error)||i(null==(n=o.data)?void 0:n.code)}(e)}async function Bp(){return Fp(wp.resource)}function Mp(){return Hp(Ip())}async function Wp(e){var t;if(!e)return{status:401,error:"Not authenticated"};const n=null==(t=e.userInfo)?void 0:t.custom_data;return n?n.default_org?n.default_org:(console.warn("WARN: You do not have a default organization set. Please visit your Needle Cloud account settings and then try again."),Fl("WARN: You do not have a default organization set. Please visit your Needle Cloud account settings and then try again."),null):null}function Gp(e){return new de(yp,{storage:Np,navigate:t=>{if(null==e.navigate)throw new Error("Can not navigate");e.navigate(t)}})}function Hp(e){return function(e,t){return Lp(()=>e.getContext(t))}(e,wp).then(t=>{const n=t;return n.client=e,n}).catch(async e=>{const t=e instanceof Error?e.message:String(e);return"oidc.invalid_token"==e.code||"oidc.invalid_grant"==e.code?(Fl(`OIDC: ${e.code} – token refresh failed, clearing stale tokens`),Sp(),Pp=null,console.error("Session expired – please log in again: npx needle-cloud login")):e.code?(console.error(e.code),Fl(`OIDC: ${e.code} – ${t}`)):Fl(`OIDC: getContext failed – ${t}`),null})}var Jp={__proto__:null,resetSharedClient:Up,tryGetFreshAccessTokenForResource:Fp,acquireAccessToken:Dp,shouldClearAuthOnError:qp,tryGetFreshAccessToken:Bp,tryGetUser:Mp,tryGetDefaultOrgId:Wp,createNodeClient:Gp,getUserFromClient:Hp};let Vp=null;function Kp(e){var t;const n=null==(t=e.userInfo)?void 0:t.custom_data;if(!n)return[];const o=n.machines;return o?o.map(e=>e.name):[]}let Yp=Date.now();async function Zp(e){var t;const n=Date.now();n-Yp>3e4&&"client"in e&&(Yp=n,await e.client.fetchUserInfo().catch(console.error));const o=null==(t=e.userInfo)?void 0:t.custom_data;if(!o)return!1;if(Vp||await Xp(),!Vp)return console.error("Failed to get machine id"),!0;const i=o.machines;if(!i)return!1;const a=i.some(e=>e.id===Vp);return a}async function Xp(){return Vp||await import("node-machine-id").then(async e=>{const t=await e.default.machineId(!1);Vp=t}),Vp}function Qp(){return oe.userInfo().username+"@"+oe.hostname()}async function eu(e,t={signout:!1}){if(e.accessToken){const o={machine_id:await Xp(),machine_name:Qp(),platform:oe.platform(),arch:oe.arch()},i=await fetch("https://cloud.needle.tools/api"+Ue.account.post_machine,{method:"POST",headers:{Authorization:"Bearer "+e.accessToken,"Content-Type":"application/json"},body:JSON.stringify(o)}).catch(e=>{var t,n;const o=(null==e||null==(t=e.cause)?void 0:t.code)||(null==e||null==(n=e.cause)?void 0:n.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`),Fl(`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 t=JSON.parse(e);t.logins&&(a=!1,Fl("Too many logins from different machines"),j().fail("You have reached the maximum number of allowed logins\n"),j().warn(`Please logout from one of the following machines:\n- ${t.logins.join("\n- ")}\n`))}}var n;return!!a||(t.signout&&(Sp(),"client"in e&&(null==(n=e.client)||n.signOut(_p("too-many-logins")))),!1)}return!0}let tu=null;function nu(){if(tu)return tu;{const e=au();return tu=e,e}}const ou="projects.json";function iu(){const e=process.env.HOME||process.env.USERPROFILE||process.cwd(),t=y(e,".needle");return r(t)||d(t,{recursive:!0}),y(t,ou)}function au(){const e=iu();if(!r(e))return{entries:[]};const t=l(e,"utf-8");try{const e=JSON.parse(t);return tu=e,e}catch(e){return console.error("Failed to parse project info file:",e),{entries:[]}}}const su=JSON.parse(l(new URL("../package.json",import.meta.url),"utf-8"));function ru(){return su.version}const cu=process.env.NEEDLE_SEARCH_ENDPOINT||"https://search.needle.tools",lu=process.env.NEEDLE_SEARCH_API_KEY||"da5737c00d6822c32a1b9e3b5dab094bfc17e205aef2f7f3e1a0fd4ebc77b79f",pu=[{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"]}}],uu={needle_cloud_me:async function(e){try{const e=await Mp(),t=null==e?void 0:e.userInfo;return t?JSON.stringify({id:t.sub,name:t.name||t.preferred_username,email:t.email,profile_picture:t.picture}):"No user is currently logged in."}catch(e){return"Error retrieving user: "+(e instanceof Error?e.message:String(e))}},needle_search:async function(t){const n=t.query;if(!n||"string"!=typeof n)return{content:[{type:"text",text:"Error: query parameter is required."}]};const o=Math.min(Math.max(Number(t.limit)||5,1),20),i=`${cu}/api/semantic-search?q=${encodeURIComponent(n)}&limit=${o}`,a={Accept:"application/json"};lu&&(a.Authorization=`Bearer ${lu}`);try{const t=await e(i,{headers:a,signal:AbortSignal.timeout(15e3)});if(!t.ok){const e=await t.text().catch(()=>"");return{content:[{type:"text",text:`Search API error (${t.status}): ${e}`}]}}const o=await t.json();if(!o.results||0===o.results.length)return{content:[{type:"text",text:`No results found for: "${n}"`}]};const s=o.results.map((e,t)=>`## [${t+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 "${n}" (${o.durationMs}ms):\n\n${s}`}]}}catch(e){return{content:[{type:"text",text:`Search failed: ${e instanceof Error?e.message:String(e)}`}]}}}},du=new Map;function mu(e,t){const n=pu.findIndex(t=>t.name===e);-1!==n&&(pu.splice(n,1),delete uu[e],t())}function fu(e,t,n,o){const i=pu.findIndex(t=>t.name===e.name);if(-1!==i&&pu.splice(i,1),pu.push(e),uu[e.name]=t,hu.delete(e.name),null!=n&&n.source){const t=du.get(n.source)||new Set;t.add(e.name),du.set(n.source,t)}o()}const hu=new Map;async function gu(e,t){const n=uu[e];if(!n){const t=hu.get(e);if(t)return{isError:!0,content:[{type:"text",text:`This tool is currently unavailable because "${t}" 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 n(t);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 vu=200,xu=2e3,bu=new RegExp("^[A-Za-z0-9_./*?\\[\\]{},\\-]+$");function yu({pattern:e,glob:t,root:n,maxResults:o}){if("string"!=typeof e)throw new Error("invalid pattern: must be a string");if(e.length>xu)throw new Error(`invalid pattern: exceeds ${xu} characters`);if(null!=t&&""!==t){if("string"!=typeof t)throw new Error("invalid glob: must be a string");if(t.length>vu)throw new Error(`invalid glob: exceeds ${vu} characters`);if(!bu.test(t))throw new Error("invalid glob: contains disallowed characters")}const i=["-rn"];return t&&i.push(`--include=${t}`),i.push(`--max-count=${o}`,"-E",e,n),i}function wu(e){try{const t=new RegExp(e,"i");return{test:e=>t.test(e),mode:"regex"}}catch{const t=e.toLowerCase();return{test:e=>e.toLowerCase().includes(t),mode:"literal"}}}function _u(e={}){fu({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 t={content:[]},n=nu();if(n){const e=null==n?void 0:n.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0];if(null!=e&&e.log_location){const n=c(e.log_location).mtime;t.content.push({type:"text",text:`${e.log_location} (last modified: ${n.toLocaleString()})`})}else{let n="No recent project with known log location known.";e&&(n+=" Recent project is "+(null==e?void 0:e.project_location)),t.content.push({type:"text",text:n})}}return t},{source:"cli"},()=>{}),fu({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 t={content:[]},n=nu();if(n){const e=null==n?void 0:n.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0];t.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 t},{source:"cli"},()=>{}),fu({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 t={content:[]},n=nu();if(n){const e=null==n?void 0:n.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0];t.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 t},{source:"cli"},()=>{}),fu({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 t={content:[]},n=nu();if(n){const e=null==n?void 0:n.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0];t.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 t},{source:"cli"},()=>{}),fu({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 t=Tu(e.path);if(!t)return{content:[{type:"text",text:"Error: path is outside the project directory."}]};try{const n=c(t.resolved).mtime.toISOString(),o=l(t.resolved,"utf-8").split("\n");if(e.filter){const i=wu(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: ${t.resolved} (modified: ${n}) — 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,t)=>`${i+t}: ${e}`).join("\n");return{content:[{type:"text",text:`File: ${t.resolved} (${o.length} lines, modified: ${n}, showing ${i}-${i+s.length-1})\n`+r}]}}catch(e){return{content:[{type:"text",text:`Error reading file: ${e.message}`}]}}},{source:"cli"},()=>{}),fu({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 t=ju();if(0===t.length)return{content:[{type:"text",text:"Error: no active project found."}]};const n=Math.min(e.max_results||50,200),o=[];try{yu({pattern:e.pattern,glob:e.glob,root:".",maxResults:n})}catch(e){return{content:[{type:"text",text:`Error: ${e.message}`}]}}for(const a of t)try{const t=yu({pattern:e.pattern,glob:e.glob,root:a,maxResults:n});let s="";try{s=g("grep",t,{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 n=t.length>0?`\nSearched in:\n${t.join("\n")}`:"\nNo project directories available to search.";return{content:[{type:"text",text:`No matches found for pattern: ${e.pattern}${n}`}]}}const a=o.slice(0,n);return{content:[{type:"text",text:`Found ${o.length} matches${o.length>n?` (showing first ${n})`:""}:\n`+a.join("\n")}]}},{source:"cli"},()=>{}),fu({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 t=ku();if(!t)return{content:[{type:"text",text:"Error: no active project found."}]};const n="blender"===t.editor?"<blender>":"unity"===t.editor?"<unity>":"<editor_project>",o=[];if(e.project&&"editor"!==e.project||!t.project_location||o.push({root:b(t.project_location),label:n}),e.project&&"web"!==e.project||!t.web_location||o.push({root:b(t.web_location),label:"<web_project>"}),0===o.length)return{content:[{type:"text",text:"Error: no active project found."}]};const i=[];for(const{root:t,label:n}of o){const o=e.path?Su(e.path,t):t;if(o)try{var a;const s=$u(o,t,null!=(a=e.recursive)&&a,e.pattern,0);i.push(...s.map(e=>({file:e,root:t,label:n})))}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}/${w(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"},()=>{}),fu({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 t=ku();var n;if(null==t||!t.log_location)return Fl(`read_editor_log: no editor log file known (project: ${null!=(n=null==t?void 0:t.project_location)?n:"none"})`),{content:[{type:"text",text:"Error: no editor log file known. Is a Unity or Blender project open?"}]};try{const n=l(t.log_location,"utf-8").split("\n");let o,i;if(e.filter){const t=wu(e.filter);o=[];for(let e=0;e<n.length;e++)t.test(n[e])&&o.push(`L${e+1}: ${n[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}" (${t.mode}) → ${a} matches (showing ${s+1}-${s+o.length}) in ${n.length} total lines`}else{const t=Math.min(Math.max(e.lines||100,1),500);o=n.slice(-t),i=`last ${t} of ${n.length} lines`}const a="unity"===t.editor?function(e){const t=[],n=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?t.push(a):4===i&&t.push(" ... (stack trace truncated)");continue}if(o=!1,i=0,!a.trim())continue;const e=n.get(a)||0;if(n.set(a,e+1),0===e)t.push(a);else if(1===e)t.push(` [repeated ${e+1}x] ${a}`);else{const n=t.length-1;n>=0&&t[n].startsWith(" [repeated")&&(t[n]=` [repeated ${e+1}x] ${a}`)}}return t}(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: ${t.log_location} (${i}, ${a.length} after processing, editor: ${t.editor})${c}:\n`+r}]}}catch(e){return{content:[{type:"text",text:`Error reading log: ${e.message}`}]}}},{source:"cli"},()=>{}),fu({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 t=Tu(e.path);if(!t)return{content:[{type:"text",text:"Error: path is outside the project directory."}]};if(!r(t.resolved))return{content:[{type:"text",text:`Error: file not found: ${t.resolved}`}]};try{const n=function(e){const t=e.toLowerCase();if(t.endsWith(".gltf")){const t=l(e,"utf-8");return JSON.parse(t)}if(t.endsWith(".glb")){const t=l(e);if(t.length<20)return null;if(1179937895!==t.readUInt32LE(0))return null;const n=t.readUInt32LE(12);if(1313821514!==t.readUInt32LE(16))return null;const o=t.toString("utf-8",20,20+n);return JSON.parse(o)}return null}(t.resolved);if(!n)return{content:[{type:"text",text:"Error: could not parse glTF/GLB file."}]};const o=5e4;if(e.query){const i=Eu(n,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 ${t.resolved}`+(s?` (truncated to ${o} chars)`:"")+"\n"+a}]}}let i=function(e,t){var n,o,i,a,s,r,c,l,p,u,d,m,f;const h=[`glTF: ${t}`];if(e.asset){const t=[];e.asset.version&&t.push(`v${e.asset.version}`),e.asset.generator&&t.push(e.asset.generator),h.push(`Asset: ${t.join(", ")}`)}if(null!=(n=e.extensionsUsed)&&n.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 t=null!=(g=null==(v=e.scenes)||null==(v=v[null!=(x=e.scene)?x:0])?void 0:v.nodes)?g:[],n=new Set,o=(t,i)=>{if(i>6||n.has(t))return;n.add(t);const a=e.nodes[t];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_${t}`}${r.length?` (${r.join(", ")})`:""}`),a.children)for(const e of a.children)o(e,i+1)};for(const e of t)o(e,1);n.size<e.nodes.length&&n.size>0&&h.push(` ... and ${e.nodes.length-n.size} more nodes`)}if(null!=(s=e.meshes)&&s.length){h.push(`\nMeshes (${e.meshes.length}):`);for(const t of e.meshes.slice(0,30)){var b,y;const e=null!=(b=null==(y=t.primitives)?void 0:y.length)?b:0;h.push(` - ${t.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 t of e.materials.slice(0,30)){const e=t.name||"(unnamed)",n=[];t.pbrMetallicRoughness&&n.push("PBR"),t.alphaMode&&"OPAQUE"!==t.alphaMode&&n.push(t.alphaMode),t.doubleSided&&n.push("doubleSided"),t.extensions&&n.push(`ext:[${Object.keys(t.extensions).join(",")}]`),h.push(` - ${e}${n.length?` (${n.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 t of e.animations.slice(0,20)){var w,_;const e=null!=(w=null==(_=t.channels)?void 0:_.length)?w:0;h.push(` - ${t.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 t of e.skins.slice(0,10)){var k,S;h.push(` - ${t.name||"(unnamed)"} (${null!=(k=null==(S=t.joints)?void 0:S.length)?k:0} joints)`)}}if(null!=(d=e.cameras)&&d.length){h.push(`\nCameras (${e.cameras.length}):`);for(const t of e.cameras)h.push(` - ${t.name||"(unnamed)"} (${t.type})`)}if(null!=(m=e.buffers)&&m.length){const t=e.buffers.reduce((e,t)=>e+(t.byteLength||0),0);h.push(`\nBuffers: ${e.buffers.length} (${(t/1024/1024).toFixed(1)} MB total)`)}return null!=(f=e.accessors)&&f.length&&h.push(`Accessors: ${e.accessors.length}`),h.join("\n")}(n,t.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"},()=>{}),fu(ll.schema,async e=>{const t=await ll.execute(e);return"error"in t?{content:[{type:"text",text:t.error}]}:{content:[{type:"text",text:t.content}]}},{source:"cli"},()=>{}),null!=e&&e.logToolCount&&Fl(`[MCP] registered ${pu.length} built-in tools: ${pu.map(e=>e.name).join(", ")}`)}function ku(){var e;const t=nu();return null!=t&&null!=(e=t.entries)&&e.length?t.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0]:null}function Su(e,t){const n=b(t,e),o=b(t);return n.startsWith(o+_)||n===o?n:null}function ju(){const e=ku();if(!e)return[];const t=[];return e.project_location&&t.push(b(e.project_location)),e.web_location&&t.push(b(e.web_location)),t}function Tu(e){const t=ju();for(const n of t){const t=Su(e,n);if(t&&r(t))return{resolved:t,root:n}}for(const n of t){const t=Su(e,n);if(t)return{resolved:t,root:n}}const n=b(e);for(const e of t)if(n.startsWith(e+_)||n===e)return{resolved:n,root:e};return null}function Eu(e,t){if(0===t.length||null==e)return e;const[n,...o]=t;if("*"!==n)return Eu(e[/^\d+$/.test(n)?Number(n):n],o);if(Array.isArray(e)){const t=e.map(e=>Eu(e,o)).filter(e=>void 0!==e);return t.length>0?t:void 0}if("object"==typeof e){const t={};for(const n of Object.keys(e)){const i=Eu(e[n],o);void 0!==i&&(t[n]=i)}return Object.keys(t).length>0?t:void 0}}function $u(e,t,n,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(!n)continue;if(c.name.startsWith("."))continue}}const s=y(e,c.name);if(c.isDirectory())n&&a.push(...$u(s,t,!0,o,i+1));else{if(o&&!o.split("|").map(e=>(e=e.trim()).startsWith(".")&&!e.startsWith("*.")?"*"+e:e).filter(Boolean).some(e=>be(c.name,e,{nocase:!0})))continue;a.push(s)}}return a}const Ou="settings.json";function Ru(){return W(B(),".needle")}function Au(e){const t=W(null!=e?e:Ru(),Ou);if(!T(t))return{};try{const e=JSON.parse(z(t,"utf-8"));return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}catch{return{}}}function Cu(e){return"disabled"===Au(e).remote_ai_tools}function Nu(e,t){if(!T(e))try{E(e,{recursive:!0})}catch{}let n=null,o=null;try{n=F(e,{persistent:!1},(e,n)=>{n&&n.toString()!==Ou||(o&&clearTimeout(o),o=setTimeout(()=>{o=null;try{t()}catch{}},50))}),null==n.on||n.on("error",()=>{})}catch{}return()=>{o&&(clearTimeout(o),o=null);try{var e;null==(e=n)||e.close()}catch{}n=null}}var Pu={__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:Ru,readSettings:Au,writeSetting:function(e,t,n){const o=Au(e);null===n?delete o[t]:o[t]=n,E(e,{recursive:!0}),L(W(e,Ou),JSON.stringify(o,null,2)+"\n","utf-8")},areRemoteAiToolsDisabled:Cu,watchSettings:Nu};const Iu=2e3,Uu=6e4,zu=25e3,Lu=1e4,Fu=o();let Du=null,qu=null,Bu=null,Mu=null,Wu=Iu,Gu=!1,Hu=!1;function Ju(){Du||(Cu()?Fl("Needle Cloud connection: skipped (remote_ai_tools disabled in settings)"):(Gu=!1,qu&&(clearTimeout(qu),qu=null),Wu=Iu,Ku()))}function Vu(e){Gu=!0,Yu(),qu&&(clearTimeout(qu),qu=null),Du?(Fl(`Needle Cloud connection: closing (reason: ${null!=e?e:"shutdown"})`),Du.close(1e3,null!=e?e:"shutdown"),Du=null):e&&Fl(`Needle Cloud connection: disconnect requested (reason: ${e}) — no active connection`)}async function Ku(){let e=await Bp();if(e||(e=function(){const e=Cp("accessToken");if(s.existsSync(e)){const t=s.readFileSync(e,"utf8");if(t){const e=JSON.parse(t),n=null==e?void 0:e["@https://cloud.needle.tools/api"];return null==n?void 0:n.token}}return null}(),e&&Fl("Needle Cloud connection: using cached token (refresh failed)")),!e)return Hu||(Fl("Needle Cloud connection: skipped (not logged in)"),Hu=!0),void Zu(!0);Hu=!1;const t="https://cloud.needle.tools/api".replace(/^http/,"ws")+"/v1/cli/ws?token="+encodeURIComponent(e)+"&instance="+encodeURIComponent(Fu);Fl("Needle Cloud connection: connecting...");const n=`needle-cloud/${ru()} Node/${process.versions.node}`;Du=new ve(t,{headers:{"User-Agent":n,Origin:"cli://needle-cloud"}}),Du.on("open",()=>{Wu=Iu,Fl("Needle Cloud connection: established"),function(){var e,t,n,o,i;if(!Du||Du.readyState!==ve.OPEN)return;const a=nu(),s=null==a||null==(e=a.entries)||null==(e=e.sort((e,t)=>t.last_accessed-e.last_accessed))?void 0:e[0],r={type:"presence",editor:null!=(t=null==s?void 0:s.editor)?t:"unknown",project:null!=(n=null==s?void 0:s.project_location)?n: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:ru()};Du.send(JSON.stringify(r))}(),function(){if(!Du||Du.readyState!==ve.OPEN)return;try{_u()}catch(e){Fl(`Needle Cloud connection: registerServerTools failed: ${e}`)}const e=pu.map(e=>e.name);var t;Fl(`Needle Cloud connection: sending ${e.length} tools: ${e.join(", ")}`),Du.send(JSON.stringify({type:"tools",tools:(t=pu,t.map(e=>{var t;return{name:e.name,description:e.description,inputSchema:e.inputSchema,capability:null!=(t=e.capability)?t:"local"}}))}))}(),Yu(),Bu=setInterval(()=>{Du&&Du.readyState===ve.OPEN&&(Du.ping(),Mu=setTimeout(()=>{Fl("Needle Cloud connection: pong timeout, terminating"),Du&&Du.terminate()},Lu))},zu)}),Du.on("pong",()=>{Mu&&(clearTimeout(Mu),Mu=null)}),Du.on("message",e=>{try{const n=JSON.parse(e.toString());var t;"execute_tool"===n.type&&n.requestId&&n.toolName&&async function(e,t,n){Fl(`Cloud tool request: ${t}(${Object.keys(n).length>0?" "+Object.entries(n).map(([e,t])=>`${e}=${JSON.stringify(t)}`).join(", "):""}) [${e}]`);const o=Date.now();try{var i,a;const s=await gu(t,n);Fl(`Cloud tool result: ${t} → ${null!=(i=null==s||null==(a=s.content)?void 0:a.reduce((e,t)=>{var n;return e+((null==(n=t.text)?void 0:n.length)||0)},0))?i:0} chars in ${Date.now()-o}ms [${e}]`),Du&&Du.readyState===ve.OPEN&&Du.send(JSON.stringify({type:"tool_result",requestId:e,result:s}))}catch(n){const i=n instanceof Error?n.message:String(n);Fl(`Cloud tool error: ${t} → ${i} in ${Date.now()-o}ms [${e}]`),Du&&Du.readyState===ve.OPEN&&Du.send(JSON.stringify({type:"tool_result",requestId:e,error:i}))}}(n.requestId,n.toolName,null!=(t=n.args)?t:{})}catch{}}),Du.on("close",(e,t)=>{const n=(null==t?void 0:t.toString())||"";Fl(`Needle Cloud connection: closed (code=${e}${n?" "+n:""})`),Yu(),Du=null,Gu||Zu()}),Du.on("error",e=>{Fl(`Needle Cloud connection: error - ${e.message||"connection refused"} (is https://cloud.needle.tools/api reachable?)`)})}function Yu(){Bu&&(clearInterval(Bu),Bu=null),Mu&&(clearTimeout(Mu),Mu=null)}function Zu(e=!1){Gu||qu||(e||Fl(`Needle Cloud connection: reconnecting in ${Wu/1e3}s`),qu=setTimeout(()=>{qu=null,Ku()},Wu),Wu=Math.min(2*Wu,Uu))}const Xu=e=>{const t=ge();return t.use("/:action",async(t,n,o)=>{const{action:i}=t.params,a=Gp({navigate:e=>{n.redirect(e)}});switch(i){case"sign-in":e.invalid_login=!1,e.invalid_login_type=null,e.error=void 0,Fl("Sign in..."),await a.clearAllTokens(),Up();try{await a.signIn(`${Ql}/auth-callback`)}catch(e){const t=null==e?void 0:e.cause,o=`Sign-in failed: ${null!=t&&t.code?`${t.code}${t.address?` (${t.address}:${t.port})`:""}`:(null==e?void 0:e.message)||"unknown error"}`;return Fl(o),console.error(o),n.status(502).send(o)}break;case"sign-out":{var s,r;const t=await Mp(),n=(null==t||null==(s=t.userInfo)?void 0:s.sub)||(null==t||null==(r=t.claims)?void 0:r.sub),o=null==t?void 0:t.accessToken;Fl(`Sign out... (${n})`),n&&o&&await async function(e){return!e.accessToken||import("node-machine-id").then(async t=>{const n=await Xp();return Vp=n,await fetch("https://cloud.needle.tools/api"+Ue.account.post_machine,{method:"POST",headers:{Authorization:"Bearer "+e.accessToken,"Content-Type":"application/json"},body:JSON.stringify({action:"logout",machine_id:n,machine_name:Qp()})}).catch(e=>{Fl(`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:n,accessToken:o}).catch(e=>{console.error(e),Fl(`Failed to validate logout: ${e}`)}),e.invalid_login=!1,e.invalid_login_type=null,e.error=void 0,console.log("User signed out"+(n?`: ${n}`:"")),await a.signOut(_p()),Up();break}case"auth-callback":if(t.url){const o=await a.handleSignInCallback(`${Ql}${t.originalUrl}`).catch(e=>({error:e}));if(Up(),o&&"error"in o){Fl(`Error during sign in: ${o.error}`);const e=o.error instanceof Error?o.error.message:String(o.error);n.redirect(Ql+"?cancelled&message="+encodeURIComponent(e))}else{var c,l,p,u;const t=await Mp();if(null!=t&&t.isAuthenticated){var d,m;e.invalid_login=!1,e.user_email=(null==(d=t.claims)?void 0:d.email)||(null==(m=t.userInfo)?void 0:m.email)||null,e.logged_in_machine_names=[...Kp(t)];const o=await eu(t,{signout:!0});if(!o)return e.invalid_login=!0,e.invalid_login_type="too-many-logins",n.redirect(_p("too-many-logins"));if("object"==typeof o&&"error"in o)return e.invalid_login=!0,e.invalid_login_type="error",e.error=o.error,n.redirect(_p("error"));Up()}console.log(`User logged in: ${(null==t||null==(c=t.userInfo)?void 0:c.sub)||(null==t||null==(l=t.claims)?void 0:l.sub)}`),Fl(`User logged in: ${(null==t||null==(p=t.userInfo)?void 0:p.sub)||(null==t||null==(u=t.claims)?void 0:u.sub)}`),Ju(),n.redirect(Ql)}}break;default:o()}}),t};function Qu(e){var t,n,o,i;if(!e)return"";let a=(null==(t=e.claims)?void 0:t.name)||(null==(n=e.userInfo)?void 0:n.name)||(null==(o=e.claims)?void 0:o.username)||"";var s;return(!a||a.length<=0)&&null!=(i=e.claims)&&i.email?function(e){return e?(e=(e=(e=(e=e.split("@")[0]).replace(/[^a-zA-Z0-9]/g," ")).replace(/\s+/g," ")).split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),e):e}(null==(s=e.claims)?void 0:s.email):a}async function ed(e,t=null){var n,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==(n=e.claims)?void 0:n.sub)||(null==(o=e.userInfo)?void 0:o.sub);t===i&&(t=null);let a=null;if(null==t)a=e.accessToken;else if(null!=t){var s;let n=null==e||null==(s=e.userInfo)||null==(s=s.organization_data)?void 0:s.find(e=>e.id===t);if(!n){var r;const o=t.toLowerCase();n=null==e||null==(r=e.userInfo)||null==(r=r.organization_data)?void 0:r.find(e=>e.name.toLowerCase()===o)}if(!n)return{status:403,error:`User is not part of team "${t}"`};t=n.id,a=await e.client.getOrganizationToken(n.id).catch(e=>{var o;return console.error(`Error getting organization token for "${null==(o=n)?void 0:o.name}" (${t}): ${e.message}`),null})}return a?{authToken:a,org:t}:{status:403,error:"No access token found"}}const td=function(){return async(e,t,n)=>{const o=await Mp();Object.defineProperty(e,"user",{enumerable:!0,get:()=>o}),n()}},nd=`${Ql}/mcp`,od="2025-06-18",id={name:"Needle Cloud MCP",version:"1.0.0"};function ad(e){return{jsonrpc:"2.0",id:e,result:{protocolVersion:od,capabilities:{tools:{listChanged:!0}},serverInfo:id}}}async function sd(e,t){const n=!0===(null==t?void 0:t.proxy),{method:o,params:i,id:a}=e;if("initialize"===o)return ad(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{_u()}catch{}let e=pu;if(n){const t=await async function(){try{var e,t;const n=await fetch(nd,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/list"}),signal:AbortSignal.timeout(2e3)});return n.ok&&null!=(e=null==(t=(await n.json()).result)?void 0:t.tools)?e:[]}catch{return[]}}();if(t.length>0){const n=new Set(pu.map(e=>e.name));e=[...pu,...t.filter(e=>!n.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{_u()}catch{}try{return{jsonrpc:"2.0",id:a,result:await gu(e,(null==i?void 0:i.arguments)||{})}}catch(t){if(n)try{const t=await async function(e,t){const n=await fetch(nd,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:e,arguments:t}}),signal:AbortSignal.timeout(35e3)}),o=await n.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:t}}catch{}return{jsonrpc:"2.0",id:a,error:{code:-32603,message:`Tool execution failed: ${t.message}`}}}}return{jsonrpc:"2.0",id:null!=a?a:null,error:{code:-32601,message:`Method '${o}' not found`}}}function rd(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}let cd=!1;const ld=ge(),pd=new Set,ud=new Map;let dd=0;function md(){const e=[];for(const[t,{connectedAt:n,userAgent:o}]of ud)e.push({id:t,connectedAt:n,userAgent:o});return e}function fd(e,t,n){if((t.headers.accept||"").includes("text/event-stream")){n.setHeader("Content-Type","text/event-stream"),n.setHeader("Cache-Control","no-cache"),n.setHeader("Connection","keep-alive"),n.setHeader("Access-Control-Allow-Origin","*"),n.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id"),n.flushHeaders(),n.write(": connected\n\n");const o=t.headers["user-agent"]||"";return ud.set(e,{id:e,client:n,connectedAt:Date.now(),userAgent:o}),console.log(`[MCP] SSE client connected (ID: ${e}) ${o}. Total clients: ${ud.size}`),Fl(`MCP SSE client connected (ID: ${e}) ${o}. Total clients: ${ud.size}`),t.on("close",()=>{console.log(`[MCP] SSE client disconnected (ID: ${e}): ${o}`),Fl(`MCP SSE client disconnected (ID: ${e}): ${o}`),ud.delete(e)}),!0}return!1}function hd(e){if(!Array.isArray(e))return console.error("Invalid input: paths should be an array of strings."),null;for(const t of e)if(!1!==r(t))try{const e=gd(t);if(e)return e}catch(e){}}function gd(e){const t=y(e,".git");if(r(t)){const e=function(e){const t=f(e);if(t.isDirectory())return y(e,"config");if(t.isFile()){const t=l(e,"utf-8").trim().match(/^gitdir:\s*(.+)$/);if(t){let n=t[1].trim();k(n)||(n=b(S(e),n));const o=y(n,"config");if(r(o))return o;const i=y(n,"commondir");if(r(i)){let e=l(i,"utf-8").trim();return k(e)||(e=b(n,e)),y(e,"config")}}}return null}(t);if(e&&r(e)){const t=function(e){const t=l(e,"utf-8"),n=/\[remote\s+"(?<name>.+?)"\].+?url\s*=\s*(?<url>.+?)$/gms,o=[];let i;for(;null!==(i=n.exec(t));)if(i.groups){const e=i.groups.name,t=i.groups.url.trim();t.length&&o.push({name:e,url:t})}const a=o.find(e=>"origin"===e.name)||o.find(e=>"upstream"===e.name)||o[0];return a?a.url:null}(e);if(t)return t}}const n=y(e,".plastic");if(r(n)){const e=y(n,"replicas.db");if(r(e)){const t=l(e,"utf-8").split("\n");for(const e of t){const t=e.split("=");if(2===t.length&&"repo"===t[0].trim()){const e=t[1].trim();if(e.length)return e}}}}const o=y(e,"..");return o===e?null:gd(o)}ld.get("/mcp",async(e,t)=>{if(fd(dd++,e,t))return;const n=function(e){const t=[...pu].sort((e,t)=>e.name.localeCompare(t.name)),n=t.map(e=>`\n <div class="tool">\n <span class="tool-name">${rd(e.name)}</span>\n <span class="tool-desc">${rd(function(e){const t=e.indexOf("\n");return-1===t?e:e.slice(0,t)}(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">${t.length}</span></h2>\n <p class="tools-info">These tools are available to AI agents connected via the Model Context Protocol (MCP).</p>\n ${n}\n</body>\n</html>`}();t.status(200).header("Content-Type","text/html; charset=utf-8").send(n)}),ld.post("/mcp",async(e,t)=>{const n=e.headers.accept||"",o=e.headers["user-agent"]||"",{method:i,id:a}=e.body;console.log(`[MCP] Received request from ${o} (${i}) (ID: ${a})`),t.setHeader("Content-Type","application/json"),t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Mcp-Session-Id"),t.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id");try{if("initialize"===i&&n.includes("text/event-stream")){const n=void 0!==a?a:dd++;if(fd(n,e,t)){cd=!0;const e=ad(n);return void t.write(`data: ${JSON.stringify(e)}\n\n`)}}const r=await sd(e.body);if("initialize"===i){cd=!0;const e=X();pd.add(e),t.setHeader("Mcp-Session-Id",e),console.log(`[MCP] New session created: ${e} for ${o}`),Fl(`MCP New session: ${e} for ${o}`)}if(null===r)return t.status(204).end();if(Fl(`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)}t.json(r)}catch(e){console.error("[MCP] Error processing request:",e);const n={jsonrpc:"2.0",error:{code:-32603,message:"Internal server error",data:"development"===process.env.NODE_ENV?e.stack:void 0},id:a||null};t.json(n)}}),ld.options("/mcp",(e,t)=>{t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Allow-Methods","GET, POST, OPTIONS, DELETE"),t.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Mcp-Session-Id"),t.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id"),t.status(204).end()});let vd=!1;function xd(e,t={}){vd&&process.stdout.write(JSON.stringify({jsonrpc:"2.0",method:e,params:t})+"\n")}var bd={__proto__:null,sendStdioNotification:xd,startStdio:function(){vd=!0,process.stdin.resume();const e=me({input:process.stdin,terminal:!1});e.on("line",async e=>{const t=e.trim();if(!t)return;let n;try{n=JSON.parse(t)}catch{return void process.stdout.write(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}})+"\n")}const o=await sd(n,{proxy:!0});null!==o&&process.stdout.write(JSON.stringify(o)+"\n")}),e.on("close",()=>{vd=!1,process.exit(0)})}};let yd=null;function wd(){yd&&clearTimeout(yd),yd=setTimeout(()=>{!function(e,t={}){if(0===ud.size)return;const n=`data: ${JSON.stringify({jsonrpc:"2.0",method:"notifications/tools/list_changed",params:t})}\n\n`;for(const[e,{client:t}]of ud)try{t.write(n)}catch(t){console.error(`[MCP] Error sending notification to client (${e}):`,t),ud.delete(e)}}(),xd("notifications/tools/list_changed")},10)}const _d=new Set(["https://cloud.needle.tools","https://needle.tools","https://engine.needle.tools","https://docs.needle.tools","chrome-extension://kjcepmifiddcepiocokclhibpkgcdomk","chrome-extension://jonplpbnhmanoekkgcepnedhghflblmo"]),kd=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Sd(e){if("string"!=typeof e||0===e.length)return!1;if(_d.has(e))return!0;let t;try{t=new URL(e)}catch{return!1}if("/"!==t.pathname&&""!==t.pathname)return!1;if(""!==t.search||""!==t.hash)return!1;if("http:"!==t.protocol&&"https:"!==t.protocol)return!1;const n=t.hostname.toLowerCase();return!!kd.has(n)||"::1"===n}const jd="[MCP]",Td=new Array,Ed="2026-09-23T08:00:46.975Z";var $d={__proto__:null,BUILD_TIME:Ed};const{json:Od}=ye;function Rd(e){const t=null==e?void 0:e.cause;return null!=t&&t.code?`${t.code}${t.address?` (${t.address}:${t.port})`:""}`:null!=t&&t.message?t.message:null!=e&&e.code?e.code:null!=e&&e.message&&"fetch failed"!==e.message?e.message:"connection refused or network unreachable"}async function Ad(t={restart:!1}){const n=await e(Ql).catch(e=>({ok:!1})),i="/sign-in",a="/api/authenticated",s="/api/projects",c="/api/content",l={baseUrl:Ql,port:Xl,isHost:!1,auth_endpoints:{"sign-in":`${Ql}${i}`,"sign-out":`${Ql}/sign-out`,"is-authenticated":`${Ql}${a}`}};let p=n.ok;if(p){var u;const f=await e(`${Ql}/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&&(Fl(`Running server uses different API endpoint (${g.api_endpoint} vs https://cloud.needle.tools/api), restarting...`),t||(t={}),t.restart=!0)}if(!0===(null==(u=t)?void 0:u.restart)){Fl("Restarting auth server...");const v=`${Ql}/restart`;t.ora&&(t.ora.text="Sending restart request to server");const x=new AbortController;setTimeout(()=>x.abort(),1e4);let b={};try{const _=y(ie(),".needle","local-server-token"),k=JSON.parse((await import("fs")).readFileSync(_,"utf-8"));k.token&&(b={Authorization:`Bearer ${k.token}`})}catch{}const w=await e(v,{method:"post",signal:x.signal,headers:b}).catch(e=>({ok:!1,status:400,error:e}));if(w.ok)return await Rc(300),Ad({restart:!1});console.error("Failed to restart server",w.status),Fl(`Failed to restart server: ${w.status}`)}}if(!p){process.title="Needle CLI server";const S=await import("express").catch(e=>{throw console.error("Error starting the auth server (express not found)",e),Fl("Error starting the auth server"),new Error("Failed to load express module")});if(!S)throw Fl("Error loading auth server module"),new Error("Failed to load express module");Fl(`Starting Needle CLI server ${ru()} (built ${Ed})... (Using api at https://cloud.needle.tools/api)`,{emptyLineBefore:!0}),l.isHost=!0;let j=null;const $={invalid_login:!1,invalid_login_type:null,user_email:null,logged_in_machine_names:[]};let O=S.default();O.use(Od({limit:"10mb"}));const R=y(ie(),".needle"),A=function(e,t){var n;const i=W(e,"local-server-token"),a=null!=(n=function(e){if(!T(e))return null;try{const t=z(e,"utf-8");if(0===t.length)return null;const n=JSON.parse(t);if(n&&"string"==typeof n.token&&n.token.length>0)return n.token}catch{}return null}(i))?n:o();E(e,{recursive:!0});const s=JSON.stringify({token:a,pid:process.pid,port:t},null,2);if(L(i,s,{encoding:"utf-8",mode:384}),"win32"===process.platform)try{const e=process.env.USERNAME||process.env.USER||"";e&&we("icacls",[i,"/inheritance:r","/grant:r",`${e}:(F)`],{stdio:"ignore",timeout:5e3})}catch{}return a}(R,Xl);Fl(`Local token written to ${y(R,"local-server-token")}`);const C=function(e,t=5e3){const n=new Map,o=Math.max(1,Math.round(t/1e3));return(i,a)=>{const s=Date.now(),r=n.get(i);if(!r||s-r.lastLog>t){var c;const t=null!=(c=null==r?void 0:r.suppressed)?c:0;e(t>0?`${a} [+${t} similar in last ${o}s]`:a),n.set(i,{lastLog:s,suppressed:0})}else r.suppressed++}}(e=>Fl(`Denied: ${e}`),5e3);O.use(function(e){const t=null==e?void 0:e.onDenied;return(e,n,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(Sd(s))return o();if(t)try{var c,l,p,u;const n=null!=(c=null==(l=e.headers)?void 0:l["user-agent"])?c:"unknown",o=null!=(p=null!=(u=e.path)?u:e.url)?p:"?";t(`origin|${s}|${o}`,`denied origin=${s} path=${o} ua="${n}"`)}catch{}return n.status(403).send("Forbidden: origin not allowed")}return o()}}({onDenied:C}));const N=new Set(["/","/sign-in","/sign-out","/auth-callback","/api/info","/api/authenticated","/api/public_key","/mcp","/register"]),P="needle_local";O.use((e,t,n)=>{var o,i,a;if("OPTIONS"===e.method)return n();if(N.has(e.path))return n();if(e.path.startsWith("/mcp/"))return n();if(e.path.startsWith("/.well-known/"))return n();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]===A)return n()}if((null==(i=e.query)?void 0:i.token)===A)return n();const r=((null==(a=e.headers)?void 0:a.cookie)||"").split(";").map(e=>e.trim()).find(e=>e.startsWith(P+"="));if(r&&r.split("=")[1]===A)return n();try{var c,l;const t=null!=(c=null==(l=e.headers)?void 0:l["user-agent"])?c:"unknown";C(`token|${t}|${e.path}`,`path=${e.path} ua="${t}" — no valid token or cookie`)}catch{}return t.status(401).send("Unauthorized: token required")}),O.use(Xu($)),t.ora?(t.ora.start("Starting MCP server..."),t.ora.succeed(`MCP server available at ${Ql}/mcp`)):console.log(`\nMCP server available at ${Ql}/mcp .`),O.use(ld);const I="\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 (${ru()})"/>`,F="</div>";let D="";O.get("/",td(),async(e,t)=>{var n,o;if(null!=(n=e.user)&&n.isAuthenticated?t.cookie(P,A,{httpOnly:!0,sameSite:"strict",path:"/"}):t.clearCookie(P,{path:"/"}),t.set({"Content-Type":"text/html; charset=utf-8"}),t.write(I),null!=e.query.cancelled)return t.end("Login cancelled. You can close this window now."),void Fl("Login cancelled by user");if(null!=e.query["too-many-logins"]&&$.logged_in_machine_names.length){var a;const e=wl();let n="<div>";return n+="<strong>You have reached the maximum number of allowed device logins!</strong><br/><br/>",n+=(null==(a=$.logged_in_machine_names)?void 0:a.map(e=>`• ${e}`).join("<br/>"))+"<br/><br/>",n+=`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/>`,n+="</div>",t.status(406),t.end(U+n+F),void Fl(`Login failed: Too many logins from different machines: [${$.logged_in_machine_names.join(", ")}]`)}if(null!=e.query.error)return t.status(500),void t.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://${Ul()}" target="_blank">${Ul()}</a></span>\n </div>\n ${F}`);if(null!=(o=e.user)&&o.isAuthenticated){var s;if(!await Zp(e.user)){if($.invalid_login=!0,$.logged_in_machine_names=[...Kp(e.user)],Sp(),Fl("Cleared stored auth data"),"client"in e.user){const t=e.user;await t.client.clearAccessToken(),await t.client.clearAllTokens(),Fl("Cleared all tokens")}return t.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>${F}`)}$.invalid_login=!1,t.end(`${U}\n <div>\n Hi ${Qu(e.user)} — you logged in successfully. You can close this window now.\n </div>\n ${F}`);const n=`Logged in successfully as ${Qu(e.user)} (${null==(s=e.user.userInfo)?void 0:s.sub})`;return void(D!==n&&(D=n,Fl(D)))}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}`),t.write(U+r+F),t.end()}),O.post("/restart",(e,n)=>{var o;t.ora&&(t.ora.text="Received restart event. This instance will close"),null==(o=j)||o.close(e=>{e&&console.error(e)}),setTimeout(()=>{process.exit(0)},100),n.status(200).end("Server is restarting"),Fl("Server is restarting\n")}),O.get("/api/logs",async(e,t)=>{const n=Ul();r(n)?h(n,"utf-8",(e,o)=>{if(e)return console.error(e),void t.status(500).end("Failed to read log file");t.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${ru()} (built ${Ed}) Log File (newest first) ---\n${n}\n\n`;a+=i,t.status(200).end(a)}):t.status(404).end("Log file not found")}),O.get("/api/info",(e,t)=>{t.json({api_endpoint:"https://cloud.needle.tools/api",version:ru()})}),O.get(a,td(),async(e,t)=>{var n;if(!0===$.invalid_login){const e=Cd($);return t.status(e.status).json(e)}$.invalid_login=!1,t.status(null!=(n=e.user)&&n.isAuthenticated?200:400).send()}),O.get("/api/user",td(),async(e,t)=>{var n;const o=e.user;if(null==o||!o.isAuthenticated){if(!0===$.invalid_login){const e=Cd($);return t.status(e.status).json(e)}return t.status(401).json({error:"Not authenticated"})}if($.invalid_login=!1,!await Zp(o))return Sp(),t.status(403).json({error:"You have been logged out from this machine"});if(null==o||!o.claims)return t.status(400).json({error:"User claims not found"});if(null==o||!o.userInfo)return t.status(400).json({error:"User info not found"});const i=null==o||null==(n=o.claims)?void 0:n.organization_roles,a=null==o?void 0:o.userInfo.custom_data,s={authenticated:o.isAuthenticated,id:o.userInfo.sub,name:Qu(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 t;const n={id:e.id,name:e.name,roles:(null==i?void 0:i.filter(t=>t.startsWith(e.id)).map(e=>e.split(":")[1]))||[],canWrite:!1};return n.canWrite=null==(t=n.roles)?void 0:t.some(e=>r.includes(e)),n}).sort((e,t)=>e.id===s.default_org_id?-1:t.id===s.default_org_id?1:e.name.localeCompare(t.name))),t.json(s)}),O.get("/api/license",td(),async(t,n)=>{var o,i,a;const s=null==(o=t.query.token)?void 0:o.toString(),r=null==(i=t.query.org)?void 0:i.toString();let c=null;if(s)c={authToken:s};else{const e=await Mp();if(!e||!e.isAuthenticated)return n.status(401).json({error:"Not authenticated",code:"not_authenticated"});if(!await Zp(e))return Sp(),n.status(403).json({error:"Invalid login"});c=await ed(e,r||null).catch(e=>({status:500,error:e.message}))}if(!c)return n.status(500).json({error:"Failed to fetch licenses (Missing auth)"});if("error"in c)return n.status(c.status).json({error:c.error});const l=ze(c),p=null==(a=t.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${Ue.account.get_licenses}`,{method:"GET",headers:u}).catch(e=>{const t=Rd(e);return console.error("Failed to fetch licenses:",t),Fl(`Failed to fetch licenses: "${t}" - is https://cloud.needle.tools/api reachable?`),null});if(!d)return n.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),n.json(e)}return n.status(d.status).json({error:d.statusText})}),O.get("/api/deployments",td(),async(e,t)=>{var n;const o=await Mp();if(!o||!o.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const i=null==(n=e.query.org)?void 0:n.toString(),a=await ed(o,i).catch(e=>({status:500,error:e.message}));if("error"in a)return t.status(a.status).json({error:a.error});if(i&&!a.org)return t.status(400).json({error:"Organization not found"});const s=await Vl({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 t.status(s.status).json({error:s.error});for(const e of s.deployments)e.editUrl=`${_l()}/${e.id}`;const r={...s};return t.json(r)}),O.get(c,td(),async(e,t)=>{var n,o,i,a,s,r,c,l;const p=await Mp();if(!p||!p.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const u=(null==(n=e.query.org)?void 0:n.toString())||(null==(o=p.userInfo)||null==(o=o.custom_data)?void 0:o.default_org)||void 0,d=await ed(p,u).catch(e=>({status:500,error:e.message}));if("error"in d)return t.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 sl({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?t.status(f.status).json({error:f.error}):t.json(f)}),O.get(c+"/:identifier",td(),async(e,t)=>{var n,o;const i=await Mp();if(!i||!i.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const a=(null==(n=e.query.org)?void 0:n.toString())||(null==(o=i.userInfo)||null==(o=o.custom_data)?void 0:o.default_org)||void 0,s=await ed(i,a).catch(e=>({status:500,error:e.message}));if("error"in s)return t.status(s.status).json({error:s.error});const r=await rl({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?t.status(r.status).json({error:r.error}):t.json(r)}),O.get(s,td(),async(t,n)=>{const o=await Mp();if(!o||!o.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const i=`https://cloud.needle.tools/api${Ue.local_projects.get.user}`,a=await e(i,{method:"GET",headers:{Authorization:`Bearer ${o.accessToken}`}}).catch(e=>(console.error("Failed to fetch projects:",Rd(e)),null));if(!a)return n.status(502).json({error:"Failed to fetch projects: upstream API unreachable"});if(!a.ok)return n.status(a.status).json({error:a.statusText});const s=await a.json().catch(e=>console.error(e));return n.json(s)}),O.get(s+"/:id",td(),async(t,n)=>{var o;const i=await Mp();if(!i||!i.isAuthenticated)return n.status(401).json({error:"Not authenticated"});let a=null==(o=t.query.org)?void 0:o.toString();const s=await ed(i,a).catch(e=>({status:500,error:e.message}));if(!s)return n.status(500).json({error:"Failed to fetch projects"});if("error"in s)return n.status(s.status).json({error:s.error});const r=ze(s),c=`https://cloud.needle.tools/api${Ue.local_projects.get.by_id}${encodeURIComponent(t.params.id)}`,l=await e(c,{method:"GET",headers:{...r}}).catch(e=>(console.error("Failed to fetch project:",Rd(e)),null));if(!l)return n.status(502).json({error:"Failed to fetch project: upstream API unreachable. Please try again later or contact hi@needle.tools"});if(!l.ok)return n.status(l.status).json({error:l.statusText});const p=await l.json().catch(e=>(console.error(e),null));return p?n.json(p):n.status(500).json({error:"Failed to parse data. Please try again later or contact hi@needle.tools"})}),O.post("/api/projects",td(),async(t,n)=>{const o=await Mp();if(!o||!o.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const i="string"==typeof t.body?JSON.parse(t.body):t.body,a={machine_id:await Xp(),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 n.status(400).json({error:"Invalid request"});const s=`https://cloud.needle.tools/api${Ue.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:",Rd(e)),null));return r?r.ok?n.send("OK"):n.status(r.status).json({error:r.statusText}):n.status(502).json({error:"Failed to upsert project: upstream API unreachable"})}),O.get("/api/public_key",td(),async(t,n)=>{var o,i;const a=await Mp();if(!a||!a.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const s=null==(o=t.query.org)?void 0:o.toString(),r=await ed(a,s).catch(e=>({error:e.message,status:500}));if(!r)return n.status(500).json({error:"Failed to fetch public key"});if("error"in r)return n.status(r.status).json({error:r.error});const c={project_id:(null==(i=t.query.project_id)?void 0:i.toString())||void 0,machine_id:await Xp()},l=await e(`https://cloud.needle.tools/api${Ue.account.public_key}`,{method:"POST",headers:{...ze(r),"Content-Type":"application/json"},body:JSON.stringify(c)}).catch(e=>(console.error("Failed to fetch public key:",Rd(e)),null));if(!l)return n.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?n.json(e):n.status(500).json({error:"Failed to fetch public key"})}return n.status(l.status).json({error:l.statusText})}),O.get("/api/local_project_id",async(e,t)=>{const n=e.query.paths;if(!n)return t.status(400).json({error:"Missing paths"});let o=[];"string"==typeof n?o=n.split(",").map(e=>e.trim()).filter(e=>e.length>0):Array.isArray(n)&&(o=n.map(e=>e.toString().trim()).filter(e=>e.length>0));const i=hd(o);return i?t.json({project_id:i}):t.status(404).json({error:"Project ID not found"})}),O.post("/api/project/info",td(),async(e,t)=>{(function(e){try{!function(e){var t,n,o,i;const a={last_accessed:Date.now(),editor:null!=(t=e.scene_path)&&t.endsWith(".unity")?"unity":null!=(n=e.scene_path)&&n.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=iu();let r=au();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,t)=>t.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&&Fl(`Active project changed: ${l||"(none)"} → ${p}`);try{tu=r;const e=JSON.stringify(r);m(s,e,"utf-8")}catch(e){console.error("Failed to save project info:",e)}}(e)}catch(e){Fl("Error saving project info: "+e)}})("string"==typeof e.body?JSON.parse(e.body):e.body),t.send("OK")});let q=null;const B=new Promise(e=>q=e);let M=!1;if(j=O.listen(Xl,()=>{null==q||q()}),j.on("error",e=>{if("EADDRINUSE"===(null==e?void 0:e.code))return Fl(`License server port ${Xl} already in use — a server is already running; not starting a second one.`),M=!0,l.isHost=!1,void(null==q||q());console.error("[needle] License server failed to start:",(null==e?void 0:e.message)||e),Fl(`License server failed to start: ${(null==e?void 0:e.message)||e}`),process.exit(1)}),function(e,t){e.on("connection",e=>{const n=e.remoteAddress;if(!function(e){if(!e)return!1;const t=e.includes("%")?e.slice(0,e.indexOf("%")):e;return"127.0.0.1"===t||"::1"===t||"::ffff:127.0.0.1"===t}(n)){try{null==t||t(`Local server: rejected non-loopback connection from ${n||"unknown"}`)}catch{}e.destroy()}})}(j,Fl),j.on("close",d),process.on("exit",d),process.on("SIGINT",()=>{d(),process.exit(0)}),await B.catch(e=>{console.error(e),Fl(`Error starting the auth server (promise failed): ${e.message}`)}),M)return l;function d(){Fl("Cleaning up auth server...")}(function(e,t){const n=new xe({server:e,path:"/mcp/ws",verifyClient:({req:e},t)=>{var n;const o=null==(n=e.headers)?void 0:n.origin;if(o&&!Sd(o))return Fl(`${jd} rejected WS upgrade: disallowed origin ${o}`),void t(!1,403,"Forbidden: origin not allowed");t(!0)}});Fl("MCP websocket server created.");let o=0,i=new Map;n.on("connection",e=>{const t=++o;Td.push(e),console.log(`${jd} client connected (#${t})`),Fl(`${jd} client connected (#${t})`),e.on("close",()=>{const n=Td.indexOf(e);-1!==n&&Td.splice(n,1);const o=i.get(t);if(o){for(const e of o)mu(e,wd);i.delete(t)}console.log(`${jd} client disconnected (#${t})`),Fl(`${jd} client disconnected (#${t})`)});const n=new Map;e.on("message",o=>{try{const a=o.toString(),s=JSON.parse(a);switch(s.command){default:console.log(`${jd} Unknown command: ${s.command}`),Fl(`Unknown MCP websocket command received: ${s.command}`);break;case"get_connected_clients":!function(t,n){const o={clients:[...md()],command:"mcp_server_response",messageId:"messageId"in t?t.messageId:void 0};e.send(JSON.stringify(o))}(s);break;case"register_tools":{const o=s.tools,a=s.source;a&&function(e,t){const n=du.get(e);if(n&&n.size>0){console.log(`[MCP] Removing ${n.size} tools registered from ${e}`);let o=!1;for(const t of n){const n=pu.findIndex(e=>e.name===t);-1!==n&&(pu.splice(n,1),delete uu[t],hu.set(t,e),o=!0)}du.delete(e),o&&t()}}(a,wd);const r=a||"unknown";console.log(`${jd} ${r} registered ${o.length} tool${1===o.length?"":"s"}`),Fl(`${jd} ${r} registered ${o.length} tool${1===o.length?"":"s"}`);const c=i.get(t)||new Set;i.set(t,c);for(const t of o)c.add(t.name),fu(t,async o=>{console.log(`Tool ${t.name} executed via WebSocket with args:`,o);const i=`${t.name}-${Date.now()}-${Math.random()}`;return await new Promise((a,s)=>{const r=setTimeout(()=>{n.has(i)&&(console.error(`${jd} Tool execution timed out for tool: ${t.name}`),n.delete(i),s(new Error(`Tool execution timed out for tool: ${t.name}`)))},3e4);n.set(i,{resolve:e=>{a(e),clearTimeout(r)},reject:s}),e.send(JSON.stringify({command:"execute_tool",toolName:t.name,args:o,requestId:i}))})},{source:a},wd);break}case"tool_result":{const e=s.requestId,t=s.result;if(console.log(`${jd} Received tool result for requestId: ${e}`,t),n.has(e)){const o=n.get(e);null==o||o.resolve(t),n.delete(e)}else console.error(`${jd} No pending tool execution found for requestId: ${e}`);break}}}catch(e){console.error(`${jd} Error processing WebSocket message:`,e)}})})})(j),_u({logToolCount:!0}),Ju();const G=Nu(R,()=>{Cu()?(Fl("Settings changed: remote_ai_tools disabled — closing cloud connection"),Vu("remote_ai_tools setting disabled")):(Fl("Settings changed: remote_ai_tools enabled — opening cloud connection"),Ju())});process.on("exit",()=>{G(),Vu("process exit")})}return l}function Cd(e){let t="";return t=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 ${wl()}. You're currently logged in on: ${e.logged_in_machine_names.join(", ")}`:"An unknown error occured.",{status:403,error:t}}async function Nd(e={headless:!1,silent:!1,clearAuthData:!1}){return!0===e.clearAuthData&&await Sp(),Id("sign-in",{...e})}function Pd(e={}){return Id("sign-out",{...e})}function Id(t,n){return new Promise(async(o,i)=>{let a=!1;if("sign-in"==t){const e=await Mp();if(null!=e&&e.isAuthenticated&&e.accessToken)return await eu(e)?(a=!0,n.ora&&(n.ora.text=`Authorized as ${Qu(e)}`),"gotoAccountPage"in n&&!0===n.gotoAccountPage&&(n.ora&&(n.ora.text="Opening account page in the browser"),kl(wl()),await new Promise(e=>setTimeout(e,2e3))),o(e)):o(null);if(!0===n.headless)return o(null)}else if("sign-out"==t&&!0===n.headless){a=!0,Sp();const t=await Ad(),n=await e(t.auth_endpoints["sign-out"],{follow:2});return o(n.ok)}const s=await Ad();switch(n.timeout||(n.timeout=6e5),"number"==typeof n.timeout&&n.timeout>0&&setTimeout(()=>{a||(n.ora&&n.ora.fail('Timeout "'+t+'"'),o(null))},n.timeout),t){case"sign-in":const e=s.auth_endpoints["sign-in"];setTimeout(()=>kl(e),300),n.ora&&(n.ora.text=`Please authenticate in the browser: ${e}`),setTimeout(l,2e3);break;case"sign-out":Sp(),kl(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(t){case"sign-in":if(200===e.status){const e=await Mp();return e&&!await eu(e)?o(null):(a=!0,n.ora&&e&&(n.ora.text="User is authenticated"),o(e))}if(403===e.status){n.ora&&n.ora.fail("Authentication failed");const t=await e.text();if(t.startsWith("{")){const e=JSON.parse(t);if("logged_in_machine_names"in e&&Array.isArray(e.logged_in_machine_names)){const t=e.logged_in_machine_names;j().fail(`You're already authenticated on ${t.length} other machine(s). Please logout from other machines first. You're currently logged in on: ${t.join(", ")}`)}}return o(null)}break;case"sign-out":if(400===e.status)return a=!0,Sp(),n.ora&&(n.ora.text="User is signed-out"),o(!0)}else if(r++,r>c)return n.ora?n.ora.fail(`Failed to complete auth flow. Please try again. Make sure that port ${s.port} is not blocked`):n.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 Ud=/token|secret|password|authorization|api[-_]?key|access[-_]?key|private[-_]?key|client[-_]?secret/i;function zd(e,t){return async function(n){const o=function(e,t){const n=[];if(e&&Object.keys(e).length>0&&n.push(`args=${Ld(e)}`),t&&Object.keys(t).length>0){const e=Object.fromEntries(Object.entries(t).map(([e,t])=>Ud.test(e)?[e,"<redacted>"]:[e,t]));n.push(`options=${Ld(e)}`)}return n.join(" ")}(null==n?void 0:n.args,null==n?void 0:n.options);Fl(`CLI action: ${e}${o?" "+o:""}`);const i=Date.now();try{const o=await t(n);return Fl(`CLI action: ${e} succeeded in ${Date.now()-i}ms`),o}catch(t){const n=t instanceof Error?t.message:String(t);throw Ll(`CLI action: ${e} failed in ${Date.now()-i}ms: ${n}`),t}}}function Ld(e){try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():"function"==typeof t?"<fn>":t)}catch{return"<unserializable>"}}globalThis.fetch||(globalThis.fetch=e),globalThis.File||(globalThis.File=t),globalThis.crypto||(globalThis.crypto=n.webcrypto),function(e={}){var t,n,o;const i=null!=(t=e.proc)?t:process,a=null!=(n=e.log)?n:Ll,s=null!=(o=e.error)?o:e=>console.error(e),r=(e,t)=>{const n=t instanceof Error&&t.message||String(t);try{const o=t instanceof Error&&t.stack?`\n${t.stack}`:"";a(`CLI crashed (${e}): ${n}${o}`)}catch{}try{s(`error: ${n}`)}catch{}try{i.exit(1)}catch{}};i.on("unhandledRejection",e=>r("unhandled rejection",e)),i.on("uncaughtException",e=>r("uncaught exception",e))}();const Fd=process.argv.includes("--silent"),Dd=JSON.parse(l(new URL("../package.json",import.meta.url),"utf-8")),qd="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 Bd(e,t=null,n=!0){let o,i=null==e?void 0:e.toString();var a;if(i||(ue.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}),t=10;let n,i="",a=!1;return new Promise(s=>{const r="Paste your https://cloud.needle.tools/team#token access token here:",c=j({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(n),n=setTimeout(()=>{if(!a&&(u||i.trim().length>t)){process.stdin.setRawMode(!1),e.close(),a=!0;const t=i.trim();if(t.length>0){const e=t.slice(3,-3).replace(/./g,"*");c.succeed("Access token received: "+e)}else c.fail("No access token provided");s({accessToken:t,org_id:o})}},150)})})}if(!i){let e;await async function(){const e=await Mp();return null==e?void 0:e.isAuthenticated}()||(e=Fd?void 0:j("No access token found. Please sign in to authenticate...").start()),Fl("No access token provided, attempting login. Org: "+t);const a=Nd({headless:!n,ora:e,timeout:12e4}),d=await a;var s;if(d&&!await Zp(d)?(null==(s=e)||s.fail("You are not logged in from this machine. Please login again."),await Pd({headless:!0}),process.exit(1)):e&&(Fl("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==t){const e=await Wp(d);"string"==typeof e&&(t=e)}else t===(null==(r=d.userInfo)?void 0:r.sub)&&(t=null);if(t){var c,l,p;if(o=null==(c=d.userInfo)||null==(c=c.organization_data)||null==(c=c.find(e=>e.id===t))?void 0:c.id,o||(t=null==(l=t.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()===t))?void 0:p.id)),!o)throw new Error(`ERR: You (${Qu(d)}) are not a member of the team "${t}" 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)),Fl("Getting access token for org "+o+", "+i.substring(0,8)+"...")}else{var u;Fl("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"),Fl("ERR: Missing NEEDLE_CLOUD_TOKEN token. Org: "+o),process.exit(403)),{accessToken:i,org_id:o}}function Md(e){return null!=e.org&&console.warn("Warning: --org is deprecated. Use --team instead."),e.team||e.org}const Wd=Ie.program;async function Gd(){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))}Wd.version(Dd.version).description("Command-line interface (CLI) for Needle Cloud"),Wd.command("version","Print the CLI version").configure({visible:!1}).action(()=>{Fd||console.log(`☁ Needle CLI — ${Dd.version}, Node ${process.version}`)}),Wd.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:Wd.BOOLEAN,default:!1}).option("--integration <integration>","Hint for the process which integration triggered this command",{required:!1,validator:Wd.STRING}).action(async({options:e})=>{const t=e.integration,n=Fd?void 0:j("Starting Needle License server "+(t?`(from ${t})`:"")).start();Ad({ora:n,restart:e.restart}).catch(e=>{console.error("Failed to start server:",e),null==n||n.fail("Failed to start server: "+e.message),process.exit(1)}).then(e=>{null!=e&&e.baseUrl&&e.isHost?null==n||n.succeed(`Server started on ${e.baseUrl} (v${ru()}, built ${function(e){if("string"!=typeof Ed||0===Ed.length)return"unknown";const t=new Date(Ed);if(Number.isNaN(t.getTime()))return"unknown";const n=e=>String(e).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}()})`):!1===(null==e?void 0:e.isHost)?(t||null==n||n.warn(`Server is running on ${e.baseUrl||e.port}`),process.exit(0)):(null==n||n.fail("Failed to start server"),process.exit(1))})}),Wd.command("settings","Show current Needle CLI settings").action(async()=>{const{readSettings:e,KNOWN_SETTINGS:t}=await Promise.resolve().then(function(){return Pu}),n=e();for(const[e,o]of Object.entries(t)){const t=n[e],i=void 0!==t?String(t):o.default;console.log(`\n ${"enabled"===i?"[x]":"[ ]"} ${o.displayName}: ${i}${void 0===t?" (default)":""}`),console.log(` ${o.description}`),console.log(` Change: ${o.command}`)}console.log("")}),Wd.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:Wd.BOOLEAN}).action(zd("settings remote-ai-tools",async({args:e})=>{const{writeSetting:t,defaultSettingsDir:n}=await Promise.resolve().then(function(){return Pu}),o=e.enabled,i=n();o?(t(i,"remote_ai_tools",null),console.log("Remote AI tools enabled (default)."),Fl("Settings: remote_ai_tools set to enabled (default) via CLI command")):(t(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."),Fl("Settings: remote_ai_tools set to disabled via CLI command"))})),Wd.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(zd("mcp",async()=>{const{startStdio:e}=await Promise.resolve().then(function(){return bd});e()})),Wd.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 t=hd(e.paths);t?console.log(`Found project ID: "${t}"`):console.log("No project ID found.")}),Wd.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:Wd.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:Wd.BOOLEAN,default:!1}).action(zd("send-logs",async({options:e})=>{var t,n,o,i,a,s,r;const{runSendLogs:c,HAYSTACK_RESOURCE:l}=await Promise.resolve().then(function(){return bp}),{tryGetFreshAccessTokenForResource:p}=await Promise.resolve().then(function(){return Jp}),{findActiveEditorLog:u}=await import("./cli.send-logs.discovery-0e806cf7.js"),{getLogFilePath:d,getPrevLogsFilePath:m,getPipelineLogFilePath:f}=await Promise.resolve().then(function(){return Dl}),{homedir:h,platform:g}=await import("os"),{existsSync:v}=await import("fs"),{BUILD_TIME:x}=await Promise.resolve().then(function(){return $d}),{getNodeVersion:b,getNpmVersion:y,getArch:w,getOsRelease:_,getCpuCount:k,getTotalMemoryMb:S,getTzOffsetMinutes:T,isCi:E,isTty:$}=await import("./cli.runtime-465aa7a3.js"),O=null!=(t=null!=(n=null==(o=e.crash)||null==o.valueOf?void 0:o.valueOf())?n:e.crash)&&t?"crash":"normal",R=e.note,A=null!=(i=null!=(a=null==(s=e.dryRun)||null==s.valueOf?void 0:s.valueOf())?a:e.dryRun)&&i,C=d(),N=m(),P=f(),I={getAccessToken:()=>p(l),fetch:globalThis.fetch,paths:{cliLogPath:v(C)?C:null,prevLogPath:v(N)?N:null,pipelineLogPath:v(P)?P:null,homeDir:h()},meta:{cli_version:ru(),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:S(),tz_offset_minutes:T(),is_ci:E(),is_tty:$()},findActiveEditorLog:u,stdout:process.stdout,stderr:process.stderr},U=A?"Building payload (dry-run)":"Uploading logs",z=Fd?void 0:j(U).start();I.recoverAuth=async()=>{null==z||z.stop();try{await Gd();const e=await Nd({clearAuthData:!0,silent:Fd,ora:void 0});if(null==e||!e.isAuthenticated)return null}catch(e){return Fl(`send-logs: auto-recovery login failed: ${e instanceof Error?e.message:e}`),null}finally{null==z||z.start(U)}return await p(l)};const L=await c({mode:O,note:R,dryRun:A},I);L.ok?A?null==z||z.succeed("Dry-run payload printed above. Nothing was uploaded."):L.truncated?(null==z||z.warn(`Uploaded (truncated at server cap). Reference: ${L.refId}`),console.log(`Share ${L.refId} in your bug report.`)):(null==z||z.succeed(`Uploaded. Reference: ${L.refId}`),console.log(`Share ${L.refId} in your bug report.`)):(null==z||z.fail(L.error||"Upload failed"),process.exitCode=1)})),Wd.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:Wd.BOOLEAN,default:!1}).option("--clear <clear>","Refresh the access token",{required:!1,validator:Wd.BOOLEAN,default:!1}).action(async({options:e})=>{await Gd();const t=e.headless.valueOf()||!1,n=e.clear.valueOf()||!1,o=Fd?void 0:j("Login").start();await Nd({headless:t,silent:Fd,clearAuthData:n,ora:o}).then(async e=>{null!=e&&e.isAuthenticated?null==o||o.succeed("Successfully logged in as "+Qu(e)):0==t?null!=e&&e.claims||null!=e&&e.userInfo?null==o||o.warn(`You (${Qu(e)}) are not authenticated...`):null==o||o.fail("Login failed"):Fd||null==o||o.warn("Not logged in"),process.exit(null!=e&&e.isAuthenticated?0:1)})}),Wd.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:Wd.BOOLEAN,default:!1}).action(async({options:e})=>{await Gd();const t=e.headless.valueOf()||!1;await Pd({headless:t}).then(e=>{e?j("Logged out").succeed():j("Logout failed").fail(),process.exit(e?0:1)})}),Wd.command("me","Prints your user information").help("Prints basic informaton about the logged in Needle Cloud account (your account)").action(async({})=>{const e=Fd?void 0:j("Query user data").start(),t=await Mp();if(null!=t&&t.isAuthenticated&&await Zp(t)){const a=t.userInfo||t.claims;var n,o,i;a?(null==e||e.succeed(`You are logged in as ${Qu(t)}`),console.log(`- Name: ${Qu(t)}`),console.log(`- ID: ${a.sub}`),a.email&&console.log(`- Email: ${a.email}`),a.phone_number&&console.log(`- Phone: ${a.phone_number}`),null!=(n=t.userInfo)&&n.organization_data&&console.log(`- Teams [${null==(o=t.userInfo)?void 0:o.organization_data.length}]: ${null==(i=t.userInfo)?void 0:i.organization_data.sort((e,t)=>e.name.localeCompare(t.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")}),Wd.command("get-pro","Start license flow for Needle Engine PRO").configure({visible:!1,strictArgsCount:!1,strictOptions:!1}).option("--team <team>","The team to purchase the license for",{validator:Wd.STRING}).option("--org <org>","Legacy alias for --team",{validator:Wd.STRING,hidden:!0}).action(zd("get-pro",async({options:e})=>{var t;let n=(null==(t=Md(e))?void 0:t.toString())||null;const o=j().start("Start Needle Engine PRO purchase flow"),i=function(e){e=e||{};const t="undefined"!=typeof window?window.location:null;"current_page"===e.baseUrl&&(e.baseUrl=null==t?void 0:t.href);let n=e.pathname||(null==t?void 0:t.pathname),o=e.baseUrl||(null==t?void 0:t.href);if(!n||!o)return null;const i=new URL(n,o);return t&&(i.search=t.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:n?`/team/${n}`:"/account",account_id:n,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}`),kl(a)}));const Hd={account:{url:wl}},Jd=`"${Object.keys(Hd).join('", "')}"`;Wd.command("open",`Open a page in the default browser. Options are: ${Jd}`).argument("<page>",`The page to open. Options are: ${Jd}`,{validator:Wd.STRING}).configure({strictOptions:!1,strictArgsCount:!1,visible:!1}).help("").action(async({args:e,logger:t})=>{const n=e.page.toString(),o=Hd[n];o?"url"in o?kl(o.url()):t.error(`Unknown argument: ${n}`):t.error(`Unknown argument: ${n}. Options are: ${Jd}`)}),Wd.command("list-deployments","Get a list of deployed websites").configure({visible:!1}).help("").option("--token <token>",qd,{validator:Wd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Wd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Wd.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Wd.STRING}).option("--limit <limit>","Limit the number of deployments to show (min: 0, max: 100)",{validator:Wd.NUMBER,default:10}).option("--offset <offset>","The offset for deployments (default: 0, min: 0)",{validator:Wd.NUMBER,default:0}).option("--format <format>","The output format. Options: cli (default), json",{validator:Wd.STRING,default:"cli",hidden:!0}).option("--name","Filter by one or multiple deployment names (separated by ;)",{validator:Wd.STRING}).action(async({options:e,logger:t})=>{var n,o,i;const{accessToken:a,org_id:s}=await Bd(e.token,Md(e)),r=(null==(n=e.endpoint)?void 0:n.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 t.error("The limit can not be negative");if(c>100)return void t.error("The limit can not be higher than 100");const d=j("Query deployments").start(),m=await Vl({endpoint:r,authToken:a,org:s,limit:c,offset:l,names:null==u?void 0:u.split(";")}).catch(e=>{t.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,n)=>{t.info(`${n+c*l}: ${e.name} – ${e.url}`)})):d.warn("No deployments found"),process.exit(0)}else d.fail("Failed to query deployments"),process.exit(1)}),Wd.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>",qd,{validator:Wd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Wd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Wd.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Wd.STRING}).option("--type <type>","Filter by content type (e.g. material, 3d-asset, deployment)",{required:!1,validator:Wd.STRING}).option("--format <format>","Filter by output format (e.g. glb, textures)",{required:!1,validator:Wd.STRING}).option("--search <search>","Search by name, title or description",{required:!1,validator:Wd.STRING}).option("--limit <limit>","Max number of items to show (default: 20, max: 100)",{validator:Wd.NUMBER,default:20}).option("--offset <offset>","Offset for pagination (default: 0)",{validator:Wd.NUMBER,default:0}).option("--output <output>","Output style: cli (default), json",{validator:Wd.STRING,default:"cli"}).action(async({options:e,logger:t})=>{var n,o,i,a,s,r,c,l,p;const{accessToken:u,org_id:d}=await Bd(e.token,Md(e)),m=(null==(n=e.endpoint)?void 0:n.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=j("Querying content...").start();try{const e=await sl({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 n=e.items.map(e=>{var t;const n=e.title||"(untitled)";return{id:e.identifier,type:e.content_type||"?",formats:null!=(t=e.content_formats)&&t.length?e.content_formats.join(", "):"",name:n.length>20?n.slice(0,17)+"...":n,versions:String(e.version_count||0),date:e.created_at?Ac(new Date(e.created_at),new Date,{allowSimple:!0,limitInDays:2}):""}}),o={id:Math.max(2,...n.map(e=>e.id.length)),type:Math.max(4,...n.map(e=>e.type.length)),formats:Math.max(7,...n.map(e=>e.formats.length)),name:Math.max(4,...n.map(e=>e.name.length))},i=Zl(` ${"ID".padEnd(o.id)} ${"TYPE".padEnd(o.type)} ${"FORMATS".padEnd(o.formats)} ${"NAME".padEnd(o.name)} ${"#".padStart(3)} AGE`);t.info(i);for(const e of n){const n=Yl(e.type).padEnd(o.type+11),i=(e.formats?e.formats.split(", "):[]).map(e=>Yl(e)).join(", ")+" ".repeat(Math.max(0,o.formats-e.formats.length));t.info(` ${Zl(e.id.padEnd(o.id))} ${n} ${i} ${e.name.padEnd(o.name)} ${e.versions.padStart(3)} ${Zl(e.date)}`)}e.total>h+f&&t.info(` ... ${e.total-h-f} more (use --offset ${h+f})`),process.exit(0)}catch(e){y.fail(e.message),process.exit(1)}}),Wd.command("delete","Move a content item to the trash").help("Move a content item to the trash. This immediately frees total storage capacity but does not refund monthly usage. The item can be restored for 31 days if enough total storage is available.\n\nUsage:\n needle-cloud delete <identifier>").argument("<identifier>","Content item identifier",{validator:Wd.STRING}).option("--token <token>",qd,{validator:Wd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Wd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Wd.STRING,hidden:!0}).option("--endpoint <endpoint>","The Needle Cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Wd.STRING}).action(async({args:e,options:t})=>{var n;const{accessToken:o,org_id:i}=await Bd(t.token,Md(t)),a=(null==(n=t.endpoint)?void 0:n.toString())||"https://cloud.needle.tools/api",s=e.identifier.toString(),r=j(`Deleting content "${s}"...`).start();try{const e=await Jl({identifier:s,endpoint:a,authToken:o,org:i});r.succeed(e.message||`Moved content "${s}" to the trash`),process.exit(0)}catch(e){r.fail(e.message),process.exit(1)}}),Wd.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:Wd.STRING}).argument("[directory]","Output directory (default: current directory)",{default:"."}).option("--token <token>",qd,{validator:Wd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Wd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Wd.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Wd.STRING}).option("--format <format>","Output format to download (e.g. glb, textures)",{required:!1,validator:Wd.STRING}).option("--name <name>","Output filename (without extension)",{required:!1,validator:Wd.STRING}).option("--verbose","Show detailed download info",{required:!1,validator:Wd.BOOLEAN,default:!1}).action(async({args:e,options:t,logger:n})=>{var o,i,a,s,r,c;const{accessToken:l,org_id:p}=await Bd(t.token,Md(t)),u=(null==(o=t.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=t.name)?void 0:a.toString())||void 0,h=null!=(s=null==(r=t.verbose)?void 0:r.valueOf())&&s,g=(null==(c=t.format)?void 0:c.toString())||void 0,v=j("Looking up content...").start();try{var x;const e={baseUrl:u,authToken:l,org:p},t=await rl(e,d).catch(()=>null);if(!t)return void v.fail(`Content not found: "${d}". Use the exact content identifier (see list-content).`);const o=null==(x=t.versions)?void 0:x[0];if(!o)return void v.fail(`Content "${t.title||t.name}" has no versions`);let i=o.identifier;if(g){let e=!1;for(const n of t.versions){if(n.content_format===g){i=n.identifier,e=!0;break}const t=n.variants.find(e=>e.content_format===g);if(t){i=t.identifier,e=!0;break}}if(!e)return void v.fail(`No output with format "${g}" found for "${t.title||t.name}"`)}v.text=`Downloading "${t.title||t.name}"${g?` (format: ${g})`:""}...`,v.stop();const a=await Gl({baseUrl:u,authToken:l,org:p,identifier:i,outDir:m,filename:f,verbose:h,content_format:g});"error"in a&&n.error(a.error)}catch(e){v.fail(e.message)}}),Wd.command("deploy","Deploy a website to Needle").help("").argument("<directory>","The directory to deploy",{validator:Wd.STRING}).option("--token <token>",qd,{validator:Wd.STRING}).option("--team <team>","The team name or id to deploy to (not needed when using token/accesstoken)",{required:!1,validator:Wd.STRING}).option("--org <org>","The organization name or id to deloy to (not needed when using token/accesstoken)",{required:!1,validator:Wd.STRING,hidden:!0}).option("--name <name>","The project name. This name will also be used in your website URL",{required:!1,validator:Wd.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:Wd.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Wd.STRING,hidden:!0}).option("--open","Open the deployment in the default browser",{default:!0,validator:Wd.BOOLEAN}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Wd.BOOLEAN,default:!1,hidden:!0}).option("--experimental","Use the experimental upload API. Mostly used for debugging (default: false)",{required:!1,validator:Wd.BOOLEAN,default:!1,hidden:!0}).option("--raw","Use raw to disallow modifications like gzip compression on upload",{required:!1,validator:Wd.BOOLEAN,default:!1,hidden:!0}).option("--no-provenance","Do not record which commit and CI run this deployment came from",{required:!1,validator:Wd.BOOLEAN,default:!1}).action(zd("deploy",async({args:e,options:t,logger:n})=>{var o,i,a,s;const r=t.open,{accessToken:c,org_id:l}=await Bd(t.token,Md(t)),p=t.verbose.valueOf(),u=t.experimental.valueOf()||!1,d=t.raw.valueOf()||!1,m=(null==(o=t.noProvenance)?void 0:o.valueOf())||!1;await Bl({logger:n,endpoint:(null==(i=t.endpoint)?void 0:i.toString())||void 0,token:c,org_id:l,directory:e.directory.toString(),name:(null==(a=t.name)?void 0:a.toString())||void 0,entrypoint:(null==(s=t.entrypoint)?void 0:s.toString())||void 0,open:r,verbose:p||!1,experimental:u||!1,raw:d||!1,noProvenance:m})})),Wd.command("upload","Upload files or a folder to Needle Cloud").help("Uploads your files and returns the link to manage them on Needle Cloud. Processing jobs (asset optimization and related derived formats) are scheduled automatically in the background — this command does not wait for them; use `optimize` to upload and wait for the optimized result. Use --no-optimize to store the files exactly as uploaded, with no jobs scheduled.").option("--token <token>",qd,{validator:Wd.STRING}).option("--team <team>","The team name or id to upload the file to",{required:!1,validator:Wd.STRING}).option("--org <org>","The organization name or id to upload the file to",{required:!1,validator:Wd.STRING,hidden:!0}).argument("<path>","The full path to a file or directory that should be uploaded",{validator:Wd.STRING}).option("--name <name>","The upload project name / unique identifier. This can also be the view id of previous uploads.",{required:!1,validator:Wd.STRING}).option("--no-optimize","Do not schedule any processing jobs — store the files exactly as uploaded",{required:!1,validator:Wd.BOOLEAN,default:!1}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Wd.BOOLEAN,default:!1}).action(zd("upload",async({args:e,options:t})=>{var n,o,i;const a=(null==(n=t.verbose)?void 0:n.valueOf())||!1,{accessToken:s,org_id:r}=await Bd(t.token,Md(t));if(s!=t.token){const e=await Mp();null!=e&&e.isAuthenticated?r||(j("Please provide an organization id to upload files...").fail(),process.exit(1)):(j("Please login to upload files...").fail(),process.exit(1))}const c=await async function(e){const t=await Wl({token:e.token,org_id:e.org_id,fileOrDirectory:e.fileOrDirectory,name:e.name,verbose:e.verbose},{optimizations:!e.noOptimize&&void 0});return"error"in t?t:(e.noOptimize&&j().info("No processing jobs were scheduled (--no-optimize)."),{success:!0,editUrl:t.editUrl})}({token:s,org_id:r,fileOrDirectory:e.path.toString(),name:(null==(o=t.name)?void 0:o.toString())||void 0,noOptimize:(null==(i=t.noOptimize)?void 0:i.valueOf())||!1,verbose:a}).catch(e=>{console.error(e),process.exit(1)});"error"in c&&(c.noprint||console.error(c.error),process.exit(1))})),Wd.command("optimize","Optimize glTF, GLB, VRM, FBX, USD files").help("").option("--token <token>",qd,{validator:Wd.STRING}).option("--team <team>","The team name or id to upload the file to",{required:!1,validator:Wd.STRING}).option("--org <org>","The organization name or id to upload the file to",{required:!1,validator:Wd.STRING,hidden:!0}).argument("<path>","The full path to a file or directory that should be optimized",{validator:Wd.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:Wd.STRING}).option("--name <name>","The optimization project name / unique identifier. This can also be the view id of previous uploads.",{required:!1,validator:Wd.STRING}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Wd.BOOLEAN,default:!1}).option("--progressive","Use Needle progressive loading",{required:!1,validator:Wd.BOOLEAN,default:!0}).option("--usecase <usecase>",'The use case for the optimization. This can be "product" (default) or "world".',{required:!1,validator:Wd.STRING,default:"product"}).action(zd("optimize",async({args:e,options:t,logger:n})=>{var o,i,a,s;const l=t.verbose.valueOf(),{accessToken:p,org_id:u}=await Bd(t.token,Md(t));if(p!=t.token){const e=await Mp();null!=e&&e.isAuthenticated?u||(j("Please provide an organization id to optimize files...").fail(),process.exit(1)):(j("Please login to optimize files...").fail(),process.exit(1));const t=await async function(e,t){const n=e.baseUrl+Ue.account.get_licenses,o={...{...t},...ze(e)},i=await fetch(n,{...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});(!t||t.length<=0||!t.find(e=>"Needle Engine"===e.type&&("pro"===e.license||"enterprise"===e.license)))&&(j("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=t.progressive)?void 0:o.valueOf())||!0,m=(null==(i=t.usecase)?void 0:i.toString())||"product",f=await async function(e){if(e.outDir){var t;if((null==(t=e.outDir)?void 0:t.length)<=0){const e="Output Directory is invalid";return j().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 j().fail(e),{error:e}}}const n=await Wl({token:e.token,org_id:e.org_id,fileOrDirectory:e.fileOrDirectory,name:e.name,verbose:e.verbose},{purposeLabel:"for optimization"});if("error"in n)return n;{const t=n.res,i="https://cloud.needle.tools/api",a=await async function(e,t={progressive:!0}){const n=e.baseUrl+Ue.jobs.create,o={...ze(e),"content-type":"application/json"},i={type:"optimization",job_id:e.id,triggered_by:e.trigger_type,parameters:{...t}},a=await fetch(n,{...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:i,authToken:e.token,org:e.org_id,id:t.id,trigger_type:"cli"},function(e){return e.progressive?{progressive:!0,usecase:e.usecase||"product"}:{progressive:!1}}(e));if(!a)return{error:"Failed to send optimization request"};if("error"in a){const e=`Failed to optimize: ${a.error}`;return console.error(e),{error:e}}{const t=a.job,n=j(`Optimization requested for ${t.name||t.identifier}`).start();let s=!1;n.color="gray";const r=Br();for(;;){if("completed"===a.job.status){var o;s=!0,n.succeed(`${null!=(o=a.message)?o:"Optimization completed"}`);break}let c=2e3;const l=await qr(t.identifier,{baseUrl:i,authToken:e.token,org:a.job.org}),p=r.record(l);if(p)return n.fail(p.reason),{error:p.reason};if("new"!==(null==l?void 0:l.status)&&"pending"!==(null==l?void 0:l.status)||(n.text="Your asset is queued - waiting for optimization to start",n.color="yellow",c=2e3),"running"===(null==l?void 0:l.status))n.text=`Your asset is being optimized: ${l.progress?`${l.progress}%`:""} ${l.status_message?`— ${l.status_message}`:""}`,n.color="cyan",c=1e3;else if("stalled"===(null==l?void 0:l.status))c=2500;else{if("completed"===(null==l?void 0:l.status)){s=!0,n.succeed(`Your asset has finished optimizing: ${l.status_message}`);break}if("canceled"===(null==l?void 0:l.status))return n.fail(`Optimization cancelled: ${l.error}`),{error:l.error||"Optimization cancelled"};if("failed"===(null==l?void 0:l.status))return n.fail(`Optimization failed: ${l.error}`),console.error(`Optimization failed: ${l.error}`),{error:l.error||"Optimization failed"}}await Rc(c)}if(s){if(e.outDir){const n=await Gl({baseUrl:i,authToken:e.token,org:e.org_id,identifier:t.identifier,outDir:e.outDir,verbose:e.verbose});if("error"in n)return{error:n.error}}else j().succeed(`Asset successfully optimized: https://cloud.needle.tools/edit/${t.content_id} (To download optimized files, use the --outdir option)`);return{success:!0}}}}return{error:"Unknown error"}}({logger:n,token:p,org_id:u,fileOrDirectory:e.path.toString(),name:(null==(a=t.name)?void 0:a.toString())||void 0,progressive:d,usecase:m,outDir:(null==(s=t.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))})),Wd.command("generate-material","Generate a PBR material from a text prompt").help("").argument("<prompt>","The text prompt describing the material to generate",{validator:Wd.STRING}).option("--token <token>",qd,{validator:Wd.STRING}).option("--team <team>","The team name or id",{required:!1,validator:Wd.STRING}).option("--org <org>","The organization name or id",{required:!1,validator:Wd.STRING,hidden:!0}).option("--resolution <resolution>","The material texture resolution (256, 512, 1k, 2k, 4k)",{default:"512",required:!1,validator:Wd.STRING}).option("--name <name>","Output filename",{required:!1,validator:Wd.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:Wd.STRING}).action(zd("generate-material",async({args:e,options:t,logger:n})=>{var o,i,a;const{accessToken:s,org_id:r}=await Bd(t.token,Md(t)),c=e.prompt.toString(),l=null==(o=t.resolution)?void 0:o.toString(),p=null==(i=t.outdir)?void 0:i.toString(),u=null==(a=t.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 ${wl()}`};if(!e.prompt||e.prompt.length<=0)return{error:"A prompt is required"};const t="https://cloud.needle.tools/api";Fl(`[generate-material] Starting request to ${t}, prompt="${e.prompt}", resolution=${e.resolution||512}`,{emptyLineBefore:!0});const n=j("Requesting material generation...").start(),o=await Promise.race([al({baseUrl:t,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 Fl(`[generate-material] Request failed: ${o.error}`),n.fail(o.error),{error:o.error};const i=o.job;if(Fl(`[generate-material] Job created: ${i.identifier}, status=${i.status}`),"canceled"===i.status)return Fl(`[generate-material] Job canceled: ${i.status_message||"quota exceeded"}`),n.fail(i.status_message||"Material generation was canceled (quota exceeded)"),{error:i.status_message||"Quota exceeded"};n.succeed(`Material generation requested: ${i.identifier}`);const a=j("Waiting for material generation...").start();a.color="gray";const s=Br();for(;;){if("completed"===i.status){a.succeed("Material generation completed");break}let n=2e3;const o=await qr(i.identifier,{baseUrl:t,authToken:e.token,org:i.org}),r=s.record(o);if(r)return a.fail(r.reason),{error:r.reason};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",n=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",n=1e3;else{if("completed"===(null==o?void 0:o.status)){Fl(`[generate-material] Job completed: ${i.identifier}`),a.succeed(`Material generation completed: ${o.status_message||""}`);break}if("canceled"===(null==o?void 0:o.status))return Fl(`[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 Fl(`[generate-material] Job failed: ${i.identifier}, error=${o.error}`),a.fail(`Material generation failed: ${o.error||""}`),{error:o.error||"Material generation failed"}}await Rc(n)}if(e.outDir){const n=await Gl({baseUrl:t,authToken:e.token,org:e.org_id,identifier:i.identifier,outDir:e.outDir,filename:e.outputName});if("error"in n)return{error:n.error}}return{success:!0,identifier:i.identifier}}({logger:n,token:s,org_id:r,prompt:c,resolution:l,outputName:u,outDir:p});"error"in d&&(d.error&&n.error(d.error),process.exit(1)),!p&&d.identifier&&console.log(d.identifier),process.exit(0)})),Wd.command("generate-3d","Generate a 3D model from a text prompt").help("").argument("<prompt>",'A description of the object to generate, e.g. "a weathered wooden crate with iron bands"',{validator:Wd.STRING}).option("--token <token>",qd,{validator:Wd.STRING}).option("--team <team>","The team name or id",{required:!1,validator:Wd.STRING}).option("--org <org>","The organization name or id",{required:!1,validator:Wd.STRING,hidden:!0}).option("--quality <quality>","Quality tier: standard (default, includes physically based material maps) or draft (faster and cheaper, base color only)",{default:"standard",required:!1,validator:Wd.STRING}).option("--face-count <faceCount>","Target polygon count (40000-1500000). Leave unset to let the generator choose.",{required:!1,validator:Wd.NUMBER}).option("--name <name>","Output filename",{required:!1,validator:Wd.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:Wd.STRING}).action(zd("generate-3d",async({args:e,options:t,logger:n})=>{var o,i,a;const{accessToken:s,org_id:r}=await Bd(t.token,Md(t)),c=e.prompt.toString(),l=null==(o=t.quality)?void 0:o.toString(),p=null!=t.faceCount?Number(t.faceCount):void 0,u=null==(i=t.outdir)?void 0:i.toString(),d=null==(a=t.name)?void 0:a.toString(),m=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 ${wl()}`};if(!e.prompt||e.prompt.length<=0)return{error:"A prompt is required"};const t="https://cloud.needle.tools/api";Fl(`[generate-3d] Starting request to ${t}, prompt="${e.prompt}", quality=${e.quality||"draft"}`,{emptyLineBefore:!0});const n=j("Requesting 3D generation...").start(),o=await async function(e,t){var n;if(null!=(n=e.signal)&&n.aborted)return{error:"The 3D generation request was cancelled"};const o=e.baseUrl+Ue.jobs.create,i={...ze(e),"content-type":"application/json"},a={type:"ai-3d-asset",triggered_by:e.trigger_type,parameters:{...t}},s=await fetch(o,{...Le,method:"POST",headers:i,body:JSON.stringify(a),signal:e.signal}).catch(e=>function(e){return"AbortError"===(null==e?void 0:e.name)||"TimeoutError"===(null==e?void 0:e.name)}(e)?{__aborted:!0}:(console.error(`Failed to request 3D asset generation: ${null==e?void 0:e.message}`),{__failed:(null==e?void 0:e.message)||"Request failed"}));if("__aborted"in s)return{error:"The 3D generation request was cancelled"};if("__failed"in s)return{error:s.__failed};if(!s.ok){const e=await s.text();return console.error(`Failed to request 3D asset generation (${s.status}): ${e}`),{error:e||`Request failed (${s.status})`}}const r=await s.json().catch(e=>(console.error(e),null));return null!=r&&r.job?r:{error:"The server did not return a job"}}({baseUrl:t,authToken:e.token,org:e.org_id,trigger_type:"cli",signal:AbortSignal.timeout(3e4)},{prompt:e.prompt,...e.quality?{quality:e.quality}:{},...e.face_count?{face_count:e.face_count}:{}});if("error"in o)return Fl(`[generate-3d] Request failed: ${o.error}`),n.fail(o.error),{error:o.error};const i=o.job;if(Fl(`[generate-3d] Job created: ${i.identifier}, status=${i.status}`),"canceled"===i.status)return Fl(`[generate-3d] Job canceled: ${i.status_message||"quota exceeded"}`),n.fail(i.status_message||"3D generation was canceled (quota exceeded)"),{error:i.status_message||"Quota exceeded"};n.succeed(`3D generation requested: ${i.identifier}`);const a=j("Waiting for the 3D model...").start();a.color="gray";const s=Br();for(;;){if("completed"===i.status){a.succeed("3D generation completed");break}let n=2e3;const o=await qr(i.identifier,{baseUrl:t,authToken:e.token,org:i.org}),r=s.record(o);if(r)return a.fail(r.reason),{error:r.reason};if("new"===(null==o?void 0:o.status)||"pending"===(null==o?void 0:o.status))a.text="Your model is queued - waiting for generation to start",a.color="yellow",n=2e3;else if("running"===(null==o?void 0:o.status))a.text=`Generating 3D model: ${o.progress?`${o.progress}%`:""} ${o.status_message?`— ${o.status_message}`:""}`,a.color="cyan",n=1e3;else{if("completed"===(null==o?void 0:o.status)){Fl(`[generate-3d] Job completed: ${i.identifier}`),a.succeed(`3D generation completed: ${o.status_message||""}`);break}if("canceled"===(null==o?void 0:o.status))return Fl(`[generate-3d] Job canceled: ${i.identifier}, error=${o.error}`),a.fail(`3D generation canceled: ${o.error||""}`),{error:o.error||"3D generation canceled"};if("failed"===(null==o?void 0:o.status))return Fl(`[generate-3d] Job failed: ${i.identifier}, error=${o.error}`),a.fail(`3D generation failed: ${o.error||""}`),{error:o.error||"3D generation failed"}}await Rc(n)}if(e.outDir){const n=await Gl({baseUrl:t,authToken:e.token,org:e.org_id,identifier:i.identifier,outDir:e.outDir,filename:e.outputName});if("error"in n)return{error:n.error}}return{success:!0,identifier:i.identifier}}({logger:n,token:s,org_id:r,prompt:c,quality:l,face_count:p,outputName:d,outDir:u});"error"in m&&(m.error&&n.error(m.error),process.exit(1)),!u&&m.identifier&&console.log(m.identifier),process.exit(0)})),Wd.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>",qd,{validator:Wd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Wd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Wd.STRING,hidden:!0}).option("--slug <slug>","Chat slug to continue an existing conversation",{required:!1,validator:Wd.STRING}).option("--no-stream","Disable streaming (returns full response at once)",{required:!1,validator:Wd.BOOLEAN,default:!1}).action(zd("ask",async({args:e,options:t})=>{var n,o;const{accessToken:i,org_id:a}=await Bd(t.token,Md(t)),s=Array.isArray(e.message)?e.message:e.message?[e.message]:[],r=s.length?s.join(" "):void 0,c=(null==(n=t.slug)?void 0:n.toString())||void 0,l=(null==(o=t.noStream)?void 0:o.valueOf())||!1;await async function(e){const{token:t,org_id:n,message:o,slug:i,stream:a}=e,s=i||function(e){try{const t=e.split(".")[1],n=JSON.parse(Buffer.from(t,"base64url").toString());if(n.sub)return n.sub+"-cli"}catch{}return"cli-"+Math.random().toString(36).slice(2,10)}(t);await async function(e){const{token:t,org_id:n,slug:o,stream:i,initialMessage:a}=e,s=pe({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 Hl({token:t,org_id:n,slug:o,message:a,stream:i}),console.log(""));;){const e=(await s.question("> ")).trim();if(e){if("exit"===e||"quit"===e)break;await Hl({token:t,org_id:n,slug:o,message:e,stream:i}),console.log("")}}}finally{s.close()}}({token:t,org_id:n,slug:s,stream:a,initialMessage:o})}({token:i,org_id:a,message:r,slug:c,stream:!l}),process.exit(0)}));export{nu as g,Wd as p};
|