@umijs/bundler-utils 4.0.41 → 4.0.43
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/compiled/babel/index.js +44746 -103067
- package/compiled/express/express-serve-static-core/index.d.ts +23 -11
- package/compiled/express/index.js +58 -71
- package/compiled/express/mime/Mime.d.ts +11 -0
- package/compiled/express/mime/index.d.ts +10 -24
- package/compiled/express/package.json +1 -1
- package/compiled/express/serve-static/index.d.ts +1 -2
- package/compiled/http-proxy-middleware/index.js +4 -4
- package/compiled/http-proxy-middleware/package.json +1 -1
- package/compiled/less/index.js +2 -17
- package/compiled/less/package.json +1 -1
- package/dist/https.js +18 -8
- package/dist/index.js +12 -8
- package/dist/proxy.js +4 -1
- package/package.json +20 -19
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TypeMap } from './index';
|
|
2
|
+
|
|
3
|
+
declare class Mime {
|
|
4
|
+
constructor(typeMap: TypeMap, ...mimes: TypeMap[]);
|
|
5
|
+
|
|
6
|
+
getType(path: string): string | null;
|
|
7
|
+
getExtension(mime: string): string | null;
|
|
8
|
+
define(typeMap: TypeMap, force?: boolean): void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export = Mime;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for mime
|
|
1
|
+
// Type definitions for mime 3.0
|
|
2
2
|
// Project: https://github.com/broofa/node-mime
|
|
3
3
|
// Definitions by: Jeff Goddard <https://github.com/jedigo>
|
|
4
4
|
// Daniel Hritzkiv <https://github.com/dhritzkiv>
|
|
@@ -6,30 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
// Originally imported from: https://github.com/soywiz/typescript-node-definitions/mime.d.ts
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export interface TypeMap { [key: string]: string[]; }
|
|
9
|
+
import Mime = require('./Mime');
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
* Look up a mime type based on extension.
|
|
15
|
-
*
|
|
16
|
-
* If not found, uses the fallback argument if provided, and otherwise
|
|
17
|
-
* uses `default_type`.
|
|
18
|
-
*/
|
|
19
|
-
export function lookup(path: string, fallback?: string): string;
|
|
20
|
-
/**
|
|
21
|
-
* Return a file extensions associated with a mime type.
|
|
22
|
-
*/
|
|
23
|
-
export function extension(mime: string): string | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Load an Apache2-style ".types" file.
|
|
26
|
-
*/
|
|
27
|
-
export function load(filepath: string): void;
|
|
28
|
-
export function define(mimes: TypeMap): void;
|
|
11
|
+
export as namespace mime;
|
|
29
12
|
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
declare namespace mime {
|
|
14
|
+
interface TypeMap {
|
|
15
|
+
[key: string]: string[];
|
|
16
|
+
}
|
|
32
17
|
}
|
|
33
18
|
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
declare const mime: Mime;
|
|
20
|
+
|
|
21
|
+
export = mime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"express","author":"TJ Holowaychuk <tj@vision-media.ca>","license":"MIT"}
|
|
1
|
+
{"name":"express","version":"4.18.2","author":"TJ Holowaychuk <tj@vision-media.ca>","license":"MIT"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
// Type definitions for serve-static 1.
|
|
1
|
+
// Type definitions for serve-static 1.15
|
|
2
2
|
// Project: https://github.com/expressjs/serve-static
|
|
3
3
|
// Definitions by: Uros Smolnik <https://github.com/urossmolnik>
|
|
4
4
|
// Linus Unnebäck <https://github.com/LinusU>
|
|
5
5
|
// Devansh Jethmalani <https://github.com/devanshj>
|
|
6
6
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
-
// TypeScript Version: 2.3
|
|
8
7
|
|
|
9
8
|
/// <reference types="node" />
|
|
10
9
|
import * as m from '../mime';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
6
6
|
* Licensed under the MIT License.
|
|
7
|
-
*/const n=r(3837);const o=r(211);const isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);const transform=e=>t=>e===true?Number(t):String(t);const isValidValue=e=>typeof e==="number"||typeof e==="string"&&e!=="";const isNumber=e=>Number.isInteger(+e);const zeros=e=>{let t=`${e}`;let r=-1;if(t[0]==="-")t=t.slice(1);if(t==="0")return false;while(t[++r]==="0");return r>0};const stringify=(e,t,r)=>{if(typeof e==="string"||typeof t==="string"){return true}return r.stringify===true};const pad=(e,t,r)=>{if(t>0){let r=e[0]==="-"?"-":"";if(r)e=e.slice(1);e=r+e.padStart(r?t-1:t,"0")}if(r===false){return String(e)}return e};const toMaxLen=(e,t)=>{let r=e[0]==="-"?"-":"";if(r){e=e.slice(1);t--}while(e.length<t)e="0"+e;return r?"-"+e:e};const toSequence=(e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0));e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let r=t.capture?"":"?:";let n="";let o="";let s;if(e.positives.length){n=e.positives.join("|")}if(e.negatives.length){o=`-(${r}${e.negatives.join("|")})`}if(n&&o){s=`${n}|${o}`}else{s=n||o}if(t.wrap){return`(${r}${s})`}return s};const toRange=(e,t,r,n)=>{if(r){return o(e,t,{wrap:false,...n})}let s=String.fromCharCode(e);if(e===t)return s;let i=String.fromCharCode(t);return`[${s}-${i}]`};const toRegex=(e,t,r)=>{if(Array.isArray(e)){let t=r.wrap===true;let n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return o(e,t,r)};const rangeError=(...e)=>new RangeError("Invalid range arguments: "+n.inspect(...e));const invalidRange=(e,t,r)=>{if(r.strictRanges===true)throw rangeError([e,t]);return[]};const invalidStep=(e,t)=>{if(t.strictRanges===true){throw new TypeError(`Expected step "${e}" to be a number`)}return[]};const fillNumbers=(e,t,r=1,n={})=>{let o=Number(e);let s=Number(t);if(!Number.isInteger(o)||!Number.isInteger(s)){if(n.strictRanges===true)throw rangeError([e,t]);return[]}if(o===0)o=0;if(s===0)s=0;let i=o>s;let u=String(e);let a=String(t);let c=String(r);r=Math.max(Math.abs(r),1);let l=zeros(u)||zeros(a)||zeros(c);let f=l?Math.max(u.length,a.length,c.length):0;let p=l===false&&stringify(e,t,n)===false;let h=n.transform||transform(p);if(n.toRegex&&r===1){return toRange(toMaxLen(e,f),toMaxLen(t,f),true,n)}let d={negatives:[],positives:[]};let push=e=>d[e<0?"negatives":"positives"].push(Math.abs(e));let g=[];let R=0;while(i?o>=s:o<=s){if(n.toRegex===true&&r>1){push(o)}else{g.push(pad(h(o,R),f,p))}o=i?o-r:o+r;R++}if(n.toRegex===true){return r>1?toSequence(d,n):toRegex(g,null,{wrap:false,...n})}return g};const fillLetters=(e,t,r=1,n={})=>{if(!isNumber(e)&&e.length>1||!isNumber(t)&&t.length>1){return invalidRange(e,t,n)}let o=n.transform||(e=>String.fromCharCode(e));let s=`${e}`.charCodeAt(0);let i=`${t}`.charCodeAt(0);let u=s>i;let a=Math.min(s,i);let c=Math.max(s,i);if(n.toRegex&&r===1){return toRange(a,c,false,n)}let l=[];let f=0;while(u?s>=i:s<=i){l.push(o(s,f));s=u?s-r:s+r;f++}if(n.toRegex===true){return toRegex(l,null,{wrap:false,options:n})}return l};const fill=(e,t,r,n={})=>{if(t==null&&isValidValue(e)){return[e]}if(!isValidValue(e)||!isValidValue(t)){return invalidRange(e,t,n)}if(typeof r==="function"){return fill(e,t,1,{transform:r})}if(isObject(r)){return fill(e,t,0,r)}let o={...n};if(o.capture===true)o.wrap=true;r=r||o.step||1;if(!isNumber(r)){if(r!=null&&!isObject(r))return invalidStep(r,o);return fill(e,t,1,r)}if(isNumber(e)&&isNumber(t)){return fillNumbers(e,t,r,o)}return fillLetters(e,t,Math.max(Math.abs(r),1),o)};e.exports=fill},2794:function(e,t,r){var n;e.exports=function(){if(!n){try{n=r(4755)("follow-redirects")}catch(e){}if(typeof n!=="function"){n=function(){}}}n.apply(null,arguments)}},4113:function(e,t,r){var n=r(7310);var o=n.URL;var s=r(3685);var i=r(5687);var u=r(2781).Writable;var a=r(9491);var c=r(2794);var l=["abort","aborted","connect","error","socket","timeout"];var f=Object.create(null);l.forEach((function(e){f[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}}));var p=createErrorType("ERR_FR_REDIRECTION_FAILURE","Redirected request failed");var h=createErrorType("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded");var d=createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit");var g=createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");function RedirectableRequest(e,t){u.call(this);this._sanitizeOptions(e);this._options=e;this._ended=false;this._ending=false;this._redirectCount=0;this._redirects=[];this._requestBodyLength=0;this._requestBodyBuffers=[];if(t){this.on("response",t)}var r=this;this._onNativeResponse=function(e){r._processResponse(e)};this._performRequest()}RedirectableRequest.prototype=Object.create(u.prototype);RedirectableRequest.prototype.abort=function(){abortRequest(this._currentRequest);this.emit("abort")};RedirectableRequest.prototype.write=function(e,t,r){if(this._ending){throw new g}if(!(typeof e==="string"||typeof e==="object"&&"length"in e)){throw new TypeError("data should be a string, Buffer or Uint8Array")}if(typeof t==="function"){r=t;t=null}if(e.length===0){if(r){r()}return}if(this._requestBodyLength+e.length<=this._options.maxBodyLength){this._requestBodyLength+=e.length;this._requestBodyBuffers.push({data:e,encoding:t});this._currentRequest.write(e,t,r)}else{this.emit("error",new d);this.abort()}};RedirectableRequest.prototype.end=function(e,t,r){if(typeof e==="function"){r=e;e=t=null}else if(typeof t==="function"){r=t;t=null}if(!e){this._ended=this._ending=true;this._currentRequest.end(null,null,r)}else{var n=this;var o=this._currentRequest;this.write(e,t,(function(){n._ended=true;o.end(null,null,r)}));this._ending=true}};RedirectableRequest.prototype.setHeader=function(e,t){this._options.headers[e]=t;this._currentRequest.setHeader(e,t)};RedirectableRequest.prototype.removeHeader=function(e){delete this._options.headers[e];this._currentRequest.removeHeader(e)};RedirectableRequest.prototype.setTimeout=function(e,t){var r=this;function destroyOnTimeout(t){t.setTimeout(e);t.removeListener("timeout",t.destroy);t.addListener("timeout",t.destroy)}function startTimer(t){if(r._timeout){clearTimeout(r._timeout)}r._timeout=setTimeout((function(){r.emit("timeout");clearTimer()}),e);destroyOnTimeout(t)}function clearTimer(){if(r._timeout){clearTimeout(r._timeout);r._timeout=null}r.removeListener("abort",clearTimer);r.removeListener("error",clearTimer);r.removeListener("response",clearTimer);if(t){r.removeListener("timeout",t)}if(!r.socket){r._currentRequest.removeListener("socket",startTimer)}}if(t){this.on("timeout",t)}if(this.socket){startTimer(this.socket)}else{this._currentRequest.once("socket",startTimer)}this.on("socket",destroyOnTimeout);this.on("abort",clearTimer);this.on("error",clearTimer);this.on("response",clearTimer);return this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){RedirectableRequest.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}}));["aborted","connection","socket"].forEach((function(e){Object.defineProperty(RedirectableRequest.prototype,e,{get:function(){return this._currentRequest[e]}})}));RedirectableRequest.prototype._sanitizeOptions=function(e){if(!e.headers){e.headers={}}if(e.host){if(!e.hostname){e.hostname=e.host}delete e.host}if(!e.pathname&&e.path){var t=e.path.indexOf("?");if(t<0){e.pathname=e.path}else{e.pathname=e.path.substring(0,t);e.search=e.path.substring(t)}}};RedirectableRequest.prototype._performRequest=function(){var e=this._options.protocol;var t=this._options.nativeProtocols[e];if(!t){this.emit("error",new TypeError("Unsupported protocol "+e));return}if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var o=this._currentRequest=t.request(this._options,this._onNativeResponse);o._redirectable=this;for(var s of l){o.on(s,f[s])}this._currentUrl=/^\//.test(this._options.path)?n.format(this._options):this._currentUrl=this._options.path;if(this._isRedirect){var i=0;var u=this;var a=this._requestBodyBuffers;(function writeNext(e){if(o===u._currentRequest){if(e){u.emit("error",e)}else if(i<a.length){var t=a[i++];if(!o.finished){o.write(t.data,t.encoding,writeNext)}}else if(u._ended){o.end()}}})()}};RedirectableRequest.prototype._processResponse=function(e){var t=e.statusCode;if(this._options.trackRedirects){this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t})}var r=e.headers.location;if(!r||this._options.followRedirects===false||t<300||t>=400){e.responseUrl=this._currentUrl;e.redirects=this._redirects;this.emit("response",e);this._requestBodyBuffers=[];return}abortRequest(this._currentRequest);e.destroy();if(++this._redirectCount>this._options.maxRedirects){this.emit("error",new h);return}var o;var s=this._options.beforeRedirect;if(s){o=Object.assign({Host:e.req.getHeader("host")},this._options.headers)}var i=this._options.method;if((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method)){this._options.method="GET";this._requestBodyBuffers=[];removeMatchingHeaders(/^content-/i,this._options.headers)}var u=removeMatchingHeaders(/^host$/i,this._options.headers);var a=n.parse(this._currentUrl);var l=u||a.host;var f=/^\w+:/.test(r)?this._currentUrl:n.format(Object.assign(a,{host:l}));var d;try{d=n.resolve(f,r)}catch(e){this.emit("error",new p(e));return}c("redirecting to",d);this._isRedirect=true;var g=n.parse(d);Object.assign(this._options,g);if(g.protocol!==a.protocol&&g.protocol!=="https:"||g.host!==l&&!isSubdomain(g.host,l)){removeMatchingHeaders(/^(?:authorization|cookie)$/i,this._options.headers)}if(typeof s==="function"){var R={headers:e.headers,statusCode:t};var y={url:f,method:i,headers:o};try{s(this._options,R,y)}catch(e){this.emit("error",e);return}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new p(e))}};function wrap(e){var t={maxRedirects:21,maxBodyLength:10*1024*1024};var r={};Object.keys(e).forEach((function(s){var i=s+":";var u=r[i]=e[s];var l=t[s]=Object.create(u);function request(e,s,u){if(typeof e==="string"){var l=e;try{e=urlToOptions(new o(l))}catch(t){e=n.parse(l)}}else if(o&&e instanceof o){e=urlToOptions(e)}else{u=s;s=e;e={protocol:i}}if(typeof s==="function"){u=s;s=null}s=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,s);s.nativeProtocols=r;a.equal(s.protocol,i,"protocol mismatch");c("options",s);return new RedirectableRequest(s,u)}function get(e,t,r){var n=l.request(e,t,r);n.end();return n}Object.defineProperties(l,{request:{value:request,configurable:true,enumerable:true,writable:true},get:{value:get,configurable:true,enumerable:true,writable:true}})}));return t}function noop(){}function urlToOptions(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};if(e.port!==""){t.port=Number(e.port)}return t}function removeMatchingHeaders(e,t){var r;for(var n in t){if(e.test(n)){r=t[n];delete t[n]}}return r===null||typeof r==="undefined"?undefined:String(r).trim()}function createErrorType(e,t){function CustomError(e){Error.captureStackTrace(this,this.constructor);if(!e){this.message=t}else{this.message=t+": "+e.message;this.cause=e}}CustomError.prototype=new Error;CustomError.prototype.constructor=CustomError;CustomError.prototype.name="Error ["+e+"]";CustomError.prototype.code=e;return CustomError}function abortRequest(e){for(var t of l){e.removeListener(t,f[t])}e.on("error",noop);e.abort()}function isSubdomain(e,t){const r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}e.exports=wrap({http:s,https:i});e.exports.wrap=wrap},66:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getHandlers=t.init=void 0;const n=r(1936);const o=(0,n.getInstance)();function init(e,t){const r=getHandlers(t);for(const t of Object.keys(r)){e.on(t,r[t])}o.debug("[HPM] Subscribed to http-proxy events:",Object.keys(r))}t.init=init;function getHandlers(e){const t={error:"onError",proxyReq:"onProxyReq",proxyReqWs:"onProxyReqWs",proxyRes:"onProxyRes",open:"onOpen",close:"onClose"};const r={};for(const[n,o]of Object.entries(t)){const t=e?e[o]:null;if(typeof t==="function"){r[n]=t}}if(typeof r.error!=="function"){r.error=defaultErrorHandler}if(typeof r.close!=="function"){r.close=logClose}return r}t.getHandlers=getHandlers;function defaultErrorHandler(e,t,r){if(!t&&!r){throw e}const n=t.headers&&t.headers.host;const o=e.code;if(r.writeHead&&!r.headersSent){if(/HPE_INVALID/.test(o)){r.writeHead(502)}else{switch(o){case"ECONNRESET":case"ENOTFOUND":case"ECONNREFUSED":case"ETIMEDOUT":r.writeHead(504);break;default:r.writeHead(500)}}}r.end(`Error occurred while trying to proxy: ${n}${t.url}`)}function logClose(e,t,r){o.info("[HPM] Client disconnected")}},6418:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createConfig=void 0;const n=r(4273);const o=r(7310);const s=r(6721);const i=r(1936);const u=(0,i.getInstance)();function createConfig(e,t){const r={context:undefined,options:{}};if(isContextless(e,t)){r.context="/";r.options=Object.assign(r.options,e)}else if(isStringShortHand(e)){const n=o.parse(e);const s=[n.protocol,"//",n.host].join("");r.context=n.pathname||"/";r.options=Object.assign(r.options,{target:s},t);if(n.protocol==="ws:"||n.protocol==="wss:"){r.options.ws=true}}else{r.context=e;r.options=Object.assign(r.options,t)}configureLogger(r.options);if(!r.options.target&&!r.options.router){throw new Error(s.ERRORS.ERR_CONFIG_FACTORY_TARGET_MISSING)}return r}t.createConfig=createConfig;function isStringShortHand(e){if(typeof e==="string"){return!!o.parse(e).host}}function isContextless(e,t){return n(e)&&(t==null||Object.keys(t).length===0)}function configureLogger(e){if(e.logLevel){u.setLevel(e.logLevel)}if(e.logProvider){u.setProvider(e.logProvider)}}},1572:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.match=void 0;const n=r(6654);const o=r(8627);const s=r(7310);const i=r(6721);function match(e,t,r){if(isStringPath(e)){return matchSingleStringPath(e,t)}if(isGlobPath(e)){return matchSingleGlobPath(e,t)}if(Array.isArray(e)){if(e.every(isStringPath)){return matchMultiPath(e,t)}if(e.every(isGlobPath)){return matchMultiGlobPath(e,t)}throw new Error(i.ERRORS.ERR_CONTEXT_MATCHER_INVALID_ARRAY)}if(typeof e==="function"){const n=getUrlPathName(t);return e(n,r)}throw new Error(i.ERRORS.ERR_CONTEXT_MATCHER_GENERIC)}t.match=match;function matchSingleStringPath(e,t){const r=getUrlPathName(t);return r.indexOf(e)===0}function matchSingleGlobPath(e,t){const r=getUrlPathName(t);const n=o([r],e);return n&&n.length>0}function matchMultiGlobPath(e,t){return matchSingleGlobPath(e,t)}function matchMultiPath(e,t){let r=false;for(const n of e){if(matchSingleStringPath(n,t)){r=true;break}}return r}function getUrlPathName(e){return e&&s.parse(e).pathname}function isStringPath(e){return typeof e==="string"&&!n(e)}function isGlobPath(e){return n(e)}},6721:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ERRORS=void 0;var r;(function(e){e["ERR_CONFIG_FACTORY_TARGET_MISSING"]='[HPM] Missing "target" option. Example: {target: "http://www.example.org"}';e["ERR_CONTEXT_MATCHER_GENERIC"]='[HPM] Invalid context. Expecting something like: "/api" or ["/api", "/ajax"]';e["ERR_CONTEXT_MATCHER_INVALID_ARRAY"]='[HPM] Invalid context. Expecting something like: ["/api", "/ajax"] or ["/api/**", "!**.html"]';e["ERR_PATH_REWRITER_CONFIG"]="[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function"})(r=t.ERRORS||(t.ERRORS={}))},8330:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.fixRequestBody=void 0;const n=r(3477);function fixRequestBody(e,t){const r=t.body;if(!r){return}const o=e.getHeader("Content-Type");const writeBody=t=>{e.setHeader("Content-Length",Buffer.byteLength(t));e.write(t)};if(o&&o.includes("application/json")){writeBody(JSON.stringify(r))}if(o&&o.includes("application/x-www-form-urlencoded")){writeBody(n.stringify(r))}}t.fixRequestBody=fixRequestBody},4249:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var o=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))n(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});o(r(4265),t)},4265:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.fixRequestBody=t.responseInterceptor=void 0;var n=r(9678);Object.defineProperty(t,"responseInterceptor",{enumerable:true,get:function(){return n.responseInterceptor}});var o=r(8330);Object.defineProperty(t,"fixRequestBody",{enumerable:true,get:function(){return o.fixRequestBody}})},9678:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.responseInterceptor=void 0;const n=r(9796);function responseInterceptor(e){return async function proxyRes(proxyRes,t,r){const n=proxyRes;let o=Buffer.from("","utf8");const s=decompress(proxyRes,proxyRes.headers["content-encoding"]);s.on("data",(e=>o=Buffer.concat([o,e])));s.on("end",(async()=>{copyHeaders(proxyRes,r);const s=Buffer.from(await e(o,n,t,r));r.setHeader("content-length",Buffer.byteLength(s,"utf8"));r.write(s);r.end()}));s.on("error",(e=>{r.end(`Error fetching proxied request: ${e.message}`)}))}}t.responseInterceptor=responseInterceptor;function decompress(e,t){let r=e;let o;switch(t){case"gzip":o=n.createGunzip();break;case"br":o=n.createBrotliDecompress();break;case"deflate":o=n.createInflate();break;default:break}if(o){r.pipe(o);r=o}return r}function copyHeaders(e,t){t.statusCode=e.statusCode;t.statusMessage=e.statusMessage;if(t.setHeader){let r=Object.keys(e.headers);r=r.filter((e=>!["content-encoding","transfer-encoding"].includes(e)));r.forEach((r=>{let n=e.headers[r];if(r==="set-cookie"){n=Array.isArray(n)?n:[n];n=n.map((e=>e.replace(/Domain=[^;]+?/i,"")))}t.setHeader(r,n)}))}else{t.headers=e.headers}}},5037:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.HttpProxyMiddleware=void 0;const n=r(6873);const o=r(6418);const s=r(1572);const i=r(66);const u=r(1936);const a=r(5132);const c=r(4112);class HttpProxyMiddleware{constructor(e,t){this.logger=(0,u.getInstance)();this.wsInternalSubscribed=false;this.serverOnCloseSubscribed=false;this.middleware=async(e,t,r)=>{var n,o;if(this.shouldProxy(this.config.context,e)){try{const r=await this.prepareProxyRequest(e);this.proxy.web(e,t,r)}catch(e){r(e)}}else{r()}const s=(o=(n=e.socket)!==null&&n!==void 0?n:e.connection)===null||o===void 0?void 0:o.server;if(s&&!this.serverOnCloseSubscribed){s.on("close",(()=>{this.logger.info("[HPM] server close signal received: closing proxy server");this.proxy.close()}));this.serverOnCloseSubscribed=true}if(this.proxyOptions.ws===true){this.catchUpgradeRequest(s)}};this.catchUpgradeRequest=e=>{if(!this.wsInternalSubscribed){e.on("upgrade",this.handleUpgrade);this.wsInternalSubscribed=true}};this.handleUpgrade=async(e,t,r)=>{if(this.shouldProxy(this.config.context,e)){const n=await this.prepareProxyRequest(e);this.proxy.ws(e,t,r,n);this.logger.info("[HPM] Upgrading to WebSocket")}};this.shouldProxy=(e,t)=>{const r=t.originalUrl||t.url;return s.match(e,r,t)};this.prepareProxyRequest=async e=>{e.url=e.originalUrl||e.url;const t=e.url;const r=Object.assign({},this.proxyOptions);await this.applyRouter(e,r);await this.applyPathRewrite(e,this.pathRewriter);if(this.proxyOptions.logLevel==="debug"){const n=(0,u.getArrow)(t,e.url,this.proxyOptions.target,r.target);this.logger.debug("[HPM] %s %s %s %s",e.method,t,n,r.target)}return r};this.applyRouter=async(e,t)=>{let r;if(t.router){r=await c.getTarget(e,t);if(r){this.logger.debug('[HPM] Router new target: %s -> "%s"',t.target,r);t.target=r}}};this.applyPathRewrite=async(e,t)=>{if(t){const r=await t(e.url,e);if(typeof r==="string"){e.url=r}else{this.logger.info("[HPM] pathRewrite: No rewritten path found. (%s)",e.url)}}};this.logError=(e,t,r,n)=>{var o;const s=((o=t.headers)===null||o===void 0?void 0:o.host)||t.hostname||t.host;const i=`${s}${t.url}`;const u=`${n===null||n===void 0?void 0:n.href}`;const a="[HPM] Error occurred while proxying request %s to %s [%s] (%s)";const c="https://nodejs.org/api/errors.html#errors_common_system_errors";this.logger.error(a,i,u,e.code||e,c)};this.config=(0,o.createConfig)(e,t);this.proxyOptions=this.config.options;this.proxy=n.createProxyServer({});this.logger.info(`[HPM] Proxy created: ${this.config.context} -> ${this.proxyOptions.target}`);this.pathRewriter=a.createPathRewriter(this.proxyOptions.pathRewrite);i.init(this.proxy,this.proxyOptions);this.proxy.on("error",this.logError);this.middleware.upgrade=(e,t,r)=>{if(!this.wsInternalSubscribed){this.handleUpgrade(e,t,r)}}}}t.HttpProxyMiddleware=HttpProxyMiddleware},7666:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var o=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))n(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});t.createProxyMiddleware=void 0;const s=r(5037);function createProxyMiddleware(e,t){const{middleware:r}=new s.HttpProxyMiddleware(e,t);return r}t.createProxyMiddleware=createProxyMiddleware;o(r(4249),t)},1936:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getArrow=t.getInstance=void 0;const n=r(3837);let o;const s={log:console.log,debug:console.log,info:console.info,warn:console.warn,error:console.error};var i;(function(e){e[e["debug"]=10]="debug";e[e["info"]=20]="info";e[e["warn"]=30]="warn";e[e["error"]=50]="error";e[e["silent"]=80]="silent"})(i||(i={}));function getInstance(){if(!o){o=new Logger}return o}t.getInstance=getInstance;class Logger{constructor(){this.setLevel("info");this.setProvider((()=>s))}log(){this.provider.log(this._interpolate.apply(null,arguments))}debug(){if(this._showLevel("debug")){this.provider.debug(this._interpolate.apply(null,arguments))}}info(){if(this._showLevel("info")){this.provider.info(this._interpolate.apply(null,arguments))}}warn(){if(this._showLevel("warn")){this.provider.warn(this._interpolate.apply(null,arguments))}}error(){if(this._showLevel("error")){this.provider.error(this._interpolate.apply(null,arguments))}}setLevel(e){if(this.isValidLevel(e)){this.logLevel=e}}setProvider(e){if(e&&this.isValidProvider(e)){this.provider=e(s)}}isValidProvider(e){const t=true;if(e&&typeof e!=="function"){throw new Error("[HPM] Log provider config error. Expecting a function.")}return t}isValidLevel(e){const t=Object.keys(i);const r=t.includes(e);if(!r){throw new Error("[HPM] Log level error. Invalid logLevel.")}return r}_showLevel(e){let t=false;const r=i[this.logLevel];if(r&&r<=i[e]){t=true}return t}_interpolate(e,...t){const r=n.format(e,...t);return r}}function getArrow(e,t,r,n){const o=[">"];const s=r!==n;const i=e!==t;if(i&&!s){o.unshift("~")}else if(!i&&s){o.unshift("=")}else if(i&&s){o.unshift("≈")}else{o.unshift("-")}return o.join("")}t.getArrow=getArrow},5132:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createPathRewriter=void 0;const n=r(4273);const o=r(6721);const s=r(1936);const i=(0,s.getInstance)();function createPathRewriter(e){let t;if(!isValidRewriteConfig(e)){return}if(typeof e==="function"){const t=e;return t}else{t=parsePathRewriteRules(e);return rewritePath}function rewritePath(e){let r=e;for(const n of t){if(n.regex.test(e)){r=r.replace(n.regex,n.value);i.debug('[HPM] Rewriting path from "%s" to "%s"',e,r);break}}return r}}t.createPathRewriter=createPathRewriter;function isValidRewriteConfig(e){if(typeof e==="function"){return true}else if(n(e)){return Object.keys(e).length!==0}else if(e===undefined||e===null){return false}else{throw new Error(o.ERRORS.ERR_PATH_REWRITER_CONFIG)}}function parsePathRewriteRules(e){const t=[];if(n(e)){for(const[r]of Object.entries(e)){t.push({regex:new RegExp(r),value:e[r]});i.info('[HPM] Proxy rewrite rule created: "%s" ~> "%s"',r,e[r])}}return t}},4112:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getTarget=void 0;const n=r(4273);const o=r(1936);const s=(0,o.getInstance)();async function getTarget(e,t){let r;const o=t.router;if(n(o)){r=getTargetFromProxyTable(e,o)}else if(typeof o==="function"){r=await o(e)}return r}t.getTarget=getTarget;function getTargetFromProxyTable(e,t){let r;const n=e.headers.host;const o=e.url;const i=n+o;for(const[e]of Object.entries(t)){if(containsPath(e)){if(i.indexOf(e)>-1){r=t[e];s.debug('[HPM] Router table match: "%s"',e);break}}else{if(e===n){r=t[e];s.debug('[HPM] Router table match: "%s"',n);break}}}return r}function containsPath(e){return e.indexOf("/")>-1}},6873:function(e,t,r){
|
|
7
|
+
*/const n=r(3837);const o=r(211);const isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);const transform=e=>t=>e===true?Number(t):String(t);const isValidValue=e=>typeof e==="number"||typeof e==="string"&&e!=="";const isNumber=e=>Number.isInteger(+e);const zeros=e=>{let t=`${e}`;let r=-1;if(t[0]==="-")t=t.slice(1);if(t==="0")return false;while(t[++r]==="0");return r>0};const stringify=(e,t,r)=>{if(typeof e==="string"||typeof t==="string"){return true}return r.stringify===true};const pad=(e,t,r)=>{if(t>0){let r=e[0]==="-"?"-":"";if(r)e=e.slice(1);e=r+e.padStart(r?t-1:t,"0")}if(r===false){return String(e)}return e};const toMaxLen=(e,t)=>{let r=e[0]==="-"?"-":"";if(r){e=e.slice(1);t--}while(e.length<t)e="0"+e;return r?"-"+e:e};const toSequence=(e,t)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0));e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let r=t.capture?"":"?:";let n="";let o="";let s;if(e.positives.length){n=e.positives.join("|")}if(e.negatives.length){o=`-(${r}${e.negatives.join("|")})`}if(n&&o){s=`${n}|${o}`}else{s=n||o}if(t.wrap){return`(${r}${s})`}return s};const toRange=(e,t,r,n)=>{if(r){return o(e,t,{wrap:false,...n})}let s=String.fromCharCode(e);if(e===t)return s;let i=String.fromCharCode(t);return`[${s}-${i}]`};const toRegex=(e,t,r)=>{if(Array.isArray(e)){let t=r.wrap===true;let n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return o(e,t,r)};const rangeError=(...e)=>new RangeError("Invalid range arguments: "+n.inspect(...e));const invalidRange=(e,t,r)=>{if(r.strictRanges===true)throw rangeError([e,t]);return[]};const invalidStep=(e,t)=>{if(t.strictRanges===true){throw new TypeError(`Expected step "${e}" to be a number`)}return[]};const fillNumbers=(e,t,r=1,n={})=>{let o=Number(e);let s=Number(t);if(!Number.isInteger(o)||!Number.isInteger(s)){if(n.strictRanges===true)throw rangeError([e,t]);return[]}if(o===0)o=0;if(s===0)s=0;let i=o>s;let u=String(e);let a=String(t);let c=String(r);r=Math.max(Math.abs(r),1);let l=zeros(u)||zeros(a)||zeros(c);let f=l?Math.max(u.length,a.length,c.length):0;let p=l===false&&stringify(e,t,n)===false;let h=n.transform||transform(p);if(n.toRegex&&r===1){return toRange(toMaxLen(e,f),toMaxLen(t,f),true,n)}let d={negatives:[],positives:[]};let push=e=>d[e<0?"negatives":"positives"].push(Math.abs(e));let g=[];let R=0;while(i?o>=s:o<=s){if(n.toRegex===true&&r>1){push(o)}else{g.push(pad(h(o,R),f,p))}o=i?o-r:o+r;R++}if(n.toRegex===true){return r>1?toSequence(d,n):toRegex(g,null,{wrap:false,...n})}return g};const fillLetters=(e,t,r=1,n={})=>{if(!isNumber(e)&&e.length>1||!isNumber(t)&&t.length>1){return invalidRange(e,t,n)}let o=n.transform||(e=>String.fromCharCode(e));let s=`${e}`.charCodeAt(0);let i=`${t}`.charCodeAt(0);let u=s>i;let a=Math.min(s,i);let c=Math.max(s,i);if(n.toRegex&&r===1){return toRange(a,c,false,n)}let l=[];let f=0;while(u?s>=i:s<=i){l.push(o(s,f));s=u?s-r:s+r;f++}if(n.toRegex===true){return toRegex(l,null,{wrap:false,options:n})}return l};const fill=(e,t,r,n={})=>{if(t==null&&isValidValue(e)){return[e]}if(!isValidValue(e)||!isValidValue(t)){return invalidRange(e,t,n)}if(typeof r==="function"){return fill(e,t,1,{transform:r})}if(isObject(r)){return fill(e,t,0,r)}let o={...n};if(o.capture===true)o.wrap=true;r=r||o.step||1;if(!isNumber(r)){if(r!=null&&!isObject(r))return invalidStep(r,o);return fill(e,t,1,r)}if(isNumber(e)&&isNumber(t)){return fillNumbers(e,t,r,o)}return fillLetters(e,t,Math.max(Math.abs(r),1),o)};e.exports=fill},3299:function(e,t,r){var n;e.exports=function(){if(!n){try{n=r(4755)("follow-redirects")}catch(e){}if(typeof n!=="function"){n=function(){}}}n.apply(null,arguments)}},8318:function(e,t,r){var n=r(7310);var o=n.URL;var s=r(3685);var i=r(5687);var u=r(2781).Writable;var a=r(9491);var c=r(3299);var l=["abort","aborted","connect","error","socket","timeout"];var f=Object.create(null);l.forEach((function(e){f[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}}));var p=createErrorType("ERR_INVALID_URL","Invalid URL",TypeError);var h=createErrorType("ERR_FR_REDIRECTION_FAILURE","Redirected request failed");var d=createErrorType("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded");var g=createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit");var R=createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");function RedirectableRequest(e,t){u.call(this);this._sanitizeOptions(e);this._options=e;this._ended=false;this._ending=false;this._redirectCount=0;this._redirects=[];this._requestBodyLength=0;this._requestBodyBuffers=[];if(t){this.on("response",t)}var r=this;this._onNativeResponse=function(e){r._processResponse(e)};this._performRequest()}RedirectableRequest.prototype=Object.create(u.prototype);RedirectableRequest.prototype.abort=function(){abortRequest(this._currentRequest);this.emit("abort")};RedirectableRequest.prototype.write=function(e,t,r){if(this._ending){throw new R}if(!isString(e)&&!isBuffer(e)){throw new TypeError("data should be a string, Buffer or Uint8Array")}if(isFunction(t)){r=t;t=null}if(e.length===0){if(r){r()}return}if(this._requestBodyLength+e.length<=this._options.maxBodyLength){this._requestBodyLength+=e.length;this._requestBodyBuffers.push({data:e,encoding:t});this._currentRequest.write(e,t,r)}else{this.emit("error",new g);this.abort()}};RedirectableRequest.prototype.end=function(e,t,r){if(isFunction(e)){r=e;e=t=null}else if(isFunction(t)){r=t;t=null}if(!e){this._ended=this._ending=true;this._currentRequest.end(null,null,r)}else{var n=this;var o=this._currentRequest;this.write(e,t,(function(){n._ended=true;o.end(null,null,r)}));this._ending=true}};RedirectableRequest.prototype.setHeader=function(e,t){this._options.headers[e]=t;this._currentRequest.setHeader(e,t)};RedirectableRequest.prototype.removeHeader=function(e){delete this._options.headers[e];this._currentRequest.removeHeader(e)};RedirectableRequest.prototype.setTimeout=function(e,t){var r=this;function destroyOnTimeout(t){t.setTimeout(e);t.removeListener("timeout",t.destroy);t.addListener("timeout",t.destroy)}function startTimer(t){if(r._timeout){clearTimeout(r._timeout)}r._timeout=setTimeout((function(){r.emit("timeout");clearTimer()}),e);destroyOnTimeout(t)}function clearTimer(){if(r._timeout){clearTimeout(r._timeout);r._timeout=null}r.removeListener("abort",clearTimer);r.removeListener("error",clearTimer);r.removeListener("response",clearTimer);if(t){r.removeListener("timeout",t)}if(!r.socket){r._currentRequest.removeListener("socket",startTimer)}}if(t){this.on("timeout",t)}if(this.socket){startTimer(this.socket)}else{this._currentRequest.once("socket",startTimer)}this.on("socket",destroyOnTimeout);this.on("abort",clearTimer);this.on("error",clearTimer);this.on("response",clearTimer);return this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){RedirectableRequest.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}}));["aborted","connection","socket"].forEach((function(e){Object.defineProperty(RedirectableRequest.prototype,e,{get:function(){return this._currentRequest[e]}})}));RedirectableRequest.prototype._sanitizeOptions=function(e){if(!e.headers){e.headers={}}if(e.host){if(!e.hostname){e.hostname=e.host}delete e.host}if(!e.pathname&&e.path){var t=e.path.indexOf("?");if(t<0){e.pathname=e.path}else{e.pathname=e.path.substring(0,t);e.search=e.path.substring(t)}}};RedirectableRequest.prototype._performRequest=function(){var e=this._options.protocol;var t=this._options.nativeProtocols[e];if(!t){this.emit("error",new TypeError("Unsupported protocol "+e));return}if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var o=this._currentRequest=t.request(this._options,this._onNativeResponse);o._redirectable=this;for(var s of l){o.on(s,f[s])}this._currentUrl=/^\//.test(this._options.path)?n.format(this._options):this._options.path;if(this._isRedirect){var i=0;var u=this;var a=this._requestBodyBuffers;(function writeNext(e){if(o===u._currentRequest){if(e){u.emit("error",e)}else if(i<a.length){var t=a[i++];if(!o.finished){o.write(t.data,t.encoding,writeNext)}}else if(u._ended){o.end()}}})()}};RedirectableRequest.prototype._processResponse=function(e){var t=e.statusCode;if(this._options.trackRedirects){this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t})}var r=e.headers.location;if(!r||this._options.followRedirects===false||t<300||t>=400){e.responseUrl=this._currentUrl;e.redirects=this._redirects;this.emit("response",e);this._requestBodyBuffers=[];return}abortRequest(this._currentRequest);e.destroy();if(++this._redirectCount>this._options.maxRedirects){this.emit("error",new d);return}var o;var s=this._options.beforeRedirect;if(s){o=Object.assign({Host:e.req.getHeader("host")},this._options.headers)}var i=this._options.method;if((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method)){this._options.method="GET";this._requestBodyBuffers=[];removeMatchingHeaders(/^content-/i,this._options.headers)}var u=removeMatchingHeaders(/^host$/i,this._options.headers);var a=n.parse(this._currentUrl);var l=u||a.host;var f=/^\w+:/.test(r)?this._currentUrl:n.format(Object.assign(a,{host:l}));var p;try{p=n.resolve(f,r)}catch(e){this.emit("error",new h({cause:e}));return}c("redirecting to",p);this._isRedirect=true;var g=n.parse(p);Object.assign(this._options,g);if(g.protocol!==a.protocol&&g.protocol!=="https:"||g.host!==l&&!isSubdomain(g.host,l)){removeMatchingHeaders(/^(?:authorization|cookie)$/i,this._options.headers)}if(isFunction(s)){var R={headers:e.headers,statusCode:t};var y={url:f,method:i,headers:o};try{s(this._options,R,y)}catch(e){this.emit("error",e);return}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new h({cause:e}))}};function wrap(e){var t={maxRedirects:21,maxBodyLength:10*1024*1024};var r={};Object.keys(e).forEach((function(s){var i=s+":";var u=r[i]=e[s];var l=t[s]=Object.create(u);function request(e,s,u){if(isString(e)){var l;try{l=urlToOptions(new o(e))}catch(t){l=n.parse(e)}if(!isString(l.protocol)){throw new p({input:e})}e=l}else if(o&&e instanceof o){e=urlToOptions(e)}else{u=s;s=e;e={protocol:i}}if(isFunction(s)){u=s;s=null}s=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,s);s.nativeProtocols=r;if(!isString(s.host)&&!isString(s.hostname)){s.hostname="::1"}a.equal(s.protocol,i,"protocol mismatch");c("options",s);return new RedirectableRequest(s,u)}function get(e,t,r){var n=l.request(e,t,r);n.end();return n}Object.defineProperties(l,{request:{value:request,configurable:true,enumerable:true,writable:true},get:{value:get,configurable:true,enumerable:true,writable:true}})}));return t}function noop(){}function urlToOptions(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};if(e.port!==""){t.port=Number(e.port)}return t}function removeMatchingHeaders(e,t){var r;for(var n in t){if(e.test(n)){r=t[n];delete t[n]}}return r===null||typeof r==="undefined"?undefined:String(r).trim()}function createErrorType(e,t,r){function CustomError(r){Error.captureStackTrace(this,this.constructor);Object.assign(this,r||{});this.code=e;this.message=this.cause?t+": "+this.cause.message:t}CustomError.prototype=new(r||Error);CustomError.prototype.constructor=CustomError;CustomError.prototype.name="Error ["+e+"]";return CustomError}function abortRequest(e){for(var t of l){e.removeListener(t,f[t])}e.on("error",noop);e.abort()}function isSubdomain(e,t){a(isString(e)&&isString(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}function isString(e){return typeof e==="string"||e instanceof String}function isFunction(e){return typeof e==="function"}function isBuffer(e){return typeof e==="object"&&"length"in e}e.exports=wrap({http:s,https:i});e.exports.wrap=wrap},6292:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getHandlers=t.init=void 0;const n=r(9853);const o=(0,n.getInstance)();function init(e,t){const r=getHandlers(t);for(const t of Object.keys(r)){e.on(t,r[t])}e.on("econnreset",((e,t,r,n)=>{o.error(`[HPM] ECONNRESET: %O`,e)}));e.on("proxyReqWs",((e,t,r,n,s)=>{r.on("error",(e=>{o.error(`[HPM] WebSocket error: %O`,e)}))}));o.debug("[HPM] Subscribed to http-proxy events:",Object.keys(r))}t.init=init;function getHandlers(e){const t={error:"onError",proxyReq:"onProxyReq",proxyReqWs:"onProxyReqWs",proxyRes:"onProxyRes",open:"onOpen",close:"onClose"};const r={};for(const[n,o]of Object.entries(t)){const t=e?e[o]:null;if(typeof t==="function"){r[n]=t}}if(typeof r.error!=="function"){r.error=defaultErrorHandler}if(typeof r.close!=="function"){r.close=logClose}return r}t.getHandlers=getHandlers;function defaultErrorHandler(e,t,r){if(!t&&!r){throw e}const n=t.headers&&t.headers.host;const o=e.code;if(r.writeHead&&!r.headersSent){if(/HPE_INVALID/.test(o)){r.writeHead(502)}else{switch(o){case"ECONNRESET":case"ENOTFOUND":case"ECONNREFUSED":case"ETIMEDOUT":r.writeHead(504);break;default:r.writeHead(500)}}}r.end(`Error occurred while trying to proxy: ${n}${t.url}`)}function logClose(e,t,r){o.info("[HPM] Client disconnected")}},2181:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createConfig=void 0;const n=r(4273);const o=r(7310);const s=r(4946);const i=r(9853);const u=(0,i.getInstance)();function createConfig(e,t){const r={context:undefined,options:{}};if(isContextless(e,t)){r.context="/";r.options=Object.assign(r.options,e)}else if(isStringShortHand(e)){const n=o.parse(e);const s=[n.protocol,"//",n.host].join("");r.context=n.pathname||"/";r.options=Object.assign(r.options,{target:s},t);if(n.protocol==="ws:"||n.protocol==="wss:"){r.options.ws=true}}else{r.context=e;r.options=Object.assign(r.options,t)}configureLogger(r.options);if(!r.options.target&&!r.options.router){throw new Error(s.ERRORS.ERR_CONFIG_FACTORY_TARGET_MISSING)}return r}t.createConfig=createConfig;function isStringShortHand(e){if(typeof e==="string"){return!!o.parse(e).host}}function isContextless(e,t){return n(e)&&(t==null||Object.keys(t).length===0)}function configureLogger(e){if(e.logLevel){u.setLevel(e.logLevel)}if(e.logProvider){u.setProvider(e.logProvider)}}},5393:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.match=void 0;const n=r(6654);const o=r(8627);const s=r(7310);const i=r(4946);function match(e,t,r){if(isStringPath(e)){return matchSingleStringPath(e,t)}if(isGlobPath(e)){return matchSingleGlobPath(e,t)}if(Array.isArray(e)){if(e.every(isStringPath)){return matchMultiPath(e,t)}if(e.every(isGlobPath)){return matchMultiGlobPath(e,t)}throw new Error(i.ERRORS.ERR_CONTEXT_MATCHER_INVALID_ARRAY)}if(typeof e==="function"){const n=getUrlPathName(t);return e(n,r)}throw new Error(i.ERRORS.ERR_CONTEXT_MATCHER_GENERIC)}t.match=match;function matchSingleStringPath(e,t){const r=getUrlPathName(t);return r.indexOf(e)===0}function matchSingleGlobPath(e,t){const r=getUrlPathName(t);const n=o([r],e);return n&&n.length>0}function matchMultiGlobPath(e,t){return matchSingleGlobPath(e,t)}function matchMultiPath(e,t){let r=false;for(const n of e){if(matchSingleStringPath(n,t)){r=true;break}}return r}function getUrlPathName(e){return e&&s.parse(e).pathname}function isStringPath(e){return typeof e==="string"&&!n(e)}function isGlobPath(e){return n(e)}},4946:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ERRORS=void 0;var r;(function(e){e["ERR_CONFIG_FACTORY_TARGET_MISSING"]='[HPM] Missing "target" option. Example: {target: "http://www.example.org"}';e["ERR_CONTEXT_MATCHER_GENERIC"]='[HPM] Invalid context. Expecting something like: "/api" or ["/api", "/ajax"]';e["ERR_CONTEXT_MATCHER_INVALID_ARRAY"]='[HPM] Invalid context. Expecting something like: ["/api", "/ajax"] or ["/api/**", "!**.html"]';e["ERR_PATH_REWRITER_CONFIG"]="[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function"})(r=t.ERRORS||(t.ERRORS={}))},8183:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.fixRequestBody=void 0;const n=r(3477);function fixRequestBody(e,t){const r=t.body;if(!r){return}const o=e.getHeader("Content-Type");const writeBody=t=>{e.setHeader("Content-Length",Buffer.byteLength(t));e.write(t)};if(o&&o.includes("application/json")){writeBody(JSON.stringify(r))}if(o&&o.includes("application/x-www-form-urlencoded")){writeBody(n.stringify(r))}}t.fixRequestBody=fixRequestBody},7688:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var o=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))n(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});o(r(1644),t)},1644:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.fixRequestBody=t.responseInterceptor=void 0;var n=r(5975);Object.defineProperty(t,"responseInterceptor",{enumerable:true,get:function(){return n.responseInterceptor}});var o=r(8183);Object.defineProperty(t,"fixRequestBody",{enumerable:true,get:function(){return o.fixRequestBody}})},5975:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.responseInterceptor=void 0;const n=r(9796);function responseInterceptor(e){return async function proxyRes(proxyRes,t,r){const n=proxyRes;let o=Buffer.from("","utf8");const s=decompress(proxyRes,proxyRes.headers["content-encoding"]);s.on("data",(e=>o=Buffer.concat([o,e])));s.on("end",(async()=>{copyHeaders(proxyRes,r);const s=Buffer.from(await e(o,n,t,r));r.setHeader("content-length",Buffer.byteLength(s,"utf8"));r.write(s);r.end()}));s.on("error",(e=>{r.end(`Error fetching proxied request: ${e.message}`)}))}}t.responseInterceptor=responseInterceptor;function decompress(e,t){let r=e;let o;switch(t){case"gzip":o=n.createGunzip();break;case"br":o=n.createBrotliDecompress();break;case"deflate":o=n.createInflate();break;default:break}if(o){r.pipe(o);r=o}return r}function copyHeaders(e,t){t.statusCode=e.statusCode;t.statusMessage=e.statusMessage;if(t.setHeader){let r=Object.keys(e.headers);r=r.filter((e=>!["content-encoding","transfer-encoding"].includes(e)));r.forEach((r=>{let n=e.headers[r];if(r==="set-cookie"){n=Array.isArray(n)?n:[n];n=n.map((e=>e.replace(/Domain=[^;]+?/i,"")))}t.setHeader(r,n)}))}else{t.headers=e.headers}}},912:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.HttpProxyMiddleware=void 0;const n=r(6873);const o=r(2181);const s=r(5393);const i=r(6292);const u=r(9853);const a=r(833);const c=r(6774);class HttpProxyMiddleware{constructor(e,t){this.logger=(0,u.getInstance)();this.wsInternalSubscribed=false;this.serverOnCloseSubscribed=false;this.middleware=async(e,t,r)=>{var n,o;if(this.shouldProxy(this.config.context,e)){try{const r=await this.prepareProxyRequest(e);this.proxy.web(e,t,r)}catch(e){r(e)}}else{r()}const s=(o=(n=e.socket)!==null&&n!==void 0?n:e.connection)===null||o===void 0?void 0:o.server;if(s&&!this.serverOnCloseSubscribed){s.on("close",(()=>{this.logger.info("[HPM] server close signal received: closing proxy server");this.proxy.close()}));this.serverOnCloseSubscribed=true}if(this.proxyOptions.ws===true){this.catchUpgradeRequest(s)}};this.catchUpgradeRequest=e=>{if(!this.wsInternalSubscribed){e.on("upgrade",this.handleUpgrade);this.wsInternalSubscribed=true}};this.handleUpgrade=async(e,t,r)=>{if(this.shouldProxy(this.config.context,e)){const n=await this.prepareProxyRequest(e);this.proxy.ws(e,t,r,n);this.logger.info("[HPM] Upgrading to WebSocket")}};this.shouldProxy=(e,t)=>{const r=t.originalUrl||t.url;return s.match(e,r,t)};this.prepareProxyRequest=async e=>{e.url=e.originalUrl||e.url;const t=e.url;const r=Object.assign({},this.proxyOptions);await this.applyRouter(e,r);await this.applyPathRewrite(e,this.pathRewriter);if(this.proxyOptions.logLevel==="debug"){const n=(0,u.getArrow)(t,e.url,this.proxyOptions.target,r.target);this.logger.debug("[HPM] %s %s %s %s",e.method,t,n,r.target)}return r};this.applyRouter=async(e,t)=>{let r;if(t.router){r=await c.getTarget(e,t);if(r){this.logger.debug('[HPM] Router new target: %s -> "%s"',t.target,r);t.target=r}}};this.applyPathRewrite=async(e,t)=>{if(t){const r=await t(e.url,e);if(typeof r==="string"){e.url=r}else{this.logger.info("[HPM] pathRewrite: No rewritten path found. (%s)",e.url)}}};this.logError=(e,t,r,n)=>{var o;const s=((o=t.headers)===null||o===void 0?void 0:o.host)||t.hostname||t.host;const i=`${s}${t.url}`;const u=`${n===null||n===void 0?void 0:n.href}`;const a="[HPM] Error occurred while proxying request %s to %s [%s] (%s)";const c="https://nodejs.org/api/errors.html#errors_common_system_errors";this.logger.error(a,i,u,e.code||e,c)};this.config=(0,o.createConfig)(e,t);this.proxyOptions=this.config.options;this.proxy=n.createProxyServer({});this.logger.info(`[HPM] Proxy created: ${this.config.context} -> ${this.proxyOptions.target}`);this.pathRewriter=a.createPathRewriter(this.proxyOptions.pathRewrite);i.init(this.proxy,this.proxyOptions);this.proxy.on("error",this.logError);this.middleware.upgrade=(e,t,r)=>{if(!this.wsInternalSubscribed){this.handleUpgrade(e,t,r)}}}}t.HttpProxyMiddleware=HttpProxyMiddleware},7059:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var o=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))n(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});t.createProxyMiddleware=void 0;const s=r(912);function createProxyMiddleware(e,t){const{middleware:r}=new s.HttpProxyMiddleware(e,t);return r}t.createProxyMiddleware=createProxyMiddleware;o(r(7688),t)},9853:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getArrow=t.getInstance=void 0;const n=r(3837);let o;const s={log:console.log,debug:console.log,info:console.info,warn:console.warn,error:console.error};var i;(function(e){e[e["debug"]=10]="debug";e[e["info"]=20]="info";e[e["warn"]=30]="warn";e[e["error"]=50]="error";e[e["silent"]=80]="silent"})(i||(i={}));function getInstance(){if(!o){o=new Logger}return o}t.getInstance=getInstance;class Logger{constructor(){this.setLevel("info");this.setProvider((()=>s))}log(){this.provider.log(this._interpolate.apply(null,arguments))}debug(){if(this._showLevel("debug")){this.provider.debug(this._interpolate.apply(null,arguments))}}info(){if(this._showLevel("info")){this.provider.info(this._interpolate.apply(null,arguments))}}warn(){if(this._showLevel("warn")){this.provider.warn(this._interpolate.apply(null,arguments))}}error(){if(this._showLevel("error")){this.provider.error(this._interpolate.apply(null,arguments))}}setLevel(e){if(this.isValidLevel(e)){this.logLevel=e}}setProvider(e){if(e&&this.isValidProvider(e)){this.provider=e(s)}}isValidProvider(e){const t=true;if(e&&typeof e!=="function"){throw new Error("[HPM] Log provider config error. Expecting a function.")}return t}isValidLevel(e){const t=Object.keys(i);const r=t.includes(e);if(!r){throw new Error("[HPM] Log level error. Invalid logLevel.")}return r}_showLevel(e){let t=false;const r=i[this.logLevel];if(r&&r<=i[e]){t=true}return t}_interpolate(e,...t){const r=n.format(e,...t);return r}}function getArrow(e,t,r,n){const o=[">"];const s=r!==n;const i=e!==t;if(i&&!s){o.unshift("~")}else if(!i&&s){o.unshift("=")}else if(i&&s){o.unshift("≈")}else{o.unshift("-")}return o.join("")}t.getArrow=getArrow},833:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createPathRewriter=void 0;const n=r(4273);const o=r(4946);const s=r(9853);const i=(0,s.getInstance)();function createPathRewriter(e){let t;if(!isValidRewriteConfig(e)){return}if(typeof e==="function"){const t=e;return t}else{t=parsePathRewriteRules(e);return rewritePath}function rewritePath(e){let r=e;for(const n of t){if(n.regex.test(e)){r=r.replace(n.regex,n.value);i.debug('[HPM] Rewriting path from "%s" to "%s"',e,r);break}}return r}}t.createPathRewriter=createPathRewriter;function isValidRewriteConfig(e){if(typeof e==="function"){return true}else if(n(e)){return Object.keys(e).length!==0}else if(e===undefined||e===null){return false}else{throw new Error(o.ERRORS.ERR_PATH_REWRITER_CONFIG)}}function parsePathRewriteRules(e){const t=[];if(n(e)){for(const[r]of Object.entries(e)){t.push({regex:new RegExp(r),value:e[r]});i.info('[HPM] Proxy rewrite rule created: "%s" ~> "%s"',r,e[r])}}return t}},6774:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getTarget=void 0;const n=r(4273);const o=r(9853);const s=(0,o.getInstance)();async function getTarget(e,t){let r;const o=t.router;if(n(o)){r=getTargetFromProxyTable(e,o)}else if(typeof o==="function"){r=await o(e)}return r}t.getTarget=getTarget;function getTargetFromProxyTable(e,t){let r;const n=e.headers.host;const o=e.url;const i=n+o;for(const[e]of Object.entries(t)){if(containsPath(e)){if(i.indexOf(e)>-1){r=t[e];s.debug('[HPM] Router table match: "%s"',e);break}}else{if(e===n){r=t[e];s.debug('[HPM] Router table match: "%s"',n);break}}}return r}function containsPath(e){return e.indexOf("/")>-1}},6873:function(e,t,r){
|
|
8
8
|
/*!
|
|
9
9
|
* Caron dimonio, con occhi di bragia
|
|
10
10
|
* loro accennando, tutte le raccoglie;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Dante - The Divine Comedy (Canto III)
|
|
18
18
|
*/
|
|
19
|
-
e.exports=r(8831)},8831:function(e,t,r){var n=r(9691).Server;function createProxyServer(e){return new n(e)}n.createProxyServer=createProxyServer;n.createServer=createProxyServer;n.createProxy=createProxyServer;e.exports=n},8398:function(e,t,r){var n=t,o=r(7310),s=r(3837)._extend,i=r(926);var u=/(^|,)\s*upgrade\s*($|,)/i,a=/^https|wss/;n.isSSL=a;n.setupOutgoing=function(e,t,r,c){e.port=t[c||"target"].port||(a.test(t[c||"target"].protocol)?443:80);["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach((function(r){e[r]=t[c||"target"][r]}));e.method=t.method||r.method;e.headers=s({},r.headers);if(t.headers){s(e.headers,t.headers)}if(t.auth){e.auth=t.auth}if(t.ca){e.ca=t.ca}if(a.test(t[c||"target"].protocol)){e.rejectUnauthorized=typeof t.secure==="undefined"?true:t.secure}e.agent=t.agent||false;e.localAddress=t.localAddress;if(!e.agent){e.headers=e.headers||{};if(typeof e.headers.connection!=="string"||!u.test(e.headers.connection)){e.headers.connection="close"}}var l=t[c||"target"];var f=l&&t.prependPath!==false?l.path||"":"";var p=!t.toProxy?o.parse(r.url).path||"":r.url;p=!t.ignorePath?p:"";e.path=n.urlJoin(f,p);if(t.changeOrigin){e.headers.host=i(e.port,t[c||"target"].protocol)&&!hasPort(e.host)?e.host+":"+e.port:e.host}return e};n.setupSocket=function(e){e.setTimeout(0);e.setNoDelay(true);e.setKeepAlive(true,0);return e};n.getPort=function(e){var t=e.headers.host?e.headers.host.match(/:(\d+)/):"";return t?t[1]:n.hasEncryptedConnection(e)?"443":"80"};n.hasEncryptedConnection=function(e){return Boolean(e.connection.encrypted||e.connection.pair)};n.urlJoin=function(){var e=Array.prototype.slice.call(arguments),t=e.length-1,r=e[t],n=r.split("?"),o;e[t]=n.shift();o=[e.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")];o.push.apply(o,n);return o.join("?")};n.rewriteCookieProperty=function rewriteCookieProperty(e,t,r){if(Array.isArray(e)){return e.map((function(e){return rewriteCookieProperty(e,t,r)}))}return e.replace(new RegExp("(;\\s*"+r+"=)([^;]+)","i"),(function(e,r,n){var o;if(n in t){o=t[n]}else if("*"in t){o=t["*"]}else{return e}if(o){return r+o}else{return""}}))};function hasPort(e){return!!~e.indexOf(":")}},9691:function(e,t,r){var n=e.exports,o=r(3837)._extend,s=r(7310).parse,i=r(5377),u=r(3685),a=r(5687),c=r(3756),l=r(2733);n.Server=ProxyServer;function createRightProxy(e){return function(t){return function(r,n){var i=e==="ws"?this.wsPasses:this.webPasses,u=[].slice.call(arguments),a=u.length-1,c,l;if(typeof u[a]==="function"){l=u[a];a--}var f=t;if(!(u[a]instanceof Buffer)&&u[a]!==n){f=o({},t);o(f,u[a]);a--}if(u[a]instanceof Buffer){c=u[a]}["target","forward"].forEach((function(e){if(typeof f[e]==="string")f[e]=s(f[e])}));if(!f.target&&!f.forward){return this.emit("error",new Error("Must provide a proper URL as target"))}for(var p=0;p<i.length;p++){if(i[p](r,n,f,c,this,l)){break}}}}}n.createRightProxy=createRightProxy;function ProxyServer(e){i.call(this);e=e||{};e.prependPath=e.prependPath===false?false:true;this.web=this.proxyRequest=createRightProxy("web")(e);this.ws=this.proxyWebsocketRequest=createRightProxy("ws")(e);this.options=e;this.webPasses=Object.keys(c).map((function(e){return c[e]}));this.wsPasses=Object.keys(l).map((function(e){return l[e]}));this.on("error",this.onError,this)}r(3837).inherits(ProxyServer,i);ProxyServer.prototype.onError=function(e){if(this.listeners("error").length===1){throw e}};ProxyServer.prototype.listen=function(e,t){var r=this,closure=function(e,t){r.web(e,t)};this._server=this.options.ssl?a.createServer(this.options.ssl,closure):u.createServer(closure);if(this.options.ws){this._server.on("upgrade",(function(e,t,n){r.ws(e,t,n)}))}this._server.listen(e,t);return this};ProxyServer.prototype.close=function(e){var t=this;if(this._server){this._server.close(done)}function done(){t._server=null;if(e){e.apply(null,arguments)}}};ProxyServer.prototype.before=function(e,t,r){if(e!=="ws"&&e!=="web"){throw new Error("type must be `web` or `ws`")}var n=e==="ws"?this.wsPasses:this.webPasses,o=false;n.forEach((function(e,r){if(e.name===t)o=r}));if(o===false)throw new Error("No such pass");n.splice(o,0,r)};ProxyServer.prototype.after=function(e,t,r){if(e!=="ws"&&e!=="web"){throw new Error("type must be `web` or `ws`")}var n=e==="ws"?this.wsPasses:this.webPasses,o=false;n.forEach((function(e,r){if(e.name===t)o=r}));if(o===false)throw new Error("No such pass");n.splice(o++,0,r)}},3756:function(e,t,r){var n=r(3685),o=r(5687),s=r(2272),i=r(8398),u=r(
|
|
19
|
+
e.exports=r(8831)},8831:function(e,t,r){var n=r(9691).Server;function createProxyServer(e){return new n(e)}n.createProxyServer=createProxyServer;n.createServer=createProxyServer;n.createProxy=createProxyServer;e.exports=n},8398:function(e,t,r){var n=t,o=r(7310),s=r(3837)._extend,i=r(926);var u=/(^|,)\s*upgrade\s*($|,)/i,a=/^https|wss/;n.isSSL=a;n.setupOutgoing=function(e,t,r,c){e.port=t[c||"target"].port||(a.test(t[c||"target"].protocol)?443:80);["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach((function(r){e[r]=t[c||"target"][r]}));e.method=t.method||r.method;e.headers=s({},r.headers);if(t.headers){s(e.headers,t.headers)}if(t.auth){e.auth=t.auth}if(t.ca){e.ca=t.ca}if(a.test(t[c||"target"].protocol)){e.rejectUnauthorized=typeof t.secure==="undefined"?true:t.secure}e.agent=t.agent||false;e.localAddress=t.localAddress;if(!e.agent){e.headers=e.headers||{};if(typeof e.headers.connection!=="string"||!u.test(e.headers.connection)){e.headers.connection="close"}}var l=t[c||"target"];var f=l&&t.prependPath!==false?l.path||"":"";var p=!t.toProxy?o.parse(r.url).path||"":r.url;p=!t.ignorePath?p:"";e.path=n.urlJoin(f,p);if(t.changeOrigin){e.headers.host=i(e.port,t[c||"target"].protocol)&&!hasPort(e.host)?e.host+":"+e.port:e.host}return e};n.setupSocket=function(e){e.setTimeout(0);e.setNoDelay(true);e.setKeepAlive(true,0);return e};n.getPort=function(e){var t=e.headers.host?e.headers.host.match(/:(\d+)/):"";return t?t[1]:n.hasEncryptedConnection(e)?"443":"80"};n.hasEncryptedConnection=function(e){return Boolean(e.connection.encrypted||e.connection.pair)};n.urlJoin=function(){var e=Array.prototype.slice.call(arguments),t=e.length-1,r=e[t],n=r.split("?"),o;e[t]=n.shift();o=[e.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")];o.push.apply(o,n);return o.join("?")};n.rewriteCookieProperty=function rewriteCookieProperty(e,t,r){if(Array.isArray(e)){return e.map((function(e){return rewriteCookieProperty(e,t,r)}))}return e.replace(new RegExp("(;\\s*"+r+"=)([^;]+)","i"),(function(e,r,n){var o;if(n in t){o=t[n]}else if("*"in t){o=t["*"]}else{return e}if(o){return r+o}else{return""}}))};function hasPort(e){return!!~e.indexOf(":")}},9691:function(e,t,r){var n=e.exports,o=r(3837)._extend,s=r(7310).parse,i=r(5377),u=r(3685),a=r(5687),c=r(3756),l=r(2733);n.Server=ProxyServer;function createRightProxy(e){return function(t){return function(r,n){var i=e==="ws"?this.wsPasses:this.webPasses,u=[].slice.call(arguments),a=u.length-1,c,l;if(typeof u[a]==="function"){l=u[a];a--}var f=t;if(!(u[a]instanceof Buffer)&&u[a]!==n){f=o({},t);o(f,u[a]);a--}if(u[a]instanceof Buffer){c=u[a]}["target","forward"].forEach((function(e){if(typeof f[e]==="string")f[e]=s(f[e])}));if(!f.target&&!f.forward){return this.emit("error",new Error("Must provide a proper URL as target"))}for(var p=0;p<i.length;p++){if(i[p](r,n,f,c,this,l)){break}}}}}n.createRightProxy=createRightProxy;function ProxyServer(e){i.call(this);e=e||{};e.prependPath=e.prependPath===false?false:true;this.web=this.proxyRequest=createRightProxy("web")(e);this.ws=this.proxyWebsocketRequest=createRightProxy("ws")(e);this.options=e;this.webPasses=Object.keys(c).map((function(e){return c[e]}));this.wsPasses=Object.keys(l).map((function(e){return l[e]}));this.on("error",this.onError,this)}r(3837).inherits(ProxyServer,i);ProxyServer.prototype.onError=function(e){if(this.listeners("error").length===1){throw e}};ProxyServer.prototype.listen=function(e,t){var r=this,closure=function(e,t){r.web(e,t)};this._server=this.options.ssl?a.createServer(this.options.ssl,closure):u.createServer(closure);if(this.options.ws){this._server.on("upgrade",(function(e,t,n){r.ws(e,t,n)}))}this._server.listen(e,t);return this};ProxyServer.prototype.close=function(e){var t=this;if(this._server){this._server.close(done)}function done(){t._server=null;if(e){e.apply(null,arguments)}}};ProxyServer.prototype.before=function(e,t,r){if(e!=="ws"&&e!=="web"){throw new Error("type must be `web` or `ws`")}var n=e==="ws"?this.wsPasses:this.webPasses,o=false;n.forEach((function(e,r){if(e.name===t)o=r}));if(o===false)throw new Error("No such pass");n.splice(o,0,r)};ProxyServer.prototype.after=function(e,t,r){if(e!=="ws"&&e!=="web"){throw new Error("type must be `web` or `ws`")}var n=e==="ws"?this.wsPasses:this.webPasses,o=false;n.forEach((function(e,r){if(e.name===t)o=r}));if(o===false)throw new Error("No such pass");n.splice(o++,0,r)}},3756:function(e,t,r){var n=r(3685),o=r(5687),s=r(2272),i=r(8398),u=r(8318);s=Object.keys(s).map((function(e){return s[e]}));var a={http:n,https:o};
|
|
20
20
|
/*!
|
|
21
21
|
* Array of passes.
|
|
22
22
|
*
|
|
@@ -57,10 +57,10 @@ var n=r(3071);var o={"{":"}","(":")","[":"]"};var strictCheck=function(e){if(e[0
|
|
|
57
57
|
*
|
|
58
58
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
59
59
|
* Released under the MIT License.
|
|
60
|
-
*/e.exports=function(e){if(typeof e==="number"){return e-e===0}if(typeof e==="string"&&e.trim()!==""){return Number.isFinite?Number.isFinite(+e):isFinite(+e)}return false}},4273:function(e){"use strict";e.exports=e=>{if(Object.prototype.toString.call(e)!=="[object Object]"){return false}const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}},8627:function(e,t,r){"use strict";const n=r(3837);const o=r(1570);const s=r(376);const i=r(8658);const isEmptyString=e=>e===""||e==="./";const micromatch=(e,t,r)=>{t=[].concat(t);e=[].concat(e);let n=new Set;let o=new Set;let i=new Set;let u=0;let onResult=e=>{i.add(e.output);if(r&&r.onResult){r.onResult(e)}};for(let i=0;i<t.length;i++){let a=s(String(t[i]),{...r,onResult:onResult},true);let c=a.state.negated||a.state.negatedExtglob;if(c)u++;for(let t of e){let e=a(t,true);let r=c?!e.isMatch:e.isMatch;if(!r)continue;if(c){n.add(e.output)}else{n.delete(e.output);o.add(e.output)}}}let a=u===t.length?[...i]:[...o];let c=a.filter((e=>!n.has(e)));if(r&&c.length===0){if(r.failglob===true){throw new Error(`No matches found for "${t.join(", ")}"`)}if(r.nonull===true||r.nullglob===true){return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}}return c};micromatch.match=micromatch;micromatch.matcher=(e,t)=>s(e,t);micromatch.isMatch=(e,t,r)=>s(t,r)(e);micromatch.any=micromatch.isMatch;micromatch.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set;let o=[];let onResult=e=>{if(r.onResult)r.onResult(e);o.push(e.output)};let s=new Set(micromatch(e,t,{...r,onResult:onResult}));for(let e of o){if(!s.has(e)){n.add(e)}}return[...n]};micromatch.contains=(e,t,r)=>{if(typeof e!=="string"){throw new TypeError(`Expected a string: "${n.inspect(e)}"`)}if(Array.isArray(t)){return t.some((t=>micromatch.contains(e,t,r)))}if(typeof t==="string"){if(isEmptyString(e)||isEmptyString(t)){return false}if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t)){return true}}return micromatch.isMatch(e,t,{...r,contains:true})};micromatch.matchKeys=(e,t,r)=>{if(!i.isObject(e)){throw new TypeError("Expected the first argument to be an object")}let n=micromatch(Object.keys(e),t,r);let o={};for(let t of n)o[t]=e[t];return o};micromatch.some=(e,t,r)=>{let n=[].concat(e);for(let e of[].concat(t)){let t=s(String(e),r);if(n.some((e=>t(e)))){return true}}return false};micromatch.every=(e,t,r)=>{let n=[].concat(e);for(let e of[].concat(t)){let t=s(String(e),r);if(!n.every((e=>t(e)))){return false}}return true};micromatch.all=(e,t,r)=>{if(typeof e!=="string"){throw new TypeError(`Expected a string: "${n.inspect(e)}"`)}return[].concat(t).every((t=>s(t,r)(e)))};micromatch.capture=(e,t,r)=>{let n=i.isWindows(r);let o=s.makeRe(String(e),{...r,capture:true});let u=o.exec(n?i.toPosixSlashes(t):t);if(u){return u.slice(1).map((e=>e===void 0?"":e))}};micromatch.makeRe=(...e)=>s.makeRe(...e);micromatch.scan=(...e)=>s.scan(...e);micromatch.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[])){for(let e of o(String(n),t)){r.push(s.parse(e,t))}}return r};micromatch.braces=(e,t)=>{if(typeof e!=="string")throw new TypeError("Expected a string");if(t&&t.nobrace===true||!/\{.*\}/.test(e)){return[e]}return o(e,t)};micromatch.braceExpand=(e,t)=>{if(typeof e!=="string")throw new TypeError("Expected a string");return micromatch.braces(e,{...t,expand:true})};e.exports=micromatch},376:function(e,t,r){"use strict";e.exports=r(7631)},7820:function(e,t,r){"use strict";const n=r(1017);const o="\\\\/";const s=`[^${o}]`;const i="\\.";const u="\\+";const a="\\?";const c="\\/";const l="(?=.)";const f="[^/]";const p=`(?:${c}|$)`;const h=`(?:^|${c})`;const d=`${i}{1,2}${p}`;const g=`(?!${i})`;const R=`(?!${h}${d})`;const y=`(?!${i}{0,1}${p})`;const _=`(?!${d})`;const v=`[^.${c}]`;const E=`${f}*?`;const x={DOT_LITERAL:i,PLUS_LITERAL:u,QMARK_LITERAL:a,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:f,END_ANCHOR:p,DOTS_SLASH:d,NO_DOT:g,NO_DOTS:R,NO_DOT_SLASH:y,NO_DOTS_SLASH:_,QMARK_NO_DOT:v,STAR:E,START_ANCHOR:h};const A={...x,SLASH_LITERAL:`[${o}]`,QMARK:s,STAR:`${s}*?`,DOTS_SLASH:`${i}{1,2}(?:[${o}]|$)`,NO_DOT:`(?!${i})`,NO_DOTS:`(?!(?:^|[${o}])${i}{1,2}(?:[${o}]|$))`,NO_DOT_SLASH:`(?!${i}{0,1}(?:[${o}]|$))`,NO_DOTS_SLASH:`(?!${i}{1,2}(?:[${o}]|$))`,QMARK_NO_DOT:`[^.${o}]`,START_ANCHOR:`(?:^|[${o}])`,END_ANCHOR:`(?:[${o}]|$)`};const m={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};e.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:m,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:n.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===true?A:x}}},6986:function(e,t,r){"use strict";const n=r(7820);const o=r(8658);const{MAX_LENGTH:s,POSIX_REGEX_SOURCE:i,REGEX_NON_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:c}=n;const expandRange=(e,t)=>{if(typeof t.expandRange==="function"){return t.expandRange(...e,t)}e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map((e=>o.escapeRegex(e))).join("..")}return r};const syntaxError=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`;const parse=(e,t)=>{if(typeof e!=="string"){throw new TypeError("Expected a string")}e=c[e]||e;const r={...t};const l=typeof r.maxLength==="number"?Math.min(s,r.maxLength):s;let f=e.length;if(f>l){throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${l}`)}const p={type:"bos",value:"",output:r.prepend||""};const h=[p];const d=r.capture?"":"?:";const g=o.isWindows(t);const R=n.globChars(g);const y=n.extglobChars(R);const{DOT_LITERAL:_,PLUS_LITERAL:v,SLASH_LITERAL:E,ONE_CHAR:x,DOTS_SLASH:A,NO_DOT:m,NO_DOT_SLASH:b,NO_DOTS_SLASH:w,QMARK:C,QMARK_NO_DOT:S,STAR:H,START_ANCHOR:O}=R;const globstar=e=>`(${d}(?:(?!${O}${e.dot?A:_}).)*?)`;const T=r.dot?"":m;const P=r.dot?C:S;let L=r.bash===true?globstar(r):H;if(r.capture){L=`(${L})`}if(typeof r.noext==="boolean"){r.noextglob=r.noext}const $={input:e,index:-1,start:0,dot:r.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:h};e=o.removePrefix(e,$);f=e.length;const k=[];const N=[];const M=[];let I=p;let B;const eos=()=>$.index===f-1;const q=$.peek=(t=1)=>e[$.index+t];const j=$.advance=()=>e[++$.index]||"";const remaining=()=>e.slice($.index+1);const consume=(e="",t=0)=>{$.consumed+=e;$.index+=t};const append=e=>{$.output+=e.output!=null?e.output:e.value;consume(e.value)};const negate=()=>{let e=1;while(q()==="!"&&(q(2)!=="("||q(3)==="?")){j();$.start++;e++}if(e%2===0){return false}$.negated=true;$.start++;return true};const increment=e=>{$[e]++;M.push(e)};const decrement=e=>{$[e]--;M.pop()};const push=e=>{if(I.type==="globstar"){const t=$.braces>0&&(e.type==="comma"||e.type==="brace");const r=e.extglob===true||k.length&&(e.type==="pipe"||e.type==="paren");if(e.type!=="slash"&&e.type!=="paren"&&!t&&!r){$.output=$.output.slice(0,-I.output.length);I.type="star";I.value="*";I.output=L;$.output+=I.output}}if(k.length&&e.type!=="paren"){k[k.length-1].inner+=e.value}if(e.value||e.output)append(e);if(I&&I.type==="text"&&e.type==="text"){I.value+=e.value;I.output=(I.output||"")+e.value;return}e.prev=I;h.push(e);I=e};const extglobOpen=(e,t)=>{const n={...y[t],conditions:1,inner:""};n.prev=I;n.parens=$.parens;n.output=$.output;const o=(r.capture?"(":"")+n.open;increment("parens");push({type:e,value:t,output:$.output?"":x});push({type:"paren",extglob:true,value:j(),output:o});k.push(n)};const extglobClose=e=>{let n=e.close+(r.capture?")":"");let o;if(e.type==="negate"){let s=L;if(e.inner&&e.inner.length>1&&e.inner.includes("/")){s=globstar(r)}if(s!==L||eos()||/^\)+$/.test(remaining())){n=e.close=`)$))${s}`}if(e.inner.includes("*")&&(o=remaining())&&/^\.[^\\/.]+$/.test(o)){const r=parse(o,{...t,fastpaths:false}).output;n=e.close=`)${r})${s})`}if(e.prev.type==="bos"){$.negatedExtglob=true}}push({type:"paren",extglob:true,value:B,output:n});decrement("parens")};if(r.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=false;let s=e.replace(a,((e,t,r,o,s,i)=>{if(o==="\\"){n=true;return e}if(o==="?"){if(t){return t+o+(s?C.repeat(s.length):"")}if(i===0){return P+(s?C.repeat(s.length):"")}return C.repeat(r.length)}if(o==="."){return _.repeat(r.length)}if(o==="*"){if(t){return t+o+(s?L:"")}return L}return t?e:`\\${e}`}));if(n===true){if(r.unescape===true){s=s.replace(/\\/g,"")}else{s=s.replace(/\\+/g,(e=>e.length%2===0?"\\\\":e?"\\":""))}}if(s===e&&r.contains===true){$.output=e;return $}$.output=o.wrapOutput(s,$,t);return $}while(!eos()){B=j();if(B==="\0"){continue}if(B==="\\"){const e=q();if(e==="/"&&r.bash!==true){continue}if(e==="."||e===";"){continue}if(!e){B+="\\";push({type:"text",value:B});continue}const t=/^\\+/.exec(remaining());let n=0;if(t&&t[0].length>2){n=t[0].length;$.index+=n;if(n%2!==0){B+="\\"}}if(r.unescape===true){B=j()}else{B+=j()}if($.brackets===0){push({type:"text",value:B});continue}}if($.brackets>0&&(B!=="]"||I.value==="["||I.value==="[^")){if(r.posix!==false&&B===":"){const e=I.value.slice(1);if(e.includes("[")){I.posix=true;if(e.includes(":")){const e=I.value.lastIndexOf("[");const t=I.value.slice(0,e);const r=I.value.slice(e+2);const n=i[r];if(n){I.value=t+n;$.backtrack=true;j();if(!p.output&&h.indexOf(I)===1){p.output=x}continue}}}}if(B==="["&&q()!==":"||B==="-"&&q()==="]"){B=`\\${B}`}if(B==="]"&&(I.value==="["||I.value==="[^")){B=`\\${B}`}if(r.posix===true&&B==="!"&&I.value==="["){B="^"}I.value+=B;append({value:B});continue}if($.quotes===1&&B!=='"'){B=o.escapeRegex(B);I.value+=B;append({value:B});continue}if(B==='"'){$.quotes=$.quotes===1?0:1;if(r.keepQuotes===true){push({type:"text",value:B})}continue}if(B==="("){increment("parens");push({type:"paren",value:B});continue}if(B===")"){if($.parens===0&&r.strictBrackets===true){throw new SyntaxError(syntaxError("opening","("))}const e=k[k.length-1];if(e&&$.parens===e.parens+1){extglobClose(k.pop());continue}push({type:"paren",value:B,output:$.parens?")":"\\)"});decrement("parens");continue}if(B==="["){if(r.nobracket===true||!remaining().includes("]")){if(r.nobracket!==true&&r.strictBrackets===true){throw new SyntaxError(syntaxError("closing","]"))}B=`\\${B}`}else{increment("brackets")}push({type:"bracket",value:B});continue}if(B==="]"){if(r.nobracket===true||I&&I.type==="bracket"&&I.value.length===1){push({type:"text",value:B,output:`\\${B}`});continue}if($.brackets===0){if(r.strictBrackets===true){throw new SyntaxError(syntaxError("opening","["))}push({type:"text",value:B,output:`\\${B}`});continue}decrement("brackets");const e=I.value.slice(1);if(I.posix!==true&&e[0]==="^"&&!e.includes("/")){B=`/${B}`}I.value+=B;append({value:B});if(r.literalBrackets===false||o.hasRegexChars(e)){continue}const t=o.escapeRegex(I.value);$.output=$.output.slice(0,-I.value.length);if(r.literalBrackets===true){$.output+=t;I.value=t;continue}I.value=`(${d}${t}|${I.value})`;$.output+=I.value;continue}if(B==="{"&&r.nobrace!==true){increment("braces");const e={type:"brace",value:B,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};N.push(e);push(e);continue}if(B==="}"){const e=N[N.length-1];if(r.nobrace===true||!e){push({type:"text",value:B,output:B});continue}let t=")";if(e.dots===true){const e=h.slice();const n=[];for(let t=e.length-1;t>=0;t--){h.pop();if(e[t].type==="brace"){break}if(e[t].type!=="dots"){n.unshift(e[t].value)}}t=expandRange(n,r);$.backtrack=true}if(e.comma!==true&&e.dots!==true){const r=$.output.slice(0,e.outputIndex);const n=$.tokens.slice(e.tokensIndex);e.value=e.output="\\{";B=t="\\}";$.output=r;for(const e of n){$.output+=e.output||e.value}}push({type:"brace",value:B,output:t});decrement("braces");N.pop();continue}if(B==="|"){if(k.length>0){k[k.length-1].conditions++}push({type:"text",value:B});continue}if(B===","){let e=B;const t=N[N.length-1];if(t&&M[M.length-1]==="braces"){t.comma=true;e="|"}push({type:"comma",value:B,output:e});continue}if(B==="/"){if(I.type==="dot"&&$.index===$.start+1){$.start=$.index+1;$.consumed="";$.output="";h.pop();I=p;continue}push({type:"slash",value:B,output:E});continue}if(B==="."){if($.braces>0&&I.type==="dot"){if(I.value===".")I.output=_;const e=N[N.length-1];I.type="dots";I.output+=B;I.value+=B;e.dots=true;continue}if($.braces+$.parens===0&&I.type!=="bos"&&I.type!=="slash"){push({type:"text",value:B,output:_});continue}push({type:"dot",value:B,output:_});continue}if(B==="?"){const e=I&&I.value==="(";if(!e&&r.noextglob!==true&&q()==="("&&q(2)!=="?"){extglobOpen("qmark",B);continue}if(I&&I.type==="paren"){const e=q();let t=B;if(e==="<"&&!o.supportsLookbehinds()){throw new Error("Node.js v10 or higher is required for regex lookbehinds")}if(I.value==="("&&!/[!=<:]/.test(e)||e==="<"&&!/<([!=]|\w+>)/.test(remaining())){t=`\\${B}`}push({type:"text",value:B,output:t});continue}if(r.dot!==true&&(I.type==="slash"||I.type==="bos")){push({type:"qmark",value:B,output:S});continue}push({type:"qmark",value:B,output:C});continue}if(B==="!"){if(r.noextglob!==true&&q()==="("){if(q(2)!=="?"||!/[!=<:]/.test(q(3))){extglobOpen("negate",B);continue}}if(r.nonegate!==true&&$.index===0){negate();continue}}if(B==="+"){if(r.noextglob!==true&&q()==="("&&q(2)!=="?"){extglobOpen("plus",B);continue}if(I&&I.value==="("||r.regex===false){push({type:"plus",value:B,output:v});continue}if(I&&(I.type==="bracket"||I.type==="paren"||I.type==="brace")||$.parens>0){push({type:"plus",value:B});continue}push({type:"plus",value:v});continue}if(B==="@"){if(r.noextglob!==true&&q()==="("&&q(2)!=="?"){push({type:"at",extglob:true,value:B,output:""});continue}push({type:"text",value:B});continue}if(B!=="*"){if(B==="$"||B==="^"){B=`\\${B}`}const e=u.exec(remaining());if(e){B+=e[0];$.index+=e[0].length}push({type:"text",value:B});continue}if(I&&(I.type==="globstar"||I.star===true)){I.type="star";I.star=true;I.value+=B;I.output=L;$.backtrack=true;$.globstar=true;consume(B);continue}let t=remaining();if(r.noextglob!==true&&/^\([^?]/.test(t)){extglobOpen("star",B);continue}if(I.type==="star"){if(r.noglobstar===true){consume(B);continue}const n=I.prev;const o=n.prev;const s=n.type==="slash"||n.type==="bos";const i=o&&(o.type==="star"||o.type==="globstar");if(r.bash===true&&(!s||t[0]&&t[0]!=="/")){push({type:"star",value:B,output:""});continue}const u=$.braces>0&&(n.type==="comma"||n.type==="brace");const a=k.length&&(n.type==="pipe"||n.type==="paren");if(!s&&n.type!=="paren"&&!u&&!a){push({type:"star",value:B,output:""});continue}while(t.slice(0,3)==="/**"){const r=e[$.index+4];if(r&&r!=="/"){break}t=t.slice(3);consume("/**",3)}if(n.type==="bos"&&eos()){I.type="globstar";I.value+=B;I.output=globstar(r);$.output=I.output;$.globstar=true;consume(B);continue}if(n.type==="slash"&&n.prev.type!=="bos"&&!i&&eos()){$.output=$.output.slice(0,-(n.output+I.output).length);n.output=`(?:${n.output}`;I.type="globstar";I.output=globstar(r)+(r.strictSlashes?")":"|$)");I.value+=B;$.globstar=true;$.output+=n.output+I.output;consume(B);continue}if(n.type==="slash"&&n.prev.type!=="bos"&&t[0]==="/"){const e=t[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(n.output+I.output).length);n.output=`(?:${n.output}`;I.type="globstar";I.output=`${globstar(r)}${E}|${E}${e})`;I.value+=B;$.output+=n.output+I.output;$.globstar=true;consume(B+j());push({type:"slash",value:"/",output:""});continue}if(n.type==="bos"&&t[0]==="/"){I.type="globstar";I.value+=B;I.output=`(?:^|${E}|${globstar(r)}${E})`;$.output=I.output;$.globstar=true;consume(B+j());push({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-I.output.length);I.type="globstar";I.output=globstar(r);I.value+=B;$.output+=I.output;$.globstar=true;consume(B);continue}const n={type:"star",value:B,output:L};if(r.bash===true){n.output=".*?";if(I.type==="bos"||I.type==="slash"){n.output=T+n.output}push(n);continue}if(I&&(I.type==="bracket"||I.type==="paren")&&r.regex===true){n.output=B;push(n);continue}if($.index===$.start||I.type==="slash"||I.type==="dot"){if(I.type==="dot"){$.output+=b;I.output+=b}else if(r.dot===true){$.output+=w;I.output+=w}else{$.output+=T;I.output+=T}if(q()!=="*"){$.output+=x;I.output+=x}}push(n)}while($.brackets>0){if(r.strictBrackets===true)throw new SyntaxError(syntaxError("closing","]"));$.output=o.escapeLast($.output,"[");decrement("brackets")}while($.parens>0){if(r.strictBrackets===true)throw new SyntaxError(syntaxError("closing",")"));$.output=o.escapeLast($.output,"(");decrement("parens")}while($.braces>0){if(r.strictBrackets===true)throw new SyntaxError(syntaxError("closing","}"));$.output=o.escapeLast($.output,"{");decrement("braces")}if(r.strictSlashes!==true&&(I.type==="star"||I.type==="bracket")){push({type:"maybe_slash",value:"",output:`${E}?`})}if($.backtrack===true){$.output="";for(const e of $.tokens){$.output+=e.output!=null?e.output:e.value;if(e.suffix){$.output+=e.suffix}}}return $};parse.fastpaths=(e,t)=>{const r={...t};const i=typeof r.maxLength==="number"?Math.min(s,r.maxLength):s;const u=e.length;if(u>i){throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${i}`)}e=c[e]||e;const a=o.isWindows(t);const{DOT_LITERAL:l,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:g,NO_DOTS_SLASH:R,STAR:y,START_ANCHOR:_}=n.globChars(a);const v=r.dot?g:d;const E=r.dot?R:d;const x=r.capture?"":"?:";const A={negated:false,prefix:""};let m=r.bash===true?".*?":y;if(r.capture){m=`(${m})`}const globstar=e=>{if(e.noglobstar===true)return m;return`(${x}(?:(?!${_}${e.dot?h:l}).)*?)`};const create=e=>{switch(e){case"*":return`${v}${p}${m}`;case".*":return`${l}${p}${m}`;case"*.*":return`${v}${m}${l}${p}${m}`;case"*/*":return`${v}${m}${f}${p}${E}${m}`;case"**":return v+globstar(r);case"**/*":return`(?:${v}${globstar(r)}${f})?${E}${p}${m}`;case"**/*.*":return`(?:${v}${globstar(r)}${f})?${E}${m}${l}${p}${m}`;case"**/.*":return`(?:${v}${globstar(r)}${f})?${l}${p}${m}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=create(t[1]);if(!r)return;return r+l+t[2]}}};const b=o.removePrefix(e,A);let w=create(b);if(w&&r.strictSlashes!==true){w+=`${f}?`}return w};e.exports=parse},7631:function(e,t,r){"use strict";const n=r(1017);const o=r(8640);const s=r(6986);const i=r(8658);const u=r(7820);const isObject=e=>e&&typeof e==="object"&&!Array.isArray(e);const picomatch=(e,t,r=false)=>{if(Array.isArray(e)){const n=e.map((e=>picomatch(e,t,r)));const arrayMatcher=e=>{for(const t of n){const r=t(e);if(r)return r}return false};return arrayMatcher}const n=isObject(e)&&e.tokens&&e.input;if(e===""||typeof e!=="string"&&!n){throw new TypeError("Expected pattern to be a non-empty string")}const o=t||{};const s=i.isWindows(t);const u=n?picomatch.compileRe(e,t):picomatch.makeRe(e,t,false,true);const a=u.state;delete u.state;let isIgnored=()=>false;if(o.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch(o.ignore,e,r)}const matcher=(r,n=false)=>{const{isMatch:i,match:c,output:l}=picomatch.test(r,u,t,{glob:e,posix:s});const f={glob:e,state:a,regex:u,posix:s,input:r,output:l,match:c,isMatch:i};if(typeof o.onResult==="function"){o.onResult(f)}if(i===false){f.isMatch=false;return n?f:false}if(isIgnored(r)){if(typeof o.onIgnore==="function"){o.onIgnore(f)}f.isMatch=false;return n?f:false}if(typeof o.onMatch==="function"){o.onMatch(f)}return n?f:true};if(r){matcher.state=a}return matcher};picomatch.test=(e,t,r,{glob:n,posix:o}={})=>{if(typeof e!=="string"){throw new TypeError("Expected input to be a string")}if(e===""){return{isMatch:false,output:""}}const s=r||{};const u=s.format||(o?i.toPosixSlashes:null);let a=e===n;let c=a&&u?u(e):e;if(a===false){c=u?u(e):e;a=c===n}if(a===false||s.capture===true){if(s.matchBase===true||s.basename===true){a=picomatch.matchBase(e,t,r,o)}else{a=t.exec(c)}}return{isMatch:Boolean(a),match:a,output:c}};picomatch.matchBase=(e,t,r,o=i.isWindows(r))=>{const s=t instanceof RegExp?t:picomatch.makeRe(t,r);return s.test(n.basename(e))};picomatch.isMatch=(e,t,r)=>picomatch(t,r)(e);picomatch.parse=(e,t)=>{if(Array.isArray(e))return e.map((e=>picomatch.parse(e,t)));return s(e,{...t,fastpaths:false})};picomatch.scan=(e,t)=>o(e,t);picomatch.compileRe=(e,t,r=false,n=false)=>{if(r===true){return e.output}const o=t||{};const s=o.contains?"":"^";const i=o.contains?"":"$";let u=`${s}(?:${e.output})${i}`;if(e&&e.negated===true){u=`^(?!${u}).*$`}const a=picomatch.toRegex(u,t);if(n===true){a.state=e}return a};picomatch.makeRe=(e,t={},r=false,n=false)=>{if(!e||typeof e!=="string"){throw new TypeError("Expected a non-empty string")}let o={negated:false,fastpaths:true};if(t.fastpaths!==false&&(e[0]==="."||e[0]==="*")){o.output=s.fastpaths(e,t)}if(!o.output){o=s(e,t)}return picomatch.compileRe(o,t,r,n)};picomatch.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&t.debug===true)throw e;return/$^/}};picomatch.constants=u;e.exports=picomatch},8640:function(e,t,r){"use strict";const n=r(8658);const{CHAR_ASTERISK:o,CHAR_AT:s,CHAR_BACKWARD_SLASH:i,CHAR_COMMA:u,CHAR_DOT:a,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:f,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:d,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:R,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:_}=r(7820);const isPathSeparator=e=>e===l||e===i;const depth=e=>{if(e.isPrefix!==true){e.depth=e.isGlobstar?Infinity:1}};const scan=(e,t)=>{const r=t||{};const v=e.length-1;const E=r.parts===true||r.scanToEnd===true;const x=[];const A=[];const m=[];let b=e;let w=-1;let C=0;let S=0;let H=false;let O=false;let T=false;let P=false;let L=false;let $=false;let k=false;let N=false;let M=false;let I=false;let B=0;let q;let j;let G={value:"",depth:0,isGlob:false};const eos=()=>w>=v;const peek=()=>b.charCodeAt(w+1);const advance=()=>{q=j;return b.charCodeAt(++w)};while(w<v){j=advance();let e;if(j===i){k=G.backslashes=true;j=advance();if(j===f){$=true}continue}if($===true||j===f){B++;while(eos()!==true&&(j=advance())){if(j===i){k=G.backslashes=true;advance();continue}if(j===f){B++;continue}if($!==true&&j===a&&(j=advance())===a){H=G.isBrace=true;T=G.isGlob=true;I=true;if(E===true){continue}break}if($!==true&&j===u){H=G.isBrace=true;T=G.isGlob=true;I=true;if(E===true){continue}break}if(j===R){B--;if(B===0){$=false;H=G.isBrace=true;I=true;break}}}if(E===true){continue}break}if(j===l){x.push(w);A.push(G);G={value:"",depth:0,isGlob:false};if(I===true)continue;if(q===a&&w===C+1){C+=2;continue}S=w+1;continue}if(r.noext!==true){const e=j===d||j===s||j===o||j===g||j===c;if(e===true&&peek()===p){T=G.isGlob=true;P=G.isExtglob=true;I=true;if(j===c&&w===C){M=true}if(E===true){while(eos()!==true&&(j=advance())){if(j===i){k=G.backslashes=true;j=advance();continue}if(j===y){T=G.isGlob=true;I=true;break}}continue}break}}if(j===o){if(q===o)L=G.isGlobstar=true;T=G.isGlob=true;I=true;if(E===true){continue}break}if(j===g){T=G.isGlob=true;I=true;if(E===true){continue}break}if(j===h){while(eos()!==true&&(e=advance())){if(e===i){k=G.backslashes=true;advance();continue}if(e===_){O=G.isBracket=true;T=G.isGlob=true;I=true;break}}if(E===true){continue}break}if(r.nonegate!==true&&j===c&&w===C){N=G.negated=true;C++;continue}if(r.noparen!==true&&j===p){T=G.isGlob=true;if(E===true){while(eos()!==true&&(j=advance())){if(j===p){k=G.backslashes=true;j=advance();continue}if(j===y){I=true;break}}continue}break}if(T===true){I=true;if(E===true){continue}break}}if(r.noext===true){P=false;T=false}let U=b;let D="";let K="";if(C>0){D=b.slice(0,C);b=b.slice(C);S-=C}if(U&&T===true&&S>0){U=b.slice(0,S);K=b.slice(S)}else if(T===true){U="";K=b}else{U=b}if(U&&U!==""&&U!=="/"&&U!==b){if(isPathSeparator(U.charCodeAt(U.length-1))){U=U.slice(0,-1)}}if(r.unescape===true){if(K)K=n.removeBackslashes(K);if(U&&k===true){U=n.removeBackslashes(U)}}const F={prefix:D,input:e,start:C,base:U,glob:K,isBrace:H,isBracket:O,isGlob:T,isExtglob:P,isGlobstar:L,negated:N,negatedExtglob:M};if(r.tokens===true){F.maxDepth=0;if(!isPathSeparator(j)){A.push(G)}F.tokens=A}if(r.parts===true||r.tokens===true){let t;for(let n=0;n<x.length;n++){const o=t?t+1:C;const s=x[n];const i=e.slice(o,s);if(r.tokens){if(n===0&&C!==0){A[n].isPrefix=true;A[n].value=D}else{A[n].value=i}depth(A[n]);F.maxDepth+=A[n].depth}if(n!==0||i!==""){m.push(i)}t=s}if(t&&t+1<e.length){const n=e.slice(t+1);m.push(n);if(r.tokens){A[A.length-1].value=n;depth(A[A.length-1]);F.maxDepth+=A[A.length-1].depth}}F.slashes=x;F.parts=m}return F};e.exports=scan},8658:function(e,t,r){"use strict";const n=r(1017);const o=process.platform==="win32";const{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_GLOBAL:a}=r(7820);t.isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);t.hasRegexChars=e=>u.test(e);t.isRegexChar=e=>e.length===1&&t.hasRegexChars(e);t.escapeRegex=e=>e.replace(a,"\\$1");t.toPosixSlashes=e=>e.replace(s,"/");t.removeBackslashes=e=>e.replace(i,(e=>e==="\\"?"":e));t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);if(e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10){return true}return false};t.isWindows=e=>{if(e&&typeof e.windows==="boolean"){return e.windows}return o===true||n.sep==="\\"};t.escapeLast=(e,r,n)=>{const o=e.lastIndexOf(r,n);if(o===-1)return e;if(e[o-1]==="\\")return t.escapeLast(e,r,o-1);return`${e.slice(0,o)}\\${e.slice(o)}`};t.removePrefix=(e,t={})=>{let r=e;if(r.startsWith("./")){r=r.slice(2);t.prefix="./"}return r};t.wrapOutput=(e,t={},r={})=>{const n=r.contains?"":"^";const o=r.contains?"":"$";let s=`${n}(?:${e})${o}`;if(t.negated===true){s=`(?:^(?!${s}).*$)`}return s}},926:function(e){"use strict";e.exports=function required(e,t){t=t.split(":")[0];e=+e;if(!e)return false;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return false}return e!==0}},211:function(e,t,r){"use strict";
|
|
60
|
+
*/e.exports=function(e){if(typeof e==="number"){return e-e===0}if(typeof e==="string"&&e.trim()!==""){return Number.isFinite?Number.isFinite(+e):isFinite(+e)}return false}},4273:function(e){"use strict";e.exports=e=>{if(Object.prototype.toString.call(e)!=="[object Object]"){return false}const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}},8627:function(e,t,r){"use strict";const n=r(3837);const o=r(1570);const s=r(376);const i=r(8658);const isEmptyString=e=>e===""||e==="./";const micromatch=(e,t,r)=>{t=[].concat(t);e=[].concat(e);let n=new Set;let o=new Set;let i=new Set;let u=0;let onResult=e=>{i.add(e.output);if(r&&r.onResult){r.onResult(e)}};for(let i=0;i<t.length;i++){let a=s(String(t[i]),{...r,onResult:onResult},true);let c=a.state.negated||a.state.negatedExtglob;if(c)u++;for(let t of e){let e=a(t,true);let r=c?!e.isMatch:e.isMatch;if(!r)continue;if(c){n.add(e.output)}else{n.delete(e.output);o.add(e.output)}}}let a=u===t.length?[...i]:[...o];let c=a.filter((e=>!n.has(e)));if(r&&c.length===0){if(r.failglob===true){throw new Error(`No matches found for "${t.join(", ")}"`)}if(r.nonull===true||r.nullglob===true){return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}}return c};micromatch.match=micromatch;micromatch.matcher=(e,t)=>s(e,t);micromatch.isMatch=(e,t,r)=>s(t,r)(e);micromatch.any=micromatch.isMatch;micromatch.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set;let o=[];let onResult=e=>{if(r.onResult)r.onResult(e);o.push(e.output)};let s=new Set(micromatch(e,t,{...r,onResult:onResult}));for(let e of o){if(!s.has(e)){n.add(e)}}return[...n]};micromatch.contains=(e,t,r)=>{if(typeof e!=="string"){throw new TypeError(`Expected a string: "${n.inspect(e)}"`)}if(Array.isArray(t)){return t.some((t=>micromatch.contains(e,t,r)))}if(typeof t==="string"){if(isEmptyString(e)||isEmptyString(t)){return false}if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t)){return true}}return micromatch.isMatch(e,t,{...r,contains:true})};micromatch.matchKeys=(e,t,r)=>{if(!i.isObject(e)){throw new TypeError("Expected the first argument to be an object")}let n=micromatch(Object.keys(e),t,r);let o={};for(let t of n)o[t]=e[t];return o};micromatch.some=(e,t,r)=>{let n=[].concat(e);for(let e of[].concat(t)){let t=s(String(e),r);if(n.some((e=>t(e)))){return true}}return false};micromatch.every=(e,t,r)=>{let n=[].concat(e);for(let e of[].concat(t)){let t=s(String(e),r);if(!n.every((e=>t(e)))){return false}}return true};micromatch.all=(e,t,r)=>{if(typeof e!=="string"){throw new TypeError(`Expected a string: "${n.inspect(e)}"`)}return[].concat(t).every((t=>s(t,r)(e)))};micromatch.capture=(e,t,r)=>{let n=i.isWindows(r);let o=s.makeRe(String(e),{...r,capture:true});let u=o.exec(n?i.toPosixSlashes(t):t);if(u){return u.slice(1).map((e=>e===void 0?"":e))}};micromatch.makeRe=(...e)=>s.makeRe(...e);micromatch.scan=(...e)=>s.scan(...e);micromatch.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[])){for(let e of o(String(n),t)){r.push(s.parse(e,t))}}return r};micromatch.braces=(e,t)=>{if(typeof e!=="string")throw new TypeError("Expected a string");if(t&&t.nobrace===true||!/\{.*\}/.test(e)){return[e]}return o(e,t)};micromatch.braceExpand=(e,t)=>{if(typeof e!=="string")throw new TypeError("Expected a string");return micromatch.braces(e,{...t,expand:true})};e.exports=micromatch},376:function(e,t,r){"use strict";e.exports=r(7631)},7820:function(e,t,r){"use strict";const n=r(1017);const o="\\\\/";const s=`[^${o}]`;const i="\\.";const u="\\+";const a="\\?";const c="\\/";const l="(?=.)";const f="[^/]";const p=`(?:${c}|$)`;const h=`(?:^|${c})`;const d=`${i}{1,2}${p}`;const g=`(?!${i})`;const R=`(?!${h}${d})`;const y=`(?!${i}{0,1}${p})`;const _=`(?!${d})`;const v=`[^.${c}]`;const E=`${f}*?`;const x={DOT_LITERAL:i,PLUS_LITERAL:u,QMARK_LITERAL:a,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:f,END_ANCHOR:p,DOTS_SLASH:d,NO_DOT:g,NO_DOTS:R,NO_DOT_SLASH:y,NO_DOTS_SLASH:_,QMARK_NO_DOT:v,STAR:E,START_ANCHOR:h};const A={...x,SLASH_LITERAL:`[${o}]`,QMARK:s,STAR:`${s}*?`,DOTS_SLASH:`${i}{1,2}(?:[${o}]|$)`,NO_DOT:`(?!${i})`,NO_DOTS:`(?!(?:^|[${o}])${i}{1,2}(?:[${o}]|$))`,NO_DOT_SLASH:`(?!${i}{0,1}(?:[${o}]|$))`,NO_DOTS_SLASH:`(?!${i}{1,2}(?:[${o}]|$))`,QMARK_NO_DOT:`[^.${o}]`,START_ANCHOR:`(?:^|[${o}])`,END_ANCHOR:`(?:[${o}]|$)`};const m={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};e.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:m,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:n.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===true?A:x}}},6986:function(e,t,r){"use strict";const n=r(7820);const o=r(8658);const{MAX_LENGTH:s,POSIX_REGEX_SOURCE:i,REGEX_NON_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:c}=n;const expandRange=(e,t)=>{if(typeof t.expandRange==="function"){return t.expandRange(...e,t)}e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map((e=>o.escapeRegex(e))).join("..")}return r};const syntaxError=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`;const parse=(e,t)=>{if(typeof e!=="string"){throw new TypeError("Expected a string")}e=c[e]||e;const r={...t};const l=typeof r.maxLength==="number"?Math.min(s,r.maxLength):s;let f=e.length;if(f>l){throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${l}`)}const p={type:"bos",value:"",output:r.prepend||""};const h=[p];const d=r.capture?"":"?:";const g=o.isWindows(t);const R=n.globChars(g);const y=n.extglobChars(R);const{DOT_LITERAL:_,PLUS_LITERAL:v,SLASH_LITERAL:E,ONE_CHAR:x,DOTS_SLASH:A,NO_DOT:m,NO_DOT_SLASH:b,NO_DOTS_SLASH:w,QMARK:C,QMARK_NO_DOT:S,STAR:H,START_ANCHOR:O}=R;const globstar=e=>`(${d}(?:(?!${O}${e.dot?A:_}).)*?)`;const T=r.dot?"":m;const P=r.dot?C:S;let L=r.bash===true?globstar(r):H;if(r.capture){L=`(${L})`}if(typeof r.noext==="boolean"){r.noextglob=r.noext}const $={input:e,index:-1,start:0,dot:r.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:h};e=o.removePrefix(e,$);f=e.length;const k=[];const N=[];const M=[];let I=p;let B;const eos=()=>$.index===f-1;const q=$.peek=(t=1)=>e[$.index+t];const j=$.advance=()=>e[++$.index]||"";const remaining=()=>e.slice($.index+1);const consume=(e="",t=0)=>{$.consumed+=e;$.index+=t};const append=e=>{$.output+=e.output!=null?e.output:e.value;consume(e.value)};const negate=()=>{let e=1;while(q()==="!"&&(q(2)!=="("||q(3)==="?")){j();$.start++;e++}if(e%2===0){return false}$.negated=true;$.start++;return true};const increment=e=>{$[e]++;M.push(e)};const decrement=e=>{$[e]--;M.pop()};const push=e=>{if(I.type==="globstar"){const t=$.braces>0&&(e.type==="comma"||e.type==="brace");const r=e.extglob===true||k.length&&(e.type==="pipe"||e.type==="paren");if(e.type!=="slash"&&e.type!=="paren"&&!t&&!r){$.output=$.output.slice(0,-I.output.length);I.type="star";I.value="*";I.output=L;$.output+=I.output}}if(k.length&&e.type!=="paren"){k[k.length-1].inner+=e.value}if(e.value||e.output)append(e);if(I&&I.type==="text"&&e.type==="text"){I.value+=e.value;I.output=(I.output||"")+e.value;return}e.prev=I;h.push(e);I=e};const extglobOpen=(e,t)=>{const n={...y[t],conditions:1,inner:""};n.prev=I;n.parens=$.parens;n.output=$.output;const o=(r.capture?"(":"")+n.open;increment("parens");push({type:e,value:t,output:$.output?"":x});push({type:"paren",extglob:true,value:j(),output:o});k.push(n)};const extglobClose=e=>{let n=e.close+(r.capture?")":"");let o;if(e.type==="negate"){let s=L;if(e.inner&&e.inner.length>1&&e.inner.includes("/")){s=globstar(r)}if(s!==L||eos()||/^\)+$/.test(remaining())){n=e.close=`)$))${s}`}if(e.inner.includes("*")&&(o=remaining())&&/^\.[^\\/.]+$/.test(o)){const r=parse(o,{...t,fastpaths:false}).output;n=e.close=`)${r})${s})`}if(e.prev.type==="bos"){$.negatedExtglob=true}}push({type:"paren",extglob:true,value:B,output:n});decrement("parens")};if(r.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=false;let s=e.replace(a,((e,t,r,o,s,i)=>{if(o==="\\"){n=true;return e}if(o==="?"){if(t){return t+o+(s?C.repeat(s.length):"")}if(i===0){return P+(s?C.repeat(s.length):"")}return C.repeat(r.length)}if(o==="."){return _.repeat(r.length)}if(o==="*"){if(t){return t+o+(s?L:"")}return L}return t?e:`\\${e}`}));if(n===true){if(r.unescape===true){s=s.replace(/\\/g,"")}else{s=s.replace(/\\+/g,(e=>e.length%2===0?"\\\\":e?"\\":""))}}if(s===e&&r.contains===true){$.output=e;return $}$.output=o.wrapOutput(s,$,t);return $}while(!eos()){B=j();if(B==="\0"){continue}if(B==="\\"){const e=q();if(e==="/"&&r.bash!==true){continue}if(e==="."||e===";"){continue}if(!e){B+="\\";push({type:"text",value:B});continue}const t=/^\\+/.exec(remaining());let n=0;if(t&&t[0].length>2){n=t[0].length;$.index+=n;if(n%2!==0){B+="\\"}}if(r.unescape===true){B=j()}else{B+=j()}if($.brackets===0){push({type:"text",value:B});continue}}if($.brackets>0&&(B!=="]"||I.value==="["||I.value==="[^")){if(r.posix!==false&&B===":"){const e=I.value.slice(1);if(e.includes("[")){I.posix=true;if(e.includes(":")){const e=I.value.lastIndexOf("[");const t=I.value.slice(0,e);const r=I.value.slice(e+2);const n=i[r];if(n){I.value=t+n;$.backtrack=true;j();if(!p.output&&h.indexOf(I)===1){p.output=x}continue}}}}if(B==="["&&q()!==":"||B==="-"&&q()==="]"){B=`\\${B}`}if(B==="]"&&(I.value==="["||I.value==="[^")){B=`\\${B}`}if(r.posix===true&&B==="!"&&I.value==="["){B="^"}I.value+=B;append({value:B});continue}if($.quotes===1&&B!=='"'){B=o.escapeRegex(B);I.value+=B;append({value:B});continue}if(B==='"'){$.quotes=$.quotes===1?0:1;if(r.keepQuotes===true){push({type:"text",value:B})}continue}if(B==="("){increment("parens");push({type:"paren",value:B});continue}if(B===")"){if($.parens===0&&r.strictBrackets===true){throw new SyntaxError(syntaxError("opening","("))}const e=k[k.length-1];if(e&&$.parens===e.parens+1){extglobClose(k.pop());continue}push({type:"paren",value:B,output:$.parens?")":"\\)"});decrement("parens");continue}if(B==="["){if(r.nobracket===true||!remaining().includes("]")){if(r.nobracket!==true&&r.strictBrackets===true){throw new SyntaxError(syntaxError("closing","]"))}B=`\\${B}`}else{increment("brackets")}push({type:"bracket",value:B});continue}if(B==="]"){if(r.nobracket===true||I&&I.type==="bracket"&&I.value.length===1){push({type:"text",value:B,output:`\\${B}`});continue}if($.brackets===0){if(r.strictBrackets===true){throw new SyntaxError(syntaxError("opening","["))}push({type:"text",value:B,output:`\\${B}`});continue}decrement("brackets");const e=I.value.slice(1);if(I.posix!==true&&e[0]==="^"&&!e.includes("/")){B=`/${B}`}I.value+=B;append({value:B});if(r.literalBrackets===false||o.hasRegexChars(e)){continue}const t=o.escapeRegex(I.value);$.output=$.output.slice(0,-I.value.length);if(r.literalBrackets===true){$.output+=t;I.value=t;continue}I.value=`(${d}${t}|${I.value})`;$.output+=I.value;continue}if(B==="{"&&r.nobrace!==true){increment("braces");const e={type:"brace",value:B,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};N.push(e);push(e);continue}if(B==="}"){const e=N[N.length-1];if(r.nobrace===true||!e){push({type:"text",value:B,output:B});continue}let t=")";if(e.dots===true){const e=h.slice();const n=[];for(let t=e.length-1;t>=0;t--){h.pop();if(e[t].type==="brace"){break}if(e[t].type!=="dots"){n.unshift(e[t].value)}}t=expandRange(n,r);$.backtrack=true}if(e.comma!==true&&e.dots!==true){const r=$.output.slice(0,e.outputIndex);const n=$.tokens.slice(e.tokensIndex);e.value=e.output="\\{";B=t="\\}";$.output=r;for(const e of n){$.output+=e.output||e.value}}push({type:"brace",value:B,output:t});decrement("braces");N.pop();continue}if(B==="|"){if(k.length>0){k[k.length-1].conditions++}push({type:"text",value:B});continue}if(B===","){let e=B;const t=N[N.length-1];if(t&&M[M.length-1]==="braces"){t.comma=true;e="|"}push({type:"comma",value:B,output:e});continue}if(B==="/"){if(I.type==="dot"&&$.index===$.start+1){$.start=$.index+1;$.consumed="";$.output="";h.pop();I=p;continue}push({type:"slash",value:B,output:E});continue}if(B==="."){if($.braces>0&&I.type==="dot"){if(I.value===".")I.output=_;const e=N[N.length-1];I.type="dots";I.output+=B;I.value+=B;e.dots=true;continue}if($.braces+$.parens===0&&I.type!=="bos"&&I.type!=="slash"){push({type:"text",value:B,output:_});continue}push({type:"dot",value:B,output:_});continue}if(B==="?"){const e=I&&I.value==="(";if(!e&&r.noextglob!==true&&q()==="("&&q(2)!=="?"){extglobOpen("qmark",B);continue}if(I&&I.type==="paren"){const e=q();let t=B;if(e==="<"&&!o.supportsLookbehinds()){throw new Error("Node.js v10 or higher is required for regex lookbehinds")}if(I.value==="("&&!/[!=<:]/.test(e)||e==="<"&&!/<([!=]|\w+>)/.test(remaining())){t=`\\${B}`}push({type:"text",value:B,output:t});continue}if(r.dot!==true&&(I.type==="slash"||I.type==="bos")){push({type:"qmark",value:B,output:S});continue}push({type:"qmark",value:B,output:C});continue}if(B==="!"){if(r.noextglob!==true&&q()==="("){if(q(2)!=="?"||!/[!=<:]/.test(q(3))){extglobOpen("negate",B);continue}}if(r.nonegate!==true&&$.index===0){negate();continue}}if(B==="+"){if(r.noextglob!==true&&q()==="("&&q(2)!=="?"){extglobOpen("plus",B);continue}if(I&&I.value==="("||r.regex===false){push({type:"plus",value:B,output:v});continue}if(I&&(I.type==="bracket"||I.type==="paren"||I.type==="brace")||$.parens>0){push({type:"plus",value:B});continue}push({type:"plus",value:v});continue}if(B==="@"){if(r.noextglob!==true&&q()==="("&&q(2)!=="?"){push({type:"at",extglob:true,value:B,output:""});continue}push({type:"text",value:B});continue}if(B!=="*"){if(B==="$"||B==="^"){B=`\\${B}`}const e=u.exec(remaining());if(e){B+=e[0];$.index+=e[0].length}push({type:"text",value:B});continue}if(I&&(I.type==="globstar"||I.star===true)){I.type="star";I.star=true;I.value+=B;I.output=L;$.backtrack=true;$.globstar=true;consume(B);continue}let t=remaining();if(r.noextglob!==true&&/^\([^?]/.test(t)){extglobOpen("star",B);continue}if(I.type==="star"){if(r.noglobstar===true){consume(B);continue}const n=I.prev;const o=n.prev;const s=n.type==="slash"||n.type==="bos";const i=o&&(o.type==="star"||o.type==="globstar");if(r.bash===true&&(!s||t[0]&&t[0]!=="/")){push({type:"star",value:B,output:""});continue}const u=$.braces>0&&(n.type==="comma"||n.type==="brace");const a=k.length&&(n.type==="pipe"||n.type==="paren");if(!s&&n.type!=="paren"&&!u&&!a){push({type:"star",value:B,output:""});continue}while(t.slice(0,3)==="/**"){const r=e[$.index+4];if(r&&r!=="/"){break}t=t.slice(3);consume("/**",3)}if(n.type==="bos"&&eos()){I.type="globstar";I.value+=B;I.output=globstar(r);$.output=I.output;$.globstar=true;consume(B);continue}if(n.type==="slash"&&n.prev.type!=="bos"&&!i&&eos()){$.output=$.output.slice(0,-(n.output+I.output).length);n.output=`(?:${n.output}`;I.type="globstar";I.output=globstar(r)+(r.strictSlashes?")":"|$)");I.value+=B;$.globstar=true;$.output+=n.output+I.output;consume(B);continue}if(n.type==="slash"&&n.prev.type!=="bos"&&t[0]==="/"){const e=t[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(n.output+I.output).length);n.output=`(?:${n.output}`;I.type="globstar";I.output=`${globstar(r)}${E}|${E}${e})`;I.value+=B;$.output+=n.output+I.output;$.globstar=true;consume(B+j());push({type:"slash",value:"/",output:""});continue}if(n.type==="bos"&&t[0]==="/"){I.type="globstar";I.value+=B;I.output=`(?:^|${E}|${globstar(r)}${E})`;$.output=I.output;$.globstar=true;consume(B+j());push({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-I.output.length);I.type="globstar";I.output=globstar(r);I.value+=B;$.output+=I.output;$.globstar=true;consume(B);continue}const n={type:"star",value:B,output:L};if(r.bash===true){n.output=".*?";if(I.type==="bos"||I.type==="slash"){n.output=T+n.output}push(n);continue}if(I&&(I.type==="bracket"||I.type==="paren")&&r.regex===true){n.output=B;push(n);continue}if($.index===$.start||I.type==="slash"||I.type==="dot"){if(I.type==="dot"){$.output+=b;I.output+=b}else if(r.dot===true){$.output+=w;I.output+=w}else{$.output+=T;I.output+=T}if(q()!=="*"){$.output+=x;I.output+=x}}push(n)}while($.brackets>0){if(r.strictBrackets===true)throw new SyntaxError(syntaxError("closing","]"));$.output=o.escapeLast($.output,"[");decrement("brackets")}while($.parens>0){if(r.strictBrackets===true)throw new SyntaxError(syntaxError("closing",")"));$.output=o.escapeLast($.output,"(");decrement("parens")}while($.braces>0){if(r.strictBrackets===true)throw new SyntaxError(syntaxError("closing","}"));$.output=o.escapeLast($.output,"{");decrement("braces")}if(r.strictSlashes!==true&&(I.type==="star"||I.type==="bracket")){push({type:"maybe_slash",value:"",output:`${E}?`})}if($.backtrack===true){$.output="";for(const e of $.tokens){$.output+=e.output!=null?e.output:e.value;if(e.suffix){$.output+=e.suffix}}}return $};parse.fastpaths=(e,t)=>{const r={...t};const i=typeof r.maxLength==="number"?Math.min(s,r.maxLength):s;const u=e.length;if(u>i){throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${i}`)}e=c[e]||e;const a=o.isWindows(t);const{DOT_LITERAL:l,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:h,NO_DOT:d,NO_DOTS:g,NO_DOTS_SLASH:R,STAR:y,START_ANCHOR:_}=n.globChars(a);const v=r.dot?g:d;const E=r.dot?R:d;const x=r.capture?"":"?:";const A={negated:false,prefix:""};let m=r.bash===true?".*?":y;if(r.capture){m=`(${m})`}const globstar=e=>{if(e.noglobstar===true)return m;return`(${x}(?:(?!${_}${e.dot?h:l}).)*?)`};const create=e=>{switch(e){case"*":return`${v}${p}${m}`;case".*":return`${l}${p}${m}`;case"*.*":return`${v}${m}${l}${p}${m}`;case"*/*":return`${v}${m}${f}${p}${E}${m}`;case"**":return v+globstar(r);case"**/*":return`(?:${v}${globstar(r)}${f})?${E}${p}${m}`;case"**/*.*":return`(?:${v}${globstar(r)}${f})?${E}${m}${l}${p}${m}`;case"**/.*":return`(?:${v}${globstar(r)}${f})?${l}${p}${m}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=create(t[1]);if(!r)return;return r+l+t[2]}}};const b=o.removePrefix(e,A);let w=create(b);if(w&&r.strictSlashes!==true){w+=`${f}?`}return w};e.exports=parse},7631:function(e,t,r){"use strict";const n=r(1017);const o=r(8640);const s=r(6986);const i=r(8658);const u=r(7820);const isObject=e=>e&&typeof e==="object"&&!Array.isArray(e);const picomatch=(e,t,r=false)=>{if(Array.isArray(e)){const n=e.map((e=>picomatch(e,t,r)));const arrayMatcher=e=>{for(const t of n){const r=t(e);if(r)return r}return false};return arrayMatcher}const n=isObject(e)&&e.tokens&&e.input;if(e===""||typeof e!=="string"&&!n){throw new TypeError("Expected pattern to be a non-empty string")}const o=t||{};const s=i.isWindows(t);const u=n?picomatch.compileRe(e,t):picomatch.makeRe(e,t,false,true);const a=u.state;delete u.state;let isIgnored=()=>false;if(o.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch(o.ignore,e,r)}const matcher=(r,n=false)=>{const{isMatch:i,match:c,output:l}=picomatch.test(r,u,t,{glob:e,posix:s});const f={glob:e,state:a,regex:u,posix:s,input:r,output:l,match:c,isMatch:i};if(typeof o.onResult==="function"){o.onResult(f)}if(i===false){f.isMatch=false;return n?f:false}if(isIgnored(r)){if(typeof o.onIgnore==="function"){o.onIgnore(f)}f.isMatch=false;return n?f:false}if(typeof o.onMatch==="function"){o.onMatch(f)}return n?f:true};if(r){matcher.state=a}return matcher};picomatch.test=(e,t,r,{glob:n,posix:o}={})=>{if(typeof e!=="string"){throw new TypeError("Expected input to be a string")}if(e===""){return{isMatch:false,output:""}}const s=r||{};const u=s.format||(o?i.toPosixSlashes:null);let a=e===n;let c=a&&u?u(e):e;if(a===false){c=u?u(e):e;a=c===n}if(a===false||s.capture===true){if(s.matchBase===true||s.basename===true){a=picomatch.matchBase(e,t,r,o)}else{a=t.exec(c)}}return{isMatch:Boolean(a),match:a,output:c}};picomatch.matchBase=(e,t,r,o=i.isWindows(r))=>{const s=t instanceof RegExp?t:picomatch.makeRe(t,r);return s.test(n.basename(e))};picomatch.isMatch=(e,t,r)=>picomatch(t,r)(e);picomatch.parse=(e,t)=>{if(Array.isArray(e))return e.map((e=>picomatch.parse(e,t)));return s(e,{...t,fastpaths:false})};picomatch.scan=(e,t)=>o(e,t);picomatch.compileRe=(e,t,r=false,n=false)=>{if(r===true){return e.output}const o=t||{};const s=o.contains?"":"^";const i=o.contains?"":"$";let u=`${s}(?:${e.output})${i}`;if(e&&e.negated===true){u=`^(?!${u}).*$`}const a=picomatch.toRegex(u,t);if(n===true){a.state=e}return a};picomatch.makeRe=(e,t={},r=false,n=false)=>{if(!e||typeof e!=="string"){throw new TypeError("Expected a non-empty string")}let o={negated:false,fastpaths:true};if(t.fastpaths!==false&&(e[0]==="."||e[0]==="*")){o.output=s.fastpaths(e,t)}if(!o.output){o=s(e,t)}return picomatch.compileRe(o,t,r,n)};picomatch.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&t.debug===true)throw e;return/$^/}};picomatch.constants=u;e.exports=picomatch},8640:function(e,t,r){"use strict";const n=r(8658);const{CHAR_ASTERISK:o,CHAR_AT:s,CHAR_BACKWARD_SLASH:i,CHAR_COMMA:u,CHAR_DOT:a,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:f,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:d,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:R,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:_}=r(7820);const isPathSeparator=e=>e===l||e===i;const depth=e=>{if(e.isPrefix!==true){e.depth=e.isGlobstar?Infinity:1}};const scan=(e,t)=>{const r=t||{};const v=e.length-1;const E=r.parts===true||r.scanToEnd===true;const x=[];const A=[];const m=[];let b=e;let w=-1;let C=0;let S=0;let H=false;let O=false;let T=false;let P=false;let L=false;let $=false;let k=false;let N=false;let M=false;let I=false;let B=0;let q;let j;let G={value:"",depth:0,isGlob:false};const eos=()=>w>=v;const peek=()=>b.charCodeAt(w+1);const advance=()=>{q=j;return b.charCodeAt(++w)};while(w<v){j=advance();let e;if(j===i){k=G.backslashes=true;j=advance();if(j===f){$=true}continue}if($===true||j===f){B++;while(eos()!==true&&(j=advance())){if(j===i){k=G.backslashes=true;advance();continue}if(j===f){B++;continue}if($!==true&&j===a&&(j=advance())===a){H=G.isBrace=true;T=G.isGlob=true;I=true;if(E===true){continue}break}if($!==true&&j===u){H=G.isBrace=true;T=G.isGlob=true;I=true;if(E===true){continue}break}if(j===R){B--;if(B===0){$=false;H=G.isBrace=true;I=true;break}}}if(E===true){continue}break}if(j===l){x.push(w);A.push(G);G={value:"",depth:0,isGlob:false};if(I===true)continue;if(q===a&&w===C+1){C+=2;continue}S=w+1;continue}if(r.noext!==true){const e=j===d||j===s||j===o||j===g||j===c;if(e===true&&peek()===p){T=G.isGlob=true;P=G.isExtglob=true;I=true;if(j===c&&w===C){M=true}if(E===true){while(eos()!==true&&(j=advance())){if(j===i){k=G.backslashes=true;j=advance();continue}if(j===y){T=G.isGlob=true;I=true;break}}continue}break}}if(j===o){if(q===o)L=G.isGlobstar=true;T=G.isGlob=true;I=true;if(E===true){continue}break}if(j===g){T=G.isGlob=true;I=true;if(E===true){continue}break}if(j===h){while(eos()!==true&&(e=advance())){if(e===i){k=G.backslashes=true;advance();continue}if(e===_){O=G.isBracket=true;T=G.isGlob=true;I=true;break}}if(E===true){continue}break}if(r.nonegate!==true&&j===c&&w===C){N=G.negated=true;C++;continue}if(r.noparen!==true&&j===p){T=G.isGlob=true;if(E===true){while(eos()!==true&&(j=advance())){if(j===p){k=G.backslashes=true;j=advance();continue}if(j===y){I=true;break}}continue}break}if(T===true){I=true;if(E===true){continue}break}}if(r.noext===true){P=false;T=false}let U=b;let D="";let F="";if(C>0){D=b.slice(0,C);b=b.slice(C);S-=C}if(U&&T===true&&S>0){U=b.slice(0,S);F=b.slice(S)}else if(T===true){U="";F=b}else{U=b}if(U&&U!==""&&U!=="/"&&U!==b){if(isPathSeparator(U.charCodeAt(U.length-1))){U=U.slice(0,-1)}}if(r.unescape===true){if(F)F=n.removeBackslashes(F);if(U&&k===true){U=n.removeBackslashes(U)}}const K={prefix:D,input:e,start:C,base:U,glob:F,isBrace:H,isBracket:O,isGlob:T,isExtglob:P,isGlobstar:L,negated:N,negatedExtglob:M};if(r.tokens===true){K.maxDepth=0;if(!isPathSeparator(j)){A.push(G)}K.tokens=A}if(r.parts===true||r.tokens===true){let t;for(let n=0;n<x.length;n++){const o=t?t+1:C;const s=x[n];const i=e.slice(o,s);if(r.tokens){if(n===0&&C!==0){A[n].isPrefix=true;A[n].value=D}else{A[n].value=i}depth(A[n]);K.maxDepth+=A[n].depth}if(n!==0||i!==""){m.push(i)}t=s}if(t&&t+1<e.length){const n=e.slice(t+1);m.push(n);if(r.tokens){A[A.length-1].value=n;depth(A[A.length-1]);K.maxDepth+=A[A.length-1].depth}}K.slashes=x;K.parts=m}return K};e.exports=scan},8658:function(e,t,r){"use strict";const n=r(1017);const o=process.platform==="win32";const{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_GLOBAL:a}=r(7820);t.isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);t.hasRegexChars=e=>u.test(e);t.isRegexChar=e=>e.length===1&&t.hasRegexChars(e);t.escapeRegex=e=>e.replace(a,"\\$1");t.toPosixSlashes=e=>e.replace(s,"/");t.removeBackslashes=e=>e.replace(i,(e=>e==="\\"?"":e));t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);if(e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10){return true}return false};t.isWindows=e=>{if(e&&typeof e.windows==="boolean"){return e.windows}return o===true||n.sep==="\\"};t.escapeLast=(e,r,n)=>{const o=e.lastIndexOf(r,n);if(o===-1)return e;if(e[o-1]==="\\")return t.escapeLast(e,r,o-1);return`${e.slice(0,o)}\\${e.slice(o)}`};t.removePrefix=(e,t={})=>{let r=e;if(r.startsWith("./")){r=r.slice(2);t.prefix="./"}return r};t.wrapOutput=(e,t={},r={})=>{const n=r.contains?"":"^";const o=r.contains?"":"$";let s=`${n}(?:${e})${o}`;if(t.negated===true){s=`(?:^(?!${s}).*$)`}return s}},926:function(e){"use strict";e.exports=function required(e,t){t=t.split(":")[0];e=+e;if(!e)return false;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return false}return e!==0}},211:function(e,t,r){"use strict";
|
|
61
61
|
/*!
|
|
62
62
|
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
63
63
|
*
|
|
64
64
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
65
65
|
* Released under the MIT License.
|
|
66
|
-
*/const n=r(8387);const toRegexRange=(e,t,r)=>{if(n(e)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(t===void 0||e===t){return String(e)}if(n(t)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let o={relaxZeros:true,...r};if(typeof o.strictZeros==="boolean"){o.relaxZeros=o.strictZeros===false}let s=String(o.relaxZeros);let i=String(o.shorthand);let u=String(o.capture);let a=String(o.wrap);let c=e+":"+t+"="+s+i+u+a;if(toRegexRange.cache.hasOwnProperty(c)){return toRegexRange.cache[c].result}let l=Math.min(e,t);let f=Math.max(e,t);if(Math.abs(l-f)===1){let r=e+"|"+t;if(o.capture){return`(${r})`}if(o.wrap===false){return r}return`(?:${r})`}let p=hasPadding(e)||hasPadding(t);let h={min:e,max:t,a:l,b:f};let d=[];let g=[];if(p){h.isPadded=p;h.maxLen=String(h.max).length}if(l<0){let e=f<0?Math.abs(f):1;g=splitToPatterns(e,Math.abs(l),h,o);l=h.a=0}if(f>=0){d=splitToPatterns(l,f,h,o)}h.negatives=g;h.positives=d;h.result=collatePatterns(g,d,o);if(o.capture===true){h.result=`(${h.result})`}else if(o.wrap!==false&&d.length+g.length>1){h.result=`(?:${h.result})`}toRegexRange.cache[c]=h;return h.result};function collatePatterns(e,t,r){let n=filterPatterns(e,t,"-",false,r)||[];let o=filterPatterns(t,e,"",false,r)||[];let s=filterPatterns(e,t,"-?",true,r)||[];let i=n.concat(s).concat(o);return i.join("|")}function splitToRanges(e,t){let r=1;let n=1;let o=countNines(e,r);let s=new Set([t]);while(e<=o&&o<=t){s.add(o);r+=1;o=countNines(e,r)}o=countZeros(t+1,n)-1;while(e<o&&o<=t){s.add(o);n+=1;o=countZeros(t+1,n)-1}s=[...s];s.sort(compare);return s}function rangeToPattern(e,t,r){if(e===t){return{pattern:e,count:[],digits:0}}let n=zip(e,t);let o=n.length;let s="";let i=0;for(let e=0;e<o;e++){let[t,o]=n[e];if(t===o){s+=t}else if(t!=="0"||o!=="9"){s+=toCharacterClass(t,o,r)}else{i++}}if(i){s+=r.shorthand===true?"\\d":"[0-9]"}return{pattern:s,count:[i],digits:o}}function splitToPatterns(e,t,r,n){let o=splitToRanges(e,t);let s=[];let i=e;let u;for(let e=0;e<o.length;e++){let t=o[e];let a=rangeToPattern(String(i),String(t),n);let c="";if(!r.isPadded&&u&&u.pattern===a.pattern){if(u.count.length>1){u.count.pop()}u.count.push(a.count[0]);u.string=u.pattern+toQuantifier(u.count);i=t+1;continue}if(r.isPadded){c=padZeros(t,r,n)}a.string=c+a.pattern+toQuantifier(a.count);s.push(a);i=t+1;u=a}return s}function filterPatterns(e,t,r,n,o){let s=[];for(let o of e){let{string:e}=o;if(!n&&!contains(t,"string",e)){s.push(r+e)}if(n&&contains(t,"string",e)){s.push(r+e)}}return s}function zip(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function compare(e,t){return e>t?1:t>e?-1:0}function contains(e,t,r){return e.some((e=>e[t]===r))}function countNines(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function countZeros(e,t){return e-e%Math.pow(10,t)}function toQuantifier(e){let[t=0,r=""]=e;if(r||t>1){return`{${t+(r?","+r:"")}}`}return""}function toCharacterClass(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function hasPadding(e){return/^-?(0+)\d/.test(e)}function padZeros(e,t,r){if(!t.isPadded){return e}let n=Math.abs(t.maxLen-String(e).length);let o=r.relaxZeros!==false;switch(n){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:{return o?`0{0,${n}}`:`0{${n}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};e.exports=toRegexRange},4755:function(e){"use strict";e.exports=require("@umijs/utils/compiled/debug")},9491:function(e){"use strict";e.exports=require("assert")},3685:function(e){"use strict";e.exports=require("http")},5687:function(e){"use strict";e.exports=require("https")},1017:function(e){"use strict";e.exports=require("path")},3477:function(e){"use strict";e.exports=require("querystring")},2781:function(e){"use strict";e.exports=require("stream")},7310:function(e){"use strict";e.exports=require("url")},3837:function(e){"use strict";e.exports=require("util")},9796:function(e){"use strict";e.exports=require("zlib")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var o=t[r]={exports:{}};var s=true;try{e[r].call(o.exports,o,o.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(
|
|
66
|
+
*/const n=r(8387);const toRegexRange=(e,t,r)=>{if(n(e)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(t===void 0||e===t){return String(e)}if(n(t)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let o={relaxZeros:true,...r};if(typeof o.strictZeros==="boolean"){o.relaxZeros=o.strictZeros===false}let s=String(o.relaxZeros);let i=String(o.shorthand);let u=String(o.capture);let a=String(o.wrap);let c=e+":"+t+"="+s+i+u+a;if(toRegexRange.cache.hasOwnProperty(c)){return toRegexRange.cache[c].result}let l=Math.min(e,t);let f=Math.max(e,t);if(Math.abs(l-f)===1){let r=e+"|"+t;if(o.capture){return`(${r})`}if(o.wrap===false){return r}return`(?:${r})`}let p=hasPadding(e)||hasPadding(t);let h={min:e,max:t,a:l,b:f};let d=[];let g=[];if(p){h.isPadded=p;h.maxLen=String(h.max).length}if(l<0){let e=f<0?Math.abs(f):1;g=splitToPatterns(e,Math.abs(l),h,o);l=h.a=0}if(f>=0){d=splitToPatterns(l,f,h,o)}h.negatives=g;h.positives=d;h.result=collatePatterns(g,d,o);if(o.capture===true){h.result=`(${h.result})`}else if(o.wrap!==false&&d.length+g.length>1){h.result=`(?:${h.result})`}toRegexRange.cache[c]=h;return h.result};function collatePatterns(e,t,r){let n=filterPatterns(e,t,"-",false,r)||[];let o=filterPatterns(t,e,"",false,r)||[];let s=filterPatterns(e,t,"-?",true,r)||[];let i=n.concat(s).concat(o);return i.join("|")}function splitToRanges(e,t){let r=1;let n=1;let o=countNines(e,r);let s=new Set([t]);while(e<=o&&o<=t){s.add(o);r+=1;o=countNines(e,r)}o=countZeros(t+1,n)-1;while(e<o&&o<=t){s.add(o);n+=1;o=countZeros(t+1,n)-1}s=[...s];s.sort(compare);return s}function rangeToPattern(e,t,r){if(e===t){return{pattern:e,count:[],digits:0}}let n=zip(e,t);let o=n.length;let s="";let i=0;for(let e=0;e<o;e++){let[t,o]=n[e];if(t===o){s+=t}else if(t!=="0"||o!=="9"){s+=toCharacterClass(t,o,r)}else{i++}}if(i){s+=r.shorthand===true?"\\d":"[0-9]"}return{pattern:s,count:[i],digits:o}}function splitToPatterns(e,t,r,n){let o=splitToRanges(e,t);let s=[];let i=e;let u;for(let e=0;e<o.length;e++){let t=o[e];let a=rangeToPattern(String(i),String(t),n);let c="";if(!r.isPadded&&u&&u.pattern===a.pattern){if(u.count.length>1){u.count.pop()}u.count.push(a.count[0]);u.string=u.pattern+toQuantifier(u.count);i=t+1;continue}if(r.isPadded){c=padZeros(t,r,n)}a.string=c+a.pattern+toQuantifier(a.count);s.push(a);i=t+1;u=a}return s}function filterPatterns(e,t,r,n,o){let s=[];for(let o of e){let{string:e}=o;if(!n&&!contains(t,"string",e)){s.push(r+e)}if(n&&contains(t,"string",e)){s.push(r+e)}}return s}function zip(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function compare(e,t){return e>t?1:t>e?-1:0}function contains(e,t,r){return e.some((e=>e[t]===r))}function countNines(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function countZeros(e,t){return e-e%Math.pow(10,t)}function toQuantifier(e){let[t=0,r=""]=e;if(r||t>1){return`{${t+(r?","+r:"")}}`}return""}function toCharacterClass(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function hasPadding(e){return/^-?(0+)\d/.test(e)}function padZeros(e,t,r){if(!t.isPadded){return e}let n=Math.abs(t.maxLen-String(e).length);let o=r.relaxZeros!==false;switch(n){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:{return o?`0{0,${n}}`:`0{${n}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};e.exports=toRegexRange},4755:function(e){"use strict";e.exports=require("@umijs/utils/compiled/debug")},9491:function(e){"use strict";e.exports=require("assert")},3685:function(e){"use strict";e.exports=require("http")},5687:function(e){"use strict";e.exports=require("https")},1017:function(e){"use strict";e.exports=require("path")},3477:function(e){"use strict";e.exports=require("querystring")},2781:function(e){"use strict";e.exports=require("stream")},7310:function(e){"use strict";e.exports=require("url")},3837:function(e){"use strict";e.exports=require("util")},9796:function(e){"use strict";e.exports=require("zlib")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var o=t[r]={exports:{}};var s=true;try{e[r].call(o.exports,o,o.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(7059);module.exports=r})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"http-proxy-middleware","version":"2.0.
|
|
1
|
+
{"name":"http-proxy-middleware","version":"2.0.6","author":"Steven Chim","license":"MIT","types":"dist/index.d.ts"}
|