318 lines
684 KiB
JavaScript
318 lines
684 KiB
JavaScript
|
"use strict";var e=require("obsidian"),n=require("crypto"),t=require("path"),a=require("tty"),i=require("util"),o=require("fs"),r=require("net"),s=require("events"),c=require("stream"),p=require("zlib"),l=require("buffer"),u=require("string_decoder"),d=require("querystring"),f=require("url"),m=require("http");function v(e){var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}var h=v(e);const g={port:8080,hostname:"0.0.0.0",defaultFile:"",startOnLoad:!1,useRibbonButons:!0,indexHtml:'<html>\n<head>\n <meta charset="utf-8">\n <meta name="viewport"\n content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">\n <title>#VAR{HTML_TITLE}</title>\n <link rel="shortcut icon" href="#VAR{FAVICON_URL}">\n <link href="#VAR{CSS_FILE_URL}" type="text/css" rel="stylesheet">\n</head>\n<body\n class="#VAR{THEME_MODE} mod-windows is-frameless is-maximized is-hidden-frameless obsidian-app show-inline-title show-view-header"\n style="--zoom-factor:1; --font-text-size:16px;">\n <div class="app-container">\n <div class="horizontal-main-container">\n <div class="workspace">\n <div class="workspace-split mod-vertical mod-root">\n <div class="workspace-tabs mod-top mod-top-left-space mod-top-right-space">\n <div class="workspace-tab-container">\n <div class="workspace-leaf">\n <div class="workspace-leaf-content" data-type="markdown" data-mode="preview">\n <div class="view-content">\n <div class="markdown-reading-view" style="width: 100%; height: 100%;">\n <div\n class="markdown-preview-view markdown-rendered node-insert-event is-readable-line-width allow-fold-headings show-indentation-guide allow-fold-lists"\n tabindex="-1" style="tab-size: 4;">\n <div class="markdown-preview-sizer markdown-preview-section" style="padding-bottom: 369px; min-height: 1158px;">\n <div class="markdown-preview-pusher" style="width: 1px; height: 0.1px; margin-bottom: 0px;"></div>\n <div class="mod-header">\n <div class="inline-title" contenteditable="true" spellcheck="false" tabindex="-1" enterkeyhint="done">#VAR{RENDERED_CONTENT_FILE_NAME}\n </div>\n #VAR{RENDERED_CONTENT}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</body>\n</html>',htmlReplaceableVariables:[{varName:"HTML_TITLE",varValue:"Obsidian Html Server"},{varName:"FAVICON_URL",varValue:"//obsidian.md/favicon.ico"},{varName:"CSS_FILE_URL",varValue:"/.obsidian/plugins/obsidian-http-server/app.css"}],showAdvancedOptions:!1,useSimpleAuth:!1,simpleAuthUsername:"obsidian",simpleAuthPassword:n.randomBytes(8).toString("hex")};var x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var y={},w={get exports(){return y},set exports(e){y=e}},k={},j={get exports(){return k},set exports(e){k=e}},E={},S={get exports(){return E},set exports(e){E=e}},O=t.relative,A=function(e){if(!e)throw new TypeError("argument namespace is required");var n=z(N()[1])[0];function t(e){q.call(t,e)}return t._file=n,t._ignored=function(e){if(process.noDeprecation)return!0;return _(process.env.NO_DEPRECATION||"",e)}(e),t._namespace=e,t._traced=function(e){if(process.traceDeprecation)return!0;return _(process.env.TRACE_DEPRECATION||"",e)}(e),t._warned=Object.cre
|
|||
|
/*!
|
|||
|
* content-type
|
|||
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/function K(e){var n=String(e);if(Z.test(n))return n;if(n.length>0&&!J.test(n))throw new TypeError("invalid parameter value");return'"'+n.replace(X,"\\$1")+'"'}function ee(e){this.parameters=Object.create(null),this.type=e}W.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var n=e.parameters,t=e.type;if(!t||!Q.test(t))throw new TypeError("invalid type");var a=t;if(n&&"object"==typeof n)for(var i,o=Object.keys(n).sort(),r=0;r<o.length;r++){if(i=o[r],!Z.test(i))throw new TypeError("invalid parameter name");a+="; "+i+"="+K(n[i])}return a},W.parse=function(e){if(!e)throw new TypeError("argument string is required");var n="object"==typeof e?function(e){var n;"function"==typeof e.getHeader?n=e.getHeader("content-type"):"object"==typeof e.headers&&(n=e.headers&&e.headers["content-type"]);if("string"!=typeof n)throw new TypeError("content-type header is missing from object");return n}(e):e;if("string"!=typeof n)throw new TypeError("argument string is required to be a string");var t=n.indexOf(";"),a=-1!==t?n.slice(0,t).trim():n.trim();if(!Q.test(a))throw new TypeError("invalid media type");var i=new ee(a.toLowerCase());if(-1!==t){var o,r,s;for(G.lastIndex=t;r=G.exec(n);){if(r.index!==t)throw new TypeError("invalid parameter format");t+=r[0].length,o=r[1].toLowerCase(),34===(s=r[2]).charCodeAt(0)&&-1!==(s=s.slice(1,-1)).indexOf("\\")&&(s=s.replace(Y,"$1")),i.parameters[o]=s}if(t!==n.length)throw new TypeError("invalid parameter format")}return i};var ne={},te={get exports(){return ne},set exports(e){ne=e}},ae=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,n){return e.__proto__=n,e}:function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(e,t)||(e[t]=n[t]);return e});var ie={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},oe=se;
|
|||
|
/*!
|
|||
|
* statuses
|
|||
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/function re(e){if(!Object.prototype.hasOwnProperty.call(se.message,e))throw new Error("invalid status code: "+e);return se.message[e]}function se(e){if("number"==typeof e)return re(e);if("string"!=typeof e)throw new TypeError("code must be a number or string");var n=parseInt(e,10);return isNaN(n)?function(e){var n=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(se.code,n))throw new Error('invalid status message: "'+e+'"');return se.code[n]}(e):re(n)}se.message=ie,se.code=function(e){var n={};return Object.keys(e).forEach((function(t){var a=e[t],i=Number(t);n[a.toLowerCase()]=i})),n}(ie),se.codes=function(e){return Object.keys(e).map((function(e){return Number(e)}))}(ie),se.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},se.empty={204:!0,205:!0,304:!0},se.retry={502:!0,503:!0,504:!0};var ce,pe={},le={},ue={get exports(){return le},set exports(e){le=e}};!function(e){try{var n=require("util");if("function"!=typeof n.inherits)throw"";e.exports=n.inherits}catch(n){e.exports=(ce||(ce=1,"function"==typeof Object.create?ue.exports=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ue.exports=function(e,n){if(n){e.super_=n;var t=function(){};t.prototype=n.prototype,e.prototype=new t,e.prototype.constructor=e}}),le)}}({get exports(){return pe},set exports(e){pe=e}});
|
|||
|
/*!
|
|||
|
* toidentifier
|
|||
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
var de=function(e){return e.split(" ").map((function(e){return e.slice(0,1).toUpperCase()+e.slice(1)})).join("").replace(/[^ _0-9a-z]/gi,"")}
|
|||
|
/*!
|
|||
|
* http-errors
|
|||
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/;!function(e){var n,t=A("http-errors"),a=ae,i=oe,o=pe,r=de;function s(e){return Number(String(e).charAt(0)+"00")}function c(e,n){var t=Object.getOwnPropertyDescriptor(e,"name");t&&t.configurable&&(t.value=n,Object.defineProperty(e,"name",t))}function p(e){return"Error"!==e.substr(-5)?e+"Error":e}e.exports=function e(){for(var n,a,o=500,r={},c=0;c<arguments.length;c++){var p=arguments[c],l=typeof p;if("object"===l&&p instanceof Error)o=(n=p).status||n.statusCode||o;else if("number"===l&&0===c)o=p;else if("string"===l)a=p;else{if("object"!==l)throw new TypeError("argument #"+(c+1)+" unsupported type "+l);r=p}}"number"==typeof o&&(o<400||o>=600)&&t("non-error status code; use only 4xx or 5xx status codes");("number"!=typeof o||!i.message[o]&&(o<400||o>=600))&&(o=500);var u=e[o]||e[s(o)];n||(n=u?new u(a):new Error(a||i.message[o]),Error.captureStackTrace(n,e));u&&n instanceof u&&n.status===o||(n.expose=o<500,n.status=n.statusCode=o);for(var d in r)"status"!==d&&"statusCode"!==d&&(n[d]=r[d]);return n},e.exports.HttpError=function(){function e(){throw new TypeError("cannot construct abstract class")}return o(e,Error),e}(),e.exports.isHttpError=(n=e.exports.HttpError,function(e){return!(!e||"object"!=typeof e)&&(e instanceof n||e instanceof Error&&"boolean"==typeof e.expose&&"number"==typeof e.statusCode&&e.status===e.statusCode)}),function(e,n,t){n.forEach((function(n){var l,u=r(i.message[n]);switch(s(n)){case 400:l=function(e,n,t){var r=p(n);function s(e){var n=null!=e?e:i.message[t],o=new Error(n);return Error.captureStackTrace(o,s),a(o,s.prototype),Object.defineProperty(o,"message",{enumerable:!0,configurable:!0,value:n,writable:!0}),Object.defineProperty(o,"name",{enumerable:!1,configurable:!0,value:r,writable:!0}),o}return o(s,e),c(s,r),s.prototype.status=t,s.prototype.statusCode=t,s.prototype.expose=!0,s}(t,u,n);break;case 500:l=function(e,n,t){var r=p(n);function s(e){var n=null!=e?e:i.message[t],o=new Error(n);return Error.captureStackTrace(o,s),a(o,s.prototype),Object.defineProperty(o,"message",{enumerable:!0,configurable:!0,value:n,writable:!0}),Object.defineProperty(o,"name",{enumerable:!1,configurable:!0,value:r,writable:!0}),o}return o(s,e),c(s,r),s.prototype.status=t,s.prototype.statusCode=t,s.prototype.expose=!1,s}(t,u,n)}l&&(e[n]=l,e[u]=l)}))}(e.exports,i.codes,e.exports.HttpError)}(te);var fe,me,ve,he,ge={},xe={get exports(){return ge},set exports(e){ge=e}},be={},ye={get exports(){return be},set exports(e){be=e}},we={},ke={get exports(){return we},set exports(e){we=e}};function je(){if(me)return fe;me=1;var e=1e3,n=60*e,t=60*n,a=24*t,i=365.25*a;function o(e,n,t){if(!(e<n))return e<1.5*n?Math.floor(e/n)+" "+t:Math.ceil(e/n)+" "+t+"s"}return fe=function(r,s){s=s||{};var c=typeof r;if("string"===c&&r.length>0)return function(o){if((o=String(o)).length>100)return;var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(o);if(!r)return;var s=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*i;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*t;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(r);if("number"===c&&!1===isNaN(r))return s.long?function(i){return o(i,a,"day")||o(i,t,"hour")||o(i,n,"minute")||o(i,e,"second")||i+" ms"}(r):function(i){if(i>=a)return Math.round(i/a)+"d";if(i>=t)return Math.round(i/t)+"h";if(i>=n)return Math.round(i/n)+"m";if(i>=e)return Math.round(i/e)+"s";return i+"ms"}(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))},fe}function Ee(){return ve||(ve=1,function(e,n){var t;function a(e){function a(){if(a.enabled){var e=a,i=+new Date,o=i-(t||i);e.diff=o,e.prev=t,e.curr=i,t=i;for(var r=new Array(arguments.length),s=0;s<r.length;s++)r[s]=arguments[s];r[0]=n.coerce(r[0]),"string"!=typeof r[
|
|||
|
/*!
|
|||
|
* destroy
|
|||
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/var Te=s.EventEmitter,qe=o.ReadStream,ze=c,Ie=p,Pe=function(e,n){!function(e){return e instanceof qe}(e)?function(e){return e instanceof Ie.Gzip||e instanceof Ie.Gunzip||e instanceof Ie.Deflate||e instanceof Ie.DeflateRaw||e instanceof Ie.Inflate||e instanceof Ie.InflateRaw||e instanceof Ie.Unzip}(e)?function(e){"function"==typeof e.destroy?e._binding?(e.destroy(),e._processing?(e._needDrain=!0,e.once("drain",Re)):e._binding.clear()):e._destroy&&e._destroy!==ze.Transform.prototype._destroy?e.destroy():e._destroy&&"function"==typeof e.close?(e.destroyed=!0,e.close()):e.destroy():"function"==typeof e.close&&function(e){if(!0===e._hadError){var n=null===e._binding?"_binding":"_handle";e[n]={close:function(){this[n]=null}}}e.close()}(e)}(e):function(e){return e instanceof ze&&"function"==typeof e.destroy}(e)&&e.destroy():function(e){e.destroy(),"function"==typeof e.close&&e.on("open",Ne)}(e);t=e,t instanceof Te&&n&&(e.removeAllListeners("error"),e.addListener("error",De));var t;return e};function De(){}function Re(){this._binding.clear()}function Ne(){"number"==typeof this.fd&&this.close()}var Be,Le,Me={},Ue={get exports(){return Me},set exports(e){Me=e}};function Fe(){if(Le)return Be;Le=1;var e,n=l,t=n.Buffer,a={};for(e in n)n.hasOwnProperty(e)&&"SlowBuffer"!==e&&"Buffer"!==e&&(a[e]=n[e]);var i=a.Buffer={};for(e in t)t.hasOwnProperty(e)&&"allocUnsafe"!==e&&"allocUnsafeSlow"!==e&&(i[e]=t[e]);if(a.Buffer.prototype=t.prototype,i.from&&i.from!==Uint8Array.from||(i.from=function(e,n,a){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return t(e,n,a)}),i.alloc||(i.alloc=function(e,n,a){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var i=t(e);return n&&0!==n.length?"string"==typeof a?i.fill(n,a):i.fill(n):i.fill(0),i}),!a.kStringMaxLength)try{a.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(e){}return a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),Be=a}var He,$e={};function Ve(){if(He)return $e;He=1;function e(e,n){this.encoder=e,this.addBOM=!0}function n(e,n){this.decoder=e,this.pass=!1,this.options=n||{}}return $e.PrependBOM=e,e.prototype.write=function(e){return this.addBOM&&(e="\ufeff"+e,this.addBOM=!1),this.encoder.write(e)},e.prototype.end=function(){return this.encoder.end()},$e.StripBOM=n,n.prototype.write=function(e){var n=this.decoder.write(e);return this.pass||!n||("\ufeff"===n[0]&&(n=n.slice(1),"function"==typeof this.options.stripBOM&&this.options.stripBOM()),this.pass=!0),n},n.prototype.end=function(){return this.decoder.end()},$e}var We,Ge,Je={};function Ze(){if(Ge)return We;Ge=1;var e=Fe().Buffer;function n(n,t){this.enc=n.encodingName,this.bomAware=n.bomAware,"base64"===this.enc?this.encoder=o:"cesu8"===this.enc&&(this.enc="utf8",this.encoder=r,"💩"!==e.from("eda0bdedb2a9","hex").toString()&&(this.decoder=s,this.defaultCharUnicode=t.defaultCharUnicode))}We={utf8:{type:"_internal",bomAware:!0},cesu8:{type:"_internal",bomAware:!0},unicode11utf8:"utf8",ucs2:{type:"_internal",bomAware:!0},utf16le:"ucs2",binary:{type:"_internal"},base64:{type:"_internal"},hex:{type:"_internal"},_internal:n},n.prototype.encoder=i,n.prototype.decoder=a;var t=u.StringDecoder;function a(e,n){t.call(this,n.enc)}function i(e,n){this.enc=n.enc}function o(e,n){this.prevStr=""}function r(e,n){}function s(e,n){this.acc=0,this.contBytes=0,this.accBytes=0,this.defaultCharUnicode=n.defaultCharUnicode}return t.prototype.end||(t.prototype.end=function(){}),a.prototype=t.prototype,i.prototype.write=function(n){return e.from(n,this.enc)},i.prototype.end=function(){},o.prototype.write=function(n){var t=(n=this.prevStr+n).length-n.length%4;return this.prevStr=n.slic
|
|||
|
/*!
|
|||
|
* unpipe
|
|||
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/var Tn,qn,zn=function(e){if(!e)throw new TypeError("argument stream is required");if("function"==typeof e.unpipe)return void e.unpipe();if(!function(e){for(var n=e.listeners("data"),t=0;t<n.length;t++)if("ondata"===n[t].name)return!0;return!1}(e))return;for(var n,t=e.listeners("close"),a=0;a<t.length;a++)"cleanup"!==(n=t[a]).name&&"onclose"!==n.name||n.call(e)}
|
|||
|
/*!
|
|||
|
* raw-body
|
|||
|
* Copyright(c) 2013-2014 Jonathan Ong
|
|||
|
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/;function In(){if(qn)return Tn;qn=1;var e=function(){try{return require("async_hooks")}catch(e){return{}}}(),n=V(),t=ne,a=_n(),i=zn;Tn=function(t,a,i){var o=i,s=a||{};!0!==a&&"string"!=typeof a||(s={encoding:a});"function"==typeof a&&(o=a,s={});if(void 0!==o&&"function"!=typeof o)throw new TypeError("argument callback must be a function");if(!o&&!x.Promise)throw new TypeError("argument callback is required");var c=!0!==s.encoding?s.encoding:"utf-8",p=n.parse(s.limit),l=null==s.length||isNaN(s.length)?null:parseInt(s.length,10);if(o)return r(t,c,l,p,function(n){var t;e.AsyncResource&&(t=new e.AsyncResource(n.name||"bound-anonymous-fn"));if(!t||!t.runInAsyncScope)return n;return t.runInAsyncScope.bind(t,n,null)}(o));return new Promise((function(e,n){r(t,c,l,p,(function(t,a){if(t)return n(t);e(a)}))}))};var o=/^Encoding not recognized: /;function r(e,n,r,s,c){var p=!1,l=!0;if(null!==s&&null!==r&&r>s)return v(t(413,"request entity too large",{expected:r,length:r,limit:s,type:"entity.too.large"}));var u=e._readableState;if(e._decoder||u&&(u.encoding||u.decoder))return v(t(500,"stream encoding should not be set",{type:"stream.encoding.set"}));if(void 0!==e.readable&&!e.readable)return v(t(500,"stream is not readable",{type:"stream.not.readable"}));var d,f=0;try{d=function(e){if(!e)return null;try{return a.getDecoder(e)}catch(n){if(!o.test(n.message))throw n;throw t(415,"specified encoding unsupported",{encoding:e,type:"encoding.unsupported"})}}(n)}catch(e){return v(e)}var m=d?"":[];function v(){for(var n=new Array(arguments.length),t=0;t<n.length;t++)n[t]=arguments[t];function a(){b(),n[0]&&function(e){i(e),"function"==typeof e.pause&&e.pause()}(e),c.apply(null,n)}p=!0,l?process.nextTick(a):a()}function h(){p||v(t(400,"request aborted",{code:"ECONNABORTED",expected:r,length:r,received:f,type:"request.aborted"}))}function g(e){p||(f+=e.length,null!==s&&f>s?v(t(413,"request entity too large",{limit:s,received:f,type:"entity.too.large"})):d?m+=d.write(e):m.push(e))}function x(e){if(!p){if(e)return v(e);if(null!==r&&f!==r)v(t(400,"request size did not match content length",{expected:r,length:r,received:f,type:"request.size.invalid"}));else v(null,d?m+(d.end()||""):Buffer.concat(m))}}function b(){m=null,e.removeListener("aborted",h),e.removeListener("data",g),e.removeListener("end",x),e.removeListener("error",x),e.removeListener("close",b)}e.on("aborted",h),e.on("close",b),e.on("data",g),e.on("end",x),e.on("error",x),l=!1}return Tn}var Pn={},Dn=function(e,n){if(!Array.isArray(e))throw new TypeError("arg must be an array of [ee, events...] arrays");for(var t=[],a=0;a<e.length;a++){var i=e[a];if(!Array.isArray(i)||i.length<2)throw new TypeError("each array member must be [ee, events...]");for(var o=i[0],r=1;r<i.length;r++){var s=i[r],c=Rn(s,p);o.on(s,c),t.push({ee:o,event:s,fn:c})}}function p(){l(),n.apply(null,arguments)}function l(){for(var e,n=0;n<t.length;n++)(e=t[n]).ee.removeListener(e.event,e.fn)}function u(e){n=e}return u.cancel=l,u};function Rn(e,n){return function(t){for(var a=new Array(arguments.length),i="error"===e?t:null,o=0;o<a.length;o++)a[o]=arguments[o];n(i,this,e,a)}}
|
|||
|
/*!
|
|||
|
* on-finished
|
|||
|
* Copyright(c) 2013 Jonathan Ong
|
|||
|
* Copyright(c) 2014 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/({get exports(){return Pn},set exports(e){Pn=e}}).exports=function(e,n){if(!1!==Fn(e))return Un(n,null,e),e;return function(e,n){var t=e.__onFinished;t&&t.queue||(t=e.__onFinished=function(e){function n(t){if(e.__onFinished===n&&(e.__onFinished=null),n.queue){var a=n.queue;n.queue=null;for(var i=0;i<a.length;i++)a[i](t,e)}}return n.queue=[],n}(e),function(e,n){var t,a,i=!1;function o(e){t.cancel(),a.cancel(),i=!0,n(e)}function r(n){e.removeListener("socket",r),i||t===a&&(a=Mn([[n,"error","close"]],o))}if(t=a=Mn([[e,"end","finish"]],o),e.socket)return void r(e.socket);e.on("socket",r),void 0===e.socket&&function(e,n){var t=e.assignSocket;if("function"!=typeof t)return;e.assignSocket=function(e){t.call(this,e),n(e)}}(e,r)}(e,t));t.queue.push(n)}(e,function(e){var n;Ln.AsyncResource&&(n=new Ln.AsyncResource(e.name||"bound-anonymous-fn"));if(!n||!n.runInAsyncScope)return e;return n.runInAsyncScope.bind(n,e,null)}
|
|||
|
/*!
|
|||
|
* body-parser
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/(n)),e},Pn.isFinished=Fn;var Nn,Bn,Ln=function(){try{return require("async_hooks")}catch(e){return{}}}(),Mn=Dn,Un="function"==typeof setImmediate?setImmediate:function(e){process.nextTick(e.bind.apply(e,arguments))};function Fn(e){var n=e.socket;return"boolean"==typeof e.finished?Boolean(e.finished||n&&!n.writable):"boolean"==typeof e.complete?Boolean(e.upgrade||!n||!n.readable||e.complete&&!e.readable):void 0}function Hn(){if(Bn)return Nn;Bn=1;var e=ne,n=Pe,t=In(),a=_n(),i=Pn,o=zn,r=p;return Nn=function(s,c,p,l,u,d){var f,m,v=d;s._body=!0;var h=null!==v.encoding?v.encoding:null,g=v.verify;try{m=function(n,t,a){var i,o=(n.headers["content-encoding"]||"identity").toLowerCase(),s=n.headers["content-length"];if(t('content-encoding "%s"',o),!1===a&&"identity"!==o)throw e(415,"content encoding unsupported",{encoding:o,type:"encoding.unsupported"});switch(o){case"deflate":i=r.createInflate(),t("inflate body"),n.pipe(i);break;case"gzip":i=r.createGunzip(),t("gunzip body"),n.pipe(i);break;case"identity":(i=n).length=s;break;default:throw e(415,'unsupported content encoding "'+o+'"',{encoding:o,type:"encoding.unsupported"})}return i}(s,u,v.inflate),f=m.length,m.length=void 0}catch(e){return p(e)}if(v.length=f,v.encoding=g?null:h,null===v.encoding&&null!==h&&!a.encodingExists(h))return p(e(415,'unsupported charset "'+h.toUpperCase()+'"',{charset:h.toLowerCase(),type:"charset.unsupported"}));u("read body"),t(m,v,(function(t,r){var d;if(t)return d="encoding.unsupported"===t.type?e(415,'unsupported charset "'+h.toUpperCase()+'"',{charset:h.toLowerCase(),type:"charset.unsupported"}):e(400,t),m!==s&&(o(s),n(m,!0)),void function(e,n){i.isFinished(e)?n(null):(i(e,n),e.resume())}(s,(function(){p(e(400,d))}));if(g)try{u("verify body"),g(s,c,r,h)}catch(n){return void p(e(403,n,{body:r,type:n.type||"entity.verify.failed"}))}var f=r;try{u("parse body"),f="string"!=typeof r&&null!==h?a.decode(r,h):r,s.body=l(f)}catch(n){return void p(e(400,n,{body:f,type:n.type||"entity.parse.failed"}))}p()}))},Nn}var $n={},Vn={get exports(){return $n},set exports(e){$n=e}},Wn={},Gn=/; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g,Jn=/^[\u0020-\u007e\u0080-\u00ff]+$/,Zn=/^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/,Yn=/\\([\u0000-\u007f])/g,Xn=/([\\"])/g,Qn=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/,Kn=/^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/,et=/^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;function nt(e){var n=String(e);if(Zn.test(n))return n;if(n.length>0&&!Jn.test(n))throw new TypeError("invalid parameter value");return'"'+n.replace(Xn,"\\$1")+'"'}Wn.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var n=e.parameters,t=e.subtype,a=e.suffix,i=e.type;if(!i||!Kn.test(i))throw new TypeError("invalid type");if(!t||!Qn.test(t))throw new TypeError("invalid subtype");var o=i+"/"+t;if(a){if(!Kn.test(a))throw new TypeError("invalid suffix");o+="+"+a}if(n&&"object"==typeof n)for(var r,s=Object.keys(n).sort(),c=0;c<s.length;c++){if(r=s[c],!Zn.test(r))throw new TypeError("invalid parameter name");o+="; "+r+"="+nt(n[r])}return o},Wn.parse=function(e){if(!e)throw new TypeError("argument string is required");"object"==typeof e&&(e=function(e){if("function"==typeof e.getHeader)return e.getHeader("content-type");if("object"==typeof e.headers)return e.headers&&e.headers["content-type"]}(e));if("string"!=typeof e)throw new TypeError("argument string is required to be a string");var n,t,a,i=e.indexOf(";"),o=function(e){var n=et.exec(e.toLowerCase());if(!n)throw new TypeError("invalid media type");var t,a=n[1],i=n[2],o=i.lastIndexOf("+");-1!==o&&(t=i.substr(o+1),i=i.substr(0,o));var r={type:a,subtype:i,suffix:t};return r}(-1!==i?e.substr(0,i):e),r={};Gn.lastIndex=i;for(;t=Gn.exec(e);){if(t.index!==i)throw new TypeError("invalid parameter format");i+=t[0].length,n=t[1].toLowerCase(),'"'===(a=t[2])[0]&&(a=a.substr(1,a.length-2).replace(Yn,"$1")),r[n]=a}if(-1!==i&&i!==e.length)throw new TypeError("i
|
|||
|
/*!
|
|||
|
* mime-types
|
|||
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
function(e){var n,a,i,o=at,r=t.extname,s=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;function p(e){if(!e||"string"!=typeof e)return!1;var n=s.exec(e),t=n&&o[n[1].toLowerCase()];return t&&t.charset?t.charset:!(!n||!c.test(n[1]))&&"UTF-8"}e.charset=p,e.charsets={lookup:p},e.contentType=function(n){if(!n||"string"!=typeof n)return!1;var t=-1===n.indexOf("/")?e.lookup(n):n;if(!t)return!1;if(-1===t.indexOf("charset")){var a=e.charset(t);a&&(t+="; charset="+a.toLowerCase())}return t},e.extension=function(n){if(!n||"string"!=typeof n)return!1;var t=s.exec(n),a=t&&e.extensions[t[1].toLowerCase()];if(!a||!a.length)return!1;return a[0]},e.extensions=Object.create(null),e.lookup=function(n){if(!n||"string"!=typeof n)return!1;var t=r("x."+n).toLowerCase().substr(1);if(!t)return!1;return e.types[t]||!1},e.types=Object.create(null),n=e.extensions,a=e.types,i=["nginx","apache",void 0,"iana"],Object.keys(o).forEach((function(e){var t=o[e],r=t.extensions;if(r&&r.length){n[e]=r;for(var s=0;s<r.length;s++){var c=r[s];if(a[c]){var p=i.indexOf(o[a[c]].source),l=i.indexOf(t.source);if("application/octet-stream"!==a[c]&&(p>l||p===l&&"application/"===a[c].substr(0,12)))continue}a[c]=e}}}))}(tt);
|
|||
|
/*!
|
|||
|
* type-is
|
|||
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
var ot,rt,st,ct,pt,lt,ut,dt,ft,mt,vt,ht,gt,xt,bt,yt,wt,kt,jt=Wn,Et=tt;function St(e,n){var t,a,i=n,o=function(e){if(!e)return null;try{return function(e){var n=jt.parse(e);return n.parameters=void 0,jt.format(n)}(e)}catch(e){return null}}
|
|||
|
/*!
|
|||
|
* body-parser
|
|||
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/(e);if(!o)return!1;if(i&&!Array.isArray(i))for(i=new Array(arguments.length-1),t=0;t<i.length;t++)i[t]=arguments[t+1];if(!i||!i.length)return o;for(t=0;t<i.length;t++)if(Ct(At(a=i[t]),o))return"+"===a[0]||-1!==a.indexOf("*")?o:a;return!1}function Ot(e){return void 0!==e.headers["transfer-encoding"]||!isNaN(e.headers["content-length"])}function At(e){if("string"!=typeof e)return!1;switch(e){case"urlencoded":return"application/x-www-form-urlencoded";case"multipart":return"multipart/*"}return"+"===e[0]?"*/*"+e:-1===e.indexOf("/")?Et.lookup(e):e}function Ct(e,n){if(!1===e)return!1;var t=n.split("/"),a=e.split("/");return 2===t.length&&2===a.length&&(("*"===a[0]||a[0]===t[0])&&("*+"===a[1].substr(0,2)?a[1].length<=t[1].length+1&&a[1].substr(1)===t[1].substr(1-a[1].length):"*"===a[1]||a[1]===t[1]))}function _t(){if(rt)return ot;rt=1;var e=V(),n=W,t=ne,a=_e()("body-parser:json"),i=Hn(),o=$n;ot=function(c){var p=c||{},l="number"!=typeof p.limit?e.parse(p.limit||"100kb"):p.limit,u=!1!==p.inflate,d=p.reviver,f=!1!==p.strict,m=p.type||"application/json",v=p.verify||!1;if(!1!==v&&"function"!=typeof v)throw new TypeError("option verify must be function");var h="function"!=typeof m?function(e){return function(n){return Boolean(o(n,e))}}(m):m;function g(e){if(0===e.length)return{};if(f){var n=(t=e,(i=r.exec(t))?i[1]:void 0);if("{"!==n&&"["!==n)throw a("strict violation"),function(e,n){var t=e.indexOf(n),a=-1!==t?e.substring(0,t)+"#":"";try{throw JSON.parse(a),new SyntaxError("strict violation")}catch(e){return s(e,{message:e.message.replace("#",n),stack:e.stack})}}(e,n)}var t,i;try{return a("parse json"),JSON.parse(e,d)}catch(e){throw s(e,{message:e.message,stack:e.stack})}}return function(e,r,s){if(e._body)return a("body already parsed"),void s();if(e.body=e.body||{},!o.hasBody(e))return a("skip empty body"),void s();if(a("content-type %j",e.headers["content-type"]),!h(e))return a("skip parsing"),void s();var c=function(e){try{return(n.parse(e).parameters.charset||"").toLowerCase()}catch(e){return}}(e)||"utf-8";if("utf-"!==c.slice(0,4))return a("invalid charset"),void s(t(415,'unsupported charset "'+c.toUpperCase()+'"',{charset:c,type:"charset.unsupported"}));i(e,r,s,g,a,{encoding:c,inflate:u,limit:l,verify:v})}};var r=/^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/;function s(e,n){for(var t=Object.getOwnPropertyNames(e),a=0;a<t.length;a++){var i=t[a];"stack"!==i&&"message"!==i&&delete e[i]}return e.stack=n.stack.replace(e.message,n.message),e.message=n.message,e}return ot}
|
|||
|
/*!
|
|||
|
* body-parser
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/function Tt(){if(ct)return st;ct=1;var e=V(),n=_e()("body-parser:raw"),t=Hn(),a=$n;return st=function(i){var o=i||{},r=!1!==o.inflate,s="number"!=typeof o.limit?e.parse(o.limit||"100kb"):o.limit,c=o.type||"application/octet-stream",p=o.verify||!1;if(!1!==p&&"function"!=typeof p)throw new TypeError("option verify must be function");var l="function"!=typeof c?function(e){return function(n){return Boolean(a(n,e))}}(c):c;function u(e){return e}return function(e,i,o){return e._body?(n("body already parsed"),void o()):(e.body=e.body||{},a.hasBody(e)?(n("content-type %j",e.headers["content-type"]),l(e)?void t(e,i,o,u,n,{encoding:null,inflate:r,limit:s,verify:p}):(n("skip parsing"),void o())):(n("skip empty body"),void o()))}},st}
|
|||
|
/*!
|
|||
|
* body-parser
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/function qt(){if(lt)return pt;lt=1;var e=V(),n=W,t=_e()("body-parser:text"),a=Hn(),i=$n;return pt=function(o){var r=o||{},s=r.defaultCharset||"utf-8",c=!1!==r.inflate,p="number"!=typeof r.limit?e.parse(r.limit||"100kb"):r.limit,l=r.type||"text/plain",u=r.verify||!1;if(!1!==u&&"function"!=typeof u)throw new TypeError("option verify must be function");var d="function"!=typeof l?function(e){return function(n){return Boolean(i(n,e))}}(l):l;function f(e){return e}return function(e,o,r){if(e._body)return t("body already parsed"),void r();if(e.body=e.body||{},!i.hasBody(e))return t("skip empty body"),void r();if(t("content-type %j",e.headers["content-type"]),!d(e))return t("skip parsing"),void r();var l=function(e){try{return(n.parse(e).parameters.charset||"").toLowerCase()}catch(e){return}}(e)||s;a(e,o,r,f,t,{encoding:l,inflate:c,limit:p,verify:u})}},pt}function zt(){if(mt)return ft;mt=1;var e="undefined"!=typeof Symbol&&Symbol,n=dt?ut:(dt=1,ut=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},n=Symbol("test"),t=Object(n);if("string"==typeof n)return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;for(n in e[n]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var a=Object.getOwnPropertySymbols(e);if(1!==a.length||a[0]!==n)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,n);if(42!==i.value||!0!==i.enumerable)return!1}return!0});return ft=function(){return"function"==typeof e&&("function"==typeof Symbol&&("symbol"==typeof e("foo")&&("symbol"==typeof Symbol("bar")&&n())))}}function It(){if(ht)return vt;ht=1;var e=Array.prototype.slice,n=Object.prototype.toString;return vt=function(t){var a=this;if("function"!=typeof a||"[object Function]"!==n.call(a))throw new TypeError("Function.prototype.bind called on incompatible "+a);for(var i,o=e.call(arguments,1),r=Math.max(0,a.length-o.length),s=[],c=0;c<r;c++)s.push("$"+c);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var n=a.apply(this,o.concat(e.call(arguments)));return Object(n)===n?n:this}return a.apply(t,o.concat(e.call(arguments)))})),a.prototype){var p=function(){};p.prototype=a.prototype,i.prototype=new p,p.prototype=null}return i},vt}function Pt(){if(xt)return gt;xt=1;var e=It();return gt=Function.prototype.bind||e}function Dt(){if(kt)return wt;var e;kt=1;var n=SyntaxError,t=Function,a=TypeError,i=function(e){try{return t('"use strict"; return ('+e+").constructor;")()}catch(e){}},o=Object.getOwnPropertyDescriptor;if(o)try{o({},"")}catch(e){o=null}var r=function(){throw new a},s=o?function(){try{return r}catch(e){try{return o(arguments,"callee").get}catch(e){return r}}}():r,c=zt()(),p=Object.getPrototypeOf||function(e){return e.__proto__},l={},u="undefined"==typeof Uint8Array?e:p(Uint8Array),d={"%AggregateError%":"undefined"==typeof AggregateError?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?e:ArrayBuffer,"%ArrayIteratorPrototype%":c?p([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":l,"%AsyncGenerator%":l,"%AsyncGeneratorFunction%":l,"%AsyncIteratorPrototype%":l,"%Atomics%":"undefined"==typeof Atomics?e:Atomics,"%BigInt%":"undefined"==typeof BigInt?e:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?e:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==t
|
|||
|
/*!
|
|||
|
* body-parser
|
|||
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/function ma(){if(ta)return na;ta=1;var e=V(),n=W,t=ne,a=_e()("body-parser:urlencoded"),i=A("body-parser"),o=Hn(),r=$n;na=function(s){var l=s||{};void 0===l.extended&&i("undefined extended: provide extended option");var u=!1!==l.extended,d=!1!==l.inflate,f="number"!=typeof l.limit?e.parse(l.limit||"100kb"):l.limit,m=l.type||"application/x-www-form-urlencoded",v=l.verify||!1;if(!1!==v&&"function"!=typeof v)throw new TypeError("option verify must be function");var h=u?function(e){var n=void 0!==e.parameterLimit?e.parameterLimit:1e3,i=p("qs");if(isNaN(n)||n<1)throw new TypeError("option parameterLimit must be a positive number");isFinite(n)&&(n|=0);return function(e){var o=c(e,n);if(void 0===o)throw a("too many parameters"),t(413,"too many parameters",{type:"parameters.too.many"});var r=Math.max(100,o);return a("parse extended urlencoding"),i(e,{allowPrototypes:!0,arrayLimit:r,depth:1/0,parameterLimit:n})}}(l):function(e){var n=void 0!==e.parameterLimit?e.parameterLimit:1e3,i=p("querystring");if(isNaN(n)||n<1)throw new TypeError("option parameterLimit must be a positive number");isFinite(n)&&(n|=0);return function(e){if(void 0===c(e,n))throw a("too many parameters"),t(413,"too many parameters",{type:"parameters.too.many"});return a("parse urlencoding"),i(e,void 0,void 0,{maxKeys:n})}}(l),g="function"!=typeof m?function(e){return function(n){return Boolean(r(n,e))}}(m):m;function x(e){return e.length?h(e):{}}return function(e,i,s){if(e._body)return a("body already parsed"),void s();if(e.body=e.body||{},!r.hasBody(e))return a("skip empty body"),void s();if(a("content-type %j",e.headers["content-type"]),!g(e))return a("skip parsing"),void s();var c=function(e){try{return(n.parse(e).parameters.charset||"").toLowerCase()}catch(e){return}}(e)||"utf-8";if("utf-8"!==c)return a("invalid charset"),void s(t(415,'unsupported charset "'+c.toUpperCase()+'"',{charset:c,type:"charset.unsupported"}));o(e,i,s,x,a,{debug:a,encoding:c,inflate:d,limit:f,verify:v})}};var s=Object.create(null);function c(e,n){for(var t=0,a=0;-1!==(a=e.indexOf("&",a));)if(a++,++t===n)return;return t}function p(e){var n=s[e];if(void 0!==n)return n.parse;switch(e){case"qs":n=fa();break;case"querystring":n=d}return s[e]=n,n.parse}return na}
|
|||
|
/*!
|
|||
|
* body-parser
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/!function(e,n){var t=A("body-parser"),a=Object.create(null);function i(e){return function(){return function(e){var n=a[e];if(void 0!==n)return n;switch(e){case"json":n=_t();break;case"raw":n=Tt();break;case"text":n=qt();break;case"urlencoded":n=ma()}return a[e]=n}(e)}}n=e.exports=t.function((function(e){var t=Object.create(e||null,{type:{configurable:!0,enumerable:!0,value:void 0,writable:!0}}),a=n.urlencoded(t),i=n.json(t);return function(e,n,t){i(e,n,(function(i){if(i)return t(i);a(e,n,t)}))}}),"bodyParser: use individual json/urlencoded middlewares"),Object.defineProperty(n,"json",{configurable:!0,enumerable:!0,get:i("json")}),Object.defineProperty(n,"raw",{configurable:!0,enumerable:!0,get:i("raw")}),Object.defineProperty(n,"text",{configurable:!0,enumerable:!0,get:i("text")}),Object.defineProperty(n,"urlencoded",{configurable:!0,enumerable:!0,get:i("urlencoded")})}(S,E);
|
|||
|
/*!
|
|||
|
* merge-descriptors
|
|||
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
var va=function(e,n,t){if(!e)throw new TypeError("argument dest is required");if(!n)throw new TypeError("argument src is required");void 0===t&&(t=!0);return Object.getOwnPropertyNames(n).forEach((function(a){if(t||!ha.call(e,a)){var i=Object.getOwnPropertyDescriptor(n,a);Object.defineProperty(e,a,i)}})),e},ha=Object.prototype.hasOwnProperty;var ga,xa,ba,ya,wa={},ka={get exports(){return wa},set exports(e){wa=e}},ja={},Ea={},Sa={get exports(){return Ea},set exports(e){Ea=e}},Oa={},Aa={get exports(){return Oa},set exports(e){Oa=e}};function Ca(){if(xa)return ga;xa=1;var e=1e3,n=60*e,t=60*n,a=24*t,i=365.25*a;function o(e,n,t){if(!(e<n))return e<1.5*n?Math.floor(e/n)+" "+t:Math.ceil(e/n)+" "+t+"s"}return ga=function(r,s){s=s||{};var c=typeof r;if("string"===c&&r.length>0)return function(o){if((o=String(o)).length>100)return;var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(o);if(!r)return;var s=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*i;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*t;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(r);if("number"===c&&!1===isNaN(r))return s.long?function(i){return o(i,a,"day")||o(i,t,"hour")||o(i,n,"minute")||o(i,e,"second")||i+" ms"}(r):function(i){if(i>=a)return Math.round(i/a)+"d";if(i>=t)return Math.round(i/t)+"h";if(i>=n)return Math.round(i/n)+"m";if(i>=e)return Math.round(i/e)+"s";return i+"ms"}(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))},ga}function _a(){return ba||(ba=1,function(e,n){var t;function a(e){function a(){if(a.enabled){var e=a,i=+new Date,o=i-(t||i);e.diff=o,e.prev=t,e.curr=i,t=i;for(var r=new Array(arguments.length),s=0;s<r.length;s++)r[s]=arguments[s];r[0]=n.coerce(r[0]),"string"!=typeof r[0]&&r.unshift("%O");var c=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(function(t,a){if("%%"===t)return t;c++;var i=n.formatters[a];if("function"==typeof i){var o=r[c];t=i.call(e,o),r.splice(c,1),c--}return t})),n.formatArgs.call(e,r),(a.log||n.log||console.log.bind(console)).apply(e,r)}}return a.namespace=e,a.enabled=n.enabled(e),a.useColors=n.useColors(),a.color=function(e){var t,a=0;for(t in e)a=(a<<5)-a+e.charCodeAt(t),a|=0;return n.colors[Math.abs(a)%n.colors.length]}(e),"function"==typeof n.init&&n.init(a),a}(n=Aa.exports=a.debug=a.default=a).coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){n.enable("")},n.enable=function(e){n.save(e),n.names=[],n.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),a=t.length,i=0;i<a;i++)t[i]&&("-"===(e=t[i].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){var t,a;for(t=0,a=n.skips.length;t<a;t++)if(n.skips[t].test(e))return!1;for(t=0,a=n.names.length;t<a;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=Ca(),n.names=[],n.skips=[],n.formatters={}}(0,Oa)),Oa}var Ta,qa={},za={get exports(){return qa},set exports(e){qa=e}};!function(e){"undefined"!=typeof process&&"renderer"===process.type?e.exports=(ya||(ya=1,function(e,n){function t(){var e;try{e=n.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(n=Sa.exports=_a()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},n.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff),t){var a="color: "+this.color;e.splice(1,0,a,"color: inherit");var i=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))})),e.splice(o,0,a)}},n.save=function(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(e){}},n.load=t,n.u
|
|||
|
/*!
|
|||
|
* encodeurl
|
|||
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
var Ia=function(e){return String(e).replace(Da,Ra).replace(Pa,encodeURI)}
|
|||
|
/*!
|
|||
|
* escape-html
|
|||
|
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|||
|
* Copyright(c) 2015 Andreas Lubbe
|
|||
|
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|||
|
* MIT Licensed
|
|||
|
*/,Pa=/(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g,Da=/(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g,Ra="$1<>$2";var Na=/["'&<>]/,Ba=function(e){var n,t=""+e,a=Na.exec(t);if(!a)return t;var i="",o=0,r=0;for(o=a.index;o<t.length;o++){switch(t.charCodeAt(o)){case 34:n=""";break;case 38:n="&";break;case 39:n="'";break;case 60:n="<";break;case 62:n=">";break;default:continue}r!==o&&(i+=t.substring(r,o)),r=o+1,i+=n}return r!==o?i+t.substring(r,o):i};var La={},Ma={get exports(){return La},set exports(e){La=e}},Ua=f,Fa=Ua.parse,Ha=Ua.Url;function $a(e){var n=e.url;if(void 0!==n){var t=e._parsedUrl;return Wa(n,t)?t:((t=Va(n))._raw=n,e._parsedUrl=t)}}function Va(e){if("string"!=typeof e||47!==e.charCodeAt(0))return Fa(e);for(var n=e,t=null,a=null,i=1;i<e.length;i++)switch(e.charCodeAt(i)){case 63:null===a&&(n=e.substring(0,i),t=e.substring(i+1),a=e.substring(i));break;case 9:case 10:case 12:case 13:case 32:case 35:case 160:case 65279:return Fa(e)}var o=void 0!==Ha?new Ha:{};return o.path=e,o.href=e,o.pathname=n,null!==a&&(o.query=t,o.search=a),o}function Wa(e,n){return"object"==typeof n&&null!==n&&(void 0===Ha||n instanceof Ha)&&n._raw===e}
|
|||
|
/*!
|
|||
|
* finalhandler
|
|||
|
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/Ma.exports=$a,La.original=function(e){var n=e.originalUrl;if("string"!=typeof n)return $a(e);var t=e._parsedOriginalUrl;if(Wa(n,t))return t;return t=Va(n),t._raw=n,e._parsedOriginalUrl=t};var Ga=ja("finalhandler"),Ja=Ia,Za=Ba,Ya=Pn,Xa=La,Qa=oe,Ka=zn,ei=/\x20{2}/g,ni=/\n/g,ti="function"==typeof setImmediate?setImmediate:function(e){process.nextTick(e.bind.apply(e,arguments))},ai=Ya.isFinished;var ii=function(e,n,t){var a=t||{},i=a.env||process.env.NODE_ENV||"development",o=a.onerror;return function(t){var a,r,s;if(t||!oi(n)){if(t?(s=function(e){if("number"==typeof e.status&&e.status>=400&&e.status<600)return e.status;if("number"==typeof e.statusCode&&e.statusCode>=400&&e.statusCode<600)return e.statusCode;return}(t),void 0===s?s=function(e){var n=e.statusCode;("number"!=typeof n||n<400||n>599)&&(n=500);return n}(n):a=function(e){if(!e.headers||"object"!=typeof e.headers)return;for(var n=Object.create(null),t=Object.keys(e.headers),a=0;a<t.length;a++){var i=t[a];n[i]=e.headers[i]}return n}(t),r=function(e,n,t){var a;"production"!==t&&((a=e.stack)||"function"!=typeof e.toString||(a=e.toString()));return a||Qa.message[n]}(t,s,i)):(s=404,r="Cannot "+e.method+" "+Ja(function(e){try{return Xa.original(e).pathname}catch(e){return"resource"}}(e))),Ga("default %s",s),t&&o&&ti(o,t,e,n),oi(n))return Ga("cannot %d after headers sent",s),void e.socket.destroy();!function(e,n,t,a,i){function o(){var o=function(e){return'<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>'+Za(e).replace(ni,"<br>").replace(ei," ")+"</pre>\n</body>\n</html>\n"}(i);n.statusCode=t,n.statusMessage=Qa.message[t],n.removeHeader("Content-Encoding"),n.removeHeader("Content-Language"),n.removeHeader("Content-Range"),function(e,n){if(!n)return;for(var t=Object.keys(n),a=0;a<t.length;a++){var i=t[a];e.setHeader(i,n[i])}}(n,a),n.setHeader("Content-Security-Policy","default-src 'none'"),n.setHeader("X-Content-Type-Options","nosniff"),n.setHeader("Content-Type","text/html; charset=utf-8"),n.setHeader("Content-Length",Buffer.byteLength(o,"utf8")),"HEAD"!==e.method?n.end(o,"utf8"):n.end()}if(ai(e))return void o();Ka(e),Ya(e,o),e.resume()}(e,n,s,a,r)}else Ga("cannot 404 after headers sent")}};function oi(e){return"boolean"!=typeof e.headersSent?Boolean(e._header):e.headersSent}var ri,si,ci,pi,li={},ui={get exports(){return li},set exports(e){li=e}},di={},fi={},mi={get exports(){return fi},set exports(e){fi=e}},vi={},hi={get exports(){return vi},set exports(e){vi=e}};function gi(){if(si)return ri;si=1;var e=1e3,n=60*e,t=60*n,a=24*t,i=365.25*a;function o(e,n,t){if(!(e<n))return e<1.5*n?Math.floor(e/n)+" "+t:Math.ceil(e/n)+" "+t+"s"}return ri=function(r,s){s=s||{};var c=typeof r;if("string"===c&&r.length>0)return function(o){if((o=String(o)).length>100)return;var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(o);if(!r)return;var s=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*i;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*t;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(r);if("number"===c&&!1===isNaN(r))return s.long?function(i){return o(i,a,"day")||o(i,t,"hour")||o(i,n,"minute")||o(i,e,"second")||i+" ms"}(r):function(i){if(i>=a)return Math.round(i/a)+"d";if(i>=t)return Math.round(i/t)+"h";if(i>=n)return Math.round(i/n)+"m";if(i>=e)return Math.round(i/e)+"s";return i+"ms"}(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))},ri}function xi(){return ci||(ci=1,function(e,n){var t;function a(e){function a(){if(a.enabled){var e=a,i=+new Date,o=i-(t||i);e.diff=o,e.prev=t,e.curr=i,t=i;for(var r=new Array(arguments.length),s=0;s<r.length;s++)r[s]=arguments[s];r[0]=n.coerce(r[0]),"string"!=typeof r
|
|||
|
/*!
|
|||
|
* express
|
|||
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/,Oi=/\((?!\?)/g;var Ai=Si,Ci=di("express:router:layer"),_i=Object.prototype.hasOwnProperty,Ti=qi;function qi(e,n,t){if(!(this instanceof qi))return new qi(e,n,t);Ci("new %o",e);var a=n||{};this.handle=t,this.name=t.name||"<anonymous>",this.params=void 0,this.path=void 0,this.regexp=Ai(e,this.keys=[],a),this.regexp.fast_star="*"===e,this.regexp.fast_slash="/"===e&&!1===a.end}function zi(e){if("string"!=typeof e||0===e.length)return e;try{return decodeURIComponent(e)}catch(n){throw n instanceof URIError&&(n.message="Failed to decode param '"+e+"'",n.status=n.statusCode=400),n}}
|
|||
|
/*!
|
|||
|
* methods
|
|||
|
* Copyright(c) 2013-2014 TJ Holowaychuk
|
|||
|
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/qi.prototype.handle_error=function(e,n,t,a){var i=this.handle;if(4!==i.length)return a(e);try{i(e,n,t,a)}catch(e){a(e)}},qi.prototype.handle_request=function(e,n,t){var a=this.handle;if(a.length>3)return t();try{a(e,n,t)}catch(e){t(e)}},qi.prototype.match=function(e){var n;if(null!=e){if(this.regexp.fast_slash)return this.params={},this.path="",!0;if(this.regexp.fast_star)return this.params={0:zi(e)},this.path=e,!0;n=this.regexp.exec(e)}if(!n)return this.params=void 0,this.path=void 0,!1;this.params={},this.path=n[0];for(var t=this.keys,a=this.params,i=1;i<n.length;i++){var o=t[i-1].name,r=zi(n[i]);void 0===r&&_i.call(a,o)||(a[o]=r)}return!0};var Ii=m,Pi=Ii.METHODS&&Ii.METHODS.map((function(e){return e.toLowerCase()}))||["get","post","put","head","delete","options","trace","copy","lock","mkcol","move","purge","propfind","proppatch","unlock","report","mkactivity","checkout","merge","m-search","notify","subscribe","unsubscribe","patch","search","connect"];
|
|||
|
/*!
|
|||
|
* express
|
|||
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
var Di=di("express:router:route"),Ri=ki,Ni=Ti,Bi=Pi,Li=Array.prototype.slice,Mi=Object.prototype.toString,Ui=Fi;function Fi(e){this.path=e,this.stack=[],Di("new %o",e),this.methods={}}Fi.prototype._handles_method=function(e){if(this.methods._all)return!0;var n=e.toLowerCase();return"head"!==n||this.methods.head||(n="get"),Boolean(this.methods[n])},Fi.prototype._options=function(){var e=Object.keys(this.methods);this.methods.get&&!this.methods.head&&e.push("head");for(var n=0;n<e.length;n++)e[n]=e[n].toUpperCase();return e},Fi.prototype.dispatch=function(e,n,t){var a=0,i=this.stack,o=0;if(0===i.length)return t();var r=e.method.toLowerCase();"head"!==r||this.methods.head||(r="get"),e.route=this,function s(c){if(c&&"route"===c)return t();if(c&&"router"===c)return t(c);if(++o>100)return setImmediate(s,c);var p=i[a++];if(!p)return t(c);p.method&&p.method!==r?s(c):c?p.handle_error(c,e,n,s):p.handle_request(e,n,s);o=0}()},Fi.prototype.all=function(){for(var e=Ri(Li.call(arguments)),n=0;n<e.length;n++){var t=e[n];if("function"!=typeof t){var a=Mi.call(t);throw new TypeError("Route.all() requires a callback function but got a "+a)}var i=Ni("/",{},t);i.method=void 0,this.methods._all=!0,this.stack.push(i)}return this},Bi.forEach((function(e){Fi.prototype[e]=function(){for(var n=Ri(Li.call(arguments)),t=0;t<n.length;t++){var a=n[t];if("function"!=typeof a){var i=Mi.call(a);throw new Error("Route."+e+"() requires a callback function but got a "+i)}Di("%s %o",e,this.path);var o=Ni("/",{},a);o.method=e,this.methods[e]=!0,this.stack.push(o)}return this}}));var Hi={};({get exports(){return Hi},set exports(e){Hi=e}}).exports=function(e,n){if(e&&n)for(var t in n)e[t]=n[t];return e};
|
|||
|
/*!
|
|||
|
* express
|
|||
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
var $i=Ui,Vi=Ti,Wi=Pi,Gi=Hi,Ji=di("express:router"),Zi=A("express"),Yi=ki,Xi=La,Qi=ae,Ki=/^\[object (\S+)\]$/,eo=Array.prototype.slice,no=Object.prototype.toString,to=ui.exports=function(e){var n=e||{};function t(e,n,a){t.handle(e,n,a)}return Qi(t,to),t.params={},t._params=[],t.caseSensitive=n.caseSensitive,t.mergeParams=n.mergeParams,t.strict=n.strict,t.stack=[],t};function ao(e,n){for(var t=0;t<n.length;t++){var a=n[t];-1===e.indexOf(a)&&e.push(a)}}function io(e){var n=typeof e;return"object"!==n?n:no.call(e).replace(Ki,"$1")}function oo(e,n){try{return e.match(n)}catch(e){return e}}to.param=function(e,n){if("function"==typeof e)return Zi("router.param(fn): Refactor to use path params"),void this._params.push(e);var t,a=this._params,i=a.length;":"===e[0]&&(Zi("router.param("+JSON.stringify(e)+", fn): Use router.param("+JSON.stringify(e.slice(1))+", fn) instead"),e=e.slice(1));for(var o=0;o<i;++o)(t=a[o](e,n))&&(n=t);if("function"!=typeof n)throw new Error("invalid param() call for "+e+", got "+n);return(this.params[e]=this.params[e]||[]).push(n),this},to.handle=function(e,n,t){var a=this;Ji("dispatching %s %s",e.method,e.url);var i,o,r=0,s=function(e){if("string"!=typeof e||0===e.length||"/"===e[0])return;var n=e.indexOf("?"),t=-1!==n?n:e.length,a=e.slice(0,t).indexOf("://");return-1!==a?e.substring(0,e.indexOf("/",3+a)):void 0}(e.url)||"",c="",p=!1,l=0,u={},d=[],f=a.stack,m=e.params,v=e.baseUrl||"",h=function(e,n){for(var t=new Array(arguments.length-2),a=new Array(arguments.length-2),i=0;i<t.length;i++)t[i]=arguments[i+2],a[i]=n[t[i]];return function(){for(var i=0;i<t.length;i++)n[t[i]]=a[i];return e.apply(this,arguments)}}(t,e,"baseUrl","next","params");function g(t){var i="route"===t?null:t;if(p&&(e.url=e.url.slice(1),p=!1),0!==c.length&&(e.baseUrl=v,e.url=s+c+e.url.slice(s.length),c=""),"router"!==i)if(r>=f.length)setImmediate(h,i);else{if(++l>100)return setImmediate(g,t);var o,x,b,y=function(e){try{return Xi(e).pathname}catch(e){return}}(e);if(null==y)return h(i);for(;!0!==x&&r<f.length;)if(x=oo(o=f[r++],y),b=o.route,"boolean"!=typeof x&&(i=i||x),!0===x&&b)if(i)x=!1;else{var w=e.method,k=b._handles_method(w);k||"OPTIONS"!==w||ao(d,b._options()),k||"HEAD"===w||(x=!1)}if(!0!==x)return h(i);b&&(e.route=b),e.params=a.mergeParams?function(e,n){if("object"!=typeof n||!n)return e;var t=Gi({},n);if(!(0 in e)||!(0 in n))return Gi(t,e);var a=0,i=0;for(;a in e;)a++;for(;i in n;)i++;for(a--;a>=0;a--)e[a+i]=e[a],a<i&&delete e[a];return Gi(t,e)}(o.params,m):o.params;var j=o.path;a.process_params(o,u,e,n,(function(t){t?g(i||t):b?o.handle_request(e,n,g):function(t,a,i,o){if(0!==i.length){if(i!==o.slice(0,i.length))return void g(a);var r=o[i.length];if(r&&"/"!==r&&"."!==r)return g(a);Ji("trim prefix (%s) from url %s",i,e.url),c=i,e.url=s+e.url.slice(s.length+c.length),s||"/"===e.url[0]||(e.url="/"+e.url,p=!0),e.baseUrl=v+("/"===c[c.length-1]?c.substring(0,c.length-1):c)}Ji("%s %s : %s",t.name,i,e.originalUrl),a?t.handle_error(a,e,n,g):t.handle_request(e,n,g)}(o,i,j,y),l=0}))}else setImmediate(h,null)}e.next=g,"OPTIONS"===e.method&&(i=h,o=function(e,t){if(t||0===d.length)return e(t);!function(e,n,t){try{var a=n.join(",");e.set("Allow",a),e.send(a)}catch(e){t(e)}}(n,d,e)},h=function(){var e=new Array(arguments.length+1);e[0]=i;for(var n=0,t=arguments.length;n<t;n++)e[n+1]=arguments[n];o.apply(this,e)}),e.baseUrl=v,e.originalUrl=e.originalUrl||e.url,g()},to.process_params=function(e,n,t,a,i){var o=this.params,r=e.keys;if(!r||0===r.length)return i();var s,c,p,l,u,d=0,f=0;function m(e){return e?i(e):d>=r.length?i():(f=0,c=r[d++],s=c.name,p=t.params[s],l=o[s],u=n[s],void 0!==p&&l?u&&(u.match===p||u.error&&"route"!==u.error)?(t.params[s]=u.value,m(u.error)):(n[s]=u={error:null,match:p,value:p},void v()):m())}function v(e){var n=l[f++];if(u.value=t.params[c.name],e)return u.error=e,void m(e);if(!n)return m();try{n(t,a,v,p,c.name)}catch(e){v(e)}}m()},to.use=function(e){var n=0,t="/";if("function"!=typeof e){for(var a=e;Array.isArray(a)&&0!==a.length;)a=a[0];"function"!=typeof a&&(n=1,t=e)}var i=Yi(eo.call(arguments,n));if(0===i.length)th
|
|||
|
/*!
|
|||
|
* express
|
|||
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/function lo(){if(so)return ro;so=1;var e=Hi,n=La,t=fa();return ro=function(a){var i=e({},a),o=t.parse;return"function"==typeof a&&(o=a,i=void 0),void 0!==i&&void 0===i.allowPrototypes&&(i.allowPrototypes=!0),function(e,t,a){if(!e.query){var r=n(e).query;e.query=o(r,i)}a()}},ro}co.init=function(e){return function(n,t,a){e.enabled("x-powered-by")&&t.setHeader("X-Powered-By","Express"),n.res=t,t.req=n,n.next=a,po(n,e.request),po(t,e.response),t.locals=t.locals||Object.create(null),a()}};
|
|||
|
/*!
|
|||
|
* express
|
|||
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
var uo=di("express:view"),fo=t,mo=o,vo=fo.dirname,ho=fo.basename,go=fo.extname,xo=fo.join,bo=fo.resolve,yo=wo;function wo(e,n){var t=n||{};if(this.defaultEngine=t.defaultEngine,this.ext=go(e),this.name=e,this.root=t.root,!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");var a=e;if(this.ext||(this.ext="."!==this.defaultEngine[0]?"."+this.defaultEngine:this.defaultEngine,a+=this.ext),!t.engines[this.ext]){var i=this.ext.slice(1);uo('require "%s"',i);var o=function(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(i).__express;if("function"!=typeof o)throw new Error('Module "'+i+'" does not provide a view engine.');t.engines[this.ext]=o}this.engine=t.engines[this.ext],this.path=this.lookup(a)}function ko(e){uo('stat "%s"',e);try{return mo.statSync(e)}catch(e){return}}wo.prototype.lookup=function(e){var n,t=[].concat(this.root);uo('lookup "%s"',e);for(var a=0;a<t.length&&!n;a++){var i=t[a],o=bo(i,e),r=vo(o),s=ho(o);n=this.resolve(r,s)}return n},wo.prototype.render=function(e,n){uo('render "%s"',this.path),this.engine(this.path,e,n)},wo.prototype.resolve=function(e,n){var t=this.ext,a=xo(e,n),i=ko(a);return i&&i.isFile()||(i=ko(a=xo(e,ho(n,t),"index"+t)))&&i.isFile()?a:void 0};var jo={},Eo={};
|
|||
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|||
|
!function(e,n){var t=l,a=t.Buffer;function i(e,n){for(var t in e)n[t]=e[t]}function o(e,n,t){return a(e,n,t)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=t:(i(t,n),n.Buffer=o),o.prototype=Object.create(a.prototype),i(a,o),o.from=function(e,n,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,n,t)},o.alloc=function(e,n,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=a(e);return void 0!==n?"string"==typeof t?i.fill(n,t):i.fill(n):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return t.SlowBuffer(e)}}({get exports(){return Eo},set exports(e){Eo=e}},Eo);var So={},Oo={get exports(){return So},set exports(e){So=e}},Ao={};
|
|||
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|||
|
!function(e,n){var t=l,a=t.Buffer;function i(e,n){for(var t in e)n[t]=e[t]}function o(e,n,t){return a(e,n,t)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=t:(i(t,n),n.Buffer=o),o.prototype=Object.create(a.prototype),i(a,o),o.from=function(e,n,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,n,t)},o.alloc=function(e,n,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=a(e);return void 0!==n?"string"==typeof t?i.fill(n,t):i.fill(n):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return t.SlowBuffer(e)}}({get exports(){return Ao},set exports(e){Ao=e}},Ao),
|
|||
|
/*!
|
|||
|
* content-disposition
|
|||
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
Oo.exports=function(e,n){var t=n||{},a=t.type||"attachment",i=function(e,n){if(void 0===e)return;var t={};if("string"!=typeof e)throw new TypeError("filename must be a string");void 0===n&&(n=!0);if("string"!=typeof n&&"boolean"!=typeof n)throw new TypeError("fallback must be a string or boolean");if("string"==typeof n&&Io.test(n))throw new TypeError("fallback must be ISO-8859-1 string");var a=Co(e),i=No.test(a),o="string"!=typeof n?n&&Fo(a):Co(n),r="string"==typeof o&&o!==a;(r||!i||qo.test(a))&&(t["filename*"]=a);(i||r)&&(t.filename=r?o:a);return t}(e,t.fallback);return function(e){var n=e.parameters,t=e.type;if(!t||"string"!=typeof t||!Bo.test(t))throw new TypeError("invalid type");var a=String(t).toLowerCase();if(n&&"object"==typeof n)for(var i,o=Object.keys(n).sort(),r=0;r<o.length;r++){var s="*"===(i=o[r]).substr(-1)?Wo(n[i]):Vo(n[i]);a+="; "+i+"="+s}return a}(new Go(a,i))},So.parse=function(e){if(!e||"string"!=typeof e)throw new TypeError("argument string is required");var n=Mo.exec(e);if(!n)throw new TypeError("invalid type format");var t,a,i=n[0].length,o=n[1].toLowerCase(),r=[],s={};i=Ro.lastIndex=";"===n[0].substr(-1)?i-1:i;for(;n=Ro.exec(e);){if(n.index!==i)throw new TypeError("invalid parameter format");if(i+=n[0].length,t=n[1].toLowerCase(),a=n[2],-1!==r.indexOf(t))throw new TypeError("invalid duplicate parameter");r.push(t),t.indexOf("*")+1!==t.length?"string"!=typeof s[t]&&('"'===a[0]&&(a=a.substr(1,a.length-2).replace(Po,"$1")),s[t]=a):(t=t.slice(0,-1),a=Uo(a),s[t]=a)}if(-1!==i&&i!==e.length)throw new TypeError("invalid parameter format");return new Go(o,s)};var Co=t.basename,_o=Ao.Buffer,To=/[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g,qo=/%[0-9A-Fa-f]{2}/,zo=/%([0-9A-Fa-f]{2})/g,Io=/[^\x20-\x7e\xa0-\xff]/g,Po=/\\([\u0000-\u007f])/g,Do=/([\\"])/g,Ro=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,No=/^[\x20-\x7e\x80-\xff]+$/,Bo=/^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/,Lo=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,Mo=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function Uo(e){var n=Lo.exec(e);if(!n)throw new TypeError("invalid extended field value");var t,a=n[1].toLowerCase(),i=n[2].replace(zo,Ho);switch(a){case"iso-8859-1":t=Fo(i);break;case"utf-8":t=_o.from(i,"binary").toString("utf8");break;default:throw new TypeError("unsupported charset in extended field")}return t}function Fo(e){return String(e).replace(Io,"?")}function Ho(e,n){return String.fromCharCode(parseInt(n,16))}function $o(e){return"%"+String(e).charCodeAt(0).toString(16).toUpperCase()}function Vo(e){return'"'+String(e).replace(Do,"\\$1")+'"'}function Wo(e){var n=String(e);return"UTF-8''"+encodeURIComponent(n).replace(To,$o)}function Go(e,n){this.type=e,this.parameters=n}var Jo,Zo,Yo,Xo,Qo={},Ko={get exports(){return Qo},set exports(e){Qo=e}},er={},nr={},tr={get exports(){return nr},set exports(e){nr=e}},ar={},ir={get exports(){return ar},set exports(e){ar=e}};function or(){if(Zo)return Jo;Zo=1;var e=1e3,n=60*e,t=60*n,a=24*t,i=365.25*a;function o(e,n,t){if(!(e<n))return e<1.5*n?Math.floor(e/n)+" "+t:Math.ceil(e/n)+" "+t+"s"}return Jo=function(r,s){s=s||{};var c=typeof r;if("string"===c&&r.length>0)return function(o){if((o=String(o)).length>100)return;var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(o);if(!r)return;var s=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*i;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*t;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(r);if("number"===c&&!1===isNaN(r))return s.long?function(i){return o(i,a,"day")||o(i,t,"hour")||o(i,n,"minute")|
|
|||
|
/*!
|
|||
|
* etag
|
|||
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
var lr=function(e,n){if(null==e)throw new TypeError("argument entity is required");var t=function(e){if("function"==typeof dr&&e instanceof dr)return!0;return e&&"object"==typeof e&&"ctime"in e&&"[object Date]"===fr.call(e.ctime)&&"mtime"in e&&"[object Date]"===fr.call(e.mtime)&&"ino"in e&&"number"==typeof e.ino&&"size"in e&&"number"==typeof e.size}(e),a=n&&"boolean"==typeof n.weak?n.weak:t;if(!t&&"string"!=typeof e&&!Buffer.isBuffer(e))throw new TypeError("argument entity must be string, Buffer, or fs.Stats");var i=t?(o=e,r=o.mtime.getTime().toString(16),'"'+o.size.toString(16)+"-"+r+'"'):function(e){if(0===e.length)return'"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"';var n=ur.createHash("sha1").update(e,"utf8").digest("base64").substring(0,27),t="string"==typeof e?Buffer.byteLength(e,"utf8"):e.length;return'"'+t.toString(16)+"-"+n+'"'}(e);var o,r;
|
|||
|
/*!
|
|||
|
* fresh
|
|||
|
* Copyright(c) 2012 TJ Holowaychuk
|
|||
|
* Copyright(c) 2016-2017 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/return a?"W/"+i:i},ur=n,dr=o.Stats,fr=Object.prototype.toString;var mr=/(?:^|,)\s*?no-cache\s*?(?:,|$)/,vr=function(e,n){var t=e["if-modified-since"],a=e["if-none-match"];if(!t&&!a)return!1;var i=e["cache-control"];if(i&&mr.test(i))return!1;if(a&&"*"!==a){var o=n.etag;if(!o)return!1;for(var r=!0,s=function(e){for(var n=0,t=[],a=0,i=0,o=e.length;i<o;i++)switch(e.charCodeAt(i)){case 32:a===n&&(a=n=i+1);break;case 44:t.push(e.substring(a,n)),a=n=i+1;break;default:n=i+1}return t.push(e.substring(a,n)),t}(a),c=0;c<s.length;c++){var p=s[c];if(p===o||p==="W/"+o||"W/"+p===o){r=!1;break}}if(r)return!1}if(t){var l=n["last-modified"];if(!(l&&hr(l)<=hr(t)))return!1}return!0};function hr(e){var n=e&&Date.parse(e);return"number"==typeof n?n:NaN}var gr=o;function xr(){this.types=Object.create(null),this.extensions=Object.create(null)}xr.prototype.define=function(e){for(var n in e){for(var t=e[n],a=0;a<t.length;a++)process.env.DEBUG_MIME&&this.types[t[a]]&&console.warn((this._loading||"define()").replace(/.*\//,""),'changes "'+t[a]+'" extension type from '+this.types[t[a]]+" to "+n),this.types[t[a]]=n;this.extensions[n]||(this.extensions[n]=t[0])}},xr.prototype.load=function(e){this._loading=e;var n={};gr.readFileSync(e,"ascii").split(/[\r\n]+/).forEach((function(e){var t=e.replace(/\s*#.*|^\s*|\s*$/g,"").split(/\s+/);n[t.shift()]=t})),this.define(n),this._loading=null},xr.prototype.lookup=function(e,n){var t=e.replace(/^.*[\.\/\\]/,"").toLowerCase();return this.types[t]||n||this.default_type},xr.prototype.extension=function(e){var n=e.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();return this.extensions[n]};var br=new xr;br.define({"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"applicat
|
|||
|
/*!
|
|||
|
* range-parser
|
|||
|
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|||
|
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/var Cr=function(e,n,t){if("string"!=typeof n)throw new TypeError("argument str must be a string");var a=n.indexOf("=");if(-1===a)return-2;var i=n.slice(a+1).split(","),o=[];o.type=n.slice(0,a);for(var r=0;r<i.length;r++){var s=i[r].split("-"),c=parseInt(s[0],10),p=parseInt(s[1],10);isNaN(c)?(c=e-p,p=e-1):isNaN(p)&&(p=e-1),p>e-1&&(p=e-1),isNaN(c)||isNaN(p)||c>p||c<0||o.push({start:c,end:p})}if(o.length<1)return-1;return t&&t.combine?function(e){for(var n=e.map(_r).sort(zr),t=0,a=1;a<n.length;a++){var i=n[a],o=n[t];i.start>o.end+1?n[++t]=i:i.end>o.end&&(o.end=i.end,o.index=Math.min(o.index,i.index))}n.length=t+1;var r=n.sort(qr).map(Tr);return r.type=e.type,r}(o):o};function _r(e,n){return{start:e.start,end:e.end,index:n}}function Tr(e){return{start:e.start,end:e.end}}function qr(e,n){return e.index-n.index}function zr(e,n){return e.start-n.start}
|
|||
|
/*!
|
|||
|
* send
|
|||
|
* Copyright(c) 2012 TJ Holowaychuk
|
|||
|
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/var Ir=ne,Pr=er("send"),Dr=A("send"),Rr=Pe,Nr=Ia,Br=Ba,Lr=lr,Mr=vr,Ur=o,Fr=yr,Hr=function(e,n){n=n||{};var t=typeof e;if("string"===t&&e.length>0)return function(e){if((e=String(e)).length>100)return;var n=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!n)return;var t=parseFloat(n[1]);switch((n[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return t*Or;case"weeks":case"week":case"w":return t*Sr;case"days":case"day":case"d":return t*Er;case"hours":case"hour":case"hrs":case"hr":case"h":return t*jr;case"minutes":case"minute":case"mins":case"min":case"m":return t*kr;case"seconds":case"second":case"secs":case"sec":case"s":return t*wr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}(e);if("number"===t&&isFinite(e))return n.long?function(e){var n=Math.abs(e);if(n>=Er)return Ar(e,n,Er,"day");if(n>=jr)return Ar(e,n,jr,"hour");if(n>=kr)return Ar(e,n,kr,"minute");if(n>=wr)return Ar(e,n,wr,"second");return e+" ms"}(e):function(e){var n=Math.abs(e);if(n>=Er)return Math.round(e/Er)+"d";if(n>=jr)return Math.round(e/jr)+"h";if(n>=kr)return Math.round(e/kr)+"m";if(n>=wr)return Math.round(e/wr)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},$r=Pn,Vr=Cr,Wr=t,Gr=oe,Jr=c,Zr=i,Yr=Wr.extname,Xr=Wr.join,Qr=Wr.normalize,Kr=Wr.resolve,es=Wr.sep,ns=/^ *bytes=/,ts=31536e6,as=/(?:^|[\\/])\.\.(?:[\\/]|$)/;function is(e,n,t){Jr.call(this);var a=t||{};if(this.options=a,this.path=n,this.req=e,this._acceptRanges=void 0===a.acceptRanges||Boolean(a.acceptRanges),this._cacheControl=void 0===a.cacheControl||Boolean(a.cacheControl),this._etag=void 0===a.etag||Boolean(a.etag),this._dotfiles=void 0!==a.dotfiles?a.dotfiles:"ignore","ignore"!==this._dotfiles&&"allow"!==this._dotfiles&&"deny"!==this._dotfiles)throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"');this._hidden=Boolean(a.hidden),void 0!==a.hidden&&Dr("hidden: use dotfiles: '"+(this._hidden?"allow":"ignore")+"' instead"),void 0===a.dotfiles&&(this._dotfiles=void 0),this._extensions=void 0!==a.extensions?cs(a.extensions,"extensions option"):[],this._immutable=void 0!==a.immutable&&Boolean(a.immutable),this._index=void 0!==a.index?cs(a.index,"index option"):["index.html"],this._lastModified=void 0===a.lastModified||Boolean(a.lastModified),this._maxage=a.maxAge||a.maxage,this._maxage="string"==typeof this._maxage?Hr(this._maxage):Number(this._maxage),this._maxage=isNaN(this._maxage)?0:Math.min(Math.max(0,this._maxage),ts),this._root=a.root?Kr(a.root):null,!this._root&&a.from&&this.from(a.from)}function os(e,n,t){return e+" "+(t?t.start+"-"+t.end:"*")+"/"+n}function rs(e,n){return'<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>'+e+"</title>\n</head>\n<body>\n<pre>"+n+"</pre>\n</body>\n</html>\n"}function ss(e,n){return("function"!=typeof e.listenerCount?e.listeners(n).length:e.listenerCount(n))>0}function cs(e,n){for(var t=[].concat(e||[]),a=0;a<t.length;a++)if("string"!=typeof t[a])throw new TypeError(n+" must be array of strings or false");return t}function ps(e){var n=e&&Date.parse(e);return"number"==typeof n?n:NaN}Ko.exports=function(e,n,t){return new is(e,n,t)},Qo.mime=Fr,Zr.inherits(is,Jr),is.prototype.etag=Dr.function((function(e){return this._etag=Boolean(e),Pr("etag %s",this._etag),this}),"send.etag: pass etag as option"),is.prototype.hidden=Dr.function((function(e){return this._hidden=Boolean(e),this._dotfiles=void 0,Pr("hidden %s",this._hidden),this}),"send.hidden: use dotfiles option"),is.prototype.index=Dr.function((function(e){var n=e?cs(e,"paths argument"):[];return Pr("index %o",e),this._index=n,this}),"send.index: pass index as option"),is.prototype.root=function(e){return this._root=Kr(String(e)),Pr("root %s",this._root),this},is.prototype.from=Dr.function(is.prototype.root,"send.from: pass root as option"),is.prototype.root=Dr.function(is.prototype.root,"send.root: pass root as option"),is.prototype.max
|
|||
|
/*!
|
|||
|
* proxy-addr
|
|||
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
us.exports=function(e,n){if(!e)throw new TypeError("req argument is required");if(!n)throw new TypeError("trust argument is required");var t=ys(e,n);return t[t.length-1]},ls.all=ys,ls.compile=ws;var ms=ds,vs=fs,hs=/^[0-9]+$/,gs=vs.isValid,xs=vs.parse,bs={linklocal:["169.254.0.0/16","fe80::/10"],loopback:["127.0.0.1/8","::1/128"],uniquelocal:["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16","fc00::/7"]};function ys(e,n){var t=ms(e);if(!n)return t;"function"!=typeof n&&(n=ws(n));for(var a=0;a<t.length-1;a++)n(t[a],a)||(t.length=a+1);return t}function ws(e){if(!e)throw new TypeError("argument is required");var n,t,a,i,o,r,s,c,p;if("string"==typeof e)n=[e];else{if(!Array.isArray(e))throw new TypeError("unsupported trust argument");n=e.slice()}for(var l=0;l<n.length;l++)e=n[l],Object.prototype.hasOwnProperty.call(bs,e)&&(e=bs[e],n.splice.apply(n,[l,1].concat(e)),l+=e.length-1);return t=function(e){for(var n=new Array(e.length),t=0;t<e.length;t++)n[t]=ks(e[t]);return n}(n),0===(a=t.length)?js:1===a?(o=t[0],r=o[0],s=r.kind(),c="ipv4"===s,p=o[1],function(e){if(!gs(e))return!1;var n=xs(e);if(n.kind()!==s){if(c&&!n.isIPv4MappedAddress())return!1;n=c?n.toIPv4Address():n.toIPv4MappedAddress()}return n.match(r,p)}):(i=t,function(e){if(!gs(e))return!1;for(var n,t=xs(e),a=t.kind(),o=0;o<i.length;o++){var r=i[o],s=r[0],c=s.kind(),p=r[1],l=t;if(a!==c){if("ipv4"===c&&!t.isIPv4MappedAddress())continue;n||(n="ipv4"===c?t.toIPv4Address():t.toIPv4MappedAddress()),l=n}if(l.match(s,p))return!0}return!1})}function ks(e){var n=e.lastIndexOf("/"),t=-1!==n?e.substring(0,n):e;if(!gs(t))throw new TypeError("invalid IP address: "+t);var a=xs(t);-1===n&&"ipv6"===a.kind()&&a.isIPv4MappedAddress()&&(a=a.toIPv4Address());var i="ipv6"===a.kind()?128:32,o=-1!==n?e.substring(n+1,e.length):null;if((o=null===o?i:hs.test(o)?parseInt(o,10):"ipv4"===a.kind()&&gs(o)?function(e){var n=xs(e),t=n.kind();return"ipv4"===t?n.prefixLengthFromSubnetMask():null}(o):null)<=0||o>i)throw new TypeError("invalid range on address: "+e);return[a,o]}function js(){return!1}
|
|||
|
/*!
|
|||
|
* express
|
|||
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
!function(e){var n=Eo.Buffer,t=So,a=W,i=A("express"),o=ki,r=Qo.mime,s=lr,c=ls,p=fa(),l=d;function u(e){return function(t,a){var i=n.isBuffer(t)?t:n.from(t,a);return s(i,e)}}function f(e){return p.parse(e,{allowPrototypes:!0})}function m(){return{}}e.etag=u({weak:!1}),e.wetag=u({weak:!0}),e.isAbsolute=function(e){return"/"===e[0]||(":"===e[1]&&("\\"===e[2]||"/"===e[2])||("\\\\"===e.substring(0,2)||void 0))},e.flatten=i.function(o,"utils.flatten: use array-flatten npm module instead"),e.normalizeType=function(e){return~e.indexOf("/")?function(e,n){for(var t=e.split(/ *; */),a={value:t[0],quality:1,params:{},originalIndex:n},i=1;i<t.length;++i){var o=t[i].split(/ *= */);"q"===o[0]?a.quality=parseFloat(o[1]):a.params[o[0]]=o[1]}return a}(e):{value:r.lookup(e),params:{}}},e.normalizeTypes=function(n){for(var t=[],a=0;a<n.length;++a)t.push(e.normalizeType(n[a]));return t},e.contentDisposition=i.function(t,"utils.contentDisposition: use content-disposition npm module instead"),e.compileETag=function(n){var t;if("function"==typeof n)return n;switch(n){case!0:case"weak":t=e.wetag;break;case!1:break;case"strong":t=e.etag;break;default:throw new TypeError("unknown value for etag function: "+n)}return t},e.compileQueryParser=function(e){var n;if("function"==typeof e)return e;switch(e){case!0:case"simple":n=l.parse;break;case!1:n=m;break;case"extended":n=f;break;default:throw new TypeError("unknown value for query parser function: "+e)}return n},e.compileTrust=function(e){return"function"==typeof e?e:!0===e?function(){return!0}:"number"==typeof e?function(n,t){return t<e}:("string"==typeof e&&(e=e.split(",").map((function(e){return e.trim()}))),c.compile(e||[]))},e.setCharset=function(e,n){if(!e||!n)return e;var t=a.parse(e);return t.parameters.charset=n,a.format(t)}}(jo),
|
|||
|
/*!
|
|||
|
* express
|
|||
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
function(e,n){var a=ii,i=li,o=Pi,r=co,s=lo(),c=di("express:application"),p=yo,l=m,u=jo.compileETag,d=jo.compileQueryParser,f=jo.compileTrust,v=A("express"),h=ki,g=Hi,x=t.resolve,b=ae,y=Object.prototype.hasOwnProperty,w=Array.prototype.slice,k=e.exports={},j="@@symbol:trust_proxy_default";function E(e){"test"!==this.get("env")&&console.error(e.stack||e.toString())}k.init=function(){this.cache={},this.engines={},this.settings={},this.defaultConfiguration()},k.defaultConfiguration=function(){var e=process.env.NODE_ENV||"development";this.enable("x-powered-by"),this.set("etag","weak"),this.set("env",e),this.set("query parser","extended"),this.set("subdomain offset",2),this.set("trust proxy",!1),Object.defineProperty(this.settings,j,{configurable:!0,value:!0}),c("booting in %s mode",e),this.on("mount",(function(e){!0===this.settings[j]&&"function"==typeof e.settings["trust proxy fn"]&&(delete this.settings["trust proxy"],delete this.settings["trust proxy fn"]),b(this.request,e.request),b(this.response,e.response),b(this.engines,e.engines),b(this.settings,e.settings)})),this.locals=Object.create(null),this.mountpath="/",this.locals.settings=this.settings,this.set("view",p),this.set("views",x("views")),this.set("jsonp callback name","callback"),"production"===e&&this.enable("view cache"),Object.defineProperty(this,"router",{get:function(){throw new Error("'app.router' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.")}})},k.lazyrouter=function(){this._router||(this._router=new i({caseSensitive:this.enabled("case sensitive routing"),strict:this.enabled("strict routing")}),this._router.use(s(this.get("query parser fn"))),this._router.use(r.init(this)))},k.handle=function(e,n,t){var i=this._router,o=t||a(e,n,{env:this.get("env"),onerror:E.bind(this)});if(!i)return c("no routes defined on app"),void o();i.handle(e,n,o)},k.use=function(e){var n=0,t="/";if("function"!=typeof e){for(var a=e;Array.isArray(a)&&0!==a.length;)a=a[0];"function"!=typeof a&&(n=1,t=e)}var i=h(w.call(arguments,n));if(0===i.length)throw new TypeError("app.use() requires a middleware function");this.lazyrouter();var o=this._router;return i.forEach((function(e){if(!e||!e.handle||!e.set)return o.use(t,e);c(".use app under %s",t),e.mountpath=t,e.parent=this,o.use(t,(function(n,t,a){var i=n.app;e.handle(n,t,(function(e){b(n,i.request),b(t,i.response),a(e)}))})),e.emit("mount",this)}),this),this},k.route=function(e){return this.lazyrouter(),this._router.route(e)},k.engine=function(e,n){if("function"!=typeof n)throw new Error("callback function required");var t="."!==e[0]?"."+e:e;return this.engines[t]=n,this},k.param=function(e,n){if(this.lazyrouter(),Array.isArray(e)){for(var t=0;t<e.length;t++)this.param(e[t],n);return this}return this._router.param(e,n),this},k.set=function(e,n){if(1!==arguments.length){switch(c('set "%s" to %o',e,n),this.settings[e]=n,e){case"etag":this.set("etag fn",u(n));break;case"query parser":this.set("query parser fn",d(n));break;case"trust proxy":this.set("trust proxy fn",f(n)),Object.defineProperty(this.settings,j,{configurable:!0,value:!1})}return this}for(var t=this.settings;t&&t!==Object.prototype;){if(y.call(t,e))return t[e];t=Object.getPrototypeOf(t)}},k.path=function(){return this.parent?this.parent.path()+this.mountpath:""},k.enabled=function(e){return Boolean(this.set(e))},k.disabled=function(e){return!this.set(e)},k.enable=function(e){return this.set(e,!0)},k.disable=function(e){return this.set(e,!1)},o.forEach((function(e){k[e]=function(n){if("get"===e&&1===arguments.length)return this.set(n);this.lazyrouter();var t=this._router.route(n);return t[e].apply(t,w.call(arguments,1)),this}})),k.all=function(e){this.lazyrouter();for(var n=this._router.route(e),t=w.call(arguments,1),a=0;a<o.length;a++)n[o[a]].apply(n,t);return this},k.del=v.function(k.delete,"app.del: Use app.delete instead"),k.render=function(e,n,t){var a,i=this.cache,o=t,r=this.engines,s=n,c={};if("function"==typeof n&&(o=n,s={}),g(c,this.locals),s._locals&&g(c,s._locals),g(c,s),null==c.cache&&(c.cache=this.enabled("vie
|
|||
|
/*!
|
|||
|
* negotiator
|
|||
|
* Copyright(c) 2012 Federico Romero
|
|||
|
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
|||
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/(t[3]).map(rc),c=0;c<s.length;c++){var p=s[c],l=p[0].toLowerCase(),u=p[1],d=u&&'"'===u[0]&&'"'===u[u.length-1]?u.substr(1,u.length-2):u;if("q"===l){i=parseFloat(d);break}a[l]=d}return{type:r,subtype:o,params:a,q:i,i:n}}function ec(e,n,t){var a=Ks(e),i=0;if(!a)return null;if(n.type.toLowerCase()==a.type.toLowerCase())i|=4;else if("*"!=n.type)return null;if(n.subtype.toLowerCase()==a.subtype.toLowerCase())i|=2;else if("*"!=n.subtype)return null;var o=Object.keys(n.params);if(o.length>0){if(!o.every((function(e){return"*"==n.params[e]||(n.params[e]||"").toLowerCase()==(a.params[e]||"").toLowerCase()})))return null;i|=1}return{i:t,o:n.i,q:n.q,s:i}}function nc(e,n){var t=Qs(void 0===e?"*/*":e||"");if(!n)return t.filter(ic).sort(tc).map(ac);var a=n.map((function(e,n){return function(e,n,t){for(var a={o:-1,q:0,s:0},i=0;i<n.length;i++){var o=ec(e,n[i],t);o&&(a.s-o.s||a.q-o.q||a.o-o.o)<0&&(a=o)}return a}(e,t,n)}));return a.filter(ic).sort(tc).map((function(e){return n[a.indexOf(e)]}))}function tc(e,n){return n.q-e.q||n.s-e.s||e.o-n.o||e.i-n.i||0}function ac(e){return e.type+"/"+e.subtype}function ic(e){return e.q>0}function oc(e){for(var n=0,t=0;-1!==(t=e.indexOf('"',t));)n++,t++;return n}function rc(e){var n,t,a=e.indexOf("=");return-1===a?n=e:(n=e.substr(0,a),t=e.substr(a+1)),[n,t]}var sc=Os,cc=Ps,pc=Fs,lc=Ys;function uc(e){if(!(this instanceof uc))return new uc(e);this.request=e}Ss.exports=uc,Es.Negotiator=uc,uc.prototype.charset=function(e){var n=this.charsets(e);return n&&n[0]},uc.prototype.charsets=function(e){return sc(this.request.headers["accept-charset"],e)},uc.prototype.encoding=function(e){var n=this.encodings(e);return n&&n[0]},uc.prototype.encodings=function(e){return cc(this.request.headers["accept-encoding"],e)},uc.prototype.language=function(e){var n=this.languages(e);return n&&n[0]},uc.prototype.languages=function(e){return pc(this.request.headers["accept-language"],e)},uc.prototype.mediaType=function(e){var n=this.mediaTypes(e);return n&&n[0]},uc.prototype.mediaTypes=function(e){return lc(this.request.headers.accept,e)},uc.prototype.preferredCharset=uc.prototype.charset,uc.prototype.preferredCharsets=uc.prototype.charsets,uc.prototype.preferredEncoding=uc.prototype.encoding,uc.prototype.preferredEncodings=uc.prototype.encodings,uc.prototype.preferredLanguage=uc.prototype.language,uc.prototype.preferredLanguages=uc.prototype.languages,uc.prototype.preferredMediaType=uc.prototype.mediaType,uc.prototype.preferredMediaTypes=uc.prototype.mediaTypes;
|
|||
|
/*!
|
|||
|
* accepts
|
|||
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
var dc=Es,fc=tt,mc=vc;function vc(e){if(!(this instanceof vc))return new vc(e);this.headers=e.headers,this.negotiator=new dc(e)}function hc(e){return-1===e.indexOf("/")?fc.lookup(e):e}function gc(e){return"string"==typeof e}
|
|||
|
/*!
|
|||
|
* express
|
|||
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/vc.prototype.type=vc.prototype.types=function(e){var n=e;if(n&&!Array.isArray(n)){n=new Array(arguments.length);for(var t=0;t<n.length;t++)n[t]=arguments[t]}if(!n||0===n.length)return this.negotiator.mediaTypes();if(!this.headers.accept)return n[0];var a=n.map(hc),i=this.negotiator.mediaTypes(a.filter(gc))[0];return!!i&&n[a.indexOf(i)]},vc.prototype.encoding=vc.prototype.encodings=function(e){var n=e;if(n&&!Array.isArray(n)){n=new Array(arguments.length);for(var t=0;t<n.length;t++)n[t]=arguments[t]}return n&&0!==n.length?this.negotiator.encodings(n)[0]||!1:this.negotiator.encodings()},vc.prototype.charset=vc.prototype.charsets=function(e){var n=e;if(n&&!Array.isArray(n)){n=new Array(arguments.length);for(var t=0;t<n.length;t++)n[t]=arguments[t]}return n&&0!==n.length?this.negotiator.charsets(n)[0]||!1:this.negotiator.charsets()},vc.prototype.lang=vc.prototype.langs=vc.prototype.language=vc.prototype.languages=function(e){var n=e;if(n&&!Array.isArray(n)){n=new Array(arguments.length);for(var t=0;t<n.length;t++)n[t]=arguments[t]}return n&&0!==n.length?this.negotiator.languages(n)[0]||!1:this.negotiator.languages()};var xc=mc,bc=A("express"),yc=r.isIP,wc=$n,kc=m,jc=vr,Ec=Cr,Sc=La,Oc=ls,Ac=Object.create(kc.IncomingMessage.prototype),Cc=Ac;function _c(e,n,t){Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:t})}Ac.get=Ac.header=function(e){if(!e)throw new TypeError("name argument is required to req.get");if("string"!=typeof e)throw new TypeError("name must be a string to req.get");var n=e.toLowerCase();switch(n){case"referer":case"referrer":return this.headers.referrer||this.headers.referer;default:return this.headers[n]}},Ac.accepts=function(){var e=xc(this);return e.types.apply(e,arguments)},Ac.acceptsEncodings=function(){var e=xc(this);return e.encodings.apply(e,arguments)},Ac.acceptsEncoding=bc.function(Ac.acceptsEncodings,"req.acceptsEncoding: Use acceptsEncodings instead"),Ac.acceptsCharsets=function(){var e=xc(this);return e.charsets.apply(e,arguments)},Ac.acceptsCharset=bc.function(Ac.acceptsCharsets,"req.acceptsCharset: Use acceptsCharsets instead"),Ac.acceptsLanguages=function(){var e=xc(this);return e.languages.apply(e,arguments)},Ac.acceptsLanguage=bc.function(Ac.acceptsLanguages,"req.acceptsLanguage: Use acceptsLanguages instead"),Ac.range=function(e,n){var t=this.get("Range");if(t)return Ec(e,t,n)},Ac.param=function(e,n){var t=this.params||{},a=this.body||{},i=this.query||{};return bc("req.param("+(1===arguments.length?"name":"name, default")+"): Use req.params, req.body, or req.query instead"),null!=t[e]&&t.hasOwnProperty(e)?t[e]:null!=a[e]?a[e]:null!=i[e]?i[e]:n},Ac.is=function(e){var n=e;if(!Array.isArray(e)){n=new Array(arguments.length);for(var t=0;t<n.length;t++)n[t]=arguments[t]}return wc(this,n)},_c(Ac,"protocol",(function(){var e=this.connection.encrypted?"https":"http";if(!this.app.get("trust proxy fn")(this.connection.remoteAddress,0))return e;var n=this.get("X-Forwarded-Proto")||e,t=n.indexOf(",");return-1!==t?n.substring(0,t).trim():n.trim()})),_c(Ac,"secure",(function(){return"https"===this.protocol})),_c(Ac,"ip",(function(){var e=this.app.get("trust proxy fn");return Oc(this,e)})),_c(Ac,"ips",(function(){var e=this.app.get("trust proxy fn"),n=Oc.all(this,e);return n.reverse().pop(),n})),_c(Ac,"subdomains",(function(){var e=this.hostname;if(!e)return[];var n=this.app.get("subdomain offset"),t=yc(e)?[e]:e.split(".").reverse();return t.slice(n)})),_c(Ac,"path",(function(){return Sc(this).pathname})),_c(Ac,"hostname",(function(){var e=this.app.get("trust proxy fn"),n=this.get("X-Forwarded-Host");if(n&&e(this.connection.remoteAddress,0)?-1!==n.indexOf(",")&&(n=n.substring(0,n.indexOf(",")).trimRight()):n=this.get("Host"),n){var t="["===n[0]?n.indexOf("]")+1:0,a=n.indexOf(":",t);return-1!==a?n.substring(0,a):n}})),_c(Ac,"host",bc.function((function(){return this.hostname}),"req.host: Use req.hostname instead")),_c(Ac,"fresh",(function(){var e=this.method,n=this.res,t=n.statusCode;return("GET"===e||"HEAD"===e)&&((t>=200&&t<300||304===t)&&jc(this.headers,{etag:n.get("ETag"),"last-modified":
|
|||
|
/*!
|
|||
|
* cookie
|
|||
|
* Copyright(c) 2012-2014 Roman Shtylman
|
|||
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
parse:function(e,n){if("string"!=typeof e)throw new TypeError("argument str must be a string");var t={},a=(n||{}).decode||Pc,i=0;for(;i<e.length;){var o=e.indexOf("=",i);if(-1===o)break;var r=e.indexOf(";",i);if(-1===r)r=e.length;else if(r<o){i=e.lastIndexOf(";",o-1)+1;continue}var s=e.slice(i,o).trim();if(void 0===t[s]){var c=e.slice(o+1,r).trim();34===c.charCodeAt(0)&&(c=c.slice(1,-1)),t[s]=Rc(c,a)}i=r+1}return t},serialize:function(e,n,t){var a=t||{},i=a.encode||Dc;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!Ic.test(e))throw new TypeError("argument name is invalid");var o=i(n);if(o&&!Ic.test(o))throw new TypeError("argument val is invalid");var r=e+"="+o;if(null!=a.maxAge){var s=a.maxAge-0;if(isNaN(s)||!isFinite(s))throw new TypeError("option maxAge is invalid");r+="; Max-Age="+Math.floor(s)}if(a.domain){if(!Ic.test(a.domain))throw new TypeError("option domain is invalid");r+="; Domain="+a.domain}if(a.path){if(!Ic.test(a.path))throw new TypeError("option path is invalid");r+="; Path="+a.path}if(a.expires){var c=a.expires;if(!function(e){return"[object Date]"===zc.call(e)||e instanceof Date}(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");r+="; Expires="+c.toUTCString()}a.httpOnly&&(r+="; HttpOnly");a.secure&&(r+="; Secure");if(a.priority){switch("string"==typeof a.priority?a.priority.toLowerCase():a.priority){case"low":r+="; Priority=Low";break;case"medium":r+="; Priority=Medium";break;case"high":r+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(a.sameSite){switch("string"==typeof a.sameSite?a.sameSite.toLowerCase():a.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return r}},zc=Object.prototype.toString,Ic=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Pc(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function Dc(e){return encodeURIComponent(e)}function Rc(e,n){try{return n(e)}catch(n){return e}}var Nc={};
|
|||
|
/*!
|
|||
|
* vary
|
|||
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
({get exports(){return Nc},set exports(e){Nc=e}}).exports=function(e,n){if(!e||!e.getHeader||!e.setHeader)throw new TypeError("res argument is required");var t=e.getHeader("Vary")||"",a=Array.isArray(t)?t.join(", "):String(t);(t=Lc(a,n))&&e.setHeader("Vary",t)}
|
|||
|
/*!
|
|||
|
* express
|
|||
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/,Nc.append=Lc;var Bc=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Lc(e,n){if("string"!=typeof e)throw new TypeError("header argument is required");if(!n)throw new TypeError("field argument is required");for(var t=Array.isArray(n)?n:Mc(String(n)),a=0;a<t.length;a++)if(!Bc.test(t[a]))throw new TypeError("field argument contains an invalid header name");if("*"===e)return e;var i=e,o=Mc(e.toLowerCase());if(-1!==t.indexOf("*")||-1!==o.indexOf("*"))return"*";for(var r=0;r<t.length;r++){var s=t[r].toLowerCase();-1===o.indexOf(s)&&(o.push(s),i=i?i+", "+t[r]:t[r])}return i}function Mc(e){for(var n=0,t=[],a=0,i=0,o=e.length;i<o;i++)switch(e.charCodeAt(i)){case 32:a===n&&(a=n=i+1);break;case 44:t.push(e.substring(a,n)),a=n=i+1;break;default:n=i+1}return t.push(e.substring(a,n)),t}var Uc=Eo.Buffer,Fc=So,Hc=ne,$c=A("express"),Vc=Ia,Wc=Ba,Gc=m,Jc=jo.isAbsolute,Zc=Pn,Yc=t,Xc=oe,Qc=Hi,Kc=Tc.sign,ep=jo.normalizeType,np=jo.normalizeTypes,tp=jo.setCharset,ap=qc,ip=Qo,op=Yc.extname,rp=ip.mime,sp=Yc.resolve,cp=Nc,pp=Object.create(Gc.ServerResponse.prototype),lp=pp,up=/;\s*charset\s*=/;function dp(e,n,t,a){var i,o=!1;function r(){if(!o){o=!0;var e=new Error("Request aborted");e.code="ECONNABORTED",a(e)}}function s(e){o||(o=!0,a(e))}n.on("directory",(function(){if(!o){o=!0;var e=new Error("EISDIR, read");e.code="EISDIR",a(e)}})),n.on("end",(function(){o||(o=!0,a())})),n.on("error",s),n.on("file",(function(){i=!1})),n.on("stream",(function(){i=!0})),Zc(e,(function(e){return e&&"ECONNRESET"===e.code?r():e?s(e):void(o||setImmediate((function(){!1===i||o?o||(o=!0,a()):r()})))})),t.headers&&n.on("headers",(function(e){for(var n=t.headers,a=Object.keys(n),i=0;i<a.length;i++){var o=a[i];e.setHeader(o,n[o])}})),n.pipe(e)}function fp(e,n,t,a){var i=n||t?JSON.stringify(e,n,t):JSON.stringify(e);return a&&"string"==typeof i&&(i=i.replace(/[<>&]/g,(function(e){switch(e.charCodeAt(0)){case 60:return"\\u003c";case 62:return"\\u003e";case 38:return"\\u0026";default:return e}}))),i}pp.status=function(e){return("string"==typeof e||Math.floor(e)!==e)&&e>99&&e<1e3&&$c("res.status("+JSON.stringify(e)+"): use res.status("+Math.floor(e)+") instead"),this.statusCode=e,this},pp.links=function(e){var n=this.get("Link")||"";return n&&(n+=", "),this.set("Link",n+Object.keys(e).map((function(n){return"<"+e[n]+'>; rel="'+n+'"'})).join(", "))},pp.send=function(e){var n,t,a=e,i=this.req,o=this.app;switch(2===arguments.length&&("number"!=typeof arguments[0]&&"number"==typeof arguments[1]?($c("res.send(body, status): Use res.status(status).send(body) instead"),this.statusCode=arguments[1]):($c("res.send(status, body): Use res.status(status).send(body) instead"),this.statusCode=arguments[0],a=arguments[1])),"number"==typeof a&&1===arguments.length&&(this.get("Content-Type")||this.type("txt"),$c("res.send(status): Use res.sendStatus(status) instead"),this.statusCode=a,a=Xc.message[a]),typeof a){case"string":this.get("Content-Type")||this.type("html");break;case"boolean":case"number":case"object":if(null===a)a="";else{if(!Uc.isBuffer(a))return this.json(a);this.get("Content-Type")||this.type("bin")}}"string"==typeof a&&(n="utf8","string"==typeof(t=this.get("Content-Type"))&&this.set("Content-Type",tp(t,"utf-8")));var r,s,c=o.get("etag fn"),p=!this.get("ETag")&&"function"==typeof c;return void 0!==a&&(Uc.isBuffer(a)?r=a.length:!p&&a.length<1e3?r=Uc.byteLength(a,n):(a=Uc.from(a,n),n=void 0,r=a.length),this.set("Content-Length",r)),p&&void 0!==r&&(s=c(a,n))&&this.set("ETag",s),i.fresh&&(this.statusCode=304),204!==this.statusCode&&304!==this.statusCode||(this.removeHeader("Content-Type"),this.removeHeader("Content-Length"),this.removeHeader("Transfer-Encoding"),a=""),205===this.statusCode&&(this.set("Content-Length","0"),this.removeHeader("Transfer-Encoding"),a=""),"HEAD"===i.method?this.end():this.end(a,n),this},pp.json=function(e){var n=e;2===arguments.length&&("number"==typeof arguments[1]?($c("res.json(obj, status): Use res.status(status).json(obj) instead"),this.statusCode=arguments[1]):($c("res.json(status, obj): Use res.status(status).json(obj) instead"),this.statusCode=argum
|
|||
|
/*!
|
|||
|
* express
|
|||
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/!function(e,n){var t=E,a=s.EventEmitter,i=va,o=wa,r=Ui,c=li,p=Cc,l=lp;(n=e.exports=function(){var e=function(n,t,a){e.handle(n,t,a)};return i(e,a.prototype,!1),i(e,o,!1),e.request=Object.create(p,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.response=Object.create(l,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.init(),e}).application=o,n.request=p,n.response=l,n.Route=r,n.Router=c,n.json=t.json,n.query=lo(),n.raw=t.raw,n.static=gp(),n.text=t.text,n.urlencoded=t.urlencoded;["bodyParser","compress","cookieSession","session","logger","cookieParser","favicon","responseTime","errorHandler","timeout","methodOverride","vhost","csrf","directory","limit","multipart","staticCache"].forEach((function(e){Object.defineProperty(n,e,{get:function(){throw new Error("Most middleware (like "+e+") is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.")},configurable:!0})}))}(j,k),w.exports=k;var xp=b(y),bp={},yp={get exports(){return bp},set exports(e){bp=e}},wp={};
|
|||
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|||
|
!function(e,n){var t=l,a=t.Buffer;function i(e,n){for(var t in e)n[t]=e[t]}function o(e,n,t){return a(e,n,t)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=t:(i(t,n),n.Buffer=o),o.prototype=Object.create(a.prototype),i(a,o),o.from=function(e,n,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,n,t)},o.alloc=function(e,n,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=a(e);return void 0!==n?"string"==typeof t?i.fill(n,t):i.fill(n):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return t.SlowBuffer(e)}}({get exports(){return wp},set exports(e){wp=e}},wp);var kp={
|
|||
|
/*!
|
|||
|
* cookie
|
|||
|
* Copyright(c) 2012-2014 Roman Shtylman
|
|||
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
parse:function(e,n){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var t={},a=n||{},i=e.split(";"),o=a.decode||jp,r=0;r<i.length;r++){var s=i[r],c=s.indexOf("=");if(!(c<0)){var p=s.substring(0,c).trim();if(null==t[p]){var l=s.substring(c+1,s.length).trim();'"'===l[0]&&(l=l.slice(1,-1)),t[p]=Op(l,o)}}}return t},serialize:function(e,n,t){var a=t||{},i=a.encode||Ep;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!Sp.test(e))throw new TypeError("argument name is invalid");var o=i(n);if(o&&!Sp.test(o))throw new TypeError("argument val is invalid");var r=e+"="+o;if(null!=a.maxAge){var s=a.maxAge-0;if(isNaN(s)||!isFinite(s))throw new TypeError("option maxAge is invalid");r+="; Max-Age="+Math.floor(s)}if(a.domain){if(!Sp.test(a.domain))throw new TypeError("option domain is invalid");r+="; Domain="+a.domain}if(a.path){if(!Sp.test(a.path))throw new TypeError("option path is invalid");r+="; Path="+a.path}if(a.expires){if("function"!=typeof a.expires.toUTCString)throw new TypeError("option expires is invalid");r+="; Expires="+a.expires.toUTCString()}a.httpOnly&&(r+="; HttpOnly");a.secure&&(r+="; Secure");if(a.sameSite){switch("string"==typeof a.sameSite?a.sameSite.toLowerCase():a.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return r}},jp=decodeURIComponent,Ep=encodeURIComponent,Sp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Op(e,n){try{return n(e)}catch(n){return e}}var Ap,Cp,_p,Tp,qp={},zp={},Ip={get exports(){return zp},set exports(e){zp=e}},Pp={},Dp={get exports(){return Pp},set exports(e){Pp=e}};function Rp(){if(Cp)return Ap;Cp=1;var e=1e3,n=60*e,t=60*n,a=24*t,i=365.25*a;function o(e,n,t){if(!(e<n))return e<1.5*n?Math.floor(e/n)+" "+t:Math.ceil(e/n)+" "+t+"s"}return Ap=function(r,s){s=s||{};var c=typeof r;if("string"===c&&r.length>0)return function(o){if((o=String(o)).length>100)return;var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(o);if(!r)return;var s=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*i;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*t;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(r);if("number"===c&&!1===isNaN(r))return s.long?function(i){return o(i,a,"day")||o(i,t,"hour")||o(i,n,"minute")||o(i,e,"second")||i+" ms"}(r):function(i){if(i>=a)return Math.round(i/a)+"d";if(i>=t)return Math.round(i/t)+"h";if(i>=n)return Math.round(i/n)+"m";if(i>=e)return Math.round(i/e)+"s";return i+"ms"}(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))}}function Np(){return _p||(_p=1,function(e,n){var t;function a(e){function a(){if(a.enabled){var e=a,i=+new Date,o=i-(t||i);e.diff=o,e.prev=t,e.curr=i,t=i;for(var r=new Array(arguments.length),s=0;s<r.length;s++)r[s]=arguments[s];r[0]=n.coerce(r[0]),"string"!=typeof r[0]&&r.unshift("%O");var c=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(function(t,a){if("%%"===t)return t;c++;var i=n.formatters[a];if("function"==typeof i){var o=r[c];t=i.call(e,o),r.splice(c,1),c--}return t})),n.formatArgs.call(e,r),(a.log||n.log||console.log.bind(console)).apply(e,r)}}return a.namespace=e,a.enabled=n.enabled(e),a.useColors=n.useColors(),a.color=function(e){var t,a=0;for(t in e)a=(a<<5)-a+e.charCodeAt(t),a|=0;return n.colors[Math.abs(a)%n.colors.length]}(e),"function"==typeof n.init&&n.init(a),a}(n=Dp.exports=a.debug=a.default=a).coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){n.enable("")},n.enable=function(e){n.save(e),n.names=[],n.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),a=t.length,i=0;i<a;i++)t
|
|||
|
/*!
|
|||
|
* on-headers
|
|||
|
* Copyright(c) 2014 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
var Up=function(e,n){if(!e)throw new TypeError("argument res is required");if("function"!=typeof n)throw new TypeError("argument listener must be a function");e.writeHead=function(e,n){var t=!1;return function(a){var i=Fp.apply(this,arguments);return t||(t=!0,n.call(this),"number"==typeof i[0]&&this.statusCode!==i[0]&&(i[0]=this.statusCode,i.length=1)),e.apply(this,i)}}(e.writeHead,n)};function Fp(e){var n=arguments.length,t=n>1&&"string"==typeof arguments[1]?2:1,a=n>=t+1?arguments[t]:void 0;this.statusCode=e,Array.isArray(a)?function(e,n){for(var t=0;t<n.length;t++)e.setHeader(n[t][0],n[t][1])}(this,a):a&&function(e,n){for(var t=Object.keys(n),a=0;a<t.length;a++){var i=t[a];i&&e.setHeader(i,n[i])}}(this,a);for(var i=new Array(Math.min(n,t)),o=0;o<i.length;o++)i[o]=arguments[o];return i}var Hp={},$p={get exports(){return Hp},set exports(e){Hp=e}},Vp={},Wp={get exports(){return Vp},set exports(e){Vp=e}},Gp=n,Jp=Gp.randomBytes===Gp.pseudoRandomBytes?1:3;function Zp(e,n,t){Gp.randomBytes(e,(function(a,i){return a?--n?void setTimeout(Zp.bind(null,e,n,t),10):t(a):t(null,i)}))}
|
|||
|
/*!
|
|||
|
* uid-safe
|
|||
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
* Copyright(c) 2015-2017 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/Wp.exports=function(e,n){if(void 0!==n&&"function"!=typeof n)throw new TypeError("argument callback must be a function");if(!n&&!x.Promise)throw new TypeError("argument callback is required");if(n)return Zp(e,Jp,n);return new Promise((function(n,t){Zp(e,Jp,(function(e,a){if(e)return t(e);n(a)}))}))},Vp.sync=function(e){for(var n=null,t=0;t<Jp;t++)try{return Gp.randomBytes(e)}catch(e){n=e}throw n};var Yp=Vp,Xp=/=+$/,Qp=/\+/g,Kp=/\//g;function el(e,n){Yp(e,(function(e,t){if(e)return n(e);n(null,nl(t))}))}function nl(e){return e.toString("base64").replace(Xp,"").replace(Qp,"-").replace(Kp,"_")}$p.exports=function(e,n){if(void 0!==n&&"function"!=typeof n)throw new TypeError("argument callback must be a function");if(!n&&!x.Promise)throw new TypeError("argument callback is required");if(n)return el(e,n);return new Promise((function(n,t){el(e,(function(e,a){if(e)return t(e);n(a)}))}))},Hp.sync=function(e){return nl(Yp.sync(e))};var tl={},al={get exports(){return tl},set exports(e){tl=e}},il=kp,ol=A("express-session");
|
|||
|
/*!
|
|||
|
* Prototype.
|
|||
|
*/
|
|||
|
(al.exports=function(e){if(this.path="/",this.maxAge=null,this.httpOnly=!0,e){if("object"!=typeof e)throw new TypeError("argument options must be a object");for(var n in e)"data"!==n&&(this[n]=e[n])}void 0!==this.originalMaxAge&&null!==this.originalMaxAge||(this.originalMaxAge=this.maxAge)}).prototype={set expires(e){this._expires=e,this.originalMaxAge=this.maxAge},get expires(){return this._expires},set maxAge(e){if(e&&"number"!=typeof e&&!(e instanceof Date))throw new TypeError("maxAge must be a number or Date");e instanceof Date&&ol("maxAge as Date; pass number of milliseconds instead"),this.expires="number"==typeof e?new Date(Date.now()+e):e},get maxAge(){return this.expires instanceof Date?this.expires.valueOf()-Date.now():this.expires},get data(){return{originalMaxAge:this.originalMaxAge,expires:this._expires,secure:this.secure,httpOnly:this.httpOnly,domain:this.domain,path:this.path,sameSite:this.sameSite}},serialize:function(e,n){return il.serialize(e,n,this.data)},toJSON:function(){return this.data}};
|
|||
|
/*!
|
|||
|
* Connect - session - Session
|
|||
|
* Copyright(c) 2010 Sencha Inc.
|
|||
|
* Copyright(c) 2011 TJ Holowaychuk
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
var rl=sl;function sl(e,n){if(Object.defineProperty(this,"req",{value:e}),Object.defineProperty(this,"id",{value:e.sessionID}),"object"==typeof n&&null!==n)for(var t in n)t in this||(this[t]=n[t])}function cl(e,n,t){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value:t,writable:!0})}
|
|||
|
/*!
|
|||
|
* Connect - session - Store
|
|||
|
* Copyright(c) 2010 Sencha Inc.
|
|||
|
* Copyright(c) 2011 TJ Holowaychuk
|
|||
|
* MIT Licensed
|
|||
|
*/cl(sl.prototype,"touch",(function(){return this.resetMaxAge()})),cl(sl.prototype,"resetMaxAge",(function(){return this.cookie.maxAge=this.cookie.originalMaxAge,this})),cl(sl.prototype,"save",(function(e){return this.req.sessionStore.set(this.id,this,e||function(){}),this})),cl(sl.prototype,"reload",(function(e){var n=this.req,t=this.req.sessionStore;return t.get(this.id,(function(a,i){return a?e(a):i?(t.createSession(n,i),void e()):e(new Error("failed to load session"))})),this})),cl(sl.prototype,"destroy",(function(e){return delete this.req.session,this.req.sessionStore.destroy(this.id,e),this})),cl(sl.prototype,"regenerate",(function(e){return this.req.sessionStore.regenerate(this.req,e),this}));var pl=tl,ll=s.EventEmitter,ul=rl,dl=fl;function fl(){ll.call(this)}i.inherits(fl,ll),fl.prototype.regenerate=function(e,n){var t=this;this.destroy(e.sessionID,(function(a){t.generate(e),n(a)}))},fl.prototype.load=function(e,n){var t=this;this.get(e,(function(a,i){if(a)return n(a);if(!i)return n();var o={sessionID:e,sessionStore:t};n(null,t.createSession(o,i))}))},fl.prototype.createSession=function(e,n){var t=n.cookie.expires,a=n.cookie.originalMaxAge;return n.cookie=new pl(n.cookie),"string"==typeof t&&(n.cookie.expires=new Date(t)),n.cookie.originalMaxAge=a,e.session=new ul(e,n),e.session};
|
|||
|
/*!
|
|||
|
* express-session
|
|||
|
* Copyright(c) 2010 Sencha Inc.
|
|||
|
* Copyright(c) 2011 TJ Holowaychuk
|
|||
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/
|
|||
|
var ml=dl,vl="function"==typeof setImmediate?setImmediate:function(e){process.nextTick(e.bind.apply(e,arguments))},hl=gl;function gl(){ml.call(this),this.sessions=Object.create(null)}function xl(e){var n=this.sessions[e];if(n){if((n=JSON.parse(n)).cookie){var t="string"==typeof n.cookie.expires?new Date(n.cookie.expires):n.cookie.expires;if(t&&t<=Date.now())return void delete this.sessions[e]}return n}}
|
|||
|
/*!
|
|||
|
* express-session
|
|||
|
* Copyright(c) 2010 Sencha Inc.
|
|||
|
* Copyright(c) 2011 TJ Holowaychuk
|
|||
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
* MIT Licensed
|
|||
|
*/i.inherits(gl,ml),gl.prototype.all=function(e){for(var n=Object.keys(this.sessions),t=Object.create(null),a=0;a<n.length;a++){var i=n[a],o=xl.call(this,i);o&&(t[i]=o)}e&&vl(e,null,t)},gl.prototype.clear=function(e){this.sessions=Object.create(null),e&&vl(e)},gl.prototype.destroy=function(e,n){delete this.sessions[e],n&&vl(n)},gl.prototype.get=function(e,n){vl(n,null,xl.call(this,e))},gl.prototype.set=function(e,n,t){this.sessions[e]=JSON.stringify(n),t&&vl(t)},gl.prototype.length=function(e){this.all((function(n,t){if(n)return e(n);e(null,Object.keys(t).length)}))},gl.prototype.touch=function(e,n,t){var a=xl.call(this,e);a&&(a.cookie=n.cookie,this.sessions[e]=JSON.stringify(a)),t&&vl(t)},function(e,t){var a=wp.Buffer,i=kp,o=n,r=qp("express-session"),s=A("express-session"),c=Up,p=La,l=Tc,u=Hp.sync,d=tl,f=hl,m=rl,v=dl,h=process.env.NODE_ENV;t=e.exports=function(e){var n=e||{},t=n.cookie||{},o=n.genid||b,u=n.name||n.key||"connect.sid",v=n.store||new f,j=n.proxy,E=n.resave,S=Boolean(n.rolling),O=n.saveUninitialized,A=n.secret;if("function"!=typeof o)throw new TypeError("genid option must be a function");void 0===E&&(s("undefined resave option; provide resave option"),E=!0);void 0===O&&(s("undefined saveUninitialized option; provide saveUninitialized option"),O=!0);if(n.unset&&"destroy"!==n.unset&&"keep"!==n.unset)throw new TypeError('unset option must be "destroy" or "keep"');var C="destroy"===n.unset;if(Array.isArray(A)&&0===A.length)throw new TypeError("secret option array must contain one or more strings");A&&!Array.isArray(A)&&(A=[A]);A||s("req.secret; provide secret option");"production"===h&&v instanceof f&&console.warn(g);v.generate=function(e){e.sessionID=o(e),e.session=new m(e),e.session.cookie=new d(t),"auto"===t.secure&&(e.session.cookie.secure=w(e,j))};var _="function"==typeof v.touch,T=!0;return v.on("disconnect",(function(){T=!1})),v.on("connect",(function(){T=!0})),function(e,n,o){if(e.session)o();else{if(!T)return r("store is disconnected"),void o();if(0!==(p.original(e).pathname||"/").indexOf(t.path||"/"))return o();if(A||e.secret){var d,f,m,h=A||[e.secret],g=!1;e.sessionStore=v;var b=e.sessionID=function(e,n,t){var a,o,c=e.headers.cookie;if(c){(a=i.parse(c)[n])&&("s:"===a.substr(0,2)?!1===(o=k(a.slice(2),t))&&(r("cookie signature invalid"),o=void 0):r("cookie unsigned"))}!o&&e.signedCookies&&(o=e.signedCookies[n])&&s("cookie should be available in req.headers.cookie");!o&&e.cookies&&(a=e.cookies[n])&&("s:"===a.substr(0,2)?((o=k(a.slice(2),t))&&s("cookie should be available in req.headers.cookie"),!1===o&&(r("cookie signature invalid"),o=void 0)):r("cookie unsigned"));return o}(e,u,h);c(n,(function(){e.session?function(e){if("string"!=typeof e.sessionID)return!1;return b!==e.sessionID?O||R(e.session):S||null!=e.session.cookie.expires&&R(e.session)}(e)&&(!e.session.cookie.secure||w(e,j)?(g||(e.session.touch(),g=!0),function(e,n,t,a,o){var s="s:"+l.sign(t,a),c=i.serialize(n,s,o);r("set-cookie %s",c);var p=e.getHeader("Set-Cookie")||[],u=Array.isArray(p)?p.concat(c):[p,c];e.setHeader("Set-Cookie",u)}(n,u,e.sessionID,h[0],e.session.cookie.data)):r("not secured")):r("no session")}));var q=n.end,z=n.write,I=!1;if(n.end=function(t,i){if(I)return!1;var s;I=!0;var c=!0;function p(){if(c)return s=q.call(n,t,i),void(c=!1);q.call(n)}function l(){if(!c)return s;if(n._header||n._implicitHeader(),null==t)return s=!0;var e=Number(n.getHeader("Content-Length"));return!isNaN(e)&&e>0&&(t=a.isBuffer(t)?t:a.from(t,i),i=void 0,0!==t.length)?(r("split response"),s=z.call(n,t.slice(0,t.length-1)),t=t.slice(t.length-1,t.length),s):(s=z.call(n,t,i),c=!1,s)}return function(e){return e.sessionID&&C&&null==e.session}(e)?(r("destroying"),v.destroy(e.sessionID,(function(e){e&&x(o,e),r("destroyed"),p()})),l()):e.session?(g||(e.session.touch(),g=!0),N(e)?(e.session.save((function(e){e&&x(o,e),p()})),l()):_&&function(e){if("string"!=typeof e.sessionID)return r("session ignored because of bogus req.sessionID %o",e.sessionID),!1;return b===e.sessionID&&!N(e)}(e)?(r("touching"),v.touch(e.sessionID,e.session,(function(e){e&&x(o,e),r("touched
|