UNPKG

postman-sandbox

Version:

Sandbox for Postman Scripts to run in Node.js or browser

1 lines 2.44 MB
module.exports=c=>c(null,"\"function\"==typeof require&&(globalThis._nodeRequires={buffer:require(\"buffer\")},require=null),require=function e(t,n,a){function r(o,s){if(!n[o]){if(!t[o]){var c=\"function\"==typeof require&&require;if(!s&&c)return c(o,!0);if(i)return i(o,!0);var u=new Error(\"Cannot find module '\"+o+\"'\");throw u.code=\"MODULE_NOT_FOUND\",u}var l=n[o]={exports:{}};t[o][0].call(l.exports,(function(e){return r(t[o][1][e]||e)}),l,l.exports,e,t,n,a)}return n[o].exports}for(var i=\"function\"==typeof require&&require,o=0;o<a.length;o++)r(a[o]);return r}({1:[function(e,t,n){var a=e(\"teleport-javascript\"),r=Array.prototype.slice,i=[\"log\",\"warn\",\"debug\",\"info\",\"error\",\"clear\"];function o(e,t){if(\"function\"==typeof t){const e=t.constructor&&t.constructor.name?t.constructor.name:\"Function\";return t.name?`[${e}: ${t.name}]`:`[${e}]`}return t instanceof WeakMap?\"[WeakMap]\":t instanceof WeakSet?\"[WeakSet]\":t instanceof ArrayBuffer?`[ArrayBuffer { byteLength: ${t.byteLength} }]`:t}t.exports=function PostmanConsole(e,t,n){const s=function(i){const s=r.call(arguments,1);n&&n[i].apply(n,s),e.dispatch(\"execution.console\",t,i,a.stringify(s,o))};i.forEach((t=>{this[t]=s.bind(e,t)}))}},{\"teleport-javascript\":587}],2:[function(e,t,n){const a=e(\"@postman/tough-cookie\").CookieJar,r=e(\"@postman/tough-cookie\").Cookie,i=e(\"postman-collection\").Cookie,o=e(\"postman-collection\").CookieList,s=e(\"postman-collection\").Url,c=\"function\",u=\"object\",l=\"string\",p=function(e){if(e)return r.fromJSON({key:e.name||e.key,value:e.value,expires:e.expires,maxAge:e.maxAge,domain:e.domain,path:e.path,secure:e.secure,httpOnly:e.httpOnly,hostOnly:e.hostOnly,extensions:e.extensions})},d=function(e){if(e)return new i({name:e.key,value:e.value,expires:\"Infinity\"===e.expires?null:e.expires,maxAge:e.maxAge,domain:e.domain,path:e.path,secure:e.secure,httpOnly:e.httpOnly,hostOnly:e.hostOnly,extensions:e.extensions})},f=function(e){return s.isUrl(e)?e:e&&typeof e===l?new s(e):null},h=function(e,t,n){if(typeof e===c)return t?e(t instanceof Error?t:new Error(t)):void e(null,n)},m=function(e,t,n){const a=()=>new Promise(((t,n)=>{e((function(e,a){if(e)return n(e instanceof Error?e:new Error(e));t(a)}))}));if(void 0===t)return a();if(typeof t!==c&&n)throw new TypeError(\"callback needs to be a function\");a().then((e=>{h(t,null,e)})).catch((e=>{h(t,e)}))},g=function(e,t,n,a){e.getCookies(t,(function(e,t){var r,i;if(e)return a(e);if(!t||!t.length)return a(null,null);for(r=0,i=t.length;r<i;r++)if(t[r].key===n)return a(null,t[r]);a(null,null)}))};t.exports=class PostmanCookieJar{constructor(e){this.store=e,this.jar=new a(e,{rejectPublicSuffixes:!1,looseMode:!0})}get(e,t,n){return m((n=>{if(!(e=f(e)))throw new TypeError(\"CookieJar.get() requires a valid url\");if(typeof t!==l)throw new TypeError(\"CookieJar.get() requires cookie name to be a string\");g(this.jar,e.toString(!0),t,(function(e,t){return e||!t?n(e,null):(t=d(t),n(null,t.valueOf()))}))}),n,!0)}getAll(e,t,n){return typeof t!==c||n||(n=t,t={}),void 0!==t||n||(t={}),m((n=>{if(!(e=f(e)))throw new TypeError(\"CookieJar.getAll() requires a valid url\");if(typeof t!==u)throw new TypeError(\"CookieJar.getAll() requires options to be an object\");t={http:!Object.hasOwn(t,\"http\")||Boolean(t.http),secure:Object.hasOwn(t,\"secure\")?Boolean(t.secure):void 0},this.jar.getCookies(e.toString(!0),t,(function(e,t){if(e)return n(e);n(null,new o(null,t&&t.map(d)))}))}),n,!0)}set(e,t,n,a){return typeof n!==c||a||(a=n,n=null),m((a=>{if(!(e=f(e)))throw new TypeError(\"CookieJar.set() requires a valid url\");var r;if(t&&n)r=p({name:t,value:n});else if(typeof t===u)r=p(t);else{if(typeof t!==l)throw new TypeError(\"CookieJar.set() requires a valid set cookie arguments\");r=t}this.jar.setCookie(r,e.toString(!0),(function(e,t){if(e)return a(e);a(null,d(t))}))}),a)}unset(e,t,n){return m((n=>{if(!(e=f(e)))throw new TypeError(\"CookieJar.unset() requires a valid url\");if(typeof t!==l)throw new TypeError(\"CookieJar.unset() requires cookie name to be a string\");var a=this.store;g(this.jar,e.toString(!0),t,(function(e,t){if(e||!t)return n(e);a.removeCookie(t.domain,t.path,t.key,(function(e){n(e)}))}))}),n)}clear(e,t){return m((t=>{if(!(e=f(e)))throw new TypeError(\"CookieJar.clear() requires a valid url\");var n=this.store;this.jar.getCookies(e.toString(!0),(function(e,a){if(e||!a)return t(e);!function(e,t,n){if(!n&&(n=function(){}),!Array.isArray(e)||!t)return n();var a=0,r=e.length,i=function(o){if(o||a>=r)return n(o);try{t.call(e,e[a++],i)}catch(s){return n(s)}};if(!r)return n();i()}(a,(function(e,t){n.removeCookie(e.domain,e.path,e.key,t)}),t)}))}),t)}}},{\"@postman/tough-cookie\":182,\"postman-collection\":\"postman-collection\"}],3:[function(e,t,n){const a=e(\"lodash\"),r=e(\"@postman/tough-cookie\").Store,i=e(\"@postman/tough-cookie\").Cookie,o=Array.prototype.slice;class PostmanCookieStore extends r{constructor(e,t,n){super(),this.id=e,this.emitter=t,this.timers=n}}PostmanCookieStore.prototype.synchronous=!1,[\"findCookie\",\"findCookies\",\"putCookie\",\"updateCookie\",\"removeCookie\",\"removeCookies\",\"removeAllCookies\",\"getAllCookies\"].forEach((function(e){PostmanCookieStore.prototype[e]=function(){const t=\"execution.cookies.\"+this.id;let n,s,c;n=o.call(arguments),n.length=a.get(r.prototype,[e,\"length\"],0),c=n.pop(),s=this.timers.setEvent((function(e,t){if(\"function\"!=typeof c)throw new TypeError(\"callback is not a function\");return e||!t?c(e):Array.isArray(t)?c(e,t.map((function(e){return i.fromJSON(e)}))):void c(e,i.fromJSON(t))})),this.timers.wrapped.setTimeout((()=>{this.emitter.dispatch(t,s,\"store\",e,n)}))}})),t.exports=PostmanCookieStore},{\"@postman/tough-cookie\":182,lodash:\"lodash\"}],4:[function(e,t,n){const{isNonLegacySandbox:a}=e(\"./non-legacy-codemarkers\"),r=e(\"lodash\"),i=e(\"./postman-legacy-interface\"),o={atob:'global \"atob\" function',btoa:'global \"btoa\" function',\"crypto-js\":'global \"crypto\" object',tv4:'\"ajv\" library',backbone:null};t.exports=function(t,n,s,c,u,l,p,d){if(!n||!r.isString(n))return u.terminate();t.reset(),a(n)||d.disableLegacyAPIs?i.teardown(t):i.setup(t,s,c),t.import({Buffer:e(\"buffer\").Buffer,File:e(\"buffer\").File,console:c,pm:l,setTimeout:u.setTimeout,setInterval:u.setInterval,setImmediate:u.setImmediate,clearTimeout:u.clearTimeout,clearInterval:u.clearInterval,clearImmediate:u.clearImmediate,require:(...t)=>{const n=t?.[0],a=o[n];return void 0!==a&&c.warn(`Using \"${n}\" library is deprecated.${null!==a?` Use ${a} instead.`:\"\"}`),e(...t)}}),t.exec(n,{async:!0},(function(e){s.return.async=u.queueLength()>0,i.finish(t,l,p),u.wrapped.setImmediate((function(){if(s.return.async)return e&&u.error(e);u.terminate(e)}))}))}},{\"./non-legacy-codemarkers\":7,\"./postman-legacy-interface\":12,buffer:\"buffer\",lodash:\"lodash\"}],5:[function(e,t,n){const a=e(\"lodash\"),r=e(\"chai\"),i=e(\"ajv\"),o=e(\"uniscope\"),s=e(\"postman-collection\"),c=s.Event,u=e(\"./execution\"),l=e(\"./console\"),p=e(\"./timers\"),d=e(\"./pmapi\"),f=e(\"./cookie-store\"),h=e(\"./pm-require\"),{Vault:m,getVaultInterface:g}=e(\"./vault\"),{isNonLegacySandbox:y,getNonLegacyCodeMarker:v}=e(\"./non-legacy-codemarkers\"),b=e(\"./execute-context\");t.exports=function(t,n){const x=o.create({eval:!0,ignore:[\"require\"],block:[\"bridge\"]});let w,k={};t.once(\"initialize\",(({template:n,...c})=>{if(k=c||{},!n)return r.use(e(\"chai-postman\")(s,a,i)),t.dispatch(\"initialize\");const u={exports:{}},l=o.create({eval:!0,ignore:[\"require\"],block:[\"bridge\"]});l.import({Buffer:e(\"buffer\").Buffer,module:u}),l.exec(n,(e=>{if(e)return t.dispatch(\"initialize\",e);const{chaiPlugin:n,initializeExecution:i}=u&&u.exports||{};a.isFunction(n)&&r.use(n),a.isFunction(i)&&(w=i),t.dispatch(\"initialize\")}))})),t.on(\"execute\",(function(e,r,i,o){if(!e||!a.isString(e))return t.dispatch(\"error\",new Error(\"sandbox: execution identifier parameter(s) missing\"));!o&&(o={}),!i&&(i={}),r=new c(r);const s=\"execution.result.\"+e,_=\"execution.request.\"+e,j=\"execution.error.\"+e,S=\"execution.abort.\"+e,A=\"execution.response.\"+e,E=\"execution.cookies.\"+e,C=\"execution.assertion.\"+e,T=\"execution.skipRequest.\"+e,P=(e=>{if(\"string\"!=typeof e)return;const t=`;(async()=>{;\\n ${e}\\n ;})().then(__exitscope).catch(__exitscope);`;return y(e)?`${v()}${t}`:t})(r.script?.toSource()),D=new u(e,r,i,{...o,initializeExecution:w}),O=[...k.disabledAPIs||[]],M=function(e){!Array.isArray(e)&&(e=[e]),t.dispatch(C,o.cursor,e),t.dispatch(\"execution.assertion\",o.cursor,e)},N=function(e){t.dispatch(j,o.cursor,e),t.dispatch(\"execution.error\",o.cursor,e)};let R,B,L,I=!1;D.return.async=!1,B=new p(null,(function(e){e&&N(e)}),(function(){D.return.async=!0}),(function(e,n){function a(){L.dispose(),t.off(S),t.off(A),t.off(E),t.off(\"uncaughtException\",N),D.response&&delete D.response,t.dispatch(s,e||null,D)}R&&(R=B.wrapped.clearTimeout(R)),B&&(B.seal(),B.clearAll()),e&&N(e),!0!==n&&(I?a():B.wrapped.setImmediate(a))})),a.isFinite(o.timeout)&&(R=B.wrapped.setTimeout((function(){B.terminate(new Error(\"sandbox: \"+(D.return.async?\"asynchronous\":\"synchronous\")+\" script execution timeout\"))}),o.timeout)),t.on(S,(function(){B.terminate(null,!0)})),t.on(A,(function(e,t,n,a){B.clearEvent(e,t,n,a)})),t.on(E,(function(e,t,n){B.clearEvent(e,t,n)})),t.on(\"uncaughtException\",N),o.resolvedPackages||O.push(\"require\"),L=new m(e,t,B),b(x,P,D,new l(t,o.cursor,o.debug&&n.console),B,new d(D,(function(n,a){var r=B.setEvent(a);t.dispatch(_,o.cursor,e,r,n)}),(function(){if(!D||\"prerequest\"!==D.target)throw new TypeError(\"pm.execution.skipRequest is not a function\");I=!0,t.dispatch(T,o.cursor),B.terminate(null)}),M,new f(e,t,B),g(L.exec.bind(L)),h(o.resolvedPackages,x),{disabledAPIs:O}),M,{disableLegacyAPIs:k.disableLegacyAPIs})}))}},{\"./console\":1,\"./cookie-store\":3,\"./execute-context\":4,\"./execution\":6,\"./non-legacy-codemarkers\":7,\"./pm-require\":9,\"./pmapi\":11,\"./timers\":14,\"./vault\":15,ajv:\"ajv\",buffer:\"buffer\",chai:\"chai\",\"chai-postman\":245,lodash:\"lodash\",\"postman-collection\":\"postman-collection\",uniscope:589}],6:[function(e,t,n){const a=e(\"lodash\"),r=e(\"postman-collection\"),i=\"request\",o=\"script\",s=\"data\",c=\"response\",u={test:!0,prerequest:!0},l={test:!0},p=[\"_variables\",\"environment\",\"collectionVariables\",\"globals\"],d={autoCompact:!0};t.exports=class{constructor(e,t,n,f){if(this.id=e,this.target=t.listen||o,this.legacy=f.legacy||{},this.cursor=a.isObject(f.cursor)?f.cursor:{},this.data=a.get(n,s,{}),this.cookies=new r.CookieList(null,n.cookies),p.forEach((e=>{this[e]=r.VariableScope.isVariableScope(n[e])?n[e]:new r.VariableScope(n[e]),this[e].enableTracking(d)})),f.initializeExecution){const{request:e,response:t,message:a}=f.initializeExecution(this.target,n)||{};this.request=e,this.response=t,this.message=a}else(u[this.target]||a.has(n,i))&&(this.request=r.Request.isRequest(n.request)?n.request:new r.Request(n.request)),(l[this.target]||a.has(n,c))&&(this.response=r.Response.isResponse(n.response)?n.response:new r.Response(n.response));this.return={}}toJSON(){return a.mapValues(this,(function(e){return a.isFunction(e&&e.toJSON)?e.toJSON():e}))}}},{lodash:\"lodash\",\"postman-collection\":\"postman-collection\"}],7:[function(e,t,n){const a={'\"use sandbox2\";':!0,\"'use sandbox2';\":!0};t.exports={isNonLegacySandbox:e=>a[e.substr(0,15)],getNonLegacyCodeMarker:()=>Object.keys(a)[0]}},{}],8:[function(e,t,n){t.exports={listener:e=>function(t){this.dispatch(e,t)}}},{}],9:[function(e,t,n){const{LEGACY_GLOBS:a}=e(\"./postman-legacy-interface\"),r=\"__module_obj\",i=[\"((exports, module) => {\\n\",`\\n})(${r}.exports, ${r});`];class PostmanRequireStore{constructor(e){if(!e)throw new Error(\"File cache is required\");this.fileCache=e}hasFile(e){return Boolean(this.getFile(e))}getFile(e){return this.fileCache[e]}getResolvedPath(e){if(this.hasFile(e))return e}getFileData(e){return this.hasFile(e)&&this.getFile(e).data}hasError(e){return this.hasFile(e)&&Boolean(this.getFile(e).error)}getFileError(e){return this.hasError(e)&&this.getFile(e).error}}t.exports=function createPostmanRequire(e,t){const n=new PostmanRequireStore(e||{}),o={};return function(e){const s=n.getResolvedPath(e);if(!s)throw new Error(`Cannot find package '${e}'`);if(n.hasError(s))throw new Error(`Error while loading package '${e}': ${n.getFileError(s)}`);if(o[s])return o[s].exports;const c=n.getFileData(s),u={id:s,exports:{}};o[u.id]=u;const l=i[0]+c+i[1];return t.import({[r]:u}),t.exec(l,{async:!0,block:a},(t=>{if(t)throw new Error(`Error in package '${e}': ${t.message?t.message:t}`)})),t.unset(r),u.exports}}},{\"./postman-legacy-interface\":12}],10:[function(e,t,n){t.exports=function(e,t){var n=0,a=function(e,t){return{name:String(e),async:!1,skipped:Boolean(t),passed:!0,error:null,index:n++}},r=function(e,t){e.error=t,e.passed=!1};e.test=function(n,i){var o=a(n,!1);if(\"function\"!=typeof i)return t(o),e;if(i.length)try{o.async=!0,i((function(e){o.error&&!1===o.passed||(e&&r(o,e),t(o))}))}catch(s){r(o,s),t(o)}else{try{i()}catch(s){r(o,s)}t(o)}return e},e.test.skip=function(n){return t(a(n,!0)),e},e.test.index=function(){return n}}},{}],11:[function(e,t,n){const a=e(\"lodash\"),r=e(\"postman-collection\"),i=e(\"./cookie-jar\"),o=r.VariableScope,s=r.Request,c=r.Response,u=r.CookieList,l=e(\"chai\"),p=function(e,t,n=[]){var r,i={writable:!1};for(r in t)!a.includes(n,r)&&Object.hasOwn(t,r)&&void 0!==t[r]&&(i.value=t[r],Object.defineProperty(e,r,i));return e},d=e(\"./pmapi-setup-runner\");function Postman(e,t,n,r,f,h,m,g={}){let y=new o;y.syncVariablesFrom(e.data),e._variables.addLayer(y.values),e._variables.addLayer(e.environment.values),e._variables.addLayer(e.collectionVariables.values),e._variables.addLayer(e.globals.values),e.cookies&&(e.cookies.jar=function(){return new i(f)}),p(this,{info:p({},{eventName:e.target,iteration:e.cursor.iteration,iterationCount:e.cursor.cycles,requestName:e.legacy._itemName,requestId:e.legacy._itemId}),vault:h,globals:e.globals,environment:e.environment,collectionVariables:e.collectionVariables,variables:e._variables,iterationData:y,request:e.request,response:e.response,message:e.message,cookies:e.cookies,visualizer:{set(t,n,a){if(\"string\"!=typeof t)throw new Error(\"Invalid template. Template must be of type string, found \"+typeof t);if(n&&\"object\"!=typeof n)throw new Error(\"Invalid data. Data must be an object, found \"+typeof n);if(a&&\"object\"!=typeof a)throw new Error(\"Invalid options. Options must be an object, found \"+typeof a);e.return.visualizer={template:t,data:n,options:a}},clear(){e.return.visualizer=void 0}},sendRequest:function(e,n){let r;const i=this,o=()=>new Promise((function(n,a){e?t(s.isRequest(e)?e:new s(e),(function(e,t,i){if(i&&!u.isCookieList(i.cookies)&&(i.cookies=new u({},i.cookies)),r=i,e)return a(e);n(c.isResponse(t)?t:new c(t))})):a(new Error(\"sendrequest: nothing to request\"))}));return a.isFunction(n)?(o().then((e=>{n.call(i,null,e,r)})).catch((e=>{n.call(i,e)})),i):o()},execution:{skipRequest:n,location:p(e.legacy._itemPath||[],{current:e.legacy._eventItemName}),setNextRequest:function(t){e.return&&(e.return.nextRequest=t)}},require:function(e){return m(e)}},g.disabledAPIs),d(this,r),this.response&&Object.defineProperty(this.response,\"to\",{get(){return l.expect(this).to}}),this.request&&Object.defineProperty(this.request,\"to\",{get(){return l.expect(this).to}}),y=null}Postman.prototype.expect=l.expect,t.exports=Postman},{\"./cookie-jar\":2,\"./pmapi-setup-runner\":10,chai:\"chai\",lodash:\"lodash\",\"postman-collection\":\"postman-collection\"}],12:[function(e,t,n){const a=e(\"lodash\"),r={JSON:e(\"liquid-json\"),_:e(\"lodash3\").noConflict(),CryptoJS:e(\"crypto-js\"),tv4:e(\"tv4\"),xml2Json:e(\"./xml2Json\"),Backbone:e(\"backbone\"),cheerio:e(\"cheerio\")},i=[\"tests\",\"globals\",\"environment\",\"data\",\"request\",\"responseCookies\",\"responseHeaders\",\"responseTime\",\"responseCode\",\"responseBody\",\"iteration\",\"postman\",\"_\",\"CryptoJS\",\"tv4\",\"xml2Json\",\"Backbone\",\"cheerio\"],o={tests:'\"pm.test()\"',globals:'\"pm.globals\"',environment:'\"pm.environment\"',data:'\"pm.iterationData\"',request:'\"pm.request\"',responseCookies:'\"pm.cookies\"',responseHeaders:'\"pm.response.headers\"',responseTime:'\"pm.response.responseTime\"',responseCode:'\"pm.response.code\"',responseBody:'\"pm.response.text()\"',iteration:'\"pm.info.iteration\"',_:\"\\\"require('lodash')\\\"\",CryptoJS:'global \"crypto\" object',tv4:\"\\\"require('ajv')\\\"\",xml2Json:\"\\\"require('xml2js')\\\"\",cheerio:\"\\\"require('cheerio')\\\"\",\"postman.setNextRequest\":'\"pm.execution.setNextRequest()\"',\"postman.setEnvironmentVariable\":'\"pm.environment.set()\"',\"postman.getEnvironmentVariable\":'\"pm.environment.get()\"',\"postman.clearEnvironmentVariables\":'\"pm.environment.clear()\"',\"postman.clearEnvironmentVariable\":'\"pm.environment.unset()\"',\"postman.setGlobalVariable\":'\"pm.globals.set()\"',\"postman.getGlobalVariable\":'\"pm.globals.get()\"',\"postman.clearGlobalVariables\":'\"pm.globals.clear()\"',\"postman.clearGlobalVariable\":'\"pm.globals.unset()\"',\"postman.getResponseCookie\":'\"pm.cookies.get()\"',\"postman.getResponseHeader\":'\"pm.response.headers.get()\"'},s=\"function\",c=\"test\",u=\"raw\",l=\"urlencoded\",p=\"formdata\",d=\"file\";function f(e,t,n){t.has(e)||(t.add(e),o[e]?n.warn(`Using \"${e}\" is deprecated. Use ${o[e]} instead.`):i.includes(e)&&n.warn(`Using \"${e}\" is deprecated.`))}class PostmanLegacyInterface{constructor(e,t){this.__execution=e,this.__environment=t.environment,this.__globals=t.globals}setEnvironmentVariable(e,t){return!1!==t&&!t||typeof(t&&t.toString)!==s||(t=t.toString()),this.__environment[e]=t,this.__execution.environment.set(e,t)}getEnvironmentVariable(e){return this.__execution.environment.get(e)}clearEnvironmentVariables(){for(var e in this.__environment)Object.hasOwn(this.__environment,e)&&delete this.__environment[e];return this.__execution.environment.clear()}clearEnvironmentVariable(e){return e&&delete this.__environment[e],this.__execution.environment.unset(e)}setGlobalVariable(e,t){return!1!==t&&!t||typeof(t&&t.toString)!==s||(t=t.toString()),this.__globals[e]=t,this.__execution.globals.set(e,t)}getGlobalVariable(e){return this.__execution.globals.get(e)}clearGlobalVariables(){for(var e in this.__globals)Object.hasOwn(this.__globals,e)&&delete this.__globals[e];return this.__execution.globals.clear()}clearGlobalVariable(e){return e&&delete this.__globals[e],this.__execution.globals.unset(e)}setNextRequest(e){this.__execution.return&&(this.__execution.return.nextRequest=e)}}class PostmanLegacyTestInterface extends PostmanLegacyInterface{getResponseCookie(e){return this.__execution.cookies?this.__execution.cookies.one(String(e)):void 0}getResponseHeader(e){var t=this.__execution.response&&this.__execution.response.headers&&this.__execution.response.headers.one(e);return t?t.value:void 0}}t.exports={setup(e,t,n){var o,s,h=a.assign({},r);h.tests={},h.globals=t.globals.syncVariablesTo(),h.environment=t.environment.syncVariablesTo(),h.data=t.data||(t.data={}),h.request=t.request?{id:t.legacy?t.legacy._itemId:void 0,name:t.legacy?t.legacy._itemName:void 0,description:t.request.description?t.request.description.toString():void 0,headers:t.request.headers.toObject(!0,!1,!0,!0),method:t.request.method,url:t.request.url.toString(),data:(o=t.request,s=function(e){var t,n,r=a.get(e,\"body.mode\"),i=a.get(e,\"body\");if(i&&!i.isEmpty())return t=i[r],a.isFunction(t&&t.all)&&(t=t.all()),r===u?n={body:t}:r===l?n={form:a.reduce(t,(function(e,t){return t.disabled||(e[t.key]?a.isArray(e[t.key])?e[t.key].push(t.value):e[t.key]=[e[t.key],t.value]:e[t.key]=t.value),e}),{})}:e.body.mode===p?n={formData:a.reduce(t,(function(e,t){return t.disabled||(e[t.key]?a.isArray(e[t.key])?e[t.key].push(t.value):e[t.key]=[e[t.key],t.value]:e[t.key]=t.value),e}),{})}:e.body.mode===d&&(n={body:a.get(e,\"body.file.content\")}),n}(o),s&&(s.form||s.formData||s.body)||{})}:{},t.target===c&&(h.responseCookies=t.cookies||[],h.responseHeaders={},t.response&&t.response.headers.each((function(e){e&&!e.disabled&&(h.responseHeaders[e.key]=e.value)})),h.responseTime=t.response?t.response.responseTime:NaN,h.responseCode=t.response?a.clone(t.response.details()):{code:NaN,name:\"\",details:\"\"},h.responseBody=(()=>{if(t.response&&!(t.response.responseSize>52428800))return t.response.text()})()),h.iteration=a.isObject(t.cursor)?t.cursor.iteration:0;const m=new(t.target===c?PostmanLegacyTestInterface:PostmanLegacyInterface)(t,h),g=new Set;e.__is_deprecation_warning_enabled=!0,h.postman=new Proxy(m,{get:(t,a)=>(e.__is_deprecation_warning_enabled&&f(`postman.${a}`,g,n),t[a])}),i.forEach((t=>{h[t]&&[\"object\",\"function\"].includes(typeof h[t])&&(h[t]=new Proxy(h[t],{set(a,r,i){e.__is_deprecation_warning_enabled&&f(t,g,n),a[r]=i},get:(a,r)=>(\"postman\"!==t&&e.__is_deprecation_warning_enabled&&f(t,g,n),a[r]),apply:(a,r,i)=>(e.__is_deprecation_warning_enabled&&f(t,g,n),a.apply(r,i))}))})),e.import(h),h=null,e.__postman_legacy_setup=!0},teardown(e){if(e.__postman_legacy_setup){for(var t=0,n=i.length;t<n;t++)e.unset(i[t]);e.__postman_legacy_setup=!1}},finish(e,t,n){e.__postman_legacy_setup&&(e.__is_deprecation_warning_enabled=!1,function(e,t,n){var r=e._imports&&e._imports.tests,i=t.test.index();a.isEmpty(r)||n(a.map(r,(function(e,t){var n=String(t),a=Boolean(e),r=null;return a||((r=new Error(\"expected \"+String(e)+\" to be truthy\")).name=\"AssertionError\"),{name:n,skipped:!1,passed:a,error:r,index:i++}})))}(e,t,n))},LEGACY_GLOBS:i}},{\"./xml2Json\":16,backbone:\"backbone\",cheerio:\"cheerio\",\"crypto-js\":\"crypto-js\",\"liquid-json\":\"json\",lodash:\"lodash\",lodash3:423,tv4:\"tv4\"}],13:[function(e,t,n){try{Error&&(Error.prototype.toJSON=function(){return{type:\"Error\",name:this.name,message:this.message}})}catch(o){}const{Request:a,Response:r}=e(\"postman-collection\");try{a.prototype.toJSON=(i=a.prototype.toJSON,function(){var e,t=this.to;return delete this.to,e=i.apply(this,arguments),this.to=t,e}),r.prototype.toJSON=function(e){return function(){var t,n=this.to;return delete this.to,t=e.apply(this,arguments),this.to=n,t}}(r.prototype.toJSON)}catch(o){}var i},{\"postman-collection\":\"postman-collection\"}],14:[function(e,t,n){const a=\"function\",r=[\"Timeout\",\"Interval\",\"Immediate\",\"Event\"],i={Interval:!0},o={Event:!0},s=Array.prototype.slice,c=r.reduce((function(e,t){var n=new Function(`return typeof set${t} === 'function'`)(),a=new Function(`return typeof clear${t} === 'function'`)();return n&&(e[`set${t}`]=new Function(\"_setFn\",`return function set${t} (fn, ms) { return _setFn(fn, ms); }`)(this[`set${t}`])),a&&(e[`clear${t}`]=new Function(\"_clearFn\",`return function clear${t} (id) { return _clearFn(id); }`)(this[`clear${t}`])),e}),{});t.exports=function(e,t,n,u){var l,p=e||c,d={},f=0,h=0,m=!1;typeof p.setImmediate!==a&&(p.setImmediate=function(e){return p.setTimeout(e,0)},p.clearImmediate=function(e){return p.clearTimeout(e)}),typeof p.setEvent!==a&&function(){var e={},t=0;p.setEvent=function(n){var a=++t;return e[a]=n,a},p.clearEvent=function(t){var n=e[t];delete e[t],typeof n===a&&n.apply(d,s.call(arguments,1))},p.clearAllEvents=function(){Object.keys(e).forEach((function(t){delete e[t]}))}}(),l=function(e,t){e&&(h+=e),0===h&&l.started&&p.setImmediate((function(){0===h&&l.started&&(!t&&!m&&typeof u===a&&u(),l.started=!1)})),h>0&&!l.started&&(!t&&typeof n===a&&n(),l.started=!0)},r.forEach(function(e){var n={};this[\"set\"+e]=function(r){if(!m&&typeof r===a){var c=++f,u=s.call(arguments);return u[0]=function(){try{r.apply(d,o[e]?arguments:null)}catch(a){t&&t(a)}o[e]||i[e]?l():(l(-1),delete n[c])},n[c]=p[\"set\"+e].apply(this,u),u=null,l(1),c}},this[\"clear\"+e]=function(a){var r,i=n[a];if(!m&&i){(r=s.call(arguments))[0]=i,delete n[a];try{p[\"clear\"+e].apply(d,r)}catch(o){t(o)}l(-1),r=i=null}},typeof p[\"clearAll\"+e+\"s\"]===a?this[\"clearAll\"+e+\"s\"]=function(){p[\"clearAll\"+e+\"s\"](),Object.keys(n).forEach((function(){l(-1,!0)}))}:this[\"clearAll\"+e+\"s\"]=function(){Object.keys(n).forEach((function(t){l(-1,!0),p[\"clear\"+e](n[t])}))}}.bind(this)),this.queueLength=function(){return h},this.wrapped=p,this.clearAll=function(){r.forEach(function(e){this[\"clearAll\"+e+\"s\"]()}.bind(this))},this.seal=function(){m=!0},this.error=function(e){return t.call(d,e)},this.terminate=function(){return this.seal(),this.clearAll(),u.apply(d,arguments)}}},{}],15:[function(e,t,n){t.exports={Vault:class{constructor(e,t,n){this._bridge=t,this._timers=n,this._event=`execution.vault.${e}`,this._handler=(e,...t)=>{this._timers.clearEvent(e,...t)},this._bridge.on(this._event,this._handler)}exec(...e){return new Promise(((t,n)=>{const a=this._timers.setEvent(((e,...a)=>{if(e)return n(e instanceof Error?e:new Error(e.message||e));t(...a)}));this._bridge.dispatch(this._event,a,...e)}))}dispose(){this._bridge.off(this._event,this._handler)}},getVaultInterface:e=>({get:t=>e(\"get\",t),set:(t,n)=>e(\"set\",t,n),unset:t=>e(\"unset\",t)})}},{}],16:[function(e,t,n){const a=e(\"xml2js\"),r={explicitArray:!1,async:!1,trim:!0,mergeAttrs:!1};t.exports=function(e){var t={};return a.parseString(e,r,(function(e,n){t=n})),t}},{xml2js:\"xml2js\"}],17:[function(e,t,n){e(\"./timers\"),e(\"buffer\"),function(){var t=this,n=e(\"uniscope/lib/allowed-globals\").concat([\"require\",\"eval\",\"console\",\"bridge\",\"__uvm_emit\",\"__uvm_setTimeout\"]),a=function(e){-1===n.indexOf(e)&&delete t[e]};do{Object.getOwnPropertyNames(t).forEach(a),t=Object.getPrototypeOf(t)}while(null!==Object.getPrototypeOf(t));Object.defineProperty(Error,\"prepareStackTrace\",{value:function(e,t){let n=`Error: ${e&&e.message}`;for(let a=0;a<(t&&t.length);a++)n+=`\\n at ${t[a]}`;return n},configurable:!1,enumerable:!1,writable:!1})}(),e(\"./purse\"),bridge.on(\"ping\",e(\"./ping\").listener(\"pong\")),e(\"./execute\")(bridge,{console:\"undefined\"!=typeof console?console:null,window:\"undefined\"!=typeof window?window:null}),bridge=void 0,delete bridge},{\"./execute\":5,\"./ping\":8,\"./purse\":13,\"./timers\":14,buffer:\"buffer\",\"uniscope/lib/allowed-globals\":590}],18:[function(e,t,n){const a=function(){throw new Error(\"Not implemented\")};t.exports=function(e){return{Buffer:e.Buffer,SlowBuffer:e.SlowBuffer,INSPECT_MAX_BYTES:e.INSPECT_MAX_BYTES,kMaxLength:e.kMaxLength,kStringMaxLength:e.kStringMaxLength,constants:e.constants,File:e.File,Blob:e.Blob,atob:e.atob,btoa:e.btoa,isAscii:a,isUtf8:a,resolveObjectURL:a,transcode:a}}},{}],19:[function(e,t,n){const a=function(){throw new Error(\"Not implemented\")};t.exports=function(e){function t(){return\"number\"==typeof arguments[0]?e.alloc(...arguments):e.from(...arguments)}return Object.setPrototypeOf(t,e),t.poolSize=e.poolSize,Object.defineProperty(t,Symbol.hasInstance,{value:function(t){return t instanceof e}}),t.from=function(){return e.from(...arguments)},t.copyBytesFrom=a,t.of=a,t.alloc=function(){return e.alloc(...arguments)},t.allocUnsafe=function(){return e.allocUnsafe(...arguments)},t.allocUnsafeSlow=function(){return e.allocUnsafeSlow(...arguments)},t.isBuffer=function(){return e.isBuffer(...arguments)},t.compare=function(){return e.compare(...arguments)},t.isEncoding=function(){return e.isEncoding(...arguments)},t.concat=function(){return e.concat(...arguments)},t.byteLength=function(){return e.byteLength(...arguments)},t}},{}],20:[function(e,t,n){(function(e){(function(){!function(){var t,n=Object,a=Array,r=RegExp,i=Date,o=String,s=Number,c=Math,u=n.prototype.toString,l=void 0!==e?e:this,p={},d=n.defineProperty&&n.defineProperties,f=\"Array,Boolean,Date,Function,Number,String,RegExp\".split(\",\");f.forEach((function(e){l[e]||(l[e]=Function(\"return \"+e)())}));var h,m,g=_(f[0]),y=_(f[1]),v=_(f[2]),b=_(f[3]),x=_(f[4]),w=_(f[5]),k=_(f[6]);function _(e){var t,n;return/String|Number|Boolean/.test(e)&&(t=e.toLowerCase()),n=\"Array\"===e&&a.isArray||function(n){return!(!t||typeof n!==t)||j(n)===\"[object \"+e+\"]\"},p[e]=n,n}function j(e){return u.call(e)}function S(e){e.SugarMethods||(T(e,\"SugarMethods\",{}),A(e,!1,!1,{extend:function(t,n,a){A(e,!1!==a,n,t)},sugarRestore:function(){return C(e,arguments,(function(e,t,n){T(e,t,n.method)}))},sugarRevert:function(){return C(e,arguments,(function(e,t,n){n.existed?T(e,t,n.original):delete e[t]}))}}))}function A(e,t,n,a){var r=t?e.prototype:e;S(e),I(a,(function(a,i){var o,s,c,u=r[a],l=L(r,a);\"function\"==typeof n&&(o=r[a],s=i,c=n,i=function(){return(!o||!0!==c&&c.apply(this,arguments)?s:o).apply(this,arguments)}),!1===n&&r[a]||T(r,a,i),e.SugarMethods[a]={instance:t,method:i,original:u,existed:l}}))}function E(e,t,n,a,r){var i={};(a=w(a)?a.split(\",\"):a).forEach((function(e,t){r(i,e,t)})),A(e,t,n,i)}function C(e,t,n){var a=0===t.length,r=P(t),i=!1;return I(e.SugarMethods,(function(t,o){(a||r.indexOf(t)>-1)&&(i=!0,n(o.instance?e.prototype:e,t,o))})),i}function T(e,t,a){d?n.defineProperty(e,t,{value:a,configurable:!0,enumerable:!1,writable:!0}):e[t]=a}function P(e,t){var n,a,r=[];for(n=0,a=e.length;n<a;n++)r.push(e[n]),t&&t.call(e,e[n],n);return r}function D(e,t,n){P(a.prototype.concat.apply([],a.prototype.slice.call(e,n||0)),t)}function O(e){if(!e||!e.call)throw new TypeError(\"Callback is not callable\")}function M(e){return e!==t}function N(e){return e===t}function R(e){return e&&\"object\"==typeof e}function B(e){return!!e&&\"[object Object]\"===j(e)&&\"hasOwnProperty\"in e}function L(e,t){return n.hasOwnProperty.call(e,t)}function I(e,t){var n;for(n in e)if(L(e,n)&&!1===t.call(e,n,e[n],e))break}function F(e,t){return I(t,(function(n){e[n]=t[n]})),e}function z(e){F(this,e)}function q(e,t,n,a){for(var r=[],i=parseInt(e),o=a<0;!o&&i<=t||o&&i>=t;)r.push(i),n&&n.call(this,i),i+=a||1;return r}function H(e,t,n){var a=c[n||\"round\"],r=c.pow(10,c.abs(t||0));return t<0&&(r=1/r),a(e*r)/r}function U(e,t){return H(e,t,\"ceil\")}function G(e,t){return H(e,t,\"floor\")}function W(e,t,n,a){var r=c.abs(e).toString(a||10);return r=V(t-r.replace(/\\.\\d+/,\"\").length,\"0\")+r,(n||e<0)&&(r=(e<0?\"-\":\"+\")+r),r}function $(e){if(e>=11&&e<=13)return\"th\";switch(e%10){case 1:return\"st\";case 2:return\"nd\";case 3:return\"rd\";default:return\"th\"}}function V(e,t){return a(c.max(0,M(e)?e:1)+1).join(t||\"\")}function K(e,t){var n=e.toString().match(/[^/]*$/)[0];return t&&(n=(n+t).split(\"\").sort().join(\"\").replace(/([gimy])\\1+/g,\"$1\")),n}function J(e){return w(e)||(e=o(e)),e.replace(/([\\\\/'*+?|()\\[\\]{}.^$])/g,\"\\\\$1\")}function Y(e,t){var a,r,i,s,c,l,p,d,f=typeof e;if(\"string\"===f)return e;if(i=u.call(e),a=B(e),r=\"[object Array]\"===i,null!=e&&a||r){if(t||(t=[]),t.length>1)for(p=t.length;p--;)if(t[p]===e)return\"CYC\";for(t.push(e),s=o(e.constructor),p=0,d=(c=r?e:n.keys(e).sort()).length;p<d;p++)s+=(l=r?p:c[p])+Y(e[l],t);t.pop()}else s=1/e==-1/0?\"-0\":o(e&&e.valueOf?e.valueOf():e);return f+i+s}function X(e,t){return Z(e)&&Z(t)?Y(e)===Y(t):e===t}function Z(e){var t=j(e);return/^\\[object Date|Array|String|Number|RegExp|Boolean|Arguments\\]$/.test(t)||B(e)}function Q(e,t,n){var a,r=[],i=e.length,o=!1!==t[t.length-1];return P(t,(function(t){if(y(t))return!1;o&&(t%=i)<0&&(t=i+t),a=n?e.charAt(t)||\"\":e[t],r.push(a)})),r.length<2?r[0]:r}function ee(e,t){E(t,!0,!1,e,(function(e,t){e[t+(\"equal\"===t?\"s\":\"\")]=function(){return n[t].apply(null,[this].concat(P(arguments)))}}))}function te(e,t,n,a){var r,i,o=e.length,s=-1==a,c=s?o-1:0,u=(r=n,i=c,isNaN(r)?i:parseInt(0|r));for(u<0&&(u=o+u),(!s&&u<0||s&&u>=o)&&(u=c);s&&u>=0||!s&&u<o;){if(e[u]===t)return u;u+=a}return-1}function ne(e,t,n,a){var r,i,o=e.length,s=0,c=M(n);if(O(t),0==o&&!c)throw new TypeError(\"Reduce called on empty array with no initial value\");for(c?r=n:(r=e[a?o-1:s],s++);s<o;)(i=a?o-s-1:s)in e&&(r=t(r,e[i],i,e)),s++;return r}function ae(e){if(0===e.length)throw new TypeError(\"First argument must be defined\")}function re(e,t,n,a){var i=!0;return e===t||(k(t)&&w(e)?r(t).test(e):b(t)?t.apply(n,a):B(t)&&R(e)?(I(t,(function(a,r){re(e[a],t[a],n,[e[a],e])||(i=!1)})),i):X(e,t))}function ie(e,t,n,a){return N(t)?e:b(t)?t.apply(n,a||[]):b(e[t])?e[t].call(e):e[t]}function oe(e,t,n,a){var r,i,o;for(n<0&&(n=e.length+n),o=isNaN(n)?0:n,r=!0===a?e.length+o:e.length;o<r;){if(!((i=o%e.length)in e))return se(e,t,o,a);if(!1===t.call(e,e[i],i,e))break;o++}}function se(e,t,n,a){var r,i=[];for(r in e)ce(e,r)&&r>=n&&i.push(parseInt(r));return i.sort().each((function(n){return t.call(e,e[n],n,e)})),e}function ce(e,t){return t in e&&function(e){return e>>>0}(t)==t&&4294967295!=t}function ue(e,t,n,a,r){var i,o;return oe(e,(function(e,n,a){if(re(e,t,a,[e,n,a]))return i=e,o=n,!1}),n,a),r?o:i}function le(e,t){var n,a=[],r={};return oe(e,(function(i,o){n=t?ie(i,t,e,[i,o,e]):i,me(r,n)||a.push(i)})),a}function pe(e,t,n){var a=[],r={};return t.each((function(e){me(r,e)})),e.each((function(e){var t=Y(e),i=!Z(e);he(r,t,e,i)!=n&&(!function(e,t,n,a){var r,i=0;if(a)for(r=e[t];i<r.length;)r[i]===n?r.splice(i,1):i+=1;else delete e[t]}(r,t,e,i),a.push(e))})),a}function de(e,t,n){t=t||1/0,n=n||0;var a=[];return oe(e,(function(e){g(e)&&n<t?a=a.concat(de(e,t,n+1)):a.push(e)})),a}function fe(e){var t=[];return P(e,(function(e){t=t.concat(e)})),t}function he(e,t,n,a){var r=t in e;return a&&(e[t]||(e[t]=[]),r=-1!==e[t].indexOf(n)),r}function me(e,t){var n=Y(t),a=!Z(t),r=he(e,n,t,a);return a?e[n].push(t):e[n]=t,r}function ge(e,t,n,a){var r,i=[],o=\"max\"===n,s=\"min\"===n,c=Array.isArray(e);return I(e,(function(n){var a=e[n],u=ie(a,t,e,c?[a,parseInt(n),e]:[]);if(N(u))throw new TypeError(\"Cannot compare with undefined\");u===r?i.push(a):(N(r)||o&&u>r||s&&u<r)&&(i=[a],r=u)})),c||(i=de(i,1)),a?i:i[0]}function ye(e){return a[ke]&&(e=e.toLowerCase()),e.replace(a[we],\"\")}function ve(e,t){var n=e.charAt(t);return(a[_e]||{})[n]||n}function be(e){var t=a[xe];return e?t.indexOf(e):null}z.prototype.constructor=n,S(n),I(f,(function(e,t){S(l[t])})),A(n,!1,!1,{keys:function(e){var t=[];if(!R(e)&&!k(e)&&!b(e))throw new TypeError(\"Object required\");return I(e,(function(e,n){t.push(e)})),t}}),A(a,!1,!1,{isArray:function(e){return g(e)}}),A(a,!0,!1,{every:function(e,t){var n=this.length,a=0;for(ae(arguments);a<n;){if(a in this&&!e.call(t,this[a],a,this))return!1;a++}return!0},some:function(e,t){var n=this.length,a=0;for(ae(arguments);a<n;){if(a in this&&e.call(t,this[a],a,this))return!0;a++}return!1},map:function(e,t){var n=this.length,a=0,r=new Array(n);for(ae(arguments);a<n;)a in this&&(r[a]=e.call(t,this[a],a,this)),a++;return r},filter:function(e,t){var n=this.length,a=0,r=[];for(ae(arguments);a<n;)a in this&&e.call(t,this[a],a,this)&&r.push(this[a]),a++;return r},indexOf:function(e,t){return w(this)?this.indexOf(e,t):te(this,e,t,1)},lastIndexOf:function(e,t){return w(this)?this.lastIndexOf(e,t):te(this,e,t,-1)},forEach:function(e,t){var n=this.length,a=0;for(O(e);a<n;)a in this&&e.call(t,this[a],a,this),a++},reduce:function(e,t){return ne(this,e,t)},reduceRight:function(e,t){return ne(this,e,t,!0)}}),A(Function,!0,!1,{bind:function(e){var t,n=this,a=P(arguments).slice(1);if(!b(this))throw new TypeError(\"Function.prototype.bind called on a non-function\");return t=function(){return n.apply(n.prototype&&this instanceof n?this:e,a.concat(P(arguments)))},t.prototype=this.prototype,t}}),A(i,!1,!1,{now:function(){return(new i).getTime()}}),function(){var e=\"\\t\\n\\v\\f\\r   ᠎             \\u2028\\u2029 \\ufeff\".match(/^\\s+$/);try{o.prototype.trim.call([1])}catch(t){e=!1}A(o,!0,!e,{trim:function(){return this.toString().trimLeft().trimRight()},trimLeft:function(){return this.replace(r(\"^[\\t\\n\\v\\f\\r   ᠎             \\u2028\\u2029 \\ufeff]+\"),\"\")},trimRight:function(){return this.replace(r(\"[\\t\\n\\v\\f\\r   ᠎             \\u2028\\u2029 \\ufeff]+$\"),\"\")}})}(),h=new i(i.UTC(1999,11,31)),m=h.toISOString&&\"1999-12-31T00:00:00.000Z\"===h.toISOString(),E(i,!0,!m,\"toISOString,toJSON\",(function(e,t){e[t]=function(){return W(this.getUTCFullYear(),4)+\"-\"+W(this.getUTCMonth()+1,2)+\"-\"+W(this.getUTCDate(),2)+\"T\"+W(this.getUTCHours(),2)+\":\"+W(this.getUTCMinutes(),2)+\":\"+W(this.getUTCSeconds(),2)+\".\"+W(this.getUTCMilliseconds(),3)+\"Z\"}}));var xe=\"AlphanumericSortOrder\",we=\"AlphanumericSortIgnore\",ke=\"AlphanumericSortIgnoreCase\",_e=\"AlphanumericSortEquivalents\";function je(e){return e&&e.valueOf&&(e=e.valueOf()),n.keys(e)}function Se(e,t){E(n,!1,!1,e,(function(e,n){e[n]=function(e,r,i){var o,s=je(e);return o=a.prototype[n].call(s,(function(n){return t?ie(e[n],r,e,[n,e[n],e]):re(e[n],r,e,[n,e[n],e])}),i),g(o)&&(o=o.reduce((function(t,n,a){return t[n]=e[n],t}),{})),o}})),ee(e,z)}A(a,!1,!1,{create:function(){var e,t=[];return P(arguments,(function(n){if(R(n))try{(e=a.prototype.slice.call(n,0)).length>0&&(n=e)}catch(r){}t=t.concat(n)})),t}}),A(a,!0,!1,{find:function(e,t,n){return ue(this,e,t,n)},findAll:function(e,t,n){var a=[];return oe(this,(function(t,n,r){re(t,e,r,[t,n,r])&&a.push(t)}),t,n),a},findIndex:function(e,t,n){var a=ue(this,e,t,n,!0);return N(a)?-1:a},count:function(e){return N(e)?this.length:this.findAll(e).length},removeAt:function(e,t){var n,a;if(N(e))return this;for(N(t)&&(t=e),n=0,a=t-e;n<=a;n++)this.splice(e,1);return this},include:function(e,t){return this.clone().add(e,t)},exclude:function(){return a.prototype.remove.apply(this.clone(),arguments)},clone:function(){return F([],this)},unique:function(e){return le(this,e)},flatten:function(e){return de(this,e)},union:function(){return le(this.concat(fe(arguments)))},intersect:function(){return pe(this,fe(arguments),!1)},subtract:function(e){return pe(this,fe(arguments),!0)},at:function(){return Q(this,arguments)},first:function(e){return N(e)?this[0]:(e<0&&(e=0),this.slice(0,e))},last:function(e){if(N(e))return this[this.length-1];var t=this.length-e<0?0:this.length-e;return this.slice(t)},from:function(e){return this.slice(e)},to:function(e){return N(e)&&(e=this.length),this.slice(0,e)},min:function(e,t){return ge(this,e,\"min\",t)},max:function(e,t){return ge(this,e,\"max\",t)},least:function(e,t){return ge(this.groupBy.apply(this,[e]),\"length\",\"min\",t)},most:function(e,t){return ge(this.groupBy.apply(this,[e]),\"length\",\"max\",t)},sum:function(e){var t=e?this.map(e):this;return t.length>0?t.reduce((function(e,t){return e+t})):0},average:function(e){var t=e?this.map(e):this;return t.length>0?t.sum()/t.length:0},inGroups:function(e,t){var n=arguments.length>1,a=this,r=[],i=U(this.length/e);return q(0,e-1,(function(e){var o=e*i,s=a.slice(o,o+i);n&&s.length<i&&q(1,i-s.length,(function(){s=s.add(t)})),r.push(s)})),r},inGroupsOf:function(e,t){var n,a=[],r=this.length,i=this;return 0===r||0===e?i:(N(e)&&(e=1),N(t)&&(t=null),q(0,U(r/e)-1,(function(r){for(n=i.slice(e*r,e*r+e);n.length<e;)n.push(t);a.push(n)})),a)},isEmpty:function(){return 0==this.compact().length},sortBy:function(e,t){var n=this.clone();return n.sort((function(a,r){var i,o,s;return i=ie(a,e,n,[a]),o=ie(r,e,n,[r]),s=w(i)&&w(o)?function(e,t){var n,a,r,i,o,s,c=0,u=0;e=ye(e),t=ye(t);do{r=ve(e,c),i=ve(t,c),n=be(r),a=be(i),-1!==n&&-1!==a||(n=e.charCodeAt(c)||null,a=t.charCodeAt(c)||null),(o=r!==e.charAt(c))!=(s=i!==t.charAt(c))&&0===u&&(u=o-s),c+=1}while(null!=n&&null!=a&&n===a);return n===a?u:n<a?-1:1}(i,o):i<o?-1:i>o?1:0,s*(t?-1:1)})),n},randomize:function(){for(var e,t,n=this.concat(),a=n.length;a;)e=c.random()*a|0,t=n[--a],n[a]=n[e],n[e]=t;return n},zip:function(){var e=P(arguments);return this.map((function(t,n){return[t].concat(e.map((function(e){return n in e?e[n]:null})))}))},sample:function(e){var t=this.randomize();return arguments.length>0?t.slice(0,e):t[0]},each:function(e,t,n){return oe(this,e,t,n),this},add:function(e,t){return x(s(t))&&!isNaN(t)||(t=this.length),a.prototype.splice.apply(this,[t,0].concat(e)),this},remove:function(){var e,t=this;return P(arguments,(function(n){for(e=0;e<t.length;)re(t[e],n,t,[t[e],e,t])?t.splice(e,1):e++})),t},compact:function(e){var t=[];return oe(this,(function(n,a){g(n)?t.push(n.compact()):e&&n?t.push(n):e||null==n||n.valueOf()!=n.valueOf()||t.push(n)})),t},groupBy:function(e,t){var n,a=this,r={};return oe(a,(function(t,i){n=ie(t,e,a,[t,i,a]),r[n]||(r[n]=[]),r[n].push(t)})),t&&I(r,t),r},none:function(){return!this.any.apply(this,arguments)}}),A(a,!0,!1,{all:a.prototype.every,any:a.prototype.some,insert:a.prototype.add}),A(n,!1,!1,{map:function(e,t){return je(e).reduce((function(n,a){return n[a]=ie(e[a],t,e,[a,e[a],e]),n}),{})},reduce:function(e){var t=je(e).map((function(t){return e[t]}));return t.reduce.apply(t,P(arguments).slice(1))},each:function(e,t){return O(t),I(e,t),e},size:function(e){return je(e).length}});var Ae,Ee,Ce=\"any,all,none,count,find,findAll,isEmpty\".split(\",\"),Te=\"sum,average,min,max,least,most\".split(\",\"),Pe=\"map,reduce,size\".split(\",\"),De=Ce.concat(Te).concat(Pe);E(a,!0,(function(){var e=arguments;return e.length>0&&!b(e[0])}),\"map,every,all,some,any,none,filter\",(function(e,t){e[t]=function(e){return this[t]((function(n,a){return\"map\"===t?ie(n,e,this,[n,a,this]):re(n,e,this,[n,a,this])}))}})),function(){a[xe]=\"AÁÀÂÃĄBCĆČÇDĎÐEÉÈĚÊËĘFGĞHıIÍÌİÎÏJKLŁMNŃŇÑOÓÒÔPQRŘSŚŠŞTŤUÚÙŮÛÜVWXYÝZŹŻŽÞÆŒØÕÅÄÖ\".split(\"\").map((function(e){return e+e.toLowerCase()})).join(\"\");var e={};oe(\"AÁÀÂÃÄ,CÇ,EÉÈÊË,IÍÌİÎÏ,OÓÒÔÕÖ,Sß,UÚÙÛÜ\".split(\",\"),(function(t){var n=t.charAt(0);oe(t.slice(1).split(\"\"),(function(t){e[t]=n,e[t.toLowerCase()]=n.toLowerCase()}))})),a[ke]=!0,a[_e]=e}(),Se(Ce),Se(Te,!0),ee(Pe,z);var Oe,Me,Ne,Re,Be,Le,Ie=[\"ampm\",\"hour\",\"minute\",\"second\",\"ampm\",\"utc\",\"offset_sign\",\"offset_hours\",\"offset_minutes\",\"ampm\"],Fe=\"(?:[,.]\\\\d+)?\",ze=\"[0-5]\\\\d\"+Fe,qe=\"({t})?\\\\s*(\"+(\"\\\\d{1,2}\"+Fe)+\")(?:{h}(\"+ze+\")?{m}(?::?(\"+ze+\"){s})?\\\\s*(?:({t})|(Z)|(?:([+-])(\\\\d{2,2})(?::?(\\\\d{2,2}))?)?)?|\\\\s*({t}))\",He=\"〇一二三四五六七八九十百千万\",Ue=\"0123456789\",Ge={},We=[],$e=[{token:\"f{1,4}|ms|milliseconds\",format:function(e){return ut(e,\"Milliseconds\")}},{token:\"ss?|seconds\",format:function(e,t){return ut(e,\"Seconds\")}},{token:\"mm?|minutes\",format:function(e,t){return ut(e,\"Minutes\")}},{token:\"hh?|hours|12hr\",format:function(e){return function(e){var t=ut(e,\"Hours\");return 0===t?12:t-12*G(t/13)}(e)}},{token:\"HH?|24hr\",format:function(e){return ut(e,\"Hours\")}},{token:\"dd?|date|day\",format:function(e){return ut(e,\"Date\")}},{token:\"dow|weekday\",word:!0,format:function(e,t,n,a){var r=ut(e,\"Day\");return t.weekdays[r+7*(n-1)]}},{token:\"MM?\",format:function(e){return ut(e,\"Month\")+1}},{token:\"mon|month\",word:!0,format:function(e,t,n,a){var r=ut(e,\"Month\");return t.months[r+12*(n-1)]}},{token:\"y{2,4}|year\",format:function(e){return ut(e,\"FullYear\")}},{token:\"[Tt]{1,2}\",format:function(e,t,n,a){if(0==t.ampm.length)return\"\";var r=ut(e,\"Hours\"),i=t.ampm[G(r/12)];return 1===a.length&&(i=i.slice(0,1)),\"T\"===a.slice(0,1)&&(i=i.toUpperCase()),i}},{token:\"z{1,4}|tz|timezone\",text:!0,format:function(e,t,n,a){var r=e.getUTCOffset();return\"z\"!=a&&\"zz\"!=a||(r=r.replace(/(\\d{2})(\\d{2})/,(function(e,t,n){return W(t,a.length)}))),r}},{token:\"iso(tz|timezone)\",format:function(e){return e.getUTCOffset(!0)}},{token:\"ord\",format:function(e){var t=ut(e,\"Date\");return t+$(t)}}],Ve=[{unit:\"year\",method:\"FullYear\",ambiguous:!0,multiplier:function(e){return 24*(365+(e?e.isLeapYear()?1:0:.25))*60*60*1e3}},{unit:\"month\",method:\"Month\",ambiguous:!0,multiplier:function(e,t){var n,a=30.4375;return e&&t<=(n=e.daysInMonth()).days()&&(a=n),24*a*60*60*1e3},error:.919},{unit:\"week\",method:\"ISOWeek\",multiplier:function(){return 6048e5}},{unit:\"day\",method:\"Date\",ambiguous:!0,multiplier:function(){return 864e5}},{unit:\"hour\",method:\"Hours\",multiplier:function(){return 36e5}},{unit:\"minute\",method:\"Minutes\",multiplier:function(){return 6e4}},{unit:\"second\",method:\"Seconds\",multiplier:function(){return 1e3}},{unit:\"millisecond\",method:\"Milliseconds\",multiplier:function(){return 1}}],Ke={};function Je(e){F(this,e),this.compiledFormats=We.concat()}function Ye(e,t){var n;if(w(e)||(e=\"\"),n=Ke[e]||Ke[e.slice(0,2)],!1===t&&!n)throw new Error(\"Invalid locale.\");return n||Ee}function Xe(e,t,n,a){e.compiledFormats.unshift({variant:a,locale:e,reg:r(\"^\"+t+\"$\",\"i\"),to:n})}function Ze(e){return e.slice(0,1).toUpperCase()+e.slice(1)}function Qe(e){return e.filter((function(e){return!!e})).join(\"|\")}function et(e,t){var n;return B(e[0])?e:x(e[0])&&!x(e[1])?[e[0]]:w(e[0])&&t?[tt(e[0]),e[1]]:(n={},Me.forEach((function(t,a){n[t.unit]=e[a]})),[n])}function tt(e,t){var n={};return match=e.match(/^(\\d+)?\\s?(\\w+?)s?$/i),match&&(N(t)&&(t=parseInt(match[1])||1),n[match[2].toLowerCase()]=t),n}function nt(e){return function(e){return e.replace(Oe,(function(e,t,n){var a,r,i=0,o=1;return t?e:(n.split(\"\").reverse().forEach((function(e){var t=Ge[e],n=t>9;n?(a&&(i+=o),o*=t/(r||1),r=t):(!1===a&&(o*=10),i+=o*t),a=n})),a&&(i+=o),i)}))}(e=e.trim().replace(/^just (?=now)|\\.+$/i,\"\"))}function at(e,t,n,a){var r,o,s,c,u,l,p,d,f,h=new i,m=!1;return h.utc(a),v(e)?h.utc(e.isUTC()).setTime(e.getTime()):x(e)?h.setTime(e):B(e)?(h.set(e,!0),c=e):w(e)&&(r=Ye(t),e=nt(e),r&&I(r.getFormats(),(function(n,a){var g,y=e.match(a.reg);if(y)return o=(s=a).locale,c=function(e,t){var n,a,r={};return t.forEach((function(t,i){N(n=e[i+1])||\"\"===n||(\"year\"===t&&(r.yearAsString=n.replace(/'/,\"\")),a=parseFloat(n.replace(/'/,\"\").replace(/,/,\".\")),r[t]=isNaN(a)?n.toLowerCase():a)})),r}(y,s.to),c.utc&&h.utc(),o.cachedFormat=s,c.timestamp?(c=c.timestamp,!1):(s.variant&&!w(c.month)&&(w(c.date)||r.hasVariant(t))&&(d=c.month,c.month=c.date,c.date=d),c.year&&2===c.yearAsString.length&&(c.year=(g=c.year,100*H(ut(new i,\"FullYear\")/100)-100*H(g/100)+g)),c.month&&(c.month=o.getMonth(c.month),c.shift&&!c.unit&&(c.unit=o.units[7])),c.weekday&&c.date?delete c.weekday:c.weekday&&(c.weekday=o.getWeekday(c.weekday),c.shift&&!c.unit&&(c.unit=o.units[5])),c.day&&(d=o.modifiersByName[c.day])?(c.day=d.value,h.reset(),m=!0):c.day&&(l=o.getWeekday(c.day))>-1&&(delete c.day,c.num&&c.month?(f=function(){var e=h.getWeekday();h.setWeekday(7*(c.num-1)+(e>l?l+7:l))},c.day=1):c.weekday=l),c.date&&!x(c.date)&&(c.date=o.getNumericDate(c.date)),o.matchPM(c.ampm)&&c.hour<12?c.hour+=12:o.matchAM(c.ampm)&&12===c.hour&&(c.hour=0),(\"offset_hours\"in c||\"offset_minutes\"in c)&&(h.utc(),c.offset_minutes=c.offset_minutes||0,c.offset_minutes+=60*c.offset_hours,\"-\"===c.offset_sign&&(c.offset_minutes*=-1),c.minute-=c.offset_minutes),c.unit&&(m=!0,p=o.getNumber(c.num),u=o.getEnglishUnit(c.unit),(c.shift||c.edge)&&(p*=(d=o.modifiersByName[c.shift])?d.value:0,\"month\"===u&&M(c.date)&&(h.set({day:c.date},!0),delete c.date),\"year\"===u&&M(c.month)&&(h.set({month:c.month,day:c.date},!0),delete c.month,delete c.date)),c.sign&&(d=o.modifiersByName[c.sign])&&(p*=d.value),M(c.weekday)&&(h.set({weekday:c.weekday},!0),delete c.weekday),c[u]=(c[u]||0)+p),\"-\"===c.year_sign&&(c.year*=-1),Ne.slice(1,4).forEach((function(e,t){var n=c[e.unit],a=n%1;a&&(c[Ne[t].unit]=H(a*(\"second\"===e.unit?1e3:60)),c[e.unit]=G(n))})),!1)})),s?m?h.advance(c):(h._utc&&h.reset(),ct(h,c,!0,!1,n)):(\"now\"!==e&&(h=new i(e)),a&&h.addMinutes(-h.getTimezoneOffset())),c&&c.edge&&(d=o.modifiersByName[c.edge],I(Ne.slice(4),(function(e,t){if(M(c[t.unit]))return u=t.unit,!1})),\"year\"===u?c.specificity=\"month\":\"month\"!==u&&\"week\"!==u||(c.specificity=\"day\"),h[(d.value<0?\"endOf\":\"beginningOf\")+Ze(u)](),-2===d.value&&h.reset()),f&&f(),h.utc(!1)),{date:h,set:c}}function rt(e){var t,n=c.abs(e),a=n,r=0;return Ne.slice(1).forEach((function(e,i){(t=G(H(n/e.multiplier()*10)/10))>=1&&(a=t,r=i+1)})),[a,r,e]}function it(e){var t=rt(e.millisecondsFromNow());return 6===t[1]&&(t[0]=c.abs(e.monthsFromNow())),t}function ot(e,t,n,a){var i,o=Ye(a),s=r(/^[A-Z]/);return e.isValid()?(Date[t]?t=Date[t]:b(t)&&(i=it(e),t=t.apply(e,i.concat(o))),!t&&n?(0===(i=i||it(e))[1]&&(i[1]=1,i[0]=1),o.getRelativeFormat(i)):(t=o[t=t||\"long\"]||t,$e.forEach((function(n){t=t.replace(r(\"\\\\{(\"+n.token+\")(\\\\d)?\\\\}\",n.word?\"i\":\"\"),(function(t,a,r){var i=n.format(e,o,r||1,a),c=a.length,u=a.match(/^(.)\\1+$/);return n.word?(3===c&&(i=i.slice(0,3)),(u||a.match(s))&&(i=Ze(i))):u&&!n.text&&(i=(x(i)?W(i,c):i.toString()).slice(-c)),i}))})),t)):\"Invalid Date\"}function st(e,t,n,a){var r,i,o,s,c,u,l=0,p=0,d=0;return n>0&&(p=d=n,c=!0),!!(r=at(t,null,null,a)).date.isValid()&&(r.set&&r.set.specificity&&(Ve.forEach((function(t,n){t.unit===r.set.specificity&&(l=t.multiplier(r.date,e-r.date)-1)})),u=Ze(r.set.specificity),(r.set.edge||r.set.shift)&&r.date[\"beginningOf\"+u](),\"month\"===r.set.specificity&&(s=r.date.clone()[\"endOf\"+u]().getTime()),!c&&r.set.sign&&\"millisecond\"!=r.set.specificity&&(p=50,d=-50)),i=e.getTime(),o=r.date.getTime(),s=function(e,t,n){var a,r,i,o;a=new Date(t),r=new Date(n).utc(e.isUTC()),23!==ut(r,\"Hours\")&&(i=a.getTimezoneOffset())!==(o=r.getTimezoneOffset())&&(n+=(o-i).minutes());return n}(e,o,s=s||o+l),i>=o-p&&i<=s+d)}function ct(e,t,n,a,r){var o,s;function c(e){return M(t[e])?t[e]:t[e+\"s\"]}function u(e){return M(c(e))}function l(e,t){return u(e)||t&&u(\"weekday\")}if(x(t)&&a)t={milliseconds:t};else if(x(t))return e.setTime(t),e;if(M(t.date)&&(t.day=t.date),I(Ne,(function(a,r){var i=\"day\"===r.unit;if(l(r.unit,i))return t.specificity=r.unit,o=+a,!1;!n||\"week\"===r.unit||i&&u(\"week\")||lt(e,r.method,i?1:0)})),Ve.forEach((function(n,r){var i,o=n.unit,s=n.method;Ve[r-1];N(i=c(o))||(a?(\"week\"===o&&(i=(t.day||0)+7*i,s=\"Date\"),i=i*a+ut(e,s)):\"month\"===o&&u(\"day\")&&lt(e,\"Date\",15),lt(e,s,i),a&&\"month\"===o&&function(e,t){t<0&&(t=t%12+12);t%12!=ut(e,\"Month\")&&lt(e,\"Date\",0)}(e,i))})),!a&&!u(\"day\")&&u(\"weekday\")){var p=c(\"weekday\");e.setWeekday(p)}return s=new i,(-1===r&&e>s||1===r&&e<s)&&I(Ne.slice(o+1),(function(t,n){if((n.ambiguous||\"week\"===n.unit&&u(\"weekday\"))&&!l(n.unit,\"day\"===n.unit))return e