@http-forge/core 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +110 -110
- package/dist/index.mjs +111 -111
- package/dist/infrastructure/test-suite/test-suite-service.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var $L=Object.create;var Xp=Object.defineProperty;var ML=Object.getOwnPropertyDescriptor;var NL=Object.getOwnPropertyNames;var DL=Object.getPrototypeOf,FL=Object.prototype.hasOwnProperty;var it=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var se=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(n){throw t=[n],n}};var F=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},Ns=(r,e)=>{for(var t in e)Xp(r,t,{get:e[t],enumerable:!0})},hE=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of NL(e))!FL.call(r,i)&&i!==t&&Xp(r,i,{get:()=>e[i],enumerable:!(n=ML(e,i))||n.enumerable});return r};var Cb=(r,e,t)=>(t=r!=null?$L(DL(r)):{},hE(e||!r||!r.__esModule?Xp(t,"default",{value:r,enumerable:!0}):t,r)),El=r=>hE(Xp({},"__esModule",{value:!0}),r);function kt(r){return r.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function pt(r){let e=Date.now().toString(36)+(LL++).toString(36)+Math.random().toString(36).slice(2,7);return r?`${kt(r)}_${e}`:e}function xb(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}function xc(r,e){let t={},n={};for(let[i,s]of Object.entries(r)){let a=i.toLowerCase();n[a]=i,t[i]=s}for(let[i,s]of Object.entries(e)){let a=i.toLowerCase(),l=n[a];l&&delete t[l],n[a]=i,t[i]=s}return t}function jL(r){return JSON.parse(JSON.stringify(r))}function UL(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function HL(r,e){try{return JSON.parse(r)}catch{return e}}function BL(r){if(r===0)return"0 B";let e=1024,t=["B","KB","MB","GB"],n=Math.floor(Math.log(r)/Math.log(e));return`${parseFloat((r/Math.pow(e,n)).toFixed(1))} ${t[n]}`}function VL(r){return r<1e3?`${r} ms`:`${(r/1e3).toFixed(2)} s`}var LL,bn=se(()=>{"use strict";LL=0});import*as Xe from"fs";import*as rn from"path";function th(r){if(!Xe.existsSync(r))return;let e={},t=rn.join(r,eh.preRequest);Xe.existsSync(t)&&(e.preRequest=Xe.readFileSync(t,"utf-8"));let n=rn.join(r,eh.postResponse);return Xe.existsSync(n)&&(e.postResponse=Xe.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function rh(r,e){await Xe.promises.mkdir(r,{recursive:!0});let t=rn.join(r,eh.preRequest);e.preRequest?await Xe.promises.writeFile(t,e.preRequest,"utf-8"):Xe.existsSync(t)&&await Xe.promises.unlink(t);let n=rn.join(r,eh.postResponse);e.postResponse?await Xe.promises.writeFile(n,e.postResponse,"utf-8"):Xe.existsSync(n)&&await Xe.promises.unlink(n)}function gE(r){for(let[e,t]of Object.entries(mE)){let n=rn.join(r,e);if(Xe.existsSync(n))try{let i=Xe.readFileSync(n,"utf-8"),s;if(t.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:t.type,format:t.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function yE(r){if(!r||r.type==="none")return{bodyForMetadata:r};if(r.type==="raw"){let e=r.format||"json",n={json:"body.json",xml:"body.xml",text:"body.txt",html:"body.html",javascript:"body.js"}[e];if(n){let i=e==="json"?typeof r.content=="string"?r.content:JSON.stringify(r.content,null,2):String(r.content||"");return{bodyForMetadata:{type:r.type,format:r.format},externalBodyFile:{filename:n,content:i}}}}if(r.type==="graphql"){let e=typeof r.content=="string"?r.content:JSON.stringify(r.content,null,2);return{bodyForMetadata:{type:r.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:r}}async function vE(r,e){for(let t of Object.keys(mE))if(t!==e){let n=rn.join(r,t);if(Xe.existsSync(n))try{await Xe.promises.unlink(n)}catch{}}}function bE(r){if(Xe.existsSync(r))try{let e=Xe.readFileSync(r,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${r}:`,e);return}}async function SE(r,e,t){let n=rn.join(r,Ec.responseSchema),i=rn.join(r,Ec.bodySchema);e?await Xe.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):Xe.existsSync(n)&&await Xe.promises.unlink(n),t?await Xe.promises.writeFile(i,JSON.stringify(t,null,2),"utf-8"):Xe.existsSync(i)&&await Xe.promises.unlink(i)}function Eb(r,e){for(let t of r){if(t.id===e)return t;if(t.type==="folder"&&t.items){let n=Eb(t.items,e);if(n)return n}}}function Ob(r,e){for(let t=0;t<r.length;t++){let n=r[t];if(n.id===e)return r.splice(t,1),!0;if(n.type==="folder"&&n.items&&Ob(n.items,e))return!0}return!1}function wE(r,e){let t=new Map(r.map(i=>[i.id,i])),n=[];for(let i of e){let s=t.get(i);s&&(n.push(s),t.delete(i))}for(let i of t.values())n.push(i);return n}function Ib(r,e){let t;try{t=Xe.readdirSync(r,{withFileTypes:!0})}catch{return}for(let n of t){if(!n.isDirectory()||n.name===nn)continue;if(n.name===e)return rn.join(r,n.name);let i=Ib(rn.join(r,n.name),e);if(i)return i}}function WL(r){for(let e of[xr.request,xr.folder]){let t=rn.join(r,e);if(Xe.existsSync(t))try{let n=Xe.readFileSync(t,"utf-8");return JSON.parse(n).id}catch{return}}}function Pb(r,e){let t;try{t=Xe.readdirSync(r,{withFileTypes:!0})}catch{return}for(let n of t){if(!n.isDirectory()||n.name===nn)continue;let i=rn.join(r,n.name);if(WL(i)===e)return i;let s=Pb(i,e);if(s)return s}}function Sn(r,e=[]){let t=r.toLowerCase().trim(),n=t.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=t.match(/t(\d+)/gi)||[],a=0;for(let y of s){let S=parseInt(y.substring(1));S>a&&(a=S)}let l="";if(a>0)l=`t${a}`;else{let y=t.match(/[_\s-](\d+\.\d+)[_\s-]/);y&&(l=`v${y[1].replace(".","_")}`)}let f=t;n&&(f=f.substring(n[0].length)),f=f.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),f=f.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),f=f.replace(/\([^)]+\)/g,""),f=f.replace(/:[a-z_][a-z0-9_]*/gi,""),f=f.replace(/\{[^}]+\}/g,""),f=f.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let d=f.split("-").filter(y=>y.length>0),h=[];i&&h.push(i),h.push(...d),l&&h.push(l);let g=h.join("-");if(g||(g="item"),e.includes(g)){let y=2;for(;e.includes(`${g}-${y}`);)y++;g=`${g}-${y}`}return g}var eh,xr,mE,Ec,nn,Wo=se(()=>{"use strict";eh={preRequest:"pre-request.js",postResponse:"post-response.js"},xr={collection:"collection.json",folder:"folder.json",request:"request.json"},mE={"body.json":{type:"raw",format:"json"},"body.xml":{type:"raw",format:"xml"},"body.txt":{type:"raw",format:"text"},"body.html":{type:"raw",format:"html"},"body.js":{type:"raw",format:"javascript"},"body.graphql":{type:"graphql"}},Ec={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},nn="scripts"});import*as Ce from"fs";import*as Pe from"path";var Ds,nh=se(()=>{"use strict";bn();Wo();Ds=class{collectionsDir;cache=new Map;slugToIdMap=new Map;idToSlugMap=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}getSlugById(e){return this.idToSlugMap.get(e)}getIdBySlug(e){return this.slugToIdMap.get(e)}ensureDirectory(){Ce.existsSync(this.collectionsDir)||Ce.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,t){let n;try{n=Ce.readFileSync(e,"utf-8")}catch(i){console.error(`[FolderCollectionStore] Failed to read ${t} ${e}:`,i);return}if(n.trim().length!==0)try{return JSON.parse(n)}catch(i){if(i instanceof SyntaxError&&/Unexpected end of JSON input/.test(i.message))return;console.error(`[FolderCollectionStore] Failed to parse ${t} ${e}:`,i);return}}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Ce.existsSync(this.collectionsDir))return[];let e=Ce.readdirSync(this.collectionsDir,{withFileTypes:!0}),t=[];for(let n of e)if(n.isDirectory())try{let i=this.loadCollectionFromFolder(n.name);i&&(this.cache.set(i.id,i),this.slugToIdMap.set(n.name,i.id),this.idToSlugMap.set(i.id,n.name),t.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return t}loadCollectionFromFolder(e){let t=Pe.join(this.collectionsDir,e),n=Pe.join(t,xr.collection);if(!Ce.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(Pe.join(t,nn)),a=this.loadItemsFromDir(t,i.id,i.order);return{id:i.id,name:i.name,description:i.description,version:i.version,variables:i.variables,auth:i.auth,scripts:s,items:a}}catch(s){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,s);return}}loadItemsFromDir(e,t,n){let i=[],s=new Map,a=Ce.readdirSync(e,{withFileTypes:!0});for(let l of a){if(!l.isDirectory()||l.name===nn)continue;let f=Pe.join(e,l.name);if(Ce.existsSync(Pe.join(f,xr.folder))){let d=this.loadFolderFromDir(f,l.name);d&&s.set(l.name,d)}else if(Ce.existsSync(Pe.join(f,xr.request))){let d=this.loadRequestFromDir(f,l.name);d&&s.set(l.name,d)}}if(n&&n.length>0){for(let l of n){let f=s.get(l);f&&(i.push(f),s.delete(l))}for(let l of s.values())i.push(l)}else for(let l of s.values())i.push(l);return i}loadFolderFromDir(e,t){let n=Pe.join(e,xr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(Pe.join(e,nn)),a=this.loadItemsFromDir(e,i.id,i.order);return this.slugToIdMap.set(t,i.id),this.idToSlugMap.set(i.id,t),{id:i.id,type:"folder",name:i.name,description:i.description,auth:i.auth,scripts:s,items:a}}catch(s){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,s);return}}loadRequestFromDir(e,t){let n=Pe.join(e,xr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(Pe.join(e,nn)),a=i.body,l=this.loadBodyFromDir(e);l&&(a=l);let f=this.loadSchemaFile(Pe.join(e,Ec.responseSchema)),d=this.loadSchemaFile(Pe.join(e,Ec.bodySchema)),h=Pe.join(e,"doc.md"),g=Ce.existsSync(h)?Ce.readFileSync(h,"utf-8"):void 0;return this.slugToIdMap.set(t,i.id),this.idToSlugMap.set(i.id,t),{id:i.id,type:"request",name:i.name,description:i.description,method:i.method,url:i.url,params:i.params,query:i.query,headers:i.headers,body:a,auth:i.auth,settings:i.settings,scripts:s,deprecated:i.deprecated,...g&&{doc:g},...f&&{responseSchema:f},...d&&{bodySchema:d}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return th(e)}loadBodyFromDir(e){return gE(e)}loadSchemaFile(e){return bE(e)}async saveSchemaFiles(e,t){return SE(e,t.responseSchema,t.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let t=this.idToSlugMap.get(e);if(t){let n=this.loadCollectionFromFolder(t);return n&&this.cache.set(e,n),n}return this.loadAll(),this.cache.get(e)}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=pt(e.name));let t=this.idToSlugMap.get(e.id);if(!t){let l=Ce.readdirSync(this.collectionsDir);t=Sn(e.name,l),this.idToSlugMap.set(e.id,t),this.slugToIdMap.set(t,e.id)}let n=Pe.join(this.collectionsDir,t),i=!Ce.existsSync(n);await Ce.promises.mkdir(n,{recursive:!0});let s={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth},[a]=await Promise.all([this.saveItemsToDir(n,e.items,i),e.scripts?this.saveScriptsToDir(Pe.join(n,nn),e.scripts):Promise.resolve()]);a.length>0&&(s.order=a),await Ce.promises.writeFile(Pe.join(n,xr.collection),JSON.stringify(s,null,2),"utf-8"),this.cache.set(e.id,e)}async saveItemsToDir(e,t,n=!1){let i=[],s=[];for(let a of t){let l=this.idToSlugMap.get(a.id);l||(l=Sn(a.name,i),this.idToSlugMap.set(a.id,l),this.slugToIdMap.set(l,a.id)),i.push(l),s.push({item:a,slug:l})}return await Promise.all(s.map(async({item:a,slug:l})=>{let f=Pe.join(e,l);await Ce.promises.mkdir(f,{recursive:!0}),a.type==="folder"?await this.saveFolderToDir(f,a,n):await this.saveRequestToDir(f,a,n)})),i}async saveFolderToDir(e,t,n=!1){let i={id:t.id,name:t.name,description:t.description,auth:t.auth},[s]=await Promise.all([t.items?this.saveItemsToDir(e,t.items,n):Promise.resolve([]),t.scripts?this.saveScriptsToDir(Pe.join(e,nn),t.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await Ce.promises.writeFile(Pe.join(e,xr.folder),JSON.stringify(i,null,2),"utf-8")}async saveRequestToDir(e,t,n=!1){let{bodyForMetadata:i,externalBodyFile:s}=this.prepareBodyForSave(t.body),a={id:t.id,name:t.name,method:t.method||"GET",url:t.url||"",description:t.description,params:t.params,query:t.query,headers:t.headers,body:i,auth:t.auth,settings:t.settings,...t.deprecated&&{deprecated:t.deprecated}},l=[Ce.promises.writeFile(Pe.join(e,xr.request),JSON.stringify(a,null,2),"utf-8")];s&&l.push(Ce.promises.writeFile(Pe.join(e,s.filename),s.content,"utf-8")),n||l.push(this.cleanupOldBodyFiles(e,s?.filename)),(!n||t.responseSchema||t.bodySchema)&&l.push(this.saveSchemaFiles(e,t)),t.doc&&l.push(Ce.promises.writeFile(Pe.join(e,"doc.md"),t.doc,"utf-8")),t.scripts&&l.push(this.saveScriptsToDir(Pe.join(e,nn),t.scripts)),await Promise.all(l)}prepareBodyForSave(e){return yE(e)}async cleanupOldBodyFiles(e,t){return vE(e,t)}async saveScriptsToDir(e,t){return rh(e,t)}async delete(e){let t=this.idToSlugMap.get(e);if(!t&&(this.loadAll(),t=this.idToSlugMap.get(e),!t))return!1;let n=Pe.join(this.collectionsDir,t);if(!Ce.existsSync(n))return!1;try{return await Ce.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(t),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let t=this.idToSlugMap.get(e);return t?Ce.existsSync(Pe.join(this.collectionsDir,t,xr.collection)):!1}getCollectionPath(e){let t=this.idToSlugMap.get(e)||e;return Pe.join(this.collectionsDir,t)}getItemPath(e,t){return this.findItemPath(e,t)}async create(e,t){let n={id:t||pt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,t,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,t);if(!s)throw new Error(`Item ${t} not found in collection ${e}`);await this.saveScriptsToDir(Pe.join(s,nn),n);let a=this.findItemById(i.items,t);a&&(a.scripts=n)}loadScripts(e,t){let n=this.findItemPath(e,t);if(n)return this.loadScriptsFromDir(Pe.join(n,nn))}async updateCollectionMetadata(e,t){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);let i=this.idToSlugMap.get(e);if(!i)throw new Error(`Collection slug not found for ${e}`);let s=Pe.join(this.collectionsDir,i),a=Pe.join(s,xr.collection),l=Ce.readFileSync(a,"utf-8"),d={...JSON.parse(l),...t,id:e};await Ce.promises.writeFile(a,JSON.stringify(d,null,2),"utf-8"),t.name!==void 0&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.version!==void 0&&(n.version=t.version),t.variables!==void 0&&(n.variables=t.variables),t.auth!==void 0&&(n.auth=t.auth)}async saveItem(e,t,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let a;if(n){let h=this.findItemPath(e,n);if(!h)throw new Error(`Parent folder ${n} not found`);a=h}else a=Pe.join(this.collectionsDir,s);let l=this.idToSlugMap.get(t.id);if(!l){let h=Ce.readdirSync(a).filter(g=>Ce.statSync(Pe.join(a,g)).isDirectory()&&g!==nn);l=Sn(t.name,h),this.idToSlugMap.set(t.id,l),this.slugToIdMap.set(l,t.id)}let f=Pe.join(a,l);await Ce.promises.mkdir(f,{recursive:!0}),t.type==="folder"?await this.saveFolderToDir(f,t):await this.saveRequestToDir(f,t);let d=this.findItemById(i.items,t.id);if(d)Object.assign(d,t);else if(n){let h=this.findItemById(i.items,n);h&&h.type==="folder"&&(h.items=h.items||[],h.items.push(t))}else i.items.push(t)}async deleteItem(e,t){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,t);if(!i||!Ce.existsSync(i))return!1;try{await Ce.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,t);let s=this.idToSlugMap.get(t);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(t)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${t}:`,s),!1}}async updateItem(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,t);if(!s)return!1;let a=this.findItemById(i.items,t);if(!a)return!1;let{id:l,type:f,items:d,...h}=n;return Object.assign(a,h),a.type==="folder"?await this.saveFolderToDir(s,a):await this.saveRequestToDir(s,a),!0}async moveItem(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=this.findItemPath(e,t);if(!a||!Ce.existsSync(a))return!1;let l;if(n){let h=this.findItemPath(e,n);if(!h)return!1;l=h}else l=Pe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(t);if(!f)return!1;let d=Pe.join(l,f);if(Ce.existsSync(d))return!1;try{await Ce.promises.rename(a,d);let h=this.findItemById(i.items,t);if(h){let g=h.type==="folder"?{...h,items:h.items?[...h.items]:[]}:{...h};if(this.deleteItemFromTree(i.items,t),n){let y=this.findItemById(i.items,n);y&&y.type==="folder"&&(y.items=y.items||[],y.items.push(g))}else i.items.push(g)}return!0}catch(h){return console.error(`[FolderCollectionStore] Failed to move item ${t}:`,h),!1}}async reorderItems(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=[];for(let l of n){let f=this.idToSlugMap.get(l);f&&a.push(f)}try{if(t){let l=this.findItemPath(e,t);if(!l)return!1;let f=Pe.join(l,xr.folder),d=Ce.readFileSync(f,"utf-8"),h=JSON.parse(d);h.order=a,await Ce.promises.writeFile(f,JSON.stringify(h,null,2),"utf-8");let g=this.findItemById(i.items,t);g&&g.type==="folder"&&g.items&&(g.items=this.sortItemsByOrder(g.items,n))}else{let l=Pe.join(this.collectionsDir,s,xr.collection),f=Ce.readFileSync(l,"utf-8"),d=JSON.parse(f);d.order=a,await Ce.promises.writeFile(l,JSON.stringify(d,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(l){return console.error("[FolderCollectionStore] Failed to reorder items:",l),!1}}sortItemsByOrder(e,t){return wE(e,t)}findItemPath(e,t){let n=this.idToSlugMap.get(e);if(!n)return;let i=Pe.join(this.collectionsDir,n),s=Pb(i,t);if(s)return s;let a=this.load(e);if(a){let f=this.buildSlugPath(a.items,t);if(f)return Pe.join(i,...f)}let l=this.idToSlugMap.get(t);if(l)return Ib(i,l)}buildSlugPath(e,t){for(let n of e){let i=this.idToSlugMap.get(n.id);if(i){if(n.id===t)return[i];if(n.type==="folder"&&n.items){let s=this.buildSlugPath(n.items,t);if(s)return[i,...s]}}}}findItemById(e,t){return Eb(e,t)}deleteItemFromTree(e,t){return Ob(e,t)}}});var lt,zo=se(()=>{"use strict";lt=class{static parseSetCookie(e,t){let n=e.split(";").map(h=>h.trim());if(n.length===0)return null;let[i,...s]=n,a=i.indexOf("=");if(a===-1)return null;let l=i.substring(0,a).trim(),f=i.substring(a+1).trim(),d={name:l,value:f,domain:t};for(let h of s){let g=h.indexOf("="),y=(g===-1?h:h.substring(0,g)).toLowerCase(),S=g===-1?"":h.substring(g+1);switch(y){case"domain":d.domain=S.startsWith(".")?S.substring(1):S;break;case"path":d.path=S;break;case"expires":d.expires=S;break;case"max-age":d.maxAge=parseInt(S,10);break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break;case"samesite":d.sameSite=S;break}}return d}static parseCookieHeaders(e,t){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let a of s){let l=this.parseSetCookie(a,t);l&&n.push(l)}return n}static formatCookieHeader(e){return e.map(t=>`${t.name}=${t.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,t){if(t==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=t.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}}});import*as Fs from"fs";import*as Jo from"path";function sh(r){let e=r.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function kc(r){if(!Fs.existsSync(r))return JL();let e=ih(Jo.join(r,"_global.json"))||{},t=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=Fs.readdirSync(r).filter(d=>d.endsWith(".json")).filter(d=>!d.endsWith(".local.json")).filter(d=>!sh(d)),s={};for(let d of i){let h=ih(Jo.join(r,d))||{},g=Jo.basename(d,".json");s[g]={description:h.description,requiresConfirmation:h.requiresConfirmation,variables:h.variables||{},secretVariables:h.secretVariables}}let l=(ih(Jo.join(r,"_global.local.json"))||{}).variables||{},f={};for(let d of Object.keys(s)){let h=Jo.join(r,`${d}.local.json`);if(Fs.existsSync(h)){let g=ih(h)||{};f[d]={variables:g.variables||{}}}}return{globalVariables:t,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function JL(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function ih(r){try{if(!Fs.existsSync(r))return null;let e=Fs.readFileSync(r,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${r}:`,e),null}}var oh=se(()=>{"use strict"});var Wn,Il=se(()=>{"use strict";Wn=class{buildUrl(e,t={},n={}){let i=e;return i=this.replacePathParams(i,t),i=this.appendQueryParams(i,n),i}replacePathParams(e,t){let n="",i="",s=e,a="",l=e.indexOf("?");l!==-1&&(a=e.substring(l),s=e.substring(0,l));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let d=/:(\w+)(?:\([^)]*\))?(\?)?/g,h=s.replace(d,(g,y,S)=>{let _=t[y];return _!==void 0&&_!==""?encodeURIComponent(_):S?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${y}`),g)});return h=h.replace(/([^:])\/+/g,"$1/"),h.length>1&&h.endsWith("/")&&(h=h.slice(0,-1)),`${n}${i}${h}${a}`}extractPathParams(e){let t=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=t.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,t){let n=e,i={};if(e.includes("?")){let[f,d]=e.split("?");n=f,d&&new URLSearchParams(d).forEach((g,y)=>{i[y]=g})}let s={...i,...t},a=new URLSearchParams;for(let[f,d]of Object.entries(s))d!=null&&a.append(f,d);let l=a.toString();return l?`${n}?${l}`:n}}});function RE(r,e=0){return(er[r[e+0]]+er[r[e+1]]+er[r[e+2]]+er[r[e+3]]+"-"+er[r[e+4]]+er[r[e+5]]+"-"+er[r[e+6]]+er[r[e+7]]+"-"+er[r[e+8]]+er[r[e+9]]+"-"+er[r[e+10]]+er[r[e+11]]+er[r[e+12]]+er[r[e+13]]+er[r[e+14]]+er[r[e+15]]).toLowerCase()}var er,CE=se(()=>{er=[];for(let r=0;r<256;++r)er.push((r+256).toString(16).slice(1))});function qb(){return crypto.getRandomValues(GL)}var GL,xE=se(()=>{GL=new Uint8Array(16)});function YL(r,e,t){return!e&&!r&&crypto.randomUUID?crypto.randomUUID():KL(r,e,t)}function KL(r,e,t){r=r||{};let n=r.random??r.rng?.()??qb();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[t+i]=n[i];return e}return RE(n)}var Pl,EE=se(()=>{xE();CE();Pl=YL});var Ab=se(()=>{EE()});function QL(r=0,e=999){return Math.floor(Math.random()*(e-r+1))+r}function ZL(){return Date.now()}function OE(){return Pl()}function XL(){return Pl()}function IE(r=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="";for(let n=0;n<r;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function ej(){let r=IE(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${r}@${e[Math.floor(Math.random()*e.length)]}`}function tj(){return Math.random()<.5}function rj(r=10){let e="0123456789abcdef",t="";for(let n=0;n<r;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function nj(){return Math.floor(Date.now()/1e3)}function ij(){return new Date().toISOString()}function sj(){return new Date().toISOString().split("T")[0]}function oj(){return new Date().toISOString().split("T")[1].split(".")[0]}function aj(){return new Date().toISOString()}function lj(r=""){return Buffer.from(String(r)).toString("base64")}function uj(r=""){return Buffer.from(String(r),"base64").toString("utf-8")}function cj(r=""){return encodeURIComponent(String(r))}function fj(r=""){return decodeURIComponent(String(r))}function dj(r){return r?r.split(",").map(e=>{let t=e.trim(),n=Number(t);return!isNaN(n)&&t!==""?n:t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t}):[]}function Yi(r,e){let t=PE[r];return t?e&&e.length>0?t(...e):t():null}function pj(r){return!r||typeof r!="string"?r:r.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,t,n)=>{try{let i=n?dj(n):void 0,s=Yi(t,i);return s===null?e:String(s)}catch{return e}})}function Go(r,e){let t=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=t.exec(r))!==null;){let s=i[0],a=i[1];if(!(s in e)){let l=Yi(a);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var PE,ah=se(()=>{"use strict";Ab();PE={randomInt:QL,timestamp:ZL,guid:XL,uuid:OE,randomUUID:OE,randomString:IE,randomHexadecimal:rj,randomEmail:ej,randomBoolean:tj,isoTimestamp:aj,timestamp_s:nj,datetime:ij,date:sj,time:oj,base64Encode:lj,base64Decode:uj,urlEncode:cj,urlDecode:fj}});import*as lh from"vm";function Yo(r){let e=r.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function Ko(r,e={}){try{let t={...e,Math,Date,JSON,Number,String,Boolean,Array,Object,parseInt,parseFloat,isNaN,isFinite,encodeURIComponent,decodeURIComponent,encodeURI,decodeURI,undefined:void 0,null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},n=lh.createContext(t);return lh.runInContext(r,n,{timeout:hj,displayErrors:!1})}catch{return}}var hj,uh=se(()=>{"use strict";hj=100});import*as ch from"crypto";function mj(r){if(typeof r=="string"&&r.charCodeAt(0)===30)try{return JSON.parse(r.slice(1))}catch{return r}return r}function qc(r){if(!r||!r.includes("|"))return null;let e=gj(r);if(e.length<2)return null;let t=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let a=yj(s);a&&n.push(a)}return n.length===0?null:{input:t,filters:n}}function gj(r){let e=[],t="",n=0,i=!1,s=!1;for(let a=0;a<r.length;a++){let l=r[a],f=a>0?r[a-1]:"",d=a<r.length-1?r[a+1]:"";if(f==="\\"){t+=l;continue}if(l==="'"&&!s)i=!i;else if(l==='"'&&!i)s=!s;else if(l==="("&&!i&&!s)n++;else if(l===")"&&!i&&!s)n--;else if(l==="|"&&n===0&&!i&&!s){if(d==="|"){t+="||",a++;continue}e.push(t),t="";continue}t+=l}return t&&e.push(t),e}function yj(r){let e=r.indexOf("(");if(e===-1)return{name:r.trim(),args:[]};let t=r.substring(0,e).trim(),n=r.substring(e+1,r.lastIndexOf(")"));return{name:t,args:vj(n)}}function vj(r){if(!r||!r.trim())return[];let e=[],t="",n=!1,i=!1;for(let s=0;s<r.length;s++){let a=r[s];if((s>0?r[s-1]:"")==="\\"){t+=a;continue}if(a==="'"&&!i){n=!n,t+=a;continue}else if(a==='"'&&!n){i=!i,t+=a;continue}else if(a===","&&!n&&!i){e.push(t.trim()),t="";continue}t+=a}return t.trim()&&e.push(t.trim()),e}function Tt(r,e){if(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))return r.slice(1,-1);let t=Number(r);if(!isNaN(t)&&r!=="")return t;if(r==="true")return!0;if(r==="false")return!1;if(e&&r in e){let n=mj(e[r]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return r}function Ac(r,e,t={}){let n=r;for(let i of e)n=bj(n,i.name,i.args,t);return n}function bj(r,e,t,n){switch(e){case"upper":return String(r).toUpperCase();case"lower":return String(r).toLowerCase();case"trim":return String(r).trim();case"length":return Array.isArray(r)?r.length:String(r).length;case"substring":{let i=Tt(t[0],n),s=t[1]!==void 0?Tt(t[1],n):void 0;return String(r).substring(i<0?String(r).length+i:i,s!==void 0?s<0?String(r).length+s:s:void 0)}case"replace":{let i=t[0]!==void 0?String(Tt(t[0],n)):"",s=t[1]!==void 0?String(Tt(t[1],n)):"";return String(r).replace(new RegExp(wj(i),"g"),s)}case"split":{let i=t[0]!==void 0?String(Tt(t[0],n)):",";return String(r).split(i)}case"join":{let i=t[0]!==void 0?String(Tt(t[0],n)):",";return Array.isArray(r)?r.join(i):String(r)}case"removeQuotes":return String(r).replace(/["']/g,"");case"removeSpaces":return String(r).replace(/\s/g,"");case"format":{let i=t[0]!==void 0?String(Tt(t[0],n)):"{0}";i=i.replace("{0}",String(r));for(let s=1;s<t.length;s++){let a=Tt(t[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=Tt(t[0],n);return Number(r)+i}case"subtract":{let i=Tt(t[0],n);return Number(r)-i}case"multiply":{let i=Tt(t[0],n);return Number(r)*i}case"abs":return Math.abs(Number(r));case"btoa":return Buffer.from(String(r)).toString("base64");case"atob":return Buffer.from(String(r),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(r));case"urlDecode":return decodeURIComponent(String(r));case"hash":{let i=String(t[0]!==void 0?Tt(t[0],n):"md5").toLowerCase(),s=String(t[1]!==void 0?Tt(t[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return ch.createHash(l).update(String(r)).digest(s)}case"hmac":{let i=t[0]?String(Tt(t[0],n)):"",s=String(t[1]!==void 0?Tt(t[1],n):"sha256").toLowerCase(),a=String(t[2]!==void 0?Tt(t[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return ch.createHmac(f,i).update(String(r)).digest(a)}case"first":return Array.isArray(r)?r[0]:r;case"last":return Array.isArray(r)?r[r.length-1]:r;case"at":{let i=Tt(t[0],n);return Array.isArray(r)?r.at(i):r}case"slice":{let i=Tt(t[0],n),s=t[1]!==void 0?Tt(t[1],n):void 0;return Array.isArray(r)?r.slice(i,s):String(r).slice(i,s)}case"unique":return Array.isArray(r)?[...new Set(r)]:r;case"filter":return!Array.isArray(r)||!t[0]?r:Sj(r,t[0],n);case"map":{if(!Array.isArray(r))return r;let i=t.map(s=>String(Tt(s,n)));return i.length===1?r.map(s=>Tc(s,i[0])):r.map(s=>{let a={};for(let l of i){let f=Tc(s,l);f!==void 0&&(a[l]=f)}return a})}case"prop":{let i=t[0]!==void 0?String(Tt(t[0],n)):"";if(Array.isArray(r)){let s=r.map(a=>Tc(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return r&&typeof r=="object"?Tc(r,i):r}case"parseJSON":try{return JSON.parse(String(r))}catch{return r}case"stringify":try{return JSON.stringify(r)}catch{return String(r)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(r));case"isUrl":try{return new URL(String(r)),!0}catch{return!1}case"setIfValue":return r||void 0;case"setNull":return r===null?null:r;default:return r}}function Sj(r,e,t){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return r;let[,i,s,a]=n,l=Tt(a,t);return r.filter(f=>{let d=Tc(f,i);if(d===void 0)return!1;switch(s){case">":return Number(d)>Number(l);case">=":return Number(d)>=Number(l);case"<":return Number(d)<Number(l);case"<=":return Number(d)<=Number(l);case"=":return String(d)===String(l);case"!=":return String(d)!==String(l);case"*=":return String(d).includes(String(l));case"^=":return String(d).startsWith(String(l));case"$=":return String(d).endsWith(String(l));default:return!0}})}function Tc(r,e){if(!(!r||typeof r!="object"))return e in r?r[e]:e.split(".").reduce((t,n)=>t?.[n],r)}function wj(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var fh=se(()=>{"use strict"});function kE(r,e){if(r)return r.split(",").map(t=>{let n=t.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function _j(r){return new Qo(r)}var Qo,Zo,$c=se(()=>{"use strict";ah();uh();fh();Qo=class r{allVariables;static MAX_RESOLUTION_DEPTH=20;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.variables}}resolveString(e,t=!1){return typeof e!="string"?e:this.resolveUntilStable(e,this.allVariables,t)}resolveStringWithExtra(e,t,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...t};return this.resolveUntilStable(e,i,n)}resolveUntilStable(e,t,n){let i=e;for(let s=0;s<r.MAX_RESOLUTION_DEPTH;s++){let a=this.resolveSinglePass(i,t,n);if(a===i)break;i=a}return i}resolveSinglePass(e,t,n){if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(f,d)=>this.resolveTemplateContent(d.trim(),t,f));let i="",s=0,a=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=a.exec(e))!==null;){let f=l[1].trim(),d=this.resolveTemplateContent(f,t,l[0]);if(d!==l[0]){i+=e.slice(s,l.index);let h=this.getStringContext(e,l.index);i+=h?this.escapeForString(String(d),h):String(d)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,t=!1){if(typeof e=="string")return this.resolveString(e,t);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,t));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,t);return n}return e}resolveObjectWithExtra(e,t,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,t,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,t,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,a]of Object.entries(e))i[s]=this.resolveObjectWithExtra(a,t,n);return i}return e}resolveTemplateContent(e,t,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let l=kE(i[2],t),f=Yi(i[1],l);return f!==null?String(f):n}let s=qc(e);if(s){let l=this.resolveFilterInput(s.input,t);if(l!==void 0){let f=Ac(l,s.filters,t);return f!==void 0?String(f):n}return n}let a=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(a){let l=a[1];if(t[l]!==void 0){let f=this.deserializeValue(t[l]),d=a[2],h=this.resolvePropertyAccess(f,d);if(h!==void 0)return typeof h=="object"?JSON.stringify(h):String(h)}}if(t[e]!==void 0){let l=t[e];return typeof l=="string"&&l.charCodeAt(0)===30?l.slice(1):String(l)}if(Yo(e)){let l=this.deserializeVariables(t),f=Go(e,l),d=Ko(e,f);if(d!==void 0)return String(d)}return n}resolveFilterInput(e,t){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=kE(n[2],t),a=Yi(n[1],s);return a!==null?a:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(t[s]!==void 0){let a=this.deserializeValue(t[s]),l=this.resolvePropertyAccess(a,i[2]);if(l!==void 0)return l}}if(t[e]!==void 0)return this.deserializeValue(t[e]);if(Yo(e)){let s=this.deserializeVariables(t),a=Go(e,s),l=Ko(e,a);if(l!==void 0)return l}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{return e}return e}deserializeVariables(e){let t={};for(let[n,i]of Object.entries(e))t[n]=this.deserializeValue(i);return t}resolvePropertyAccess(e,t){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(t))!==null;){if(n==null)return;if(s[1]!==void 0){let a=s[1];/^\d+$/.test(a)?n=n[Number(a)]:n=n[a.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,t){let n=e.replace(/\\/g,"\\\\");return t==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,t){let n=null;for(let i=0;i<t;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},Zo=class{interpolate(e,t){return!e||typeof e!="string"?e:new Qo({globals:{},collectionVariables:{},environmentVariables:{},variables:t}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let t=[],n,i=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(t.includes(s)||t.push(s))}return t}interpolateObject(e,t){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,t);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,t));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,t);return n}return e}}});import*as Rj from"http";import*as Mc from"https";import{URL as TE}from"url";import*as dh from"zlib";var zn,Xo,Nc=se(()=>{"use strict";zn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Xo=class{settings;version;constructor(e){this.settings={...zn,...e};try{this.version=it("../../package.json").version||"0.0.0"}catch{this.version="0.0.0"}this.settings.strictSSL===!1&&console.log("[NodeHttpClient] SSL verification disabled (strictSSL: false)")}async send(e){let t=this.mergeSettings(e.settings);return await this.executeInternal(e,t,0)}mergeSettings(e){return{timeout:e?.timeout??this.settings.timeout,followRedirects:e?.followRedirects??this.settings.followRedirects,followOriginalMethod:e?.followOriginalMethod??this.settings.followOriginalMethod,followAuthHeader:e?.followAuthHeader??this.settings.followAuthHeader,maxRedirects:e?.maxRedirects??this.settings.maxRedirects,strictSSL:e?.strictSSL??this.settings.strictSSL,decompress:e?.decompress??this.settings.decompress,includeCookies:e?.includeCookies??this.settings.includeCookies}}async executeInternal(e,t,n,i){let s=Date.now(),a=new TE(e.url),l=a.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(g=>g.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let h={hostname:a.hostname,port:a.port||(l?443:80),path:a.pathname+a.search,method:e.method,headers:{...f},timeout:t.timeout||void 0};return t.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(h.headers["Accept-Encoding"]="gzip, deflate"),l&&(h.rejectUnauthorized=t.strictSSL,t.strictSSL?h.agent=Mc.globalAgent:h.agent=new Mc.Agent({rejectUnauthorized:!1})),new Promise((g,y)=>{if(i?.aborted){let R=new Error("Request cancelled");R.name="AbortError",y(R);return}let _=(l?Mc:Rj).request(h,async R=>{let I=R.statusCode||0;if(t.followRedirects&&[301,302,303,307,308].includes(I)){if(n>=t.maxRedirects){y(new Error(`Maximum redirects (${t.maxRedirects}) exceeded`));return}let U=R.headers.location;if(!U){y(new Error("Redirect response missing Location header"));return}let B=new TE(U,e.url).toString(),V=e.method;!t.followOriginalMethod&&[301,302,303].includes(I)&&(V="GET");let W={...e.headers};t.followAuthHeader||(delete W.authorization,delete W.Authorization);try{let X=await this.executeInternal({...e,url:B,method:V,headers:W,body:V==="GET"?void 0:e.body},t,n+1,i),T=Date.now();X.time=T-s,g(X)}catch(X){y(X)}return}let q=[];R.on("data",U=>q.push(U)),R.on("end",()=>{let U=Date.now(),B=Buffer.concat(q),V=R.headers["content-encoding"];if(t.decompress&&V)try{V==="gzip"?B=dh.gunzipSync(B):V==="deflate"&&(B=dh.inflateSync(B))}catch(C){console.warn("[NodeHttpClient] Decompression failed:",C)}let W=B.toString("utf-8"),X={};for(let[C,k]of Object.entries(R.headers))(typeof k=="string"||Array.isArray(k))&&(X[C]=k);let T=this.parseCookies(R.headers["set-cookie"],a.hostname);g({status:R.statusCode||0,statusText:R.statusMessage||"",headers:X,cookies:T,body:W,time:U-s,size:B.length})})});if(i&&i.addEventListener("abort",()=>{_.destroy();let R=new Error("Request cancelled");R.name="AbortError",y(R)}),_.on("error",R=>{y(R)}),_.on("timeout",()=>{_.destroy(),y(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let R=typeof e.body=="string"?e.body:JSON.stringify(e.body);_.write(R)}_.end()})}sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let t={};for(let[n,i]of Object.entries(e))t[n]=this.sanitizeHeaderValue(String(i));return t}parseCookies(e,t){return e?e.map(n=>{let i=n.split(";").map(h=>h.trim()),[s,...a]=i,[l,f]=s.split("="),d={name:l.trim(),value:f?.trim()||"",domain:t};for(let h of a){let[g,y]=h.split("=");switch(g.toLowerCase().trim()){case"domain":d.domain=y?.trim();break;case"path":d.path=y?.trim();break;case"expires":d.expires=y?.trim();break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break}}return d}):[]}}});function $b(r){return{timeout:r?.timeout??zn.timeout,followRedirects:r?.followRedirects??zn.followRedirects,followOriginalMethod:r?.followOriginalMethod??zn.followOriginalMethod,followAuthHeader:r?.followAuthHeader??zn.followAuthHeader,maxRedirects:r?.maxRedirects??zn.maxRedirects,strictSSL:r?.strictSSL??zn.strictSSL,decompress:r?.decompress??zn.decompress,includeCookies:r?.includeCookies??zn.includeCookies}}var Mb=se(()=>{"use strict";Nc()});var Ki,Dc=se(()=>{"use strict";Mb();Ki=class{constructor(e,t,n){this.urlBuilder=e;this.interceptors=t;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let t=$b(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,e,n);if(a)return a;throw s}try{let s=await this.httpClient.send({...i,settings:t});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,i,n);if(a)return a;throw s}}buildUrl(e,t={},n={}){return this.urlBuilder.buildUrl(e,t,n)}}});var Qi,Nb,Db,Fb,Fc=se(()=>{"use strict";Qi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let t=this.requestInterceptors.findIndex(n=>n.name===e);return t>=0?(this.requestInterceptors.splice(t,1),!0):!1}removeResponseInterceptor(e){let t=this.responseInterceptors.findIndex(n=>n.name===e);return t>=0?(this.responseInterceptors.splice(t,1),!0):!1}removeErrorInterceptor(e){let t=this.errorInterceptors.findIndex(n=>n.name===e);return t>=0?(this.errorInterceptors.splice(t,1),!0):!1}async executeRequestInterceptors(e,t){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,t)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,t,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,t,n)}catch(a){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,a),a}return i}async executeErrorInterceptors(e,t,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,t,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((t,n)=>(t.priority??100)-(n.priority??100))}},Nb=class{name="logging";priority=1e3;intercept(e,t){return e}},Db=class{name="timing";priority=1;intercept(e,t,n){return e}},Fb=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,t=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=t}handle(e,t,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}}});var qE=F((kl,Lc)=>{(function(){var r,e="4.18.1",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",a="Invalid `imports` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,d="__lodash_placeholder__",h=1,g=2,y=4,S=1,_=2,R=1,I=2,q=4,U=8,B=16,V=32,W=64,X=128,T=256,C=512,k=30,N="...",j=800,$=16,G=1,K=2,ne=3,pe=1/0,et=9007199254740991,_e=17976931348623157e292,he=NaN,xe=4294967295,bt=xe-1,It=xe>>>1,ue=[["ary",X],["bind",R],["bindKey",I],["curry",U],["curryRight",B],["flip",C],["partial",V],["partialRight",W],["rearg",T]],mr="[object Arguments]",fi="[object Array]",Ct="[object AsyncFunction]",Gr="[object Boolean]",Pr="[object Date]",mt="[object DOMException]",gt="[object Error]",ln="[object Function]",ho="[object GeneratorFunction]",Yt="[object Map]",mo="[object Number]",ly="[object Null]",Tn="[object Object]",Fd="[object Promise]",Ld="[object Proxy]",Kt="[object RegExp]",gr="[object Set]",go="[object String]",Da="[object Symbol]",jd="[object Undefined]",Bt="[object WeakMap]",Ud="[object WeakSet]",qi="[object ArrayBuffer]",qn="[object DataView]",at="[object Float32Array]",Fa="[object Float64Array]",La="[object Int8Array]",ms="[object Int16Array]",yo="[object Int32Array]",gs="[object Uint8Array]",di="[object Uint8ClampedArray]",ys="[object Uint16Array]",Bu="[object Uint32Array]",ja=/\b__p \+= '';/g,uy=/\b(__p \+=) '' \+/g,vo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ai=/&(?:amp|lt|gt|quot|#39);/g,Ua=/[&<>"']/g,Ha=RegExp(Ai.source),le=RegExp(Ua.source),cy=/<%-([\s\S]+?)%>/g,fy=/<%([\s\S]+?)%>/g,un=/<%=([\s\S]+?)%>/g,kr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ae=/^\w*$/,Vu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ke=/[\\^$.*+?()[\]{}|]/g,bo=RegExp(Ke.source),Wu=/^\s+/,Ba=/\s/,Qt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,An=/\{\n\/\* \[wrapped with (.+)\] \*/,cn=/,? & /,$t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Tr=/[()=,{}\[\]\/\s]/,$n=/\\(\\)?/g,$i=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Hd=/\w*$/,dy=/^[-+]0x[0-9a-f]+$/i,So=/^0b[01]+$/i,Bd=/^\[object .+?Constructor\]$/,py=/^0o[0-7]+$/i,vs=/^(?:0|[1-9]\d*)$/,wo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_o=/($^)/,hy=/['\n\r\u2028\u2029\\]/g,Va="\\ud800-\\udfff",my="\\u0300-\\u036f",xt="\\ufe20-\\ufe2f",zu="\\u20d0-\\u20ff",Vd=my+xt+zu,Ju="\\u2700-\\u27bf",Gu="a-z\\xdf-\\xf6\\xf8-\\xff",gy="\\xac\\xb1\\xd7\\xf7",yy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vy="\\u2000-\\u206f",by=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Wd="A-Z\\xc0-\\xd6\\xd8-\\xde",zd="\\ufe0e\\ufe0f",Yu=gy+yy+vy+by,Wa="['\u2019]",Sy="["+Va+"]",Jd="["+Yu+"]",za="["+Vd+"]",Ku="\\d+",wy="["+Ju+"]",bs="["+Gu+"]",Ro="[^"+Va+Yu+Ku+Ju+Gu+Wd+"]",Ja="\\ud83c[\\udffb-\\udfff]",Co="(?:"+za+"|"+Ja+")",fn="[^"+Va+"]",Qu="(?:\\ud83c[\\udde6-\\uddff]){2}",Zu="[\\ud800-\\udbff][\\udc00-\\udfff]",Ss="["+Wd+"]",Gd="\\u200d",Yd="(?:"+bs+"|"+Ro+")",_y="(?:"+Ss+"|"+Ro+")",Kd="(?:"+Wa+"(?:d|ll|m|re|s|t|ve))?",Qd="(?:"+Wa+"(?:D|LL|M|RE|S|T|VE))?",Ga=Co+"?",Zd="["+zd+"]?",Xd="(?:"+Gd+"(?:"+[fn,Qu,Zu].join("|")+")"+Zd+Ga+")*",Ry="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ep=Zd+Ga+Xd,xy="(?:"+[wy,Qu,Zu].join("|")+")"+ep,Ey="(?:"+[fn+za+"?",za,Qu,Zu,Sy].join("|")+")",Oy=RegExp(Wa,"g"),Iy=RegExp(za,"g"),Xu=RegExp(Ja+"(?="+Ja+")|"+Ey+ep,"g"),Py=RegExp([Ss+"?"+bs+"+"+Kd+"(?="+[Jd,Ss,"$"].join("|")+")",_y+"+"+Qd+"(?="+[Jd,Ss+Yd,"$"].join("|")+")",Ss+"?"+Yd+"+"+Kd,Ss+"+"+Qd,Cy,Ry,Ku,xy].join("|"),"g"),ky=RegExp("["+Gd+Va+Vd+zd+"]"),Ty=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qy=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ay=-1,dt={};dt[at]=dt[Fa]=dt[La]=dt[ms]=dt[yo]=dt[gs]=dt[di]=dt[ys]=dt[Bu]=!0,dt[mr]=dt[fi]=dt[qi]=dt[Gr]=dt[qn]=dt[Pr]=dt[gt]=dt[ln]=dt[Yt]=dt[mo]=dt[Tn]=dt[Kt]=dt[gr]=dt[go]=dt[Bt]=!1;var ut={};ut[mr]=ut[fi]=ut[qi]=ut[qn]=ut[Gr]=ut[Pr]=ut[at]=ut[Fa]=ut[La]=ut[ms]=ut[yo]=ut[Yt]=ut[mo]=ut[Tn]=ut[Kt]=ut[gr]=ut[go]=ut[Da]=ut[gs]=ut[di]=ut[ys]=ut[Bu]=!0,ut[gt]=ut[ln]=ut[Bt]=!1;var ec={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},tc={"&":"&","<":"<",">":">",'"':""","'":"'"},$y={"&":"&","<":"<",">":">",""":'"',"'":"'"},tp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},rp=parseFloat,My=parseInt,np=typeof global=="object"&&global&&global.Object===Object&&global,Ny=typeof self=="object"&&self&&self.Object===Object&&self,Ft=np||Ny||Function("return this")(),Ya=typeof kl=="object"&&kl&&!kl.nodeType&&kl,Qe=Ya&&typeof Lc=="object"&&Lc&&!Lc.nodeType&&Lc,ws=Qe&&Qe.exports===Ya,Mi=ws&&np.process,qr=(function(){try{var L=Qe&&Qe.require&&Qe.require("util").types;return L||Mi&&Mi.binding&&Mi.binding("util")}catch{}})(),rc=qr&&qr.isArrayBuffer,ip=qr&&qr.isDate,sp=qr&&qr.isMap,xo=qr&&qr.isRegExp,Mn=qr&&qr.isSet,Ka=qr&&qr.isTypedArray;function yr(L,Y,z){switch(z.length){case 0:return L.call(Y);case 1:return L.call(Y,z[0]);case 2:return L.call(Y,z[0],z[1]);case 3:return L.call(Y,z[0],z[1],z[2])}return L.apply(Y,z)}function Nn(L,Y,z,ae){for(var be=-1,Ge=L==null?0:L.length;++be<Ge;){var rt=L[be];Y(ae,rt,z(rt),L)}return ae}function vr(L,Y){for(var z=-1,ae=L==null?0:L.length;++z<ae&&Y(L[z],z,L)!==!1;);return L}function nc(L,Y){for(var z=L==null?0:L.length;z--&&Y(L[z],z,L)!==!1;);return L}function op(L,Y){for(var z=-1,ae=L==null?0:L.length;++z<ae;)if(!Y(L[z],z,L))return!1;return!0}function pi(L,Y){for(var z=-1,ae=L==null?0:L.length,be=0,Ge=[];++z<ae;){var rt=L[z];Y(rt,z,L)&&(Ge[be++]=rt)}return Ge}function Qa(L,Y){var z=L==null?0:L.length;return!!z&&Ni(L,Y,0)>-1}function _s(L,Y,z){for(var ae=-1,be=L==null?0:L.length;++ae<be;)if(z(Y,L[ae]))return!0;return!1}function ct(L,Y){for(var z=-1,ae=L==null?0:L.length,be=Array(ae);++z<ae;)be[z]=Y(L[z],z,L);return be}function hi(L,Y){for(var z=-1,ae=Y.length,be=L.length;++z<ae;)L[be+z]=Y[z];return L}function ic(L,Y,z,ae){var be=-1,Ge=L==null?0:L.length;for(ae&&Ge&&(z=L[++be]);++be<Ge;)z=Y(z,L[be],be,L);return z}function Dy(L,Y,z,ae){var be=L==null?0:L.length;for(ae&&be&&(z=L[--be]);be--;)z=Y(z,L[be],be,L);return z}function Za(L,Y){for(var z=-1,ae=L==null?0:L.length;++z<ae;)if(Y(L[z],z,L))return!0;return!1}var Fy=Eo("length");function Ly(L){return L.split("")}function jy(L){return L.match($t)||[]}function ap(L,Y,z){var ae;return z(L,function(be,Ge,rt){if(Y(be,Ge,rt))return ae=Ge,!1}),ae}function Xa(L,Y,z,ae){for(var be=L.length,Ge=z+(ae?1:-1);ae?Ge--:++Ge<be;)if(Y(L[Ge],Ge,L))return Ge;return-1}function Ni(L,Y,z){return Y===Y?Yy(L,Y,z):Xa(L,Di,z)}function Uy(L,Y,z,ae){for(var be=z-1,Ge=L.length;++be<Ge;)if(ae(L[be],Y))return be;return-1}function Di(L){return L!==L}function lp(L,Y){var z=L==null?0:L.length;return z?oc(L,Y)/z:he}function Eo(L){return function(Y){return Y==null?r:Y[L]}}function sc(L){return function(Y){return L==null?r:L[Y]}}function el(L,Y,z,ae,be){return be(L,function(Ge,rt,Ue){z=ae?(ae=!1,Ge):Y(z,Ge,rt,Ue)}),z}function Hy(L,Y){var z=L.length;for(L.sort(Y);z--;)L[z]=L[z].value;return L}function oc(L,Y){for(var z,ae=-1,be=L.length;++ae<be;){var Ge=Y(L[ae]);Ge!==r&&(z=z===r?Ge:z+Ge)}return z}function ac(L,Y){for(var z=-1,ae=Array(L);++z<L;)ae[z]=Y(z);return ae}function By(L,Y){return ct(Y,function(z){return[z,L[z]]})}function lc(L){return L&&L.slice(0,pp(L)+1).replace(Wu,"")}function br(L){return function(Y){return L(Y)}}function tl(L,Y){return ct(Y,function(z){return L[z]})}function tt(L,Y){return L.has(Y)}function up(L,Y){for(var z=-1,ae=L.length;++z<ae&&Ni(Y,L[z],0)>-1;);return z}function cp(L,Y){for(var z=L.length;z--&&Ni(Y,L[z],0)>-1;);return z}function fp(L,Y){for(var z=L.length,ae=0;z--;)L[z]===Y&&++ae;return ae}var Vy=sc(ec),Wy=sc(tc);function zy(L){return"\\"+tp[L]}function Oo(L,Y){return L==null?r:L[Y]}function Rs(L){return ky.test(L)}function Jy(L){return Ty.test(L)}function Gy(L){for(var Y,z=[];!(Y=L.next()).done;)z.push(Y.value);return z}function Cs(L){var Y=-1,z=Array(L.size);return L.forEach(function(ae,be){z[++Y]=[be,ae]}),z}function Io(L,Y){return function(z){return L(Y(z))}}function dn(L,Y){for(var z=-1,ae=L.length,be=0,Ge=[];++z<ae;){var rt=L[z];(rt===Y||rt===d)&&(L[z]=d,Ge[be++]=z)}return Ge}function rl(L){var Y=-1,z=Array(L.size);return L.forEach(function(ae){z[++Y]=ae}),z}function dp(L){var Y=-1,z=Array(L.size);return L.forEach(function(ae){z[++Y]=[ae,ae]}),z}function Yy(L,Y,z){for(var ae=z-1,be=L.length;++ae<be;)if(L[ae]===Y)return ae;return-1}function uc(L,Y,z){for(var ae=z+1;ae--;)if(L[ae]===Y)return ae;return ae}function mi(L){return Rs(L)?Qy(L):Fy(L)}function Sr(L){return Rs(L)?Zy(L):Ly(L)}function pp(L){for(var Y=L.length;Y--&&Ba.test(L.charAt(Y)););return Y}var Ky=sc($y);function Qy(L){for(var Y=Xu.lastIndex=0;Xu.test(L);)++Y;return Y}function Zy(L){return L.match(Xu)||[]}function Xy(L){return L.match(Py)||[]}var ev=(function L(Y){Y=Y==null?Ft:gi.defaults(Ft.Object(),Y,gi.pick(Ft,qy));var z=Y.Array,ae=Y.Date,be=Y.Error,Ge=Y.Function,rt=Y.Math,Ue=Y.Object,nl=Y.RegExp,tv=Y.String,wr=Y.TypeError,Po=z.prototype,rv=Ge.prototype,xs=Ue.prototype,ko=Y["__core-js_shared__"],il=rv.toString,Ze=xs.hasOwnProperty,nv=0,hp=(function(){var o=/[^.]+$/.exec(ko&&ko.keys&&ko.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),sl=xs.toString,iv=il.call(Ue),sv=Ft._,ov=nl("^"+il.call(Ze).replace(Ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ol=ws?Y.Buffer:r,yi=Y.Symbol,al=Y.Uint8Array,mp=ol?ol.allocUnsafe:r,ll=Io(Ue.getPrototypeOf,Ue),gp=Ue.create,To=xs.propertyIsEnumerable,ul=Po.splice,yp=yi?yi.isConcatSpreadable:r,qo=yi?yi.iterator:r,Fi=yi?yi.toStringTag:r,cl=(function(){try{var o=Ho(Ue,"defineProperty");return o({},"",{}),o}catch{}})(),av=Y.clearTimeout!==Ft.clearTimeout&&Y.clearTimeout,lv=ae&&ae.now!==Ft.Date.now&&ae.now,uv=Y.setTimeout!==Ft.setTimeout&&Y.setTimeout,Ao=rt.ceil,$o=rt.floor,fl=Ue.getOwnPropertySymbols,dl=ol?ol.isBuffer:r,Li=Y.isFinite,pl=Po.join,vp=Io(Ue.keys,Ue),yt=rt.max,Vt=rt.min,bp=ae.now,cv=Y.parseInt,Sp=rt.random,fv=Po.reverse,cc=Ho(Y,"DataView"),Mo=Ho(Y,"Map"),fc=Ho(Y,"Promise"),Es=Ho(Y,"Set"),No=Ho(Y,"WeakMap"),Do=Ho(Ue,"create"),hl=No&&new No,Os={},dv=Bo(cc),pv=Bo(Mo),hv=Bo(fc),mv=Bo(Es),gv=Bo(No),ml=yi?yi.prototype:r,Fo=ml?ml.valueOf:r,wp=ml?ml.toString:r;function O(o){if(Pt(o)&&!Re(o)&&!(o instanceof $e)){if(o instanceof sr)return o;if(Ze.call(o,"__wrapped__"))return qx(o)}return new sr(o)}var Is=(function(){function o(){}return function(u){if(!Et(u))return{};if(gp)return gp(u);o.prototype=u;var p=new o;return o.prototype=r,p}})();function gl(){}function sr(o,u){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=r}O.templateSettings={escape:cy,evaluate:fy,interpolate:un,variable:"",imports:{_:O}},O.prototype=gl.prototype,O.prototype.constructor=O,sr.prototype=Is(gl.prototype),sr.prototype.constructor=sr;function $e(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=xe,this.__views__=[]}function yv(){var o=new $e(this.__wrapped__);return o.__actions__=Ar(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Ar(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Ar(this.__views__),o}function vv(){if(this.__filtered__){var o=new $e(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function dc(){var o=this.__wrapped__.value(),u=this.__dir__,p=Re(o),v=u<0,x=p?o.length:0,P=lM(0,x,this.__views__),A=P.start,D=P.end,H=D-A,Q=v?D:A-1,Z=this.__iteratees__,ee=Z.length,ie=0,ce=Vt(H,this.__takeCount__);if(!p||!v&&x==H&&ce==H)return tx(o,this.__actions__);var ye=[];e:for(;H--&&ie<ce;){Q+=u;for(var Ie=-1,me=o[Q];++Ie<ee;){var Le=Z[Ie],He=Le.iteratee,en=Le.type,Cr=He(me);if(en==K)me=Cr;else if(!Cr){if(en==G)continue e;break e}}ye[ie++]=me}return ye}$e.prototype=Is(gl.prototype),$e.prototype.constructor=$e;function pn(o){var u=-1,p=o==null?0:o.length;for(this.clear();++u<p;){var v=o[u];this.set(v[0],v[1])}}function bv(){this.__data__=Do?Do(null):{},this.size=0}function Sv(o){var u=this.has(o)&&delete this.__data__[o];return this.size-=u?1:0,u}function wv(o){var u=this.__data__;if(Do){var p=u[o];return p===l?r:p}return Ze.call(u,o)?u[o]:r}function _v(o){var u=this.__data__;return Do?u[o]!==r:Ze.call(u,o)}function Rv(o,u){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=Do&&u===r?l:u,this}pn.prototype.clear=bv,pn.prototype.delete=Sv,pn.prototype.get=wv,pn.prototype.has=_v,pn.prototype.set=Rv;function Dn(o){var u=-1,p=o==null?0:o.length;for(this.clear();++u<p;){var v=o[u];this.set(v[0],v[1])}}function _p(){this.__data__=[],this.size=0}function Cv(o){var u=this.__data__,p=vl(u,o);if(p<0)return!1;var v=u.length-1;return p==v?u.pop():ul.call(u,p,1),--this.size,!0}function xv(o){var u=this.__data__,p=vl(u,o);return p<0?r:u[p][1]}function Rp(o){return vl(this.__data__,o)>-1}function Ev(o,u){var p=this.__data__,v=vl(p,o);return v<0?(++this.size,p.push([o,u])):p[v][1]=u,this}Dn.prototype.clear=_p,Dn.prototype.delete=Cv,Dn.prototype.get=xv,Dn.prototype.has=Rp,Dn.prototype.set=Ev;function Fn(o){var u=-1,p=o==null?0:o.length;for(this.clear();++u<p;){var v=o[u];this.set(v[0],v[1])}}function Ov(){this.size=0,this.__data__={hash:new pn,map:new(Mo||Dn),string:new pn}}function vi(o){var u=Vp(this,o).delete(o);return this.size-=u?1:0,u}function Cp(o){return Vp(this,o).get(o)}function Iv(o){return Vp(this,o).has(o)}function Pv(o,u){var p=Vp(this,o),v=p.size;return p.set(o,u),this.size+=p.size==v?0:1,this}Fn.prototype.clear=Ov,Fn.prototype.delete=vi,Fn.prototype.get=Cp,Fn.prototype.has=Iv,Fn.prototype.set=Pv;function ji(o){var u=-1,p=o==null?0:o.length;for(this.__data__=new Fn;++u<p;)this.add(o[u])}function te(o){return this.__data__.set(o,l),this}function kv(o){return this.__data__.has(o)}ji.prototype.add=ji.prototype.push=te,ji.prototype.has=kv;function Yr(o){var u=this.__data__=new Dn(o);this.size=u.size}function xp(){this.__data__=new Dn,this.size=0}function Ve(o){var u=this.__data__,p=u.delete(o);return this.size=u.size,p}function yl(o){return this.__data__.get(o)}function Ep(o){return this.__data__.has(o)}function pc(o,u){var p=this.__data__;if(p instanceof Dn){var v=p.__data__;if(!Mo||v.length<t-1)return v.push([o,u]),this.size=++p.size,this;p=this.__data__=new Fn(v)}return p.set(o,u),this.size=p.size,this}Yr.prototype.clear=xp,Yr.prototype.delete=Ve,Yr.prototype.get=yl,Yr.prototype.has=Ep,Yr.prototype.set=pc;function Op(o,u){var p=Re(o),v=!p&&Vo(o),x=!p&&!v&&Ms(o),P=!p&&!v&&!x&&Cl(o),A=p||v||x||P,D=A?ac(o.length,tv):[],H=D.length;for(var Q in o)(u||Ze.call(o,Q))&&!(A&&(Q=="length"||x&&(Q=="offset"||Q=="parent")||P&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||Vi(Q,H)))&&D.push(Q);return D}function Ip(o){var u=o.length;return u?o[Bv(0,u-1)]:r}function Tv(o,u){return Wp(Ar(o),bi(u,0,o.length))}function qv(o){return Wp(Ar(o))}function hc(o,u,p){(p!==r&&!Bn(o[u],p)||p===r&&!(u in o))&&Kr(o,u,p)}function _r(o,u,p){var v=o[u];(!(Ze.call(o,u)&&Bn(v,p))||p===r&&!(u in o))&&Kr(o,u,p)}function vl(o,u){for(var p=o.length;p--;)if(Bn(o[p][0],u))return p;return-1}function Pp(o,u,p,v){return Si(o,function(x,P,A){u(v,x,p(x),A)}),v}function kp(o,u){return o&&wi(u,Zt(u),o)}function Av(o,u){return o&&wi(u,Mr(u),o)}function Kr(o,u,p){u=="__proto__"&&cl?cl(o,u,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[u]=p}function mc(o,u){for(var p=-1,v=u.length,x=z(v),P=o==null;++p<v;)x[p]=P?r:mb(o,u[p]);return x}function bi(o,u,p){return o===o&&(p!==r&&(o=o<=p?o:p),u!==r&&(o=o>=u?o:u)),o}function or(o,u,p,v,x,P){var A,D=u&h,H=u&g,Q=u&y;if(p&&(A=x?p(o,v,x,P):p(o)),A!==r)return A;if(!Et(o))return o;var Z=Re(o);if(Z){if(A=cM(o),!D)return Ar(o,A)}else{var ee=ar(o),ie=ee==ln||ee==ho;if(Ms(o))return ix(o,D);if(ee==Tn||ee==mr||ie&&!x){if(A=H||ie?{}:Rx(o),!D)return H?X$(o,Av(A,o)):Z$(o,kp(A,o))}else{if(!ut[ee])return x?o:{};A=fM(o,ee,D)}}P||(P=new Yr);var ce=P.get(o);if(ce)return ce;P.set(o,A),Zx(o)?o.forEach(function(me){A.add(or(me,u,p,me,o,P))}):Kx(o)&&o.forEach(function(me,Le){A.set(Le,or(me,u,p,Le,o,P))});var ye=Q?H?eb:Xv:H?Mr:Zt,Ie=Z?r:ye(o);return vr(Ie||o,function(me,Le){Ie&&(Le=me,me=o[Le]),_r(A,Le,or(me,u,p,Le,o,P))}),A}function $v(o){var u=Zt(o);return function(p){return hn(p,o,u)}}function hn(o,u,p){var v=p.length;if(o==null)return!v;for(o=Ue(o);v--;){var x=p[v],P=u[x],A=o[x];if(A===r&&!(x in o)||!P(A))return!1}return!0}function gc(o,u,p){if(typeof o!="function")throw new wr(i);return Rc(function(){o.apply(r,p)},u)}function Lo(o,u,p,v){var x=-1,P=Qa,A=!0,D=o.length,H=[],Q=u.length;if(!D)return H;p&&(u=ct(u,br(p))),v?(P=_s,A=!1):u.length>=t&&(P=tt,A=!1,u=new ji(u));e:for(;++x<D;){var Z=o[x],ee=p==null?Z:p(Z);if(Z=v||Z!==0?Z:0,A&&ee===ee){for(var ie=Q;ie--;)if(u[ie]===ee)continue e;H.push(Z)}else P(u,ee,v)||H.push(Z)}return H}var Si=ux(mn),Tp=ux(Ln,!0);function Mv(o,u){var p=!0;return Si(o,function(v,x,P){return p=!!u(v,x,P),p}),p}function bl(o,u,p){for(var v=-1,x=o.length;++v<x;){var P=o[v],A=u(P);if(A!=null&&(D===r?A===A&&!Xr(A):p(A,D)))var D=A,H=P}return H}function Nv(o,u,p,v){var x=o.length;for(p=Ee(p),p<0&&(p=-p>x?0:x+p),v=v===r||v>x?x:Ee(v),v<0&&(v+=x),v=p>v?0:eE(v);p<v;)o[p++]=u;return o}function qp(o,u){var p=[];return Si(o,function(v,x,P){u(v,x,P)&&p.push(v)}),p}function Wt(o,u,p,v,x){var P=-1,A=o.length;for(p||(p=pM),x||(x=[]);++P<A;){var D=o[P];u>0&&p(D)?u>1?Wt(D,u-1,p,v,x):hi(x,D):v||(x[x.length]=D)}return x}var yc=cx(),Ap=cx(!0);function mn(o,u){return o&&yc(o,u,Zt)}function Ln(o,u){return o&&Ap(o,u,Zt)}function Sl(o,u){return pi(u,function(p){return Wi(o[p])})}function Ui(o,u){u=As(u,o);for(var p=0,v=u.length;o!=null&&p<v;)o=o[Hn(u[p++])];return p&&p==v?o:r}function $p(o,u,p){var v=u(o);return Re(o)?v:hi(v,p(o))}function Xt(o){return o==null?o===r?jd:ly:Fi&&Fi in Ue(o)?aM(o):SM(o)}function vc(o,u){return o>u}function Dv(o,u){return o!=null&&Ze.call(o,u)}function Fv(o,u){return o!=null&&u in Ue(o)}function Lv(o,u,p){return o>=Vt(u,p)&&o<yt(u,p)}function Qr(o,u,p){for(var v=p?_s:Qa,x=o[0].length,P=o.length,A=P,D=z(P),H=1/0,Q=[];A--;){var Z=o[A];A&&u&&(Z=ct(Z,br(u))),H=Vt(Z.length,H),D[A]=!p&&(u||x>=120&&Z.length>=120)?new ji(A&&Z):r}Z=o[0];var ee=-1,ie=D[0];e:for(;++ee<x&&Q.length<H;){var ce=Z[ee],ye=u?u(ce):ce;if(ce=p||ce!==0?ce:0,!(ie?tt(ie,ye):v(Q,ye,p))){for(A=P;--A;){var Ie=D[A];if(!(Ie?tt(Ie,ye):v(o[A],ye,p)))continue e}ie&&ie.push(ye),Q.push(ce)}}return Q}function Ps(o,u,p,v){return mn(o,function(x,P,A){u(v,p(x),P,A)}),v}function jo(o,u,p){u=As(u,o),o=Ox(o,u);var v=o==null?o:o[Hn(yn(u))];return v==null?r:yr(v,o,p)}function Mp(o){return Pt(o)&&Xt(o)==mr}function jv(o){return Pt(o)&&Xt(o)==qi}function Uv(o){return Pt(o)&&Xt(o)==Pr}function Uo(o,u,p,v,x){return o===u?!0:o==null||u==null||!Pt(o)&&!Pt(u)?o!==o&&u!==u:bc(o,u,p,v,Uo,x)}function bc(o,u,p,v,x,P){var A=Re(o),D=Re(u),H=A?fi:ar(o),Q=D?fi:ar(u);H=H==mr?Tn:H,Q=Q==mr?Tn:Q;var Z=H==Tn,ee=Q==Tn,ie=H==Q;if(ie&&Ms(o)){if(!Ms(u))return!1;A=!0,Z=!1}if(ie&&!Z)return P||(P=new Yr),A||Cl(o)?Sx(o,u,p,v,x,P):sM(o,u,H,p,v,x,P);if(!(p&S)){var ce=Z&&Ze.call(o,"__wrapped__"),ye=ee&&Ze.call(u,"__wrapped__");if(ce||ye){var Ie=ce?o.value():o,me=ye?u.value():u;return P||(P=new Yr),x(Ie,me,p,v,P)}}return ie?(P||(P=new Yr),oM(o,u,p,v,x,P)):!1}function ks(o){return Pt(o)&&ar(o)==Yt}function Ts(o,u,p,v){var x=p.length,P=x,A=!v;if(o==null)return!P;for(o=Ue(o);x--;){var D=p[x];if(A&&D[2]?D[1]!==o[D[0]]:!(D[0]in o))return!1}for(;++x<P;){D=p[x];var H=D[0],Q=o[H],Z=D[1];if(A&&D[2]){if(Q===r&&!(H in o))return!1}else{var ee=new Yr;if(v)var ie=v(Q,Z,H,o,u,ee);if(!(ie===r?Uo(Z,Q,S|_,v,ee):ie))return!1}}return!0}function Fe(o){if(!Et(o)||mM(o))return!1;var u=Wi(o)?ov:Bd;return u.test(Bo(o))}function c(o){return Pt(o)&&Xt(o)==Kt}function m(o){return Pt(o)&&ar(o)==gr}function b(o){return Pt(o)&&Qp(o.length)&&!!dt[Xt(o)]}function w(o){return typeof o=="function"?o:o==null?Nr:typeof o=="object"?Re(o)?Me(o[0],o[1]):ve(o):dE(o)}function E(o){if(!_c(o))return vp(o);var u=[];for(var p in Ue(o))Ze.call(o,p)&&p!="constructor"&&u.push(p);return u}function M(o){if(!Et(o))return bM(o);var u=_c(o),p=[];for(var v in o)v=="constructor"&&(u||!Ze.call(o,v))||p.push(v);return p}function J(o,u){return o<u}function oe(o,u){var p=-1,v=$r(o)?z(o.length):[];return Si(o,function(x,P,A){v[++p]=u(x,P,A)}),v}function ve(o){var u=rb(o);return u.length==1&&u[0][2]?xx(u[0][0],u[0][1]):function(p){return p===o||Ts(p,o,u)}}function Me(o,u){return ib(o)&&Cx(u)?xx(Hn(o),u):function(p){var v=mb(p,o);return v===r&&v===u?gb(p,o):Uo(u,v,S|_)}}function Lt(o,u,p,v,x){o!==u&&yc(u,function(P,A){if(x||(x=new Yr),Et(P))jn(o,u,A,p,Lt,v,x);else{var D=v?v(ob(o,A),P,A+"",o,u,x):r;D===r&&(D=P),hc(o,A,D)}},Mr)}function jn(o,u,p,v,x,P,A){var D=ob(o,p),H=ob(u,p),Q=A.get(H);if(Q){hc(o,p,Q);return}var Z=P?P(D,H,p+"",o,u,A):r,ee=Z===r;if(ee){var ie=Re(H),ce=!ie&&Ms(H),ye=!ie&&!ce&&Cl(H);Z=H,ie||ce||ye?Re(D)?Z=D:Mt(D)?Z=Ar(D):ce?(ee=!1,Z=ix(H,!0)):ye?(ee=!1,Z=sx(H,!0)):Z=[]:Cc(H)||Vo(H)?(Z=D,Vo(D)?Z=tE(D):(!Et(D)||Wi(D))&&(Z=Rx(H))):ee=!1}ee&&(A.set(H,Z),x(Z,H,v,P,A),A.delete(H)),hc(o,p,Z)}function Un(o,u){var p=o.length;if(p)return u+=u<0?p:0,Vi(u,p)?o[u]:r}function GC(o,u,p){u.length?u=ct(u,function(P){return Re(P)?function(A){return Ui(A,P.length===1?P[0]:P)}:P}):u=[Nr];var v=-1;u=ct(u,br(ge()));var x=oe(o,function(P,A,D){var H=ct(u,function(Q){return Q(P)});return{criteria:H,index:++v,value:P}});return Hy(x,function(P,A){return Q$(P,A,p)})}function L$(o,u){return YC(o,u,function(p,v){return gb(o,v)})}function YC(o,u,p){for(var v=-1,x=u.length,P={};++v<x;){var A=u[v],D=Ui(o,A);p(D,A)&&Sc(P,As(A,o),D)}return P}function j$(o){return function(u){return Ui(u,o)}}function Hv(o,u,p,v){var x=v?Uy:Ni,P=-1,A=u.length,D=o;for(o===u&&(u=Ar(u)),p&&(D=ct(o,br(p)));++P<A;)for(var H=0,Q=u[P],Z=p?p(Q):Q;(H=x(D,Z,H,v))>-1;)D!==o&&ul.call(D,H,1),ul.call(o,H,1);return o}function KC(o,u){for(var p=o?u.length:0,v=p-1;p--;){var x=u[p];if(p==v||x!==P){var P=x;Vi(x)?ul.call(o,x,1):zv(o,x)}}return o}function Bv(o,u){return o+$o(Sp()*(u-o+1))}function U$(o,u,p,v){for(var x=-1,P=yt(Ao((u-o)/(p||1)),0),A=z(P);P--;)A[v?P:++x]=o,o+=p;return A}function Vv(o,u){var p="";if(!o||u<1||u>et)return p;do u%2&&(p+=o),u=$o(u/2),u&&(o+=o);while(u);return p}function Te(o,u){return ab(Ex(o,u,Nr),o+"")}function H$(o){return Ip(xl(o))}function B$(o,u){var p=xl(o);return Wp(p,bi(u,0,p.length))}function Sc(o,u,p,v){if(!Et(o))return o;u=As(u,o);for(var x=-1,P=u.length,A=P-1,D=o;D!=null&&++x<P;){var H=Hn(u[x]),Q=p;if(H==="__proto__"||H==="constructor"||H==="prototype")return o;if(x!=A){var Z=D[H];Q=v?v(Z,H,D):r,Q===r&&(Q=Et(Z)?Z:Vi(u[x+1])?[]:{})}_r(D,H,Q),D=D[H]}return o}var QC=hl?function(o,u){return hl.set(o,u),o}:Nr,V$=cl?function(o,u){return cl(o,"toString",{configurable:!0,enumerable:!1,value:vb(u),writable:!0})}:Nr;function W$(o){return Wp(xl(o))}function gn(o,u,p){var v=-1,x=o.length;u<0&&(u=-u>x?0:x+u),p=p>x?x:p,p<0&&(p+=x),x=u>p?0:p-u>>>0,u>>>=0;for(var P=z(x);++v<x;)P[v]=o[v+u];return P}function z$(o,u){var p;return Si(o,function(v,x,P){return p=u(v,x,P),!p}),!!p}function Np(o,u,p){var v=0,x=o==null?v:o.length;if(typeof u=="number"&&u===u&&x<=It){for(;v<x;){var P=v+x>>>1,A=o[P];A!==null&&!Xr(A)&&(p?A<=u:A<u)?v=P+1:x=P}return x}return Wv(o,u,Nr,p)}function Wv(o,u,p,v){var x=0,P=o==null?0:o.length;if(P===0)return 0;u=p(u);for(var A=u!==u,D=u===null,H=Xr(u),Q=u===r;x<P;){var Z=$o((x+P)/2),ee=p(o[Z]),ie=ee!==r,ce=ee===null,ye=ee===ee,Ie=Xr(ee);if(A)var me=v||ye;else Q?me=ye&&(v||ie):D?me=ye&&ie&&(v||!ce):H?me=ye&&ie&&!ce&&(v||!Ie):ce||Ie?me=!1:me=v?ee<=u:ee<u;me?x=Z+1:P=Z}return Vt(P,bt)}function ZC(o,u){for(var p=-1,v=o.length,x=0,P=[];++p<v;){var A=o[p],D=u?u(A):A;if(!p||!Bn(D,H)){var H=D;P[x++]=A===0?0:A}}return P}function XC(o){return typeof o=="number"?o:Xr(o)?he:+o}function Zr(o){if(typeof o=="string")return o;if(Re(o))return ct(o,Zr)+"";if(Xr(o))return wp?wp.call(o):"";var u=o+"";return u=="0"&&1/o==-pe?"-0":u}function qs(o,u,p){var v=-1,x=Qa,P=o.length,A=!0,D=[],H=D;if(p)A=!1,x=_s;else if(P>=t){var Q=u?null:nM(o);if(Q)return rl(Q);A=!1,x=tt,H=new ji}else H=u?[]:D;e:for(;++v<P;){var Z=o[v],ee=u?u(Z):Z;if(Z=p||Z!==0?Z:0,A&&ee===ee){for(var ie=H.length;ie--;)if(H[ie]===ee)continue e;u&&H.push(ee),D.push(Z)}else x(H,ee,p)||(H!==D&&H.push(ee),D.push(Z))}return D}function zv(o,u){u=As(u,o);var p=-1,v=u.length;if(!v)return!0;for(;++p<v;){var x=Hn(u[p]);if(x==="__proto__"&&!Ze.call(o,"__proto__")||(x==="constructor"||x==="prototype")&&p<v-1)return!1}var P=Ox(o,u);return P==null||delete P[Hn(yn(u))]}function ex(o,u,p,v){return Sc(o,u,p(Ui(o,u)),v)}function Dp(o,u,p,v){for(var x=o.length,P=v?x:-1;(v?P--:++P<x)&&u(o[P],P,o););return p?gn(o,v?0:P,v?P+1:x):gn(o,v?P+1:0,v?x:P)}function tx(o,u){var p=o;return p instanceof $e&&(p=p.value()),ic(u,function(v,x){return x.func.apply(x.thisArg,hi([v],x.args))},p)}function Jv(o,u,p){var v=o.length;if(v<2)return v?qs(o[0]):[];for(var x=-1,P=z(v);++x<v;)for(var A=o[x],D=-1;++D<v;)D!=x&&(P[x]=Lo(P[x]||A,o[D],u,p));return qs(Wt(P,1),u,p)}function rx(o,u,p){for(var v=-1,x=o.length,P=u.length,A={};++v<x;){var D=v<P?u[v]:r;p(A,o[v],D)}return A}function Gv(o){return Mt(o)?o:[]}function Yv(o){return typeof o=="function"?o:Nr}function As(o,u){return Re(o)?o:ib(o,u)?[o]:Tx(nt(o))}var J$=Te;function $s(o,u,p){var v=o.length;return p=p===r?v:p,!u&&p>=v?o:gn(o,u,p)}var nx=av||function(o){return Ft.clearTimeout(o)};function ix(o,u){if(u)return o.slice();var p=o.length,v=mp?mp(p):new o.constructor(p);return o.copy(v),v}function Kv(o){var u=new o.constructor(o.byteLength);return new al(u).set(new al(o)),u}function G$(o,u){var p=u?Kv(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function Y$(o){var u=new o.constructor(o.source,Hd.exec(o));return u.lastIndex=o.lastIndex,u}function K$(o){return Fo?Ue(Fo.call(o)):{}}function sx(o,u){var p=u?Kv(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function ox(o,u){if(o!==u){var p=o!==r,v=o===null,x=o===o,P=Xr(o),A=u!==r,D=u===null,H=u===u,Q=Xr(u);if(!D&&!Q&&!P&&o>u||P&&A&&H&&!D&&!Q||v&&A&&H||!p&&H||!x)return 1;if(!v&&!P&&!Q&&o<u||Q&&p&&x&&!v&&!P||D&&p&&x||!A&&x||!H)return-1}return 0}function Q$(o,u,p){for(var v=-1,x=o.criteria,P=u.criteria,A=x.length,D=p.length;++v<A;){var H=ox(x[v],P[v]);if(H){if(v>=D)return H;var Q=p[v];return H*(Q=="desc"?-1:1)}}return o.index-u.index}function ax(o,u,p,v){for(var x=-1,P=o.length,A=p.length,D=-1,H=u.length,Q=yt(P-A,0),Z=z(H+Q),ee=!v;++D<H;)Z[D]=u[D];for(;++x<A;)(ee||x<P)&&(Z[p[x]]=o[x]);for(;Q--;)Z[D++]=o[x++];return Z}function lx(o,u,p,v){for(var x=-1,P=o.length,A=-1,D=p.length,H=-1,Q=u.length,Z=yt(P-D,0),ee=z(Z+Q),ie=!v;++x<Z;)ee[x]=o[x];for(var ce=x;++H<Q;)ee[ce+H]=u[H];for(;++A<D;)(ie||x<P)&&(ee[ce+p[A]]=o[x++]);return ee}function Ar(o,u){var p=-1,v=o.length;for(u||(u=z(v));++p<v;)u[p]=o[p];return u}function wi(o,u,p,v){var x=!p;p||(p={});for(var P=-1,A=u.length;++P<A;){var D=u[P],H=v?v(p[D],o[D],D,p,o):r;H===r&&(H=o[D]),x?Kr(p,D,H):_r(p,D,H)}return p}function Z$(o,u){return wi(o,nb(o),u)}function X$(o,u){return wi(o,wx(o),u)}function Fp(o,u){return function(p,v){var x=Re(p)?Nn:Pp,P=u?u():{};return x(p,o,ge(v,2),P)}}function wl(o){return Te(function(u,p){var v=-1,x=p.length,P=x>1?p[x-1]:r,A=x>2?p[2]:r;for(P=o.length>3&&typeof P=="function"?(x--,P):r,A&&Rr(p[0],p[1],A)&&(P=x<3?r:P,x=1),u=Ue(u);++v<x;){var D=p[v];D&&o(u,D,v,P)}return u})}function ux(o,u){return function(p,v){if(p==null)return p;if(!$r(p))return o(p,v);for(var x=p.length,P=u?x:-1,A=Ue(p);(u?P--:++P<x)&&v(A[P],P,A)!==!1;);return p}}function cx(o){return function(u,p,v){for(var x=-1,P=Ue(u),A=v(u),D=A.length;D--;){var H=A[o?D:++x];if(p(P[H],H,P)===!1)break}return u}}function eM(o,u,p){var v=u&R,x=wc(o);function P(){var A=this&&this!==Ft&&this instanceof P?x:o;return A.apply(v?p:this,arguments)}return P}function fx(o){return function(u){u=nt(u);var p=Rs(u)?Sr(u):r,v=p?p[0]:u.charAt(0),x=p?$s(p,1).join(""):u.slice(1);return v[o]()+x}}function _l(o){return function(u){return ic(cE(uE(u).replace(Oy,"")),o,"")}}function wc(o){return function(){var u=arguments;switch(u.length){case 0:return new o;case 1:return new o(u[0]);case 2:return new o(u[0],u[1]);case 3:return new o(u[0],u[1],u[2]);case 4:return new o(u[0],u[1],u[2],u[3]);case 5:return new o(u[0],u[1],u[2],u[3],u[4]);case 6:return new o(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new o(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var p=Is(o.prototype),v=o.apply(p,u);return Et(v)?v:p}}function tM(o,u,p){var v=wc(o);function x(){for(var P=arguments.length,A=z(P),D=P,H=Rl(x);D--;)A[D]=arguments[D];var Q=P<3&&A[0]!==H&&A[P-1]!==H?[]:dn(A,H);if(P-=Q.length,P<p)return gx(o,u,Lp,x.placeholder,r,A,Q,r,r,p-P);var Z=this&&this!==Ft&&this instanceof x?v:o;return yr(Z,this,A)}return x}function dx(o){return function(u,p,v){var x=Ue(u);if(!$r(u)){var P=ge(p,3);u=Zt(u),p=function(D){return P(x[D],D,x)}}var A=o(u,p,v);return A>-1?x[P?u[A]:A]:r}}function px(o){return Bi(function(u){var p=u.length,v=p,x=sr.prototype.thru;for(o&&u.reverse();v--;){var P=u[v];if(typeof P!="function")throw new wr(i);if(x&&!A&&Bp(P)=="wrapper")var A=new sr([],!0)}for(v=A?v:p;++v<p;){P=u[v];var D=Bp(P),H=D=="wrapper"?tb(P):r;H&&sb(H[0])&&H[1]==(X|U|V|T)&&!H[4].length&&H[9]==1?A=A[Bp(H[0])].apply(A,H[3]):A=P.length==1&&sb(P)?A[D]():A.thru(P)}return function(){var Q=arguments,Z=Q[0];if(A&&Q.length==1&&Re(Z))return A.plant(Z).value();for(var ee=0,ie=p?u[ee].apply(this,Q):Z;++ee<p;)ie=u[ee].call(this,ie);return ie}})}function Lp(o,u,p,v,x,P,A,D,H,Q){var Z=u&X,ee=u&R,ie=u&I,ce=u&(U|B),ye=u&C,Ie=ie?r:wc(o);function me(){for(var Le=arguments.length,He=z(Le),en=Le;en--;)He[en]=arguments[en];if(ce)var Cr=Rl(me),tn=fp(He,Cr);if(v&&(He=ax(He,v,x,ce)),P&&(He=lx(He,P,A,ce)),Le-=tn,ce&&Le<Q){var Nt=dn(He,Cr);return gx(o,u,Lp,me.placeholder,p,He,Nt,D,H,Q-Le)}var Vn=ee?p:this,Ji=ie?Vn[o]:o;return Le=He.length,D?He=wM(He,D):ye&&Le>1&&He.reverse(),Z&&H<Le&&(He.length=H),this&&this!==Ft&&this instanceof me&&(Ji=Ie||wc(Ji)),Ji.apply(Vn,He)}return me}function hx(o,u){return function(p,v){return Ps(p,o,u(v),{})}}function jp(o,u){return function(p,v){var x;if(p===r&&v===r)return u;if(p!==r&&(x=p),v!==r){if(x===r)return v;typeof p=="string"||typeof v=="string"?(p=Zr(p),v=Zr(v)):(p=XC(p),v=XC(v)),x=o(p,v)}return x}}function Qv(o){return Bi(function(u){return u=ct(u,br(ge())),Te(function(p){var v=this;return o(u,function(x){return yr(x,v,p)})})})}function Up(o,u){u=u===r?" ":Zr(u);var p=u.length;if(p<2)return p?Vv(u,o):u;var v=Vv(u,Ao(o/mi(u)));return Rs(u)?$s(Sr(v),0,o).join(""):v.slice(0,o)}function rM(o,u,p,v){var x=u&R,P=wc(o);function A(){for(var D=-1,H=arguments.length,Q=-1,Z=v.length,ee=z(Z+H),ie=this&&this!==Ft&&this instanceof A?P:o;++Q<Z;)ee[Q]=v[Q];for(;H--;)ee[Q++]=arguments[++D];return yr(ie,x?p:this,ee)}return A}function mx(o){return function(u,p,v){return v&&typeof v!="number"&&Rr(u,p,v)&&(p=v=r),u=zi(u),p===r?(p=u,u=0):p=zi(p),v=v===r?u<p?1:-1:zi(v),U$(u,p,v,o)}}function Hp(o){return function(u,p){return typeof u=="string"&&typeof p=="string"||(u=vn(u),p=vn(p)),o(u,p)}}function gx(o,u,p,v,x,P,A,D,H,Q){var Z=u&U,ee=Z?A:r,ie=Z?r:A,ce=Z?P:r,ye=Z?r:P;u|=Z?V:W,u&=~(Z?W:V),u&q||(u&=~(R|I));var Ie=[o,u,x,ce,ee,ye,ie,D,H,Q],me=p.apply(r,Ie);return sb(o)&&Ix(me,Ie),me.placeholder=v,Px(me,o,u)}function Zv(o){var u=rt[o];return function(p,v){if(p=vn(p),v=v==null?0:Vt(Ee(v),292),v&&Li(p)){var x=(nt(p)+"e").split("e"),P=u(x[0]+"e"+(+x[1]+v));return x=(nt(P)+"e").split("e"),+(x[0]+"e"+(+x[1]-v))}return u(p)}}var nM=Es&&1/rl(new Es([,-0]))[1]==pe?function(o){return new Es(o)}:wb;function yx(o){return function(u){var p=ar(u);return p==Yt?Cs(u):p==gr?dp(u):By(u,o(u))}}function Hi(o,u,p,v,x,P,A,D){var H=u&I;if(!H&&typeof o!="function")throw new wr(i);var Q=v?v.length:0;if(Q||(u&=~(V|W),v=x=r),A=A===r?A:yt(Ee(A),0),D=D===r?D:Ee(D),Q-=x?x.length:0,u&W){var Z=v,ee=x;v=x=r}var ie=H?r:tb(o),ce=[o,u,p,v,x,Z,ee,P,A,D];if(ie&&vM(ce,ie),o=ce[0],u=ce[1],p=ce[2],v=ce[3],x=ce[4],D=ce[9]=ce[9]===r?H?0:o.length:yt(ce[9]-Q,0),!D&&u&(U|B)&&(u&=~(U|B)),!u||u==R)var ye=eM(o,u,p);else u==U||u==B?ye=tM(o,u,D):(u==V||u==(R|V))&&!x.length?ye=rM(o,u,p,v):ye=Lp.apply(r,ce);var Ie=ie?QC:Ix;return Px(Ie(ye,ce),o,u)}function vx(o,u,p,v){return o===r||Bn(o,xs[p])&&!Ze.call(v,p)?u:o}function bx(o,u,p,v,x,P){return Et(o)&&Et(u)&&(P.set(u,o),Lt(o,u,r,bx,P),P.delete(u)),o}function iM(o){return Cc(o)?r:o}function Sx(o,u,p,v,x,P){var A=p&S,D=o.length,H=u.length;if(D!=H&&!(A&&H>D))return!1;var Q=P.get(o),Z=P.get(u);if(Q&&Z)return Q==u&&Z==o;var ee=-1,ie=!0,ce=p&_?new ji:r;for(P.set(o,u),P.set(u,o);++ee<D;){var ye=o[ee],Ie=u[ee];if(v)var me=A?v(Ie,ye,ee,u,o,P):v(ye,Ie,ee,o,u,P);if(me!==r){if(me)continue;ie=!1;break}if(ce){if(!Za(u,function(Le,He){if(!tt(ce,He)&&(ye===Le||x(ye,Le,p,v,P)))return ce.push(He)})){ie=!1;break}}else if(!(ye===Ie||x(ye,Ie,p,v,P))){ie=!1;break}}return P.delete(o),P.delete(u),ie}function sM(o,u,p,v,x,P,A){switch(p){case qn:if(o.byteLength!=u.byteLength||o.byteOffset!=u.byteOffset)return!1;o=o.buffer,u=u.buffer;case qi:return!(o.byteLength!=u.byteLength||!P(new al(o),new al(u)));case Gr:case Pr:case mo:return Bn(+o,+u);case gt:return o.name==u.name&&o.message==u.message;case Kt:case go:return o==u+"";case Yt:var D=Cs;case gr:var H=v&S;if(D||(D=rl),o.size!=u.size&&!H)return!1;var Q=A.get(o);if(Q)return Q==u;v|=_,A.set(o,u);var Z=Sx(D(o),D(u),v,x,P,A);return A.delete(o),Z;case Da:if(Fo)return Fo.call(o)==Fo.call(u)}return!1}function oM(o,u,p,v,x,P){var A=p&S,D=Xv(o),H=D.length,Q=Xv(u),Z=Q.length;if(H!=Z&&!A)return!1;for(var ee=H;ee--;){var ie=D[ee];if(!(A?ie in u:Ze.call(u,ie)))return!1}var ce=P.get(o),ye=P.get(u);if(ce&&ye)return ce==u&&ye==o;var Ie=!0;P.set(o,u),P.set(u,o);for(var me=A;++ee<H;){ie=D[ee];var Le=o[ie],He=u[ie];if(v)var en=A?v(He,Le,ie,u,o,P):v(Le,He,ie,o,u,P);if(!(en===r?Le===He||x(Le,He,p,v,P):en)){Ie=!1;break}me||(me=ie=="constructor")}if(Ie&&!me){var Cr=o.constructor,tn=u.constructor;Cr!=tn&&"constructor"in o&&"constructor"in u&&!(typeof Cr=="function"&&Cr instanceof Cr&&typeof tn=="function"&&tn instanceof tn)&&(Ie=!1)}return P.delete(o),P.delete(u),Ie}function Bi(o){return ab(Ex(o,r,Mx),o+"")}function Xv(o){return $p(o,Zt,nb)}function eb(o){return $p(o,Mr,wx)}var tb=hl?function(o){return hl.get(o)}:wb;function Bp(o){for(var u=o.name+"",p=Os[u],v=Ze.call(Os,u)?p.length:0;v--;){var x=p[v],P=x.func;if(P==null||P==o)return x.name}return u}function Rl(o){var u=Ze.call(O,"placeholder")?O:o;return u.placeholder}function ge(){var o=O.iteratee||bb;return o=o===bb?w:o,arguments.length?o(arguments[0],arguments[1]):o}function Vp(o,u){var p=o.__data__;return hM(u)?p[typeof u=="string"?"string":"hash"]:p.map}function rb(o){for(var u=Zt(o),p=u.length;p--;){var v=u[p],x=o[v];u[p]=[v,x,Cx(x)]}return u}function Ho(o,u){var p=Oo(o,u);return Fe(p)?p:r}function aM(o){var u=Ze.call(o,Fi),p=o[Fi];try{o[Fi]=r;var v=!0}catch{}var x=sl.call(o);return v&&(u?o[Fi]=p:delete o[Fi]),x}var nb=fl?function(o){return o==null?[]:(o=Ue(o),pi(fl(o),function(u){return To.call(o,u)}))}:_b,wx=fl?function(o){for(var u=[];o;)hi(u,nb(o)),o=ll(o);return u}:_b,ar=Xt;(cc&&ar(new cc(new ArrayBuffer(1)))!=qn||Mo&&ar(new Mo)!=Yt||fc&&ar(fc.resolve())!=Fd||Es&&ar(new Es)!=gr||No&&ar(new No)!=Bt)&&(ar=function(o){var u=Xt(o),p=u==Tn?o.constructor:r,v=p?Bo(p):"";if(v)switch(v){case dv:return qn;case pv:return Yt;case hv:return Fd;case mv:return gr;case gv:return Bt}return u});function lM(o,u,p){for(var v=-1,x=p.length;++v<x;){var P=p[v],A=P.size;switch(P.type){case"drop":o+=A;break;case"dropRight":u-=A;break;case"take":u=Vt(u,o+A);break;case"takeRight":o=yt(o,u-A);break}}return{start:o,end:u}}function uM(o){var u=o.match(An);return u?u[1].split(cn):[]}function _x(o,u,p){u=As(u,o);for(var v=-1,x=u.length,P=!1;++v<x;){var A=Hn(u[v]);if(!(P=o!=null&&p(o,A)))break;o=o[A]}return P||++v!=x?P:(x=o==null?0:o.length,!!x&&Qp(x)&&Vi(A,x)&&(Re(o)||Vo(o)))}function cM(o){var u=o.length,p=new o.constructor(u);return u&&typeof o[0]=="string"&&Ze.call(o,"index")&&(p.index=o.index,p.input=o.input),p}function Rx(o){return typeof o.constructor=="function"&&!_c(o)?Is(ll(o)):{}}function fM(o,u,p){var v=o.constructor;switch(u){case qi:return Kv(o);case Gr:case Pr:return new v(+o);case qn:return G$(o,p);case at:case Fa:case La:case ms:case yo:case gs:case di:case ys:case Bu:return sx(o,p);case Yt:return new v;case mo:case go:return new v(o);case Kt:return Y$(o);case gr:return new v;case Da:return K$(o)}}function dM(o,u){var p=u.length;if(!p)return o;var v=p-1;return u[v]=(p>1?"& ":"")+u[v],u=u.join(p>2?", ":" "),o.replace(Qt,`{
|
|
1
|
+
var $L=Object.create;var Zp=Object.defineProperty;var ML=Object.getOwnPropertyDescriptor;var NL=Object.getOwnPropertyNames;var DL=Object.getPrototypeOf,FL=Object.prototype.hasOwnProperty;var it=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var se=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(n){throw t=[n],n}};var F=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},Ns=(r,e)=>{for(var t in e)Zp(r,t,{get:e[t],enumerable:!0})},hE=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of NL(e))!FL.call(r,i)&&i!==t&&Zp(r,i,{get:()=>e[i],enumerable:!(n=ML(e,i))||n.enumerable});return r};var Cb=(r,e,t)=>(t=r!=null?$L(DL(r)):{},hE(e||!r||!r.__esModule?Zp(t,"default",{value:r,enumerable:!0}):t,r)),El=r=>hE(Zp({},"__esModule",{value:!0}),r);function kt(r){return r.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function pt(r){let e=Date.now().toString(36)+(LL++).toString(36)+Math.random().toString(36).slice(2,7);return r?`${kt(r)}_${e}`:e}function xb(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}function Cc(r,e){let t={},n={};for(let[i,s]of Object.entries(r)){let a=i.toLowerCase();n[a]=i,t[i]=s}for(let[i,s]of Object.entries(e)){let a=i.toLowerCase(),l=n[a];l&&delete t[l],n[a]=i,t[i]=s}return t}function jL(r){return JSON.parse(JSON.stringify(r))}function UL(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function HL(r,e){try{return JSON.parse(r)}catch{return e}}function BL(r){if(r===0)return"0 B";let e=1024,t=["B","KB","MB","GB"],n=Math.floor(Math.log(r)/Math.log(e));return`${parseFloat((r/Math.pow(e,n)).toFixed(1))} ${t[n]}`}function VL(r){return r<1e3?`${r} ms`:`${(r/1e3).toFixed(2)} s`}var LL,bn=se(()=>{"use strict";LL=0});import*as Xe from"fs";import*as rn from"path";function eh(r){if(!Xe.existsSync(r))return;let e={},t=rn.join(r,Xp.preRequest);Xe.existsSync(t)&&(e.preRequest=Xe.readFileSync(t,"utf-8"));let n=rn.join(r,Xp.postResponse);return Xe.existsSync(n)&&(e.postResponse=Xe.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function th(r,e){await Xe.promises.mkdir(r,{recursive:!0});let t=rn.join(r,Xp.preRequest);e.preRequest?await Xe.promises.writeFile(t,e.preRequest,"utf-8"):Xe.existsSync(t)&&await Xe.promises.unlink(t);let n=rn.join(r,Xp.postResponse);e.postResponse?await Xe.promises.writeFile(n,e.postResponse,"utf-8"):Xe.existsSync(n)&&await Xe.promises.unlink(n)}function gE(r){for(let[e,t]of Object.entries(mE)){let n=rn.join(r,e);if(Xe.existsSync(n))try{let i=Xe.readFileSync(n,"utf-8"),s;if(t.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:t.type,format:t.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function yE(r){if(!r||r.type==="none")return{bodyForMetadata:r};if(r.type==="raw"){let e=r.format||"json",n={json:"body.json",xml:"body.xml",text:"body.txt",html:"body.html",javascript:"body.js"}[e];if(n){let i=e==="json"?typeof r.content=="string"?r.content:JSON.stringify(r.content,null,2):String(r.content||"");return{bodyForMetadata:{type:r.type,format:r.format},externalBodyFile:{filename:n,content:i}}}}if(r.type==="graphql"){let e=typeof r.content=="string"?r.content:JSON.stringify(r.content,null,2);return{bodyForMetadata:{type:r.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:r}}async function vE(r,e){for(let t of Object.keys(mE))if(t!==e){let n=rn.join(r,t);if(Xe.existsSync(n))try{await Xe.promises.unlink(n)}catch{}}}function bE(r){if(Xe.existsSync(r))try{let e=Xe.readFileSync(r,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${r}:`,e);return}}async function SE(r,e,t){let n=rn.join(r,xc.responseSchema),i=rn.join(r,xc.bodySchema);e?await Xe.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):Xe.existsSync(n)&&await Xe.promises.unlink(n),t?await Xe.promises.writeFile(i,JSON.stringify(t,null,2),"utf-8"):Xe.existsSync(i)&&await Xe.promises.unlink(i)}function Eb(r,e){for(let t of r){if(t.id===e)return t;if(t.type==="folder"&&t.items){let n=Eb(t.items,e);if(n)return n}}}function Ob(r,e){for(let t=0;t<r.length;t++){let n=r[t];if(n.id===e)return r.splice(t,1),!0;if(n.type==="folder"&&n.items&&Ob(n.items,e))return!0}return!1}function wE(r,e){let t=new Map(r.map(i=>[i.id,i])),n=[];for(let i of e){let s=t.get(i);s&&(n.push(s),t.delete(i))}for(let i of t.values())n.push(i);return n}function Ib(r,e){let t;try{t=Xe.readdirSync(r,{withFileTypes:!0})}catch{return}for(let n of t){if(!n.isDirectory()||n.name===nn)continue;if(n.name===e)return rn.join(r,n.name);let i=Ib(rn.join(r,n.name),e);if(i)return i}}function WL(r){for(let e of[xr.request,xr.folder]){let t=rn.join(r,e);if(Xe.existsSync(t))try{let n=Xe.readFileSync(t,"utf-8");return JSON.parse(n).id}catch{return}}}function Pb(r,e){let t;try{t=Xe.readdirSync(r,{withFileTypes:!0})}catch{return}for(let n of t){if(!n.isDirectory()||n.name===nn)continue;let i=rn.join(r,n.name);if(WL(i)===e)return i;let s=Pb(i,e);if(s)return s}}function Sn(r,e=[]){let t=r.toLowerCase().trim(),n=t.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=t.match(/t(\d+)/gi)||[],a=0;for(let y of s){let S=parseInt(y.substring(1));S>a&&(a=S)}let l="";if(a>0)l=`t${a}`;else{let y=t.match(/[_\s-](\d+\.\d+)[_\s-]/);y&&(l=`v${y[1].replace(".","_")}`)}let f=t;n&&(f=f.substring(n[0].length)),f=f.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),f=f.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),f=f.replace(/\([^)]+\)/g,""),f=f.replace(/:[a-z_][a-z0-9_]*/gi,""),f=f.replace(/\{[^}]+\}/g,""),f=f.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let d=f.split("-").filter(y=>y.length>0),h=[];i&&h.push(i),h.push(...d),l&&h.push(l);let g=h.join("-");if(g||(g="item"),e.includes(g)){let y=2;for(;e.includes(`${g}-${y}`);)y++;g=`${g}-${y}`}return g}var Xp,xr,mE,xc,nn,Wo=se(()=>{"use strict";Xp={preRequest:"pre-request.js",postResponse:"post-response.js"},xr={collection:"collection.json",folder:"folder.json",request:"request.json"},mE={"body.json":{type:"raw",format:"json"},"body.xml":{type:"raw",format:"xml"},"body.txt":{type:"raw",format:"text"},"body.html":{type:"raw",format:"html"},"body.js":{type:"raw",format:"javascript"},"body.graphql":{type:"graphql"}},xc={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},nn="scripts"});import*as Ce from"fs";import*as Pe from"path";var Ds,rh=se(()=>{"use strict";bn();Wo();Ds=class{collectionsDir;cache=new Map;slugToIdMap=new Map;idToSlugMap=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}getSlugById(e){return this.idToSlugMap.get(e)}getIdBySlug(e){return this.slugToIdMap.get(e)}ensureDirectory(){Ce.existsSync(this.collectionsDir)||Ce.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,t){let n;try{n=Ce.readFileSync(e,"utf-8")}catch(i){console.error(`[FolderCollectionStore] Failed to read ${t} ${e}:`,i);return}if(n.trim().length!==0)try{return JSON.parse(n)}catch(i){if(i instanceof SyntaxError&&/Unexpected end of JSON input/.test(i.message))return;console.error(`[FolderCollectionStore] Failed to parse ${t} ${e}:`,i);return}}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Ce.existsSync(this.collectionsDir))return[];let e=Ce.readdirSync(this.collectionsDir,{withFileTypes:!0}),t=[];for(let n of e)if(n.isDirectory())try{let i=this.loadCollectionFromFolder(n.name);i&&(this.cache.set(i.id,i),this.slugToIdMap.set(n.name,i.id),this.idToSlugMap.set(i.id,n.name),t.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return t}loadCollectionFromFolder(e){let t=Pe.join(this.collectionsDir,e),n=Pe.join(t,xr.collection);if(!Ce.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(Pe.join(t,nn)),a=this.loadItemsFromDir(t,i.id,i.order);return{id:i.id,name:i.name,description:i.description,version:i.version,variables:i.variables,auth:i.auth,scripts:s,items:a}}catch(s){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,s);return}}loadItemsFromDir(e,t,n){let i=[],s=new Map,a=Ce.readdirSync(e,{withFileTypes:!0});for(let l of a){if(!l.isDirectory()||l.name===nn)continue;let f=Pe.join(e,l.name);if(Ce.existsSync(Pe.join(f,xr.folder))){let d=this.loadFolderFromDir(f,l.name);d&&s.set(l.name,d)}else if(Ce.existsSync(Pe.join(f,xr.request))){let d=this.loadRequestFromDir(f,l.name);d&&s.set(l.name,d)}}if(n&&n.length>0){for(let l of n){let f=s.get(l);f&&(i.push(f),s.delete(l))}for(let l of s.values())i.push(l)}else for(let l of s.values())i.push(l);return i}loadFolderFromDir(e,t){let n=Pe.join(e,xr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(Pe.join(e,nn)),a=this.loadItemsFromDir(e,i.id,i.order);return this.slugToIdMap.set(t,i.id),this.idToSlugMap.set(i.id,t),{id:i.id,type:"folder",name:i.name,description:i.description,auth:i.auth,scripts:s,items:a}}catch(s){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,s);return}}loadRequestFromDir(e,t){let n=Pe.join(e,xr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(Pe.join(e,nn)),a=i.body,l=this.loadBodyFromDir(e);l&&(a=l);let f=this.loadSchemaFile(Pe.join(e,xc.responseSchema)),d=this.loadSchemaFile(Pe.join(e,xc.bodySchema)),h=Pe.join(e,"doc.md"),g=Ce.existsSync(h)?Ce.readFileSync(h,"utf-8"):void 0;return this.slugToIdMap.set(t,i.id),this.idToSlugMap.set(i.id,t),{id:i.id,type:"request",name:i.name,description:i.description,method:i.method,url:i.url,params:i.params,query:i.query,headers:i.headers,body:a,auth:i.auth,settings:i.settings,scripts:s,deprecated:i.deprecated,...g&&{doc:g},...f&&{responseSchema:f},...d&&{bodySchema:d}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return eh(e)}loadBodyFromDir(e){return gE(e)}loadSchemaFile(e){return bE(e)}async saveSchemaFiles(e,t){return SE(e,t.responseSchema,t.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let t=this.idToSlugMap.get(e);if(t){let n=this.loadCollectionFromFolder(t);return n&&this.cache.set(e,n),n}return this.loadAll(),this.cache.get(e)}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=pt(e.name));let t=this.idToSlugMap.get(e.id);if(!t){let l=Ce.readdirSync(this.collectionsDir);t=Sn(e.name,l),this.idToSlugMap.set(e.id,t),this.slugToIdMap.set(t,e.id)}let n=Pe.join(this.collectionsDir,t),i=!Ce.existsSync(n);await Ce.promises.mkdir(n,{recursive:!0});let s={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth},[a]=await Promise.all([this.saveItemsToDir(n,e.items,i),e.scripts?this.saveScriptsToDir(Pe.join(n,nn),e.scripts):Promise.resolve()]);a.length>0&&(s.order=a),await Ce.promises.writeFile(Pe.join(n,xr.collection),JSON.stringify(s,null,2),"utf-8"),this.cache.set(e.id,e)}async saveItemsToDir(e,t,n=!1){let i=[],s=[];for(let a of t){let l=this.idToSlugMap.get(a.id);l||(l=Sn(a.name,i),this.idToSlugMap.set(a.id,l),this.slugToIdMap.set(l,a.id)),i.push(l),s.push({item:a,slug:l})}return await Promise.all(s.map(async({item:a,slug:l})=>{let f=Pe.join(e,l);await Ce.promises.mkdir(f,{recursive:!0}),a.type==="folder"?await this.saveFolderToDir(f,a,n):await this.saveRequestToDir(f,a,n)})),i}async saveFolderToDir(e,t,n=!1){let i={id:t.id,name:t.name,description:t.description,auth:t.auth},[s]=await Promise.all([t.items?this.saveItemsToDir(e,t.items,n):Promise.resolve([]),t.scripts?this.saveScriptsToDir(Pe.join(e,nn),t.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await Ce.promises.writeFile(Pe.join(e,xr.folder),JSON.stringify(i,null,2),"utf-8")}async saveRequestToDir(e,t,n=!1){let{bodyForMetadata:i,externalBodyFile:s}=this.prepareBodyForSave(t.body),a={id:t.id,name:t.name,method:t.method||"GET",url:t.url||"",description:t.description,params:t.params,query:t.query,headers:t.headers,body:i,auth:t.auth,settings:t.settings,...t.deprecated&&{deprecated:t.deprecated}},l=[Ce.promises.writeFile(Pe.join(e,xr.request),JSON.stringify(a,null,2),"utf-8")];s&&l.push(Ce.promises.writeFile(Pe.join(e,s.filename),s.content,"utf-8")),n||l.push(this.cleanupOldBodyFiles(e,s?.filename)),(!n||t.responseSchema||t.bodySchema)&&l.push(this.saveSchemaFiles(e,t)),t.doc&&l.push(Ce.promises.writeFile(Pe.join(e,"doc.md"),t.doc,"utf-8")),t.scripts&&l.push(this.saveScriptsToDir(Pe.join(e,nn),t.scripts)),await Promise.all(l)}prepareBodyForSave(e){return yE(e)}async cleanupOldBodyFiles(e,t){return vE(e,t)}async saveScriptsToDir(e,t){return th(e,t)}async delete(e){let t=this.idToSlugMap.get(e);if(!t&&(this.loadAll(),t=this.idToSlugMap.get(e),!t))return!1;let n=Pe.join(this.collectionsDir,t);if(!Ce.existsSync(n))return!1;try{return await Ce.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(t),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let t=this.idToSlugMap.get(e);return t?Ce.existsSync(Pe.join(this.collectionsDir,t,xr.collection)):!1}getCollectionPath(e){let t=this.idToSlugMap.get(e)||e;return Pe.join(this.collectionsDir,t)}getItemPath(e,t){return this.findItemPath(e,t)}async create(e,t){let n={id:t||pt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,t,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,t);if(!s)throw new Error(`Item ${t} not found in collection ${e}`);await this.saveScriptsToDir(Pe.join(s,nn),n);let a=this.findItemById(i.items,t);a&&(a.scripts=n)}loadScripts(e,t){let n=this.findItemPath(e,t);if(n)return this.loadScriptsFromDir(Pe.join(n,nn))}async updateCollectionMetadata(e,t){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);let i=this.idToSlugMap.get(e);if(!i)throw new Error(`Collection slug not found for ${e}`);let s=Pe.join(this.collectionsDir,i),a=Pe.join(s,xr.collection),l=Ce.readFileSync(a,"utf-8"),d={...JSON.parse(l),...t,id:e};await Ce.promises.writeFile(a,JSON.stringify(d,null,2),"utf-8"),t.name!==void 0&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.version!==void 0&&(n.version=t.version),t.variables!==void 0&&(n.variables=t.variables),t.auth!==void 0&&(n.auth=t.auth)}async saveItem(e,t,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let a;if(n){let h=this.findItemPath(e,n);if(!h)throw new Error(`Parent folder ${n} not found`);a=h}else a=Pe.join(this.collectionsDir,s);let l=this.idToSlugMap.get(t.id);if(!l){let h=Ce.readdirSync(a).filter(g=>Ce.statSync(Pe.join(a,g)).isDirectory()&&g!==nn);l=Sn(t.name,h),this.idToSlugMap.set(t.id,l),this.slugToIdMap.set(l,t.id)}let f=Pe.join(a,l);await Ce.promises.mkdir(f,{recursive:!0}),t.type==="folder"?await this.saveFolderToDir(f,t):await this.saveRequestToDir(f,t);let d=this.findItemById(i.items,t.id);if(d)Object.assign(d,t);else if(n){let h=this.findItemById(i.items,n);h&&h.type==="folder"&&(h.items=h.items||[],h.items.push(t))}else i.items.push(t)}async deleteItem(e,t){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,t);if(!i||!Ce.existsSync(i))return!1;try{await Ce.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,t);let s=this.idToSlugMap.get(t);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(t)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${t}:`,s),!1}}async updateItem(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,t);if(!s)return!1;let a=this.findItemById(i.items,t);if(!a)return!1;let{id:l,type:f,items:d,...h}=n;return Object.assign(a,h),a.type==="folder"?await this.saveFolderToDir(s,a):await this.saveRequestToDir(s,a),!0}async moveItem(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=this.findItemPath(e,t);if(!a||!Ce.existsSync(a))return!1;let l;if(n){let h=this.findItemPath(e,n);if(!h)return!1;l=h}else l=Pe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(t);if(!f)return!1;let d=Pe.join(l,f);if(Ce.existsSync(d))return!1;try{await Ce.promises.rename(a,d);let h=this.findItemById(i.items,t);if(h){let g=h.type==="folder"?{...h,items:h.items?[...h.items]:[]}:{...h};if(this.deleteItemFromTree(i.items,t),n){let y=this.findItemById(i.items,n);y&&y.type==="folder"&&(y.items=y.items||[],y.items.push(g))}else i.items.push(g)}return!0}catch(h){return console.error(`[FolderCollectionStore] Failed to move item ${t}:`,h),!1}}async reorderItems(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=[];for(let l of n){let f=this.idToSlugMap.get(l);f&&a.push(f)}try{if(t){let l=this.findItemPath(e,t);if(!l)return!1;let f=Pe.join(l,xr.folder),d=Ce.readFileSync(f,"utf-8"),h=JSON.parse(d);h.order=a,await Ce.promises.writeFile(f,JSON.stringify(h,null,2),"utf-8");let g=this.findItemById(i.items,t);g&&g.type==="folder"&&g.items&&(g.items=this.sortItemsByOrder(g.items,n))}else{let l=Pe.join(this.collectionsDir,s,xr.collection),f=Ce.readFileSync(l,"utf-8"),d=JSON.parse(f);d.order=a,await Ce.promises.writeFile(l,JSON.stringify(d,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(l){return console.error("[FolderCollectionStore] Failed to reorder items:",l),!1}}sortItemsByOrder(e,t){return wE(e,t)}findItemPath(e,t){let n=this.idToSlugMap.get(e);if(!n)return;let i=Pe.join(this.collectionsDir,n),s=Pb(i,t);if(s)return s;let a=this.load(e);if(a){let f=this.buildSlugPath(a.items,t);if(f)return Pe.join(i,...f)}let l=this.idToSlugMap.get(t);if(l)return Ib(i,l)}buildSlugPath(e,t){for(let n of e){let i=this.idToSlugMap.get(n.id);if(i){if(n.id===t)return[i];if(n.type==="folder"&&n.items){let s=this.buildSlugPath(n.items,t);if(s)return[i,...s]}}}}findItemById(e,t){return Eb(e,t)}deleteItemFromTree(e,t){return Ob(e,t)}}});var lt,zo=se(()=>{"use strict";lt=class{static parseSetCookie(e,t){let n=e.split(";").map(h=>h.trim());if(n.length===0)return null;let[i,...s]=n,a=i.indexOf("=");if(a===-1)return null;let l=i.substring(0,a).trim(),f=i.substring(a+1).trim(),d={name:l,value:f,domain:t};for(let h of s){let g=h.indexOf("="),y=(g===-1?h:h.substring(0,g)).toLowerCase(),S=g===-1?"":h.substring(g+1);switch(y){case"domain":d.domain=S.startsWith(".")?S.substring(1):S;break;case"path":d.path=S;break;case"expires":d.expires=S;break;case"max-age":d.maxAge=parseInt(S,10);break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break;case"samesite":d.sameSite=S;break}}return d}static parseCookieHeaders(e,t){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let a of s){let l=this.parseSetCookie(a,t);l&&n.push(l)}return n}static formatCookieHeader(e){return e.map(t=>`${t.name}=${t.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,t){if(t==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=t.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}}});import*as Fs from"fs";import*as Jo from"path";function ih(r){let e=r.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function Pc(r){if(!Fs.existsSync(r))return JL();let e=nh(Jo.join(r,"_global.json"))||{},t=e.variables||{},n=e.defaultHeaders||{},i=Fs.readdirSync(r).filter(d=>d.endsWith(".json")).filter(d=>!d.endsWith(".local.json")).filter(d=>!ih(d)),s={};for(let d of i){let h=nh(Jo.join(r,d))||{},g=Jo.basename(d,".json");s[g]={description:h.description,requiresConfirmation:h.requiresConfirmation,variables:h.variables||{},secretVariables:h.secretVariables}}let l=(nh(Jo.join(r,"_global.local.json"))||{}).variables||{},f={};for(let d of Object.keys(s)){let h=Jo.join(r,`${d}.local.json`);if(Fs.existsSync(h)){let g=nh(h)||{};f[d]={variables:g.variables||{}}}}return{globalVariables:t,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function JL(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function nh(r){try{if(!Fs.existsSync(r))return null;let e=Fs.readFileSync(r,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${r}:`,e),null}}var sh=se(()=>{"use strict"});var Vn,Il=se(()=>{"use strict";Vn=class{buildUrl(e,t={},n={}){let i=e;return i=this.replacePathParams(i,t),i=this.appendQueryParams(i,n),i}replacePathParams(e,t){let n="",i="",s=e,a="",l=e.indexOf("?");l!==-1&&(a=e.substring(l),s=e.substring(0,l));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let d=/:(\w+)(?:\([^)]*\))?(\?)?/g,h=s.replace(d,(g,y,S)=>{let _=t[y];return _!==void 0&&_!==""?encodeURIComponent(_):S?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${y}`),g)});return h=h.replace(/([^:])\/+/g,"$1/"),h.length>1&&h.endsWith("/")&&(h=h.slice(0,-1)),`${n}${i}${h}${a}`}extractPathParams(e){let t=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=t.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,t){let n=e,i={};if(e.includes("?")){let[f,d]=e.split("?");n=f,d&&new URLSearchParams(d).forEach((g,y)=>{i[y]=g})}let s={...i,...t},a=new URLSearchParams;for(let[f,d]of Object.entries(s))d!=null&&a.append(f,d);let l=a.toString();return l?`${n}?${l}`:n}}});function RE(r,e=0){return(er[r[e+0]]+er[r[e+1]]+er[r[e+2]]+er[r[e+3]]+"-"+er[r[e+4]]+er[r[e+5]]+"-"+er[r[e+6]]+er[r[e+7]]+"-"+er[r[e+8]]+er[r[e+9]]+"-"+er[r[e+10]]+er[r[e+11]]+er[r[e+12]]+er[r[e+13]]+er[r[e+14]]+er[r[e+15]]).toLowerCase()}var er,CE=se(()=>{er=[];for(let r=0;r<256;++r)er.push((r+256).toString(16).slice(1))});function qb(){return crypto.getRandomValues(GL)}var GL,xE=se(()=>{GL=new Uint8Array(16)});function YL(r,e,t){return!e&&!r&&crypto.randomUUID?crypto.randomUUID():KL(r,e,t)}function KL(r,e,t){r=r||{};let n=r.random??r.rng?.()??qb();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[t+i]=n[i];return e}return RE(n)}var Pl,EE=se(()=>{xE();CE();Pl=YL});var Ab=se(()=>{EE()});function QL(r=0,e=999){return Math.floor(Math.random()*(e-r+1))+r}function ZL(){return Date.now()}function OE(){return Pl()}function XL(){return Pl()}function IE(r=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="";for(let n=0;n<r;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function ej(){let r=IE(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${r}@${e[Math.floor(Math.random()*e.length)]}`}function tj(){return Math.random()<.5}function rj(r=10){let e="0123456789abcdef",t="";for(let n=0;n<r;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function nj(){return Math.floor(Date.now()/1e3)}function ij(){return new Date().toISOString()}function sj(){return new Date().toISOString().split("T")[0]}function oj(){return new Date().toISOString().split("T")[1].split(".")[0]}function aj(){return new Date().toISOString()}function lj(r=""){return Buffer.from(String(r)).toString("base64")}function uj(r=""){return Buffer.from(String(r),"base64").toString("utf-8")}function cj(r=""){return encodeURIComponent(String(r))}function fj(r=""){return decodeURIComponent(String(r))}function dj(r){return r?r.split(",").map(e=>{let t=e.trim(),n=Number(t);return!isNaN(n)&&t!==""?n:t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t}):[]}function Yi(r,e){let t=PE[r];return t?e&&e.length>0?t(...e):t():null}function pj(r){return!r||typeof r!="string"?r:r.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,t,n)=>{try{let i=n?dj(n):void 0,s=Yi(t,i);return s===null?e:String(s)}catch{return e}})}function Go(r,e){let t=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=t.exec(r))!==null;){let s=i[0],a=i[1];if(!(s in e)){let l=Yi(a);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var PE,oh=se(()=>{"use strict";Ab();PE={randomInt:QL,timestamp:ZL,guid:XL,uuid:OE,randomUUID:OE,randomString:IE,randomHexadecimal:rj,randomEmail:ej,randomBoolean:tj,isoTimestamp:aj,timestamp_s:nj,datetime:ij,date:sj,time:oj,base64Encode:lj,base64Decode:uj,urlEncode:cj,urlDecode:fj}});import*as ah from"vm";function Yo(r){let e=r.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function Ko(r,e={}){try{let t={...e,Math,Date,JSON,Number,String,Boolean,Array,Object,parseInt,parseFloat,isNaN,isFinite,encodeURIComponent,decodeURIComponent,encodeURI,decodeURI,undefined:void 0,null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},n=ah.createContext(t);return ah.runInContext(r,n,{timeout:hj,displayErrors:!1})}catch{return}}var hj,lh=se(()=>{"use strict";hj=100});import*as uh from"crypto";function mj(r){if(typeof r=="string"&&r.charCodeAt(0)===30)try{return JSON.parse(r.slice(1))}catch{return r}return r}function Tc(r){if(!r||!r.includes("|"))return null;let e=gj(r);if(e.length<2)return null;let t=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let a=yj(s);a&&n.push(a)}return n.length===0?null:{input:t,filters:n}}function gj(r){let e=[],t="",n=0,i=!1,s=!1;for(let a=0;a<r.length;a++){let l=r[a],f=a>0?r[a-1]:"",d=a<r.length-1?r[a+1]:"";if(f==="\\"){t+=l;continue}if(l==="'"&&!s)i=!i;else if(l==='"'&&!i)s=!s;else if(l==="("&&!i&&!s)n++;else if(l===")"&&!i&&!s)n--;else if(l==="|"&&n===0&&!i&&!s){if(d==="|"){t+="||",a++;continue}e.push(t),t="";continue}t+=l}return t&&e.push(t),e}function yj(r){let e=r.indexOf("(");if(e===-1)return{name:r.trim(),args:[]};let t=r.substring(0,e).trim(),n=r.substring(e+1,r.lastIndexOf(")"));return{name:t,args:vj(n)}}function vj(r){if(!r||!r.trim())return[];let e=[],t="",n=!1,i=!1;for(let s=0;s<r.length;s++){let a=r[s];if((s>0?r[s-1]:"")==="\\"){t+=a;continue}if(a==="'"&&!i){n=!n,t+=a;continue}else if(a==='"'&&!n){i=!i,t+=a;continue}else if(a===","&&!n&&!i){e.push(t.trim()),t="";continue}t+=a}return t.trim()&&e.push(t.trim()),e}function Tt(r,e){if(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))return r.slice(1,-1);let t=Number(r);if(!isNaN(t)&&r!=="")return t;if(r==="true")return!0;if(r==="false")return!1;if(e&&r in e){let n=mj(e[r]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return r}function qc(r,e,t={}){let n=r;for(let i of e)n=bj(n,i.name,i.args,t);return n}function bj(r,e,t,n){switch(e){case"upper":return String(r).toUpperCase();case"lower":return String(r).toLowerCase();case"trim":return String(r).trim();case"length":return Array.isArray(r)?r.length:String(r).length;case"substring":{let i=Tt(t[0],n),s=t[1]!==void 0?Tt(t[1],n):void 0;return String(r).substring(i<0?String(r).length+i:i,s!==void 0?s<0?String(r).length+s:s:void 0)}case"replace":{let i=t[0]!==void 0?String(Tt(t[0],n)):"",s=t[1]!==void 0?String(Tt(t[1],n)):"";return String(r).replace(new RegExp(wj(i),"g"),s)}case"split":{let i=t[0]!==void 0?String(Tt(t[0],n)):",";return String(r).split(i)}case"join":{let i=t[0]!==void 0?String(Tt(t[0],n)):",";return Array.isArray(r)?r.join(i):String(r)}case"removeQuotes":return String(r).replace(/["']/g,"");case"removeSpaces":return String(r).replace(/\s/g,"");case"format":{let i=t[0]!==void 0?String(Tt(t[0],n)):"{0}";i=i.replace("{0}",String(r));for(let s=1;s<t.length;s++){let a=Tt(t[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=Tt(t[0],n);return Number(r)+i}case"subtract":{let i=Tt(t[0],n);return Number(r)-i}case"multiply":{let i=Tt(t[0],n);return Number(r)*i}case"abs":return Math.abs(Number(r));case"btoa":return Buffer.from(String(r)).toString("base64");case"atob":return Buffer.from(String(r),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(r));case"urlDecode":return decodeURIComponent(String(r));case"hash":{let i=String(t[0]!==void 0?Tt(t[0],n):"md5").toLowerCase(),s=String(t[1]!==void 0?Tt(t[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return uh.createHash(l).update(String(r)).digest(s)}case"hmac":{let i=t[0]?String(Tt(t[0],n)):"",s=String(t[1]!==void 0?Tt(t[1],n):"sha256").toLowerCase(),a=String(t[2]!==void 0?Tt(t[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return uh.createHmac(f,i).update(String(r)).digest(a)}case"first":return Array.isArray(r)?r[0]:r;case"last":return Array.isArray(r)?r[r.length-1]:r;case"at":{let i=Tt(t[0],n);return Array.isArray(r)?r.at(i):r}case"slice":{let i=Tt(t[0],n),s=t[1]!==void 0?Tt(t[1],n):void 0;return Array.isArray(r)?r.slice(i,s):String(r).slice(i,s)}case"unique":return Array.isArray(r)?[...new Set(r)]:r;case"filter":return!Array.isArray(r)||!t[0]?r:Sj(r,t[0],n);case"map":{if(!Array.isArray(r))return r;let i=t.map(s=>String(Tt(s,n)));return i.length===1?r.map(s=>kc(s,i[0])):r.map(s=>{let a={};for(let l of i){let f=kc(s,l);f!==void 0&&(a[l]=f)}return a})}case"prop":{let i=t[0]!==void 0?String(Tt(t[0],n)):"";if(Array.isArray(r)){let s=r.map(a=>kc(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return r&&typeof r=="object"?kc(r,i):r}case"parseJSON":try{return JSON.parse(String(r))}catch{return r}case"stringify":try{return JSON.stringify(r)}catch{return String(r)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(r));case"isUrl":try{return new URL(String(r)),!0}catch{return!1}case"setIfValue":return r||void 0;case"setNull":return r===null?null:r;default:return r}}function Sj(r,e,t){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return r;let[,i,s,a]=n,l=Tt(a,t);return r.filter(f=>{let d=kc(f,i);if(d===void 0)return!1;switch(s){case">":return Number(d)>Number(l);case">=":return Number(d)>=Number(l);case"<":return Number(d)<Number(l);case"<=":return Number(d)<=Number(l);case"=":return String(d)===String(l);case"!=":return String(d)!==String(l);case"*=":return String(d).includes(String(l));case"^=":return String(d).startsWith(String(l));case"$=":return String(d).endsWith(String(l));default:return!0}})}function kc(r,e){if(!(!r||typeof r!="object"))return e in r?r[e]:e.split(".").reduce((t,n)=>t?.[n],r)}function wj(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ch=se(()=>{"use strict"});function kE(r,e){if(r)return r.split(",").map(t=>{let n=t.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function _j(r){return new Qo(r)}var Qo,Zo,Ac=se(()=>{"use strict";oh();lh();ch();Qo=class r{allVariables;static MAX_RESOLUTION_DEPTH=20;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.variables}}resolveString(e,t=!1){return typeof e!="string"?e:this.resolveUntilStable(e,this.allVariables,t)}resolveStringWithExtra(e,t,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...t};return this.resolveUntilStable(e,i,n)}resolveUntilStable(e,t,n){let i=e;for(let s=0;s<r.MAX_RESOLUTION_DEPTH;s++){let a=this.resolveSinglePass(i,t,n);if(a===i)break;i=a}return i}resolveSinglePass(e,t,n){if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(f,d)=>this.resolveTemplateContent(d.trim(),t,f));let i="",s=0,a=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=a.exec(e))!==null;){let f=l[1].trim(),d=this.resolveTemplateContent(f,t,l[0]);if(d!==l[0]){i+=e.slice(s,l.index);let h=this.getStringContext(e,l.index);i+=h?this.escapeForString(String(d),h):String(d)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,t=!1){if(typeof e=="string")return this.resolveString(e,t);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,t));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,t);return n}return e}resolveObjectWithExtra(e,t,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,t,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,t,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,a]of Object.entries(e))i[s]=this.resolveObjectWithExtra(a,t,n);return i}return e}resolveTemplateContent(e,t,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let l=kE(i[2],t),f=Yi(i[1],l);return f!==null?String(f):n}let s=Tc(e);if(s){let l=this.resolveFilterInput(s.input,t);if(l!==void 0){let f=qc(l,s.filters,t);return f!==void 0?String(f):n}return n}let a=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(a){let l=a[1];if(t[l]!==void 0){let f=this.deserializeValue(t[l]),d=a[2],h=this.resolvePropertyAccess(f,d);if(h!==void 0)return typeof h=="object"?JSON.stringify(h):String(h)}}if(t[e]!==void 0){let l=t[e];return typeof l=="string"&&l.charCodeAt(0)===30?l.slice(1):String(l)}if(Yo(e)){let l=this.deserializeVariables(t),f=Go(e,l),d=Ko(e,f);if(d!==void 0)return String(d)}return n}resolveFilterInput(e,t){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=kE(n[2],t),a=Yi(n[1],s);return a!==null?a:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(t[s]!==void 0){let a=this.deserializeValue(t[s]),l=this.resolvePropertyAccess(a,i[2]);if(l!==void 0)return l}}if(t[e]!==void 0)return this.deserializeValue(t[e]);if(Yo(e)){let s=this.deserializeVariables(t),a=Go(e,s),l=Ko(e,a);if(l!==void 0)return l}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{return e}return e}deserializeVariables(e){let t={};for(let[n,i]of Object.entries(e))t[n]=this.deserializeValue(i);return t}resolvePropertyAccess(e,t){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(t))!==null;){if(n==null)return;if(s[1]!==void 0){let a=s[1];/^\d+$/.test(a)?n=n[Number(a)]:n=n[a.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,t){let n=e.replace(/\\/g,"\\\\");return t==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,t){let n=null;for(let i=0;i<t;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},Zo=class{interpolate(e,t){return!e||typeof e!="string"?e:new Qo({globals:{},collectionVariables:{},environmentVariables:{},variables:t}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let t=[],n,i=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(t.includes(s)||t.push(s))}return t}interpolateObject(e,t){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,t);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,t));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,t);return n}return e}}});import*as Rj from"http";import*as $c from"https";import{URL as TE}from"url";import*as fh from"zlib";var Wn,Xo,Mc=se(()=>{"use strict";Wn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Xo=class{settings;version;constructor(e){this.settings={...Wn,...e};try{this.version=it("../../package.json").version||"0.0.0"}catch{this.version="0.0.0"}this.settings.strictSSL===!1&&console.log("[NodeHttpClient] SSL verification disabled (strictSSL: false)")}async send(e){let t=this.mergeSettings(e.settings);return await this.executeInternal(e,t,0)}mergeSettings(e){return{timeout:e?.timeout??this.settings.timeout,followRedirects:e?.followRedirects??this.settings.followRedirects,followOriginalMethod:e?.followOriginalMethod??this.settings.followOriginalMethod,followAuthHeader:e?.followAuthHeader??this.settings.followAuthHeader,maxRedirects:e?.maxRedirects??this.settings.maxRedirects,strictSSL:e?.strictSSL??this.settings.strictSSL,decompress:e?.decompress??this.settings.decompress,includeCookies:e?.includeCookies??this.settings.includeCookies}}async executeInternal(e,t,n,i){let s=Date.now(),a=new TE(e.url),l=a.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(g=>g.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let h={hostname:a.hostname,port:a.port||(l?443:80),path:a.pathname+a.search,method:e.method,headers:{...f},timeout:t.timeout||void 0};return t.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(h.headers["Accept-Encoding"]="gzip, deflate"),l&&(h.rejectUnauthorized=t.strictSSL,t.strictSSL?h.agent=$c.globalAgent:h.agent=new $c.Agent({rejectUnauthorized:!1})),new Promise((g,y)=>{if(i?.aborted){let R=new Error("Request cancelled");R.name="AbortError",y(R);return}let _=(l?$c:Rj).request(h,async R=>{let I=R.statusCode||0;if(t.followRedirects&&[301,302,303,307,308].includes(I)){if(n>=t.maxRedirects){y(new Error(`Maximum redirects (${t.maxRedirects}) exceeded`));return}let j=R.headers.location;if(!j){y(new Error("Redirect response missing Location header"));return}let B=new TE(j,e.url).toString(),V=e.method;!t.followOriginalMethod&&[301,302,303].includes(I)&&(V="GET");let W={...e.headers};t.followAuthHeader||(delete W.authorization,delete W.Authorization);try{let X=await this.executeInternal({...e,url:B,method:V,headers:W,body:V==="GET"?void 0:e.body},t,n+1,i),T=Date.now();X.time=T-s,g(X)}catch(X){y(X)}return}let q=[];R.on("data",j=>q.push(j)),R.on("end",()=>{let j=Date.now(),B=Buffer.concat(q),V=R.headers["content-encoding"];if(t.decompress&&V)try{V==="gzip"?B=fh.gunzipSync(B):V==="deflate"&&(B=fh.inflateSync(B))}catch(C){console.warn("[NodeHttpClient] Decompression failed:",C)}let W=B.toString("utf-8"),X={};for(let[C,k]of Object.entries(R.headers))(typeof k=="string"||Array.isArray(k))&&(X[C]=k);let T=this.parseCookies(R.headers["set-cookie"],a.hostname);g({status:R.statusCode||0,statusText:R.statusMessage||"",headers:X,cookies:T,body:W,time:j-s,size:B.length})})});if(i&&i.addEventListener("abort",()=>{_.destroy();let R=new Error("Request cancelled");R.name="AbortError",y(R)}),_.on("error",R=>{y(R)}),_.on("timeout",()=>{_.destroy(),y(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let R=typeof e.body=="string"?e.body:JSON.stringify(e.body);_.write(R)}_.end()})}sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let t={};for(let[n,i]of Object.entries(e))t[n]=this.sanitizeHeaderValue(String(i));return t}parseCookies(e,t){return e?e.map(n=>{let i=n.split(";").map(h=>h.trim()),[s,...a]=i,[l,f]=s.split("="),d={name:l.trim(),value:f?.trim()||"",domain:t};for(let h of a){let[g,y]=h.split("=");switch(g.toLowerCase().trim()){case"domain":d.domain=y?.trim();break;case"path":d.path=y?.trim();break;case"expires":d.expires=y?.trim();break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break}}return d}):[]}}});function $b(r){return{timeout:r?.timeout??Wn.timeout,followRedirects:r?.followRedirects??Wn.followRedirects,followOriginalMethod:r?.followOriginalMethod??Wn.followOriginalMethod,followAuthHeader:r?.followAuthHeader??Wn.followAuthHeader,maxRedirects:r?.maxRedirects??Wn.maxRedirects,strictSSL:r?.strictSSL??Wn.strictSSL,decompress:r?.decompress??Wn.decompress,includeCookies:r?.includeCookies??Wn.includeCookies}}var Mb=se(()=>{"use strict";Mc()});var Ki,Nc=se(()=>{"use strict";Mb();Ki=class{constructor(e,t,n){this.urlBuilder=e;this.interceptors=t;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let t=$b(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,e,n);if(a)return a;throw s}try{let s=await this.httpClient.send({...i,settings:t});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,i,n);if(a)return a;throw s}}buildUrl(e,t={},n={}){return this.urlBuilder.buildUrl(e,t,n)}}});var Qi,Nb,Db,Fb,Dc=se(()=>{"use strict";Qi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let t=this.requestInterceptors.findIndex(n=>n.name===e);return t>=0?(this.requestInterceptors.splice(t,1),!0):!1}removeResponseInterceptor(e){let t=this.responseInterceptors.findIndex(n=>n.name===e);return t>=0?(this.responseInterceptors.splice(t,1),!0):!1}removeErrorInterceptor(e){let t=this.errorInterceptors.findIndex(n=>n.name===e);return t>=0?(this.errorInterceptors.splice(t,1),!0):!1}async executeRequestInterceptors(e,t){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,t)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,t,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,t,n)}catch(a){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,a),a}return i}async executeErrorInterceptors(e,t,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,t,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((t,n)=>(t.priority??100)-(n.priority??100))}},Nb=class{name="logging";priority=1e3;intercept(e,t){return e}},Db=class{name="timing";priority=1;intercept(e,t,n){return e}},Fb=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,t=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=t}handle(e,t,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}}});var qE=F((kl,Fc)=>{(function(){var r,e="4.18.1",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",a="Invalid `imports` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,d="__lodash_placeholder__",h=1,g=2,y=4,S=1,_=2,R=1,I=2,q=4,j=8,B=16,V=32,W=64,X=128,T=256,C=512,k=30,N="...",U=800,$=16,G=1,K=2,ne=3,pe=1/0,et=9007199254740991,_e=17976931348623157e292,he=NaN,xe=4294967295,bt=xe-1,It=xe>>>1,ue=[["ary",X],["bind",R],["bindKey",I],["curry",j],["curryRight",B],["flip",C],["partial",V],["partialRight",W],["rearg",T]],mr="[object Arguments]",ci="[object Array]",Ct="[object AsyncFunction]",Gr="[object Boolean]",Pr="[object Date]",mt="[object DOMException]",gt="[object Error]",ln="[object Function]",ho="[object GeneratorFunction]",Yt="[object Map]",mo="[object Number]",ly="[object Null]",kn="[object Object]",Dd="[object Promise]",Fd="[object Proxy]",Kt="[object RegExp]",gr="[object Set]",go="[object String]",Da="[object Symbol]",Ld="[object Undefined]",Bt="[object WeakMap]",jd="[object WeakSet]",qi="[object ArrayBuffer]",Tn="[object DataView]",at="[object Float32Array]",Fa="[object Float64Array]",La="[object Int8Array]",ms="[object Int16Array]",yo="[object Int32Array]",gs="[object Uint8Array]",fi="[object Uint8ClampedArray]",ys="[object Uint16Array]",Hu="[object Uint32Array]",ja=/\b__p \+= '';/g,uy=/\b(__p \+=) '' \+/g,vo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ai=/&(?:amp|lt|gt|quot|#39);/g,Ua=/[&<>"']/g,Ha=RegExp(Ai.source),le=RegExp(Ua.source),cy=/<%-([\s\S]+?)%>/g,fy=/<%([\s\S]+?)%>/g,un=/<%=([\s\S]+?)%>/g,kr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ae=/^\w*$/,Bu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ke=/[\\^$.*+?()[\]{}|]/g,bo=RegExp(Ke.source),Vu=/^\s+/,Ba=/\s/,Qt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,qn=/\{\n\/\* \[wrapped with (.+)\] \*/,cn=/,? & /,$t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Tr=/[()=,{}\[\]\/\s]/,An=/\\(\\)?/g,$i=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ud=/\w*$/,dy=/^[-+]0x[0-9a-f]+$/i,So=/^0b[01]+$/i,Hd=/^\[object .+?Constructor\]$/,py=/^0o[0-7]+$/i,vs=/^(?:0|[1-9]\d*)$/,wo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_o=/($^)/,hy=/['\n\r\u2028\u2029\\]/g,Va="\\ud800-\\udfff",my="\\u0300-\\u036f",xt="\\ufe20-\\ufe2f",Wu="\\u20d0-\\u20ff",Bd=my+xt+Wu,zu="\\u2700-\\u27bf",Ju="a-z\\xdf-\\xf6\\xf8-\\xff",gy="\\xac\\xb1\\xd7\\xf7",yy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vy="\\u2000-\\u206f",by=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Vd="A-Z\\xc0-\\xd6\\xd8-\\xde",Wd="\\ufe0e\\ufe0f",Gu=gy+yy+vy+by,Wa="['\u2019]",Sy="["+Va+"]",zd="["+Gu+"]",za="["+Bd+"]",Yu="\\d+",wy="["+zu+"]",bs="["+Ju+"]",Ro="[^"+Va+Gu+Yu+zu+Ju+Vd+"]",Ja="\\ud83c[\\udffb-\\udfff]",Co="(?:"+za+"|"+Ja+")",fn="[^"+Va+"]",Ku="(?:\\ud83c[\\udde6-\\uddff]){2}",Qu="[\\ud800-\\udbff][\\udc00-\\udfff]",Ss="["+Vd+"]",Jd="\\u200d",Gd="(?:"+bs+"|"+Ro+")",_y="(?:"+Ss+"|"+Ro+")",Yd="(?:"+Wa+"(?:d|ll|m|re|s|t|ve))?",Kd="(?:"+Wa+"(?:D|LL|M|RE|S|T|VE))?",Ga=Co+"?",Qd="["+Wd+"]?",Zd="(?:"+Jd+"(?:"+[fn,Ku,Qu].join("|")+")"+Qd+Ga+")*",Ry="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xd=Qd+Ga+Zd,xy="(?:"+[wy,Ku,Qu].join("|")+")"+Xd,Ey="(?:"+[fn+za+"?",za,Ku,Qu,Sy].join("|")+")",Oy=RegExp(Wa,"g"),Iy=RegExp(za,"g"),Zu=RegExp(Ja+"(?="+Ja+")|"+Ey+Xd,"g"),Py=RegExp([Ss+"?"+bs+"+"+Yd+"(?="+[zd,Ss,"$"].join("|")+")",_y+"+"+Kd+"(?="+[zd,Ss+Gd,"$"].join("|")+")",Ss+"?"+Gd+"+"+Yd,Ss+"+"+Kd,Cy,Ry,Yu,xy].join("|"),"g"),ky=RegExp("["+Jd+Va+Bd+Wd+"]"),Ty=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qy=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ay=-1,dt={};dt[at]=dt[Fa]=dt[La]=dt[ms]=dt[yo]=dt[gs]=dt[fi]=dt[ys]=dt[Hu]=!0,dt[mr]=dt[ci]=dt[qi]=dt[Gr]=dt[Tn]=dt[Pr]=dt[gt]=dt[ln]=dt[Yt]=dt[mo]=dt[kn]=dt[Kt]=dt[gr]=dt[go]=dt[Bt]=!1;var ut={};ut[mr]=ut[ci]=ut[qi]=ut[Tn]=ut[Gr]=ut[Pr]=ut[at]=ut[Fa]=ut[La]=ut[ms]=ut[yo]=ut[Yt]=ut[mo]=ut[kn]=ut[Kt]=ut[gr]=ut[go]=ut[Da]=ut[gs]=ut[fi]=ut[ys]=ut[Hu]=!0,ut[gt]=ut[ln]=ut[Bt]=!1;var Xu={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},ec={"&":"&","<":"<",">":">",'"':""","'":"'"},$y={"&":"&","<":"<",">":">",""":'"',"'":"'"},ep={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tp=parseFloat,My=parseInt,rp=typeof global=="object"&&global&&global.Object===Object&&global,Ny=typeof self=="object"&&self&&self.Object===Object&&self,Ft=rp||Ny||Function("return this")(),Ya=typeof kl=="object"&&kl&&!kl.nodeType&&kl,Qe=Ya&&typeof Fc=="object"&&Fc&&!Fc.nodeType&&Fc,ws=Qe&&Qe.exports===Ya,Mi=ws&&rp.process,qr=(function(){try{var L=Qe&&Qe.require&&Qe.require("util").types;return L||Mi&&Mi.binding&&Mi.binding("util")}catch{}})(),tc=qr&&qr.isArrayBuffer,np=qr&&qr.isDate,ip=qr&&qr.isMap,xo=qr&&qr.isRegExp,$n=qr&&qr.isSet,Ka=qr&&qr.isTypedArray;function yr(L,Y,z){switch(z.length){case 0:return L.call(Y);case 1:return L.call(Y,z[0]);case 2:return L.call(Y,z[0],z[1]);case 3:return L.call(Y,z[0],z[1],z[2])}return L.apply(Y,z)}function Mn(L,Y,z,ae){for(var be=-1,Ge=L==null?0:L.length;++be<Ge;){var rt=L[be];Y(ae,rt,z(rt),L)}return ae}function vr(L,Y){for(var z=-1,ae=L==null?0:L.length;++z<ae&&Y(L[z],z,L)!==!1;);return L}function rc(L,Y){for(var z=L==null?0:L.length;z--&&Y(L[z],z,L)!==!1;);return L}function sp(L,Y){for(var z=-1,ae=L==null?0:L.length;++z<ae;)if(!Y(L[z],z,L))return!1;return!0}function di(L,Y){for(var z=-1,ae=L==null?0:L.length,be=0,Ge=[];++z<ae;){var rt=L[z];Y(rt,z,L)&&(Ge[be++]=rt)}return Ge}function Qa(L,Y){var z=L==null?0:L.length;return!!z&&Ni(L,Y,0)>-1}function _s(L,Y,z){for(var ae=-1,be=L==null?0:L.length;++ae<be;)if(z(Y,L[ae]))return!0;return!1}function ct(L,Y){for(var z=-1,ae=L==null?0:L.length,be=Array(ae);++z<ae;)be[z]=Y(L[z],z,L);return be}function pi(L,Y){for(var z=-1,ae=Y.length,be=L.length;++z<ae;)L[be+z]=Y[z];return L}function nc(L,Y,z,ae){var be=-1,Ge=L==null?0:L.length;for(ae&&Ge&&(z=L[++be]);++be<Ge;)z=Y(z,L[be],be,L);return z}function Dy(L,Y,z,ae){var be=L==null?0:L.length;for(ae&&be&&(z=L[--be]);be--;)z=Y(z,L[be],be,L);return z}function Za(L,Y){for(var z=-1,ae=L==null?0:L.length;++z<ae;)if(Y(L[z],z,L))return!0;return!1}var Fy=Eo("length");function Ly(L){return L.split("")}function jy(L){return L.match($t)||[]}function op(L,Y,z){var ae;return z(L,function(be,Ge,rt){if(Y(be,Ge,rt))return ae=Ge,!1}),ae}function Xa(L,Y,z,ae){for(var be=L.length,Ge=z+(ae?1:-1);ae?Ge--:++Ge<be;)if(Y(L[Ge],Ge,L))return Ge;return-1}function Ni(L,Y,z){return Y===Y?Yy(L,Y,z):Xa(L,Di,z)}function Uy(L,Y,z,ae){for(var be=z-1,Ge=L.length;++be<Ge;)if(ae(L[be],Y))return be;return-1}function Di(L){return L!==L}function ap(L,Y){var z=L==null?0:L.length;return z?sc(L,Y)/z:he}function Eo(L){return function(Y){return Y==null?r:Y[L]}}function ic(L){return function(Y){return L==null?r:L[Y]}}function el(L,Y,z,ae,be){return be(L,function(Ge,rt,Ue){z=ae?(ae=!1,Ge):Y(z,Ge,rt,Ue)}),z}function Hy(L,Y){var z=L.length;for(L.sort(Y);z--;)L[z]=L[z].value;return L}function sc(L,Y){for(var z,ae=-1,be=L.length;++ae<be;){var Ge=Y(L[ae]);Ge!==r&&(z=z===r?Ge:z+Ge)}return z}function oc(L,Y){for(var z=-1,ae=Array(L);++z<L;)ae[z]=Y(z);return ae}function By(L,Y){return ct(Y,function(z){return[z,L[z]]})}function ac(L){return L&&L.slice(0,dp(L)+1).replace(Vu,"")}function br(L){return function(Y){return L(Y)}}function tl(L,Y){return ct(Y,function(z){return L[z]})}function tt(L,Y){return L.has(Y)}function lp(L,Y){for(var z=-1,ae=L.length;++z<ae&&Ni(Y,L[z],0)>-1;);return z}function up(L,Y){for(var z=L.length;z--&&Ni(Y,L[z],0)>-1;);return z}function cp(L,Y){for(var z=L.length,ae=0;z--;)L[z]===Y&&++ae;return ae}var Vy=ic(Xu),Wy=ic(ec);function zy(L){return"\\"+ep[L]}function Oo(L,Y){return L==null?r:L[Y]}function Rs(L){return ky.test(L)}function Jy(L){return Ty.test(L)}function Gy(L){for(var Y,z=[];!(Y=L.next()).done;)z.push(Y.value);return z}function Cs(L){var Y=-1,z=Array(L.size);return L.forEach(function(ae,be){z[++Y]=[be,ae]}),z}function Io(L,Y){return function(z){return L(Y(z))}}function dn(L,Y){for(var z=-1,ae=L.length,be=0,Ge=[];++z<ae;){var rt=L[z];(rt===Y||rt===d)&&(L[z]=d,Ge[be++]=z)}return Ge}function rl(L){var Y=-1,z=Array(L.size);return L.forEach(function(ae){z[++Y]=ae}),z}function fp(L){var Y=-1,z=Array(L.size);return L.forEach(function(ae){z[++Y]=[ae,ae]}),z}function Yy(L,Y,z){for(var ae=z-1,be=L.length;++ae<be;)if(L[ae]===Y)return ae;return-1}function lc(L,Y,z){for(var ae=z+1;ae--;)if(L[ae]===Y)return ae;return ae}function hi(L){return Rs(L)?Qy(L):Fy(L)}function Sr(L){return Rs(L)?Zy(L):Ly(L)}function dp(L){for(var Y=L.length;Y--&&Ba.test(L.charAt(Y)););return Y}var Ky=ic($y);function Qy(L){for(var Y=Zu.lastIndex=0;Zu.test(L);)++Y;return Y}function Zy(L){return L.match(Zu)||[]}function Xy(L){return L.match(Py)||[]}var ev=(function L(Y){Y=Y==null?Ft:mi.defaults(Ft.Object(),Y,mi.pick(Ft,qy));var z=Y.Array,ae=Y.Date,be=Y.Error,Ge=Y.Function,rt=Y.Math,Ue=Y.Object,nl=Y.RegExp,tv=Y.String,wr=Y.TypeError,Po=z.prototype,rv=Ge.prototype,xs=Ue.prototype,ko=Y["__core-js_shared__"],il=rv.toString,Ze=xs.hasOwnProperty,nv=0,pp=(function(){var o=/[^.]+$/.exec(ko&&ko.keys&&ko.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),sl=xs.toString,iv=il.call(Ue),sv=Ft._,ov=nl("^"+il.call(Ze).replace(Ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ol=ws?Y.Buffer:r,gi=Y.Symbol,al=Y.Uint8Array,hp=ol?ol.allocUnsafe:r,ll=Io(Ue.getPrototypeOf,Ue),mp=Ue.create,To=xs.propertyIsEnumerable,ul=Po.splice,gp=gi?gi.isConcatSpreadable:r,qo=gi?gi.iterator:r,Fi=gi?gi.toStringTag:r,cl=(function(){try{var o=Ho(Ue,"defineProperty");return o({},"",{}),o}catch{}})(),av=Y.clearTimeout!==Ft.clearTimeout&&Y.clearTimeout,lv=ae&&ae.now!==Ft.Date.now&&ae.now,uv=Y.setTimeout!==Ft.setTimeout&&Y.setTimeout,Ao=rt.ceil,$o=rt.floor,fl=Ue.getOwnPropertySymbols,dl=ol?ol.isBuffer:r,Li=Y.isFinite,pl=Po.join,yp=Io(Ue.keys,Ue),yt=rt.max,Vt=rt.min,vp=ae.now,cv=Y.parseInt,bp=rt.random,fv=Po.reverse,uc=Ho(Y,"DataView"),Mo=Ho(Y,"Map"),cc=Ho(Y,"Promise"),Es=Ho(Y,"Set"),No=Ho(Y,"WeakMap"),Do=Ho(Ue,"create"),hl=No&&new No,Os={},dv=Bo(uc),pv=Bo(Mo),hv=Bo(cc),mv=Bo(Es),gv=Bo(No),ml=gi?gi.prototype:r,Fo=ml?ml.valueOf:r,Sp=ml?ml.toString:r;function O(o){if(Pt(o)&&!Re(o)&&!(o instanceof $e)){if(o instanceof sr)return o;if(Ze.call(o,"__wrapped__"))return qx(o)}return new sr(o)}var Is=(function(){function o(){}return function(u){if(!Et(u))return{};if(mp)return mp(u);o.prototype=u;var p=new o;return o.prototype=r,p}})();function gl(){}function sr(o,u){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=r}O.templateSettings={escape:cy,evaluate:fy,interpolate:un,variable:"",imports:{_:O}},O.prototype=gl.prototype,O.prototype.constructor=O,sr.prototype=Is(gl.prototype),sr.prototype.constructor=sr;function $e(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=xe,this.__views__=[]}function yv(){var o=new $e(this.__wrapped__);return o.__actions__=Ar(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Ar(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Ar(this.__views__),o}function vv(){if(this.__filtered__){var o=new $e(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function fc(){var o=this.__wrapped__.value(),u=this.__dir__,p=Re(o),v=u<0,x=p?o.length:0,P=lM(0,x,this.__views__),A=P.start,D=P.end,H=D-A,Q=v?D:A-1,Z=this.__iteratees__,ee=Z.length,ie=0,ce=Vt(H,this.__takeCount__);if(!p||!v&&x==H&&ce==H)return tx(o,this.__actions__);var ye=[];e:for(;H--&&ie<ce;){Q+=u;for(var Ie=-1,me=o[Q];++Ie<ee;){var Le=Z[Ie],He=Le.iteratee,en=Le.type,Cr=He(me);if(en==K)me=Cr;else if(!Cr){if(en==G)continue e;break e}}ye[ie++]=me}return ye}$e.prototype=Is(gl.prototype),$e.prototype.constructor=$e;function pn(o){var u=-1,p=o==null?0:o.length;for(this.clear();++u<p;){var v=o[u];this.set(v[0],v[1])}}function bv(){this.__data__=Do?Do(null):{},this.size=0}function Sv(o){var u=this.has(o)&&delete this.__data__[o];return this.size-=u?1:0,u}function wv(o){var u=this.__data__;if(Do){var p=u[o];return p===l?r:p}return Ze.call(u,o)?u[o]:r}function _v(o){var u=this.__data__;return Do?u[o]!==r:Ze.call(u,o)}function Rv(o,u){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=Do&&u===r?l:u,this}pn.prototype.clear=bv,pn.prototype.delete=Sv,pn.prototype.get=wv,pn.prototype.has=_v,pn.prototype.set=Rv;function Nn(o){var u=-1,p=o==null?0:o.length;for(this.clear();++u<p;){var v=o[u];this.set(v[0],v[1])}}function wp(){this.__data__=[],this.size=0}function Cv(o){var u=this.__data__,p=vl(u,o);if(p<0)return!1;var v=u.length-1;return p==v?u.pop():ul.call(u,p,1),--this.size,!0}function xv(o){var u=this.__data__,p=vl(u,o);return p<0?r:u[p][1]}function _p(o){return vl(this.__data__,o)>-1}function Ev(o,u){var p=this.__data__,v=vl(p,o);return v<0?(++this.size,p.push([o,u])):p[v][1]=u,this}Nn.prototype.clear=wp,Nn.prototype.delete=Cv,Nn.prototype.get=xv,Nn.prototype.has=_p,Nn.prototype.set=Ev;function Dn(o){var u=-1,p=o==null?0:o.length;for(this.clear();++u<p;){var v=o[u];this.set(v[0],v[1])}}function Ov(){this.size=0,this.__data__={hash:new pn,map:new(Mo||Nn),string:new pn}}function yi(o){var u=Bp(this,o).delete(o);return this.size-=u?1:0,u}function Rp(o){return Bp(this,o).get(o)}function Iv(o){return Bp(this,o).has(o)}function Pv(o,u){var p=Bp(this,o),v=p.size;return p.set(o,u),this.size+=p.size==v?0:1,this}Dn.prototype.clear=Ov,Dn.prototype.delete=yi,Dn.prototype.get=Rp,Dn.prototype.has=Iv,Dn.prototype.set=Pv;function ji(o){var u=-1,p=o==null?0:o.length;for(this.__data__=new Dn;++u<p;)this.add(o[u])}function te(o){return this.__data__.set(o,l),this}function kv(o){return this.__data__.has(o)}ji.prototype.add=ji.prototype.push=te,ji.prototype.has=kv;function Yr(o){var u=this.__data__=new Nn(o);this.size=u.size}function Cp(){this.__data__=new Nn,this.size=0}function Ve(o){var u=this.__data__,p=u.delete(o);return this.size=u.size,p}function yl(o){return this.__data__.get(o)}function xp(o){return this.__data__.has(o)}function dc(o,u){var p=this.__data__;if(p instanceof Nn){var v=p.__data__;if(!Mo||v.length<t-1)return v.push([o,u]),this.size=++p.size,this;p=this.__data__=new Dn(v)}return p.set(o,u),this.size=p.size,this}Yr.prototype.clear=Cp,Yr.prototype.delete=Ve,Yr.prototype.get=yl,Yr.prototype.has=xp,Yr.prototype.set=dc;function Ep(o,u){var p=Re(o),v=!p&&Vo(o),x=!p&&!v&&Ms(o),P=!p&&!v&&!x&&Cl(o),A=p||v||x||P,D=A?oc(o.length,tv):[],H=D.length;for(var Q in o)(u||Ze.call(o,Q))&&!(A&&(Q=="length"||x&&(Q=="offset"||Q=="parent")||P&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||Vi(Q,H)))&&D.push(Q);return D}function Op(o){var u=o.length;return u?o[Bv(0,u-1)]:r}function Tv(o,u){return Vp(Ar(o),vi(u,0,o.length))}function qv(o){return Vp(Ar(o))}function pc(o,u,p){(p!==r&&!Hn(o[u],p)||p===r&&!(u in o))&&Kr(o,u,p)}function _r(o,u,p){var v=o[u];(!(Ze.call(o,u)&&Hn(v,p))||p===r&&!(u in o))&&Kr(o,u,p)}function vl(o,u){for(var p=o.length;p--;)if(Hn(o[p][0],u))return p;return-1}function Ip(o,u,p,v){return bi(o,function(x,P,A){u(v,x,p(x),A)}),v}function Pp(o,u){return o&&Si(u,Zt(u),o)}function Av(o,u){return o&&Si(u,Mr(u),o)}function Kr(o,u,p){u=="__proto__"&&cl?cl(o,u,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[u]=p}function hc(o,u){for(var p=-1,v=u.length,x=z(v),P=o==null;++p<v;)x[p]=P?r:mb(o,u[p]);return x}function vi(o,u,p){return o===o&&(p!==r&&(o=o<=p?o:p),u!==r&&(o=o>=u?o:u)),o}function or(o,u,p,v,x,P){var A,D=u&h,H=u&g,Q=u&y;if(p&&(A=x?p(o,v,x,P):p(o)),A!==r)return A;if(!Et(o))return o;var Z=Re(o);if(Z){if(A=cM(o),!D)return Ar(o,A)}else{var ee=ar(o),ie=ee==ln||ee==ho;if(Ms(o))return ix(o,D);if(ee==kn||ee==mr||ie&&!x){if(A=H||ie?{}:Rx(o),!D)return H?X$(o,Av(A,o)):Z$(o,Pp(A,o))}else{if(!ut[ee])return x?o:{};A=fM(o,ee,D)}}P||(P=new Yr);var ce=P.get(o);if(ce)return ce;P.set(o,A),Zx(o)?o.forEach(function(me){A.add(or(me,u,p,me,o,P))}):Kx(o)&&o.forEach(function(me,Le){A.set(Le,or(me,u,p,Le,o,P))});var ye=Q?H?eb:Xv:H?Mr:Zt,Ie=Z?r:ye(o);return vr(Ie||o,function(me,Le){Ie&&(Le=me,me=o[Le]),_r(A,Le,or(me,u,p,Le,o,P))}),A}function $v(o){var u=Zt(o);return function(p){return hn(p,o,u)}}function hn(o,u,p){var v=p.length;if(o==null)return!v;for(o=Ue(o);v--;){var x=p[v],P=u[x],A=o[x];if(A===r&&!(x in o)||!P(A))return!1}return!0}function mc(o,u,p){if(typeof o!="function")throw new wr(i);return _c(function(){o.apply(r,p)},u)}function Lo(o,u,p,v){var x=-1,P=Qa,A=!0,D=o.length,H=[],Q=u.length;if(!D)return H;p&&(u=ct(u,br(p))),v?(P=_s,A=!1):u.length>=t&&(P=tt,A=!1,u=new ji(u));e:for(;++x<D;){var Z=o[x],ee=p==null?Z:p(Z);if(Z=v||Z!==0?Z:0,A&&ee===ee){for(var ie=Q;ie--;)if(u[ie]===ee)continue e;H.push(Z)}else P(u,ee,v)||H.push(Z)}return H}var bi=ux(mn),kp=ux(Fn,!0);function Mv(o,u){var p=!0;return bi(o,function(v,x,P){return p=!!u(v,x,P),p}),p}function bl(o,u,p){for(var v=-1,x=o.length;++v<x;){var P=o[v],A=u(P);if(A!=null&&(D===r?A===A&&!Xr(A):p(A,D)))var D=A,H=P}return H}function Nv(o,u,p,v){var x=o.length;for(p=Ee(p),p<0&&(p=-p>x?0:x+p),v=v===r||v>x?x:Ee(v),v<0&&(v+=x),v=p>v?0:eE(v);p<v;)o[p++]=u;return o}function Tp(o,u){var p=[];return bi(o,function(v,x,P){u(v,x,P)&&p.push(v)}),p}function Wt(o,u,p,v,x){var P=-1,A=o.length;for(p||(p=pM),x||(x=[]);++P<A;){var D=o[P];u>0&&p(D)?u>1?Wt(D,u-1,p,v,x):pi(x,D):v||(x[x.length]=D)}return x}var gc=cx(),qp=cx(!0);function mn(o,u){return o&&gc(o,u,Zt)}function Fn(o,u){return o&&qp(o,u,Zt)}function Sl(o,u){return di(u,function(p){return Wi(o[p])})}function Ui(o,u){u=As(u,o);for(var p=0,v=u.length;o!=null&&p<v;)o=o[Un(u[p++])];return p&&p==v?o:r}function Ap(o,u,p){var v=u(o);return Re(o)?v:pi(v,p(o))}function Xt(o){return o==null?o===r?Ld:ly:Fi&&Fi in Ue(o)?aM(o):SM(o)}function yc(o,u){return o>u}function Dv(o,u){return o!=null&&Ze.call(o,u)}function Fv(o,u){return o!=null&&u in Ue(o)}function Lv(o,u,p){return o>=Vt(u,p)&&o<yt(u,p)}function Qr(o,u,p){for(var v=p?_s:Qa,x=o[0].length,P=o.length,A=P,D=z(P),H=1/0,Q=[];A--;){var Z=o[A];A&&u&&(Z=ct(Z,br(u))),H=Vt(Z.length,H),D[A]=!p&&(u||x>=120&&Z.length>=120)?new ji(A&&Z):r}Z=o[0];var ee=-1,ie=D[0];e:for(;++ee<x&&Q.length<H;){var ce=Z[ee],ye=u?u(ce):ce;if(ce=p||ce!==0?ce:0,!(ie?tt(ie,ye):v(Q,ye,p))){for(A=P;--A;){var Ie=D[A];if(!(Ie?tt(Ie,ye):v(o[A],ye,p)))continue e}ie&&ie.push(ye),Q.push(ce)}}return Q}function Ps(o,u,p,v){return mn(o,function(x,P,A){u(v,p(x),P,A)}),v}function jo(o,u,p){u=As(u,o),o=Ox(o,u);var v=o==null?o:o[Un(yn(u))];return v==null?r:yr(v,o,p)}function $p(o){return Pt(o)&&Xt(o)==mr}function jv(o){return Pt(o)&&Xt(o)==qi}function Uv(o){return Pt(o)&&Xt(o)==Pr}function Uo(o,u,p,v,x){return o===u?!0:o==null||u==null||!Pt(o)&&!Pt(u)?o!==o&&u!==u:vc(o,u,p,v,Uo,x)}function vc(o,u,p,v,x,P){var A=Re(o),D=Re(u),H=A?ci:ar(o),Q=D?ci:ar(u);H=H==mr?kn:H,Q=Q==mr?kn:Q;var Z=H==kn,ee=Q==kn,ie=H==Q;if(ie&&Ms(o)){if(!Ms(u))return!1;A=!0,Z=!1}if(ie&&!Z)return P||(P=new Yr),A||Cl(o)?Sx(o,u,p,v,x,P):sM(o,u,H,p,v,x,P);if(!(p&S)){var ce=Z&&Ze.call(o,"__wrapped__"),ye=ee&&Ze.call(u,"__wrapped__");if(ce||ye){var Ie=ce?o.value():o,me=ye?u.value():u;return P||(P=new Yr),x(Ie,me,p,v,P)}}return ie?(P||(P=new Yr),oM(o,u,p,v,x,P)):!1}function ks(o){return Pt(o)&&ar(o)==Yt}function Ts(o,u,p,v){var x=p.length,P=x,A=!v;if(o==null)return!P;for(o=Ue(o);x--;){var D=p[x];if(A&&D[2]?D[1]!==o[D[0]]:!(D[0]in o))return!1}for(;++x<P;){D=p[x];var H=D[0],Q=o[H],Z=D[1];if(A&&D[2]){if(Q===r&&!(H in o))return!1}else{var ee=new Yr;if(v)var ie=v(Q,Z,H,o,u,ee);if(!(ie===r?Uo(Z,Q,S|_,v,ee):ie))return!1}}return!0}function Fe(o){if(!Et(o)||mM(o))return!1;var u=Wi(o)?ov:Hd;return u.test(Bo(o))}function c(o){return Pt(o)&&Xt(o)==Kt}function m(o){return Pt(o)&&ar(o)==gr}function b(o){return Pt(o)&&Kp(o.length)&&!!dt[Xt(o)]}function w(o){return typeof o=="function"?o:o==null?Nr:typeof o=="object"?Re(o)?Me(o[0],o[1]):ve(o):dE(o)}function E(o){if(!wc(o))return yp(o);var u=[];for(var p in Ue(o))Ze.call(o,p)&&p!="constructor"&&u.push(p);return u}function M(o){if(!Et(o))return bM(o);var u=wc(o),p=[];for(var v in o)v=="constructor"&&(u||!Ze.call(o,v))||p.push(v);return p}function J(o,u){return o<u}function oe(o,u){var p=-1,v=$r(o)?z(o.length):[];return bi(o,function(x,P,A){v[++p]=u(x,P,A)}),v}function ve(o){var u=rb(o);return u.length==1&&u[0][2]?xx(u[0][0],u[0][1]):function(p){return p===o||Ts(p,o,u)}}function Me(o,u){return ib(o)&&Cx(u)?xx(Un(o),u):function(p){var v=mb(p,o);return v===r&&v===u?gb(p,o):Uo(u,v,S|_)}}function Lt(o,u,p,v,x){o!==u&&gc(u,function(P,A){if(x||(x=new Yr),Et(P))Ln(o,u,A,p,Lt,v,x);else{var D=v?v(ob(o,A),P,A+"",o,u,x):r;D===r&&(D=P),pc(o,A,D)}},Mr)}function Ln(o,u,p,v,x,P,A){var D=ob(o,p),H=ob(u,p),Q=A.get(H);if(Q){pc(o,p,Q);return}var Z=P?P(D,H,p+"",o,u,A):r,ee=Z===r;if(ee){var ie=Re(H),ce=!ie&&Ms(H),ye=!ie&&!ce&&Cl(H);Z=H,ie||ce||ye?Re(D)?Z=D:Mt(D)?Z=Ar(D):ce?(ee=!1,Z=ix(H,!0)):ye?(ee=!1,Z=sx(H,!0)):Z=[]:Rc(H)||Vo(H)?(Z=D,Vo(D)?Z=tE(D):(!Et(D)||Wi(D))&&(Z=Rx(H))):ee=!1}ee&&(A.set(H,Z),x(Z,H,v,P,A),A.delete(H)),pc(o,p,Z)}function jn(o,u){var p=o.length;if(p)return u+=u<0?p:0,Vi(u,p)?o[u]:r}function GC(o,u,p){u.length?u=ct(u,function(P){return Re(P)?function(A){return Ui(A,P.length===1?P[0]:P)}:P}):u=[Nr];var v=-1;u=ct(u,br(ge()));var x=oe(o,function(P,A,D){var H=ct(u,function(Q){return Q(P)});return{criteria:H,index:++v,value:P}});return Hy(x,function(P,A){return Q$(P,A,p)})}function L$(o,u){return YC(o,u,function(p,v){return gb(o,v)})}function YC(o,u,p){for(var v=-1,x=u.length,P={};++v<x;){var A=u[v],D=Ui(o,A);p(D,A)&&bc(P,As(A,o),D)}return P}function j$(o){return function(u){return Ui(u,o)}}function Hv(o,u,p,v){var x=v?Uy:Ni,P=-1,A=u.length,D=o;for(o===u&&(u=Ar(u)),p&&(D=ct(o,br(p)));++P<A;)for(var H=0,Q=u[P],Z=p?p(Q):Q;(H=x(D,Z,H,v))>-1;)D!==o&&ul.call(D,H,1),ul.call(o,H,1);return o}function KC(o,u){for(var p=o?u.length:0,v=p-1;p--;){var x=u[p];if(p==v||x!==P){var P=x;Vi(x)?ul.call(o,x,1):zv(o,x)}}return o}function Bv(o,u){return o+$o(bp()*(u-o+1))}function U$(o,u,p,v){for(var x=-1,P=yt(Ao((u-o)/(p||1)),0),A=z(P);P--;)A[v?P:++x]=o,o+=p;return A}function Vv(o,u){var p="";if(!o||u<1||u>et)return p;do u%2&&(p+=o),u=$o(u/2),u&&(o+=o);while(u);return p}function Te(o,u){return ab(Ex(o,u,Nr),o+"")}function H$(o){return Op(xl(o))}function B$(o,u){var p=xl(o);return Vp(p,vi(u,0,p.length))}function bc(o,u,p,v){if(!Et(o))return o;u=As(u,o);for(var x=-1,P=u.length,A=P-1,D=o;D!=null&&++x<P;){var H=Un(u[x]),Q=p;if(H==="__proto__"||H==="constructor"||H==="prototype")return o;if(x!=A){var Z=D[H];Q=v?v(Z,H,D):r,Q===r&&(Q=Et(Z)?Z:Vi(u[x+1])?[]:{})}_r(D,H,Q),D=D[H]}return o}var QC=hl?function(o,u){return hl.set(o,u),o}:Nr,V$=cl?function(o,u){return cl(o,"toString",{configurable:!0,enumerable:!1,value:vb(u),writable:!0})}:Nr;function W$(o){return Vp(xl(o))}function gn(o,u,p){var v=-1,x=o.length;u<0&&(u=-u>x?0:x+u),p=p>x?x:p,p<0&&(p+=x),x=u>p?0:p-u>>>0,u>>>=0;for(var P=z(x);++v<x;)P[v]=o[v+u];return P}function z$(o,u){var p;return bi(o,function(v,x,P){return p=u(v,x,P),!p}),!!p}function Mp(o,u,p){var v=0,x=o==null?v:o.length;if(typeof u=="number"&&u===u&&x<=It){for(;v<x;){var P=v+x>>>1,A=o[P];A!==null&&!Xr(A)&&(p?A<=u:A<u)?v=P+1:x=P}return x}return Wv(o,u,Nr,p)}function Wv(o,u,p,v){var x=0,P=o==null?0:o.length;if(P===0)return 0;u=p(u);for(var A=u!==u,D=u===null,H=Xr(u),Q=u===r;x<P;){var Z=$o((x+P)/2),ee=p(o[Z]),ie=ee!==r,ce=ee===null,ye=ee===ee,Ie=Xr(ee);if(A)var me=v||ye;else Q?me=ye&&(v||ie):D?me=ye&&ie&&(v||!ce):H?me=ye&&ie&&!ce&&(v||!Ie):ce||Ie?me=!1:me=v?ee<=u:ee<u;me?x=Z+1:P=Z}return Vt(P,bt)}function ZC(o,u){for(var p=-1,v=o.length,x=0,P=[];++p<v;){var A=o[p],D=u?u(A):A;if(!p||!Hn(D,H)){var H=D;P[x++]=A===0?0:A}}return P}function XC(o){return typeof o=="number"?o:Xr(o)?he:+o}function Zr(o){if(typeof o=="string")return o;if(Re(o))return ct(o,Zr)+"";if(Xr(o))return Sp?Sp.call(o):"";var u=o+"";return u=="0"&&1/o==-pe?"-0":u}function qs(o,u,p){var v=-1,x=Qa,P=o.length,A=!0,D=[],H=D;if(p)A=!1,x=_s;else if(P>=t){var Q=u?null:nM(o);if(Q)return rl(Q);A=!1,x=tt,H=new ji}else H=u?[]:D;e:for(;++v<P;){var Z=o[v],ee=u?u(Z):Z;if(Z=p||Z!==0?Z:0,A&&ee===ee){for(var ie=H.length;ie--;)if(H[ie]===ee)continue e;u&&H.push(ee),D.push(Z)}else x(H,ee,p)||(H!==D&&H.push(ee),D.push(Z))}return D}function zv(o,u){u=As(u,o);var p=-1,v=u.length;if(!v)return!0;for(;++p<v;){var x=Un(u[p]);if(x==="__proto__"&&!Ze.call(o,"__proto__")||(x==="constructor"||x==="prototype")&&p<v-1)return!1}var P=Ox(o,u);return P==null||delete P[Un(yn(u))]}function ex(o,u,p,v){return bc(o,u,p(Ui(o,u)),v)}function Np(o,u,p,v){for(var x=o.length,P=v?x:-1;(v?P--:++P<x)&&u(o[P],P,o););return p?gn(o,v?0:P,v?P+1:x):gn(o,v?P+1:0,v?x:P)}function tx(o,u){var p=o;return p instanceof $e&&(p=p.value()),nc(u,function(v,x){return x.func.apply(x.thisArg,pi([v],x.args))},p)}function Jv(o,u,p){var v=o.length;if(v<2)return v?qs(o[0]):[];for(var x=-1,P=z(v);++x<v;)for(var A=o[x],D=-1;++D<v;)D!=x&&(P[x]=Lo(P[x]||A,o[D],u,p));return qs(Wt(P,1),u,p)}function rx(o,u,p){for(var v=-1,x=o.length,P=u.length,A={};++v<x;){var D=v<P?u[v]:r;p(A,o[v],D)}return A}function Gv(o){return Mt(o)?o:[]}function Yv(o){return typeof o=="function"?o:Nr}function As(o,u){return Re(o)?o:ib(o,u)?[o]:Tx(nt(o))}var J$=Te;function $s(o,u,p){var v=o.length;return p=p===r?v:p,!u&&p>=v?o:gn(o,u,p)}var nx=av||function(o){return Ft.clearTimeout(o)};function ix(o,u){if(u)return o.slice();var p=o.length,v=hp?hp(p):new o.constructor(p);return o.copy(v),v}function Kv(o){var u=new o.constructor(o.byteLength);return new al(u).set(new al(o)),u}function G$(o,u){var p=u?Kv(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function Y$(o){var u=new o.constructor(o.source,Ud.exec(o));return u.lastIndex=o.lastIndex,u}function K$(o){return Fo?Ue(Fo.call(o)):{}}function sx(o,u){var p=u?Kv(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function ox(o,u){if(o!==u){var p=o!==r,v=o===null,x=o===o,P=Xr(o),A=u!==r,D=u===null,H=u===u,Q=Xr(u);if(!D&&!Q&&!P&&o>u||P&&A&&H&&!D&&!Q||v&&A&&H||!p&&H||!x)return 1;if(!v&&!P&&!Q&&o<u||Q&&p&&x&&!v&&!P||D&&p&&x||!A&&x||!H)return-1}return 0}function Q$(o,u,p){for(var v=-1,x=o.criteria,P=u.criteria,A=x.length,D=p.length;++v<A;){var H=ox(x[v],P[v]);if(H){if(v>=D)return H;var Q=p[v];return H*(Q=="desc"?-1:1)}}return o.index-u.index}function ax(o,u,p,v){for(var x=-1,P=o.length,A=p.length,D=-1,H=u.length,Q=yt(P-A,0),Z=z(H+Q),ee=!v;++D<H;)Z[D]=u[D];for(;++x<A;)(ee||x<P)&&(Z[p[x]]=o[x]);for(;Q--;)Z[D++]=o[x++];return Z}function lx(o,u,p,v){for(var x=-1,P=o.length,A=-1,D=p.length,H=-1,Q=u.length,Z=yt(P-D,0),ee=z(Z+Q),ie=!v;++x<Z;)ee[x]=o[x];for(var ce=x;++H<Q;)ee[ce+H]=u[H];for(;++A<D;)(ie||x<P)&&(ee[ce+p[A]]=o[x++]);return ee}function Ar(o,u){var p=-1,v=o.length;for(u||(u=z(v));++p<v;)u[p]=o[p];return u}function Si(o,u,p,v){var x=!p;p||(p={});for(var P=-1,A=u.length;++P<A;){var D=u[P],H=v?v(p[D],o[D],D,p,o):r;H===r&&(H=o[D]),x?Kr(p,D,H):_r(p,D,H)}return p}function Z$(o,u){return Si(o,nb(o),u)}function X$(o,u){return Si(o,wx(o),u)}function Dp(o,u){return function(p,v){var x=Re(p)?Mn:Ip,P=u?u():{};return x(p,o,ge(v,2),P)}}function wl(o){return Te(function(u,p){var v=-1,x=p.length,P=x>1?p[x-1]:r,A=x>2?p[2]:r;for(P=o.length>3&&typeof P=="function"?(x--,P):r,A&&Rr(p[0],p[1],A)&&(P=x<3?r:P,x=1),u=Ue(u);++v<x;){var D=p[v];D&&o(u,D,v,P)}return u})}function ux(o,u){return function(p,v){if(p==null)return p;if(!$r(p))return o(p,v);for(var x=p.length,P=u?x:-1,A=Ue(p);(u?P--:++P<x)&&v(A[P],P,A)!==!1;);return p}}function cx(o){return function(u,p,v){for(var x=-1,P=Ue(u),A=v(u),D=A.length;D--;){var H=A[o?D:++x];if(p(P[H],H,P)===!1)break}return u}}function eM(o,u,p){var v=u&R,x=Sc(o);function P(){var A=this&&this!==Ft&&this instanceof P?x:o;return A.apply(v?p:this,arguments)}return P}function fx(o){return function(u){u=nt(u);var p=Rs(u)?Sr(u):r,v=p?p[0]:u.charAt(0),x=p?$s(p,1).join(""):u.slice(1);return v[o]()+x}}function _l(o){return function(u){return nc(cE(uE(u).replace(Oy,"")),o,"")}}function Sc(o){return function(){var u=arguments;switch(u.length){case 0:return new o;case 1:return new o(u[0]);case 2:return new o(u[0],u[1]);case 3:return new o(u[0],u[1],u[2]);case 4:return new o(u[0],u[1],u[2],u[3]);case 5:return new o(u[0],u[1],u[2],u[3],u[4]);case 6:return new o(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new o(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var p=Is(o.prototype),v=o.apply(p,u);return Et(v)?v:p}}function tM(o,u,p){var v=Sc(o);function x(){for(var P=arguments.length,A=z(P),D=P,H=Rl(x);D--;)A[D]=arguments[D];var Q=P<3&&A[0]!==H&&A[P-1]!==H?[]:dn(A,H);if(P-=Q.length,P<p)return gx(o,u,Fp,x.placeholder,r,A,Q,r,r,p-P);var Z=this&&this!==Ft&&this instanceof x?v:o;return yr(Z,this,A)}return x}function dx(o){return function(u,p,v){var x=Ue(u);if(!$r(u)){var P=ge(p,3);u=Zt(u),p=function(D){return P(x[D],D,x)}}var A=o(u,p,v);return A>-1?x[P?u[A]:A]:r}}function px(o){return Bi(function(u){var p=u.length,v=p,x=sr.prototype.thru;for(o&&u.reverse();v--;){var P=u[v];if(typeof P!="function")throw new wr(i);if(x&&!A&&Hp(P)=="wrapper")var A=new sr([],!0)}for(v=A?v:p;++v<p;){P=u[v];var D=Hp(P),H=D=="wrapper"?tb(P):r;H&&sb(H[0])&&H[1]==(X|j|V|T)&&!H[4].length&&H[9]==1?A=A[Hp(H[0])].apply(A,H[3]):A=P.length==1&&sb(P)?A[D]():A.thru(P)}return function(){var Q=arguments,Z=Q[0];if(A&&Q.length==1&&Re(Z))return A.plant(Z).value();for(var ee=0,ie=p?u[ee].apply(this,Q):Z;++ee<p;)ie=u[ee].call(this,ie);return ie}})}function Fp(o,u,p,v,x,P,A,D,H,Q){var Z=u&X,ee=u&R,ie=u&I,ce=u&(j|B),ye=u&C,Ie=ie?r:Sc(o);function me(){for(var Le=arguments.length,He=z(Le),en=Le;en--;)He[en]=arguments[en];if(ce)var Cr=Rl(me),tn=cp(He,Cr);if(v&&(He=ax(He,v,x,ce)),P&&(He=lx(He,P,A,ce)),Le-=tn,ce&&Le<Q){var Nt=dn(He,Cr);return gx(o,u,Fp,me.placeholder,p,He,Nt,D,H,Q-Le)}var Bn=ee?p:this,Ji=ie?Bn[o]:o;return Le=He.length,D?He=wM(He,D):ye&&Le>1&&He.reverse(),Z&&H<Le&&(He.length=H),this&&this!==Ft&&this instanceof me&&(Ji=Ie||Sc(Ji)),Ji.apply(Bn,He)}return me}function hx(o,u){return function(p,v){return Ps(p,o,u(v),{})}}function Lp(o,u){return function(p,v){var x;if(p===r&&v===r)return u;if(p!==r&&(x=p),v!==r){if(x===r)return v;typeof p=="string"||typeof v=="string"?(p=Zr(p),v=Zr(v)):(p=XC(p),v=XC(v)),x=o(p,v)}return x}}function Qv(o){return Bi(function(u){return u=ct(u,br(ge())),Te(function(p){var v=this;return o(u,function(x){return yr(x,v,p)})})})}function jp(o,u){u=u===r?" ":Zr(u);var p=u.length;if(p<2)return p?Vv(u,o):u;var v=Vv(u,Ao(o/hi(u)));return Rs(u)?$s(Sr(v),0,o).join(""):v.slice(0,o)}function rM(o,u,p,v){var x=u&R,P=Sc(o);function A(){for(var D=-1,H=arguments.length,Q=-1,Z=v.length,ee=z(Z+H),ie=this&&this!==Ft&&this instanceof A?P:o;++Q<Z;)ee[Q]=v[Q];for(;H--;)ee[Q++]=arguments[++D];return yr(ie,x?p:this,ee)}return A}function mx(o){return function(u,p,v){return v&&typeof v!="number"&&Rr(u,p,v)&&(p=v=r),u=zi(u),p===r?(p=u,u=0):p=zi(p),v=v===r?u<p?1:-1:zi(v),U$(u,p,v,o)}}function Up(o){return function(u,p){return typeof u=="string"&&typeof p=="string"||(u=vn(u),p=vn(p)),o(u,p)}}function gx(o,u,p,v,x,P,A,D,H,Q){var Z=u&j,ee=Z?A:r,ie=Z?r:A,ce=Z?P:r,ye=Z?r:P;u|=Z?V:W,u&=~(Z?W:V),u&q||(u&=~(R|I));var Ie=[o,u,x,ce,ee,ye,ie,D,H,Q],me=p.apply(r,Ie);return sb(o)&&Ix(me,Ie),me.placeholder=v,Px(me,o,u)}function Zv(o){var u=rt[o];return function(p,v){if(p=vn(p),v=v==null?0:Vt(Ee(v),292),v&&Li(p)){var x=(nt(p)+"e").split("e"),P=u(x[0]+"e"+(+x[1]+v));return x=(nt(P)+"e").split("e"),+(x[0]+"e"+(+x[1]-v))}return u(p)}}var nM=Es&&1/rl(new Es([,-0]))[1]==pe?function(o){return new Es(o)}:wb;function yx(o){return function(u){var p=ar(u);return p==Yt?Cs(u):p==gr?fp(u):By(u,o(u))}}function Hi(o,u,p,v,x,P,A,D){var H=u&I;if(!H&&typeof o!="function")throw new wr(i);var Q=v?v.length:0;if(Q||(u&=~(V|W),v=x=r),A=A===r?A:yt(Ee(A),0),D=D===r?D:Ee(D),Q-=x?x.length:0,u&W){var Z=v,ee=x;v=x=r}var ie=H?r:tb(o),ce=[o,u,p,v,x,Z,ee,P,A,D];if(ie&&vM(ce,ie),o=ce[0],u=ce[1],p=ce[2],v=ce[3],x=ce[4],D=ce[9]=ce[9]===r?H?0:o.length:yt(ce[9]-Q,0),!D&&u&(j|B)&&(u&=~(j|B)),!u||u==R)var ye=eM(o,u,p);else u==j||u==B?ye=tM(o,u,D):(u==V||u==(R|V))&&!x.length?ye=rM(o,u,p,v):ye=Fp.apply(r,ce);var Ie=ie?QC:Ix;return Px(Ie(ye,ce),o,u)}function vx(o,u,p,v){return o===r||Hn(o,xs[p])&&!Ze.call(v,p)?u:o}function bx(o,u,p,v,x,P){return Et(o)&&Et(u)&&(P.set(u,o),Lt(o,u,r,bx,P),P.delete(u)),o}function iM(o){return Rc(o)?r:o}function Sx(o,u,p,v,x,P){var A=p&S,D=o.length,H=u.length;if(D!=H&&!(A&&H>D))return!1;var Q=P.get(o),Z=P.get(u);if(Q&&Z)return Q==u&&Z==o;var ee=-1,ie=!0,ce=p&_?new ji:r;for(P.set(o,u),P.set(u,o);++ee<D;){var ye=o[ee],Ie=u[ee];if(v)var me=A?v(Ie,ye,ee,u,o,P):v(ye,Ie,ee,o,u,P);if(me!==r){if(me)continue;ie=!1;break}if(ce){if(!Za(u,function(Le,He){if(!tt(ce,He)&&(ye===Le||x(ye,Le,p,v,P)))return ce.push(He)})){ie=!1;break}}else if(!(ye===Ie||x(ye,Ie,p,v,P))){ie=!1;break}}return P.delete(o),P.delete(u),ie}function sM(o,u,p,v,x,P,A){switch(p){case Tn:if(o.byteLength!=u.byteLength||o.byteOffset!=u.byteOffset)return!1;o=o.buffer,u=u.buffer;case qi:return!(o.byteLength!=u.byteLength||!P(new al(o),new al(u)));case Gr:case Pr:case mo:return Hn(+o,+u);case gt:return o.name==u.name&&o.message==u.message;case Kt:case go:return o==u+"";case Yt:var D=Cs;case gr:var H=v&S;if(D||(D=rl),o.size!=u.size&&!H)return!1;var Q=A.get(o);if(Q)return Q==u;v|=_,A.set(o,u);var Z=Sx(D(o),D(u),v,x,P,A);return A.delete(o),Z;case Da:if(Fo)return Fo.call(o)==Fo.call(u)}return!1}function oM(o,u,p,v,x,P){var A=p&S,D=Xv(o),H=D.length,Q=Xv(u),Z=Q.length;if(H!=Z&&!A)return!1;for(var ee=H;ee--;){var ie=D[ee];if(!(A?ie in u:Ze.call(u,ie)))return!1}var ce=P.get(o),ye=P.get(u);if(ce&&ye)return ce==u&&ye==o;var Ie=!0;P.set(o,u),P.set(u,o);for(var me=A;++ee<H;){ie=D[ee];var Le=o[ie],He=u[ie];if(v)var en=A?v(He,Le,ie,u,o,P):v(Le,He,ie,o,u,P);if(!(en===r?Le===He||x(Le,He,p,v,P):en)){Ie=!1;break}me||(me=ie=="constructor")}if(Ie&&!me){var Cr=o.constructor,tn=u.constructor;Cr!=tn&&"constructor"in o&&"constructor"in u&&!(typeof Cr=="function"&&Cr instanceof Cr&&typeof tn=="function"&&tn instanceof tn)&&(Ie=!1)}return P.delete(o),P.delete(u),Ie}function Bi(o){return ab(Ex(o,r,Mx),o+"")}function Xv(o){return Ap(o,Zt,nb)}function eb(o){return Ap(o,Mr,wx)}var tb=hl?function(o){return hl.get(o)}:wb;function Hp(o){for(var u=o.name+"",p=Os[u],v=Ze.call(Os,u)?p.length:0;v--;){var x=p[v],P=x.func;if(P==null||P==o)return x.name}return u}function Rl(o){var u=Ze.call(O,"placeholder")?O:o;return u.placeholder}function ge(){var o=O.iteratee||bb;return o=o===bb?w:o,arguments.length?o(arguments[0],arguments[1]):o}function Bp(o,u){var p=o.__data__;return hM(u)?p[typeof u=="string"?"string":"hash"]:p.map}function rb(o){for(var u=Zt(o),p=u.length;p--;){var v=u[p],x=o[v];u[p]=[v,x,Cx(x)]}return u}function Ho(o,u){var p=Oo(o,u);return Fe(p)?p:r}function aM(o){var u=Ze.call(o,Fi),p=o[Fi];try{o[Fi]=r;var v=!0}catch{}var x=sl.call(o);return v&&(u?o[Fi]=p:delete o[Fi]),x}var nb=fl?function(o){return o==null?[]:(o=Ue(o),di(fl(o),function(u){return To.call(o,u)}))}:_b,wx=fl?function(o){for(var u=[];o;)pi(u,nb(o)),o=ll(o);return u}:_b,ar=Xt;(uc&&ar(new uc(new ArrayBuffer(1)))!=Tn||Mo&&ar(new Mo)!=Yt||cc&&ar(cc.resolve())!=Dd||Es&&ar(new Es)!=gr||No&&ar(new No)!=Bt)&&(ar=function(o){var u=Xt(o),p=u==kn?o.constructor:r,v=p?Bo(p):"";if(v)switch(v){case dv:return Tn;case pv:return Yt;case hv:return Dd;case mv:return gr;case gv:return Bt}return u});function lM(o,u,p){for(var v=-1,x=p.length;++v<x;){var P=p[v],A=P.size;switch(P.type){case"drop":o+=A;break;case"dropRight":u-=A;break;case"take":u=Vt(u,o+A);break;case"takeRight":o=yt(o,u-A);break}}return{start:o,end:u}}function uM(o){var u=o.match(qn);return u?u[1].split(cn):[]}function _x(o,u,p){u=As(u,o);for(var v=-1,x=u.length,P=!1;++v<x;){var A=Un(u[v]);if(!(P=o!=null&&p(o,A)))break;o=o[A]}return P||++v!=x?P:(x=o==null?0:o.length,!!x&&Kp(x)&&Vi(A,x)&&(Re(o)||Vo(o)))}function cM(o){var u=o.length,p=new o.constructor(u);return u&&typeof o[0]=="string"&&Ze.call(o,"index")&&(p.index=o.index,p.input=o.input),p}function Rx(o){return typeof o.constructor=="function"&&!wc(o)?Is(ll(o)):{}}function fM(o,u,p){var v=o.constructor;switch(u){case qi:return Kv(o);case Gr:case Pr:return new v(+o);case Tn:return G$(o,p);case at:case Fa:case La:case ms:case yo:case gs:case fi:case ys:case Hu:return sx(o,p);case Yt:return new v;case mo:case go:return new v(o);case Kt:return Y$(o);case gr:return new v;case Da:return K$(o)}}function dM(o,u){var p=u.length;if(!p)return o;var v=p-1;return u[v]=(p>1?"& ":"")+u[v],u=u.join(p>2?", ":" "),o.replace(Qt,`{
|
|
2
2
|
/* [wrapped with `+u+`] */
|
|
3
|
-
`)}function pM(o){return Re(o)||Vo(o)||!!(yp&&o&&o[yp])}function Vi(o,u){var p=typeof o;return u=u??et,!!u&&(p=="number"||p!="symbol"&&vs.test(o))&&o>-1&&o%1==0&&o<u}function Rr(o,u,p){if(!Et(p))return!1;var v=typeof u;return(v=="number"?$r(p)&&Vi(u,p.length):v=="string"&&u in p)?Bn(p[u],o):!1}function ib(o,u){if(Re(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||Xr(o)?!0:Ae.test(o)||!kr.test(o)||u!=null&&o in Ue(u)}function hM(o){var u=typeof o;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?o!=="__proto__":o===null}function sb(o){var u=Bp(o),p=O[u];if(typeof p!="function"||!(u in $e.prototype))return!1;if(o===p)return!0;var v=tb(p);return!!v&&o===v[0]}function mM(o){return!!hp&&hp in o}var gM=ko?Wi:Rb;function _c(o){var u=o&&o.constructor,p=typeof u=="function"&&u.prototype||xs;return o===p}function Cx(o){return o===o&&!Et(o)}function xx(o,u){return function(p){return p==null?!1:p[o]===u&&(u!==r||o in Ue(p))}}function yM(o){var u=Yp(o,function(v){return p.size===f&&p.clear(),v}),p=u.cache;return u}function vM(o,u){var p=o[1],v=u[1],x=p|v,P=x<(R|I|X),A=v==X&&p==U||v==X&&p==T&&o[7].length<=u[8]||v==(X|T)&&u[7].length<=u[8]&&p==U;if(!(P||A))return o;v&R&&(o[2]=u[2],x|=p&R?0:q);var D=u[3];if(D){var H=o[3];o[3]=H?ax(H,D,u[4]):D,o[4]=H?dn(o[3],d):u[4]}return D=u[5],D&&(H=o[5],o[5]=H?lx(H,D,u[6]):D,o[6]=H?dn(o[5],d):u[6]),D=u[7],D&&(o[7]=D),v&X&&(o[8]=o[8]==null?u[8]:Vt(o[8],u[8])),o[9]==null&&(o[9]=u[9]),o[0]=u[0],o[1]=x,o}function bM(o){var u=[];if(o!=null)for(var p in Ue(o))u.push(p);return u}function SM(o){return sl.call(o)}function Ex(o,u,p){return u=yt(u===r?o.length-1:u,0),function(){for(var v=arguments,x=-1,P=yt(v.length-u,0),A=z(P);++x<P;)A[x]=v[u+x];x=-1;for(var D=z(u+1);++x<u;)D[x]=v[x];return D[u]=p(A),yr(o,this,D)}}function Ox(o,u){return u.length<2?o:Ui(o,gn(u,0,-1))}function wM(o,u){for(var p=o.length,v=Vt(u.length,p),x=Ar(o);v--;){var P=u[v];o[v]=Vi(P,p)?x[P]:r}return o}function ob(o,u){if(!(u==="constructor"&&typeof o[u]=="function")&&u!="__proto__")return o[u]}var Ix=kx(QC),Rc=uv||function(o,u){return Ft.setTimeout(o,u)},ab=kx(V$);function Px(o,u,p){var v=u+"";return ab(o,dM(v,_M(uM(v),p)))}function kx(o){var u=0,p=0;return function(){var v=bp(),x=$-(v-p);if(p=v,x>0){if(++u>=j)return arguments[0]}else u=0;return o.apply(r,arguments)}}function Wp(o,u){var p=-1,v=o.length,x=v-1;for(u=u===r?v:u;++p<u;){var P=Bv(p,x),A=o[P];o[P]=o[p],o[p]=A}return o.length=u,o}var Tx=yM(function(o){var u=[];return o.charCodeAt(0)===46&&u.push(""),o.replace(Vu,function(p,v,x,P){u.push(x?P.replace($n,"$1"):v||p)}),u});function Hn(o){if(typeof o=="string"||Xr(o))return o;var u=o+"";return u=="0"&&1/o==-pe?"-0":u}function Bo(o){if(o!=null){try{return il.call(o)}catch{}try{return o+""}catch{}}return""}function _M(o,u){return vr(ue,function(p){var v="_."+p[0];u&p[1]&&!Qa(o,v)&&o.push(v)}),o.sort()}function qx(o){if(o instanceof $e)return o.clone();var u=new sr(o.__wrapped__,o.__chain__);return u.__actions__=Ar(o.__actions__),u.__index__=o.__index__,u.__values__=o.__values__,u}function RM(o,u,p){(p?Rr(o,u,p):u===r)?u=1:u=yt(Ee(u),0);var v=o==null?0:o.length;if(!v||u<1)return[];for(var x=0,P=0,A=z(Ao(v/u));x<v;)A[P++]=gn(o,x,x+=u);return A}function CM(o){for(var u=-1,p=o==null?0:o.length,v=0,x=[];++u<p;){var P=o[u];P&&(x[v++]=P)}return x}function xM(){var o=arguments.length;if(!o)return[];for(var u=z(o-1),p=arguments[0],v=o;v--;)u[v-1]=arguments[v];return hi(Re(p)?Ar(p):[p],Wt(u,1))}var EM=Te(function(o,u){return Mt(o)?Lo(o,Wt(u,1,Mt,!0)):[]}),OM=Te(function(o,u){var p=yn(u);return Mt(p)&&(p=r),Mt(o)?Lo(o,Wt(u,1,Mt,!0),ge(p,2)):[]}),IM=Te(function(o,u){var p=yn(u);return Mt(p)&&(p=r),Mt(o)?Lo(o,Wt(u,1,Mt,!0),r,p):[]});function PM(o,u,p){var v=o==null?0:o.length;return v?(u=p||u===r?1:Ee(u),gn(o,u<0?0:u,v)):[]}function kM(o,u,p){var v=o==null?0:o.length;return v?(u=p||u===r?1:Ee(u),u=v-u,gn(o,0,u<0?0:u)):[]}function TM(o,u){return o&&o.length?Dp(o,ge(u,3),!0,!0):[]}function qM(o,u){return o&&o.length?Dp(o,ge(u,3),!0):[]}function AM(o,u,p,v){var x=o==null?0:o.length;return x?(p&&typeof p!="number"&&Rr(o,u,p)&&(p=0,v=x),Nv(o,u,p,v)):[]}function Ax(o,u,p){var v=o==null?0:o.length;if(!v)return-1;var x=p==null?0:Ee(p);return x<0&&(x=yt(v+x,0)),Xa(o,ge(u,3),x)}function $x(o,u,p){var v=o==null?0:o.length;if(!v)return-1;var x=v-1;return p!==r&&(x=Ee(p),x=p<0?yt(v+x,0):Vt(x,v-1)),Xa(o,ge(u,3),x,!0)}function Mx(o){var u=o==null?0:o.length;return u?Wt(o,1):[]}function $M(o){var u=o==null?0:o.length;return u?Wt(o,pe):[]}function MM(o,u){var p=o==null?0:o.length;return p?(u=u===r?1:Ee(u),Wt(o,u)):[]}function NM(o){for(var u=-1,p=o==null?0:o.length,v={};++u<p;){var x=o[u];Kr(v,x[0],x[1])}return v}function Nx(o){return o&&o.length?o[0]:r}function DM(o,u,p){var v=o==null?0:o.length;if(!v)return-1;var x=p==null?0:Ee(p);return x<0&&(x=yt(v+x,0)),Ni(o,u,x)}function FM(o){var u=o==null?0:o.length;return u?gn(o,0,-1):[]}var LM=Te(function(o){var u=ct(o,Gv);return u.length&&u[0]===o[0]?Qr(u):[]}),jM=Te(function(o){var u=yn(o),p=ct(o,Gv);return u===yn(p)?u=r:p.pop(),p.length&&p[0]===o[0]?Qr(p,ge(u,2)):[]}),UM=Te(function(o){var u=yn(o),p=ct(o,Gv);return u=typeof u=="function"?u:r,u&&p.pop(),p.length&&p[0]===o[0]?Qr(p,r,u):[]});function HM(o,u){return o==null?"":pl.call(o,u)}function yn(o){var u=o==null?0:o.length;return u?o[u-1]:r}function BM(o,u,p){var v=o==null?0:o.length;if(!v)return-1;var x=v;return p!==r&&(x=Ee(p),x=x<0?yt(v+x,0):Vt(x,v-1)),u===u?uc(o,u,x):Xa(o,Di,x,!0)}function VM(o,u){return o&&o.length?Un(o,Ee(u)):r}var WM=Te(Dx);function Dx(o,u){return o&&o.length&&u&&u.length?Hv(o,u):o}function zM(o,u,p){return o&&o.length&&u&&u.length?Hv(o,u,ge(p,2)):o}function JM(o,u,p){return o&&o.length&&u&&u.length?Hv(o,u,r,p):o}var GM=Bi(function(o,u){var p=o==null?0:o.length,v=mc(o,u);return KC(o,ct(u,function(x){return Vi(x,p)?+x:x}).sort(ox)),v});function YM(o,u){var p=[];if(!(o&&o.length))return p;var v=-1,x=[],P=o.length;for(u=ge(u,3);++v<P;){var A=o[v];u(A,v,o)&&(p.push(A),x.push(v))}return KC(o,x),p}function lb(o){return o==null?o:fv.call(o)}function KM(o,u,p){var v=o==null?0:o.length;return v?(p&&typeof p!="number"&&Rr(o,u,p)?(u=0,p=v):(u=u==null?0:Ee(u),p=p===r?v:Ee(p)),gn(o,u,p)):[]}function QM(o,u){return Np(o,u)}function ZM(o,u,p){return Wv(o,u,ge(p,2))}function XM(o,u){var p=o==null?0:o.length;if(p){var v=Np(o,u);if(v<p&&Bn(o[v],u))return v}return-1}function eN(o,u){return Np(o,u,!0)}function tN(o,u,p){return Wv(o,u,ge(p,2),!0)}function rN(o,u){var p=o==null?0:o.length;if(p){var v=Np(o,u,!0)-1;if(Bn(o[v],u))return v}return-1}function nN(o){return o&&o.length?ZC(o):[]}function iN(o,u){return o&&o.length?ZC(o,ge(u,2)):[]}function sN(o){var u=o==null?0:o.length;return u?gn(o,1,u):[]}function oN(o,u,p){return o&&o.length?(u=p||u===r?1:Ee(u),gn(o,0,u<0?0:u)):[]}function aN(o,u,p){var v=o==null?0:o.length;return v?(u=p||u===r?1:Ee(u),u=v-u,gn(o,u<0?0:u,v)):[]}function lN(o,u){return o&&o.length?Dp(o,ge(u,3),!1,!0):[]}function uN(o,u){return o&&o.length?Dp(o,ge(u,3)):[]}var cN=Te(function(o){return qs(Wt(o,1,Mt,!0))}),fN=Te(function(o){var u=yn(o);return Mt(u)&&(u=r),qs(Wt(o,1,Mt,!0),ge(u,2))}),dN=Te(function(o){var u=yn(o);return u=typeof u=="function"?u:r,qs(Wt(o,1,Mt,!0),r,u)});function pN(o){return o&&o.length?qs(o):[]}function hN(o,u){return o&&o.length?qs(o,ge(u,2)):[]}function mN(o,u){return u=typeof u=="function"?u:r,o&&o.length?qs(o,r,u):[]}function ub(o){if(!(o&&o.length))return[];var u=0;return o=pi(o,function(p){if(Mt(p))return u=yt(p.length,u),!0}),ac(u,function(p){return ct(o,Eo(p))})}function Fx(o,u){if(!(o&&o.length))return[];var p=ub(o);return u==null?p:ct(p,function(v){return yr(u,r,v)})}var gN=Te(function(o,u){return Mt(o)?Lo(o,u):[]}),yN=Te(function(o){return Jv(pi(o,Mt))}),vN=Te(function(o){var u=yn(o);return Mt(u)&&(u=r),Jv(pi(o,Mt),ge(u,2))}),bN=Te(function(o){var u=yn(o);return u=typeof u=="function"?u:r,Jv(pi(o,Mt),r,u)}),SN=Te(ub);function wN(o,u){return rx(o||[],u||[],_r)}function _N(o,u){return rx(o||[],u||[],Sc)}var RN=Te(function(o){var u=o.length,p=u>1?o[u-1]:r;return p=typeof p=="function"?(o.pop(),p):r,Fx(o,p)});function Lx(o){var u=O(o);return u.__chain__=!0,u}function CN(o,u){return u(o),o}function zp(o,u){return u(o)}var xN=Bi(function(o){var u=o.length,p=u?o[0]:0,v=this.__wrapped__,x=function(P){return mc(P,o)};return u>1||this.__actions__.length||!(v instanceof $e)||!Vi(p)?this.thru(x):(v=v.slice(p,+p+(u?1:0)),v.__actions__.push({func:zp,args:[x],thisArg:r}),new sr(v,this.__chain__).thru(function(P){return u&&!P.length&&P.push(r),P}))});function EN(){return Lx(this)}function ON(){return new sr(this.value(),this.__chain__)}function IN(){this.__values__===r&&(this.__values__=Xx(this.value()));var o=this.__index__>=this.__values__.length,u=o?r:this.__values__[this.__index__++];return{done:o,value:u}}function PN(){return this}function kN(o){for(var u,p=this;p instanceof gl;){var v=qx(p);v.__index__=0,v.__values__=r,u?x.__wrapped__=v:u=v;var x=v;p=p.__wrapped__}return x.__wrapped__=o,u}function TN(){var o=this.__wrapped__;if(o instanceof $e){var u=o;return this.__actions__.length&&(u=new $e(this)),u=u.reverse(),u.__actions__.push({func:zp,args:[lb],thisArg:r}),new sr(u,this.__chain__)}return this.thru(lb)}function qN(){return tx(this.__wrapped__,this.__actions__)}var AN=Fp(function(o,u,p){Ze.call(o,p)?++o[p]:Kr(o,p,1)});function $N(o,u,p){var v=Re(o)?op:Mv;return p&&Rr(o,u,p)&&(u=r),v(o,ge(u,3))}function MN(o,u){var p=Re(o)?pi:qp;return p(o,ge(u,3))}var NN=dx(Ax),DN=dx($x);function FN(o,u){return Wt(Jp(o,u),1)}function LN(o,u){return Wt(Jp(o,u),pe)}function jN(o,u,p){return p=p===r?1:Ee(p),Wt(Jp(o,u),p)}function jx(o,u){var p=Re(o)?vr:Si;return p(o,ge(u,3))}function Ux(o,u){var p=Re(o)?nc:Tp;return p(o,ge(u,3))}var UN=Fp(function(o,u,p){Ze.call(o,p)?o[p].push(u):Kr(o,p,[u])});function HN(o,u,p,v){o=$r(o)?o:xl(o),p=p&&!v?Ee(p):0;var x=o.length;return p<0&&(p=yt(x+p,0)),Zp(o)?p<=x&&o.indexOf(u,p)>-1:!!x&&Ni(o,u,p)>-1}var BN=Te(function(o,u,p){var v=-1,x=typeof u=="function",P=$r(o)?z(o.length):[];return Si(o,function(A){P[++v]=x?yr(u,A,p):jo(A,u,p)}),P}),VN=Fp(function(o,u,p){Kr(o,p,u)});function Jp(o,u){var p=Re(o)?ct:oe;return p(o,ge(u,3))}function WN(o,u,p,v){return o==null?[]:(Re(u)||(u=u==null?[]:[u]),p=v?r:p,Re(p)||(p=p==null?[]:[p]),GC(o,u,p))}var zN=Fp(function(o,u,p){o[p?0:1].push(u)},function(){return[[],[]]});function JN(o,u,p){var v=Re(o)?ic:el,x=arguments.length<3;return v(o,ge(u,4),p,x,Si)}function GN(o,u,p){var v=Re(o)?Dy:el,x=arguments.length<3;return v(o,ge(u,4),p,x,Tp)}function YN(o,u){var p=Re(o)?pi:qp;return p(o,Kp(ge(u,3)))}function KN(o){var u=Re(o)?Ip:H$;return u(o)}function QN(o,u,p){(p?Rr(o,u,p):u===r)?u=1:u=Ee(u);var v=Re(o)?Tv:B$;return v(o,u)}function ZN(o){var u=Re(o)?qv:W$;return u(o)}function XN(o){if(o==null)return 0;if($r(o))return Zp(o)?mi(o):o.length;var u=ar(o);return u==Yt||u==gr?o.size:E(o).length}function eD(o,u,p){var v=Re(o)?Za:z$;return p&&Rr(o,u,p)&&(u=r),v(o,ge(u,3))}var tD=Te(function(o,u){if(o==null)return[];var p=u.length;return p>1&&Rr(o,u[0],u[1])?u=[]:p>2&&Rr(u[0],u[1],u[2])&&(u=[u[0]]),GC(o,Wt(u,1),[])}),Gp=lv||function(){return Ft.Date.now()};function rD(o,u){if(typeof u!="function")throw new wr(i);return o=Ee(o),function(){if(--o<1)return u.apply(this,arguments)}}function Hx(o,u,p){return u=p?r:u,u=o&&u==null?o.length:u,Hi(o,X,r,r,r,r,u)}function Bx(o,u){var p;if(typeof u!="function")throw new wr(i);return o=Ee(o),function(){return--o>0&&(p=u.apply(this,arguments)),o<=1&&(u=r),p}}var cb=Te(function(o,u,p){var v=R;if(p.length){var x=dn(p,Rl(cb));v|=V}return Hi(o,v,u,p,x)}),Vx=Te(function(o,u,p){var v=R|I;if(p.length){var x=dn(p,Rl(Vx));v|=V}return Hi(u,v,o,p,x)});function Wx(o,u,p){u=p?r:u;var v=Hi(o,U,r,r,r,r,r,u);return v.placeholder=Wx.placeholder,v}function zx(o,u,p){u=p?r:u;var v=Hi(o,B,r,r,r,r,r,u);return v.placeholder=zx.placeholder,v}function Jx(o,u,p){var v,x,P,A,D,H,Q=0,Z=!1,ee=!1,ie=!0;if(typeof o!="function")throw new wr(i);u=vn(u)||0,Et(p)&&(Z=!!p.leading,ee="maxWait"in p,P=ee?yt(vn(p.maxWait)||0,u):P,ie="trailing"in p?!!p.trailing:ie);function ce(Nt){var Vn=v,Ji=x;return v=x=r,Q=Nt,A=o.apply(Ji,Vn),A}function ye(Nt){return Q=Nt,D=Rc(Le,u),Z?ce(Nt):A}function Ie(Nt){var Vn=Nt-H,Ji=Nt-Q,pE=u-Vn;return ee?Vt(pE,P-Ji):pE}function me(Nt){var Vn=Nt-H,Ji=Nt-Q;return H===r||Vn>=u||Vn<0||ee&&Ji>=P}function Le(){var Nt=Gp();if(me(Nt))return He(Nt);D=Rc(Le,Ie(Nt))}function He(Nt){return D=r,ie&&v?ce(Nt):(v=x=r,A)}function en(){D!==r&&nx(D),Q=0,v=H=x=D=r}function Cr(){return D===r?A:He(Gp())}function tn(){var Nt=Gp(),Vn=me(Nt);if(v=arguments,x=this,H=Nt,Vn){if(D===r)return ye(H);if(ee)return nx(D),D=Rc(Le,u),ce(H)}return D===r&&(D=Rc(Le,u)),A}return tn.cancel=en,tn.flush=Cr,tn}var nD=Te(function(o,u){return gc(o,1,u)}),iD=Te(function(o,u,p){return gc(o,vn(u)||0,p)});function sD(o){return Hi(o,C)}function Yp(o,u){if(typeof o!="function"||u!=null&&typeof u!="function")throw new wr(i);var p=function(){var v=arguments,x=u?u.apply(this,v):v[0],P=p.cache;if(P.has(x))return P.get(x);var A=o.apply(this,v);return p.cache=P.set(x,A)||P,A};return p.cache=new(Yp.Cache||Fn),p}Yp.Cache=Fn;function Kp(o){if(typeof o!="function")throw new wr(i);return function(){var u=arguments;switch(u.length){case 0:return!o.call(this);case 1:return!o.call(this,u[0]);case 2:return!o.call(this,u[0],u[1]);case 3:return!o.call(this,u[0],u[1],u[2])}return!o.apply(this,u)}}function oD(o){return Bx(2,o)}var aD=J$(function(o,u){u=u.length==1&&Re(u[0])?ct(u[0],br(ge())):ct(Wt(u,1),br(ge()));var p=u.length;return Te(function(v){for(var x=-1,P=Vt(v.length,p);++x<P;)v[x]=u[x].call(this,v[x]);return yr(o,this,v)})}),fb=Te(function(o,u){var p=dn(u,Rl(fb));return Hi(o,V,r,u,p)}),Gx=Te(function(o,u){var p=dn(u,Rl(Gx));return Hi(o,W,r,u,p)}),lD=Bi(function(o,u){return Hi(o,T,r,r,r,u)});function uD(o,u){if(typeof o!="function")throw new wr(i);return u=u===r?u:Ee(u),Te(o,u)}function cD(o,u){if(typeof o!="function")throw new wr(i);return u=u==null?0:yt(Ee(u),0),Te(function(p){var v=p[u],x=$s(p,0,u);return v&&hi(x,v),yr(o,this,x)})}function fD(o,u,p){var v=!0,x=!0;if(typeof o!="function")throw new wr(i);return Et(p)&&(v="leading"in p?!!p.leading:v,x="trailing"in p?!!p.trailing:x),Jx(o,u,{leading:v,maxWait:u,trailing:x})}function dD(o){return Hx(o,1)}function pD(o,u){return fb(Yv(u),o)}function hD(){if(!arguments.length)return[];var o=arguments[0];return Re(o)?o:[o]}function mD(o){return or(o,y)}function gD(o,u){return u=typeof u=="function"?u:r,or(o,y,u)}function yD(o){return or(o,h|y)}function vD(o,u){return u=typeof u=="function"?u:r,or(o,h|y,u)}function bD(o,u){return u==null||hn(o,u,Zt(u))}function Bn(o,u){return o===u||o!==o&&u!==u}var SD=Hp(vc),wD=Hp(function(o,u){return o>=u}),Vo=Mp((function(){return arguments})())?Mp:function(o){return Pt(o)&&Ze.call(o,"callee")&&!To.call(o,"callee")},Re=z.isArray,_D=rc?br(rc):jv;function $r(o){return o!=null&&Qp(o.length)&&!Wi(o)}function Mt(o){return Pt(o)&&$r(o)}function RD(o){return o===!0||o===!1||Pt(o)&&Xt(o)==Gr}var Ms=dl||Rb,CD=ip?br(ip):Uv;function xD(o){return Pt(o)&&o.nodeType===1&&!Cc(o)}function ED(o){if(o==null)return!0;if($r(o)&&(Re(o)||typeof o=="string"||typeof o.splice=="function"||Ms(o)||Cl(o)||Vo(o)))return!o.length;var u=ar(o);if(u==Yt||u==gr)return!o.size;if(_c(o))return!E(o).length;for(var p in o)if(Ze.call(o,p))return!1;return!0}function OD(o,u){return Uo(o,u)}function ID(o,u,p){p=typeof p=="function"?p:r;var v=p?p(o,u):r;return v===r?Uo(o,u,r,p):!!v}function db(o){if(!Pt(o))return!1;var u=Xt(o);return u==gt||u==mt||typeof o.message=="string"&&typeof o.name=="string"&&!Cc(o)}function PD(o){return typeof o=="number"&&Li(o)}function Wi(o){if(!Et(o))return!1;var u=Xt(o);return u==ln||u==ho||u==Ct||u==Ld}function Yx(o){return typeof o=="number"&&o==Ee(o)}function Qp(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=et}function Et(o){var u=typeof o;return o!=null&&(u=="object"||u=="function")}function Pt(o){return o!=null&&typeof o=="object"}var Kx=sp?br(sp):ks;function kD(o,u){return o===u||Ts(o,u,rb(u))}function TD(o,u,p){return p=typeof p=="function"?p:r,Ts(o,u,rb(u),p)}function qD(o){return Qx(o)&&o!=+o}function AD(o){if(gM(o))throw new be(n);return Fe(o)}function $D(o){return o===null}function MD(o){return o==null}function Qx(o){return typeof o=="number"||Pt(o)&&Xt(o)==mo}function Cc(o){if(!Pt(o)||Xt(o)!=Tn)return!1;var u=ll(o);if(u===null)return!0;var p=Ze.call(u,"constructor")&&u.constructor;return typeof p=="function"&&p instanceof p&&il.call(p)==iv}var pb=xo?br(xo):c;function ND(o){return Yx(o)&&o>=-et&&o<=et}var Zx=Mn?br(Mn):m;function Zp(o){return typeof o=="string"||!Re(o)&&Pt(o)&&Xt(o)==go}function Xr(o){return typeof o=="symbol"||Pt(o)&&Xt(o)==Da}var Cl=Ka?br(Ka):b;function DD(o){return o===r}function FD(o){return Pt(o)&&ar(o)==Bt}function LD(o){return Pt(o)&&Xt(o)==Ud}var jD=Hp(J),UD=Hp(function(o,u){return o<=u});function Xx(o){if(!o)return[];if($r(o))return Zp(o)?Sr(o):Ar(o);if(qo&&o[qo])return Gy(o[qo]());var u=ar(o),p=u==Yt?Cs:u==gr?rl:xl;return p(o)}function zi(o){if(!o)return o===0?o:0;if(o=vn(o),o===pe||o===-pe){var u=o<0?-1:1;return u*_e}return o===o?o:0}function Ee(o){var u=zi(o),p=u%1;return u===u?p?u-p:u:0}function eE(o){return o?bi(Ee(o),0,xe):0}function vn(o){if(typeof o=="number")return o;if(Xr(o))return he;if(Et(o)){var u=typeof o.valueOf=="function"?o.valueOf():o;o=Et(u)?u+"":u}if(typeof o!="string")return o===0?o:+o;o=lc(o);var p=So.test(o);return p||py.test(o)?My(o.slice(2),p?2:8):dy.test(o)?he:+o}function tE(o){return wi(o,Mr(o))}function HD(o){return o?bi(Ee(o),-et,et):o===0?o:0}function nt(o){return o==null?"":Zr(o)}var BD=wl(function(o,u){if(_c(u)||$r(u)){wi(u,Zt(u),o);return}for(var p in u)Ze.call(u,p)&&_r(o,p,u[p])}),rE=wl(function(o,u){wi(u,Mr(u),o)}),nE=wl(function(o,u,p,v){wi(u,Mr(u),o,v)}),hb=wl(function(o,u,p,v){wi(u,Zt(u),o,v)}),VD=Bi(mc);function WD(o,u){var p=Is(o);return u==null?p:kp(p,u)}var zD=Te(function(o,u){o=Ue(o);var p=-1,v=u.length,x=v>2?u[2]:r;for(x&&Rr(u[0],u[1],x)&&(v=1);++p<v;)for(var P=u[p],A=Mr(P),D=-1,H=A.length;++D<H;){var Q=A[D],Z=o[Q];(Z===r||Bn(Z,xs[Q])&&!Ze.call(o,Q))&&(o[Q]=P[Q])}return o}),JD=Te(function(o){return o.push(r,bx),yr(iE,r,o)});function GD(o,u){return ap(o,ge(u,3),mn)}function YD(o,u){return ap(o,ge(u,3),Ln)}function KD(o,u){return o==null?o:yc(o,ge(u,3),Mr)}function QD(o,u){return o==null?o:Ap(o,ge(u,3),Mr)}function ZD(o,u){return o&&mn(o,ge(u,3))}function XD(o,u){return o&&Ln(o,ge(u,3))}function eF(o){return o==null?[]:Sl(o,Zt(o))}function tF(o){return o==null?[]:Sl(o,Mr(o))}function mb(o,u,p){var v=o==null?r:Ui(o,u);return v===r?p:v}function rF(o,u){return o!=null&&_x(o,u,Dv)}function gb(o,u){return o!=null&&_x(o,u,Fv)}var nF=hx(function(o,u,p){u!=null&&typeof u.toString!="function"&&(u=sl.call(u)),o[u]=p},vb(Nr)),iF=hx(function(o,u,p){u!=null&&typeof u.toString!="function"&&(u=sl.call(u)),Ze.call(o,u)?o[u].push(p):o[u]=[p]},ge),sF=Te(jo);function Zt(o){return $r(o)?Op(o):E(o)}function Mr(o){return $r(o)?Op(o,!0):M(o)}function oF(o,u){var p={};return u=ge(u,3),mn(o,function(v,x,P){Kr(p,u(v,x,P),v)}),p}function aF(o,u){var p={};return u=ge(u,3),mn(o,function(v,x,P){Kr(p,x,u(v,x,P))}),p}var lF=wl(function(o,u,p){Lt(o,u,p)}),iE=wl(function(o,u,p,v){Lt(o,u,p,v)}),uF=Bi(function(o,u){var p={};if(o==null)return p;var v=!1;u=ct(u,function(P){return P=As(P,o),v||(v=P.length>1),P}),wi(o,eb(o),p),v&&(p=or(p,h|g|y,iM));for(var x=u.length;x--;)zv(p,u[x]);return p});function cF(o,u){return sE(o,Kp(ge(u)))}var fF=Bi(function(o,u){return o==null?{}:L$(o,u)});function sE(o,u){if(o==null)return{};var p=ct(eb(o),function(v){return[v]});return u=ge(u),YC(o,p,function(v,x){return u(v,x[0])})}function dF(o,u,p){u=As(u,o);var v=-1,x=u.length;for(x||(x=1,o=r);++v<x;){var P=o==null?r:o[Hn(u[v])];P===r&&(v=x,P=p),o=Wi(P)?P.call(o):P}return o}function pF(o,u,p){return o==null?o:Sc(o,u,p)}function hF(o,u,p,v){return v=typeof v=="function"?v:r,o==null?o:Sc(o,u,p,v)}var oE=yx(Zt),aE=yx(Mr);function mF(o,u,p){var v=Re(o),x=v||Ms(o)||Cl(o);if(u=ge(u,4),p==null){var P=o&&o.constructor;x?p=v?new P:[]:Et(o)?p=Wi(P)?Is(ll(o)):{}:p={}}return(x?vr:mn)(o,function(A,D,H){return u(p,A,D,H)}),p}function gF(o,u){return o==null?!0:zv(o,u)}function yF(o,u,p){return o==null?o:ex(o,u,Yv(p))}function vF(o,u,p,v){return v=typeof v=="function"?v:r,o==null?o:ex(o,u,Yv(p),v)}function xl(o){return o==null?[]:tl(o,Zt(o))}function bF(o){return o==null?[]:tl(o,Mr(o))}function SF(o,u,p){return p===r&&(p=u,u=r),p!==r&&(p=vn(p),p=p===p?p:0),u!==r&&(u=vn(u),u=u===u?u:0),bi(vn(o),u,p)}function wF(o,u,p){return u=zi(u),p===r?(p=u,u=0):p=zi(p),o=vn(o),Lv(o,u,p)}function _F(o,u,p){if(p&&typeof p!="boolean"&&Rr(o,u,p)&&(u=p=r),p===r&&(typeof u=="boolean"?(p=u,u=r):typeof o=="boolean"&&(p=o,o=r)),o===r&&u===r?(o=0,u=1):(o=zi(o),u===r?(u=o,o=0):u=zi(u)),o>u){var v=o;o=u,u=v}if(p||o%1||u%1){var x=Sp();return Vt(o+x*(u-o+rp("1e-"+((x+"").length-1))),u)}return Bv(o,u)}var RF=_l(function(o,u,p){return u=u.toLowerCase(),o+(p?lE(u):u)});function lE(o){return yb(nt(o).toLowerCase())}function uE(o){return o=nt(o),o&&o.replace(wo,Vy).replace(Iy,"")}function CF(o,u,p){o=nt(o),u=Zr(u);var v=o.length;p=p===r?v:bi(Ee(p),0,v);var x=p;return p-=u.length,p>=0&&o.slice(p,x)==u}function xF(o){return o=nt(o),o&&le.test(o)?o.replace(Ua,Wy):o}function EF(o){return o=nt(o),o&&bo.test(o)?o.replace(Ke,"\\$&"):o}var OF=_l(function(o,u,p){return o+(p?"-":"")+u.toLowerCase()}),IF=_l(function(o,u,p){return o+(p?" ":"")+u.toLowerCase()}),PF=fx("toLowerCase");function kF(o,u,p){o=nt(o),u=Ee(u);var v=u?mi(o):0;if(!u||v>=u)return o;var x=(u-v)/2;return Up($o(x),p)+o+Up(Ao(x),p)}function TF(o,u,p){o=nt(o),u=Ee(u);var v=u?mi(o):0;return u&&v<u?o+Up(u-v,p):o}function qF(o,u,p){o=nt(o),u=Ee(u);var v=u?mi(o):0;return u&&v<u?Up(u-v,p)+o:o}function AF(o,u,p){return p||u==null?u=0:u&&(u=+u),cv(nt(o).replace(Wu,""),u||0)}function $F(o,u,p){return(p?Rr(o,u,p):u===r)?u=1:u=Ee(u),Vv(nt(o),u)}function MF(){var o=arguments,u=nt(o[0]);return o.length<3?u:u.replace(o[1],o[2])}var NF=_l(function(o,u,p){return o+(p?"_":"")+u.toLowerCase()});function DF(o,u,p){return p&&typeof p!="number"&&Rr(o,u,p)&&(u=p=r),p=p===r?xe:p>>>0,p?(o=nt(o),o&&(typeof u=="string"||u!=null&&!pb(u))&&(u=Zr(u),!u&&Rs(o))?$s(Sr(o),0,p):o.split(u,p)):[]}var FF=_l(function(o,u,p){return o+(p?" ":"")+yb(u)});function LF(o,u,p){return o=nt(o),p=p==null?0:bi(Ee(p),0,o.length),u=Zr(u),o.slice(p,p+u.length)==u}function jF(o,u,p){var v=O.templateSettings;p&&Rr(o,u,p)&&(u=r),o=nt(o),u=hb({},u,v,vx);var x=hb({},u.imports,v.imports,vx),P=Zt(x),A=tl(x,P);vr(P,function(me){if(Tr.test(me))throw new be(a)});var D,H,Q=0,Z=u.interpolate||_o,ee="__p += '",ie=nl((u.escape||_o).source+"|"+Z.source+"|"+(Z===un?$i:_o).source+"|"+(u.evaluate||_o).source+"|$","g"),ce="//# sourceURL="+(Ze.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ay+"]")+`
|
|
3
|
+
`)}function pM(o){return Re(o)||Vo(o)||!!(gp&&o&&o[gp])}function Vi(o,u){var p=typeof o;return u=u??et,!!u&&(p=="number"||p!="symbol"&&vs.test(o))&&o>-1&&o%1==0&&o<u}function Rr(o,u,p){if(!Et(p))return!1;var v=typeof u;return(v=="number"?$r(p)&&Vi(u,p.length):v=="string"&&u in p)?Hn(p[u],o):!1}function ib(o,u){if(Re(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||Xr(o)?!0:Ae.test(o)||!kr.test(o)||u!=null&&o in Ue(u)}function hM(o){var u=typeof o;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?o!=="__proto__":o===null}function sb(o){var u=Hp(o),p=O[u];if(typeof p!="function"||!(u in $e.prototype))return!1;if(o===p)return!0;var v=tb(p);return!!v&&o===v[0]}function mM(o){return!!pp&&pp in o}var gM=ko?Wi:Rb;function wc(o){var u=o&&o.constructor,p=typeof u=="function"&&u.prototype||xs;return o===p}function Cx(o){return o===o&&!Et(o)}function xx(o,u){return function(p){return p==null?!1:p[o]===u&&(u!==r||o in Ue(p))}}function yM(o){var u=Gp(o,function(v){return p.size===f&&p.clear(),v}),p=u.cache;return u}function vM(o,u){var p=o[1],v=u[1],x=p|v,P=x<(R|I|X),A=v==X&&p==j||v==X&&p==T&&o[7].length<=u[8]||v==(X|T)&&u[7].length<=u[8]&&p==j;if(!(P||A))return o;v&R&&(o[2]=u[2],x|=p&R?0:q);var D=u[3];if(D){var H=o[3];o[3]=H?ax(H,D,u[4]):D,o[4]=H?dn(o[3],d):u[4]}return D=u[5],D&&(H=o[5],o[5]=H?lx(H,D,u[6]):D,o[6]=H?dn(o[5],d):u[6]),D=u[7],D&&(o[7]=D),v&X&&(o[8]=o[8]==null?u[8]:Vt(o[8],u[8])),o[9]==null&&(o[9]=u[9]),o[0]=u[0],o[1]=x,o}function bM(o){var u=[];if(o!=null)for(var p in Ue(o))u.push(p);return u}function SM(o){return sl.call(o)}function Ex(o,u,p){return u=yt(u===r?o.length-1:u,0),function(){for(var v=arguments,x=-1,P=yt(v.length-u,0),A=z(P);++x<P;)A[x]=v[u+x];x=-1;for(var D=z(u+1);++x<u;)D[x]=v[x];return D[u]=p(A),yr(o,this,D)}}function Ox(o,u){return u.length<2?o:Ui(o,gn(u,0,-1))}function wM(o,u){for(var p=o.length,v=Vt(u.length,p),x=Ar(o);v--;){var P=u[v];o[v]=Vi(P,p)?x[P]:r}return o}function ob(o,u){if(!(u==="constructor"&&typeof o[u]=="function")&&u!="__proto__")return o[u]}var Ix=kx(QC),_c=uv||function(o,u){return Ft.setTimeout(o,u)},ab=kx(V$);function Px(o,u,p){var v=u+"";return ab(o,dM(v,_M(uM(v),p)))}function kx(o){var u=0,p=0;return function(){var v=vp(),x=$-(v-p);if(p=v,x>0){if(++u>=U)return arguments[0]}else u=0;return o.apply(r,arguments)}}function Vp(o,u){var p=-1,v=o.length,x=v-1;for(u=u===r?v:u;++p<u;){var P=Bv(p,x),A=o[P];o[P]=o[p],o[p]=A}return o.length=u,o}var Tx=yM(function(o){var u=[];return o.charCodeAt(0)===46&&u.push(""),o.replace(Bu,function(p,v,x,P){u.push(x?P.replace(An,"$1"):v||p)}),u});function Un(o){if(typeof o=="string"||Xr(o))return o;var u=o+"";return u=="0"&&1/o==-pe?"-0":u}function Bo(o){if(o!=null){try{return il.call(o)}catch{}try{return o+""}catch{}}return""}function _M(o,u){return vr(ue,function(p){var v="_."+p[0];u&p[1]&&!Qa(o,v)&&o.push(v)}),o.sort()}function qx(o){if(o instanceof $e)return o.clone();var u=new sr(o.__wrapped__,o.__chain__);return u.__actions__=Ar(o.__actions__),u.__index__=o.__index__,u.__values__=o.__values__,u}function RM(o,u,p){(p?Rr(o,u,p):u===r)?u=1:u=yt(Ee(u),0);var v=o==null?0:o.length;if(!v||u<1)return[];for(var x=0,P=0,A=z(Ao(v/u));x<v;)A[P++]=gn(o,x,x+=u);return A}function CM(o){for(var u=-1,p=o==null?0:o.length,v=0,x=[];++u<p;){var P=o[u];P&&(x[v++]=P)}return x}function xM(){var o=arguments.length;if(!o)return[];for(var u=z(o-1),p=arguments[0],v=o;v--;)u[v-1]=arguments[v];return pi(Re(p)?Ar(p):[p],Wt(u,1))}var EM=Te(function(o,u){return Mt(o)?Lo(o,Wt(u,1,Mt,!0)):[]}),OM=Te(function(o,u){var p=yn(u);return Mt(p)&&(p=r),Mt(o)?Lo(o,Wt(u,1,Mt,!0),ge(p,2)):[]}),IM=Te(function(o,u){var p=yn(u);return Mt(p)&&(p=r),Mt(o)?Lo(o,Wt(u,1,Mt,!0),r,p):[]});function PM(o,u,p){var v=o==null?0:o.length;return v?(u=p||u===r?1:Ee(u),gn(o,u<0?0:u,v)):[]}function kM(o,u,p){var v=o==null?0:o.length;return v?(u=p||u===r?1:Ee(u),u=v-u,gn(o,0,u<0?0:u)):[]}function TM(o,u){return o&&o.length?Np(o,ge(u,3),!0,!0):[]}function qM(o,u){return o&&o.length?Np(o,ge(u,3),!0):[]}function AM(o,u,p,v){var x=o==null?0:o.length;return x?(p&&typeof p!="number"&&Rr(o,u,p)&&(p=0,v=x),Nv(o,u,p,v)):[]}function Ax(o,u,p){var v=o==null?0:o.length;if(!v)return-1;var x=p==null?0:Ee(p);return x<0&&(x=yt(v+x,0)),Xa(o,ge(u,3),x)}function $x(o,u,p){var v=o==null?0:o.length;if(!v)return-1;var x=v-1;return p!==r&&(x=Ee(p),x=p<0?yt(v+x,0):Vt(x,v-1)),Xa(o,ge(u,3),x,!0)}function Mx(o){var u=o==null?0:o.length;return u?Wt(o,1):[]}function $M(o){var u=o==null?0:o.length;return u?Wt(o,pe):[]}function MM(o,u){var p=o==null?0:o.length;return p?(u=u===r?1:Ee(u),Wt(o,u)):[]}function NM(o){for(var u=-1,p=o==null?0:o.length,v={};++u<p;){var x=o[u];Kr(v,x[0],x[1])}return v}function Nx(o){return o&&o.length?o[0]:r}function DM(o,u,p){var v=o==null?0:o.length;if(!v)return-1;var x=p==null?0:Ee(p);return x<0&&(x=yt(v+x,0)),Ni(o,u,x)}function FM(o){var u=o==null?0:o.length;return u?gn(o,0,-1):[]}var LM=Te(function(o){var u=ct(o,Gv);return u.length&&u[0]===o[0]?Qr(u):[]}),jM=Te(function(o){var u=yn(o),p=ct(o,Gv);return u===yn(p)?u=r:p.pop(),p.length&&p[0]===o[0]?Qr(p,ge(u,2)):[]}),UM=Te(function(o){var u=yn(o),p=ct(o,Gv);return u=typeof u=="function"?u:r,u&&p.pop(),p.length&&p[0]===o[0]?Qr(p,r,u):[]});function HM(o,u){return o==null?"":pl.call(o,u)}function yn(o){var u=o==null?0:o.length;return u?o[u-1]:r}function BM(o,u,p){var v=o==null?0:o.length;if(!v)return-1;var x=v;return p!==r&&(x=Ee(p),x=x<0?yt(v+x,0):Vt(x,v-1)),u===u?lc(o,u,x):Xa(o,Di,x,!0)}function VM(o,u){return o&&o.length?jn(o,Ee(u)):r}var WM=Te(Dx);function Dx(o,u){return o&&o.length&&u&&u.length?Hv(o,u):o}function zM(o,u,p){return o&&o.length&&u&&u.length?Hv(o,u,ge(p,2)):o}function JM(o,u,p){return o&&o.length&&u&&u.length?Hv(o,u,r,p):o}var GM=Bi(function(o,u){var p=o==null?0:o.length,v=hc(o,u);return KC(o,ct(u,function(x){return Vi(x,p)?+x:x}).sort(ox)),v});function YM(o,u){var p=[];if(!(o&&o.length))return p;var v=-1,x=[],P=o.length;for(u=ge(u,3);++v<P;){var A=o[v];u(A,v,o)&&(p.push(A),x.push(v))}return KC(o,x),p}function lb(o){return o==null?o:fv.call(o)}function KM(o,u,p){var v=o==null?0:o.length;return v?(p&&typeof p!="number"&&Rr(o,u,p)?(u=0,p=v):(u=u==null?0:Ee(u),p=p===r?v:Ee(p)),gn(o,u,p)):[]}function QM(o,u){return Mp(o,u)}function ZM(o,u,p){return Wv(o,u,ge(p,2))}function XM(o,u){var p=o==null?0:o.length;if(p){var v=Mp(o,u);if(v<p&&Hn(o[v],u))return v}return-1}function eN(o,u){return Mp(o,u,!0)}function tN(o,u,p){return Wv(o,u,ge(p,2),!0)}function rN(o,u){var p=o==null?0:o.length;if(p){var v=Mp(o,u,!0)-1;if(Hn(o[v],u))return v}return-1}function nN(o){return o&&o.length?ZC(o):[]}function iN(o,u){return o&&o.length?ZC(o,ge(u,2)):[]}function sN(o){var u=o==null?0:o.length;return u?gn(o,1,u):[]}function oN(o,u,p){return o&&o.length?(u=p||u===r?1:Ee(u),gn(o,0,u<0?0:u)):[]}function aN(o,u,p){var v=o==null?0:o.length;return v?(u=p||u===r?1:Ee(u),u=v-u,gn(o,u<0?0:u,v)):[]}function lN(o,u){return o&&o.length?Np(o,ge(u,3),!1,!0):[]}function uN(o,u){return o&&o.length?Np(o,ge(u,3)):[]}var cN=Te(function(o){return qs(Wt(o,1,Mt,!0))}),fN=Te(function(o){var u=yn(o);return Mt(u)&&(u=r),qs(Wt(o,1,Mt,!0),ge(u,2))}),dN=Te(function(o){var u=yn(o);return u=typeof u=="function"?u:r,qs(Wt(o,1,Mt,!0),r,u)});function pN(o){return o&&o.length?qs(o):[]}function hN(o,u){return o&&o.length?qs(o,ge(u,2)):[]}function mN(o,u){return u=typeof u=="function"?u:r,o&&o.length?qs(o,r,u):[]}function ub(o){if(!(o&&o.length))return[];var u=0;return o=di(o,function(p){if(Mt(p))return u=yt(p.length,u),!0}),oc(u,function(p){return ct(o,Eo(p))})}function Fx(o,u){if(!(o&&o.length))return[];var p=ub(o);return u==null?p:ct(p,function(v){return yr(u,r,v)})}var gN=Te(function(o,u){return Mt(o)?Lo(o,u):[]}),yN=Te(function(o){return Jv(di(o,Mt))}),vN=Te(function(o){var u=yn(o);return Mt(u)&&(u=r),Jv(di(o,Mt),ge(u,2))}),bN=Te(function(o){var u=yn(o);return u=typeof u=="function"?u:r,Jv(di(o,Mt),r,u)}),SN=Te(ub);function wN(o,u){return rx(o||[],u||[],_r)}function _N(o,u){return rx(o||[],u||[],bc)}var RN=Te(function(o){var u=o.length,p=u>1?o[u-1]:r;return p=typeof p=="function"?(o.pop(),p):r,Fx(o,p)});function Lx(o){var u=O(o);return u.__chain__=!0,u}function CN(o,u){return u(o),o}function Wp(o,u){return u(o)}var xN=Bi(function(o){var u=o.length,p=u?o[0]:0,v=this.__wrapped__,x=function(P){return hc(P,o)};return u>1||this.__actions__.length||!(v instanceof $e)||!Vi(p)?this.thru(x):(v=v.slice(p,+p+(u?1:0)),v.__actions__.push({func:Wp,args:[x],thisArg:r}),new sr(v,this.__chain__).thru(function(P){return u&&!P.length&&P.push(r),P}))});function EN(){return Lx(this)}function ON(){return new sr(this.value(),this.__chain__)}function IN(){this.__values__===r&&(this.__values__=Xx(this.value()));var o=this.__index__>=this.__values__.length,u=o?r:this.__values__[this.__index__++];return{done:o,value:u}}function PN(){return this}function kN(o){for(var u,p=this;p instanceof gl;){var v=qx(p);v.__index__=0,v.__values__=r,u?x.__wrapped__=v:u=v;var x=v;p=p.__wrapped__}return x.__wrapped__=o,u}function TN(){var o=this.__wrapped__;if(o instanceof $e){var u=o;return this.__actions__.length&&(u=new $e(this)),u=u.reverse(),u.__actions__.push({func:Wp,args:[lb],thisArg:r}),new sr(u,this.__chain__)}return this.thru(lb)}function qN(){return tx(this.__wrapped__,this.__actions__)}var AN=Dp(function(o,u,p){Ze.call(o,p)?++o[p]:Kr(o,p,1)});function $N(o,u,p){var v=Re(o)?sp:Mv;return p&&Rr(o,u,p)&&(u=r),v(o,ge(u,3))}function MN(o,u){var p=Re(o)?di:Tp;return p(o,ge(u,3))}var NN=dx(Ax),DN=dx($x);function FN(o,u){return Wt(zp(o,u),1)}function LN(o,u){return Wt(zp(o,u),pe)}function jN(o,u,p){return p=p===r?1:Ee(p),Wt(zp(o,u),p)}function jx(o,u){var p=Re(o)?vr:bi;return p(o,ge(u,3))}function Ux(o,u){var p=Re(o)?rc:kp;return p(o,ge(u,3))}var UN=Dp(function(o,u,p){Ze.call(o,p)?o[p].push(u):Kr(o,p,[u])});function HN(o,u,p,v){o=$r(o)?o:xl(o),p=p&&!v?Ee(p):0;var x=o.length;return p<0&&(p=yt(x+p,0)),Qp(o)?p<=x&&o.indexOf(u,p)>-1:!!x&&Ni(o,u,p)>-1}var BN=Te(function(o,u,p){var v=-1,x=typeof u=="function",P=$r(o)?z(o.length):[];return bi(o,function(A){P[++v]=x?yr(u,A,p):jo(A,u,p)}),P}),VN=Dp(function(o,u,p){Kr(o,p,u)});function zp(o,u){var p=Re(o)?ct:oe;return p(o,ge(u,3))}function WN(o,u,p,v){return o==null?[]:(Re(u)||(u=u==null?[]:[u]),p=v?r:p,Re(p)||(p=p==null?[]:[p]),GC(o,u,p))}var zN=Dp(function(o,u,p){o[p?0:1].push(u)},function(){return[[],[]]});function JN(o,u,p){var v=Re(o)?nc:el,x=arguments.length<3;return v(o,ge(u,4),p,x,bi)}function GN(o,u,p){var v=Re(o)?Dy:el,x=arguments.length<3;return v(o,ge(u,4),p,x,kp)}function YN(o,u){var p=Re(o)?di:Tp;return p(o,Yp(ge(u,3)))}function KN(o){var u=Re(o)?Op:H$;return u(o)}function QN(o,u,p){(p?Rr(o,u,p):u===r)?u=1:u=Ee(u);var v=Re(o)?Tv:B$;return v(o,u)}function ZN(o){var u=Re(o)?qv:W$;return u(o)}function XN(o){if(o==null)return 0;if($r(o))return Qp(o)?hi(o):o.length;var u=ar(o);return u==Yt||u==gr?o.size:E(o).length}function eD(o,u,p){var v=Re(o)?Za:z$;return p&&Rr(o,u,p)&&(u=r),v(o,ge(u,3))}var tD=Te(function(o,u){if(o==null)return[];var p=u.length;return p>1&&Rr(o,u[0],u[1])?u=[]:p>2&&Rr(u[0],u[1],u[2])&&(u=[u[0]]),GC(o,Wt(u,1),[])}),Jp=lv||function(){return Ft.Date.now()};function rD(o,u){if(typeof u!="function")throw new wr(i);return o=Ee(o),function(){if(--o<1)return u.apply(this,arguments)}}function Hx(o,u,p){return u=p?r:u,u=o&&u==null?o.length:u,Hi(o,X,r,r,r,r,u)}function Bx(o,u){var p;if(typeof u!="function")throw new wr(i);return o=Ee(o),function(){return--o>0&&(p=u.apply(this,arguments)),o<=1&&(u=r),p}}var cb=Te(function(o,u,p){var v=R;if(p.length){var x=dn(p,Rl(cb));v|=V}return Hi(o,v,u,p,x)}),Vx=Te(function(o,u,p){var v=R|I;if(p.length){var x=dn(p,Rl(Vx));v|=V}return Hi(u,v,o,p,x)});function Wx(o,u,p){u=p?r:u;var v=Hi(o,j,r,r,r,r,r,u);return v.placeholder=Wx.placeholder,v}function zx(o,u,p){u=p?r:u;var v=Hi(o,B,r,r,r,r,r,u);return v.placeholder=zx.placeholder,v}function Jx(o,u,p){var v,x,P,A,D,H,Q=0,Z=!1,ee=!1,ie=!0;if(typeof o!="function")throw new wr(i);u=vn(u)||0,Et(p)&&(Z=!!p.leading,ee="maxWait"in p,P=ee?yt(vn(p.maxWait)||0,u):P,ie="trailing"in p?!!p.trailing:ie);function ce(Nt){var Bn=v,Ji=x;return v=x=r,Q=Nt,A=o.apply(Ji,Bn),A}function ye(Nt){return Q=Nt,D=_c(Le,u),Z?ce(Nt):A}function Ie(Nt){var Bn=Nt-H,Ji=Nt-Q,pE=u-Bn;return ee?Vt(pE,P-Ji):pE}function me(Nt){var Bn=Nt-H,Ji=Nt-Q;return H===r||Bn>=u||Bn<0||ee&&Ji>=P}function Le(){var Nt=Jp();if(me(Nt))return He(Nt);D=_c(Le,Ie(Nt))}function He(Nt){return D=r,ie&&v?ce(Nt):(v=x=r,A)}function en(){D!==r&&nx(D),Q=0,v=H=x=D=r}function Cr(){return D===r?A:He(Jp())}function tn(){var Nt=Jp(),Bn=me(Nt);if(v=arguments,x=this,H=Nt,Bn){if(D===r)return ye(H);if(ee)return nx(D),D=_c(Le,u),ce(H)}return D===r&&(D=_c(Le,u)),A}return tn.cancel=en,tn.flush=Cr,tn}var nD=Te(function(o,u){return mc(o,1,u)}),iD=Te(function(o,u,p){return mc(o,vn(u)||0,p)});function sD(o){return Hi(o,C)}function Gp(o,u){if(typeof o!="function"||u!=null&&typeof u!="function")throw new wr(i);var p=function(){var v=arguments,x=u?u.apply(this,v):v[0],P=p.cache;if(P.has(x))return P.get(x);var A=o.apply(this,v);return p.cache=P.set(x,A)||P,A};return p.cache=new(Gp.Cache||Dn),p}Gp.Cache=Dn;function Yp(o){if(typeof o!="function")throw new wr(i);return function(){var u=arguments;switch(u.length){case 0:return!o.call(this);case 1:return!o.call(this,u[0]);case 2:return!o.call(this,u[0],u[1]);case 3:return!o.call(this,u[0],u[1],u[2])}return!o.apply(this,u)}}function oD(o){return Bx(2,o)}var aD=J$(function(o,u){u=u.length==1&&Re(u[0])?ct(u[0],br(ge())):ct(Wt(u,1),br(ge()));var p=u.length;return Te(function(v){for(var x=-1,P=Vt(v.length,p);++x<P;)v[x]=u[x].call(this,v[x]);return yr(o,this,v)})}),fb=Te(function(o,u){var p=dn(u,Rl(fb));return Hi(o,V,r,u,p)}),Gx=Te(function(o,u){var p=dn(u,Rl(Gx));return Hi(o,W,r,u,p)}),lD=Bi(function(o,u){return Hi(o,T,r,r,r,u)});function uD(o,u){if(typeof o!="function")throw new wr(i);return u=u===r?u:Ee(u),Te(o,u)}function cD(o,u){if(typeof o!="function")throw new wr(i);return u=u==null?0:yt(Ee(u),0),Te(function(p){var v=p[u],x=$s(p,0,u);return v&&pi(x,v),yr(o,this,x)})}function fD(o,u,p){var v=!0,x=!0;if(typeof o!="function")throw new wr(i);return Et(p)&&(v="leading"in p?!!p.leading:v,x="trailing"in p?!!p.trailing:x),Jx(o,u,{leading:v,maxWait:u,trailing:x})}function dD(o){return Hx(o,1)}function pD(o,u){return fb(Yv(u),o)}function hD(){if(!arguments.length)return[];var o=arguments[0];return Re(o)?o:[o]}function mD(o){return or(o,y)}function gD(o,u){return u=typeof u=="function"?u:r,or(o,y,u)}function yD(o){return or(o,h|y)}function vD(o,u){return u=typeof u=="function"?u:r,or(o,h|y,u)}function bD(o,u){return u==null||hn(o,u,Zt(u))}function Hn(o,u){return o===u||o!==o&&u!==u}var SD=Up(yc),wD=Up(function(o,u){return o>=u}),Vo=$p((function(){return arguments})())?$p:function(o){return Pt(o)&&Ze.call(o,"callee")&&!To.call(o,"callee")},Re=z.isArray,_D=tc?br(tc):jv;function $r(o){return o!=null&&Kp(o.length)&&!Wi(o)}function Mt(o){return Pt(o)&&$r(o)}function RD(o){return o===!0||o===!1||Pt(o)&&Xt(o)==Gr}var Ms=dl||Rb,CD=np?br(np):Uv;function xD(o){return Pt(o)&&o.nodeType===1&&!Rc(o)}function ED(o){if(o==null)return!0;if($r(o)&&(Re(o)||typeof o=="string"||typeof o.splice=="function"||Ms(o)||Cl(o)||Vo(o)))return!o.length;var u=ar(o);if(u==Yt||u==gr)return!o.size;if(wc(o))return!E(o).length;for(var p in o)if(Ze.call(o,p))return!1;return!0}function OD(o,u){return Uo(o,u)}function ID(o,u,p){p=typeof p=="function"?p:r;var v=p?p(o,u):r;return v===r?Uo(o,u,r,p):!!v}function db(o){if(!Pt(o))return!1;var u=Xt(o);return u==gt||u==mt||typeof o.message=="string"&&typeof o.name=="string"&&!Rc(o)}function PD(o){return typeof o=="number"&&Li(o)}function Wi(o){if(!Et(o))return!1;var u=Xt(o);return u==ln||u==ho||u==Ct||u==Fd}function Yx(o){return typeof o=="number"&&o==Ee(o)}function Kp(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=et}function Et(o){var u=typeof o;return o!=null&&(u=="object"||u=="function")}function Pt(o){return o!=null&&typeof o=="object"}var Kx=ip?br(ip):ks;function kD(o,u){return o===u||Ts(o,u,rb(u))}function TD(o,u,p){return p=typeof p=="function"?p:r,Ts(o,u,rb(u),p)}function qD(o){return Qx(o)&&o!=+o}function AD(o){if(gM(o))throw new be(n);return Fe(o)}function $D(o){return o===null}function MD(o){return o==null}function Qx(o){return typeof o=="number"||Pt(o)&&Xt(o)==mo}function Rc(o){if(!Pt(o)||Xt(o)!=kn)return!1;var u=ll(o);if(u===null)return!0;var p=Ze.call(u,"constructor")&&u.constructor;return typeof p=="function"&&p instanceof p&&il.call(p)==iv}var pb=xo?br(xo):c;function ND(o){return Yx(o)&&o>=-et&&o<=et}var Zx=$n?br($n):m;function Qp(o){return typeof o=="string"||!Re(o)&&Pt(o)&&Xt(o)==go}function Xr(o){return typeof o=="symbol"||Pt(o)&&Xt(o)==Da}var Cl=Ka?br(Ka):b;function DD(o){return o===r}function FD(o){return Pt(o)&&ar(o)==Bt}function LD(o){return Pt(o)&&Xt(o)==jd}var jD=Up(J),UD=Up(function(o,u){return o<=u});function Xx(o){if(!o)return[];if($r(o))return Qp(o)?Sr(o):Ar(o);if(qo&&o[qo])return Gy(o[qo]());var u=ar(o),p=u==Yt?Cs:u==gr?rl:xl;return p(o)}function zi(o){if(!o)return o===0?o:0;if(o=vn(o),o===pe||o===-pe){var u=o<0?-1:1;return u*_e}return o===o?o:0}function Ee(o){var u=zi(o),p=u%1;return u===u?p?u-p:u:0}function eE(o){return o?vi(Ee(o),0,xe):0}function vn(o){if(typeof o=="number")return o;if(Xr(o))return he;if(Et(o)){var u=typeof o.valueOf=="function"?o.valueOf():o;o=Et(u)?u+"":u}if(typeof o!="string")return o===0?o:+o;o=ac(o);var p=So.test(o);return p||py.test(o)?My(o.slice(2),p?2:8):dy.test(o)?he:+o}function tE(o){return Si(o,Mr(o))}function HD(o){return o?vi(Ee(o),-et,et):o===0?o:0}function nt(o){return o==null?"":Zr(o)}var BD=wl(function(o,u){if(wc(u)||$r(u)){Si(u,Zt(u),o);return}for(var p in u)Ze.call(u,p)&&_r(o,p,u[p])}),rE=wl(function(o,u){Si(u,Mr(u),o)}),nE=wl(function(o,u,p,v){Si(u,Mr(u),o,v)}),hb=wl(function(o,u,p,v){Si(u,Zt(u),o,v)}),VD=Bi(hc);function WD(o,u){var p=Is(o);return u==null?p:Pp(p,u)}var zD=Te(function(o,u){o=Ue(o);var p=-1,v=u.length,x=v>2?u[2]:r;for(x&&Rr(u[0],u[1],x)&&(v=1);++p<v;)for(var P=u[p],A=Mr(P),D=-1,H=A.length;++D<H;){var Q=A[D],Z=o[Q];(Z===r||Hn(Z,xs[Q])&&!Ze.call(o,Q))&&(o[Q]=P[Q])}return o}),JD=Te(function(o){return o.push(r,bx),yr(iE,r,o)});function GD(o,u){return op(o,ge(u,3),mn)}function YD(o,u){return op(o,ge(u,3),Fn)}function KD(o,u){return o==null?o:gc(o,ge(u,3),Mr)}function QD(o,u){return o==null?o:qp(o,ge(u,3),Mr)}function ZD(o,u){return o&&mn(o,ge(u,3))}function XD(o,u){return o&&Fn(o,ge(u,3))}function eF(o){return o==null?[]:Sl(o,Zt(o))}function tF(o){return o==null?[]:Sl(o,Mr(o))}function mb(o,u,p){var v=o==null?r:Ui(o,u);return v===r?p:v}function rF(o,u){return o!=null&&_x(o,u,Dv)}function gb(o,u){return o!=null&&_x(o,u,Fv)}var nF=hx(function(o,u,p){u!=null&&typeof u.toString!="function"&&(u=sl.call(u)),o[u]=p},vb(Nr)),iF=hx(function(o,u,p){u!=null&&typeof u.toString!="function"&&(u=sl.call(u)),Ze.call(o,u)?o[u].push(p):o[u]=[p]},ge),sF=Te(jo);function Zt(o){return $r(o)?Ep(o):E(o)}function Mr(o){return $r(o)?Ep(o,!0):M(o)}function oF(o,u){var p={};return u=ge(u,3),mn(o,function(v,x,P){Kr(p,u(v,x,P),v)}),p}function aF(o,u){var p={};return u=ge(u,3),mn(o,function(v,x,P){Kr(p,x,u(v,x,P))}),p}var lF=wl(function(o,u,p){Lt(o,u,p)}),iE=wl(function(o,u,p,v){Lt(o,u,p,v)}),uF=Bi(function(o,u){var p={};if(o==null)return p;var v=!1;u=ct(u,function(P){return P=As(P,o),v||(v=P.length>1),P}),Si(o,eb(o),p),v&&(p=or(p,h|g|y,iM));for(var x=u.length;x--;)zv(p,u[x]);return p});function cF(o,u){return sE(o,Yp(ge(u)))}var fF=Bi(function(o,u){return o==null?{}:L$(o,u)});function sE(o,u){if(o==null)return{};var p=ct(eb(o),function(v){return[v]});return u=ge(u),YC(o,p,function(v,x){return u(v,x[0])})}function dF(o,u,p){u=As(u,o);var v=-1,x=u.length;for(x||(x=1,o=r);++v<x;){var P=o==null?r:o[Un(u[v])];P===r&&(v=x,P=p),o=Wi(P)?P.call(o):P}return o}function pF(o,u,p){return o==null?o:bc(o,u,p)}function hF(o,u,p,v){return v=typeof v=="function"?v:r,o==null?o:bc(o,u,p,v)}var oE=yx(Zt),aE=yx(Mr);function mF(o,u,p){var v=Re(o),x=v||Ms(o)||Cl(o);if(u=ge(u,4),p==null){var P=o&&o.constructor;x?p=v?new P:[]:Et(o)?p=Wi(P)?Is(ll(o)):{}:p={}}return(x?vr:mn)(o,function(A,D,H){return u(p,A,D,H)}),p}function gF(o,u){return o==null?!0:zv(o,u)}function yF(o,u,p){return o==null?o:ex(o,u,Yv(p))}function vF(o,u,p,v){return v=typeof v=="function"?v:r,o==null?o:ex(o,u,Yv(p),v)}function xl(o){return o==null?[]:tl(o,Zt(o))}function bF(o){return o==null?[]:tl(o,Mr(o))}function SF(o,u,p){return p===r&&(p=u,u=r),p!==r&&(p=vn(p),p=p===p?p:0),u!==r&&(u=vn(u),u=u===u?u:0),vi(vn(o),u,p)}function wF(o,u,p){return u=zi(u),p===r?(p=u,u=0):p=zi(p),o=vn(o),Lv(o,u,p)}function _F(o,u,p){if(p&&typeof p!="boolean"&&Rr(o,u,p)&&(u=p=r),p===r&&(typeof u=="boolean"?(p=u,u=r):typeof o=="boolean"&&(p=o,o=r)),o===r&&u===r?(o=0,u=1):(o=zi(o),u===r?(u=o,o=0):u=zi(u)),o>u){var v=o;o=u,u=v}if(p||o%1||u%1){var x=bp();return Vt(o+x*(u-o+tp("1e-"+((x+"").length-1))),u)}return Bv(o,u)}var RF=_l(function(o,u,p){return u=u.toLowerCase(),o+(p?lE(u):u)});function lE(o){return yb(nt(o).toLowerCase())}function uE(o){return o=nt(o),o&&o.replace(wo,Vy).replace(Iy,"")}function CF(o,u,p){o=nt(o),u=Zr(u);var v=o.length;p=p===r?v:vi(Ee(p),0,v);var x=p;return p-=u.length,p>=0&&o.slice(p,x)==u}function xF(o){return o=nt(o),o&&le.test(o)?o.replace(Ua,Wy):o}function EF(o){return o=nt(o),o&&bo.test(o)?o.replace(Ke,"\\$&"):o}var OF=_l(function(o,u,p){return o+(p?"-":"")+u.toLowerCase()}),IF=_l(function(o,u,p){return o+(p?" ":"")+u.toLowerCase()}),PF=fx("toLowerCase");function kF(o,u,p){o=nt(o),u=Ee(u);var v=u?hi(o):0;if(!u||v>=u)return o;var x=(u-v)/2;return jp($o(x),p)+o+jp(Ao(x),p)}function TF(o,u,p){o=nt(o),u=Ee(u);var v=u?hi(o):0;return u&&v<u?o+jp(u-v,p):o}function qF(o,u,p){o=nt(o),u=Ee(u);var v=u?hi(o):0;return u&&v<u?jp(u-v,p)+o:o}function AF(o,u,p){return p||u==null?u=0:u&&(u=+u),cv(nt(o).replace(Vu,""),u||0)}function $F(o,u,p){return(p?Rr(o,u,p):u===r)?u=1:u=Ee(u),Vv(nt(o),u)}function MF(){var o=arguments,u=nt(o[0]);return o.length<3?u:u.replace(o[1],o[2])}var NF=_l(function(o,u,p){return o+(p?"_":"")+u.toLowerCase()});function DF(o,u,p){return p&&typeof p!="number"&&Rr(o,u,p)&&(u=p=r),p=p===r?xe:p>>>0,p?(o=nt(o),o&&(typeof u=="string"||u!=null&&!pb(u))&&(u=Zr(u),!u&&Rs(o))?$s(Sr(o),0,p):o.split(u,p)):[]}var FF=_l(function(o,u,p){return o+(p?" ":"")+yb(u)});function LF(o,u,p){return o=nt(o),p=p==null?0:vi(Ee(p),0,o.length),u=Zr(u),o.slice(p,p+u.length)==u}function jF(o,u,p){var v=O.templateSettings;p&&Rr(o,u,p)&&(u=r),o=nt(o),u=hb({},u,v,vx);var x=hb({},u.imports,v.imports,vx),P=Zt(x),A=tl(x,P);vr(P,function(me){if(Tr.test(me))throw new be(a)});var D,H,Q=0,Z=u.interpolate||_o,ee="__p += '",ie=nl((u.escape||_o).source+"|"+Z.source+"|"+(Z===un?$i:_o).source+"|"+(u.evaluate||_o).source+"|$","g"),ce="//# sourceURL="+(Ze.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ay+"]")+`
|
|
4
4
|
`;o.replace(ie,function(me,Le,He,en,Cr,tn){return He||(He=en),ee+=o.slice(Q,tn).replace(hy,zy),Le&&(D=!0,ee+=`' +
|
|
5
5
|
__e(`+Le+`) +
|
|
6
6
|
'`),Cr&&(H=!0,ee+=`';
|
|
@@ -17,27 +17,27 @@ __p += '`),He&&(ee+=`' +
|
|
|
17
17
|
function print() { __p += __j.call(arguments, '') }
|
|
18
18
|
`:`;
|
|
19
19
|
`)+ee+`return __p
|
|
20
|
-
}`;var Ie=fE(function(){return Ge(P,ce+"return "+ee).apply(r,A)});if(Ie.source=ee,db(Ie))throw Ie;return Ie}function UF(o){return nt(o).toLowerCase()}function HF(o){return nt(o).toUpperCase()}function BF(o,u,p){if(o=nt(o),o&&(p||u===r))return lc(o);if(!o||!(u=Zr(u)))return o;var v=Sr(o),x=Sr(u),P=up(v,x),A=cp(v,x)+1;return $s(v,P,A).join("")}function VF(o,u,p){if(o=nt(o),o&&(p||u===r))return o.slice(0,pp(o)+1);if(!o||!(u=Zr(u)))return o;var v=Sr(o),x=cp(v,Sr(u))+1;return $s(v,0,x).join("")}function WF(o,u,p){if(o=nt(o),o&&(p||u===r))return o.replace(Wu,"");if(!o||!(u=Zr(u)))return o;var v=Sr(o),x=up(v,Sr(u));return $s(v,x).join("")}function zF(o,u){var p=k,v=N;if(Et(u)){var x="separator"in u?u.separator:x;p="length"in u?Ee(u.length):p,v="omission"in u?Zr(u.omission):v}o=nt(o);var P=o.length;if(Rs(o)){var A=Sr(o);P=A.length}if(p>=P)return o;var D=p-mi(v);if(D<1)return v;var H=A?$s(A,0,D).join(""):o.slice(0,D);if(x===r)return H+v;if(A&&(D+=H.length-D),pb(x)){if(o.slice(D).search(x)){var Q,Z=H;for(x.global||(x=nl(x.source,nt(Hd.exec(x))+"g")),x.lastIndex=0;Q=x.exec(Z);)var ee=Q.index;H=H.slice(0,ee===r?D:ee)}}else if(o.indexOf(Zr(x),D)!=D){var ie=H.lastIndexOf(x);ie>-1&&(H=H.slice(0,ie))}return H+v}function JF(o){return o=nt(o),o&&Ha.test(o)?o.replace(Ai,Ky):o}var GF=_l(function(o,u,p){return o+(p?" ":"")+u.toUpperCase()}),yb=fx("toUpperCase");function cE(o,u,p){return o=nt(o),u=p?r:u,u===r?Jy(o)?Xy(o):jy(o):o.match(u)||[]}var fE=Te(function(o,u){try{return yr(o,r,u)}catch(p){return db(p)?p:new be(p)}}),YF=Bi(function(o,u){return vr(u,function(p){p=Hn(p),Kr(o,p,cb(o[p],o))}),o});function KF(o){var u=o==null?0:o.length,p=ge();return o=u?ct(o,function(v){if(typeof v[1]!="function")throw new wr(i);return[p(v[0]),v[1]]}):[],Te(function(v){for(var x=-1;++x<u;){var P=o[x];if(yr(P[0],this,v))return yr(P[1],this,v)}})}function QF(o){return $v(or(o,h))}function vb(o){return function(){return o}}function ZF(o,u){return o==null||o!==o?u:o}var XF=px(),eL=px(!0);function Nr(o){return o}function bb(o){return w(typeof o=="function"?o:or(o,h))}function tL(o){return ve(or(o,h))}function rL(o,u){return Me(o,or(u,h))}var nL=Te(function(o,u){return function(p){return jo(p,o,u)}}),iL=Te(function(o,u){return function(p){return jo(o,p,u)}});function Sb(o,u,p){var v=Zt(u),x=Sl(u,v);p==null&&!(Et(u)&&(x.length||!v.length))&&(p=u,u=o,o=this,x=Sl(u,Zt(u)));var P=!(Et(p)&&"chain"in p)||!!p.chain,A=Wi(o);return vr(x,function(D){var H=u[D];o[D]=H,A&&(o.prototype[D]=function(){var Q=this.__chain__;if(P||Q){var Z=o(this.__wrapped__),ee=Z.__actions__=Ar(this.__actions__);return ee.push({func:H,args:arguments,thisArg:o}),Z.__chain__=Q,Z}return H.apply(o,hi([this.value()],arguments))})}),o}function sL(){return Ft._===this&&(Ft._=sv),this}function wb(){}function oL(o){return o=Ee(o),Te(function(u){return Un(u,o)})}var aL=Qv(ct),lL=Qv(op),uL=Qv(Za);function dE(o){return ib(o)?Eo(Hn(o)):j$(o)}function cL(o){return function(u){return o==null?r:Ui(o,u)}}var fL=mx(),dL=mx(!0);function _b(){return[]}function Rb(){return!1}function pL(){return{}}function hL(){return""}function mL(){return!0}function gL(o,u){if(o=Ee(o),o<1||o>et)return[];var p=xe,v=Vt(o,xe);u=ge(u),o-=xe;for(var x=ac(v,u);++p<o;)u(p);return x}function yL(o){return Re(o)?ct(o,Hn):Xr(o)?[o]:Ar(Tx(nt(o)))}function vL(o){var u=++nv;return nt(o)+u}var bL=jp(function(o,u){return o+u},0),SL=Zv("ceil"),wL=jp(function(o,u){return o/u},1),_L=Zv("floor");function RL(o){return o&&o.length?bl(o,Nr,vc):r}function CL(o,u){return o&&o.length?bl(o,ge(u,2),vc):r}function xL(o){return lp(o,Nr)}function EL(o,u){return lp(o,ge(u,2))}function OL(o){return o&&o.length?bl(o,Nr,J):r}function IL(o,u){return o&&o.length?bl(o,ge(u,2),J):r}var PL=jp(function(o,u){return o*u},1),kL=Zv("round"),TL=jp(function(o,u){return o-u},0);function qL(o){return o&&o.length?oc(o,Nr):0}function AL(o,u){return o&&o.length?oc(o,ge(u,2)):0}return O.after=rD,O.ary=Hx,O.assign=BD,O.assignIn=rE,O.assignInWith=nE,O.assignWith=hb,O.at=VD,O.before=Bx,O.bind=cb,O.bindAll=YF,O.bindKey=Vx,O.castArray=hD,O.chain=Lx,O.chunk=RM,O.compact=CM,O.concat=xM,O.cond=KF,O.conforms=QF,O.constant=vb,O.countBy=AN,O.create=WD,O.curry=Wx,O.curryRight=zx,O.debounce=Jx,O.defaults=zD,O.defaultsDeep=JD,O.defer=nD,O.delay=iD,O.difference=EM,O.differenceBy=OM,O.differenceWith=IM,O.drop=PM,O.dropRight=kM,O.dropRightWhile=TM,O.dropWhile=qM,O.fill=AM,O.filter=MN,O.flatMap=FN,O.flatMapDeep=LN,O.flatMapDepth=jN,O.flatten=Mx,O.flattenDeep=$M,O.flattenDepth=MM,O.flip=sD,O.flow=XF,O.flowRight=eL,O.fromPairs=NM,O.functions=eF,O.functionsIn=tF,O.groupBy=UN,O.initial=FM,O.intersection=LM,O.intersectionBy=jM,O.intersectionWith=UM,O.invert=nF,O.invertBy=iF,O.invokeMap=BN,O.iteratee=bb,O.keyBy=VN,O.keys=Zt,O.keysIn=Mr,O.map=Jp,O.mapKeys=oF,O.mapValues=aF,O.matches=tL,O.matchesProperty=rL,O.memoize=Yp,O.merge=lF,O.mergeWith=iE,O.method=nL,O.methodOf=iL,O.mixin=Sb,O.negate=Kp,O.nthArg=oL,O.omit=uF,O.omitBy=cF,O.once=oD,O.orderBy=WN,O.over=aL,O.overArgs=aD,O.overEvery=lL,O.overSome=uL,O.partial=fb,O.partialRight=Gx,O.partition=zN,O.pick=fF,O.pickBy=sE,O.property=dE,O.propertyOf=cL,O.pull=WM,O.pullAll=Dx,O.pullAllBy=zM,O.pullAllWith=JM,O.pullAt=GM,O.range=fL,O.rangeRight=dL,O.rearg=lD,O.reject=YN,O.remove=YM,O.rest=uD,O.reverse=lb,O.sampleSize=QN,O.set=pF,O.setWith=hF,O.shuffle=ZN,O.slice=KM,O.sortBy=tD,O.sortedUniq=nN,O.sortedUniqBy=iN,O.split=DF,O.spread=cD,O.tail=sN,O.take=oN,O.takeRight=aN,O.takeRightWhile=lN,O.takeWhile=uN,O.tap=CN,O.throttle=fD,O.thru=zp,O.toArray=Xx,O.toPairs=oE,O.toPairsIn=aE,O.toPath=yL,O.toPlainObject=tE,O.transform=mF,O.unary=dD,O.union=cN,O.unionBy=fN,O.unionWith=dN,O.uniq=pN,O.uniqBy=hN,O.uniqWith=mN,O.unset=gF,O.unzip=ub,O.unzipWith=Fx,O.update=yF,O.updateWith=vF,O.values=xl,O.valuesIn=bF,O.without=gN,O.words=cE,O.wrap=pD,O.xor=yN,O.xorBy=vN,O.xorWith=bN,O.zip=SN,O.zipObject=wN,O.zipObjectDeep=_N,O.zipWith=RN,O.entries=oE,O.entriesIn=aE,O.extend=rE,O.extendWith=nE,Sb(O,O),O.add=bL,O.attempt=fE,O.camelCase=RF,O.capitalize=lE,O.ceil=SL,O.clamp=SF,O.clone=mD,O.cloneDeep=yD,O.cloneDeepWith=vD,O.cloneWith=gD,O.conformsTo=bD,O.deburr=uE,O.defaultTo=ZF,O.divide=wL,O.endsWith=CF,O.eq=Bn,O.escape=xF,O.escapeRegExp=EF,O.every=$N,O.find=NN,O.findIndex=Ax,O.findKey=GD,O.findLast=DN,O.findLastIndex=$x,O.findLastKey=YD,O.floor=_L,O.forEach=jx,O.forEachRight=Ux,O.forIn=KD,O.forInRight=QD,O.forOwn=ZD,O.forOwnRight=XD,O.get=mb,O.gt=SD,O.gte=wD,O.has=rF,O.hasIn=gb,O.head=Nx,O.identity=Nr,O.includes=HN,O.indexOf=DM,O.inRange=wF,O.invoke=sF,O.isArguments=Vo,O.isArray=Re,O.isArrayBuffer=_D,O.isArrayLike=$r,O.isArrayLikeObject=Mt,O.isBoolean=RD,O.isBuffer=Ms,O.isDate=CD,O.isElement=xD,O.isEmpty=ED,O.isEqual=OD,O.isEqualWith=ID,O.isError=db,O.isFinite=PD,O.isFunction=Wi,O.isInteger=Yx,O.isLength=Qp,O.isMap=Kx,O.isMatch=kD,O.isMatchWith=TD,O.isNaN=qD,O.isNative=AD,O.isNil=MD,O.isNull=$D,O.isNumber=Qx,O.isObject=Et,O.isObjectLike=Pt,O.isPlainObject=Cc,O.isRegExp=pb,O.isSafeInteger=ND,O.isSet=Zx,O.isString=Zp,O.isSymbol=Xr,O.isTypedArray=Cl,O.isUndefined=DD,O.isWeakMap=FD,O.isWeakSet=LD,O.join=HM,O.kebabCase=OF,O.last=yn,O.lastIndexOf=BM,O.lowerCase=IF,O.lowerFirst=PF,O.lt=jD,O.lte=UD,O.max=RL,O.maxBy=CL,O.mean=xL,O.meanBy=EL,O.min=OL,O.minBy=IL,O.stubArray=_b,O.stubFalse=Rb,O.stubObject=pL,O.stubString=hL,O.stubTrue=mL,O.multiply=PL,O.nth=VM,O.noConflict=sL,O.noop=wb,O.now=Gp,O.pad=kF,O.padEnd=TF,O.padStart=qF,O.parseInt=AF,O.random=_F,O.reduce=JN,O.reduceRight=GN,O.repeat=$F,O.replace=MF,O.result=dF,O.round=kL,O.runInContext=L,O.sample=KN,O.size=XN,O.snakeCase=NF,O.some=eD,O.sortedIndex=QM,O.sortedIndexBy=ZM,O.sortedIndexOf=XM,O.sortedLastIndex=eN,O.sortedLastIndexBy=tN,O.sortedLastIndexOf=rN,O.startCase=FF,O.startsWith=LF,O.subtract=TL,O.sum=qL,O.sumBy=AL,O.template=jF,O.times=gL,O.toFinite=zi,O.toInteger=Ee,O.toLength=eE,O.toLower=UF,O.toNumber=vn,O.toSafeInteger=HD,O.toString=nt,O.toUpper=HF,O.trim=BF,O.trimEnd=VF,O.trimStart=WF,O.truncate=zF,O.unescape=JF,O.uniqueId=vL,O.upperCase=GF,O.upperFirst=yb,O.each=jx,O.eachRight=Ux,O.first=Nx,Sb(O,(function(){var o={};return mn(O,function(u,p){Ze.call(O.prototype,p)||(o[p]=u)}),o})(),{chain:!1}),O.VERSION=e,vr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){O[o].placeholder=O}),vr(["drop","take"],function(o,u){$e.prototype[o]=function(p){p=p===r?1:yt(Ee(p),0);var v=this.__filtered__&&!u?new $e(this):this.clone();return v.__filtered__?v.__takeCount__=Vt(p,v.__takeCount__):v.__views__.push({size:Vt(p,xe),type:o+(v.__dir__<0?"Right":"")}),v},$e.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),vr(["filter","map","takeWhile"],function(o,u){var p=u+1,v=p==G||p==ne;$e.prototype[o]=function(x){var P=this.clone();return P.__iteratees__.push({iteratee:ge(x,3),type:p}),P.__filtered__=P.__filtered__||v,P}}),vr(["head","last"],function(o,u){var p="take"+(u?"Right":"");$e.prototype[o]=function(){return this[p](1).value()[0]}}),vr(["initial","tail"],function(o,u){var p="drop"+(u?"":"Right");$e.prototype[o]=function(){return this.__filtered__?new $e(this):this[p](1)}}),$e.prototype.compact=function(){return this.filter(Nr)},$e.prototype.find=function(o){return this.filter(o).head()},$e.prototype.findLast=function(o){return this.reverse().find(o)},$e.prototype.invokeMap=Te(function(o,u){return typeof o=="function"?new $e(this):this.map(function(p){return jo(p,o,u)})}),$e.prototype.reject=function(o){return this.filter(Kp(ge(o)))},$e.prototype.slice=function(o,u){o=Ee(o);var p=this;return p.__filtered__&&(o>0||u<0)?new $e(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),u!==r&&(u=Ee(u),p=u<0?p.dropRight(-u):p.take(u-o)),p)},$e.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},$e.prototype.toArray=function(){return this.take(xe)},mn($e.prototype,function(o,u){var p=/^(?:filter|find|map|reject)|While$/.test(u),v=/^(?:head|last)$/.test(u),x=O[v?"take"+(u=="last"?"Right":""):u],P=v||/^find/.test(u);x&&(O.prototype[u]=function(){var A=this.__wrapped__,D=v?[1]:arguments,H=A instanceof $e,Q=D[0],Z=H||Re(A),ee=function(Le){var He=x.apply(O,hi([Le],D));return v&&ie?He[0]:He};Z&&p&&typeof Q=="function"&&Q.length!=1&&(H=Z=!1);var ie=this.__chain__,ce=!!this.__actions__.length,ye=P&&!ie,Ie=H&&!ce;if(!P&&Z){A=Ie?A:new $e(this);var me=o.apply(A,D);return me.__actions__.push({func:zp,args:[ee],thisArg:r}),new sr(me,ie)}return ye&&Ie?o.apply(this,D):(me=this.thru(ee),ye?v?me.value()[0]:me.value():me)})}),vr(["pop","push","shift","sort","splice","unshift"],function(o){var u=Po[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",v=/^(?:pop|shift)$/.test(o);O.prototype[o]=function(){var x=arguments;if(v&&!this.__chain__){var P=this.value();return u.apply(Re(P)?P:[],x)}return this[p](function(A){return u.apply(Re(A)?A:[],x)})}}),mn($e.prototype,function(o,u){var p=O[u];if(p){var v=p.name+"";Ze.call(Os,v)||(Os[v]=[]),Os[v].push({name:u,func:p})}}),Os[Lp(r,I).name]=[{name:"wrapper",func:r}],$e.prototype.clone=yv,$e.prototype.reverse=vv,$e.prototype.value=dc,O.prototype.at=xN,O.prototype.chain=EN,O.prototype.commit=ON,O.prototype.next=IN,O.prototype.plant=kN,O.prototype.reverse=TN,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=qN,O.prototype.first=O.prototype.head,qo&&(O.prototype[qo]=PN),O}),gi=ev();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ft._=gi,define(function(){return gi})):Qe?((Qe.exports=gi)._=gi,Ya._=gi):Ft._=gi}).call(kl)});var AE=F((Lb,Tl)=>{(function(r,e){typeof Lb=="object"&&typeof Tl<"u"?Tl.exports=e():typeof define=="function"&&define.amd?define(e):r.moment=e()})(Lb,(function(){"use strict";var r;function e(){return r.apply(null,arguments)}function t(c){r=c}function n(c){return c instanceof Array||Object.prototype.toString.call(c)==="[object Array]"}function i(c){return c!=null&&Object.prototype.toString.call(c)==="[object Object]"}function s(c,m){return Object.prototype.hasOwnProperty.call(c,m)}function a(c){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(c).length===0;var m;for(m in c)if(s(c,m))return!1;return!0}function l(c){return c===void 0}function f(c){return typeof c=="number"||Object.prototype.toString.call(c)==="[object Number]"}function d(c){return c instanceof Date||Object.prototype.toString.call(c)==="[object Date]"}function h(c,m){var b=[],w,E=c.length;for(w=0;w<E;++w)b.push(m(c[w],w));return b}function g(c,m){for(var b in m)s(m,b)&&(c[b]=m[b]);return s(m,"toString")&&(c.toString=m.toString),s(m,"valueOf")&&(c.valueOf=m.valueOf),c}function y(c,m,b,w){return tl(c,m,b,w,!0).utc()}function S(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function _(c){return c._pf==null&&(c._pf=S()),c._pf}var R;Array.prototype.some?R=Array.prototype.some:R=function(c){var m=Object(this),b=m.length>>>0,w;for(w=0;w<b;w++)if(w in m&&c.call(this,m[w],w,m))return!0;return!1};function I(c){var m=null,b=!1,w=c._d&&!isNaN(c._d.getTime());if(w&&(m=_(c),b=R.call(m.parsedDateParts,function(E){return E!=null}),w=m.overflow<0&&!m.empty&&!m.invalidEra&&!m.invalidMonth&&!m.invalidWeekday&&!m.weekdayMismatch&&!m.nullInput&&!m.invalidFormat&&!m.userInvalidated&&(!m.meridiem||m.meridiem&&b),c._strict&&(w=w&&m.charsLeftOver===0&&m.unusedTokens.length===0&&m.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(c))c._isValid=w;else return w;return c._isValid}function q(c){var m=y(NaN);return c!=null?g(_(m),c):_(m).userInvalidated=!0,m}var U=e.momentProperties=[],B=!1;function V(c,m){var b,w,E,M=U.length;if(l(m._isAMomentObject)||(c._isAMomentObject=m._isAMomentObject),l(m._i)||(c._i=m._i),l(m._f)||(c._f=m._f),l(m._l)||(c._l=m._l),l(m._strict)||(c._strict=m._strict),l(m._tzm)||(c._tzm=m._tzm),l(m._isUTC)||(c._isUTC=m._isUTC),l(m._offset)||(c._offset=m._offset),l(m._pf)||(c._pf=_(m)),l(m._locale)||(c._locale=m._locale),M>0)for(b=0;b<M;b++)w=U[b],E=m[w],l(E)||(c[w]=E);return c}function W(c){V(this,c),this._d=new Date(c._d!=null?c._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),B===!1&&(B=!0,e.updateOffset(this),B=!1)}function X(c){return c instanceof W||c!=null&&c._isAMomentObject!=null}function T(c){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+c)}function C(c,m){var b=!0;return g(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,c),b){var w=[],E,M,J,oe=arguments.length;for(M=0;M<oe;M++){if(E="",typeof arguments[M]=="object"){E+=`
|
|
20
|
+
}`;var Ie=fE(function(){return Ge(P,ce+"return "+ee).apply(r,A)});if(Ie.source=ee,db(Ie))throw Ie;return Ie}function UF(o){return nt(o).toLowerCase()}function HF(o){return nt(o).toUpperCase()}function BF(o,u,p){if(o=nt(o),o&&(p||u===r))return ac(o);if(!o||!(u=Zr(u)))return o;var v=Sr(o),x=Sr(u),P=lp(v,x),A=up(v,x)+1;return $s(v,P,A).join("")}function VF(o,u,p){if(o=nt(o),o&&(p||u===r))return o.slice(0,dp(o)+1);if(!o||!(u=Zr(u)))return o;var v=Sr(o),x=up(v,Sr(u))+1;return $s(v,0,x).join("")}function WF(o,u,p){if(o=nt(o),o&&(p||u===r))return o.replace(Vu,"");if(!o||!(u=Zr(u)))return o;var v=Sr(o),x=lp(v,Sr(u));return $s(v,x).join("")}function zF(o,u){var p=k,v=N;if(Et(u)){var x="separator"in u?u.separator:x;p="length"in u?Ee(u.length):p,v="omission"in u?Zr(u.omission):v}o=nt(o);var P=o.length;if(Rs(o)){var A=Sr(o);P=A.length}if(p>=P)return o;var D=p-hi(v);if(D<1)return v;var H=A?$s(A,0,D).join(""):o.slice(0,D);if(x===r)return H+v;if(A&&(D+=H.length-D),pb(x)){if(o.slice(D).search(x)){var Q,Z=H;for(x.global||(x=nl(x.source,nt(Ud.exec(x))+"g")),x.lastIndex=0;Q=x.exec(Z);)var ee=Q.index;H=H.slice(0,ee===r?D:ee)}}else if(o.indexOf(Zr(x),D)!=D){var ie=H.lastIndexOf(x);ie>-1&&(H=H.slice(0,ie))}return H+v}function JF(o){return o=nt(o),o&&Ha.test(o)?o.replace(Ai,Ky):o}var GF=_l(function(o,u,p){return o+(p?" ":"")+u.toUpperCase()}),yb=fx("toUpperCase");function cE(o,u,p){return o=nt(o),u=p?r:u,u===r?Jy(o)?Xy(o):jy(o):o.match(u)||[]}var fE=Te(function(o,u){try{return yr(o,r,u)}catch(p){return db(p)?p:new be(p)}}),YF=Bi(function(o,u){return vr(u,function(p){p=Un(p),Kr(o,p,cb(o[p],o))}),o});function KF(o){var u=o==null?0:o.length,p=ge();return o=u?ct(o,function(v){if(typeof v[1]!="function")throw new wr(i);return[p(v[0]),v[1]]}):[],Te(function(v){for(var x=-1;++x<u;){var P=o[x];if(yr(P[0],this,v))return yr(P[1],this,v)}})}function QF(o){return $v(or(o,h))}function vb(o){return function(){return o}}function ZF(o,u){return o==null||o!==o?u:o}var XF=px(),eL=px(!0);function Nr(o){return o}function bb(o){return w(typeof o=="function"?o:or(o,h))}function tL(o){return ve(or(o,h))}function rL(o,u){return Me(o,or(u,h))}var nL=Te(function(o,u){return function(p){return jo(p,o,u)}}),iL=Te(function(o,u){return function(p){return jo(o,p,u)}});function Sb(o,u,p){var v=Zt(u),x=Sl(u,v);p==null&&!(Et(u)&&(x.length||!v.length))&&(p=u,u=o,o=this,x=Sl(u,Zt(u)));var P=!(Et(p)&&"chain"in p)||!!p.chain,A=Wi(o);return vr(x,function(D){var H=u[D];o[D]=H,A&&(o.prototype[D]=function(){var Q=this.__chain__;if(P||Q){var Z=o(this.__wrapped__),ee=Z.__actions__=Ar(this.__actions__);return ee.push({func:H,args:arguments,thisArg:o}),Z.__chain__=Q,Z}return H.apply(o,pi([this.value()],arguments))})}),o}function sL(){return Ft._===this&&(Ft._=sv),this}function wb(){}function oL(o){return o=Ee(o),Te(function(u){return jn(u,o)})}var aL=Qv(ct),lL=Qv(sp),uL=Qv(Za);function dE(o){return ib(o)?Eo(Un(o)):j$(o)}function cL(o){return function(u){return o==null?r:Ui(o,u)}}var fL=mx(),dL=mx(!0);function _b(){return[]}function Rb(){return!1}function pL(){return{}}function hL(){return""}function mL(){return!0}function gL(o,u){if(o=Ee(o),o<1||o>et)return[];var p=xe,v=Vt(o,xe);u=ge(u),o-=xe;for(var x=oc(v,u);++p<o;)u(p);return x}function yL(o){return Re(o)?ct(o,Un):Xr(o)?[o]:Ar(Tx(nt(o)))}function vL(o){var u=++nv;return nt(o)+u}var bL=Lp(function(o,u){return o+u},0),SL=Zv("ceil"),wL=Lp(function(o,u){return o/u},1),_L=Zv("floor");function RL(o){return o&&o.length?bl(o,Nr,yc):r}function CL(o,u){return o&&o.length?bl(o,ge(u,2),yc):r}function xL(o){return ap(o,Nr)}function EL(o,u){return ap(o,ge(u,2))}function OL(o){return o&&o.length?bl(o,Nr,J):r}function IL(o,u){return o&&o.length?bl(o,ge(u,2),J):r}var PL=Lp(function(o,u){return o*u},1),kL=Zv("round"),TL=Lp(function(o,u){return o-u},0);function qL(o){return o&&o.length?sc(o,Nr):0}function AL(o,u){return o&&o.length?sc(o,ge(u,2)):0}return O.after=rD,O.ary=Hx,O.assign=BD,O.assignIn=rE,O.assignInWith=nE,O.assignWith=hb,O.at=VD,O.before=Bx,O.bind=cb,O.bindAll=YF,O.bindKey=Vx,O.castArray=hD,O.chain=Lx,O.chunk=RM,O.compact=CM,O.concat=xM,O.cond=KF,O.conforms=QF,O.constant=vb,O.countBy=AN,O.create=WD,O.curry=Wx,O.curryRight=zx,O.debounce=Jx,O.defaults=zD,O.defaultsDeep=JD,O.defer=nD,O.delay=iD,O.difference=EM,O.differenceBy=OM,O.differenceWith=IM,O.drop=PM,O.dropRight=kM,O.dropRightWhile=TM,O.dropWhile=qM,O.fill=AM,O.filter=MN,O.flatMap=FN,O.flatMapDeep=LN,O.flatMapDepth=jN,O.flatten=Mx,O.flattenDeep=$M,O.flattenDepth=MM,O.flip=sD,O.flow=XF,O.flowRight=eL,O.fromPairs=NM,O.functions=eF,O.functionsIn=tF,O.groupBy=UN,O.initial=FM,O.intersection=LM,O.intersectionBy=jM,O.intersectionWith=UM,O.invert=nF,O.invertBy=iF,O.invokeMap=BN,O.iteratee=bb,O.keyBy=VN,O.keys=Zt,O.keysIn=Mr,O.map=zp,O.mapKeys=oF,O.mapValues=aF,O.matches=tL,O.matchesProperty=rL,O.memoize=Gp,O.merge=lF,O.mergeWith=iE,O.method=nL,O.methodOf=iL,O.mixin=Sb,O.negate=Yp,O.nthArg=oL,O.omit=uF,O.omitBy=cF,O.once=oD,O.orderBy=WN,O.over=aL,O.overArgs=aD,O.overEvery=lL,O.overSome=uL,O.partial=fb,O.partialRight=Gx,O.partition=zN,O.pick=fF,O.pickBy=sE,O.property=dE,O.propertyOf=cL,O.pull=WM,O.pullAll=Dx,O.pullAllBy=zM,O.pullAllWith=JM,O.pullAt=GM,O.range=fL,O.rangeRight=dL,O.rearg=lD,O.reject=YN,O.remove=YM,O.rest=uD,O.reverse=lb,O.sampleSize=QN,O.set=pF,O.setWith=hF,O.shuffle=ZN,O.slice=KM,O.sortBy=tD,O.sortedUniq=nN,O.sortedUniqBy=iN,O.split=DF,O.spread=cD,O.tail=sN,O.take=oN,O.takeRight=aN,O.takeRightWhile=lN,O.takeWhile=uN,O.tap=CN,O.throttle=fD,O.thru=Wp,O.toArray=Xx,O.toPairs=oE,O.toPairsIn=aE,O.toPath=yL,O.toPlainObject=tE,O.transform=mF,O.unary=dD,O.union=cN,O.unionBy=fN,O.unionWith=dN,O.uniq=pN,O.uniqBy=hN,O.uniqWith=mN,O.unset=gF,O.unzip=ub,O.unzipWith=Fx,O.update=yF,O.updateWith=vF,O.values=xl,O.valuesIn=bF,O.without=gN,O.words=cE,O.wrap=pD,O.xor=yN,O.xorBy=vN,O.xorWith=bN,O.zip=SN,O.zipObject=wN,O.zipObjectDeep=_N,O.zipWith=RN,O.entries=oE,O.entriesIn=aE,O.extend=rE,O.extendWith=nE,Sb(O,O),O.add=bL,O.attempt=fE,O.camelCase=RF,O.capitalize=lE,O.ceil=SL,O.clamp=SF,O.clone=mD,O.cloneDeep=yD,O.cloneDeepWith=vD,O.cloneWith=gD,O.conformsTo=bD,O.deburr=uE,O.defaultTo=ZF,O.divide=wL,O.endsWith=CF,O.eq=Hn,O.escape=xF,O.escapeRegExp=EF,O.every=$N,O.find=NN,O.findIndex=Ax,O.findKey=GD,O.findLast=DN,O.findLastIndex=$x,O.findLastKey=YD,O.floor=_L,O.forEach=jx,O.forEachRight=Ux,O.forIn=KD,O.forInRight=QD,O.forOwn=ZD,O.forOwnRight=XD,O.get=mb,O.gt=SD,O.gte=wD,O.has=rF,O.hasIn=gb,O.head=Nx,O.identity=Nr,O.includes=HN,O.indexOf=DM,O.inRange=wF,O.invoke=sF,O.isArguments=Vo,O.isArray=Re,O.isArrayBuffer=_D,O.isArrayLike=$r,O.isArrayLikeObject=Mt,O.isBoolean=RD,O.isBuffer=Ms,O.isDate=CD,O.isElement=xD,O.isEmpty=ED,O.isEqual=OD,O.isEqualWith=ID,O.isError=db,O.isFinite=PD,O.isFunction=Wi,O.isInteger=Yx,O.isLength=Kp,O.isMap=Kx,O.isMatch=kD,O.isMatchWith=TD,O.isNaN=qD,O.isNative=AD,O.isNil=MD,O.isNull=$D,O.isNumber=Qx,O.isObject=Et,O.isObjectLike=Pt,O.isPlainObject=Rc,O.isRegExp=pb,O.isSafeInteger=ND,O.isSet=Zx,O.isString=Qp,O.isSymbol=Xr,O.isTypedArray=Cl,O.isUndefined=DD,O.isWeakMap=FD,O.isWeakSet=LD,O.join=HM,O.kebabCase=OF,O.last=yn,O.lastIndexOf=BM,O.lowerCase=IF,O.lowerFirst=PF,O.lt=jD,O.lte=UD,O.max=RL,O.maxBy=CL,O.mean=xL,O.meanBy=EL,O.min=OL,O.minBy=IL,O.stubArray=_b,O.stubFalse=Rb,O.stubObject=pL,O.stubString=hL,O.stubTrue=mL,O.multiply=PL,O.nth=VM,O.noConflict=sL,O.noop=wb,O.now=Jp,O.pad=kF,O.padEnd=TF,O.padStart=qF,O.parseInt=AF,O.random=_F,O.reduce=JN,O.reduceRight=GN,O.repeat=$F,O.replace=MF,O.result=dF,O.round=kL,O.runInContext=L,O.sample=KN,O.size=XN,O.snakeCase=NF,O.some=eD,O.sortedIndex=QM,O.sortedIndexBy=ZM,O.sortedIndexOf=XM,O.sortedLastIndex=eN,O.sortedLastIndexBy=tN,O.sortedLastIndexOf=rN,O.startCase=FF,O.startsWith=LF,O.subtract=TL,O.sum=qL,O.sumBy=AL,O.template=jF,O.times=gL,O.toFinite=zi,O.toInteger=Ee,O.toLength=eE,O.toLower=UF,O.toNumber=vn,O.toSafeInteger=HD,O.toString=nt,O.toUpper=HF,O.trim=BF,O.trimEnd=VF,O.trimStart=WF,O.truncate=zF,O.unescape=JF,O.uniqueId=vL,O.upperCase=GF,O.upperFirst=yb,O.each=jx,O.eachRight=Ux,O.first=Nx,Sb(O,(function(){var o={};return mn(O,function(u,p){Ze.call(O.prototype,p)||(o[p]=u)}),o})(),{chain:!1}),O.VERSION=e,vr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){O[o].placeholder=O}),vr(["drop","take"],function(o,u){$e.prototype[o]=function(p){p=p===r?1:yt(Ee(p),0);var v=this.__filtered__&&!u?new $e(this):this.clone();return v.__filtered__?v.__takeCount__=Vt(p,v.__takeCount__):v.__views__.push({size:Vt(p,xe),type:o+(v.__dir__<0?"Right":"")}),v},$e.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),vr(["filter","map","takeWhile"],function(o,u){var p=u+1,v=p==G||p==ne;$e.prototype[o]=function(x){var P=this.clone();return P.__iteratees__.push({iteratee:ge(x,3),type:p}),P.__filtered__=P.__filtered__||v,P}}),vr(["head","last"],function(o,u){var p="take"+(u?"Right":"");$e.prototype[o]=function(){return this[p](1).value()[0]}}),vr(["initial","tail"],function(o,u){var p="drop"+(u?"":"Right");$e.prototype[o]=function(){return this.__filtered__?new $e(this):this[p](1)}}),$e.prototype.compact=function(){return this.filter(Nr)},$e.prototype.find=function(o){return this.filter(o).head()},$e.prototype.findLast=function(o){return this.reverse().find(o)},$e.prototype.invokeMap=Te(function(o,u){return typeof o=="function"?new $e(this):this.map(function(p){return jo(p,o,u)})}),$e.prototype.reject=function(o){return this.filter(Yp(ge(o)))},$e.prototype.slice=function(o,u){o=Ee(o);var p=this;return p.__filtered__&&(o>0||u<0)?new $e(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),u!==r&&(u=Ee(u),p=u<0?p.dropRight(-u):p.take(u-o)),p)},$e.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},$e.prototype.toArray=function(){return this.take(xe)},mn($e.prototype,function(o,u){var p=/^(?:filter|find|map|reject)|While$/.test(u),v=/^(?:head|last)$/.test(u),x=O[v?"take"+(u=="last"?"Right":""):u],P=v||/^find/.test(u);x&&(O.prototype[u]=function(){var A=this.__wrapped__,D=v?[1]:arguments,H=A instanceof $e,Q=D[0],Z=H||Re(A),ee=function(Le){var He=x.apply(O,pi([Le],D));return v&&ie?He[0]:He};Z&&p&&typeof Q=="function"&&Q.length!=1&&(H=Z=!1);var ie=this.__chain__,ce=!!this.__actions__.length,ye=P&&!ie,Ie=H&&!ce;if(!P&&Z){A=Ie?A:new $e(this);var me=o.apply(A,D);return me.__actions__.push({func:Wp,args:[ee],thisArg:r}),new sr(me,ie)}return ye&&Ie?o.apply(this,D):(me=this.thru(ee),ye?v?me.value()[0]:me.value():me)})}),vr(["pop","push","shift","sort","splice","unshift"],function(o){var u=Po[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",v=/^(?:pop|shift)$/.test(o);O.prototype[o]=function(){var x=arguments;if(v&&!this.__chain__){var P=this.value();return u.apply(Re(P)?P:[],x)}return this[p](function(A){return u.apply(Re(A)?A:[],x)})}}),mn($e.prototype,function(o,u){var p=O[u];if(p){var v=p.name+"";Ze.call(Os,v)||(Os[v]=[]),Os[v].push({name:u,func:p})}}),Os[Fp(r,I).name]=[{name:"wrapper",func:r}],$e.prototype.clone=yv,$e.prototype.reverse=vv,$e.prototype.value=fc,O.prototype.at=xN,O.prototype.chain=EN,O.prototype.commit=ON,O.prototype.next=IN,O.prototype.plant=kN,O.prototype.reverse=TN,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=qN,O.prototype.first=O.prototype.head,qo&&(O.prototype[qo]=PN),O}),mi=ev();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ft._=mi,define(function(){return mi})):Qe?((Qe.exports=mi)._=mi,Ya._=mi):Ft._=mi}).call(kl)});var AE=F((Lb,Tl)=>{(function(r,e){typeof Lb=="object"&&typeof Tl<"u"?Tl.exports=e():typeof define=="function"&&define.amd?define(e):r.moment=e()})(Lb,(function(){"use strict";var r;function e(){return r.apply(null,arguments)}function t(c){r=c}function n(c){return c instanceof Array||Object.prototype.toString.call(c)==="[object Array]"}function i(c){return c!=null&&Object.prototype.toString.call(c)==="[object Object]"}function s(c,m){return Object.prototype.hasOwnProperty.call(c,m)}function a(c){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(c).length===0;var m;for(m in c)if(s(c,m))return!1;return!0}function l(c){return c===void 0}function f(c){return typeof c=="number"||Object.prototype.toString.call(c)==="[object Number]"}function d(c){return c instanceof Date||Object.prototype.toString.call(c)==="[object Date]"}function h(c,m){var b=[],w,E=c.length;for(w=0;w<E;++w)b.push(m(c[w],w));return b}function g(c,m){for(var b in m)s(m,b)&&(c[b]=m[b]);return s(m,"toString")&&(c.toString=m.toString),s(m,"valueOf")&&(c.valueOf=m.valueOf),c}function y(c,m,b,w){return tl(c,m,b,w,!0).utc()}function S(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function _(c){return c._pf==null&&(c._pf=S()),c._pf}var R;Array.prototype.some?R=Array.prototype.some:R=function(c){var m=Object(this),b=m.length>>>0,w;for(w=0;w<b;w++)if(w in m&&c.call(this,m[w],w,m))return!0;return!1};function I(c){var m=null,b=!1,w=c._d&&!isNaN(c._d.getTime());if(w&&(m=_(c),b=R.call(m.parsedDateParts,function(E){return E!=null}),w=m.overflow<0&&!m.empty&&!m.invalidEra&&!m.invalidMonth&&!m.invalidWeekday&&!m.weekdayMismatch&&!m.nullInput&&!m.invalidFormat&&!m.userInvalidated&&(!m.meridiem||m.meridiem&&b),c._strict&&(w=w&&m.charsLeftOver===0&&m.unusedTokens.length===0&&m.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(c))c._isValid=w;else return w;return c._isValid}function q(c){var m=y(NaN);return c!=null?g(_(m),c):_(m).userInvalidated=!0,m}var j=e.momentProperties=[],B=!1;function V(c,m){var b,w,E,M=j.length;if(l(m._isAMomentObject)||(c._isAMomentObject=m._isAMomentObject),l(m._i)||(c._i=m._i),l(m._f)||(c._f=m._f),l(m._l)||(c._l=m._l),l(m._strict)||(c._strict=m._strict),l(m._tzm)||(c._tzm=m._tzm),l(m._isUTC)||(c._isUTC=m._isUTC),l(m._offset)||(c._offset=m._offset),l(m._pf)||(c._pf=_(m)),l(m._locale)||(c._locale=m._locale),M>0)for(b=0;b<M;b++)w=j[b],E=m[w],l(E)||(c[w]=E);return c}function W(c){V(this,c),this._d=new Date(c._d!=null?c._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),B===!1&&(B=!0,e.updateOffset(this),B=!1)}function X(c){return c instanceof W||c!=null&&c._isAMomentObject!=null}function T(c){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+c)}function C(c,m){var b=!0;return g(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,c),b){var w=[],E,M,J,oe=arguments.length;for(M=0;M<oe;M++){if(E="",typeof arguments[M]=="object"){E+=`
|
|
21
21
|
[`+M+"] ";for(J in arguments[0])s(arguments[0],J)&&(E+=J+": "+arguments[0][J]+", ");E=E.slice(0,-2)}else E=arguments[M];w.push(E)}T(c+`
|
|
22
22
|
Arguments: `+Array.prototype.slice.call(w).join("")+`
|
|
23
|
-
`+new Error().stack),b=!1}return m.apply(this,arguments)},m)}var k={};function N(c,m){e.deprecationHandler!=null&&e.deprecationHandler(c,m),k[c]||(T(m),k[c]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function j(c){return typeof Function<"u"&&c instanceof Function||Object.prototype.toString.call(c)==="[object Function]"}function $(c){var m,b;for(b in c)s(c,b)&&(m=c[b],j(m)?this[b]=m:this["_"+b]=m);this._config=c,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function G(c,m){var b=g({},c),w;for(w in m)s(m,w)&&(i(c[w])&&i(m[w])?(b[w]={},g(b[w],c[w]),g(b[w],m[w])):m[w]!=null?b[w]=m[w]:delete b[w]);for(w in c)s(c,w)&&!s(m,w)&&i(c[w])&&(b[w]=g({},b[w]));return b}function K(c){c!=null&&this.set(c)}var ne;Object.keys?ne=Object.keys:ne=function(c){var m,b=[];for(m in c)s(c,m)&&b.push(m);return b};var pe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function et(c,m,b){var w=this._calendar[c]||this._calendar.sameElse;return j(w)?w.call(m,b):w}function _e(c,m,b){var w=""+Math.abs(c),E=m-w.length,M=c>=0;return(M?b?"+":"":"-")+Math.pow(10,Math.max(0,E)).toString().substr(1)+w}var he=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,xe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,bt={},It={};function ue(c,m,b,w){var E=w;typeof w=="string"&&(E=function(){return this[w]()}),c&&(It[c]=E),m&&(It[m[0]]=function(){return _e(E.apply(this,arguments),m[1],m[2])}),b&&(It[b]=function(){return this.localeData().ordinal(E.apply(this,arguments),c)})}function mr(c){return c.match(/\[[\s\S]/)?c.replace(/^\[|\]$/g,""):c.replace(/\\/g,"")}function fi(c){var m=c.match(he),b,w;for(b=0,w=m.length;b<w;b++)It[m[b]]?m[b]=It[m[b]]:m[b]=mr(m[b]);return function(E){var M="",J;for(J=0;J<w;J++)M+=j(m[J])?m[J].call(E,c):m[J];return M}}function Ct(c,m){return c.isValid()?(m=Gr(m,c.localeData()),bt[m]=bt[m]||fi(m),bt[m](c)):c.localeData().invalidDate()}function Gr(c,m){var b=5;function w(E){return m.longDateFormat(E)||E}for(xe.lastIndex=0;b>=0&&xe.test(c);)c=c.replace(xe,w),xe.lastIndex=0,b-=1;return c}var Pr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function mt(c){var m=this._longDateFormat[c],b=this._longDateFormat[c.toUpperCase()];return m||!b?m:(this._longDateFormat[c]=b.match(he).map(function(w){return w==="MMMM"||w==="MM"||w==="DD"||w==="dddd"?w.slice(1):w}).join(""),this._longDateFormat[c])}var gt="Invalid date";function ln(){return this._invalidDate}var ho="%d",Yt=/\d{1,2}/;function mo(c){return this._ordinal.replace("%d",c)}var ly={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Tn(c,m,b,w){var E=this._relativeTime[b];return j(E)?E(c,m,b,w):E.replace(/%d/i,c)}function Fd(c,m){var b=this._relativeTime[c>0?"future":"past"];return j(b)?b(m):b.replace(/%s/i,m)}var Ld={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Kt(c){return typeof c=="string"?Ld[c]||Ld[c.toLowerCase()]:void 0}function gr(c){var m={},b,w;for(w in c)s(c,w)&&(b=Kt(w),b&&(m[b]=c[w]));return m}var go={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Da(c){var m=[],b;for(b in c)s(c,b)&&m.push({unit:b,priority:go[b]});return m.sort(function(w,E){return w.priority-E.priority}),m}var jd=/\d/,Bt=/\d\d/,Ud=/\d{3}/,qi=/\d{4}/,qn=/[+-]?\d{6}/,at=/\d\d?/,Fa=/\d\d\d\d?/,La=/\d\d\d\d\d\d?/,ms=/\d{1,3}/,yo=/\d{1,4}/,gs=/[+-]?\d{1,6}/,di=/\d+/,ys=/[+-]?\d+/,Bu=/Z|[+-]\d\d:?\d\d/gi,ja=/Z|[+-]\d\d(?::?\d\d)?/gi,uy=/[+-]?\d+(\.\d{1,3})?/,vo=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ai=/^[1-9]\d?/,Ua=/^([1-9]\d|\d)/,Ha;Ha={};function le(c,m,b){Ha[c]=j(m)?m:function(w,E){return w&&b?b:m}}function cy(c,m){return s(Ha,c)?Ha[c](m._strict,m._locale):new RegExp(fy(c))}function fy(c){return un(c.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(m,b,w,E,M){return b||w||E||M}))}function un(c){return c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function kr(c){return c<0?Math.ceil(c)||0:Math.floor(c)}function Ae(c){var m=+c,b=0;return m!==0&&isFinite(m)&&(b=kr(m)),b}var Vu={};function Ke(c,m){var b,w=m,E;for(typeof c=="string"&&(c=[c]),f(m)&&(w=function(M,J){J[m]=Ae(M)}),E=c.length,b=0;b<E;b++)Vu[c[b]]=w}function bo(c,m){Ke(c,function(b,w,E,M){E._w=E._w||{},m(b,E._w,E,M)})}function Wu(c,m,b){m!=null&&s(Vu,c)&&Vu[c](m,b._a,b,c)}function Ba(c){return c%4===0&&c%100!==0||c%400===0}var Qt=0,An=1,cn=2,$t=3,Tr=4,$n=5,$i=6,Hd=7,dy=8;ue("Y",0,0,function(){var c=this.year();return c<=9999?_e(c,4):"+"+c}),ue(0,["YY",2],0,function(){return this.year()%100}),ue(0,["YYYY",4],0,"year"),ue(0,["YYYYY",5],0,"year"),ue(0,["YYYYYY",6,!0],0,"year"),le("Y",ys),le("YY",at,Bt),le("YYYY",yo,qi),le("YYYYY",gs,qn),le("YYYYYY",gs,qn),Ke(["YYYYY","YYYYYY"],Qt),Ke("YYYY",function(c,m){m[Qt]=c.length===2?e.parseTwoDigitYear(c):Ae(c)}),Ke("YY",function(c,m){m[Qt]=e.parseTwoDigitYear(c)}),Ke("Y",function(c,m){m[Qt]=parseInt(c,10)});function So(c){return Ba(c)?366:365}e.parseTwoDigitYear=function(c){return Ae(c)+(Ae(c)>68?1900:2e3)};var Bd=vs("FullYear",!0);function py(){return Ba(this.year())}function vs(c,m){return function(b){return b!=null?(_o(this,c,b),e.updateOffset(this,m),this):wo(this,c)}}function wo(c,m){if(!c.isValid())return NaN;var b=c._d,w=c._isUTC;switch(m){case"Milliseconds":return w?b.getUTCMilliseconds():b.getMilliseconds();case"Seconds":return w?b.getUTCSeconds():b.getSeconds();case"Minutes":return w?b.getUTCMinutes():b.getMinutes();case"Hours":return w?b.getUTCHours():b.getHours();case"Date":return w?b.getUTCDate():b.getDate();case"Day":return w?b.getUTCDay():b.getDay();case"Month":return w?b.getUTCMonth():b.getMonth();case"FullYear":return w?b.getUTCFullYear():b.getFullYear();default:return NaN}}function _o(c,m,b){var w,E,M,J,oe;if(!(!c.isValid()||isNaN(b))){switch(w=c._d,E=c._isUTC,m){case"Milliseconds":return void(E?w.setUTCMilliseconds(b):w.setMilliseconds(b));case"Seconds":return void(E?w.setUTCSeconds(b):w.setSeconds(b));case"Minutes":return void(E?w.setUTCMinutes(b):w.setMinutes(b));case"Hours":return void(E?w.setUTCHours(b):w.setHours(b));case"Date":return void(E?w.setUTCDate(b):w.setDate(b));case"FullYear":break;default:return}M=b,J=c.month(),oe=c.date(),oe=oe===29&&J===1&&!Ba(M)?28:oe,E?w.setUTCFullYear(M,J,oe):w.setFullYear(M,J,oe)}}function hy(c){return c=Kt(c),j(this[c])?this[c]():this}function Va(c,m){if(typeof c=="object"){c=gr(c);var b=Da(c),w,E=b.length;for(w=0;w<E;w++)this[b[w].unit](c[b[w].unit])}else if(c=Kt(c),j(this[c]))return this[c](m);return this}function my(c,m){return(c%m+m)%m}var xt;Array.prototype.indexOf?xt=Array.prototype.indexOf:xt=function(c){var m;for(m=0;m<this.length;++m)if(this[m]===c)return m;return-1};function zu(c,m){if(isNaN(c)||isNaN(m))return NaN;var b=my(m,12);return c+=(m-b)/12,b===1?Ba(c)?29:28:31-b%7%2}ue("M",["MM",2],"Mo",function(){return this.month()+1}),ue("MMM",0,0,function(c){return this.localeData().monthsShort(this,c)}),ue("MMMM",0,0,function(c){return this.localeData().months(this,c)}),le("M",at,Ai),le("MM",at,Bt),le("MMM",function(c,m){return m.monthsShortRegex(c)}),le("MMMM",function(c,m){return m.monthsRegex(c)}),Ke(["M","MM"],function(c,m){m[An]=Ae(c)-1}),Ke(["MMM","MMMM"],function(c,m,b,w){var E=b._locale.monthsParse(c,w,b._strict);E!=null?m[An]=E:_(b).invalidMonth=c});var Vd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ju="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Gu=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,gy=vo,yy=vo;function vy(c,m){return c?n(this._months)?this._months[c.month()]:this._months[(this._months.isFormat||Gu).test(m)?"format":"standalone"][c.month()]:n(this._months)?this._months:this._months.standalone}function by(c,m){return c?n(this._monthsShort)?this._monthsShort[c.month()]:this._monthsShort[Gu.test(m)?"format":"standalone"][c.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Wd(c,m,b){var w,E,M,J=c.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],w=0;w<12;++w)M=y([2e3,w]),this._shortMonthsParse[w]=this.monthsShort(M,"").toLocaleLowerCase(),this._longMonthsParse[w]=this.months(M,"").toLocaleLowerCase();return b?m==="MMM"?(E=xt.call(this._shortMonthsParse,J),E!==-1?E:null):(E=xt.call(this._longMonthsParse,J),E!==-1?E:null):m==="MMM"?(E=xt.call(this._shortMonthsParse,J),E!==-1?E:(E=xt.call(this._longMonthsParse,J),E!==-1?E:null)):(E=xt.call(this._longMonthsParse,J),E!==-1?E:(E=xt.call(this._shortMonthsParse,J),E!==-1?E:null))}function zd(c,m,b){var w,E,M;if(this._monthsParseExact)return Wd.call(this,c,m,b);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),w=0;w<12;w++){if(E=y([2e3,w]),b&&!this._longMonthsParse[w]&&(this._longMonthsParse[w]=new RegExp("^"+this.months(E,"").replace(".","")+"$","i"),this._shortMonthsParse[w]=new RegExp("^"+this.monthsShort(E,"").replace(".","")+"$","i")),!b&&!this._monthsParse[w]&&(M="^"+this.months(E,"")+"|^"+this.monthsShort(E,""),this._monthsParse[w]=new RegExp(M.replace(".",""),"i")),b&&m==="MMMM"&&this._longMonthsParse[w].test(c))return w;if(b&&m==="MMM"&&this._shortMonthsParse[w].test(c))return w;if(!b&&this._monthsParse[w].test(c))return w}}function Yu(c,m){if(!c.isValid())return c;if(typeof m=="string"){if(/^\d+$/.test(m))m=Ae(m);else if(m=c.localeData().monthsParse(m),!f(m))return c}var b=m,w=c.date();return w=w<29?w:Math.min(w,zu(c.year(),b)),c._isUTC?c._d.setUTCMonth(b,w):c._d.setMonth(b,w),c}function Wa(c){return c!=null?(Yu(this,c),e.updateOffset(this,!0),this):wo(this,"Month")}function Sy(){return zu(this.year(),this.month())}function Jd(c){return this._monthsParseExact?(s(this,"_monthsRegex")||Ku.call(this),c?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=gy),this._monthsShortStrictRegex&&c?this._monthsShortStrictRegex:this._monthsShortRegex)}function za(c){return this._monthsParseExact?(s(this,"_monthsRegex")||Ku.call(this),c?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=yy),this._monthsStrictRegex&&c?this._monthsStrictRegex:this._monthsRegex)}function Ku(){function c(ve,Me){return Me.length-ve.length}var m=[],b=[],w=[],E,M,J,oe;for(E=0;E<12;E++)M=y([2e3,E]),J=un(this.monthsShort(M,"")),oe=un(this.months(M,"")),m.push(J),b.push(oe),w.push(oe),w.push(J);m.sort(c),b.sort(c),w.sort(c),this._monthsRegex=new RegExp("^("+w.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+m.join("|")+")","i")}function wy(c,m,b,w,E,M,J){var oe;return c<100&&c>=0?(oe=new Date(c+400,m,b,w,E,M,J),isFinite(oe.getFullYear())&&oe.setFullYear(c)):oe=new Date(c,m,b,w,E,M,J),oe}function bs(c){var m,b;return c<100&&c>=0?(b=Array.prototype.slice.call(arguments),b[0]=c+400,m=new Date(Date.UTC.apply(null,b)),isFinite(m.getUTCFullYear())&&m.setUTCFullYear(c)):m=new Date(Date.UTC.apply(null,arguments)),m}function Ro(c,m,b){var w=7+m-b,E=(7+bs(c,0,w).getUTCDay()-m)%7;return-E+w-1}function Ja(c,m,b,w,E){var M=(7+b-w)%7,J=Ro(c,w,E),oe=1+7*(m-1)+M+J,ve,Me;return oe<=0?(ve=c-1,Me=So(ve)+oe):oe>So(c)?(ve=c+1,Me=oe-So(c)):(ve=c,Me=oe),{year:ve,dayOfYear:Me}}function Co(c,m,b){var w=Ro(c.year(),m,b),E=Math.floor((c.dayOfYear()-w-1)/7)+1,M,J;return E<1?(J=c.year()-1,M=E+fn(J,m,b)):E>fn(c.year(),m,b)?(M=E-fn(c.year(),m,b),J=c.year()+1):(J=c.year(),M=E),{week:M,year:J}}function fn(c,m,b){var w=Ro(c,m,b),E=Ro(c+1,m,b);return(So(c)-w+E)/7}ue("w",["ww",2],"wo","week"),ue("W",["WW",2],"Wo","isoWeek"),le("w",at,Ai),le("ww",at,Bt),le("W",at,Ai),le("WW",at,Bt),bo(["w","ww","W","WW"],function(c,m,b,w){m[w.substr(0,1)]=Ae(c)});function Qu(c){return Co(c,this._week.dow,this._week.doy).week}var Zu={dow:0,doy:6};function Ss(){return this._week.dow}function Gd(){return this._week.doy}function Yd(c){var m=this.localeData().week(this);return c==null?m:this.add((c-m)*7,"d")}function _y(c){var m=Co(this,1,4).week;return c==null?m:this.add((c-m)*7,"d")}ue("d",0,"do","day"),ue("dd",0,0,function(c){return this.localeData().weekdaysMin(this,c)}),ue("ddd",0,0,function(c){return this.localeData().weekdaysShort(this,c)}),ue("dddd",0,0,function(c){return this.localeData().weekdays(this,c)}),ue("e",0,0,"weekday"),ue("E",0,0,"isoWeekday"),le("d",at),le("e",at),le("E",at),le("dd",function(c,m){return m.weekdaysMinRegex(c)}),le("ddd",function(c,m){return m.weekdaysShortRegex(c)}),le("dddd",function(c,m){return m.weekdaysRegex(c)}),bo(["dd","ddd","dddd"],function(c,m,b,w){var E=b._locale.weekdaysParse(c,w,b._strict);E!=null?m.d=E:_(b).invalidWeekday=c}),bo(["d","e","E"],function(c,m,b,w){m[w]=Ae(c)});function Kd(c,m){return typeof c!="string"?c:isNaN(c)?(c=m.weekdaysParse(c),typeof c=="number"?c:null):parseInt(c,10)}function Qd(c,m){return typeof c=="string"?m.weekdaysParse(c)%7||7:isNaN(c)?null:c}function Ga(c,m){return c.slice(m,7).concat(c.slice(0,m))}var Zd="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Xd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ry="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Cy=vo,ep=vo,xy=vo;function Ey(c,m){var b=n(this._weekdays)?this._weekdays:this._weekdays[c&&c!==!0&&this._weekdays.isFormat.test(m)?"format":"standalone"];return c===!0?Ga(b,this._week.dow):c?b[c.day()]:b}function Oy(c){return c===!0?Ga(this._weekdaysShort,this._week.dow):c?this._weekdaysShort[c.day()]:this._weekdaysShort}function Iy(c){return c===!0?Ga(this._weekdaysMin,this._week.dow):c?this._weekdaysMin[c.day()]:this._weekdaysMin}function Xu(c,m,b){var w,E,M,J=c.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],w=0;w<7;++w)M=y([2e3,1]).day(w),this._minWeekdaysParse[w]=this.weekdaysMin(M,"").toLocaleLowerCase(),this._shortWeekdaysParse[w]=this.weekdaysShort(M,"").toLocaleLowerCase(),this._weekdaysParse[w]=this.weekdays(M,"").toLocaleLowerCase();return b?m==="dddd"?(E=xt.call(this._weekdaysParse,J),E!==-1?E:null):m==="ddd"?(E=xt.call(this._shortWeekdaysParse,J),E!==-1?E:null):(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null):m==="dddd"?(E=xt.call(this._weekdaysParse,J),E!==-1||(E=xt.call(this._shortWeekdaysParse,J),E!==-1)?E:(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null)):m==="ddd"?(E=xt.call(this._shortWeekdaysParse,J),E!==-1||(E=xt.call(this._weekdaysParse,J),E!==-1)?E:(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null)):(E=xt.call(this._minWeekdaysParse,J),E!==-1||(E=xt.call(this._weekdaysParse,J),E!==-1)?E:(E=xt.call(this._shortWeekdaysParse,J),E!==-1?E:null))}function Py(c,m,b){var w,E,M;if(this._weekdaysParseExact)return Xu.call(this,c,m,b);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),w=0;w<7;w++){if(E=y([2e3,1]).day(w),b&&!this._fullWeekdaysParse[w]&&(this._fullWeekdaysParse[w]=new RegExp("^"+this.weekdays(E,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[w]=new RegExp("^"+this.weekdaysShort(E,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[w]=new RegExp("^"+this.weekdaysMin(E,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[w]||(M="^"+this.weekdays(E,"")+"|^"+this.weekdaysShort(E,"")+"|^"+this.weekdaysMin(E,""),this._weekdaysParse[w]=new RegExp(M.replace(".",""),"i")),b&&m==="dddd"&&this._fullWeekdaysParse[w].test(c))return w;if(b&&m==="ddd"&&this._shortWeekdaysParse[w].test(c))return w;if(b&&m==="dd"&&this._minWeekdaysParse[w].test(c))return w;if(!b&&this._weekdaysParse[w].test(c))return w}}function ky(c){if(!this.isValid())return c!=null?this:NaN;var m=wo(this,"Day");return c!=null?(c=Kd(c,this.localeData()),this.add(c-m,"d")):m}function Ty(c){if(!this.isValid())return c!=null?this:NaN;var m=(this.day()+7-this.localeData()._week.dow)%7;return c==null?m:this.add(c-m,"d")}function qy(c){if(!this.isValid())return c!=null?this:NaN;if(c!=null){var m=Qd(c,this.localeData());return this.day(this.day()%7?m:m-7)}else return this.day()||7}function Ay(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||ec.call(this),c?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Cy),this._weekdaysStrictRegex&&c?this._weekdaysStrictRegex:this._weekdaysRegex)}function dt(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||ec.call(this),c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ep),this._weekdaysShortStrictRegex&&c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function ut(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||ec.call(this),c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=xy),this._weekdaysMinStrictRegex&&c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ec(){function c(Lt,jn){return jn.length-Lt.length}var m=[],b=[],w=[],E=[],M,J,oe,ve,Me;for(M=0;M<7;M++)J=y([2e3,1]).day(M),oe=un(this.weekdaysMin(J,"")),ve=un(this.weekdaysShort(J,"")),Me=un(this.weekdays(J,"")),m.push(oe),b.push(ve),w.push(Me),E.push(oe),E.push(ve),E.push(Me);m.sort(c),b.sort(c),w.sort(c),E.sort(c),this._weekdaysRegex=new RegExp("^("+E.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+m.join("|")+")","i")}function tc(){return this.hours()%12||12}function $y(){return this.hours()||24}ue("H",["HH",2],0,"hour"),ue("h",["hh",2],0,tc),ue("k",["kk",2],0,$y),ue("hmm",0,0,function(){return""+tc.apply(this)+_e(this.minutes(),2)}),ue("hmmss",0,0,function(){return""+tc.apply(this)+_e(this.minutes(),2)+_e(this.seconds(),2)}),ue("Hmm",0,0,function(){return""+this.hours()+_e(this.minutes(),2)}),ue("Hmmss",0,0,function(){return""+this.hours()+_e(this.minutes(),2)+_e(this.seconds(),2)});function tp(c,m){ue(c,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),m)})}tp("a",!0),tp("A",!1);function rp(c,m){return m._meridiemParse}le("a",rp),le("A",rp),le("H",at,Ua),le("h",at,Ai),le("k",at,Ai),le("HH",at,Bt),le("hh",at,Bt),le("kk",at,Bt),le("hmm",Fa),le("hmmss",La),le("Hmm",Fa),le("Hmmss",La),Ke(["H","HH"],$t),Ke(["k","kk"],function(c,m,b){var w=Ae(c);m[$t]=w===24?0:w}),Ke(["a","A"],function(c,m,b){b._isPm=b._locale.isPM(c),b._meridiem=c}),Ke(["h","hh"],function(c,m,b){m[$t]=Ae(c),_(b).bigHour=!0}),Ke("hmm",function(c,m,b){var w=c.length-2;m[$t]=Ae(c.substr(0,w)),m[Tr]=Ae(c.substr(w)),_(b).bigHour=!0}),Ke("hmmss",function(c,m,b){var w=c.length-4,E=c.length-2;m[$t]=Ae(c.substr(0,w)),m[Tr]=Ae(c.substr(w,2)),m[$n]=Ae(c.substr(E)),_(b).bigHour=!0}),Ke("Hmm",function(c,m,b){var w=c.length-2;m[$t]=Ae(c.substr(0,w)),m[Tr]=Ae(c.substr(w))}),Ke("Hmmss",function(c,m,b){var w=c.length-4,E=c.length-2;m[$t]=Ae(c.substr(0,w)),m[Tr]=Ae(c.substr(w,2)),m[$n]=Ae(c.substr(E))});function My(c){return(c+"").toLowerCase().charAt(0)==="p"}var np=/[ap]\.?m?\.?/i,Ny=vs("Hours",!0);function Ft(c,m,b){return c>11?b?"pm":"PM":b?"am":"AM"}var Ya={calendar:pe,longDateFormat:Pr,invalidDate:gt,ordinal:ho,dayOfMonthOrdinalParse:Yt,relativeTime:ly,months:Vd,monthsShort:Ju,week:Zu,weekdays:Zd,weekdaysMin:Ry,weekdaysShort:Xd,meridiemParse:np},Qe={},ws={},Mi;function qr(c,m){var b,w=Math.min(c.length,m.length);for(b=0;b<w;b+=1)if(c[b]!==m[b])return b;return w}function rc(c){return c&&c.toLowerCase().replace("_","-")}function ip(c){for(var m=0,b,w,E,M;m<c.length;){for(M=rc(c[m]).split("-"),b=M.length,w=rc(c[m+1]),w=w?w.split("-"):null;b>0;){if(E=xo(M.slice(0,b).join("-")),E)return E;if(w&&w.length>=b&&qr(M,w)>=b-1)break;b--}m++}return Mi}function sp(c){return!!(c&&c.match("^[^/\\\\]*$"))}function xo(c){var m=null,b;if(Qe[c]===void 0&&typeof Tl<"u"&&Tl&&Tl.exports&&sp(c))try{m=Mi._abbr,b=it,b("./locale/"+c),Mn(m)}catch{Qe[c]=null}return Qe[c]}function Mn(c,m){var b;return c&&(l(m)?b=Nn(c):b=Ka(c,m),b?Mi=b:typeof console<"u"&&console.warn&&console.warn("Locale "+c+" not found. Did you forget to load it?")),Mi._abbr}function Ka(c,m){if(m!==null){var b,w=Ya;if(m.abbr=c,Qe[c]!=null)N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),w=Qe[c]._config;else if(m.parentLocale!=null)if(Qe[m.parentLocale]!=null)w=Qe[m.parentLocale]._config;else if(b=xo(m.parentLocale),b!=null)w=b._config;else return ws[m.parentLocale]||(ws[m.parentLocale]=[]),ws[m.parentLocale].push({name:c,config:m}),null;return Qe[c]=new K(G(w,m)),ws[c]&&ws[c].forEach(function(E){Ka(E.name,E.config)}),Mn(c),Qe[c]}else return delete Qe[c],null}function yr(c,m){if(m!=null){var b,w,E=Ya;Qe[c]!=null&&Qe[c].parentLocale!=null?Qe[c].set(G(Qe[c]._config,m)):(w=xo(c),w!=null&&(E=w._config),m=G(E,m),w==null&&(m.abbr=c),b=new K(m),b.parentLocale=Qe[c],Qe[c]=b),Mn(c)}else Qe[c]!=null&&(Qe[c].parentLocale!=null?(Qe[c]=Qe[c].parentLocale,c===Mn()&&Mn(c)):Qe[c]!=null&&delete Qe[c]);return Qe[c]}function Nn(c){var m;if(c&&c._locale&&c._locale._abbr&&(c=c._locale._abbr),!c)return Mi;if(!n(c)){if(m=xo(c),m)return m;c=[c]}return ip(c)}function vr(){return ne(Qe)}function nc(c){var m,b=c._a;return b&&_(c).overflow===-2&&(m=b[An]<0||b[An]>11?An:b[cn]<1||b[cn]>zu(b[Qt],b[An])?cn:b[$t]<0||b[$t]>24||b[$t]===24&&(b[Tr]!==0||b[$n]!==0||b[$i]!==0)?$t:b[Tr]<0||b[Tr]>59?Tr:b[$n]<0||b[$n]>59?$n:b[$i]<0||b[$i]>999?$i:-1,_(c)._overflowDayOfYear&&(m<Qt||m>cn)&&(m=cn),_(c)._overflowWeeks&&m===-1&&(m=Hd),_(c)._overflowWeekday&&m===-1&&(m=dy),_(c).overflow=m),c}var op=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,pi=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Qa=/Z|[+-]\d\d(?::?\d\d)?/,_s=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ct=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],hi=/^\/?Date\((-?\d+)/i,ic=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dy={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Za(c){var m,b,w=c._i,E=op.exec(w)||pi.exec(w),M,J,oe,ve,Me=_s.length,Lt=ct.length;if(E){for(_(c).iso=!0,m=0,b=Me;m<b;m++)if(_s[m][1].exec(E[1])){J=_s[m][0],M=_s[m][2]!==!1;break}if(J==null){c._isValid=!1;return}if(E[3]){for(m=0,b=Lt;m<b;m++)if(ct[m][1].exec(E[3])){oe=(E[2]||" ")+ct[m][0];break}if(oe==null){c._isValid=!1;return}}if(!M&&oe!=null){c._isValid=!1;return}if(E[4])if(Qa.exec(E[4]))ve="Z";else{c._isValid=!1;return}c._f=J+(oe||"")+(ve||""),el(c)}else c._isValid=!1}function Fy(c,m,b,w,E,M){var J=[Ly(c),Ju.indexOf(m),parseInt(b,10),parseInt(w,10),parseInt(E,10)];return M&&J.push(parseInt(M,10)),J}function Ly(c){var m=parseInt(c,10);return m<=49?2e3+m:m<=999?1900+m:m}function jy(c){return c.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function ap(c,m,b){if(c){var w=Xd.indexOf(c),E=new Date(m[0],m[1],m[2]).getDay();if(w!==E)return _(b).weekdayMismatch=!0,b._isValid=!1,!1}return!0}function Xa(c,m,b){if(c)return Dy[c];if(m)return 0;var w=parseInt(b,10),E=w%100,M=(w-E)/100;return M*60+E}function Ni(c){var m=ic.exec(jy(c._i)),b;if(m){if(b=Fy(m[4],m[3],m[2],m[5],m[6],m[7]),!ap(m[1],b,c))return;c._a=b,c._tzm=Xa(m[8],m[9],m[10]),c._d=bs.apply(null,c._a),c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),_(c).rfc2822=!0}else c._isValid=!1}function Uy(c){var m=hi.exec(c._i);if(m!==null){c._d=new Date(+m[1]);return}if(Za(c),c._isValid===!1)delete c._isValid;else return;if(Ni(c),c._isValid===!1)delete c._isValid;else return;c._strict?c._isValid=!1:e.createFromInputFallback(c)}e.createFromInputFallback=C("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(c){c._d=new Date(c._i+(c._useUTC?" UTC":""))});function Di(c,m,b){return c??m??b}function lp(c){var m=new Date(e.now());return c._useUTC?[m.getUTCFullYear(),m.getUTCMonth(),m.getUTCDate()]:[m.getFullYear(),m.getMonth(),m.getDate()]}function Eo(c){var m,b,w=[],E,M,J;if(!c._d){for(E=lp(c),c._w&&c._a[cn]==null&&c._a[An]==null&&sc(c),c._dayOfYear!=null&&(J=Di(c._a[Qt],E[Qt]),(c._dayOfYear>So(J)||c._dayOfYear===0)&&(_(c)._overflowDayOfYear=!0),b=bs(J,0,c._dayOfYear),c._a[An]=b.getUTCMonth(),c._a[cn]=b.getUTCDate()),m=0;m<3&&c._a[m]==null;++m)c._a[m]=w[m]=E[m];for(;m<7;m++)c._a[m]=w[m]=c._a[m]==null?m===2?1:0:c._a[m];c._a[$t]===24&&c._a[Tr]===0&&c._a[$n]===0&&c._a[$i]===0&&(c._nextDay=!0,c._a[$t]=0),c._d=(c._useUTC?bs:wy).apply(null,w),M=c._useUTC?c._d.getUTCDay():c._d.getDay(),c._tzm!=null&&c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),c._nextDay&&(c._a[$t]=24),c._w&&typeof c._w.d<"u"&&c._w.d!==M&&(_(c).weekdayMismatch=!0)}}function sc(c){var m,b,w,E,M,J,oe,ve,Me;m=c._w,m.GG!=null||m.W!=null||m.E!=null?(M=1,J=4,b=Di(m.GG,c._a[Qt],Co(tt(),1,4).year),w=Di(m.W,1),E=Di(m.E,1),(E<1||E>7)&&(ve=!0)):(M=c._locale._week.dow,J=c._locale._week.doy,Me=Co(tt(),M,J),b=Di(m.gg,c._a[Qt],Me.year),w=Di(m.w,Me.week),m.d!=null?(E=m.d,(E<0||E>6)&&(ve=!0)):m.e!=null?(E=m.e+M,(m.e<0||m.e>6)&&(ve=!0)):E=M),w<1||w>fn(b,M,J)?_(c)._overflowWeeks=!0:ve!=null?_(c)._overflowWeekday=!0:(oe=Ja(b,w,E,M,J),c._a[Qt]=oe.year,c._dayOfYear=oe.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function el(c){if(c._f===e.ISO_8601){Za(c);return}if(c._f===e.RFC_2822){Ni(c);return}c._a=[],_(c).empty=!0;var m=""+c._i,b,w,E,M,J,oe=m.length,ve=0,Me,Lt;for(E=Gr(c._f,c._locale).match(he)||[],Lt=E.length,b=0;b<Lt;b++)M=E[b],w=(m.match(cy(M,c))||[])[0],w&&(J=m.substr(0,m.indexOf(w)),J.length>0&&_(c).unusedInput.push(J),m=m.slice(m.indexOf(w)+w.length),ve+=w.length),It[M]?(w?_(c).empty=!1:_(c).unusedTokens.push(M),Wu(M,w,c)):c._strict&&!w&&_(c).unusedTokens.push(M);_(c).charsLeftOver=oe-ve,m.length>0&&_(c).unusedInput.push(m),c._a[$t]<=12&&_(c).bigHour===!0&&c._a[$t]>0&&(_(c).bigHour=void 0),_(c).parsedDateParts=c._a.slice(0),_(c).meridiem=c._meridiem,c._a[$t]=Hy(c._locale,c._a[$t],c._meridiem),Me=_(c).era,Me!==null&&(c._a[Qt]=c._locale.erasConvertYear(Me,c._a[Qt])),Eo(c),nc(c)}function Hy(c,m,b){var w;return b==null?m:c.meridiemHour!=null?c.meridiemHour(m,b):(c.isPM!=null&&(w=c.isPM(b),w&&m<12&&(m+=12),!w&&m===12&&(m=0)),m)}function oc(c){var m,b,w,E,M,J,oe=!1,ve=c._f.length;if(ve===0){_(c).invalidFormat=!0,c._d=new Date(NaN);return}for(E=0;E<ve;E++)M=0,J=!1,m=V({},c),c._useUTC!=null&&(m._useUTC=c._useUTC),m._f=c._f[E],el(m),I(m)&&(J=!0),M+=_(m).charsLeftOver,M+=_(m).unusedTokens.length*10,_(m).score=M,oe?M<w&&(w=M,b=m):(w==null||M<w||J)&&(w=M,b=m,J&&(oe=!0));g(c,b||m)}function ac(c){if(!c._d){var m=gr(c._i),b=m.day===void 0?m.date:m.day;c._a=h([m.year,m.month,b,m.hour,m.minute,m.second,m.millisecond],function(w){return w&&parseInt(w,10)}),Eo(c)}}function By(c){var m=new W(nc(lc(c)));return m._nextDay&&(m.add(1,"d"),m._nextDay=void 0),m}function lc(c){var m=c._i,b=c._f;return c._locale=c._locale||Nn(c._l),m===null||b===void 0&&m===""?q({nullInput:!0}):(typeof m=="string"&&(c._i=m=c._locale.preparse(m)),X(m)?new W(nc(m)):(d(m)?c._d=m:n(b)?oc(c):b?el(c):br(c),I(c)||(c._d=null),c))}function br(c){var m=c._i;l(m)?c._d=new Date(e.now()):d(m)?c._d=new Date(m.valueOf()):typeof m=="string"?Uy(c):n(m)?(c._a=h(m.slice(0),function(b){return parseInt(b,10)}),Eo(c)):i(m)?ac(c):f(m)?c._d=new Date(m):e.createFromInputFallback(c)}function tl(c,m,b,w,E){var M={};return(m===!0||m===!1)&&(w=m,m=void 0),(b===!0||b===!1)&&(w=b,b=void 0),(i(c)&&a(c)||n(c)&&c.length===0)&&(c=void 0),M._isAMomentObject=!0,M._useUTC=M._isUTC=E,M._l=b,M._i=c,M._f=m,M._strict=w,By(M)}function tt(c,m,b,w){return tl(c,m,b,w,!1)}var up=C("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=tt.apply(null,arguments);return this.isValid()&&c.isValid()?c<this?this:c:q()}),cp=C("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=tt.apply(null,arguments);return this.isValid()&&c.isValid()?c>this?this:c:q()});function fp(c,m){var b,w;if(m.length===1&&n(m[0])&&(m=m[0]),!m.length)return tt();for(b=m[0],w=1;w<m.length;++w)(!m[w].isValid()||m[w][c](b))&&(b=m[w]);return b}function Vy(){var c=[].slice.call(arguments,0);return fp("isBefore",c)}function Wy(){var c=[].slice.call(arguments,0);return fp("isAfter",c)}var zy=function(){return Date.now?Date.now():+new Date},Oo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Rs(c){var m,b=!1,w,E=Oo.length;for(m in c)if(s(c,m)&&!(xt.call(Oo,m)!==-1&&(c[m]==null||!isNaN(c[m]))))return!1;for(w=0;w<E;++w)if(c[Oo[w]]){if(b)return!1;parseFloat(c[Oo[w]])!==Ae(c[Oo[w]])&&(b=!0)}return!0}function Jy(){return this._isValid}function Gy(){return rt(NaN)}function Cs(c){var m=gr(c),b=m.year||0,w=m.quarter||0,E=m.month||0,M=m.week||m.isoWeek||0,J=m.day||0,oe=m.hour||0,ve=m.minute||0,Me=m.second||0,Lt=m.millisecond||0;this._isValid=Rs(m),this._milliseconds=+Lt+Me*1e3+ve*6e4+oe*1e3*60*60,this._days=+J+M*7,this._months=+E+w*3+b*12,this._data={},this._locale=Nn(),this._bubble()}function Io(c){return c instanceof Cs}function dn(c){return c<0?Math.round(-1*c)*-1:Math.round(c)}function rl(c,m,b){var w=Math.min(c.length,m.length),E=Math.abs(c.length-m.length),M=0,J;for(J=0;J<w;J++)(b&&c[J]!==m[J]||!b&&Ae(c[J])!==Ae(m[J]))&&M++;return M+E}function dp(c,m){ue(c,0,0,function(){var b=this.utcOffset(),w="+";return b<0&&(b=-b,w="-"),w+_e(~~(b/60),2)+m+_e(~~b%60,2)})}dp("Z",":"),dp("ZZ",""),le("Z",ja),le("ZZ",ja),Ke(["Z","ZZ"],function(c,m,b){b._useUTC=!0,b._tzm=uc(ja,c)});var Yy=/([\+\-]|\d\d)/gi;function uc(c,m){var b=(m||"").match(c),w,E,M;return b===null?null:(w=b[b.length-1]||[],E=(w+"").match(Yy)||["-",0,0],M=+(E[1]*60)+Ae(E[2]),M===0?0:E[0]==="+"?M:-M)}function mi(c,m){var b,w;return m._isUTC?(b=m.clone(),w=(X(c)||d(c)?c.valueOf():tt(c).valueOf())-b.valueOf(),b._d.setTime(b._d.valueOf()+w),e.updateOffset(b,!1),b):tt(c).local()}function Sr(c){return-Math.round(c._d.getTimezoneOffset())}e.updateOffset=function(){};function pp(c,m,b){var w=this._offset||0,E;if(!this.isValid())return c!=null?this:NaN;if(c!=null){if(typeof c=="string"){if(c=uc(ja,c),c===null)return this}else Math.abs(c)<16&&!b&&(c=c*60);return!this._isUTC&&m&&(E=Sr(this)),this._offset=c,this._isUTC=!0,E!=null&&this.add(E,"m"),w!==c&&(!m||this._changeInProgress?Po(this,rt(c-w,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?w:Sr(this)}function Ky(c,m){return c!=null?(typeof c!="string"&&(c=-c),this.utcOffset(c,m),this):-this.utcOffset()}function Qy(c){return this.utcOffset(0,c)}function Zy(c){return this._isUTC&&(this.utcOffset(0,c),this._isUTC=!1,c&&this.subtract(Sr(this),"m")),this}function Xy(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var c=uc(Bu,this._i);c!=null?this.utcOffset(c):this.utcOffset(0,!0)}return this}function ev(c){return this.isValid()?(c=c?tt(c).utcOffset():0,(this.utcOffset()-c)%60===0):!1}function gi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function L(){if(!l(this._isDSTShifted))return this._isDSTShifted;var c={},m;return V(c,this),c=lc(c),c._a?(m=c._isUTC?y(c._a):tt(c._a),this._isDSTShifted=this.isValid()&&rl(c._a,m.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Y(){return this.isValid()?!this._isUTC:!1}function z(){return this.isValid()?this._isUTC:!1}function ae(){return this.isValid()?this._isUTC&&this._offset===0:!1}var be=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ge=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function rt(c,m){var b=c,w=null,E,M,J;return Io(c)?b={ms:c._milliseconds,d:c._days,M:c._months}:f(c)||!isNaN(+c)?(b={},m?b[m]=+c:b.milliseconds=+c):(w=be.exec(c))?(E=w[1]==="-"?-1:1,b={y:0,d:Ae(w[cn])*E,h:Ae(w[$t])*E,m:Ae(w[Tr])*E,s:Ae(w[$n])*E,ms:Ae(dn(w[$i]*1e3))*E}):(w=Ge.exec(c))?(E=w[1]==="-"?-1:1,b={y:Ue(w[2],E),M:Ue(w[3],E),w:Ue(w[4],E),d:Ue(w[5],E),h:Ue(w[6],E),m:Ue(w[7],E),s:Ue(w[8],E)}):b==null?b={}:typeof b=="object"&&("from"in b||"to"in b)&&(J=tv(tt(b.from),tt(b.to)),b={},b.ms=J.milliseconds,b.M=J.months),M=new Cs(b),Io(c)&&s(c,"_locale")&&(M._locale=c._locale),Io(c)&&s(c,"_isValid")&&(M._isValid=c._isValid),M}rt.fn=Cs.prototype,rt.invalid=Gy;function Ue(c,m){var b=c&&parseFloat(c.replace(",","."));return(isNaN(b)?0:b)*m}function nl(c,m){var b={};return b.months=m.month()-c.month()+(m.year()-c.year())*12,c.clone().add(b.months,"M").isAfter(m)&&--b.months,b.milliseconds=+m-+c.clone().add(b.months,"M"),b}function tv(c,m){var b;return c.isValid()&&m.isValid()?(m=mi(m,c),c.isBefore(m)?b=nl(c,m):(b=nl(m,c),b.milliseconds=-b.milliseconds,b.months=-b.months),b):{milliseconds:0,months:0}}function wr(c,m){return function(b,w){var E,M;return w!==null&&!isNaN(+w)&&(N(m,"moment()."+m+"(period, number) is deprecated. Please use moment()."+m+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),M=b,b=w,w=M),E=rt(b,w),Po(this,E,c),this}}function Po(c,m,b,w){var E=m._milliseconds,M=dn(m._days),J=dn(m._months);c.isValid()&&(w=w??!0,J&&Yu(c,wo(c,"Month")+J*b),M&&_o(c,"Date",wo(c,"Date")+M*b),E&&c._d.setTime(c._d.valueOf()+E*b),w&&e.updateOffset(c,M||J))}var rv=wr(1,"add"),xs=wr(-1,"subtract");function ko(c){return typeof c=="string"||c instanceof String}function il(c){return X(c)||d(c)||ko(c)||f(c)||nv(c)||Ze(c)||c===null||c===void 0}function Ze(c){var m=i(c)&&!a(c),b=!1,w=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],E,M,J=w.length;for(E=0;E<J;E+=1)M=w[E],b=b||s(c,M);return m&&b}function nv(c){var m=n(c),b=!1;return m&&(b=c.filter(function(w){return!f(w)&&ko(c)}).length===0),m&&b}function hp(c){var m=i(c)&&!a(c),b=!1,w=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],E,M;for(E=0;E<w.length;E+=1)M=w[E],b=b||s(c,M);return m&&b}function sl(c,m){var b=c.diff(m,"days",!0);return b<-6?"sameElse":b<-1?"lastWeek":b<0?"lastDay":b<1?"sameDay":b<2?"nextDay":b<7?"nextWeek":"sameElse"}function iv(c,m){arguments.length===1&&(arguments[0]?il(arguments[0])?(c=arguments[0],m=void 0):hp(arguments[0])&&(m=arguments[0],c=void 0):(c=void 0,m=void 0));var b=c||tt(),w=mi(b,this).startOf("day"),E=e.calendarFormat(this,w)||"sameElse",M=m&&(j(m[E])?m[E].call(this,b):m[E]);return this.format(M||this.localeData().calendar(E,this,tt(b)))}function sv(){return new W(this)}function ov(c,m){var b=X(c)?c:tt(c);return this.isValid()&&b.isValid()?(m=Kt(m)||"millisecond",m==="millisecond"?this.valueOf()>b.valueOf():b.valueOf()<this.clone().startOf(m).valueOf()):!1}function ol(c,m){var b=X(c)?c:tt(c);return this.isValid()&&b.isValid()?(m=Kt(m)||"millisecond",m==="millisecond"?this.valueOf()<b.valueOf():this.clone().endOf(m).valueOf()<b.valueOf()):!1}function yi(c,m,b,w){var E=X(c)?c:tt(c),M=X(m)?m:tt(m);return this.isValid()&&E.isValid()&&M.isValid()?(w=w||"()",(w[0]==="("?this.isAfter(E,b):!this.isBefore(E,b))&&(w[1]===")"?this.isBefore(M,b):!this.isAfter(M,b))):!1}function al(c,m){var b=X(c)?c:tt(c),w;return this.isValid()&&b.isValid()?(m=Kt(m)||"millisecond",m==="millisecond"?this.valueOf()===b.valueOf():(w=b.valueOf(),this.clone().startOf(m).valueOf()<=w&&w<=this.clone().endOf(m).valueOf())):!1}function mp(c,m){return this.isSame(c,m)||this.isAfter(c,m)}function ll(c,m){return this.isSame(c,m)||this.isBefore(c,m)}function gp(c,m,b){var w,E,M;if(!this.isValid())return NaN;if(w=mi(c,this),!w.isValid())return NaN;switch(E=(w.utcOffset()-this.utcOffset())*6e4,m=Kt(m),m){case"year":M=To(this,w)/12;break;case"month":M=To(this,w);break;case"quarter":M=To(this,w)/3;break;case"second":M=(this-w)/1e3;break;case"minute":M=(this-w)/6e4;break;case"hour":M=(this-w)/36e5;break;case"day":M=(this-w-E)/864e5;break;case"week":M=(this-w-E)/6048e5;break;default:M=this-w}return b?M:kr(M)}function To(c,m){if(c.date()<m.date())return-To(m,c);var b=(m.year()-c.year())*12+(m.month()-c.month()),w=c.clone().add(b,"months"),E,M;return m-w<0?(E=c.clone().add(b-1,"months"),M=(m-w)/(w-E)):(E=c.clone().add(b+1,"months"),M=(m-w)/(E-w)),-(b+M)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function ul(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function yp(c){if(!this.isValid())return null;var m=c!==!0,b=m?this.clone().utc():this;return b.year()<0||b.year()>9999?Ct(b,m?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):j(Date.prototype.toISOString)?m?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Ct(b,"Z")):Ct(b,m?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function qo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var c="moment",m="",b,w,E,M;return this.isLocal()||(c=this.utcOffset()===0?"moment.utc":"moment.parseZone",m="Z"),b="["+c+'("]',w=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",E="-MM-DD[T]HH:mm:ss.SSS",M=m+'[")]',this.format(b+w+E+M)}function Fi(c){c||(c=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var m=Ct(this,c);return this.localeData().postformat(m)}function cl(c,m){return this.isValid()&&(X(c)&&c.isValid()||tt(c).isValid())?rt({to:this,from:c}).locale(this.locale()).humanize(!m):this.localeData().invalidDate()}function av(c){return this.from(tt(),c)}function lv(c,m){return this.isValid()&&(X(c)&&c.isValid()||tt(c).isValid())?rt({from:this,to:c}).locale(this.locale()).humanize(!m):this.localeData().invalidDate()}function uv(c){return this.to(tt(),c)}function Ao(c){var m;return c===void 0?this._locale._abbr:(m=Nn(c),m!=null&&(this._locale=m),this)}var $o=C("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(c){return c===void 0?this.localeData():this.locale(c)});function fl(){return this._locale}var dl=1e3,Li=60*dl,pl=60*Li,vp=(365*400+97)*24*pl;function yt(c,m){return(c%m+m)%m}function Vt(c,m,b){return c<100&&c>=0?new Date(c+400,m,b)-vp:new Date(c,m,b).valueOf()}function bp(c,m,b){return c<100&&c>=0?Date.UTC(c+400,m,b)-vp:Date.UTC(c,m,b)}function cv(c){var m,b;if(c=Kt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?bp:Vt,c){case"year":m=b(this.year(),0,1);break;case"quarter":m=b(this.year(),this.month()-this.month()%3,1);break;case"month":m=b(this.year(),this.month(),1);break;case"week":m=b(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":m=b(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":m=b(this.year(),this.month(),this.date());break;case"hour":m=this._d.valueOf(),m-=yt(m+(this._isUTC?0:this.utcOffset()*Li),pl);break;case"minute":m=this._d.valueOf(),m-=yt(m,Li);break;case"second":m=this._d.valueOf(),m-=yt(m,dl);break}return this._d.setTime(m),e.updateOffset(this,!0),this}function Sp(c){var m,b;if(c=Kt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?bp:Vt,c){case"year":m=b(this.year()+1,0,1)-1;break;case"quarter":m=b(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":m=b(this.year(),this.month()+1,1)-1;break;case"week":m=b(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":m=b(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":m=b(this.year(),this.month(),this.date()+1)-1;break;case"hour":m=this._d.valueOf(),m+=pl-yt(m+(this._isUTC?0:this.utcOffset()*Li),pl)-1;break;case"minute":m=this._d.valueOf(),m+=Li-yt(m,Li)-1;break;case"second":m=this._d.valueOf(),m+=dl-yt(m,dl)-1;break}return this._d.setTime(m),e.updateOffset(this,!0),this}function fv(){return this._d.valueOf()-(this._offset||0)*6e4}function cc(){return Math.floor(this.valueOf()/1e3)}function Mo(){return new Date(this.valueOf())}function fc(){var c=this;return[c.year(),c.month(),c.date(),c.hour(),c.minute(),c.second(),c.millisecond()]}function Es(){var c=this;return{years:c.year(),months:c.month(),date:c.date(),hours:c.hours(),minutes:c.minutes(),seconds:c.seconds(),milliseconds:c.milliseconds()}}function No(){return this.isValid()?this.toISOString():null}function Do(){return I(this)}function hl(){return g({},_(this))}function Os(){return _(this).overflow}function dv(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ue("N",0,0,"eraAbbr"),ue("NN",0,0,"eraAbbr"),ue("NNN",0,0,"eraAbbr"),ue("NNNN",0,0,"eraName"),ue("NNNNN",0,0,"eraNarrow"),ue("y",["y",1],"yo","eraYear"),ue("y",["yy",2],0,"eraYear"),ue("y",["yyy",3],0,"eraYear"),ue("y",["yyyy",4],0,"eraYear"),le("N",sr),le("NN",sr),le("NNN",sr),le("NNNN",$e),le("NNNNN",yv),Ke(["N","NN","NNN","NNNN","NNNNN"],function(c,m,b,w){var E=b._locale.erasParse(c,w,b._strict);E?_(b).era=E:_(b).invalidEra=c}),le("y",di),le("yy",di),le("yyy",di),le("yyyy",di),le("yo",vv),Ke(["y","yy","yyy","yyyy"],Qt),Ke(["yo"],function(c,m,b,w){var E;b._locale._eraYearOrdinalRegex&&(E=c.match(b._locale._eraYearOrdinalRegex)),b._locale.eraYearOrdinalParse?m[Qt]=b._locale.eraYearOrdinalParse(c,E):m[Qt]=parseInt(c,10)});function pv(c,m){var b,w,E,M=this._eras||Nn("en")._eras;for(b=0,w=M.length;b<w;++b)switch(typeof M[b].since==="string"&&(E=e(M[b].since).startOf("day"),M[b].since=E.valueOf()),typeof M[b].until){case"undefined":M[b].until=1/0;break;case"string":E=e(M[b].until).startOf("day").valueOf(),M[b].until=E.valueOf();break}return M}function hv(c,m,b){var w,E,M=this.eras(),J,oe,ve;for(c=c.toUpperCase(),w=0,E=M.length;w<E;++w)if(J=M[w].name.toUpperCase(),oe=M[w].abbr.toUpperCase(),ve=M[w].narrow.toUpperCase(),b)switch(m){case"N":case"NN":case"NNN":if(oe===c)return M[w];break;case"NNNN":if(J===c)return M[w];break;case"NNNNN":if(ve===c)return M[w];break}else if([J,oe,ve].indexOf(c)>=0)return M[w]}function mv(c,m){var b=c.since<=c.until?1:-1;return m===void 0?e(c.since).year():e(c.since).year()+(m-c.offset)*b}function gv(){var c,m,b,w=this.localeData().eras();for(c=0,m=w.length;c<m;++c)if(b=this.clone().startOf("day").valueOf(),w[c].since<=b&&b<=w[c].until||w[c].until<=b&&b<=w[c].since)return w[c].name;return""}function ml(){var c,m,b,w=this.localeData().eras();for(c=0,m=w.length;c<m;++c)if(b=this.clone().startOf("day").valueOf(),w[c].since<=b&&b<=w[c].until||w[c].until<=b&&b<=w[c].since)return w[c].narrow;return""}function Fo(){var c,m,b,w=this.localeData().eras();for(c=0,m=w.length;c<m;++c)if(b=this.clone().startOf("day").valueOf(),w[c].since<=b&&b<=w[c].until||w[c].until<=b&&b<=w[c].since)return w[c].abbr;return""}function wp(){var c,m,b,w,E=this.localeData().eras();for(c=0,m=E.length;c<m;++c)if(b=E[c].since<=E[c].until?1:-1,w=this.clone().startOf("day").valueOf(),E[c].since<=w&&w<=E[c].until||E[c].until<=w&&w<=E[c].since)return(this.year()-e(E[c].since).year())*b+E[c].offset;return this.year()}function O(c){return s(this,"_erasNameRegex")||dc.call(this),c?this._erasNameRegex:this._erasRegex}function Is(c){return s(this,"_erasAbbrRegex")||dc.call(this),c?this._erasAbbrRegex:this._erasRegex}function gl(c){return s(this,"_erasNarrowRegex")||dc.call(this),c?this._erasNarrowRegex:this._erasRegex}function sr(c,m){return m.erasAbbrRegex(c)}function $e(c,m){return m.erasNameRegex(c)}function yv(c,m){return m.erasNarrowRegex(c)}function vv(c,m){return m._eraYearOrdinalRegex||di}function dc(){var c=[],m=[],b=[],w=[],E,M,J,oe,ve,Me=this.eras();for(E=0,M=Me.length;E<M;++E)J=un(Me[E].name),oe=un(Me[E].abbr),ve=un(Me[E].narrow),m.push(J),c.push(oe),b.push(ve),w.push(J),w.push(oe),w.push(ve);this._erasRegex=new RegExp("^("+w.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+m.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+c.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+b.join("|")+")","i")}ue(0,["gg",2],0,function(){return this.weekYear()%100}),ue(0,["GG",2],0,function(){return this.isoWeekYear()%100});function pn(c,m){ue(0,[c,c.length],0,m)}pn("gggg","weekYear"),pn("ggggg","weekYear"),pn("GGGG","isoWeekYear"),pn("GGGGG","isoWeekYear"),le("G",ys),le("g",ys),le("GG",at,Bt),le("gg",at,Bt),le("GGGG",yo,qi),le("gggg",yo,qi),le("GGGGG",gs,qn),le("ggggg",gs,qn),bo(["gggg","ggggg","GGGG","GGGGG"],function(c,m,b,w){m[w.substr(0,2)]=Ae(c)}),bo(["gg","GG"],function(c,m,b,w){m[w]=e.parseTwoDigitYear(c)});function bv(c){return _p.call(this,c,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Sv(c){return _p.call(this,c,this.isoWeek(),this.isoWeekday(),1,4)}function wv(){return fn(this.year(),1,4)}function _v(){return fn(this.isoWeekYear(),1,4)}function Rv(){var c=this.localeData()._week;return fn(this.year(),c.dow,c.doy)}function Dn(){var c=this.localeData()._week;return fn(this.weekYear(),c.dow,c.doy)}function _p(c,m,b,w,E){var M;return c==null?Co(this,w,E).year:(M=fn(c,w,E),m>M&&(m=M),Cv.call(this,c,m,b,w,E))}function Cv(c,m,b,w,E){var M=Ja(c,m,b,w,E),J=bs(M.year,0,M.dayOfYear);return this.year(J.getUTCFullYear()),this.month(J.getUTCMonth()),this.date(J.getUTCDate()),this}ue("Q",0,"Qo","quarter"),le("Q",jd),Ke("Q",function(c,m){m[An]=(Ae(c)-1)*3});function xv(c){return c==null?Math.ceil((this.month()+1)/3):this.month((c-1)*3+this.month()%3)}ue("D",["DD",2],"Do","date"),le("D",at,Ai),le("DD",at,Bt),le("Do",function(c,m){return c?m._dayOfMonthOrdinalParse||m._ordinalParse:m._dayOfMonthOrdinalParseLenient}),Ke(["D","DD"],cn),Ke("Do",function(c,m){m[cn]=Ae(c.match(at)[0])});var Rp=vs("Date",!0);ue("DDD",["DDDD",3],"DDDo","dayOfYear"),le("DDD",ms),le("DDDD",Ud),Ke(["DDD","DDDD"],function(c,m,b){b._dayOfYear=Ae(c)});function Ev(c){var m=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return c==null?m:this.add(c-m,"d")}ue("m",["mm",2],0,"minute"),le("m",at,Ua),le("mm",at,Bt),Ke(["m","mm"],Tr);var Fn=vs("Minutes",!1);ue("s",["ss",2],0,"second"),le("s",at,Ua),le("ss",at,Bt),Ke(["s","ss"],$n);var Ov=vs("Seconds",!1);ue("S",0,0,function(){return~~(this.millisecond()/100)}),ue(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ue(0,["SSS",3],0,"millisecond"),ue(0,["SSSS",4],0,function(){return this.millisecond()*10}),ue(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ue(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ue(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ue(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ue(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),le("S",ms,jd),le("SS",ms,Bt),le("SSS",ms,Ud);var vi,Cp;for(vi="SSSS";vi.length<=9;vi+="S")le(vi,di);function Iv(c,m){m[$i]=Ae(("0."+c)*1e3)}for(vi="S";vi.length<=9;vi+="S")Ke(vi,Iv);Cp=vs("Milliseconds",!1),ue("z",0,0,"zoneAbbr"),ue("zz",0,0,"zoneName");function Pv(){return this._isUTC?"UTC":""}function ji(){return this._isUTC?"Coordinated Universal Time":""}var te=W.prototype;te.add=rv,te.calendar=iv,te.clone=sv,te.diff=gp,te.endOf=Sp,te.format=Fi,te.from=cl,te.fromNow=av,te.to=lv,te.toNow=uv,te.get=hy,te.invalidAt=Os,te.isAfter=ov,te.isBefore=ol,te.isBetween=yi,te.isSame=al,te.isSameOrAfter=mp,te.isSameOrBefore=ll,te.isValid=Do,te.lang=$o,te.locale=Ao,te.localeData=fl,te.max=cp,te.min=up,te.parsingFlags=hl,te.set=Va,te.startOf=cv,te.subtract=xs,te.toArray=fc,te.toObject=Es,te.toDate=Mo,te.toISOString=yp,te.inspect=qo,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=No,te.toString=ul,te.unix=cc,te.valueOf=fv,te.creationData=dv,te.eraName=gv,te.eraNarrow=ml,te.eraAbbr=Fo,te.eraYear=wp,te.year=Bd,te.isLeapYear=py,te.weekYear=bv,te.isoWeekYear=Sv,te.quarter=te.quarters=xv,te.month=Wa,te.daysInMonth=Sy,te.week=te.weeks=Yd,te.isoWeek=te.isoWeeks=_y,te.weeksInYear=Rv,te.weeksInWeekYear=Dn,te.isoWeeksInYear=wv,te.isoWeeksInISOWeekYear=_v,te.date=Rp,te.day=te.days=ky,te.weekday=Ty,te.isoWeekday=qy,te.dayOfYear=Ev,te.hour=te.hours=Ny,te.minute=te.minutes=Fn,te.second=te.seconds=Ov,te.millisecond=te.milliseconds=Cp,te.utcOffset=pp,te.utc=Qy,te.local=Zy,te.parseZone=Xy,te.hasAlignedHourOffset=ev,te.isDST=gi,te.isLocal=Y,te.isUtcOffset=z,te.isUtc=ae,te.isUTC=ae,te.zoneAbbr=Pv,te.zoneName=ji,te.dates=C("dates accessor is deprecated. Use date instead.",Rp),te.months=C("months accessor is deprecated. Use month instead",Wa),te.years=C("years accessor is deprecated. Use year instead",Bd),te.zone=C("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ky),te.isDSTShifted=C("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",L);function kv(c){return tt(c*1e3)}function Yr(){return tt.apply(null,arguments).parseZone()}function xp(c){return c}var Ve=K.prototype;Ve.calendar=et,Ve.longDateFormat=mt,Ve.invalidDate=ln,Ve.ordinal=mo,Ve.preparse=xp,Ve.postformat=xp,Ve.relativeTime=Tn,Ve.pastFuture=Fd,Ve.set=$,Ve.eras=pv,Ve.erasParse=hv,Ve.erasConvertYear=mv,Ve.erasAbbrRegex=Is,Ve.erasNameRegex=O,Ve.erasNarrowRegex=gl,Ve.months=vy,Ve.monthsShort=by,Ve.monthsParse=zd,Ve.monthsRegex=za,Ve.monthsShortRegex=Jd,Ve.week=Qu,Ve.firstDayOfYear=Gd,Ve.firstDayOfWeek=Ss,Ve.weekdays=Ey,Ve.weekdaysMin=Iy,Ve.weekdaysShort=Oy,Ve.weekdaysParse=Py,Ve.weekdaysRegex=Ay,Ve.weekdaysShortRegex=dt,Ve.weekdaysMinRegex=ut,Ve.isPM=My,Ve.meridiem=Ft;function yl(c,m,b,w){var E=Nn(),M=y().set(w,m);return E[b](M,c)}function Ep(c,m,b){if(f(c)&&(m=c,c=void 0),c=c||"",m!=null)return yl(c,m,b,"month");var w,E=[];for(w=0;w<12;w++)E[w]=yl(c,w,b,"month");return E}function pc(c,m,b,w){typeof c=="boolean"?(f(m)&&(b=m,m=void 0),m=m||""):(m=c,b=m,c=!1,f(m)&&(b=m,m=void 0),m=m||"");var E=Nn(),M=c?E._week.dow:0,J,oe=[];if(b!=null)return yl(m,(b+M)%7,w,"day");for(J=0;J<7;J++)oe[J]=yl(m,(J+M)%7,w,"day");return oe}function Op(c,m){return Ep(c,m,"months")}function Ip(c,m){return Ep(c,m,"monthsShort")}function Tv(c,m,b){return pc(c,m,b,"weekdays")}function qv(c,m,b){return pc(c,m,b,"weekdaysShort")}function hc(c,m,b){return pc(c,m,b,"weekdaysMin")}Mn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(c){var m=c%10,b=Ae(c%100/10)===1?"th":m===1?"st":m===2?"nd":m===3?"rd":"th";return c+b}}),e.lang=C("moment.lang is deprecated. Use moment.locale instead.",Mn),e.langData=C("moment.langData is deprecated. Use moment.localeData instead.",Nn);var _r=Math.abs;function vl(){var c=this._data;return this._milliseconds=_r(this._milliseconds),this._days=_r(this._days),this._months=_r(this._months),c.milliseconds=_r(c.milliseconds),c.seconds=_r(c.seconds),c.minutes=_r(c.minutes),c.hours=_r(c.hours),c.months=_r(c.months),c.years=_r(c.years),this}function Pp(c,m,b,w){var E=rt(m,b);return c._milliseconds+=w*E._milliseconds,c._days+=w*E._days,c._months+=w*E._months,c._bubble()}function kp(c,m){return Pp(this,c,m,1)}function Av(c,m){return Pp(this,c,m,-1)}function Kr(c){return c<0?Math.floor(c):Math.ceil(c)}function mc(){var c=this._milliseconds,m=this._days,b=this._months,w=this._data,E,M,J,oe,ve;return c>=0&&m>=0&&b>=0||c<=0&&m<=0&&b<=0||(c+=Kr(or(b)+m)*864e5,m=0,b=0),w.milliseconds=c%1e3,E=kr(c/1e3),w.seconds=E%60,M=kr(E/60),w.minutes=M%60,J=kr(M/60),w.hours=J%24,m+=kr(J/24),ve=kr(bi(m)),b+=ve,m-=Kr(or(ve)),oe=kr(b/12),b%=12,w.days=m,w.months=b,w.years=oe,this}function bi(c){return c*4800/146097}function or(c){return c*146097/4800}function $v(c){if(!this.isValid())return NaN;var m,b,w=this._milliseconds;if(c=Kt(c),c==="month"||c==="quarter"||c==="year")switch(m=this._days+w/864e5,b=this._months+bi(m),c){case"month":return b;case"quarter":return b/3;case"year":return b/12}else switch(m=this._days+Math.round(or(this._months)),c){case"week":return m/7+w/6048e5;case"day":return m+w/864e5;case"hour":return m*24+w/36e5;case"minute":return m*1440+w/6e4;case"second":return m*86400+w/1e3;case"millisecond":return Math.floor(m*864e5)+w;default:throw new Error("Unknown unit "+c)}}function hn(c){return function(){return this.as(c)}}var gc=hn("ms"),Lo=hn("s"),Si=hn("m"),Tp=hn("h"),Mv=hn("d"),bl=hn("w"),Nv=hn("M"),qp=hn("Q"),Wt=hn("y"),yc=gc;function Ap(){return rt(this)}function mn(c){return c=Kt(c),this.isValid()?this[c+"s"]():NaN}function Ln(c){return function(){return this.isValid()?this._data[c]:NaN}}var Sl=Ln("milliseconds"),Ui=Ln("seconds"),$p=Ln("minutes"),Xt=Ln("hours"),vc=Ln("days"),Dv=Ln("months"),Fv=Ln("years");function Lv(){return kr(this.days()/7)}var Qr=Math.round,Ps={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function jo(c,m,b,w,E){return E.relativeTime(m||1,!!b,c,w)}function Mp(c,m,b,w){var E=rt(c).abs(),M=Qr(E.as("s")),J=Qr(E.as("m")),oe=Qr(E.as("h")),ve=Qr(E.as("d")),Me=Qr(E.as("M")),Lt=Qr(E.as("w")),jn=Qr(E.as("y")),Un=M<=b.ss&&["s",M]||M<b.s&&["ss",M]||J<=1&&["m"]||J<b.m&&["mm",J]||oe<=1&&["h"]||oe<b.h&&["hh",oe]||ve<=1&&["d"]||ve<b.d&&["dd",ve];return b.w!=null&&(Un=Un||Lt<=1&&["w"]||Lt<b.w&&["ww",Lt]),Un=Un||Me<=1&&["M"]||Me<b.M&&["MM",Me]||jn<=1&&["y"]||["yy",jn],Un[2]=m,Un[3]=+c>0,Un[4]=w,jo.apply(null,Un)}function jv(c){return c===void 0?Qr:typeof c=="function"?(Qr=c,!0):!1}function Uv(c,m){return Ps[c]===void 0?!1:m===void 0?Ps[c]:(Ps[c]=m,c==="s"&&(Ps.ss=m-1),!0)}function Uo(c,m){if(!this.isValid())return this.localeData().invalidDate();var b=!1,w=Ps,E,M;return typeof c=="object"&&(m=c,c=!1),typeof c=="boolean"&&(b=c),typeof m=="object"&&(w=Object.assign({},Ps,m),m.s!=null&&m.ss==null&&(w.ss=m.s-1)),E=this.localeData(),M=Mp(this,!b,w,E),b&&(M=E.pastFuture(+this,M)),E.postformat(M)}var bc=Math.abs;function ks(c){return(c>0)-(c<0)||+c}function Ts(){if(!this.isValid())return this.localeData().invalidDate();var c=bc(this._milliseconds)/1e3,m=bc(this._days),b=bc(this._months),w,E,M,J,oe=this.asSeconds(),ve,Me,Lt,jn;return oe?(w=kr(c/60),E=kr(w/60),c%=60,w%=60,M=kr(b/12),b%=12,J=c?c.toFixed(3).replace(/\.?0+$/,""):"",ve=oe<0?"-":"",Me=ks(this._months)!==ks(oe)?"-":"",Lt=ks(this._days)!==ks(oe)?"-":"",jn=ks(this._milliseconds)!==ks(oe)?"-":"",ve+"P"+(M?Me+M+"Y":"")+(b?Me+b+"M":"")+(m?Lt+m+"D":"")+(E||w||c?"T":"")+(E?jn+E+"H":"")+(w?jn+w+"M":"")+(c?jn+J+"S":"")):"P0D"}var Fe=Cs.prototype;Fe.isValid=Jy,Fe.abs=vl,Fe.add=kp,Fe.subtract=Av,Fe.as=$v,Fe.asMilliseconds=gc,Fe.asSeconds=Lo,Fe.asMinutes=Si,Fe.asHours=Tp,Fe.asDays=Mv,Fe.asWeeks=bl,Fe.asMonths=Nv,Fe.asQuarters=qp,Fe.asYears=Wt,Fe.valueOf=yc,Fe._bubble=mc,Fe.clone=Ap,Fe.get=mn,Fe.milliseconds=Sl,Fe.seconds=Ui,Fe.minutes=$p,Fe.hours=Xt,Fe.days=vc,Fe.weeks=Lv,Fe.months=Dv,Fe.years=Fv,Fe.humanize=Uo,Fe.toISOString=Ts,Fe.toString=Ts,Fe.toJSON=Ts,Fe.locale=Ao,Fe.localeData=fl,Fe.toIsoString=C("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ts),Fe.lang=$o,ue("X",0,0,"unix"),ue("x",0,0,"valueOf"),le("x",ys),le("X",uy),Ke("X",function(c,m,b){b._d=new Date(parseFloat(c)*1e3)}),Ke("x",function(c,m,b){b._d=new Date(Ae(c))});return e.version="2.30.1",t(tt),e.fn=te,e.min=Vy,e.max=Wy,e.now=zy,e.utc=y,e.unix=kv,e.months=Op,e.isDate=d,e.locale=Mn,e.invalid=q,e.duration=rt,e.isMoment=X,e.weekdays=Tv,e.parseZone=Yr,e.localeData=Nn,e.isDuration=Io,e.monthsShort=Ip,e.weekdaysMin=hc,e.defineLocale=Ka,e.updateLocale=yr,e.locales=vr,e.weekdaysShort=qv,e.normalizeUnits=Kt,e.relativeTimeRounding=jv,e.relativeTimeThreshold=Uv,e.calendarFormat=sl,e.prototype=te,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e}))});var ME=F(($E,ph)=>{(function(r,e){typeof define=="function"&&define.amd?define([],e):typeof ph<"u"&&ph.exports?ph.exports=e():r.tv4=e()})($E,function(){Object.keys||(Object.keys=(function(){var T=Object.prototype.hasOwnProperty,C=!{toString:null}.propertyIsEnumerable("toString"),k=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],N=k.length;return function(j){if(typeof j!="object"&&typeof j!="function"||j===null)throw new TypeError("Object.keys called on non-object");var $=[];for(var G in j)T.call(j,G)&&$.push(G);if(C)for(var K=0;K<N;K++)T.call(j,k[K])&&$.push(k[K]);return $}})()),Object.create||(Object.create=(function(){function T(){}return function(C){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return T.prototype=C,new T}})()),Array.isArray||(Array.isArray=function(T){return Object.prototype.toString.call(T)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(T){if(this===null)throw new TypeError;var C=Object(this),k=C.length>>>0;if(k===0)return-1;var N=0;if(arguments.length>1&&(N=Number(arguments[1]),N!==N?N=0:N!==0&&N!==1/0&&N!==-1/0&&(N=(N>0||-1)*Math.floor(Math.abs(N)))),N>=k)return-1;for(var j=N>=0?N:Math.max(k-Math.abs(N),0);j<k;j++)if(j in C&&C[j]===T)return j;return-1}),Object.isFrozen||(Object.isFrozen=function(T){for(var C="tv4_test_frozen_key";T.hasOwnProperty(C);)C+=Math.random();try{return T[C]=!0,delete T[C],!1}catch{return!0}});var r={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function t(T){return encodeURI(T).replace(/%25[0-9][0-9]/g,function(C){return"%"+C.substring(3)})}function n(T){var C="";r[T.charAt(0)]&&(C=T.charAt(0),T=T.substring(1));var k="",N="",j=!0,$=!1,G=!1;C==="+"?j=!1:C==="."?(N=".",k="."):C==="/"?(N="/",k="/"):C==="#"?(N="#",j=!1):C===";"?(N=";",k=";",$=!0,G=!0):C==="?"?(N="?",k="&",$=!0):C==="&"&&(N="&",k="&",$=!0);for(var K=[],ne=T.split(","),pe=[],et={},_e=0;_e<ne.length;_e++){var he=ne[_e],xe=null;if(he.indexOf(":")!==-1){var bt=he.split(":");he=bt[0],xe=parseInt(bt[1],10)}for(var It={};e[he.charAt(he.length-1)];)It[he.charAt(he.length-1)]=!0,he=he.substring(0,he.length-1);var ue={truncate:xe,name:he,suffices:It};pe.push(ue),et[he]=ue,K.push(he)}var mr=function(fi){for(var Ct="",Gr=0,Pr=0;Pr<pe.length;Pr++){var mt=pe[Pr],gt=fi(mt.name);if(gt==null||Array.isArray(gt)&>.length===0||typeof gt=="object"&&Object.keys(gt).length===0){Gr++;continue}if(Pr===Gr?Ct+=N:Ct+=k||",",Array.isArray(gt)){$&&(Ct+=mt.name+"=");for(var ln=0;ln<gt.length;ln++)ln>0&&(Ct+=mt.suffices["*"]&&k||",",mt.suffices["*"]&&$&&(Ct+=mt.name+"=")),Ct+=j?encodeURIComponent(gt[ln]).replace(/!/g,"%21"):t(gt[ln])}else if(typeof gt=="object"){$&&!mt.suffices["*"]&&(Ct+=mt.name+"=");var ho=!0;for(var Yt in gt)ho||(Ct+=mt.suffices["*"]&&k||","),ho=!1,Ct+=j?encodeURIComponent(Yt).replace(/!/g,"%21"):t(Yt),Ct+=mt.suffices["*"]?"=":",",Ct+=j?encodeURIComponent(gt[Yt]).replace(/!/g,"%21"):t(gt[Yt])}else $&&(Ct+=mt.name,(!G||gt!=="")&&(Ct+="=")),mt.truncate!=null&&(gt=gt.substring(0,mt.truncate)),Ct+=j?encodeURIComponent(gt).replace(/!/g,"%21"):t(gt)}return Ct};return mr.varNames=K,{prefix:N,substitution:mr}}function i(T){if(!(this instanceof i))return new i(T);for(var C=T.split("{"),k=[C.shift()],N=[],j=[],$=[];C.length>0;){var G=C.shift(),K=G.split("}")[0],ne=G.substring(K.length+1),pe=n(K);j.push(pe.substitution),N.push(pe.prefix),k.push(ne),$=$.concat(pe.substitution.varNames)}this.fill=function(et){for(var _e=k[0],he=0;he<j.length;he++){var xe=j[he];_e+=xe(et),_e+=k[he+1]}return _e},this.varNames=$,this.template=T}i.prototype={toString:function(){return this.template},fillFromObject:function(T){return this.fill(function(C){return T[C]})}};var s=function(C,k,N,j,$){if(this.missing=[],this.missingMap={},this.formatValidators=C?Object.create(C.formatValidators):{},this.schemas=C?Object.create(C.schemas):{},this.collectMultiple=k,this.errors=[],this.handleError=k?this.collectError:this.returnError,j&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),$&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=N||S("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},C)for(var G in C.definedKeywords)this.definedKeywords[G]=C.definedKeywords[G].slice(0)};s.prototype.defineKeyword=function(T,C){this.definedKeywords[T]=this.definedKeywords[T]||[],this.definedKeywords[T].push(C)},s.prototype.createError=function(T,C,k,N,j,$,G){var K=new U(T,C,k,N,j);return K.message=this.errorReporter(K,$,G),K},s.prototype.returnError=function(T){return T},s.prototype.collectError=function(T){return T&&this.errors.push(T),null},s.prototype.prefixErrors=function(T,C,k){for(var N=T;N<this.errors.length;N++)this.errors[N]=this.errors[N].prefixWith(C,k);return this},s.prototype.banUnknownProperties=function(T,C){for(var k in this.unknownPropertyPaths){var N=this.createError(_.UNKNOWN_PROPERTY,{path:k},k,"",null,T,C),j=this.handleError(N);if(j)return j}return null},s.prototype.addFormat=function(T,C){if(typeof T=="object"){for(var k in T)this.addFormat(k,T[k]);return this}this.formatValidators[T]=C},s.prototype.resolveRefs=function(T,C){if(T.$ref!==void 0){if(C=C||{},C[T.$ref])return this.createError(_.CIRCULAR_REFERENCE,{urls:Object.keys(C).join(", ")},"","",null,void 0,T);C[T.$ref]=!0,T=this.getSchema(T.$ref,C)}return T},s.prototype.getSchema=function(T,C){var k;if(this.schemas[T]!==void 0)return k=this.schemas[T],this.resolveRefs(k,C);var N=T,j="";if(T.indexOf("#")!==-1&&(j=T.substring(T.indexOf("#")+1),N=T.substring(0,T.indexOf("#"))),typeof this.schemas[N]=="object"){k=this.schemas[N];var $=decodeURIComponent(j);if($==="")return this.resolveRefs(k,C);if($.charAt(0)!=="/")return;for(var G=$.split("/").slice(1),K=0;K<G.length;K++){var ne=G[K].replace(/~1/g,"/").replace(/~0/g,"~");if(k[ne]===void 0){k=void 0;break}k=k[ne]}if(k!==void 0)return this.resolveRefs(k,C)}this.missing[N]===void 0&&(this.missing.push(N),this.missing[N]=N,this.missingMap[N]=N)},s.prototype.searchSchemas=function(T,C){if(Array.isArray(T))for(var k=0;k<T.length;k++)this.searchSchemas(T[k],C);else if(T&&typeof T=="object"){typeof T.id=="string"&&B(C,T.id)&&this.schemas[T.id]===void 0&&(this.schemas[T.id]=T);for(var N in T)if(N!=="enum"){if(typeof T[N]=="object")this.searchSchemas(T[N],C);else if(N==="$ref"){var j=g(T[N]);j&&this.schemas[j]===void 0&&this.missingMap[j]===void 0&&(this.missingMap[j]=j)}}}},s.prototype.addSchema=function(T,C){if(typeof T!="string"||typeof C>"u")if(typeof T=="object"&&typeof T.id=="string")C=T,T=C.id;else return;T===g(T)+"#"&&(T=g(T)),this.schemas[T]=C,delete this.missingMap[T],y(C,T),this.searchSchemas(C,T)},s.prototype.getSchemaMap=function(){var T={};for(var C in this.schemas)T[C]=this.schemas[C];return T},s.prototype.getSchemaUris=function(T){var C=[];for(var k in this.schemas)(!T||T.test(k))&&C.push(k);return C},s.prototype.getMissingUris=function(T){var C=[];for(var k in this.missingMap)(!T||T.test(k))&&C.push(k);return C},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(T,C,k,N,j){var $;if(C=this.resolveRefs(C),C){if(C instanceof U)return this.errors.push(C),C}else return null;var G=this.errors.length,K,ne=null,pe=null;if(this.checkRecursive&&T&&typeof T=="object"){if($=!this.scanned.length,T[this.validatedSchemasKey]){var et=T[this.validatedSchemasKey].indexOf(C);if(et!==-1)return this.errors=this.errors.concat(T[this.validationErrorsKey][et]),null}if(Object.isFrozen(T)&&(K=this.scannedFrozen.indexOf(T),K!==-1)){var _e=this.scannedFrozenSchemas[K].indexOf(C);if(_e!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[K][_e]),null}if(this.scanned.push(T),Object.isFrozen(T))K===-1&&(K=this.scannedFrozen.length,this.scannedFrozen.push(T),this.scannedFrozenSchemas.push([])),ne=this.scannedFrozenSchemas[K].length,this.scannedFrozenSchemas[K][ne]=C,this.scannedFrozenValidationErrors[K][ne]=[];else{if(!T[this.validatedSchemasKey])try{Object.defineProperty(T,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(T,this.validationErrorsKey,{value:[],configurable:!0})}catch{T[this.validatedSchemasKey]=[],T[this.validationErrorsKey]=[]}pe=T[this.validatedSchemasKey].length,T[this.validatedSchemasKey][pe]=C,T[this.validationErrorsKey][pe]=[]}}var he=this.errors.length,xe=this.validateBasic(T,C,j)||this.validateNumeric(T,C,j)||this.validateString(T,C,j)||this.validateArray(T,C,j)||this.validateObject(T,C,j)||this.validateCombinations(T,C,j)||this.validateHypermedia(T,C,j)||this.validateFormat(T,C,j)||this.validateDefinedKeywords(T,C,j)||null;if($){for(;this.scanned.length;){var bt=this.scanned.pop();delete bt[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(xe||he!==this.errors.length)for(;k&&k.length||N&&N.length;){var It=k&&k.length?""+k.pop():null,ue=N&&N.length?""+N.pop():null;xe&&(xe=xe.prefixWith(It,ue)),this.prefixErrors(he,It,ue)}return ne!==null?this.scannedFrozenValidationErrors[K][ne]=this.errors.slice(G):pe!==null&&(T[this.validationErrorsKey][pe]=this.errors.slice(G)),this.handleError(xe)},s.prototype.validateFormat=function(T,C){if(typeof C.format!="string"||!this.formatValidators[C.format])return null;var k=this.formatValidators[C.format].call(null,T,C);return typeof k=="string"||typeof k=="number"?this.createError(_.FORMAT_CUSTOM,{message:k},"","/format",null,T,C):k&&typeof k=="object"?this.createError(_.FORMAT_CUSTOM,{message:k.message||"?"},k.dataPath||"",k.schemaPath||"/format",null,T,C):null},s.prototype.validateDefinedKeywords=function(T,C,k){for(var N in this.definedKeywords)if(!(typeof C[N]>"u"))for(var j=this.definedKeywords[N],$=0;$<j.length;$++){var G=j[$],K=G(T,C[N],C,k);if(typeof K=="string"||typeof K=="number")return this.createError(_.KEYWORD_CUSTOM,{key:N,message:K},"","",null,T,C).prefixWith(null,N);if(K&&typeof K=="object"){var ne=K.code;if(typeof ne=="string"){if(!_[ne])throw new Error("Undefined error code (use defineError): "+ne);ne=_[ne]}else typeof ne!="number"&&(ne=_.KEYWORD_CUSTOM);var pe=typeof K.message=="object"?K.message:{key:N,message:K.message||"?"},et=K.schemaPath||"/"+N.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ne,pe,K.dataPath||null,et,null,T,C)}}return null};function a(T,C){if(T===C)return!0;if(T&&C&&typeof T=="object"&&typeof C=="object"){if(Array.isArray(T)!==Array.isArray(C))return!1;if(Array.isArray(T)){if(T.length!==C.length)return!1;for(var k=0;k<T.length;k++)if(!a(T[k],C[k]))return!1}else{var N;for(N in T)if(C[N]===void 0&&T[N]!==void 0)return!1;for(N in C)if(T[N]===void 0&&C[N]!==void 0)return!1;for(N in T)if(!a(T[N],C[N]))return!1}return!0}return!1}s.prototype.validateBasic=function(C,k,N){var j;return(j=this.validateType(C,k,N))||(j=this.validateEnum(C,k,N))?j.prefixWith(null,"type"):null},s.prototype.validateType=function(C,k){if(k.type===void 0)return null;var N=typeof C;C===null?N="null":Array.isArray(C)&&(N="array");var j=k.type;Array.isArray(j)||(j=[j]);for(var $=0;$<j.length;$++){var G=j[$];if(G===N||G==="integer"&&N==="number"&&C%1===0)return null}return this.createError(_.INVALID_TYPE,{type:N,expected:j.join("/")},"","",null,C,k)},s.prototype.validateEnum=function(C,k){if(k.enum===void 0)return null;for(var N=0;N<k.enum.length;N++){var j=k.enum[N];if(a(C,j))return null}return this.createError(_.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(C):C},"","",null,C,k)},s.prototype.validateNumeric=function(C,k,N){return this.validateMultipleOf(C,k,N)||this.validateMinMax(C,k,N)||this.validateNaN(C,k,N)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(C,k){var N=k.multipleOf||k.divisibleBy;if(N===void 0)return null;if(typeof C=="number"){var j=C/N%1;if(j>=l&&j<f)return this.createError(_.NUMBER_MULTIPLE_OF,{value:C,multipleOf:N},"","",null,C,k)}return null},s.prototype.validateMinMax=function(C,k){if(typeof C!="number")return null;if(k.minimum!==void 0){if(C<k.minimum)return this.createError(_.NUMBER_MINIMUM,{value:C,minimum:k.minimum},"","/minimum",null,C,k);if(k.exclusiveMinimum&&C===k.minimum)return this.createError(_.NUMBER_MINIMUM_EXCLUSIVE,{value:C,minimum:k.minimum},"","/exclusiveMinimum",null,C,k)}if(k.maximum!==void 0){if(C>k.maximum)return this.createError(_.NUMBER_MAXIMUM,{value:C,maximum:k.maximum},"","/maximum",null,C,k);if(k.exclusiveMaximum&&C===k.maximum)return this.createError(_.NUMBER_MAXIMUM_EXCLUSIVE,{value:C,maximum:k.maximum},"","/exclusiveMaximum",null,C,k)}return null},s.prototype.validateNaN=function(C,k){return typeof C!="number"?null:isNaN(C)===!0||C===1/0||C===-1/0?this.createError(_.NUMBER_NOT_A_NUMBER,{value:C},"","/type",null,C,k):null},s.prototype.validateString=function(C,k,N){return this.validateStringLength(C,k,N)||this.validateStringPattern(C,k,N)||null},s.prototype.validateStringLength=function(C,k){return typeof C!="string"?null:k.minLength!==void 0&&C.length<k.minLength?this.createError(_.STRING_LENGTH_SHORT,{length:C.length,minimum:k.minLength},"","/minLength",null,C,k):k.maxLength!==void 0&&C.length>k.maxLength?this.createError(_.STRING_LENGTH_LONG,{length:C.length,maximum:k.maxLength},"","/maxLength",null,C,k):null},s.prototype.validateStringPattern=function(C,k){if(typeof C!="string"||typeof k.pattern!="string"&&!(k.pattern instanceof RegExp))return null;var N;if(k.pattern instanceof RegExp)N=k.pattern;else{var j,$="",G=k.pattern.match(/^\/(.+)\/([img]*)$/);G?(j=G[1],$=G[2]):j=k.pattern,N=new RegExp(j,$)}return N.test(C)?null:this.createError(_.STRING_PATTERN,{pattern:k.pattern},"","/pattern",null,C,k)},s.prototype.validateArray=function(C,k,N){return Array.isArray(C)&&(this.validateArrayLength(C,k,N)||this.validateArrayUniqueItems(C,k,N)||this.validateArrayItems(C,k,N))||null},s.prototype.validateArrayLength=function(C,k){var N;return k.minItems!==void 0&&C.length<k.minItems&&(N=this.createError(_.ARRAY_LENGTH_SHORT,{length:C.length,minimum:k.minItems},"","/minItems",null,C,k),this.handleError(N))||k.maxItems!==void 0&&C.length>k.maxItems&&(N=this.createError(_.ARRAY_LENGTH_LONG,{length:C.length,maximum:k.maxItems},"","/maxItems",null,C,k),this.handleError(N))?N:null},s.prototype.validateArrayUniqueItems=function(C,k){if(k.uniqueItems){for(var N=0;N<C.length;N++)for(var j=N+1;j<C.length;j++)if(a(C[N],C[j])){var $=this.createError(_.ARRAY_UNIQUE,{match1:N,match2:j},"","/uniqueItems",null,C,k);if(this.handleError($))return $}}return null},s.prototype.validateArrayItems=function(C,k,N){if(k.items===void 0)return null;var j,$;if(Array.isArray(k.items)){for($=0;$<C.length;$++)if($<k.items.length){if(j=this.validateAll(C[$],k.items[$],[$],["items",$],N+"/"+$))return j}else if(k.additionalItems!==void 0){if(typeof k.additionalItems=="boolean"){if(!k.additionalItems&&(j=this.createError(_.ARRAY_ADDITIONAL_ITEMS,{},"/"+$,"/additionalItems",null,C,k),this.handleError(j)))return j}else if(j=this.validateAll(C[$],k.additionalItems,[$],["additionalItems"],N+"/"+$))return j}}else for($=0;$<C.length;$++)if(j=this.validateAll(C[$],k.items,[$],["items"],N+"/"+$))return j;return null},s.prototype.validateObject=function(C,k,N){return typeof C!="object"||C===null||Array.isArray(C)?null:this.validateObjectMinMaxProperties(C,k,N)||this.validateObjectRequiredProperties(C,k,N)||this.validateObjectProperties(C,k,N)||this.validateObjectDependencies(C,k,N)||null},s.prototype.validateObjectMinMaxProperties=function(C,k){var N=Object.keys(C),j;return k.minProperties!==void 0&&N.length<k.minProperties&&(j=this.createError(_.OBJECT_PROPERTIES_MINIMUM,{propertyCount:N.length,minimum:k.minProperties},"","/minProperties",null,C,k),this.handleError(j))||k.maxProperties!==void 0&&N.length>k.maxProperties&&(j=this.createError(_.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:N.length,maximum:k.maxProperties},"","/maxProperties",null,C,k),this.handleError(j))?j:null},s.prototype.validateObjectRequiredProperties=function(C,k){if(k.required!==void 0)for(var N=0;N<k.required.length;N++){var j=k.required[N];if(C[j]===void 0){var $=this.createError(_.OBJECT_REQUIRED,{key:j},"","/required/"+N,null,C,k);if(this.handleError($))return $}}return null},s.prototype.validateObjectProperties=function(C,k,N){var j;for(var $ in C){var G=N+"/"+$.replace(/~/g,"~0").replace(/\//g,"~1"),K=!1;if(k.properties!==void 0&&k.properties[$]!==void 0&&(K=!0,j=this.validateAll(C[$],k.properties[$],[$],["properties",$],G)))return j;if(k.patternProperties!==void 0)for(var ne in k.patternProperties){var pe=new RegExp(ne);if(pe.test($)&&(K=!0,j=this.validateAll(C[$],k.patternProperties[ne],[$],["patternProperties",ne],G)))return j}if(K)this.trackUnknownProperties&&(this.knownPropertyPaths[G]=!0,delete this.unknownPropertyPaths[G]);else if(k.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[G]=!0,delete this.unknownPropertyPaths[G]),typeof k.additionalProperties=="boolean"){if(!k.additionalProperties&&(j=this.createError(_.OBJECT_ADDITIONAL_PROPERTIES,{key:$},"","/additionalProperties",null,C,k).prefixWith($,null),this.handleError(j)))return j}else if(j=this.validateAll(C[$],k.additionalProperties,[$],["additionalProperties"],G))return j}else this.trackUnknownProperties&&!this.knownPropertyPaths[G]&&(this.unknownPropertyPaths[G]=!0)}return null},s.prototype.validateObjectDependencies=function(C,k,N){var j;if(k.dependencies!==void 0){for(var $ in k.dependencies)if(C[$]!==void 0){var G=k.dependencies[$];if(typeof G=="string"){if(C[G]===void 0&&(j=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:$,missing:G},"","",null,C,k).prefixWith(null,$).prefixWith(null,"dependencies"),this.handleError(j)))return j}else if(Array.isArray(G))for(var K=0;K<G.length;K++){var ne=G[K];if(C[ne]===void 0&&(j=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:$,missing:ne},"","/"+K,null,C,k).prefixWith(null,$).prefixWith(null,"dependencies"),this.handleError(j)))return j}else if(j=this.validateAll(C,G,[],["dependencies",$],N))return j}}return null},s.prototype.validateCombinations=function(C,k,N){return this.validateAllOf(C,k,N)||this.validateAnyOf(C,k,N)||this.validateOneOf(C,k,N)||this.validateNot(C,k,N)||null},s.prototype.validateAllOf=function(C,k,N){if(k.allOf===void 0)return null;for(var j,$=0;$<k.allOf.length;$++){var G=k.allOf[$];if(j=this.validateAll(C,G,[],["allOf",$],N))return j}return null},s.prototype.validateAnyOf=function(C,k,N){if(k.anyOf===void 0)return null;var j=[],$=this.errors.length,G,K;this.trackUnknownProperties&&(G=this.unknownPropertyPaths,K=this.knownPropertyPaths);for(var ne=!0,pe=0;pe<k.anyOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var et=k.anyOf[pe],_e=this.errors.length,he=this.validateAll(C,et,[],["anyOf",pe],N);if(he===null&&_e===this.errors.length){if(this.errors=this.errors.slice(0,$),this.trackUnknownProperties){for(var xe in this.knownPropertyPaths)K[xe]=!0,delete G[xe];for(var bt in this.unknownPropertyPaths)K[bt]||(G[bt]=!0);ne=!1;continue}return null}he&&j.push(he.prefixWith(null,""+pe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=G,this.knownPropertyPaths=K),ne)return j=j.concat(this.errors.slice($)),this.errors=this.errors.slice(0,$),this.createError(_.ANY_OF_MISSING,{},"","/anyOf",j,C,k)},s.prototype.validateOneOf=function(C,k,N){if(k.oneOf===void 0)return null;var j=null,$=[],G=this.errors.length,K,ne;this.trackUnknownProperties&&(K=this.unknownPropertyPaths,ne=this.knownPropertyPaths);for(var pe=0;pe<k.oneOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var et=k.oneOf[pe],_e=this.errors.length,he=this.validateAll(C,et,[],["oneOf",pe],N);if(he===null&&_e===this.errors.length){if(j===null)j=pe;else return this.errors=this.errors.slice(0,G),this.createError(_.ONE_OF_MULTIPLE,{index1:j,index2:pe},"","/oneOf",null,C,k);if(this.trackUnknownProperties){for(var xe in this.knownPropertyPaths)ne[xe]=!0,delete K[xe];for(var bt in this.unknownPropertyPaths)ne[bt]||(K[bt]=!0)}}else he&&$.push(he)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=K,this.knownPropertyPaths=ne),j===null?($=$.concat(this.errors.slice(G)),this.errors=this.errors.slice(0,G),this.createError(_.ONE_OF_MISSING,{},"","/oneOf",$,C,k)):(this.errors=this.errors.slice(0,G),null)},s.prototype.validateNot=function(C,k,N){if(k.not===void 0)return null;var j=this.errors.length,$,G;this.trackUnknownProperties&&($=this.unknownPropertyPaths,G=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var K=this.validateAll(C,k.not,null,null,N),ne=this.errors.slice(j);return this.errors=this.errors.slice(0,j),this.trackUnknownProperties&&(this.unknownPropertyPaths=$,this.knownPropertyPaths=G),K===null&&ne.length===0?this.createError(_.NOT_PASSED,{},"","/not",null,C,k):null},s.prototype.validateHypermedia=function(C,k,N){if(!k.links)return null;for(var j,$=0;$<k.links.length;$++){var G=k.links[$];if(G.rel==="describedby"){for(var K=new i(G.href),ne=!0,pe=0;pe<K.varNames.length;pe++)if(!(K.varNames[pe]in C)){ne=!1;break}if(ne){var et=K.fillFromObject(C),_e={$ref:et};if(j=this.validateAll(C,_e,[],["links",$],N))return j}}}};function d(T){var C=String(T).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return C?{href:C[0]||"",protocol:C[1]||"",authority:C[2]||"",host:C[3]||"",hostname:C[4]||"",port:C[5]||"",pathname:C[6]||"",search:C[7]||"",hash:C[8]||""}:null}function h(T,C){function k(N){var j=[];return N.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function($){$==="/.."?j.pop():j.push($)}),j.join("").replace(/^\//,N.charAt(0)==="/"?"/":"")}return C=d(C||""),T=d(T||""),!C||!T?null:(C.protocol||T.protocol)+(C.protocol||C.authority?C.authority:T.authority)+k(C.protocol||C.authority||C.pathname.charAt(0)==="/"?C.pathname:C.pathname?(T.authority&&!T.pathname?"/":"")+T.pathname.slice(0,T.pathname.lastIndexOf("/")+1)+C.pathname:T.pathname)+(C.protocol||C.authority||C.pathname?C.search:C.search||T.search)+C.hash}function g(T){return T.split("#")[0]}function y(T,C){if(T&&typeof T=="object")if(C===void 0?C=T.id:typeof T.id=="string"&&(C=h(C,T.id),T.id=C),Array.isArray(T))for(var k=0;k<T.length;k++)y(T[k],C);else{typeof T.$ref=="string"&&(T.$ref=h(C,T.$ref));for(var N in T)N!=="enum"&&y(T[N],C)}}function S(T){T=T||"en";var C=V[T];return function(k){var N=C[k.code]||q[k.code];if(typeof N!="string")return"Unknown error code "+k.code+": "+JSON.stringify(k.messageParams);var j=k.params;return N.replace(/\{([^{}]*)\}/g,function($,G){var K=j[G];return typeof K=="string"||typeof K=="number"?K:$})}}var _={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},R={};for(var I in _)R[_[I]]=I;var q={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function U(T,C,k,N,j){if(Error.call(this),T===void 0)throw new Error("No error code supplied: "+N);this.message="",this.params=C,this.code=T,this.dataPath=k||"",this.schemaPath=N||"",this.subErrors=j||null;var $=new Error(this.message);if(this.stack=$.stack||$.stacktrace,!this.stack)try{throw $}catch(G){this.stack=G.stack||G.stacktrace}}U.prototype=Object.create(Error.prototype),U.prototype.constructor=U,U.prototype.name="ValidationError",U.prototype.prefixWith=function(T,C){if(T!==null&&(T=T.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+T+this.dataPath),C!==null&&(C=C.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+C+this.schemaPath),this.subErrors!==null)for(var k=0;k<this.subErrors.length;k++)this.subErrors[k].prefixWith(T,C);return this};function B(T,C){if(C.substring(0,T.length)===T){var k=C.substring(T.length);if(C.length>0&&C.charAt(T.length-1)==="/"||k.charAt(0)==="#"||k.charAt(0)==="?")return!0}return!1}var V={};function W(T){var C=new s,k,N,j={setErrorReporter:function($){return typeof $=="string"?this.language($):(N=$,!0)},addFormat:function(){C.addFormat.apply(C,arguments)},language:function($){return $?(V[$]||($=$.split("-")[0]),V[$]?(k=$,$):!1):k},addLanguage:function($,G){var K;for(K in _)G[K]&&!G[_[K]]&&(G[_[K]]=G[K]);var ne=$.split("-")[0];if(!V[ne])V[$]=G,V[ne]=G;else{V[$]=Object.create(V[ne]);for(K in G)typeof V[ne][K]>"u"&&(V[ne][K]=G[K]),V[$][K]=G[K]}return this},freshApi:function($){var G=W();return $&&G.language($),G},validate:function($,G,K,ne){var pe=S(k),et=N?function(xe,bt,It){return N(xe,bt,It)||pe(xe,bt,It)}:pe,_e=new s(C,!1,et,K,ne);typeof G=="string"&&(G={$ref:G}),_e.addSchema("",G);var he=_e.validateAll($,G,null,null,"");return!he&&ne&&(he=_e.banUnknownProperties($,G)),this.error=he,this.missing=_e.missing,this.valid=he===null,this.valid},validateResult:function(){var $={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply($,arguments),$},validateMultiple:function($,G,K,ne){var pe=S(k),et=N?function(xe,bt,It){return N(xe,bt,It)||pe(xe,bt,It)}:pe,_e=new s(C,!0,et,K,ne);typeof G=="string"&&(G={$ref:G}),_e.addSchema("",G),_e.validateAll($,G,null,null,""),ne&&_e.banUnknownProperties($,G);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=_e.errors,he.missing=_e.missing,he.valid=he.errors.length===0,he},addSchema:function(){return C.addSchema.apply(C,arguments)},getSchema:function(){return C.getSchema.apply(C,arguments)},getSchemaMap:function(){return C.getSchemaMap.apply(C,arguments)},getSchemaUris:function(){return C.getSchemaUris.apply(C,arguments)},getMissingUris:function(){return C.getMissingUris.apply(C,arguments)},dropSchemas:function(){C.dropSchemas.apply(C,arguments)},defineKeyword:function(){C.defineKeyword.apply(C,arguments)},defineError:function($,G,K){if(typeof $!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test($))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof G!="number"||G%1!==0||G<1e4)throw new Error("Code number must be an integer > 10000");if(typeof _[$]<"u")throw new Error("Error already defined: "+$+" as "+_[$]);if(typeof R[G]<"u")throw new Error("Error code already used: "+R[G]+" as "+G);_[$]=G,R[G]=$,q[$]=q[G]=K;for(var ne in V){var pe=V[ne];pe[$]&&(pe[G]=pe[G]||pe[$])}},reset:function(){C.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:h,getDocumentUri:g,errorCodes:_};return j.language(T||"en"),j}var X=W();return X.addLanguage("en-gb",q),X.tv4=X,X})});var Hc=F(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.regexpCode=Ye.getEsmExportName=Ye.getProperty=Ye.safeStringify=Ye.stringify=Ye.strConcat=Ye.addCodeArg=Ye.str=Ye._=Ye.nil=Ye._Code=Ye.Name=Ye.IDENTIFIER=Ye._CodeOrName=void 0;var jc=class{};Ye._CodeOrName=jc;Ye.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ea=class extends jc{constructor(e){if(super(),!Ye.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Ye.Name=ea;var wn=class extends jc{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>(n instanceof ea&&(t[n.str]=(t[n.str]||0)+1),t),{})}};Ye._Code=wn;Ye.nil=new wn("");function NE(r,...e){let t=[r[0]],n=0;for(;n<e.length;)Ub(t,e[n]),t.push(r[++n]);return new wn(t)}Ye._=NE;var jb=new wn("+");function DE(r,...e){let t=[Uc(r[0])],n=0;for(;n<e.length;)t.push(jb),Ub(t,e[n]),t.push(jb,Uc(r[++n]));return Cj(t),new wn(t)}Ye.str=DE;function Ub(r,e){e instanceof wn?r.push(...e._items):e instanceof ea?r.push(e):r.push(Oj(e))}Ye.addCodeArg=Ub;function Cj(r){let e=1;for(;e<r.length-1;){if(r[e]===jb){let t=xj(r[e-1],r[e+1]);if(t!==void 0){r.splice(e-1,3,t);continue}r[e++]="+"}e++}}function xj(r,e){if(e==='""')return r;if(r==='""')return e;if(typeof r=="string")return e instanceof ea||r[r.length-1]!=='"'?void 0:typeof e!="string"?`${r.slice(0,-1)}${e}"`:e[0]==='"'?r.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(r instanceof ea))return`"${r}${e.slice(1)}`}function Ej(r,e){return e.emptyStr()?r:r.emptyStr()?e:DE`${r}${e}`}Ye.strConcat=Ej;function Oj(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:Uc(Array.isArray(r)?r.join(","):r)}function Ij(r){return new wn(Uc(r))}Ye.stringify=Ij;function Uc(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ye.safeStringify=Uc;function Pj(r){return typeof r=="string"&&Ye.IDENTIFIER.test(r)?new wn(`.${r}`):NE`[${r}]`}Ye.getProperty=Pj;function kj(r){if(typeof r=="string"&&Ye.IDENTIFIER.test(r))return new wn(`${r}`);throw new Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)}Ye.getEsmExportName=kj;function Tj(r){return new wn(r.toString())}Ye.regexpCode=Tj});var Vb=F(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.ValueScope=Fr.ValueScopeName=Fr.Scope=Fr.varKinds=Fr.UsedValueState=void 0;var Dr=Hc(),Hb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},hh;(function(r){r[r.Started=0]="Started",r[r.Completed=1]="Completed"})(hh||(Fr.UsedValueState=hh={}));Fr.varKinds={const:new Dr.Name("const"),let:new Dr.Name("let"),var:new Dr.Name("var")};var mh=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof Dr.Name?e:this.name(e)}name(e){return new Dr.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(!((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Fr.Scope=mh;var gh=class extends Dr.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=(0,Dr._)`.${new Dr.Name(t)}[${n}]`}};Fr.ValueScopeName=gh;var qj=(0,Dr._)`\n`,Bb=class extends mh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?qj:Dr.nil}}get(){return this._scope}name(e){return new gh(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,a=(n=t.key)!==null&&n!==void 0?n:t.ref,l=this._values[s];if(l){let h=l.get(a);if(h)return h}else l=this._values[s]=new Map;l.set(a,i);let f=this._scope[s]||(this._scope[s]=[]),d=f.length;return f[d]=t.ref,i.setValue(t,{property:s,itemIndex:d}),i}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Dr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},t,n)}_reduceValues(e,t,n={},i){let s=Dr.nil;for(let a in e){let l=e[a];if(!l)continue;let f=n[a]=n[a]||new Map;l.forEach(d=>{if(f.has(d))return;f.set(d,hh.Started);let h=t(d);if(h){let g=this.opts.es5?Fr.varKinds.var:Fr.varKinds.const;s=(0,Dr._)`${s}${g} ${d} = ${h};${this.opts._n}`}else if(h=i?.(d))s=(0,Dr._)`${s}${h}${this.opts._n}`;else throw new Hb(d);f.set(d,hh.Completed)})}return s}};Fr.ValueScope=Bb});var Ne=F(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.or=qe.and=qe.not=qe.CodeGen=qe.operators=qe.varKinds=qe.ValueScopeName=qe.ValueScope=qe.Scope=qe.Name=qe.regexpCode=qe.stringify=qe.getProperty=qe.nil=qe.strConcat=qe.str=qe._=void 0;var Be=Hc(),Jn=Vb(),js=Hc();Object.defineProperty(qe,"_",{enumerable:!0,get:function(){return js._}});Object.defineProperty(qe,"str",{enumerable:!0,get:function(){return js.str}});Object.defineProperty(qe,"strConcat",{enumerable:!0,get:function(){return js.strConcat}});Object.defineProperty(qe,"nil",{enumerable:!0,get:function(){return js.nil}});Object.defineProperty(qe,"getProperty",{enumerable:!0,get:function(){return js.getProperty}});Object.defineProperty(qe,"stringify",{enumerable:!0,get:function(){return js.stringify}});Object.defineProperty(qe,"regexpCode",{enumerable:!0,get:function(){return js.regexpCode}});Object.defineProperty(qe,"Name",{enumerable:!0,get:function(){return js.Name}});var Sh=Vb();Object.defineProperty(qe,"Scope",{enumerable:!0,get:function(){return Sh.Scope}});Object.defineProperty(qe,"ValueScope",{enumerable:!0,get:function(){return Sh.ValueScope}});Object.defineProperty(qe,"ValueScopeName",{enumerable:!0,get:function(){return Sh.ValueScopeName}});Object.defineProperty(qe,"varKinds",{enumerable:!0,get:function(){return Sh.varKinds}});qe.operators={GT:new Be._Code(">"),GTE:new Be._Code(">="),LT:new Be._Code("<"),LTE:new Be._Code("<="),EQ:new Be._Code("==="),NEQ:new Be._Code("!=="),NOT:new Be._Code("!"),OR:new Be._Code("||"),AND:new Be._Code("&&"),ADD:new Be._Code("+")};var Zi=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},Wb=class extends Zi{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?Jn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=Al(this.rhs,e,t)),this}get names(){return this.rhs instanceof Be._CodeOrName?this.rhs.names:{}}},yh=class extends Zi{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof Be.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Al(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Be.Name?{}:{...this.lhs.names};return bh(e,this.rhs)}},zb=class extends yh{constructor(e,t,n,i){super(e,n,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Jb=class extends Zi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Gb=class extends Zi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Yb=class extends Zi{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Kb=class extends Zi{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=Al(this.code,e,t),this}get names(){return this.code instanceof Be._CodeOrName?this.code.names:{}}},Bc=class extends Zi{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,t)||(Aj(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>na(e,t.names),{})}},Xi=class extends Bc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Qb=class extends Bc{},ql=class extends Xi{};ql.kind="else";var ta=class r extends Xi{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let n=t.optimizeNodes();t=this.else=Array.isArray(n)?new ql(n):n}if(t)return e===!1?t instanceof r?t:t.nodes:this.nodes.length?this:new r(FE(e),t instanceof r?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=Al(this.condition,e,t),this}get names(){let e=super.names;return bh(e,this.condition),this.else&&na(e,this.else.names),e}};ta.kind="if";var ra=class extends Xi{};ra.kind="for";var Zb=class extends ra{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=Al(this.iteration,e,t),this}get names(){return na(super.names,this.iteration.names)}},Xb=class extends ra{constructor(e,t,n,i){super(),this.varKind=e,this.name=t,this.from=n,this.to=i}render(e){let t=e.es5?Jn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${t} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=bh(super.names,this.from);return bh(e,this.to)}},vh=class extends ra{constructor(e,t,n,i){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=Al(this.iterable,e,t),this}get names(){return na(super.names,this.iterable.names)}},Vc=class extends Xi{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Vc.kind="func";var Wc=class extends Bc{render(e){return"return "+super.render(e)}};Wc.kind="return";var eS=class extends Xi{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var n,i;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(i=this.finally)===null||i===void 0||i.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&na(e,this.catch.names),this.finally&&na(e,this.finally.names),e}},zc=class extends Xi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};zc.kind="catch";var Jc=class extends Xi{render(e){return"finally"+super.render(e)}};Jc.kind="finally";var tS=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
24
|
-
`:""},this._extScope=e,this._scope=new Jn.Scope({parent:e}),this._nodes=[new Qb]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,i){let s=this._scope.toName(t);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new Wb(e,s,n)),s}const(e,t,n){return this._def(Jn.varKinds.const,e,t,n)}let(e,t,n){return this._def(Jn.varKinds.let,e,t,n)}var(e,t,n){return this._def(Jn.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new yh(e,t,n))}add(e,t){return this._leafNode(new zb(e,qe.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==Be.nil&&this._leafNode(new Kb(e)),this}object(...e){let t=["{"];for(let[n,i]of e)t.length>1&&t.push(","),t.push(n),(n!==i||this.opts.es5)&&(t.push(":"),(0,Be.addCodeArg)(t,i));return t.push("}"),new Be._Code(t)}if(e,t,n){if(this._blockNode(new ta(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new ta(e))}else(){return this._elseNode(new ql)}endIf(){return this._endBlockNode(ta,ql)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new Zb(e),t)}forRange(e,t,n,i,s=this.opts.es5?Jn.varKinds.var:Jn.varKinds.let){let a=this._scope.toName(e);return this._for(new Xb(s,a,t,n),()=>i(a))}forOf(e,t,n,i=Jn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=t instanceof Be.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,Be._)`${a}.length`,l=>{this.var(s,(0,Be._)`${a}[${l}]`),n(s)})}return this._for(new vh("of",i,s,t),()=>n(s))}forIn(e,t,n,i=this.opts.es5?Jn.varKinds.var:Jn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Be._)`Object.keys(${t})`,n);let s=this._scope.toName(e);return this._for(new vh("in",i,s,t),()=>n(s))}endFor(){return this._endBlockNode(ra)}label(e){return this._leafNode(new Jb(e))}break(e){return this._leafNode(new Gb(e))}return(e){let t=new Wc;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Wc)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new eS;if(this._blockNode(i),this.code(e),t){let s=this.name("e");this._currNode=i.catch=new zc(s),t(s)}return n&&(this._currNode=i.finally=new Jc,this.code(n)),this._endBlockNode(zc,Jc)}throw(e){return this._leafNode(new Yb(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=Be.nil,n,i){return this._blockNode(new Vc(e,t,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Vc)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof ta))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};qe.CodeGen=tS;function na(r,e){for(let t in e)r[t]=(r[t]||0)+(e[t]||0);return r}function bh(r,e){return e instanceof Be._CodeOrName?na(r,e.names):r}function Al(r,e,t){if(r instanceof Be.Name)return n(r);if(!i(r))return r;return new Be._Code(r._items.reduce((s,a)=>(a instanceof Be.Name&&(a=n(a)),a instanceof Be._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=t[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function i(s){return s instanceof Be._Code&&s._items.some(a=>a instanceof Be.Name&&e[a.str]===1&&t[a.str]!==void 0)}}function Aj(r,e){for(let t in e)r[t]=(r[t]||0)-(e[t]||0)}function FE(r){return typeof r=="boolean"||typeof r=="number"||r===null?!r:(0,Be._)`!${rS(r)}`}qe.not=FE;var $j=LE(qe.operators.AND);function Mj(...r){return r.reduce($j)}qe.and=Mj;var Nj=LE(qe.operators.OR);function Dj(...r){return r.reduce(Nj)}qe.or=Dj;function LE(r){return(e,t)=>e===Be.nil?t:t===Be.nil?e:(0,Be._)`${rS(e)} ${r} ${rS(t)}`}function rS(r){return r instanceof Be.Name?r:(0,Be._)`(${r})`}});var We=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var ht=Ne(),Fj=Hc();function Lj(r){let e={};for(let t of r)e[t]=!0;return e}De.toHash=Lj;function jj(r,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(HE(r,e),!BE(e,r.self.RULES.all))}De.alwaysValidSchema=jj;function HE(r,e=r.schema){let{opts:t,self:n}=r;if(!t.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||zE(r,`unknown keyword: "${s}"`)}De.checkUnknownRules=HE;function BE(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(e[t])return!0;return!1}De.schemaHasRules=BE;function Uj(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(t!=="$ref"&&e.all[t])return!0;return!1}De.schemaHasRulesButRef=Uj;function Hj({topSchemaRef:r,schemaPath:e},t,n,i){if(!i){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,ht._)`${t}`}return(0,ht._)`${r}${e}${(0,ht.getProperty)(n)}`}De.schemaRefOrVal=Hj;function Bj(r){return VE(decodeURIComponent(r))}De.unescapeFragment=Bj;function Vj(r){return encodeURIComponent(iS(r))}De.escapeFragment=Vj;function iS(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=iS;function VE(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=VE;function Wj(r,e){if(Array.isArray(r))for(let t of r)e(t);else e(r)}De.eachItem=Wj;function jE({mergeNames:r,mergeToName:e,mergeValues:t,resultToName:n}){return(i,s,a,l)=>{let f=a===void 0?s:a instanceof ht.Name?(s instanceof ht.Name?r(i,s,a):e(i,s,a),a):s instanceof ht.Name?(e(i,a,s),s):t(s,a);return l===ht.Name&&!(f instanceof ht.Name)?n(i,f):f}}De.mergeEvaluated={props:jE({mergeNames:(r,e,t)=>r.if((0,ht._)`${t} !== true && ${e} !== undefined`,()=>{r.if((0,ht._)`${e} === true`,()=>r.assign(t,!0),()=>r.assign(t,(0,ht._)`${t} || {}`).code((0,ht._)`Object.assign(${t}, ${e})`))}),mergeToName:(r,e,t)=>r.if((0,ht._)`${t} !== true`,()=>{e===!0?r.assign(t,!0):(r.assign(t,(0,ht._)`${t} || {}`),sS(r,t,e))}),mergeValues:(r,e)=>r===!0?!0:{...r,...e},resultToName:WE}),items:jE({mergeNames:(r,e,t)=>r.if((0,ht._)`${t} !== true && ${e} !== undefined`,()=>r.assign(t,(0,ht._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(r,e,t)=>r.if((0,ht._)`${t} !== true`,()=>r.assign(t,e===!0?!0:(0,ht._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(r,e)=>r===!0?!0:Math.max(r,e),resultToName:(r,e)=>r.var("items",e)})};function WE(r,e){if(e===!0)return r.var("props",!0);let t=r.var("props",(0,ht._)`{}`);return e!==void 0&&sS(r,t,e),t}De.evaluatedPropsToName=WE;function sS(r,e,t){Object.keys(t).forEach(n=>r.assign((0,ht._)`${e}${(0,ht.getProperty)(n)}`,!0))}De.setEvaluated=sS;var UE={};function zj(r,e){return r.scopeValue("func",{ref:e,code:UE[e.code]||(UE[e.code]=new Fj._Code(e.code))})}De.useFunc=zj;var nS;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(nS||(De.Type=nS={}));function Jj(r,e,t){if(r instanceof ht.Name){let n=e===nS.Num;return t?n?(0,ht._)`"[" + ${r} + "]"`:(0,ht._)`"['" + ${r} + "']"`:n?(0,ht._)`"/" + ${r}`:(0,ht._)`"/" + ${r}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,ht.getProperty)(r).toString():"/"+iS(r)}De.getErrorPath=Jj;function zE(r,e,t=r.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);r.self.logger.warn(e)}}De.checkStrictMode=zE});var es=F(oS=>{"use strict";Object.defineProperty(oS,"__esModule",{value:!0});var lr=Ne(),Gj={data:new lr.Name("data"),valCxt:new lr.Name("valCxt"),instancePath:new lr.Name("instancePath"),parentData:new lr.Name("parentData"),parentDataProperty:new lr.Name("parentDataProperty"),rootData:new lr.Name("rootData"),dynamicAnchors:new lr.Name("dynamicAnchors"),vErrors:new lr.Name("vErrors"),errors:new lr.Name("errors"),this:new lr.Name("this"),self:new lr.Name("self"),scope:new lr.Name("scope"),json:new lr.Name("json"),jsonPos:new lr.Name("jsonPos"),jsonLen:new lr.Name("jsonLen"),jsonPart:new lr.Name("jsonPart")};oS.default=Gj});var Gc=F(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.extendErrors=ur.resetErrorsCount=ur.reportExtraError=ur.reportError=ur.keyword$DataError=ur.keywordError=void 0;var ze=Ne(),wh=We(),Er=es();ur.keywordError={message:({keyword:r})=>(0,ze.str)`must pass "${r}" keyword validation`};ur.keyword$DataError={message:({keyword:r,schemaType:e})=>e?(0,ze.str)`"${r}" keyword must be ${e} ($data)`:(0,ze.str)`"${r}" keyword is invalid ($data)`};function Yj(r,e=ur.keywordError,t,n){let{it:i}=r,{gen:s,compositeRule:a,allErrors:l}=i,f=YE(r,e,t);n??(a||l)?JE(s,f):GE(i,(0,ze._)`[${f}]`)}ur.reportError=Yj;function Kj(r,e=ur.keywordError,t){let{it:n}=r,{gen:i,compositeRule:s,allErrors:a}=n,l=YE(r,e,t);JE(i,l),s||a||GE(n,Er.default.vErrors)}ur.reportExtraError=Kj;function Qj(r,e){r.assign(Er.default.errors,e),r.if((0,ze._)`${Er.default.vErrors} !== null`,()=>r.if(e,()=>r.assign((0,ze._)`${Er.default.vErrors}.length`,e),()=>r.assign(Er.default.vErrors,null)))}ur.resetErrorsCount=Qj;function Zj({gen:r,keyword:e,schemaValue:t,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=r.name("err");r.forRange("i",i,Er.default.errors,l=>{r.const(a,(0,ze._)`${Er.default.vErrors}[${l}]`),r.if((0,ze._)`${a}.instancePath === undefined`,()=>r.assign((0,ze._)`${a}.instancePath`,(0,ze.strConcat)(Er.default.instancePath,s.errorPath))),r.assign((0,ze._)`${a}.schemaPath`,(0,ze.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(r.assign((0,ze._)`${a}.schema`,t),r.assign((0,ze._)`${a}.data`,n))})}ur.extendErrors=Zj;function JE(r,e){let t=r.const("err",e);r.if((0,ze._)`${Er.default.vErrors} === null`,()=>r.assign(Er.default.vErrors,(0,ze._)`[${t}]`),(0,ze._)`${Er.default.vErrors}.push(${t})`),r.code((0,ze._)`${Er.default.errors}++`)}function GE(r,e){let{gen:t,validateName:n,schemaEnv:i}=r;i.$async?t.throw((0,ze._)`new ${r.ValidationError}(${e})`):(t.assign((0,ze._)`${n}.errors`,e),t.return(!1))}var ia={keyword:new ze.Name("keyword"),schemaPath:new ze.Name("schemaPath"),params:new ze.Name("params"),propertyName:new ze.Name("propertyName"),message:new ze.Name("message"),schema:new ze.Name("schema"),parentSchema:new ze.Name("parentSchema")};function YE(r,e,t){let{createErrors:n}=r.it;return n===!1?(0,ze._)`{}`:Xj(r,e,t)}function Xj(r,e,t={}){let{gen:n,it:i}=r,s=[e2(i,t),t2(r,t)];return r2(r,e,s),n.object(...s)}function e2({errorPath:r},{instancePath:e}){let t=e?(0,ze.str)`${r}${(0,wh.getErrorPath)(e,wh.Type.Str)}`:r;return[Er.default.instancePath,(0,ze.strConcat)(Er.default.instancePath,t)]}function t2({keyword:r,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:n}){let i=n?e:(0,ze.str)`${e}/${r}`;return t&&(i=(0,ze.str)`${i}${(0,wh.getErrorPath)(t,wh.Type.Str)}`),[ia.schemaPath,i]}function r2(r,{params:e,message:t},n){let{keyword:i,data:s,schemaValue:a,it:l}=r,{opts:f,propertyName:d,topSchemaRef:h,schemaPath:g}=l;n.push([ia.keyword,i],[ia.params,typeof e=="function"?e(r):e||(0,ze._)`{}`]),f.messages&&n.push([ia.message,typeof t=="function"?t(r):t]),f.verbose&&n.push([ia.schema,a],[ia.parentSchema,(0,ze._)`${h}${g}`],[Er.default.data,s]),d&&n.push([ia.propertyName,d])}});var QE=F($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.boolOrEmptySchema=$l.topBoolOrEmptySchema=void 0;var n2=Gc(),i2=Ne(),s2=es(),o2={message:"boolean schema is false"};function a2(r){let{gen:e,schema:t,validateName:n}=r;t===!1?KE(r,!1):typeof t=="object"&&t.$async===!0?e.return(s2.default.data):(e.assign((0,i2._)`${n}.errors`,null),e.return(!0))}$l.topBoolOrEmptySchema=a2;function l2(r,e){let{gen:t,schema:n}=r;n===!1?(t.var(e,!1),KE(r)):t.var(e,!0)}$l.boolOrEmptySchema=l2;function KE(r,e){let{gen:t,data:n}=r,i={gen:t,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:r};(0,n2.reportError)(i,o2,void 0,e)}});var aS=F(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.getRules=Ml.isJSONType=void 0;var u2=["string","number","integer","boolean","null","object","array"],c2=new Set(u2);function f2(r){return typeof r=="string"&&c2.has(r)}Ml.isJSONType=f2;function d2(){let r={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...r,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},r.number,r.string,r.array,r.object],post:{rules:[]},all:{},keywords:{}}}Ml.getRules=d2});var lS=F(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.shouldUseRule=Us.shouldUseGroup=Us.schemaHasRulesForType=void 0;function p2({schema:r,self:e},t){let n=e.RULES.types[t];return n&&n!==!0&&ZE(r,n)}Us.schemaHasRulesForType=p2;function ZE(r,e){return e.rules.some(t=>XE(r,t))}Us.shouldUseGroup=ZE;function XE(r,e){var t;return r[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(n=>r[n]!==void 0))}Us.shouldUseRule=XE});var Yc=F(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.reportTypeError=cr.checkDataTypes=cr.checkDataType=cr.coerceAndCheckDataType=cr.getJSONTypes=cr.getSchemaTypes=cr.DataType=void 0;var h2=aS(),m2=lS(),g2=Gc(),Oe=Ne(),eO=We(),Nl;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(Nl||(cr.DataType=Nl={}));function y2(r){let e=tO(r.type);if(e.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&e.push("null")}return e}cr.getSchemaTypes=y2;function tO(r){let e=Array.isArray(r)?r:r?[r]:[];if(e.every(h2.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}cr.getJSONTypes=tO;function v2(r,e){let{gen:t,data:n,opts:i}=r,s=b2(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,m2.schemaHasRulesForType)(r,e[0]));if(a){let l=cS(e,n,i.strictNumbers,Nl.Wrong);t.if(l,()=>{s.length?S2(r,e,s):fS(r)})}return a}cr.coerceAndCheckDataType=v2;var rO=new Set(["string","number","integer","boolean","null"]);function b2(r,e){return e?r.filter(t=>rO.has(t)||e==="array"&&t==="array"):[]}function S2(r,e,t){let{gen:n,data:i,opts:s}=r,a=n.let("dataType",(0,Oe._)`typeof ${i}`),l=n.let("coerced",(0,Oe._)`undefined`);s.coerceTypes==="array"&&n.if((0,Oe._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Oe._)`${i}[0]`).assign(a,(0,Oe._)`typeof ${i}`).if(cS(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,Oe._)`${l} !== undefined`);for(let d of t)(rO.has(d)||d==="array"&&s.coerceTypes==="array")&&f(d);n.else(),fS(r),n.endIf(),n.if((0,Oe._)`${l} !== undefined`,()=>{n.assign(i,l),w2(r,l)});function f(d){switch(d){case"string":n.elseIf((0,Oe._)`${a} == "number" || ${a} == "boolean"`).assign(l,(0,Oe._)`"" + ${i}`).elseIf((0,Oe._)`${i} === null`).assign(l,(0,Oe._)`""`);return;case"number":n.elseIf((0,Oe._)`${a} == "boolean" || ${i} === null
|
|
23
|
+
`+new Error().stack),b=!1}return m.apply(this,arguments)},m)}var k={};function N(c,m){e.deprecationHandler!=null&&e.deprecationHandler(c,m),k[c]||(T(m),k[c]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function U(c){return typeof Function<"u"&&c instanceof Function||Object.prototype.toString.call(c)==="[object Function]"}function $(c){var m,b;for(b in c)s(c,b)&&(m=c[b],U(m)?this[b]=m:this["_"+b]=m);this._config=c,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function G(c,m){var b=g({},c),w;for(w in m)s(m,w)&&(i(c[w])&&i(m[w])?(b[w]={},g(b[w],c[w]),g(b[w],m[w])):m[w]!=null?b[w]=m[w]:delete b[w]);for(w in c)s(c,w)&&!s(m,w)&&i(c[w])&&(b[w]=g({},b[w]));return b}function K(c){c!=null&&this.set(c)}var ne;Object.keys?ne=Object.keys:ne=function(c){var m,b=[];for(m in c)s(c,m)&&b.push(m);return b};var pe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function et(c,m,b){var w=this._calendar[c]||this._calendar.sameElse;return U(w)?w.call(m,b):w}function _e(c,m,b){var w=""+Math.abs(c),E=m-w.length,M=c>=0;return(M?b?"+":"":"-")+Math.pow(10,Math.max(0,E)).toString().substr(1)+w}var he=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,xe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,bt={},It={};function ue(c,m,b,w){var E=w;typeof w=="string"&&(E=function(){return this[w]()}),c&&(It[c]=E),m&&(It[m[0]]=function(){return _e(E.apply(this,arguments),m[1],m[2])}),b&&(It[b]=function(){return this.localeData().ordinal(E.apply(this,arguments),c)})}function mr(c){return c.match(/\[[\s\S]/)?c.replace(/^\[|\]$/g,""):c.replace(/\\/g,"")}function ci(c){var m=c.match(he),b,w;for(b=0,w=m.length;b<w;b++)It[m[b]]?m[b]=It[m[b]]:m[b]=mr(m[b]);return function(E){var M="",J;for(J=0;J<w;J++)M+=U(m[J])?m[J].call(E,c):m[J];return M}}function Ct(c,m){return c.isValid()?(m=Gr(m,c.localeData()),bt[m]=bt[m]||ci(m),bt[m](c)):c.localeData().invalidDate()}function Gr(c,m){var b=5;function w(E){return m.longDateFormat(E)||E}for(xe.lastIndex=0;b>=0&&xe.test(c);)c=c.replace(xe,w),xe.lastIndex=0,b-=1;return c}var Pr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function mt(c){var m=this._longDateFormat[c],b=this._longDateFormat[c.toUpperCase()];return m||!b?m:(this._longDateFormat[c]=b.match(he).map(function(w){return w==="MMMM"||w==="MM"||w==="DD"||w==="dddd"?w.slice(1):w}).join(""),this._longDateFormat[c])}var gt="Invalid date";function ln(){return this._invalidDate}var ho="%d",Yt=/\d{1,2}/;function mo(c){return this._ordinal.replace("%d",c)}var ly={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function kn(c,m,b,w){var E=this._relativeTime[b];return U(E)?E(c,m,b,w):E.replace(/%d/i,c)}function Dd(c,m){var b=this._relativeTime[c>0?"future":"past"];return U(b)?b(m):b.replace(/%s/i,m)}var Fd={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Kt(c){return typeof c=="string"?Fd[c]||Fd[c.toLowerCase()]:void 0}function gr(c){var m={},b,w;for(w in c)s(c,w)&&(b=Kt(w),b&&(m[b]=c[w]));return m}var go={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Da(c){var m=[],b;for(b in c)s(c,b)&&m.push({unit:b,priority:go[b]});return m.sort(function(w,E){return w.priority-E.priority}),m}var Ld=/\d/,Bt=/\d\d/,jd=/\d{3}/,qi=/\d{4}/,Tn=/[+-]?\d{6}/,at=/\d\d?/,Fa=/\d\d\d\d?/,La=/\d\d\d\d\d\d?/,ms=/\d{1,3}/,yo=/\d{1,4}/,gs=/[+-]?\d{1,6}/,fi=/\d+/,ys=/[+-]?\d+/,Hu=/Z|[+-]\d\d:?\d\d/gi,ja=/Z|[+-]\d\d(?::?\d\d)?/gi,uy=/[+-]?\d+(\.\d{1,3})?/,vo=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ai=/^[1-9]\d?/,Ua=/^([1-9]\d|\d)/,Ha;Ha={};function le(c,m,b){Ha[c]=U(m)?m:function(w,E){return w&&b?b:m}}function cy(c,m){return s(Ha,c)?Ha[c](m._strict,m._locale):new RegExp(fy(c))}function fy(c){return un(c.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(m,b,w,E,M){return b||w||E||M}))}function un(c){return c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function kr(c){return c<0?Math.ceil(c)||0:Math.floor(c)}function Ae(c){var m=+c,b=0;return m!==0&&isFinite(m)&&(b=kr(m)),b}var Bu={};function Ke(c,m){var b,w=m,E;for(typeof c=="string"&&(c=[c]),f(m)&&(w=function(M,J){J[m]=Ae(M)}),E=c.length,b=0;b<E;b++)Bu[c[b]]=w}function bo(c,m){Ke(c,function(b,w,E,M){E._w=E._w||{},m(b,E._w,E,M)})}function Vu(c,m,b){m!=null&&s(Bu,c)&&Bu[c](m,b._a,b,c)}function Ba(c){return c%4===0&&c%100!==0||c%400===0}var Qt=0,qn=1,cn=2,$t=3,Tr=4,An=5,$i=6,Ud=7,dy=8;ue("Y",0,0,function(){var c=this.year();return c<=9999?_e(c,4):"+"+c}),ue(0,["YY",2],0,function(){return this.year()%100}),ue(0,["YYYY",4],0,"year"),ue(0,["YYYYY",5],0,"year"),ue(0,["YYYYYY",6,!0],0,"year"),le("Y",ys),le("YY",at,Bt),le("YYYY",yo,qi),le("YYYYY",gs,Tn),le("YYYYYY",gs,Tn),Ke(["YYYYY","YYYYYY"],Qt),Ke("YYYY",function(c,m){m[Qt]=c.length===2?e.parseTwoDigitYear(c):Ae(c)}),Ke("YY",function(c,m){m[Qt]=e.parseTwoDigitYear(c)}),Ke("Y",function(c,m){m[Qt]=parseInt(c,10)});function So(c){return Ba(c)?366:365}e.parseTwoDigitYear=function(c){return Ae(c)+(Ae(c)>68?1900:2e3)};var Hd=vs("FullYear",!0);function py(){return Ba(this.year())}function vs(c,m){return function(b){return b!=null?(_o(this,c,b),e.updateOffset(this,m),this):wo(this,c)}}function wo(c,m){if(!c.isValid())return NaN;var b=c._d,w=c._isUTC;switch(m){case"Milliseconds":return w?b.getUTCMilliseconds():b.getMilliseconds();case"Seconds":return w?b.getUTCSeconds():b.getSeconds();case"Minutes":return w?b.getUTCMinutes():b.getMinutes();case"Hours":return w?b.getUTCHours():b.getHours();case"Date":return w?b.getUTCDate():b.getDate();case"Day":return w?b.getUTCDay():b.getDay();case"Month":return w?b.getUTCMonth():b.getMonth();case"FullYear":return w?b.getUTCFullYear():b.getFullYear();default:return NaN}}function _o(c,m,b){var w,E,M,J,oe;if(!(!c.isValid()||isNaN(b))){switch(w=c._d,E=c._isUTC,m){case"Milliseconds":return void(E?w.setUTCMilliseconds(b):w.setMilliseconds(b));case"Seconds":return void(E?w.setUTCSeconds(b):w.setSeconds(b));case"Minutes":return void(E?w.setUTCMinutes(b):w.setMinutes(b));case"Hours":return void(E?w.setUTCHours(b):w.setHours(b));case"Date":return void(E?w.setUTCDate(b):w.setDate(b));case"FullYear":break;default:return}M=b,J=c.month(),oe=c.date(),oe=oe===29&&J===1&&!Ba(M)?28:oe,E?w.setUTCFullYear(M,J,oe):w.setFullYear(M,J,oe)}}function hy(c){return c=Kt(c),U(this[c])?this[c]():this}function Va(c,m){if(typeof c=="object"){c=gr(c);var b=Da(c),w,E=b.length;for(w=0;w<E;w++)this[b[w].unit](c[b[w].unit])}else if(c=Kt(c),U(this[c]))return this[c](m);return this}function my(c,m){return(c%m+m)%m}var xt;Array.prototype.indexOf?xt=Array.prototype.indexOf:xt=function(c){var m;for(m=0;m<this.length;++m)if(this[m]===c)return m;return-1};function Wu(c,m){if(isNaN(c)||isNaN(m))return NaN;var b=my(m,12);return c+=(m-b)/12,b===1?Ba(c)?29:28:31-b%7%2}ue("M",["MM",2],"Mo",function(){return this.month()+1}),ue("MMM",0,0,function(c){return this.localeData().monthsShort(this,c)}),ue("MMMM",0,0,function(c){return this.localeData().months(this,c)}),le("M",at,Ai),le("MM",at,Bt),le("MMM",function(c,m){return m.monthsShortRegex(c)}),le("MMMM",function(c,m){return m.monthsRegex(c)}),Ke(["M","MM"],function(c,m){m[qn]=Ae(c)-1}),Ke(["MMM","MMMM"],function(c,m,b,w){var E=b._locale.monthsParse(c,w,b._strict);E!=null?m[qn]=E:_(b).invalidMonth=c});var Bd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),zu="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ju=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,gy=vo,yy=vo;function vy(c,m){return c?n(this._months)?this._months[c.month()]:this._months[(this._months.isFormat||Ju).test(m)?"format":"standalone"][c.month()]:n(this._months)?this._months:this._months.standalone}function by(c,m){return c?n(this._monthsShort)?this._monthsShort[c.month()]:this._monthsShort[Ju.test(m)?"format":"standalone"][c.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Vd(c,m,b){var w,E,M,J=c.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],w=0;w<12;++w)M=y([2e3,w]),this._shortMonthsParse[w]=this.monthsShort(M,"").toLocaleLowerCase(),this._longMonthsParse[w]=this.months(M,"").toLocaleLowerCase();return b?m==="MMM"?(E=xt.call(this._shortMonthsParse,J),E!==-1?E:null):(E=xt.call(this._longMonthsParse,J),E!==-1?E:null):m==="MMM"?(E=xt.call(this._shortMonthsParse,J),E!==-1?E:(E=xt.call(this._longMonthsParse,J),E!==-1?E:null)):(E=xt.call(this._longMonthsParse,J),E!==-1?E:(E=xt.call(this._shortMonthsParse,J),E!==-1?E:null))}function Wd(c,m,b){var w,E,M;if(this._monthsParseExact)return Vd.call(this,c,m,b);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),w=0;w<12;w++){if(E=y([2e3,w]),b&&!this._longMonthsParse[w]&&(this._longMonthsParse[w]=new RegExp("^"+this.months(E,"").replace(".","")+"$","i"),this._shortMonthsParse[w]=new RegExp("^"+this.monthsShort(E,"").replace(".","")+"$","i")),!b&&!this._monthsParse[w]&&(M="^"+this.months(E,"")+"|^"+this.monthsShort(E,""),this._monthsParse[w]=new RegExp(M.replace(".",""),"i")),b&&m==="MMMM"&&this._longMonthsParse[w].test(c))return w;if(b&&m==="MMM"&&this._shortMonthsParse[w].test(c))return w;if(!b&&this._monthsParse[w].test(c))return w}}function Gu(c,m){if(!c.isValid())return c;if(typeof m=="string"){if(/^\d+$/.test(m))m=Ae(m);else if(m=c.localeData().monthsParse(m),!f(m))return c}var b=m,w=c.date();return w=w<29?w:Math.min(w,Wu(c.year(),b)),c._isUTC?c._d.setUTCMonth(b,w):c._d.setMonth(b,w),c}function Wa(c){return c!=null?(Gu(this,c),e.updateOffset(this,!0),this):wo(this,"Month")}function Sy(){return Wu(this.year(),this.month())}function zd(c){return this._monthsParseExact?(s(this,"_monthsRegex")||Yu.call(this),c?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=gy),this._monthsShortStrictRegex&&c?this._monthsShortStrictRegex:this._monthsShortRegex)}function za(c){return this._monthsParseExact?(s(this,"_monthsRegex")||Yu.call(this),c?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=yy),this._monthsStrictRegex&&c?this._monthsStrictRegex:this._monthsRegex)}function Yu(){function c(ve,Me){return Me.length-ve.length}var m=[],b=[],w=[],E,M,J,oe;for(E=0;E<12;E++)M=y([2e3,E]),J=un(this.monthsShort(M,"")),oe=un(this.months(M,"")),m.push(J),b.push(oe),w.push(oe),w.push(J);m.sort(c),b.sort(c),w.sort(c),this._monthsRegex=new RegExp("^("+w.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+m.join("|")+")","i")}function wy(c,m,b,w,E,M,J){var oe;return c<100&&c>=0?(oe=new Date(c+400,m,b,w,E,M,J),isFinite(oe.getFullYear())&&oe.setFullYear(c)):oe=new Date(c,m,b,w,E,M,J),oe}function bs(c){var m,b;return c<100&&c>=0?(b=Array.prototype.slice.call(arguments),b[0]=c+400,m=new Date(Date.UTC.apply(null,b)),isFinite(m.getUTCFullYear())&&m.setUTCFullYear(c)):m=new Date(Date.UTC.apply(null,arguments)),m}function Ro(c,m,b){var w=7+m-b,E=(7+bs(c,0,w).getUTCDay()-m)%7;return-E+w-1}function Ja(c,m,b,w,E){var M=(7+b-w)%7,J=Ro(c,w,E),oe=1+7*(m-1)+M+J,ve,Me;return oe<=0?(ve=c-1,Me=So(ve)+oe):oe>So(c)?(ve=c+1,Me=oe-So(c)):(ve=c,Me=oe),{year:ve,dayOfYear:Me}}function Co(c,m,b){var w=Ro(c.year(),m,b),E=Math.floor((c.dayOfYear()-w-1)/7)+1,M,J;return E<1?(J=c.year()-1,M=E+fn(J,m,b)):E>fn(c.year(),m,b)?(M=E-fn(c.year(),m,b),J=c.year()+1):(J=c.year(),M=E),{week:M,year:J}}function fn(c,m,b){var w=Ro(c,m,b),E=Ro(c+1,m,b);return(So(c)-w+E)/7}ue("w",["ww",2],"wo","week"),ue("W",["WW",2],"Wo","isoWeek"),le("w",at,Ai),le("ww",at,Bt),le("W",at,Ai),le("WW",at,Bt),bo(["w","ww","W","WW"],function(c,m,b,w){m[w.substr(0,1)]=Ae(c)});function Ku(c){return Co(c,this._week.dow,this._week.doy).week}var Qu={dow:0,doy:6};function Ss(){return this._week.dow}function Jd(){return this._week.doy}function Gd(c){var m=this.localeData().week(this);return c==null?m:this.add((c-m)*7,"d")}function _y(c){var m=Co(this,1,4).week;return c==null?m:this.add((c-m)*7,"d")}ue("d",0,"do","day"),ue("dd",0,0,function(c){return this.localeData().weekdaysMin(this,c)}),ue("ddd",0,0,function(c){return this.localeData().weekdaysShort(this,c)}),ue("dddd",0,0,function(c){return this.localeData().weekdays(this,c)}),ue("e",0,0,"weekday"),ue("E",0,0,"isoWeekday"),le("d",at),le("e",at),le("E",at),le("dd",function(c,m){return m.weekdaysMinRegex(c)}),le("ddd",function(c,m){return m.weekdaysShortRegex(c)}),le("dddd",function(c,m){return m.weekdaysRegex(c)}),bo(["dd","ddd","dddd"],function(c,m,b,w){var E=b._locale.weekdaysParse(c,w,b._strict);E!=null?m.d=E:_(b).invalidWeekday=c}),bo(["d","e","E"],function(c,m,b,w){m[w]=Ae(c)});function Yd(c,m){return typeof c!="string"?c:isNaN(c)?(c=m.weekdaysParse(c),typeof c=="number"?c:null):parseInt(c,10)}function Kd(c,m){return typeof c=="string"?m.weekdaysParse(c)%7||7:isNaN(c)?null:c}function Ga(c,m){return c.slice(m,7).concat(c.slice(0,m))}var Qd="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Zd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ry="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Cy=vo,Xd=vo,xy=vo;function Ey(c,m){var b=n(this._weekdays)?this._weekdays:this._weekdays[c&&c!==!0&&this._weekdays.isFormat.test(m)?"format":"standalone"];return c===!0?Ga(b,this._week.dow):c?b[c.day()]:b}function Oy(c){return c===!0?Ga(this._weekdaysShort,this._week.dow):c?this._weekdaysShort[c.day()]:this._weekdaysShort}function Iy(c){return c===!0?Ga(this._weekdaysMin,this._week.dow):c?this._weekdaysMin[c.day()]:this._weekdaysMin}function Zu(c,m,b){var w,E,M,J=c.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],w=0;w<7;++w)M=y([2e3,1]).day(w),this._minWeekdaysParse[w]=this.weekdaysMin(M,"").toLocaleLowerCase(),this._shortWeekdaysParse[w]=this.weekdaysShort(M,"").toLocaleLowerCase(),this._weekdaysParse[w]=this.weekdays(M,"").toLocaleLowerCase();return b?m==="dddd"?(E=xt.call(this._weekdaysParse,J),E!==-1?E:null):m==="ddd"?(E=xt.call(this._shortWeekdaysParse,J),E!==-1?E:null):(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null):m==="dddd"?(E=xt.call(this._weekdaysParse,J),E!==-1||(E=xt.call(this._shortWeekdaysParse,J),E!==-1)?E:(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null)):m==="ddd"?(E=xt.call(this._shortWeekdaysParse,J),E!==-1||(E=xt.call(this._weekdaysParse,J),E!==-1)?E:(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null)):(E=xt.call(this._minWeekdaysParse,J),E!==-1||(E=xt.call(this._weekdaysParse,J),E!==-1)?E:(E=xt.call(this._shortWeekdaysParse,J),E!==-1?E:null))}function Py(c,m,b){var w,E,M;if(this._weekdaysParseExact)return Zu.call(this,c,m,b);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),w=0;w<7;w++){if(E=y([2e3,1]).day(w),b&&!this._fullWeekdaysParse[w]&&(this._fullWeekdaysParse[w]=new RegExp("^"+this.weekdays(E,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[w]=new RegExp("^"+this.weekdaysShort(E,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[w]=new RegExp("^"+this.weekdaysMin(E,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[w]||(M="^"+this.weekdays(E,"")+"|^"+this.weekdaysShort(E,"")+"|^"+this.weekdaysMin(E,""),this._weekdaysParse[w]=new RegExp(M.replace(".",""),"i")),b&&m==="dddd"&&this._fullWeekdaysParse[w].test(c))return w;if(b&&m==="ddd"&&this._shortWeekdaysParse[w].test(c))return w;if(b&&m==="dd"&&this._minWeekdaysParse[w].test(c))return w;if(!b&&this._weekdaysParse[w].test(c))return w}}function ky(c){if(!this.isValid())return c!=null?this:NaN;var m=wo(this,"Day");return c!=null?(c=Yd(c,this.localeData()),this.add(c-m,"d")):m}function Ty(c){if(!this.isValid())return c!=null?this:NaN;var m=(this.day()+7-this.localeData()._week.dow)%7;return c==null?m:this.add(c-m,"d")}function qy(c){if(!this.isValid())return c!=null?this:NaN;if(c!=null){var m=Kd(c,this.localeData());return this.day(this.day()%7?m:m-7)}else return this.day()||7}function Ay(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xu.call(this),c?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Cy),this._weekdaysStrictRegex&&c?this._weekdaysStrictRegex:this._weekdaysRegex)}function dt(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xu.call(this),c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Xd),this._weekdaysShortStrictRegex&&c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function ut(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xu.call(this),c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=xy),this._weekdaysMinStrictRegex&&c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xu(){function c(Lt,Ln){return Ln.length-Lt.length}var m=[],b=[],w=[],E=[],M,J,oe,ve,Me;for(M=0;M<7;M++)J=y([2e3,1]).day(M),oe=un(this.weekdaysMin(J,"")),ve=un(this.weekdaysShort(J,"")),Me=un(this.weekdays(J,"")),m.push(oe),b.push(ve),w.push(Me),E.push(oe),E.push(ve),E.push(Me);m.sort(c),b.sort(c),w.sort(c),E.sort(c),this._weekdaysRegex=new RegExp("^("+E.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+m.join("|")+")","i")}function ec(){return this.hours()%12||12}function $y(){return this.hours()||24}ue("H",["HH",2],0,"hour"),ue("h",["hh",2],0,ec),ue("k",["kk",2],0,$y),ue("hmm",0,0,function(){return""+ec.apply(this)+_e(this.minutes(),2)}),ue("hmmss",0,0,function(){return""+ec.apply(this)+_e(this.minutes(),2)+_e(this.seconds(),2)}),ue("Hmm",0,0,function(){return""+this.hours()+_e(this.minutes(),2)}),ue("Hmmss",0,0,function(){return""+this.hours()+_e(this.minutes(),2)+_e(this.seconds(),2)});function ep(c,m){ue(c,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),m)})}ep("a",!0),ep("A",!1);function tp(c,m){return m._meridiemParse}le("a",tp),le("A",tp),le("H",at,Ua),le("h",at,Ai),le("k",at,Ai),le("HH",at,Bt),le("hh",at,Bt),le("kk",at,Bt),le("hmm",Fa),le("hmmss",La),le("Hmm",Fa),le("Hmmss",La),Ke(["H","HH"],$t),Ke(["k","kk"],function(c,m,b){var w=Ae(c);m[$t]=w===24?0:w}),Ke(["a","A"],function(c,m,b){b._isPm=b._locale.isPM(c),b._meridiem=c}),Ke(["h","hh"],function(c,m,b){m[$t]=Ae(c),_(b).bigHour=!0}),Ke("hmm",function(c,m,b){var w=c.length-2;m[$t]=Ae(c.substr(0,w)),m[Tr]=Ae(c.substr(w)),_(b).bigHour=!0}),Ke("hmmss",function(c,m,b){var w=c.length-4,E=c.length-2;m[$t]=Ae(c.substr(0,w)),m[Tr]=Ae(c.substr(w,2)),m[An]=Ae(c.substr(E)),_(b).bigHour=!0}),Ke("Hmm",function(c,m,b){var w=c.length-2;m[$t]=Ae(c.substr(0,w)),m[Tr]=Ae(c.substr(w))}),Ke("Hmmss",function(c,m,b){var w=c.length-4,E=c.length-2;m[$t]=Ae(c.substr(0,w)),m[Tr]=Ae(c.substr(w,2)),m[An]=Ae(c.substr(E))});function My(c){return(c+"").toLowerCase().charAt(0)==="p"}var rp=/[ap]\.?m?\.?/i,Ny=vs("Hours",!0);function Ft(c,m,b){return c>11?b?"pm":"PM":b?"am":"AM"}var Ya={calendar:pe,longDateFormat:Pr,invalidDate:gt,ordinal:ho,dayOfMonthOrdinalParse:Yt,relativeTime:ly,months:Bd,monthsShort:zu,week:Qu,weekdays:Qd,weekdaysMin:Ry,weekdaysShort:Zd,meridiemParse:rp},Qe={},ws={},Mi;function qr(c,m){var b,w=Math.min(c.length,m.length);for(b=0;b<w;b+=1)if(c[b]!==m[b])return b;return w}function tc(c){return c&&c.toLowerCase().replace("_","-")}function np(c){for(var m=0,b,w,E,M;m<c.length;){for(M=tc(c[m]).split("-"),b=M.length,w=tc(c[m+1]),w=w?w.split("-"):null;b>0;){if(E=xo(M.slice(0,b).join("-")),E)return E;if(w&&w.length>=b&&qr(M,w)>=b-1)break;b--}m++}return Mi}function ip(c){return!!(c&&c.match("^[^/\\\\]*$"))}function xo(c){var m=null,b;if(Qe[c]===void 0&&typeof Tl<"u"&&Tl&&Tl.exports&&ip(c))try{m=Mi._abbr,b=it,b("./locale/"+c),$n(m)}catch{Qe[c]=null}return Qe[c]}function $n(c,m){var b;return c&&(l(m)?b=Mn(c):b=Ka(c,m),b?Mi=b:typeof console<"u"&&console.warn&&console.warn("Locale "+c+" not found. Did you forget to load it?")),Mi._abbr}function Ka(c,m){if(m!==null){var b,w=Ya;if(m.abbr=c,Qe[c]!=null)N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),w=Qe[c]._config;else if(m.parentLocale!=null)if(Qe[m.parentLocale]!=null)w=Qe[m.parentLocale]._config;else if(b=xo(m.parentLocale),b!=null)w=b._config;else return ws[m.parentLocale]||(ws[m.parentLocale]=[]),ws[m.parentLocale].push({name:c,config:m}),null;return Qe[c]=new K(G(w,m)),ws[c]&&ws[c].forEach(function(E){Ka(E.name,E.config)}),$n(c),Qe[c]}else return delete Qe[c],null}function yr(c,m){if(m!=null){var b,w,E=Ya;Qe[c]!=null&&Qe[c].parentLocale!=null?Qe[c].set(G(Qe[c]._config,m)):(w=xo(c),w!=null&&(E=w._config),m=G(E,m),w==null&&(m.abbr=c),b=new K(m),b.parentLocale=Qe[c],Qe[c]=b),$n(c)}else Qe[c]!=null&&(Qe[c].parentLocale!=null?(Qe[c]=Qe[c].parentLocale,c===$n()&&$n(c)):Qe[c]!=null&&delete Qe[c]);return Qe[c]}function Mn(c){var m;if(c&&c._locale&&c._locale._abbr&&(c=c._locale._abbr),!c)return Mi;if(!n(c)){if(m=xo(c),m)return m;c=[c]}return np(c)}function vr(){return ne(Qe)}function rc(c){var m,b=c._a;return b&&_(c).overflow===-2&&(m=b[qn]<0||b[qn]>11?qn:b[cn]<1||b[cn]>Wu(b[Qt],b[qn])?cn:b[$t]<0||b[$t]>24||b[$t]===24&&(b[Tr]!==0||b[An]!==0||b[$i]!==0)?$t:b[Tr]<0||b[Tr]>59?Tr:b[An]<0||b[An]>59?An:b[$i]<0||b[$i]>999?$i:-1,_(c)._overflowDayOfYear&&(m<Qt||m>cn)&&(m=cn),_(c)._overflowWeeks&&m===-1&&(m=Ud),_(c)._overflowWeekday&&m===-1&&(m=dy),_(c).overflow=m),c}var sp=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,di=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Qa=/Z|[+-]\d\d(?::?\d\d)?/,_s=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ct=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pi=/^\/?Date\((-?\d+)/i,nc=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dy={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Za(c){var m,b,w=c._i,E=sp.exec(w)||di.exec(w),M,J,oe,ve,Me=_s.length,Lt=ct.length;if(E){for(_(c).iso=!0,m=0,b=Me;m<b;m++)if(_s[m][1].exec(E[1])){J=_s[m][0],M=_s[m][2]!==!1;break}if(J==null){c._isValid=!1;return}if(E[3]){for(m=0,b=Lt;m<b;m++)if(ct[m][1].exec(E[3])){oe=(E[2]||" ")+ct[m][0];break}if(oe==null){c._isValid=!1;return}}if(!M&&oe!=null){c._isValid=!1;return}if(E[4])if(Qa.exec(E[4]))ve="Z";else{c._isValid=!1;return}c._f=J+(oe||"")+(ve||""),el(c)}else c._isValid=!1}function Fy(c,m,b,w,E,M){var J=[Ly(c),zu.indexOf(m),parseInt(b,10),parseInt(w,10),parseInt(E,10)];return M&&J.push(parseInt(M,10)),J}function Ly(c){var m=parseInt(c,10);return m<=49?2e3+m:m<=999?1900+m:m}function jy(c){return c.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function op(c,m,b){if(c){var w=Zd.indexOf(c),E=new Date(m[0],m[1],m[2]).getDay();if(w!==E)return _(b).weekdayMismatch=!0,b._isValid=!1,!1}return!0}function Xa(c,m,b){if(c)return Dy[c];if(m)return 0;var w=parseInt(b,10),E=w%100,M=(w-E)/100;return M*60+E}function Ni(c){var m=nc.exec(jy(c._i)),b;if(m){if(b=Fy(m[4],m[3],m[2],m[5],m[6],m[7]),!op(m[1],b,c))return;c._a=b,c._tzm=Xa(m[8],m[9],m[10]),c._d=bs.apply(null,c._a),c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),_(c).rfc2822=!0}else c._isValid=!1}function Uy(c){var m=pi.exec(c._i);if(m!==null){c._d=new Date(+m[1]);return}if(Za(c),c._isValid===!1)delete c._isValid;else return;if(Ni(c),c._isValid===!1)delete c._isValid;else return;c._strict?c._isValid=!1:e.createFromInputFallback(c)}e.createFromInputFallback=C("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(c){c._d=new Date(c._i+(c._useUTC?" UTC":""))});function Di(c,m,b){return c??m??b}function ap(c){var m=new Date(e.now());return c._useUTC?[m.getUTCFullYear(),m.getUTCMonth(),m.getUTCDate()]:[m.getFullYear(),m.getMonth(),m.getDate()]}function Eo(c){var m,b,w=[],E,M,J;if(!c._d){for(E=ap(c),c._w&&c._a[cn]==null&&c._a[qn]==null&&ic(c),c._dayOfYear!=null&&(J=Di(c._a[Qt],E[Qt]),(c._dayOfYear>So(J)||c._dayOfYear===0)&&(_(c)._overflowDayOfYear=!0),b=bs(J,0,c._dayOfYear),c._a[qn]=b.getUTCMonth(),c._a[cn]=b.getUTCDate()),m=0;m<3&&c._a[m]==null;++m)c._a[m]=w[m]=E[m];for(;m<7;m++)c._a[m]=w[m]=c._a[m]==null?m===2?1:0:c._a[m];c._a[$t]===24&&c._a[Tr]===0&&c._a[An]===0&&c._a[$i]===0&&(c._nextDay=!0,c._a[$t]=0),c._d=(c._useUTC?bs:wy).apply(null,w),M=c._useUTC?c._d.getUTCDay():c._d.getDay(),c._tzm!=null&&c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),c._nextDay&&(c._a[$t]=24),c._w&&typeof c._w.d<"u"&&c._w.d!==M&&(_(c).weekdayMismatch=!0)}}function ic(c){var m,b,w,E,M,J,oe,ve,Me;m=c._w,m.GG!=null||m.W!=null||m.E!=null?(M=1,J=4,b=Di(m.GG,c._a[Qt],Co(tt(),1,4).year),w=Di(m.W,1),E=Di(m.E,1),(E<1||E>7)&&(ve=!0)):(M=c._locale._week.dow,J=c._locale._week.doy,Me=Co(tt(),M,J),b=Di(m.gg,c._a[Qt],Me.year),w=Di(m.w,Me.week),m.d!=null?(E=m.d,(E<0||E>6)&&(ve=!0)):m.e!=null?(E=m.e+M,(m.e<0||m.e>6)&&(ve=!0)):E=M),w<1||w>fn(b,M,J)?_(c)._overflowWeeks=!0:ve!=null?_(c)._overflowWeekday=!0:(oe=Ja(b,w,E,M,J),c._a[Qt]=oe.year,c._dayOfYear=oe.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function el(c){if(c._f===e.ISO_8601){Za(c);return}if(c._f===e.RFC_2822){Ni(c);return}c._a=[],_(c).empty=!0;var m=""+c._i,b,w,E,M,J,oe=m.length,ve=0,Me,Lt;for(E=Gr(c._f,c._locale).match(he)||[],Lt=E.length,b=0;b<Lt;b++)M=E[b],w=(m.match(cy(M,c))||[])[0],w&&(J=m.substr(0,m.indexOf(w)),J.length>0&&_(c).unusedInput.push(J),m=m.slice(m.indexOf(w)+w.length),ve+=w.length),It[M]?(w?_(c).empty=!1:_(c).unusedTokens.push(M),Vu(M,w,c)):c._strict&&!w&&_(c).unusedTokens.push(M);_(c).charsLeftOver=oe-ve,m.length>0&&_(c).unusedInput.push(m),c._a[$t]<=12&&_(c).bigHour===!0&&c._a[$t]>0&&(_(c).bigHour=void 0),_(c).parsedDateParts=c._a.slice(0),_(c).meridiem=c._meridiem,c._a[$t]=Hy(c._locale,c._a[$t],c._meridiem),Me=_(c).era,Me!==null&&(c._a[Qt]=c._locale.erasConvertYear(Me,c._a[Qt])),Eo(c),rc(c)}function Hy(c,m,b){var w;return b==null?m:c.meridiemHour!=null?c.meridiemHour(m,b):(c.isPM!=null&&(w=c.isPM(b),w&&m<12&&(m+=12),!w&&m===12&&(m=0)),m)}function sc(c){var m,b,w,E,M,J,oe=!1,ve=c._f.length;if(ve===0){_(c).invalidFormat=!0,c._d=new Date(NaN);return}for(E=0;E<ve;E++)M=0,J=!1,m=V({},c),c._useUTC!=null&&(m._useUTC=c._useUTC),m._f=c._f[E],el(m),I(m)&&(J=!0),M+=_(m).charsLeftOver,M+=_(m).unusedTokens.length*10,_(m).score=M,oe?M<w&&(w=M,b=m):(w==null||M<w||J)&&(w=M,b=m,J&&(oe=!0));g(c,b||m)}function oc(c){if(!c._d){var m=gr(c._i),b=m.day===void 0?m.date:m.day;c._a=h([m.year,m.month,b,m.hour,m.minute,m.second,m.millisecond],function(w){return w&&parseInt(w,10)}),Eo(c)}}function By(c){var m=new W(rc(ac(c)));return m._nextDay&&(m.add(1,"d"),m._nextDay=void 0),m}function ac(c){var m=c._i,b=c._f;return c._locale=c._locale||Mn(c._l),m===null||b===void 0&&m===""?q({nullInput:!0}):(typeof m=="string"&&(c._i=m=c._locale.preparse(m)),X(m)?new W(rc(m)):(d(m)?c._d=m:n(b)?sc(c):b?el(c):br(c),I(c)||(c._d=null),c))}function br(c){var m=c._i;l(m)?c._d=new Date(e.now()):d(m)?c._d=new Date(m.valueOf()):typeof m=="string"?Uy(c):n(m)?(c._a=h(m.slice(0),function(b){return parseInt(b,10)}),Eo(c)):i(m)?oc(c):f(m)?c._d=new Date(m):e.createFromInputFallback(c)}function tl(c,m,b,w,E){var M={};return(m===!0||m===!1)&&(w=m,m=void 0),(b===!0||b===!1)&&(w=b,b=void 0),(i(c)&&a(c)||n(c)&&c.length===0)&&(c=void 0),M._isAMomentObject=!0,M._useUTC=M._isUTC=E,M._l=b,M._i=c,M._f=m,M._strict=w,By(M)}function tt(c,m,b,w){return tl(c,m,b,w,!1)}var lp=C("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=tt.apply(null,arguments);return this.isValid()&&c.isValid()?c<this?this:c:q()}),up=C("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=tt.apply(null,arguments);return this.isValid()&&c.isValid()?c>this?this:c:q()});function cp(c,m){var b,w;if(m.length===1&&n(m[0])&&(m=m[0]),!m.length)return tt();for(b=m[0],w=1;w<m.length;++w)(!m[w].isValid()||m[w][c](b))&&(b=m[w]);return b}function Vy(){var c=[].slice.call(arguments,0);return cp("isBefore",c)}function Wy(){var c=[].slice.call(arguments,0);return cp("isAfter",c)}var zy=function(){return Date.now?Date.now():+new Date},Oo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Rs(c){var m,b=!1,w,E=Oo.length;for(m in c)if(s(c,m)&&!(xt.call(Oo,m)!==-1&&(c[m]==null||!isNaN(c[m]))))return!1;for(w=0;w<E;++w)if(c[Oo[w]]){if(b)return!1;parseFloat(c[Oo[w]])!==Ae(c[Oo[w]])&&(b=!0)}return!0}function Jy(){return this._isValid}function Gy(){return rt(NaN)}function Cs(c){var m=gr(c),b=m.year||0,w=m.quarter||0,E=m.month||0,M=m.week||m.isoWeek||0,J=m.day||0,oe=m.hour||0,ve=m.minute||0,Me=m.second||0,Lt=m.millisecond||0;this._isValid=Rs(m),this._milliseconds=+Lt+Me*1e3+ve*6e4+oe*1e3*60*60,this._days=+J+M*7,this._months=+E+w*3+b*12,this._data={},this._locale=Mn(),this._bubble()}function Io(c){return c instanceof Cs}function dn(c){return c<0?Math.round(-1*c)*-1:Math.round(c)}function rl(c,m,b){var w=Math.min(c.length,m.length),E=Math.abs(c.length-m.length),M=0,J;for(J=0;J<w;J++)(b&&c[J]!==m[J]||!b&&Ae(c[J])!==Ae(m[J]))&&M++;return M+E}function fp(c,m){ue(c,0,0,function(){var b=this.utcOffset(),w="+";return b<0&&(b=-b,w="-"),w+_e(~~(b/60),2)+m+_e(~~b%60,2)})}fp("Z",":"),fp("ZZ",""),le("Z",ja),le("ZZ",ja),Ke(["Z","ZZ"],function(c,m,b){b._useUTC=!0,b._tzm=lc(ja,c)});var Yy=/([\+\-]|\d\d)/gi;function lc(c,m){var b=(m||"").match(c),w,E,M;return b===null?null:(w=b[b.length-1]||[],E=(w+"").match(Yy)||["-",0,0],M=+(E[1]*60)+Ae(E[2]),M===0?0:E[0]==="+"?M:-M)}function hi(c,m){var b,w;return m._isUTC?(b=m.clone(),w=(X(c)||d(c)?c.valueOf():tt(c).valueOf())-b.valueOf(),b._d.setTime(b._d.valueOf()+w),e.updateOffset(b,!1),b):tt(c).local()}function Sr(c){return-Math.round(c._d.getTimezoneOffset())}e.updateOffset=function(){};function dp(c,m,b){var w=this._offset||0,E;if(!this.isValid())return c!=null?this:NaN;if(c!=null){if(typeof c=="string"){if(c=lc(ja,c),c===null)return this}else Math.abs(c)<16&&!b&&(c=c*60);return!this._isUTC&&m&&(E=Sr(this)),this._offset=c,this._isUTC=!0,E!=null&&this.add(E,"m"),w!==c&&(!m||this._changeInProgress?Po(this,rt(c-w,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?w:Sr(this)}function Ky(c,m){return c!=null?(typeof c!="string"&&(c=-c),this.utcOffset(c,m),this):-this.utcOffset()}function Qy(c){return this.utcOffset(0,c)}function Zy(c){return this._isUTC&&(this.utcOffset(0,c),this._isUTC=!1,c&&this.subtract(Sr(this),"m")),this}function Xy(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var c=lc(Hu,this._i);c!=null?this.utcOffset(c):this.utcOffset(0,!0)}return this}function ev(c){return this.isValid()?(c=c?tt(c).utcOffset():0,(this.utcOffset()-c)%60===0):!1}function mi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function L(){if(!l(this._isDSTShifted))return this._isDSTShifted;var c={},m;return V(c,this),c=ac(c),c._a?(m=c._isUTC?y(c._a):tt(c._a),this._isDSTShifted=this.isValid()&&rl(c._a,m.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Y(){return this.isValid()?!this._isUTC:!1}function z(){return this.isValid()?this._isUTC:!1}function ae(){return this.isValid()?this._isUTC&&this._offset===0:!1}var be=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ge=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function rt(c,m){var b=c,w=null,E,M,J;return Io(c)?b={ms:c._milliseconds,d:c._days,M:c._months}:f(c)||!isNaN(+c)?(b={},m?b[m]=+c:b.milliseconds=+c):(w=be.exec(c))?(E=w[1]==="-"?-1:1,b={y:0,d:Ae(w[cn])*E,h:Ae(w[$t])*E,m:Ae(w[Tr])*E,s:Ae(w[An])*E,ms:Ae(dn(w[$i]*1e3))*E}):(w=Ge.exec(c))?(E=w[1]==="-"?-1:1,b={y:Ue(w[2],E),M:Ue(w[3],E),w:Ue(w[4],E),d:Ue(w[5],E),h:Ue(w[6],E),m:Ue(w[7],E),s:Ue(w[8],E)}):b==null?b={}:typeof b=="object"&&("from"in b||"to"in b)&&(J=tv(tt(b.from),tt(b.to)),b={},b.ms=J.milliseconds,b.M=J.months),M=new Cs(b),Io(c)&&s(c,"_locale")&&(M._locale=c._locale),Io(c)&&s(c,"_isValid")&&(M._isValid=c._isValid),M}rt.fn=Cs.prototype,rt.invalid=Gy;function Ue(c,m){var b=c&&parseFloat(c.replace(",","."));return(isNaN(b)?0:b)*m}function nl(c,m){var b={};return b.months=m.month()-c.month()+(m.year()-c.year())*12,c.clone().add(b.months,"M").isAfter(m)&&--b.months,b.milliseconds=+m-+c.clone().add(b.months,"M"),b}function tv(c,m){var b;return c.isValid()&&m.isValid()?(m=hi(m,c),c.isBefore(m)?b=nl(c,m):(b=nl(m,c),b.milliseconds=-b.milliseconds,b.months=-b.months),b):{milliseconds:0,months:0}}function wr(c,m){return function(b,w){var E,M;return w!==null&&!isNaN(+w)&&(N(m,"moment()."+m+"(period, number) is deprecated. Please use moment()."+m+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),M=b,b=w,w=M),E=rt(b,w),Po(this,E,c),this}}function Po(c,m,b,w){var E=m._milliseconds,M=dn(m._days),J=dn(m._months);c.isValid()&&(w=w??!0,J&&Gu(c,wo(c,"Month")+J*b),M&&_o(c,"Date",wo(c,"Date")+M*b),E&&c._d.setTime(c._d.valueOf()+E*b),w&&e.updateOffset(c,M||J))}var rv=wr(1,"add"),xs=wr(-1,"subtract");function ko(c){return typeof c=="string"||c instanceof String}function il(c){return X(c)||d(c)||ko(c)||f(c)||nv(c)||Ze(c)||c===null||c===void 0}function Ze(c){var m=i(c)&&!a(c),b=!1,w=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],E,M,J=w.length;for(E=0;E<J;E+=1)M=w[E],b=b||s(c,M);return m&&b}function nv(c){var m=n(c),b=!1;return m&&(b=c.filter(function(w){return!f(w)&&ko(c)}).length===0),m&&b}function pp(c){var m=i(c)&&!a(c),b=!1,w=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],E,M;for(E=0;E<w.length;E+=1)M=w[E],b=b||s(c,M);return m&&b}function sl(c,m){var b=c.diff(m,"days",!0);return b<-6?"sameElse":b<-1?"lastWeek":b<0?"lastDay":b<1?"sameDay":b<2?"nextDay":b<7?"nextWeek":"sameElse"}function iv(c,m){arguments.length===1&&(arguments[0]?il(arguments[0])?(c=arguments[0],m=void 0):pp(arguments[0])&&(m=arguments[0],c=void 0):(c=void 0,m=void 0));var b=c||tt(),w=hi(b,this).startOf("day"),E=e.calendarFormat(this,w)||"sameElse",M=m&&(U(m[E])?m[E].call(this,b):m[E]);return this.format(M||this.localeData().calendar(E,this,tt(b)))}function sv(){return new W(this)}function ov(c,m){var b=X(c)?c:tt(c);return this.isValid()&&b.isValid()?(m=Kt(m)||"millisecond",m==="millisecond"?this.valueOf()>b.valueOf():b.valueOf()<this.clone().startOf(m).valueOf()):!1}function ol(c,m){var b=X(c)?c:tt(c);return this.isValid()&&b.isValid()?(m=Kt(m)||"millisecond",m==="millisecond"?this.valueOf()<b.valueOf():this.clone().endOf(m).valueOf()<b.valueOf()):!1}function gi(c,m,b,w){var E=X(c)?c:tt(c),M=X(m)?m:tt(m);return this.isValid()&&E.isValid()&&M.isValid()?(w=w||"()",(w[0]==="("?this.isAfter(E,b):!this.isBefore(E,b))&&(w[1]===")"?this.isBefore(M,b):!this.isAfter(M,b))):!1}function al(c,m){var b=X(c)?c:tt(c),w;return this.isValid()&&b.isValid()?(m=Kt(m)||"millisecond",m==="millisecond"?this.valueOf()===b.valueOf():(w=b.valueOf(),this.clone().startOf(m).valueOf()<=w&&w<=this.clone().endOf(m).valueOf())):!1}function hp(c,m){return this.isSame(c,m)||this.isAfter(c,m)}function ll(c,m){return this.isSame(c,m)||this.isBefore(c,m)}function mp(c,m,b){var w,E,M;if(!this.isValid())return NaN;if(w=hi(c,this),!w.isValid())return NaN;switch(E=(w.utcOffset()-this.utcOffset())*6e4,m=Kt(m),m){case"year":M=To(this,w)/12;break;case"month":M=To(this,w);break;case"quarter":M=To(this,w)/3;break;case"second":M=(this-w)/1e3;break;case"minute":M=(this-w)/6e4;break;case"hour":M=(this-w)/36e5;break;case"day":M=(this-w-E)/864e5;break;case"week":M=(this-w-E)/6048e5;break;default:M=this-w}return b?M:kr(M)}function To(c,m){if(c.date()<m.date())return-To(m,c);var b=(m.year()-c.year())*12+(m.month()-c.month()),w=c.clone().add(b,"months"),E,M;return m-w<0?(E=c.clone().add(b-1,"months"),M=(m-w)/(w-E)):(E=c.clone().add(b+1,"months"),M=(m-w)/(E-w)),-(b+M)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function ul(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function gp(c){if(!this.isValid())return null;var m=c!==!0,b=m?this.clone().utc():this;return b.year()<0||b.year()>9999?Ct(b,m?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):U(Date.prototype.toISOString)?m?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Ct(b,"Z")):Ct(b,m?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function qo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var c="moment",m="",b,w,E,M;return this.isLocal()||(c=this.utcOffset()===0?"moment.utc":"moment.parseZone",m="Z"),b="["+c+'("]',w=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",E="-MM-DD[T]HH:mm:ss.SSS",M=m+'[")]',this.format(b+w+E+M)}function Fi(c){c||(c=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var m=Ct(this,c);return this.localeData().postformat(m)}function cl(c,m){return this.isValid()&&(X(c)&&c.isValid()||tt(c).isValid())?rt({to:this,from:c}).locale(this.locale()).humanize(!m):this.localeData().invalidDate()}function av(c){return this.from(tt(),c)}function lv(c,m){return this.isValid()&&(X(c)&&c.isValid()||tt(c).isValid())?rt({from:this,to:c}).locale(this.locale()).humanize(!m):this.localeData().invalidDate()}function uv(c){return this.to(tt(),c)}function Ao(c){var m;return c===void 0?this._locale._abbr:(m=Mn(c),m!=null&&(this._locale=m),this)}var $o=C("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(c){return c===void 0?this.localeData():this.locale(c)});function fl(){return this._locale}var dl=1e3,Li=60*dl,pl=60*Li,yp=(365*400+97)*24*pl;function yt(c,m){return(c%m+m)%m}function Vt(c,m,b){return c<100&&c>=0?new Date(c+400,m,b)-yp:new Date(c,m,b).valueOf()}function vp(c,m,b){return c<100&&c>=0?Date.UTC(c+400,m,b)-yp:Date.UTC(c,m,b)}function cv(c){var m,b;if(c=Kt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?vp:Vt,c){case"year":m=b(this.year(),0,1);break;case"quarter":m=b(this.year(),this.month()-this.month()%3,1);break;case"month":m=b(this.year(),this.month(),1);break;case"week":m=b(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":m=b(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":m=b(this.year(),this.month(),this.date());break;case"hour":m=this._d.valueOf(),m-=yt(m+(this._isUTC?0:this.utcOffset()*Li),pl);break;case"minute":m=this._d.valueOf(),m-=yt(m,Li);break;case"second":m=this._d.valueOf(),m-=yt(m,dl);break}return this._d.setTime(m),e.updateOffset(this,!0),this}function bp(c){var m,b;if(c=Kt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?vp:Vt,c){case"year":m=b(this.year()+1,0,1)-1;break;case"quarter":m=b(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":m=b(this.year(),this.month()+1,1)-1;break;case"week":m=b(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":m=b(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":m=b(this.year(),this.month(),this.date()+1)-1;break;case"hour":m=this._d.valueOf(),m+=pl-yt(m+(this._isUTC?0:this.utcOffset()*Li),pl)-1;break;case"minute":m=this._d.valueOf(),m+=Li-yt(m,Li)-1;break;case"second":m=this._d.valueOf(),m+=dl-yt(m,dl)-1;break}return this._d.setTime(m),e.updateOffset(this,!0),this}function fv(){return this._d.valueOf()-(this._offset||0)*6e4}function uc(){return Math.floor(this.valueOf()/1e3)}function Mo(){return new Date(this.valueOf())}function cc(){var c=this;return[c.year(),c.month(),c.date(),c.hour(),c.minute(),c.second(),c.millisecond()]}function Es(){var c=this;return{years:c.year(),months:c.month(),date:c.date(),hours:c.hours(),minutes:c.minutes(),seconds:c.seconds(),milliseconds:c.milliseconds()}}function No(){return this.isValid()?this.toISOString():null}function Do(){return I(this)}function hl(){return g({},_(this))}function Os(){return _(this).overflow}function dv(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ue("N",0,0,"eraAbbr"),ue("NN",0,0,"eraAbbr"),ue("NNN",0,0,"eraAbbr"),ue("NNNN",0,0,"eraName"),ue("NNNNN",0,0,"eraNarrow"),ue("y",["y",1],"yo","eraYear"),ue("y",["yy",2],0,"eraYear"),ue("y",["yyy",3],0,"eraYear"),ue("y",["yyyy",4],0,"eraYear"),le("N",sr),le("NN",sr),le("NNN",sr),le("NNNN",$e),le("NNNNN",yv),Ke(["N","NN","NNN","NNNN","NNNNN"],function(c,m,b,w){var E=b._locale.erasParse(c,w,b._strict);E?_(b).era=E:_(b).invalidEra=c}),le("y",fi),le("yy",fi),le("yyy",fi),le("yyyy",fi),le("yo",vv),Ke(["y","yy","yyy","yyyy"],Qt),Ke(["yo"],function(c,m,b,w){var E;b._locale._eraYearOrdinalRegex&&(E=c.match(b._locale._eraYearOrdinalRegex)),b._locale.eraYearOrdinalParse?m[Qt]=b._locale.eraYearOrdinalParse(c,E):m[Qt]=parseInt(c,10)});function pv(c,m){var b,w,E,M=this._eras||Mn("en")._eras;for(b=0,w=M.length;b<w;++b)switch(typeof M[b].since==="string"&&(E=e(M[b].since).startOf("day"),M[b].since=E.valueOf()),typeof M[b].until){case"undefined":M[b].until=1/0;break;case"string":E=e(M[b].until).startOf("day").valueOf(),M[b].until=E.valueOf();break}return M}function hv(c,m,b){var w,E,M=this.eras(),J,oe,ve;for(c=c.toUpperCase(),w=0,E=M.length;w<E;++w)if(J=M[w].name.toUpperCase(),oe=M[w].abbr.toUpperCase(),ve=M[w].narrow.toUpperCase(),b)switch(m){case"N":case"NN":case"NNN":if(oe===c)return M[w];break;case"NNNN":if(J===c)return M[w];break;case"NNNNN":if(ve===c)return M[w];break}else if([J,oe,ve].indexOf(c)>=0)return M[w]}function mv(c,m){var b=c.since<=c.until?1:-1;return m===void 0?e(c.since).year():e(c.since).year()+(m-c.offset)*b}function gv(){var c,m,b,w=this.localeData().eras();for(c=0,m=w.length;c<m;++c)if(b=this.clone().startOf("day").valueOf(),w[c].since<=b&&b<=w[c].until||w[c].until<=b&&b<=w[c].since)return w[c].name;return""}function ml(){var c,m,b,w=this.localeData().eras();for(c=0,m=w.length;c<m;++c)if(b=this.clone().startOf("day").valueOf(),w[c].since<=b&&b<=w[c].until||w[c].until<=b&&b<=w[c].since)return w[c].narrow;return""}function Fo(){var c,m,b,w=this.localeData().eras();for(c=0,m=w.length;c<m;++c)if(b=this.clone().startOf("day").valueOf(),w[c].since<=b&&b<=w[c].until||w[c].until<=b&&b<=w[c].since)return w[c].abbr;return""}function Sp(){var c,m,b,w,E=this.localeData().eras();for(c=0,m=E.length;c<m;++c)if(b=E[c].since<=E[c].until?1:-1,w=this.clone().startOf("day").valueOf(),E[c].since<=w&&w<=E[c].until||E[c].until<=w&&w<=E[c].since)return(this.year()-e(E[c].since).year())*b+E[c].offset;return this.year()}function O(c){return s(this,"_erasNameRegex")||fc.call(this),c?this._erasNameRegex:this._erasRegex}function Is(c){return s(this,"_erasAbbrRegex")||fc.call(this),c?this._erasAbbrRegex:this._erasRegex}function gl(c){return s(this,"_erasNarrowRegex")||fc.call(this),c?this._erasNarrowRegex:this._erasRegex}function sr(c,m){return m.erasAbbrRegex(c)}function $e(c,m){return m.erasNameRegex(c)}function yv(c,m){return m.erasNarrowRegex(c)}function vv(c,m){return m._eraYearOrdinalRegex||fi}function fc(){var c=[],m=[],b=[],w=[],E,M,J,oe,ve,Me=this.eras();for(E=0,M=Me.length;E<M;++E)J=un(Me[E].name),oe=un(Me[E].abbr),ve=un(Me[E].narrow),m.push(J),c.push(oe),b.push(ve),w.push(J),w.push(oe),w.push(ve);this._erasRegex=new RegExp("^("+w.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+m.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+c.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+b.join("|")+")","i")}ue(0,["gg",2],0,function(){return this.weekYear()%100}),ue(0,["GG",2],0,function(){return this.isoWeekYear()%100});function pn(c,m){ue(0,[c,c.length],0,m)}pn("gggg","weekYear"),pn("ggggg","weekYear"),pn("GGGG","isoWeekYear"),pn("GGGGG","isoWeekYear"),le("G",ys),le("g",ys),le("GG",at,Bt),le("gg",at,Bt),le("GGGG",yo,qi),le("gggg",yo,qi),le("GGGGG",gs,Tn),le("ggggg",gs,Tn),bo(["gggg","ggggg","GGGG","GGGGG"],function(c,m,b,w){m[w.substr(0,2)]=Ae(c)}),bo(["gg","GG"],function(c,m,b,w){m[w]=e.parseTwoDigitYear(c)});function bv(c){return wp.call(this,c,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Sv(c){return wp.call(this,c,this.isoWeek(),this.isoWeekday(),1,4)}function wv(){return fn(this.year(),1,4)}function _v(){return fn(this.isoWeekYear(),1,4)}function Rv(){var c=this.localeData()._week;return fn(this.year(),c.dow,c.doy)}function Nn(){var c=this.localeData()._week;return fn(this.weekYear(),c.dow,c.doy)}function wp(c,m,b,w,E){var M;return c==null?Co(this,w,E).year:(M=fn(c,w,E),m>M&&(m=M),Cv.call(this,c,m,b,w,E))}function Cv(c,m,b,w,E){var M=Ja(c,m,b,w,E),J=bs(M.year,0,M.dayOfYear);return this.year(J.getUTCFullYear()),this.month(J.getUTCMonth()),this.date(J.getUTCDate()),this}ue("Q",0,"Qo","quarter"),le("Q",Ld),Ke("Q",function(c,m){m[qn]=(Ae(c)-1)*3});function xv(c){return c==null?Math.ceil((this.month()+1)/3):this.month((c-1)*3+this.month()%3)}ue("D",["DD",2],"Do","date"),le("D",at,Ai),le("DD",at,Bt),le("Do",function(c,m){return c?m._dayOfMonthOrdinalParse||m._ordinalParse:m._dayOfMonthOrdinalParseLenient}),Ke(["D","DD"],cn),Ke("Do",function(c,m){m[cn]=Ae(c.match(at)[0])});var _p=vs("Date",!0);ue("DDD",["DDDD",3],"DDDo","dayOfYear"),le("DDD",ms),le("DDDD",jd),Ke(["DDD","DDDD"],function(c,m,b){b._dayOfYear=Ae(c)});function Ev(c){var m=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return c==null?m:this.add(c-m,"d")}ue("m",["mm",2],0,"minute"),le("m",at,Ua),le("mm",at,Bt),Ke(["m","mm"],Tr);var Dn=vs("Minutes",!1);ue("s",["ss",2],0,"second"),le("s",at,Ua),le("ss",at,Bt),Ke(["s","ss"],An);var Ov=vs("Seconds",!1);ue("S",0,0,function(){return~~(this.millisecond()/100)}),ue(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ue(0,["SSS",3],0,"millisecond"),ue(0,["SSSS",4],0,function(){return this.millisecond()*10}),ue(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ue(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ue(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ue(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ue(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),le("S",ms,Ld),le("SS",ms,Bt),le("SSS",ms,jd);var yi,Rp;for(yi="SSSS";yi.length<=9;yi+="S")le(yi,fi);function Iv(c,m){m[$i]=Ae(("0."+c)*1e3)}for(yi="S";yi.length<=9;yi+="S")Ke(yi,Iv);Rp=vs("Milliseconds",!1),ue("z",0,0,"zoneAbbr"),ue("zz",0,0,"zoneName");function Pv(){return this._isUTC?"UTC":""}function ji(){return this._isUTC?"Coordinated Universal Time":""}var te=W.prototype;te.add=rv,te.calendar=iv,te.clone=sv,te.diff=mp,te.endOf=bp,te.format=Fi,te.from=cl,te.fromNow=av,te.to=lv,te.toNow=uv,te.get=hy,te.invalidAt=Os,te.isAfter=ov,te.isBefore=ol,te.isBetween=gi,te.isSame=al,te.isSameOrAfter=hp,te.isSameOrBefore=ll,te.isValid=Do,te.lang=$o,te.locale=Ao,te.localeData=fl,te.max=up,te.min=lp,te.parsingFlags=hl,te.set=Va,te.startOf=cv,te.subtract=xs,te.toArray=cc,te.toObject=Es,te.toDate=Mo,te.toISOString=gp,te.inspect=qo,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=No,te.toString=ul,te.unix=uc,te.valueOf=fv,te.creationData=dv,te.eraName=gv,te.eraNarrow=ml,te.eraAbbr=Fo,te.eraYear=Sp,te.year=Hd,te.isLeapYear=py,te.weekYear=bv,te.isoWeekYear=Sv,te.quarter=te.quarters=xv,te.month=Wa,te.daysInMonth=Sy,te.week=te.weeks=Gd,te.isoWeek=te.isoWeeks=_y,te.weeksInYear=Rv,te.weeksInWeekYear=Nn,te.isoWeeksInYear=wv,te.isoWeeksInISOWeekYear=_v,te.date=_p,te.day=te.days=ky,te.weekday=Ty,te.isoWeekday=qy,te.dayOfYear=Ev,te.hour=te.hours=Ny,te.minute=te.minutes=Dn,te.second=te.seconds=Ov,te.millisecond=te.milliseconds=Rp,te.utcOffset=dp,te.utc=Qy,te.local=Zy,te.parseZone=Xy,te.hasAlignedHourOffset=ev,te.isDST=mi,te.isLocal=Y,te.isUtcOffset=z,te.isUtc=ae,te.isUTC=ae,te.zoneAbbr=Pv,te.zoneName=ji,te.dates=C("dates accessor is deprecated. Use date instead.",_p),te.months=C("months accessor is deprecated. Use month instead",Wa),te.years=C("years accessor is deprecated. Use year instead",Hd),te.zone=C("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ky),te.isDSTShifted=C("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",L);function kv(c){return tt(c*1e3)}function Yr(){return tt.apply(null,arguments).parseZone()}function Cp(c){return c}var Ve=K.prototype;Ve.calendar=et,Ve.longDateFormat=mt,Ve.invalidDate=ln,Ve.ordinal=mo,Ve.preparse=Cp,Ve.postformat=Cp,Ve.relativeTime=kn,Ve.pastFuture=Dd,Ve.set=$,Ve.eras=pv,Ve.erasParse=hv,Ve.erasConvertYear=mv,Ve.erasAbbrRegex=Is,Ve.erasNameRegex=O,Ve.erasNarrowRegex=gl,Ve.months=vy,Ve.monthsShort=by,Ve.monthsParse=Wd,Ve.monthsRegex=za,Ve.monthsShortRegex=zd,Ve.week=Ku,Ve.firstDayOfYear=Jd,Ve.firstDayOfWeek=Ss,Ve.weekdays=Ey,Ve.weekdaysMin=Iy,Ve.weekdaysShort=Oy,Ve.weekdaysParse=Py,Ve.weekdaysRegex=Ay,Ve.weekdaysShortRegex=dt,Ve.weekdaysMinRegex=ut,Ve.isPM=My,Ve.meridiem=Ft;function yl(c,m,b,w){var E=Mn(),M=y().set(w,m);return E[b](M,c)}function xp(c,m,b){if(f(c)&&(m=c,c=void 0),c=c||"",m!=null)return yl(c,m,b,"month");var w,E=[];for(w=0;w<12;w++)E[w]=yl(c,w,b,"month");return E}function dc(c,m,b,w){typeof c=="boolean"?(f(m)&&(b=m,m=void 0),m=m||""):(m=c,b=m,c=!1,f(m)&&(b=m,m=void 0),m=m||"");var E=Mn(),M=c?E._week.dow:0,J,oe=[];if(b!=null)return yl(m,(b+M)%7,w,"day");for(J=0;J<7;J++)oe[J]=yl(m,(J+M)%7,w,"day");return oe}function Ep(c,m){return xp(c,m,"months")}function Op(c,m){return xp(c,m,"monthsShort")}function Tv(c,m,b){return dc(c,m,b,"weekdays")}function qv(c,m,b){return dc(c,m,b,"weekdaysShort")}function pc(c,m,b){return dc(c,m,b,"weekdaysMin")}$n("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(c){var m=c%10,b=Ae(c%100/10)===1?"th":m===1?"st":m===2?"nd":m===3?"rd":"th";return c+b}}),e.lang=C("moment.lang is deprecated. Use moment.locale instead.",$n),e.langData=C("moment.langData is deprecated. Use moment.localeData instead.",Mn);var _r=Math.abs;function vl(){var c=this._data;return this._milliseconds=_r(this._milliseconds),this._days=_r(this._days),this._months=_r(this._months),c.milliseconds=_r(c.milliseconds),c.seconds=_r(c.seconds),c.minutes=_r(c.minutes),c.hours=_r(c.hours),c.months=_r(c.months),c.years=_r(c.years),this}function Ip(c,m,b,w){var E=rt(m,b);return c._milliseconds+=w*E._milliseconds,c._days+=w*E._days,c._months+=w*E._months,c._bubble()}function Pp(c,m){return Ip(this,c,m,1)}function Av(c,m){return Ip(this,c,m,-1)}function Kr(c){return c<0?Math.floor(c):Math.ceil(c)}function hc(){var c=this._milliseconds,m=this._days,b=this._months,w=this._data,E,M,J,oe,ve;return c>=0&&m>=0&&b>=0||c<=0&&m<=0&&b<=0||(c+=Kr(or(b)+m)*864e5,m=0,b=0),w.milliseconds=c%1e3,E=kr(c/1e3),w.seconds=E%60,M=kr(E/60),w.minutes=M%60,J=kr(M/60),w.hours=J%24,m+=kr(J/24),ve=kr(vi(m)),b+=ve,m-=Kr(or(ve)),oe=kr(b/12),b%=12,w.days=m,w.months=b,w.years=oe,this}function vi(c){return c*4800/146097}function or(c){return c*146097/4800}function $v(c){if(!this.isValid())return NaN;var m,b,w=this._milliseconds;if(c=Kt(c),c==="month"||c==="quarter"||c==="year")switch(m=this._days+w/864e5,b=this._months+vi(m),c){case"month":return b;case"quarter":return b/3;case"year":return b/12}else switch(m=this._days+Math.round(or(this._months)),c){case"week":return m/7+w/6048e5;case"day":return m+w/864e5;case"hour":return m*24+w/36e5;case"minute":return m*1440+w/6e4;case"second":return m*86400+w/1e3;case"millisecond":return Math.floor(m*864e5)+w;default:throw new Error("Unknown unit "+c)}}function hn(c){return function(){return this.as(c)}}var mc=hn("ms"),Lo=hn("s"),bi=hn("m"),kp=hn("h"),Mv=hn("d"),bl=hn("w"),Nv=hn("M"),Tp=hn("Q"),Wt=hn("y"),gc=mc;function qp(){return rt(this)}function mn(c){return c=Kt(c),this.isValid()?this[c+"s"]():NaN}function Fn(c){return function(){return this.isValid()?this._data[c]:NaN}}var Sl=Fn("milliseconds"),Ui=Fn("seconds"),Ap=Fn("minutes"),Xt=Fn("hours"),yc=Fn("days"),Dv=Fn("months"),Fv=Fn("years");function Lv(){return kr(this.days()/7)}var Qr=Math.round,Ps={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function jo(c,m,b,w,E){return E.relativeTime(m||1,!!b,c,w)}function $p(c,m,b,w){var E=rt(c).abs(),M=Qr(E.as("s")),J=Qr(E.as("m")),oe=Qr(E.as("h")),ve=Qr(E.as("d")),Me=Qr(E.as("M")),Lt=Qr(E.as("w")),Ln=Qr(E.as("y")),jn=M<=b.ss&&["s",M]||M<b.s&&["ss",M]||J<=1&&["m"]||J<b.m&&["mm",J]||oe<=1&&["h"]||oe<b.h&&["hh",oe]||ve<=1&&["d"]||ve<b.d&&["dd",ve];return b.w!=null&&(jn=jn||Lt<=1&&["w"]||Lt<b.w&&["ww",Lt]),jn=jn||Me<=1&&["M"]||Me<b.M&&["MM",Me]||Ln<=1&&["y"]||["yy",Ln],jn[2]=m,jn[3]=+c>0,jn[4]=w,jo.apply(null,jn)}function jv(c){return c===void 0?Qr:typeof c=="function"?(Qr=c,!0):!1}function Uv(c,m){return Ps[c]===void 0?!1:m===void 0?Ps[c]:(Ps[c]=m,c==="s"&&(Ps.ss=m-1),!0)}function Uo(c,m){if(!this.isValid())return this.localeData().invalidDate();var b=!1,w=Ps,E,M;return typeof c=="object"&&(m=c,c=!1),typeof c=="boolean"&&(b=c),typeof m=="object"&&(w=Object.assign({},Ps,m),m.s!=null&&m.ss==null&&(w.ss=m.s-1)),E=this.localeData(),M=$p(this,!b,w,E),b&&(M=E.pastFuture(+this,M)),E.postformat(M)}var vc=Math.abs;function ks(c){return(c>0)-(c<0)||+c}function Ts(){if(!this.isValid())return this.localeData().invalidDate();var c=vc(this._milliseconds)/1e3,m=vc(this._days),b=vc(this._months),w,E,M,J,oe=this.asSeconds(),ve,Me,Lt,Ln;return oe?(w=kr(c/60),E=kr(w/60),c%=60,w%=60,M=kr(b/12),b%=12,J=c?c.toFixed(3).replace(/\.?0+$/,""):"",ve=oe<0?"-":"",Me=ks(this._months)!==ks(oe)?"-":"",Lt=ks(this._days)!==ks(oe)?"-":"",Ln=ks(this._milliseconds)!==ks(oe)?"-":"",ve+"P"+(M?Me+M+"Y":"")+(b?Me+b+"M":"")+(m?Lt+m+"D":"")+(E||w||c?"T":"")+(E?Ln+E+"H":"")+(w?Ln+w+"M":"")+(c?Ln+J+"S":"")):"P0D"}var Fe=Cs.prototype;Fe.isValid=Jy,Fe.abs=vl,Fe.add=Pp,Fe.subtract=Av,Fe.as=$v,Fe.asMilliseconds=mc,Fe.asSeconds=Lo,Fe.asMinutes=bi,Fe.asHours=kp,Fe.asDays=Mv,Fe.asWeeks=bl,Fe.asMonths=Nv,Fe.asQuarters=Tp,Fe.asYears=Wt,Fe.valueOf=gc,Fe._bubble=hc,Fe.clone=qp,Fe.get=mn,Fe.milliseconds=Sl,Fe.seconds=Ui,Fe.minutes=Ap,Fe.hours=Xt,Fe.days=yc,Fe.weeks=Lv,Fe.months=Dv,Fe.years=Fv,Fe.humanize=Uo,Fe.toISOString=Ts,Fe.toString=Ts,Fe.toJSON=Ts,Fe.locale=Ao,Fe.localeData=fl,Fe.toIsoString=C("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ts),Fe.lang=$o,ue("X",0,0,"unix"),ue("x",0,0,"valueOf"),le("x",ys),le("X",uy),Ke("X",function(c,m,b){b._d=new Date(parseFloat(c)*1e3)}),Ke("x",function(c,m,b){b._d=new Date(Ae(c))});return e.version="2.30.1",t(tt),e.fn=te,e.min=Vy,e.max=Wy,e.now=zy,e.utc=y,e.unix=kv,e.months=Ep,e.isDate=d,e.locale=$n,e.invalid=q,e.duration=rt,e.isMoment=X,e.weekdays=Tv,e.parseZone=Yr,e.localeData=Mn,e.isDuration=Io,e.monthsShort=Op,e.weekdaysMin=pc,e.defineLocale=Ka,e.updateLocale=yr,e.locales=vr,e.weekdaysShort=qv,e.normalizeUnits=Kt,e.relativeTimeRounding=jv,e.relativeTimeThreshold=Uv,e.calendarFormat=sl,e.prototype=te,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e}))});var ME=F(($E,dh)=>{(function(r,e){typeof define=="function"&&define.amd?define([],e):typeof dh<"u"&&dh.exports?dh.exports=e():r.tv4=e()})($E,function(){Object.keys||(Object.keys=(function(){var T=Object.prototype.hasOwnProperty,C=!{toString:null}.propertyIsEnumerable("toString"),k=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],N=k.length;return function(U){if(typeof U!="object"&&typeof U!="function"||U===null)throw new TypeError("Object.keys called on non-object");var $=[];for(var G in U)T.call(U,G)&&$.push(G);if(C)for(var K=0;K<N;K++)T.call(U,k[K])&&$.push(k[K]);return $}})()),Object.create||(Object.create=(function(){function T(){}return function(C){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return T.prototype=C,new T}})()),Array.isArray||(Array.isArray=function(T){return Object.prototype.toString.call(T)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(T){if(this===null)throw new TypeError;var C=Object(this),k=C.length>>>0;if(k===0)return-1;var N=0;if(arguments.length>1&&(N=Number(arguments[1]),N!==N?N=0:N!==0&&N!==1/0&&N!==-1/0&&(N=(N>0||-1)*Math.floor(Math.abs(N)))),N>=k)return-1;for(var U=N>=0?N:Math.max(k-Math.abs(N),0);U<k;U++)if(U in C&&C[U]===T)return U;return-1}),Object.isFrozen||(Object.isFrozen=function(T){for(var C="tv4_test_frozen_key";T.hasOwnProperty(C);)C+=Math.random();try{return T[C]=!0,delete T[C],!1}catch{return!0}});var r={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function t(T){return encodeURI(T).replace(/%25[0-9][0-9]/g,function(C){return"%"+C.substring(3)})}function n(T){var C="";r[T.charAt(0)]&&(C=T.charAt(0),T=T.substring(1));var k="",N="",U=!0,$=!1,G=!1;C==="+"?U=!1:C==="."?(N=".",k="."):C==="/"?(N="/",k="/"):C==="#"?(N="#",U=!1):C===";"?(N=";",k=";",$=!0,G=!0):C==="?"?(N="?",k="&",$=!0):C==="&"&&(N="&",k="&",$=!0);for(var K=[],ne=T.split(","),pe=[],et={},_e=0;_e<ne.length;_e++){var he=ne[_e],xe=null;if(he.indexOf(":")!==-1){var bt=he.split(":");he=bt[0],xe=parseInt(bt[1],10)}for(var It={};e[he.charAt(he.length-1)];)It[he.charAt(he.length-1)]=!0,he=he.substring(0,he.length-1);var ue={truncate:xe,name:he,suffices:It};pe.push(ue),et[he]=ue,K.push(he)}var mr=function(ci){for(var Ct="",Gr=0,Pr=0;Pr<pe.length;Pr++){var mt=pe[Pr],gt=ci(mt.name);if(gt==null||Array.isArray(gt)&>.length===0||typeof gt=="object"&&Object.keys(gt).length===0){Gr++;continue}if(Pr===Gr?Ct+=N:Ct+=k||",",Array.isArray(gt)){$&&(Ct+=mt.name+"=");for(var ln=0;ln<gt.length;ln++)ln>0&&(Ct+=mt.suffices["*"]&&k||",",mt.suffices["*"]&&$&&(Ct+=mt.name+"=")),Ct+=U?encodeURIComponent(gt[ln]).replace(/!/g,"%21"):t(gt[ln])}else if(typeof gt=="object"){$&&!mt.suffices["*"]&&(Ct+=mt.name+"=");var ho=!0;for(var Yt in gt)ho||(Ct+=mt.suffices["*"]&&k||","),ho=!1,Ct+=U?encodeURIComponent(Yt).replace(/!/g,"%21"):t(Yt),Ct+=mt.suffices["*"]?"=":",",Ct+=U?encodeURIComponent(gt[Yt]).replace(/!/g,"%21"):t(gt[Yt])}else $&&(Ct+=mt.name,(!G||gt!=="")&&(Ct+="=")),mt.truncate!=null&&(gt=gt.substring(0,mt.truncate)),Ct+=U?encodeURIComponent(gt).replace(/!/g,"%21"):t(gt)}return Ct};return mr.varNames=K,{prefix:N,substitution:mr}}function i(T){if(!(this instanceof i))return new i(T);for(var C=T.split("{"),k=[C.shift()],N=[],U=[],$=[];C.length>0;){var G=C.shift(),K=G.split("}")[0],ne=G.substring(K.length+1),pe=n(K);U.push(pe.substitution),N.push(pe.prefix),k.push(ne),$=$.concat(pe.substitution.varNames)}this.fill=function(et){for(var _e=k[0],he=0;he<U.length;he++){var xe=U[he];_e+=xe(et),_e+=k[he+1]}return _e},this.varNames=$,this.template=T}i.prototype={toString:function(){return this.template},fillFromObject:function(T){return this.fill(function(C){return T[C]})}};var s=function(C,k,N,U,$){if(this.missing=[],this.missingMap={},this.formatValidators=C?Object.create(C.formatValidators):{},this.schemas=C?Object.create(C.schemas):{},this.collectMultiple=k,this.errors=[],this.handleError=k?this.collectError:this.returnError,U&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),$&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=N||S("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},C)for(var G in C.definedKeywords)this.definedKeywords[G]=C.definedKeywords[G].slice(0)};s.prototype.defineKeyword=function(T,C){this.definedKeywords[T]=this.definedKeywords[T]||[],this.definedKeywords[T].push(C)},s.prototype.createError=function(T,C,k,N,U,$,G){var K=new j(T,C,k,N,U);return K.message=this.errorReporter(K,$,G),K},s.prototype.returnError=function(T){return T},s.prototype.collectError=function(T){return T&&this.errors.push(T),null},s.prototype.prefixErrors=function(T,C,k){for(var N=T;N<this.errors.length;N++)this.errors[N]=this.errors[N].prefixWith(C,k);return this},s.prototype.banUnknownProperties=function(T,C){for(var k in this.unknownPropertyPaths){var N=this.createError(_.UNKNOWN_PROPERTY,{path:k},k,"",null,T,C),U=this.handleError(N);if(U)return U}return null},s.prototype.addFormat=function(T,C){if(typeof T=="object"){for(var k in T)this.addFormat(k,T[k]);return this}this.formatValidators[T]=C},s.prototype.resolveRefs=function(T,C){if(T.$ref!==void 0){if(C=C||{},C[T.$ref])return this.createError(_.CIRCULAR_REFERENCE,{urls:Object.keys(C).join(", ")},"","",null,void 0,T);C[T.$ref]=!0,T=this.getSchema(T.$ref,C)}return T},s.prototype.getSchema=function(T,C){var k;if(this.schemas[T]!==void 0)return k=this.schemas[T],this.resolveRefs(k,C);var N=T,U="";if(T.indexOf("#")!==-1&&(U=T.substring(T.indexOf("#")+1),N=T.substring(0,T.indexOf("#"))),typeof this.schemas[N]=="object"){k=this.schemas[N];var $=decodeURIComponent(U);if($==="")return this.resolveRefs(k,C);if($.charAt(0)!=="/")return;for(var G=$.split("/").slice(1),K=0;K<G.length;K++){var ne=G[K].replace(/~1/g,"/").replace(/~0/g,"~");if(k[ne]===void 0){k=void 0;break}k=k[ne]}if(k!==void 0)return this.resolveRefs(k,C)}this.missing[N]===void 0&&(this.missing.push(N),this.missing[N]=N,this.missingMap[N]=N)},s.prototype.searchSchemas=function(T,C){if(Array.isArray(T))for(var k=0;k<T.length;k++)this.searchSchemas(T[k],C);else if(T&&typeof T=="object"){typeof T.id=="string"&&B(C,T.id)&&this.schemas[T.id]===void 0&&(this.schemas[T.id]=T);for(var N in T)if(N!=="enum"){if(typeof T[N]=="object")this.searchSchemas(T[N],C);else if(N==="$ref"){var U=g(T[N]);U&&this.schemas[U]===void 0&&this.missingMap[U]===void 0&&(this.missingMap[U]=U)}}}},s.prototype.addSchema=function(T,C){if(typeof T!="string"||typeof C>"u")if(typeof T=="object"&&typeof T.id=="string")C=T,T=C.id;else return;T===g(T)+"#"&&(T=g(T)),this.schemas[T]=C,delete this.missingMap[T],y(C,T),this.searchSchemas(C,T)},s.prototype.getSchemaMap=function(){var T={};for(var C in this.schemas)T[C]=this.schemas[C];return T},s.prototype.getSchemaUris=function(T){var C=[];for(var k in this.schemas)(!T||T.test(k))&&C.push(k);return C},s.prototype.getMissingUris=function(T){var C=[];for(var k in this.missingMap)(!T||T.test(k))&&C.push(k);return C},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(T,C,k,N,U){var $;if(C=this.resolveRefs(C),C){if(C instanceof j)return this.errors.push(C),C}else return null;var G=this.errors.length,K,ne=null,pe=null;if(this.checkRecursive&&T&&typeof T=="object"){if($=!this.scanned.length,T[this.validatedSchemasKey]){var et=T[this.validatedSchemasKey].indexOf(C);if(et!==-1)return this.errors=this.errors.concat(T[this.validationErrorsKey][et]),null}if(Object.isFrozen(T)&&(K=this.scannedFrozen.indexOf(T),K!==-1)){var _e=this.scannedFrozenSchemas[K].indexOf(C);if(_e!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[K][_e]),null}if(this.scanned.push(T),Object.isFrozen(T))K===-1&&(K=this.scannedFrozen.length,this.scannedFrozen.push(T),this.scannedFrozenSchemas.push([])),ne=this.scannedFrozenSchemas[K].length,this.scannedFrozenSchemas[K][ne]=C,this.scannedFrozenValidationErrors[K][ne]=[];else{if(!T[this.validatedSchemasKey])try{Object.defineProperty(T,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(T,this.validationErrorsKey,{value:[],configurable:!0})}catch{T[this.validatedSchemasKey]=[],T[this.validationErrorsKey]=[]}pe=T[this.validatedSchemasKey].length,T[this.validatedSchemasKey][pe]=C,T[this.validationErrorsKey][pe]=[]}}var he=this.errors.length,xe=this.validateBasic(T,C,U)||this.validateNumeric(T,C,U)||this.validateString(T,C,U)||this.validateArray(T,C,U)||this.validateObject(T,C,U)||this.validateCombinations(T,C,U)||this.validateHypermedia(T,C,U)||this.validateFormat(T,C,U)||this.validateDefinedKeywords(T,C,U)||null;if($){for(;this.scanned.length;){var bt=this.scanned.pop();delete bt[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(xe||he!==this.errors.length)for(;k&&k.length||N&&N.length;){var It=k&&k.length?""+k.pop():null,ue=N&&N.length?""+N.pop():null;xe&&(xe=xe.prefixWith(It,ue)),this.prefixErrors(he,It,ue)}return ne!==null?this.scannedFrozenValidationErrors[K][ne]=this.errors.slice(G):pe!==null&&(T[this.validationErrorsKey][pe]=this.errors.slice(G)),this.handleError(xe)},s.prototype.validateFormat=function(T,C){if(typeof C.format!="string"||!this.formatValidators[C.format])return null;var k=this.formatValidators[C.format].call(null,T,C);return typeof k=="string"||typeof k=="number"?this.createError(_.FORMAT_CUSTOM,{message:k},"","/format",null,T,C):k&&typeof k=="object"?this.createError(_.FORMAT_CUSTOM,{message:k.message||"?"},k.dataPath||"",k.schemaPath||"/format",null,T,C):null},s.prototype.validateDefinedKeywords=function(T,C,k){for(var N in this.definedKeywords)if(!(typeof C[N]>"u"))for(var U=this.definedKeywords[N],$=0;$<U.length;$++){var G=U[$],K=G(T,C[N],C,k);if(typeof K=="string"||typeof K=="number")return this.createError(_.KEYWORD_CUSTOM,{key:N,message:K},"","",null,T,C).prefixWith(null,N);if(K&&typeof K=="object"){var ne=K.code;if(typeof ne=="string"){if(!_[ne])throw new Error("Undefined error code (use defineError): "+ne);ne=_[ne]}else typeof ne!="number"&&(ne=_.KEYWORD_CUSTOM);var pe=typeof K.message=="object"?K.message:{key:N,message:K.message||"?"},et=K.schemaPath||"/"+N.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ne,pe,K.dataPath||null,et,null,T,C)}}return null};function a(T,C){if(T===C)return!0;if(T&&C&&typeof T=="object"&&typeof C=="object"){if(Array.isArray(T)!==Array.isArray(C))return!1;if(Array.isArray(T)){if(T.length!==C.length)return!1;for(var k=0;k<T.length;k++)if(!a(T[k],C[k]))return!1}else{var N;for(N in T)if(C[N]===void 0&&T[N]!==void 0)return!1;for(N in C)if(T[N]===void 0&&C[N]!==void 0)return!1;for(N in T)if(!a(T[N],C[N]))return!1}return!0}return!1}s.prototype.validateBasic=function(C,k,N){var U;return(U=this.validateType(C,k,N))||(U=this.validateEnum(C,k,N))?U.prefixWith(null,"type"):null},s.prototype.validateType=function(C,k){if(k.type===void 0)return null;var N=typeof C;C===null?N="null":Array.isArray(C)&&(N="array");var U=k.type;Array.isArray(U)||(U=[U]);for(var $=0;$<U.length;$++){var G=U[$];if(G===N||G==="integer"&&N==="number"&&C%1===0)return null}return this.createError(_.INVALID_TYPE,{type:N,expected:U.join("/")},"","",null,C,k)},s.prototype.validateEnum=function(C,k){if(k.enum===void 0)return null;for(var N=0;N<k.enum.length;N++){var U=k.enum[N];if(a(C,U))return null}return this.createError(_.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(C):C},"","",null,C,k)},s.prototype.validateNumeric=function(C,k,N){return this.validateMultipleOf(C,k,N)||this.validateMinMax(C,k,N)||this.validateNaN(C,k,N)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(C,k){var N=k.multipleOf||k.divisibleBy;if(N===void 0)return null;if(typeof C=="number"){var U=C/N%1;if(U>=l&&U<f)return this.createError(_.NUMBER_MULTIPLE_OF,{value:C,multipleOf:N},"","",null,C,k)}return null},s.prototype.validateMinMax=function(C,k){if(typeof C!="number")return null;if(k.minimum!==void 0){if(C<k.minimum)return this.createError(_.NUMBER_MINIMUM,{value:C,minimum:k.minimum},"","/minimum",null,C,k);if(k.exclusiveMinimum&&C===k.minimum)return this.createError(_.NUMBER_MINIMUM_EXCLUSIVE,{value:C,minimum:k.minimum},"","/exclusiveMinimum",null,C,k)}if(k.maximum!==void 0){if(C>k.maximum)return this.createError(_.NUMBER_MAXIMUM,{value:C,maximum:k.maximum},"","/maximum",null,C,k);if(k.exclusiveMaximum&&C===k.maximum)return this.createError(_.NUMBER_MAXIMUM_EXCLUSIVE,{value:C,maximum:k.maximum},"","/exclusiveMaximum",null,C,k)}return null},s.prototype.validateNaN=function(C,k){return typeof C!="number"?null:isNaN(C)===!0||C===1/0||C===-1/0?this.createError(_.NUMBER_NOT_A_NUMBER,{value:C},"","/type",null,C,k):null},s.prototype.validateString=function(C,k,N){return this.validateStringLength(C,k,N)||this.validateStringPattern(C,k,N)||null},s.prototype.validateStringLength=function(C,k){return typeof C!="string"?null:k.minLength!==void 0&&C.length<k.minLength?this.createError(_.STRING_LENGTH_SHORT,{length:C.length,minimum:k.minLength},"","/minLength",null,C,k):k.maxLength!==void 0&&C.length>k.maxLength?this.createError(_.STRING_LENGTH_LONG,{length:C.length,maximum:k.maxLength},"","/maxLength",null,C,k):null},s.prototype.validateStringPattern=function(C,k){if(typeof C!="string"||typeof k.pattern!="string"&&!(k.pattern instanceof RegExp))return null;var N;if(k.pattern instanceof RegExp)N=k.pattern;else{var U,$="",G=k.pattern.match(/^\/(.+)\/([img]*)$/);G?(U=G[1],$=G[2]):U=k.pattern,N=new RegExp(U,$)}return N.test(C)?null:this.createError(_.STRING_PATTERN,{pattern:k.pattern},"","/pattern",null,C,k)},s.prototype.validateArray=function(C,k,N){return Array.isArray(C)&&(this.validateArrayLength(C,k,N)||this.validateArrayUniqueItems(C,k,N)||this.validateArrayItems(C,k,N))||null},s.prototype.validateArrayLength=function(C,k){var N;return k.minItems!==void 0&&C.length<k.minItems&&(N=this.createError(_.ARRAY_LENGTH_SHORT,{length:C.length,minimum:k.minItems},"","/minItems",null,C,k),this.handleError(N))||k.maxItems!==void 0&&C.length>k.maxItems&&(N=this.createError(_.ARRAY_LENGTH_LONG,{length:C.length,maximum:k.maxItems},"","/maxItems",null,C,k),this.handleError(N))?N:null},s.prototype.validateArrayUniqueItems=function(C,k){if(k.uniqueItems){for(var N=0;N<C.length;N++)for(var U=N+1;U<C.length;U++)if(a(C[N],C[U])){var $=this.createError(_.ARRAY_UNIQUE,{match1:N,match2:U},"","/uniqueItems",null,C,k);if(this.handleError($))return $}}return null},s.prototype.validateArrayItems=function(C,k,N){if(k.items===void 0)return null;var U,$;if(Array.isArray(k.items)){for($=0;$<C.length;$++)if($<k.items.length){if(U=this.validateAll(C[$],k.items[$],[$],["items",$],N+"/"+$))return U}else if(k.additionalItems!==void 0){if(typeof k.additionalItems=="boolean"){if(!k.additionalItems&&(U=this.createError(_.ARRAY_ADDITIONAL_ITEMS,{},"/"+$,"/additionalItems",null,C,k),this.handleError(U)))return U}else if(U=this.validateAll(C[$],k.additionalItems,[$],["additionalItems"],N+"/"+$))return U}}else for($=0;$<C.length;$++)if(U=this.validateAll(C[$],k.items,[$],["items"],N+"/"+$))return U;return null},s.prototype.validateObject=function(C,k,N){return typeof C!="object"||C===null||Array.isArray(C)?null:this.validateObjectMinMaxProperties(C,k,N)||this.validateObjectRequiredProperties(C,k,N)||this.validateObjectProperties(C,k,N)||this.validateObjectDependencies(C,k,N)||null},s.prototype.validateObjectMinMaxProperties=function(C,k){var N=Object.keys(C),U;return k.minProperties!==void 0&&N.length<k.minProperties&&(U=this.createError(_.OBJECT_PROPERTIES_MINIMUM,{propertyCount:N.length,minimum:k.minProperties},"","/minProperties",null,C,k),this.handleError(U))||k.maxProperties!==void 0&&N.length>k.maxProperties&&(U=this.createError(_.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:N.length,maximum:k.maxProperties},"","/maxProperties",null,C,k),this.handleError(U))?U:null},s.prototype.validateObjectRequiredProperties=function(C,k){if(k.required!==void 0)for(var N=0;N<k.required.length;N++){var U=k.required[N];if(C[U]===void 0){var $=this.createError(_.OBJECT_REQUIRED,{key:U},"","/required/"+N,null,C,k);if(this.handleError($))return $}}return null},s.prototype.validateObjectProperties=function(C,k,N){var U;for(var $ in C){var G=N+"/"+$.replace(/~/g,"~0").replace(/\//g,"~1"),K=!1;if(k.properties!==void 0&&k.properties[$]!==void 0&&(K=!0,U=this.validateAll(C[$],k.properties[$],[$],["properties",$],G)))return U;if(k.patternProperties!==void 0)for(var ne in k.patternProperties){var pe=new RegExp(ne);if(pe.test($)&&(K=!0,U=this.validateAll(C[$],k.patternProperties[ne],[$],["patternProperties",ne],G)))return U}if(K)this.trackUnknownProperties&&(this.knownPropertyPaths[G]=!0,delete this.unknownPropertyPaths[G]);else if(k.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[G]=!0,delete this.unknownPropertyPaths[G]),typeof k.additionalProperties=="boolean"){if(!k.additionalProperties&&(U=this.createError(_.OBJECT_ADDITIONAL_PROPERTIES,{key:$},"","/additionalProperties",null,C,k).prefixWith($,null),this.handleError(U)))return U}else if(U=this.validateAll(C[$],k.additionalProperties,[$],["additionalProperties"],G))return U}else this.trackUnknownProperties&&!this.knownPropertyPaths[G]&&(this.unknownPropertyPaths[G]=!0)}return null},s.prototype.validateObjectDependencies=function(C,k,N){var U;if(k.dependencies!==void 0){for(var $ in k.dependencies)if(C[$]!==void 0){var G=k.dependencies[$];if(typeof G=="string"){if(C[G]===void 0&&(U=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:$,missing:G},"","",null,C,k).prefixWith(null,$).prefixWith(null,"dependencies"),this.handleError(U)))return U}else if(Array.isArray(G))for(var K=0;K<G.length;K++){var ne=G[K];if(C[ne]===void 0&&(U=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:$,missing:ne},"","/"+K,null,C,k).prefixWith(null,$).prefixWith(null,"dependencies"),this.handleError(U)))return U}else if(U=this.validateAll(C,G,[],["dependencies",$],N))return U}}return null},s.prototype.validateCombinations=function(C,k,N){return this.validateAllOf(C,k,N)||this.validateAnyOf(C,k,N)||this.validateOneOf(C,k,N)||this.validateNot(C,k,N)||null},s.prototype.validateAllOf=function(C,k,N){if(k.allOf===void 0)return null;for(var U,$=0;$<k.allOf.length;$++){var G=k.allOf[$];if(U=this.validateAll(C,G,[],["allOf",$],N))return U}return null},s.prototype.validateAnyOf=function(C,k,N){if(k.anyOf===void 0)return null;var U=[],$=this.errors.length,G,K;this.trackUnknownProperties&&(G=this.unknownPropertyPaths,K=this.knownPropertyPaths);for(var ne=!0,pe=0;pe<k.anyOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var et=k.anyOf[pe],_e=this.errors.length,he=this.validateAll(C,et,[],["anyOf",pe],N);if(he===null&&_e===this.errors.length){if(this.errors=this.errors.slice(0,$),this.trackUnknownProperties){for(var xe in this.knownPropertyPaths)K[xe]=!0,delete G[xe];for(var bt in this.unknownPropertyPaths)K[bt]||(G[bt]=!0);ne=!1;continue}return null}he&&U.push(he.prefixWith(null,""+pe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=G,this.knownPropertyPaths=K),ne)return U=U.concat(this.errors.slice($)),this.errors=this.errors.slice(0,$),this.createError(_.ANY_OF_MISSING,{},"","/anyOf",U,C,k)},s.prototype.validateOneOf=function(C,k,N){if(k.oneOf===void 0)return null;var U=null,$=[],G=this.errors.length,K,ne;this.trackUnknownProperties&&(K=this.unknownPropertyPaths,ne=this.knownPropertyPaths);for(var pe=0;pe<k.oneOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var et=k.oneOf[pe],_e=this.errors.length,he=this.validateAll(C,et,[],["oneOf",pe],N);if(he===null&&_e===this.errors.length){if(U===null)U=pe;else return this.errors=this.errors.slice(0,G),this.createError(_.ONE_OF_MULTIPLE,{index1:U,index2:pe},"","/oneOf",null,C,k);if(this.trackUnknownProperties){for(var xe in this.knownPropertyPaths)ne[xe]=!0,delete K[xe];for(var bt in this.unknownPropertyPaths)ne[bt]||(K[bt]=!0)}}else he&&$.push(he)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=K,this.knownPropertyPaths=ne),U===null?($=$.concat(this.errors.slice(G)),this.errors=this.errors.slice(0,G),this.createError(_.ONE_OF_MISSING,{},"","/oneOf",$,C,k)):(this.errors=this.errors.slice(0,G),null)},s.prototype.validateNot=function(C,k,N){if(k.not===void 0)return null;var U=this.errors.length,$,G;this.trackUnknownProperties&&($=this.unknownPropertyPaths,G=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var K=this.validateAll(C,k.not,null,null,N),ne=this.errors.slice(U);return this.errors=this.errors.slice(0,U),this.trackUnknownProperties&&(this.unknownPropertyPaths=$,this.knownPropertyPaths=G),K===null&&ne.length===0?this.createError(_.NOT_PASSED,{},"","/not",null,C,k):null},s.prototype.validateHypermedia=function(C,k,N){if(!k.links)return null;for(var U,$=0;$<k.links.length;$++){var G=k.links[$];if(G.rel==="describedby"){for(var K=new i(G.href),ne=!0,pe=0;pe<K.varNames.length;pe++)if(!(K.varNames[pe]in C)){ne=!1;break}if(ne){var et=K.fillFromObject(C),_e={$ref:et};if(U=this.validateAll(C,_e,[],["links",$],N))return U}}}};function d(T){var C=String(T).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return C?{href:C[0]||"",protocol:C[1]||"",authority:C[2]||"",host:C[3]||"",hostname:C[4]||"",port:C[5]||"",pathname:C[6]||"",search:C[7]||"",hash:C[8]||""}:null}function h(T,C){function k(N){var U=[];return N.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function($){$==="/.."?U.pop():U.push($)}),U.join("").replace(/^\//,N.charAt(0)==="/"?"/":"")}return C=d(C||""),T=d(T||""),!C||!T?null:(C.protocol||T.protocol)+(C.protocol||C.authority?C.authority:T.authority)+k(C.protocol||C.authority||C.pathname.charAt(0)==="/"?C.pathname:C.pathname?(T.authority&&!T.pathname?"/":"")+T.pathname.slice(0,T.pathname.lastIndexOf("/")+1)+C.pathname:T.pathname)+(C.protocol||C.authority||C.pathname?C.search:C.search||T.search)+C.hash}function g(T){return T.split("#")[0]}function y(T,C){if(T&&typeof T=="object")if(C===void 0?C=T.id:typeof T.id=="string"&&(C=h(C,T.id),T.id=C),Array.isArray(T))for(var k=0;k<T.length;k++)y(T[k],C);else{typeof T.$ref=="string"&&(T.$ref=h(C,T.$ref));for(var N in T)N!=="enum"&&y(T[N],C)}}function S(T){T=T||"en";var C=V[T];return function(k){var N=C[k.code]||q[k.code];if(typeof N!="string")return"Unknown error code "+k.code+": "+JSON.stringify(k.messageParams);var U=k.params;return N.replace(/\{([^{}]*)\}/g,function($,G){var K=U[G];return typeof K=="string"||typeof K=="number"?K:$})}}var _={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},R={};for(var I in _)R[_[I]]=I;var q={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function j(T,C,k,N,U){if(Error.call(this),T===void 0)throw new Error("No error code supplied: "+N);this.message="",this.params=C,this.code=T,this.dataPath=k||"",this.schemaPath=N||"",this.subErrors=U||null;var $=new Error(this.message);if(this.stack=$.stack||$.stacktrace,!this.stack)try{throw $}catch(G){this.stack=G.stack||G.stacktrace}}j.prototype=Object.create(Error.prototype),j.prototype.constructor=j,j.prototype.name="ValidationError",j.prototype.prefixWith=function(T,C){if(T!==null&&(T=T.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+T+this.dataPath),C!==null&&(C=C.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+C+this.schemaPath),this.subErrors!==null)for(var k=0;k<this.subErrors.length;k++)this.subErrors[k].prefixWith(T,C);return this};function B(T,C){if(C.substring(0,T.length)===T){var k=C.substring(T.length);if(C.length>0&&C.charAt(T.length-1)==="/"||k.charAt(0)==="#"||k.charAt(0)==="?")return!0}return!1}var V={};function W(T){var C=new s,k,N,U={setErrorReporter:function($){return typeof $=="string"?this.language($):(N=$,!0)},addFormat:function(){C.addFormat.apply(C,arguments)},language:function($){return $?(V[$]||($=$.split("-")[0]),V[$]?(k=$,$):!1):k},addLanguage:function($,G){var K;for(K in _)G[K]&&!G[_[K]]&&(G[_[K]]=G[K]);var ne=$.split("-")[0];if(!V[ne])V[$]=G,V[ne]=G;else{V[$]=Object.create(V[ne]);for(K in G)typeof V[ne][K]>"u"&&(V[ne][K]=G[K]),V[$][K]=G[K]}return this},freshApi:function($){var G=W();return $&&G.language($),G},validate:function($,G,K,ne){var pe=S(k),et=N?function(xe,bt,It){return N(xe,bt,It)||pe(xe,bt,It)}:pe,_e=new s(C,!1,et,K,ne);typeof G=="string"&&(G={$ref:G}),_e.addSchema("",G);var he=_e.validateAll($,G,null,null,"");return!he&&ne&&(he=_e.banUnknownProperties($,G)),this.error=he,this.missing=_e.missing,this.valid=he===null,this.valid},validateResult:function(){var $={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply($,arguments),$},validateMultiple:function($,G,K,ne){var pe=S(k),et=N?function(xe,bt,It){return N(xe,bt,It)||pe(xe,bt,It)}:pe,_e=new s(C,!0,et,K,ne);typeof G=="string"&&(G={$ref:G}),_e.addSchema("",G),_e.validateAll($,G,null,null,""),ne&&_e.banUnknownProperties($,G);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=_e.errors,he.missing=_e.missing,he.valid=he.errors.length===0,he},addSchema:function(){return C.addSchema.apply(C,arguments)},getSchema:function(){return C.getSchema.apply(C,arguments)},getSchemaMap:function(){return C.getSchemaMap.apply(C,arguments)},getSchemaUris:function(){return C.getSchemaUris.apply(C,arguments)},getMissingUris:function(){return C.getMissingUris.apply(C,arguments)},dropSchemas:function(){C.dropSchemas.apply(C,arguments)},defineKeyword:function(){C.defineKeyword.apply(C,arguments)},defineError:function($,G,K){if(typeof $!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test($))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof G!="number"||G%1!==0||G<1e4)throw new Error("Code number must be an integer > 10000");if(typeof _[$]<"u")throw new Error("Error already defined: "+$+" as "+_[$]);if(typeof R[G]<"u")throw new Error("Error code already used: "+R[G]+" as "+G);_[$]=G,R[G]=$,q[$]=q[G]=K;for(var ne in V){var pe=V[ne];pe[$]&&(pe[G]=pe[G]||pe[$])}},reset:function(){C.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:h,getDocumentUri:g,errorCodes:_};return U.language(T||"en"),U}var X=W();return X.addLanguage("en-gb",q),X.tv4=X,X})});var Uc=F(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.regexpCode=Ye.getEsmExportName=Ye.getProperty=Ye.safeStringify=Ye.stringify=Ye.strConcat=Ye.addCodeArg=Ye.str=Ye._=Ye.nil=Ye._Code=Ye.Name=Ye.IDENTIFIER=Ye._CodeOrName=void 0;var Lc=class{};Ye._CodeOrName=Lc;Ye.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ea=class extends Lc{constructor(e){if(super(),!Ye.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Ye.Name=ea;var wn=class extends Lc{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>(n instanceof ea&&(t[n.str]=(t[n.str]||0)+1),t),{})}};Ye._Code=wn;Ye.nil=new wn("");function NE(r,...e){let t=[r[0]],n=0;for(;n<e.length;)Ub(t,e[n]),t.push(r[++n]);return new wn(t)}Ye._=NE;var jb=new wn("+");function DE(r,...e){let t=[jc(r[0])],n=0;for(;n<e.length;)t.push(jb),Ub(t,e[n]),t.push(jb,jc(r[++n]));return Cj(t),new wn(t)}Ye.str=DE;function Ub(r,e){e instanceof wn?r.push(...e._items):e instanceof ea?r.push(e):r.push(Oj(e))}Ye.addCodeArg=Ub;function Cj(r){let e=1;for(;e<r.length-1;){if(r[e]===jb){let t=xj(r[e-1],r[e+1]);if(t!==void 0){r.splice(e-1,3,t);continue}r[e++]="+"}e++}}function xj(r,e){if(e==='""')return r;if(r==='""')return e;if(typeof r=="string")return e instanceof ea||r[r.length-1]!=='"'?void 0:typeof e!="string"?`${r.slice(0,-1)}${e}"`:e[0]==='"'?r.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(r instanceof ea))return`"${r}${e.slice(1)}`}function Ej(r,e){return e.emptyStr()?r:r.emptyStr()?e:DE`${r}${e}`}Ye.strConcat=Ej;function Oj(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:jc(Array.isArray(r)?r.join(","):r)}function Ij(r){return new wn(jc(r))}Ye.stringify=Ij;function jc(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ye.safeStringify=jc;function Pj(r){return typeof r=="string"&&Ye.IDENTIFIER.test(r)?new wn(`.${r}`):NE`[${r}]`}Ye.getProperty=Pj;function kj(r){if(typeof r=="string"&&Ye.IDENTIFIER.test(r))return new wn(`${r}`);throw new Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)}Ye.getEsmExportName=kj;function Tj(r){return new wn(r.toString())}Ye.regexpCode=Tj});var Vb=F(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.ValueScope=Fr.ValueScopeName=Fr.Scope=Fr.varKinds=Fr.UsedValueState=void 0;var Dr=Uc(),Hb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},ph;(function(r){r[r.Started=0]="Started",r[r.Completed=1]="Completed"})(ph||(Fr.UsedValueState=ph={}));Fr.varKinds={const:new Dr.Name("const"),let:new Dr.Name("let"),var:new Dr.Name("var")};var hh=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof Dr.Name?e:this.name(e)}name(e){return new Dr.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(!((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Fr.Scope=hh;var mh=class extends Dr.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=(0,Dr._)`.${new Dr.Name(t)}[${n}]`}};Fr.ValueScopeName=mh;var qj=(0,Dr._)`\n`,Bb=class extends hh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?qj:Dr.nil}}get(){return this._scope}name(e){return new mh(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,a=(n=t.key)!==null&&n!==void 0?n:t.ref,l=this._values[s];if(l){let h=l.get(a);if(h)return h}else l=this._values[s]=new Map;l.set(a,i);let f=this._scope[s]||(this._scope[s]=[]),d=f.length;return f[d]=t.ref,i.setValue(t,{property:s,itemIndex:d}),i}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Dr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},t,n)}_reduceValues(e,t,n={},i){let s=Dr.nil;for(let a in e){let l=e[a];if(!l)continue;let f=n[a]=n[a]||new Map;l.forEach(d=>{if(f.has(d))return;f.set(d,ph.Started);let h=t(d);if(h){let g=this.opts.es5?Fr.varKinds.var:Fr.varKinds.const;s=(0,Dr._)`${s}${g} ${d} = ${h};${this.opts._n}`}else if(h=i?.(d))s=(0,Dr._)`${s}${h}${this.opts._n}`;else throw new Hb(d);f.set(d,ph.Completed)})}return s}};Fr.ValueScope=Bb});var Ne=F(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.or=qe.and=qe.not=qe.CodeGen=qe.operators=qe.varKinds=qe.ValueScopeName=qe.ValueScope=qe.Scope=qe.Name=qe.regexpCode=qe.stringify=qe.getProperty=qe.nil=qe.strConcat=qe.str=qe._=void 0;var Be=Uc(),zn=Vb(),js=Uc();Object.defineProperty(qe,"_",{enumerable:!0,get:function(){return js._}});Object.defineProperty(qe,"str",{enumerable:!0,get:function(){return js.str}});Object.defineProperty(qe,"strConcat",{enumerable:!0,get:function(){return js.strConcat}});Object.defineProperty(qe,"nil",{enumerable:!0,get:function(){return js.nil}});Object.defineProperty(qe,"getProperty",{enumerable:!0,get:function(){return js.getProperty}});Object.defineProperty(qe,"stringify",{enumerable:!0,get:function(){return js.stringify}});Object.defineProperty(qe,"regexpCode",{enumerable:!0,get:function(){return js.regexpCode}});Object.defineProperty(qe,"Name",{enumerable:!0,get:function(){return js.Name}});var bh=Vb();Object.defineProperty(qe,"Scope",{enumerable:!0,get:function(){return bh.Scope}});Object.defineProperty(qe,"ValueScope",{enumerable:!0,get:function(){return bh.ValueScope}});Object.defineProperty(qe,"ValueScopeName",{enumerable:!0,get:function(){return bh.ValueScopeName}});Object.defineProperty(qe,"varKinds",{enumerable:!0,get:function(){return bh.varKinds}});qe.operators={GT:new Be._Code(">"),GTE:new Be._Code(">="),LT:new Be._Code("<"),LTE:new Be._Code("<="),EQ:new Be._Code("==="),NEQ:new Be._Code("!=="),NOT:new Be._Code("!"),OR:new Be._Code("||"),AND:new Be._Code("&&"),ADD:new Be._Code("+")};var Zi=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},Wb=class extends Zi{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?zn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=Al(this.rhs,e,t)),this}get names(){return this.rhs instanceof Be._CodeOrName?this.rhs.names:{}}},gh=class extends Zi{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof Be.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Al(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Be.Name?{}:{...this.lhs.names};return vh(e,this.rhs)}},zb=class extends gh{constructor(e,t,n,i){super(e,n,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Jb=class extends Zi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Gb=class extends Zi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Yb=class extends Zi{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Kb=class extends Zi{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=Al(this.code,e,t),this}get names(){return this.code instanceof Be._CodeOrName?this.code.names:{}}},Hc=class extends Zi{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,t)||(Aj(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>na(e,t.names),{})}},Xi=class extends Hc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Qb=class extends Hc{},ql=class extends Xi{};ql.kind="else";var ta=class r extends Xi{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let n=t.optimizeNodes();t=this.else=Array.isArray(n)?new ql(n):n}if(t)return e===!1?t instanceof r?t:t.nodes:this.nodes.length?this:new r(FE(e),t instanceof r?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=Al(this.condition,e,t),this}get names(){let e=super.names;return vh(e,this.condition),this.else&&na(e,this.else.names),e}};ta.kind="if";var ra=class extends Xi{};ra.kind="for";var Zb=class extends ra{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=Al(this.iteration,e,t),this}get names(){return na(super.names,this.iteration.names)}},Xb=class extends ra{constructor(e,t,n,i){super(),this.varKind=e,this.name=t,this.from=n,this.to=i}render(e){let t=e.es5?zn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${t} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=vh(super.names,this.from);return vh(e,this.to)}},yh=class extends ra{constructor(e,t,n,i){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=Al(this.iterable,e,t),this}get names(){return na(super.names,this.iterable.names)}},Bc=class extends Xi{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Bc.kind="func";var Vc=class extends Hc{render(e){return"return "+super.render(e)}};Vc.kind="return";var eS=class extends Xi{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var n,i;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(i=this.finally)===null||i===void 0||i.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&na(e,this.catch.names),this.finally&&na(e,this.finally.names),e}},Wc=class extends Xi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Wc.kind="catch";var zc=class extends Xi{render(e){return"finally"+super.render(e)}};zc.kind="finally";var tS=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
24
|
+
`:""},this._extScope=e,this._scope=new zn.Scope({parent:e}),this._nodes=[new Qb]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,i){let s=this._scope.toName(t);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new Wb(e,s,n)),s}const(e,t,n){return this._def(zn.varKinds.const,e,t,n)}let(e,t,n){return this._def(zn.varKinds.let,e,t,n)}var(e,t,n){return this._def(zn.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new gh(e,t,n))}add(e,t){return this._leafNode(new zb(e,qe.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==Be.nil&&this._leafNode(new Kb(e)),this}object(...e){let t=["{"];for(let[n,i]of e)t.length>1&&t.push(","),t.push(n),(n!==i||this.opts.es5)&&(t.push(":"),(0,Be.addCodeArg)(t,i));return t.push("}"),new Be._Code(t)}if(e,t,n){if(this._blockNode(new ta(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new ta(e))}else(){return this._elseNode(new ql)}endIf(){return this._endBlockNode(ta,ql)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new Zb(e),t)}forRange(e,t,n,i,s=this.opts.es5?zn.varKinds.var:zn.varKinds.let){let a=this._scope.toName(e);return this._for(new Xb(s,a,t,n),()=>i(a))}forOf(e,t,n,i=zn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=t instanceof Be.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,Be._)`${a}.length`,l=>{this.var(s,(0,Be._)`${a}[${l}]`),n(s)})}return this._for(new yh("of",i,s,t),()=>n(s))}forIn(e,t,n,i=this.opts.es5?zn.varKinds.var:zn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Be._)`Object.keys(${t})`,n);let s=this._scope.toName(e);return this._for(new yh("in",i,s,t),()=>n(s))}endFor(){return this._endBlockNode(ra)}label(e){return this._leafNode(new Jb(e))}break(e){return this._leafNode(new Gb(e))}return(e){let t=new Vc;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Vc)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new eS;if(this._blockNode(i),this.code(e),t){let s=this.name("e");this._currNode=i.catch=new Wc(s),t(s)}return n&&(this._currNode=i.finally=new zc,this.code(n)),this._endBlockNode(Wc,zc)}throw(e){return this._leafNode(new Yb(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=Be.nil,n,i){return this._blockNode(new Bc(e,t,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Bc)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof ta))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};qe.CodeGen=tS;function na(r,e){for(let t in e)r[t]=(r[t]||0)+(e[t]||0);return r}function vh(r,e){return e instanceof Be._CodeOrName?na(r,e.names):r}function Al(r,e,t){if(r instanceof Be.Name)return n(r);if(!i(r))return r;return new Be._Code(r._items.reduce((s,a)=>(a instanceof Be.Name&&(a=n(a)),a instanceof Be._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=t[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function i(s){return s instanceof Be._Code&&s._items.some(a=>a instanceof Be.Name&&e[a.str]===1&&t[a.str]!==void 0)}}function Aj(r,e){for(let t in e)r[t]=(r[t]||0)-(e[t]||0)}function FE(r){return typeof r=="boolean"||typeof r=="number"||r===null?!r:(0,Be._)`!${rS(r)}`}qe.not=FE;var $j=LE(qe.operators.AND);function Mj(...r){return r.reduce($j)}qe.and=Mj;var Nj=LE(qe.operators.OR);function Dj(...r){return r.reduce(Nj)}qe.or=Dj;function LE(r){return(e,t)=>e===Be.nil?t:t===Be.nil?e:(0,Be._)`${rS(e)} ${r} ${rS(t)}`}function rS(r){return r instanceof Be.Name?r:(0,Be._)`(${r})`}});var We=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var ht=Ne(),Fj=Uc();function Lj(r){let e={};for(let t of r)e[t]=!0;return e}De.toHash=Lj;function jj(r,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(HE(r,e),!BE(e,r.self.RULES.all))}De.alwaysValidSchema=jj;function HE(r,e=r.schema){let{opts:t,self:n}=r;if(!t.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||zE(r,`unknown keyword: "${s}"`)}De.checkUnknownRules=HE;function BE(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(e[t])return!0;return!1}De.schemaHasRules=BE;function Uj(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(t!=="$ref"&&e.all[t])return!0;return!1}De.schemaHasRulesButRef=Uj;function Hj({topSchemaRef:r,schemaPath:e},t,n,i){if(!i){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,ht._)`${t}`}return(0,ht._)`${r}${e}${(0,ht.getProperty)(n)}`}De.schemaRefOrVal=Hj;function Bj(r){return VE(decodeURIComponent(r))}De.unescapeFragment=Bj;function Vj(r){return encodeURIComponent(iS(r))}De.escapeFragment=Vj;function iS(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=iS;function VE(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=VE;function Wj(r,e){if(Array.isArray(r))for(let t of r)e(t);else e(r)}De.eachItem=Wj;function jE({mergeNames:r,mergeToName:e,mergeValues:t,resultToName:n}){return(i,s,a,l)=>{let f=a===void 0?s:a instanceof ht.Name?(s instanceof ht.Name?r(i,s,a):e(i,s,a),a):s instanceof ht.Name?(e(i,a,s),s):t(s,a);return l===ht.Name&&!(f instanceof ht.Name)?n(i,f):f}}De.mergeEvaluated={props:jE({mergeNames:(r,e,t)=>r.if((0,ht._)`${t} !== true && ${e} !== undefined`,()=>{r.if((0,ht._)`${e} === true`,()=>r.assign(t,!0),()=>r.assign(t,(0,ht._)`${t} || {}`).code((0,ht._)`Object.assign(${t}, ${e})`))}),mergeToName:(r,e,t)=>r.if((0,ht._)`${t} !== true`,()=>{e===!0?r.assign(t,!0):(r.assign(t,(0,ht._)`${t} || {}`),sS(r,t,e))}),mergeValues:(r,e)=>r===!0?!0:{...r,...e},resultToName:WE}),items:jE({mergeNames:(r,e,t)=>r.if((0,ht._)`${t} !== true && ${e} !== undefined`,()=>r.assign(t,(0,ht._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(r,e,t)=>r.if((0,ht._)`${t} !== true`,()=>r.assign(t,e===!0?!0:(0,ht._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(r,e)=>r===!0?!0:Math.max(r,e),resultToName:(r,e)=>r.var("items",e)})};function WE(r,e){if(e===!0)return r.var("props",!0);let t=r.var("props",(0,ht._)`{}`);return e!==void 0&&sS(r,t,e),t}De.evaluatedPropsToName=WE;function sS(r,e,t){Object.keys(t).forEach(n=>r.assign((0,ht._)`${e}${(0,ht.getProperty)(n)}`,!0))}De.setEvaluated=sS;var UE={};function zj(r,e){return r.scopeValue("func",{ref:e,code:UE[e.code]||(UE[e.code]=new Fj._Code(e.code))})}De.useFunc=zj;var nS;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(nS||(De.Type=nS={}));function Jj(r,e,t){if(r instanceof ht.Name){let n=e===nS.Num;return t?n?(0,ht._)`"[" + ${r} + "]"`:(0,ht._)`"['" + ${r} + "']"`:n?(0,ht._)`"/" + ${r}`:(0,ht._)`"/" + ${r}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,ht.getProperty)(r).toString():"/"+iS(r)}De.getErrorPath=Jj;function zE(r,e,t=r.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);r.self.logger.warn(e)}}De.checkStrictMode=zE});var es=F(oS=>{"use strict";Object.defineProperty(oS,"__esModule",{value:!0});var lr=Ne(),Gj={data:new lr.Name("data"),valCxt:new lr.Name("valCxt"),instancePath:new lr.Name("instancePath"),parentData:new lr.Name("parentData"),parentDataProperty:new lr.Name("parentDataProperty"),rootData:new lr.Name("rootData"),dynamicAnchors:new lr.Name("dynamicAnchors"),vErrors:new lr.Name("vErrors"),errors:new lr.Name("errors"),this:new lr.Name("this"),self:new lr.Name("self"),scope:new lr.Name("scope"),json:new lr.Name("json"),jsonPos:new lr.Name("jsonPos"),jsonLen:new lr.Name("jsonLen"),jsonPart:new lr.Name("jsonPart")};oS.default=Gj});var Jc=F(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.extendErrors=ur.resetErrorsCount=ur.reportExtraError=ur.reportError=ur.keyword$DataError=ur.keywordError=void 0;var ze=Ne(),Sh=We(),Er=es();ur.keywordError={message:({keyword:r})=>(0,ze.str)`must pass "${r}" keyword validation`};ur.keyword$DataError={message:({keyword:r,schemaType:e})=>e?(0,ze.str)`"${r}" keyword must be ${e} ($data)`:(0,ze.str)`"${r}" keyword is invalid ($data)`};function Yj(r,e=ur.keywordError,t,n){let{it:i}=r,{gen:s,compositeRule:a,allErrors:l}=i,f=YE(r,e,t);n??(a||l)?JE(s,f):GE(i,(0,ze._)`[${f}]`)}ur.reportError=Yj;function Kj(r,e=ur.keywordError,t){let{it:n}=r,{gen:i,compositeRule:s,allErrors:a}=n,l=YE(r,e,t);JE(i,l),s||a||GE(n,Er.default.vErrors)}ur.reportExtraError=Kj;function Qj(r,e){r.assign(Er.default.errors,e),r.if((0,ze._)`${Er.default.vErrors} !== null`,()=>r.if(e,()=>r.assign((0,ze._)`${Er.default.vErrors}.length`,e),()=>r.assign(Er.default.vErrors,null)))}ur.resetErrorsCount=Qj;function Zj({gen:r,keyword:e,schemaValue:t,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=r.name("err");r.forRange("i",i,Er.default.errors,l=>{r.const(a,(0,ze._)`${Er.default.vErrors}[${l}]`),r.if((0,ze._)`${a}.instancePath === undefined`,()=>r.assign((0,ze._)`${a}.instancePath`,(0,ze.strConcat)(Er.default.instancePath,s.errorPath))),r.assign((0,ze._)`${a}.schemaPath`,(0,ze.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(r.assign((0,ze._)`${a}.schema`,t),r.assign((0,ze._)`${a}.data`,n))})}ur.extendErrors=Zj;function JE(r,e){let t=r.const("err",e);r.if((0,ze._)`${Er.default.vErrors} === null`,()=>r.assign(Er.default.vErrors,(0,ze._)`[${t}]`),(0,ze._)`${Er.default.vErrors}.push(${t})`),r.code((0,ze._)`${Er.default.errors}++`)}function GE(r,e){let{gen:t,validateName:n,schemaEnv:i}=r;i.$async?t.throw((0,ze._)`new ${r.ValidationError}(${e})`):(t.assign((0,ze._)`${n}.errors`,e),t.return(!1))}var ia={keyword:new ze.Name("keyword"),schemaPath:new ze.Name("schemaPath"),params:new ze.Name("params"),propertyName:new ze.Name("propertyName"),message:new ze.Name("message"),schema:new ze.Name("schema"),parentSchema:new ze.Name("parentSchema")};function YE(r,e,t){let{createErrors:n}=r.it;return n===!1?(0,ze._)`{}`:Xj(r,e,t)}function Xj(r,e,t={}){let{gen:n,it:i}=r,s=[e2(i,t),t2(r,t)];return r2(r,e,s),n.object(...s)}function e2({errorPath:r},{instancePath:e}){let t=e?(0,ze.str)`${r}${(0,Sh.getErrorPath)(e,Sh.Type.Str)}`:r;return[Er.default.instancePath,(0,ze.strConcat)(Er.default.instancePath,t)]}function t2({keyword:r,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:n}){let i=n?e:(0,ze.str)`${e}/${r}`;return t&&(i=(0,ze.str)`${i}${(0,Sh.getErrorPath)(t,Sh.Type.Str)}`),[ia.schemaPath,i]}function r2(r,{params:e,message:t},n){let{keyword:i,data:s,schemaValue:a,it:l}=r,{opts:f,propertyName:d,topSchemaRef:h,schemaPath:g}=l;n.push([ia.keyword,i],[ia.params,typeof e=="function"?e(r):e||(0,ze._)`{}`]),f.messages&&n.push([ia.message,typeof t=="function"?t(r):t]),f.verbose&&n.push([ia.schema,a],[ia.parentSchema,(0,ze._)`${h}${g}`],[Er.default.data,s]),d&&n.push([ia.propertyName,d])}});var QE=F($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.boolOrEmptySchema=$l.topBoolOrEmptySchema=void 0;var n2=Jc(),i2=Ne(),s2=es(),o2={message:"boolean schema is false"};function a2(r){let{gen:e,schema:t,validateName:n}=r;t===!1?KE(r,!1):typeof t=="object"&&t.$async===!0?e.return(s2.default.data):(e.assign((0,i2._)`${n}.errors`,null),e.return(!0))}$l.topBoolOrEmptySchema=a2;function l2(r,e){let{gen:t,schema:n}=r;n===!1?(t.var(e,!1),KE(r)):t.var(e,!0)}$l.boolOrEmptySchema=l2;function KE(r,e){let{gen:t,data:n}=r,i={gen:t,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:r};(0,n2.reportError)(i,o2,void 0,e)}});var aS=F(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.getRules=Ml.isJSONType=void 0;var u2=["string","number","integer","boolean","null","object","array"],c2=new Set(u2);function f2(r){return typeof r=="string"&&c2.has(r)}Ml.isJSONType=f2;function d2(){let r={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...r,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},r.number,r.string,r.array,r.object],post:{rules:[]},all:{},keywords:{}}}Ml.getRules=d2});var lS=F(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.shouldUseRule=Us.shouldUseGroup=Us.schemaHasRulesForType=void 0;function p2({schema:r,self:e},t){let n=e.RULES.types[t];return n&&n!==!0&&ZE(r,n)}Us.schemaHasRulesForType=p2;function ZE(r,e){return e.rules.some(t=>XE(r,t))}Us.shouldUseGroup=ZE;function XE(r,e){var t;return r[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(n=>r[n]!==void 0))}Us.shouldUseRule=XE});var Gc=F(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.reportTypeError=cr.checkDataTypes=cr.checkDataType=cr.coerceAndCheckDataType=cr.getJSONTypes=cr.getSchemaTypes=cr.DataType=void 0;var h2=aS(),m2=lS(),g2=Jc(),Oe=Ne(),eO=We(),Nl;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(Nl||(cr.DataType=Nl={}));function y2(r){let e=tO(r.type);if(e.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&e.push("null")}return e}cr.getSchemaTypes=y2;function tO(r){let e=Array.isArray(r)?r:r?[r]:[];if(e.every(h2.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}cr.getJSONTypes=tO;function v2(r,e){let{gen:t,data:n,opts:i}=r,s=b2(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,m2.schemaHasRulesForType)(r,e[0]));if(a){let l=cS(e,n,i.strictNumbers,Nl.Wrong);t.if(l,()=>{s.length?S2(r,e,s):fS(r)})}return a}cr.coerceAndCheckDataType=v2;var rO=new Set(["string","number","integer","boolean","null"]);function b2(r,e){return e?r.filter(t=>rO.has(t)||e==="array"&&t==="array"):[]}function S2(r,e,t){let{gen:n,data:i,opts:s}=r,a=n.let("dataType",(0,Oe._)`typeof ${i}`),l=n.let("coerced",(0,Oe._)`undefined`);s.coerceTypes==="array"&&n.if((0,Oe._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Oe._)`${i}[0]`).assign(a,(0,Oe._)`typeof ${i}`).if(cS(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,Oe._)`${l} !== undefined`);for(let d of t)(rO.has(d)||d==="array"&&s.coerceTypes==="array")&&f(d);n.else(),fS(r),n.endIf(),n.if((0,Oe._)`${l} !== undefined`,()=>{n.assign(i,l),w2(r,l)});function f(d){switch(d){case"string":n.elseIf((0,Oe._)`${a} == "number" || ${a} == "boolean"`).assign(l,(0,Oe._)`"" + ${i}`).elseIf((0,Oe._)`${i} === null`).assign(l,(0,Oe._)`""`);return;case"number":n.elseIf((0,Oe._)`${a} == "boolean" || ${i} === null
|
|
25
25
|
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(l,(0,Oe._)`+${i}`);return;case"integer":n.elseIf((0,Oe._)`${a} === "boolean" || ${i} === null
|
|
26
26
|
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,(0,Oe._)`+${i}`);return;case"boolean":n.elseIf((0,Oe._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf((0,Oe._)`${i} === "true" || ${i} === 1`).assign(l,!0);return;case"null":n.elseIf((0,Oe._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(l,null);return;case"array":n.elseIf((0,Oe._)`${a} === "string" || ${a} === "number"
|
|
27
|
-
|| ${a} === "boolean" || ${i} === null`).assign(l,(0,Oe._)`[${i}]`)}}}function w2({gen:r,parentData:e,parentDataProperty:t},n){r.if((0,Oe._)`${e} !== undefined`,()=>r.assign((0,Oe._)`${e}[${t}]`,n))}function uS(r,e,t,n=Nl.Correct){let i=n===Nl.Correct?Oe.operators.EQ:Oe.operators.NEQ,s;switch(r){case"null":return(0,Oe._)`${e} ${i} null`;case"array":s=(0,Oe._)`Array.isArray(${e})`;break;case"object":s=(0,Oe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Oe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Oe._)`typeof ${e} ${i} ${r}`}return n===Nl.Correct?s:(0,Oe.not)(s);function a(l=Oe.nil){return(0,Oe.and)((0,Oe._)`typeof ${e} == "number"`,l,t?(0,Oe._)`isFinite(${e})`:Oe.nil)}}cr.checkDataType=uS;function cS(r,e,t,n){if(r.length===1)return uS(r[0],e,t,n);let i,s=(0,eO.toHash)(r);if(s.array&&s.object){let a=(0,Oe._)`typeof ${e} != "object"`;i=s.null?a:(0,Oe._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Oe.nil;s.number&&delete s.integer;for(let a in s)i=(0,Oe.and)(i,uS(a,e,t,n));return i}cr.checkDataTypes=cS;var _2={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:e})=>typeof r=="string"?(0,Oe._)`{type: ${r}}`:(0,Oe._)`{type: ${e}}`};function fS(r){let e=R2(r);(0,g2.reportError)(e,_2)}cr.reportTypeError=fS;function R2(r){let{gen:e,data:t,schema:n}=r,i=(0,eO.schemaRefOrVal)(r,n,"type");return{gen:e,keyword:"type",data:t,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:r}}});var iO=F(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.assignDefaults=void 0;var Dl=Ne(),C2=We();function x2(r,e){let{properties:t,items:n}=r.schema;if(e==="object"&&t)for(let i in t)nO(r,i,t[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>nO(r,s,i.default))}_h.assignDefaults=x2;function nO(r,e,t){let{gen:n,compositeRule:i,data:s,opts:a}=r;if(t===void 0)return;let l=(0,Dl._)`${s}${(0,Dl.getProperty)(e)}`;if(i){(0,C2.checkStrictMode)(r,`default is ignored for: ${l}`);return}let f=(0,Dl._)`${l} === undefined`;a.useDefaults==="empty"&&(f=(0,Dl._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,Dl._)`${l} = ${(0,Dl.stringify)(t)}`)}});var _n=F(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.validateUnion=ft.validateArray=ft.usePattern=ft.callValidateCode=ft.schemaProperties=ft.allSchemaProperties=ft.noPropertyInData=ft.propertyInData=ft.isOwnProperty=ft.hasPropFunc=ft.reportMissingProp=ft.checkMissingProp=ft.checkReportMissingProp=void 0;var St=Ne(),dS=We(),Hs=es(),E2=We();function O2(r,e){let{gen:t,data:n,it:i}=r;t.if(hS(t,n,e,i.opts.ownProperties),()=>{r.setParams({missingProperty:(0,St._)`${e}`},!0),r.error()})}ft.checkReportMissingProp=O2;function I2({gen:r,data:e,it:{opts:t}},n,i){return(0,St.or)(...n.map(s=>(0,St.and)(hS(r,e,s,t.ownProperties),(0,St._)`${i} = ${s}`)))}ft.checkMissingProp=I2;function P2(r,e){r.setParams({missingProperty:e},!0),r.error()}ft.reportMissingProp=P2;function sO(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,St._)`Object.prototype.hasOwnProperty`})}ft.hasPropFunc=sO;function pS(r,e,t){return(0,St._)`${sO(r)}.call(${e}, ${t})`}ft.isOwnProperty=pS;function k2(r,e,t,n){let i=(0,St._)`${e}${(0,St.getProperty)(t)} !== undefined`;return n?(0,St._)`${i} && ${pS(r,e,t)}`:i}ft.propertyInData=k2;function hS(r,e,t,n){let i=(0,St._)`${e}${(0,St.getProperty)(t)} === undefined`;return n?(0,St.or)(i,(0,St.not)(pS(r,e,t))):i}ft.noPropertyInData=hS;function oO(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}ft.allSchemaProperties=oO;function T2(r,e){return oO(e).filter(t=>!(0,dS.alwaysValidSchema)(r,e[t]))}ft.schemaProperties=T2;function q2({schemaCode:r,data:e,it:{gen:t,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},l,f,d){let h=d?(0,St._)`${r}, ${e}, ${n}${i}`:e,g=[[Hs.default.instancePath,(0,St.strConcat)(Hs.default.instancePath,s)],[Hs.default.parentData,a.parentData],[Hs.default.parentDataProperty,a.parentDataProperty],[Hs.default.rootData,Hs.default.rootData]];a.opts.dynamicRef&&g.push([Hs.default.dynamicAnchors,Hs.default.dynamicAnchors]);let y=(0,St._)`${h}, ${t.object(...g)}`;return f!==St.nil?(0,St._)`${l}.call(${f}, ${y})`:(0,St._)`${l}(${y})`}ft.callValidateCode=q2;var A2=(0,St._)`new RegExp`;function $2({gen:r,it:{opts:e}},t){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(t,n);return r.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,St._)`${i.code==="new RegExp"?A2:(0,E2.useFunc)(r,i)}(${t}, ${n})`})}ft.usePattern=$2;function M2(r){let{gen:e,data:t,keyword:n,it:i}=r,s=e.name("valid");if(i.allErrors){let l=e.let("valid",!0);return a(()=>e.assign(l,!1)),l}return e.var(s,!0),a(()=>e.break()),s;function a(l){let f=e.const("len",(0,St._)`${t}.length`);e.forRange("i",0,f,d=>{r.subschema({keyword:n,dataProp:d,dataPropType:dS.Type.Num},s),e.if((0,St.not)(s),l)})}}ft.validateArray=M2;function N2(r){let{gen:e,schema:t,keyword:n,it:i}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(f=>(0,dS.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),l=e.name("_valid");e.block(()=>t.forEach((f,d)=>{let h=r.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(a,(0,St._)`${a} || ${l}`),r.mergeValidEvaluated(h,l)||e.if((0,St.not)(a))})),r.result(a,()=>r.reset(),()=>r.error(!0))}ft.validateUnion=N2});var uO=F(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.validateKeywordUsage=_i.validSchemaType=_i.funcKeywordCode=_i.macroKeywordCode=void 0;var Or=Ne(),sa=es(),D2=_n(),F2=Gc();function L2(r,e){let{gen:t,keyword:n,schema:i,parentSchema:s,it:a}=r,l=e.macro.call(a.self,i,s,a),f=lO(t,n,l);a.opts.validateSchema!==!1&&a.self.validateSchema(l,!0);let d=t.name("valid");r.subschema({schema:l,schemaPath:Or.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},d),r.pass(d,()=>r.error(!0))}_i.macroKeywordCode=L2;function j2(r,e){var t;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:l,it:f}=r;H2(f,e);let d=!l&&e.compile?e.compile.call(f.self,s,a,f):e.validate,h=lO(n,i,d),g=n.let("valid");r.block$data(g,y),r.ok((t=e.valid)!==null&&t!==void 0?t:g);function y(){if(e.errors===!1)R(),e.modifying&&aO(r),I(()=>r.error());else{let q=e.async?S():_();e.modifying&&aO(r),I(()=>U2(r,q))}}function S(){let q=n.let("ruleErrs",null);return n.try(()=>R((0,Or._)`await `),U=>n.assign(g,!1).if((0,Or._)`${U} instanceof ${f.ValidationError}`,()=>n.assign(q,(0,Or._)`${U}.errors`),()=>n.throw(U))),q}function _(){let q=(0,Or._)`${h}.errors`;return n.assign(q,null),R(Or.nil),q}function R(q=e.async?(0,Or._)`await `:Or.nil){let U=f.opts.passContext?sa.default.this:sa.default.self,B=!("compile"in e&&!l||e.schema===!1);n.assign(g,(0,Or._)`${q}${(0,D2.callValidateCode)(r,h,U,B)}`,e.modifying)}function I(q){var U;n.if((0,Or.not)((U=e.valid)!==null&&U!==void 0?U:g),q)}}_i.funcKeywordCode=j2;function aO(r){let{gen:e,data:t,it:n}=r;e.if(n.parentData,()=>e.assign(t,(0,Or._)`${n.parentData}[${n.parentDataProperty}]`))}function U2(r,e){let{gen:t}=r;t.if((0,Or._)`Array.isArray(${e})`,()=>{t.assign(sa.default.vErrors,(0,Or._)`${sa.default.vErrors} === null ? ${e} : ${sa.default.vErrors}.concat(${e})`).assign(sa.default.errors,(0,Or._)`${sa.default.vErrors}.length`),(0,F2.extendErrors)(r)},()=>r.error())}function H2({schemaEnv:r},e){if(e.async&&!r.$async)throw new Error("async keyword in sync schema")}function lO(r,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return r.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,Or.stringify)(t)})}function B2(r,e,t=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(r):n==="object"?r&&typeof r=="object"&&!Array.isArray(r):typeof r==n||t&&typeof r>"u")}_i.validSchemaType=B2;function V2({schema:r,opts:e,self:t,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(l=>!Object.prototype.hasOwnProperty.call(r,l)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(r[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+t.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(f);else throw new Error(f)}}_i.validateKeywordUsage=V2});var fO=F(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.extendSubschemaMode=Bs.extendSubschemaData=Bs.getSubschema=void 0;var Ri=Ne(),cO=We();function W2(r,{keyword:e,schemaProp:t,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=r.schema[e];return t===void 0?{schema:l,schemaPath:(0,Ri._)`${r.schemaPath}${(0,Ri.getProperty)(e)}`,errSchemaPath:`${r.errSchemaPath}/${e}`}:{schema:l[t],schemaPath:(0,Ri._)`${r.schemaPath}${(0,Ri.getProperty)(e)}${(0,Ri.getProperty)(t)}`,errSchemaPath:`${r.errSchemaPath}/${e}/${(0,cO.escapeFragment)(t)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Bs.getSubschema=W2;function z2(r,e,{dataProp:t,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(t!==void 0){let{errorPath:d,dataPathArr:h,opts:g}=e,y=l.let("data",(0,Ri._)`${e.data}${(0,Ri.getProperty)(t)}`,!0);f(y),r.errorPath=(0,Ri.str)`${d}${(0,cO.getErrorPath)(t,n,g.jsPropertySyntax)}`,r.parentDataProperty=(0,Ri._)`${t}`,r.dataPathArr=[...h,r.parentDataProperty]}if(i!==void 0){let d=i instanceof Ri.Name?i:l.let("data",i,!0);f(d),a!==void 0&&(r.propertyName=a)}s&&(r.dataTypes=s);function f(d){r.data=d,r.dataLevel=e.dataLevel+1,r.dataTypes=[],e.definedProperties=new Set,r.parentData=e.data,r.dataNames=[...e.dataNames,d]}}Bs.extendSubschemaData=z2;function J2(r,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(r.compositeRule=n),i!==void 0&&(r.createErrors=i),s!==void 0&&(r.allErrors=s),r.jtdDiscriminator=e,r.jtdMetadata=t}Bs.extendSubschemaMode=J2});var mS=F((v7,dO)=>{"use strict";dO.exports=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!r(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!r(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}});var hO=F((b7,pO)=>{"use strict";var Vs=pO.exports=function(r,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var n=typeof t=="function"?t:t.pre||function(){},i=t.post||function(){};Rh(e,n,i,r,"",r)};Vs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Vs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Vs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Vs.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Rh(r,e,t,n,i,s,a,l,f,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,l,f,d);for(var h in n){var g=n[h];if(Array.isArray(g)){if(h in Vs.arrayKeywords)for(var y=0;y<g.length;y++)Rh(r,e,t,g[y],i+"/"+h+"/"+y,s,i,h,n,y)}else if(h in Vs.propsKeywords){if(g&&typeof g=="object")for(var S in g)Rh(r,e,t,g[S],i+"/"+h+"/"+G2(S),s,i,h,n,S)}else(h in Vs.keywords||r.allKeys&&!(h in Vs.skipKeywords))&&Rh(r,e,t,g,i+"/"+h,s,i,h,n)}t(n,i,s,a,l,f,d)}}function G2(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}});var Kc=F(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.getSchemaRefs=Lr.resolveUrl=Lr.normalizeId=Lr._getFullPath=Lr.getFullPath=Lr.inlineRef=void 0;var Y2=We(),K2=mS(),Q2=hO(),Z2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function X2(r,e=!0){return typeof r=="boolean"?!0:e===!0?!gS(r):e?mO(r)<=e:!1}Lr.inlineRef=X2;var eU=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function gS(r){for(let e in r){if(eU.has(e))return!0;let t=r[e];if(Array.isArray(t)&&t.some(gS)||typeof t=="object"&&gS(t))return!0}return!1}function mO(r){let e=0;for(let t in r){if(t==="$ref")return 1/0;if(e++,!Z2.has(t)&&(typeof r[t]=="object"&&(0,Y2.eachItem)(r[t],n=>e+=mO(n)),e===1/0))return 1/0}return e}function gO(r,e="",t){t!==!1&&(e=Fl(e));let n=r.parse(e);return yO(r,n)}Lr.getFullPath=gO;function yO(r,e){return r.serialize(e).split("#")[0]+"#"}Lr._getFullPath=yO;var tU=/#\/?$/;function Fl(r){return r?r.replace(tU,""):""}Lr.normalizeId=Fl;function rU(r,e,t){return t=Fl(t),r.resolve(e,t)}Lr.resolveUrl=rU;var nU=/^[a-z_][-a-z0-9._]*$/i;function iU(r,e){if(typeof r=="boolean")return{};let{schemaId:t,uriResolver:n}=this.opts,i=Fl(r[t]||e),s={"":i},a=gO(n,i,!1),l={},f=new Set;return Q2(r,{allKeys:!0},(g,y,S,_)=>{if(_===void 0)return;let R=a+y,I=s[_];typeof g[t]=="string"&&(I=q.call(this,g[t])),U.call(this,g.$anchor),U.call(this,g.$dynamicAnchor),s[y]=I;function q(B){let V=this.opts.uriResolver.resolve;if(B=Fl(I?V(I,B):B),f.has(B))throw h(B);f.add(B);let W=this.refs[B];return typeof W=="string"&&(W=this.refs[W]),typeof W=="object"?d(g,W.schema,B):B!==Fl(R)&&(B[0]==="#"?(d(g,l[B],B),l[B]=g):this.refs[B]=R),B}function U(B){if(typeof B=="string"){if(!nU.test(B))throw new Error(`invalid anchor "${B}"`);q.call(this,`#${B}`)}}}),l;function d(g,y,S){if(y!==void 0&&!K2(g,y))throw h(S)}function h(g){return new Error(`reference "${g}" resolves to more than one schema`)}}Lr.getSchemaRefs=iU});var Xc=F(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.getData=Ws.KeywordCxt=Ws.validateFunctionCode=void 0;var _O=QE(),vO=Yc(),vS=lS(),Ch=Yc(),sU=iO(),Zc=uO(),yS=fO(),de=Ne(),Se=es(),oU=Kc(),ts=We(),Qc=Gc();function aU(r){if(xO(r)&&(EO(r),CO(r))){cU(r);return}RO(r,()=>(0,_O.topBoolOrEmptySchema)(r))}Ws.validateFunctionCode=aU;function RO({gen:r,validateName:e,schema:t,schemaEnv:n,opts:i},s){i.code.es5?r.func(e,(0,de._)`${Se.default.data}, ${Se.default.valCxt}`,n.$async,()=>{r.code((0,de._)`"use strict"; ${bO(t,i)}`),uU(r,i),r.code(s)}):r.func(e,(0,de._)`${Se.default.data}, ${lU(i)}`,n.$async,()=>r.code(bO(t,i)).code(s))}function lU(r){return(0,de._)`{${Se.default.instancePath}="", ${Se.default.parentData}, ${Se.default.parentDataProperty}, ${Se.default.rootData}=${Se.default.data}${r.dynamicRef?(0,de._)`, ${Se.default.dynamicAnchors}={}`:de.nil}}={}`}function uU(r,e){r.if(Se.default.valCxt,()=>{r.var(Se.default.instancePath,(0,de._)`${Se.default.valCxt}.${Se.default.instancePath}`),r.var(Se.default.parentData,(0,de._)`${Se.default.valCxt}.${Se.default.parentData}`),r.var(Se.default.parentDataProperty,(0,de._)`${Se.default.valCxt}.${Se.default.parentDataProperty}`),r.var(Se.default.rootData,(0,de._)`${Se.default.valCxt}.${Se.default.rootData}`),e.dynamicRef&&r.var(Se.default.dynamicAnchors,(0,de._)`${Se.default.valCxt}.${Se.default.dynamicAnchors}`)},()=>{r.var(Se.default.instancePath,(0,de._)`""`),r.var(Se.default.parentData,(0,de._)`undefined`),r.var(Se.default.parentDataProperty,(0,de._)`undefined`),r.var(Se.default.rootData,Se.default.data),e.dynamicRef&&r.var(Se.default.dynamicAnchors,(0,de._)`{}`)})}function cU(r){let{schema:e,opts:t,gen:n}=r;RO(r,()=>{t.$comment&&e.$comment&&IO(r),mU(r),n.let(Se.default.vErrors,null),n.let(Se.default.errors,0),t.unevaluated&&fU(r),OO(r),vU(r)})}function fU(r){let{gen:e,validateName:t}=r;r.evaluated=e.const("evaluated",(0,de._)`${t}.evaluated`),e.if((0,de._)`${r.evaluated}.dynamicProps`,()=>e.assign((0,de._)`${r.evaluated}.props`,(0,de._)`undefined`)),e.if((0,de._)`${r.evaluated}.dynamicItems`,()=>e.assign((0,de._)`${r.evaluated}.items`,(0,de._)`undefined`))}function bO(r,e){let t=typeof r=="object"&&r[e.schemaId];return t&&(e.code.source||e.code.process)?(0,de._)`/*# sourceURL=${t} */`:de.nil}function dU(r,e){if(xO(r)&&(EO(r),CO(r))){pU(r,e);return}(0,_O.boolOrEmptySchema)(r,e)}function CO({schema:r,self:e}){if(typeof r=="boolean")return!r;for(let t in r)if(e.RULES.all[t])return!0;return!1}function xO(r){return typeof r.schema!="boolean"}function pU(r,e){let{schema:t,gen:n,opts:i}=r;i.$comment&&t.$comment&&IO(r),gU(r),yU(r);let s=n.const("_errs",Se.default.errors);OO(r,s),n.var(e,(0,de._)`${s} === ${Se.default.errors}`)}function EO(r){(0,ts.checkUnknownRules)(r),hU(r)}function OO(r,e){if(r.opts.jtd)return SO(r,[],!1,e);let t=(0,vO.getSchemaTypes)(r.schema),n=(0,vO.coerceAndCheckDataType)(r,t);SO(r,t,!n,e)}function hU(r){let{schema:e,errSchemaPath:t,opts:n,self:i}=r;e.$ref&&n.ignoreKeywordsWithRef&&(0,ts.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function mU(r){let{schema:e,opts:t}=r;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,ts.checkStrictMode)(r,"default is ignored in the schema root")}function gU(r){let e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,oU.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function yU(r){if(r.schema.$async&&!r.schemaEnv.$async)throw new Error("async schema in sync schema")}function IO({gen:r,schemaEnv:e,schema:t,errSchemaPath:n,opts:i}){let s=t.$comment;if(i.$comment===!0)r.code((0,de._)`${Se.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,de.str)`${n}/$comment`,l=r.scopeValue("root",{ref:e.root});r.code((0,de._)`${Se.default.self}.opts.$comment(${s}, ${a}, ${l}.schema)`)}}function vU(r){let{gen:e,schemaEnv:t,validateName:n,ValidationError:i,opts:s}=r;t.$async?e.if((0,de._)`${Se.default.errors} === 0`,()=>e.return(Se.default.data),()=>e.throw((0,de._)`new ${i}(${Se.default.vErrors})`)):(e.assign((0,de._)`${n}.errors`,Se.default.vErrors),s.unevaluated&&bU(r),e.return((0,de._)`${Se.default.errors} === 0`))}function bU({gen:r,evaluated:e,props:t,items:n}){t instanceof de.Name&&r.assign((0,de._)`${e}.props`,t),n instanceof de.Name&&r.assign((0,de._)`${e}.items`,n)}function SO(r,e,t,n){let{gen:i,schema:s,data:a,allErrors:l,opts:f,self:d}=r,{RULES:h}=d;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,ts.schemaHasRulesButRef)(s,h))){i.block(()=>kO(r,"$ref",h.all.$ref.definition));return}f.jtd||SU(r,e),i.block(()=>{for(let y of h.rules)g(y);g(h.post)});function g(y){(0,vS.shouldUseGroup)(s,y)&&(y.type?(i.if((0,Ch.checkDataType)(y.type,a,f.strictNumbers)),wO(r,y),e.length===1&&e[0]===y.type&&t&&(i.else(),(0,Ch.reportTypeError)(r)),i.endIf()):wO(r,y),l||i.if((0,de._)`${Se.default.errors} === ${n||0}`))}}function wO(r,e){let{gen:t,schema:n,opts:{useDefaults:i}}=r;i&&(0,sU.assignDefaults)(r,e.type),t.block(()=>{for(let s of e.rules)(0,vS.shouldUseRule)(n,s)&&kO(r,s.keyword,s.definition,e.type)})}function SU(r,e){r.schemaEnv.meta||!r.opts.strictTypes||(wU(r,e),r.opts.allowUnionTypes||_U(r,e),RU(r,r.dataTypes))}function wU(r,e){if(e.length){if(!r.dataTypes.length){r.dataTypes=e;return}e.forEach(t=>{PO(r.dataTypes,t)||bS(r,`type "${t}" not allowed by context "${r.dataTypes.join(",")}"`)}),xU(r,e)}}function _U(r,e){e.length>1&&!(e.length===2&&e.includes("null"))&&bS(r,"use allowUnionTypes to allow union type keyword")}function RU(r,e){let t=r.self.RULES.all;for(let n in t){let i=t[n];if(typeof i=="object"&&(0,vS.shouldUseRule)(r.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>CU(e,a))&&bS(r,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function CU(r,e){return r.includes(e)||e==="number"&&r.includes("integer")}function PO(r,e){return r.includes(e)||e==="integer"&&r.includes("number")}function xU(r,e){let t=[];for(let n of r.dataTypes)PO(e,n)?t.push(n):e.includes("integer")&&n==="number"&&t.push("integer");r.dataTypes=t}function bS(r,e){let t=r.schemaEnv.baseId+r.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,ts.checkStrictMode)(r,e,r.opts.strictTypes)}var xh=class{constructor(e,t,n){if((0,Zc.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ts.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",TO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Zc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Se.default.errors))}result(e,t,n){this.failResult((0,de.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,de.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,de._)`${t} !== undefined && (${(0,de.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?Qc.reportExtraError:Qc.reportError)(this,this.def.error,t)}$dataError(){(0,Qc.reportError)(this,this.def.$dataError||Qc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Qc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=de.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=de.nil,t=de.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,de.or)((0,de._)`${i} === undefined`,t)),e!==de.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==de.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:i,it:s}=this;return(0,de.or)(a(),l());function a(){if(n.length){if(!(t instanceof de.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,de._)`${(0,Ch.checkDataTypes)(f,t,s.opts.strictNumbers,Ch.DataType.Wrong)}`}return de.nil}function l(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,de._)`!${f}(${t})`}return de.nil}}subschema(e,t){let n=(0,yS.getSubschema)(this.it,e);(0,yS.extendSubschemaData)(n,this.it,e),(0,yS.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return dU(i,t),i}mergeEvaluated(e,t){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=ts.mergeEvaluated.props(i,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=ts.mergeEvaluated.items(i,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(t,()=>this.mergeEvaluated(e,de.Name)),!0}};Ws.KeywordCxt=xh;function kO(r,e,t,n){let i=new xh(r,t,e);"code"in t?t.code(i,n):i.$data&&t.validate?(0,Zc.funcKeywordCode)(i,t):"macro"in t?(0,Zc.macroKeywordCode)(i,t):(t.compile||t.validate)&&(0,Zc.funcKeywordCode)(i,t)}var EU=/^\/(?:[^~]|~0|~1)*$/,OU=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function TO(r,{dataLevel:e,dataNames:t,dataPathArr:n}){let i,s;if(r==="")return Se.default.rootData;if(r[0]==="/"){if(!EU.test(r))throw new Error(`Invalid JSON-pointer: ${r}`);i=r,s=Se.default.rootData}else{let d=OU.exec(r);if(!d)throw new Error(`Invalid JSON-pointer: ${r}`);let h=+d[1];if(i=d[2],i==="#"){if(h>=e)throw new Error(f("property/index",h));return n[e-h]}if(h>e)throw new Error(f("data",h));if(s=t[e-h],!i)return s}let a=s,l=i.split("/");for(let d of l)d&&(s=(0,de._)`${s}${(0,de.getProperty)((0,ts.unescapeJsonPointer)(d))}`,a=(0,de._)`${a} && ${s}`);return a;function f(d,h){return`Cannot access ${d} ${h} levels up, current level is ${e}`}}Ws.getData=TO});var Eh=F(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});var SS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};wS.default=SS});var ef=F(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var _S=Kc(),RS=class extends Error{constructor(e,t,n,i){super(i||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,_S.resolveUrl)(e,t,n),this.missingSchema=(0,_S.normalizeId)((0,_S.getFullPath)(e,this.missingRef))}};CS.default=RS});var Ih=F(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.resolveSchema=Rn.getCompilingSchema=Rn.resolveRef=Rn.compileSchema=Rn.SchemaEnv=void 0;var Gn=Ne(),IU=Eh(),oa=es(),Yn=Kc(),qO=We(),PU=Xc(),Ll=class{constructor(e){var t;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,Yn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Rn.SchemaEnv=Ll;function ES(r){let e=AO.call(this,r);if(e)return e;let t=(0,Yn.getFullPath)(this.opts.uriResolver,r.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Gn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;r.$async&&(l=a.scopeValue("Error",{ref:IU.default,code:(0,Gn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");r.validateName=f;let d={gen:a,allErrors:this.opts.allErrors,data:oa.default.data,parentData:oa.default.parentData,parentDataProperty:oa.default.parentDataProperty,dataNames:[oa.default.data],dataPathArr:[Gn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:r.schema,code:(0,Gn.stringify)(r.schema)}:{ref:r.schema}),validateName:f,ValidationError:l,schema:r.schema,schemaEnv:r,rootId:t,baseId:r.baseId||t,schemaPath:Gn.nil,errSchemaPath:r.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Gn._)`""`,opts:this.opts,self:this},h;try{this._compilations.add(r),(0,PU.validateFunctionCode)(d),a.optimize(this.opts.code.optimize);let g=a.toString();h=`${a.scopeRefs(oa.default.scope)}return ${g}`,this.opts.code.process&&(h=this.opts.code.process(h,r));let S=new Function(`${oa.default.self}`,`${oa.default.scope}`,h)(this,this.scope.get());if(this.scope.value(f,{ref:S}),S.errors=null,S.schema=r.schema,S.schemaEnv=r,r.$async&&(S.$async=!0),this.opts.code.source===!0&&(S.source={validateName:f,validateCode:g,scopeValues:a._values}),this.opts.unevaluated){let{props:_,items:R}=d;S.evaluated={props:_ instanceof Gn.Name?void 0:_,items:R instanceof Gn.Name?void 0:R,dynamicProps:_ instanceof Gn.Name,dynamicItems:R instanceof Gn.Name},S.source&&(S.source.evaluated=(0,Gn.stringify)(S.evaluated))}return r.validate=S,r}catch(g){throw delete r.validate,delete r.validateName,h&&this.logger.error("Error compiling schema, function code:",h),g}finally{this._compilations.delete(r)}}Rn.compileSchema=ES;function kU(r,e,t){var n;t=(0,Yn.resolveUrl)(this.opts.uriResolver,e,t);let i=r.refs[t];if(i)return i;let s=AU.call(this,r,t);if(s===void 0){let a=(n=r.localRefs)===null||n===void 0?void 0:n[t],{schemaId:l}=this.opts;a&&(s=new Ll({schema:a,schemaId:l,root:r,baseId:e}))}if(s!==void 0)return r.refs[t]=TU.call(this,s)}Rn.resolveRef=kU;function TU(r){return(0,Yn.inlineRef)(r.schema,this.opts.inlineRefs)?r.schema:r.validate?r:ES.call(this,r)}function AO(r){for(let e of this._compilations)if(qU(e,r))return e}Rn.getCompilingSchema=AO;function qU(r,e){return r.schema===e.schema&&r.root===e.root&&r.baseId===e.baseId}function AU(r,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||Oh.call(this,r,e)}function Oh(r,e){let t=this.opts.uriResolver.parse(e),n=(0,Yn._getFullPath)(this.opts.uriResolver,t),i=(0,Yn.getFullPath)(this.opts.uriResolver,r.baseId,void 0);if(Object.keys(r.schema).length>0&&n===i)return xS.call(this,t,r);let s=(0,Yn.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let l=Oh.call(this,r,a);return typeof l?.schema!="object"?void 0:xS.call(this,t,l)}if(typeof a?.schema=="object"){if(a.validate||ES.call(this,a),s===(0,Yn.normalizeId)(e)){let{schema:l}=a,{schemaId:f}=this.opts,d=l[f];return d&&(i=(0,Yn.resolveUrl)(this.opts.uriResolver,i,d)),new Ll({schema:l,schemaId:f,root:r,baseId:i})}return xS.call(this,t,a)}}Rn.resolveSchema=Oh;var $U=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function xS(r,{baseId:e,schema:t,root:n}){var i;if(((i=r.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let l of r.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let f=t[(0,qO.unescapeFragment)(l)];if(f===void 0)return;t=f;let d=typeof t=="object"&&t[this.opts.schemaId];!$U.has(l)&&d&&(e=(0,Yn.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof t!="boolean"&&t.$ref&&!(0,qO.schemaHasRulesButRef)(t,this.RULES)){let l=(0,Yn.resolveUrl)(this.opts.uriResolver,e,t.$ref);s=Oh.call(this,n,l)}let{schemaId:a}=this.opts;if(s=s||new Ll({schema:t,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var $O=F((x7,MU)=>{MU.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var PS=F((E7,jO)=>{"use strict";var NU=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),NO=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),OS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),DO=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),DU=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function IS(r){let e="",t=0,n=0;for(n=0;n<r.length;n++)if(t=r[n].charCodeAt(0),t!==48){if(!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[n];break}for(n+=1;n<r.length;n++){if(t=r[n].charCodeAt(0),!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[n]}return e}var FU=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function MO(r){return r.length=0,!0}function LU(r,e,t){if(r.length){let n=IS(r);if(n!=="")e.push(n);else return t.error=!0,!1;r.length=0}return!0}function jU(r){let e=0,t={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,l=LU;for(let f=0;f<r.length;f++){let d=r[f];if(!(d==="["||d==="]"))if(d===":"){if(s===!0&&(a=!0),!l(i,n,t))break;if(++e>7){t.error=!0;break}f>0&&r[f-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(i,n,t))break;l=MO}else{i.push(d);continue}}return i.length&&(l===MO?t.zone=i.join(""):a?n.push(i.join("")):n.push(IS(i))),t.address=n.join(""),t}function FO(r){if(UU(r,":")<2)return{host:r,isIPV6:!1};let e=jU(r);if(e.error)return{host:r,isIPV6:!1};{let t=e.address,n=e.address;return e.zone&&(t+="%"+e.zone,n+="%25"+e.zone),{host:t,isIPV6:!0,escapedHost:n}}}function UU(r,e){let t=0;for(let n=0;n<r.length;n++)r[n]===e&&t++;return t}function HU(r){let e=r,t=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){t.push("/");break}else{t.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){t.push("/");break}}else if(i===3&&e==="/.."){t.length!==0&&t.pop(),t.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),t.length!==0&&t.pop();continue}}if((n=e.indexOf("/",1))===-1){t.push(e);break}else t.push(e.slice(0,n)),e=e.slice(n)}return t.join("")}var BU={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},VU=/[@/?#:]/g,WU=/[@/?#]/g;function LO(r,e){let t=e?WU:VU;return t.lastIndex=0,r.replace(t,n=>BU[n])}function zU(r,e=!1){if(r.indexOf("%")===-1)return r;let t="";for(let n=0;n<r.length;n++){if(r[n]==="%"&&n+2<r.length){let i=r.slice(n+1,n+3);if(OS(i)){let s=i.toUpperCase(),a=String.fromCharCode(parseInt(s,16));e&&DO(a)?t+=a:t+="%"+s,n+=2;continue}}t+=r[n]}return t}function JU(r){let e="";for(let t=0;t<r.length;t++){if(r[t]==="%"&&t+2<r.length){let n=r.slice(t+1,t+3);if(OS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&DO(s)?e+=s:e+="%"+i,t+=2;continue}}DU(r[t])?e+=r[t]:e+=escape(r[t])}return e}function GU(r){let e="";for(let t=0;t<r.length;t++){if(r[t]==="%"&&t+2<r.length){let n=r.slice(t+1,t+3);if(OS(n)){e+="%"+n.toUpperCase(),t+=2;continue}}e+=escape(r[t])}return e}function YU(r){let e=[];if(r.userinfo!==void 0&&(e.push(r.userinfo),e.push("@")),r.host!==void 0){let t=unescape(r.host);if(!NO(t)){let n=FO(t);n.isIPV6===!0?t=`[${n.escapedHost}]`:t=LO(t,!1)}e.push(t)}return(typeof r.port=="number"||typeof r.port=="string")&&(e.push(":"),e.push(String(r.port))),e.length?e.join(""):void 0}jO.exports={nonSimpleDomain:FU,recomposeAuthority:YU,reescapeHostDelimiters:LO,normalizePercentEncoding:zU,normalizePathEncoding:JU,escapePreservingEscapes:GU,removeDotSegments:HU,isIPv4:NO,isUUID:NU,normalizeIPv6:FO,stringArrayToHexStripped:IS}});var WO=F((O7,VO)=>{"use strict";var{isUUID:KU}=PS(),QU=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,ZU=["http","https","ws","wss","urn","urn:uuid"];function XU(r){return ZU.indexOf(r)!==-1}function kS(r){return r.secure===!0?!0:r.secure===!1?!1:r.scheme?r.scheme.length===3&&(r.scheme[0]==="w"||r.scheme[0]==="W")&&(r.scheme[1]==="s"||r.scheme[1]==="S")&&(r.scheme[2]==="s"||r.scheme[2]==="S"):!1}function UO(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function HO(r){let e=String(r.scheme).toLowerCase()==="https";return(r.port===(e?443:80)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}function eH(r){return r.secure=kS(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function tH(r){if((r.port===(kS(r)?443:80)||r.port==="")&&(r.port=void 0),typeof r.secure=="boolean"&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){let[e,t]=r.resourceName.split("?");r.path=e&&e!=="/"?e:void 0,r.query=t,r.resourceName=void 0}return r.fragment=void 0,r}function rH(r,e){if(!r.path)return r.error="URN can not be parsed",r;let t=r.path.match(QU);if(t){let n=e.scheme||r.scheme||"urn";r.nid=t[1].toLowerCase(),r.nss=t[2];let i=`${n}:${e.nid||r.nid}`,s=TS(i);r.path=void 0,s&&(r=s.parse(r,e))}else r.error=r.error||"URN can not be parsed.";return r}function nH(r,e){if(r.nid===void 0)throw new Error("URN without nid cannot be serialized");let t=e.scheme||r.scheme||"urn",n=r.nid.toLowerCase(),i=`${t}:${e.nid||n}`,s=TS(i);s&&(r=s.serialize(r,e));let a=r,l=r.nss;return a.path=`${n||e.nid}:${l}`,e.skipEscape=!0,a}function iH(r,e){let t=r;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!KU(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function sH(r){let e=r;return e.nss=(r.uuid||"").toLowerCase(),e}var BO={scheme:"http",domainHost:!0,parse:UO,serialize:HO},oH={scheme:"https",domainHost:BO.domainHost,parse:UO,serialize:HO},Ph={scheme:"ws",domainHost:!0,parse:eH,serialize:tH},aH={scheme:"wss",domainHost:Ph.domainHost,parse:Ph.parse,serialize:Ph.serialize},lH={scheme:"urn",parse:rH,serialize:nH,skipNormalize:!0},uH={scheme:"urn:uuid",parse:iH,serialize:sH,skipNormalize:!0},kh={http:BO,https:oH,ws:Ph,wss:aH,urn:lH,"urn:uuid":uH};Object.setPrototypeOf(kh,null);function TS(r){return r&&(kh[r]||kh[r.toLowerCase()])||void 0}VO.exports={wsIsSecure:kS,SCHEMES:kh,isValidSchemeName:XU,getSchemeHandler:TS}});var QO=F((I7,Th)=>{"use strict";var{normalizeIPv6:cH,removeDotSegments:tf,recomposeAuthority:fH,normalizePercentEncoding:dH,normalizePathEncoding:pH,escapePreservingEscapes:hH,reescapeHostDelimiters:mH,isIPv4:gH,nonSimpleDomain:yH}=PS(),{SCHEMES:vH,getSchemeHandler:JO}=WO();function bH(r,e){return typeof r=="string"?r=CH(r,e):typeof r=="object"&&(r=jl(aa(r,e),e)),r}function SH(r,e,t){let n=t?Object.assign({scheme:"null"},t):{scheme:"null"},i=GO(jl(r,n),jl(e,n),n,!0);return n.skipEscape=!0,aa(i,n)}function GO(r,e,t,n){let i={};return n||(r=jl(aa(r,t),t),e=jl(aa(e,t),t)),t=t||{},!t.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=tf(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=tf(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=tf(e.path):((r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&!r.path?i.path="/"+e.path:r.path?i.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=tf(i.path)),i.query=e.query):(i.path=r.path,e.query!==void 0?i.query=e.query:i.query=r.query),i.userinfo=r.userinfo,i.host=r.host,i.port=r.port),i.scheme=r.scheme),i.fragment=e.fragment,i}function wH(r,e,t){let n=zO(r,t),i=zO(e,t);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function aa(r,e){let t={host:r.host,scheme:r.scheme,userinfo:r.userinfo,port:r.port,path:r.path,query:r.query,nid:r.nid,nss:r.nss,uuid:r.uuid,fragment:r.fragment,reference:r.reference,resourceName:r.resourceName,secure:r.secure,error:""},n=Object.assign({},e),i=[],s=JO(n.scheme||t.scheme);s&&s.serialize&&s.serialize(t,n),t.path!==void 0&&(n.skipEscape?t.path=dH(t.path):(t.path=hH(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),n.reference!=="suffix"&&t.scheme&&i.push(t.scheme,":");let a=fH(t);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),t.path&&t.path[0]!=="/"&&i.push("/")),t.path!==void 0){let l=t.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=tf(l)),a===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),i.push(l)}return t.query!==void 0&&i.push("?",t.query),t.fragment!==void 0&&i.push("#",t.fragment),i.join("")}var _H=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function RH(r,e){if(e[2]!==void 0&&r.path&&r.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof r.port=="number"&&(r.port<0||r.port>65535))return"URI port is malformed."}function YO(r,e){let t=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,s=!1;t.reference==="suffix"&&(t.scheme?r=t.scheme+":"+r:r="//"+r);let a=r.match(_H);if(a){n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]);let l=RH(n,a);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(gH(n.host)===!1){let h=cH(n.host);n.host=h.host.toLowerCase(),s=h.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");let f=JO(t.scheme||n.scheme);if(!t.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(t.domainHost||f&&f.domainHost)&&s===!1&&yH(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!f||f&&!f.skipNormalize)&&(r.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=mH(unescape(n.host),s))),n.path&&(n.path=pH(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}f&&f.parse&&f.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function jl(r,e){return YO(r,e).parsed}function CH(r,e){return KO(r,e).normalized}function KO(r,e){let{parsed:t,malformedAuthorityOrPort:n}=YO(r,e);return{normalized:n?r:aa(t,e),malformedAuthorityOrPort:n}}function zO(r,e){if(typeof r=="string"){let{normalized:t,malformedAuthorityOrPort:n}=KO(r,e);return n?void 0:t}if(typeof r=="object")return aa(r,e)}var qS={SCHEMES:vH,normalize:bH,resolve:SH,resolveComponent:GO,equal:wH,serialize:aa,parse:jl};Th.exports=qS;Th.exports.default=qS;Th.exports.fastUri=qS});var XO=F(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});var ZO=QO();ZO.code='require("ajv/dist/runtime/uri").default';AS.default=ZO});var aI=F(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.CodeGen=tr.Name=tr.nil=tr.stringify=tr.str=tr._=tr.KeywordCxt=void 0;var xH=Xc();Object.defineProperty(tr,"KeywordCxt",{enumerable:!0,get:function(){return xH.KeywordCxt}});var Ul=Ne();Object.defineProperty(tr,"_",{enumerable:!0,get:function(){return Ul._}});Object.defineProperty(tr,"str",{enumerable:!0,get:function(){return Ul.str}});Object.defineProperty(tr,"stringify",{enumerable:!0,get:function(){return Ul.stringify}});Object.defineProperty(tr,"nil",{enumerable:!0,get:function(){return Ul.nil}});Object.defineProperty(tr,"Name",{enumerable:!0,get:function(){return Ul.Name}});Object.defineProperty(tr,"CodeGen",{enumerable:!0,get:function(){return Ul.CodeGen}});var EH=Eh(),iI=ef(),OH=aS(),rf=Ih(),IH=Ne(),nf=Kc(),qh=Yc(),MS=We(),eI=$O(),PH=XO(),sI=(r,e)=>new RegExp(r,e);sI.code="new RegExp";var kH=["removeAdditional","useDefaults","coerceTypes"],TH=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),qH={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},AH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},tI=200;function $H(r){var e,t,n,i,s,a,l,f,d,h,g,y,S,_,R,I,q,U,B,V,W,X,T,C,k;let N=r.strict,j=(e=r.code)===null||e===void 0?void 0:e.optimize,$=j===!0||j===void 0?1:j||0,G=(n=(t=r.code)===null||t===void 0?void 0:t.regExp)!==null&&n!==void 0?n:sI,K=(i=r.uriResolver)!==null&&i!==void 0?i:PH.default;return{strictSchema:(a=(s=r.strictSchema)!==null&&s!==void 0?s:N)!==null&&a!==void 0?a:!0,strictNumbers:(f=(l=r.strictNumbers)!==null&&l!==void 0?l:N)!==null&&f!==void 0?f:!0,strictTypes:(h=(d=r.strictTypes)!==null&&d!==void 0?d:N)!==null&&h!==void 0?h:"log",strictTuples:(y=(g=r.strictTuples)!==null&&g!==void 0?g:N)!==null&&y!==void 0?y:"log",strictRequired:(_=(S=r.strictRequired)!==null&&S!==void 0?S:N)!==null&&_!==void 0?_:!1,code:r.code?{...r.code,optimize:$,regExp:G}:{optimize:$,regExp:G},loopRequired:(R=r.loopRequired)!==null&&R!==void 0?R:tI,loopEnum:(I=r.loopEnum)!==null&&I!==void 0?I:tI,meta:(q=r.meta)!==null&&q!==void 0?q:!0,messages:(U=r.messages)!==null&&U!==void 0?U:!0,inlineRefs:(B=r.inlineRefs)!==null&&B!==void 0?B:!0,schemaId:(V=r.schemaId)!==null&&V!==void 0?V:"$id",addUsedSchema:(W=r.addUsedSchema)!==null&&W!==void 0?W:!0,validateSchema:(X=r.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(T=r.validateFormats)!==null&&T!==void 0?T:!0,unicodeRegExp:(C=r.unicodeRegExp)!==null&&C!==void 0?C:!0,int32range:(k=r.int32range)!==null&&k!==void 0?k:!0,uriResolver:K}}var sf=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...$H(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new IH.ValueScope({scope:{},prefixes:TH,es5:t,lines:n}),this.logger=jH(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,OH.getRules)(),rI.call(this,qH,e,"NOT SUPPORTED"),rI.call(this,AH,e,"DEPRECATED","warn"),this._metaOpts=FH.call(this),e.formats&&NH.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&DH.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),MH.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,i=eI;n==="id"&&(i={...eI},i.id=i.$id,delete i.$id),t&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(t);return"$async"in n||(this.errors=n.errors),i}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,t);async function i(h,g){await s.call(this,h.$schema);let y=this._addSchema(h,g);return y.validate||a.call(this,y)}async function s(h){h&&!this.getSchema(h)&&await i.call(this,{$ref:h},!0)}async function a(h){try{return this._compileSchemaEnv(h)}catch(g){if(!(g instanceof iI.default))throw g;return l.call(this,g),await f.call(this,g.missingSchema),a.call(this,h)}}function l({missingSchema:h,missingRef:g}){if(this.refs[h])throw new Error(`AnySchema ${h} is loaded but ${g} cannot be resolved`)}async function f(h){let g=await d.call(this,h);this.refs[h]||await s.call(this,g.$schema),this.refs[h]||this.addSchema(g,h,t)}async function d(h){let g=this._loading[h];if(g)return g;try{return await(this._loading[h]=n(h))}finally{delete this._loading[h]}}}addSchema(e,t,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return t=(0,nf.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,i,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&t){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let t;for(;typeof(t=nI.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:n}=this.opts,i=new rf.SchemaEnv({schema:{},schemaId:n});if(t=rf.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=nI.call(this,e);return typeof t=="object"&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,nf.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e=="string")n=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else if(typeof e=="object"&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(HH.call(this,n,t),!t)return(0,MS.eachItem)(n,s=>$S.call(this,s)),this;VH.call(this,t);let i={...t,type:(0,qh.getJSONTypes)(t.type),schemaType:(0,qh.getJSONTypes)(t.schemaType)};return(0,MS.eachItem)(n,i.type.length===0?s=>$S.call(this,s,i):s=>i.type.forEach(a=>$S.call(this,s,i,a))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,t){return typeof t=="string"&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+t+s)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of t){let s=i.split("/").slice(1),a=e;for(let l of s)a=a[l];for(let l in n){let f=n[l];if(typeof f!="object")continue;let{$data:d}=f.definition,h=a[l];d&&h&&(a[l]=oI(h))}}return e}_removeAllSchemas(e,t){for(let n in e){let i=e[n];(!t||t.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,t,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:l}=this.opts;if(typeof e=="object")a=e[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let f=this._cache.get(e);if(f!==void 0)return f;n=(0,nf.normalizeId)(a||n);let d=nf.getSchemaRefs.call(this,e,n);return f=new rf.SchemaEnv({schema:e,schemaId:l,meta:t,baseId:n,localRefs:d}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),i&&this.validateSchema(e,!0),f}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):rf.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{rf.compileSchema.call(this,e)}finally{this.opts=t}}};sf.ValidationError=EH.default;sf.MissingRefError=iI.default;tr.default=sf;function rI(r,e,t,n="error"){for(let i in r){let s=i;s in e&&this.logger[n](`${t}: option ${i}. ${r[s]}`)}}function nI(r){return r=(0,nf.normalizeId)(r),this.schemas[r]||this.refs[r]}function MH(){let r=this.opts.schemas;if(r)if(Array.isArray(r))this.addSchema(r);else for(let e in r)this.addSchema(r[e],e)}function NH(){for(let r in this.opts.formats){let e=this.opts.formats[r];e&&this.addFormat(r,e)}}function DH(r){if(Array.isArray(r)){this.addVocabulary(r);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in r){let t=r[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function FH(){let r={...this.opts};for(let e of kH)delete r[e];return r}var LH={log(){},warn(){},error(){}};function jH(r){if(r===!1)return LH;if(r===void 0)return console;if(r.log&&r.warn&&r.error)return r;throw new Error("logger must implement log, warn and error methods")}var UH=/^[a-z_$][a-z0-9_$:-]*$/i;function HH(r,e){let{RULES:t}=this;if((0,MS.eachItem)(r,n=>{if(t.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!UH.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function $S(r,e,t){var n;let i=e?.post;if(t&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:f})=>f===t);if(a||(a={type:t,rules:[]},s.rules.push(a)),s.keywords[r]=!0,!e)return;let l={keyword:r,definition:{...e,type:(0,qh.getJSONTypes)(e.type),schemaType:(0,qh.getJSONTypes)(e.schemaType)}};e.before?BH.call(this,a,l,e.before):a.rules.push(l),s.all[r]=l,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function BH(r,e,t){let n=r.rules.findIndex(i=>i.keyword===t);n>=0?r.rules.splice(n,0,e):(r.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function VH(r){let{metaSchema:e}=r;e!==void 0&&(r.$data&&this.opts.$data&&(e=oI(e)),r.validateSchema=this.compile(e,!0))}var WH={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function oI(r){return{anyOf:[r,WH]}}});var lI=F(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});var zH={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};NS.default=zH});var dI=F(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.callRef=la.getValidate=void 0;var JH=ef(),uI=_n(),jr=Ne(),Hl=es(),cI=Ih(),Ah=We(),GH={keyword:"$ref",schemaType:"string",code(r){let{gen:e,schema:t,it:n}=r,{baseId:i,schemaEnv:s,validateName:a,opts:l,self:f}=n,{root:d}=s;if((t==="#"||t==="#/")&&i===d.baseId)return g();let h=cI.resolveRef.call(f,d,i,t);if(h===void 0)throw new JH.default(n.opts.uriResolver,i,t);if(h instanceof cI.SchemaEnv)return y(h);return S(h);function g(){if(s===d)return $h(r,a,s,s.$async);let _=e.scopeValue("root",{ref:d});return $h(r,(0,jr._)`${_}.validate`,d,d.$async)}function y(_){let R=fI(r,_);$h(r,R,_,_.$async)}function S(_){let R=e.scopeValue("schema",l.code.source===!0?{ref:_,code:(0,jr.stringify)(_)}:{ref:_}),I=e.name("valid"),q=r.subschema({schema:_,dataTypes:[],schemaPath:jr.nil,topSchemaRef:R,errSchemaPath:t},I);r.mergeEvaluated(q),r.ok(I)}}};function fI(r,e){let{gen:t}=r;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,jr._)`${t.scopeValue("wrapper",{ref:e})}.validate`}la.getValidate=fI;function $h(r,e,t,n){let{gen:i,it:s}=r,{allErrors:a,schemaEnv:l,opts:f}=s,d=f.passContext?Hl.default.this:jr.nil;n?h():g();function h(){if(!l.$async)throw new Error("async schema referenced by sync schema");let _=i.let("valid");i.try(()=>{i.code((0,jr._)`await ${(0,uI.callValidateCode)(r,e,d)}`),S(e),a||i.assign(_,!0)},R=>{i.if((0,jr._)`!(${R} instanceof ${s.ValidationError})`,()=>i.throw(R)),y(R),a||i.assign(_,!1)}),r.ok(_)}function g(){r.result((0,uI.callValidateCode)(r,e,d),()=>S(e),()=>y(e))}function y(_){let R=(0,jr._)`${_}.errors`;i.assign(Hl.default.vErrors,(0,jr._)`${Hl.default.vErrors} === null ? ${R} : ${Hl.default.vErrors}.concat(${R})`),i.assign(Hl.default.errors,(0,jr._)`${Hl.default.vErrors}.length`)}function S(_){var R;if(!s.opts.unevaluated)return;let I=(R=t?.validate)===null||R===void 0?void 0:R.evaluated;if(s.props!==!0)if(I&&!I.dynamicProps)I.props!==void 0&&(s.props=Ah.mergeEvaluated.props(i,I.props,s.props));else{let q=i.var("props",(0,jr._)`${_}.evaluated.props`);s.props=Ah.mergeEvaluated.props(i,q,s.props,jr.Name)}if(s.items!==!0)if(I&&!I.dynamicItems)I.items!==void 0&&(s.items=Ah.mergeEvaluated.items(i,I.items,s.items));else{let q=i.var("items",(0,jr._)`${_}.evaluated.items`);s.items=Ah.mergeEvaluated.items(i,q,s.items,jr.Name)}}}la.callRef=$h;la.default=GH});var pI=F(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var YH=lI(),KH=dI(),QH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",YH.default,KH.default];DS.default=QH});var hI=F(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});var Mh=Ne(),zs=Mh.operators,Nh={maximum:{okStr:"<=",ok:zs.LTE,fail:zs.GT},minimum:{okStr:">=",ok:zs.GTE,fail:zs.LT},exclusiveMaximum:{okStr:"<",ok:zs.LT,fail:zs.GTE},exclusiveMinimum:{okStr:">",ok:zs.GT,fail:zs.LTE}},ZH={message:({keyword:r,schemaCode:e})=>(0,Mh.str)`must be ${Nh[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,Mh._)`{comparison: ${Nh[r].okStr}, limit: ${e}}`},XH={keyword:Object.keys(Nh),type:"number",schemaType:"number",$data:!0,error:ZH,code(r){let{keyword:e,data:t,schemaCode:n}=r;r.fail$data((0,Mh._)`${t} ${Nh[e].fail} ${n} || isNaN(${t})`)}};FS.default=XH});var mI=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var of=Ne(),eB={message:({schemaCode:r})=>(0,of.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,of._)`{multipleOf: ${r}}`},tB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:eB,code(r){let{gen:e,data:t,schemaCode:n,it:i}=r,s=i.opts.multipleOfPrecision,a=e.let("res"),l=s?(0,of._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,of._)`${a} !== parseInt(${a})`;r.fail$data((0,of._)`(${n} === 0 || (${a} = ${t}/${n}, ${l}))`)}};LS.default=tB});var yI=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});function gI(r){let e=r.length,t=0,n=0,i;for(;n<e;)t++,i=r.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=r.charCodeAt(n),(i&64512)===56320&&n++);return t}jS.default=gI;gI.code='require("ajv/dist/runtime/ucs2length").default'});var vI=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var ua=Ne(),rB=We(),nB=yI(),iB={message({keyword:r,schemaCode:e}){let t=r==="maxLength"?"more":"fewer";return(0,ua.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:r})=>(0,ua._)`{limit: ${r}}`},sB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:iB,code(r){let{keyword:e,data:t,schemaCode:n,it:i}=r,s=e==="maxLength"?ua.operators.GT:ua.operators.LT,a=i.opts.unicode===!1?(0,ua._)`${t}.length`:(0,ua._)`${(0,rB.useFunc)(r.gen,nB.default)}(${t})`;r.fail$data((0,ua._)`${a} ${s} ${n}`)}};US.default=sB});var bI=F(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});var oB=_n(),aB=We(),Bl=Ne(),lB={message:({schemaCode:r})=>(0,Bl.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,Bl._)`{pattern: ${r}}`},uB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:lB,code(r){let{gen:e,data:t,$data:n,schema:i,schemaCode:s,it:a}=r,l=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:f}=a.opts.code,d=f.code==="new RegExp"?(0,Bl._)`new RegExp`:(0,aB.useFunc)(e,f),h=e.let("valid");e.try(()=>e.assign(h,(0,Bl._)`${d}(${s}, ${l}).test(${t})`),()=>e.assign(h,!1)),r.fail$data((0,Bl._)`!${h}`)}else{let f=(0,oB.usePattern)(r,i);r.fail$data((0,Bl._)`!${f}.test(${t})`)}}};HS.default=uB});var SI=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var af=Ne(),cB={message({keyword:r,schemaCode:e}){let t=r==="maxProperties"?"more":"fewer";return(0,af.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:r})=>(0,af._)`{limit: ${r}}`},fB={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:cB,code(r){let{keyword:e,data:t,schemaCode:n}=r,i=e==="maxProperties"?af.operators.GT:af.operators.LT;r.fail$data((0,af._)`Object.keys(${t}).length ${i} ${n}`)}};BS.default=fB});var wI=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var lf=_n(),uf=Ne(),dB=We(),pB={message:({params:{missingProperty:r}})=>(0,uf.str)`must have required property '${r}'`,params:({params:{missingProperty:r}})=>(0,uf._)`{missingProperty: ${r}}`},hB={keyword:"required",type:"object",schemaType:"array",$data:!0,error:pB,code(r){let{gen:e,schema:t,schemaCode:n,data:i,$data:s,it:a}=r,{opts:l}=a;if(!s&&t.length===0)return;let f=t.length>=l.loopRequired;if(a.allErrors?d():h(),l.strictRequired){let S=r.parentSchema.properties,{definedProperties:_}=r.it;for(let R of t)if(S?.[R]===void 0&&!_.has(R)){let I=a.schemaEnv.baseId+a.errSchemaPath,q=`required property "${R}" is not defined at "${I}" (strictRequired)`;(0,dB.checkStrictMode)(a,q,a.opts.strictRequired)}}function d(){if(f||s)r.block$data(uf.nil,g);else for(let S of t)(0,lf.checkReportMissingProp)(r,S)}function h(){let S=e.let("missing");if(f||s){let _=e.let("valid",!0);r.block$data(_,()=>y(S,_)),r.ok(_)}else e.if((0,lf.checkMissingProp)(r,t,S)),(0,lf.reportMissingProp)(r,S),e.else()}function g(){e.forOf("prop",n,S=>{r.setParams({missingProperty:S}),e.if((0,lf.noPropertyInData)(e,i,S,l.ownProperties),()=>r.error())})}function y(S,_){r.setParams({missingProperty:S}),e.forOf(S,n,()=>{e.assign(_,(0,lf.propertyInData)(e,i,S,l.ownProperties)),e.if((0,uf.not)(_),()=>{r.error(),e.break()})},uf.nil)}}};VS.default=hB});var _I=F(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var cf=Ne(),mB={message({keyword:r,schemaCode:e}){let t=r==="maxItems"?"more":"fewer";return(0,cf.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:r})=>(0,cf._)`{limit: ${r}}`},gB={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:mB,code(r){let{keyword:e,data:t,schemaCode:n}=r,i=e==="maxItems"?cf.operators.GT:cf.operators.LT;r.fail$data((0,cf._)`${t}.length ${i} ${n}`)}};WS.default=gB});var Dh=F(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var RI=mS();RI.code='require("ajv/dist/runtime/equal").default';zS.default=RI});var CI=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var JS=Yc(),rr=Ne(),yB=We(),vB=Dh(),bB={message:({params:{i:r,j:e}})=>(0,rr.str)`must NOT have duplicate items (items ## ${e} and ${r} are identical)`,params:({params:{i:r,j:e}})=>(0,rr._)`{i: ${r}, j: ${e}}`},SB={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:bB,code(r){let{gen:e,data:t,$data:n,schema:i,parentSchema:s,schemaCode:a,it:l}=r;if(!n&&!i)return;let f=e.let("valid"),d=s.items?(0,JS.getSchemaTypes)(s.items):[];r.block$data(f,h,(0,rr._)`${a} === false`),r.ok(f);function h(){let _=e.let("i",(0,rr._)`${t}.length`),R=e.let("j");r.setParams({i:_,j:R}),e.assign(f,!0),e.if((0,rr._)`${_} > 1`,()=>(g()?y:S)(_,R))}function g(){return d.length>0&&!d.some(_=>_==="object"||_==="array")}function y(_,R){let I=e.name("item"),q=(0,JS.checkDataTypes)(d,I,l.opts.strictNumbers,JS.DataType.Wrong),U=e.const("indices",(0,rr._)`{}`);e.for((0,rr._)`;${_}--;`,()=>{e.let(I,(0,rr._)`${t}[${_}]`),e.if(q,(0,rr._)`continue`),d.length>1&&e.if((0,rr._)`typeof ${I} == "string"`,(0,rr._)`${I} += "_"`),e.if((0,rr._)`typeof ${U}[${I}] == "number"`,()=>{e.assign(R,(0,rr._)`${U}[${I}]`),r.error(),e.assign(f,!1).break()}).code((0,rr._)`${U}[${I}] = ${_}`)})}function S(_,R){let I=(0,yB.useFunc)(e,vB.default),q=e.name("outer");e.label(q).for((0,rr._)`;${_}--;`,()=>e.for((0,rr._)`${R} = ${_}; ${R}--;`,()=>e.if((0,rr._)`${I}(${t}[${_}], ${t}[${R}])`,()=>{r.error(),e.assign(f,!1).break(q)})))}}};GS.default=SB});var xI=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var YS=Ne(),wB=We(),_B=Dh(),RB={message:"must be equal to constant",params:({schemaCode:r})=>(0,YS._)`{allowedValue: ${r}}`},CB={keyword:"const",$data:!0,error:RB,code(r){let{gen:e,data:t,$data:n,schemaCode:i,schema:s}=r;n||s&&typeof s=="object"?r.fail$data((0,YS._)`!${(0,wB.useFunc)(e,_B.default)}(${t}, ${i})`):r.fail((0,YS._)`${s} !== ${t}`)}};KS.default=CB});var EI=F(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});var ff=Ne(),xB=We(),EB=Dh(),OB={message:"must be equal to one of the allowed values",params:({schemaCode:r})=>(0,ff._)`{allowedValues: ${r}}`},IB={keyword:"enum",schemaType:"array",$data:!0,error:OB,code(r){let{gen:e,data:t,$data:n,schema:i,schemaCode:s,it:a}=r;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let l=i.length>=a.opts.loopEnum,f,d=()=>f??(f=(0,xB.useFunc)(e,EB.default)),h;if(l||n)h=e.let("valid"),r.block$data(h,g);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let S=e.const("vSchema",s);h=(0,ff.or)(...i.map((_,R)=>y(S,R)))}r.pass(h);function g(){e.assign(h,!1),e.forOf("v",s,S=>e.if((0,ff._)`${d()}(${t}, ${S})`,()=>e.assign(h,!0).break()))}function y(S,_){let R=i[_];return typeof R=="object"&&R!==null?(0,ff._)`${d()}(${t}, ${S}[${_}])`:(0,ff._)`${t} === ${R}`}}};QS.default=IB});var OI=F(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0});var PB=hI(),kB=mI(),TB=vI(),qB=bI(),AB=SI(),$B=wI(),MB=_I(),NB=CI(),DB=xI(),FB=EI(),LB=[PB.default,kB.default,TB.default,qB.default,AB.default,$B.default,MB.default,NB.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},DB.default,FB.default];ZS.default=LB});var e0=F(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.validateAdditionalItems=void 0;var ca=Ne(),XS=We(),jB={message:({params:{len:r}})=>(0,ca.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,ca._)`{limit: ${r}}`},UB={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:jB,code(r){let{parentSchema:e,it:t}=r,{items:n}=e;if(!Array.isArray(n)){(0,XS.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}II(r,n)}};function II(r,e){let{gen:t,schema:n,data:i,keyword:s,it:a}=r;a.items=!0;let l=t.const("len",(0,ca._)`${i}.length`);if(n===!1)r.setParams({len:e.length}),r.pass((0,ca._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,XS.alwaysValidSchema)(a,n)){let d=t.var("valid",(0,ca._)`${l} <= ${e.length}`);t.if((0,ca.not)(d),()=>f(d)),r.ok(d)}function f(d){t.forRange("i",e.length,l,h=>{r.subschema({keyword:s,dataProp:h,dataPropType:XS.Type.Num},d),a.allErrors||t.if((0,ca.not)(d),()=>t.break())})}}df.validateAdditionalItems=II;df.default=UB});var t0=F(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.validateTuple=void 0;var PI=Ne(),Fh=We(),HB=_n(),BB={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(r){let{schema:e,it:t}=r;if(Array.isArray(e))return kI(r,"additionalItems",e);t.items=!0,!(0,Fh.alwaysValidSchema)(t,e)&&r.ok((0,HB.validateArray)(r))}};function kI(r,e,t=r.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:l}=r;h(i),l.opts.unevaluated&&t.length&&l.items!==!0&&(l.items=Fh.mergeEvaluated.items(n,t.length,l.items));let f=n.name("valid"),d=n.const("len",(0,PI._)`${s}.length`);t.forEach((g,y)=>{(0,Fh.alwaysValidSchema)(l,g)||(n.if((0,PI._)`${d} > ${y}`,()=>r.subschema({keyword:a,schemaProp:y,dataProp:y},f)),r.ok(f))});function h(g){let{opts:y,errSchemaPath:S}=l,_=t.length,R=_===g.minItems&&(_===g.maxItems||g[e]===!1);if(y.strictTuples&&!R){let I=`"${a}" is ${_}-tuple, but minItems or maxItems/${e} are not specified or different at path "${S}"`;(0,Fh.checkStrictMode)(l,I,y.strictTuples)}}}pf.validateTuple=kI;pf.default=BB});var TI=F(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var VB=t0(),WB={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,VB.validateTuple)(r,"items")};r0.default=WB});var AI=F(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});var qI=Ne(),zB=We(),JB=_n(),GB=e0(),YB={message:({params:{len:r}})=>(0,qI.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,qI._)`{limit: ${r}}`},KB={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:YB,code(r){let{schema:e,parentSchema:t,it:n}=r,{prefixItems:i}=t;n.items=!0,!(0,zB.alwaysValidSchema)(n,e)&&(i?(0,GB.validateAdditionalItems)(r,i):r.ok((0,JB.validateArray)(r)))}};n0.default=KB});var $I=F(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});var Cn=Ne(),Lh=We(),QB={message:({params:{min:r,max:e}})=>e===void 0?(0,Cn.str)`must contain at least ${r} valid item(s)`:(0,Cn.str)`must contain at least ${r} and no more than ${e} valid item(s)`,params:({params:{min:r,max:e}})=>e===void 0?(0,Cn._)`{minContains: ${r}}`:(0,Cn._)`{minContains: ${r}, maxContains: ${e}}`},ZB={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:QB,code(r){let{gen:e,schema:t,parentSchema:n,data:i,it:s}=r,a,l,{minContains:f,maxContains:d}=n;s.opts.next?(a=f===void 0?1:f,l=d):a=1;let h=e.const("len",(0,Cn._)`${i}.length`);if(r.setParams({min:a,max:l}),l===void 0&&a===0){(0,Lh.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,Lh.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,Lh.alwaysValidSchema)(s,t)){let R=(0,Cn._)`${h} >= ${a}`;l!==void 0&&(R=(0,Cn._)`${R} && ${h} <= ${l}`),r.pass(R);return}s.items=!0;let g=e.name("valid");l===void 0&&a===1?S(g,()=>e.if(g,()=>e.break())):a===0?(e.let(g,!0),l!==void 0&&e.if((0,Cn._)`${i}.length > 0`,y)):(e.let(g,!1),y()),r.result(g,()=>r.reset());function y(){let R=e.name("_valid"),I=e.let("count",0);S(R,()=>e.if(R,()=>_(I)))}function S(R,I){e.forRange("i",0,h,q=>{r.subschema({keyword:"contains",dataProp:q,dataPropType:Lh.Type.Num,compositeRule:!0},R),I()})}function _(R){e.code((0,Cn._)`${R}++`),l===void 0?e.if((0,Cn._)`${R} >= ${a}`,()=>e.assign(g,!0).break()):(e.if((0,Cn._)`${R} > ${l}`,()=>e.assign(g,!1).break()),a===1?e.assign(g,!0):e.if((0,Cn._)`${R} >= ${a}`,()=>e.assign(g,!0)))}}};i0.default=ZB});var DI=F(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.validateSchemaDeps=Ci.validatePropertyDeps=Ci.error=void 0;var s0=Ne(),XB=We(),hf=_n();Ci.error={message:({params:{property:r,depsCount:e,deps:t}})=>{let n=e===1?"property":"properties";return(0,s0.str)`must have ${n} ${t} when property ${r} is present`},params:({params:{property:r,depsCount:e,deps:t,missingProperty:n}})=>(0,s0._)`{property: ${r},
|
|
27
|
+
|| ${a} === "boolean" || ${i} === null`).assign(l,(0,Oe._)`[${i}]`)}}}function w2({gen:r,parentData:e,parentDataProperty:t},n){r.if((0,Oe._)`${e} !== undefined`,()=>r.assign((0,Oe._)`${e}[${t}]`,n))}function uS(r,e,t,n=Nl.Correct){let i=n===Nl.Correct?Oe.operators.EQ:Oe.operators.NEQ,s;switch(r){case"null":return(0,Oe._)`${e} ${i} null`;case"array":s=(0,Oe._)`Array.isArray(${e})`;break;case"object":s=(0,Oe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Oe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Oe._)`typeof ${e} ${i} ${r}`}return n===Nl.Correct?s:(0,Oe.not)(s);function a(l=Oe.nil){return(0,Oe.and)((0,Oe._)`typeof ${e} == "number"`,l,t?(0,Oe._)`isFinite(${e})`:Oe.nil)}}cr.checkDataType=uS;function cS(r,e,t,n){if(r.length===1)return uS(r[0],e,t,n);let i,s=(0,eO.toHash)(r);if(s.array&&s.object){let a=(0,Oe._)`typeof ${e} != "object"`;i=s.null?a:(0,Oe._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Oe.nil;s.number&&delete s.integer;for(let a in s)i=(0,Oe.and)(i,uS(a,e,t,n));return i}cr.checkDataTypes=cS;var _2={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:e})=>typeof r=="string"?(0,Oe._)`{type: ${r}}`:(0,Oe._)`{type: ${e}}`};function fS(r){let e=R2(r);(0,g2.reportError)(e,_2)}cr.reportTypeError=fS;function R2(r){let{gen:e,data:t,schema:n}=r,i=(0,eO.schemaRefOrVal)(r,n,"type");return{gen:e,keyword:"type",data:t,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:r}}});var iO=F(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.assignDefaults=void 0;var Dl=Ne(),C2=We();function x2(r,e){let{properties:t,items:n}=r.schema;if(e==="object"&&t)for(let i in t)nO(r,i,t[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>nO(r,s,i.default))}wh.assignDefaults=x2;function nO(r,e,t){let{gen:n,compositeRule:i,data:s,opts:a}=r;if(t===void 0)return;let l=(0,Dl._)`${s}${(0,Dl.getProperty)(e)}`;if(i){(0,C2.checkStrictMode)(r,`default is ignored for: ${l}`);return}let f=(0,Dl._)`${l} === undefined`;a.useDefaults==="empty"&&(f=(0,Dl._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,Dl._)`${l} = ${(0,Dl.stringify)(t)}`)}});var _n=F(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.validateUnion=ft.validateArray=ft.usePattern=ft.callValidateCode=ft.schemaProperties=ft.allSchemaProperties=ft.noPropertyInData=ft.propertyInData=ft.isOwnProperty=ft.hasPropFunc=ft.reportMissingProp=ft.checkMissingProp=ft.checkReportMissingProp=void 0;var St=Ne(),dS=We(),Hs=es(),E2=We();function O2(r,e){let{gen:t,data:n,it:i}=r;t.if(hS(t,n,e,i.opts.ownProperties),()=>{r.setParams({missingProperty:(0,St._)`${e}`},!0),r.error()})}ft.checkReportMissingProp=O2;function I2({gen:r,data:e,it:{opts:t}},n,i){return(0,St.or)(...n.map(s=>(0,St.and)(hS(r,e,s,t.ownProperties),(0,St._)`${i} = ${s}`)))}ft.checkMissingProp=I2;function P2(r,e){r.setParams({missingProperty:e},!0),r.error()}ft.reportMissingProp=P2;function sO(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,St._)`Object.prototype.hasOwnProperty`})}ft.hasPropFunc=sO;function pS(r,e,t){return(0,St._)`${sO(r)}.call(${e}, ${t})`}ft.isOwnProperty=pS;function k2(r,e,t,n){let i=(0,St._)`${e}${(0,St.getProperty)(t)} !== undefined`;return n?(0,St._)`${i} && ${pS(r,e,t)}`:i}ft.propertyInData=k2;function hS(r,e,t,n){let i=(0,St._)`${e}${(0,St.getProperty)(t)} === undefined`;return n?(0,St.or)(i,(0,St.not)(pS(r,e,t))):i}ft.noPropertyInData=hS;function oO(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}ft.allSchemaProperties=oO;function T2(r,e){return oO(e).filter(t=>!(0,dS.alwaysValidSchema)(r,e[t]))}ft.schemaProperties=T2;function q2({schemaCode:r,data:e,it:{gen:t,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},l,f,d){let h=d?(0,St._)`${r}, ${e}, ${n}${i}`:e,g=[[Hs.default.instancePath,(0,St.strConcat)(Hs.default.instancePath,s)],[Hs.default.parentData,a.parentData],[Hs.default.parentDataProperty,a.parentDataProperty],[Hs.default.rootData,Hs.default.rootData]];a.opts.dynamicRef&&g.push([Hs.default.dynamicAnchors,Hs.default.dynamicAnchors]);let y=(0,St._)`${h}, ${t.object(...g)}`;return f!==St.nil?(0,St._)`${l}.call(${f}, ${y})`:(0,St._)`${l}(${y})`}ft.callValidateCode=q2;var A2=(0,St._)`new RegExp`;function $2({gen:r,it:{opts:e}},t){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(t,n);return r.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,St._)`${i.code==="new RegExp"?A2:(0,E2.useFunc)(r,i)}(${t}, ${n})`})}ft.usePattern=$2;function M2(r){let{gen:e,data:t,keyword:n,it:i}=r,s=e.name("valid");if(i.allErrors){let l=e.let("valid",!0);return a(()=>e.assign(l,!1)),l}return e.var(s,!0),a(()=>e.break()),s;function a(l){let f=e.const("len",(0,St._)`${t}.length`);e.forRange("i",0,f,d=>{r.subschema({keyword:n,dataProp:d,dataPropType:dS.Type.Num},s),e.if((0,St.not)(s),l)})}}ft.validateArray=M2;function N2(r){let{gen:e,schema:t,keyword:n,it:i}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(f=>(0,dS.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),l=e.name("_valid");e.block(()=>t.forEach((f,d)=>{let h=r.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(a,(0,St._)`${a} || ${l}`),r.mergeValidEvaluated(h,l)||e.if((0,St.not)(a))})),r.result(a,()=>r.reset(),()=>r.error(!0))}ft.validateUnion=N2});var uO=F(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.validateKeywordUsage=wi.validSchemaType=wi.funcKeywordCode=wi.macroKeywordCode=void 0;var Or=Ne(),sa=es(),D2=_n(),F2=Jc();function L2(r,e){let{gen:t,keyword:n,schema:i,parentSchema:s,it:a}=r,l=e.macro.call(a.self,i,s,a),f=lO(t,n,l);a.opts.validateSchema!==!1&&a.self.validateSchema(l,!0);let d=t.name("valid");r.subschema({schema:l,schemaPath:Or.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},d),r.pass(d,()=>r.error(!0))}wi.macroKeywordCode=L2;function j2(r,e){var t;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:l,it:f}=r;H2(f,e);let d=!l&&e.compile?e.compile.call(f.self,s,a,f):e.validate,h=lO(n,i,d),g=n.let("valid");r.block$data(g,y),r.ok((t=e.valid)!==null&&t!==void 0?t:g);function y(){if(e.errors===!1)R(),e.modifying&&aO(r),I(()=>r.error());else{let q=e.async?S():_();e.modifying&&aO(r),I(()=>U2(r,q))}}function S(){let q=n.let("ruleErrs",null);return n.try(()=>R((0,Or._)`await `),j=>n.assign(g,!1).if((0,Or._)`${j} instanceof ${f.ValidationError}`,()=>n.assign(q,(0,Or._)`${j}.errors`),()=>n.throw(j))),q}function _(){let q=(0,Or._)`${h}.errors`;return n.assign(q,null),R(Or.nil),q}function R(q=e.async?(0,Or._)`await `:Or.nil){let j=f.opts.passContext?sa.default.this:sa.default.self,B=!("compile"in e&&!l||e.schema===!1);n.assign(g,(0,Or._)`${q}${(0,D2.callValidateCode)(r,h,j,B)}`,e.modifying)}function I(q){var j;n.if((0,Or.not)((j=e.valid)!==null&&j!==void 0?j:g),q)}}wi.funcKeywordCode=j2;function aO(r){let{gen:e,data:t,it:n}=r;e.if(n.parentData,()=>e.assign(t,(0,Or._)`${n.parentData}[${n.parentDataProperty}]`))}function U2(r,e){let{gen:t}=r;t.if((0,Or._)`Array.isArray(${e})`,()=>{t.assign(sa.default.vErrors,(0,Or._)`${sa.default.vErrors} === null ? ${e} : ${sa.default.vErrors}.concat(${e})`).assign(sa.default.errors,(0,Or._)`${sa.default.vErrors}.length`),(0,F2.extendErrors)(r)},()=>r.error())}function H2({schemaEnv:r},e){if(e.async&&!r.$async)throw new Error("async keyword in sync schema")}function lO(r,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return r.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,Or.stringify)(t)})}function B2(r,e,t=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(r):n==="object"?r&&typeof r=="object"&&!Array.isArray(r):typeof r==n||t&&typeof r>"u")}wi.validSchemaType=B2;function V2({schema:r,opts:e,self:t,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(l=>!Object.prototype.hasOwnProperty.call(r,l)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(r[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+t.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(f);else throw new Error(f)}}wi.validateKeywordUsage=V2});var fO=F(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.extendSubschemaMode=Bs.extendSubschemaData=Bs.getSubschema=void 0;var _i=Ne(),cO=We();function W2(r,{keyword:e,schemaProp:t,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=r.schema[e];return t===void 0?{schema:l,schemaPath:(0,_i._)`${r.schemaPath}${(0,_i.getProperty)(e)}`,errSchemaPath:`${r.errSchemaPath}/${e}`}:{schema:l[t],schemaPath:(0,_i._)`${r.schemaPath}${(0,_i.getProperty)(e)}${(0,_i.getProperty)(t)}`,errSchemaPath:`${r.errSchemaPath}/${e}/${(0,cO.escapeFragment)(t)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Bs.getSubschema=W2;function z2(r,e,{dataProp:t,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(t!==void 0){let{errorPath:d,dataPathArr:h,opts:g}=e,y=l.let("data",(0,_i._)`${e.data}${(0,_i.getProperty)(t)}`,!0);f(y),r.errorPath=(0,_i.str)`${d}${(0,cO.getErrorPath)(t,n,g.jsPropertySyntax)}`,r.parentDataProperty=(0,_i._)`${t}`,r.dataPathArr=[...h,r.parentDataProperty]}if(i!==void 0){let d=i instanceof _i.Name?i:l.let("data",i,!0);f(d),a!==void 0&&(r.propertyName=a)}s&&(r.dataTypes=s);function f(d){r.data=d,r.dataLevel=e.dataLevel+1,r.dataTypes=[],e.definedProperties=new Set,r.parentData=e.data,r.dataNames=[...e.dataNames,d]}}Bs.extendSubschemaData=z2;function J2(r,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(r.compositeRule=n),i!==void 0&&(r.createErrors=i),s!==void 0&&(r.allErrors=s),r.jtdDiscriminator=e,r.jtdMetadata=t}Bs.extendSubschemaMode=J2});var mS=F((v7,dO)=>{"use strict";dO.exports=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!r(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!r(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}});var hO=F((b7,pO)=>{"use strict";var Vs=pO.exports=function(r,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var n=typeof t=="function"?t:t.pre||function(){},i=t.post||function(){};_h(e,n,i,r,"",r)};Vs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Vs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Vs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Vs.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function _h(r,e,t,n,i,s,a,l,f,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,l,f,d);for(var h in n){var g=n[h];if(Array.isArray(g)){if(h in Vs.arrayKeywords)for(var y=0;y<g.length;y++)_h(r,e,t,g[y],i+"/"+h+"/"+y,s,i,h,n,y)}else if(h in Vs.propsKeywords){if(g&&typeof g=="object")for(var S in g)_h(r,e,t,g[S],i+"/"+h+"/"+G2(S),s,i,h,n,S)}else(h in Vs.keywords||r.allKeys&&!(h in Vs.skipKeywords))&&_h(r,e,t,g,i+"/"+h,s,i,h,n)}t(n,i,s,a,l,f,d)}}function G2(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}});var Yc=F(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.getSchemaRefs=Lr.resolveUrl=Lr.normalizeId=Lr._getFullPath=Lr.getFullPath=Lr.inlineRef=void 0;var Y2=We(),K2=mS(),Q2=hO(),Z2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function X2(r,e=!0){return typeof r=="boolean"?!0:e===!0?!gS(r):e?mO(r)<=e:!1}Lr.inlineRef=X2;var eU=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function gS(r){for(let e in r){if(eU.has(e))return!0;let t=r[e];if(Array.isArray(t)&&t.some(gS)||typeof t=="object"&&gS(t))return!0}return!1}function mO(r){let e=0;for(let t in r){if(t==="$ref")return 1/0;if(e++,!Z2.has(t)&&(typeof r[t]=="object"&&(0,Y2.eachItem)(r[t],n=>e+=mO(n)),e===1/0))return 1/0}return e}function gO(r,e="",t){t!==!1&&(e=Fl(e));let n=r.parse(e);return yO(r,n)}Lr.getFullPath=gO;function yO(r,e){return r.serialize(e).split("#")[0]+"#"}Lr._getFullPath=yO;var tU=/#\/?$/;function Fl(r){return r?r.replace(tU,""):""}Lr.normalizeId=Fl;function rU(r,e,t){return t=Fl(t),r.resolve(e,t)}Lr.resolveUrl=rU;var nU=/^[a-z_][-a-z0-9._]*$/i;function iU(r,e){if(typeof r=="boolean")return{};let{schemaId:t,uriResolver:n}=this.opts,i=Fl(r[t]||e),s={"":i},a=gO(n,i,!1),l={},f=new Set;return Q2(r,{allKeys:!0},(g,y,S,_)=>{if(_===void 0)return;let R=a+y,I=s[_];typeof g[t]=="string"&&(I=q.call(this,g[t])),j.call(this,g.$anchor),j.call(this,g.$dynamicAnchor),s[y]=I;function q(B){let V=this.opts.uriResolver.resolve;if(B=Fl(I?V(I,B):B),f.has(B))throw h(B);f.add(B);let W=this.refs[B];return typeof W=="string"&&(W=this.refs[W]),typeof W=="object"?d(g,W.schema,B):B!==Fl(R)&&(B[0]==="#"?(d(g,l[B],B),l[B]=g):this.refs[B]=R),B}function j(B){if(typeof B=="string"){if(!nU.test(B))throw new Error(`invalid anchor "${B}"`);q.call(this,`#${B}`)}}}),l;function d(g,y,S){if(y!==void 0&&!K2(g,y))throw h(S)}function h(g){return new Error(`reference "${g}" resolves to more than one schema`)}}Lr.getSchemaRefs=iU});var Zc=F(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.getData=Ws.KeywordCxt=Ws.validateFunctionCode=void 0;var _O=QE(),vO=Gc(),vS=lS(),Rh=Gc(),sU=iO(),Qc=uO(),yS=fO(),de=Ne(),Se=es(),oU=Yc(),ts=We(),Kc=Jc();function aU(r){if(xO(r)&&(EO(r),CO(r))){cU(r);return}RO(r,()=>(0,_O.topBoolOrEmptySchema)(r))}Ws.validateFunctionCode=aU;function RO({gen:r,validateName:e,schema:t,schemaEnv:n,opts:i},s){i.code.es5?r.func(e,(0,de._)`${Se.default.data}, ${Se.default.valCxt}`,n.$async,()=>{r.code((0,de._)`"use strict"; ${bO(t,i)}`),uU(r,i),r.code(s)}):r.func(e,(0,de._)`${Se.default.data}, ${lU(i)}`,n.$async,()=>r.code(bO(t,i)).code(s))}function lU(r){return(0,de._)`{${Se.default.instancePath}="", ${Se.default.parentData}, ${Se.default.parentDataProperty}, ${Se.default.rootData}=${Se.default.data}${r.dynamicRef?(0,de._)`, ${Se.default.dynamicAnchors}={}`:de.nil}}={}`}function uU(r,e){r.if(Se.default.valCxt,()=>{r.var(Se.default.instancePath,(0,de._)`${Se.default.valCxt}.${Se.default.instancePath}`),r.var(Se.default.parentData,(0,de._)`${Se.default.valCxt}.${Se.default.parentData}`),r.var(Se.default.parentDataProperty,(0,de._)`${Se.default.valCxt}.${Se.default.parentDataProperty}`),r.var(Se.default.rootData,(0,de._)`${Se.default.valCxt}.${Se.default.rootData}`),e.dynamicRef&&r.var(Se.default.dynamicAnchors,(0,de._)`${Se.default.valCxt}.${Se.default.dynamicAnchors}`)},()=>{r.var(Se.default.instancePath,(0,de._)`""`),r.var(Se.default.parentData,(0,de._)`undefined`),r.var(Se.default.parentDataProperty,(0,de._)`undefined`),r.var(Se.default.rootData,Se.default.data),e.dynamicRef&&r.var(Se.default.dynamicAnchors,(0,de._)`{}`)})}function cU(r){let{schema:e,opts:t,gen:n}=r;RO(r,()=>{t.$comment&&e.$comment&&IO(r),mU(r),n.let(Se.default.vErrors,null),n.let(Se.default.errors,0),t.unevaluated&&fU(r),OO(r),vU(r)})}function fU(r){let{gen:e,validateName:t}=r;r.evaluated=e.const("evaluated",(0,de._)`${t}.evaluated`),e.if((0,de._)`${r.evaluated}.dynamicProps`,()=>e.assign((0,de._)`${r.evaluated}.props`,(0,de._)`undefined`)),e.if((0,de._)`${r.evaluated}.dynamicItems`,()=>e.assign((0,de._)`${r.evaluated}.items`,(0,de._)`undefined`))}function bO(r,e){let t=typeof r=="object"&&r[e.schemaId];return t&&(e.code.source||e.code.process)?(0,de._)`/*# sourceURL=${t} */`:de.nil}function dU(r,e){if(xO(r)&&(EO(r),CO(r))){pU(r,e);return}(0,_O.boolOrEmptySchema)(r,e)}function CO({schema:r,self:e}){if(typeof r=="boolean")return!r;for(let t in r)if(e.RULES.all[t])return!0;return!1}function xO(r){return typeof r.schema!="boolean"}function pU(r,e){let{schema:t,gen:n,opts:i}=r;i.$comment&&t.$comment&&IO(r),gU(r),yU(r);let s=n.const("_errs",Se.default.errors);OO(r,s),n.var(e,(0,de._)`${s} === ${Se.default.errors}`)}function EO(r){(0,ts.checkUnknownRules)(r),hU(r)}function OO(r,e){if(r.opts.jtd)return SO(r,[],!1,e);let t=(0,vO.getSchemaTypes)(r.schema),n=(0,vO.coerceAndCheckDataType)(r,t);SO(r,t,!n,e)}function hU(r){let{schema:e,errSchemaPath:t,opts:n,self:i}=r;e.$ref&&n.ignoreKeywordsWithRef&&(0,ts.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function mU(r){let{schema:e,opts:t}=r;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,ts.checkStrictMode)(r,"default is ignored in the schema root")}function gU(r){let e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,oU.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function yU(r){if(r.schema.$async&&!r.schemaEnv.$async)throw new Error("async schema in sync schema")}function IO({gen:r,schemaEnv:e,schema:t,errSchemaPath:n,opts:i}){let s=t.$comment;if(i.$comment===!0)r.code((0,de._)`${Se.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,de.str)`${n}/$comment`,l=r.scopeValue("root",{ref:e.root});r.code((0,de._)`${Se.default.self}.opts.$comment(${s}, ${a}, ${l}.schema)`)}}function vU(r){let{gen:e,schemaEnv:t,validateName:n,ValidationError:i,opts:s}=r;t.$async?e.if((0,de._)`${Se.default.errors} === 0`,()=>e.return(Se.default.data),()=>e.throw((0,de._)`new ${i}(${Se.default.vErrors})`)):(e.assign((0,de._)`${n}.errors`,Se.default.vErrors),s.unevaluated&&bU(r),e.return((0,de._)`${Se.default.errors} === 0`))}function bU({gen:r,evaluated:e,props:t,items:n}){t instanceof de.Name&&r.assign((0,de._)`${e}.props`,t),n instanceof de.Name&&r.assign((0,de._)`${e}.items`,n)}function SO(r,e,t,n){let{gen:i,schema:s,data:a,allErrors:l,opts:f,self:d}=r,{RULES:h}=d;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,ts.schemaHasRulesButRef)(s,h))){i.block(()=>kO(r,"$ref",h.all.$ref.definition));return}f.jtd||SU(r,e),i.block(()=>{for(let y of h.rules)g(y);g(h.post)});function g(y){(0,vS.shouldUseGroup)(s,y)&&(y.type?(i.if((0,Rh.checkDataType)(y.type,a,f.strictNumbers)),wO(r,y),e.length===1&&e[0]===y.type&&t&&(i.else(),(0,Rh.reportTypeError)(r)),i.endIf()):wO(r,y),l||i.if((0,de._)`${Se.default.errors} === ${n||0}`))}}function wO(r,e){let{gen:t,schema:n,opts:{useDefaults:i}}=r;i&&(0,sU.assignDefaults)(r,e.type),t.block(()=>{for(let s of e.rules)(0,vS.shouldUseRule)(n,s)&&kO(r,s.keyword,s.definition,e.type)})}function SU(r,e){r.schemaEnv.meta||!r.opts.strictTypes||(wU(r,e),r.opts.allowUnionTypes||_U(r,e),RU(r,r.dataTypes))}function wU(r,e){if(e.length){if(!r.dataTypes.length){r.dataTypes=e;return}e.forEach(t=>{PO(r.dataTypes,t)||bS(r,`type "${t}" not allowed by context "${r.dataTypes.join(",")}"`)}),xU(r,e)}}function _U(r,e){e.length>1&&!(e.length===2&&e.includes("null"))&&bS(r,"use allowUnionTypes to allow union type keyword")}function RU(r,e){let t=r.self.RULES.all;for(let n in t){let i=t[n];if(typeof i=="object"&&(0,vS.shouldUseRule)(r.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>CU(e,a))&&bS(r,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function CU(r,e){return r.includes(e)||e==="number"&&r.includes("integer")}function PO(r,e){return r.includes(e)||e==="integer"&&r.includes("number")}function xU(r,e){let t=[];for(let n of r.dataTypes)PO(e,n)?t.push(n):e.includes("integer")&&n==="number"&&t.push("integer");r.dataTypes=t}function bS(r,e){let t=r.schemaEnv.baseId+r.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,ts.checkStrictMode)(r,e,r.opts.strictTypes)}var Ch=class{constructor(e,t,n){if((0,Qc.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ts.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",TO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Qc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Se.default.errors))}result(e,t,n){this.failResult((0,de.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,de.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,de._)`${t} !== undefined && (${(0,de.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?Kc.reportExtraError:Kc.reportError)(this,this.def.error,t)}$dataError(){(0,Kc.reportError)(this,this.def.$dataError||Kc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Kc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=de.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=de.nil,t=de.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,de.or)((0,de._)`${i} === undefined`,t)),e!==de.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==de.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:i,it:s}=this;return(0,de.or)(a(),l());function a(){if(n.length){if(!(t instanceof de.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,de._)`${(0,Rh.checkDataTypes)(f,t,s.opts.strictNumbers,Rh.DataType.Wrong)}`}return de.nil}function l(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,de._)`!${f}(${t})`}return de.nil}}subschema(e,t){let n=(0,yS.getSubschema)(this.it,e);(0,yS.extendSubschemaData)(n,this.it,e),(0,yS.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return dU(i,t),i}mergeEvaluated(e,t){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=ts.mergeEvaluated.props(i,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=ts.mergeEvaluated.items(i,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(t,()=>this.mergeEvaluated(e,de.Name)),!0}};Ws.KeywordCxt=Ch;function kO(r,e,t,n){let i=new Ch(r,t,e);"code"in t?t.code(i,n):i.$data&&t.validate?(0,Qc.funcKeywordCode)(i,t):"macro"in t?(0,Qc.macroKeywordCode)(i,t):(t.compile||t.validate)&&(0,Qc.funcKeywordCode)(i,t)}var EU=/^\/(?:[^~]|~0|~1)*$/,OU=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function TO(r,{dataLevel:e,dataNames:t,dataPathArr:n}){let i,s;if(r==="")return Se.default.rootData;if(r[0]==="/"){if(!EU.test(r))throw new Error(`Invalid JSON-pointer: ${r}`);i=r,s=Se.default.rootData}else{let d=OU.exec(r);if(!d)throw new Error(`Invalid JSON-pointer: ${r}`);let h=+d[1];if(i=d[2],i==="#"){if(h>=e)throw new Error(f("property/index",h));return n[e-h]}if(h>e)throw new Error(f("data",h));if(s=t[e-h],!i)return s}let a=s,l=i.split("/");for(let d of l)d&&(s=(0,de._)`${s}${(0,de.getProperty)((0,ts.unescapeJsonPointer)(d))}`,a=(0,de._)`${a} && ${s}`);return a;function f(d,h){return`Cannot access ${d} ${h} levels up, current level is ${e}`}}Ws.getData=TO});var xh=F(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});var SS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};wS.default=SS});var Xc=F(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var _S=Yc(),RS=class extends Error{constructor(e,t,n,i){super(i||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,_S.resolveUrl)(e,t,n),this.missingSchema=(0,_S.normalizeId)((0,_S.getFullPath)(e,this.missingRef))}};CS.default=RS});var Oh=F(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.resolveSchema=Rn.getCompilingSchema=Rn.resolveRef=Rn.compileSchema=Rn.SchemaEnv=void 0;var Jn=Ne(),IU=xh(),oa=es(),Gn=Yc(),qO=We(),PU=Zc(),Ll=class{constructor(e){var t;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,Gn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Rn.SchemaEnv=Ll;function ES(r){let e=AO.call(this,r);if(e)return e;let t=(0,Gn.getFullPath)(this.opts.uriResolver,r.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Jn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;r.$async&&(l=a.scopeValue("Error",{ref:IU.default,code:(0,Jn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");r.validateName=f;let d={gen:a,allErrors:this.opts.allErrors,data:oa.default.data,parentData:oa.default.parentData,parentDataProperty:oa.default.parentDataProperty,dataNames:[oa.default.data],dataPathArr:[Jn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:r.schema,code:(0,Jn.stringify)(r.schema)}:{ref:r.schema}),validateName:f,ValidationError:l,schema:r.schema,schemaEnv:r,rootId:t,baseId:r.baseId||t,schemaPath:Jn.nil,errSchemaPath:r.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Jn._)`""`,opts:this.opts,self:this},h;try{this._compilations.add(r),(0,PU.validateFunctionCode)(d),a.optimize(this.opts.code.optimize);let g=a.toString();h=`${a.scopeRefs(oa.default.scope)}return ${g}`,this.opts.code.process&&(h=this.opts.code.process(h,r));let S=new Function(`${oa.default.self}`,`${oa.default.scope}`,h)(this,this.scope.get());if(this.scope.value(f,{ref:S}),S.errors=null,S.schema=r.schema,S.schemaEnv=r,r.$async&&(S.$async=!0),this.opts.code.source===!0&&(S.source={validateName:f,validateCode:g,scopeValues:a._values}),this.opts.unevaluated){let{props:_,items:R}=d;S.evaluated={props:_ instanceof Jn.Name?void 0:_,items:R instanceof Jn.Name?void 0:R,dynamicProps:_ instanceof Jn.Name,dynamicItems:R instanceof Jn.Name},S.source&&(S.source.evaluated=(0,Jn.stringify)(S.evaluated))}return r.validate=S,r}catch(g){throw delete r.validate,delete r.validateName,h&&this.logger.error("Error compiling schema, function code:",h),g}finally{this._compilations.delete(r)}}Rn.compileSchema=ES;function kU(r,e,t){var n;t=(0,Gn.resolveUrl)(this.opts.uriResolver,e,t);let i=r.refs[t];if(i)return i;let s=AU.call(this,r,t);if(s===void 0){let a=(n=r.localRefs)===null||n===void 0?void 0:n[t],{schemaId:l}=this.opts;a&&(s=new Ll({schema:a,schemaId:l,root:r,baseId:e}))}if(s!==void 0)return r.refs[t]=TU.call(this,s)}Rn.resolveRef=kU;function TU(r){return(0,Gn.inlineRef)(r.schema,this.opts.inlineRefs)?r.schema:r.validate?r:ES.call(this,r)}function AO(r){for(let e of this._compilations)if(qU(e,r))return e}Rn.getCompilingSchema=AO;function qU(r,e){return r.schema===e.schema&&r.root===e.root&&r.baseId===e.baseId}function AU(r,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||Eh.call(this,r,e)}function Eh(r,e){let t=this.opts.uriResolver.parse(e),n=(0,Gn._getFullPath)(this.opts.uriResolver,t),i=(0,Gn.getFullPath)(this.opts.uriResolver,r.baseId,void 0);if(Object.keys(r.schema).length>0&&n===i)return xS.call(this,t,r);let s=(0,Gn.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let l=Eh.call(this,r,a);return typeof l?.schema!="object"?void 0:xS.call(this,t,l)}if(typeof a?.schema=="object"){if(a.validate||ES.call(this,a),s===(0,Gn.normalizeId)(e)){let{schema:l}=a,{schemaId:f}=this.opts,d=l[f];return d&&(i=(0,Gn.resolveUrl)(this.opts.uriResolver,i,d)),new Ll({schema:l,schemaId:f,root:r,baseId:i})}return xS.call(this,t,a)}}Rn.resolveSchema=Eh;var $U=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function xS(r,{baseId:e,schema:t,root:n}){var i;if(((i=r.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let l of r.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let f=t[(0,qO.unescapeFragment)(l)];if(f===void 0)return;t=f;let d=typeof t=="object"&&t[this.opts.schemaId];!$U.has(l)&&d&&(e=(0,Gn.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof t!="boolean"&&t.$ref&&!(0,qO.schemaHasRulesButRef)(t,this.RULES)){let l=(0,Gn.resolveUrl)(this.opts.uriResolver,e,t.$ref);s=Eh.call(this,n,l)}let{schemaId:a}=this.opts;if(s=s||new Ll({schema:t,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var $O=F((x7,MU)=>{MU.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var PS=F((E7,jO)=>{"use strict";var NU=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),NO=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),OS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),DO=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),DU=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function IS(r){let e="",t=0,n=0;for(n=0;n<r.length;n++)if(t=r[n].charCodeAt(0),t!==48){if(!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[n];break}for(n+=1;n<r.length;n++){if(t=r[n].charCodeAt(0),!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[n]}return e}var FU=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function MO(r){return r.length=0,!0}function LU(r,e,t){if(r.length){let n=IS(r);if(n!=="")e.push(n);else return t.error=!0,!1;r.length=0}return!0}function jU(r){let e=0,t={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,l=LU;for(let f=0;f<r.length;f++){let d=r[f];if(!(d==="["||d==="]"))if(d===":"){if(s===!0&&(a=!0),!l(i,n,t))break;if(++e>7){t.error=!0;break}f>0&&r[f-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(i,n,t))break;l=MO}else{i.push(d);continue}}return i.length&&(l===MO?t.zone=i.join(""):a?n.push(i.join("")):n.push(IS(i))),t.address=n.join(""),t}function FO(r){if(UU(r,":")<2)return{host:r,isIPV6:!1};let e=jU(r);if(e.error)return{host:r,isIPV6:!1};{let t=e.address,n=e.address;return e.zone&&(t+="%"+e.zone,n+="%25"+e.zone),{host:t,isIPV6:!0,escapedHost:n}}}function UU(r,e){let t=0;for(let n=0;n<r.length;n++)r[n]===e&&t++;return t}function HU(r){let e=r,t=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){t.push("/");break}else{t.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){t.push("/");break}}else if(i===3&&e==="/.."){t.length!==0&&t.pop(),t.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),t.length!==0&&t.pop();continue}}if((n=e.indexOf("/",1))===-1){t.push(e);break}else t.push(e.slice(0,n)),e=e.slice(n)}return t.join("")}var BU={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},VU=/[@/?#:]/g,WU=/[@/?#]/g;function LO(r,e){let t=e?WU:VU;return t.lastIndex=0,r.replace(t,n=>BU[n])}function zU(r,e=!1){if(r.indexOf("%")===-1)return r;let t="";for(let n=0;n<r.length;n++){if(r[n]==="%"&&n+2<r.length){let i=r.slice(n+1,n+3);if(OS(i)){let s=i.toUpperCase(),a=String.fromCharCode(parseInt(s,16));e&&DO(a)?t+=a:t+="%"+s,n+=2;continue}}t+=r[n]}return t}function JU(r){let e="";for(let t=0;t<r.length;t++){if(r[t]==="%"&&t+2<r.length){let n=r.slice(t+1,t+3);if(OS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&DO(s)?e+=s:e+="%"+i,t+=2;continue}}DU(r[t])?e+=r[t]:e+=escape(r[t])}return e}function GU(r){let e="";for(let t=0;t<r.length;t++){if(r[t]==="%"&&t+2<r.length){let n=r.slice(t+1,t+3);if(OS(n)){e+="%"+n.toUpperCase(),t+=2;continue}}e+=escape(r[t])}return e}function YU(r){let e=[];if(r.userinfo!==void 0&&(e.push(r.userinfo),e.push("@")),r.host!==void 0){let t=unescape(r.host);if(!NO(t)){let n=FO(t);n.isIPV6===!0?t=`[${n.escapedHost}]`:t=LO(t,!1)}e.push(t)}return(typeof r.port=="number"||typeof r.port=="string")&&(e.push(":"),e.push(String(r.port))),e.length?e.join(""):void 0}jO.exports={nonSimpleDomain:FU,recomposeAuthority:YU,reescapeHostDelimiters:LO,normalizePercentEncoding:zU,normalizePathEncoding:JU,escapePreservingEscapes:GU,removeDotSegments:HU,isIPv4:NO,isUUID:NU,normalizeIPv6:FO,stringArrayToHexStripped:IS}});var WO=F((O7,VO)=>{"use strict";var{isUUID:KU}=PS(),QU=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,ZU=["http","https","ws","wss","urn","urn:uuid"];function XU(r){return ZU.indexOf(r)!==-1}function kS(r){return r.secure===!0?!0:r.secure===!1?!1:r.scheme?r.scheme.length===3&&(r.scheme[0]==="w"||r.scheme[0]==="W")&&(r.scheme[1]==="s"||r.scheme[1]==="S")&&(r.scheme[2]==="s"||r.scheme[2]==="S"):!1}function UO(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function HO(r){let e=String(r.scheme).toLowerCase()==="https";return(r.port===(e?443:80)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}function eH(r){return r.secure=kS(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function tH(r){if((r.port===(kS(r)?443:80)||r.port==="")&&(r.port=void 0),typeof r.secure=="boolean"&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){let[e,t]=r.resourceName.split("?");r.path=e&&e!=="/"?e:void 0,r.query=t,r.resourceName=void 0}return r.fragment=void 0,r}function rH(r,e){if(!r.path)return r.error="URN can not be parsed",r;let t=r.path.match(QU);if(t){let n=e.scheme||r.scheme||"urn";r.nid=t[1].toLowerCase(),r.nss=t[2];let i=`${n}:${e.nid||r.nid}`,s=TS(i);r.path=void 0,s&&(r=s.parse(r,e))}else r.error=r.error||"URN can not be parsed.";return r}function nH(r,e){if(r.nid===void 0)throw new Error("URN without nid cannot be serialized");let t=e.scheme||r.scheme||"urn",n=r.nid.toLowerCase(),i=`${t}:${e.nid||n}`,s=TS(i);s&&(r=s.serialize(r,e));let a=r,l=r.nss;return a.path=`${n||e.nid}:${l}`,e.skipEscape=!0,a}function iH(r,e){let t=r;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!KU(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function sH(r){let e=r;return e.nss=(r.uuid||"").toLowerCase(),e}var BO={scheme:"http",domainHost:!0,parse:UO,serialize:HO},oH={scheme:"https",domainHost:BO.domainHost,parse:UO,serialize:HO},Ih={scheme:"ws",domainHost:!0,parse:eH,serialize:tH},aH={scheme:"wss",domainHost:Ih.domainHost,parse:Ih.parse,serialize:Ih.serialize},lH={scheme:"urn",parse:rH,serialize:nH,skipNormalize:!0},uH={scheme:"urn:uuid",parse:iH,serialize:sH,skipNormalize:!0},Ph={http:BO,https:oH,ws:Ih,wss:aH,urn:lH,"urn:uuid":uH};Object.setPrototypeOf(Ph,null);function TS(r){return r&&(Ph[r]||Ph[r.toLowerCase()])||void 0}VO.exports={wsIsSecure:kS,SCHEMES:Ph,isValidSchemeName:XU,getSchemeHandler:TS}});var QO=F((I7,kh)=>{"use strict";var{normalizeIPv6:cH,removeDotSegments:ef,recomposeAuthority:fH,normalizePercentEncoding:dH,normalizePathEncoding:pH,escapePreservingEscapes:hH,reescapeHostDelimiters:mH,isIPv4:gH,nonSimpleDomain:yH}=PS(),{SCHEMES:vH,getSchemeHandler:JO}=WO();function bH(r,e){return typeof r=="string"?r=CH(r,e):typeof r=="object"&&(r=jl(aa(r,e),e)),r}function SH(r,e,t){let n=t?Object.assign({scheme:"null"},t):{scheme:"null"},i=GO(jl(r,n),jl(e,n),n,!0);return n.skipEscape=!0,aa(i,n)}function GO(r,e,t,n){let i={};return n||(r=jl(aa(r,t),t),e=jl(aa(e,t),t)),t=t||{},!t.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=ef(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=ef(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=ef(e.path):((r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&!r.path?i.path="/"+e.path:r.path?i.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=ef(i.path)),i.query=e.query):(i.path=r.path,e.query!==void 0?i.query=e.query:i.query=r.query),i.userinfo=r.userinfo,i.host=r.host,i.port=r.port),i.scheme=r.scheme),i.fragment=e.fragment,i}function wH(r,e,t){let n=zO(r,t),i=zO(e,t);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function aa(r,e){let t={host:r.host,scheme:r.scheme,userinfo:r.userinfo,port:r.port,path:r.path,query:r.query,nid:r.nid,nss:r.nss,uuid:r.uuid,fragment:r.fragment,reference:r.reference,resourceName:r.resourceName,secure:r.secure,error:""},n=Object.assign({},e),i=[],s=JO(n.scheme||t.scheme);s&&s.serialize&&s.serialize(t,n),t.path!==void 0&&(n.skipEscape?t.path=dH(t.path):(t.path=hH(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),n.reference!=="suffix"&&t.scheme&&i.push(t.scheme,":");let a=fH(t);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),t.path&&t.path[0]!=="/"&&i.push("/")),t.path!==void 0){let l=t.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=ef(l)),a===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),i.push(l)}return t.query!==void 0&&i.push("?",t.query),t.fragment!==void 0&&i.push("#",t.fragment),i.join("")}var _H=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function RH(r,e){if(e[2]!==void 0&&r.path&&r.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof r.port=="number"&&(r.port<0||r.port>65535))return"URI port is malformed."}function YO(r,e){let t=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,s=!1;t.reference==="suffix"&&(t.scheme?r=t.scheme+":"+r:r="//"+r);let a=r.match(_H);if(a){n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]);let l=RH(n,a);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(gH(n.host)===!1){let h=cH(n.host);n.host=h.host.toLowerCase(),s=h.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");let f=JO(t.scheme||n.scheme);if(!t.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(t.domainHost||f&&f.domainHost)&&s===!1&&yH(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!f||f&&!f.skipNormalize)&&(r.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=mH(unescape(n.host),s))),n.path&&(n.path=pH(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}f&&f.parse&&f.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function jl(r,e){return YO(r,e).parsed}function CH(r,e){return KO(r,e).normalized}function KO(r,e){let{parsed:t,malformedAuthorityOrPort:n}=YO(r,e);return{normalized:n?r:aa(t,e),malformedAuthorityOrPort:n}}function zO(r,e){if(typeof r=="string"){let{normalized:t,malformedAuthorityOrPort:n}=KO(r,e);return n?void 0:t}if(typeof r=="object")return aa(r,e)}var qS={SCHEMES:vH,normalize:bH,resolve:SH,resolveComponent:GO,equal:wH,serialize:aa,parse:jl};kh.exports=qS;kh.exports.default=qS;kh.exports.fastUri=qS});var XO=F(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});var ZO=QO();ZO.code='require("ajv/dist/runtime/uri").default';AS.default=ZO});var aI=F(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.CodeGen=tr.Name=tr.nil=tr.stringify=tr.str=tr._=tr.KeywordCxt=void 0;var xH=Zc();Object.defineProperty(tr,"KeywordCxt",{enumerable:!0,get:function(){return xH.KeywordCxt}});var Ul=Ne();Object.defineProperty(tr,"_",{enumerable:!0,get:function(){return Ul._}});Object.defineProperty(tr,"str",{enumerable:!0,get:function(){return Ul.str}});Object.defineProperty(tr,"stringify",{enumerable:!0,get:function(){return Ul.stringify}});Object.defineProperty(tr,"nil",{enumerable:!0,get:function(){return Ul.nil}});Object.defineProperty(tr,"Name",{enumerable:!0,get:function(){return Ul.Name}});Object.defineProperty(tr,"CodeGen",{enumerable:!0,get:function(){return Ul.CodeGen}});var EH=xh(),iI=Xc(),OH=aS(),tf=Oh(),IH=Ne(),rf=Yc(),Th=Gc(),MS=We(),eI=$O(),PH=XO(),sI=(r,e)=>new RegExp(r,e);sI.code="new RegExp";var kH=["removeAdditional","useDefaults","coerceTypes"],TH=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),qH={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},AH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},tI=200;function $H(r){var e,t,n,i,s,a,l,f,d,h,g,y,S,_,R,I,q,j,B,V,W,X,T,C,k;let N=r.strict,U=(e=r.code)===null||e===void 0?void 0:e.optimize,$=U===!0||U===void 0?1:U||0,G=(n=(t=r.code)===null||t===void 0?void 0:t.regExp)!==null&&n!==void 0?n:sI,K=(i=r.uriResolver)!==null&&i!==void 0?i:PH.default;return{strictSchema:(a=(s=r.strictSchema)!==null&&s!==void 0?s:N)!==null&&a!==void 0?a:!0,strictNumbers:(f=(l=r.strictNumbers)!==null&&l!==void 0?l:N)!==null&&f!==void 0?f:!0,strictTypes:(h=(d=r.strictTypes)!==null&&d!==void 0?d:N)!==null&&h!==void 0?h:"log",strictTuples:(y=(g=r.strictTuples)!==null&&g!==void 0?g:N)!==null&&y!==void 0?y:"log",strictRequired:(_=(S=r.strictRequired)!==null&&S!==void 0?S:N)!==null&&_!==void 0?_:!1,code:r.code?{...r.code,optimize:$,regExp:G}:{optimize:$,regExp:G},loopRequired:(R=r.loopRequired)!==null&&R!==void 0?R:tI,loopEnum:(I=r.loopEnum)!==null&&I!==void 0?I:tI,meta:(q=r.meta)!==null&&q!==void 0?q:!0,messages:(j=r.messages)!==null&&j!==void 0?j:!0,inlineRefs:(B=r.inlineRefs)!==null&&B!==void 0?B:!0,schemaId:(V=r.schemaId)!==null&&V!==void 0?V:"$id",addUsedSchema:(W=r.addUsedSchema)!==null&&W!==void 0?W:!0,validateSchema:(X=r.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(T=r.validateFormats)!==null&&T!==void 0?T:!0,unicodeRegExp:(C=r.unicodeRegExp)!==null&&C!==void 0?C:!0,int32range:(k=r.int32range)!==null&&k!==void 0?k:!0,uriResolver:K}}var nf=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...$H(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new IH.ValueScope({scope:{},prefixes:TH,es5:t,lines:n}),this.logger=jH(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,OH.getRules)(),rI.call(this,qH,e,"NOT SUPPORTED"),rI.call(this,AH,e,"DEPRECATED","warn"),this._metaOpts=FH.call(this),e.formats&&NH.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&DH.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),MH.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,i=eI;n==="id"&&(i={...eI},i.id=i.$id,delete i.$id),t&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(t);return"$async"in n||(this.errors=n.errors),i}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,t);async function i(h,g){await s.call(this,h.$schema);let y=this._addSchema(h,g);return y.validate||a.call(this,y)}async function s(h){h&&!this.getSchema(h)&&await i.call(this,{$ref:h},!0)}async function a(h){try{return this._compileSchemaEnv(h)}catch(g){if(!(g instanceof iI.default))throw g;return l.call(this,g),await f.call(this,g.missingSchema),a.call(this,h)}}function l({missingSchema:h,missingRef:g}){if(this.refs[h])throw new Error(`AnySchema ${h} is loaded but ${g} cannot be resolved`)}async function f(h){let g=await d.call(this,h);this.refs[h]||await s.call(this,g.$schema),this.refs[h]||this.addSchema(g,h,t)}async function d(h){let g=this._loading[h];if(g)return g;try{return await(this._loading[h]=n(h))}finally{delete this._loading[h]}}}addSchema(e,t,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return t=(0,rf.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,i,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&t){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let t;for(;typeof(t=nI.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:n}=this.opts,i=new tf.SchemaEnv({schema:{},schemaId:n});if(t=tf.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=nI.call(this,e);return typeof t=="object"&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,rf.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e=="string")n=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else if(typeof e=="object"&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(HH.call(this,n,t),!t)return(0,MS.eachItem)(n,s=>$S.call(this,s)),this;VH.call(this,t);let i={...t,type:(0,Th.getJSONTypes)(t.type),schemaType:(0,Th.getJSONTypes)(t.schemaType)};return(0,MS.eachItem)(n,i.type.length===0?s=>$S.call(this,s,i):s=>i.type.forEach(a=>$S.call(this,s,i,a))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,t){return typeof t=="string"&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+t+s)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of t){let s=i.split("/").slice(1),a=e;for(let l of s)a=a[l];for(let l in n){let f=n[l];if(typeof f!="object")continue;let{$data:d}=f.definition,h=a[l];d&&h&&(a[l]=oI(h))}}return e}_removeAllSchemas(e,t){for(let n in e){let i=e[n];(!t||t.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,t,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:l}=this.opts;if(typeof e=="object")a=e[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let f=this._cache.get(e);if(f!==void 0)return f;n=(0,rf.normalizeId)(a||n);let d=rf.getSchemaRefs.call(this,e,n);return f=new tf.SchemaEnv({schema:e,schemaId:l,meta:t,baseId:n,localRefs:d}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),i&&this.validateSchema(e,!0),f}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):tf.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{tf.compileSchema.call(this,e)}finally{this.opts=t}}};nf.ValidationError=EH.default;nf.MissingRefError=iI.default;tr.default=nf;function rI(r,e,t,n="error"){for(let i in r){let s=i;s in e&&this.logger[n](`${t}: option ${i}. ${r[s]}`)}}function nI(r){return r=(0,rf.normalizeId)(r),this.schemas[r]||this.refs[r]}function MH(){let r=this.opts.schemas;if(r)if(Array.isArray(r))this.addSchema(r);else for(let e in r)this.addSchema(r[e],e)}function NH(){for(let r in this.opts.formats){let e=this.opts.formats[r];e&&this.addFormat(r,e)}}function DH(r){if(Array.isArray(r)){this.addVocabulary(r);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in r){let t=r[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function FH(){let r={...this.opts};for(let e of kH)delete r[e];return r}var LH={log(){},warn(){},error(){}};function jH(r){if(r===!1)return LH;if(r===void 0)return console;if(r.log&&r.warn&&r.error)return r;throw new Error("logger must implement log, warn and error methods")}var UH=/^[a-z_$][a-z0-9_$:-]*$/i;function HH(r,e){let{RULES:t}=this;if((0,MS.eachItem)(r,n=>{if(t.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!UH.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function $S(r,e,t){var n;let i=e?.post;if(t&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:f})=>f===t);if(a||(a={type:t,rules:[]},s.rules.push(a)),s.keywords[r]=!0,!e)return;let l={keyword:r,definition:{...e,type:(0,Th.getJSONTypes)(e.type),schemaType:(0,Th.getJSONTypes)(e.schemaType)}};e.before?BH.call(this,a,l,e.before):a.rules.push(l),s.all[r]=l,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function BH(r,e,t){let n=r.rules.findIndex(i=>i.keyword===t);n>=0?r.rules.splice(n,0,e):(r.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function VH(r){let{metaSchema:e}=r;e!==void 0&&(r.$data&&this.opts.$data&&(e=oI(e)),r.validateSchema=this.compile(e,!0))}var WH={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function oI(r){return{anyOf:[r,WH]}}});var lI=F(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});var zH={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};NS.default=zH});var dI=F(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.callRef=la.getValidate=void 0;var JH=Xc(),uI=_n(),jr=Ne(),Hl=es(),cI=Oh(),qh=We(),GH={keyword:"$ref",schemaType:"string",code(r){let{gen:e,schema:t,it:n}=r,{baseId:i,schemaEnv:s,validateName:a,opts:l,self:f}=n,{root:d}=s;if((t==="#"||t==="#/")&&i===d.baseId)return g();let h=cI.resolveRef.call(f,d,i,t);if(h===void 0)throw new JH.default(n.opts.uriResolver,i,t);if(h instanceof cI.SchemaEnv)return y(h);return S(h);function g(){if(s===d)return Ah(r,a,s,s.$async);let _=e.scopeValue("root",{ref:d});return Ah(r,(0,jr._)`${_}.validate`,d,d.$async)}function y(_){let R=fI(r,_);Ah(r,R,_,_.$async)}function S(_){let R=e.scopeValue("schema",l.code.source===!0?{ref:_,code:(0,jr.stringify)(_)}:{ref:_}),I=e.name("valid"),q=r.subschema({schema:_,dataTypes:[],schemaPath:jr.nil,topSchemaRef:R,errSchemaPath:t},I);r.mergeEvaluated(q),r.ok(I)}}};function fI(r,e){let{gen:t}=r;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,jr._)`${t.scopeValue("wrapper",{ref:e})}.validate`}la.getValidate=fI;function Ah(r,e,t,n){let{gen:i,it:s}=r,{allErrors:a,schemaEnv:l,opts:f}=s,d=f.passContext?Hl.default.this:jr.nil;n?h():g();function h(){if(!l.$async)throw new Error("async schema referenced by sync schema");let _=i.let("valid");i.try(()=>{i.code((0,jr._)`await ${(0,uI.callValidateCode)(r,e,d)}`),S(e),a||i.assign(_,!0)},R=>{i.if((0,jr._)`!(${R} instanceof ${s.ValidationError})`,()=>i.throw(R)),y(R),a||i.assign(_,!1)}),r.ok(_)}function g(){r.result((0,uI.callValidateCode)(r,e,d),()=>S(e),()=>y(e))}function y(_){let R=(0,jr._)`${_}.errors`;i.assign(Hl.default.vErrors,(0,jr._)`${Hl.default.vErrors} === null ? ${R} : ${Hl.default.vErrors}.concat(${R})`),i.assign(Hl.default.errors,(0,jr._)`${Hl.default.vErrors}.length`)}function S(_){var R;if(!s.opts.unevaluated)return;let I=(R=t?.validate)===null||R===void 0?void 0:R.evaluated;if(s.props!==!0)if(I&&!I.dynamicProps)I.props!==void 0&&(s.props=qh.mergeEvaluated.props(i,I.props,s.props));else{let q=i.var("props",(0,jr._)`${_}.evaluated.props`);s.props=qh.mergeEvaluated.props(i,q,s.props,jr.Name)}if(s.items!==!0)if(I&&!I.dynamicItems)I.items!==void 0&&(s.items=qh.mergeEvaluated.items(i,I.items,s.items));else{let q=i.var("items",(0,jr._)`${_}.evaluated.items`);s.items=qh.mergeEvaluated.items(i,q,s.items,jr.Name)}}}la.callRef=Ah;la.default=GH});var pI=F(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var YH=lI(),KH=dI(),QH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",YH.default,KH.default];DS.default=QH});var hI=F(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});var $h=Ne(),zs=$h.operators,Mh={maximum:{okStr:"<=",ok:zs.LTE,fail:zs.GT},minimum:{okStr:">=",ok:zs.GTE,fail:zs.LT},exclusiveMaximum:{okStr:"<",ok:zs.LT,fail:zs.GTE},exclusiveMinimum:{okStr:">",ok:zs.GT,fail:zs.LTE}},ZH={message:({keyword:r,schemaCode:e})=>(0,$h.str)`must be ${Mh[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,$h._)`{comparison: ${Mh[r].okStr}, limit: ${e}}`},XH={keyword:Object.keys(Mh),type:"number",schemaType:"number",$data:!0,error:ZH,code(r){let{keyword:e,data:t,schemaCode:n}=r;r.fail$data((0,$h._)`${t} ${Mh[e].fail} ${n} || isNaN(${t})`)}};FS.default=XH});var mI=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var sf=Ne(),eB={message:({schemaCode:r})=>(0,sf.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,sf._)`{multipleOf: ${r}}`},tB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:eB,code(r){let{gen:e,data:t,schemaCode:n,it:i}=r,s=i.opts.multipleOfPrecision,a=e.let("res"),l=s?(0,sf._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,sf._)`${a} !== parseInt(${a})`;r.fail$data((0,sf._)`(${n} === 0 || (${a} = ${t}/${n}, ${l}))`)}};LS.default=tB});var yI=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});function gI(r){let e=r.length,t=0,n=0,i;for(;n<e;)t++,i=r.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=r.charCodeAt(n),(i&64512)===56320&&n++);return t}jS.default=gI;gI.code='require("ajv/dist/runtime/ucs2length").default'});var vI=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var ua=Ne(),rB=We(),nB=yI(),iB={message({keyword:r,schemaCode:e}){let t=r==="maxLength"?"more":"fewer";return(0,ua.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:r})=>(0,ua._)`{limit: ${r}}`},sB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:iB,code(r){let{keyword:e,data:t,schemaCode:n,it:i}=r,s=e==="maxLength"?ua.operators.GT:ua.operators.LT,a=i.opts.unicode===!1?(0,ua._)`${t}.length`:(0,ua._)`${(0,rB.useFunc)(r.gen,nB.default)}(${t})`;r.fail$data((0,ua._)`${a} ${s} ${n}`)}};US.default=sB});var bI=F(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});var oB=_n(),aB=We(),Bl=Ne(),lB={message:({schemaCode:r})=>(0,Bl.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,Bl._)`{pattern: ${r}}`},uB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:lB,code(r){let{gen:e,data:t,$data:n,schema:i,schemaCode:s,it:a}=r,l=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:f}=a.opts.code,d=f.code==="new RegExp"?(0,Bl._)`new RegExp`:(0,aB.useFunc)(e,f),h=e.let("valid");e.try(()=>e.assign(h,(0,Bl._)`${d}(${s}, ${l}).test(${t})`),()=>e.assign(h,!1)),r.fail$data((0,Bl._)`!${h}`)}else{let f=(0,oB.usePattern)(r,i);r.fail$data((0,Bl._)`!${f}.test(${t})`)}}};HS.default=uB});var SI=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var of=Ne(),cB={message({keyword:r,schemaCode:e}){let t=r==="maxProperties"?"more":"fewer";return(0,of.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:r})=>(0,of._)`{limit: ${r}}`},fB={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:cB,code(r){let{keyword:e,data:t,schemaCode:n}=r,i=e==="maxProperties"?of.operators.GT:of.operators.LT;r.fail$data((0,of._)`Object.keys(${t}).length ${i} ${n}`)}};BS.default=fB});var wI=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var af=_n(),lf=Ne(),dB=We(),pB={message:({params:{missingProperty:r}})=>(0,lf.str)`must have required property '${r}'`,params:({params:{missingProperty:r}})=>(0,lf._)`{missingProperty: ${r}}`},hB={keyword:"required",type:"object",schemaType:"array",$data:!0,error:pB,code(r){let{gen:e,schema:t,schemaCode:n,data:i,$data:s,it:a}=r,{opts:l}=a;if(!s&&t.length===0)return;let f=t.length>=l.loopRequired;if(a.allErrors?d():h(),l.strictRequired){let S=r.parentSchema.properties,{definedProperties:_}=r.it;for(let R of t)if(S?.[R]===void 0&&!_.has(R)){let I=a.schemaEnv.baseId+a.errSchemaPath,q=`required property "${R}" is not defined at "${I}" (strictRequired)`;(0,dB.checkStrictMode)(a,q,a.opts.strictRequired)}}function d(){if(f||s)r.block$data(lf.nil,g);else for(let S of t)(0,af.checkReportMissingProp)(r,S)}function h(){let S=e.let("missing");if(f||s){let _=e.let("valid",!0);r.block$data(_,()=>y(S,_)),r.ok(_)}else e.if((0,af.checkMissingProp)(r,t,S)),(0,af.reportMissingProp)(r,S),e.else()}function g(){e.forOf("prop",n,S=>{r.setParams({missingProperty:S}),e.if((0,af.noPropertyInData)(e,i,S,l.ownProperties),()=>r.error())})}function y(S,_){r.setParams({missingProperty:S}),e.forOf(S,n,()=>{e.assign(_,(0,af.propertyInData)(e,i,S,l.ownProperties)),e.if((0,lf.not)(_),()=>{r.error(),e.break()})},lf.nil)}}};VS.default=hB});var _I=F(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var uf=Ne(),mB={message({keyword:r,schemaCode:e}){let t=r==="maxItems"?"more":"fewer";return(0,uf.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:r})=>(0,uf._)`{limit: ${r}}`},gB={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:mB,code(r){let{keyword:e,data:t,schemaCode:n}=r,i=e==="maxItems"?uf.operators.GT:uf.operators.LT;r.fail$data((0,uf._)`${t}.length ${i} ${n}`)}};WS.default=gB});var Nh=F(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var RI=mS();RI.code='require("ajv/dist/runtime/equal").default';zS.default=RI});var CI=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var JS=Gc(),rr=Ne(),yB=We(),vB=Nh(),bB={message:({params:{i:r,j:e}})=>(0,rr.str)`must NOT have duplicate items (items ## ${e} and ${r} are identical)`,params:({params:{i:r,j:e}})=>(0,rr._)`{i: ${r}, j: ${e}}`},SB={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:bB,code(r){let{gen:e,data:t,$data:n,schema:i,parentSchema:s,schemaCode:a,it:l}=r;if(!n&&!i)return;let f=e.let("valid"),d=s.items?(0,JS.getSchemaTypes)(s.items):[];r.block$data(f,h,(0,rr._)`${a} === false`),r.ok(f);function h(){let _=e.let("i",(0,rr._)`${t}.length`),R=e.let("j");r.setParams({i:_,j:R}),e.assign(f,!0),e.if((0,rr._)`${_} > 1`,()=>(g()?y:S)(_,R))}function g(){return d.length>0&&!d.some(_=>_==="object"||_==="array")}function y(_,R){let I=e.name("item"),q=(0,JS.checkDataTypes)(d,I,l.opts.strictNumbers,JS.DataType.Wrong),j=e.const("indices",(0,rr._)`{}`);e.for((0,rr._)`;${_}--;`,()=>{e.let(I,(0,rr._)`${t}[${_}]`),e.if(q,(0,rr._)`continue`),d.length>1&&e.if((0,rr._)`typeof ${I} == "string"`,(0,rr._)`${I} += "_"`),e.if((0,rr._)`typeof ${j}[${I}] == "number"`,()=>{e.assign(R,(0,rr._)`${j}[${I}]`),r.error(),e.assign(f,!1).break()}).code((0,rr._)`${j}[${I}] = ${_}`)})}function S(_,R){let I=(0,yB.useFunc)(e,vB.default),q=e.name("outer");e.label(q).for((0,rr._)`;${_}--;`,()=>e.for((0,rr._)`${R} = ${_}; ${R}--;`,()=>e.if((0,rr._)`${I}(${t}[${_}], ${t}[${R}])`,()=>{r.error(),e.assign(f,!1).break(q)})))}}};GS.default=SB});var xI=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var YS=Ne(),wB=We(),_B=Nh(),RB={message:"must be equal to constant",params:({schemaCode:r})=>(0,YS._)`{allowedValue: ${r}}`},CB={keyword:"const",$data:!0,error:RB,code(r){let{gen:e,data:t,$data:n,schemaCode:i,schema:s}=r;n||s&&typeof s=="object"?r.fail$data((0,YS._)`!${(0,wB.useFunc)(e,_B.default)}(${t}, ${i})`):r.fail((0,YS._)`${s} !== ${t}`)}};KS.default=CB});var EI=F(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});var cf=Ne(),xB=We(),EB=Nh(),OB={message:"must be equal to one of the allowed values",params:({schemaCode:r})=>(0,cf._)`{allowedValues: ${r}}`},IB={keyword:"enum",schemaType:"array",$data:!0,error:OB,code(r){let{gen:e,data:t,$data:n,schema:i,schemaCode:s,it:a}=r;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let l=i.length>=a.opts.loopEnum,f,d=()=>f??(f=(0,xB.useFunc)(e,EB.default)),h;if(l||n)h=e.let("valid"),r.block$data(h,g);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let S=e.const("vSchema",s);h=(0,cf.or)(...i.map((_,R)=>y(S,R)))}r.pass(h);function g(){e.assign(h,!1),e.forOf("v",s,S=>e.if((0,cf._)`${d()}(${t}, ${S})`,()=>e.assign(h,!0).break()))}function y(S,_){let R=i[_];return typeof R=="object"&&R!==null?(0,cf._)`${d()}(${t}, ${S}[${_}])`:(0,cf._)`${t} === ${R}`}}};QS.default=IB});var OI=F(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0});var PB=hI(),kB=mI(),TB=vI(),qB=bI(),AB=SI(),$B=wI(),MB=_I(),NB=CI(),DB=xI(),FB=EI(),LB=[PB.default,kB.default,TB.default,qB.default,AB.default,$B.default,MB.default,NB.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},DB.default,FB.default];ZS.default=LB});var e0=F(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.validateAdditionalItems=void 0;var ca=Ne(),XS=We(),jB={message:({params:{len:r}})=>(0,ca.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,ca._)`{limit: ${r}}`},UB={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:jB,code(r){let{parentSchema:e,it:t}=r,{items:n}=e;if(!Array.isArray(n)){(0,XS.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}II(r,n)}};function II(r,e){let{gen:t,schema:n,data:i,keyword:s,it:a}=r;a.items=!0;let l=t.const("len",(0,ca._)`${i}.length`);if(n===!1)r.setParams({len:e.length}),r.pass((0,ca._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,XS.alwaysValidSchema)(a,n)){let d=t.var("valid",(0,ca._)`${l} <= ${e.length}`);t.if((0,ca.not)(d),()=>f(d)),r.ok(d)}function f(d){t.forRange("i",e.length,l,h=>{r.subschema({keyword:s,dataProp:h,dataPropType:XS.Type.Num},d),a.allErrors||t.if((0,ca.not)(d),()=>t.break())})}}ff.validateAdditionalItems=II;ff.default=UB});var t0=F(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.validateTuple=void 0;var PI=Ne(),Dh=We(),HB=_n(),BB={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(r){let{schema:e,it:t}=r;if(Array.isArray(e))return kI(r,"additionalItems",e);t.items=!0,!(0,Dh.alwaysValidSchema)(t,e)&&r.ok((0,HB.validateArray)(r))}};function kI(r,e,t=r.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:l}=r;h(i),l.opts.unevaluated&&t.length&&l.items!==!0&&(l.items=Dh.mergeEvaluated.items(n,t.length,l.items));let f=n.name("valid"),d=n.const("len",(0,PI._)`${s}.length`);t.forEach((g,y)=>{(0,Dh.alwaysValidSchema)(l,g)||(n.if((0,PI._)`${d} > ${y}`,()=>r.subschema({keyword:a,schemaProp:y,dataProp:y},f)),r.ok(f))});function h(g){let{opts:y,errSchemaPath:S}=l,_=t.length,R=_===g.minItems&&(_===g.maxItems||g[e]===!1);if(y.strictTuples&&!R){let I=`"${a}" is ${_}-tuple, but minItems or maxItems/${e} are not specified or different at path "${S}"`;(0,Dh.checkStrictMode)(l,I,y.strictTuples)}}}df.validateTuple=kI;df.default=BB});var TI=F(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var VB=t0(),WB={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,VB.validateTuple)(r,"items")};r0.default=WB});var AI=F(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});var qI=Ne(),zB=We(),JB=_n(),GB=e0(),YB={message:({params:{len:r}})=>(0,qI.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,qI._)`{limit: ${r}}`},KB={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:YB,code(r){let{schema:e,parentSchema:t,it:n}=r,{prefixItems:i}=t;n.items=!0,!(0,zB.alwaysValidSchema)(n,e)&&(i?(0,GB.validateAdditionalItems)(r,i):r.ok((0,JB.validateArray)(r)))}};n0.default=KB});var $I=F(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});var Cn=Ne(),Fh=We(),QB={message:({params:{min:r,max:e}})=>e===void 0?(0,Cn.str)`must contain at least ${r} valid item(s)`:(0,Cn.str)`must contain at least ${r} and no more than ${e} valid item(s)`,params:({params:{min:r,max:e}})=>e===void 0?(0,Cn._)`{minContains: ${r}}`:(0,Cn._)`{minContains: ${r}, maxContains: ${e}}`},ZB={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:QB,code(r){let{gen:e,schema:t,parentSchema:n,data:i,it:s}=r,a,l,{minContains:f,maxContains:d}=n;s.opts.next?(a=f===void 0?1:f,l=d):a=1;let h=e.const("len",(0,Cn._)`${i}.length`);if(r.setParams({min:a,max:l}),l===void 0&&a===0){(0,Fh.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,Fh.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,Fh.alwaysValidSchema)(s,t)){let R=(0,Cn._)`${h} >= ${a}`;l!==void 0&&(R=(0,Cn._)`${R} && ${h} <= ${l}`),r.pass(R);return}s.items=!0;let g=e.name("valid");l===void 0&&a===1?S(g,()=>e.if(g,()=>e.break())):a===0?(e.let(g,!0),l!==void 0&&e.if((0,Cn._)`${i}.length > 0`,y)):(e.let(g,!1),y()),r.result(g,()=>r.reset());function y(){let R=e.name("_valid"),I=e.let("count",0);S(R,()=>e.if(R,()=>_(I)))}function S(R,I){e.forRange("i",0,h,q=>{r.subschema({keyword:"contains",dataProp:q,dataPropType:Fh.Type.Num,compositeRule:!0},R),I()})}function _(R){e.code((0,Cn._)`${R}++`),l===void 0?e.if((0,Cn._)`${R} >= ${a}`,()=>e.assign(g,!0).break()):(e.if((0,Cn._)`${R} > ${l}`,()=>e.assign(g,!1).break()),a===1?e.assign(g,!0):e.if((0,Cn._)`${R} >= ${a}`,()=>e.assign(g,!0)))}}};i0.default=ZB});var DI=F(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.validateSchemaDeps=Ri.validatePropertyDeps=Ri.error=void 0;var s0=Ne(),XB=We(),pf=_n();Ri.error={message:({params:{property:r,depsCount:e,deps:t}})=>{let n=e===1?"property":"properties";return(0,s0.str)`must have ${n} ${t} when property ${r} is present`},params:({params:{property:r,depsCount:e,deps:t,missingProperty:n}})=>(0,s0._)`{property: ${r},
|
|
28
28
|
missingProperty: ${n},
|
|
29
29
|
depsCount: ${e},
|
|
30
|
-
deps: ${t}}`};var eV={keyword:"dependencies",type:"object",schemaType:"object",error:Ci.error,code(r){let[e,t]=tV(r);MI(r,e),NI(r,t)}};function tV({schema:r}){let e={},t={};for(let n in r){if(n==="__proto__")continue;let i=Array.isArray(r[n])?e:t;i[n]=r[n]}return[e,t]}function MI(r,e=r.schema){let{gen:t,data:n,it:i}=r;if(Object.keys(e).length===0)return;let s=t.let("missing");for(let a in e){let l=e[a];if(l.length===0)continue;let f=(0,hf.propertyInData)(t,n,a,i.opts.ownProperties);r.setParams({property:a,depsCount:l.length,deps:l.join(", ")}),i.allErrors?t.if(f,()=>{for(let d of l)(0,hf.checkReportMissingProp)(r,d)}):(t.if((0,s0._)`${f} && (${(0,hf.checkMissingProp)(r,l,s)})`),(0,hf.reportMissingProp)(r,s),t.else())}}Ci.validatePropertyDeps=MI;function NI(r,e=r.schema){let{gen:t,data:n,keyword:i,it:s}=r,a=t.name("valid");for(let l in e)(0,XB.alwaysValidSchema)(s,e[l])||(t.if((0,hf.propertyInData)(t,n,l,s.opts.ownProperties),()=>{let f=r.subschema({keyword:i,schemaProp:l},a);r.mergeValidEvaluated(f,a)},()=>t.var(a,!0)),r.ok(a))}Ci.validateSchemaDeps=NI;Ci.default=eV});var LI=F(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});var FI=Ne(),rV=We(),nV={message:"property name must be valid",params:({params:r})=>(0,FI._)`{propertyName: ${r.propertyName}}`},iV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:nV,code(r){let{gen:e,schema:t,data:n,it:i}=r;if((0,rV.alwaysValidSchema)(i,t))return;let s=e.name("valid");e.forIn("key",n,a=>{r.setParams({propertyName:a}),r.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,FI.not)(s),()=>{r.error(!0),i.allErrors||e.break()})}),r.ok(s)}};o0.default=iV});var l0=F(a0=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});var jh=_n(),Kn=Ne(),sV=es(),Uh=We(),oV={message:"must NOT have additional properties",params:({params:r})=>(0,Kn._)`{additionalProperty: ${r.additionalProperty}}`},aV={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:oV,code(r){let{gen:e,schema:t,parentSchema:n,data:i,errsCount:s,it:a}=r;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:f}=a;if(a.props=!0,f.removeAdditional!=="all"&&(0,Uh.alwaysValidSchema)(a,t))return;let d=(0,jh.allSchemaProperties)(n.properties),h=(0,jh.allSchemaProperties)(n.patternProperties);g(),r.ok((0,Kn._)`${s} === ${sV.default.errors}`);function g(){e.forIn("key",i,I=>{!d.length&&!h.length?_(I):e.if(y(I),()=>_(I))})}function y(I){let q;if(d.length>8){let U=(0,Uh.schemaRefOrVal)(a,n.properties,"properties");q=(0,jh.isOwnProperty)(e,U,I)}else d.length?q=(0,Kn.or)(...d.map(U=>(0,Kn._)`${I} === ${U}`)):q=Kn.nil;return h.length&&(q=(0,Kn.or)(q,...h.map(U=>(0,Kn._)`${(0,jh.usePattern)(r,U)}.test(${I})`))),(0,Kn.not)(q)}function S(I){e.code((0,Kn._)`delete ${i}[${I}]`)}function _(I){if(f.removeAdditional==="all"||f.removeAdditional&&t===!1){S(I);return}if(t===!1){r.setParams({additionalProperty:I}),r.error(),l||e.break();return}if(typeof t=="object"&&!(0,Uh.alwaysValidSchema)(a,t)){let q=e.name("valid");f.removeAdditional==="failing"?(R(I,q,!1),e.if((0,Kn.not)(q),()=>{r.reset(),S(I)})):(R(I,q),l||e.if((0,Kn.not)(q),()=>e.break()))}}function R(I,q,U){let B={keyword:"additionalProperties",dataProp:I,dataPropType:Uh.Type.Str};U===!1&&Object.assign(B,{compositeRule:!0,createErrors:!1,allErrors:!1}),r.subschema(B,q)}}};a0.default=aV});var HI=F(c0=>{"use strict";Object.defineProperty(c0,"__esModule",{value:!0});var lV=Xc(),jI=_n(),u0=We(),UI=l0(),uV={keyword:"properties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,parentSchema:n,data:i,it:s}=r;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&UI.default.code(new lV.KeywordCxt(s,UI.default,"additionalProperties"));let a=(0,jI.allSchemaProperties)(t);for(let g of a)s.definedProperties.add(g);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=u0.mergeEvaluated.props(e,(0,u0.toHash)(a),s.props));let l=a.filter(g=>!(0,u0.alwaysValidSchema)(s,t[g]));if(l.length===0)return;let f=e.name("valid");for(let g of l)d(g)?h(g):(e.if((0,jI.propertyInData)(e,i,g,s.opts.ownProperties)),h(g),s.allErrors||e.else().var(f,!0),e.endIf()),r.it.definedProperties.add(g),r.ok(f);function d(g){return s.opts.useDefaults&&!s.compositeRule&&t[g].default!==void 0}function h(g){r.subschema({keyword:"properties",schemaProp:g,dataProp:g},f)}}};c0.default=uV});var zI=F(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});var BI=_n(),Hh=Ne(),VI=We(),WI=We(),cV={keyword:"patternProperties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,data:n,parentSchema:i,it:s}=r,{opts:a}=s,l=(0,BI.allSchemaProperties)(t),f=l.filter(R=>(0,VI.alwaysValidSchema)(s,t[R]));if(l.length===0||f.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=a.strictSchema&&!a.allowMatchingProperties&&i.properties,h=e.name("valid");s.props!==!0&&!(s.props instanceof Hh.Name)&&(s.props=(0,WI.evaluatedPropsToName)(e,s.props));let{props:g}=s;y();function y(){for(let R of l)d&&S(R),s.allErrors?_(R):(e.var(h,!0),_(R),e.if(h))}function S(R){for(let I in d)new RegExp(R).test(I)&&(0,VI.checkStrictMode)(s,`property ${I} matches pattern ${R} (use allowMatchingProperties)`)}function _(R){e.forIn("key",n,I=>{e.if((0,Hh._)`${(0,BI.usePattern)(r,R)}.test(${I})`,()=>{let q=f.includes(R);q||r.subschema({keyword:"patternProperties",schemaProp:R,dataProp:I,dataPropType:WI.Type.Str},h),s.opts.unevaluated&&g!==!0?e.assign((0,Hh._)`${g}[${I}]`,!0):!q&&!s.allErrors&&e.if((0,Hh.not)(h),()=>e.break())})})}}};f0.default=cV});var JI=F(d0=>{"use strict";Object.defineProperty(d0,"__esModule",{value:!0});var fV=We(),dV={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:e,schema:t,it:n}=r;if((0,fV.alwaysValidSchema)(n,t)){r.fail();return}let i=e.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),r.failResult(i,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};d0.default=dV});var GI=F(p0=>{"use strict";Object.defineProperty(p0,"__esModule",{value:!0});var pV=_n(),hV={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:pV.validateUnion,error:{message:"must match a schema in anyOf"}};p0.default=hV});var YI=F(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});var Bh=Ne(),mV=We(),gV={message:"must match exactly one schema in oneOf",params:({params:r})=>(0,Bh._)`{passingSchemas: ${r.passing}}`},yV={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:gV,code(r){let{gen:e,schema:t,parentSchema:n,it:i}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=t,a=e.let("valid",!1),l=e.let("passing",null),f=e.name("_valid");r.setParams({passing:l}),e.block(d),r.result(a,()=>r.reset(),()=>r.error(!0));function d(){s.forEach((h,g)=>{let y;(0,mV.alwaysValidSchema)(i,h)?e.var(f,!0):y=r.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},f),g>0&&e.if((0,Bh._)`${f} && ${a}`).assign(a,!1).assign(l,(0,Bh._)`[${l}, ${g}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(l,g),y&&r.mergeEvaluated(y,Bh.Name)})})}}};h0.default=yV});var KI=F(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});var vV=We(),bV={keyword:"allOf",schemaType:"array",code(r){let{gen:e,schema:t,it:n}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");let i=e.name("valid");t.forEach((s,a)=>{if((0,vV.alwaysValidSchema)(n,s))return;let l=r.subschema({keyword:"allOf",schemaProp:a},i);r.ok(i),r.mergeEvaluated(l)})}};m0.default=bV});var XI=F(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});var Vh=Ne(),ZI=We(),SV={message:({params:r})=>(0,Vh.str)`must match "${r.ifClause}" schema`,params:({params:r})=>(0,Vh._)`{failingKeyword: ${r.ifClause}}`},wV={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:SV,code(r){let{gen:e,parentSchema:t,it:n}=r;t.then===void 0&&t.else===void 0&&(0,ZI.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=QI(n,"then"),s=QI(n,"else");if(!i&&!s)return;let a=e.let("valid",!0),l=e.name("_valid");if(f(),r.reset(),i&&s){let h=e.let("ifClause");r.setParams({ifClause:h}),e.if(l,d("then",h),d("else",h))}else i?e.if(l,d("then")):e.if((0,Vh.not)(l),d("else"));r.pass(a,()=>r.error(!0));function f(){let h=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);r.mergeEvaluated(h)}function d(h,g){return()=>{let y=r.subschema({keyword:h},l);e.assign(a,l),r.mergeValidEvaluated(y,a),g?e.assign(g,(0,Vh._)`${h}`):r.setParams({ifClause:h})}}}};function QI(r,e){let t=r.schema[e];return t!==void 0&&!(0,ZI.alwaysValidSchema)(r,t)}g0.default=wV});var eP=F(y0=>{"use strict";Object.defineProperty(y0,"__esModule",{value:!0});var _V=We(),RV={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:e,it:t}){e.if===void 0&&(0,_V.checkStrictMode)(t,`"${r}" without "if" is ignored`)}};y0.default=RV});var tP=F(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});var CV=e0(),xV=TI(),EV=t0(),OV=AI(),IV=$I(),PV=DI(),kV=LI(),TV=l0(),qV=HI(),AV=zI(),$V=JI(),MV=GI(),NV=YI(),DV=KI(),FV=XI(),LV=eP();function jV(r=!1){let e=[$V.default,MV.default,NV.default,DV.default,FV.default,LV.default,kV.default,TV.default,PV.default,qV.default,AV.default];return r?e.push(xV.default,OV.default):e.push(CV.default,EV.default),e.push(IV.default),e}v0.default=jV});var rP=F(b0=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});var Dt=Ne(),UV={message:({schemaCode:r})=>(0,Dt.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,Dt._)`{format: ${r}}`},HV={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:UV,code(r,e){let{gen:t,data:n,$data:i,schema:s,schemaCode:a,it:l}=r,{opts:f,errSchemaPath:d,schemaEnv:h,self:g}=l;if(!f.validateFormats)return;i?y():S();function y(){let _=t.scopeValue("formats",{ref:g.formats,code:f.code.formats}),R=t.const("fDef",(0,Dt._)`${_}[${a}]`),I=t.let("fType"),q=t.let("format");t.if((0,Dt._)`typeof ${R} == "object" && !(${R} instanceof RegExp)`,()=>t.assign(I,(0,Dt._)`${R}.type || "string"`).assign(q,(0,Dt._)`${R}.validate`),()=>t.assign(I,(0,Dt._)`"string"`).assign(q,R)),r.fail$data((0,Dt.or)(U(),B()));function U(){return f.strictSchema===!1?Dt.nil:(0,Dt._)`${a} && !${q}`}function B(){let V=h.$async?(0,Dt._)`(${R}.async ? await ${q}(${n}) : ${q}(${n}))`:(0,Dt._)`${q}(${n})`,W=(0,Dt._)`(typeof ${q} == "function" ? ${V} : ${q}.test(${n}))`;return(0,Dt._)`${q} && ${q} !== true && ${I} === ${e} && !${W}`}}function S(){let _=g.formats[s];if(!_){U();return}if(_===!0)return;let[R,I,q]=B(_);R===e&&r.pass(V());function U(){if(f.strictSchema===!1){g.logger.warn(W());return}throw new Error(W());function W(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function B(W){let X=W instanceof RegExp?(0,Dt.regexpCode)(W):f.code.formats?(0,Dt._)`${f.code.formats}${(0,Dt.getProperty)(s)}`:void 0,T=t.scopeValue("formats",{key:s,ref:W,code:X});return typeof W=="object"&&!(W instanceof RegExp)?[W.type||"string",W.validate,(0,Dt._)`${T}.validate`]:["string",W,T]}function V(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!h.$async)throw new Error("async format in sync schema");return(0,Dt._)`await ${q}(${n})`}return typeof I=="function"?(0,Dt._)`${q}(${n})`:(0,Dt._)`${q}.test(${n})`}}}};b0.default=HV});var nP=F(S0=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});var BV=rP(),VV=[BV.default];S0.default=VV});var iP=F(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.contentVocabulary=Vl.metadataVocabulary=void 0;Vl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Vl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var oP=F(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});var WV=pI(),zV=OI(),JV=tP(),GV=nP(),sP=iP(),YV=[WV.default,zV.default,(0,JV.default)(),GV.default,sP.metadataVocabulary,sP.contentVocabulary];w0.default=YV});var lP=F(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.DiscrError=void 0;var aP;(function(r){r.Tag="tag",r.Mapping="mapping"})(aP||(Wh.DiscrError=aP={}))});var cP=F(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});var Wl=Ne(),_0=lP(),uP=Ih(),KV=ef(),QV=We(),ZV={message:({params:{discrError:r,tagName:e}})=>r===_0.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:r,tag:e,tagName:t}})=>(0,Wl._)`{error: ${r}, tag: ${t}, tagValue: ${e}}`},XV={keyword:"discriminator",type:"object",schemaType:"object",error:ZV,code(r){let{gen:e,data:t,schema:n,parentSchema:i,it:s}=r,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),d=e.const("tag",(0,Wl._)`${t}${(0,Wl.getProperty)(l)}`);e.if((0,Wl._)`typeof ${d} == "string"`,()=>h(),()=>r.error(!1,{discrError:_0.DiscrError.Tag,tag:d,tagName:l})),r.ok(f);function h(){let S=y();e.if(!1);for(let _ in S)e.elseIf((0,Wl._)`${d} === ${_}`),e.assign(f,g(S[_]));e.else(),r.error(!1,{discrError:_0.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}function g(S){let _=e.name("valid"),R=r.subschema({keyword:"oneOf",schemaProp:S},_);return r.mergeEvaluated(R,Wl.Name),_}function y(){var S;let _={},R=q(i),I=!0;for(let V=0;V<a.length;V++){let W=a[V];if(W?.$ref&&!(0,QV.schemaHasRulesButRef)(W,s.self.RULES)){let T=W.$ref;if(W=uP.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,T),W instanceof uP.SchemaEnv&&(W=W.schema),W===void 0)throw new KV.default(s.opts.uriResolver,s.baseId,T)}let X=(S=W?.properties)===null||S===void 0?void 0:S[l];if(typeof X!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);I=I&&(R||q(W)),U(X,V)}if(!I)throw new Error(`discriminator: "${l}" must be required`);return _;function q({required:V}){return Array.isArray(V)&&V.includes(l)}function U(V,W){if(V.const)B(V.const,W);else if(V.enum)for(let X of V.enum)B(X,W);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function B(V,W){if(typeof V!="string"||V in _)throw new Error(`discriminator: "${l}" values must be unique strings`);_[V]=W}}}};R0.default=XV});var fP=F((gQ,eW)=>{eW.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var pP=F((wt,C0)=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.MissingRefError=wt.ValidationError=wt.CodeGen=wt.Name=wt.nil=wt.stringify=wt.str=wt._=wt.KeywordCxt=wt.Ajv=void 0;var tW=aI(),rW=oP(),nW=cP(),dP=fP(),iW=["/properties"],zh="http://json-schema.org/draft-07/schema",zl=class extends tW.default{_addVocabularies(){super._addVocabularies(),rW.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(nW.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(dP,iW):dP;this.addMetaSchema(e,zh,!1),this.refs["http://json-schema.org/schema"]=zh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(zh)?zh:void 0)}};wt.Ajv=zl;C0.exports=wt=zl;C0.exports.Ajv=zl;Object.defineProperty(wt,"__esModule",{value:!0});wt.default=zl;var sW=Xc();Object.defineProperty(wt,"KeywordCxt",{enumerable:!0,get:function(){return sW.KeywordCxt}});var Jl=Ne();Object.defineProperty(wt,"_",{enumerable:!0,get:function(){return Jl._}});Object.defineProperty(wt,"str",{enumerable:!0,get:function(){return Jl.str}});Object.defineProperty(wt,"stringify",{enumerable:!0,get:function(){return Jl.stringify}});Object.defineProperty(wt,"nil",{enumerable:!0,get:function(){return Jl.nil}});Object.defineProperty(wt,"Name",{enumerable:!0,get:function(){return Jl.Name}});Object.defineProperty(wt,"CodeGen",{enumerable:!0,get:function(){return Jl.CodeGen}});var oW=Eh();Object.defineProperty(wt,"ValidationError",{enumerable:!0,get:function(){return oW.default}});var aW=ef();Object.defineProperty(wt,"MissingRefError",{enumerable:!0,get:function(){return aW.default}})});import*as lW from"crypto";import*as fa from"fs";import{createRequire as uW}from"module";import*as Qn from"path";function Gh(){return{format:(r,e)=>{let t=r?new Date(r):new Date;return e==="YYYY-MM-DD"?t.toISOString().split("T")[0]:t.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let r=new Date;return{format:()=>r.toISOString(),toISOString:()=>r.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function hP(){return{get:(r,e,t)=>{let n=e.split("."),i=r;for(let s of n)if(i=i?.[s],i===void 0)return t;return i},set:(r,e,t)=>{let n=e.split("."),i=r;for(let s=0;s<n.length-1;s++)i[n[s]]||(i[n[s]]={}),i=i[n[s]];return i[n[n.length-1]]=t,r},cloneDeep:r=>JSON.parse(JSON.stringify(r)),keys:r=>Object.keys(r??{}),values:r=>Object.values(r??{}),entries:r=>Object.entries(r??{}),each(r,e){Array.isArray(r)?r.forEach((t,n)=>e(t,n,r)):r&&typeof r=="object"&&Object.entries(r).forEach(([t,n])=>e(n,t,r))},forEach(r,e){Array.isArray(r)?r.forEach((t,n)=>e(t,n,r)):r&&typeof r=="object"&&Object.entries(r).forEach(([t,n])=>e(n,t,r))},map:(r,e)=>(Array.isArray(r)?r:Object.values(r??{})).map(t=>e(t)),filter:(r,e)=>(Array.isArray(r)?r:Object.values(r??{})).filter(t=>e(t)),find:(r,e)=>(Array.isArray(r)?r:Object.values(r??{})).find(t=>e(t)),reduce:(r,e,t)=>(Array.isArray(r)?r:Object.values(r??{})).reduce((n,i)=>e(n,i),t),includes:(r,e)=>Array.isArray(r)?r.includes(e):Object.values(r??{}).includes(e),isObject:r=>r!==null&&typeof r=="object"&&!Array.isArray(r),isArray:r=>Array.isArray(r),isString:r=>typeof r=="string",isNumber:r=>typeof r=="number",isFunction:r=>typeof r=="function",isNil:r=>r==null,isEmpty:r=>r==null?!0:Array.isArray(r)||typeof r=="string"?r.length===0:typeof r=="object"?Object.keys(r).length===0:!1,assign:(r,...e)=>Object.assign(r,...e),merge:(r,...e)=>{let t={...r};for(let n of e)for(let[i,s]of Object.entries(n??{}))t[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...t[i]??{},...s}:s;return t},omit:(r,e)=>{let t={...r};for(let n of e)delete t[n];return t},pick:(r,e)=>{let t={};for(let n of e)n in(r??{})&&(t[n]=r[n]);return t}}}function x0(r,e){return new Jh(r,e)}var Jh,E0=se(()=>{"use strict";Ab();Jh=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Pl}),crypto:()=>lW,path:()=>Qn,querystring:()=>it("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>qE(),hP),moment:()=>this.loadOptionalModule("moment",()=>AE(),Gh),tv4:()=>this.loadOptionalModule("tv4",()=>ME()),ajv:()=>this.loadOptionalModule("ajv",()=>pP()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>it("crypto-js"),()=>{throw new Error('crypto-js npm module is not installed. The built-in CryptoJS global is already available in scripts with AES/DES/TripleDES/hash/HMAC/PBKDF2 support. If you need the exact npm package, add "crypto-js" to your modules/package.json and run npm install.')})};constructor(e=[],t={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...t,outputChannel:t.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e){let i=Qn.resolve(n);if(this.initializeModules(i)){this.modulesPath=i;break}}}loadOptionalModule(e,t,n){try{return t()}catch{if(this.customModulesRequire)try{return console.debug(`[ModuleLoader] ${e} not in core, trying user modules`),this.customModulesRequire(e)}catch{this.logModuleWarning(e,"user")}else this.logModuleWarning(e,"core");if(n)return console.warn(`[ModuleLoader] Using shim for ${e}. Some features may be limited.`),n();throw new Error(this.getModuleInstallInstructions(e))}}logModuleWarning(e,t){let i={moment:"Date/time manipulation",lodash:"Utility functions",tv4:"JSON Schema validation (v4)",ajv:"JSON Schema validation"}[e]||e;console.warn(`[ModuleLoader] ${i} functionality (${e}) is not available.
|
|
30
|
+
deps: ${t}}`};var eV={keyword:"dependencies",type:"object",schemaType:"object",error:Ri.error,code(r){let[e,t]=tV(r);MI(r,e),NI(r,t)}};function tV({schema:r}){let e={},t={};for(let n in r){if(n==="__proto__")continue;let i=Array.isArray(r[n])?e:t;i[n]=r[n]}return[e,t]}function MI(r,e=r.schema){let{gen:t,data:n,it:i}=r;if(Object.keys(e).length===0)return;let s=t.let("missing");for(let a in e){let l=e[a];if(l.length===0)continue;let f=(0,pf.propertyInData)(t,n,a,i.opts.ownProperties);r.setParams({property:a,depsCount:l.length,deps:l.join(", ")}),i.allErrors?t.if(f,()=>{for(let d of l)(0,pf.checkReportMissingProp)(r,d)}):(t.if((0,s0._)`${f} && (${(0,pf.checkMissingProp)(r,l,s)})`),(0,pf.reportMissingProp)(r,s),t.else())}}Ri.validatePropertyDeps=MI;function NI(r,e=r.schema){let{gen:t,data:n,keyword:i,it:s}=r,a=t.name("valid");for(let l in e)(0,XB.alwaysValidSchema)(s,e[l])||(t.if((0,pf.propertyInData)(t,n,l,s.opts.ownProperties),()=>{let f=r.subschema({keyword:i,schemaProp:l},a);r.mergeValidEvaluated(f,a)},()=>t.var(a,!0)),r.ok(a))}Ri.validateSchemaDeps=NI;Ri.default=eV});var LI=F(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});var FI=Ne(),rV=We(),nV={message:"property name must be valid",params:({params:r})=>(0,FI._)`{propertyName: ${r.propertyName}}`},iV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:nV,code(r){let{gen:e,schema:t,data:n,it:i}=r;if((0,rV.alwaysValidSchema)(i,t))return;let s=e.name("valid");e.forIn("key",n,a=>{r.setParams({propertyName:a}),r.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,FI.not)(s),()=>{r.error(!0),i.allErrors||e.break()})}),r.ok(s)}};o0.default=iV});var l0=F(a0=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});var Lh=_n(),Yn=Ne(),sV=es(),jh=We(),oV={message:"must NOT have additional properties",params:({params:r})=>(0,Yn._)`{additionalProperty: ${r.additionalProperty}}`},aV={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:oV,code(r){let{gen:e,schema:t,parentSchema:n,data:i,errsCount:s,it:a}=r;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:f}=a;if(a.props=!0,f.removeAdditional!=="all"&&(0,jh.alwaysValidSchema)(a,t))return;let d=(0,Lh.allSchemaProperties)(n.properties),h=(0,Lh.allSchemaProperties)(n.patternProperties);g(),r.ok((0,Yn._)`${s} === ${sV.default.errors}`);function g(){e.forIn("key",i,I=>{!d.length&&!h.length?_(I):e.if(y(I),()=>_(I))})}function y(I){let q;if(d.length>8){let j=(0,jh.schemaRefOrVal)(a,n.properties,"properties");q=(0,Lh.isOwnProperty)(e,j,I)}else d.length?q=(0,Yn.or)(...d.map(j=>(0,Yn._)`${I} === ${j}`)):q=Yn.nil;return h.length&&(q=(0,Yn.or)(q,...h.map(j=>(0,Yn._)`${(0,Lh.usePattern)(r,j)}.test(${I})`))),(0,Yn.not)(q)}function S(I){e.code((0,Yn._)`delete ${i}[${I}]`)}function _(I){if(f.removeAdditional==="all"||f.removeAdditional&&t===!1){S(I);return}if(t===!1){r.setParams({additionalProperty:I}),r.error(),l||e.break();return}if(typeof t=="object"&&!(0,jh.alwaysValidSchema)(a,t)){let q=e.name("valid");f.removeAdditional==="failing"?(R(I,q,!1),e.if((0,Yn.not)(q),()=>{r.reset(),S(I)})):(R(I,q),l||e.if((0,Yn.not)(q),()=>e.break()))}}function R(I,q,j){let B={keyword:"additionalProperties",dataProp:I,dataPropType:jh.Type.Str};j===!1&&Object.assign(B,{compositeRule:!0,createErrors:!1,allErrors:!1}),r.subschema(B,q)}}};a0.default=aV});var HI=F(c0=>{"use strict";Object.defineProperty(c0,"__esModule",{value:!0});var lV=Zc(),jI=_n(),u0=We(),UI=l0(),uV={keyword:"properties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,parentSchema:n,data:i,it:s}=r;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&UI.default.code(new lV.KeywordCxt(s,UI.default,"additionalProperties"));let a=(0,jI.allSchemaProperties)(t);for(let g of a)s.definedProperties.add(g);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=u0.mergeEvaluated.props(e,(0,u0.toHash)(a),s.props));let l=a.filter(g=>!(0,u0.alwaysValidSchema)(s,t[g]));if(l.length===0)return;let f=e.name("valid");for(let g of l)d(g)?h(g):(e.if((0,jI.propertyInData)(e,i,g,s.opts.ownProperties)),h(g),s.allErrors||e.else().var(f,!0),e.endIf()),r.it.definedProperties.add(g),r.ok(f);function d(g){return s.opts.useDefaults&&!s.compositeRule&&t[g].default!==void 0}function h(g){r.subschema({keyword:"properties",schemaProp:g,dataProp:g},f)}}};c0.default=uV});var zI=F(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});var BI=_n(),Uh=Ne(),VI=We(),WI=We(),cV={keyword:"patternProperties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,data:n,parentSchema:i,it:s}=r,{opts:a}=s,l=(0,BI.allSchemaProperties)(t),f=l.filter(R=>(0,VI.alwaysValidSchema)(s,t[R]));if(l.length===0||f.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=a.strictSchema&&!a.allowMatchingProperties&&i.properties,h=e.name("valid");s.props!==!0&&!(s.props instanceof Uh.Name)&&(s.props=(0,WI.evaluatedPropsToName)(e,s.props));let{props:g}=s;y();function y(){for(let R of l)d&&S(R),s.allErrors?_(R):(e.var(h,!0),_(R),e.if(h))}function S(R){for(let I in d)new RegExp(R).test(I)&&(0,VI.checkStrictMode)(s,`property ${I} matches pattern ${R} (use allowMatchingProperties)`)}function _(R){e.forIn("key",n,I=>{e.if((0,Uh._)`${(0,BI.usePattern)(r,R)}.test(${I})`,()=>{let q=f.includes(R);q||r.subschema({keyword:"patternProperties",schemaProp:R,dataProp:I,dataPropType:WI.Type.Str},h),s.opts.unevaluated&&g!==!0?e.assign((0,Uh._)`${g}[${I}]`,!0):!q&&!s.allErrors&&e.if((0,Uh.not)(h),()=>e.break())})})}}};f0.default=cV});var JI=F(d0=>{"use strict";Object.defineProperty(d0,"__esModule",{value:!0});var fV=We(),dV={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:e,schema:t,it:n}=r;if((0,fV.alwaysValidSchema)(n,t)){r.fail();return}let i=e.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),r.failResult(i,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};d0.default=dV});var GI=F(p0=>{"use strict";Object.defineProperty(p0,"__esModule",{value:!0});var pV=_n(),hV={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:pV.validateUnion,error:{message:"must match a schema in anyOf"}};p0.default=hV});var YI=F(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});var Hh=Ne(),mV=We(),gV={message:"must match exactly one schema in oneOf",params:({params:r})=>(0,Hh._)`{passingSchemas: ${r.passing}}`},yV={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:gV,code(r){let{gen:e,schema:t,parentSchema:n,it:i}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=t,a=e.let("valid",!1),l=e.let("passing",null),f=e.name("_valid");r.setParams({passing:l}),e.block(d),r.result(a,()=>r.reset(),()=>r.error(!0));function d(){s.forEach((h,g)=>{let y;(0,mV.alwaysValidSchema)(i,h)?e.var(f,!0):y=r.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},f),g>0&&e.if((0,Hh._)`${f} && ${a}`).assign(a,!1).assign(l,(0,Hh._)`[${l}, ${g}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(l,g),y&&r.mergeEvaluated(y,Hh.Name)})})}}};h0.default=yV});var KI=F(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});var vV=We(),bV={keyword:"allOf",schemaType:"array",code(r){let{gen:e,schema:t,it:n}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");let i=e.name("valid");t.forEach((s,a)=>{if((0,vV.alwaysValidSchema)(n,s))return;let l=r.subschema({keyword:"allOf",schemaProp:a},i);r.ok(i),r.mergeEvaluated(l)})}};m0.default=bV});var XI=F(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});var Bh=Ne(),ZI=We(),SV={message:({params:r})=>(0,Bh.str)`must match "${r.ifClause}" schema`,params:({params:r})=>(0,Bh._)`{failingKeyword: ${r.ifClause}}`},wV={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:SV,code(r){let{gen:e,parentSchema:t,it:n}=r;t.then===void 0&&t.else===void 0&&(0,ZI.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=QI(n,"then"),s=QI(n,"else");if(!i&&!s)return;let a=e.let("valid",!0),l=e.name("_valid");if(f(),r.reset(),i&&s){let h=e.let("ifClause");r.setParams({ifClause:h}),e.if(l,d("then",h),d("else",h))}else i?e.if(l,d("then")):e.if((0,Bh.not)(l),d("else"));r.pass(a,()=>r.error(!0));function f(){let h=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);r.mergeEvaluated(h)}function d(h,g){return()=>{let y=r.subschema({keyword:h},l);e.assign(a,l),r.mergeValidEvaluated(y,a),g?e.assign(g,(0,Bh._)`${h}`):r.setParams({ifClause:h})}}}};function QI(r,e){let t=r.schema[e];return t!==void 0&&!(0,ZI.alwaysValidSchema)(r,t)}g0.default=wV});var eP=F(y0=>{"use strict";Object.defineProperty(y0,"__esModule",{value:!0});var _V=We(),RV={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:e,it:t}){e.if===void 0&&(0,_V.checkStrictMode)(t,`"${r}" without "if" is ignored`)}};y0.default=RV});var tP=F(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});var CV=e0(),xV=TI(),EV=t0(),OV=AI(),IV=$I(),PV=DI(),kV=LI(),TV=l0(),qV=HI(),AV=zI(),$V=JI(),MV=GI(),NV=YI(),DV=KI(),FV=XI(),LV=eP();function jV(r=!1){let e=[$V.default,MV.default,NV.default,DV.default,FV.default,LV.default,kV.default,TV.default,PV.default,qV.default,AV.default];return r?e.push(xV.default,OV.default):e.push(CV.default,EV.default),e.push(IV.default),e}v0.default=jV});var rP=F(b0=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});var Dt=Ne(),UV={message:({schemaCode:r})=>(0,Dt.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,Dt._)`{format: ${r}}`},HV={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:UV,code(r,e){let{gen:t,data:n,$data:i,schema:s,schemaCode:a,it:l}=r,{opts:f,errSchemaPath:d,schemaEnv:h,self:g}=l;if(!f.validateFormats)return;i?y():S();function y(){let _=t.scopeValue("formats",{ref:g.formats,code:f.code.formats}),R=t.const("fDef",(0,Dt._)`${_}[${a}]`),I=t.let("fType"),q=t.let("format");t.if((0,Dt._)`typeof ${R} == "object" && !(${R} instanceof RegExp)`,()=>t.assign(I,(0,Dt._)`${R}.type || "string"`).assign(q,(0,Dt._)`${R}.validate`),()=>t.assign(I,(0,Dt._)`"string"`).assign(q,R)),r.fail$data((0,Dt.or)(j(),B()));function j(){return f.strictSchema===!1?Dt.nil:(0,Dt._)`${a} && !${q}`}function B(){let V=h.$async?(0,Dt._)`(${R}.async ? await ${q}(${n}) : ${q}(${n}))`:(0,Dt._)`${q}(${n})`,W=(0,Dt._)`(typeof ${q} == "function" ? ${V} : ${q}.test(${n}))`;return(0,Dt._)`${q} && ${q} !== true && ${I} === ${e} && !${W}`}}function S(){let _=g.formats[s];if(!_){j();return}if(_===!0)return;let[R,I,q]=B(_);R===e&&r.pass(V());function j(){if(f.strictSchema===!1){g.logger.warn(W());return}throw new Error(W());function W(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function B(W){let X=W instanceof RegExp?(0,Dt.regexpCode)(W):f.code.formats?(0,Dt._)`${f.code.formats}${(0,Dt.getProperty)(s)}`:void 0,T=t.scopeValue("formats",{key:s,ref:W,code:X});return typeof W=="object"&&!(W instanceof RegExp)?[W.type||"string",W.validate,(0,Dt._)`${T}.validate`]:["string",W,T]}function V(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!h.$async)throw new Error("async format in sync schema");return(0,Dt._)`await ${q}(${n})`}return typeof I=="function"?(0,Dt._)`${q}(${n})`:(0,Dt._)`${q}.test(${n})`}}}};b0.default=HV});var nP=F(S0=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});var BV=rP(),VV=[BV.default];S0.default=VV});var iP=F(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.contentVocabulary=Vl.metadataVocabulary=void 0;Vl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Vl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var oP=F(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});var WV=pI(),zV=OI(),JV=tP(),GV=nP(),sP=iP(),YV=[WV.default,zV.default,(0,JV.default)(),GV.default,sP.metadataVocabulary,sP.contentVocabulary];w0.default=YV});var lP=F(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.DiscrError=void 0;var aP;(function(r){r.Tag="tag",r.Mapping="mapping"})(aP||(Vh.DiscrError=aP={}))});var cP=F(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});var Wl=Ne(),_0=lP(),uP=Oh(),KV=Xc(),QV=We(),ZV={message:({params:{discrError:r,tagName:e}})=>r===_0.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:r,tag:e,tagName:t}})=>(0,Wl._)`{error: ${r}, tag: ${t}, tagValue: ${e}}`},XV={keyword:"discriminator",type:"object",schemaType:"object",error:ZV,code(r){let{gen:e,data:t,schema:n,parentSchema:i,it:s}=r,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),d=e.const("tag",(0,Wl._)`${t}${(0,Wl.getProperty)(l)}`);e.if((0,Wl._)`typeof ${d} == "string"`,()=>h(),()=>r.error(!1,{discrError:_0.DiscrError.Tag,tag:d,tagName:l})),r.ok(f);function h(){let S=y();e.if(!1);for(let _ in S)e.elseIf((0,Wl._)`${d} === ${_}`),e.assign(f,g(S[_]));e.else(),r.error(!1,{discrError:_0.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}function g(S){let _=e.name("valid"),R=r.subschema({keyword:"oneOf",schemaProp:S},_);return r.mergeEvaluated(R,Wl.Name),_}function y(){var S;let _={},R=q(i),I=!0;for(let V=0;V<a.length;V++){let W=a[V];if(W?.$ref&&!(0,QV.schemaHasRulesButRef)(W,s.self.RULES)){let T=W.$ref;if(W=uP.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,T),W instanceof uP.SchemaEnv&&(W=W.schema),W===void 0)throw new KV.default(s.opts.uriResolver,s.baseId,T)}let X=(S=W?.properties)===null||S===void 0?void 0:S[l];if(typeof X!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);I=I&&(R||q(W)),j(X,V)}if(!I)throw new Error(`discriminator: "${l}" must be required`);return _;function q({required:V}){return Array.isArray(V)&&V.includes(l)}function j(V,W){if(V.const)B(V.const,W);else if(V.enum)for(let X of V.enum)B(X,W);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function B(V,W){if(typeof V!="string"||V in _)throw new Error(`discriminator: "${l}" values must be unique strings`);_[V]=W}}}};R0.default=XV});var fP=F((gQ,eW)=>{eW.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var pP=F((wt,C0)=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.MissingRefError=wt.ValidationError=wt.CodeGen=wt.Name=wt.nil=wt.stringify=wt.str=wt._=wt.KeywordCxt=wt.Ajv=void 0;var tW=aI(),rW=oP(),nW=cP(),dP=fP(),iW=["/properties"],Wh="http://json-schema.org/draft-07/schema",zl=class extends tW.default{_addVocabularies(){super._addVocabularies(),rW.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(nW.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(dP,iW):dP;this.addMetaSchema(e,Wh,!1),this.refs["http://json-schema.org/schema"]=Wh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Wh)?Wh:void 0)}};wt.Ajv=zl;C0.exports=wt=zl;C0.exports.Ajv=zl;Object.defineProperty(wt,"__esModule",{value:!0});wt.default=zl;var sW=Zc();Object.defineProperty(wt,"KeywordCxt",{enumerable:!0,get:function(){return sW.KeywordCxt}});var Jl=Ne();Object.defineProperty(wt,"_",{enumerable:!0,get:function(){return Jl._}});Object.defineProperty(wt,"str",{enumerable:!0,get:function(){return Jl.str}});Object.defineProperty(wt,"stringify",{enumerable:!0,get:function(){return Jl.stringify}});Object.defineProperty(wt,"nil",{enumerable:!0,get:function(){return Jl.nil}});Object.defineProperty(wt,"Name",{enumerable:!0,get:function(){return Jl.Name}});Object.defineProperty(wt,"CodeGen",{enumerable:!0,get:function(){return Jl.CodeGen}});var oW=xh();Object.defineProperty(wt,"ValidationError",{enumerable:!0,get:function(){return oW.default}});var aW=Xc();Object.defineProperty(wt,"MissingRefError",{enumerable:!0,get:function(){return aW.default}})});import*as lW from"crypto";import*as fa from"fs";import{createRequire as uW}from"module";import*as Kn from"path";function Jh(){return{format:(r,e)=>{let t=r?new Date(r):new Date;return e==="YYYY-MM-DD"?t.toISOString().split("T")[0]:t.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let r=new Date;return{format:()=>r.toISOString(),toISOString:()=>r.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function hP(){return{get:(r,e,t)=>{let n=e.split("."),i=r;for(let s of n)if(i=i?.[s],i===void 0)return t;return i},set:(r,e,t)=>{let n=e.split("."),i=r;for(let s=0;s<n.length-1;s++)i[n[s]]||(i[n[s]]={}),i=i[n[s]];return i[n[n.length-1]]=t,r},cloneDeep:r=>JSON.parse(JSON.stringify(r)),keys:r=>Object.keys(r??{}),values:r=>Object.values(r??{}),entries:r=>Object.entries(r??{}),each(r,e){Array.isArray(r)?r.forEach((t,n)=>e(t,n,r)):r&&typeof r=="object"&&Object.entries(r).forEach(([t,n])=>e(n,t,r))},forEach(r,e){Array.isArray(r)?r.forEach((t,n)=>e(t,n,r)):r&&typeof r=="object"&&Object.entries(r).forEach(([t,n])=>e(n,t,r))},map:(r,e)=>(Array.isArray(r)?r:Object.values(r??{})).map(t=>e(t)),filter:(r,e)=>(Array.isArray(r)?r:Object.values(r??{})).filter(t=>e(t)),find:(r,e)=>(Array.isArray(r)?r:Object.values(r??{})).find(t=>e(t)),reduce:(r,e,t)=>(Array.isArray(r)?r:Object.values(r??{})).reduce((n,i)=>e(n,i),t),includes:(r,e)=>Array.isArray(r)?r.includes(e):Object.values(r??{}).includes(e),isObject:r=>r!==null&&typeof r=="object"&&!Array.isArray(r),isArray:r=>Array.isArray(r),isString:r=>typeof r=="string",isNumber:r=>typeof r=="number",isFunction:r=>typeof r=="function",isNil:r=>r==null,isEmpty:r=>r==null?!0:Array.isArray(r)||typeof r=="string"?r.length===0:typeof r=="object"?Object.keys(r).length===0:!1,assign:(r,...e)=>Object.assign(r,...e),merge:(r,...e)=>{let t={...r};for(let n of e)for(let[i,s]of Object.entries(n??{}))t[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...t[i]??{},...s}:s;return t},omit:(r,e)=>{let t={...r};for(let n of e)delete t[n];return t},pick:(r,e)=>{let t={};for(let n of e)n in(r??{})&&(t[n]=r[n]);return t}}}function x0(r,e){return new zh(r,e)}var zh,E0=se(()=>{"use strict";Ab();zh=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Pl}),crypto:()=>lW,path:()=>Kn,querystring:()=>it("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>qE(),hP),moment:()=>this.loadOptionalModule("moment",()=>AE(),Jh),tv4:()=>this.loadOptionalModule("tv4",()=>ME()),ajv:()=>this.loadOptionalModule("ajv",()=>pP()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>it("crypto-js"),()=>{throw new Error('crypto-js npm module is not installed. The built-in CryptoJS global is already available in scripts with AES/DES/TripleDES/hash/HMAC/PBKDF2 support. If you need the exact npm package, add "crypto-js" to your modules/package.json and run npm install.')})};constructor(e=[],t={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...t,outputChannel:t.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e){let i=Kn.resolve(n);if(this.initializeModules(i)){this.modulesPath=i;break}}}loadOptionalModule(e,t,n){try{return t()}catch{if(this.customModulesRequire)try{return console.debug(`[ModuleLoader] ${e} not in core, trying user modules`),this.customModulesRequire(e)}catch{this.logModuleWarning(e,"user")}else this.logModuleWarning(e,"core");if(n)return console.warn(`[ModuleLoader] Using shim for ${e}. Some features may be limited.`),n();throw new Error(this.getModuleInstallInstructions(e))}}logModuleWarning(e,t){let i={moment:"Date/time manipulation",lodash:"Utility functions",tv4:"JSON Schema validation (v4)",ajv:"JSON Schema validation"}[e]||e;console.warn(`[ModuleLoader] ${i} functionality (${e}) is not available.
|
|
31
31
|
${this.getModuleInstallInstructions(e)}`)}getModuleInstallInstructions(e){let n={moment:"^2.30.1",lodash:"^4.17.21",tv4:"^1.3.0",ajv:"^8.17.1"}[e]||"latest";return`To use ${e}, add it to http-forge/modules/package.json:
|
|
32
32
|
{
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"${e}": "${n}"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
Then run: cd http-forge/modules && npm install`}initializeModules(e){if(this.logDebug("Initializing module loader..."),!this.options.allowCustomModules)return this.logDebug("Custom modules disabled by configuration"),!0;try{let t=
|
|
38
|
-
Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}finally{this.resolveStack.delete(e)}}}getModuleSuggestions(e){let t=this.getAvailableModules(),n=[];for(let i of t)if(i.startsWith(e.substring(0,3))&&(n.push(i),n.length>=3))break;return n}cacheModule(e,t,n,i){this.moduleCache.set(e,{module:t,source:n,resolveTime:i}),i>100&&this.logDebug(`Slow module load: ${e} took ${i}ms`)}getGlobalSetupExports(){return this.globalSetupExports}hasCustomModules(){return this.customModulesRequire!==void 0}getAvailableModules(){return[...Object.keys(this.builtinModules),...Array.from(this.availableModules)].sort()}clearCache(){this.moduleCache.clear(),this.logDebug("Module cache cleared")}getCacheStats(){return{size:this.moduleCache.size,hits:0}}logDebug(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader] ${e}`)}logError(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader ERROR] ${e}`),console.error(`[ModuleLoader ERROR] ${e}`)}}});function mP(r){let e=new Set,t=new Set,n=(h,g)=>{try{h(...g)}catch(y){try{r(y)}catch{}}},i={setTimeout:(h,g,...y)=>{if(typeof h!="function")return setTimeout(()=>{},g);let S=setTimeout(()=>{e.delete(S),n(h,y)},g);return e.add(S),S},clearTimeout:h=>{h!=null&&(e.delete(h),clearTimeout(h))},setInterval:(h,g,...y)=>{if(typeof h!="function")return setInterval(()=>{},g);let S=setInterval(()=>{n(h,y)},g);return t.add(S),S},clearInterval:h=>{h!=null&&(t.delete(h),clearInterval(h))}},s=()=>e.size+t.size,a=()=>{for(let h of e)clearTimeout(h);for(let h of t)clearInterval(h);e.clear(),t.clear()},l=h=>new Promise(g=>setTimeout(g,h)),f=async h=>{let g=Date.now();for(await l(0);s()>0;){let y=Date.now()-g;if(y>=h)return a(),{timedOut:!0,elapsedMs:Date.now()-g};let S=h-y;await l(Math.min(15,S))}return await l(0),s()>0?d(g,h):{timedOut:!1,elapsedMs:Date.now()-g}},d=async(h,g)=>{for(;s()>0;){let y=Date.now()-h;if(y>=g)return a(),{timedOut:!0,elapsedMs:Date.now()-h};let S=g-y;await l(Math.min(15,S))}return{timedOut:!1,elapsedMs:Date.now()-h}};return{timers:i,pendingCount:s,clearAll:a,drain:f}}var gP=se(()=>{"use strict"});function O0(r,e,t="$"){let n=[];if(e===null||typeof e!="object")return n;let i=s=>s===null?"null":Array.isArray(s)?"array":Number.isInteger(s)?"integer":typeof s;if(e.type!==void 0){let s=Array.isArray(e.type)?e.type:[e.type],a=i(r);if(!s.some(f=>f===a||f==="number"&&a==="integer"))return n.push(`${t}: expected type ${s.join("|")} but got ${a}`),n}if(Array.isArray(e.enum)&&!e.enum.some(s=>JSON.stringify(s)===JSON.stringify(r))&&n.push(`${t}: value ${JSON.stringify(r)} is not in enum ${JSON.stringify(e.enum)}`),typeof r=="number"&&(typeof e.minimum=="number"&&r<e.minimum&&n.push(`${t}: ${r} is below minimum ${e.minimum}`),typeof e.maximum=="number"&&r>e.maximum&&n.push(`${t}: ${r} is above maximum ${e.maximum}`)),typeof r=="string"&&(typeof e.minLength=="number"&&r.length<e.minLength&&n.push(`${t}: string length ${r.length} is below minLength ${e.minLength}`),typeof e.maxLength=="number"&&r.length>e.maxLength&&n.push(`${t}: string length ${r.length} is above maxLength ${e.maxLength}`),typeof e.pattern=="string"&&!new RegExp(e.pattern).test(r)&&n.push(`${t}: string does not match pattern ${e.pattern}`)),i(r)==="object"){if(Array.isArray(e.required))for(let s of e.required)s in r||n.push(`${t}: missing required property "${s}"`);if(e.properties&&typeof e.properties=="object")for(let[s,a]of Object.entries(e.properties))s in r&&n.push(...O0(r[s],a,`${t}.${s}`));if(e.additionalProperties===!1&&e.properties){let s=new Set(Object.keys(e.properties));for(let a of Object.keys(r))s.has(a)||n.push(`${t}: additional property "${a}" is not allowed`)}}return Array.isArray(r)&&e.items&&typeof e.items=="object"&&r.forEach((s,a)=>{n.push(...O0(s,e.items,`${t}[${a}]`))}),n}function cW(r){let e=r.httpOnly??!1,t=r.secure??!1,n=r.expires==null&&r.maxAge==null;return{name:r.name,value:r.value,domain:r.domain,path:r.path,expires:r.expires,maxAge:r.maxAge,httpOnly:e,secure:t,session:n,hostOnly:!1,sameSite:r.sameSite,valueOf(){return r.value},toString(){let i=[`${r.name}=${r.value}`];return r.expires&&i.push(`Expires=${r.expires}`),r.maxAge!=null&&i.push(`Max-Age=${r.maxAge}`),r.domain&&i.push(`Domain=${r.domain}`),r.path&&i.push(`Path=${r.path}`),t&&i.push("Secure"),e&&i.push("HttpOnly"),r.sameSite&&i.push(`SameSite=${r.sameSite}`),i.join("; ")}}}function fW(r){let e=r.map(cW),t=n=>e.find(i=>i.name===n);return e.get=n=>t(n)?.value,e.one=n=>t(n),e.has=n=>e.some(i=>i.name===n),e.toObject=()=>{let n={};for(let i of e)n[i.name]=i.value;return n},e.all=()=>[...e],e.each=n=>{for(let i of e)n(i)},e.count=()=>e.length,e.idx=n=>e[n],e}function dW(r){let e={...r};return e.get=t=>{let n=t.toLowerCase();for(let[i,s]of Object.entries(r))if(i.toLowerCase()===n)return s},e.has=t=>{let n=t.toLowerCase();return Object.keys(r).some(i=>i.toLowerCase()===n)},e.toObject=()=>({...r}),e.each=t=>{for(let[n,i]of Object.entries(r))t({key:n,value:i})},e}function
|
|
37
|
+
Then run: cd http-forge/modules && npm install`}initializeModules(e){if(this.logDebug("Initializing module loader..."),!this.options.allowCustomModules)return this.logDebug("Custom modules disabled by configuration"),!0;try{let t=Kn.resolve(e,"package.json");if(!fa.existsSync(t))return this.logDebug(`No modules/package.json found at ${e}`),!1;let n=fa.realpathSync(t);return this.customModulesRequire=uW(n),this.loadAvailableModules(e),this.loadGlobalSetup(e),this.logDebug(`Module loader initialized with ${this.availableModules.size} workspace modules`),!0}catch(t){return console.error("Failed to initialize modules:",t),!1}}loadAvailableModules(e){try{let t=Kn.join(e,"package.json"),n=fa.readFileSync(t,"utf-8"),i=JSON.parse(n);if(typeof i!="object"||i===null)throw new Error("Invalid package.json: must be an object");let s=i.dependencies||{},a=i.devDependencies||{};if(typeof s!="object"||typeof a!="object")throw new Error("Invalid dependencies in package.json");Object.keys(s).forEach(l=>{typeof l=="string"&&l.trim()&&this.availableModules.add(l.trim())}),Object.keys(a).forEach(l=>{typeof l=="string"&&l.trim()&&this.availableModules.add(l.trim())}),this.logDebug(`Loaded ${this.availableModules.size} modules from package.json`)}catch(t){let n=`Failed to load workspace modules from package.json: ${t instanceof Error?t.message:t}`;this.logError(n)}}loadGlobalSetup(e){let t=Kn.join(e,"global-setup.js");if(fa.existsSync(t))try{this.customModulesRequire&&(this.globalSetupExports=this.customModulesRequire("./global-setup.js"))}catch(n){console.error("Failed to load global-setup.js:",n),this.globalSetupExports=void 0}}createRequireFunction(){return e=>{let t=Date.now();try{if(this.resolveStack.has(e))throw new Error(`Circular dependency detected: ${Array.from(this.resolveStack).join(" -> ")} -> ${e}`);if(this.resolveStack.size>=this.options.maxResolveDepth)throw new Error(`Maximum module resolve depth (${this.options.maxResolveDepth}) exceeded`);this.resolveStack.add(e);let n=this.moduleCache.get(e);if(n)return this.logDebug(`Module cache hit: ${e}`),n.module;if(this.builtinModules[e]){this.logDebug(`Loading built-in module: ${e}`);let a=this.builtinModules[e]();return this.cacheModule(e,a,"builtin",Date.now()-t),a}if(!this.modulesPath)throw new Error("Module loading is not initialized. No valid modules/ directory found. Create http-forge-assets/modules/package.json first.");if(e.startsWith("./")||e.startsWith("../")){if(!this.customModulesRequire)throw new Error(`Cannot load local module '${e}': No modules/ folder found. Create http-forge-assets/modules/package.json first.`);let a=Kn.resolve(this.modulesPath,e),l=Kn.normalize(a),f=Kn.normalize(this.modulesPath);if(!l.startsWith(f))throw new Error(`Security violation: Attempt to load module outside modules directory: ${e}`);try{this.logDebug(`Loading relative module: ${e}`);let d=this.customModulesRequire(e);return this.cacheModule(e,d,"relative",Date.now()-t),d}catch(d){throw new Error(`Failed to load local module '${e}': ${d.message}`)}}if(this.availableModules.has(e)&&this.customModulesRequire)try{this.logDebug(`Loading workspace module: ${e}`);let a=this.customModulesRequire(e);return this.cacheModule(e,a,"workspace",Date.now()-t),a}catch(a){throw new Error(`Module '${e}' is in package.json but failed to load: ${a.message}`)}let i=this.getModuleSuggestions(e),s=`Module '${e}' is not available.`;throw i.length>0&&(s+=` Did you mean: ${i.join(", ")}?`),s+=`
|
|
38
|
+
Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}finally{this.resolveStack.delete(e)}}}getModuleSuggestions(e){let t=this.getAvailableModules(),n=[];for(let i of t)if(i.startsWith(e.substring(0,3))&&(n.push(i),n.length>=3))break;return n}cacheModule(e,t,n,i){this.moduleCache.set(e,{module:t,source:n,resolveTime:i}),i>100&&this.logDebug(`Slow module load: ${e} took ${i}ms`)}getGlobalSetupExports(){return this.globalSetupExports}hasCustomModules(){return this.customModulesRequire!==void 0}getAvailableModules(){return[...Object.keys(this.builtinModules),...Array.from(this.availableModules)].sort()}clearCache(){this.moduleCache.clear(),this.logDebug("Module cache cleared")}getCacheStats(){return{size:this.moduleCache.size,hits:0}}logDebug(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader] ${e}`)}logError(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader ERROR] ${e}`),console.error(`[ModuleLoader ERROR] ${e}`)}}});function mP(r){let e=new Set,t=new Set,n=(h,g)=>{try{h(...g)}catch(y){try{r(y)}catch{}}},i={setTimeout:(h,g,...y)=>{if(typeof h!="function")return setTimeout(()=>{},g);let S=setTimeout(()=>{e.delete(S),n(h,y)},g);return e.add(S),S},clearTimeout:h=>{h!=null&&(e.delete(h),clearTimeout(h))},setInterval:(h,g,...y)=>{if(typeof h!="function")return setInterval(()=>{},g);let S=setInterval(()=>{n(h,y)},g);return t.add(S),S},clearInterval:h=>{h!=null&&(t.delete(h),clearInterval(h))}},s=()=>e.size+t.size,a=()=>{for(let h of e)clearTimeout(h);for(let h of t)clearInterval(h);e.clear(),t.clear()},l=h=>new Promise(g=>setTimeout(g,h)),f=async h=>{let g=Date.now();for(await l(0);s()>0;){let y=Date.now()-g;if(y>=h)return a(),{timedOut:!0,elapsedMs:Date.now()-g};let S=h-y;await l(Math.min(15,S))}return await l(0),s()>0?d(g,h):{timedOut:!1,elapsedMs:Date.now()-g}},d=async(h,g)=>{for(;s()>0;){let y=Date.now()-h;if(y>=g)return a(),{timedOut:!0,elapsedMs:Date.now()-h};let S=g-y;await l(Math.min(15,S))}return{timedOut:!1,elapsedMs:Date.now()-h}};return{timers:i,pendingCount:s,clearAll:a,drain:f}}var gP=se(()=>{"use strict"});function O0(r,e,t="$"){let n=[];if(e===null||typeof e!="object")return n;let i=s=>s===null?"null":Array.isArray(s)?"array":Number.isInteger(s)?"integer":typeof s;if(e.type!==void 0){let s=Array.isArray(e.type)?e.type:[e.type],a=i(r);if(!s.some(f=>f===a||f==="number"&&a==="integer"))return n.push(`${t}: expected type ${s.join("|")} but got ${a}`),n}if(Array.isArray(e.enum)&&!e.enum.some(s=>JSON.stringify(s)===JSON.stringify(r))&&n.push(`${t}: value ${JSON.stringify(r)} is not in enum ${JSON.stringify(e.enum)}`),typeof r=="number"&&(typeof e.minimum=="number"&&r<e.minimum&&n.push(`${t}: ${r} is below minimum ${e.minimum}`),typeof e.maximum=="number"&&r>e.maximum&&n.push(`${t}: ${r} is above maximum ${e.maximum}`)),typeof r=="string"&&(typeof e.minLength=="number"&&r.length<e.minLength&&n.push(`${t}: string length ${r.length} is below minLength ${e.minLength}`),typeof e.maxLength=="number"&&r.length>e.maxLength&&n.push(`${t}: string length ${r.length} is above maxLength ${e.maxLength}`),typeof e.pattern=="string"&&!new RegExp(e.pattern).test(r)&&n.push(`${t}: string does not match pattern ${e.pattern}`)),i(r)==="object"){if(Array.isArray(e.required))for(let s of e.required)s in r||n.push(`${t}: missing required property "${s}"`);if(e.properties&&typeof e.properties=="object")for(let[s,a]of Object.entries(e.properties))s in r&&n.push(...O0(r[s],a,`${t}.${s}`));if(e.additionalProperties===!1&&e.properties){let s=new Set(Object.keys(e.properties));for(let a of Object.keys(r))s.has(a)||n.push(`${t}: additional property "${a}" is not allowed`)}}return Array.isArray(r)&&e.items&&typeof e.items=="object"&&r.forEach((s,a)=>{n.push(...O0(s,e.items,`${t}[${a}]`))}),n}function cW(r){let e=r.httpOnly??!1,t=r.secure??!1,n=r.expires==null&&r.maxAge==null;return{name:r.name,value:r.value,domain:r.domain,path:r.path,expires:r.expires,maxAge:r.maxAge,httpOnly:e,secure:t,session:n,hostOnly:!1,sameSite:r.sameSite,valueOf(){return r.value},toString(){let i=[`${r.name}=${r.value}`];return r.expires&&i.push(`Expires=${r.expires}`),r.maxAge!=null&&i.push(`Max-Age=${r.maxAge}`),r.domain&&i.push(`Domain=${r.domain}`),r.path&&i.push(`Path=${r.path}`),t&&i.push("Secure"),e&&i.push("HttpOnly"),r.sameSite&&i.push(`SameSite=${r.sameSite}`),i.join("; ")}}}function fW(r){let e=r.map(cW),t=n=>e.find(i=>i.name===n);return e.get=n=>t(n)?.value,e.one=n=>t(n),e.has=n=>e.some(i=>i.name===n),e.toObject=()=>{let n={};for(let i of e)n[i.name]=i.value;return n},e.all=()=>[...e],e.each=n=>{for(let i of e)n(i)},e.count=()=>e.length,e.idx=n=>e[n],e}function dW(r){let e={...r};return e.get=t=>{let n=t.toLowerCase();for(let[i,s]of Object.entries(r))if(i.toLowerCase()===n)return s},e.has=t=>{let n=t.toLowerCase();return Object.keys(r).some(i=>i.toLowerCase()===n)},e.toObject=()=>({...r}),e.each=t=>{for(let[n,i]of Object.entries(r))t({key:n,value:i})},e}function Gh(r){let e=dW(r.headers),t=fW(r.cookies||[]);return{status:r.statusText,code:r.status,statusText:r.statusText,headers:e,body:r.body,cookies:t,responseTime:r.responseTime,responseSize:r.responseSize,reason(){return this.statusText},json(){if(typeof this.body=="object")return this.body;try{return JSON.parse(this.body)}catch{return null}},text(){return typeof this.body=="string"?this.body:JSON.stringify(this.body)},to:{have:{status(n){if(r.status!==n)throw new Error(`Expected status ${n} but got ${r.status}`)},header(n,i){let s=r.headers[n]||r.headers[n.toLowerCase()];if(!s)throw new Error(`Expected header "${n}" to exist`);if(i!==void 0&&s!==i)throw new Error(`Expected header "${n}" to be "${i}" but got "${s}"`)},body(n){let i=typeof r.body=="string"?r.body:JSON.stringify(r.body);if(n!==void 0&&i!==n)throw new Error(`Expected body to be "${n}" but got "${i}"`)},jsonBody(n){let i=typeof r.body=="object"?r.body:JSON.parse(r.body);if(n!==void 0&&JSON.stringify(i)!==JSON.stringify(n))throw new Error("Expected JSON body to match")},jsonSchema(n){let i=typeof r.body=="object"?r.body:JSON.parse(r.body),s=O0(i,n);if(s.length>0)throw new Error(`Expected response body to match JSON schema:
|
|
39
39
|
- ${s.join(`
|
|
40
|
-
- `)}`)}},be:{get ok(){if(r.status<200||r.status>=300)throw new Error(`Expected response to be OK (2xx) but got ${r.status}`);return(()=>{})},get success(){if(r.status<200||r.status>=300)throw new Error(`Expected response to be successful (2xx) but got ${r.status}`);return(()=>{})},get error(){if(r.status<400)throw new Error(`Expected response to be error (4xx/5xx) but got ${r.status}`);return(()=>{})},get clientError(){if(r.status<400||r.status>=500)throw new Error(`Expected response to be client error (4xx) but got ${r.status}`);return(()=>{})},get serverError(){if(r.status<500||r.status>=600)throw new Error(`Expected response to be server error (5xx) but got ${r.status}`);return(()=>{})}}}}}function
|
|
40
|
+
- `)}`)}},be:{get ok(){if(r.status<200||r.status>=300)throw new Error(`Expected response to be OK (2xx) but got ${r.status}`);return(()=>{})},get success(){if(r.status<200||r.status>=300)throw new Error(`Expected response to be successful (2xx) but got ${r.status}`);return(()=>{})},get error(){if(r.status<400)throw new Error(`Expected response to be error (4xx/5xx) but got ${r.status}`);return(()=>{})},get clientError(){if(r.status<400||r.status>=500)throw new Error(`Expected response to be client error (4xx) but got ${r.status}`);return(()=>{})},get serverError(){if(r.status<500||r.status>=600)throw new Error(`Expected response to be server error (5xx) but got ${r.status}`);return(()=>{})}}}}}function hf(r){return{_value:r,_negated:!1,_deep:!1,get not(){return this._negated=!this._negated,this},get to(){return this},get be(){return this},get have(){return this},get deep(){return this._deep=!0,this},get and(){return this},get that(){return this},get which(){return this},get is(){return this},get been(){return this},get has(){return this},get with(){return this},get at(){return this},get of(){return this},get same(){return this},get but(){return this},get does(){return this},get still(){return this},get also(){return this},_assert(t,n){if(!(this._negated?!t:t))throw new Error(n)},equal(t){return this._deep?(this._deep=!1,this.eql(t)):(this._assert(this._value===t,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}equal ${JSON.stringify(t)}`),this)},eql(t){let n=JSON.stringify(this._value)===JSON.stringify(t);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}deeply equal ${JSON.stringify(t)}`),this},property(t,n){let i=typeof this._value=="object"&&this._value!==null&&t in this._value;return n!==void 0?this._assert(i&&this._value[t]===n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${t}" with value ${JSON.stringify(n)}`):this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${t}"`),this},get ok(){return this._assert(!!this._value,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be truthy`),this},get exist(){return this._assert(this._value!==null&&this._value!==void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}exist`),this},include(t){let n=!1;return typeof this._value=="string"?n=this._value.includes(t):Array.isArray(this._value)?n=this._value.includes(t):typeof this._value=="object"&&this._value!==null&&(n=t in this._value),this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}include ${JSON.stringify(t)}`),this},contain(t){return this.include(t)},oneOf(t){let n=Array.isArray(t)&&t.includes(this._value);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be one of ${JSON.stringify(t)}`),this},match(t){let n=t.test(String(this._value));return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}match ${t}`),this},above(t){return this._assert(Number(this._value)>t,`Expected ${this._value} to ${this._negated?"not ":""}be above ${t}`),this},below(t){return this._assert(Number(this._value)<t,`Expected ${this._value} to ${this._negated?"not ":""}be below ${t}`),this},greaterThan(t){return this.above(t)},lessThan(t){return this.below(t)},within(t,n){let i=Number(this._value);return this._assert(i>=t&&i<=n,`Expected ${this._value} to ${this._negated?"not ":""}be within ${t}..${n}`),this},get true(){return this._assert(this._value===!0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be true`),this},get false(){return this._assert(this._value===!1,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be false`),this},get null(){return this._assert(this._value===null,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be null`),this},get undefined(){return this._assert(this._value===void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be undefined`),this},get empty(){let t=!1;return this._value===null||this._value===void 0?t=!0:typeof this._value=="string"||Array.isArray(this._value)?t=this._value.length===0:typeof this._value=="object"&&(t=Object.keys(this._value).length===0),this._assert(t,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be empty`),this},length(t){let n=Array.isArray(this._value)||typeof this._value=="string"?this._value.length:Object.keys(this._value||{}).length;return this._assert(n===t,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have length ${t}`),this},lengthOf(t){return this.length(t)},a(t){let n=Array.isArray(this._value)?"array":typeof this._value;return this._assert(n===t.toLowerCase(),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be a(n) ${t} (got ${n})`),this},an(t){return this.a(t)},members(t){let n=this._value,i=Array.isArray(n)&&Array.isArray(t)&&t.every(s=>n.some(a=>JSON.stringify(a)===JSON.stringify(s)));return this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have members ${JSON.stringify(t)}`),this},keys(...t){let n=Array.isArray(t[0])?t[0]:t,i=Object.keys(this._value||{}),s=n.every(a=>i.includes(a));return this._assert(s,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have keys ${JSON.stringify(n)}`),this},string(t){return this._assert(typeof this._value=="string"&&this._value.includes(t),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}contain string "${t}"`),this}}}var Yh=se(()=>{"use strict"});function Kh(r,e=!1){let t=(typeof r=="string"?[r]:r).filter(i=>i&&i.trim());return t.length===0?"":e?`(async () => {
|
|
41
41
|
${t.map((i,s)=>`await (async () => {
|
|
42
42
|
/* --- script unit ${s+1} --- */
|
|
43
43
|
${i}
|
|
@@ -47,10 +47,10 @@ ${i}
|
|
|
47
47
|
|
|
48
48
|
// --- Next Script ---
|
|
49
49
|
|
|
50
|
-
`)}function gf(r,e){return JSON.stringify(r)!==JSON.stringify(e)}function Gl(r){return r.map(e=>{let t=e.args.map(n=>{if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)}).join(" ");return`[${e.level}] ${t}`})}function pW(r){return{log:(...e)=>r.push({level:"log",args:e}),info:(...e)=>r.push({level:"info",args:e}),warn:(...e)=>r.push({level:"warn",args:e}),error:(...e)=>r.push({level:"error",args:e})}}function I0(r){let e=[],t=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let a=s.then(()=>{r.push({name:n,passed:!0})},l=>{r.push({name:n,passed:!1,message:l.message||String(l)})});e.push(a)}else r.push({name:n,passed:!0})}catch(s){r.push({name:n,passed:!1,message:s.message})}};return t.skip=(n,i)=>{r.push({name:n,passed:!0,skipped:!0})},t.fail=n=>{r.push({name:n||"Failed test",passed:!1,message:n||"pm.test.fail()"})},t.index=()=>r.length,t._pendingTests=e,t}function P0(r){let e={};for(let[t,n]of Object.entries(r))e[t]=Array.isArray(n)?n.join(", "):n;return e}function Zh(r,e,t){let n;if(t)try{n=new URL(t).hostname}catch{n=void 0}let i=lt.parseCookieHeaders(r||{},n);return i.length>0?i:Array.isArray(e)&&e.length>0?e.filter(s=>s&&s.name).map(s=>({name:s.name,value:s.value,domain:s.domain??n,path:s.path,expires:s.expires,maxAge:s.maxAge,httpOnly:s.httpOnly,secure:s.secure,sameSite:s.sameSite})):[]}var yf=se(()=>{"use strict";zo()});import*as k0 from"vm";function hW(r){let e=null;try{e=new URL(r)}catch{}return{toString(){return r},valueOf(){return r},[Symbol.toPrimitive](n){return n==="number"?NaN:r},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:r},getPathWithQuery(){return e?e.pathname+e.search:r},getQueryString(){return e?e.search.startsWith("?")?e.search.slice(1):e.search:""},getRemote(){if(!e)return"";let n=e.port||(e.protocol==="https:"?"443":"80");return`${e.hostname}:${n}`},getOAuth1BaseUrl(){return e?`${e.protocol}//${e.host}${e.pathname}`:r},get protocol(){return e?.protocol?.replace(":","")||""},get host(){return e?e.hostname.split("."):[]},get port(){return e?.port||""},get path(){return e?e.pathname.split("/").filter(Boolean):[]},get hash(){return e?.hash?.replace("#","")||""},query:{toObject(){if(!e)return{};let n={};return e.searchParams.forEach((i,s)=>{n[s]=i}),n},has(n){return e?e.searchParams.has(n):!1},get(n){return e?e.searchParams.get(n):void 0},each(n){e&&e.searchParams.forEach((i,s)=>n({key:s,value:i}))}}}}var vf,T0=se(()=>{"use strict";gP();Kh();yf();vf=class{constructor(e,t){this.deps=e;this.initialContext=t;this.timerRegistry=mP(n=>{let i=n instanceof Error?n.message:String(n);this.consoleMessages.push({level:"error",args:[`Uncaught error in async callback: ${i}`]})}),this.initializeSession()}deps;initialContext;vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;timerRegistry;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,t={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,t,this.timerRegistry.timers)}createSharedContext(){let e=this.initialContext,t=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:l=>e.cookieJar?e.cookieJar.get(l,i)?.value:void 0,set:(l,f)=>{e.cookieJar&&e.cookieJar.set({name:l,value:f,domain:i})},has:l=>e.cookieJar?e.cookieJar.has(l,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(l=>({name:l.name,value:l.value})):[],toObject:()=>{if(!e.cookieJar)return{};let l=e.cookieJar.getAll(i),f={};for(let d of l)f[d.name]=d.value;return f},jar:()=>{let l=e.cookieJar;return{getAll(f,d){try{if(!l){d(null,[]);return}let h=l.getAll(f).map(g=>({name:g.name,value:g.value,domain:g.domain,path:g.path,httpOnly:g.httpOnly,secure:g.secure}));d(null,h)}catch(h){d(h,[])}},get(f,d,h){try{if(!l){h(null,void 0);return}let g=l.get(d,f);h(null,g?{name:g.name,value:g.value,domain:g.domain}:void 0)}catch(g){h(g,void 0)}},set(f,d,h,g){try{if(!l){(g||h)?.(null);return}typeof d=="string"&&typeof h=="string"?(l.set({name:d,value:h,domain:f}),g?.(null)):typeof d=="object"&&(l.set({...d,domain:f}),h?.(null))}catch(y){(g||h)?.(y)}},unset(f,d,h){try{if(!l){h?.(null);return}l.delete(d,f),h?.(null)}catch(g){h?.(g)}},clear(f){try{if(!l){f?.(null);return}l.clear(),f?.(null)}catch(d){f?.(d)}}}},remove:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},unset:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},a=this;return{request:this.createRequestObject(t,e),response:null,test:I0(this.assertions),expect:mf,cookies:s,execution:{setNextRequest(l){a._nextRequest=l},skipRequest(){a._skipRequest=!0},runRequest(l,f){let h=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let g=typeof l=="string"?{url:l,method:"GET"}:l,y=await n.sendRequest(g),S=Array.isArray(y?.cookies)?y.cookies.filter(I=>I?.name):[],_=y?.body,R=0;if(typeof _=="string")R=Buffer.byteLength(_,"utf8");else if(Buffer.isBuffer(_))R=_.length;else if(_!=null)try{R=Buffer.byteLength(JSON.stringify(_),"utf8")}catch{}return Yh({executedRequest:null,status:y?.status??0,statusText:y?.statusText??"",headers:y?.headers??{},body:_,cookies:S,responseTime:y?.time,responseSize:R})})();if(typeof f=="function"){h.then(g=>f(null,g),g=>f(g));return}return h},location:{current:n.info?.requestName||"",currentRequestName:n.info?.requestName||"",eventName:"prerequest",toString(){return n.info?.requestName||""}}},setNextRequest(l){a._nextRequest=l},visualizer:{set(l,f){a._visualizerData={template:l,data:f}},clear(){a._visualizerData=void 0}},...n,info:{...n.info||{},eventName:"prerequest",requestName:n.info?.requestName||void 0,requestId:n.info?.requestId||void 0,iteration:e.iteration||0,iterationCount:e.iterationCount||1}}}createRequestObject(e,t){let n=l=>{if(!l)return"none";switch(l){case"raw":return"raw";case"form-data":return"formdata";case"x-www-form-urlencoded":return"urlencoded";case"binary":return"file";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},i=l=>{if(!l)return"none";switch(l){case"raw":return"raw";case"formdata":return"form-data";case"urlencoded":return"x-www-form-urlencoded";case"file":return"binary";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},s={...e.headers,add:l=>{l&&l.key&&(e.headers[l.key]=l.value||"")},get:l=>{for(let[f,d]of Object.entries(e.headers))if(f.toLowerCase()===l.toLowerCase())return d},has:l=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.toLowerCase())return!0;return!1},remove:l=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.toLowerCase()){delete e.headers[f];break}},update:l=>{if(l&&l.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.key.toLowerCase()){e.headers[f]=l.value||"";return}}},upsert:l=>{if(l&&l.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.key.toLowerCase()){e.headers[f]=l.value||"";return}e.headers[l.key]=l.value||""}},toObject:()=>{let l={};for(let[f,d]of Object.entries(e.headers))typeof d=="string"&&(l[f]=d);return l},each:l=>{for(let[f,d]of Object.entries(e.headers))typeof d=="string"&&l({key:f,value:d})}},a={get mode(){return n(e.body?.type)},set mode(l){let f=i(l);e.body?e.body.type=f:e.body={type:f,content:null}},get raw(){let l=e.body?.content;return typeof l=="string"?l:l&&typeof l=="object"?JSON.stringify(l):""},set raw(l){e.body?(e.body.type="raw",e.body.content=l):e.body={type:"raw",content:l}},get formdata(){return e.body?.type==="form-data"&&Array.isArray(e.body.content)?e.body.content:[]},get urlencoded(){return e.body?.type==="x-www-form-urlencoded"&&Array.isArray(e.body.content)?e.body.content:[]},get graphql(){return e.body?.type==="graphql"?e.body.content:null},get file(){return e.body?.type==="binary"?e.body.content:null}};return{get url(){return hW(e.url)},set url(l){e.url=typeof l=="string"?l:String(l)},get method(){return e.method},set method(l){e.method=l},headers:s,get body(){return a},set body(l){if(l==null)e.body=null;else if(typeof l=="string")e.body={type:"raw",content:l};else if(typeof l=="object")if(l.type||l.mode||l.content!==void 0){let f=l.mode?i(l.mode):l.type||"raw";e.body={type:f,format:l.format,content:l.content}}else e.body={type:"raw",content:l}},get params(){return e.params||{}},set params(l){e.params=l||{}},get query(){return e.query||{}},set query(l){e.query=l||{}},get auth(){return t.request?.auth||null},set auth(l){t.request&&(t.request.auth=l)},get certificate(){return t.request?.certificate||null},set certificate(l){t.request&&(t.request.certificate=l)},get description(){return t.request?.description||null},set description(l){t.request&&(t.request.description=l)},get name(){return t.request?.name||null},set name(l){t.request&&(t.request.name=l)},get id(){return t.request?.id||null},get disabled(){return t.request?.disabled||!1},set disabled(l){t.request&&(t.request.disabled=l)},get messages(){return t.request?.messages||[]},get methodPath(){return t.request?.methodPath||null},get metadata(){return t.request?.metadata||[]},getHeaders(l){let f={};for(let[d,h]of Object.entries(e.headers))typeof h=="string"&&(f[d]=h);return f},addQueryParams(l){if(typeof l=="string"){let f=new URLSearchParams(l);for(let[d,h]of f)e.query||(e.query={}),e.query[d]=h}else Array.isArray(l)&&(e.query||(e.query={}),l.forEach(f=>{f.key&&(e.query[f.key]=f.value||"")}))},removeQueryParams(l){e.query&&(typeof l=="string"?delete e.query[l]:Array.isArray(l)&&l.forEach(f=>{let d=typeof f=="string"?f:f.key;d&&delete e.query[d]}))},authorizeUsing(l,f){t.request&&(typeof l=="string"?(t.request.auth||(t.request.auth={}),t.request.auth.type=l,f&&(t.request.auth.parameters=f)):typeof l=="object"&&(t.request.auth=l))},clone(){return{url:e.url,method:e.method,headers:{...e.headers},body:e.body?{...e.body}:null,params:e.params?{...e.params}:{},query:e.query?{...e.query}:{},auth:t.request?.auth,certificate:t.request?.certificate,description:t.request?.description,name:t.request?.name,id:t.request?.id,disabled:t.request?.disabled,metadata:t.request?.metadata,messages:t.request?.messages,methodPath:t.request?.methodPath}},describe(l,f){t.request&&(t.request.description={content:l,type:f||"text/plain"})},setHeader(l,f){e.headers[l]=f},addHeader(l,f){typeof l=="object"&&l!==null?e.headers[l.key]=l.value:e.headers[l]=f},removeHeader(l){delete e.headers[l]},setBody(l,f,d){e.body={type:f||e.body?.type||"raw",format:d||e.body?.format,content:l}}}}injectLegacyGlobals(e,t){let n=this.vmContext;if(!n)return;let i=this.initialContext,s=e==="test"&&t?.executedRequest?t.executedRequest:this.modifiedRequest,a={};for(let[S,_]of Object.entries(s?.headers||{}))typeof _=="string"&&(a[S]=_);let l=s?.body,f=l==null?null:typeof l=="object"&&"content"in l?l.content:l,d=i.request;if(n.request={id:d?.id??"",name:d?.name??"",description:d?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:a,data:f},n.environment=this._liveEnvironmentScope?.toObject?.()??{...this._environmentVariables},n.globals=this._liveGlobalsScope?.toObject?.()??{...this._globals},n.data={...i.iterationData||{}},typeof n.iteration!="number"&&(n.iteration=0),e!=="test"||!t)return;let h=t.body;n.responseBody=h==null?"":typeof h=="string"?h:JSON.stringify(h);let g=t.statusText||"";n.responseCode={code:t.status,name:g,detail:g},n.responseHeaders={...t.headers||{}},n.responseTime=t.responseTime??0,n.responseCookies=(t.cookies||[]).map(S=>({...S}));let y=this;n.tests=new Proxy({},{set(S,_,R){return y.assertions.push({name:String(_),passed:!!R,message:R?void 0:`"${String(_)}" was false`}),!0}})}async executePreRequest(e){let t=Qh(e,this.deps.isolateScripts);if(!t||!t.trim())return{success:!0};try{this.consoleMessages.length=0,this.injectLegacyGlobals("prerequest");let n=this.ctx.variables.replaceIn(t),i=this.deps.scriptTimeoutMs??5e3,s=k0.runInContext(n,this.vmContext,{timeout:i});this.deps.isolateScripts&&s&&typeof s.then=="function"&&await s,(await this.timerRegistry.drain(i)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${i}ms; pending async work was cancelled.`]});let l=Gl(this.consoleMessages),f=this.initialContext.request.body,d=!this.bodiesEqual(this.modifiedRequest.body,f);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:gf(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:d?this.modifiedRequest.body:void 0,params:gf(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:gf(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),localVariables:this.ctx.variables.toLocalObject?.()??{},modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:l.length>0?l:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){let i=[...Gl(this.consoleMessages),`[error] Script execution failed: ${n.message}`];return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:i,modifiedVariables:this.ctx?.variables?.toObject(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,t){let n=Qh(e,this.deps.isolateScripts);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=Yh(t),this.ctx.request=this.createRequestObject(t.executedRequest,this.initialContext),this.injectLegacyGlobals("test",t);let i=this.ctx.variables.replaceIn(n),s=this.deps.scriptTimeoutMs??5e3,a=k0.runInContext(i,this.vmContext,{timeout:s});this.deps.isolateScripts&&a&&typeof a.then=="function"&&await a,this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0),(await this.timerRegistry.drain(s)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${s}ms; pending async work was cancelled.`]});let f=Gl(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:f.length>0?f:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"});let s=[...Gl(this.consoleMessages),`[error] Script execution failed: ${i.message}`];return{testResults:[...this.assertions],consoleOutput:s,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,t){return e===t||!e&&!t?!0:!e||!t?!1:e.type===t.type&&e.format===t.format&&JSON.stringify(e.content)===JSON.stringify(t.content)}dispose(){this.timerRegistry.clearAll(),this.vmContext=null,this.ctx=null,this.assertions=[]}}});import*as nr from"crypto";import*as mW from"querystring";import*as vP from"vm";function bP(r,e){if(r)return r.split(",").map(t=>{let n=t.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function SP(r){if(typeof r=="string"&&r.charCodeAt(0)===30)try{return JSON.parse(r.slice(1))}catch{return r}return r}function gW(r,e){if(r==="@")return"";if(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))return r.slice(1,-1);let t=r.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(t){let n=bP(t[2],e),i=Yi(t[1],n);return i!==null?i:void 0}if(e[r]!==void 0)return SP(e[r]);if(Yo(r)){let n=Go(r,e),i=Ko(r,n);if(i!==void 0)return i}}function yP(r,e,t,n){let i=Buffer.concat([Buffer.from(r,"utf8"),n||Buffer.alloc(0)]),s=[],a=Buffer.alloc(0);for(;Buffer.concat(s).length<e+t;)a=nr.createHash("md5").update(Buffer.concat([a,i])).digest(),s.push(a);let l=Buffer.concat(s);return{key:l.subarray(0,e),iv:l.subarray(e,e+t)}}function q0(r,e,t){let n=i=>r==="aes"?`aes-${i*8}-cbc`:r==="des"?"des-cbc":r==="des-ede3"?"des-ede3-cbc":r;return{encrypt(i,s,a){let l=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=nr.randomBytes(8),{key:d,iv:h}=yP(s,e,t,f),g=nr.createCipheriv(n(e),d,h),y=Buffer.concat([g.update(l),g.final()]),S=Buffer.concat([Buffer.from("Salted__"),f,y]);return{ciphertext:new je(y),salt:new je(f),toString:_=>_?_.stringify(new je(S)):S.toString("base64")}}else{let f=s.toBuffer(),d=a?.iv&&a.iv instanceof je?a.iv.toBuffer():Buffer.alloc(t),h=nr.createCipheriv(n(f.length),f,d);a?.padding===!1&&h.setAutoPadding(!1);let g=Buffer.concat([h.update(l),h.final()]);return{ciphertext:new je(g),toString:y=>y?y.stringify(new je(g)):g.toString("base64")}}},decrypt(i,s,a){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,d;l.subarray(0,8).toString()==="Salted__"?(d=l.subarray(8,16),f=l.subarray(16)):(d=Buffer.alloc(0),f=l);let{key:h,iv:g}=yP(s,e,t,d),y=nr.createDecipheriv(n(e),h,g);return new je(Buffer.concat([y.update(f),y.final()]))}else{let l=s.toBuffer(),f=a?.iv&&a.iv instanceof je?a.iv.toBuffer():Buffer.alloc(t),d=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),h=nr.createDecipheriv(n(l.length),l,f);return a?.padding===!1&&h.setAutoPadding(!1),new je(Buffer.concat([h.update(d),h.final()]))}}}}function yW(){let r=t=>n=>{let i=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8");return new je(nr.createHash(t).update(i).digest())},e=t=>(n,i)=>{let s=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),a=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");return new je(nr.createHmac(t,a).update(s).digest())};return{MD5:r("md5"),SHA1:r("sha1"),SHA224:r("sha224"),SHA256:r("sha256"),SHA384:r("sha384"),SHA512:r("sha512"),SHA3:r("sha3-256"),RIPEMD160:r("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:q0("aes",32,16),DES:q0("des",8,8),TripleDES:q0("des-ede3",24,8),PBKDF2(t,n,i){let s=t instanceof je?t.toBuffer():Buffer.from(String(t),"utf8"),a=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,f=i?.iterations||1;return new je(nr.pbkdf2Sync(s,a,f,l,"sha1"))},enc:{Base64:{stringify:t=>(t instanceof je?t.toBuffer():Buffer.from(String(t))).toString("base64"),parse:t=>je.fromBase64(t)},Utf8:{stringify:t=>(t instanceof je?t.toBuffer():Buffer.from(String(t))).toString("utf8"),parse:t=>je.fromUtf8(t)},Hex:{stringify:t=>(t instanceof je?t.toBuffer():Buffer.from(String(t))).toString("hex"),parse:t=>je.fromHex(t)},Latin1:{stringify:t=>(t instanceof je?t.toBuffer():Buffer.from(String(t))).toString("latin1"),parse:t=>new je(Buffer.from(t,"latin1"))},Utf16:{stringify:t=>(t instanceof je?t.toBuffer():Buffer.from(String(t))).toString("utf16le"),parse:t=>new je(Buffer.from(t,"utf16le"))},Utf16BE:{stringify:t=>(t instanceof je?t.toBuffer():Buffer.from(String(t))).swap16().toString("utf16le"),parse:t=>new je(Buffer.from(t,"utf16le").swap16())}},lib:{WordArray:{create:t=>t?typeof t=="string"?new je(Buffer.from(t,"utf8")):Buffer.isBuffer(t)?new je(t):new je(Buffer.from(String(t))):new je(Buffer.alloc(0)),random:t=>new je(nr.randomBytes(t))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var je,rs,bf=se(()=>{"use strict";ah();uh();fh();E0();T0();Kh();je=class r{_buffer;constructor(e){this._buffer=typeof e=="string"?Buffer.from(e,"utf8"):e}toString(e){return e?e.stringify(this):this._buffer.toString("hex")}toBuffer(){return this._buffer}static fromHex(e){return new r(Buffer.from(e,"hex"))}static fromBase64(e){return new r(Buffer.from(e,"base64"))}static fromUtf8(e){return new r(Buffer.from(e,"utf8"))}};rs=class r{constructor(e,t=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=x0(t)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new vf({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this),isolateScripts:this.scopeMode==="isolated",scriptTimeoutMs:this.scriptTimeoutMs},e)}createVM(e,t,n){let i=this.moduleLoader.getGlobalSetupExports(),s=this.moduleLoader.createRequireFunction();e.require=s,e.vault=this.createVault();let a={ctx:e,hf:e,pm:e,console:t,...i||{},global:i,setTimeout:n?.setTimeout??setTimeout,setInterval:n?.setInterval??setInterval,clearTimeout:n?.clearTimeout??clearTimeout,clearInterval:n?.clearInterval??clearInterval,URL,URLSearchParams,Buffer,atob:l=>Buffer.from(l,"base64").toString("binary"),btoa:l=>Buffer.from(l,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:nr,_:s("lodash"),require:s,moment:Gh(),querystring:mW,CryptoJS:yW(),tv4:(()=>{try{return s("tv4")}catch{return}})(),postman:{setNextRequest:l=>e.setNextRequest?.(l),setGlobalVariable:(l,f)=>e.globals?.set(l,f),getGlobalVariable:l=>e.globals?.get(l),clearGlobalVariable:l=>e.globals?.unset(l),setEnvironmentVariable:(l,f)=>e.environment?.set(l,f),getEnvironmentVariable:l=>e.environment?.get(l),clearEnvironmentVariable:l=>e.environment?.unset(l),getResponseHeader:l=>{let f=e.response?.headers?.get?.(l);return f===void 0?null:f},getResponseCookie:l=>{let f=e.response?.cookies;if(f&&typeof f[Symbol.iterator]=="function"){for(let d of f)if(d?.name&&d.name.toLowerCase()===l.toLowerCase())return{...d}}return null}},jsonStringify:(l,f,d)=>JSON.stringify(l,f,d),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let f=this.moduleLoader.createRequireFunction()("xml2js"),d;return f.parseString(l,{explicitArray:!1},(h,g)=>{if(h)throw h;d=g}),d}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return vP.createContext(a)}createCommonContext(e,t){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},a={...e.environmentVariables||{}},l=e.iterationData||{},f=this.createMergedVariableScope(n,a,i,s,l),d=this.createGlobalsScope(s,e.onGlobalsChange),h=this.createVariableScope(i),g=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),y={...g,set:(_,R)=>{let I=this.serializeValue(R);g.set(_,I),n[_]=I},unset(_){g.unset(_),delete n[_]},clear(){g.clear();for(let _ of Object.keys(a))delete n[_]}};return d.replaceIn=f.replaceIn,h.replaceIn=f.replaceIn,y.replaceIn=f.replaceIn,{globals:d,collectionVariables:h,variables:f,environment:y,iterationData:{get:_=>l[_],has:_=>_ in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:mf,info:e.info||{eventName:t,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:r.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{}return e}}createVariableScope(e){return{get:t=>this.deserializeValue(e[t]),set:(t,n)=>{e[t]=this.serializeValue(n)},has(t){return t in e},unset(t){delete e[t]},clear(){Object.keys(e).forEach(t=>delete e[t])},toObject(){return{...e}}}}createGlobalsScope(e,t){let n=(i,s,a)=>{t&&t(i,s,a)};return{get:i=>this.deserializeValue(e[i]),set:(i,s)=>{let a=this.serializeValue(s);e[i]=a,n("set",i,a)},has(i){return i in e},unset(i){delete e[i],n("unset",i)},clear(){Object.keys(e).forEach(i=>delete e[i]),n("clear")},toObject(){return{...e}}}}createMergedVariableScope(e,t,n,i,s={}){let a={get:l=>l in e?this.deserializeValue(e[l]):l in s?s[l]:l in t?this.deserializeValue(t[l]):l in n?this.deserializeValue(n[l]):this.deserializeValue(i[l]),set:(l,f)=>{e[l]=this.serializeValue(f)},has(l){return l in e||l in s||l in t||l in t||l in n||l in i},unset(l){delete e[l]},clear(){Object.keys(e).forEach(l=>delete e[l])},toObject(){return{...i,...n,...t,...s,...e}},toLocalObject(){return{...n,...t,...s,...e}},replaceIn(l){if(!l||typeof l!="string")return l;let f=a.toObject(),d=20,h=y=>y.replace(/\{\{([^}]+)\}\}/g,(S,_)=>{let R=_.trim(),I=R.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(I)try{let B=bP(I[2],f),V=Yi(I[1],B);return V!==null?String(V):S}catch{return S}let q=qc(R);if(q){let B=gW(q.input,f);if(B!==void 0){let V=Ac(B,q.filters,f);return V!==void 0?String(V):S}return S}let U=a.get(R);if(U!==void 0)return String(U);if(Yo(R)){let B={};for(let[X,T]of Object.entries(f))B[X]=SP(T);let V=Go(R,B),W=Ko(R,V);if(W!==void 0)return String(W)}return S}),g=l;for(let y=0;y<d;y++){let S=h(g);if(S===g)break;g=S}return g}};return a}createEnvironmentScope(e,t,n,i){let s=(a,l,f)=>{n&&(i?n(a,l,f):n(l||"",a==="set"?f:void 0))};return{name:t||"",get:a=>this.deserializeValue(e[a]),set:(a,l)=>{let f=this.serializeValue(l);e[a]=f,s("set",a,f)},has(a){return a in e},unset(a){delete e[a],s("unset",a)},clear(){Object.keys(e).forEach(a=>delete e[a]),s("clear")},toObject(){return{...e}}}}createVault(){let e=this.secretRegistry,t=()=>{throw new Error("pm.vault is read-only in HTTP Forge. Use environment variables or {{secret:provider/path}} tokens to manage secrets.")};return{async get(n){if(!e)throw new Error('pm.vault is not available \u2014 no secret providers are configured. Configure a provider under "secrets.providers" to use pm.vault.get().');let i=`secret:${n}`;return(await e.resolveSecretTokens(`{{${i}}}`))[i]},set:t,unset:t}}createSendRequest(){return this.httpService?(e,t)=>{let n=typeof e=="string"?{url:e,method:"GET"}:e,i=this.httpService.execute({url:n.url,method:n.method||"GET",headers:n.headers||{},body:n.body,...n});if(t){i.then(s=>t(null,s)).catch(s=>t(s,null));return}return i}:(e,t)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(t){t(n,null);return}return Promise.reject(n)}}}});var A0,da,Xh=se(()=>{"use strict";A0={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain",javascript:"application/javascript",css:"text/css","x-www-form-urlencoded":"application/x-www-form-urlencoded","form-data":"multipart/form-data",graphql:"application/json"},da=class{sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let t={};for(let[n,i]of Object.entries(e))t[n]=this.sanitizeHeaderValue(String(i));return t}encodeBody(e){if(!e||e.type==="none")return null;let{type:t,content:n}=e;switch(t){case"x-www-form-urlencoded":return this.encodeUrlEncodedBody(n);case"form-data":return n;case"graphql":return this.encodeGraphQLBody(n);case"raw":return n;default:return n}}encodeUrlEncodedBody(e){if(Array.isArray(e)){let t=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&t.append(n.key,n.value||"");return t.toString()}return typeof e=="string"?e:String(e)}encodeGraphQLBody(e){if(typeof e=="string")try{e=JSON.parse(e)}catch{return e}if(typeof e=="object"&&e!==null&&e.query){let t=e.variables;if(typeof t=="string")try{t=t.trim()?JSON.parse(t):void 0}catch{t=void 0}return JSON.stringify({query:e.query,...t!=null?{variables:t}:{},...e.operationName?{operationName:e.operationName}:{}})}return JSON.stringify(e)}setContentTypeHeader(e,t,n){if(Object.keys(e).some(a=>a.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!t||t.type==="none")return;let s;switch(t.type){case"x-www-form-urlencoded":s=A0["x-www-form-urlencoded"];break;case"raw":s=t.format?A0[t.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=A0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var ha,em=se(()=>{"use strict";ha=class{parse(e,t){return t.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:[t]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let t=e.split(/\r?\n/).filter(s=>s.trim());if(t.length<2)return[{}];let n=this.parseCsvLine(t[0]),i=[];for(let s=1;s<t.length;s++){let a=this.parseCsvLine(t[s]),l={};n.forEach((f,d)=>{l[f]=a[d]||""}),i.push(l)}return i}parseCsvLine(e){let t=[],n="",i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=e[s+1];a==='"'?i&&l==='"'?(n+='"',s++):i=!i:a===","&&!i?(t.push(n.trim()),n=""):n+=a}return t.push(n.trim()),t}}});import*as Ql from"crypto";var bW,Rf,M0=se(()=>{"use strict";bW=3e4,Rf=class{constructor(e,t,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=t;this.envConfigService=n;this.httpService=i;this.callbackPath=s}secretStore;browserService;envConfigService;httpService;callbackPath;tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,t){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,t),tokenType:e.tokenPrefix||"Bearer",raw:{}};let n=this.buildCacheKeyString(e),i=this.tokenCache.get(n);if(i&&!this.isExpired(i))return i;if(i?.refreshToken)try{return await this.refreshToken(e,i.refreshToken,t)}catch{this.tokenCache.delete(n)}if(!i){let a=await this.secretStore.get(`oauth2_refresh_${n}`);if(a)try{return await this.refreshToken(e,a,t)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,t,"client_credentials");break;case"password":s=await this.fetchToken(e,t,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,t);break;case"implicit":s=await this.implicitFlow(e,t);break;default:throw new Error(`Unknown OAuth2 grant type: ${e.grantType}`)}return this.tokenCache.set(n,s),s.refreshToken&&await this.storeRefreshToken(n,s.refreshToken),s}async refreshToken(e,t,n){let i=this.resolve(e.tokenUrl||"",n);if(!i)throw new Error("OAuth2 tokenUrl is required for token refresh");let s=this.resolve(e.clientId||"",n),a=this.resolve(e.clientSecret||"",n),l=new URLSearchParams;l.append("grant_type","refresh_token"),l.append("refresh_token",t);let f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,l,s,a,n);let d=await this.httpService.execute({method:"POST",url:i,headers:f,body:l.toString()}),h=this.parseTokenResponse(d.body,e);h.refreshToken||(h.refreshToken=t);let g=this.buildCacheKeyString(e);return this.tokenCache.set(g,h),h.refreshToken&&await this.storeRefreshToken(g,h.refreshToken),h}async authorizationCodeFlow(e,t){let n=this.resolve(e.authUrl||"",t),i=this.resolve(e.tokenUrl||"",t),s=this.resolve(e.clientId||"",t),a=this.resolve(e.clientSecret||"",t),l=e.scope?this.resolve(e.scope,t):void 0;if(!n)throw new Error("OAuth2 authUrl is required for authorization code flow");if(!i)throw new Error("OAuth2 tokenUrl is required for authorization code flow");if(!s)throw new Error("OAuth2 clientId is required for authorization code flow");let f=e.usePkce!==!1,d,h,g;if(f){d=this.generateCodeVerifier();let X=e.pkceMethod||"S256";h=X==="S256"?this.generateCodeChallengeS256(d):d,g=X}let y=e.state||Ql.randomBytes(16).toString("hex"),S=await this.getCallbackUri(),_=new URL(n);if(_.searchParams.set("response_type","code"),_.searchParams.set("client_id",s),_.searchParams.set("redirect_uri",S),l&&_.searchParams.set("scope",l),_.searchParams.set("state",y),h&&(_.searchParams.set("code_challenge",h),_.searchParams.set("code_challenge_method",g)),e.audience&&_.searchParams.set("audience",this.resolve(e.audience,t)),e.resource&&_.searchParams.set("resource",this.resolve(e.resource,t)),e.extraParams)for(let[X,T]of Object.entries(e.extraParams))_.searchParams.set(X,this.resolve(T,t));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let R=new Promise((X,T)=>{this.pendingAuthCallback={resolve:X,reject:T,state:y}});await this.browserService.openExternal(_.toString());let I;try{I=await Promise.race([R,new Promise((X,T)=>setTimeout(()=>{this.pendingAuthCallback=null,T(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(I.state&&I.state!==y)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let q=new URLSearchParams;q.append("grant_type","authorization_code"),q.append("code",I.code),q.append("redirect_uri",S),d&&q.append("code_verifier",d);let U={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,U,q,s,a,t);let B=await this.httpService.execute({method:"POST",url:i,headers:U,body:q.toString()}),V=this.parseTokenResponse(B.body,e),W=this.buildCacheKeyString(e);return this.tokenCache.set(W,V),V.refreshToken&&await this.storeRefreshToken(W,V.refreshToken),V}async implicitFlow(e,t){let n=this.resolve(e.authUrl||"",t),i=this.resolve(e.clientId||"",t),s=e.scope?this.resolve(e.scope,t):void 0;if(!n)throw new Error("OAuth2 authUrl is required for implicit flow");if(!i)throw new Error("OAuth2 clientId is required for implicit flow");let a=e.state||Ql.randomBytes(16).toString("hex"),l=await this.getCallbackUri(),f=new URL(n);if(f.searchParams.set("response_type","token"),f.searchParams.set("client_id",i),f.searchParams.set("redirect_uri",l),s&&f.searchParams.set("scope",s),f.searchParams.set("state",a),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,t)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,t)),e.extraParams)for(let[S,_]of Object.entries(e.extraParams))f.searchParams.set(S,this.resolve(_,t));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let d=new Promise((S,_)=>{this.pendingImplicitCallback={resolve:S,reject:_,state:a}});await this.browserService.openExternal(f.toString());let h;try{h=await Promise.race([d,new Promise((S,_)=>setTimeout(()=>{this.pendingImplicitCallback=null,_(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(h.state&&h.state!==a)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let g={accessToken:h.accessToken,tokenType:h.tokenType||e.tokenPrefix||"Bearer",expiresAt:h.expiresIn?Date.now()+h.expiresIn*1e3:void 0,raw:{access_token:h.accessToken,token_type:h.tokenType,expires_in:h.expiresIn}},y=this.buildCacheKeyString(e);return this.tokenCache.set(y,g),g}handleAuthorizationCallback(e,t,n){if(n){let i=new Error(`OAuth2 authorization error: ${n}`);this.pendingAuthCallback?.reject(i),this.pendingImplicitCallback?.reject(i),this.pendingAuthCallback=null,this.pendingImplicitCallback=null;return}if(e&&this.pendingAuthCallback){this.pendingAuthCallback.resolve({code:e,state:t}),this.pendingAuthCallback=null;return}!e&&!this.pendingAuthCallback&&this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow did not receive access_token")),this.pendingImplicitCallback=null)}handleImplicitCallback(e,t,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:t,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let t=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(t),this.secretStore.delete(`oauth2_refresh_${t}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,t,n){let i=this.resolve(e.tokenUrl||"",t);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",t),a=this.resolve(e.clientSecret||"",t),l=e.scope?this.resolve(e.scope,t):void 0,f=new URLSearchParams;if(f.append("grant_type",n),l&&f.append("scope",l),n==="password"){let g=this.resolve(e.username||"",t),y=this.resolve(e.password||"",t);if(!g)throw new Error("OAuth2 password grant requires username");f.append("username",g),f.append("password",y)}if(e.audience&&f.append("audience",this.resolve(e.audience,t)),e.resource&&f.append("resource",this.resolve(e.resource,t)),e.extraParams)for(let[g,y]of Object.entries(e.extraParams))f.append(g,this.resolve(y,t));let d={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,d,f,s,a,t);let h=await this.httpService.execute({method:"POST",url:i,headers:d,body:f.toString()});return this.parseTokenResponse(h.body,e)}applyClientAuth(e,t,n,i,s,a){if(e.clientAuthentication==="header"){let l=Buffer.from(`${i}:${s}`).toString("base64");t.Authorization=`Basic ${l}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,t){let n=e;if(typeof n=="string")try{n=JSON.parse(n)}catch{throw new Error("OAuth2 token response is not valid JSON")}if(!n||typeof n!="object")throw new Error("OAuth2 token response is not a valid JSON object");let i=n,s=t.tokenField||"access_token",a=i[s];if(!a)throw new Error(`OAuth2 token fetch failed: '${s}' not present in response`);let l=typeof i.expires_in=="number"?i.expires_in:void 0;return{accessToken:a,tokenType:i.token_type||t.tokenPrefix||"Bearer",expiresAt:l?Date.now()+l*1e3:void 0,refreshToken:i.refresh_token,scope:i.scope,raw:i}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-bW:!1}buildCacheKeyString(e){return`${e.tokenUrl||""}|${e.clientId||""}|${e.scope||""}|${e.grantType}`}async getCallbackUri(){let e=`${this.browserService.uriScheme}://${this.callbackPath}`;return this.browserService.asExternalUri(e)}resolve(e,t){return this.envConfigService.resolveVariables(e,t)}generateCodeVerifier(){return Ql.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Ql.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,t){try{await this.secretStore.store(`oauth2_refresh_${e}`,t)}catch{}}}});import*as ma from"fs";import*as Js from"path";function Zl(r,e={}){let t=[];Object.entries(e).forEach(([n,i])=>{t.push(`${n}=${i}`)}),t.length&&ma.writeFileSync(r,t.join(`
|
|
51
|
-
`),"utf-8")}function
|
|
52
|
-
`)}function RW(r){let e=r.url;if(r.query&&r.query.length){let t=r.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");t&&(e+=(e.includes("?")?"&":"?")+t)}return e}var rm=se(()=>{"use strict";bn()});import*as fr from"fs";import*as N0 from"path";var Xl,D0=se(()=>{"use strict";bn();Xl=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){fr.existsSync(this.collectionsDir)||fr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!fr.existsSync(this.collectionsDir))return[];let e=fr.readdirSync(this.collectionsDir),t=[];for(let n of e)if(n.endsWith(".json"))try{let i=N0.join(this.collectionsDir,n),s=fr.readFileSync(i,"utf-8"),a=JSON.parse(s);a.id&&a.name&&(this.cache.set(a.id,a),t.push(a))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return t}load(e){if(this.cache.has(e))return this.cache.get(e);let t=this.getCollectionPath(e);if(fr.existsSync(t))try{let n=fr.readFileSync(t,"utf-8"),i=JSON.parse(n);return this.cache.set(e,i),i}catch(n){console.error(`[JsonCollectionLoader] Failed to load collection ${e}:`,n);return}}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=pt(e.name));let t=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await fr.promises.writeFile(t,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let t=this.getCollectionPath(e);if(!fr.existsSync(t))return!1;try{return await fr.promises.unlink(t),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return fr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return N0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,t){}async create(e,t){let n={id:t||pt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,t,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,t);s&&(s.scripts=n,await this.save(i))}loadScripts(e,t){let n=this.load(e);return n?this.findItemById(n.items,t)?.scripts:void 0}async updateCollectionMetadata(e,t){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);t.name!==void 0&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.version!==void 0&&(n.version=t.version),t.variables!==void 0&&(n.variables=t.variables),t.auth!==void 0&&(n.auth=t.auth),await this.save(n)}async saveItem(e,t,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,t.id);if(s)Object.assign(s,t);else if(n){let a=this.findItemById(i.items,n);if(a&&a.type==="folder")a.items=a.items||[],a.items.push(t);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(t);await this.save(i)}async deleteItem(e,t){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,t);return i&&await this.save(n),i}async updateItem(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,t);if(!s)return!1;let{id:a,type:l,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,t);if(!s)return!1;let a={...s};if(!this.deleteItemById(i.items,t))return!1;if(n){let l=this.findItemById(i.items,n);if(l&&l.type==="folder")l.items=l.items||[],l.items.push(a);else return i.items.push(a),!1}else i.items.push(a);return await this.save(i),!0}async reorderItems(e,t,n){let i=this.load(e);if(!i)return!1;try{let s;if(t){let f=this.findItemById(i.items,t);if(!f||!f.items)return!1;s=f.items}else s=i.items;let a=new Map(s.map(f=>[f.id,f])),l=[];for(let f of n){let d=a.get(f);d&&(l.push(d),a.delete(f))}for(let f of a.values())l.push(f);if(t){let f=this.findItemById(i.items,t);f&&(f.items=l)}else i.items=l;return await this.save(i),!0}catch(s){return console.error("[JsonCollectionLoader] Failed to reorder items:",s),!1}}findItemById(e,t){for(let n of e){if(n.id===t)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,t);if(i)return i}}}deleteItemById(e,t){for(let n=0;n<e.length;n++){if(e[n].id===t)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,t))return!0}return!1}}});var xf,F0=se(()=>{"use strict";nh();D0();xf=class{static create(e){let t=e.getStorageConfig(),n=e.getCollectionsPath();return t.format==="folder"?new Ds(n):new Xl(n)}static createForFormat(e,t){return e==="folder"?new Ds(t):new Xl(t)}}});import*as _t from"fs";import*as Zn from"path";function wP(r){if(typeof r!="string")return"text";let e=r.trim();try{let t=JSON.parse(e);if(typeof t=="object"&&t!==null)return"json"}catch{}return/^<\?xml/.test(e)||/^<([a-zA-Z_][\w\-\.]*)[\s>]/.test(e)?/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":"xml":/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":/^(function\s*\(|\(\)\s*=>|const |let |var |export |import )/.test(e)?"javascript":"text"}function CW(r){return{info:{name:r.name,_postman_id:r.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:r.items.map(e=>_P(e)),event:L0(r.scripts),variable:r.variables?Object.entries(r.variables).map(([e,t])=>({key:e,value:t})):[]}}function _P(r){if(r.type==="folder")return{name:r.name,item:r.items?r.items.map(_P):[],event:L0(r.scripts)};if(r.type==="request"){let e=r;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(t=>t.enabled!==!1).map(xW),url:EW(e),body:OW(e),auth:IW(e.auth),description:e.description},event:L0(e.scripts),protocolProfileBehavior:PW(e.settings)}}}function xW(r){return{key:r.key,value:r.value,disabled:r.enabled===!1}}function EW(r){let e=r.url,t=r.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=t.match(/^([^\/\?]+)/);if(i){let d=i[1];/^{{.*}}$/.test(d)?n=[d]:n=d.split(".")}let s=[],a=t.match(/^[^\/\?]+(\/[^\?]*)?/);if(a&&a[1]!==void 0){let d=a[1].replace(/^\//,"");d.endsWith("/")?(s=d.slice(0,-1).split("/"),s.push("")):s=d.length>0?d.split("/"):[]}let l;if(Array.isArray(r.query)&&r.query.length>0)l=r.query.map(d=>{let h={key:d.key,value:d.value};return d.enabled===!1&&(h.disabled=!0),h});else{let d=t.indexOf("?");d!==-1&&(l=t.substring(d+1).split("&").map(g=>{let[y,...S]=g.split("=");return{key:y,value:S.join("=")}}))}let f;return r.params&&typeof r.params=="object"&&(f=Object.entries(r.params).map(([d,h])=>({key:d,value:String(h)}))),{raw:e,host:n.length>0?n:void 0,path:s.length>0?s:void 0,query:l&&l.length>0?l:void 0,variable:f&&f.length>0?f:void 0}}function OW(r){if(!r.body)return;let e=r.body;if(typeof e=="string"){let s=wP(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||wP(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let t=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(t)return{mode:"formdata",formdata:t.map(s=>({key:s.key,value:s.value,type:s.type||"text",disabled:s.enabled===!1}))};let n=e.type==="x-www-form-urlencoded"&&Array.isArray(e.content)?e.content:e.type==="urlencoded"&&Array.isArray(e.fields)?e.fields:null;if(n)return{mode:"urlencoded",urlencoded:n.map(s=>({key:s.key,value:s.value,disabled:s.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="binary")return{mode:"binary",file:{}};let i=e.type==="graphql"?e.content??(e.query?e:null):null;if(i){let s=i.query??"",a=i.variables;return{mode:"graphql",graphql:{query:s,variables:a?typeof a=="string"?a:JSON.stringify(a):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function IW(r){if(!(!r||!r.type||r.type==="none")){if(r.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:r.bearerToken,type:"string"}]};if(r.type==="basic"&&r.basicAuth)return{type:"basic",basic:[{key:"username",value:r.basicAuth.username,type:"string"},{key:"password",value:r.basicAuth.password,type:"string"}]}}}function PW(r){if(!r)return;let e={};return r.followRedirects===!1&&(e.followRedirects=!1),r.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),r.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),r.maxRedirects!==void 0&&(e.maxRedirects=r.maxRedirects),r.strictSSL===!1&&(e.disableUrlEncoding=!1),r.timeout!==void 0&&(e.requestTimeout=r.timeout),Object.keys(e).length>0?e:void 0}function L0(r){if(!r)return[];let e=[];return r.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[r.preRequest]}}),r.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[r.postResponse]}}),e}var Ef,j0=se(()=>{"use strict";bn();rm();F0();Ef=class{constructor(e,t,n){this.workspaceRoot=e;this.configService=t;this.fileWatcherFactory=n;this.collectionsDir=t.getCollectionsPath(),this.loader=xf.create(t),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;debounceTimer=null;selfWritePending=!1;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){_t.existsSync(this.collectionsDir)||_t.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let t of e)this.collections.set(t.id,t)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null;let t=this.selfWritePending;this.selfWritePending=!1,t||this.loadCollections(),this.onCollectionsChanged?.()},300)};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let t of this.collections.values())if(t.id===e)return t}getCollectionByName(e){let t=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===t)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=pt(e.name)),this.selfWritePending=!0,await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let t=this.collections.get(e);return t?.variables?{...t.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,t,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[t]=String(n)}deleteCollectionVariable(e,t){let n=this.localCollectionValues.get(e);n&&delete n[t]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,t){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,t)}findRequestByPath(e,t){let n=this.collections.get(e);if(!n)return;let i=t.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,t,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,t,n);if(s){let a=this.findItemRecursive(i.items,t);if(a){let{id:l,type:f,...d}=n;Object.assign(a,d)}}return s}async addRequest(e,t,n){let i=this.collections.get(e);if(!i)return!1;t.id||(t.id=pt(t.name)),this.selfWritePending=!0;try{if(await this.loader.saveItem(e,t,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(t))}else i.items.push(t);return!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,t){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,t);return i&&this.deleteItemRecursive(n.items,t),i}getAllRequests(e){let t=this.collections.get(e);if(!t)return[];let n=[];return this.collectRequestsRecursive(t.items,n),n}findItemRecursive(e,t){for(let n of e){if(n.id===t)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,t);if(i)return i}}}findItemByPath(e,t){if(t.length===0)return;let[n,...i]=t,s=e.find(a=>a.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,t,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===t)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,t,n))return!0}return!1}deleteItemRecursive(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===t)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,t))return!0}return!1}collectRequestsRecursive(e,t){for(let n of e)n.type==="request"?t.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,t)}async createCollection(e){let t={id:pt(e),name:e,items:[]};return await this.saveCollection(t),t}async renameCollection(e,t){let n=this.collections.get(e);return n?(n.name=t,await this.saveCollection(n),!0):!1}async duplicateCollection(e,t){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);this.selfWritePending=!0;let i=pt(t),s=this.loader.getCollectionPath(e),a=Zn.join(this.collectionsDir,i);if(!_t.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let l=Zn.join(a,"collection.json");if(_t.existsSync(l)){let d=JSON.parse(_t.readFileSync(l,"utf-8"));d.id=i,d.name=t,_t.writeFileSync(l,JSON.stringify(d,null,2))}else _t.writeFileSync(l,JSON.stringify({id:i,name:t},null,2));this.loadCollections();let f=this.collections.get(i);if(!f)throw new Error("Failed to load duplicated collection");return f}async createFolder(e){let t=this.collections.get(e.collectionId);if(!t)throw new Error("Collection not found");this.selfWritePending=!0;let n={id:pt(e.name),type:"folder",name:e.name,items:[]};if(await this.loader.saveItem(e.collectionId,n,e.parentId),e.parentId){let i=this.findItemById(t.items,e.parentId);i&&i.type==="folder"&&(i.items=i.items||[],i.items.push(n))}else t.items.push(n);return n}async deleteFolder(e,t){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,t);return i&&this.deleteItemById(n.items,t),i}async renameFolder(e,t,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,t,{name:n});if(s){let a=this.findItemById(i.items,t);a&&(a.name=n)}return s}async duplicateFolder(e,t,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,t);if(!s||!_t.existsSync(s))throw new Error(`Folder not found on disk: ${t}`);let a=Zn.dirname(s),l=pt(n),f=Zn.join(a,l);this.selfWritePending=!0,this.copyDirRecursive(s,f);let d=Zn.join(f,"folder.json");if(_t.existsSync(d)){let y=JSON.parse(_t.readFileSync(d,"utf-8"));y.id=l,y.name=n,_t.writeFileSync(d,JSON.stringify(y,null,2))}else _t.writeFileSync(d,JSON.stringify({id:l,name:n,type:"folder"},null,2));this.loadCollections();let h=this.collections.get(e),g=h?this.findItemById(h.items,l):void 0;return g||{id:l,type:"folder",name:n,items:[]}}async createRequest(e){let t=this.collections.get(e.collectionId);if(!t)throw new Error("Collection not found");this.selfWritePending=!0;let n={id:e.id||pt(e.name),type:"request",name:e.name,method:e.method||"GET",url:e.url,params:e.params,query:e.query,headers:e.headers,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts,deprecated:e.deprecated,description:e.description,doc:e.doc,responseSchema:e.responseSchema,bodySchema:e.bodySchema};if(await this.loader.saveItem(e.collectionId,n,e.parentId),e.parentId){let i=this.findItemById(t.items,e.parentId);i&&i.type==="folder"&&(i.items=i.items||[],i.items.push(n))}else t.items.push(n);return n}async renameRequest(e,t,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,t,{name:n});if(s){let a=this.findItemById(i.items,t);a&&(a.name=n)}return s}async moveItem(e,t,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.moveItem(e,t,n);return s&&this.loadCollections(),s}async reorderItems(e,t,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.reorderItems(e,t,n);return s&&this.loadCollections(),s}findItemById(e,t){for(let n of e){if(n.id===t)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,t);if(i)return i}}}copyDirRecursive(e,t){_t.existsSync(t)||_t.mkdirSync(t,{recursive:!0});for(let n of _t.readdirSync(e,{withFileTypes:!0})){let i=Zn.join(e,n.name),s=Zn.join(t,n.name);n.isDirectory()?this.copyDirRecursive(i,s):_t.copyFileSync(i,s)}}deleteItemById(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===t)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,t))return!0}return!1}async importCollection(e){let t=_t.readFileSync(e,"utf-8"),n;try{n=JSON.parse(t)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||pt(n.name||"Imported Collection"),name:n.name||"Imported Collection",description:n.description,items:n.items||[]};return await this.saveCollection(i),i}async importPostmanCollection(e){let t=d=>{if(!d)return;switch(d.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:d.bearer?.find(q=>q.key==="token")?.value||""};case"basic":let y=d.basic?.find(q=>q.key==="username"),S=d.basic?.find(q=>q.key==="password");return{type:"basic",basicAuth:{username:y?.value||"",password:S?.value||""}};case"apikey":let _=d.apikey?.find(q=>q.key==="key"),R=d.apikey?.find(q=>q.key==="value"),I=d.apikey?.find(q=>q.key==="in");return{type:"apikey",apikey:{key:_?.value||"",value:R?.value||"",in:I?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=d=>{if(!Array.isArray(d)||d.length===0)return;let h={};for(let g of d){let y=g.script?.exec;if(!y)continue;let S=Array.isArray(y)?y.join(`
|
|
53
|
-
`):y;g.listen==="prerequest"?h.preRequest=S:g.listen==="test"&&(h.postResponse=S)}return h.preRequest||h.postResponse?h:void 0},i=d=>{if(!d||typeof d!="object")return;let h={};return d.followRedirects===!1&&(h.followRedirects=!1),d.followOriginalHttpMethod===!0&&(h.followOriginalMethod=!0),d.followAuthorizationHeader===!1&&(h.followAuthHeader=!1),d.maxRedirects!==void 0&&(h.maxRedirects=d.maxRedirects),d.requestTimeout!==void 0&&(h.timeout=d.requestTimeout),Object.keys(h).length>0?h:void 0},s=d=>{if(!d||typeof d=="string")return;let h=d.query;if(!(!Array.isArray(h)||h.length===0))return h.map(g=>({key:g.key||"",value:g.value||"",enabled:g.disabled!==!0}))},a=d=>{if(typeof d=="string")return d;if(!d)return"";let h=new Set;if(Array.isArray(d.variable))for(let y of d.variable)y.key&&h.add(y.key);if(h.size===0&&d.raw)return d.raw;let g="";if(d.protocol&&(g+=d.protocol+"://"),d.host&&(g+=Array.isArray(d.host)?d.host.join("."):d.host),d.port&&(g+=":"+d.port),d.path){let S=(Array.isArray(d.path)?d.path:[d.path]).map(_=>{let R=_.startsWith(":")?_.substring(1):_;return h.has(R)?":"+R:(_.startsWith(":"),_)});g+="/"+S.join("/")}return!g&&d.raw?d.raw:g},l=d=>d.map(h=>{if(h.item)return{id:pt(h.name),type:"folder",name:h.name,description:h.description,auth:t(h.auth),scripts:n(h.event),items:l(h.item)};{let g=h.request||{};return{id:pt(h.name),type:"request",name:h.name,description:h.description||g.description,method:typeof g.method=="string"?g.method:"GET",url:a(g.url),query:s(g.url),headers:Array.isArray(g.header)?g.header.map(y=>({key:y.key||y.name||"",value:y.value||y.value||"",enabled:y.disabled!==!0})):[],body:(()=>{let y=g.body;if(y){if(y.mode==="raw"&&y.raw){let S=y.options?.raw?.language;return{type:"raw",format:S==="xml"?"xml":S==="html"?"html":S==="javascript"?"javascript":S==="text"?"text":"json",content:y.raw}}if(y.mode==="urlencoded"&&Array.isArray(y.urlencoded))return{type:"x-www-form-urlencoded",content:y.urlencoded.map(S=>({key:S.key||"",value:S.value||"",enabled:S.disabled!==!0}))};if(y.mode==="formdata"&&Array.isArray(y.formdata))return{type:"form-data",content:y.formdata.map(S=>({key:S.key||"",value:S.value||"",type:S.type||"text",enabled:S.disabled!==!0}))};if(y.mode==="graphql"&&y.graphql){let S;if(y.graphql.variables)try{S=JSON.parse(y.graphql.variables)}catch{S=void 0}return{type:"graphql",content:{query:y.graphql.query||"",variables:S}}}if(y.mode==="binary")return{type:"binary",content:""}}})(),auth:t(g.auth),scripts:n(h.event),settings:i(h.protocolProfileBehavior)}}}),f={id:pt(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:t(e.auth),scripts:n(e.event),items:l(e.item||[])};return await this.saveCollection(f),f}async exportCollection(e,t){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=CW(n),s=JSON.stringify(i,null,2);_t.writeFileSync(t,s,"utf-8")}async exportCollectionAsRestClientFolder(e,t){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Zn.join(t,kt(n.name));_t.mkdirSync(i,{recursive:!0});let s=n.variables||{};Zl(Zn.join(i,`${kt(n.name)}.env`),s),Cf(i,kt(n.name),n.scripts),tm(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var zt,eu,ga,U0=se(()=>{"use strict";zt={version:"1.0",storage:{format:"folder",root:"./http-forge-assets",history:"./.http-forge-cache/histories",results:"./.http-forge-cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0},scripts:{modulePaths:["./http-forge-assets/src","./http-forge-assets/lib"],scope:"shared",timeout:5e3},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:500,toolMode:"auto",drilldownThreshold:100,toolPageSize:150,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null,secrets:{providers:{aws:{provider:"aws"},azure:{provider:"azure",vaultUrl:""},gcp:{provider:"gcp"},vault:{provider:"vault"},op:{provider:"1password"},doppler:{provider:"doppler"}}}},eu={config:"http-forge.config.json"},ga={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as Ur from"fs";import*as xn from"path";var tu,H0=se(()=>{"use strict";U0();tu=class{constructor(e,t,n){this.workspacePath=e;this.fileWatcherFactory=t;this.notifications=n;this.configPath=xn.join(e,eu.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!Ur.existsSync(this.configPath))return{...zt};try{let e=Ur.readFileSync(this.configPath,"utf-8"),t=JSON.parse(e);return this.mergeWithDefaults(t)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${eu.config}. Using default configuration.`),{...zt}}}mergeWithDefaults(e){return{version:e.version??zt.version,storage:{...zt.storage,...e.storage},request:{...zt.request,...e.request},scripts:{...zt.scripts,...e.scripts},runner:{...zt.runner,...e.runner},environments:{...zt.environments,...e.environments},restClientExport:{...zt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:zt.proxy,mcp:{...zt.mcp,...e.mcp,cors:{...zt.mcp.cors,...e.mcp?.cors}},secrets:{...zt.secrets,...e.secrets,providers:{...zt.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,eu.config);let e=()=>{this.reload()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getConfig(){return this.config}getStorageConfig(){return this.config.storage}getRequestConfig(){return this.config.request}getScriptsConfig(){return this.config.scripts}getRunnerConfig(){return this.config.runner}getEnvironmentsConfig(){return this.config.environments}getRestClientExportPath(){let e=this.config.restClientExport?.path||"collections-rest-client";return xn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){let e=this.config.mcp??zt.mcp;return{...e,toolMode:["flat","drilldown","auto"].includes(e.toolMode)?e.toolMode:"auto",drilldownThreshold:Math.min(500,Math.max(10,e.drilldownThreshold??100)),toolPageSize:e.toolPageSize===0?0:Math.min(1e3,Math.max(10,e.toolPageSize??150)),maxRequestsPerCall:Math.min(1e4,Math.max(1,e.maxRequestsPerCall??500))}}resolvePath(e){let t=e.startsWith("./")?e.slice(2):e;return xn.join(this.workspacePath,...t.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return xn.join(this.getRootPath(),ga.collections)}getEnvironmentsPath(){return xn.join(this.getRootPath(),ga.environments)}getFlowsPath(){return xn.join(this.getRootPath(),ga.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return xn.join(this.getRootPath(),ga.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getScriptScope(){return this.config.scripts.scope??"shared"}getScriptTimeout(){return this.config.scripts.timeout??5e3}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return Ur.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(zt,null,2);await Ur.promises.writeFile(this.configPath,e,"utf-8");let t=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of t)Ur.existsSync(i)||await Ur.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Ur.existsSync(i)||await Ur.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),t={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await Ur.promises.writeFile(xn.join(e,"globals.json"),JSON.stringify(t,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await Ur.promises.writeFile(xn.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await Ur.promises.writeFile(xn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}}});var kW,Of,B0=se(()=>{"use strict";zo();kW="httpForge.cookies",Of=class{constructor(e,t=kW){this.store=e;this.storeKey=t;this.loadCookies()}store;storeKey;cookies=new Map;loadCookies(){try{let e=this.store.get(this.storeKey);e&&(this.cookies=new Map(Object.entries(e)),this.cleanExpiredCookies())}catch(e){console.error("[CookieService] Failed to load cookies:",e)}}async saveCookies(){try{let e={};this.cookies.forEach((t,n)=>{e[n]=t}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,t,n){return`${t||"*"}|${n||"/"}|${e}`}get(e,t){if(t){let s=this.getCookieKey(e,t),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(t&&s.domain){if(this.domainMatches(t,s.domain))return s}else return s}async set(e){let t=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(t,e),await this.saveCookies()}async setFromResponse(e){for(let t of e){let n=this.getCookieKey(t.name,t.domain,t.path);this.cookies.set(n,t)}await this.saveCookies()}has(e,t){return this.get(e,t)!==void 0}async delete(e,t,n){let i=this.getCookieKey(e,t,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let t=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&t.push(n):t.push(n));return t}getCookieHeader(e){let t=this.getAll(e);return lt.formatCookieHeader(t)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let t=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&t.push(n);for(let n of t)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,t){return lt.parseCookieHeaders(e,t)}isExpired(e){return lt.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[t,n]of this.cookies.entries())this.isExpired(n)&&e.push(t);for(let t of e)this.cookies.delete(t);e.length>0&&this.saveCookies()}domainMatches(e,t){return lt.domainMatches(e,t)}get count(){return this.cookies.size}}});var If,V0=se(()=>{"use strict";zo();If=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}cookieService;localCache=[];pendingOperations=[];get(e,t){return t?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===t||t.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,t){return this.get(e,t)!==void 0}set(e){let t=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));t>=0?this.localCache[t]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,t,n){let i=this.localCache.findIndex(s=>s.name===e&&(!t||s.domain===t||s.domain&&t.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:t,path:n}),!0}getAll(e){return e?this.localCache.filter(t=>{let n=t.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(t=>{let n=t.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,t){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(t,n);i.length>0&&(i.forEach(s=>{let a=this.localCache.findIndex(l=>l.name===s.name&&l.domain===(s.domain||n));a>=0?this.localCache[a]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let t=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(lt.isExpired(s)||s.domain&&!lt.domainMatches(t,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return lt.formatCookieHeader(i)}clear(){this.localCache=[],this.pendingOperations.push({type:"clear"})}async flush(){for(let e of this.pendingOperations)switch(e.type){case"set":e.cookie&&await this.cookieService.set(e.cookie);break;case"delete":e.name&&await this.cookieService.delete(e.name,e.domain,e.path);break;case"clear":await this.cookieService.clear();break}this.pendingOperations=[]}}});function nm(r){try{let e=JSON.parse(typeof r=="string"?r:r.toString("utf-8"));if(!e)return null;let t=e.environment||e,n=t.name||e.name||"imported-environment",i=t.values||t.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let l of i){if(!l)continue;let f=l.key??l.name,d=typeof l.enabled=="boolean"?l.enabled:!0;f&&d!==!1&&(s[f]=l.value??l.initial??"")}else if(typeof i=="object"&&i!==null)for(let[l,f]of Object.entries(i))s[l]=String(f??"");let a=t._postman_exported_at?"Imported from Postman export":t.description||"";return{name:n,variables:s,description:a}}catch{return null}}async function TW(r,e){try{let t=await e.readFile(r);return nm(t)}catch{return null}}var W0=se(()=>{"use strict"});import*as Jt from"fs";import*as on from"path";var Pf,kf,z0=se(()=>{"use strict";bn();W0();rm();oh();$c();Pf={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},kf=class{constructor(e,t,n,i,s){this.workspaceFolder=e;this.workspaceStore=t;this.configService=n;this.fileWatcherFactory=i;this.secretStore=s;let a=n.getEnvironmentsPath();this.environmentsPath=a,this.sharedConfigPath=on.join(a,"_global.json"),this.localConfigPath=on.join(a,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=t.get(Pf.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.loadPersistedEnvironmentOverrides(),this.loadSecretVariables(this.selectedEnvironment).catch(()=>{}),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;secretStore;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;secretValuesCache=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Jt.existsSync(this.environmentsPath))return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.environmentsPath,"**/*.json");let e=()=>{this.reload(),this.onEnvironmentsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}dispose(){this.fileWatcher?.dispose()}getWorkspaceFolder(){return this.workspaceFolder}getRootPath(){return this.configService.getRootPath()}loadConfigs(){if(!Jt.existsSync(this.environmentsPath)){this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}},this.localConfig={credentials:{},variables:{}};return}this.loadFolderConfigs()}getSharedConfig(){return this.sharedConfig||this.loadConfigs(),this.sharedConfig}getLocalConfig(){return this.localConfig||this.loadConfigs(),this.localConfig}getEnvironmentNames(){let e=this.getSharedConfig();return e?.environments?Object.keys(e.environments):[]}getSelectedEnvironment(){return this.selectedEnvironment}async setSelectedEnvironment(e){if(this.selectedEnvironment=e,await this.workspaceStore.update(Pf.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let t=this.getEnvOverridesStateKey(e),n=this.workspaceStore.get(t,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}await this.loadSecretVariables(e)}getEnvOverridesStateKey(e){return`${Pf.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),t=this.workspaceStore.get(e,{});t&&Object.keys(t).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...t})}persistEnvironmentOverrides(e){let t=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore.update(t,n)}setEnvironmentVariable(e,t,n){let i=n??this.selectedEnvironment;this.localEnvironmentValues.has(i)||this.localEnvironmentValues.set(i,{}),this.localEnvironmentValues.get(i)[e]=String(t),this.persistEnvironmentOverrides(i)}deleteEnvironmentVariable(e,t){let n=t??this.selectedEnvironment,i=this.localEnvironmentValues.get(n);i&&(delete i[e],this.persistEnvironmentOverrides(n))}clearEnvironmentVariables(e){let t=e??this.selectedEnvironment;this.localEnvironmentValues.set(t,{}),this.persistEnvironmentOverrides(t)}async resetEnvironmentOverrides(e){let t=e||this.selectedEnvironment;this.localEnvironmentValues.delete(t),await this.workspaceStore.update(this.getEnvOverridesStateKey(t),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,t){this.localGlobalValues[e]=String(t)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.getLocalConfig()?.variables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}getResolvedEnvironment(e){let t=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[t])return null;let s=n.environments[t],a=i?.credentials?.[t],l=i?.variables||{},f=a?.variables||{},d=a&&a.headers||{},h=xc(n.defaultHeaders||{},d),g=this.localEnvironmentValues.get(t)||{},y=this.secretValuesCache.get(t)||{},S={...s.variables||{},...f,...g,...y};return{name:t,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:h,variables:S}}async getSecretVariable(e,t){return this.secretStore?.get(`${e}:${t}`)}async setSecretVariable(e,t,n){await this.secretStore?.store(`${e}:${t}`,n),this.secretValuesCache.has(e)||this.secretValuesCache.set(e,{}),this.secretValuesCache.get(e)[t]=n}async deleteSecretVariable(e,t){await this.secretStore?.delete(`${e}:${t}`),this.secretValuesCache.get(e)&&delete this.secretValuesCache.get(e)[t]}async loadSecretVariables(e){if(!this.secretStore)return;let t=e||this.selectedEnvironment,n=this.getSharedConfig()?.environments?.[t]?.secretVariables??[];if(n.length===0)return;let i={};await Promise.all(n.map(async s=>{let a=await this.secretStore.get(`${t}:${s}`);a!==void 0&&(i[s]=a)})),this.secretValuesCache.set(t,i)}resolveVariables(e,t){return this.createResolver(t).resolveString(e,!0)}exportEnvironmentsToFolder(e,t=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!t&&Object.keys(s).length){let a=on.join(e,"globals.env");Zl(a,s)}n.forEach(a=>{let l=i?.environments?.[a];if(!l)return;let f={...l.variables||{}};t&&(f={...s,...f});let d=on.join(e,`${kt(a)}.env`);Zl(d,f)})}resolveVariablesWithExtra(e,t,n){return this.createResolver(n,t).resolveString(e,!0)}resolveVariablesInObject(e,t){return this.createResolver(t).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,t,n){return this.createResolver(n,t).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return on.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Jt.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let t={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,t);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),a={variables:i.variables||{}};this.saveJsonFile(s,a)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let t=Jt.readFileSync(e,"utf-8"),n=nm(t);if(!n)throw new Error("Failed to parse Postman environment file");this.sharedConfig||this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}});let i=n.name||`imported-${Date.now()}`;return this.sharedConfig.environments=this.sharedConfig.environments||{},this.sharedConfig.environments[i]=this.sharedConfig.environments[i]||{},this.sharedConfig.environments[i].variables=n.variables,n.description&&(this.sharedConfig.environments[i].description=n.description),this.saveSharedConfig(this.sharedConfig),n}catch(t){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",t),t}}saveEnvLocalConfig(e,t){let n=this.getEnvLocalConfigPath(e),i={variables:t};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:t}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return on.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=kc(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,t){let s={...this.getResolvedEnvironment(e)?.variables||{},...t||{}},a=this.getGlobalVariables();return new Qo({globals:a,collectionVariables:{},environmentVariables:s,variables:{}})}saveFolderSharedConfig(e){Jt.existsSync(this.environmentsPath)||Jt.mkdirSync(this.environmentsPath,{recursive:!0});let t={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,t);let n=Jt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!sh(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=on.basename(s,".json");if(!i.has(a))try{Jt.unlinkSync(on.join(this.environmentsPath,s))}catch{}}for(let[s,a]of Object.entries(e.environments||{})){let l={name:s,description:a.description,requiresConfirmation:a.requiresConfirmation,variables:a.variables||{}};this.saveJsonFile(on.join(this.environmentsPath,`${s}.json`),l)}}reload(){this.sharedConfig=null,this.localConfig=null,this.loadConfigs()}getAllEnvironments(){return this.loadConfigs(),this.sharedConfig?Object.entries(this.sharedConfig.environments).map(([e,t])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:t.variables||{}})):[]}async setActiveEnvironment(e){await this.setSelectedEnvironment(e)}async createEnvironment(e){if(this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{}}),this.sharedConfig.environments[e])throw new Error(`Environment "${e}" already exists`);this.sharedConfig.environments[e]={description:`Created ${new Date().toISOString()}`,variables:{}},this.saveSharedConfig(this.sharedConfig)}async deleteEnvironment(e){if(this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentExists(e),delete this.sharedConfig.environments[e],this.selectedEnvironment===e){let t=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=t.length>0?t[0]:"dev",await this.workspaceStore.update(Pf.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,t){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(t),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(t);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[t]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[t].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,t){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(t),this.validateEnvironmentExists(e),t!==e&&(this.validateEnvironmentNameNotTaken(t),this.sharedConfig.environments[t]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=t,await this.workspaceStore.update(Pf.SELECTED_ENVIRONMENT,t)),this.saveSharedConfig(this.sharedConfig))}validateEnvironmentName(e){if(!e||e.trim().length===0)throw new Error("Environment name cannot be empty");if(e.length>128)throw new Error("Environment name cannot exceed 128 characters");if(!/^[a-zA-Z0-9_\-\.]+$/.test(e))throw new Error("Environment name can only contain letters, numbers, hyphens, underscores, and dots")}validateEnvironmentExists(e){if(!this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" not found`)}validateEnvironmentNameNotTaken(e){if(this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" already exists`)}validateConfigLoaded(){if(!this.sharedConfig)throw new Error("No environment configuration loaded")}async updateEnvironmentVariables(e,t){if(this.loadConfigs(),!this.sharedConfig)throw new Error("No configuration loaded");let n=this.sharedConfig.environments[e];if(!n)throw new Error(`Environment "${e}" not found`);n.variables=t,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Jt.existsSync(e))return null;let t=Jt.readFileSync(e,"utf-8");return JSON.parse(t)}catch(t){return console.error(`Failed to load JSON from ${e}:`,t),null}}saveJsonFile(e,t){try{let n=on.dirname(e);Jt.existsSync(n)||Jt.mkdirSync(n,{recursive:!0}),Jt.writeFileSync(e,JSON.stringify(t,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var Gs,im=se(()=>{"use strict";yf();Gs=class r{constructor(e,t,n,i,s,a,l,f,d,h,g,y){this.httpService=e;this.scriptExecutor=t;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=a;this.collectionScripts=l;this.folderScriptsChain=f;this.onConsoleOutput=d;this.collectionName=h;this.iteration=g;this.iterationCount=y}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;iteration;iterationCount;async execute(e,t,n){let i=Date.now();return this.executeWithSession(e,t,n,i)}async executeWithSession(e,t,n,i){let s=this.collectPreRequestScripts(e),a=this.collectPostResponseScripts(e),l=this.envConfigService.getResolvedEnvironment(this.environment);if(!l)throw new Error(`Environment "${this.environment}" not found or not configured`);let f=this.envConfigService.getGlobalVariables(),d={request:e,variables:{...t},environmentVariables:l.variables||{},globals:{...f},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(y,S,_)=>{y==="set"&&S&&_!==void 0?this.envConfigService.setEnvironmentVariable(S,_,this.environment):y==="unset"&&S?this.envConfigService.deleteEnvironmentVariable(S,this.environment):y==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(y,S,_)=>{y==="set"&&S&&_!==void 0?this.envConfigService.setGlobalVariable(S,_):y==="unset"&&S?this.envConfigService.deleteGlobalVariable(S):y==="clear"&&this.envConfigService.clearGlobalVariables()}},h=this.scriptExecutor.createRequestSession(d),g=null;try{let y={...t},S={...e},_;if(s.length>0){let $=await h.executePreRequest(s);if($.consoleOutput&&$.consoleOutput.length>0&&this.onConsoleOutput?.($.consoleOutput),$.nextRequest!==void 0&&(_=$.nextRequest),$.skipRequest){let G={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:G,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:y,nextRequest:_}}$.success&&($.modifiedRequest&&($.modifiedRequest.url&&(S.url=$.modifiedRequest.url),$.modifiedRequest.headers&&(S.headers=$.modifiedRequest.headers),$.modifiedRequest.params&&(S.params=$.modifiedRequest.params),$.modifiedRequest.query&&(S.query=$.modifiedRequest.query),$.modifiedRequest.body!==void 0&&(S.body=$.modifiedRequest.body)),($.localVariables??$.modifiedVariables)&&(y=$.localVariables??$.modifiedVariables))}g=await this.requestPreparer.prepareRequest(S,this.environment,l,y);let{url:R,headers:I,body:q,method:U}=g,B={};for(let $ in I)Object.prototype.hasOwnProperty.call(I,$)&&(B[$.toUpperCase()]=I[$]);if(!B.COOKIE&&S.settings?.includeCookies!==!1&&this.cookieJar){let G=this.cookieJar.getCookieHeader(R);G&&(B.COOKIE=G)}let V={method:U,url:R,headers:B,body:q.content,signal:n,settings:S.settings?{timeout:S.settings.timeout,followRedirects:S.settings.followRedirects,maxRedirects:S.settings.maxRedirects,strictSSL:S.settings.strictSSL}:void 0},W=await this.httpService.execute(V);this.cookieJar&&W.headers&&await this.cookieJar.setCookiesFromResponse(R,W.headers);let X=Date.now()-i,T=[],C={},k;if(a.length>0){let $=0;if(W.body)if(typeof W.body=="string")$=Buffer.byteLength(W.body,"utf8");else if(Buffer.isBuffer(W.body))$=W.body.length;else try{$=Buffer.byteLength(JSON.stringify(W.body),"utf8")}catch{$=0}let G=Zh(W.headers,W.cookies,g.url),K={executedRequest:g,status:W.status,statusText:W.statusText,headers:P0(W.headers||{}),body:W.body,cookies:G,responseTime:W.time,responseSize:$},ne=await h.executePostResponse(a,K);T=ne.testResults,C=ne.modifiedEnvironmentVariables||{},k=ne.visualizerData,ne.nextRequest!==void 0&&(_=ne.nextRequest),ne.consoleOutput&&ne.consoleOutput.length>0&&this.onConsoleOutput?.(ne.consoleOutput)}let N=T.length===0||T.every($=>$.passed),j=T.length>0?N:W.status>=200&&W.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...g,headers:B},response:{status:W.status,statusText:W.statusText,headers:W.headers||{},body:W.body,time:W.time||X,cookies:W.cookies||[]},duration:X,timestamp:Date.now(),passed:j,assertions:T,modifiedVariables:y,modifiedEnvironmentVariables:C,nextRequest:_,visualizerData:k}}catch(y){return this.handleError(e,g,y,i)}finally{h.dispose?.()}}collectPreRequestScripts(e){let t=[];if(this.collectionScripts?.preRequest&&t.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&t.push(n.preRequest);else this.folderScriptsChain.preRequest&&t.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&t.push(e.scripts.preRequest),t}collectPostResponseScripts(e){let t=[];if(e.scripts?.postResponse&&t.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&t.push(i.postResponse)}else this.folderScriptsChain.postResponse&&t.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&t.push(this.collectionScripts.postResponse),t}handleError(e,t,n,i){let s=Date.now()-i,a=t?.method||e.method,l=t?.url||e.url;this.onConsoleOutput?.([`[error] ${e.name}: ${n.message||n}`]);let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),d=n?.stack?String(n.stack):"",h=this.errorBodyFormat,g,y;h==="html"||h==="both"?(g=r.formatErrorAsHtml(f,d),y={"content-type":"text/html; charset=utf-8"}):(g=f,y={});let S={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:a||"GET",headers:t?.headers||{},body:t?.body||S,params:t?.params||{},query:t?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:y,cookies:[],body:g,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,t){let n=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
50
|
+
`)}function mf(r,e){return JSON.stringify(r)!==JSON.stringify(e)}function Gl(r){return r.map(e=>{let t=e.args.map(n=>{if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)}).join(" ");return`[${e.level}] ${t}`})}function pW(r){return{log:(...e)=>r.push({level:"log",args:e}),info:(...e)=>r.push({level:"info",args:e}),warn:(...e)=>r.push({level:"warn",args:e}),error:(...e)=>r.push({level:"error",args:e})}}function I0(r){let e=[],t=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let a=s.then(()=>{r.push({name:n,passed:!0})},l=>{r.push({name:n,passed:!1,message:l.message||String(l)})});e.push(a)}else r.push({name:n,passed:!0})}catch(s){r.push({name:n,passed:!1,message:s.message})}};return t.skip=(n,i)=>{r.push({name:n,passed:!0,skipped:!0})},t.fail=n=>{r.push({name:n||"Failed test",passed:!1,message:n||"pm.test.fail()"})},t.index=()=>r.length,t._pendingTests=e,t}function P0(r){let e={};for(let[t,n]of Object.entries(r))e[t]=Array.isArray(n)?n.join(", "):n;return e}function Qh(r,e,t){let n;if(t)try{n=new URL(t).hostname}catch{n=void 0}let i=lt.parseCookieHeaders(r||{},n);return i.length>0?i:Array.isArray(e)&&e.length>0?e.filter(s=>s&&s.name).map(s=>({name:s.name,value:s.value,domain:s.domain??n,path:s.path,expires:s.expires,maxAge:s.maxAge,httpOnly:s.httpOnly,secure:s.secure,sameSite:s.sameSite})):[]}var gf=se(()=>{"use strict";zo()});import*as k0 from"vm";function hW(r){let e=null;try{e=new URL(r)}catch{}return{toString(){return r},valueOf(){return r},[Symbol.toPrimitive](n){return n==="number"?NaN:r},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:r},getPathWithQuery(){return e?e.pathname+e.search:r},getQueryString(){return e?e.search.startsWith("?")?e.search.slice(1):e.search:""},getRemote(){if(!e)return"";let n=e.port||(e.protocol==="https:"?"443":"80");return`${e.hostname}:${n}`},getOAuth1BaseUrl(){return e?`${e.protocol}//${e.host}${e.pathname}`:r},get protocol(){return e?.protocol?.replace(":","")||""},get host(){return e?e.hostname.split("."):[]},get port(){return e?.port||""},get path(){return e?e.pathname.split("/").filter(Boolean):[]},get hash(){return e?.hash?.replace("#","")||""},query:{toObject(){if(!e)return{};let n={};return e.searchParams.forEach((i,s)=>{n[s]=i}),n},has(n){return e?e.searchParams.has(n):!1},get(n){return e?e.searchParams.get(n):void 0},each(n){e&&e.searchParams.forEach((i,s)=>n({key:s,value:i}))}}}}var yf,T0=se(()=>{"use strict";gP();Yh();gf();yf=class{constructor(e,t){this.deps=e;this.initialContext=t;this.timerRegistry=mP(n=>{let i=n instanceof Error?n.message:String(n);this.consoleMessages.push({level:"error",args:[`Uncaught error in async callback: ${i}`]})}),this.initializeSession()}deps;initialContext;vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;timerRegistry;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,t={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,t,this.timerRegistry.timers)}createSharedContext(){let e=this.initialContext,t=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:l=>e.cookieJar?e.cookieJar.get(l,i)?.value:void 0,set:(l,f)=>{e.cookieJar&&e.cookieJar.set({name:l,value:f,domain:i})},has:l=>e.cookieJar?e.cookieJar.has(l,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(l=>({name:l.name,value:l.value})):[],toObject:()=>{if(!e.cookieJar)return{};let l=e.cookieJar.getAll(i),f={};for(let d of l)f[d.name]=d.value;return f},jar:()=>{let l=e.cookieJar;return{getAll(f,d){try{if(!l){d(null,[]);return}let h=l.getAll(f).map(g=>({name:g.name,value:g.value,domain:g.domain,path:g.path,httpOnly:g.httpOnly,secure:g.secure}));d(null,h)}catch(h){d(h,[])}},get(f,d,h){try{if(!l){h(null,void 0);return}let g=l.get(d,f);h(null,g?{name:g.name,value:g.value,domain:g.domain}:void 0)}catch(g){h(g,void 0)}},set(f,d,h,g){try{if(!l){(g||h)?.(null);return}typeof d=="string"&&typeof h=="string"?(l.set({name:d,value:h,domain:f}),g?.(null)):typeof d=="object"&&(l.set({...d,domain:f}),h?.(null))}catch(y){(g||h)?.(y)}},unset(f,d,h){try{if(!l){h?.(null);return}l.delete(d,f),h?.(null)}catch(g){h?.(g)}},clear(f){try{if(!l){f?.(null);return}l.clear(),f?.(null)}catch(d){f?.(d)}}}},remove:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},unset:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},a=this;return{request:this.createRequestObject(t,e),response:null,test:I0(this.assertions),expect:hf,cookies:s,execution:{setNextRequest(l){a._nextRequest=l},skipRequest(){a._skipRequest=!0},runRequest(l,f){let h=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let g=typeof l=="string"?{url:l,method:"GET"}:l,y=await n.sendRequest(g),S=Array.isArray(y?.cookies)?y.cookies.filter(I=>I?.name):[],_=y?.body,R=0;if(typeof _=="string")R=Buffer.byteLength(_,"utf8");else if(Buffer.isBuffer(_))R=_.length;else if(_!=null)try{R=Buffer.byteLength(JSON.stringify(_),"utf8")}catch{}return Gh({executedRequest:null,status:y?.status??0,statusText:y?.statusText??"",headers:y?.headers??{},body:_,cookies:S,responseTime:y?.time,responseSize:R})})();if(typeof f=="function"){h.then(g=>f(null,g),g=>f(g));return}return h},location:{current:n.info?.requestName||"",currentRequestName:n.info?.requestName||"",eventName:"prerequest",toString(){return n.info?.requestName||""}}},setNextRequest(l){a._nextRequest=l},visualizer:{set(l,f){a._visualizerData={template:l,data:f}},clear(){a._visualizerData=void 0}},...n,info:{...n.info||{},eventName:"prerequest",requestName:n.info?.requestName||void 0,requestId:n.info?.requestId||void 0,iteration:e.iteration||0,iterationCount:e.iterationCount||1}}}createRequestObject(e,t){let n=l=>{if(!l)return"none";switch(l){case"raw":return"raw";case"form-data":return"formdata";case"x-www-form-urlencoded":return"urlencoded";case"binary":return"file";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},i=l=>{if(!l)return"none";switch(l){case"raw":return"raw";case"formdata":return"form-data";case"urlencoded":return"x-www-form-urlencoded";case"file":return"binary";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},s={...e.headers,add:l=>{l&&l.key&&(e.headers[l.key]=l.value||"")},get:l=>{for(let[f,d]of Object.entries(e.headers))if(f.toLowerCase()===l.toLowerCase())return d},has:l=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.toLowerCase())return!0;return!1},remove:l=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.toLowerCase()){delete e.headers[f];break}},update:l=>{if(l&&l.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.key.toLowerCase()){e.headers[f]=l.value||"";return}}},upsert:l=>{if(l&&l.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.key.toLowerCase()){e.headers[f]=l.value||"";return}e.headers[l.key]=l.value||""}},toObject:()=>{let l={};for(let[f,d]of Object.entries(e.headers))typeof d=="string"&&(l[f]=d);return l},each:l=>{for(let[f,d]of Object.entries(e.headers))typeof d=="string"&&l({key:f,value:d})}},a={get mode(){return n(e.body?.type)},set mode(l){let f=i(l);e.body?e.body.type=f:e.body={type:f,content:null}},get raw(){let l=e.body?.content;return typeof l=="string"?l:l&&typeof l=="object"?JSON.stringify(l):""},set raw(l){e.body?(e.body.type="raw",e.body.content=l):e.body={type:"raw",content:l}},get formdata(){return e.body?.type==="form-data"&&Array.isArray(e.body.content)?e.body.content:[]},get urlencoded(){return e.body?.type==="x-www-form-urlencoded"&&Array.isArray(e.body.content)?e.body.content:[]},get graphql(){return e.body?.type==="graphql"?e.body.content:null},get file(){return e.body?.type==="binary"?e.body.content:null}};return{get url(){return hW(e.url)},set url(l){e.url=typeof l=="string"?l:String(l)},get method(){return e.method},set method(l){e.method=l},headers:s,get body(){return a},set body(l){if(l==null)e.body=null;else if(typeof l=="string")e.body={type:"raw",content:l};else if(typeof l=="object")if(l.type||l.mode||l.content!==void 0){let f=l.mode?i(l.mode):l.type||"raw";e.body={type:f,format:l.format,content:l.content}}else e.body={type:"raw",content:l}},get params(){return e.params||{}},set params(l){e.params=l||{}},get query(){return e.query||{}},set query(l){e.query=l||{}},get auth(){return t.request?.auth||null},set auth(l){t.request&&(t.request.auth=l)},get certificate(){return t.request?.certificate||null},set certificate(l){t.request&&(t.request.certificate=l)},get description(){return t.request?.description||null},set description(l){t.request&&(t.request.description=l)},get name(){return t.request?.name||null},set name(l){t.request&&(t.request.name=l)},get id(){return t.request?.id||null},get disabled(){return t.request?.disabled||!1},set disabled(l){t.request&&(t.request.disabled=l)},get messages(){return t.request?.messages||[]},get methodPath(){return t.request?.methodPath||null},get metadata(){return t.request?.metadata||[]},getHeaders(l){let f={};for(let[d,h]of Object.entries(e.headers))typeof h=="string"&&(f[d]=h);return f},addQueryParams(l){if(typeof l=="string"){let f=new URLSearchParams(l);for(let[d,h]of f)e.query||(e.query={}),e.query[d]=h}else Array.isArray(l)&&(e.query||(e.query={}),l.forEach(f=>{f.key&&(e.query[f.key]=f.value||"")}))},removeQueryParams(l){e.query&&(typeof l=="string"?delete e.query[l]:Array.isArray(l)&&l.forEach(f=>{let d=typeof f=="string"?f:f.key;d&&delete e.query[d]}))},authorizeUsing(l,f){t.request&&(typeof l=="string"?(t.request.auth||(t.request.auth={}),t.request.auth.type=l,f&&(t.request.auth.parameters=f)):typeof l=="object"&&(t.request.auth=l))},clone(){return{url:e.url,method:e.method,headers:{...e.headers},body:e.body?{...e.body}:null,params:e.params?{...e.params}:{},query:e.query?{...e.query}:{},auth:t.request?.auth,certificate:t.request?.certificate,description:t.request?.description,name:t.request?.name,id:t.request?.id,disabled:t.request?.disabled,metadata:t.request?.metadata,messages:t.request?.messages,methodPath:t.request?.methodPath}},describe(l,f){t.request&&(t.request.description={content:l,type:f||"text/plain"})},setHeader(l,f){e.headers[l]=f},addHeader(l,f){typeof l=="object"&&l!==null?e.headers[l.key]=l.value:e.headers[l]=f},removeHeader(l){delete e.headers[l]},setBody(l,f,d){e.body={type:f||e.body?.type||"raw",format:d||e.body?.format,content:l}}}}injectLegacyGlobals(e,t){let n=this.vmContext;if(!n)return;let i=this.initialContext,s=e==="test"&&t?.executedRequest?t.executedRequest:this.modifiedRequest,a={};for(let[S,_]of Object.entries(s?.headers||{}))typeof _=="string"&&(a[S]=_);let l=s?.body,f=l==null?null:typeof l=="object"&&"content"in l?l.content:l,d=i.request;if(n.request={id:d?.id??"",name:d?.name??"",description:d?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:a,data:f},n.environment=this._liveEnvironmentScope?.toObject?.()??{...this._environmentVariables},n.globals=this._liveGlobalsScope?.toObject?.()??{...this._globals},n.data={...i.iterationData||{}},typeof n.iteration!="number"&&(n.iteration=0),e!=="test"||!t)return;let h=t.body;n.responseBody=h==null?"":typeof h=="string"?h:JSON.stringify(h);let g=t.statusText||"";n.responseCode={code:t.status,name:g,detail:g},n.responseHeaders={...t.headers||{}},n.responseTime=t.responseTime??0,n.responseCookies=(t.cookies||[]).map(S=>({...S}));let y=this;n.tests=new Proxy({},{set(S,_,R){return y.assertions.push({name:String(_),passed:!!R,message:R?void 0:`"${String(_)}" was false`}),!0}})}async executePreRequest(e){let t=Kh(e,this.deps.isolateScripts);if(!t||!t.trim())return{success:!0};try{this.consoleMessages.length=0,this.injectLegacyGlobals("prerequest");let n=this.ctx.variables.replaceIn(t),i=this.deps.scriptTimeoutMs??5e3,s=k0.runInContext(n,this.vmContext,{timeout:i});this.deps.isolateScripts&&s&&typeof s.then=="function"&&await s,(await this.timerRegistry.drain(i)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${i}ms; pending async work was cancelled.`]});let l=Gl(this.consoleMessages),f=this.initialContext.request.body,d=!this.bodiesEqual(this.modifiedRequest.body,f);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:mf(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:d?this.modifiedRequest.body:void 0,params:mf(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:mf(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),localVariables:this.ctx.variables.toLocalObject?.()??{},modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:l.length>0?l:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){let i=[...Gl(this.consoleMessages),`[error] Script execution failed: ${n.message}`];return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:i,modifiedVariables:this.ctx?.variables?.toObject(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,t){let n=Kh(e,this.deps.isolateScripts);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=Gh(t),this.ctx.request=this.createRequestObject(t.executedRequest,this.initialContext),this.injectLegacyGlobals("test",t);let i=this.ctx.variables.replaceIn(n),s=this.deps.scriptTimeoutMs??5e3,a=k0.runInContext(i,this.vmContext,{timeout:s});this.deps.isolateScripts&&a&&typeof a.then=="function"&&await a,this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0),(await this.timerRegistry.drain(s)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${s}ms; pending async work was cancelled.`]});let f=Gl(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:f.length>0?f:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"});let s=[...Gl(this.consoleMessages),`[error] Script execution failed: ${i.message}`];return{testResults:[...this.assertions],consoleOutput:s,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,t){return e===t||!e&&!t?!0:!e||!t?!1:e.type===t.type&&e.format===t.format&&JSON.stringify(e.content)===JSON.stringify(t.content)}dispose(){this.timerRegistry.clearAll(),this.vmContext=null,this.ctx=null,this.assertions=[]}}});import*as nr from"crypto";import*as mW from"querystring";import*as vP from"vm";function bP(r,e){if(r)return r.split(",").map(t=>{let n=t.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function SP(r){if(typeof r=="string"&&r.charCodeAt(0)===30)try{return JSON.parse(r.slice(1))}catch{return r}return r}function gW(r,e){if(r==="@")return"";if(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))return r.slice(1,-1);let t=r.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(t){let n=bP(t[2],e),i=Yi(t[1],n);return i!==null?i:void 0}if(e[r]!==void 0)return SP(e[r]);if(Yo(r)){let n=Go(r,e),i=Ko(r,n);if(i!==void 0)return i}}function yP(r,e,t,n){let i=Buffer.concat([Buffer.from(r,"utf8"),n||Buffer.alloc(0)]),s=[],a=Buffer.alloc(0);for(;Buffer.concat(s).length<e+t;)a=nr.createHash("md5").update(Buffer.concat([a,i])).digest(),s.push(a);let l=Buffer.concat(s);return{key:l.subarray(0,e),iv:l.subarray(e,e+t)}}function q0(r,e,t){let n=i=>r==="aes"?`aes-${i*8}-cbc`:r==="des"?"des-cbc":r==="des-ede3"?"des-ede3-cbc":r;return{encrypt(i,s,a){let l=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=nr.randomBytes(8),{key:d,iv:h}=yP(s,e,t,f),g=nr.createCipheriv(n(e),d,h),y=Buffer.concat([g.update(l),g.final()]),S=Buffer.concat([Buffer.from("Salted__"),f,y]);return{ciphertext:new je(y),salt:new je(f),toString:_=>_?_.stringify(new je(S)):S.toString("base64")}}else{let f=s.toBuffer(),d=a?.iv&&a.iv instanceof je?a.iv.toBuffer():Buffer.alloc(t),h=nr.createCipheriv(n(f.length),f,d);a?.padding===!1&&h.setAutoPadding(!1);let g=Buffer.concat([h.update(l),h.final()]);return{ciphertext:new je(g),toString:y=>y?y.stringify(new je(g)):g.toString("base64")}}},decrypt(i,s,a){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,d;l.subarray(0,8).toString()==="Salted__"?(d=l.subarray(8,16),f=l.subarray(16)):(d=Buffer.alloc(0),f=l);let{key:h,iv:g}=yP(s,e,t,d),y=nr.createDecipheriv(n(e),h,g);return new je(Buffer.concat([y.update(f),y.final()]))}else{let l=s.toBuffer(),f=a?.iv&&a.iv instanceof je?a.iv.toBuffer():Buffer.alloc(t),d=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),h=nr.createDecipheriv(n(l.length),l,f);return a?.padding===!1&&h.setAutoPadding(!1),new je(Buffer.concat([h.update(d),h.final()]))}}}}function yW(){let r=t=>n=>{let i=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8");return new je(nr.createHash(t).update(i).digest())},e=t=>(n,i)=>{let s=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),a=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");return new je(nr.createHmac(t,a).update(s).digest())};return{MD5:r("md5"),SHA1:r("sha1"),SHA224:r("sha224"),SHA256:r("sha256"),SHA384:r("sha384"),SHA512:r("sha512"),SHA3:r("sha3-256"),RIPEMD160:r("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:q0("aes",32,16),DES:q0("des",8,8),TripleDES:q0("des-ede3",24,8),PBKDF2(t,n,i){let s=t instanceof je?t.toBuffer():Buffer.from(String(t),"utf8"),a=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,f=i?.iterations||1;return new je(nr.pbkdf2Sync(s,a,f,l,"sha1"))},enc:{Base64:{stringify:t=>(t instanceof je?t.toBuffer():Buffer.from(String(t))).toString("base64"),parse:t=>je.fromBase64(t)},Utf8:{stringify:t=>(t instanceof je?t.toBuffer():Buffer.from(String(t))).toString("utf8"),parse:t=>je.fromUtf8(t)},Hex:{stringify:t=>(t instanceof je?t.toBuffer():Buffer.from(String(t))).toString("hex"),parse:t=>je.fromHex(t)},Latin1:{stringify:t=>(t instanceof je?t.toBuffer():Buffer.from(String(t))).toString("latin1"),parse:t=>new je(Buffer.from(t,"latin1"))},Utf16:{stringify:t=>(t instanceof je?t.toBuffer():Buffer.from(String(t))).toString("utf16le"),parse:t=>new je(Buffer.from(t,"utf16le"))},Utf16BE:{stringify:t=>(t instanceof je?t.toBuffer():Buffer.from(String(t))).swap16().toString("utf16le"),parse:t=>new je(Buffer.from(t,"utf16le").swap16())}},lib:{WordArray:{create:t=>t?typeof t=="string"?new je(Buffer.from(t,"utf8")):Buffer.isBuffer(t)?new je(t):new je(Buffer.from(String(t))):new je(Buffer.alloc(0)),random:t=>new je(nr.randomBytes(t))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var je,rs,vf=se(()=>{"use strict";oh();lh();ch();E0();T0();Yh();je=class r{_buffer;constructor(e){this._buffer=typeof e=="string"?Buffer.from(e,"utf8"):e}toString(e){return e?e.stringify(this):this._buffer.toString("hex")}toBuffer(){return this._buffer}static fromHex(e){return new r(Buffer.from(e,"hex"))}static fromBase64(e){return new r(Buffer.from(e,"base64"))}static fromUtf8(e){return new r(Buffer.from(e,"utf8"))}};rs=class r{constructor(e,t=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=x0(t)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new yf({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this),isolateScripts:this.scopeMode==="isolated",scriptTimeoutMs:this.scriptTimeoutMs},e)}createVM(e,t,n){let i=this.moduleLoader.getGlobalSetupExports(),s=this.moduleLoader.createRequireFunction();e.require=s,e.vault=this.createVault();let a={ctx:e,hf:e,pm:e,console:t,...i||{},global:i,setTimeout:n?.setTimeout??setTimeout,setInterval:n?.setInterval??setInterval,clearTimeout:n?.clearTimeout??clearTimeout,clearInterval:n?.clearInterval??clearInterval,URL,URLSearchParams,Buffer,atob:l=>Buffer.from(l,"base64").toString("binary"),btoa:l=>Buffer.from(l,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:nr,_:s("lodash"),require:s,moment:Jh(),querystring:mW,CryptoJS:yW(),tv4:(()=>{try{return s("tv4")}catch{return}})(),postman:{setNextRequest:l=>e.setNextRequest?.(l),setGlobalVariable:(l,f)=>e.globals?.set(l,f),getGlobalVariable:l=>e.globals?.get(l),clearGlobalVariable:l=>e.globals?.unset(l),setEnvironmentVariable:(l,f)=>e.environment?.set(l,f),getEnvironmentVariable:l=>e.environment?.get(l),clearEnvironmentVariable:l=>e.environment?.unset(l),getResponseHeader:l=>{let f=e.response?.headers?.get?.(l);return f===void 0?null:f},getResponseCookie:l=>{let f=e.response?.cookies;if(f&&typeof f[Symbol.iterator]=="function"){for(let d of f)if(d?.name&&d.name.toLowerCase()===l.toLowerCase())return{...d}}return null}},jsonStringify:(l,f,d)=>JSON.stringify(l,f,d),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let f=this.moduleLoader.createRequireFunction()("xml2js"),d;return f.parseString(l,{explicitArray:!1},(h,g)=>{if(h)throw h;d=g}),d}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return vP.createContext(a)}createCommonContext(e,t){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},a={...e.environmentVariables||{}},l=e.iterationData||{},f=this.createMergedVariableScope(n,a,i,s,l),d=this.createGlobalsScope(s,e.onGlobalsChange),h=this.createVariableScope(i),g=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),y={...g,set:(_,R)=>{let I=this.serializeValue(R);g.set(_,I),n[_]=I},unset(_){g.unset(_),delete n[_]},clear(){g.clear();for(let _ of Object.keys(a))delete n[_]}};return d.replaceIn=f.replaceIn,h.replaceIn=f.replaceIn,y.replaceIn=f.replaceIn,{globals:d,collectionVariables:h,variables:f,environment:y,iterationData:{get:_=>l[_],has:_=>_ in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:hf,info:e.info||{eventName:t,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:r.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{}return e}}createVariableScope(e){return{get:t=>this.deserializeValue(e[t]),set:(t,n)=>{e[t]=this.serializeValue(n)},has(t){return t in e},unset(t){delete e[t]},clear(){Object.keys(e).forEach(t=>delete e[t])},toObject(){return{...e}}}}createGlobalsScope(e,t){let n=(i,s,a)=>{t&&t(i,s,a)};return{get:i=>this.deserializeValue(e[i]),set:(i,s)=>{let a=this.serializeValue(s);e[i]=a,n("set",i,a)},has(i){return i in e},unset(i){delete e[i],n("unset",i)},clear(){Object.keys(e).forEach(i=>delete e[i]),n("clear")},toObject(){return{...e}}}}createMergedVariableScope(e,t,n,i,s={}){let a={get:l=>l in e?this.deserializeValue(e[l]):l in s?s[l]:l in t?this.deserializeValue(t[l]):l in n?this.deserializeValue(n[l]):this.deserializeValue(i[l]),set:(l,f)=>{e[l]=this.serializeValue(f)},has(l){return l in e||l in s||l in t||l in t||l in n||l in i},unset(l){delete e[l]},clear(){Object.keys(e).forEach(l=>delete e[l])},toObject(){return{...i,...n,...t,...s,...e}},toLocalObject(){return{...n,...t,...s,...e}},replaceIn(l){if(!l||typeof l!="string")return l;let f=a.toObject(),d=20,h=y=>y.replace(/\{\{([^}]+)\}\}/g,(S,_)=>{let R=_.trim(),I=R.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(I)try{let B=bP(I[2],f),V=Yi(I[1],B);return V!==null?String(V):S}catch{return S}let q=Tc(R);if(q){let B=gW(q.input,f);if(B!==void 0){let V=qc(B,q.filters,f);return V!==void 0?String(V):S}return S}let j=a.get(R);if(j!==void 0)return String(j);if(Yo(R)){let B={};for(let[X,T]of Object.entries(f))B[X]=SP(T);let V=Go(R,B),W=Ko(R,V);if(W!==void 0)return String(W)}return S}),g=l;for(let y=0;y<d;y++){let S=h(g);if(S===g)break;g=S}return g}};return a}createEnvironmentScope(e,t,n,i){let s=(a,l,f)=>{n&&(i?n(a,l,f):n(l||"",a==="set"?f:void 0))};return{name:t||"",get:a=>this.deserializeValue(e[a]),set:(a,l)=>{let f=this.serializeValue(l);e[a]=f,s("set",a,f)},has(a){return a in e},unset(a){delete e[a],s("unset",a)},clear(){Object.keys(e).forEach(a=>delete e[a]),s("clear")},toObject(){return{...e}}}}createVault(){let e=this.secretRegistry,t=()=>{throw new Error("pm.vault is read-only in HTTP Forge. Use environment variables or {{secret:provider/path}} tokens to manage secrets.")};return{async get(n){if(!e)throw new Error('pm.vault is not available \u2014 no secret providers are configured. Configure a provider under "secrets.providers" to use pm.vault.get().');let i=`secret:${n}`;return(await e.resolveSecretTokens(`{{${i}}}`))[i]},set:t,unset:t}}createSendRequest(){return this.httpService?(e,t)=>{let n=typeof e=="string"?{url:e,method:"GET"}:e,i=this.httpService.execute({url:n.url,method:n.method||"GET",headers:n.headers||{},body:n.body,...n});if(t){i.then(s=>t(null,s)).catch(s=>t(s,null));return}return i}:(e,t)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(t){t(n,null);return}return Promise.reject(n)}}}});var A0,da,Zh=se(()=>{"use strict";A0={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain",javascript:"application/javascript",css:"text/css","x-www-form-urlencoded":"application/x-www-form-urlencoded","form-data":"multipart/form-data",graphql:"application/json"},da=class{sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let t={};for(let[n,i]of Object.entries(e))t[n]=this.sanitizeHeaderValue(String(i));return t}encodeBody(e){if(!e||e.type==="none")return null;let{type:t,content:n}=e;switch(t){case"x-www-form-urlencoded":return this.encodeUrlEncodedBody(n);case"form-data":return n;case"graphql":return this.encodeGraphQLBody(n);case"raw":return n;default:return n}}encodeUrlEncodedBody(e){if(Array.isArray(e)){let t=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&t.append(n.key,n.value||"");return t.toString()}return typeof e=="string"?e:String(e)}encodeGraphQLBody(e){if(typeof e=="string")try{e=JSON.parse(e)}catch{return e}if(typeof e=="object"&&e!==null&&e.query){let t=e.variables;if(typeof t=="string")try{t=t.trim()?JSON.parse(t):void 0}catch{t=void 0}return JSON.stringify({query:e.query,...t!=null?{variables:t}:{},...e.operationName?{operationName:e.operationName}:{}})}return JSON.stringify(e)}setContentTypeHeader(e,t,n){if(Object.keys(e).some(a=>a.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!t||t.type==="none")return;let s;switch(t.type){case"x-www-form-urlencoded":s=A0["x-www-form-urlencoded"];break;case"raw":s=t.format?A0[t.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=A0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var ha,Xh=se(()=>{"use strict";ha=class{parse(e,t){return t.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:[t]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let t=e.split(/\r?\n/).filter(s=>s.trim());if(t.length<2)return[{}];let n=this.parseCsvLine(t[0]),i=[];for(let s=1;s<t.length;s++){let a=this.parseCsvLine(t[s]),l={};n.forEach((f,d)=>{l[f]=a[d]||""}),i.push(l)}return i}parseCsvLine(e){let t=[],n="",i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=e[s+1];a==='"'?i&&l==='"'?(n+='"',s++):i=!i:a===","&&!i?(t.push(n.trim()),n=""):n+=a}return t.push(n.trim()),t}}});import*as Ql from"crypto";var bW,_f,M0=se(()=>{"use strict";bW=3e4,_f=class{constructor(e,t,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=t;this.envConfigService=n;this.httpService=i;this.callbackPath=s}secretStore;browserService;envConfigService;httpService;callbackPath;tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,t){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,t),tokenType:e.tokenPrefix||"Bearer",raw:{}};let n=this.buildCacheKeyString(e),i=this.tokenCache.get(n);if(i&&!this.isExpired(i))return i;if(i?.refreshToken)try{return await this.refreshToken(e,i.refreshToken,t)}catch{this.tokenCache.delete(n)}if(!i){let a=await this.secretStore.get(`oauth2_refresh_${n}`);if(a)try{return await this.refreshToken(e,a,t)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,t,"client_credentials");break;case"password":s=await this.fetchToken(e,t,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,t);break;case"implicit":s=await this.implicitFlow(e,t);break;default:throw new Error(`Unknown OAuth2 grant type: ${e.grantType}`)}return this.tokenCache.set(n,s),s.refreshToken&&await this.storeRefreshToken(n,s.refreshToken),s}async refreshToken(e,t,n){let i=this.resolve(e.tokenUrl||"",n);if(!i)throw new Error("OAuth2 tokenUrl is required for token refresh");let s=this.resolve(e.clientId||"",n),a=this.resolve(e.clientSecret||"",n),l=new URLSearchParams;l.append("grant_type","refresh_token"),l.append("refresh_token",t);let f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,l,s,a,n);let d=await this.httpService.execute({method:"POST",url:i,headers:f,body:l.toString()}),h=this.parseTokenResponse(d.body,e);h.refreshToken||(h.refreshToken=t);let g=this.buildCacheKeyString(e);return this.tokenCache.set(g,h),h.refreshToken&&await this.storeRefreshToken(g,h.refreshToken),h}async authorizationCodeFlow(e,t){let n=this.resolve(e.authUrl||"",t),i=this.resolve(e.tokenUrl||"",t),s=this.resolve(e.clientId||"",t),a=this.resolve(e.clientSecret||"",t),l=e.scope?this.resolve(e.scope,t):void 0;if(!n)throw new Error("OAuth2 authUrl is required for authorization code flow");if(!i)throw new Error("OAuth2 tokenUrl is required for authorization code flow");if(!s)throw new Error("OAuth2 clientId is required for authorization code flow");let f=e.usePkce!==!1,d,h,g;if(f){d=this.generateCodeVerifier();let X=e.pkceMethod||"S256";h=X==="S256"?this.generateCodeChallengeS256(d):d,g=X}let y=e.state||Ql.randomBytes(16).toString("hex"),S=await this.getCallbackUri(),_=new URL(n);if(_.searchParams.set("response_type","code"),_.searchParams.set("client_id",s),_.searchParams.set("redirect_uri",S),l&&_.searchParams.set("scope",l),_.searchParams.set("state",y),h&&(_.searchParams.set("code_challenge",h),_.searchParams.set("code_challenge_method",g)),e.audience&&_.searchParams.set("audience",this.resolve(e.audience,t)),e.resource&&_.searchParams.set("resource",this.resolve(e.resource,t)),e.extraParams)for(let[X,T]of Object.entries(e.extraParams))_.searchParams.set(X,this.resolve(T,t));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let R=new Promise((X,T)=>{this.pendingAuthCallback={resolve:X,reject:T,state:y}});await this.browserService.openExternal(_.toString());let I;try{I=await Promise.race([R,new Promise((X,T)=>setTimeout(()=>{this.pendingAuthCallback=null,T(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(I.state&&I.state!==y)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let q=new URLSearchParams;q.append("grant_type","authorization_code"),q.append("code",I.code),q.append("redirect_uri",S),d&&q.append("code_verifier",d);let j={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,j,q,s,a,t);let B=await this.httpService.execute({method:"POST",url:i,headers:j,body:q.toString()}),V=this.parseTokenResponse(B.body,e),W=this.buildCacheKeyString(e);return this.tokenCache.set(W,V),V.refreshToken&&await this.storeRefreshToken(W,V.refreshToken),V}async implicitFlow(e,t){let n=this.resolve(e.authUrl||"",t),i=this.resolve(e.clientId||"",t),s=e.scope?this.resolve(e.scope,t):void 0;if(!n)throw new Error("OAuth2 authUrl is required for implicit flow");if(!i)throw new Error("OAuth2 clientId is required for implicit flow");let a=e.state||Ql.randomBytes(16).toString("hex"),l=await this.getCallbackUri(),f=new URL(n);if(f.searchParams.set("response_type","token"),f.searchParams.set("client_id",i),f.searchParams.set("redirect_uri",l),s&&f.searchParams.set("scope",s),f.searchParams.set("state",a),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,t)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,t)),e.extraParams)for(let[S,_]of Object.entries(e.extraParams))f.searchParams.set(S,this.resolve(_,t));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let d=new Promise((S,_)=>{this.pendingImplicitCallback={resolve:S,reject:_,state:a}});await this.browserService.openExternal(f.toString());let h;try{h=await Promise.race([d,new Promise((S,_)=>setTimeout(()=>{this.pendingImplicitCallback=null,_(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(h.state&&h.state!==a)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let g={accessToken:h.accessToken,tokenType:h.tokenType||e.tokenPrefix||"Bearer",expiresAt:h.expiresIn?Date.now()+h.expiresIn*1e3:void 0,raw:{access_token:h.accessToken,token_type:h.tokenType,expires_in:h.expiresIn}},y=this.buildCacheKeyString(e);return this.tokenCache.set(y,g),g}handleAuthorizationCallback(e,t,n){if(n){let i=new Error(`OAuth2 authorization error: ${n}`);this.pendingAuthCallback?.reject(i),this.pendingImplicitCallback?.reject(i),this.pendingAuthCallback=null,this.pendingImplicitCallback=null;return}if(e&&this.pendingAuthCallback){this.pendingAuthCallback.resolve({code:e,state:t}),this.pendingAuthCallback=null;return}!e&&!this.pendingAuthCallback&&this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow did not receive access_token")),this.pendingImplicitCallback=null)}handleImplicitCallback(e,t,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:t,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let t=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(t),this.secretStore.delete(`oauth2_refresh_${t}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,t,n){let i=this.resolve(e.tokenUrl||"",t);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",t),a=this.resolve(e.clientSecret||"",t),l=e.scope?this.resolve(e.scope,t):void 0,f=new URLSearchParams;if(f.append("grant_type",n),l&&f.append("scope",l),n==="password"){let g=this.resolve(e.username||"",t),y=this.resolve(e.password||"",t);if(!g)throw new Error("OAuth2 password grant requires username");f.append("username",g),f.append("password",y)}if(e.audience&&f.append("audience",this.resolve(e.audience,t)),e.resource&&f.append("resource",this.resolve(e.resource,t)),e.extraParams)for(let[g,y]of Object.entries(e.extraParams))f.append(g,this.resolve(y,t));let d={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,d,f,s,a,t);let h=await this.httpService.execute({method:"POST",url:i,headers:d,body:f.toString()});return this.parseTokenResponse(h.body,e)}applyClientAuth(e,t,n,i,s,a){if(e.clientAuthentication==="header"){let l=Buffer.from(`${i}:${s}`).toString("base64");t.Authorization=`Basic ${l}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,t){let n=e;if(typeof n=="string")try{n=JSON.parse(n)}catch{throw new Error("OAuth2 token response is not valid JSON")}if(!n||typeof n!="object")throw new Error("OAuth2 token response is not a valid JSON object");let i=n,s=t.tokenField||"access_token",a=i[s];if(!a)throw new Error(`OAuth2 token fetch failed: '${s}' not present in response`);let l=typeof i.expires_in=="number"?i.expires_in:void 0;return{accessToken:a,tokenType:i.token_type||t.tokenPrefix||"Bearer",expiresAt:l?Date.now()+l*1e3:void 0,refreshToken:i.refresh_token,scope:i.scope,raw:i}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-bW:!1}buildCacheKeyString(e){return`${e.tokenUrl||""}|${e.clientId||""}|${e.scope||""}|${e.grantType}`}async getCallbackUri(){let e=`${this.browserService.uriScheme}://${this.callbackPath}`;return this.browserService.asExternalUri(e)}resolve(e,t){return this.envConfigService.resolveVariables(e,t)}generateCodeVerifier(){return Ql.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Ql.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,t){try{await this.secretStore.store(`oauth2_refresh_${e}`,t)}catch{}}}});import*as ma from"fs";import*as Js from"path";function Zl(r,e={}){let t=[];Object.entries(e).forEach(([n,i])=>{t.push(`${n}=${i}`)}),t.length&&ma.writeFileSync(r,t.join(`
|
|
51
|
+
`),"utf-8")}function Rf(r,e,t){t&&(t.preRequest&&t.preRequest.trim()&&ma.writeFileSync(Js.join(r,`${e}.pre.js`),t.preRequest,"utf-8"),t.postResponse&&t.postResponse.trim()&&ma.writeFileSync(Js.join(r,`${e}.post.js`),t.postResponse,"utf-8"))}function SW(r,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return Js.isAbsolute(n)?n:Js.join(r,n)}async function wW(r,e,t,n,i){await r.exportCollectionAsRestClientFolder(t,n),e.exportEnvironmentsToFolder(n,i)}function em(r,e,t){r.forEach(n=>{if(n.type==="folder"){let i=Js.join(e,kt(n.name));ma.mkdirSync(i,{recursive:!0}),Rf(i,kt(n.name),n.scripts),em(n.items||[],i,t)}else if(n.type==="request"){let i=n,s=kt(i.name)+".http",a=Js.join(e,s),l=_W(i,t);ma.writeFileSync(a,l,"utf-8"),Rf(e,kt(i.name),i.scripts)}})}function _W(r,e){let t=[];t.push(`### ${e.name} / ${r.name}`),t.push(`# collection env: ${kt(e.name)}.env`),t.push(`# request scripts: ${kt(r.name)}.pre.js and .post.js`);let n=RW(r);return t.push(`${r.method} ${n}`),(r.headers||[]).filter(i=>i.enabled!==!1).forEach(i=>{t.push(`${i.key}: ${i.value}`)}),r.body&&r.body.content&&t.push("",r.body.content),t.join(`
|
|
52
|
+
`)}function RW(r){let e=r.url;if(r.query&&r.query.length){let t=r.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");t&&(e+=(e.includes("?")?"&":"?")+t)}return e}var tm=se(()=>{"use strict";bn()});import*as fr from"fs";import*as N0 from"path";var Xl,D0=se(()=>{"use strict";bn();Xl=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){fr.existsSync(this.collectionsDir)||fr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!fr.existsSync(this.collectionsDir))return[];let e=fr.readdirSync(this.collectionsDir),t=[];for(let n of e)if(n.endsWith(".json"))try{let i=N0.join(this.collectionsDir,n),s=fr.readFileSync(i,"utf-8"),a=JSON.parse(s);a.id&&a.name&&(this.cache.set(a.id,a),t.push(a))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return t}load(e){if(this.cache.has(e))return this.cache.get(e);let t=this.getCollectionPath(e);if(fr.existsSync(t))try{let n=fr.readFileSync(t,"utf-8"),i=JSON.parse(n);return this.cache.set(e,i),i}catch(n){console.error(`[JsonCollectionLoader] Failed to load collection ${e}:`,n);return}}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=pt(e.name));let t=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await fr.promises.writeFile(t,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let t=this.getCollectionPath(e);if(!fr.existsSync(t))return!1;try{return await fr.promises.unlink(t),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return fr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return N0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,t){}async create(e,t){let n={id:t||pt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,t,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,t);s&&(s.scripts=n,await this.save(i))}loadScripts(e,t){let n=this.load(e);return n?this.findItemById(n.items,t)?.scripts:void 0}async updateCollectionMetadata(e,t){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);t.name!==void 0&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.version!==void 0&&(n.version=t.version),t.variables!==void 0&&(n.variables=t.variables),t.auth!==void 0&&(n.auth=t.auth),await this.save(n)}async saveItem(e,t,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,t.id);if(s)Object.assign(s,t);else if(n){let a=this.findItemById(i.items,n);if(a&&a.type==="folder")a.items=a.items||[],a.items.push(t);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(t);await this.save(i)}async deleteItem(e,t){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,t);return i&&await this.save(n),i}async updateItem(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,t);if(!s)return!1;let{id:a,type:l,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,t);if(!s)return!1;let a={...s};if(!this.deleteItemById(i.items,t))return!1;if(n){let l=this.findItemById(i.items,n);if(l&&l.type==="folder")l.items=l.items||[],l.items.push(a);else return i.items.push(a),!1}else i.items.push(a);return await this.save(i),!0}async reorderItems(e,t,n){let i=this.load(e);if(!i)return!1;try{let s;if(t){let f=this.findItemById(i.items,t);if(!f||!f.items)return!1;s=f.items}else s=i.items;let a=new Map(s.map(f=>[f.id,f])),l=[];for(let f of n){let d=a.get(f);d&&(l.push(d),a.delete(f))}for(let f of a.values())l.push(f);if(t){let f=this.findItemById(i.items,t);f&&(f.items=l)}else i.items=l;return await this.save(i),!0}catch(s){return console.error("[JsonCollectionLoader] Failed to reorder items:",s),!1}}findItemById(e,t){for(let n of e){if(n.id===t)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,t);if(i)return i}}}deleteItemById(e,t){for(let n=0;n<e.length;n++){if(e[n].id===t)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,t))return!0}return!1}}});var Cf,F0=se(()=>{"use strict";rh();D0();Cf=class{static create(e){let t=e.getStorageConfig(),n=e.getCollectionsPath();return t.format==="folder"?new Ds(n):new Xl(n)}static createForFormat(e,t){return e==="folder"?new Ds(t):new Xl(t)}}});import*as _t from"fs";import*as Qn from"path";function wP(r){if(typeof r!="string")return"text";let e=r.trim();try{let t=JSON.parse(e);if(typeof t=="object"&&t!==null)return"json"}catch{}return/^<\?xml/.test(e)||/^<([a-zA-Z_][\w\-\.]*)[\s>]/.test(e)?/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":"xml":/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":/^(function\s*\(|\(\)\s*=>|const |let |var |export |import )/.test(e)?"javascript":"text"}function CW(r){return{info:{name:r.name,_postman_id:r.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:r.items.map(e=>_P(e)),event:L0(r.scripts),variable:r.variables?Object.entries(r.variables).map(([e,t])=>({key:e,value:t})):[]}}function _P(r){if(r.type==="folder")return{name:r.name,item:r.items?r.items.map(_P):[],event:L0(r.scripts)};if(r.type==="request"){let e=r;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(t=>t.enabled!==!1).map(xW),url:EW(e),body:OW(e),auth:IW(e.auth),description:e.description},event:L0(e.scripts),protocolProfileBehavior:PW(e.settings)}}}function xW(r){return{key:r.key,value:r.value,disabled:r.enabled===!1}}function EW(r){let e=r.url,t=r.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=t.match(/^([^\/\?]+)/);if(i){let d=i[1];/^{{.*}}$/.test(d)?n=[d]:n=d.split(".")}let s=[],a=t.match(/^[^\/\?]+(\/[^\?]*)?/);if(a&&a[1]!==void 0){let d=a[1].replace(/^\//,"");d.endsWith("/")?(s=d.slice(0,-1).split("/"),s.push("")):s=d.length>0?d.split("/"):[]}let l;if(Array.isArray(r.query)&&r.query.length>0)l=r.query.map(d=>{let h={key:d.key,value:d.value};return d.enabled===!1&&(h.disabled=!0),h});else{let d=t.indexOf("?");d!==-1&&(l=t.substring(d+1).split("&").map(g=>{let[y,...S]=g.split("=");return{key:y,value:S.join("=")}}))}let f;return r.params&&typeof r.params=="object"&&(f=Object.entries(r.params).map(([d,h])=>({key:d,value:String(h)}))),{raw:e,host:n.length>0?n:void 0,path:s.length>0?s:void 0,query:l&&l.length>0?l:void 0,variable:f&&f.length>0?f:void 0}}function OW(r){if(!r.body)return;let e=r.body;if(typeof e=="string"){let s=wP(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||wP(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let t=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(t)return{mode:"formdata",formdata:t.map(s=>({key:s.key,value:s.value,type:s.type||"text",disabled:s.enabled===!1}))};let n=e.type==="x-www-form-urlencoded"&&Array.isArray(e.content)?e.content:e.type==="urlencoded"&&Array.isArray(e.fields)?e.fields:null;if(n)return{mode:"urlencoded",urlencoded:n.map(s=>({key:s.key,value:s.value,disabled:s.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="binary")return{mode:"binary",file:{}};let i=e.type==="graphql"?e.content??(e.query?e:null):null;if(i){let s=i.query??"",a=i.variables;return{mode:"graphql",graphql:{query:s,variables:a?typeof a=="string"?a:JSON.stringify(a):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function IW(r){if(!(!r||!r.type||r.type==="none")){if(r.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:r.bearerToken,type:"string"}]};if(r.type==="basic"&&r.basicAuth)return{type:"basic",basic:[{key:"username",value:r.basicAuth.username,type:"string"},{key:"password",value:r.basicAuth.password,type:"string"}]}}}function PW(r){if(!r)return;let e={};return r.followRedirects===!1&&(e.followRedirects=!1),r.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),r.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),r.maxRedirects!==void 0&&(e.maxRedirects=r.maxRedirects),r.strictSSL===!1&&(e.disableUrlEncoding=!1),r.timeout!==void 0&&(e.requestTimeout=r.timeout),Object.keys(e).length>0?e:void 0}function L0(r){if(!r)return[];let e=[];return r.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[r.preRequest]}}),r.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[r.postResponse]}}),e}var xf,j0=se(()=>{"use strict";bn();tm();F0();xf=class{constructor(e,t,n){this.workspaceRoot=e;this.configService=t;this.fileWatcherFactory=n;this.collectionsDir=t.getCollectionsPath(),this.loader=Cf.create(t),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;debounceTimer=null;selfWritePending=!1;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){_t.existsSync(this.collectionsDir)||_t.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let t of e)this.collections.set(t.id,t)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null;let t=this.selfWritePending;this.selfWritePending=!1,t||this.loadCollections(),this.onCollectionsChanged?.()},300)};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let t of this.collections.values())if(t.id===e)return t}getCollectionByName(e){let t=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===t)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=pt(e.name)),this.selfWritePending=!0,await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let t=this.collections.get(e);return t?.variables?{...t.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,t,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[t]=String(n)}deleteCollectionVariable(e,t){let n=this.localCollectionValues.get(e);n&&delete n[t]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,t){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,t)}findRequestByPath(e,t){let n=this.collections.get(e);if(!n)return;let i=t.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,t,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,t,n);if(s){let a=this.findItemRecursive(i.items,t);if(a){let{id:l,type:f,...d}=n;Object.assign(a,d)}}return s}async addRequest(e,t,n){let i=this.collections.get(e);if(!i)return!1;t.id||(t.id=pt(t.name)),this.selfWritePending=!0;try{if(await this.loader.saveItem(e,t,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(t))}else i.items.push(t);return!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,t){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,t);return i&&this.deleteItemRecursive(n.items,t),i}getAllRequests(e){let t=this.collections.get(e);if(!t)return[];let n=[];return this.collectRequestsRecursive(t.items,n),n}findItemRecursive(e,t){for(let n of e){if(n.id===t)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,t);if(i)return i}}}findItemByPath(e,t){if(t.length===0)return;let[n,...i]=t,s=e.find(a=>a.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,t,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===t)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,t,n))return!0}return!1}deleteItemRecursive(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===t)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,t))return!0}return!1}collectRequestsRecursive(e,t){for(let n of e)n.type==="request"?t.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,t)}async createCollection(e){let t={id:pt(e),name:e,items:[]};return await this.saveCollection(t),t}async renameCollection(e,t){let n=this.collections.get(e);return n?(n.name=t,await this.saveCollection(n),!0):!1}async duplicateCollection(e,t){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);this.selfWritePending=!0;let i=pt(t),s=this.loader.getCollectionPath(e),a=Qn.join(this.collectionsDir,i);if(!_t.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let l=Qn.join(a,"collection.json");if(_t.existsSync(l)){let d=JSON.parse(_t.readFileSync(l,"utf-8"));d.id=i,d.name=t,_t.writeFileSync(l,JSON.stringify(d,null,2))}else _t.writeFileSync(l,JSON.stringify({id:i,name:t},null,2));this.loadCollections();let f=this.collections.get(i);if(!f)throw new Error("Failed to load duplicated collection");return f}async createFolder(e){let t=this.collections.get(e.collectionId);if(!t)throw new Error("Collection not found");this.selfWritePending=!0;let n={id:pt(e.name),type:"folder",name:e.name,items:[]};if(await this.loader.saveItem(e.collectionId,n,e.parentId),e.parentId){let i=this.findItemById(t.items,e.parentId);i&&i.type==="folder"&&(i.items=i.items||[],i.items.push(n))}else t.items.push(n);return n}async deleteFolder(e,t){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,t);return i&&this.deleteItemById(n.items,t),i}async renameFolder(e,t,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,t,{name:n});if(s){let a=this.findItemById(i.items,t);a&&(a.name=n)}return s}async duplicateFolder(e,t,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,t);if(!s||!_t.existsSync(s))throw new Error(`Folder not found on disk: ${t}`);let a=Qn.dirname(s),l=pt(n),f=Qn.join(a,l);this.selfWritePending=!0,this.copyDirRecursive(s,f);let d=Qn.join(f,"folder.json");if(_t.existsSync(d)){let y=JSON.parse(_t.readFileSync(d,"utf-8"));y.id=l,y.name=n,_t.writeFileSync(d,JSON.stringify(y,null,2))}else _t.writeFileSync(d,JSON.stringify({id:l,name:n,type:"folder"},null,2));this.loadCollections();let h=this.collections.get(e),g=h?this.findItemById(h.items,l):void 0;return g||{id:l,type:"folder",name:n,items:[]}}async createRequest(e){let t=this.collections.get(e.collectionId);if(!t)throw new Error("Collection not found");this.selfWritePending=!0;let n={id:e.id||pt(e.name),type:"request",name:e.name,method:e.method||"GET",url:e.url,params:e.params,query:e.query,headers:e.headers,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts,deprecated:e.deprecated,description:e.description,doc:e.doc,responseSchema:e.responseSchema,bodySchema:e.bodySchema};if(await this.loader.saveItem(e.collectionId,n,e.parentId),e.parentId){let i=this.findItemById(t.items,e.parentId);i&&i.type==="folder"&&(i.items=i.items||[],i.items.push(n))}else t.items.push(n);return n}async renameRequest(e,t,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,t,{name:n});if(s){let a=this.findItemById(i.items,t);a&&(a.name=n)}return s}async moveItem(e,t,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.moveItem(e,t,n);return s&&this.loadCollections(),s}async reorderItems(e,t,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.reorderItems(e,t,n);return s&&this.loadCollections(),s}findItemById(e,t){for(let n of e){if(n.id===t)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,t);if(i)return i}}}copyDirRecursive(e,t){_t.existsSync(t)||_t.mkdirSync(t,{recursive:!0});for(let n of _t.readdirSync(e,{withFileTypes:!0})){let i=Qn.join(e,n.name),s=Qn.join(t,n.name);n.isDirectory()?this.copyDirRecursive(i,s):_t.copyFileSync(i,s)}}deleteItemById(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===t)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,t))return!0}return!1}async importCollection(e){let t=_t.readFileSync(e,"utf-8"),n;try{n=JSON.parse(t)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||pt(n.name||"Imported Collection"),name:n.name||"Imported Collection",description:n.description,items:n.items||[]};return await this.saveCollection(i),i}async importPostmanCollection(e){let t=d=>{if(!d)return;switch(d.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:d.bearer?.find(q=>q.key==="token")?.value||""};case"basic":let y=d.basic?.find(q=>q.key==="username"),S=d.basic?.find(q=>q.key==="password");return{type:"basic",basicAuth:{username:y?.value||"",password:S?.value||""}};case"apikey":let _=d.apikey?.find(q=>q.key==="key"),R=d.apikey?.find(q=>q.key==="value"),I=d.apikey?.find(q=>q.key==="in");return{type:"apikey",apikey:{key:_?.value||"",value:R?.value||"",in:I?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=d=>{if(!Array.isArray(d)||d.length===0)return;let h={};for(let g of d){let y=g.script?.exec;if(!y)continue;let S=Array.isArray(y)?y.join(`
|
|
53
|
+
`):y;g.listen==="prerequest"?h.preRequest=S:g.listen==="test"&&(h.postResponse=S)}return h.preRequest||h.postResponse?h:void 0},i=d=>{if(!d||typeof d!="object")return;let h={};return d.followRedirects===!1&&(h.followRedirects=!1),d.followOriginalHttpMethod===!0&&(h.followOriginalMethod=!0),d.followAuthorizationHeader===!1&&(h.followAuthHeader=!1),d.maxRedirects!==void 0&&(h.maxRedirects=d.maxRedirects),d.requestTimeout!==void 0&&(h.timeout=d.requestTimeout),Object.keys(h).length>0?h:void 0},s=d=>{if(!d||typeof d=="string")return;let h=d.query;if(!(!Array.isArray(h)||h.length===0))return h.map(g=>({key:g.key||"",value:g.value||"",enabled:g.disabled!==!0}))},a=d=>{if(typeof d=="string")return d;if(!d)return"";let h=new Set;if(Array.isArray(d.variable))for(let y of d.variable)y.key&&h.add(y.key);if(h.size===0&&d.raw)return d.raw;let g="";if(d.protocol&&(g+=d.protocol+"://"),d.host&&(g+=Array.isArray(d.host)?d.host.join("."):d.host),d.port&&(g+=":"+d.port),d.path){let S=(Array.isArray(d.path)?d.path:[d.path]).map(_=>{let R=_.startsWith(":")?_.substring(1):_;return h.has(R)?":"+R:(_.startsWith(":"),_)});g+="/"+S.join("/")}return!g&&d.raw?d.raw:g},l=d=>d.map(h=>{if(h.item)return{id:pt(h.name),type:"folder",name:h.name,description:h.description,auth:t(h.auth),scripts:n(h.event),items:l(h.item)};{let g=h.request||{};return{id:pt(h.name),type:"request",name:h.name,description:h.description||g.description,method:typeof g.method=="string"?g.method:"GET",url:a(g.url),query:s(g.url),headers:Array.isArray(g.header)?g.header.map(y=>({key:y.key||y.name||"",value:y.value||y.value||"",enabled:y.disabled!==!0})):[],body:(()=>{let y=g.body;if(y){if(y.mode==="raw"&&y.raw){let S=y.options?.raw?.language;return{type:"raw",format:S==="xml"?"xml":S==="html"?"html":S==="javascript"?"javascript":S==="text"?"text":"json",content:y.raw}}if(y.mode==="urlencoded"&&Array.isArray(y.urlencoded))return{type:"x-www-form-urlencoded",content:y.urlencoded.map(S=>({key:S.key||"",value:S.value||"",enabled:S.disabled!==!0}))};if(y.mode==="formdata"&&Array.isArray(y.formdata))return{type:"form-data",content:y.formdata.map(S=>({key:S.key||"",value:S.value||"",type:S.type||"text",enabled:S.disabled!==!0}))};if(y.mode==="graphql"&&y.graphql){let S;if(y.graphql.variables)try{S=JSON.parse(y.graphql.variables)}catch{S=void 0}return{type:"graphql",content:{query:y.graphql.query||"",variables:S}}}if(y.mode==="binary")return{type:"binary",content:""}}})(),auth:t(g.auth),scripts:n(h.event),settings:i(h.protocolProfileBehavior)}}}),f={id:pt(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:t(e.auth),scripts:n(e.event),items:l(e.item||[])};return await this.saveCollection(f),f}async exportCollection(e,t){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=CW(n),s=JSON.stringify(i,null,2);_t.writeFileSync(t,s,"utf-8")}async exportCollectionAsRestClientFolder(e,t){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Qn.join(t,kt(n.name));_t.mkdirSync(i,{recursive:!0});let s=n.variables||{};Zl(Qn.join(i,`${kt(n.name)}.env`),s),Rf(i,kt(n.name),n.scripts),em(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var zt,eu,ga,U0=se(()=>{"use strict";zt={version:"1.0",storage:{format:"folder",root:"./http-forge-assets",history:"./.http-forge-cache/histories",results:"./.http-forge-cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0},scripts:{modulePaths:["./http-forge-assets/src","./http-forge-assets/lib"],scope:"shared",timeout:5e3},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:500,toolMode:"auto",drilldownThreshold:100,toolPageSize:150,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null,secrets:{providers:{aws:{provider:"aws"},azure:{provider:"azure",vaultUrl:""},gcp:{provider:"gcp"},vault:{provider:"vault"},op:{provider:"1password"},doppler:{provider:"doppler"}}}},eu={config:"http-forge.config.json"},ga={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as Ur from"fs";import*as xn from"path";var tu,H0=se(()=>{"use strict";U0();tu=class{constructor(e,t,n){this.workspacePath=e;this.fileWatcherFactory=t;this.notifications=n;this.configPath=xn.join(e,eu.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!Ur.existsSync(this.configPath))return{...zt};try{let e=Ur.readFileSync(this.configPath,"utf-8"),t=JSON.parse(e);return this.mergeWithDefaults(t)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${eu.config}. Using default configuration.`),{...zt}}}mergeWithDefaults(e){return{version:e.version??zt.version,storage:{...zt.storage,...e.storage},request:{...zt.request,...e.request},scripts:{...zt.scripts,...e.scripts},runner:{...zt.runner,...e.runner},environments:{...zt.environments,...e.environments},restClientExport:{...zt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:zt.proxy,mcp:{...zt.mcp,...e.mcp,cors:{...zt.mcp.cors,...e.mcp?.cors}},secrets:{...zt.secrets,...e.secrets,providers:{...zt.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,eu.config);let e=()=>{this.reload()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getConfig(){return this.config}getStorageConfig(){return this.config.storage}getRequestConfig(){return this.config.request}getScriptsConfig(){return this.config.scripts}getRunnerConfig(){return this.config.runner}getEnvironmentsConfig(){return this.config.environments}getRestClientExportPath(){let e=this.config.restClientExport?.path||"collections-rest-client";return xn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){let e=this.config.mcp??zt.mcp;return{...e,toolMode:["flat","drilldown","auto"].includes(e.toolMode)?e.toolMode:"auto",drilldownThreshold:Math.min(500,Math.max(10,e.drilldownThreshold??100)),toolPageSize:e.toolPageSize===0?0:Math.min(1e3,Math.max(10,e.toolPageSize??150)),maxRequestsPerCall:Math.min(1e4,Math.max(1,e.maxRequestsPerCall??500))}}resolvePath(e){let t=e.startsWith("./")?e.slice(2):e;return xn.join(this.workspacePath,...t.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return xn.join(this.getRootPath(),ga.collections)}getEnvironmentsPath(){return xn.join(this.getRootPath(),ga.environments)}getFlowsPath(){return xn.join(this.getRootPath(),ga.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return xn.join(this.getRootPath(),ga.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getScriptScope(){return this.config.scripts.scope??"shared"}getScriptTimeout(){return this.config.scripts.timeout??5e3}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return Ur.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(zt,null,2);await Ur.promises.writeFile(this.configPath,e,"utf-8");let t=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of t)Ur.existsSync(i)||await Ur.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Ur.existsSync(i)||await Ur.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),t={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await Ur.promises.writeFile(xn.join(e,"globals.json"),JSON.stringify(t,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await Ur.promises.writeFile(xn.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await Ur.promises.writeFile(xn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}}});var kW,Ef,B0=se(()=>{"use strict";zo();kW="httpForge.cookies",Ef=class{constructor(e,t=kW){this.store=e;this.storeKey=t;this.loadCookies()}store;storeKey;cookies=new Map;loadCookies(){try{let e=this.store.get(this.storeKey);e&&(this.cookies=new Map(Object.entries(e)),this.cleanExpiredCookies())}catch(e){console.error("[CookieService] Failed to load cookies:",e)}}async saveCookies(){try{let e={};this.cookies.forEach((t,n)=>{e[n]=t}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,t,n){return`${t||"*"}|${n||"/"}|${e}`}get(e,t){if(t){let s=this.getCookieKey(e,t),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(t&&s.domain){if(this.domainMatches(t,s.domain))return s}else return s}async set(e){let t=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(t,e),await this.saveCookies()}async setFromResponse(e){for(let t of e){let n=this.getCookieKey(t.name,t.domain,t.path);this.cookies.set(n,t)}await this.saveCookies()}has(e,t){return this.get(e,t)!==void 0}async delete(e,t,n){let i=this.getCookieKey(e,t,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let t=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&t.push(n):t.push(n));return t}getCookieHeader(e){let t=this.getAll(e);return lt.formatCookieHeader(t)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let t=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&t.push(n);for(let n of t)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,t){return lt.parseCookieHeaders(e,t)}isExpired(e){return lt.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[t,n]of this.cookies.entries())this.isExpired(n)&&e.push(t);for(let t of e)this.cookies.delete(t);e.length>0&&this.saveCookies()}domainMatches(e,t){return lt.domainMatches(e,t)}get count(){return this.cookies.size}}});var Of,V0=se(()=>{"use strict";zo();Of=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}cookieService;localCache=[];pendingOperations=[];get(e,t){return t?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===t||t.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,t){return this.get(e,t)!==void 0}set(e){let t=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));t>=0?this.localCache[t]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,t,n){let i=this.localCache.findIndex(s=>s.name===e&&(!t||s.domain===t||s.domain&&t.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:t,path:n}),!0}getAll(e){return e?this.localCache.filter(t=>{let n=t.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(t=>{let n=t.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,t){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(t,n);i.length>0&&(i.forEach(s=>{let a=this.localCache.findIndex(l=>l.name===s.name&&l.domain===(s.domain||n));a>=0?this.localCache[a]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let t=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(lt.isExpired(s)||s.domain&&!lt.domainMatches(t,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return lt.formatCookieHeader(i)}clear(){this.localCache=[],this.pendingOperations.push({type:"clear"})}async flush(){for(let e of this.pendingOperations)switch(e.type){case"set":e.cookie&&await this.cookieService.set(e.cookie);break;case"delete":e.name&&await this.cookieService.delete(e.name,e.domain,e.path);break;case"clear":await this.cookieService.clear();break}this.pendingOperations=[]}}});function rm(r){try{let e=JSON.parse(typeof r=="string"?r:r.toString("utf-8"));if(!e)return null;let t=e.environment||e,n=t.name||e.name||"imported-environment",i=t.values||t.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let l of i){if(!l)continue;let f=l.key??l.name,d=typeof l.enabled=="boolean"?l.enabled:!0;f&&d!==!1&&(s[f]=l.value??l.initial??"")}else if(typeof i=="object"&&i!==null)for(let[l,f]of Object.entries(i))s[l]=String(f??"");let a=t._postman_exported_at?"Imported from Postman export":t.description||"";return{name:n,variables:s,description:a}}catch{return null}}async function TW(r,e){try{let t=await e.readFile(r);return rm(t)}catch{return null}}var W0=se(()=>{"use strict"});import*as Jt from"fs";import*as on from"path";var If,Pf,z0=se(()=>{"use strict";bn();W0();tm();sh();Ac();If={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Pf=class{constructor(e,t,n,i,s){this.workspaceFolder=e;this.workspaceStore=t;this.configService=n;this.fileWatcherFactory=i;this.secretStore=s;let a=n.getEnvironmentsPath();this.environmentsPath=a,this.sharedConfigPath=on.join(a,"_global.json"),this.localConfigPath=on.join(a,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=t.get(If.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.loadPersistedEnvironmentOverrides(),this.loadSecretVariables(this.selectedEnvironment).catch(()=>{}),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;secretStore;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;secretValuesCache=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Jt.existsSync(this.environmentsPath))return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.environmentsPath,"**/*.json");let e=()=>{this.reload(),this.onEnvironmentsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}dispose(){this.fileWatcher?.dispose()}getWorkspaceFolder(){return this.workspaceFolder}getRootPath(){return this.configService.getRootPath()}loadConfigs(){if(!Jt.existsSync(this.environmentsPath)){this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}},this.localConfig={credentials:{},variables:{}};return}this.loadFolderConfigs()}getSharedConfig(){return this.sharedConfig||this.loadConfigs(),this.sharedConfig}getLocalConfig(){return this.localConfig||this.loadConfigs(),this.localConfig}getEnvironmentNames(){let e=this.getSharedConfig();return e?.environments?Object.keys(e.environments):[]}getSelectedEnvironment(){return this.selectedEnvironment}async setSelectedEnvironment(e){if(this.selectedEnvironment=e,await this.workspaceStore.update(If.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let t=this.getEnvOverridesStateKey(e),n=this.workspaceStore.get(t,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}await this.loadSecretVariables(e)}getEnvOverridesStateKey(e){return`${If.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),t=this.workspaceStore.get(e,{});t&&Object.keys(t).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...t})}persistEnvironmentOverrides(e){let t=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore.update(t,n)}setEnvironmentVariable(e,t,n){let i=n??this.selectedEnvironment;this.localEnvironmentValues.has(i)||this.localEnvironmentValues.set(i,{}),this.localEnvironmentValues.get(i)[e]=String(t),this.persistEnvironmentOverrides(i)}deleteEnvironmentVariable(e,t){let n=t??this.selectedEnvironment,i=this.localEnvironmentValues.get(n);i&&(delete i[e],this.persistEnvironmentOverrides(n))}clearEnvironmentVariables(e){let t=e??this.selectedEnvironment;this.localEnvironmentValues.set(t,{}),this.persistEnvironmentOverrides(t)}async resetEnvironmentOverrides(e){let t=e||this.selectedEnvironment;this.localEnvironmentValues.delete(t),await this.workspaceStore.update(this.getEnvOverridesStateKey(t),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,t){this.localGlobalValues[e]=String(t)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.getLocalConfig()?.variables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}getResolvedEnvironment(e){let t=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[t])return null;let s=n.environments[t],a=i?.credentials?.[t],l=i?.variables||{},f=a?.variables||{},d=a&&a.headers||{},h=Cc(n.defaultHeaders||{},d),g=this.localEnvironmentValues.get(t)||{},y=this.secretValuesCache.get(t)||{},S={...s.variables||{},...f,...g,...y};return{name:t,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:h,variables:S}}async getSecretVariable(e,t){return this.secretStore?.get(`${e}:${t}`)}async setSecretVariable(e,t,n){await this.secretStore?.store(`${e}:${t}`,n),this.secretValuesCache.has(e)||this.secretValuesCache.set(e,{}),this.secretValuesCache.get(e)[t]=n}async deleteSecretVariable(e,t){await this.secretStore?.delete(`${e}:${t}`),this.secretValuesCache.get(e)&&delete this.secretValuesCache.get(e)[t]}async loadSecretVariables(e){if(!this.secretStore)return;let t=e||this.selectedEnvironment,n=this.getSharedConfig()?.environments?.[t]?.secretVariables??[];if(n.length===0)return;let i={};await Promise.all(n.map(async s=>{let a=await this.secretStore.get(`${t}:${s}`);a!==void 0&&(i[s]=a)})),this.secretValuesCache.set(t,i)}resolveVariables(e,t){return this.createResolver(t).resolveString(e,!0)}exportEnvironmentsToFolder(e,t=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!t&&Object.keys(s).length){let a=on.join(e,"globals.env");Zl(a,s)}n.forEach(a=>{let l=i?.environments?.[a];if(!l)return;let f={...l.variables||{}};t&&(f={...s,...f});let d=on.join(e,`${kt(a)}.env`);Zl(d,f)})}resolveVariablesWithExtra(e,t,n){return this.createResolver(n,t).resolveString(e,!0)}resolveVariablesInObject(e,t){return this.createResolver(t).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,t,n){return this.createResolver(n,t).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return on.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Jt.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let t={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,t);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),a={variables:i.variables||{}};this.saveJsonFile(s,a)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let t=Jt.readFileSync(e,"utf-8"),n=rm(t);if(!n)throw new Error("Failed to parse Postman environment file");this.sharedConfig||this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}});let i=n.name||`imported-${Date.now()}`;return this.sharedConfig.environments=this.sharedConfig.environments||{},this.sharedConfig.environments[i]=this.sharedConfig.environments[i]||{},this.sharedConfig.environments[i].variables=n.variables,n.description&&(this.sharedConfig.environments[i].description=n.description),this.saveSharedConfig(this.sharedConfig),n}catch(t){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",t),t}}saveEnvLocalConfig(e,t){let n=this.getEnvLocalConfigPath(e),i={variables:t};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:t}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return on.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=Pc(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,t){let s={...this.getResolvedEnvironment(e)?.variables||{},...t||{}},a=this.getGlobalVariables();return new Qo({globals:a,collectionVariables:{},environmentVariables:s,variables:{}})}saveFolderSharedConfig(e){Jt.existsSync(this.environmentsPath)||Jt.mkdirSync(this.environmentsPath,{recursive:!0});let t={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,t);let n=Jt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!ih(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=on.basename(s,".json");if(!i.has(a))try{Jt.unlinkSync(on.join(this.environmentsPath,s))}catch{}}for(let[s,a]of Object.entries(e.environments||{})){let l={name:s,description:a.description,requiresConfirmation:a.requiresConfirmation,variables:a.variables||{}};this.saveJsonFile(on.join(this.environmentsPath,`${s}.json`),l)}}reload(){this.sharedConfig=null,this.localConfig=null,this.loadConfigs()}getAllEnvironments(){return this.loadConfigs(),this.sharedConfig?Object.entries(this.sharedConfig.environments).map(([e,t])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:t.variables||{}})):[]}async setActiveEnvironment(e){await this.setSelectedEnvironment(e)}async createEnvironment(e){if(this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{}}),this.sharedConfig.environments[e])throw new Error(`Environment "${e}" already exists`);this.sharedConfig.environments[e]={description:`Created ${new Date().toISOString()}`,variables:{}},this.saveSharedConfig(this.sharedConfig)}async deleteEnvironment(e){if(this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentExists(e),delete this.sharedConfig.environments[e],this.selectedEnvironment===e){let t=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=t.length>0?t[0]:"dev",await this.workspaceStore.update(If.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,t){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(t),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(t);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[t]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[t].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,t){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(t),this.validateEnvironmentExists(e),t!==e&&(this.validateEnvironmentNameNotTaken(t),this.sharedConfig.environments[t]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=t,await this.workspaceStore.update(If.SELECTED_ENVIRONMENT,t)),this.saveSharedConfig(this.sharedConfig))}validateEnvironmentName(e){if(!e||e.trim().length===0)throw new Error("Environment name cannot be empty");if(e.length>128)throw new Error("Environment name cannot exceed 128 characters");if(!/^[a-zA-Z0-9_\-\.]+$/.test(e))throw new Error("Environment name can only contain letters, numbers, hyphens, underscores, and dots")}validateEnvironmentExists(e){if(!this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" not found`)}validateEnvironmentNameNotTaken(e){if(this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" already exists`)}validateConfigLoaded(){if(!this.sharedConfig)throw new Error("No environment configuration loaded")}async updateEnvironmentVariables(e,t){if(this.loadConfigs(),!this.sharedConfig)throw new Error("No configuration loaded");let n=this.sharedConfig.environments[e];if(!n)throw new Error(`Environment "${e}" not found`);n.variables=t,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Jt.existsSync(e))return null;let t=Jt.readFileSync(e,"utf-8");return JSON.parse(t)}catch(t){return console.error(`Failed to load JSON from ${e}:`,t),null}}saveJsonFile(e,t){try{let n=on.dirname(e);Jt.existsSync(n)||Jt.mkdirSync(n,{recursive:!0}),Jt.writeFileSync(e,JSON.stringify(t,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var Gs,nm=se(()=>{"use strict";gf();Gs=class r{constructor(e,t,n,i,s,a,l,f,d,h,g,y){this.httpService=e;this.scriptExecutor=t;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=a;this.collectionScripts=l;this.folderScriptsChain=f;this.onConsoleOutput=d;this.collectionName=h;this.iteration=g;this.iterationCount=y}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;iteration;iterationCount;async execute(e,t,n){let i=Date.now();return this.executeWithSession(e,t,n,i)}async executeWithSession(e,t,n,i){let s=this.collectPreRequestScripts(e),a=this.collectPostResponseScripts(e),l=this.envConfigService.getResolvedEnvironment(this.environment);if(!l)throw new Error(`Environment "${this.environment}" not found or not configured`);let f=this.envConfigService.getGlobalVariables(),d={request:e,variables:{...t},environmentVariables:l.variables||{},globals:{...f},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(y,S,_)=>{y==="set"&&S&&_!==void 0?this.envConfigService.setEnvironmentVariable(S,_,this.environment):y==="unset"&&S?this.envConfigService.deleteEnvironmentVariable(S,this.environment):y==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(y,S,_)=>{y==="set"&&S&&_!==void 0?this.envConfigService.setGlobalVariable(S,_):y==="unset"&&S?this.envConfigService.deleteGlobalVariable(S):y==="clear"&&this.envConfigService.clearGlobalVariables()}},h=this.scriptExecutor.createRequestSession(d),g=null;try{let y={...t},S={...e},_;if(s.length>0){let $=await h.executePreRequest(s);if($.consoleOutput&&$.consoleOutput.length>0&&this.onConsoleOutput?.($.consoleOutput),$.nextRequest!==void 0&&(_=$.nextRequest),$.skipRequest){let G={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:G,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:y,nextRequest:_}}$.success&&($.modifiedRequest&&($.modifiedRequest.url&&(S.url=$.modifiedRequest.url),$.modifiedRequest.headers&&(S.headers=$.modifiedRequest.headers),$.modifiedRequest.params&&(S.params=$.modifiedRequest.params),$.modifiedRequest.query&&(S.query=$.modifiedRequest.query),$.modifiedRequest.body!==void 0&&(S.body=$.modifiedRequest.body)),($.localVariables??$.modifiedVariables)&&(y=$.localVariables??$.modifiedVariables))}g=await this.requestPreparer.prepareRequest(S,this.environment,l,y);let{url:R,headers:I,body:q,method:j}=g,B={};for(let $ in I)Object.prototype.hasOwnProperty.call(I,$)&&(B[$.toUpperCase()]=I[$]);if(!B.COOKIE&&S.settings?.includeCookies!==!1&&this.cookieJar){let G=this.cookieJar.getCookieHeader(R);G&&(B.COOKIE=G)}let V={method:j,url:R,headers:B,body:q.content,signal:n,settings:S.settings?{timeout:S.settings.timeout,followRedirects:S.settings.followRedirects,maxRedirects:S.settings.maxRedirects,strictSSL:S.settings.strictSSL}:void 0},W=await this.httpService.execute(V);this.cookieJar&&W.headers&&await this.cookieJar.setCookiesFromResponse(R,W.headers);let X=Date.now()-i,T=[],C={},k;if(a.length>0){let $=0;if(W.body)if(typeof W.body=="string")$=Buffer.byteLength(W.body,"utf8");else if(Buffer.isBuffer(W.body))$=W.body.length;else try{$=Buffer.byteLength(JSON.stringify(W.body),"utf8")}catch{$=0}let G=Qh(W.headers,W.cookies,g.url),K={executedRequest:g,status:W.status,statusText:W.statusText,headers:P0(W.headers||{}),body:W.body,cookies:G,responseTime:W.time,responseSize:$},ne=await h.executePostResponse(a,K);T=ne.testResults,C=ne.modifiedEnvironmentVariables||{},k=ne.visualizerData,ne.nextRequest!==void 0&&(_=ne.nextRequest),ne.consoleOutput&&ne.consoleOutput.length>0&&this.onConsoleOutput?.(ne.consoleOutput)}let N=T.length===0||T.every($=>$.passed),U=T.length>0?N:W.status>=200&&W.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...g,headers:B},response:{status:W.status,statusText:W.statusText,headers:W.headers||{},body:W.body,time:W.time||X,cookies:W.cookies||[]},duration:X,timestamp:Date.now(),passed:U,assertions:T,modifiedVariables:y,modifiedEnvironmentVariables:C,nextRequest:_,visualizerData:k}}catch(y){return this.handleError(e,g,y,i)}finally{h.dispose?.()}}collectPreRequestScripts(e){let t=[];if(this.collectionScripts?.preRequest&&t.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&t.push(n.preRequest);else this.folderScriptsChain.preRequest&&t.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&t.push(e.scripts.preRequest),t}collectPostResponseScripts(e){let t=[];if(e.scripts?.postResponse&&t.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&t.push(i.postResponse)}else this.folderScriptsChain.postResponse&&t.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&t.push(this.collectionScripts.postResponse),t}handleError(e,t,n,i){let s=Date.now()-i,a=t?.method||e.method,l=t?.url||e.url;this.onConsoleOutput?.([`[error] ${e.name}: ${n.message||n}`]);let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),d=n?.stack?String(n.stack):"",h=this.errorBodyFormat,g,y;h==="html"||h==="both"?(g=r.formatErrorAsHtml(f,d),y={"content-type":"text/html; charset=utf-8"}):(g=f,y={});let S={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:a||"GET",headers:t?.headers||{},body:t?.body||S,params:t?.params||{},query:t?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:y,cookies:[],body:g,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,t){let n=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
54
54
|
<html>
|
|
55
55
|
<body style="font-family:system-ui,Segoe UI,Roboto,-apple-system,Helvetica,Arial,sans-serif;padding:12px;color:#c7254e;">
|
|
56
56
|
<h2 style="margin-top:0;color:#a94442">Request Error</h2>
|
|
@@ -59,7 +59,7 @@ ${i}
|
|
|
59
59
|
${n(t)}
|
|
60
60
|
</pre>`:""}
|
|
61
61
|
</body>
|
|
62
|
-
</html>`}}});var
|
|
62
|
+
</html>`}}});var kf,J0=se(()=>{"use strict";bn();kf=class{constructor(e,t,n,i,s,a){this.envConfigService=e;this.httpService=t;this.preprocessor=n;this.tokenManager=i;this.appInfo=s;this.secretRegistry=a}envConfigService;httpService;preprocessor;tokenManager;appInfo;secretRegistry;async prepareRequest(e,t,n,i){if(this.secretRegistry?.hasProviders){let q=await this.secretRegistry.resolveSecretTokens(e);Object.keys(q).length>0&&(i={...q,...i??{}})}let s=i&&Object.keys(i).length>0,a=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.params||{},i,t):this.envConfigService.resolveVariablesInObject(e.params||{},t),l=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.query||{},i,t):this.envConfigService.resolveVariablesInObject(e.query||{},t),f=Cc(n?.headers||{},e.headers||{}),d=s?this.envConfigService.resolveVariablesInObjectWithExtra(f,i,t):this.envConfigService.resolveVariablesInObject(f,t);if(d=this.preprocessor.sanitizeHeaders(d),!Object.keys(d).some(q=>q.toLowerCase()==="user-agent")){let q=this.appInfo?.version||"0.0.0",j=this.appInfo?.name||"HttpForge";d["User-Agent"]=`${j}/${q}`}if(e.auth?.type==="bearer"&&e.auth.bearerToken){let q=s?this.envConfigService.resolveVariablesWithExtra(e.auth.bearerToken,i,t):this.envConfigService.resolveVariables(e.auth.bearerToken,t);d.Authorization=`Bearer ${q}`}if(e.auth?.type==="basic"&&e.auth.basicAuth){let q=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.username||"",i,t):this.envConfigService.resolveVariables(e.auth.basicAuth.username||"",t),j=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.password||"",i,t):this.envConfigService.resolveVariables(e.auth.basicAuth.password||"",t),B=Buffer.from(`${q}:${j}`).toString("base64");d.Authorization=`Basic ${B}`}e.auth?.type==="apikey"&&e.auth.apikey&&this.applyApiKey(e.auth.apikey,d,l,t,i),e.auth?.type==="oauth2"&&e.auth.oauth2&&await this.applyOAuth2(e.auth.oauth2,d,t);let g=null;if(e.body&&e.body.type!=="none"){let q=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesInObjectWithExtra(e.body.content,i,t):this.envConfigService.resolveVariablesInObject(e.body.content,t);if((e.body.format==="json"||e.body.type==="graphql")&&typeof q=="string")try{q=JSON.parse(q)}catch{e.body.format==="json"&&console.warn("[RequestPreparer] Failed to parse JSON body after variable resolution, keeping as string")}let j={type:e.body.type,format:e.body.format,content:q};g=this.preprocessor.encodeBody(j)}this.preprocessor.setContentTypeHeader(d,e.body,e.bodyContentType);let y=e.method||"GET",S=e.url||"",_=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesWithExtra(S,i,t):this.envConfigService.resolveVariables(S,t),R=this.httpService.buildUrl(_,a,l),I={type:e.body?.type||"none",format:e.body?.format,content:g};return{url:R,method:y,headers:d,body:I,params:a,query:l}}async applyOAuth2(e,t,n){if(e.accessToken){let s=this.envConfigService.resolveVariables(e.accessToken,n),a=e.tokenPrefix||"Bearer";t.Authorization=`${a} ${s}`;return}if(!this.tokenManager)throw new Error("OAuth2 authentication requires IOAuth2TokenManager. Ensure the service is properly registered.");let i=await this.tokenManager.getToken(e,n);t.Authorization=`${i.tokenType} ${i.accessToken}`}applyApiKey(e,t,n,i,s){if(!e||!e.key)return;let a=s&&Object.keys(s).length>0,l=a?this.envConfigService.resolveVariablesWithExtra(e.key||"",s,i):this.envConfigService.resolveVariables(e.key||"",i),f=a?this.envConfigService.resolveVariablesWithExtra(e.value||"",s,i):this.envConfigService.resolveVariables(e.value||"",i);(e.in||"header").toLowerCase()==="query"?n[l]=f:t[l]=f}}});var qW,Tf,G0=se(()=>{"use strict";qW=`
|
|
63
63
|
query IntrospectionQuery {
|
|
64
64
|
__schema {
|
|
65
65
|
queryType { name }
|
|
@@ -87,82 +87,82 @@ fragment TypeRef on __Type {
|
|
|
87
87
|
kind name
|
|
88
88
|
ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } } } }
|
|
89
89
|
}
|
|
90
|
-
`.trim(),
|
|
91
|
-
`),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let a=n[s].match(i);a&&t.push({type:a[1],name:a[2],line:s+1})}return t.length===0&&e.trim().startsWith("{")&&t.push({type:"query",name:"(anonymous)",line:1}),t}clearCache(e){e?this.schemaCache.delete(e):this.schemaCache.clear()}schemaToSerializable(e){let t={};for(let[n,i]of e.types)t[n]=i;return{queryType:e.queryType,mutationType:e.mutationType,subscriptionType:e.subscriptionType,types:t,directives:e.directives,fetchedAt:e.fetchedAt,endpointUrl:e.endpointUrl}}parseSchema(e,t){let n=new Map;for(let s of e.types||[]){if(s.name.startsWith("__"))continue;let a={name:s.name,kind:s.kind,description:s.description||void 0,fields:(s.fields||[]).map(l=>this.parseField(l)),inputFields:(s.inputFields||[]).map(l=>this.parseArg(l)),enumValues:(s.enumValues||[]).map(l=>({name:l.name,description:l.description||void 0,isDeprecated:l.isDeprecated||!1,deprecationReason:l.deprecationReason||void 0})),interfaces:(s.interfaces||[]).map(l=>this.renderTypeRef(l)),possibleTypes:(s.possibleTypes||[]).map(l=>this.renderTypeRef(l))};n.set(a.name,a)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(a=>this.parseArg(a))}));return{queryType:e.queryType?.name||"Query",mutationType:e.mutationType?.name||void 0,subscriptionType:e.subscriptionType?.name||void 0,types:n,directives:i,fetchedAt:Date.now(),endpointUrl:t}}parseField(e){return{name:e.name,type:this.renderTypeRef(e.type),args:(e.args||[]).map(t=>this.parseArg(t)),description:e.description||void 0,isDeprecated:e.isDeprecated||!1,deprecationReason:e.deprecationReason||void 0}}parseArg(e){return{name:e.name,type:this.renderTypeRef(e.type),defaultValue:e.defaultValue??void 0,description:e.description||void 0}}renderTypeRef(e){return e?e.kind==="NON_NULL"?`${this.renderTypeRef(e.ofType)}!`:e.kind==="LIST"?`[${this.renderTypeRef(e.ofType)}]`:e.name||"Unknown":"Unknown"}}});function ns(r){let e={};for(let[t,n]of Object.entries(r))Y0.test(t)?e[t]=Array.isArray(n)?n.map(()=>Ys):Ys:e[t]=n;return e}function K0(r=[]){return r.map(e=>e&&typeof e=="object"&&e.name&&an.test(e.name)?{...e,value:Ys}:e)}function
|
|
92
|
-
`))return AW(e)}return r}function Z0(r){return{...r,sentRequest:{...r.sentRequest,url:
|
|
93
|
-
`)){try{let n=new URLSearchParams(t);for(let[i,s]of n)an.test(i)&&s&&!dr(s)&&e.push({location:"body",field:i,message:`Form field "${i}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}return}return}if(Array.isArray(r)){r.forEach(t=>
|
|
94
|
-
`)){try{let s=new URLSearchParams(i);for(let[a,l]of s)if(an.test(a)&&l&&!dr(l)){let f=ya(a),d=2;for(;t.has(f);)f=`${ya(a)}_${d++}`;t.add(f),e.push({location:"body",field:a,path:n?`${n}.${a}`:a,value:l,variableName:f})}}catch{}return}return}if(Array.isArray(r)){r.forEach((i,s)=>
|
|
95
|
-
`)){let f=new URLSearchParams(l);if(f.get(e)===n){f.set(e,i);let d=f.toString();s?s.content=d:r.body=d}return}return}typeof a=="object"&&a!==null&&RP(a,e,t||e,n,i)}}function RP(r,e,t,n,i){let s=t.split("."),a=r;for(let f=0;f<s.length-1;f++){let d=s[f],h=d.match(/^(.+)\[(\d+)\]$/);if(h?a=a?.[h[1]]?.[parseInt(h[2])]:a=a?.[d],a==null)return}let l=s[s.length-1];a&&a[l]===n&&(a[l]=i)}function LW(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ys,Y0,an,$W,$f=se(()=>{"use strict";Ys="***",Y0=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,an=/(password|passwd|pwd|token|cookie|secret|credential|api[_\-]?key|apikey|access[_\-]?token|refresh[_\-]?token|client[_\-]?secret|private[_\-]?key|auth[_\-]?code|bearer|session[_\-]?id|jwt)/i;$W=/\{\{[^}]+\}\}/});import*as ke from"fs";import*as Hr from"path";var Mf,tw=se(()=>{"use strict";bn();$f();Mf=class{historyPath;sharedHistoryPath;constructor(e,t){this.historyPath=e,this.sharedHistoryPath=t}getEnvironmentHistoryPath(e){return Hr.join(this.historyPath,kt(e))}getCollectionHistoryPath(e,t){return Hr.join(this.getEnvironmentHistoryPath(e),t)}getRequestPath(e,t,n){return Hr.join(this.getCollectionHistoryPath(e,t),kt(n))}getSharedEnvironmentHistoryPath(e){return Hr.join(this.sharedHistoryPath,kt(e))}getSharedCollectionHistoryPath(e,t){return Hr.join(this.getSharedEnvironmentHistoryPath(e),t)}getSharedRequestPath(e,t,n){return Hr.join(this.getSharedCollectionHistoryPath(e,t),kt(n))}getHistoryFilePath(e,t,n){return Hr.join(this.getRequestPath(e,t,n),"transactions.json")}getSharedHistoryFilePath(e,t,n){return Hr.join(this.getSharedRequestPath(e,t,n),"transactions.json")}getResponseFilePath(e,t,n,i){return Hr.join(this.getRequestPath(e,t,n),`${i}.json`)}getSharedResponseFilePath(e,t,n,i){return Hr.join(this.getSharedRequestPath(e,t,n),`${i}.json`)}loadHistory(e,t,n){let i=this.getHistoryFilePath(e,t,n);try{if(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:t||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,t,n){let i=this.getSharedHistoryFilePath(e,t,n);try{if(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:t||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,t,n){let i=this.loadHistory(e,t,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,t,n){let i=this.getEntriesForEnvironment(e,t,n),s=new Map;for(let a of i){let l=a.ticket||a.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(a)}return s}getSharedEntriesGroupedByTicket(e,t,n){let i=this.loadSharedHistory(e,t,n)?.requests??[],s=new Map;for(let a of i){let l=a.ticket||a.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(a)}return s}saveHistory(e){let t=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(t)||ke.mkdirSync(t,{recursive:!0}),ke.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save history for ${e.requestId}:`,i),i}}saveSharedHistory(e){let t=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(t)||ke.mkdirSync(t,{recursive:!0}),ke.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save shared history for ${e.requestId}:`,i),i}}addEntry(e,t,n,i,s){let a=this.loadHistory(e,t,n);a||(a={environment:e,requestPath:t,requestId:n,method:i,requests:[]});let l=Z0({...s,method:i,id:xb(),timestamp:Date.now()});return a.requests.unshift(l),a.requests.length>100&&(a.requests=a.requests.slice(0,100)),this.saveHistory(a),l}deleteEntry(e,t,n,i){let s=this.loadHistory(e,t,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==a){this.saveHistory(s);let l=this.getResponseFilePath(e,t,n,i);return ke.existsSync(l)&&ke.unlinkSync(l),!0}return!1}deleteSharedEntry(e,t,n,i){let s=this.loadSharedHistory(e,t,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==a){this.saveSharedHistory(s);let l=this.getSharedResponseFilePath(e,t,n,i);return ke.existsSync(l)&&ke.unlinkSync(l),!0}return!1}shareEntry(e,t,n,i,s){let a=(s||"").trim();if(!a)return!1;let l=this.loadHistory(e,t,n);if(!l)return!1;let f=l.requests.findIndex(S=>S.id===i);if(f===-1)return!1;let[d]=l.requests.splice(f,1);this.saveHistory(l);let h=this.loadSharedHistory(e,t,n)||{environment:e,requestPath:t,requestId:n,method:l.method,requests:[]};if(!h.requests.some(S=>S.id===i)){let S={...d,ticket:null,branch:a};h.requests.unshift(S),h.requests.length>100&&(h.requests=h.requests.slice(0,100)),this.saveSharedHistory(h)}let g=this.getResponseFilePath(e,t,n,i),y=this.getSharedResponseFilePath(e,t,n,i);if(ke.existsSync(g)){let S=Hr.dirname(y);ke.existsSync(S)||ke.mkdirSync(S,{recursive:!0});try{ke.renameSync(g,y)}catch{try{ke.copyFileSync(g,y)}catch(R){return console.error(`Failed to copy full response from ${g} to ${y}:`,R),!0}try{ke.unlinkSync(g)}catch(R){console.warn(`Failed to remove original full response after copy: ${g}`,R)}}}return!0}moveSharedEntry(e,t,n,i,s){let a=(s||"").trim();if(!a)return!1;let l=this.loadSharedHistory(e,t,n);if(!l)return!1;let f=!1;return l.requests=l.requests.map(d=>d.id===i?(f=!0,{...d,ticket:null,branch:a}):d),f?(this.saveSharedHistory(l),!0):!1}renameSharedGroup(e,t,n,i,s){let a=(i||"").trim(),l=(s||"").trim();if(!a||!l||a===l)return!1;let f=this.loadSharedHistory(e,t,n);if(!f)return!1;let d=!1;return f.requests=f.requests.map(h=>!h.ticket&&h.branch===a?(d=!0,{...h,branch:l}):h),d?(this.saveSharedHistory(f),!0):!1}clearHistory(e,t,n){let i=this.getRequestPath(e,t,n);if(ke.existsSync(i)){let s=ke.readdirSync(i);for(let a of s)ke.unlinkSync(Hr.join(i,a));ke.rmdirSync(i)}}saveFullResponse(e,t,n,i,s){let a=this.getRequestPath(e,t,n),l=this.getResponseFilePath(e,t,n,i);try{ke.existsSync(a)||ke.mkdirSync(a,{recursive:!0});let f=X0(s);ke.writeFileSync(l,JSON.stringify(f,null,2),"utf-8")}catch(f){throw console.error(`Failed to save full response for ${i}:`,f),f}}loadFullResponse(e,t,n,i){let s=this.getResponseFilePath(e,t,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load full response for ${i}:`,a),null}}loadSharedFullResponse(e,t,n,i){let s=this.getSharedResponseFilePath(e,t,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load shared full response for ${i}:`,a),null}}}});var ru,rw=se(()=>{"use strict";ru=class{constructor(e,t){this.historyService=e;this.inferrer=t}historyService;inferrer;async analyze(e,t,n){let i=n?.environment||"default",s=n?.maxSamples||50,a=this.historyService.loadHistory(i,e,t),l=this.historyService.loadSharedHistory(i,e,t),f=[...a?.requests||[],...l?.requests||[]];if(f.length===0)return{responses:{}};let d=f.slice(0,s),h=new Map;for(let y of d){let S=this.historyService.loadFullResponse(i,e,t,y.id);if(S||(S=this.historyService.loadSharedFullResponse(i,e,t,y.id)),S){let _=S.status;h.has(_)||h.set(_,[]),h.get(_).push(S)}}let g={};for(let[y,S]of h){let _=this.buildResponseDefinition(S);g[String(y)]=_}return{responses:g}}buildResponseDefinition(e){let t={};if(e.length===0)return t;let n=e[0];t.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(t.contentType=i),i&&this.isJsonContentType(i)){let a=this.inferBodySchema(n);for(let l=1;l<e.length;l++){let f=this.inferBodySchema(e[l]);f&&a?a=this.inferrer.mergeSchemas(a,f):f&&(a=f)}if(a&&(t.schema=a),n.body!==void 0&&n.body!==null){let l=typeof n.body=="string"?this.tryParseJson(n.body):n.body;l!==void 0&&(t.examples={default:{summary:"Captured from history",value:l}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(t.headers=s),t}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let t=e.body;if(!(typeof t=="string"&&(t=this.tryParseJson(t),t===void 0)))return this.inferrer.inferFromValue(t)}extractContentType(e){for(let[t,n]of Object.entries(e))if(t.toLowerCase()==="content-type")return(Array.isArray(n)?n[0]:n).split(";")[0].trim()}isJsonContentType(e){return e.includes("json")||e.includes("+json")||e==="application/json"}findConsistentHeaders(e){if(e.length===0)return{};let t=new Set(["content-type","content-length","content-encoding","transfer-encoding","connection","date","server","set-cookie","vary","cache-control","expires","pragma","etag","last-modified","age"]),n=new Map,i=new Map;for(let l of e)for(let[f,d]of Object.entries(l.headers)){let h=f.toLowerCase();t.has(h)||(n.set(h,(n.get(h)||0)+1),i.has(h)||i.set(h,Array.isArray(d)?d.join(", "):d))}let s=Math.ceil(e.length/2),a={};for(let[l,f]of n)if(f>=s){let d=i.get(l);a[l]={schema:this.inferHeaderSchema(d)}}return a}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}}});var Je=F(ir=>{"use strict";var nw=Symbol.for("yaml.alias"),CP=Symbol.for("yaml.document"),lm=Symbol.for("yaml.map"),xP=Symbol.for("yaml.pair"),iw=Symbol.for("yaml.scalar"),um=Symbol.for("yaml.seq"),is=Symbol.for("yaml.node.type"),jW=r=>!!r&&typeof r=="object"&&r[is]===nw,UW=r=>!!r&&typeof r=="object"&&r[is]===CP,HW=r=>!!r&&typeof r=="object"&&r[is]===lm,BW=r=>!!r&&typeof r=="object"&&r[is]===xP,EP=r=>!!r&&typeof r=="object"&&r[is]===iw,VW=r=>!!r&&typeof r=="object"&&r[is]===um;function OP(r){if(r&&typeof r=="object")switch(r[is]){case lm:case um:return!0}return!1}function WW(r){if(r&&typeof r=="object")switch(r[is]){case nw:case lm:case iw:case um:return!0}return!1}var zW=r=>(EP(r)||OP(r))&&!!r.anchor;ir.ALIAS=nw;ir.DOC=CP;ir.MAP=lm;ir.NODE_TYPE=is;ir.PAIR=xP;ir.SCALAR=iw;ir.SEQ=um;ir.hasAnchor=zW;ir.isAlias=jW;ir.isCollection=OP;ir.isDocument=UW;ir.isMap=HW;ir.isNode=WW;ir.isPair=BW;ir.isScalar=EP;ir.isSeq=VW});var Nf=F(sw=>{"use strict";var Gt=Je(),Br=Symbol("break visit"),IP=Symbol("skip children"),xi=Symbol("remove node");function cm(r,e){let t=PP(e);Gt.isDocument(r)?nu(null,r.contents,t,Object.freeze([r]))===xi&&(r.contents=null):nu(null,r,t,Object.freeze([]))}cm.BREAK=Br;cm.SKIP=IP;cm.REMOVE=xi;function nu(r,e,t,n){let i=kP(r,e,t,n);if(Gt.isNode(i)||Gt.isPair(i))return TP(r,n,i),nu(r,i,t,n);if(typeof i!="symbol"){if(Gt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=nu(s,e.items[s],t,n);if(typeof a=="number")s=a-1;else{if(a===Br)return Br;a===xi&&(e.items.splice(s,1),s-=1)}}}else if(Gt.isPair(e)){n=Object.freeze(n.concat(e));let s=nu("key",e.key,t,n);if(s===Br)return Br;s===xi&&(e.key=null);let a=nu("value",e.value,t,n);if(a===Br)return Br;a===xi&&(e.value=null)}}return i}async function fm(r,e){let t=PP(e);Gt.isDocument(r)?await iu(null,r.contents,t,Object.freeze([r]))===xi&&(r.contents=null):await iu(null,r,t,Object.freeze([]))}fm.BREAK=Br;fm.SKIP=IP;fm.REMOVE=xi;async function iu(r,e,t,n){let i=await kP(r,e,t,n);if(Gt.isNode(i)||Gt.isPair(i))return TP(r,n,i),iu(r,i,t,n);if(typeof i!="symbol"){if(Gt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=await iu(s,e.items[s],t,n);if(typeof a=="number")s=a-1;else{if(a===Br)return Br;a===xi&&(e.items.splice(s,1),s-=1)}}}else if(Gt.isPair(e)){n=Object.freeze(n.concat(e));let s=await iu("key",e.key,t,n);if(s===Br)return Br;s===xi&&(e.key=null);let a=await iu("value",e.value,t,n);if(a===Br)return Br;a===xi&&(e.value=null)}}return i}function PP(r){return typeof r=="object"&&(r.Collection||r.Node||r.Value)?Object.assign({Alias:r.Node,Map:r.Node,Scalar:r.Node,Seq:r.Node},r.Value&&{Map:r.Value,Scalar:r.Value,Seq:r.Value},r.Collection&&{Map:r.Collection,Seq:r.Collection},r):r}function kP(r,e,t,n){if(typeof t=="function")return t(r,e,n);if(Gt.isMap(e))return t.Map?.(r,e,n);if(Gt.isSeq(e))return t.Seq?.(r,e,n);if(Gt.isPair(e))return t.Pair?.(r,e,n);if(Gt.isScalar(e))return t.Scalar?.(r,e,n);if(Gt.isAlias(e))return t.Alias?.(r,e,n)}function TP(r,e,t){let n=e[e.length-1];if(Gt.isCollection(n))n.items[r]=t;else if(Gt.isPair(n))r==="key"?n.key=t:n.value=t;else if(Gt.isDocument(n))n.contents=t;else{let i=Gt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}sw.visit=cm;sw.visitAsync=fm});var ow=F(AP=>{"use strict";var qP=Je(),JW=Nf(),GW={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},YW=r=>r.replace(/[!,[\]{}]/g,e=>GW[e]),Df=class r{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},r.defaultYaml,e),this.tags=Object.assign({},r.defaultTags,t)}clone(){let e=new r(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new r(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:r.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},r.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:r.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},r.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,a]=n;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,a),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(a){return t(String(a)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+YW(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&qP.isNode(e.contents)){let s={};JW.visit(e.contents,(a,l)=>{qP.isNode(l)&&l.tag&&(s[l.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of n)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(a)))&&t.push(`%TAG ${s} ${a}`);return t.join(`
|
|
96
|
-
`)}};
|
|
90
|
+
`.trim(),Tf=class{constructor(e){this.httpClient=e}httpClient;schemaCache=new Map;async fetchSchema(e,t){let n={method:"POST",url:e,headers:{"Content-Type":"application/json",Accept:"application/json",...t||{}},body:JSON.stringify({query:qW,operationName:"IntrospectionQuery"})},i=await this.httpClient.send(n);if(i.status<200||i.status>=300)throw new Error(`Introspection query failed with status ${i.status}: ${i.statusText}`);let s=typeof i.body=="string"?JSON.parse(i.body):i.body;if(s.errors&&s.errors.length>0){let l=s.errors.map(f=>f.message).join("; ");throw new Error(`Introspection query returned errors: ${l}`)}if(!s.data?.__schema)throw new Error("Invalid introspection response: missing __schema");let a=this.parseSchema(s.data.__schema,e);return this.schemaCache.set(e,a),a}getCachedSchema(e){return this.schemaCache.get(e)}extractOperations(e){let t=[],n=e.split(`
|
|
91
|
+
`),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let a=n[s].match(i);a&&t.push({type:a[1],name:a[2],line:s+1})}return t.length===0&&e.trim().startsWith("{")&&t.push({type:"query",name:"(anonymous)",line:1}),t}clearCache(e){e?this.schemaCache.delete(e):this.schemaCache.clear()}schemaToSerializable(e){let t={};for(let[n,i]of e.types)t[n]=i;return{queryType:e.queryType,mutationType:e.mutationType,subscriptionType:e.subscriptionType,types:t,directives:e.directives,fetchedAt:e.fetchedAt,endpointUrl:e.endpointUrl}}parseSchema(e,t){let n=new Map;for(let s of e.types||[]){if(s.name.startsWith("__"))continue;let a={name:s.name,kind:s.kind,description:s.description||void 0,fields:(s.fields||[]).map(l=>this.parseField(l)),inputFields:(s.inputFields||[]).map(l=>this.parseArg(l)),enumValues:(s.enumValues||[]).map(l=>({name:l.name,description:l.description||void 0,isDeprecated:l.isDeprecated||!1,deprecationReason:l.deprecationReason||void 0})),interfaces:(s.interfaces||[]).map(l=>this.renderTypeRef(l)),possibleTypes:(s.possibleTypes||[]).map(l=>this.renderTypeRef(l))};n.set(a.name,a)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(a=>this.parseArg(a))}));return{queryType:e.queryType?.name||"Query",mutationType:e.mutationType?.name||void 0,subscriptionType:e.subscriptionType?.name||void 0,types:n,directives:i,fetchedAt:Date.now(),endpointUrl:t}}parseField(e){return{name:e.name,type:this.renderTypeRef(e.type),args:(e.args||[]).map(t=>this.parseArg(t)),description:e.description||void 0,isDeprecated:e.isDeprecated||!1,deprecationReason:e.deprecationReason||void 0}}parseArg(e){return{name:e.name,type:this.renderTypeRef(e.type),defaultValue:e.defaultValue??void 0,description:e.description||void 0}}renderTypeRef(e){return e?e.kind==="NON_NULL"?`${this.renderTypeRef(e.ofType)}!`:e.kind==="LIST"?`[${this.renderTypeRef(e.ofType)}]`:e.name||"Unknown":"Unknown"}}});function ns(r){let e={};for(let[t,n]of Object.entries(r))Y0.test(t)?e[t]=Array.isArray(n)?n.map(()=>Ys):Ys:e[t]=n;return e}function K0(r=[]){return r.map(e=>e&&typeof e=="object"&&e.name&&an.test(e.name)?{...e,value:Ys}:e)}function om(r){try{let e=new URL(r),t=!1;for(let[n]of e.searchParams)an.test(n)&&(e.searchParams.set(n,Ys),t=!0);return t?e.toString():r}catch{return r}}function qf(r){if(r==null)return r;if(Array.isArray(r))return r.map(t=>qf(t));if(typeof r!="object")return r;let e={};for(let[t,n]of Object.entries(r)){let i=an.test(t);n===null||typeof n!="object"?e[t]=i?Ys:n:i&&Array.isArray(n)?e[t]=n.map(s=>s===null||typeof s!="object"?Ys:qf(s)):e[t]=qf(n)}return e}function AW(r){try{let e=new URLSearchParams(r),t=!1;for(let[n]of e)an.test(n)&&(e.set(n,Ys),t=!0);return t?e.toString():r}catch{return r}}function Q0(r){if(r==null)return r;if(typeof r=="object"&&!Buffer.isBuffer(r))return qf(r);if(typeof r=="string"){let e=r.trim();if(e.startsWith("{")||e.startsWith("["))try{let t=JSON.parse(e),n=qf(t);return JSON.stringify(n)}catch{}if(e.includes("=")&&!e.includes(`
|
|
92
|
+
`))return AW(e)}return r}function Z0(r){return{...r,sentRequest:{...r.sentRequest,url:om(r.sentRequest.url),headers:ns(r.sentRequest.headers),body:r.sentRequest.body!=null?Q0(r.sentRequest.body):r.sentRequest.body}}}function X0(r){return{...r,headers:ns(r.headers),cookies:r.cookies.map(e=>e&&typeof e=="object"&&e.name&&an.test(e.name)?{...e,value:Ys}:e)}}function ew(r){return{...r,url:om(r.url),request:{...r.request,url:om(r.request.url),headers:ns(r.request.headers),query:ns(r.request.query),params:ns(r.request.params),body:r.request.body!=null?Q0(r.request.body):r.request.body},response:{headers:ns(r.response.headers),body:r.response.body,time:r.response.time,size:r.response.size,cookies:r.response.cookies?K0(r.response.cookies):r.response.cookies}}}function dr(r){return typeof r=="string"&&$W.test(r)}function MW(r){let e=[];if(r.url)try{let t=new URL(r.url.includes("://")?r.url:`http://placeholder${r.url.startsWith("/")?"":"/"}${r.url}`);for(let[n,i]of t.searchParams)an.test(n)&&i&&!dr(i)&&e.push({location:"url",field:n,message:`URL query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}if(r.headers){let t=Array.isArray(r.headers)?r.headers.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(r.headers);for(let[n,i]of t)Y0.test(n)&&i&&!dr(i)&&e.push({location:"header",field:n,message:`Header "${n}" contains a hardcoded value. Use a {{variable}} instead (e.g. {{${n.toLowerCase().replace(/[^a-z0-9]/g,"_")}}})`})}if(r.query){let t=Array.isArray(r.query)?r.query.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(r.query);for(let[n,i]of t)an.test(n)&&i&&!dr(i)&&e.push({location:"query",field:n,message:`Query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}if(r.auth){let t=r.auth;if(t.bearerToken&&!dr(t.bearerToken)&&e.push({location:"auth",field:"bearerToken",message:"Bearer token contains a hardcoded value. Store it in a {{variable}} in your .local.json environment file."}),t.basicAuth&&t.basicAuth.password&&!dr(t.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",message:"Basic auth password contains a hardcoded value. Use a {{variable}} instead."}),t.apikey||t.apiKey){let n=t.apikey||t.apiKey;n.value&&!dr(n.value)&&e.push({location:"auth",field:"apiKey.value",message:"API key contains a hardcoded value. Use a {{variable}} instead."})}}if(r.body){let t=typeof r.body=="object"&&"content"in r.body?r.body.content:r.body;t&&im(t,e)}return e}function im(r,e){if(r!=null){if(typeof r=="string"){let t=r.trim();if(t.startsWith("{")||t.startsWith("[")){try{im(JSON.parse(t),e)}catch{}return}if(t.includes("=")&&!t.includes(`
|
|
93
|
+
`)){try{let n=new URLSearchParams(t);for(let[i,s]of n)an.test(i)&&s&&!dr(s)&&e.push({location:"body",field:i,message:`Form field "${i}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}return}return}if(Array.isArray(r)){r.forEach(t=>im(t,e));return}if(typeof r=="object")for(let[t,n]of Object.entries(r))an.test(t)&&n&&typeof n=="string"&&!dr(n)?e.push({location:"body",field:t,message:`Body field "${t}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&im(n,e)}}function ya(r){return r.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function NW(r){let e=[],t=new Set;function n(i){let s=i,a=2;for(;t.has(s);)s=`${i}_${a++}`;return t.add(s),s}if(r.url)try{let i=new URL(r.url.includes("://")?r.url:`http://placeholder${r.url.startsWith("/")?"":"/"}${r.url}`);for(let[s,a]of i.searchParams)an.test(s)&&a&&!dr(a)&&e.push({location:"url",field:s,value:a,variableName:n(ya(s))})}catch{}if(r.headers){let i=Array.isArray(r.headers)?r.headers.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(r.headers);for(let[s,a]of i)Y0.test(s)&&a&&!dr(a)&&e.push({location:"header",field:s,value:a,variableName:n(ya(s))})}if(r.query){let i=Array.isArray(r.query)?r.query.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(r.query);for(let[s,a]of i)an.test(s)&&a&&!dr(a)&&e.push({location:"query",field:s,value:a,variableName:n(ya(s))})}if(r.auth){let i=r.auth;if(i.bearerToken&&!dr(i.bearerToken)&&e.push({location:"auth",field:"bearerToken",value:i.bearerToken,variableName:n("bearer_token")}),i.basicAuth&&i.basicAuth.password&&!dr(i.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",value:i.basicAuth.password,variableName:n("basic_auth_password")}),i.apikey||i.apiKey){let s=i.apikey||i.apiKey;s.value&&!dr(s.value)&&e.push({location:"auth",field:"apiKey.value",value:s.value,variableName:n("api_key")})}}if(r.body){let i=typeof r.body=="object"&&"content"in r.body?r.body.content:r.body;i&&sm(i,e,t,"")}return e}function sm(r,e,t,n){if(r!=null){if(typeof r=="string"){let i=r.trim();if(i.startsWith("{")||i.startsWith("[")){try{sm(JSON.parse(i),e,t,n)}catch{}return}if(i.includes("=")&&!i.includes(`
|
|
94
|
+
`)){try{let s=new URLSearchParams(i);for(let[a,l]of s)if(an.test(a)&&l&&!dr(l)){let f=ya(a),d=2;for(;t.has(f);)f=`${ya(a)}_${d++}`;t.add(f),e.push({location:"body",field:a,path:n?`${n}.${a}`:a,value:l,variableName:f})}}catch{}return}return}if(Array.isArray(r)){r.forEach((i,s)=>sm(i,e,t,`${n}[${s}]`));return}if(typeof r=="object")for(let[i,s]of Object.entries(r)){let a=n?`${n}.${i}`:i;if(an.test(i)&&s&&typeof s=="string"&&!dr(s)){let l=ya(i),f=2;for(;t.has(l);)l=`${ya(i)}_${f++}`;t.add(l),e.push({location:"body",field:i,path:a,value:s,variableName:l})}else typeof s=="object"&&s!==null&&sm(s,e,t,a)}}}function DW(r,e){let t=JSON.parse(JSON.stringify(r));for(let n of e){let i=`{{${n.variableName}}}`;switch(n.location){case"url":t.url&&(t.url=t.url.replace(new RegExp(`([?&])${LW(n.field)}=[^&]*`),`$1${n.field}=${i}`));break;case"header":if(Array.isArray(t.headers)){let s=t.headers.find(a=>a.key===n.field&&a.value===n.value);s&&(s.value=i)}else t.headers&&t.headers[n.field]===n.value&&(t.headers[n.field]=i);break;case"query":if(Array.isArray(t.query)){let s=t.query.find(a=>a.key===n.field&&a.value===n.value);s&&(s.value=i)}else t.query&&t.query[n.field]===n.value&&(t.query[n.field]=i);break;case"auth":if(t.auth){if(n.field==="bearerToken")t.auth.bearerToken=i;else if(n.field==="basicAuth.password"&&t.auth.basicAuth)t.auth.basicAuth.password=i;else if(n.field==="apiKey.value"){let s=t.auth.apikey||t.auth.apiKey;s&&(s.value=i)}}break;case"body":FW(t,n.field,n.path,n.value,i);break}}return t}function FW(r,e,t,n,i){let s=typeof r.body=="object"&&r.body!==null&&"content"in r.body?r.body:null,a=s?s.content:r.body;if(a){if(typeof a=="string"){let l=a.trim();if(l.startsWith("{")||l.startsWith("[")){try{let f=JSON.parse(l);RP(f,e,t||e,n,i);let d=JSON.stringify(f,null,2);s?s.content=d:r.body=d}catch{}return}if(l.includes("=")&&!l.includes(`
|
|
95
|
+
`)){let f=new URLSearchParams(l);if(f.get(e)===n){f.set(e,i);let d=f.toString();s?s.content=d:r.body=d}return}return}typeof a=="object"&&a!==null&&RP(a,e,t||e,n,i)}}function RP(r,e,t,n,i){let s=t.split("."),a=r;for(let f=0;f<s.length-1;f++){let d=s[f],h=d.match(/^(.+)\[(\d+)\]$/);if(h?a=a?.[h[1]]?.[parseInt(h[2])]:a=a?.[d],a==null)return}let l=s[s.length-1];a&&a[l]===n&&(a[l]=i)}function LW(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ys,Y0,an,$W,Af=se(()=>{"use strict";Ys="***",Y0=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,an=/(password|passwd|pwd|token|cookie|secret|credential|api[_\-]?key|apikey|access[_\-]?token|refresh[_\-]?token|client[_\-]?secret|private[_\-]?key|auth[_\-]?code|bearer|session[_\-]?id|jwt)/i;$W=/\{\{[^}]+\}\}/});import*as ke from"fs";import*as Hr from"path";var $f,tw=se(()=>{"use strict";bn();Af();$f=class{historyPath;sharedHistoryPath;constructor(e,t){this.historyPath=e,this.sharedHistoryPath=t}getEnvironmentHistoryPath(e){return Hr.join(this.historyPath,kt(e))}getCollectionHistoryPath(e,t){return Hr.join(this.getEnvironmentHistoryPath(e),t)}getRequestPath(e,t,n){return Hr.join(this.getCollectionHistoryPath(e,t),kt(n))}getSharedEnvironmentHistoryPath(e){return Hr.join(this.sharedHistoryPath,kt(e))}getSharedCollectionHistoryPath(e,t){return Hr.join(this.getSharedEnvironmentHistoryPath(e),t)}getSharedRequestPath(e,t,n){return Hr.join(this.getSharedCollectionHistoryPath(e,t),kt(n))}getHistoryFilePath(e,t,n){return Hr.join(this.getRequestPath(e,t,n),"transactions.json")}getSharedHistoryFilePath(e,t,n){return Hr.join(this.getSharedRequestPath(e,t,n),"transactions.json")}getResponseFilePath(e,t,n,i){return Hr.join(this.getRequestPath(e,t,n),`${i}.json`)}getSharedResponseFilePath(e,t,n,i){return Hr.join(this.getSharedRequestPath(e,t,n),`${i}.json`)}loadHistory(e,t,n){let i=this.getHistoryFilePath(e,t,n);try{if(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:t||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,t,n){let i=this.getSharedHistoryFilePath(e,t,n);try{if(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:t||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,t,n){let i=this.loadHistory(e,t,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,t,n){let i=this.getEntriesForEnvironment(e,t,n),s=new Map;for(let a of i){let l=a.ticket||a.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(a)}return s}getSharedEntriesGroupedByTicket(e,t,n){let i=this.loadSharedHistory(e,t,n)?.requests??[],s=new Map;for(let a of i){let l=a.ticket||a.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(a)}return s}saveHistory(e){let t=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(t)||ke.mkdirSync(t,{recursive:!0}),ke.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save history for ${e.requestId}:`,i),i}}saveSharedHistory(e){let t=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(t)||ke.mkdirSync(t,{recursive:!0}),ke.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save shared history for ${e.requestId}:`,i),i}}addEntry(e,t,n,i,s){let a=this.loadHistory(e,t,n);a||(a={environment:e,requestPath:t,requestId:n,method:i,requests:[]});let l=Z0({...s,method:i,id:xb(),timestamp:Date.now()});return a.requests.unshift(l),a.requests.length>100&&(a.requests=a.requests.slice(0,100)),this.saveHistory(a),l}deleteEntry(e,t,n,i){let s=this.loadHistory(e,t,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==a){this.saveHistory(s);let l=this.getResponseFilePath(e,t,n,i);return ke.existsSync(l)&&ke.unlinkSync(l),!0}return!1}deleteSharedEntry(e,t,n,i){let s=this.loadSharedHistory(e,t,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==a){this.saveSharedHistory(s);let l=this.getSharedResponseFilePath(e,t,n,i);return ke.existsSync(l)&&ke.unlinkSync(l),!0}return!1}shareEntry(e,t,n,i,s){let a=(s||"").trim();if(!a)return!1;let l=this.loadHistory(e,t,n);if(!l)return!1;let f=l.requests.findIndex(S=>S.id===i);if(f===-1)return!1;let[d]=l.requests.splice(f,1);this.saveHistory(l);let h=this.loadSharedHistory(e,t,n)||{environment:e,requestPath:t,requestId:n,method:l.method,requests:[]};if(!h.requests.some(S=>S.id===i)){let S={...d,ticket:null,branch:a};h.requests.unshift(S),h.requests.length>100&&(h.requests=h.requests.slice(0,100)),this.saveSharedHistory(h)}let g=this.getResponseFilePath(e,t,n,i),y=this.getSharedResponseFilePath(e,t,n,i);if(ke.existsSync(g)){let S=Hr.dirname(y);ke.existsSync(S)||ke.mkdirSync(S,{recursive:!0});try{ke.renameSync(g,y)}catch{try{ke.copyFileSync(g,y)}catch(R){return console.error(`Failed to copy full response from ${g} to ${y}:`,R),!0}try{ke.unlinkSync(g)}catch(R){console.warn(`Failed to remove original full response after copy: ${g}`,R)}}}return!0}moveSharedEntry(e,t,n,i,s){let a=(s||"").trim();if(!a)return!1;let l=this.loadSharedHistory(e,t,n);if(!l)return!1;let f=!1;return l.requests=l.requests.map(d=>d.id===i?(f=!0,{...d,ticket:null,branch:a}):d),f?(this.saveSharedHistory(l),!0):!1}renameSharedGroup(e,t,n,i,s){let a=(i||"").trim(),l=(s||"").trim();if(!a||!l||a===l)return!1;let f=this.loadSharedHistory(e,t,n);if(!f)return!1;let d=!1;return f.requests=f.requests.map(h=>!h.ticket&&h.branch===a?(d=!0,{...h,branch:l}):h),d?(this.saveSharedHistory(f),!0):!1}clearHistory(e,t,n){let i=this.getRequestPath(e,t,n);if(ke.existsSync(i)){let s=ke.readdirSync(i);for(let a of s)ke.unlinkSync(Hr.join(i,a));ke.rmdirSync(i)}}saveFullResponse(e,t,n,i,s){let a=this.getRequestPath(e,t,n),l=this.getResponseFilePath(e,t,n,i);try{ke.existsSync(a)||ke.mkdirSync(a,{recursive:!0});let f=X0(s);ke.writeFileSync(l,JSON.stringify(f,null,2),"utf-8")}catch(f){throw console.error(`Failed to save full response for ${i}:`,f),f}}loadFullResponse(e,t,n,i){let s=this.getResponseFilePath(e,t,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load full response for ${i}:`,a),null}}loadSharedFullResponse(e,t,n,i){let s=this.getSharedResponseFilePath(e,t,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load shared full response for ${i}:`,a),null}}}});var ru,rw=se(()=>{"use strict";ru=class{constructor(e,t){this.historyService=e;this.inferrer=t}historyService;inferrer;async analyze(e,t,n){let i=n?.environment||"default",s=n?.maxSamples||50,a=this.historyService.loadHistory(i,e,t),l=this.historyService.loadSharedHistory(i,e,t),f=[...a?.requests||[],...l?.requests||[]];if(f.length===0)return{responses:{}};let d=f.slice(0,s),h=new Map;for(let y of d){let S=this.historyService.loadFullResponse(i,e,t,y.id);if(S||(S=this.historyService.loadSharedFullResponse(i,e,t,y.id)),S){let _=S.status;h.has(_)||h.set(_,[]),h.get(_).push(S)}}let g={};for(let[y,S]of h){let _=this.buildResponseDefinition(S);g[String(y)]=_}return{responses:g}}buildResponseDefinition(e){let t={};if(e.length===0)return t;let n=e[0];t.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(t.contentType=i),i&&this.isJsonContentType(i)){let a=this.inferBodySchema(n);for(let l=1;l<e.length;l++){let f=this.inferBodySchema(e[l]);f&&a?a=this.inferrer.mergeSchemas(a,f):f&&(a=f)}if(a&&(t.schema=a),n.body!==void 0&&n.body!==null){let l=typeof n.body=="string"?this.tryParseJson(n.body):n.body;l!==void 0&&(t.examples={default:{summary:"Captured from history",value:l}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(t.headers=s),t}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let t=e.body;if(!(typeof t=="string"&&(t=this.tryParseJson(t),t===void 0)))return this.inferrer.inferFromValue(t)}extractContentType(e){for(let[t,n]of Object.entries(e))if(t.toLowerCase()==="content-type")return(Array.isArray(n)?n[0]:n).split(";")[0].trim()}isJsonContentType(e){return e.includes("json")||e.includes("+json")||e==="application/json"}findConsistentHeaders(e){if(e.length===0)return{};let t=new Set(["content-type","content-length","content-encoding","transfer-encoding","connection","date","server","set-cookie","vary","cache-control","expires","pragma","etag","last-modified","age"]),n=new Map,i=new Map;for(let l of e)for(let[f,d]of Object.entries(l.headers)){let h=f.toLowerCase();t.has(h)||(n.set(h,(n.get(h)||0)+1),i.has(h)||i.set(h,Array.isArray(d)?d.join(", "):d))}let s=Math.ceil(e.length/2),a={};for(let[l,f]of n)if(f>=s){let d=i.get(l);a[l]={schema:this.inferHeaderSchema(d)}}return a}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}}});var Je=F(ir=>{"use strict";var nw=Symbol.for("yaml.alias"),CP=Symbol.for("yaml.document"),am=Symbol.for("yaml.map"),xP=Symbol.for("yaml.pair"),iw=Symbol.for("yaml.scalar"),lm=Symbol.for("yaml.seq"),is=Symbol.for("yaml.node.type"),jW=r=>!!r&&typeof r=="object"&&r[is]===nw,UW=r=>!!r&&typeof r=="object"&&r[is]===CP,HW=r=>!!r&&typeof r=="object"&&r[is]===am,BW=r=>!!r&&typeof r=="object"&&r[is]===xP,EP=r=>!!r&&typeof r=="object"&&r[is]===iw,VW=r=>!!r&&typeof r=="object"&&r[is]===lm;function OP(r){if(r&&typeof r=="object")switch(r[is]){case am:case lm:return!0}return!1}function WW(r){if(r&&typeof r=="object")switch(r[is]){case nw:case am:case iw:case lm:return!0}return!1}var zW=r=>(EP(r)||OP(r))&&!!r.anchor;ir.ALIAS=nw;ir.DOC=CP;ir.MAP=am;ir.NODE_TYPE=is;ir.PAIR=xP;ir.SCALAR=iw;ir.SEQ=lm;ir.hasAnchor=zW;ir.isAlias=jW;ir.isCollection=OP;ir.isDocument=UW;ir.isMap=HW;ir.isNode=WW;ir.isPair=BW;ir.isScalar=EP;ir.isSeq=VW});var Mf=F(sw=>{"use strict";var Gt=Je(),Br=Symbol("break visit"),IP=Symbol("skip children"),Ci=Symbol("remove node");function um(r,e){let t=PP(e);Gt.isDocument(r)?nu(null,r.contents,t,Object.freeze([r]))===Ci&&(r.contents=null):nu(null,r,t,Object.freeze([]))}um.BREAK=Br;um.SKIP=IP;um.REMOVE=Ci;function nu(r,e,t,n){let i=kP(r,e,t,n);if(Gt.isNode(i)||Gt.isPair(i))return TP(r,n,i),nu(r,i,t,n);if(typeof i!="symbol"){if(Gt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=nu(s,e.items[s],t,n);if(typeof a=="number")s=a-1;else{if(a===Br)return Br;a===Ci&&(e.items.splice(s,1),s-=1)}}}else if(Gt.isPair(e)){n=Object.freeze(n.concat(e));let s=nu("key",e.key,t,n);if(s===Br)return Br;s===Ci&&(e.key=null);let a=nu("value",e.value,t,n);if(a===Br)return Br;a===Ci&&(e.value=null)}}return i}async function cm(r,e){let t=PP(e);Gt.isDocument(r)?await iu(null,r.contents,t,Object.freeze([r]))===Ci&&(r.contents=null):await iu(null,r,t,Object.freeze([]))}cm.BREAK=Br;cm.SKIP=IP;cm.REMOVE=Ci;async function iu(r,e,t,n){let i=await kP(r,e,t,n);if(Gt.isNode(i)||Gt.isPair(i))return TP(r,n,i),iu(r,i,t,n);if(typeof i!="symbol"){if(Gt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=await iu(s,e.items[s],t,n);if(typeof a=="number")s=a-1;else{if(a===Br)return Br;a===Ci&&(e.items.splice(s,1),s-=1)}}}else if(Gt.isPair(e)){n=Object.freeze(n.concat(e));let s=await iu("key",e.key,t,n);if(s===Br)return Br;s===Ci&&(e.key=null);let a=await iu("value",e.value,t,n);if(a===Br)return Br;a===Ci&&(e.value=null)}}return i}function PP(r){return typeof r=="object"&&(r.Collection||r.Node||r.Value)?Object.assign({Alias:r.Node,Map:r.Node,Scalar:r.Node,Seq:r.Node},r.Value&&{Map:r.Value,Scalar:r.Value,Seq:r.Value},r.Collection&&{Map:r.Collection,Seq:r.Collection},r):r}function kP(r,e,t,n){if(typeof t=="function")return t(r,e,n);if(Gt.isMap(e))return t.Map?.(r,e,n);if(Gt.isSeq(e))return t.Seq?.(r,e,n);if(Gt.isPair(e))return t.Pair?.(r,e,n);if(Gt.isScalar(e))return t.Scalar?.(r,e,n);if(Gt.isAlias(e))return t.Alias?.(r,e,n)}function TP(r,e,t){let n=e[e.length-1];if(Gt.isCollection(n))n.items[r]=t;else if(Gt.isPair(n))r==="key"?n.key=t:n.value=t;else if(Gt.isDocument(n))n.contents=t;else{let i=Gt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}sw.visit=um;sw.visitAsync=cm});var ow=F(AP=>{"use strict";var qP=Je(),JW=Mf(),GW={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},YW=r=>r.replace(/[!,[\]{}]/g,e=>GW[e]),Nf=class r{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},r.defaultYaml,e),this.tags=Object.assign({},r.defaultTags,t)}clone(){let e=new r(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new r(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:r.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},r.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:r.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},r.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,a]=n;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,a),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(a){return t(String(a)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+YW(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&qP.isNode(e.contents)){let s={};JW.visit(e.contents,(a,l)=>{qP.isNode(l)&&l.tag&&(s[l.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of n)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(a)))&&t.push(`%TAG ${s} ${a}`);return t.join(`
|
|
96
|
+
`)}};Nf.defaultYaml={explicit:!1,version:"1.2"};Nf.defaultTags={"!!":"tag:yaml.org,2002:"};AP.Directives=Nf});var fm=F(Df=>{"use strict";var $P=Je(),KW=Mf();function QW(r){if(/[\x00-\x19\s,[\]{}]/.test(r)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(r)}`;throw new Error(t)}return!0}function MP(r){let e=new Set;return KW.visit(r,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function NP(r,e){for(let t=1;;++t){let n=`${r}${t}`;if(!e.has(n))return n}}function ZW(r,e){let t=[],n=new Map,i=null;return{onAnchor:s=>{t.push(s),i??(i=MP(r));let a=NP(e,i);return i.add(a),a},setAnchors:()=>{for(let s of t){let a=n.get(s);if(typeof a=="object"&&a.anchor&&($P.isScalar(a.node)||$P.isCollection(a.node)))a.node.anchor=a.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:n}}Df.anchorIsValid=QW;Df.anchorNames=MP;Df.createNodeAnchors=ZW;Df.findNewAnchor=NP});var aw=F(DP=>{"use strict";function Ff(r,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let a=n[i],l=Ff(r,n,String(i),a);l===void 0?delete n[i]:l!==a&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),a=Ff(r,n,i,s);a===void 0?n.delete(i):a!==s&&n.set(i,a)}else if(n instanceof Set)for(let i of Array.from(n)){let s=Ff(r,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(let[i,s]of Object.entries(n)){let a=Ff(r,n,i,s);a===void 0?delete n[i]:a!==s&&(n[i]=a)}return r.call(e,t,n)}DP.applyReviver=Ff});var Ks=F(LP=>{"use strict";var XW=Je();function FP(r,e,t){if(Array.isArray(r))return r.map((n,i)=>FP(n,String(i),t));if(r&&typeof r.toJSON=="function"){if(!t||!XW.hasAnchor(r))return r.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(r,n),t.onCreate=s=>{n.res=s,delete t.onCreate};let i=r.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof r=="bigint"&&!t?.keep?Number(r):r}LP.toJS=FP});var dm=F(UP=>{"use strict";var ez=aw(),jP=Je(),tz=Ks(),lw=class{constructor(e){Object.defineProperty(this,jP.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!jP.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=tz.toJS(this,"",a);if(typeof i=="function")for(let{count:f,res:d}of a.anchors.values())i(d,f);return typeof s=="function"?ez.applyReviver(s,{"":l},"",l):l}};UP.NodeBase=lw});var Lf=F(HP=>{"use strict";var rz=fm(),nz=Mf(),su=Je(),iz=dm(),sz=Ks(),uw=class extends iz.NodeBase{constructor(e){super(su.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],nz.visit(e,{Node:(s,a)=>{(su.isAlias(a)||su.hasAnchor(a))&&n.push(a)}}),t&&(t.aliasResolveCache=n));let i;for(let s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=t,a=this.resolve(i,t);if(!a){let f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let l=n.get(a);if(l||(sz.toJS(a,null,t),l=n.get(a)),l?.res===void 0){let f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=pm(i,a,n)),l.count*l.aliasCount>s)){let f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return l.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(rz.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}};function pm(r,e,t){if(su.isAlias(e)){let n=e.resolve(r),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(su.isCollection(e)){let n=0;for(let i of e.items){let s=pm(r,i,t);s>n&&(n=s)}return n}else if(su.isPair(e)){let n=pm(r,e.key,t),i=pm(r,e.value,t);return Math.max(n,i)}return 1}HP.Alias=uw});var jt=F(cw=>{"use strict";var oz=Je(),az=dm(),lz=Ks(),uz=r=>!r||typeof r!="function"&&typeof r!="object",Qs=class extends az.NodeBase{constructor(e){super(oz.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:lz.toJS(this.value,e,t)}toString(){return String(this.value)}};Qs.BLOCK_FOLDED="BLOCK_FOLDED";Qs.BLOCK_LITERAL="BLOCK_LITERAL";Qs.PLAIN="PLAIN";Qs.QUOTE_DOUBLE="QUOTE_DOUBLE";Qs.QUOTE_SINGLE="QUOTE_SINGLE";cw.Scalar=Qs;cw.isScalarValue=uz});var jf=F(VP=>{"use strict";var cz=Lf(),va=Je(),BP=jt(),fz="tag:yaml.org,2002:";function dz(r,e,t){if(e){let n=t.filter(s=>s.tag===e),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(r)&&!n.format)}function pz(r,e,t){if(va.isDocument(r)&&(r=r.contents),va.isNode(r))return r;if(va.isPair(r)){let g=t.schema[va.MAP].createNode?.(t.schema,null,t);return g.items.push(r),g}(r instanceof String||r instanceof Number||r instanceof Boolean||typeof BigInt<"u"&&r instanceof BigInt)&&(r=r.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:a,sourceObjects:l}=t,f;if(n&&r&&typeof r=="object"){if(f=l.get(r),f)return f.anchor??(f.anchor=i(r)),new cz.Alias(f.anchor);f={anchor:null,node:null},l.set(r,f)}e?.startsWith("!!")&&(e=fz+e.slice(2));let d=dz(r,e,a.tags);if(!d){if(r&&typeof r.toJSON=="function"&&(r=r.toJSON()),!r||typeof r!="object"){let g=new BP.Scalar(r);return f&&(f.node=g),g}d=r instanceof Map?a[va.MAP]:Symbol.iterator in Object(r)?a[va.SEQ]:a[va.MAP]}s&&(s(d),delete t.onTagObj);let h=d?.createNode?d.createNode(t.schema,r,t):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(t.schema,r,t):new BP.Scalar(r);return e?h.tag=e:d.default||(h.tag=d.tag),f&&(f.node=h),h}VP.createNode=pz});var mm=F(hm=>{"use strict";var hz=jf(),xi=Je(),mz=dm();function fw(r,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let a=[];a[s]=n,n=a}else n=new Map([[s,n]])}return hz.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:r,sourceObjects:new Map})}var WP=r=>r==null||typeof r=="object"&&!!r[Symbol.iterator]().next().done,dw=class extends mz.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>xi.isNode(n)||xi.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(WP(e))this.add(t);else{let[n,...i]=e,s=this.get(n,!0);if(xi.isCollection(s))s.addIn(i,t);else if(s===void 0&&this.schema)this.set(n,fw(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(xi.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!t&&xi.isScalar(s)?s.value:s:xi.isCollection(s)?s.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!xi.isPair(t))return!1;let n=t.value;return n==null||e&&xi.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return xi.isCollection(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let s=this.get(n,!0);if(xi.isCollection(s))s.setIn(i,t);else if(s===void 0&&this.schema)this.set(n,fw(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};hm.Collection=dw;hm.collectionFromPath=fw;hm.isEmptyPath=WP});var Uf=F(gm=>{"use strict";var gz=r=>r.replace(/^(?!$)(?: $)?/gm,"#");function pw(r,e){return/^\n+$/.test(r)?r.substring(1):e?r.replace(/^(?! *$)/gm,e):r}var yz=(r,e,t)=>r.endsWith(`
|
|
97
97
|
`)?pw(t,e):t.includes(`
|
|
98
98
|
`)?`
|
|
99
|
-
`+pw(t,e):(r.endsWith(" ")?"":" ")+t;
|
|
99
|
+
`+pw(t,e):(r.endsWith(" ")?"":" ")+t;gm.indentComment=pw;gm.lineComment=yz;gm.stringifyComment=gz});var JP=F(Hf=>{"use strict";var vz="flow",hw="block",ym="quoted";function bz(r,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:l}={}){if(!i||i<0)return r;i<s&&(s=0);let f=Math.max(1+s,1+i-e.length);if(r.length<=f)return r;let d=[],h={},g=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?d.push(0):g=i-n);let y,S,_=!1,R=-1,I=-1,q=-1;t===hw&&(R=zP(r,R,e.length),R!==-1&&(g=R+f));for(let B;B=r[R+=1];){if(t===ym&&B==="\\"){switch(I=R,r[R+1]){case"x":R+=3;break;case"u":R+=5;break;case"U":R+=9;break;default:R+=1}q=R}if(B===`
|
|
100
100
|
`)t===hw&&(R=zP(r,R,e.length)),g=R+e.length+f,y=void 0;else{if(B===" "&&S&&S!==" "&&S!==`
|
|
101
101
|
`&&S!==" "){let V=r[R+1];V&&V!==" "&&V!==`
|
|
102
|
-
`&&V!==" "&&(y=R)}if(R>=g)if(y)d.push(y),g=y+f,y=void 0;else if(t===
|
|
103
|
-
${e}${r.slice(0,W)}`:(t===
|
|
104
|
-
${e}${r.slice(V+1,W)}`)}return
|
|
105
|
-
`);n=e,i=e+1,s=r[i]}return n}
|
|
106
|
-
`){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function
|
|
102
|
+
`&&V!==" "&&(y=R)}if(R>=g)if(y)d.push(y),g=y+f,y=void 0;else if(t===ym){for(;S===" "||S===" ";)S=B,B=r[R+=1],_=!0;let V=R>q+1?R-2:I-1;if(h[V])return r;d.push(V),h[V]=!0,g=V+f,y=void 0}else _=!0}S=B}if(_&&l&&l(),d.length===0)return r;a&&a();let j=r.slice(0,d[0]);for(let B=0;B<d.length;++B){let V=d[B],W=d[B+1]||r.length;V===0?j=`
|
|
103
|
+
${e}${r.slice(0,W)}`:(t===ym&&h[V]&&(j+=`${r[V]}\\`),j+=`
|
|
104
|
+
${e}${r.slice(V+1,W)}`)}return j}function zP(r,e,t){let n=e,i=e+1,s=r[i];for(;s===" "||s===" ";)if(e<i+t)s=r[++e];else{do s=r[++e];while(s&&s!==`
|
|
105
|
+
`);n=e,i=e+1,s=r[i]}return n}Hf.FOLD_BLOCK=hw;Hf.FOLD_FLOW=vz;Hf.FOLD_QUOTED=ym;Hf.foldFlowLines=bz});var Vf=F(GP=>{"use strict";var Zn=jt(),Zs=JP(),bm=(r,e)=>({indentAtStart:e?r.indent.length:r.indentAtStart,lineWidth:r.options.lineWidth,minContentWidth:r.options.minContentWidth}),Sm=r=>/^(%|---|\.\.\.)/m.test(r);function Sz(r,e,t){if(!e||e<0)return!1;let n=e-t,i=r.length;if(i<=n)return!1;for(let s=0,a=0;s<i;++s)if(r[s]===`
|
|
106
|
+
`){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function Bf(r,e){let t=JSON.stringify(r);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Sm(r)?" ":""),a="",l=0;for(let f=0,d=t[f];d;d=t[++f])if(d===" "&&t[f+1]==="\\"&&t[f+2]==="n"&&(a+=t.slice(l,f)+"\\ ",f+=1,l=f,d="\\"),d==="\\")switch(t[f+1]){case"u":{a+=t.slice(l,f);let h=t.substr(f+2,4);switch(h){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:h.substr(0,2)==="00"?a+="\\x"+h.substr(2):a+=t.substr(f,6)}f+=5,l=f+1}break;case"n":if(n||t[f+2]==='"'||t.length<i)f+=1;else{for(a+=t.slice(l,f)+`
|
|
107
107
|
|
|
108
108
|
`;t[f+2]==="\\"&&t[f+3]==="n"&&t[f+4]!=='"';)a+=`
|
|
109
|
-
`,f+=2;a+=s,t[f+2]===" "&&(a+="\\"),f+=1,l=f+1}break;default:f+=1}return a=l?a+t.slice(l):t,n?a:Zs.foldFlowLines(a,s,Zs.FOLD_QUOTED,
|
|
110
|
-
`)||/[ \t]\n|\n[ \t]/.test(r))return
|
|
111
|
-
${t}`)+"'";return e.implicitKey?n:Zs.foldFlowLines(n,t,Zs.FOLD_FLOW,
|
|
109
|
+
`,f+=2;a+=s,t[f+2]===" "&&(a+="\\"),f+=1,l=f+1}break;default:f+=1}return a=l?a+t.slice(l):t,n?a:Zs.foldFlowLines(a,s,Zs.FOLD_QUOTED,bm(e,!1))}function mw(r,e){if(e.options.singleQuote===!1||e.implicitKey&&r.includes(`
|
|
110
|
+
`)||/[ \t]\n|\n[ \t]/.test(r))return Bf(r,e);let t=e.indent||(Sm(r)?" ":""),n="'"+r.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
111
|
+
${t}`)+"'";return e.implicitKey?n:Zs.foldFlowLines(n,t,Zs.FOLD_FLOW,bm(e,!1))}function ou(r,e){let{singleQuote:t}=e.options,n;if(t===!1)n=Bf;else{let i=r.includes('"'),s=r.includes("'");i&&!s?n=mw:s&&!i?n=Bf:n=t?mw:Bf}return n(r,e)}var gw;try{gw=new RegExp(`(^|(?<!
|
|
112
112
|
))
|
|
113
113
|
+(?!
|
|
114
|
-
|$)`,"g")}catch{gw=/\n+(?!\n|$)/g}function
|
|
114
|
+
|$)`,"g")}catch{gw=/\n+(?!\n|$)/g}function vm({comment:r,type:e,value:t},n,i,s){let{blockQuote:a,commentString:l,lineWidth:f}=n.options;if(!a||/\n[\t ]+$/.test(t))return ou(t,n);let d=n.indent||(n.forceBlockIndent||Sm(t)?" ":""),h=a==="literal"?!0:a==="folded"||e===Zn.Scalar.BLOCK_FOLDED?!1:e===Zn.Scalar.BLOCK_LITERAL?!0:!Sz(t,f,d.length);if(!t)return h?`|
|
|
115
115
|
`:`>
|
|
116
116
|
`;let g,y;for(y=t.length;y>0;--y){let W=t[y-1];if(W!==`
|
|
117
117
|
`&&W!==" "&&W!==" ")break}let S=t.substring(y),_=S.indexOf(`
|
|
118
118
|
`);_===-1?g="-":t===S||_!==S.length-1?(g="+",s&&s()):g="",S&&(t=t.slice(0,-S.length),S[S.length-1]===`
|
|
119
119
|
`&&(S=S.slice(0,-1)),S=S.replace(gw,`$&${d}`));let R=!1,I,q=-1;for(I=0;I<t.length;++I){let W=t[I];if(W===" ")R=!0;else if(W===`
|
|
120
|
-
`)q=I;else break}let
|
|
121
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),X=!1,T=
|
|
120
|
+
`)q=I;else break}let j=t.substring(0,q<I?q+1:I);j&&(t=t.substring(j.length),j=j.replace(/\n+/g,`$&${d}`));let V=(R?d?"2":"1":"")+g;if(r&&(V+=" "+l(r.replace(/ ?[\r\n]+/g," ")),i&&i()),!h){let W=t.replace(/\n+/g,`
|
|
121
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),X=!1,T=bm(n,!0);a!=="folded"&&e!==Zn.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{X=!0});let C=Zs.foldFlowLines(`${j}${W}${S}`,d,Zs.FOLD_BLOCK,T);if(!X)return`>${V}
|
|
122
122
|
${d}${C}`}return t=t.replace(/\n+/g,`$&${d}`),`|${V}
|
|
123
|
-
${d}${
|
|
123
|
+
${d}${j}${t}${S}`}function wz(r,e,t,n){let{type:i,value:s}=r,{actualString:a,implicitKey:l,indent:f,indentStep:d,inFlow:h}=e;if(l&&s.includes(`
|
|
124
124
|
`)||h&&/[[\]{},]/.test(s))return ou(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||h||!s.includes(`
|
|
125
|
-
`)?ou(s,e):
|
|
126
|
-
`))return
|
|
127
|
-
${f}`);if(a){let y=R=>R.default&&R.tag!=="tag:yaml.org,2002:str"&&R.test?.test(g),{compat:S,tags:_}=e.doc.schema;if(_.some(y)||S?.some(y))return ou(s,e)}return l?g:Zs.foldFlowLines(g,f,Zs.FOLD_FLOW,
|
|
128
|
-
${e.indent}${l}`:l}yw.createStringifyContext=Ez;yw.stringify=Pz});var ZP=F(QP=>{"use strict";var ss=Je(),YP=jt(),KP=
|
|
129
|
-
${l}:`):(I=`${I}:`,y&&(I+=
|
|
130
|
-
`:"",
|
|
131
|
-
${
|
|
125
|
+
`)?ou(s,e):vm(r,e,t,n);if(!l&&!h&&i!==Zn.Scalar.PLAIN&&s.includes(`
|
|
126
|
+
`))return vm(r,e,t,n);if(Sm(s)){if(f==="")return e.forceBlockIndent=!0,vm(r,e,t,n);if(l&&f===d)return ou(s,e)}let g=s.replace(/\n+/g,`$&
|
|
127
|
+
${f}`);if(a){let y=R=>R.default&&R.tag!=="tag:yaml.org,2002:str"&&R.test?.test(g),{compat:S,tags:_}=e.doc.schema;if(_.some(y)||S?.some(y))return ou(s,e)}return l?g:Zs.foldFlowLines(g,f,Zs.FOLD_FLOW,bm(e,!1))}function _z(r,e,t,n){let{implicitKey:i,inFlow:s}=e,a=typeof r.value=="string"?r:Object.assign({},r,{value:String(r.value)}),{type:l}=r;l!==Zn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=Zn.Scalar.QUOTE_DOUBLE);let f=h=>{switch(h){case Zn.Scalar.BLOCK_FOLDED:case Zn.Scalar.BLOCK_LITERAL:return i||s?ou(a.value,e):vm(a,e,t,n);case Zn.Scalar.QUOTE_DOUBLE:return Bf(a.value,e);case Zn.Scalar.QUOTE_SINGLE:return mw(a.value,e);case Zn.Scalar.PLAIN:return wz(a,e,t,n);default:return null}},d=f(l);if(d===null){let{defaultKeyType:h,defaultStringType:g}=e.options,y=i&&h||g;if(d=f(y),d===null)throw new Error(`Unsupported default string type ${y}`)}return d}GP.stringifyString=_z});var Wf=F(yw=>{"use strict";var Rz=fm(),Xs=Je(),Cz=Uf(),xz=Vf();function Ez(r,e){let t=Object.assign({blockQuote:!0,commentString:Cz.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},r.schema.toStringOptions,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:r,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function Oz(r,e){if(e.tag){let i=r.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let t,n;if(Xs.isScalar(e)){n=e.value;let i=r.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(a=>a.test);s.length>0&&(i=s)}t=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else n=e,t=r.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!t){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return t}function Iz(r,e,{anchors:t,doc:n}){if(!n.directives)return"";let i=[],s=(Xs.isScalar(r)||Xs.isCollection(r))&&r.anchor;s&&Rz.anchorIsValid(s)&&(t.add(s),i.push(`&${s}`));let a=r.tag??(e.default?null:e.tag);return a&&i.push(n.directives.tagString(a)),i.join(" ")}function Pz(r,e,t,n){if(Xs.isPair(r))return r.toString(e,t,n);if(Xs.isAlias(r)){if(e.doc.directives)return r.toString(e);if(e.resolvedAliases?.has(r))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(r):e.resolvedAliases=new Set([r]),r=r.resolve(e.doc)}let i,s=Xs.isNode(r)?r:e.doc.createNode(r,{onTagObj:f=>i=f});i??(i=Oz(e.doc.schema.tags,s));let a=Iz(s,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);let l=typeof i.stringify=="function"?i.stringify(s,e,t,n):Xs.isScalar(s)?xz.stringifyString(s,e,t,n):s.toString(e,t,n);return a?Xs.isScalar(s)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a}
|
|
128
|
+
${e.indent}${l}`:l}yw.createStringifyContext=Ez;yw.stringify=Pz});var ZP=F(QP=>{"use strict";var ss=Je(),YP=jt(),KP=Wf(),zf=Uf();function kz({key:r,value:e},t,n,i){let{allNullValues:s,doc:a,indent:l,indentStep:f,options:{commentString:d,indentSeq:h,simpleKeys:g}}=t,y=ss.isNode(r)&&r.comment||null;if(g){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(ss.isCollection(r)||!ss.isNode(r)&&typeof r=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let S=!g&&(!r||y&&e==null&&!t.inFlow||ss.isCollection(r)||(ss.isScalar(r)?r.type===YP.Scalar.BLOCK_FOLDED||r.type===YP.Scalar.BLOCK_LITERAL:typeof r=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!S&&(g||!s),indent:l+f});let _=!1,R=!1,I=KP.stringify(r,t,()=>_=!0,()=>R=!0);if(!S&&!t.inFlow&&I.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");S=!0}if(t.inFlow){if(s||e==null)return _&&n&&n(),I===""?"?":S?`? ${I}`:I}else if(s&&!g||e==null&&S)return I=`? ${I}`,y&&!_?I+=zf.lineComment(I,t.indent,d(y)):R&&i&&i(),I;_&&(y=null),S?(y&&(I+=zf.lineComment(I,t.indent,d(y))),I=`? ${I}
|
|
129
|
+
${l}:`):(I=`${I}:`,y&&(I+=zf.lineComment(I,t.indent,d(y))));let q,j,B;ss.isNode(e)?(q=!!e.spaceBefore,j=e.commentBefore,B=e.comment):(q=!1,j=null,B=null,e&&typeof e=="object"&&(e=a.createNode(e))),t.implicitKey=!1,!S&&!y&&ss.isScalar(e)&&(t.indentAtStart=I.length+1),R=!1,!h&&f.length>=2&&!t.inFlow&&!S&&ss.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let V=!1,W=KP.stringify(e,t,()=>V=!0,()=>R=!0),X=" ";if(y||q||j){if(X=q?`
|
|
130
|
+
`:"",j){let T=d(j);X+=`
|
|
131
|
+
${zf.indentComment(T,t.indent)}`}W===""&&!t.inFlow?X===`
|
|
132
132
|
`&&B&&(X=`
|
|
133
133
|
|
|
134
134
|
`):X+=`
|
|
135
135
|
${t.indent}`}else if(!S&&ss.isCollection(e)){let T=W[0],C=W.indexOf(`
|
|
136
|
-
`),k=C!==-1,N=t.inFlow??e.flow??e.items.length===0;if(k||!N){let
|
|
136
|
+
`),k=C!==-1,N=t.inFlow??e.flow??e.items.length===0;if(k||!N){let U=!1;if(k&&(T==="&"||T==="!")){let $=W.indexOf(" ");T==="&"&&$!==-1&&$<C&&W[$+1]==="!"&&($=W.indexOf(" ",$+1)),($===-1||C<$)&&(U=!0)}U||(X=`
|
|
137
137
|
${t.indent}`)}}else(W===""||W[0]===`
|
|
138
|
-
`)&&(X="");return I+=X+W,t.inFlow?V&&n&&n():B&&!V?I+=
|
|
138
|
+
`)&&(X="");return I+=X+W,t.inFlow?V&&n&&n():B&&!V?I+=zf.lineComment(I,t.indent,d(B)):R&&i&&i(),I}QP.stringifyPair=kz});var bw=F(vw=>{"use strict";var XP=it("process");function Tz(r,...e){r==="debug"&&console.log(...e)}function qz(r,e){(r==="debug"||r==="warn")&&(typeof XP.emitWarning=="function"?XP.emitWarning(e):console.warn(e))}vw.debug=Tz;vw.warn=qz});var xm=F(Cm=>{"use strict";var Rm=Je(),ek=jt(),wm="<<",_m={identify:r=>r===wm||typeof r=="symbol"&&r.description===wm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ek.Scalar(Symbol(wm)),{addToJSMap:tk}),stringify:()=>wm},Az=(r,e)=>(_m.identify(e)||Rm.isScalar(e)&&(!e.type||e.type===ek.Scalar.PLAIN)&&_m.identify(e.value))&&r?.doc.schema.tags.some(t=>t.tag===_m.tag&&t.default);function tk(r,e,t){let n=rk(r,t);if(Rm.isSeq(n))for(let i of n.items)Sw(r,e,i);else if(Array.isArray(n))for(let i of n)Sw(r,e,i);else Sw(r,e,n)}function Sw(r,e,t){let n=rk(r,t);if(!Rm.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,r,Map);for(let[s,a]of i)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function rk(r,e){return r&&Rm.isAlias(e)?e.resolve(r.doc,r):e}Cm.addMergeToJSMap=tk;Cm.isMergeKey=Az;Cm.merge=_m});var _w=F(sk=>{"use strict";var $z=bw(),nk=xm(),Mz=Wf(),ik=Je(),ww=Ks();function Nz(r,e,{key:t,value:n}){if(ik.isNode(t)&&t.addToJSMap)t.addToJSMap(r,e,n);else if(nk.isMergeKey(r,t))nk.addMergeToJSMap(r,e,n);else{let i=ww.toJS(t,"",r);if(e instanceof Map)e.set(i,ww.toJS(n,i,r));else if(e instanceof Set)e.add(i);else{let s=Dz(t,i,r),a=ww.toJS(n,s,r);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}function Dz(r,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(ik.isNode(r)&&t?.doc){let n=Mz.createStringifyContext(t.doc,{});n.anchors=new Set;for(let s of t.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=r.toString(n);if(!t.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),$z.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}sk.addPairToJSMap=Nz});var eo=F(Rw=>{"use strict";var ok=jf(),Fz=ZP(),Lz=_w(),Em=Je();function jz(r,e,t){let n=ok.createNode(r,void 0,t),i=ok.createNode(e,void 0,t);return new Om(n,i)}var Om=class r{constructor(e,t=null){Object.defineProperty(this,Em.NODE_TYPE,{value:Em.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return Em.isNode(t)&&(t=t.clone(e)),Em.isNode(n)&&(n=n.clone(e)),new r(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return Lz.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?Fz.stringifyPair(this,e,t,n):JSON.stringify(this)}};Rw.Pair=Om;Rw.createPair=jz});var Cw=F(lk=>{"use strict";var ba=Je(),ak=Wf(),Im=Uf();function Uz(r,e,t){return(e.inFlow??r.flow?Bz:Hz)(r,e,t)}function Hz({comment:r,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:a,onComment:l}){let{indent:f,options:{commentString:d}}=t,h=Object.assign({},t,{indent:s,type:null}),g=!1,y=[];for(let _=0;_<e.length;++_){let R=e[_],I=null;if(ba.isNode(R))!g&&R.spaceBefore&&y.push(""),Pm(t,y,R.commentBefore,g),R.comment&&(I=R.comment);else if(ba.isPair(R)){let j=ba.isNode(R.key)?R.key:null;j&&(!g&&j.spaceBefore&&y.push(""),Pm(t,y,j.commentBefore,g))}g=!1;let q=ak.stringify(R,h,()=>I=null,()=>g=!0);I&&(q+=Im.lineComment(q,s,d(I))),g&&I&&(g=!1),y.push(n+q)}let S;if(y.length===0)S=i.start+i.end;else{S=y[0];for(let _=1;_<y.length;++_){let R=y[_];S+=R?`
|
|
139
139
|
${f}${R}`:`
|
|
140
140
|
`}}return r?(S+=`
|
|
141
|
-
`+
|
|
142
|
-
`)),_<r.length-1?q+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(d||(d=g.reduce((
|
|
141
|
+
`+Im.indentComment(d(r),f),l&&l()):g&&a&&a(),S}function Bz({items:r},e,{flowChars:t,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:l}}=e;n+=s;let f=Object.assign({},e,{indent:n,inFlow:!0,type:null}),d=!1,h=0,g=[];for(let _=0;_<r.length;++_){let R=r[_],I=null;if(ba.isNode(R))R.spaceBefore&&g.push(""),Pm(e,g,R.commentBefore,!1),R.comment&&(I=R.comment);else if(ba.isPair(R)){let j=ba.isNode(R.key)?R.key:null;j&&(j.spaceBefore&&g.push(""),Pm(e,g,j.commentBefore,!1),j.comment&&(d=!0));let B=ba.isNode(R.value)?R.value:null;B?(B.comment&&(I=B.comment),B.commentBefore&&(d=!0)):R.value==null&&j?.comment&&(I=j.comment)}I&&(d=!0);let q=ak.stringify(R,f,()=>I=null);d||(d=g.length>h||q.includes(`
|
|
142
|
+
`)),_<r.length-1?q+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(d||(d=g.reduce((j,B)=>j+B.length+2,2)+(q.length+2)>e.options.lineWidth)),d&&(q+=",")),I&&(q+=Im.lineComment(q,n,l(I))),g.push(q),h=g.length}let{start:y,end:S}=t;if(g.length===0)return y+S;if(!d){let _=g.reduce((R,I)=>R+I.length+2,2);d=e.options.lineWidth>0&&_>e.options.lineWidth}if(d){let _=y;for(let R of g)_+=R?`
|
|
143
143
|
${s}${i}${R}`:`
|
|
144
144
|
`;return`${_}
|
|
145
|
-
${i}${S}`}else return`${y}${a}${g.join(" ")}${a}${S}`}function
|
|
146
|
-
`:" ")}return EJ.stringifyString({comment:r,type:e,value:l},n,i,s)}};Ik.binary=OJ});var
|
|
145
|
+
${i}${S}`}else return`${y}${a}${g.join(" ")}${a}${S}`}function Pm({indent:r,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=Im.indentComment(e(n),r);t.push(s.trimStart())}}lk.stringifyCollection=Uz});var ro=F(Ew=>{"use strict";var Vz=Cw(),Wz=_w(),zz=mm(),to=Je(),km=eo(),Jz=jt();function Jf(r,e){let t=to.isScalar(e)?e.value:e;for(let n of r)if(to.isPair(n)&&(n.key===e||n.key===t||to.isScalar(n.key)&&n.key.value===t))return n}var xw=class extends zz.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(to.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:i,replacer:s}=n,a=new this(e),l=(f,d)=>{if(typeof s=="function")d=s.call(t,f,d);else if(Array.isArray(s)&&!s.includes(f))return;(d!==void 0||i)&&a.items.push(km.createPair(f,d,n))};if(t instanceof Map)for(let[f,d]of t)l(f,d);else if(t&&typeof t=="object")for(let f of Object.keys(t))l(f,t[f]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;to.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new km.Pair(e,e?.value):n=new km.Pair(e.key,e.value);let i=Jf(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);to.isScalar(i.value)&&Jz.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let a=this.items.findIndex(l=>s(n,l)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){let t=Jf(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=Jf(this.items,e)?.value;return(!t&&to.isScalar(i)?i.value:i)??void 0}has(e){return!!Jf(this.items,e)}set(e,t){this.add(new km.Pair(e,t),!0)}toJSON(e,t,n){let i=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let s of this.items)Wz.addPairToJSMap(t,i,s);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!to.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Vz.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};Ew.YAMLMap=xw;Ew.findPair=Jf});var au=F(ck=>{"use strict";var Gz=Je(),uk=ro(),Yz={collection:"map",default:!0,nodeClass:uk.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(r,e){return Gz.isMap(r)||e("Expected a mapping for this tag"),r},createNode:(r,e,t)=>uk.YAMLMap.from(r,e,t)};ck.map=Yz});var no=F(fk=>{"use strict";var Kz=jf(),Qz=Cw(),Zz=mm(),qm=Je(),Xz=jt(),eJ=Ks(),Ow=class extends Zz.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(qm.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Tm(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=Tm(e);if(typeof n!="number")return;let i=this.items[n];return!t&&qm.isScalar(i)?i.value:i}has(e){let t=Tm(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=Tm(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];qm.isScalar(i)&&Xz.isScalarValue(t)?i.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let i=0;for(let s of this.items)n.push(eJ.toJS(s,String(i++),t));return n}toString(e,t,n){return e?Qz.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:i}=n,s=new this(e);if(t&&Symbol.iterator in Object(t)){let a=0;for(let l of t){if(typeof i=="function"){let f=t instanceof Set?l:String(a++);l=i.call(t,f,l)}s.items.push(Kz.createNode(l,void 0,n))}}return s}};function Tm(r){let e=qm.isScalar(r)?r.value:r;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}fk.YAMLSeq=Ow});var lu=F(pk=>{"use strict";var tJ=Je(),dk=no(),rJ={collection:"seq",default:!0,nodeClass:dk.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(r,e){return tJ.isSeq(r)||e("Expected a sequence for this tag"),r},createNode:(r,e,t)=>dk.YAMLSeq.from(r,e,t)};pk.seq=rJ});var Gf=F(hk=>{"use strict";var nJ=Vf(),iJ={identify:r=>typeof r=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r=>r,stringify(r,e,t,n){return e=Object.assign({actualString:!0},e),nJ.stringifyString(r,e,t,n)}};hk.string=iJ});var Am=F(yk=>{"use strict";var mk=jt(),gk={identify:r=>r==null,createNode:()=>new mk.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new mk.Scalar(null),stringify:({source:r},e)=>typeof r=="string"&&gk.test.test(r)?r:e.options.nullStr};yk.nullTag=gk});var Iw=F(bk=>{"use strict";var sJ=jt(),vk={identify:r=>typeof r=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:r=>new sJ.Scalar(r[0]==="t"||r[0]==="T"),stringify({source:r,value:e},t){if(r&&vk.test.test(r)){let n=r[0]==="t"||r[0]==="T";if(e===n)return r}return e?t.options.trueStr:t.options.falseStr}};bk.boolTag=vk});var uu=F(Sk=>{"use strict";function oJ({format:r,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!r&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let l=e-(s.length-a-1);for(;l-- >0;)s+="0"}return s}Sk.stringifyNumber=oJ});var kw=F($m=>{"use strict";var aJ=jt(),Pw=uu(),lJ={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Pw.stringifyNumber},uJ={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():Pw.stringifyNumber(r)}},cJ={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(r){let e=new aJ.Scalar(parseFloat(r)),t=r.indexOf(".");return t!==-1&&r[r.length-1]==="0"&&(e.minFractionDigits=r.length-t-1),e},stringify:Pw.stringifyNumber};$m.float=cJ;$m.floatExp=uJ;$m.floatNaN=lJ});var qw=F(Nm=>{"use strict";var wk=uu(),Mm=r=>typeof r=="bigint"||Number.isInteger(r),Tw=(r,e,t,{intAsBigInt:n})=>n?BigInt(r):parseInt(r.substring(e),t);function _k(r,e,t){let{value:n}=r;return Mm(n)&&n>=0?t+n.toString(e):wk.stringifyNumber(r)}var fJ={identify:r=>Mm(r)&&r>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(r,e,t)=>Tw(r,2,8,t),stringify:r=>_k(r,8,"0o")},dJ={identify:Mm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(r,e,t)=>Tw(r,0,10,t),stringify:wk.stringifyNumber},pJ={identify:r=>Mm(r)&&r>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(r,e,t)=>Tw(r,2,16,t),stringify:r=>_k(r,16,"0x")};Nm.int=dJ;Nm.intHex=pJ;Nm.intOct=fJ});var Ck=F(Rk=>{"use strict";var hJ=au(),mJ=Am(),gJ=lu(),yJ=Gf(),vJ=Iw(),Aw=kw(),$w=qw(),bJ=[hJ.map,gJ.seq,yJ.string,mJ.nullTag,vJ.boolTag,$w.intOct,$w.int,$w.intHex,Aw.floatNaN,Aw.floatExp,Aw.float];Rk.schema=bJ});var Ok=F(Ek=>{"use strict";var SJ=jt(),wJ=au(),_J=lu();function xk(r){return typeof r=="bigint"||Number.isInteger(r)}var Dm=({value:r})=>JSON.stringify(r),RJ=[{identify:r=>typeof r=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r=>r,stringify:Dm},{identify:r=>r==null,createNode:()=>new SJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Dm},{identify:r=>typeof r=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:r=>r==="true",stringify:Dm},{identify:xk,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(r,e,{intAsBigInt:t})=>t?BigInt(r):parseInt(r,10),stringify:({value:r})=>xk(r)?r.toString():JSON.stringify(r)},{identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:r=>parseFloat(r),stringify:Dm}],CJ={default:!0,tag:"",test:/^/,resolve(r,e){return e(`Unresolved plain scalar ${JSON.stringify(r)}`),r}},xJ=[wJ.map,_J.seq].concat(RJ,CJ);Ek.schema=xJ});var Nw=F(Ik=>{"use strict";var Yf=it("buffer"),Mw=jt(),EJ=Vf(),OJ={identify:r=>r instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(r,e){if(typeof Yf.Buffer=="function")return Yf.Buffer.from(r,"base64");if(typeof atob=="function"){let t=atob(r.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),r},stringify({comment:r,type:e,value:t},n,i,s){if(!t)return"";let a=t,l;if(typeof Yf.Buffer=="function")l=a instanceof Yf.Buffer?a.toString("base64"):Yf.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let f="";for(let d=0;d<a.length;++d)f+=String.fromCharCode(a[d]);l=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Mw.Scalar.BLOCK_LITERAL),e!==Mw.Scalar.QUOTE_DOUBLE){let f=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),d=Math.ceil(l.length/f),h=new Array(d);for(let g=0,y=0;g<d;++g,y+=f)h[g]=l.substr(y,f);l=h.join(e===Mw.Scalar.BLOCK_LITERAL?`
|
|
146
|
+
`:" ")}return EJ.stringifyString({comment:r,type:e,value:l},n,i,s)}};Ik.binary=OJ});var jm=F(Lm=>{"use strict";var Fm=Je(),Dw=eo(),IJ=jt(),PJ=no();function Pk(r,e){if(Fm.isSeq(r))for(let t=0;t<r.items.length;++t){let n=r.items[t];if(!Fm.isPair(n)){if(Fm.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Dw.Pair(new IJ.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
147
147
|
${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
|
|
148
|
-
${s.comment}`:n.comment}n=i}r.items[t]=Lm.isPair(n)?n:new Dw.Pair(n)}}else e("Expected a sequence for this tag");return r}function kk(r,e,t){let{replacer:n}=t,i=new PJ.YAMLSeq(r);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let l,f;if(Array.isArray(a))if(a.length===2)l=a[0],f=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let d=Object.keys(a);if(d.length===1)l=d[0],f=a[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=a;i.items.push(Dw.createPair(l,f,t))}return i}var kJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Pk,createNode:kk};jm.createPairs=kk;jm.pairs=kJ;jm.resolvePairs=Pk});var jw=F(Lw=>{"use strict";var Tk=Je(),Fw=Ks(),Qf=ro(),TJ=no(),qk=Um(),Sa=class r extends TJ.YAMLSeq{constructor(){super(),this.add=Qf.YAMLMap.prototype.add.bind(this),this.delete=Qf.YAMLMap.prototype.delete.bind(this),this.get=Qf.YAMLMap.prototype.get.bind(this),this.has=Qf.YAMLMap.prototype.has.bind(this),this.set=Qf.YAMLMap.prototype.set.bind(this),this.tag=r.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let s,a;if(Tk.isPair(i)?(s=Fw.toJS(i.key,"",t),a=Fw.toJS(i.value,s,t)):s=Fw.toJS(i,"",t),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,t,n){let i=qk.createPairs(e,t,n),s=new this;return s.items=i.items,s}};Sa.tag="tag:yaml.org,2002:omap";var qJ={collection:"seq",identify:r=>r instanceof Map,nodeClass:Sa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(r,e){let t=qk.resolvePairs(r,e),n=[];for(let{key:i}of t.items)Tk.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Sa,t)},createNode:(r,e,t)=>Sa.from(r,e,t)};Lw.YAMLOMap=Sa;Lw.omap=qJ});var Dk=F(Uw=>{"use strict";var Ak=jt();function $k({value:r,source:e},t){return e&&(r?Mk:Nk).test.test(e)?e:r?t.options.trueStr:t.options.falseStr}var Mk={identify:r=>r===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ak.Scalar(!0),stringify:$k},Nk={identify:r=>r===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ak.Scalar(!1),stringify:$k};Uw.falseTag=Nk;Uw.trueTag=Mk});var Fk=F(Hm=>{"use strict";var AJ=jt(),Hw=uu(),$J={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Hw.stringifyNumber},MJ={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r.replace(/_/g,"")),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():Hw.stringifyNumber(r)}},NJ={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(r){let e=new AJ.Scalar(parseFloat(r.replace(/_/g,""))),t=r.indexOf(".");if(t!==-1){let n=r.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Hw.stringifyNumber};Hm.float=NJ;Hm.floatExp=MJ;Hm.floatNaN=$J});var jk=F(Xf=>{"use strict";var Lk=uu(),Zf=r=>typeof r=="bigint"||Number.isInteger(r);function Bm(r,e,t,{intAsBigInt:n}){let i=r[0];if((i==="-"||i==="+")&&(e+=1),r=r.substring(e).replace(/_/g,""),n){switch(t){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let a=BigInt(r);return i==="-"?BigInt(-1)*a:a}let s=parseInt(r,t);return i==="-"?-1*s:s}function Bw(r,e,t){let{value:n}=r;if(Zf(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return Lk.stringifyNumber(r)}var DJ={identify:Zf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(r,e,t)=>Bm(r,2,2,t),stringify:r=>Bw(r,2,"0b")},FJ={identify:Zf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(r,e,t)=>Bm(r,1,8,t),stringify:r=>Bw(r,8,"0")},LJ={identify:Zf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(r,e,t)=>Bm(r,0,10,t),stringify:Lk.stringifyNumber},jJ={identify:Zf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(r,e,t)=>Bm(r,2,16,t),stringify:r=>Bw(r,16,"0x")};Xf.int=LJ;Xf.intBin=DJ;Xf.intHex=jJ;Xf.intOct=FJ});var Ww=F(Vw=>{"use strict";var zm=Je(),Vm=eo(),Wm=ro(),wa=class r extends Wm.YAMLMap{constructor(e){super(e),this.tag=r.tag}add(e){let t;zm.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Vm.Pair(e.key,null):t=new Vm.Pair(e,null),Wm.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Wm.findPair(this.items,e);return!t&&zm.isPair(n)?zm.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Wm.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Vm.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof i=="function"&&(a=i.call(t,a,a)),s.items.push(Vm.createPair(a,null,n));return s}};wa.tag="tag:yaml.org,2002:set";var UJ={collection:"map",identify:r=>r instanceof Set,nodeClass:wa,default:!1,tag:"tag:yaml.org,2002:set",createNode:(r,e,t)=>wa.from(r,e,t),resolve(r,e){if(zm.isMap(r)){if(r.hasAllNullValues(!0))return Object.assign(new wa,r);e("Set items must all have null values")}else e("Expected a mapping for this tag");return r}};Vw.YAMLSet=wa;Vw.set=UJ});var Jw=F(Jm=>{"use strict";var HJ=uu();function zw(r,e){let t=r[0],n=t==="-"||t==="+"?r.substring(1):r,i=a=>e?BigInt(a):Number(a),s=n.replace(/_/g,"").split(":").reduce((a,l)=>a*i(60)+i(l),i(0));return t==="-"?i(-1)*s:s}function Uk(r){let{value:e}=r,t=a=>a;if(typeof e=="bigint")t=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return HJ.stringifyNumber(r);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var BJ={identify:r=>typeof r=="bigint"||Number.isInteger(r),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(r,e,{intAsBigInt:t})=>zw(r,t),stringify:Uk},VJ={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:r=>zw(r,!1),stringify:Uk},Hk={identify:r=>r instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(r){let e=r.match(Hk.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,s,a,l]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(t,n-1,i,s||0,a||0,l||0,f),h=e[8];if(h&&h!=="Z"){let g=zw(h,!1);Math.abs(g)<30&&(g*=60),d-=6e4*g}return new Date(d)},stringify:({value:r})=>r?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Jm.floatTime=VJ;Jm.intTime=BJ;Jm.timestamp=Hk});var Wk=F(Vk=>{"use strict";var WJ=au(),zJ=$m(),JJ=lu(),GJ=Yf(),YJ=Nw(),Bk=Dk(),Gw=Fk(),Gm=jk(),KJ=Em(),QJ=jw(),ZJ=Um(),XJ=Ww(),Yw=Jw(),eG=[WJ.map,JJ.seq,GJ.string,zJ.nullTag,Bk.trueTag,Bk.falseTag,Gm.intBin,Gm.intOct,Gm.int,Gm.intHex,Gw.floatNaN,Gw.floatExp,Gw.float,YJ.binary,KJ.merge,QJ.omap,ZJ.pairs,XJ.set,Yw.intTime,Yw.floatTime,Yw.timestamp];Vk.schema=eG});var tT=F(Zw=>{"use strict";var Yk=au(),tG=$m(),Kk=lu(),rG=Yf(),nG=Iw(),Kw=kw(),Qw=qw(),iG=Ck(),sG=Ok(),Qk=Nw(),ed=Em(),Zk=jw(),Xk=Um(),zk=Wk(),eT=Ww(),Ym=Jw(),Jk=new Map([["core",iG.schema],["failsafe",[Yk.map,Kk.seq,rG.string]],["json",sG.schema],["yaml11",zk.schema],["yaml-1.1",zk.schema]]),Gk={binary:Qk.binary,bool:nG.boolTag,float:Kw.float,floatExp:Kw.floatExp,floatNaN:Kw.floatNaN,floatTime:Ym.floatTime,int:Qw.int,intHex:Qw.intHex,intOct:Qw.intOct,intTime:Ym.intTime,map:Yk.map,merge:ed.merge,null:tG.nullTag,omap:Zk.omap,pairs:Xk.pairs,seq:Kk.seq,set:eT.set,timestamp:Ym.timestamp},oG={"tag:yaml.org,2002:binary":Qk.binary,"tag:yaml.org,2002:merge":ed.merge,"tag:yaml.org,2002:omap":Zk.omap,"tag:yaml.org,2002:pairs":Xk.pairs,"tag:yaml.org,2002:set":eT.set,"tag:yaml.org,2002:timestamp":Ym.timestamp};function aG(r,e,t){let n=Jk.get(e);if(n&&!r)return t&&!n.includes(ed.merge)?n.concat(ed.merge):n.slice();let i=n;if(!i)if(Array.isArray(r))i=[];else{let s=Array.from(Jk.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(r))for(let s of r)i=i.concat(s);else typeof r=="function"&&(i=r(i.slice()));return t&&(i=i.concat(ed.merge)),i.reduce((s,a)=>{let l=typeof a=="string"?Gk[a]:a;if(!l){let f=JSON.stringify(a),d=Object.keys(Gk).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}Zw.coreKnownTags=oG;Zw.getTags=aG});var t_=F(rT=>{"use strict";var Xw=Je(),lG=au(),uG=lu(),cG=Yf(),Km=tT(),fG=(r,e)=>r.key<e.key?-1:r.key>e.key?1:0,e_=class r{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(e)?Km.getTags(e,"compat"):e?Km.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Km.coreKnownTags:{},this.tags=Km.getTags(t,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Xw.MAP,{value:lG.map}),Object.defineProperty(this,Xw.SCALAR,{value:cG.string}),Object.defineProperty(this,Xw.SEQ,{value:uG.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?fG:null}clone(){let e=Object.create(r.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};rT.Schema=e_});var iT=F(nT=>{"use strict";var dG=Je(),r_=zf(),td=Hf();function pG(r,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&r.directives){let f=r.directives.toString(r);f?(t.push(f),n=!0):r.directives.docStart&&(n=!0)}n&&t.push("---");let i=r_.createStringifyContext(r,e),{commentString:s}=i.options;if(r.commentBefore){t.length!==1&&t.unshift("");let f=s(r.commentBefore);t.unshift(td.indentComment(f,""))}let a=!1,l=null;if(r.contents){if(dG.isNode(r.contents)){if(r.contents.spaceBefore&&n&&t.push(""),r.contents.commentBefore){let h=s(r.contents.commentBefore);t.push(td.indentComment(h,""))}i.forceBlockIndent=!!r.comment,l=r.contents.comment}let f=l?void 0:()=>a=!0,d=r_.stringify(r.contents,i,()=>l=null,f);l&&(d+=td.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${d}`:t.push(d)}else t.push(r_.stringify(r.contents,i));if(r.directives?.docEnd)if(r.comment){let f=s(r.comment);f.includes(`
|
|
149
|
-
`)?(t.push("..."),t.push(
|
|
148
|
+
${s.comment}`:n.comment}n=i}r.items[t]=Fm.isPair(n)?n:new Dw.Pair(n)}}else e("Expected a sequence for this tag");return r}function kk(r,e,t){let{replacer:n}=t,i=new PJ.YAMLSeq(r);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let l,f;if(Array.isArray(a))if(a.length===2)l=a[0],f=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let d=Object.keys(a);if(d.length===1)l=d[0],f=a[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=a;i.items.push(Dw.createPair(l,f,t))}return i}var kJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Pk,createNode:kk};Lm.createPairs=kk;Lm.pairs=kJ;Lm.resolvePairs=Pk});var jw=F(Lw=>{"use strict";var Tk=Je(),Fw=Ks(),Kf=ro(),TJ=no(),qk=jm(),Sa=class r extends TJ.YAMLSeq{constructor(){super(),this.add=Kf.YAMLMap.prototype.add.bind(this),this.delete=Kf.YAMLMap.prototype.delete.bind(this),this.get=Kf.YAMLMap.prototype.get.bind(this),this.has=Kf.YAMLMap.prototype.has.bind(this),this.set=Kf.YAMLMap.prototype.set.bind(this),this.tag=r.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let s,a;if(Tk.isPair(i)?(s=Fw.toJS(i.key,"",t),a=Fw.toJS(i.value,s,t)):s=Fw.toJS(i,"",t),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,t,n){let i=qk.createPairs(e,t,n),s=new this;return s.items=i.items,s}};Sa.tag="tag:yaml.org,2002:omap";var qJ={collection:"seq",identify:r=>r instanceof Map,nodeClass:Sa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(r,e){let t=qk.resolvePairs(r,e),n=[];for(let{key:i}of t.items)Tk.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Sa,t)},createNode:(r,e,t)=>Sa.from(r,e,t)};Lw.YAMLOMap=Sa;Lw.omap=qJ});var Dk=F(Uw=>{"use strict";var Ak=jt();function $k({value:r,source:e},t){return e&&(r?Mk:Nk).test.test(e)?e:r?t.options.trueStr:t.options.falseStr}var Mk={identify:r=>r===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ak.Scalar(!0),stringify:$k},Nk={identify:r=>r===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ak.Scalar(!1),stringify:$k};Uw.falseTag=Nk;Uw.trueTag=Mk});var Fk=F(Um=>{"use strict";var AJ=jt(),Hw=uu(),$J={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Hw.stringifyNumber},MJ={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r.replace(/_/g,"")),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():Hw.stringifyNumber(r)}},NJ={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(r){let e=new AJ.Scalar(parseFloat(r.replace(/_/g,""))),t=r.indexOf(".");if(t!==-1){let n=r.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Hw.stringifyNumber};Um.float=NJ;Um.floatExp=MJ;Um.floatNaN=$J});var jk=F(Zf=>{"use strict";var Lk=uu(),Qf=r=>typeof r=="bigint"||Number.isInteger(r);function Hm(r,e,t,{intAsBigInt:n}){let i=r[0];if((i==="-"||i==="+")&&(e+=1),r=r.substring(e).replace(/_/g,""),n){switch(t){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let a=BigInt(r);return i==="-"?BigInt(-1)*a:a}let s=parseInt(r,t);return i==="-"?-1*s:s}function Bw(r,e,t){let{value:n}=r;if(Qf(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return Lk.stringifyNumber(r)}var DJ={identify:Qf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(r,e,t)=>Hm(r,2,2,t),stringify:r=>Bw(r,2,"0b")},FJ={identify:Qf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(r,e,t)=>Hm(r,1,8,t),stringify:r=>Bw(r,8,"0")},LJ={identify:Qf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(r,e,t)=>Hm(r,0,10,t),stringify:Lk.stringifyNumber},jJ={identify:Qf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(r,e,t)=>Hm(r,2,16,t),stringify:r=>Bw(r,16,"0x")};Zf.int=LJ;Zf.intBin=DJ;Zf.intHex=jJ;Zf.intOct=FJ});var Ww=F(Vw=>{"use strict";var Wm=Je(),Bm=eo(),Vm=ro(),wa=class r extends Vm.YAMLMap{constructor(e){super(e),this.tag=r.tag}add(e){let t;Wm.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Bm.Pair(e.key,null):t=new Bm.Pair(e,null),Vm.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Vm.findPair(this.items,e);return!t&&Wm.isPair(n)?Wm.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Vm.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Bm.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof i=="function"&&(a=i.call(t,a,a)),s.items.push(Bm.createPair(a,null,n));return s}};wa.tag="tag:yaml.org,2002:set";var UJ={collection:"map",identify:r=>r instanceof Set,nodeClass:wa,default:!1,tag:"tag:yaml.org,2002:set",createNode:(r,e,t)=>wa.from(r,e,t),resolve(r,e){if(Wm.isMap(r)){if(r.hasAllNullValues(!0))return Object.assign(new wa,r);e("Set items must all have null values")}else e("Expected a mapping for this tag");return r}};Vw.YAMLSet=wa;Vw.set=UJ});var Jw=F(zm=>{"use strict";var HJ=uu();function zw(r,e){let t=r[0],n=t==="-"||t==="+"?r.substring(1):r,i=a=>e?BigInt(a):Number(a),s=n.replace(/_/g,"").split(":").reduce((a,l)=>a*i(60)+i(l),i(0));return t==="-"?i(-1)*s:s}function Uk(r){let{value:e}=r,t=a=>a;if(typeof e=="bigint")t=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return HJ.stringifyNumber(r);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var BJ={identify:r=>typeof r=="bigint"||Number.isInteger(r),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(r,e,{intAsBigInt:t})=>zw(r,t),stringify:Uk},VJ={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:r=>zw(r,!1),stringify:Uk},Hk={identify:r=>r instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(r){let e=r.match(Hk.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,s,a,l]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(t,n-1,i,s||0,a||0,l||0,f),h=e[8];if(h&&h!=="Z"){let g=zw(h,!1);Math.abs(g)<30&&(g*=60),d-=6e4*g}return new Date(d)},stringify:({value:r})=>r?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};zm.floatTime=VJ;zm.intTime=BJ;zm.timestamp=Hk});var Wk=F(Vk=>{"use strict";var WJ=au(),zJ=Am(),JJ=lu(),GJ=Gf(),YJ=Nw(),Bk=Dk(),Gw=Fk(),Jm=jk(),KJ=xm(),QJ=jw(),ZJ=jm(),XJ=Ww(),Yw=Jw(),eG=[WJ.map,JJ.seq,GJ.string,zJ.nullTag,Bk.trueTag,Bk.falseTag,Jm.intBin,Jm.intOct,Jm.int,Jm.intHex,Gw.floatNaN,Gw.floatExp,Gw.float,YJ.binary,KJ.merge,QJ.omap,ZJ.pairs,XJ.set,Yw.intTime,Yw.floatTime,Yw.timestamp];Vk.schema=eG});var tT=F(Zw=>{"use strict";var Yk=au(),tG=Am(),Kk=lu(),rG=Gf(),nG=Iw(),Kw=kw(),Qw=qw(),iG=Ck(),sG=Ok(),Qk=Nw(),Xf=xm(),Zk=jw(),Xk=jm(),zk=Wk(),eT=Ww(),Gm=Jw(),Jk=new Map([["core",iG.schema],["failsafe",[Yk.map,Kk.seq,rG.string]],["json",sG.schema],["yaml11",zk.schema],["yaml-1.1",zk.schema]]),Gk={binary:Qk.binary,bool:nG.boolTag,float:Kw.float,floatExp:Kw.floatExp,floatNaN:Kw.floatNaN,floatTime:Gm.floatTime,int:Qw.int,intHex:Qw.intHex,intOct:Qw.intOct,intTime:Gm.intTime,map:Yk.map,merge:Xf.merge,null:tG.nullTag,omap:Zk.omap,pairs:Xk.pairs,seq:Kk.seq,set:eT.set,timestamp:Gm.timestamp},oG={"tag:yaml.org,2002:binary":Qk.binary,"tag:yaml.org,2002:merge":Xf.merge,"tag:yaml.org,2002:omap":Zk.omap,"tag:yaml.org,2002:pairs":Xk.pairs,"tag:yaml.org,2002:set":eT.set,"tag:yaml.org,2002:timestamp":Gm.timestamp};function aG(r,e,t){let n=Jk.get(e);if(n&&!r)return t&&!n.includes(Xf.merge)?n.concat(Xf.merge):n.slice();let i=n;if(!i)if(Array.isArray(r))i=[];else{let s=Array.from(Jk.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(r))for(let s of r)i=i.concat(s);else typeof r=="function"&&(i=r(i.slice()));return t&&(i=i.concat(Xf.merge)),i.reduce((s,a)=>{let l=typeof a=="string"?Gk[a]:a;if(!l){let f=JSON.stringify(a),d=Object.keys(Gk).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}Zw.coreKnownTags=oG;Zw.getTags=aG});var t_=F(rT=>{"use strict";var Xw=Je(),lG=au(),uG=lu(),cG=Gf(),Ym=tT(),fG=(r,e)=>r.key<e.key?-1:r.key>e.key?1:0,e_=class r{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(e)?Ym.getTags(e,"compat"):e?Ym.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Ym.coreKnownTags:{},this.tags=Ym.getTags(t,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Xw.MAP,{value:lG.map}),Object.defineProperty(this,Xw.SCALAR,{value:cG.string}),Object.defineProperty(this,Xw.SEQ,{value:uG.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?fG:null}clone(){let e=Object.create(r.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};rT.Schema=e_});var iT=F(nT=>{"use strict";var dG=Je(),r_=Wf(),ed=Uf();function pG(r,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&r.directives){let f=r.directives.toString(r);f?(t.push(f),n=!0):r.directives.docStart&&(n=!0)}n&&t.push("---");let i=r_.createStringifyContext(r,e),{commentString:s}=i.options;if(r.commentBefore){t.length!==1&&t.unshift("");let f=s(r.commentBefore);t.unshift(ed.indentComment(f,""))}let a=!1,l=null;if(r.contents){if(dG.isNode(r.contents)){if(r.contents.spaceBefore&&n&&t.push(""),r.contents.commentBefore){let h=s(r.contents.commentBefore);t.push(ed.indentComment(h,""))}i.forceBlockIndent=!!r.comment,l=r.contents.comment}let f=l?void 0:()=>a=!0,d=r_.stringify(r.contents,i,()=>l=null,f);l&&(d+=ed.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${d}`:t.push(d)}else t.push(r_.stringify(r.contents,i));if(r.directives?.docEnd)if(r.comment){let f=s(r.comment);f.includes(`
|
|
149
|
+
`)?(t.push("..."),t.push(ed.indentComment(f,""))):t.push(`... ${f}`)}else t.push("...");else{let f=r.comment;f&&a&&(f=f.replace(/^\n+/,"")),f&&((!a||l)&&t[t.length-1]!==""&&t.push(""),t.push(ed.indentComment(s(f),"")))}return t.join(`
|
|
150
150
|
`)+`
|
|
151
|
-
`}nT.stringifyDocument=pG});var
|
|
151
|
+
`}nT.stringifyDocument=pG});var td=F(sT=>{"use strict";var hG=Lf(),cu=mm(),En=Je(),mG=eo(),gG=Ks(),yG=t_(),vG=iT(),n_=fm(),bG=aw(),SG=jf(),i_=ow(),s_=class r{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,En.NODE_TYPE,{value:En.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:a}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new i_.Directives({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(r.prototype,{[En.NODE_TYPE]:{value:En.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=En.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){fu(this.contents)&&this.contents.add(e)}addIn(e,t){fu(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=n_.anchorNames(this);e.anchor=!t||n.has(t)?n_.findNewAnchor(t||"a",n):t}return new hG.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let I=j=>typeof j=="number"||j instanceof String||j instanceof Number,q=t.filter(I).map(String);q.length>0&&(t=t.concat(q)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:l,keepUndefined:f,onTagObj:d,tag:h}=n??{},{onAnchor:g,setAnchors:y,sourceObjects:S}=n_.createNodeAnchors(this,a||"a"),_={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:g,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:S},R=SG.createNode(e,h,_);return l&&En.isCollection(R)&&(R.flow=!0),y(),R}createPair(e,t,n={}){let i=this.createNode(e,null,n),s=this.createNode(t,null,n);return new mG.Pair(i,s)}delete(e){return fu(this.contents)?this.contents.delete(e):!1}deleteIn(e){return cu.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):fu(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return En.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return cu.isEmptyPath(e)?!t&&En.isScalar(this.contents)?this.contents.value:this.contents:En.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return En.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return cu.isEmptyPath(e)?this.contents!==void 0:En.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=cu.collectionFromPath(this.schema,[e],t):fu(this.contents)&&this.contents.set(e,t)}setIn(e,t){cu.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=cu.collectionFromPath(this.schema,Array.from(e),t):fu(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new i_.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new i_.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new yG.Schema(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:a}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=gG.toJS(this.contents,t??"",l);if(typeof s=="function")for(let{count:d,res:h}of l.anchors.values())s(h,d);return typeof a=="function"?bG.applyReviver(a,{"":f},"",f):f}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return vG.stringifyDocument(this,e)}};function fu(r){if(En.isCollection(r))return!0;throw new Error("Expected a YAML collection as document contents")}sT.Document=s_});var id=F(nd=>{"use strict";var rd=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},o_=class extends rd{constructor(e,t,n){super("YAMLParseError",e,t,n)}},a_=class extends rd{constructor(e,t,n){super("YAMLWarning",e,t,n)}},wG=(r,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(l=>e.linePos(l));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let s=i-1,a=r.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let l=Math.min(s-39,a.length-79);a="\u2026"+a.substring(l),s-=l-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(a.substring(0,s))){let l=r.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
|
|
152
152
|
`),a=l+a}if(/[^ ]/.test(a)){let l=1,f=t.linePos[1];f?.line===n&&f.col>i&&(l=Math.max(1,Math.min(f.col-i,80-s)));let d=" ".repeat(s)+"^".repeat(l);t.message+=`:
|
|
153
153
|
|
|
154
154
|
${a}
|
|
155
155
|
${d}
|
|
156
|
-
`}};
|
|
157
|
-
`))return!0;if(r.end){for(let e of r.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of r.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(l_(e.key)||l_(e.value))return!0}return!1;default:return!0}}aT.containsNewline=l_});var u_=F(lT=>{"use strict";var RG=
|
|
158
|
-
`+R.comment:l.comment=R.comment);continue}(R.newlineAfterProp||OG.containsNewline(y))&&i(y??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else R.found?.indent!==n.indent&&i(f,"BAD_INDENT",hT);t.atKey=!0;let q=R.end,
|
|
159
|
-
`+B.comment:
|
|
160
|
-
`+X.comment:d.comment=X.comment),g=X.end;continue}!a&&t.options.strict&&LG.containsNewline(B)&&i(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(I===0)X.comma&&i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(X.comma||i(X.start,"MISSING_CHAR",`Missing , between ${l} items`),X.comment){let T="";e:for(let C of
|
|
161
|
-
`+T:C.comment=T,X.comment=X.comment.substring(T.length+1)}}if(!a&&!V&&!X.found){let T=W?r(t,W,X,i):e(t,X.end,V,null,X,i);d.items.push(T),g=T.range[2],d_(W)&&i(T.range,"BLOCK_IN_FLOW",f_)}else{t.atKey=!0;let T=X.end,C=B?r(t,B,X,i):e(t,T,
|
|
162
|
-
`+k.comment:C.comment=k.comment);let
|
|
156
|
+
`}};nd.YAMLError=rd;nd.YAMLParseError=o_;nd.YAMLWarning=a_;nd.prettifyError=wG});var sd=F(oT=>{"use strict";function _G(r,{flow:e,indicator:t,next:n,offset:i,onError:s,parentIndent:a,startOnNewline:l}){let f=!1,d=l,h=l,g="",y="",S=!1,_=!1,R=null,I=null,q=null,j=null,B=null,V=null,W=null;for(let C of r)switch(_&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&s(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_=!1),R&&(d&&C.type!=="comment"&&C.type!=="newline"&&s(R,"TAB_AS_INDENT","Tabs are not allowed as indentation"),R=null),C.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&C.source.includes(" ")&&(R=C),h=!0;break;case"comment":{h||s(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let k=C.source.substring(1)||" ";g?g+=y+k:g=k,y="",d=!1;break}case"newline":d?g?g+=C.source:(!V||t!=="seq-item-ind")&&(f=!0):y+=C.source,d=!0,S=!0,(I||q)&&(j=C),h=!0;break;case"anchor":I&&s(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&s(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),I=C,W??(W=C.offset),d=!1,h=!1,_=!0;break;case"tag":{q&&s(C,"MULTIPLE_TAGS","A node can have at most one tag"),q=C,W??(W=C.offset),d=!1,h=!1,_=!0;break}case t:(I||q)&&s(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),V&&s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${e??"collection"}`),V=C,d=t==="seq-item-ind"||t==="explicit-key-ind",h=!1;break;case"comma":if(e){B&&s(C,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),B=C,d=!1,h=!1;break}default:s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),d=!1,h=!1}let X=r[r.length-1],T=X?X.offset+X.source.length:i;return _&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),R&&(d&&R.indent<=a||n?.type==="block-map"||n?.type==="block-seq")&&s(R,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:B,found:V,spaceBefore:f,comment:g,hasNewline:S,anchor:I,tag:q,newlineAfterProp:j,end:T,start:W??T}}oT.resolveProps=_G});var Km=F(aT=>{"use strict";function l_(r){if(!r)return null;switch(r.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(r.source.includes(`
|
|
157
|
+
`))return!0;if(r.end){for(let e of r.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of r.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(l_(e.key)||l_(e.value))return!0}return!1;default:return!0}}aT.containsNewline=l_});var u_=F(lT=>{"use strict";var RG=Km();function CG(r,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===r&&(n.source==="]"||n.source==="}")&&RG.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}lT.flowIndentCheck=CG});var c_=F(cT=>{"use strict";var uT=Je();function xG(r,e,t){let{uniqueKeys:n}=r.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,a)=>s===a||uT.isScalar(s)&&uT.isScalar(a)&&s.value===a.value;return e.some(s=>i(s.key,t))}cT.mapIncludes=xG});var gT=F(mT=>{"use strict";var fT=eo(),EG=ro(),dT=sd(),OG=Km(),pT=u_(),IG=c_(),hT="All mapping items must start at the same column";function PG({composeNode:r,composeEmptyNode:e},t,n,i,s){let a=s?.nodeClass??EG.YAMLMap,l=new a(t.schema);t.atRoot&&(t.atRoot=!1);let f=n.offset,d=null;for(let h of n.items){let{start:g,key:y,sep:S,value:_}=h,R=dT.resolveProps(g,{indicator:"explicit-key-ind",next:y??S?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0}),I=!R.found;if(I){if(y&&(y.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==n.indent&&i(f,"BAD_INDENT",hT)),!R.anchor&&!R.tag&&!S){d=R.end,R.comment&&(l.comment?l.comment+=`
|
|
158
|
+
`+R.comment:l.comment=R.comment);continue}(R.newlineAfterProp||OG.containsNewline(y))&&i(y??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else R.found?.indent!==n.indent&&i(f,"BAD_INDENT",hT);t.atKey=!0;let q=R.end,j=y?r(t,y,R,i):e(t,q,g,null,R,i);t.schema.compat&&pT.flowIndentCheck(n.indent,y,i),t.atKey=!1,IG.mapIncludes(t,l.items,j)&&i(q,"DUPLICATE_KEY","Map keys must be unique");let B=dT.resolveProps(S??[],{indicator:"map-value-ind",next:_,offset:j.range[2],onError:i,parentIndent:n.indent,startOnNewline:!y||y.type==="block-scalar"});if(f=B.end,B.found){I&&(_?.type==="block-map"&&!B.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&R.start<B.found.offset-1024&&i(j.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let V=_?r(t,_,B,i):e(t,f,S,null,B,i);t.schema.compat&&pT.flowIndentCheck(n.indent,_,i),f=V.range[2];let W=new fT.Pair(j,V);t.options.keepSourceTokens&&(W.srcToken=h),l.items.push(W)}else{I&&i(j.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),B.comment&&(j.comment?j.comment+=`
|
|
159
|
+
`+B.comment:j.comment=B.comment);let V=new fT.Pair(j);t.options.keepSourceTokens&&(V.srcToken=h),l.items.push(V)}}return d&&d<f&&i(d,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,f,d??f],l}mT.resolveBlockMap=PG});var vT=F(yT=>{"use strict";var kG=no(),TG=sd(),qG=u_();function AG({composeNode:r,composeEmptyNode:e},t,n,i,s){let a=s?.nodeClass??kG.YAMLSeq,l=new a(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=n.offset,d=null;for(let{start:h,value:g}of n.items){let y=TG.resolveProps(h,{indicator:"seq-item-ind",next:g,offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||g)g?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{d=y.end,y.comment&&(l.comment=y.comment);continue}let S=g?r(t,g,y,i):e(t,y.end,h,null,y,i);t.schema.compat&&qG.flowIndentCheck(n.indent,g,i),f=S.range[2],l.items.push(S)}return l.range=[n.offset,f,d??f],l}yT.resolveBlockSeq=AG});var du=F(bT=>{"use strict";function $G(r,e,t,n){let i="";if(r){let s=!1,a="";for(let l of r){let{source:f,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{t&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let h=f.substring(1)||" ";i?i+=a+h:i=h,a="";break}case"newline":i&&(a+=f),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=f.length}}return{comment:i,offset:e}}bT.resolveEnd=$G});var RT=F(_T=>{"use strict";var MG=Je(),NG=eo(),ST=ro(),DG=no(),FG=du(),wT=sd(),LG=Km(),jG=c_(),f_="Block collections are not allowed within flow collections",d_=r=>r&&(r.type==="block-map"||r.type==="block-seq");function UG({composeNode:r,composeEmptyNode:e},t,n,i,s){let a=n.start.source==="{",l=a?"flow map":"flow sequence",f=s?.nodeClass??(a?ST.YAMLMap:DG.YAMLSeq),d=new f(t.schema);d.flow=!0;let h=t.atRoot;h&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let g=n.offset+n.start.source.length;for(let I=0;I<n.items.length;++I){let q=n.items[I],{start:j,key:B,sep:V,value:W}=q,X=wT.resolveProps(j,{flow:l,indicator:"explicit-key-ind",next:B??V?.[0],offset:g,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!X.found){if(!X.anchor&&!X.tag&&!V&&!W){I===0&&X.comma?i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):I<n.items.length-1&&i(X.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),X.comment&&(d.comment?d.comment+=`
|
|
160
|
+
`+X.comment:d.comment=X.comment),g=X.end;continue}!a&&t.options.strict&&LG.containsNewline(B)&&i(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(I===0)X.comma&&i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(X.comma||i(X.start,"MISSING_CHAR",`Missing , between ${l} items`),X.comment){let T="";e:for(let C of j)switch(C.type){case"comma":case"space":break;case"comment":T=C.source.substring(1);break e;default:break e}if(T){let C=d.items[d.items.length-1];MG.isPair(C)&&(C=C.value??C.key),C.comment?C.comment+=`
|
|
161
|
+
`+T:C.comment=T,X.comment=X.comment.substring(T.length+1)}}if(!a&&!V&&!X.found){let T=W?r(t,W,X,i):e(t,X.end,V,null,X,i);d.items.push(T),g=T.range[2],d_(W)&&i(T.range,"BLOCK_IN_FLOW",f_)}else{t.atKey=!0;let T=X.end,C=B?r(t,B,X,i):e(t,T,j,null,X,i);d_(B)&&i(C.range,"BLOCK_IN_FLOW",f_),t.atKey=!1;let k=wT.resolveProps(V??[],{flow:l,indicator:"map-value-ind",next:W,offset:C.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(k.found){if(!a&&!X.found&&t.options.strict){if(V)for(let $ of V){if($===k.found)break;if($.type==="newline"){i($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}X.start<k.found.offset-1024&&i(k.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else W&&("source"in W&&W.source?.[0]===":"?i(W,"MISSING_CHAR",`Missing space after : in ${l}`):i(k.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let N=W?r(t,W,k,i):k.found?e(t,k.end,V,null,k,i):null;N?d_(W)&&i(N.range,"BLOCK_IN_FLOW",f_):k.comment&&(C.comment?C.comment+=`
|
|
162
|
+
`+k.comment:C.comment=k.comment);let U=new NG.Pair(C,N);if(t.options.keepSourceTokens&&(U.srcToken=q),a){let $=d;jG.mapIncludes(t,$.items,C)&&i(T,"DUPLICATE_KEY","Map keys must be unique"),$.items.push(U)}else{let $=new ST.YAMLMap(t.schema);$.flow=!0,$.items.push(U);let G=(N??C).range;$.range=[C.range[0],G[1],G[2]],d.items.push($)}g=N?N.range[2]:k.end}}let y=a?"}":"]",[S,..._]=n.end,R=g;if(S?.source===y)R=S.offset+S.source.length;else{let I=l[0].toUpperCase()+l.substring(1),q=h?`${I} must end with a ${y}`:`${I} in block collection must be sufficiently indented and end with a ${y}`;i(g,h?"MISSING_CHAR":"BAD_INDENT",q),S&&S.source.length!==1&&_.unshift(S)}if(_.length>0){let I=FG.resolveEnd(_,R,t.options.strict,i);I.comment&&(d.comment?d.comment+=`
|
|
163
163
|
`+I.comment:d.comment=I.comment),d.range=[n.offset,R,I.offset]}else d.range=[n.offset,R,R];return d}_T.resolveFlowCollection=UG});var xT=F(CT=>{"use strict";var HG=Je(),BG=jt(),VG=ro(),WG=no(),zG=gT(),JG=vT(),GG=RT();function p_(r,e,t,n,i,s){let a=t.type==="block-map"?zG.resolveBlockMap(r,e,t,n,s):t.type==="block-seq"?JG.resolveBlockSeq(r,e,t,n,s):GG.resolveFlowCollection(r,e,t,n,s),l=a.constructor;return i==="!"||i===l.tagName?(a.tag=l.tagName,a):(i&&(a.tag=i),a)}function YG(r,e,t,n,i){let s=n.tag,a=s?e.directives.tagName(s.source,y=>i(s,"TAG_RESOLVE_FAILED",y)):null;if(t.type==="block-seq"){let{anchor:y,newlineAfterProp:S}=n,_=y&&s?y.offset>s.offset?y:s:y??s;_&&(!S||S.offset<_.offset)&&i(_,"MISSING_CHAR","Missing newline after block sequence props")}let l=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===VG.YAMLMap.tagName&&l==="map"||a===WG.YAMLSeq.tagName&&l==="seq")return p_(r,e,t,i,a);let f=e.schema.tags.find(y=>y.tag===a&&y.collection===l);if(!f){let y=e.schema.knownTags[a];if(y?.collection===l)e.schema.tags.push(Object.assign({},y,{default:!1})),f=y;else return y?i(s,"BAD_COLLECTION_TYPE",`${y.tag} used for ${l} collection, but expects ${y.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),p_(r,e,t,i,a)}let d=p_(r,e,t,i,a,f),h=f.resolve?.(d,y=>i(s,"TAG_RESOLVE_FAILED",y),e.options)??d,g=HG.isNode(h)?h:new BG.Scalar(h);return g.range=d.range,g.tag=a,f?.format&&(g.format=f.format),g}CT.composeCollection=YG});var m_=F(ET=>{"use strict";var h_=jt();function KG(r,e,t){let n=e.offset,i=QG(e,r.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?h_.Scalar.BLOCK_FOLDED:h_.Scalar.BLOCK_LITERAL,a=e.source?ZG(e.source):[],l=a.length;for(let R=a.length-1;R>=0;--R){let I=a[R][1];if(I===""||I==="\r")l=R;else break}if(l===0){let R=i.chomp==="+"&&a.length>0?`
|
|
164
164
|
`.repeat(Math.max(1,a.length-1)):"",I=n+i.length;return e.source&&(I+=e.source.length),{value:R,type:s,comment:i.comment,range:[n,I,I]}}let f=e.indent+i.indent,d=e.offset+i.length,h=0;for(let R=0;R<l;++R){let[I,q]=a[R];if(q===""||q==="\r")i.indent===0&&I.length>f&&(f=I.length);else{I.length<f&&t(d+I.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=I.length),h=R,f===0&&!r.atRoot&&t(d,"BAD_INDENT","Block scalar values in collections must be indented");break}d+=I.length+q.length+1}for(let R=a.length-1;R>=l;--R)a[R][0].length>f&&(l=R+1);let g="",y="",S=!1;for(let R=0;R<h;++R)g+=a[R][0].slice(f)+`
|
|
165
|
-
`;for(let R=h;R<l;++R){let[I,q]=a[R];d+=I.length+q.length+1;let
|
|
165
|
+
`;for(let R=h;R<l;++R){let[I,q]=a[R];d+=I.length+q.length+1;let j=q[q.length-1]==="\r";if(j&&(q=q.slice(0,-1)),q&&I.length<f){let V=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(d-q.length-(j?2:1),"BAD_INDENT",V),I=""}s===h_.Scalar.BLOCK_LITERAL?(g+=y+I.slice(f)+q,y=`
|
|
166
166
|
`):I.length>f||q[0]===" "?(y===" "?y=`
|
|
167
167
|
`:!S&&y===`
|
|
168
168
|
`&&(y=`
|
|
@@ -190,14 +190,14 @@ ${d}
|
|
|
190
190
|
`);)n===`
|
|
191
191
|
`&&(t+=`
|
|
192
192
|
`),e+=1,n=r[e+1];return t||(t=" "),{fold:t,offset:e}}var sY={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
193
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function oY(r,e,t,n){let i=r.substr(e,t),a=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let l=r.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}IT.resolveFlowScalar=eY});var TT=F(kT=>{"use strict";var _a=Je(),PT=jt(),aY=m_(),lY=y_();function uY(r,e,t,n){let{value:i,type:s,comment:a,range:l}=e.type==="block-scalar"?aY.resolveBlockScalar(r,e,n):lY.resolveFlowScalar(e,r.options.strict,n),f=t?r.directives.tagName(t.source,g=>n(t,"TAG_RESOLVE_FAILED",g)):null,d;r.options.stringKeys&&r.atKey?d=r.schema[_a.SCALAR]:f?d=cY(r.schema,i,f,t,n):e.type==="scalar"?d=fY(r,i,e,n):d=r.schema[_a.SCALAR];let h;try{let g=d.resolve(i,y=>n(t??e,"TAG_RESOLVE_FAILED",y),r.options);h=_a.isScalar(g)?g:new PT.Scalar(g)}catch(g){let y=g instanceof Error?g.message:String(g);n(t??e,"TAG_RESOLVE_FAILED",y),h=new PT.Scalar(i)}return h.range=l,h.source=i,s&&(h.type=s),f&&(h.tag=f),d.format&&(h.format=d.format),a&&(h.comment=a),h}function cY(r,e,t,n,i){if(t==="!")return r[_a.SCALAR];let s=[];for(let l of r.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let a=r.knownTags[t];return a&&!a.collection?(r.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),r[_a.SCALAR])}function fY({atKey:r,directives:e,schema:t},n,i,s){let a=t.tags.find(l=>(l.default===!0||r&&l.default==="key")&&l.test?.test(n))||t[_a.SCALAR];if(t.compat){let l=t.compat.find(f=>f.default&&f.test?.test(n))??t[_a.SCALAR];if(a.tag!==l.tag){let f=e.tagString(a.tag),d=e.tagString(l.tag),h=`Value may be parsed as either ${f} or ${d}`;s(i,"TAG_RESOLVE_FAILED",h,!0)}}return a}kT.composeScalar=uY});var AT=F(qT=>{"use strict";function dY(r,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":r-=i.source.length;continue}for(i=e[++n];i?.type==="space";)r+=i.source.length,i=e[++n];break}}return r}qT.emptyScalarPosition=dY});var NT=F(b_=>{"use strict";var pY=
|
|
193
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function oY(r,e,t,n){let i=r.substr(e,t),a=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let l=r.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}IT.resolveFlowScalar=eY});var TT=F(kT=>{"use strict";var _a=Je(),PT=jt(),aY=m_(),lY=y_();function uY(r,e,t,n){let{value:i,type:s,comment:a,range:l}=e.type==="block-scalar"?aY.resolveBlockScalar(r,e,n):lY.resolveFlowScalar(e,r.options.strict,n),f=t?r.directives.tagName(t.source,g=>n(t,"TAG_RESOLVE_FAILED",g)):null,d;r.options.stringKeys&&r.atKey?d=r.schema[_a.SCALAR]:f?d=cY(r.schema,i,f,t,n):e.type==="scalar"?d=fY(r,i,e,n):d=r.schema[_a.SCALAR];let h;try{let g=d.resolve(i,y=>n(t??e,"TAG_RESOLVE_FAILED",y),r.options);h=_a.isScalar(g)?g:new PT.Scalar(g)}catch(g){let y=g instanceof Error?g.message:String(g);n(t??e,"TAG_RESOLVE_FAILED",y),h=new PT.Scalar(i)}return h.range=l,h.source=i,s&&(h.type=s),f&&(h.tag=f),d.format&&(h.format=d.format),a&&(h.comment=a),h}function cY(r,e,t,n,i){if(t==="!")return r[_a.SCALAR];let s=[];for(let l of r.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let a=r.knownTags[t];return a&&!a.collection?(r.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),r[_a.SCALAR])}function fY({atKey:r,directives:e,schema:t},n,i,s){let a=t.tags.find(l=>(l.default===!0||r&&l.default==="key")&&l.test?.test(n))||t[_a.SCALAR];if(t.compat){let l=t.compat.find(f=>f.default&&f.test?.test(n))??t[_a.SCALAR];if(a.tag!==l.tag){let f=e.tagString(a.tag),d=e.tagString(l.tag),h=`Value may be parsed as either ${f} or ${d}`;s(i,"TAG_RESOLVE_FAILED",h,!0)}}return a}kT.composeScalar=uY});var AT=F(qT=>{"use strict";function dY(r,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":r-=i.source.length;continue}for(i=e[++n];i?.type==="space";)r+=i.source.length,i=e[++n];break}}return r}qT.emptyScalarPosition=dY});var NT=F(b_=>{"use strict";var pY=Lf(),hY=Je(),mY=xT(),$T=TT(),gY=du(),yY=AT(),vY={composeNode:MT,composeEmptyNode:v_};function MT(r,e,t,n){let i=r.atKey,{spaceBefore:s,comment:a,anchor:l,tag:f}=t,d,h=!0;switch(e.type){case"alias":d=bY(r,e,n),(l||f)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=$T.composeScalar(r,e,f,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=mY.composeCollection(vY,r,e,t,n),l&&(d.anchor=l.source.substring(1))}catch(g){let y=g instanceof Error?g.message:String(g);n(e,"RESOURCE_EXHAUSTION",y)}break;default:{let g=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",g),h=!1}}return d??(d=v_(r,e.offset,void 0,null,t,n)),l&&d.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&r.options.stringKeys&&(!hY.isScalar(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&n(f??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(d.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?d.comment=a:d.commentBefore=a),r.options.keepSourceTokens&&h&&(d.srcToken=e),d}function v_(r,e,t,n,{spaceBefore:i,comment:s,anchor:a,tag:l,end:f},d){let h={type:"scalar",offset:yY.emptyScalarPosition(e,t,n),indent:-1,source:""},g=$T.composeScalar(r,h,l,d);return a&&(g.anchor=a.source.substring(1),g.anchor===""&&d(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(g.spaceBefore=!0),s&&(g.comment=s,g.range[2]=f),g}function bY({options:r},{offset:e,source:t,end:n},i){let s=new pY.Alias(t.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=e+t.length,l=gY.resolveEnd(n,a,r.strict,i);return s.range=[e,a,l.offset],l.comment&&(s.comment=l.comment),s}b_.composeEmptyNode=v_;b_.composeNode=MT});var LT=F(FT=>{"use strict";var SY=td(),DT=NT(),wY=du(),_Y=sd();function RY(r,e,{offset:t,start:n,value:i,end:s},a){let l=Object.assign({_directives:e},r),f=new SY.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},h=_Y.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:t,onError:a,parentIndent:0,startOnNewline:!0});h.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!h.hasNewline&&a(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?DT.composeNode(d,i,h,a):DT.composeEmptyNode(d,h.end,n,null,h,a);let g=f.contents.range[2],y=wY.resolveEnd(s,g,!1,a);return y.comment&&(f.comment=y.comment),f.range=[t,g,y.offset],f}FT.composeDoc=RY});var w_=F(HT=>{"use strict";var CY=it("process"),xY=ow(),EY=td(),od=id(),jT=Je(),OY=LT(),IY=du();function ad(r){if(typeof r=="number")return[r,r+1];if(Array.isArray(r))return r.length===2?r:[r[0],r[1]];let{offset:e,source:t}=r;return[e,e+(typeof t=="string"?t.length:1)]}function UT(r){let e="",t=!1,n=!1;for(let i=0;i<r.length;++i){let s=r[i];switch(s[0]){case"#":e+=(e===""?"":n?`
|
|
194
194
|
|
|
195
195
|
`:`
|
|
196
|
-
`)+(s.substring(1)||" "),t=!0,n=!1;break;case"%":r[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var S_=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,s)=>{let a=
|
|
196
|
+
`)+(s.substring(1)||" "),t=!0,n=!1;break;case"%":r[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var S_=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,s)=>{let a=ad(t);s?this.warnings.push(new od.YAMLWarning(a,n,i)):this.errors.push(new od.YAMLParseError(a,n,i))},this.directives=new xY.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=UT(this.prelude);if(n){let s=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
197
197
|
${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(jT.isCollection(s)&&!s.flow&&s.items.length>0){let a=s.items[0];jT.isPair(a)&&(a=a.key);let l=a.commentBefore;a.commentBefore=l?`${n}
|
|
198
198
|
${l}`:n}else{let a=s.commentBefore;s.commentBefore=a?`${n}
|
|
199
|
-
${a}`:n}}if(t){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:UT(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(CY.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let s=
|
|
200
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
199
|
+
${a}`:n}}if(t){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:UT(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(CY.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let s=ad(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=OY.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new od.YAMLParseError(ad(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new od.YAMLParseError(ad(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=IY.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
200
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new od.YAMLParseError(ad(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new EY.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};HT.Composer=S_});var WT=F(Qm=>{"use strict";var PY=m_(),kY=y_(),TY=id(),BT=Vf();function qY(r,e=!0,t){if(r){let n=(i,s,a)=>{let l=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(l,s,a);else throw new TY.YAMLParseError([l,l+1],s,a)};switch(r.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return kY.resolveFlowScalar(r,e,n);case"block-scalar":return PY.resolveBlockScalar({options:{strict:e}},r,n)}}return null}function AY(r,e){let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=e,l=BT.stringifyString({type:a,value:r},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),f=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
201
201
|
`}];switch(l[0]){case"|":case">":{let d=l.indexOf(`
|
|
202
202
|
`),h=l.substring(0,d),g=l.substring(d+1)+`
|
|
203
203
|
`,y=[{type:"block-scalar-header",offset:s,indent:n,source:h}];return VT(y,f)||y.push({type:"newline",offset:-1,indent:n,source:`
|
|
@@ -205,61 +205,61 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
205
205
|
`),n=e.substring(0,t),i=e.substring(t+1)+`
|
|
206
206
|
`;if(r.type==="block-scalar"){let s=r.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,r.source=i}else{let{offset:s}=r,a="indent"in r?r.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:a,source:n}];VT(l,"end"in r?r.end:void 0)||l.push({type:"newline",offset:-1,indent:a,source:`
|
|
207
207
|
`});for(let f of Object.keys(r))f!=="type"&&f!=="offset"&&delete r[f];Object.assign(r,{type:"block-scalar",indent:a,props:l,source:i})}}function VT(r,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":r.push(t);break;case"newline":return r.push(t),!0}return!1}function __(r,e,t){switch(r.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":r.type=t,r.source=e;break;case"block-scalar":{let n=r.props.slice(1),i=e.length;r.props[0].type==="block-scalar-header"&&(i-=r.props[0].source.length);for(let s of n)s.offset+=i;delete r.props,Object.assign(r,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:r.offset+e.length,indent:r.indent,source:`
|
|
208
|
-
`};delete r.items,Object.assign(r,{type:t,source:e,end:[i]});break}default:{let n="indent"in r?r.indent:-1,i="end"in r&&Array.isArray(r.end)?r.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(r))s!=="type"&&s!=="offset"&&delete r[s];Object.assign(r,{type:t,indent:n,source:e,end:i})}}}
|
|
208
|
+
`};delete r.items,Object.assign(r,{type:t,source:e,end:[i]});break}default:{let n="indent"in r?r.indent:-1,i="end"in r&&Array.isArray(r.end)?r.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(r))s!=="type"&&s!=="offset"&&delete r[s];Object.assign(r,{type:t,indent:n,source:e,end:i})}}}Qm.createScalarToken=AY;Qm.resolveAsScalar=qY;Qm.setScalarValue=$Y});var JT=F(zT=>{"use strict";var NY=r=>"type"in r?Xm(r):Zm(r);function Xm(r){switch(r.type){case"block-scalar":{let e="";for(let t of r.props)e+=Xm(t);return e+r.source}case"block-map":case"block-seq":{let e="";for(let t of r.items)e+=Zm(t);return e}case"flow-collection":{let e=r.start.source;for(let t of r.items)e+=Zm(t);for(let t of r.end)e+=t.source;return e}case"document":{let e=Zm(r);if(r.end)for(let t of r.end)e+=t.source;return e}default:{let e=r.source;if("end"in r&&r.end)for(let t of r.end)e+=t.source;return e}}}function Zm({start:r,key:e,sep:t,value:n}){let i="";for(let s of r)i+=s.source;if(e&&(i+=Xm(e)),t)for(let s of t)i+=s.source;return n&&(i+=Xm(n)),i}zT.stringify=NY});var QT=F(KT=>{"use strict";var R_=Symbol("break visit"),DY=Symbol("skip children"),GT=Symbol("remove item");function Ra(r,e){"type"in r&&r.type==="document"&&(r={start:r.start,value:r.value}),YT(Object.freeze([]),r,e)}Ra.BREAK=R_;Ra.SKIP=DY;Ra.REMOVE=GT;Ra.itemAtPath=(r,e)=>{let t=r;for(let[n,i]of e){let s=t?.[n];if(s&&"items"in s)t=s.items[i];else return}return t};Ra.parentCollection=(r,e)=>{let t=Ra.itemAtPath(r,e.slice(0,-1)),n=e[e.length-1][0],i=t?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function YT(r,e,t){let n=t(e,r);if(typeof n=="symbol")return n;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let l=YT(Object.freeze(r.concat([[i,a]])),s.items[a],t);if(typeof l=="number")a=l-1;else{if(l===R_)return R_;l===GT&&(s.items.splice(a,1),a-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,r))}}return typeof n=="function"?n(e,r):n}KT.visit=Ra});var eg=F(Vr=>{"use strict";var C_=WT(),FY=JT(),LY=QT(),x_="\uFEFF",E_="",O_="",I_="",jY=r=>!!r&&"items"in r,UY=r=>!!r&&(r.type==="scalar"||r.type==="single-quoted-scalar"||r.type==="double-quoted-scalar"||r.type==="block-scalar");function HY(r){switch(r){case x_:return"<BOM>";case E_:return"<DOC>";case O_:return"<FLOW_END>";case I_:return"<SCALAR>";default:return JSON.stringify(r)}}function BY(r){switch(r){case x_:return"byte-order-mark";case E_:return"doc-mode";case O_:return"flow-error-end";case I_:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
209
209
|
`:case`\r
|
|
210
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(r[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Vr.createScalarToken=C_.createScalarToken;Vr.resolveAsScalar=C_.resolveAsScalar;Vr.setScalarValue=C_.setScalarValue;Vr.stringify=FY.stringify;Vr.visit=LY.visit;Vr.BOM=x_;Vr.DOCUMENT=E_;Vr.FLOW_END=O_;Vr.SCALAR=I_;Vr.isCollection=jY;Vr.isScalar=UY;Vr.prettyToken=HY;Vr.tokenType=BY});var T_=F(XT=>{"use strict";var
|
|
211
|
-
`:case"\r":case" ":return!0;default:return!1}}var ZT=new Set("0123456789ABCDEFabcdef"),VY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),
|
|
210
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(r[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Vr.createScalarToken=C_.createScalarToken;Vr.resolveAsScalar=C_.resolveAsScalar;Vr.setScalarValue=C_.setScalarValue;Vr.stringify=FY.stringify;Vr.visit=LY.visit;Vr.BOM=x_;Vr.DOCUMENT=E_;Vr.FLOW_END=O_;Vr.SCALAR=I_;Vr.isCollection=jY;Vr.isScalar=UY;Vr.prettyToken=HY;Vr.tokenType=BY});var T_=F(XT=>{"use strict";var ld=eg();function Xn(r){switch(r){case void 0:case" ":case`
|
|
211
|
+
`:case"\r":case" ":return!0;default:return!1}}var ZT=new Set("0123456789ABCDEFabcdef"),VY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),tg=new Set(",[]{}"),WY=new Set(` ,[]{}
|
|
212
212
|
\r `),P_=r=>!r||WY.has(r),k_=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
213
213
|
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
214
214
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let i=this.buffer[n+e+1];if(i===`
|
|
215
215
|
`||!i&&!this.atEnd)return e+n+1}return t===`
|
|
216
|
-
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&
|
|
217
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===
|
|
216
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Xn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
217
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ld.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let s=e[n-1];if(s===" "||s===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let s=e[t-1];if(s===" "||s===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield ld.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&Xn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Xn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Xn(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(P_),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Xn(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield ld.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(P_),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||Xn(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let s=0;for(;this.buffer[t-1-s]==="\\";)s+=1;if(s%2===0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),i=n.indexOf(`
|
|
218
218
|
`,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=n.indexOf(`
|
|
219
|
-
`,s)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>
|
|
219
|
+
`,s)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>Xn(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":t+=1;break;case`
|
|
220
220
|
`:e=s,t=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
221
221
|
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
222
222
|
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
223
223
|
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);let l=s;for(;a===" ";)a=this.buffer[--s];if(a===`
|
|
224
|
-
`&&s>=this.pos&&s+1+t>l)e=s;else break}while(!0);return yield
|
|
224
|
+
`&&s>=this.pos&&s+1+t>l)e=s;else break}while(!0);return yield ld.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let s=this.buffer[n+1];if(Xn(s)||e&&tg.has(s))break;t=n}else if(Xn(i)){let s=this.buffer[n+1];if(i==="\r"&&(s===`
|
|
225
225
|
`?(n+=1,i=`
|
|
226
|
-
`,s=this.buffer[n+1]):t=n),s==="#"||e&&
|
|
227
|
-
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&
|
|
226
|
+
`,s=this.buffer[n+1]):t=n),s==="#"||e&&tg.has(s))break;if(i===`
|
|
227
|
+
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&tg.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield ld.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(P_),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(Xn(n)||t&&tg.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!Xn(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(VY.has(t))t=this.buffer[++e];else if(t==="%"&&ZT.has(this.buffer[e+1])&&ZT.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
228
228
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
229
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};XT.Lexer=k_});var A_=F(e1=>{"use strict";var q_=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let s=t+n>>1;this.lineStarts[s]<e?t=s+1:n=s}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};e1.LineCounter=q_});var M_=F(s1=>{"use strict";var zY=it("process"),t1=
|
|
229
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};XT.Lexer=k_});var A_=F(e1=>{"use strict";var q_=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let s=t+n>>1;this.lineStarts[s]<e?t=s+1:n=s}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};e1.LineCounter=q_});var M_=F(s1=>{"use strict";var zY=it("process"),t1=eg(),JY=T_();function io(r,e){for(let t=0;t<r.length;++t)if(r[t].type===e)return!0;return!1}function r1(r){for(let e=0;e<r.length;++e)switch(r[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function i1(r){switch(r?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function rg(r){switch(r.type){case"document":return r.start;case"block-map":{let e=r.items[r.items.length-1];return e.sep??e.start}case"block-seq":return r.items[r.items.length-1].start;default:return[]}}function pu(r){if(r.length===0)return[];let e=r.length;e:for(;--e>=0;)switch(r[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;r[++e]?.type==="space";);return r.splice(e,r.length)}function ng(r,e){if(e.length<1e5)Array.prototype.push.apply(r,e);else for(let t=0;t<e.length;++t)r.push(e[t])}function n1(r){if(r.start.type==="flow-seq-start")for(let e of r.items)e.sep&&!e.value&&!io(e.start,"explicit-key-ind")&&!io(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,i1(e.value)?e.value.end?ng(e.value.end,e.sep):e.value.end=e.sep:ng(e.start,e.sep),delete e.sep)}var $_=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new JY.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,zY.env.LOG_TOKENS&&console.log("|",t1.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=t1.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&n1(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&r1(i.start)===-1&&(t.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{r1(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=rg(this.peek(2)),n=pu(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
230
230
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
231
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){
|
|
231
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){ng(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&t.sep&&!t.value){let a=[];for(let l=0;l<t.sep.length;++l){let f=t.sep[l];switch(f.type){case"newline":a.push(l);break;case"space":break;case"comment":f.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=t.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(io(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(i1(t.key)&&!io(t.sep,"newline")){let a=pu(t.start),l=t.key,f=t.sep;f.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:f}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(io(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let a=pu(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):io(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);i||t.value?(e.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(a):(Object.assign(t,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!t.explicitKey&&t.sep&&!io(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){ng(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||io(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=rg(n),s=pu(i);n1(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
232
232
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
233
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=
|
|
233
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=rg(e),n=pu(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=rg(e),n=pu(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};s1.Parser=$_});var c1=F(cd=>{"use strict";var o1=w_(),GY=td(),ud=id(),YY=bw(),KY=Je(),QY=A_(),a1=M_();function l1(r){let e=r.prettyErrors!==!1;return{lineCounter:r.lineCounter||e&&new QY.LineCounter||null,prettyErrors:e}}function ZY(r,e={}){let{lineCounter:t,prettyErrors:n}=l1(e),i=new a1.Parser(t?.addNewLine),s=new o1.Composer(e),a=Array.from(s.compose(i.parse(r)));if(n&&t)for(let l of a)l.errors.forEach(ud.prettifyError(r,t)),l.warnings.forEach(ud.prettifyError(r,t));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function u1(r,e={}){let{lineCounter:t,prettyErrors:n}=l1(e),i=new a1.Parser(t?.addNewLine),s=new o1.Composer(e),a=null;for(let l of s.compose(i.parse(r),!0,r.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new ud.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(a.errors.forEach(ud.prettifyError(r,t)),a.warnings.forEach(ud.prettifyError(r,t))),a}function XY(r,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=u1(r,t);if(!i)return null;if(i.warnings.forEach(s=>YY.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function eK(r,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(r===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return KY.isDocument(r)&&!n?r.toString(t):new GY.Document(r,n,t).toString(t)}cd.parse=XY;cd.parseAllDocuments=ZY;cd.parseDocument=u1;cd.stringify=eK});var D_=F(st=>{"use strict";var tK=w_(),rK=td(),nK=t_(),N_=id(),iK=Lf(),so=Je(),sK=eo(),oK=jt(),aK=ro(),lK=no(),uK=eg(),cK=T_(),fK=A_(),dK=M_(),ig=c1(),f1=Mf();st.Composer=tK.Composer;st.Document=rK.Document;st.Schema=nK.Schema;st.YAMLError=N_.YAMLError;st.YAMLParseError=N_.YAMLParseError;st.YAMLWarning=N_.YAMLWarning;st.Alias=iK.Alias;st.isAlias=so.isAlias;st.isCollection=so.isCollection;st.isDocument=so.isDocument;st.isMap=so.isMap;st.isNode=so.isNode;st.isPair=so.isPair;st.isScalar=so.isScalar;st.isSeq=so.isSeq;st.Pair=sK.Pair;st.Scalar=oK.Scalar;st.YAMLMap=aK.YAMLMap;st.YAMLSeq=lK.YAMLSeq;st.CST=uK;st.Lexer=cK.Lexer;st.LineCounter=fK.LineCounter;st.Parser=dK.Parser;st.parse=ig.parse;st.parseAllDocuments=ig.parseAllDocuments;st.parseDocument=ig.parseDocument;st.stringify=ig.stringify;st.visit=f1.visit;st.visitAsync=f1.visitAsync});var pK,hK,mK,gK,yK,vK,bK,oo,sg=se(()=>{"use strict";pK=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,hK=/^\d{4}-\d{2}-\d{2}$/,mK=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,gK=/^https?:\/\/[^\s]+$/,yK=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,vK=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,bK=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,oo=class{inferFromValue(e){if(e==null)return{nullable:!0};if(Array.isArray(e))return this.inferArraySchema(e);switch(typeof e){case"string":return this.inferStringSchema(e);case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"boolean":return{type:"boolean"};case"object":return this.inferObjectSchema(e);default:return{}}}mergeSchemas(e,t){if(!e||Object.keys(e).length===0)return{...t};if(!t||Object.keys(t).length===0)return{...e};let n=e.nullable||t.nullable;if(!e.type&&e.nullable)return{...t,nullable:!0};if(!t.type&&t.nullable)return{...e,nullable:!0};if(e.type!==t.type)return e.type==="integer"&&t.type==="number"||e.type==="number"&&t.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&t.type==="object"?this.mergeObjectSchemas(e,t,n):e.type==="array"&&t.type==="array"?this.mergeArraySchemas(e,t,n):(e.format&&e.format===t.format&&(i.format=e.format),i)}inferStringFormat(e){if(pK.test(e))return"date-time";if(hK.test(e))return"date";if(mK.test(e))return"email";if(yK.test(e))return"uuid";if(gK.test(e))return"uri";if(vK.test(e))return"ipv4";if(bK.test(e))return"ipv6"}inferStringSchema(e){let t={type:"string"},n=this.inferStringFormat(e);return n&&(t.format=n),t}inferArraySchema(e){let t={type:"array"};if(e.length===0)return t;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return t.items=n,t}inferObjectSchema(e){let t={type:"object",properties:{}},n=Object.keys(e);for(let i of n)t.properties[i]=this.inferFromValue(e[i]);return t}mergeObjectSchemas(e,t,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},a=t.properties||{},l=new Set([...Object.keys(s),...Object.keys(a)]);for(let g of l)s[g]&&a[g]?i.properties[g]=this.mergeSchemas(s[g],a[g]):s[g]?i.properties[g]={...s[g]}:i.properties[g]={...a[g]};let f=new Set(e.required||Object.keys(s)),d=new Set(t.required||Object.keys(a)),h=[...l].filter(g=>f.has(g)&&d.has(g));return h.length>0&&(i.required=h),i}mergeArraySchemas(e,t,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&t.items?i.items=this.mergeSchemas(e.items,t.items):e.items?i.items={...e.items}:t.items&&(i.items={...t.items}),i}}});var d1,SK,hu,F_=se(()=>{"use strict";d1=Cb(D_());sg();SK=new Set(["content-type","authorization","accept","cookie","host","content-length"]),hu=class{constructor(e,t,n){this.collectionService=e;this.envConfigService=t;this.inferenceService=n;this.inferrer=new oo}collectionService;envConfigService;inferenceService;inferrer;async export(e,t){let n=this.collectionService.getCollection(e);if(!n)throw new Error(`Collection ${e} not found`);let i={openapi:"3.0.3",info:this.buildInfo(n,t),servers:this.buildServers(t),paths:{},components:{schemas:{},securitySchemes:{}},tags:[]},s=new Map;if(n.auth&&n.auth.type!=="none"&&n.auth.type!=="inherit"){let f=this.mapAuthToSecurityScheme(n.auth);if(f){let{schemeName:d,scheme:h,requirement:g}=f;s.set(d,h),i.security=[g]}}let a=new Set,l=new Set;if(await this.processItems(n.items,i,s,a,l,void 0,n,t),this.augmentServersFromHostVars(l,i.servers,t),s.size>0)for(let[f,d]of s)i.components.securitySchemes[f]=d;else delete i.components.securitySchemes;return i.tags=[...a].map(f=>({name:f})),i.tags.length===0&&delete i.tags,this.deduplicateComponents(i),Object.keys(i.components.schemas).length===0&&delete i.components.schemas,Object.keys(i.components).length===0&&delete i.components,t.format==="yaml"?d1.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,t){return{title:t.info?.title||e.name,description:t.info?.description||e.description||"",version:t.info?.version||e.version||"1.0.0"}}buildServers(e){let t=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&t.push({url:s,description:i})}}else{let i=new Set;for(let s of n){let a=this.envConfigService.resolveVariables("{{baseUrl}}",s);a&&a!=="{{baseUrl}}"&&!i.has(a)&&(i.add(a),t.push({url:a,description:s}))}}return t.length===0&&t.push({url:"http://localhost",description:"Default server"}),t}async processItems(e,t,n,i,s,a,l,f){for(let d of e)if(d.type==="folder"){let h=d,g=a||h.name;i.add(g),h.items&&await this.processItems(h.items,t,n,i,s,g,l,f)}else{let h=d;await this.processRequest(h,t,n,i,s,a,l,f)}}async processRequest(e,t,n,i,s,a,l,f){let{path:d,hostVar:h}=this.normalizeUrl(e.url);h&&s.add(h);let g=(e.method||"GET").toLowerCase();t.paths[d]||(t.paths[d]={});let y={};y.operationId=this.generateOperationId(e,g,d,t),y.summary=this.cleanSummary(e.name),e.description&&(y.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(y.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(y.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,""))),a&&(y.tags=[a]);let S=this.buildParameters(e);S.length>0&&(y.parameters=S);let _=await this.buildRequestBody(e,f);_&&(y.requestBody=_);let R=await this.buildResponses(e,l.id,f);y.responses=R;let I=this.buildOperationSecurity(e,l,n);I!==void 0&&(y.security=I);let q=t.paths[d][g];q?this.mergeOperation(q,y,e.name):t.paths[d][g]=y}mergeOperation(e,t,n){if(t.summary&&t.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
|
|
234
234
|
|
|
235
|
-
Variant: **${n}**`+(t.description?` \u2014 ${t.description}`:"")),t.tags){let i=new Set(e.tags||[]);for(let s of t.tags)i.add(s);e.tags=[...i]}if(t.parameters){e.parameters||(e.parameters=[]);for(let i of t.parameters){let s=e.parameters.find(a=>a.name===i.name&&a.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(t.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(t.responses))e.responses[i]||(e.responses[i]=s)}if(t.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(t.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else t.requestBody&&!e.requestBody&&(e.requestBody=t.requestBody)}mergeParameterSchema(e,t,n){e.schema||(e.schema={});let i=e.schema,s=t.schema||{},a=this.getConstraintKind(i),l=this.getConstraintKind(s);if(a==="none"&&l==="none")this.widenType(i,s);else if(a==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(l==="none")this.widenType(i,s);else if(a===l)this.mergeSameKindConstraints(i,s,a),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(d=>JSON.stringify(d)===JSON.stringify(f))||i.oneOf.push(f)}else if(s.oneOf){let f=this.buildVariantSchema(i);i.oneOf=[f,...s.oneOf]}else{let f=this.buildVariantSchema(i),d=this.buildVariantSchema(s);i.oneOf=[f,d]}this.stripConstraints(i)}if(t.description&&t.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+t.description),t.example!==void 0&&t.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let f=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[f]={value:t.example},delete e.example}}getConstraintKind(e){return e.oneOf?"oneOf":e.enum&&e.enum.length>0?"enum":e.pattern?"pattern":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"range":e.minLength!==void 0||e.maxLength!==void 0?"length":e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.format?"format":"none"}mergeSameKindConstraints(e,t,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of t.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{t.pattern&&t.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${t.pattern})`);break}case"range":{t.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,t.minimum):t.minimum),t.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,t.maximum):t.maximum),t.exclusiveMinimum&&(e.exclusiveMinimum=!0),t.exclusiveMaximum&&(e.exclusiveMaximum=!0),t.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,t.multipleOf):t.multipleOf);break}case"length":{t.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,t.minLength):t.minLength),t.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,t.maxLength):t.maxLength);break}case"array":{t.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,t.minItems):t.minItems),t.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,t.maxItems):t.maxItems),t.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(t.format&&t.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:t.type||"string",format:t.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(t.oneOf)for(let i of t.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let t={};return e.type&&(t.type=e.type),e.enum&&(t.enum=[...e.enum]),e.pattern&&(t.pattern=e.pattern),e.format&&(t.format=e.format),e.minimum!==void 0&&(t.minimum=e.minimum),e.maximum!==void 0&&(t.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(t.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(t.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(t.multipleOf=e.multipleOf),e.minLength!==void 0&&(t.minLength=e.minLength),e.maxLength!==void 0&&(t.maxLength=e.maxLength),e.minItems!==void 0&&(t.minItems=e.minItems),e.maxItems!==void 0&&(t.maxItems=e.maxItems),e.uniqueItems&&(t.uniqueItems=!0),e.nullable&&(t.nullable=!0),t}stripConstraints(e){delete e.enum,delete e.pattern,delete e.format,delete e.minimum,delete e.maximum,delete e.exclusiveMinimum,delete e.exclusiveMaximum,delete e.multipleOf,delete e.minLength,delete e.maxLength,delete e.minItems,delete e.maxItems,delete e.uniqueItems,delete e.nullable}extractConstraints(e){let t={};return e.enum&&(t.enum=[...e.enum]),e.pattern&&(t.pattern=e.pattern),e.format&&(t.format=e.format),e.minimum!==void 0&&(t.minimum=e.minimum),e.maximum!==void 0&&(t.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(t.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(t.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(t.multipleOf=e.multipleOf),e.minLength!==void 0&&(t.minLength=e.minLength),e.maxLength!==void 0&&(t.maxLength=e.maxLength),e.minItems!==void 0&&(t.minItems=e.minItems),e.maxItems!==void 0&&(t.maxItems=e.maxItems),e.uniqueItems&&(t.uniqueItems=!0),e.nullable&&(t.nullable=!0),t}widenType(e,t){!t.type||t.type===e.type||(e.type?(e.type==="integer"&&t.type==="number"||e.type==="number"&&t.type==="integer")&&(e.type="number"):e.type=t.type)}normalizeUrl(e){let t=e,n=null,i=t.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],t=t.slice(i[0].length)),t=t.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),t=t.replace(/\{\{(\w+)\}\}/g,"{$1}"),t.startsWith("/")||(t="/"+t),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t=t.replace(/\/\//g,"/"),{path:t,hostVar:n}}generateOperationId(e,t,n,i){let s=this.toCamelCase(e.name),a=this.collectOperationIds(i);if(a.has(s)&&(s=`${s}${t.charAt(0).toUpperCase()}${t.slice(1)}`),!s||a.has(s)){let l=n.split("/").filter(f=>f&&!f.startsWith("{"));s=t+l.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let t=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&t.add(i.operationId);return t}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase()).replace(/^[A-Z]/,t=>t.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let t=[];if(e.params)for(let[n,i]of Object.entries(e.params)){let s={name:n,in:"path",required:!0};if(typeof i=="string")s.schema={type:this.inferTypeFromValue(i)},s.example=this.coerceExample(i,s.schema.type);else{let a=i;a.oneOf?(s.schema={oneOf:a.oneOf},a.type&&(s.schema.type=a.type)):(s.schema={type:a.type||this.inferTypeFromValue(a.value)},a.format&&(s.schema.format=a.format),a.enum&&(s.schema.enum=a.enum),a.pattern&&(s.schema.pattern=a.pattern),a.minimum!==void 0&&(s.schema.minimum=a.minimum),a.maximum!==void 0&&(s.schema.maximum=a.maximum),a.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=a.exclusiveMinimum),a.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=a.exclusiveMaximum),a.multipleOf!==void 0&&(s.schema.multipleOf=a.multipleOf),a.minLength!==void 0&&(s.schema.minLength=a.minLength),a.maxLength!==void 0&&(s.schema.maxLength=a.maxLength),a.minItems!==void 0&&(s.schema.minItems=a.minItems),a.maxItems!==void 0&&(s.schema.maxItems=a.maxItems),a.uniqueItems&&(s.schema.uniqueItems=!0),a.nullable&&(s.schema.nullable=!0)),a.description&&(s.description=a.description),a.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(a.value,s.schema.type||"string")}t.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");t.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);t.push(...i)}for(let i of e.headers){if(!i.key||SK.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");t.push(s)}}return t}buildKeyValueParam(e,t){let n={name:e.key,in:t,schema:{}};return e.oneOf?(n.schema.oneOf=e.oneOf,e.type&&(n.schema.type=e.type)):(n.schema.type=e.type||"string",e.format&&(n.schema.format=e.format),e.enum&&(n.schema.enum=e.enum),e.pattern&&(n.schema.pattern=e.pattern),e.minimum!==void 0&&(n.schema.minimum=e.minimum),e.maximum!==void 0&&(n.schema.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(n.schema.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(n.schema.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(n.schema.multipleOf=e.multipleOf),e.minLength!==void 0&&(n.schema.minLength=e.minLength),e.maxLength!==void 0&&(n.schema.maxLength=e.maxLength),e.minItems!==void 0&&(n.schema.minItems=e.minItems),e.maxItems!==void 0&&(n.schema.maxItems=e.maxItems),e.uniqueItems&&(n.schema.uniqueItems=!0),e.nullable&&(n.schema.nullable=!0)),e.required&&(n.required=!0),e.description&&(n.description=e.description),e.deprecated&&(n.deprecated=!0),e.value&&(n.example=this.coerceExample(e.value,n.schema.type||"string")),n}parseCookieHeader(e){let t=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let a=i.substring(0,s).trim(),l=i.substring(s+1).trim();t.push({name:a,in:"cookie",schema:{type:"string"},example:l})}}return t}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,t){let n=this.sanitizeEnvVar(e);switch(t){case"integer":return parseInt(n,10)||n;case"number":return parseFloat(n)||n;case"boolean":return n==="true";default:return n}}sanitizeEnvVar(e){return e.replace(/\{\{(\w+)\}\}/g,"<$1>")}sanitizeObjectExamples(e){if(typeof e=="string")return this.sanitizeEnvVar(e);if(Array.isArray(e))return e.map(t=>this.sanitizeObjectExamples(t));if(e!==null&&typeof e=="object"){let t={};for(let[n,i]of Object.entries(e))t[n]=this.sanitizeObjectExamples(i);return t}return e}async buildRequestBody(e,t){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,a,l,f;if(e.bodySchema){if(e.bodySchema.content){for(let[g,y]of Object.entries(e.bodySchema.content)){let S={};y.schema&&(S.schema=y.schema),y.examples&&(S.examples=y.examples),y.encoding&&(S.encoding=y.encoding),i.content[g]=S}let h=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(h&&n.content){let g=this.tryParseBodyContent(n);g!==void 0&&i.content[h]&&(i.content[h].example=g)}return i}s=e.bodySchema.contentType||this.getContentType(n),a=e.bodySchema.schema,e.bodySchema.components,l=this.tryParseBodyContent(n),e.bodySchema.encoding&&(f=e.bodySchema.encoding)}else switch(s=this.getContentType(n),n.type){case"raw":{if(n.format==="json"&&n.content){let h=this.tryParseBodyContent(n);h!==void 0?(a=this.inferrer.inferFromValue(h),l=h):a={type:"string"}}else a={type:"string"},l=typeof n.content=="string"?n.content:void 0;break}case"form-data":{a=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{a=this.buildFormDataSchemaFromBody(n);break}case"binary":{a={type:"string",format:"binary"};break}case"graphql":{a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l=this.tryParseBodyContent(n);break}default:return null}let d={};return a&&(d.schema=a),l!==void 0&&(d.example=l),f&&(d.encoding=f),i.content[s]=d,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let t;if(typeof e.content=="string")try{t=JSON.parse(e.content)}catch{t=e.content}else t=e.content;return this.sanitizeObjectExamples(t)}buildFormDataSchemaFromBody(e){let t={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?t.properties[i.key]={type:"string",format:"binary"}:t.properties[i.key]={type:"string"});return t}async buildResponses(e,t,n){let i={};if(e.responseSchema)for(let[s,a]of Object.entries(e.responseSchema.responses)){let l={description:a.description||`Status ${s}`};if(a.content){l.content={};for(let[f,d]of Object.entries(a.content)){let h={};d.schema&&(h.schema=d.schema),d.examples&&(h.examples=d.examples),l.content[f]=h}}else if(a.schema){let f=a.contentType||"application/json",d={schema:a.schema};a.examples&&(d.examples=a.examples),l.content={[f]:d}}if(a.headers){l.headers={};for(let[f,d]of Object.entries(a.headers))l.headers[f]={...d.description&&{description:d.description},schema:d.schema}}i[s]=l}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}buildOperationSecurity(e,t,n){if(!e.auth||e.auth.type==="inherit")return;if(e.auth.type==="none")return[];let i=this.mapAuthToSecurityScheme(e.auth);if(!i)return;let{schemeName:s,scheme:a,requirement:l}=i;return n.set(s,a),[l]}mapAuthToSecurityScheme(e){switch(e.type){case"bearer":return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}};case"basic":return{schemeName:"BasicAuth",scheme:{type:"http",scheme:"basic"},requirement:{BasicAuth:[]}};case"apikey":{let t=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${t.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:t.in||"header",name:t.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let t=e.oauth2;if(!t)return;let n={};switch(t.grantType){case"client_credentials":n.clientCredentials={tokenUrl:t.tokenUrl||"",scopes:t.scope?this.parseScopes(t.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:t.authUrl||"",tokenUrl:t.tokenUrl||"",scopes:t.scope?this.parseScopes(t.scope):{}};break;case"password":n.password={tokenUrl:t.tokenUrl||"",scopes:t.scope?this.parseScopes(t.scope):{}};break;case"implicit":n.implicit={authorizationUrl:t.authUrl||"",scopes:t.scope?this.parseScopes(t.scope):{}};break;default:n.clientCredentials={tokenUrl:t.tokenUrl||"",scopes:{}}}return{schemeName:"OAuth2",scheme:{type:"oauth2",flows:n},requirement:{OAuth2:[]}}}default:return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}}}}parseScopes(e){let t={};for(let n of e.split(/\s+/))n&&(t[n]="");return t}deduplicateComponents(e){let t=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[a,l]of Object.entries(s)){let f=l;if(f.responses){for(let[d,h]of Object.entries(f.responses))if(h.content)for(let g of Object.values(h.content))g.schema&&this.trackSchema(g.schema,`${a}${i}Response${d}`,t,n)}if(f.requestBody?.content)for(let d of Object.values(f.requestBody.content))d.schema&&this.trackSchema(d.schema,`${a}${i}Request`,t,n)}for(let[i,s]of t)if((n.get(i)||0)>=2){let l=this.sanitizeComponentName(s.name);e.components.schemas[l]=s.schema,this.replaceInlineSchema(e,s.schema,`#/components/schemas/${l}`)}}trackSchema(e,t,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:t,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,t,n){let i=JSON.stringify(t);if(e.paths)for(let s of Object.values(e.paths))for(let a of Object.values(s)){if(a.responses){for(let l of Object.values(a.responses))if(l.content)for(let f of Object.values(l.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(a.requestBody?.content)for(let l of Object.values(a.requestBody.content))l.schema&&JSON.stringify(l.schema)===i&&(l.schema={$ref:n})}}sanitizeComponentName(e){return e.replace(/[^a-zA-Z0-9._-]/g,"").replace(/^[^a-zA-Z]/,"Schema")}cleanSummary(e){return e.replace(/^\[DEPRECATED\]\s*/i,"")}hasDeprecatedPrefix(e){return/^\[DEPRECATED\]/i.test(e)}augmentServersFromHostVars(e,t,n){if(e.size===0)return;let i=new Set(t.map(a=>a.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(a=>!!a);for(let a of e){let l=`{{${a}}}`,f=!1;for(let d of s){let h=this.envConfigService.resolveVariables(l,d);h&&h!==l&&!i.has(h)&&(t.push({url:h,description:d}),i.add(h),f=!0)}if(!f){let d=`{${a}}`;i.has(d)||(t.push({url:d,variables:{[a]:{default:""}}}),i.add(d))}}}}});var mu,L_=se(()=>{"use strict";mu=class{generate(e,t){if(!e)return;let n=t||{};if(e.$ref){let i=this.resolveLocalRef(e.$ref,n.components);return i?this.generate(i,n):{}}if(e.nullable&&!e.type)return null;if(e.enum&&e.enum.length>0)return e.enum[0];if(e.default!==void 0)return e.default;if(e.example!==void 0)return e.example;if(e.allOf)return this.generateFromAllOf(e.allOf,e.discriminator,n);if(e.oneOf)return this.generateFromOneOfAnyOf(e.oneOf,e.discriminator,n);if(e.anyOf)return this.generateFromOneOfAnyOf(e.anyOf,e.discriminator,n);switch(e.type){case"string":return this.generateString(e);case"integer":return this.generateInteger(e);case"number":return this.generateNumber(e);case"boolean":return!1;case"array":return this.generateArray(e,n);case"object":return this.generateObject(e,n);default:return e.properties?this.generateObject(e,n):{}}}generateString(e){switch(e.format){case"email":return"user@example.com";case"date-time":return"2026-01-01T00:00:00Z";case"date":return"2026-01-01";case"time":return"00:00:00";case"uri":case"url":return"https://example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"ipv4":return"127.0.0.1";case"ipv6":return"::1";case"hostname":return"example.com";case"binary":return"";case"byte":return"c3RyaW5n";case"password":return"********";default:return"string"}}generateInteger(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+1:0}generateNumber(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+.1:0}generateArray(e,t){return e.items?[this.generate(e.items,t)]:[]}generateObject(e,t){let n={},i=e.properties||{};for(let[s,a]of Object.entries(i))t.omitReadOnly&&a.readOnly||(n[s]=this.generate(a,t));return n}generateFromAllOf(e,t,n){let i={type:"object",properties:{},required:[]};for(let a of e){let l=a.$ref?this.resolveLocalRef(a.$ref,n.components)||{}:a;l.properties&&Object.assign(i.properties,l.properties),l.required&&(i.required=[...i.required||[],...l.required])}let s=this.generateObject(i,n);return t?.propertyName&&(s[t.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,t,n){if(e.length===0)return{};let i=e[0].$ref&&this.resolveLocalRef(e[0].$ref,n.components)||e[0],s=this.generate(i,n);return t?.propertyName&&typeof s=="object"&&s!==null&&(s[t.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,t){if(e.length===0)return"unknown";let n=e[0];if(n.$ref){let i=n.$ref.split("/");return i[i.length-1]}return"variant1"}resolveLocalRef(e,t){if(!e||!t)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return t[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return t[i[1]]}}});var ag=F(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.getDeepKeys=gu.toJSON=void 0;var wK=["function","symbol","undefined"],_K=["constructor","prototype","__proto__"],RK=Object.getPrototypeOf({});function CK(){let r={},e=this;for(let t of p1(e))if(typeof t=="string"){let n=e[t],i=typeof n;wK.includes(i)||(r[t]=n)}return r}gu.toJSON=CK;function p1(r,e=[]){let t=[];for(;r&&r!==RK;)t=t.concat(Object.getOwnPropertyNames(r),Object.getOwnPropertySymbols(r)),r=Object.getPrototypeOf(r);let n=new Set(t);for(let i of e.concat(_K))n.delete(i);return n}gu.getDeepKeys=p1});var j_=F(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.addInspectMethod=yu.format=void 0;var h1=it("util"),xK=ag(),m1=h1.inspect.custom||Symbol.for("nodejs.util.inspect.custom");yu.format=h1.format;function EK(r){r[m1]=OK}yu.addInspectMethod=EK;function OK(){let r={},e=this;for(let t of xK.getDeepKeys(e)){let n=e[t];r[t]=n}return delete r[m1],r}});var v1=F(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.lazyJoinStacks=Oi.joinStacks=Oi.isWritableStack=Oi.isLazyStack=void 0;var IK=/\r?\n/,PK=/\bono[ @]/;function kK(r){return!!(r&&r.configurable&&typeof r.get=="function")}Oi.isLazyStack=kK;function TK(r){return!!(!r||r.writable||typeof r.set=="function")}Oi.isWritableStack=TK;function g1(r,e){let t=y1(r.stack),n=e?e.stack:void 0;return t&&n?t+`
|
|
235
|
+
Variant: **${n}**`+(t.description?` \u2014 ${t.description}`:"")),t.tags){let i=new Set(e.tags||[]);for(let s of t.tags)i.add(s);e.tags=[...i]}if(t.parameters){e.parameters||(e.parameters=[]);for(let i of t.parameters){let s=e.parameters.find(a=>a.name===i.name&&a.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(t.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(t.responses))e.responses[i]||(e.responses[i]=s)}if(t.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(t.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else t.requestBody&&!e.requestBody&&(e.requestBody=t.requestBody)}mergeParameterSchema(e,t,n){e.schema||(e.schema={});let i=e.schema,s=t.schema||{},a=this.getConstraintKind(i),l=this.getConstraintKind(s);if(a==="none"&&l==="none")this.widenType(i,s);else if(a==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(l==="none")this.widenType(i,s);else if(a===l)this.mergeSameKindConstraints(i,s,a),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(d=>JSON.stringify(d)===JSON.stringify(f))||i.oneOf.push(f)}else if(s.oneOf){let f=this.buildVariantSchema(i);i.oneOf=[f,...s.oneOf]}else{let f=this.buildVariantSchema(i),d=this.buildVariantSchema(s);i.oneOf=[f,d]}this.stripConstraints(i)}if(t.description&&t.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+t.description),t.example!==void 0&&t.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let f=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[f]={value:t.example},delete e.example}}getConstraintKind(e){return e.oneOf?"oneOf":e.enum&&e.enum.length>0?"enum":e.pattern?"pattern":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"range":e.minLength!==void 0||e.maxLength!==void 0?"length":e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.format?"format":"none"}mergeSameKindConstraints(e,t,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of t.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{t.pattern&&t.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${t.pattern})`);break}case"range":{t.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,t.minimum):t.minimum),t.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,t.maximum):t.maximum),t.exclusiveMinimum&&(e.exclusiveMinimum=!0),t.exclusiveMaximum&&(e.exclusiveMaximum=!0),t.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,t.multipleOf):t.multipleOf);break}case"length":{t.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,t.minLength):t.minLength),t.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,t.maxLength):t.maxLength);break}case"array":{t.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,t.minItems):t.minItems),t.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,t.maxItems):t.maxItems),t.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(t.format&&t.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:t.type||"string",format:t.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(t.oneOf)for(let i of t.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let t={};return e.type&&(t.type=e.type),e.enum&&(t.enum=[...e.enum]),e.pattern&&(t.pattern=e.pattern),e.format&&(t.format=e.format),e.minimum!==void 0&&(t.minimum=e.minimum),e.maximum!==void 0&&(t.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(t.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(t.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(t.multipleOf=e.multipleOf),e.minLength!==void 0&&(t.minLength=e.minLength),e.maxLength!==void 0&&(t.maxLength=e.maxLength),e.minItems!==void 0&&(t.minItems=e.minItems),e.maxItems!==void 0&&(t.maxItems=e.maxItems),e.uniqueItems&&(t.uniqueItems=!0),e.nullable&&(t.nullable=!0),t}stripConstraints(e){delete e.enum,delete e.pattern,delete e.format,delete e.minimum,delete e.maximum,delete e.exclusiveMinimum,delete e.exclusiveMaximum,delete e.multipleOf,delete e.minLength,delete e.maxLength,delete e.minItems,delete e.maxItems,delete e.uniqueItems,delete e.nullable}extractConstraints(e){let t={};return e.enum&&(t.enum=[...e.enum]),e.pattern&&(t.pattern=e.pattern),e.format&&(t.format=e.format),e.minimum!==void 0&&(t.minimum=e.minimum),e.maximum!==void 0&&(t.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(t.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(t.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(t.multipleOf=e.multipleOf),e.minLength!==void 0&&(t.minLength=e.minLength),e.maxLength!==void 0&&(t.maxLength=e.maxLength),e.minItems!==void 0&&(t.minItems=e.minItems),e.maxItems!==void 0&&(t.maxItems=e.maxItems),e.uniqueItems&&(t.uniqueItems=!0),e.nullable&&(t.nullable=!0),t}widenType(e,t){!t.type||t.type===e.type||(e.type?(e.type==="integer"&&t.type==="number"||e.type==="number"&&t.type==="integer")&&(e.type="number"):e.type=t.type)}normalizeUrl(e){let t=e,n=null,i=t.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],t=t.slice(i[0].length)),t=t.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),t=t.replace(/\{\{(\w+)\}\}/g,"{$1}"),t.startsWith("/")||(t="/"+t),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t=t.replace(/\/\//g,"/"),{path:t,hostVar:n}}generateOperationId(e,t,n,i){let s=this.toCamelCase(e.name),a=this.collectOperationIds(i);if(a.has(s)&&(s=`${s}${t.charAt(0).toUpperCase()}${t.slice(1)}`),!s||a.has(s)){let l=n.split("/").filter(f=>f&&!f.startsWith("{"));s=t+l.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let t=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&t.add(i.operationId);return t}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase()).replace(/^[A-Z]/,t=>t.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let t=[];if(e.params)for(let[n,i]of Object.entries(e.params)){let s={name:n,in:"path",required:!0};if(typeof i=="string")s.schema={type:this.inferTypeFromValue(i)},s.example=this.coerceExample(i,s.schema.type);else{let a=i;a.oneOf?(s.schema={oneOf:a.oneOf},a.type&&(s.schema.type=a.type)):(s.schema={type:a.type||this.inferTypeFromValue(a.value)},a.format&&(s.schema.format=a.format),a.enum&&(s.schema.enum=a.enum),a.pattern&&(s.schema.pattern=a.pattern),a.minimum!==void 0&&(s.schema.minimum=a.minimum),a.maximum!==void 0&&(s.schema.maximum=a.maximum),a.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=a.exclusiveMinimum),a.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=a.exclusiveMaximum),a.multipleOf!==void 0&&(s.schema.multipleOf=a.multipleOf),a.minLength!==void 0&&(s.schema.minLength=a.minLength),a.maxLength!==void 0&&(s.schema.maxLength=a.maxLength),a.minItems!==void 0&&(s.schema.minItems=a.minItems),a.maxItems!==void 0&&(s.schema.maxItems=a.maxItems),a.uniqueItems&&(s.schema.uniqueItems=!0),a.nullable&&(s.schema.nullable=!0)),a.description&&(s.description=a.description),a.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(a.value,s.schema.type||"string")}t.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");t.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);t.push(...i)}for(let i of e.headers){if(!i.key||SK.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");t.push(s)}}return t}buildKeyValueParam(e,t){let n={name:e.key,in:t,schema:{}};return e.oneOf?(n.schema.oneOf=e.oneOf,e.type&&(n.schema.type=e.type)):(n.schema.type=e.type||"string",e.format&&(n.schema.format=e.format),e.enum&&(n.schema.enum=e.enum),e.pattern&&(n.schema.pattern=e.pattern),e.minimum!==void 0&&(n.schema.minimum=e.minimum),e.maximum!==void 0&&(n.schema.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(n.schema.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(n.schema.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(n.schema.multipleOf=e.multipleOf),e.minLength!==void 0&&(n.schema.minLength=e.minLength),e.maxLength!==void 0&&(n.schema.maxLength=e.maxLength),e.minItems!==void 0&&(n.schema.minItems=e.minItems),e.maxItems!==void 0&&(n.schema.maxItems=e.maxItems),e.uniqueItems&&(n.schema.uniqueItems=!0),e.nullable&&(n.schema.nullable=!0)),e.required&&(n.required=!0),e.description&&(n.description=e.description),e.deprecated&&(n.deprecated=!0),e.value&&(n.example=this.coerceExample(e.value,n.schema.type||"string")),n}parseCookieHeader(e){let t=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let a=i.substring(0,s).trim(),l=i.substring(s+1).trim();t.push({name:a,in:"cookie",schema:{type:"string"},example:l})}}return t}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,t){let n=this.sanitizeEnvVar(e);switch(t){case"integer":return parseInt(n,10)||n;case"number":return parseFloat(n)||n;case"boolean":return n==="true";default:return n}}sanitizeEnvVar(e){return e.replace(/\{\{(\w+)\}\}/g,"<$1>")}sanitizeObjectExamples(e){if(typeof e=="string")return this.sanitizeEnvVar(e);if(Array.isArray(e))return e.map(t=>this.sanitizeObjectExamples(t));if(e!==null&&typeof e=="object"){let t={};for(let[n,i]of Object.entries(e))t[n]=this.sanitizeObjectExamples(i);return t}return e}async buildRequestBody(e,t){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,a,l,f;if(e.bodySchema){if(e.bodySchema.content){for(let[g,y]of Object.entries(e.bodySchema.content)){let S={};y.schema&&(S.schema=y.schema),y.examples&&(S.examples=y.examples),y.encoding&&(S.encoding=y.encoding),i.content[g]=S}let h=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(h&&n.content){let g=this.tryParseBodyContent(n);g!==void 0&&i.content[h]&&(i.content[h].example=g)}return i}s=e.bodySchema.contentType||this.getContentType(n),a=e.bodySchema.schema,e.bodySchema.components,l=this.tryParseBodyContent(n),e.bodySchema.encoding&&(f=e.bodySchema.encoding)}else switch(s=this.getContentType(n),n.type){case"raw":{if(n.format==="json"&&n.content){let h=this.tryParseBodyContent(n);h!==void 0?(a=this.inferrer.inferFromValue(h),l=h):a={type:"string"}}else a={type:"string"},l=typeof n.content=="string"?n.content:void 0;break}case"form-data":{a=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{a=this.buildFormDataSchemaFromBody(n);break}case"binary":{a={type:"string",format:"binary"};break}case"graphql":{a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l=this.tryParseBodyContent(n);break}default:return null}let d={};return a&&(d.schema=a),l!==void 0&&(d.example=l),f&&(d.encoding=f),i.content[s]=d,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let t;if(typeof e.content=="string")try{t=JSON.parse(e.content)}catch{t=e.content}else t=e.content;return this.sanitizeObjectExamples(t)}buildFormDataSchemaFromBody(e){let t={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?t.properties[i.key]={type:"string",format:"binary"}:t.properties[i.key]={type:"string"});return t}async buildResponses(e,t,n){let i={};if(e.responseSchema)for(let[s,a]of Object.entries(e.responseSchema.responses)){let l={description:a.description||`Status ${s}`};if(a.content){l.content={};for(let[f,d]of Object.entries(a.content)){let h={};d.schema&&(h.schema=d.schema),d.examples&&(h.examples=d.examples),l.content[f]=h}}else if(a.schema){let f=a.contentType||"application/json",d={schema:a.schema};a.examples&&(d.examples=a.examples),l.content={[f]:d}}if(a.headers){l.headers={};for(let[f,d]of Object.entries(a.headers))l.headers[f]={...d.description&&{description:d.description},schema:d.schema}}i[s]=l}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}buildOperationSecurity(e,t,n){if(!e.auth||e.auth.type==="inherit")return;if(e.auth.type==="none")return[];let i=this.mapAuthToSecurityScheme(e.auth);if(!i)return;let{schemeName:s,scheme:a,requirement:l}=i;return n.set(s,a),[l]}mapAuthToSecurityScheme(e){switch(e.type){case"bearer":return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}};case"basic":return{schemeName:"BasicAuth",scheme:{type:"http",scheme:"basic"},requirement:{BasicAuth:[]}};case"apikey":{let t=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${t.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:t.in||"header",name:t.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let t=e.oauth2;if(!t)return;let n={};switch(t.grantType){case"client_credentials":n.clientCredentials={tokenUrl:t.tokenUrl||"",scopes:t.scope?this.parseScopes(t.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:t.authUrl||"",tokenUrl:t.tokenUrl||"",scopes:t.scope?this.parseScopes(t.scope):{}};break;case"password":n.password={tokenUrl:t.tokenUrl||"",scopes:t.scope?this.parseScopes(t.scope):{}};break;case"implicit":n.implicit={authorizationUrl:t.authUrl||"",scopes:t.scope?this.parseScopes(t.scope):{}};break;default:n.clientCredentials={tokenUrl:t.tokenUrl||"",scopes:{}}}return{schemeName:"OAuth2",scheme:{type:"oauth2",flows:n},requirement:{OAuth2:[]}}}default:return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}}}}parseScopes(e){let t={};for(let n of e.split(/\s+/))n&&(t[n]="");return t}deduplicateComponents(e){let t=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[a,l]of Object.entries(s)){let f=l;if(f.responses){for(let[d,h]of Object.entries(f.responses))if(h.content)for(let g of Object.values(h.content))g.schema&&this.trackSchema(g.schema,`${a}${i}Response${d}`,t,n)}if(f.requestBody?.content)for(let d of Object.values(f.requestBody.content))d.schema&&this.trackSchema(d.schema,`${a}${i}Request`,t,n)}for(let[i,s]of t)if((n.get(i)||0)>=2){let l=this.sanitizeComponentName(s.name);e.components.schemas[l]=s.schema,this.replaceInlineSchema(e,s.schema,`#/components/schemas/${l}`)}}trackSchema(e,t,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:t,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,t,n){let i=JSON.stringify(t);if(e.paths)for(let s of Object.values(e.paths))for(let a of Object.values(s)){if(a.responses){for(let l of Object.values(a.responses))if(l.content)for(let f of Object.values(l.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(a.requestBody?.content)for(let l of Object.values(a.requestBody.content))l.schema&&JSON.stringify(l.schema)===i&&(l.schema={$ref:n})}}sanitizeComponentName(e){return e.replace(/[^a-zA-Z0-9._-]/g,"").replace(/^[^a-zA-Z]/,"Schema")}cleanSummary(e){return e.replace(/^\[DEPRECATED\]\s*/i,"")}hasDeprecatedPrefix(e){return/^\[DEPRECATED\]/i.test(e)}augmentServersFromHostVars(e,t,n){if(e.size===0)return;let i=new Set(t.map(a=>a.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(a=>!!a);for(let a of e){let l=`{{${a}}}`,f=!1;for(let d of s){let h=this.envConfigService.resolveVariables(l,d);h&&h!==l&&!i.has(h)&&(t.push({url:h,description:d}),i.add(h),f=!0)}if(!f){let d=`{${a}}`;i.has(d)||(t.push({url:d,variables:{[a]:{default:""}}}),i.add(d))}}}}});var mu,L_=se(()=>{"use strict";mu=class{generate(e,t){if(!e)return;let n=t||{};if(e.$ref){let i=this.resolveLocalRef(e.$ref,n.components);return i?this.generate(i,n):{}}if(e.nullable&&!e.type)return null;if(e.enum&&e.enum.length>0)return e.enum[0];if(e.default!==void 0)return e.default;if(e.example!==void 0)return e.example;if(e.allOf)return this.generateFromAllOf(e.allOf,e.discriminator,n);if(e.oneOf)return this.generateFromOneOfAnyOf(e.oneOf,e.discriminator,n);if(e.anyOf)return this.generateFromOneOfAnyOf(e.anyOf,e.discriminator,n);switch(e.type){case"string":return this.generateString(e);case"integer":return this.generateInteger(e);case"number":return this.generateNumber(e);case"boolean":return!1;case"array":return this.generateArray(e,n);case"object":return this.generateObject(e,n);default:return e.properties?this.generateObject(e,n):{}}}generateString(e){switch(e.format){case"email":return"user@example.com";case"date-time":return"2026-01-01T00:00:00Z";case"date":return"2026-01-01";case"time":return"00:00:00";case"uri":case"url":return"https://example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"ipv4":return"127.0.0.1";case"ipv6":return"::1";case"hostname":return"example.com";case"binary":return"";case"byte":return"c3RyaW5n";case"password":return"********";default:return"string"}}generateInteger(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+1:0}generateNumber(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+.1:0}generateArray(e,t){return e.items?[this.generate(e.items,t)]:[]}generateObject(e,t){let n={},i=e.properties||{};for(let[s,a]of Object.entries(i))t.omitReadOnly&&a.readOnly||(n[s]=this.generate(a,t));return n}generateFromAllOf(e,t,n){let i={type:"object",properties:{},required:[]};for(let a of e){let l=a.$ref?this.resolveLocalRef(a.$ref,n.components)||{}:a;l.properties&&Object.assign(i.properties,l.properties),l.required&&(i.required=[...i.required||[],...l.required])}let s=this.generateObject(i,n);return t?.propertyName&&(s[t.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,t,n){if(e.length===0)return{};let i=e[0].$ref&&this.resolveLocalRef(e[0].$ref,n.components)||e[0],s=this.generate(i,n);return t?.propertyName&&typeof s=="object"&&s!==null&&(s[t.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,t){if(e.length===0)return"unknown";let n=e[0];if(n.$ref){let i=n.$ref.split("/");return i[i.length-1]}return"variant1"}resolveLocalRef(e,t){if(!e||!t)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return t[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return t[i[1]]}}});var og=F(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.getDeepKeys=gu.toJSON=void 0;var wK=["function","symbol","undefined"],_K=["constructor","prototype","__proto__"],RK=Object.getPrototypeOf({});function CK(){let r={},e=this;for(let t of p1(e))if(typeof t=="string"){let n=e[t],i=typeof n;wK.includes(i)||(r[t]=n)}return r}gu.toJSON=CK;function p1(r,e=[]){let t=[];for(;r&&r!==RK;)t=t.concat(Object.getOwnPropertyNames(r),Object.getOwnPropertySymbols(r)),r=Object.getPrototypeOf(r);let n=new Set(t);for(let i of e.concat(_K))n.delete(i);return n}gu.getDeepKeys=p1});var j_=F(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.addInspectMethod=yu.format=void 0;var h1=it("util"),xK=og(),m1=h1.inspect.custom||Symbol.for("nodejs.util.inspect.custom");yu.format=h1.format;function EK(r){r[m1]=OK}yu.addInspectMethod=EK;function OK(){let r={},e=this;for(let t of xK.getDeepKeys(e)){let n=e[t];r[t]=n}return delete r[m1],r}});var v1=F(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.lazyJoinStacks=Ei.joinStacks=Ei.isWritableStack=Ei.isLazyStack=void 0;var IK=/\r?\n/,PK=/\bono[ @]/;function kK(r){return!!(r&&r.configurable&&typeof r.get=="function")}Ei.isLazyStack=kK;function TK(r){return!!(!r||r.writable||typeof r.set=="function")}Ei.isWritableStack=TK;function g1(r,e){let t=y1(r.stack),n=e?e.stack:void 0;return t&&n?t+`
|
|
236
236
|
|
|
237
|
-
`+n:t||n}
|
|
238
|
-
`)}return r}function AK(r,e){Object.defineProperty(r,"stack",{get:()=>y1(e.get.apply(r)),enumerable:!1,configurable:!0})}});var w1=F(
|
|
239
|
-
`:"")+t.message),{originalError:t,props:n,message:s}}vu.normalizeArgs=jK});var H_=F(fg=>{"use strict";Object.defineProperty(fg,"__esModule",{value:!0});fg.Ono=void 0;var cg=w1(),R1=_1(),UK=ag(),HK=U_;fg.Ono=HK;function U_(r,e){e=R1.normalizeOptions(e);function t(...n){let{originalError:i,props:s,message:a}=R1.normalizeArgs(n,e),l=new r(a);return cg.extendError(l,i,s)}return t[Symbol.species]=r,t}U_.toJSON=function(e){return UK.toJSON.call(e)};U_.extend=function(e,t,n){return n||t instanceof Error?cg.extendError(e,t,n):t?cg.extendError(e,void 0,t):cg.extendError(e)}});var C1=F(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});dg.ono=void 0;var Ca=H_(),BK=Ii;dg.ono=BK;Ii.error=new Ca.Ono(Error);Ii.eval=new Ca.Ono(EvalError);Ii.range=new Ca.Ono(RangeError);Ii.reference=new Ca.Ono(ReferenceError);Ii.syntax=new Ca.Ono(SyntaxError);Ii.type=new Ca.Ono(TypeError);Ii.uri=new Ca.Ono(URIError);var VK=Ii;function Ii(...r){let e=r[0];if(typeof e=="object"&&typeof e.name=="string"){for(let t of Object.values(VK))if(typeof t=="function"&&t.name==="ono"){let n=t[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return t.apply(void 0,r)}}return Ii.error.apply(void 0,r)}});var E1=F(x1=>{"use strict";Object.defineProperty(x1,"__esModule",{value:!0});var Lee=it("util")});var ao=F((ti,bu)=>{"use strict";var WK=ti&&ti.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),zK=ti&&ti.__exportStar||function(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&WK(e,r,t)};Object.defineProperty(ti,"__esModule",{value:!0});ti.ono=void 0;var O1=C1();Object.defineProperty(ti,"ono",{enumerable:!0,get:function(){return O1.ono}});var JK=H_();Object.defineProperty(ti,"Ono",{enumerable:!0,get:function(){return JK.Ono}});zK(E1(),ti);ti.default=O1.ono;typeof bu=="object"&&typeof bu.exports=="object"&&(bu.exports=Object.assign(bu.exports.default,bu.exports))});var B_=F(dd=>{"use strict";var GK=dd&&dd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(dd,"__esModule",{value:!0});dd.default=YK;var I1=GK(it("path"));function YK(r){return r.startsWith("\\\\?\\")?r:r.split(I1.default?.win32?.sep).join(I1.default?.posix?.sep??"/")}});var P1=F(pg=>{"use strict";Object.defineProperty(pg,"__esModule",{value:!0});pg.isWindows=void 0;var KK=/^win/.test(globalThis.process?globalThis.process.platform:""),QK=()=>KK;pg.isWindows=QK});var On=F(Rt=>{"use strict";var ZK=Rt&&Rt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),XK=Rt&&Rt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),e6=Rt&&Rt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&ZK(t,e,n[i]);return XK(t,e),t}})(),t6=Rt&&Rt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.parse=void 0;Rt.resolve=k1;Rt.cwd=T1;Rt.getProtocol=G_;Rt.getExtension=u6;Rt.stripQuery=q1;Rt.getHash=A1;Rt.stripHash=z_;Rt.isHttp=c6;Rt.isFileSystemPath=J_;Rt.fromFileSystemPath=f6;Rt.toFileSystemPath=d6;Rt.safePointerToPath=p6;Rt.relative=h6;var mg=t6(B_()),W_=e6(it("path")),r6=/\//g,n6=/^(\w{2,}):\/\//i,i6=/~1/g,s6=/~0/g,o6=it("path"),hg=P1(),a6=[[/\?/g,"%3F"],[/#/g,"%23"]],V_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],l6=r=>new URL(r);Rt.parse=l6;function k1(r,e){let t=new URL((0,mg.default)(r),"https://aaa.nonexistanturl.com"),n=new URL((0,mg.default)(e),t),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:a,hash:l}=n;return s+a+l+i}return n.toString()+i}function T1(){if(typeof window<"u")return location.href;let r=process.cwd(),e=r.slice(-1);return e==="/"||e==="\\"?r:r+"/"}function G_(r){let e=n6.exec(r||"");if(e)return e[1].toLowerCase()}function u6(r){let e=r.lastIndexOf(".");return e>=0?q1(r.substr(e).toLowerCase()):""}function q1(r){let e=r.indexOf("?");return e>=0&&(r=r.substr(0,e)),r}function A1(r){if(!r)return"#";let e=r.indexOf("#");return e>=0?r.substring(e):"#"}function z_(r){if(!r)return"";let e=r.indexOf("#");return e>=0&&(r=r.substring(0,e)),r}function c6(r){let e=G_(r);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function J_(r){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=G_(r);return e===void 0||e==="file"}function f6(r){if((0,hg.isWindows)()){let e=T1(),t=r.toUpperCase(),i=(0,mg.default)(e).toUpperCase(),s=t.includes(i),a=t.includes(i),l=W_.win32?.isAbsolute(r)||r.startsWith("http://")||r.startsWith("https://")||r.startsWith("file://");!(s||a||l)&&!e.startsWith("http")&&(r=(0,o6.join)(e,r)),r=(0,mg.default)(r)}r=encodeURI(r);for(let e of a6)r=r.replace(e[0],e[1]);return r}function d6(r,e){r=decodeURI(r);for(let n=0;n<V_.length;n+=2)r=r.replace(V_[n],V_[n+1]);let t=r.substr(0,7).toLowerCase()==="file://";return t&&(r=r[7]==="/"?r.substr(8):r.substr(7),(0,hg.isWindows)()&&r[1]==="/"&&(r=r[0]+":"+r.substr(1)),e?r="file:///"+r:(t=!1,r=(0,hg.isWindows)()?r:"/"+r)),(0,hg.isWindows)()&&!t&&(r=r.replace(r6,"\\"),r.substr(1,2)===":\\"&&(r=r[0].toUpperCase()+r.substr(1))),r}function p6(r){return r.length<=1||r[0]!=="#"||r[1]!=="/"?[]:r.slice(2).split("/").map(e=>decodeURIComponent(e).replace(i6,"/").replace(s6,"~"))}function h6(r,e){if(!J_(r)||!J_(e))return k1(r,e);let t=W_.default.dirname(z_(r)),n=z_(e);return W_.default.relative(t,n)+A1(e)}});var In=F(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.InvalidPointerError=qt.TimeoutError=qt.MissingPointerError=qt.UnmatchedResolverError=qt.ResolverError=qt.UnmatchedParserError=qt.ParserError=qt.JSONParserErrorGroup=qt.JSONParserError=void 0;qt.isHandledError=m6;qt.normalizeError=g6;var $1=ao(),gg=On(),ri=class extends Error{constructor(e,t){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=t,this.path=null,$1.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};qt.JSONParserError=ri;var yg=class r extends Error{constructor(e){super(),this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${(0,gg.toFileSystemPath)(e.$refs._root$Ref.path)}'`,$1.Ono.extend(this)}static getParserErrors(e){let t=[];for(let n of Object.values(e.$refs._$refs))n.errors&&t.push(...n.errors);return t}get errors(){return r.getParserErrors(this.files)}};qt.JSONParserErrorGroup=yg;var Y_=class extends ri{constructor(e,t){super(`Error parsing ${t}: ${e}`,t),this.code="EPARSER",this.name="ParserError"}};qt.ParserError=Y_;var K_=class extends ri{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};qt.UnmatchedParserError=K_;var Q_=class extends ri{constructor(e,t){super(e.message||`Error reading file "${t}"`,t),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};qt.ResolverError=Q_;var Z_=class extends ri{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};qt.UnmatchedResolverError=Z_;var X_=class extends ri{constructor(e,t,n,i,s){super(`Missing $ref pointer "${(0,gg.getHash)(t)}". Token "${e}" does not exist.`,(0,gg.stripHash)(t)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};qt.MissingPointerError=X_;var eR=class extends ri{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};qt.TimeoutError=eR;var tR=class extends ri{constructor(e,t){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,gg.stripHash)(t)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};qt.InvalidPointerError=tR;function m6(r){return r instanceof ri||r instanceof yg}function g6(r){return r.path===null&&(r.path=[]),r}});var pd=F(Wr=>{"use strict";var y6=Wr&&Wr.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),v6=Wr&&Wr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),b6=Wr&&Wr.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&y6(t,e,n[i]);return v6(t,e),t}})(),S6=Wr&&Wr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.nullSymbol=void 0;var rR=S6(Su()),nR=b6(On()),bg=In();Wr.nullSymbol=Symbol("null");var w6=/\//g,_6=/~/g,R6=/~1/g,C6=/~0/g,x6=r=>{try{return decodeURIComponent(r)}catch{return r}},Sg=class r{constructor(e,t,n){this.$ref=e,this.path=t,this.originalPath=n||t,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,t,n){let i=r.parse(this.path,this.originalPath),s=[];this.value=N1(e);for(let a=0;a<i.length;a++){if(vg(this,t,n)&&(this.path=r.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!D1(n)&&"$ref"in this.value)return this;let l=i[a];if(this.value[l]===void 0||this.value[l]===null&&a===i.length-1){let f=!1;for(let S=i.length-1;S>a;S--){let _=i.slice(a,S+1).join("/");if(this.value[_]!==void 0){this.value=this.value[_],a=S,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Wr.nullSymbol;continue}this.value=null;let d=this.$ref.path||"",h=this.path.replace(d,""),g=r.join("",s),y=n?.replace(d,"");throw new bg.MissingPointerError(l,decodeURI(this.originalPath),h,g,y)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&nR.resolve(this.path,this.value.$ref)!==n)&&vg(this,t,n),this}set(e,t,n){let i=r.parse(this.path),s;if(i.length===0)return this.value=t,t;this.value=N1(e);for(let a=0;a<i.length-1;a++)vg(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=M1(this,s,{});return vg(this,n),s=i[i.length-1],M1(this,s,t),e}static parse(e,t){let n=nR.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=x6(i[s].replace(R6,"/").replace(C6,"~"));if(i[0]!=="")throw new bg.InvalidPointerError(n,t===void 0?e:t);return i.slice(1)}static join(e,t){e.indexOf("#")===-1&&(e+="#"),t=Array.isArray(t)?t:[t];for(let n=0;n<t.length;n++){let i=t[n];e+="/"+encodeURIComponent(i.replace(_6,"~0").replace(w6,"~1"))}return e}};function vg(r,e,t){if(rR.default.isAllowed$Ref(r.value,e)){let n=nR.resolve(r.path,r.value.$ref);if(n===r.path&&!D1(t))r.circular=!0;else{let i=r.$ref.$refs._resolve(n,r.path,e);return i===null?!1:(r.indirections+=i.indirections+1,rR.default.isExtended$Ref(r.value)?(r.value=rR.default.dereference(r.value,i.value),!1):(r.$ref=i.$ref,r.path=i.path,r.value=i.value,!0))}}}Wr.default=Sg;function M1(r,e,t){if(r.value&&typeof r.value=="object")e==="-"&&Array.isArray(r.value)?r.value.push(t):r.value[e]=t;else throw new bg.JSONParserError(`Error assigning $ref pointer "${r.path}".
|
|
240
|
-
Cannot set "${e}" of a non-object.`);return t}function N1(r){if((0,
|
|
237
|
+
`+n:t||n}Ei.joinStacks=g1;function qK(r,e,t){t?Object.defineProperty(e,"stack",{get:()=>{let n=r.get.apply(e);return g1({stack:n},t)},enumerable:!1,configurable:!0}):AK(e,r)}Ei.lazyJoinStacks=qK;function y1(r){if(r){let e=r.split(IK),t;for(let n=0;n<e.length;n++){let i=e[n];if(PK.test(i))t===void 0&&(t=n);else if(t!==void 0){e.splice(t,n-t);break}}if(e.length>0)return e.join(`
|
|
238
|
+
`)}return r}function AK(r,e){Object.defineProperty(r,"stack",{get:()=>y1(e.get.apply(r)),enumerable:!1,configurable:!0})}});var w1=F(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.extendError=void 0;var b1=j_(),ag=v1(),S1=og(),$K=["name","message","stack"];function MK(r,e,t){let n=r;return NK(n,e),e&&typeof e=="object"&&DK(n,e),n.toJSON=S1.toJSON,b1.addInspectMethod&&b1.addInspectMethod(n),t&&typeof t=="object"&&Object.assign(n,t),n}lg.extendError=MK;function NK(r,e){let t=Object.getOwnPropertyDescriptor(r,"stack");ag.isLazyStack(t)?ag.lazyJoinStacks(t,r,e):ag.isWritableStack(t)&&(r.stack=ag.joinStacks(r,e))}function DK(r,e){let t=S1.getDeepKeys(e,$K),n=r,i=e;for(let s of t)if(n[s]===void 0)try{n[s]=i[s]}catch{}}});var _1=F(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.normalizeArgs=vu.normalizeOptions=void 0;var FK=j_();function LK(r){return r=r||{},{concatMessages:r.concatMessages===void 0?!0:!!r.concatMessages,format:r.format===void 0?FK.format:typeof r.format=="function"?r.format:!1}}vu.normalizeOptions=LK;function jK(r,e){let t,n,i,s="";return typeof r[0]=="string"?i=r:typeof r[1]=="string"?(r[0]instanceof Error?t=r[0]:n=r[0],i=r.slice(1)):(t=r[0],n=r[1],i=r.slice(2)),i.length>0&&(e.format?s=e.format.apply(void 0,i):s=i.join(" ")),e.concatMessages&&t&&t.message&&(s+=(s?`
|
|
239
|
+
`:"")+t.message),{originalError:t,props:n,message:s}}vu.normalizeArgs=jK});var H_=F(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});cg.Ono=void 0;var ug=w1(),R1=_1(),UK=og(),HK=U_;cg.Ono=HK;function U_(r,e){e=R1.normalizeOptions(e);function t(...n){let{originalError:i,props:s,message:a}=R1.normalizeArgs(n,e),l=new r(a);return ug.extendError(l,i,s)}return t[Symbol.species]=r,t}U_.toJSON=function(e){return UK.toJSON.call(e)};U_.extend=function(e,t,n){return n||t instanceof Error?ug.extendError(e,t,n):t?ug.extendError(e,void 0,t):ug.extendError(e)}});var C1=F(fg=>{"use strict";Object.defineProperty(fg,"__esModule",{value:!0});fg.ono=void 0;var Ca=H_(),BK=Oi;fg.ono=BK;Oi.error=new Ca.Ono(Error);Oi.eval=new Ca.Ono(EvalError);Oi.range=new Ca.Ono(RangeError);Oi.reference=new Ca.Ono(ReferenceError);Oi.syntax=new Ca.Ono(SyntaxError);Oi.type=new Ca.Ono(TypeError);Oi.uri=new Ca.Ono(URIError);var VK=Oi;function Oi(...r){let e=r[0];if(typeof e=="object"&&typeof e.name=="string"){for(let t of Object.values(VK))if(typeof t=="function"&&t.name==="ono"){let n=t[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return t.apply(void 0,r)}}return Oi.error.apply(void 0,r)}});var E1=F(x1=>{"use strict";Object.defineProperty(x1,"__esModule",{value:!0});var Lee=it("util")});var ao=F((ei,bu)=>{"use strict";var WK=ei&&ei.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),zK=ei&&ei.__exportStar||function(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&WK(e,r,t)};Object.defineProperty(ei,"__esModule",{value:!0});ei.ono=void 0;var O1=C1();Object.defineProperty(ei,"ono",{enumerable:!0,get:function(){return O1.ono}});var JK=H_();Object.defineProperty(ei,"Ono",{enumerable:!0,get:function(){return JK.Ono}});zK(E1(),ei);ei.default=O1.ono;typeof bu=="object"&&typeof bu.exports=="object"&&(bu.exports=Object.assign(bu.exports.default,bu.exports))});var B_=F(fd=>{"use strict";var GK=fd&&fd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fd,"__esModule",{value:!0});fd.default=YK;var I1=GK(it("path"));function YK(r){return r.startsWith("\\\\?\\")?r:r.split(I1.default?.win32?.sep).join(I1.default?.posix?.sep??"/")}});var P1=F(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});dg.isWindows=void 0;var KK=/^win/.test(globalThis.process?globalThis.process.platform:""),QK=()=>KK;dg.isWindows=QK});var On=F(Rt=>{"use strict";var ZK=Rt&&Rt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),XK=Rt&&Rt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),e6=Rt&&Rt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&ZK(t,e,n[i]);return XK(t,e),t}})(),t6=Rt&&Rt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.parse=void 0;Rt.resolve=k1;Rt.cwd=T1;Rt.getProtocol=G_;Rt.getExtension=u6;Rt.stripQuery=q1;Rt.getHash=A1;Rt.stripHash=z_;Rt.isHttp=c6;Rt.isFileSystemPath=J_;Rt.fromFileSystemPath=f6;Rt.toFileSystemPath=d6;Rt.safePointerToPath=p6;Rt.relative=h6;var hg=t6(B_()),W_=e6(it("path")),r6=/\//g,n6=/^(\w{2,}):\/\//i,i6=/~1/g,s6=/~0/g,o6=it("path"),pg=P1(),a6=[[/\?/g,"%3F"],[/#/g,"%23"]],V_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],l6=r=>new URL(r);Rt.parse=l6;function k1(r,e){let t=new URL((0,hg.default)(r),"https://aaa.nonexistanturl.com"),n=new URL((0,hg.default)(e),t),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:a,hash:l}=n;return s+a+l+i}return n.toString()+i}function T1(){if(typeof window<"u")return location.href;let r=process.cwd(),e=r.slice(-1);return e==="/"||e==="\\"?r:r+"/"}function G_(r){let e=n6.exec(r||"");if(e)return e[1].toLowerCase()}function u6(r){let e=r.lastIndexOf(".");return e>=0?q1(r.substr(e).toLowerCase()):""}function q1(r){let e=r.indexOf("?");return e>=0&&(r=r.substr(0,e)),r}function A1(r){if(!r)return"#";let e=r.indexOf("#");return e>=0?r.substring(e):"#"}function z_(r){if(!r)return"";let e=r.indexOf("#");return e>=0&&(r=r.substring(0,e)),r}function c6(r){let e=G_(r);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function J_(r){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=G_(r);return e===void 0||e==="file"}function f6(r){if((0,pg.isWindows)()){let e=T1(),t=r.toUpperCase(),i=(0,hg.default)(e).toUpperCase(),s=t.includes(i),a=t.includes(i),l=W_.win32?.isAbsolute(r)||r.startsWith("http://")||r.startsWith("https://")||r.startsWith("file://");!(s||a||l)&&!e.startsWith("http")&&(r=(0,o6.join)(e,r)),r=(0,hg.default)(r)}r=encodeURI(r);for(let e of a6)r=r.replace(e[0],e[1]);return r}function d6(r,e){r=decodeURI(r);for(let n=0;n<V_.length;n+=2)r=r.replace(V_[n],V_[n+1]);let t=r.substr(0,7).toLowerCase()==="file://";return t&&(r=r[7]==="/"?r.substr(8):r.substr(7),(0,pg.isWindows)()&&r[1]==="/"&&(r=r[0]+":"+r.substr(1)),e?r="file:///"+r:(t=!1,r=(0,pg.isWindows)()?r:"/"+r)),(0,pg.isWindows)()&&!t&&(r=r.replace(r6,"\\"),r.substr(1,2)===":\\"&&(r=r[0].toUpperCase()+r.substr(1))),r}function p6(r){return r.length<=1||r[0]!=="#"||r[1]!=="/"?[]:r.slice(2).split("/").map(e=>decodeURIComponent(e).replace(i6,"/").replace(s6,"~"))}function h6(r,e){if(!J_(r)||!J_(e))return k1(r,e);let t=W_.default.dirname(z_(r)),n=z_(e);return W_.default.relative(t,n)+A1(e)}});var In=F(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.InvalidPointerError=qt.TimeoutError=qt.MissingPointerError=qt.UnmatchedResolverError=qt.ResolverError=qt.UnmatchedParserError=qt.ParserError=qt.JSONParserErrorGroup=qt.JSONParserError=void 0;qt.isHandledError=m6;qt.normalizeError=g6;var $1=ao(),mg=On(),ti=class extends Error{constructor(e,t){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=t,this.path=null,$1.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};qt.JSONParserError=ti;var gg=class r extends Error{constructor(e){super(),this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${(0,mg.toFileSystemPath)(e.$refs._root$Ref.path)}'`,$1.Ono.extend(this)}static getParserErrors(e){let t=[];for(let n of Object.values(e.$refs._$refs))n.errors&&t.push(...n.errors);return t}get errors(){return r.getParserErrors(this.files)}};qt.JSONParserErrorGroup=gg;var Y_=class extends ti{constructor(e,t){super(`Error parsing ${t}: ${e}`,t),this.code="EPARSER",this.name="ParserError"}};qt.ParserError=Y_;var K_=class extends ti{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};qt.UnmatchedParserError=K_;var Q_=class extends ti{constructor(e,t){super(e.message||`Error reading file "${t}"`,t),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};qt.ResolverError=Q_;var Z_=class extends ti{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};qt.UnmatchedResolverError=Z_;var X_=class extends ti{constructor(e,t,n,i,s){super(`Missing $ref pointer "${(0,mg.getHash)(t)}". Token "${e}" does not exist.`,(0,mg.stripHash)(t)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};qt.MissingPointerError=X_;var eR=class extends ti{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};qt.TimeoutError=eR;var tR=class extends ti{constructor(e,t){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,mg.stripHash)(t)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};qt.InvalidPointerError=tR;function m6(r){return r instanceof ti||r instanceof gg}function g6(r){return r.path===null&&(r.path=[]),r}});var dd=F(Wr=>{"use strict";var y6=Wr&&Wr.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),v6=Wr&&Wr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),b6=Wr&&Wr.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&y6(t,e,n[i]);return v6(t,e),t}})(),S6=Wr&&Wr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.nullSymbol=void 0;var rR=S6(Su()),nR=b6(On()),vg=In();Wr.nullSymbol=Symbol("null");var w6=/\//g,_6=/~/g,R6=/~1/g,C6=/~0/g,x6=r=>{try{return decodeURIComponent(r)}catch{return r}},bg=class r{constructor(e,t,n){this.$ref=e,this.path=t,this.originalPath=n||t,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,t,n){let i=r.parse(this.path,this.originalPath),s=[];this.value=N1(e);for(let a=0;a<i.length;a++){if(yg(this,t,n)&&(this.path=r.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!D1(n)&&"$ref"in this.value)return this;let l=i[a];if(this.value[l]===void 0||this.value[l]===null&&a===i.length-1){let f=!1;for(let S=i.length-1;S>a;S--){let _=i.slice(a,S+1).join("/");if(this.value[_]!==void 0){this.value=this.value[_],a=S,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Wr.nullSymbol;continue}this.value=null;let d=this.$ref.path||"",h=this.path.replace(d,""),g=r.join("",s),y=n?.replace(d,"");throw new vg.MissingPointerError(l,decodeURI(this.originalPath),h,g,y)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&nR.resolve(this.path,this.value.$ref)!==n)&&yg(this,t,n),this}set(e,t,n){let i=r.parse(this.path),s;if(i.length===0)return this.value=t,t;this.value=N1(e);for(let a=0;a<i.length-1;a++)yg(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=M1(this,s,{});return yg(this,n),s=i[i.length-1],M1(this,s,t),e}static parse(e,t){let n=nR.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=x6(i[s].replace(R6,"/").replace(C6,"~"));if(i[0]!=="")throw new vg.InvalidPointerError(n,t===void 0?e:t);return i.slice(1)}static join(e,t){e.indexOf("#")===-1&&(e+="#"),t=Array.isArray(t)?t:[t];for(let n=0;n<t.length;n++){let i=t[n];e+="/"+encodeURIComponent(i.replace(_6,"~0").replace(w6,"~1"))}return e}};function yg(r,e,t){if(rR.default.isAllowed$Ref(r.value,e)){let n=nR.resolve(r.path,r.value.$ref);if(n===r.path&&!D1(t))r.circular=!0;else{let i=r.$ref.$refs._resolve(n,r.path,e);return i===null?!1:(r.indirections+=i.indirections+1,rR.default.isExtended$Ref(r.value)?(r.value=rR.default.dereference(r.value,i.value),!1):(r.$ref=i.$ref,r.path=i.path,r.value=i.value,!0))}}}Wr.default=bg;function M1(r,e,t){if(r.value&&typeof r.value=="object")e==="-"&&Array.isArray(r.value)?r.value.push(t):r.value[e]=t;else throw new vg.JSONParserError(`Error assigning $ref pointer "${r.path}".
|
|
240
|
+
Cannot set "${e}" of a non-object.`);return t}function N1(r){if((0,vg.isHandledError)(r))throw r;return r}function D1(r){return typeof r=="string"&&bg.parse(r).length==0}});var Su=F(os=>{"use strict";var E6=os&&os.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),O6=os&&os.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),I6=os&&os.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&E6(t,e,n[i]);return O6(t,e),t}})();Object.defineProperty(os,"__esModule",{value:!0});var Sg=I6(dd()),wg=In(),iR=On(),sR=class r{constructor(e){this.errors=[],this.$refs=e}addError(e){this.errors===void 0&&(this.errors=[]);let t=this.errors.map(({footprint:n})=>n);"errors"in e&&Array.isArray(e.errors)?this.errors.push(...e.errors.map(wg.normalizeError).filter(({footprint:n})=>!t.includes(n))):(!("footprint"in e)||!t.includes(e.footprint))&&this.errors.push((0,wg.normalizeError)(e))}exists(e,t){try{return this.resolve(e,t),!0}catch{return!1}}get(e,t){return this.resolve(e,t)?.value}resolve(e,t,n,i){let s=new Sg.default(this,e,n);try{let a=s.resolve(this.value,t,i);return a.value===Sg.nullSymbol&&(a.value=null),a}catch(a){if(!t||!t.continueOnError||!(0,wg.isHandledError)(a))throw a;return a.path===null&&(a.path=(0,iR.safePointerToPath)((0,iR.getHash)(i))),a instanceof wg.InvalidPointerError&&(a.source=decodeURI((0,iR.stripHash)(i))),this.addError(a),null}}set(e,t){let n=new Sg.default(this,e);this.value=n.set(this.value,t),this.value===Sg.nullSymbol&&(this.value=null)}static is$Ref(e){return!!e&&typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"&&e.$ref.length>0}static isExternal$Ref(e){return r.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,t){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||e.$ref==="#")return!0;if(e.$ref[0]!=="#"&&(!t||t.resolve?.external))return!0}}static isExtended$Ref(e){return r.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,t){if(t&&typeof t=="object"&&r.isExtended$Ref(e)){let n={};for(let i of Object.keys(e))i!=="$ref"&&(n[i]=e[i]);for(let i of Object.keys(t))i in n||(n[i]=t[i]);return n}else return t}};os.default=sR});var H1=F(ri=>{"use strict";var P6=ri&&ri.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),k6=ri&&ri.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),T6=ri&&ri.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&P6(t,e,n[i]);return k6(t,e),t}})(),U1=ri&&ri.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ri,"__esModule",{value:!0});var F1=ao(),q6=U1(Su()),lo=T6(On()),L1=U1(B_()),oR=class{paths(...e){return j1(this._$refs,e.flat()).map(n=>(0,L1.default)(n.decoded))}values(...e){let t=this._$refs;return j1(t,e.flat()).reduce((i,s)=>(i[(0,L1.default)(s.decoded)]=t[s.encoded].value,i),{})}exists(e,t){try{return this._resolve(e,"",t),!0}catch{return!1}}get(e,t){return this._resolve(e,"",t).value}set(e,t){let n=lo.resolve(this._root$Ref.path,e),i=lo.stripHash(n),s=this._$refs[i];if(!s)throw(0,F1.ono)(`Error resolving $ref pointer "${e}".
|
|
241
241
|
"${i}" not found.`);s.set(n,t)}_get$Ref(e){e=lo.resolve(this._root$Ref.path,e);let t=lo.stripHash(e);return this._$refs[t]}_add(e){let t=lo.stripHash(e),n=new q6.default(this);return n.path=t,this._$refs[t]=n,this._root$Ref=this._root$Ref||n,n}_resolve(e,t,n){let i=lo.resolve(this._root$Ref.path,e),s=lo.stripHash(i),a=this._$refs[s];if(!a)throw(0,F1.ono)(`Error resolving $ref pointer "${e}".
|
|
242
|
-
"${s}" not found.`);return a.resolve(i,n,e,t)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};
|
|
242
|
+
"${s}" not found.`);return a.resolve(i,n,e,t)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};ri.default=oR;function j1(r,e){let t=Object.keys(r);return e=Array.isArray(e[0])?e[0]:Array.prototype.slice.call(e),e.length>0&&e[0]&&(t=t.filter(n=>e.includes(r[n].pathType))),t.map(n=>({encoded:n,decoded:r[n].pathType==="file"?lo.toFileSystemPath(n,!0):n}))}});var V1=F(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.all=A6;wu.filter=$6;wu.sort=M6;wu.run=N6;function A6(r){return Object.keys(r||{}).filter(e=>typeof r[e]=="object").map(e=>(r[e].name=e,r[e]))}function $6(r,e,t){return r.filter(n=>!!B1(n,e,t))}function M6(r){for(let e of r)e.order=e.order||Number.MAX_SAFE_INTEGER;return r.sort((e,t)=>e.order-t.order)}async function N6(r,e,t,n){let i,s,a=0;return new Promise((l,f)=>{d();function d(){if(i=r[a++],!i)return f(s);try{let S=B1(i,e,t,h,n);if(S&&typeof S.then=="function")S.then(g,y);else if(S!==void 0)g(S);else if(a===r.length)throw new Error("No promise has been returned or callback has been called.")}catch(S){y(S)}}function h(S,_){S?y(S):g(_)}function g(S){l({plugin:i,result:S})}function y(S){s={plugin:i,error:S},d()}})}function B1(r,e,t,n,i){let s=r[e];if(typeof s=="function")return s.apply(r,[t,n,i]);if(!n){if(s instanceof RegExp)return s.test(t.url);if(typeof s=="string")return s===t.extension;if(Array.isArray(s))return s.indexOf(t.extension)!==-1}return s}});var lR=F(as=>{"use strict";var D6=as&&as.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),F6=as&&as.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),W1=as&&as.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&D6(t,e,n[i]);return F6(t,e),t}})();Object.defineProperty(as,"__esModule",{value:!0});var aR=ao(),L6=W1(On()),uo=W1(V1()),xa=In();async function j6(r,e,t){let n=r.indexOf("#"),i="";n>=0&&(i=r.substring(n),r=r.substring(0,n));let s=e._add(r),a={url:r,hash:i,extension:L6.getExtension(r)};try{let l=await U6(a,t,e);s.pathType=l.plugin.name,a.data=l.result;let f=await H6(a,t,e);return s.value=f.result,f.result}catch(l){throw(0,xa.isHandledError)(l)&&(s.value=l),l}}async function U6(r,e,t){let n=uo.all(e.resolve);n=uo.filter(n,"canRead",r),uo.sort(n);try{return await uo.run(n,"read",r,t)}catch(i){throw!i&&e.continueOnError?new xa.UnmatchedResolverError(r.url):!i||!("error"in i)?aR.ono.syntax(`Unable to resolve $ref pointer "${r.url}"`):i.error instanceof xa.ResolverError?i.error:new xa.ResolverError(i,r.url)}}async function H6(r,e,t){let n=uo.all(e.parse),i=uo.filter(n,"canParse",r),s=i.length>0?i:n;uo.sort(s);try{let a=await uo.run(s,"parse",r,t);if(!a.plugin.allowEmpty&&B6(a.result))throw aR.ono.syntax(`Error parsing "${r.url}" as ${a.plugin.name}.
|
|
243
243
|
Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new xa.UnmatchedParserError(r.url):a&&a.message&&a.message.startsWith("Error parsing")?a:!a||!("error"in a)?aR.ono.syntax(`Unable to parse ${r.url}`):a.error instanceof xa.ParserError?a.error:new xa.ParserError(a.error.message,r.url)}}function B6(r){return r===void 0||typeof r=="object"&&Object.keys(r).length===0||typeof r=="string"&&r.trim().length===0||Buffer.isBuffer(r)&&r.length===0}as.default=j6});var J1=F(uR=>{"use strict";Object.defineProperty(uR,"__esModule",{value:!0});var z1=In();uR.default={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(r){let e=r.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string"){if(e.trim().length===0)return;try{return JSON.parse(e)}catch(t){if(this.allowBOM)try{let n=e.indexOf("{");return e=e.slice(n),JSON.parse(e)}catch(n){throw new z1.ParserError(n.message,r.url)}throw new z1.ParserError(t.message,r.url)}}else return e}}});var _u=F((Qee,Ea)=>{"use strict";function G1(r){return typeof r>"u"||r===null}function V6(r){return typeof r=="object"&&r!==null}function W6(r){return Array.isArray(r)?r:G1(r)?[]:[r]}function z6(r,e){if(e){let t=Object.keys(e);for(let n=0,i=t.length;n<i;n+=1){let s=t[n];r[s]=e[s]}}return r}function J6(r,e){let t="";for(let n=0;n<e;n+=1)t+=r;return t}function G6(r){return r===0&&Number.NEGATIVE_INFINITY===1/r}Ea.exports.isNothing=G1;Ea.exports.isObject=V6;Ea.exports.toArray=W6;Ea.exports.repeat=J6;Ea.exports.isNegativeZero=G6;Ea.exports.extend=z6});var Ru=F((Zee,K1)=>{"use strict";function Y1(r,e){let t="",n=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(t+='in "'+r.mark.name+'" '),t+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!e&&r.mark.snippet&&(t+=`
|
|
244
244
|
|
|
245
|
-
`+r.mark.snippet),n+" "+t):n}function
|
|
246
|
-
`+l}let h=cR(r.buffer,n[a],i[a],r.position,d);l+=
|
|
247
|
-
`,l+=
|
|
248
|
-
`;for(let g=1;g<=e.linesAfter&&!(a+g>=i.length);g++){let y=cR(r.buffer,n[a+g],i[a+g],r.position-(n[a]-n[a+g]),d);l+=
|
|
249
|
-
`}return l.replace(/\n$/,"")}Q1.exports=Y6});var pr=F((ete,eq)=>{"use strict";var X1=Ru(),K6=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Q6=["scalar","sequence","mapping"];function Z6(r){let e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(n){e[String(n)]=t})}),e}function X6(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(K6.indexOf(t)===-1)throw new X1('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.options=e,this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=Z6(e.styleAliases||null),Q6.indexOf(this.kind)===-1)throw new X1('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}eq.exports=X6});var hR=F((tte,rq)=>{"use strict";var
|
|
250
|
-
\r`;function N4(r){if(r===null)return!1;let e=0,t=r.length,n=OR;for(let i=0;i<t;i++){let s=n.indexOf(r.charAt(i));if(!(s>64)){if(s<0)return!1;e+=6}}return e%8===0}function D4(r){let e=r.replace(/[\r\n=]/g,""),t=e.length,n=OR,i=0,s=[];for(let l=0;l<t;l++)l%4===0&&l&&(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)),i=i<<6|n.indexOf(e.charAt(l));let a=t%4*6;return a===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):a===18?(s.push(i>>10&255),s.push(i>>2&255)):a===12&&s.push(i>>4&255),new Uint8Array(s)}function F4(r){let e="",t=0,n=r.length,i=OR;for(let a=0;a<n;a++)a%3===0&&a&&(e+=i[t>>18&63],e+=i[t>>12&63],e+=i[t>>6&63],e+=i[t&63]),t=(t<<8)+r[a];let s=n%3;return s===0?(e+=i[t>>18&63],e+=i[t>>12&63],e+=i[t>>6&63],e+=i[t&63]):s===2?(e+=i[t>>10&63],e+=i[t>>4&63],e+=i[t<<2&63],e+=i[64]):s===1&&(e+=i[t>>2&63],e+=i[t<<4&63],e+=i[64],e+=i[64]),e}function L4(r){return Object.prototype.toString.call(r)==="[object Uint8Array]"}vq.exports=new M4("tag:yaml.org,2002:binary",{kind:"scalar",resolve:N4,construct:D4,predicate:L4,represent:F4})});var PR=F((mte,bq)=>{"use strict";var j4=pr(),U4=Object.prototype.hasOwnProperty,H4=Object.prototype.toString;function B4(r){if(r===null)return!0;let e=[],t=r;for(let n=0,i=t.length;n<i;n+=1){let s=t[n],a=!1;if(H4.call(s)!=="[object Object]")return!1;let l;for(l in s)if(U4.call(s,l))if(!a)a=!0;else return!1;if(!a)return!1;if(e.indexOf(l)===-1)e.push(l);else return!1}return!0}function V4(r){return r!==null?r:[]}bq.exports=new j4("tag:yaml.org,2002:omap",{kind:"sequence",resolve:B4,construct:V4})});var kR=F((gte,Sq)=>{"use strict";var W4=pr(),z4=Object.prototype.toString;function J4(r){if(r===null)return!0;let e=r,t=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n];if(z4.call(s)!=="[object Object]")return!1;let a=Object.keys(s);if(a.length!==1)return!1;t[n]=[a[0],s[a[0]]]}return!0}function G4(r){if(r===null)return[];let e=r,t=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n],a=Object.keys(s);t[n]=[a[0],s[a[0]]]}return t}Sq.exports=new W4("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:J4,construct:G4})});var TR=F((yte,wq)=>{"use strict";var Y4=pr(),K4=Object.prototype.hasOwnProperty;function Q4(r){if(r===null)return!0;let e=r;for(let t in e)if(K4.call(e,t)&&e[t]!==null)return!1;return!0}function Z4(r){return r!==null?r:{}}wq.exports=new Y4("tag:yaml.org,2002:set",{kind:"mapping",resolve:Q4,construct:Z4})});var
|
|
251
|
-
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function l3(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}function Mq(r,e,t){e==="__proto__"?Object.defineProperty(r,e,{configurable:!0,enumerable:!0,writable:!0,value:t}):r[e]=t}var Nq=new Array(256),Dq=new Array(256);for(let r=0;r<256;r++)Nq[r]=xq(r)?1:0,Dq[r]=xq(r);function u3(r,e){this.input=r,this.filename=e.filename||null,this.schema=e.schema||e3,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:100,this.maxMergeSeqLength=typeof e.maxMergeSeqLength=="number"?e.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function Fq(r,e){let t={name:r.filename,buffer:r.input.slice(0,-1),position:r.position,line:r.line,column:r.position-r.lineStart};return t.snippet=X4(t),new kq(e,t)}function fe(r,e){throw Fq(r,e)}function
|
|
252
|
-
`,e-1))}function p3(r,e,t){let n,i,s,a,l,f,d=r.kind,h=r.result,g=r.input.charCodeAt(r.position);if(zr(g)||Cu(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96)return!1;if(g===63||g===45){let y=r.input.charCodeAt(r.position+1);if(zr(y)||t&&Cu(y))return!1}for(r.kind="scalar",r.result="",n=i=r.position,s=!1;g!==0;){if(g===58){let y=r.input.charCodeAt(r.position+1);if(zr(y)||t&&Cu(y))break}else if(g===35){let y=r.input.charCodeAt(r.position-1);if(zr(y))break}else{if(r.position===r.lineStart&&
|
|
245
|
+
`+r.mark.snippet),n+" "+t):n}function pd(r,e){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=e,this.message=Y1(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}pd.prototype=Object.create(Error.prototype);pd.prototype.constructor=pd;pd.prototype.toString=function(e){return this.name+": "+Y1(this,e)};K1.exports=pd});var Z1=F((Xee,Q1)=>{"use strict";var hd=_u();function cR(r,e,t,n,i){let s="",a="",l=Math.floor(i/2)-1;return n-e>l&&(s=" ... ",e=n-l+s.length),t-n>l&&(a=" ...",t=n+l-a.length),{str:s+r.slice(e,t).replace(/\t/g,"\u2192")+a,pos:n-e+s.length}}function fR(r,e){return hd.repeat(" ",e-r.length)+r}function Y6(r,e){if(e=Object.create(e||null),!r.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);let t=/\r?\n|\r|\0/g,n=[0],i=[],s,a=-1;for(;s=t.exec(r.buffer);)i.push(s.index),n.push(s.index+s[0].length),r.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);let l="",f=Math.min(r.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+f+3);for(let g=1;g<=e.linesBefore&&!(a-g<0);g++){let y=cR(r.buffer,n[a-g],i[a-g],r.position-(n[a]-n[a-g]),d);l=hd.repeat(" ",e.indent)+fR((r.line-g+1).toString(),f)+" | "+y.str+`
|
|
246
|
+
`+l}let h=cR(r.buffer,n[a],i[a],r.position,d);l+=hd.repeat(" ",e.indent)+fR((r.line+1).toString(),f)+" | "+h.str+`
|
|
247
|
+
`,l+=hd.repeat("-",e.indent+f+3+h.pos)+`^
|
|
248
|
+
`;for(let g=1;g<=e.linesAfter&&!(a+g>=i.length);g++){let y=cR(r.buffer,n[a+g],i[a+g],r.position-(n[a]-n[a+g]),d);l+=hd.repeat(" ",e.indent)+fR((r.line+g+1).toString(),f)+" | "+y.str+`
|
|
249
|
+
`}return l.replace(/\n$/,"")}Q1.exports=Y6});var pr=F((ete,eq)=>{"use strict";var X1=Ru(),K6=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Q6=["scalar","sequence","mapping"];function Z6(r){let e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(n){e[String(n)]=t})}),e}function X6(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(K6.indexOf(t)===-1)throw new X1('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.options=e,this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=Z6(e.styleAliases||null),Q6.indexOf(this.kind)===-1)throw new X1('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}eq.exports=X6});var hR=F((tte,rq)=>{"use strict";var md=Ru(),dR=pr();function tq(r,e){let t=[];return r[e].forEach(function(n){let i=t.length;t.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=a)}),t[i]=n}),t}function e4(){let r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function e(t){t.multi?(r.multi[t.kind].push(t),r.multi.fallback.push(t)):r[t.kind][t.tag]=r.fallback[t.tag]=t}for(let t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(e);return r}function pR(r){return this.extend(r)}pR.prototype.extend=function(e){let t=[],n=[];if(e instanceof dR)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new md("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(s){if(!(s instanceof dR))throw new md("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new md("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new md("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof dR))throw new md("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(pR.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=tq(i,"implicit"),i.compiledExplicit=tq(i,"explicit"),i.compiledTypeMap=e4(i.compiledImplicit,i.compiledExplicit),i};rq.exports=pR});var mR=F((rte,nq)=>{"use strict";var t4=pr();nq.exports=new t4("tag:yaml.org,2002:str",{kind:"scalar",construct:function(r){return r!==null?r:""}})});var gR=F((nte,iq)=>{"use strict";var r4=pr();iq.exports=new r4("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}})});var yR=F((ite,sq)=>{"use strict";var n4=pr();sq.exports=new n4("tag:yaml.org,2002:map",{kind:"mapping",construct:function(r){return r!==null?r:{}}})});var vR=F((ste,oq)=>{"use strict";var i4=hR();oq.exports=new i4({explicit:[mR(),gR(),yR()]})});var bR=F((ote,aq)=>{"use strict";var s4=pr();function o4(r){if(r===null)return!0;let e=r.length;return e===1&&r==="~"||e===4&&(r==="null"||r==="Null"||r==="NULL")}function a4(){return null}function l4(r){return r===null}aq.exports=new s4("tag:yaml.org,2002:null",{kind:"scalar",resolve:o4,construct:a4,predicate:l4,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var SR=F((ate,lq)=>{"use strict";var u4=pr();function c4(r){if(r===null)return!1;let e=r.length;return e===4&&(r==="true"||r==="True"||r==="TRUE")||e===5&&(r==="false"||r==="False"||r==="FALSE")}function f4(r){return r==="true"||r==="True"||r==="TRUE"}function d4(r){return Object.prototype.toString.call(r)==="[object Boolean]"}lq.exports=new u4("tag:yaml.org,2002:bool",{kind:"scalar",resolve:c4,construct:f4,predicate:d4,represent:{lowercase:function(r){return r?"true":"false"},uppercase:function(r){return r?"TRUE":"FALSE"},camelcase:function(r){return r?"True":"False"}},defaultStyle:"lowercase"})});var wR=F((lte,uq)=>{"use strict";var p4=_u(),h4=pr();function m4(r){return r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102}function g4(r){return r>=48&&r<=55}function y4(r){return r>=48&&r<=57}function v4(r){if(r===null)return!1;let e=r.length,t=0,n=!1;if(!e)return!1;let i=r[t];if((i==="-"||i==="+")&&(i=r[++t]),i==="0"){if(t+1===e)return!0;if(i=r[++t],i==="b"){for(t++;t<e;t++){if(i=r[t],i!=="0"&&i!=="1")return!1;n=!0}return n&&Number.isFinite(gd(r))}if(i==="x"){for(t++;t<e;t++){if(!m4(r.charCodeAt(t)))return!1;n=!0}return n&&Number.isFinite(gd(r))}if(i==="o"){for(t++;t<e;t++){if(!g4(r.charCodeAt(t)))return!1;n=!0}return n&&Number.isFinite(gd(r))}}for(;t<e;t++){if(!y4(r.charCodeAt(t)))return!1;n=!0}return n?Number.isFinite(gd(r)):!1}function gd(r){let e=r,t=1,n=e[0];if((n==="-"||n==="+")&&(n==="-"&&(t=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return t*parseInt(e.slice(2),2);if(e[1]==="x")return t*parseInt(e.slice(2),16);if(e[1]==="o")return t*parseInt(e.slice(2),8)}return t*parseInt(e,10)}function b4(r){return gd(r)}function S4(r){return Object.prototype.toString.call(r)==="[object Number]"&&r%1===0&&!p4.isNegativeZero(r)}uq.exports=new h4("tag:yaml.org,2002:int",{kind:"scalar",resolve:v4,construct:b4,predicate:S4,represent:{binary:function(r){return r>=0?"0b"+r.toString(2):"-0b"+r.toString(2).slice(1)},octal:function(r){return r>=0?"0o"+r.toString(8):"-0o"+r.toString(8).slice(1)},decimal:function(r){return r.toString(10)},hexadecimal:function(r){return r>=0?"0x"+r.toString(16).toUpperCase():"-0x"+r.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var _R=F((ute,fq)=>{"use strict";var cq=_u(),w4=pr(),_4=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),R4=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function C4(r){return r===null||!_4.test(r)?!1:Number.isFinite(parseFloat(r,10))?!0:R4.test(r)}function x4(r){let e=r.toLowerCase(),t=e[0]==="-"?-1:1;return"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:t*parseFloat(e,10)}var E4=/^[-+]?[0-9]+e/;function O4(r,e){if(isNaN(r))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===r)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===r)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(cq.isNegativeZero(r))return"-0.0";let t=r.toString(10);return E4.test(t)?t.replace("e",".e"):t}function I4(r){return Object.prototype.toString.call(r)==="[object Number]"&&(r%1!==0||cq.isNegativeZero(r))}fq.exports=new w4("tag:yaml.org,2002:float",{kind:"scalar",resolve:C4,construct:x4,predicate:I4,represent:O4,defaultStyle:"lowercase"})});var RR=F((cte,dq)=>{"use strict";dq.exports=vR().extend({implicit:[bR(),SR(),wR(),_R()]})});var CR=F((fte,pq)=>{"use strict";pq.exports=RR()});var xR=F((dte,gq)=>{"use strict";var P4=pr(),hq=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),mq=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function k4(r){return r===null?!1:hq.exec(r)!==null||mq.exec(r)!==null}function T4(r){let e=0,t=null,n=hq.exec(r);if(n===null&&(n=mq.exec(r)),n===null)throw new Error("Date resolve error");let i=+n[1],s=+n[2]-1,a=+n[3];if(!n[4])return new Date(Date.UTC(i,s,a));let l=+n[4],f=+n[5],d=+n[6];if(n[7]){for(e=n[7].slice(0,3);e.length<3;)e+="0";e=+e}if(n[9]){let g=+n[10],y=+(n[11]||0);t=(g*60+y)*6e4,n[9]==="-"&&(t=-t)}let h=new Date(Date.UTC(i,s,a,l,f,d,e));return t&&h.setTime(h.getTime()-t),h}function q4(r){return r.toISOString()}gq.exports=new P4("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:k4,construct:T4,instanceOf:Date,represent:q4})});var ER=F((pte,yq)=>{"use strict";var A4=pr();function $4(r){return r==="<<"||r===null}yq.exports=new A4("tag:yaml.org,2002:merge",{kind:"scalar",resolve:$4})});var IR=F((hte,vq)=>{"use strict";var M4=pr(),OR=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
250
|
+
\r`;function N4(r){if(r===null)return!1;let e=0,t=r.length,n=OR;for(let i=0;i<t;i++){let s=n.indexOf(r.charAt(i));if(!(s>64)){if(s<0)return!1;e+=6}}return e%8===0}function D4(r){let e=r.replace(/[\r\n=]/g,""),t=e.length,n=OR,i=0,s=[];for(let l=0;l<t;l++)l%4===0&&l&&(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)),i=i<<6|n.indexOf(e.charAt(l));let a=t%4*6;return a===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):a===18?(s.push(i>>10&255),s.push(i>>2&255)):a===12&&s.push(i>>4&255),new Uint8Array(s)}function F4(r){let e="",t=0,n=r.length,i=OR;for(let a=0;a<n;a++)a%3===0&&a&&(e+=i[t>>18&63],e+=i[t>>12&63],e+=i[t>>6&63],e+=i[t&63]),t=(t<<8)+r[a];let s=n%3;return s===0?(e+=i[t>>18&63],e+=i[t>>12&63],e+=i[t>>6&63],e+=i[t&63]):s===2?(e+=i[t>>10&63],e+=i[t>>4&63],e+=i[t<<2&63],e+=i[64]):s===1&&(e+=i[t>>2&63],e+=i[t<<4&63],e+=i[64],e+=i[64]),e}function L4(r){return Object.prototype.toString.call(r)==="[object Uint8Array]"}vq.exports=new M4("tag:yaml.org,2002:binary",{kind:"scalar",resolve:N4,construct:D4,predicate:L4,represent:F4})});var PR=F((mte,bq)=>{"use strict";var j4=pr(),U4=Object.prototype.hasOwnProperty,H4=Object.prototype.toString;function B4(r){if(r===null)return!0;let e=[],t=r;for(let n=0,i=t.length;n<i;n+=1){let s=t[n],a=!1;if(H4.call(s)!=="[object Object]")return!1;let l;for(l in s)if(U4.call(s,l))if(!a)a=!0;else return!1;if(!a)return!1;if(e.indexOf(l)===-1)e.push(l);else return!1}return!0}function V4(r){return r!==null?r:[]}bq.exports=new j4("tag:yaml.org,2002:omap",{kind:"sequence",resolve:B4,construct:V4})});var kR=F((gte,Sq)=>{"use strict";var W4=pr(),z4=Object.prototype.toString;function J4(r){if(r===null)return!0;let e=r,t=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n];if(z4.call(s)!=="[object Object]")return!1;let a=Object.keys(s);if(a.length!==1)return!1;t[n]=[a[0],s[a[0]]]}return!0}function G4(r){if(r===null)return[];let e=r,t=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n],a=Object.keys(s);t[n]=[a[0],s[a[0]]]}return t}Sq.exports=new W4("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:J4,construct:G4})});var TR=F((yte,wq)=>{"use strict";var Y4=pr(),K4=Object.prototype.hasOwnProperty;function Q4(r){if(r===null)return!0;let e=r;for(let t in e)if(K4.call(e,t)&&e[t]!==null)return!1;return!0}function Z4(r){return r!==null?r:{}}wq.exports=new Y4("tag:yaml.org,2002:set",{kind:"mapping",resolve:Q4,construct:Z4})});var _g=F((vte,_q)=>{"use strict";_q.exports=CR().extend({implicit:[xR(),ER()],explicit:[IR(),PR(),kR(),TR()]})});var Hq=F((bte,MR)=>{"use strict";var Oa=_u(),kq=Ru(),X4=Z1(),e3=_g(),ni=Object.prototype.hasOwnProperty,Rg=1,Tq=2,qq=3,Cg=4,qR=1,t3=2,Rq=3,r3=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,n3=/[\x85\u2028\u2029]/,i3=/[,\[\]{}]/,Aq=/^(?:!|!!|![0-9A-Za-z-]+!)$/,$q=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function Cq(r){return Object.prototype.toString.call(r)}function Ii(r){return r===10||r===13}function ls(r){return r===9||r===32}function zr(r){return r===9||r===32||r===10||r===13}function Cu(r){return r===44||r===91||r===93||r===123||r===125}function s3(r){if(r>=48&&r<=57)return r-48;let e=r|32;return e>=97&&e<=102?e-97+10:-1}function o3(r){return r===120?2:r===117?4:r===85?8:0}function a3(r){return r>=48&&r<=57?r-48:-1}function xq(r){switch(r){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
251
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function l3(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}function Mq(r,e,t){e==="__proto__"?Object.defineProperty(r,e,{configurable:!0,enumerable:!0,writable:!0,value:t}):r[e]=t}var Nq=new Array(256),Dq=new Array(256);for(let r=0;r<256;r++)Nq[r]=xq(r)?1:0,Dq[r]=xq(r);function u3(r,e){this.input=r,this.filename=e.filename||null,this.schema=e.schema||e3,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:100,this.maxMergeSeqLength=typeof e.maxMergeSeqLength=="number"?e.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function Fq(r,e){let t={name:r.filename,buffer:r.input.slice(0,-1),position:r.position,line:r.line,column:r.position-r.lineStart};return t.snippet=X4(t),new kq(e,t)}function fe(r,e){throw Fq(r,e)}function xg(r,e){r.onWarning&&r.onWarning.call(null,Fq(r,e))}function Ia(r,e,t){let n=r.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];ni.call(i,e)||(i[e]={existed:ni.call(r.anchorMap,e),value:r.anchorMap[e]})}r.anchorMap[e]=t}function c3(r){r.anchorMapTransactions.push(Object.create(null))}function f3(r){let e=r.anchorMapTransactions.pop(),t=r.anchorMapTransactions;if(t.length===0)return;let n=t[t.length-1],i=Object.keys(e);for(let s=0,a=i.length;s<a;s+=1){let l=i[s];ni.call(n,l)||(n[l]=e[l])}}function d3(r){let e=r.anchorMapTransactions.pop(),t=Object.keys(e);for(let n=t.length-1;n>=0;n-=1){let i=e[t[n]];i.existed?r.anchorMap[t[n]]=i.value:delete r.anchorMap[t[n]]}}function Lq(r){return{position:r.position,line:r.line,lineStart:r.lineStart,lineIndent:r.lineIndent,firstTabInLine:r.firstTabInLine,tag:r.tag,anchor:r.anchor,kind:r.kind,result:r.result}}function Eq(r,e){r.position=e.position,r.line=e.line,r.lineStart=e.lineStart,r.lineIndent=e.lineIndent,r.firstTabInLine=e.firstTabInLine,r.tag=e.tag,r.anchor=e.anchor,r.kind=e.kind,r.result=e.result}var Oq={YAML:function(e,t,n){e.version!==null&&fe(e,"duplication of %YAML directive"),n.length!==1&&fe(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&fe(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),a=parseInt(i[2],10);s!==1&&fe(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&xg(e,"unsupported YAML version of the document")},TAG:function(e,t,n){let i;n.length!==2&&fe(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],Aq.test(s)||fe(e,"ill-formed tag handle (first argument) of the TAG directive"),ni.call(e.tagMap,s)&&fe(e,'there is a previously declared suffix for "'+s+'" tag handle'),$q.test(i)||fe(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{fe(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}};function co(r,e,t,n){if(e<t){let i=r.input.slice(e,t);if(n)for(let s=0,a=i.length;s<a;s+=1){let l=i.charCodeAt(s);l===9||l>=32&&l<=1114111||fe(r,"expected valid JSON character")}else r3.test(i)&&fe(r,"the stream contains non-printable characters");r.result+=i}}function Iq(r,e,t,n){Oa.isObject(t)||fe(r,"cannot merge mappings; the provided source object is unacceptable");let i=Object.keys(t);for(let s=0,a=i.length;s<a;s+=1){let l=i[s];ni.call(e,l)||(Mq(e,l,t[l]),n[l]=!0)}}function xu(r,e,t,n,i,s,a,l,f){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let d=0,h=i.length;d<h;d+=1)Array.isArray(i[d])&&fe(r,"nested arrays are not supported inside keys"),typeof i=="object"&&Cq(i[d])==="[object Object]"&&(i[d]="[object Object]")}if(typeof i=="object"&&Cq(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s)){s.length>r.maxMergeSeqLength&&fe(r,"merge sequence length exceeded maxMergeSeqLength ("+r.maxMergeSeqLength+")");let d=new Set;for(let h=0,g=s.length;h<g;h+=1){let y=s[h];d.has(y)||(d.add(y),Iq(r,e,y,t))}}else Iq(r,e,s,t);else!r.json&&!ni.call(t,i)&&ni.call(e,i)&&(r.line=a||r.line,r.lineStart=l||r.lineStart,r.position=f||r.position,fe(r,"duplicated mapping key")),Mq(e,i,s),delete t[i];return e}function AR(r){let e=r.input.charCodeAt(r.position);e===10?r.position++:e===13?(r.position++,r.input.charCodeAt(r.position)===10&&r.position++):fe(r,"a line break is expected"),r.line+=1,r.lineStart=r.position,r.firstTabInLine=-1}function Ut(r,e,t){let n=0,i=r.input.charCodeAt(r.position);for(;i!==0;){for(;ls(i);)i===9&&r.firstTabInLine===-1&&(r.firstTabInLine=r.position),i=r.input.charCodeAt(++r.position);if(e&&i===35)do i=r.input.charCodeAt(++r.position);while(i!==10&&i!==13&&i!==0);if(Ii(i))for(AR(r),i=r.input.charCodeAt(r.position),n++,r.lineIndent=0;i===32;)r.lineIndent++,i=r.input.charCodeAt(++r.position);else break}return t!==-1&&n!==0&&r.lineIndent<t&&xg(r,"deficient indentation"),n}function Eg(r){let e=r.position,t=r.input.charCodeAt(e);return!!((t===45||t===46)&&t===r.input.charCodeAt(e+1)&&t===r.input.charCodeAt(e+2)&&(e+=3,t=r.input.charCodeAt(e),t===0||zr(t)))}function $R(r,e){e===1?r.result+=" ":e>1&&(r.result+=Oa.repeat(`
|
|
252
|
+
`,e-1))}function p3(r,e,t){let n,i,s,a,l,f,d=r.kind,h=r.result,g=r.input.charCodeAt(r.position);if(zr(g)||Cu(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96)return!1;if(g===63||g===45){let y=r.input.charCodeAt(r.position+1);if(zr(y)||t&&Cu(y))return!1}for(r.kind="scalar",r.result="",n=i=r.position,s=!1;g!==0;){if(g===58){let y=r.input.charCodeAt(r.position+1);if(zr(y)||t&&Cu(y))break}else if(g===35){let y=r.input.charCodeAt(r.position-1);if(zr(y))break}else{if(r.position===r.lineStart&&Eg(r)||t&&Cu(g))break;if(Ii(g))if(a=r.line,l=r.lineStart,f=r.lineIndent,Ut(r,!1,-1),r.lineIndent>=e){s=!0,g=r.input.charCodeAt(r.position);continue}else{r.position=i,r.line=a,r.lineStart=l,r.lineIndent=f;break}}s&&(co(r,n,i,!1),$R(r,r.line-a),n=i=r.position,s=!1),ls(g)||(i=r.position+1),g=r.input.charCodeAt(++r.position)}return co(r,n,i,!1),r.result?!0:(r.kind=d,r.result=h,!1)}function h3(r,e){let t,n,i=r.input.charCodeAt(r.position);if(i!==39)return!1;for(r.kind="scalar",r.result="",r.position++,t=n=r.position;(i=r.input.charCodeAt(r.position))!==0;)if(i===39)if(co(r,t,r.position,!0),i=r.input.charCodeAt(++r.position),i===39)t=r.position,r.position++,n=r.position;else return!0;else Ii(i)?(co(r,t,n,!0),$R(r,Ut(r,!1,e)),t=n=r.position):r.position===r.lineStart&&Eg(r)?fe(r,"unexpected end of the document within a single quoted scalar"):(r.position++,ls(i)||(n=r.position));fe(r,"unexpected end of the stream within a single quoted scalar")}function m3(r,e){let t,n,i,s=r.input.charCodeAt(r.position);if(s!==34)return!1;for(r.kind="scalar",r.result="",r.position++,t=n=r.position;(s=r.input.charCodeAt(r.position))!==0;){if(s===34)return co(r,t,r.position,!0),r.position++,!0;if(s===92){if(co(r,t,r.position,!0),s=r.input.charCodeAt(++r.position),Ii(s))Ut(r,!1,e);else if(s<256&&Nq[s])r.result+=Dq[s],r.position++;else if((i=o3(s))>0){let a=i,l=0;for(;a>0;a--)s=r.input.charCodeAt(++r.position),(i=s3(s))>=0?l=(l<<4)+i:fe(r,"expected hexadecimal character");r.result+=l3(l),r.position++}else fe(r,"unknown escape sequence");t=n=r.position}else Ii(s)?(co(r,t,n,!0),$R(r,Ut(r,!1,e)),t=n=r.position):r.position===r.lineStart&&Eg(r)?fe(r,"unexpected end of the document within a double quoted scalar"):(r.position++,ls(s)||(n=r.position))}fe(r,"unexpected end of the stream within a double quoted scalar")}function g3(r,e){let t=!0,n,i,s,a=r.tag,l,f=r.anchor,d,h,g,y,S=Object.create(null),_,R,I,q=r.input.charCodeAt(r.position);if(q===91)d=93,y=!1,l=[];else if(q===123)d=125,y=!0,l={};else return!1;for(r.anchor!==null&&Ia(r,r.anchor,l),q=r.input.charCodeAt(++r.position);q!==0;){if(Ut(r,!0,e),q=r.input.charCodeAt(r.position),q===d)return r.position++,r.tag=a,r.anchor=f,r.kind=y?"mapping":"sequence",r.result=l,!0;if(t?q===44&&fe(r,"expected the node content, but found ','"):fe(r,"missed comma between flow collection entries"),R=_=I=null,h=g=!1,q===63){let j=r.input.charCodeAt(r.position+1);zr(j)&&(h=g=!0,r.position++,Ut(r,!0,e))}n=r.line,i=r.lineStart,s=r.position,Eu(r,e,Rg,!1,!0),R=r.tag,_=r.result,Ut(r,!0,e),q=r.input.charCodeAt(r.position),(g||r.line===n)&&q===58&&(h=!0,q=r.input.charCodeAt(++r.position),Ut(r,!0,e),Eu(r,e,Rg,!1,!0),I=r.result),y?xu(r,l,S,R,_,I,n,i,s):h?l.push(xu(r,null,S,R,_,I,n,i,s)):l.push(_),Ut(r,!0,e),q=r.input.charCodeAt(r.position),q===44?(t=!0,q=r.input.charCodeAt(++r.position)):t=!1}fe(r,"unexpected end of the stream within a flow collection")}function y3(r,e){let t,n=qR,i=!1,s=!1,a=e,l=0,f=!1,d,h=r.input.charCodeAt(r.position);if(h===124)t=!1;else if(h===62)t=!0;else return!1;for(r.kind="scalar",r.result="";h!==0;)if(h=r.input.charCodeAt(++r.position),h===43||h===45)qR===n?n=h===43?Rq:t3:fe(r,"repeat of a chomping mode identifier");else if((d=a3(h))>=0)d===0?fe(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?fe(r,"repeat of an indentation width identifier"):(a=e+d-1,s=!0);else break;if(ls(h)){do h=r.input.charCodeAt(++r.position);while(ls(h));if(h===35)do h=r.input.charCodeAt(++r.position);while(!Ii(h)&&h!==0)}for(;h!==0;){for(AR(r),r.lineIndent=0,h=r.input.charCodeAt(r.position);(!s||r.lineIndent<a)&&h===32;)r.lineIndent++,h=r.input.charCodeAt(++r.position);if(!s&&r.lineIndent>a&&(a=r.lineIndent),Ii(h)){l++;continue}if(!s&&a===0&&fe(r,"missing indentation for block scalar"),r.lineIndent<a){n===Rq?r.result+=Oa.repeat(`
|
|
253
253
|
`,i?1+l:l):n===qR&&i&&(r.result+=`
|
|
254
254
|
`);break}t?ls(h)?(f=!0,r.result+=Oa.repeat(`
|
|
255
255
|
`,i?1+l:l)):f?(f=!1,r.result+=Oa.repeat(`
|
|
256
256
|
`,l+1)):l===0?i&&(r.result+=" "):r.result+=Oa.repeat(`
|
|
257
257
|
`,l):r.result+=Oa.repeat(`
|
|
258
|
-
`,i?1+l:l),i=!0,s=!0,l=0;let g=r.position;for(;!
|
|
259
|
-
`),r.charCodeAt(0)===65279&&(r=r.slice(1)));let t=new u3(r,e),n=r.indexOf("\0");for(n!==-1&&(t.position=n,fe(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)_3(t);return t.documents}function R3(r,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);let n=Uq(r,t);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function C3(r,e){let t=Uq(r,e);if(t.length!==0){if(t.length===1)return t[0];throw new kq("expected a single document in the stream, but found more")}}MR.exports.loadAll=R3;MR.exports.load=C3});var uA=F((Ste,lA)=>{"use strict";var
|
|
258
|
+
`,i?1+l:l),i=!0,s=!0,l=0;let g=r.position;for(;!Ii(h)&&h!==0;)h=r.input.charCodeAt(++r.position);co(r,g,r.position,!1)}return!0}function Pq(r,e){let t=r.tag,n=r.anchor,i=[],s=!1;if(r.firstTabInLine!==-1)return!1;r.anchor!==null&&Ia(r,r.anchor,i);let a=r.input.charCodeAt(r.position);for(;a!==0&&(r.firstTabInLine!==-1&&(r.position=r.firstTabInLine,fe(r,"tab characters must not be used in indentation")),a===45);){let l=r.input.charCodeAt(r.position+1);if(!zr(l))break;if(s=!0,r.position++,Ut(r,!0,-1)&&r.lineIndent<=e){i.push(null),a=r.input.charCodeAt(r.position);continue}let f=r.line;if(Eu(r,e,qq,!1,!0),i.push(r.result),Ut(r,!0,-1),a=r.input.charCodeAt(r.position),(r.line===f||r.lineIndent>e)&&a!==0)fe(r,"bad indentation of a sequence entry");else if(r.lineIndent<e)break}return s?(r.tag=t,r.anchor=n,r.kind="sequence",r.result=i,!0):!1}function jq(r,e,t){let n,i,s,a,l=r.tag,f=r.anchor,d={},h=Object.create(null),g=null,y=null,S=null,_=!1,R=!1;if(r.firstTabInLine!==-1)return!1;r.anchor!==null&&Ia(r,r.anchor,d);let I=r.input.charCodeAt(r.position);for(;I!==0;){!_&&r.firstTabInLine!==-1&&(r.position=r.firstTabInLine,fe(r,"tab characters must not be used in indentation"));let q=r.input.charCodeAt(r.position+1),j=r.line;if((I===63||I===58)&&zr(q))I===63?(_&&(xu(r,d,h,g,y,null,i,s,a),g=y=S=null),R=!0,_=!0,n=!0):_?(_=!1,n=!0):fe(r,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),r.position+=1,I=q;else{if(i=r.line,s=r.lineStart,a=r.position,!Eu(r,t,Tq,!1,!0))break;if(r.line===j){for(I=r.input.charCodeAt(r.position);ls(I);)I=r.input.charCodeAt(++r.position);if(I===58)I=r.input.charCodeAt(++r.position),zr(I)||fe(r,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(xu(r,d,h,g,y,null,i,s,a),g=y=S=null),R=!0,_=!1,n=!1,g=r.tag,y=r.result;else if(R)fe(r,"can not read an implicit mapping pair; a colon is missed");else return r.tag=l,r.anchor=f,!0}else if(R)fe(r,"can not read a block mapping entry; a multiline key may not be an implicit key");else return r.tag=l,r.anchor=f,!0}if((r.line===j||r.lineIndent>e)&&(_&&(i=r.line,s=r.lineStart,a=r.position),Eu(r,e,Cg,!0,n)&&(_?y=r.result:S=r.result),_||(xu(r,d,h,g,y,S,i,s,a),g=y=S=null),Ut(r,!0,-1),I=r.input.charCodeAt(r.position)),(r.line===j||r.lineIndent>e)&&I!==0)fe(r,"bad indentation of a mapping entry");else if(r.lineIndent<e)break}return _&&xu(r,d,h,g,y,null,i,s,a),R&&(r.tag=l,r.anchor=f,r.kind="mapping",r.result=d),R}function v3(r){let e=!1,t=!1,n,i,s=r.input.charCodeAt(r.position);if(s!==33)return!1;r.tag!==null&&fe(r,"duplication of a tag property"),s=r.input.charCodeAt(++r.position),s===60?(e=!0,s=r.input.charCodeAt(++r.position)):s===33?(t=!0,n="!!",s=r.input.charCodeAt(++r.position)):n="!";let a=r.position;if(e){do s=r.input.charCodeAt(++r.position);while(s!==0&&s!==62);r.position<r.length?(i=r.input.slice(a,r.position),s=r.input.charCodeAt(++r.position)):fe(r,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!zr(s);)s===33&&(t?fe(r,"tag suffix cannot contain exclamation marks"):(n=r.input.slice(a-1,r.position+1),Aq.test(n)||fe(r,"named tag handle cannot contain such characters"),t=!0,a=r.position+1)),s=r.input.charCodeAt(++r.position);i=r.input.slice(a,r.position),i3.test(i)&&fe(r,"tag suffix cannot contain flow indicator characters")}i&&!$q.test(i)&&fe(r,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{fe(r,"tag name is malformed: "+i)}return e?r.tag=i:ni.call(r.tagMap,n)?r.tag=r.tagMap[n]+i:n==="!"?r.tag="!"+i:n==="!!"?r.tag="tag:yaml.org,2002:"+i:fe(r,'undeclared tag handle "'+n+'"'),!0}function b3(r){let e=r.input.charCodeAt(r.position);if(e!==38)return!1;r.anchor!==null&&fe(r,"duplication of an anchor property"),e=r.input.charCodeAt(++r.position);let t=r.position;for(;e!==0&&!zr(e)&&!Cu(e);)e=r.input.charCodeAt(++r.position);return r.position===t&&fe(r,"name of an anchor node must contain at least one character"),r.anchor=r.input.slice(t,r.position),!0}function S3(r){let e=r.input.charCodeAt(r.position);if(e!==42)return!1;e=r.input.charCodeAt(++r.position);let t=r.position;for(;e!==0&&!zr(e)&&!Cu(e);)e=r.input.charCodeAt(++r.position);r.position===t&&fe(r,"name of an alias node must contain at least one character");let n=r.input.slice(t,r.position);return ni.call(r.anchorMap,n)||fe(r,'unidentified alias "'+n+'"'),r.result=r.anchorMap[n],Ut(r,!0,-1),!0}function w3(r,e,t,n){let i=Lq(r);return c3(r),Eq(r,e),r.tag=null,r.anchor=null,r.kind=null,r.result=null,jq(r,t,n)&&r.kind==="mapping"?(f3(r),!0):(d3(r),Eq(r,i),!1)}function Eu(r,e,t,n,i){let s,a,l=1,f=!1,d=!1,h=null,g,y,S;r.depth>=r.maxDepth&&fe(r,"nesting exceeded maxDepth ("+r.maxDepth+")"),r.depth+=1,r.listener!==null&&r.listener("open",r),r.tag=null,r.anchor=null,r.kind=null,r.result=null;let _=s=a=Cg===t||qq===t;if(n&&Ut(r,!0,-1)&&(f=!0,r.lineIndent>e?l=1:r.lineIndent===e?l=0:r.lineIndent<e&&(l=-1)),l===1)for(;;){let R=r.input.charCodeAt(r.position),I=Lq(r);if(f&&(R===33&&r.tag!==null||R===38&&r.anchor!==null)||!v3(r)&&!b3(r))break;h===null&&(h=I),Ut(r,!0,-1)?(f=!0,a=_,r.lineIndent>e?l=1:r.lineIndent===e?l=0:r.lineIndent<e&&(l=-1)):a=!1}if(a&&(a=f||i),l===1||Cg===t)if(Rg===t||Tq===t?y=e:y=e+1,S=r.position-r.lineStart,l===1)if(a&&(Pq(r,S)||jq(r,S,y))||g3(r,y))d=!0;else{let R=r.input.charCodeAt(r.position);h!==null&&_&&!a&&R!==124&&R!==62&&w3(r,h,h.position-h.lineStart,y)||s&&y3(r,y)||h3(r,y)||m3(r,y)?d=!0:S3(r)?(d=!0,(r.tag!==null||r.anchor!==null)&&fe(r,"alias node should not have any properties")):p3(r,y,Rg===t)&&(d=!0,r.tag===null&&(r.tag="?")),r.anchor!==null&&Ia(r,r.anchor,r.result)}else l===0&&(d=a&&Pq(r,S));if(r.tag===null)r.anchor!==null&&Ia(r,r.anchor,r.result);else if(r.tag==="?"){r.result!==null&&r.kind!=="scalar"&&fe(r,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+r.kind+'"');for(let R=0,I=r.implicitTypes.length;R<I;R+=1)if(g=r.implicitTypes[R],g.resolve(r.result)){r.result=g.construct(r.result),r.tag=g.tag,r.anchor!==null&&Ia(r,r.anchor,r.result);break}}else if(r.tag!=="!"){if(ni.call(r.typeMap[r.kind||"fallback"],r.tag))g=r.typeMap[r.kind||"fallback"][r.tag];else{g=null;let R=r.typeMap.multi[r.kind||"fallback"];for(let I=0,q=R.length;I<q;I+=1)if(r.tag.slice(0,R[I].tag.length)===R[I].tag){g=R[I];break}}g||fe(r,"unknown tag !<"+r.tag+">"),r.result!==null&&g.kind!==r.kind&&fe(r,"unacceptable node kind for !<"+r.tag+'> tag; it should be "'+g.kind+'", not "'+r.kind+'"'),g.resolve(r.result,r.tag)?(r.result=g.construct(r.result,r.tag),r.anchor!==null&&Ia(r,r.anchor,r.result)):fe(r,"cannot resolve a node with !<"+r.tag+"> explicit tag")}return r.listener!==null&&r.listener("close",r),r.depth-=1,r.tag!==null||r.anchor!==null||d}function _3(r){let e=r.position,t=!1,n;for(r.version=null,r.checkLineBreaks=r.legacy,r.tagMap=Object.create(null),r.anchorMap=Object.create(null);(n=r.input.charCodeAt(r.position))!==0&&(Ut(r,!0,-1),n=r.input.charCodeAt(r.position),!(r.lineIndent>0||n!==37));){t=!0,n=r.input.charCodeAt(++r.position);let i=r.position;for(;n!==0&&!zr(n);)n=r.input.charCodeAt(++r.position);let s=r.input.slice(i,r.position),a=[];for(s.length<1&&fe(r,"directive name must not be less than one character in length");n!==0;){for(;ls(n);)n=r.input.charCodeAt(++r.position);if(n===35){do n=r.input.charCodeAt(++r.position);while(n!==0&&!Ii(n));break}if(Ii(n))break;for(i=r.position;n!==0&&!zr(n);)n=r.input.charCodeAt(++r.position);a.push(r.input.slice(i,r.position))}n!==0&&AR(r),ni.call(Oq,s)?Oq[s](r,s,a):xg(r,'unknown document directive "'+s+'"')}if(Ut(r,!0,-1),r.lineIndent===0&&r.input.charCodeAt(r.position)===45&&r.input.charCodeAt(r.position+1)===45&&r.input.charCodeAt(r.position+2)===45?(r.position+=3,Ut(r,!0,-1)):t&&fe(r,"directives end mark is expected"),Eu(r,r.lineIndent-1,Cg,!1,!0),Ut(r,!0,-1),r.checkLineBreaks&&n3.test(r.input.slice(e,r.position))&&xg(r,"non-ASCII line breaks are interpreted as content"),r.documents.push(r.result),r.position===r.lineStart&&Eg(r)){r.input.charCodeAt(r.position)===46&&(r.position+=3,Ut(r,!0,-1));return}r.position<r.length-1&&fe(r,"end of the stream or a document separator is expected")}function Uq(r,e){r=String(r),e=e||{},r.length!==0&&(r.charCodeAt(r.length-1)!==10&&r.charCodeAt(r.length-1)!==13&&(r+=`
|
|
259
|
+
`),r.charCodeAt(0)===65279&&(r=r.slice(1)));let t=new u3(r,e),n=r.indexOf("\0");for(n!==-1&&(t.position=n,fe(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)_3(t);return t.documents}function R3(r,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);let n=Uq(r,t);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function C3(r,e){let t=Uq(r,e);if(t.length!==0){if(t.length===1)return t[0];throw new kq("expected a single document in the stream, but found more")}}MR.exports.loadAll=R3;MR.exports.load=C3});var uA=F((Ste,lA)=>{"use strict";var Pg=_u(),wd=Ru(),x3=_g(),Qq=Object.prototype.toString,Zq=Object.prototype.hasOwnProperty,jR=65279,E3=9,vd=10,O3=13,I3=32,P3=33,k3=34,NR=35,T3=37,q3=38,A3=39,$3=42,Xq=44,M3=45,Og=58,N3=61,D3=62,F3=63,L3=64,eA=91,tA=93,j3=96,rA=123,U3=124,nA=125,hr={};hr[0]="\\0";hr[7]="\\a";hr[8]="\\b";hr[9]="\\t";hr[10]="\\n";hr[11]="\\v";hr[12]="\\f";hr[13]="\\r";hr[27]="\\e";hr[34]='\\"';hr[92]="\\\\";hr[133]="\\N";hr[160]="\\_";hr[8232]="\\L";hr[8233]="\\P";var H3=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],B3=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function V3(r,e){if(e===null)return{};let t={},n=Object.keys(e);for(let i=0,s=n.length;i<s;i+=1){let a=n[i],l=String(e[a]);a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2));let f=r.compiledTypeMap.fallback[a];f&&Zq.call(f.styleAliases,l)&&(l=f.styleAliases[l]),t[a]=l}return t}function W3(r){let e,t,n=r.toString(16).toUpperCase();if(r<=255)e="x",t=2;else if(r<=65535)e="u",t=4;else if(r<=4294967295)e="U",t=8;else throw new wd("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+Pg.repeat("0",t-n.length)+n}var z3=1,bd=2;function J3(r){this.schema=r.schema||x3,this.indent=Math.max(1,r.indent||2),this.noArrayIndent=r.noArrayIndent||!1,this.skipInvalid=r.skipInvalid||!1,this.flowLevel=Pg.isNothing(r.flowLevel)?-1:r.flowLevel,this.styleMap=V3(this.schema,r.styles||null),this.sortKeys=r.sortKeys||!1,this.lineWidth=r.lineWidth||80,this.noRefs=r.noRefs||!1,this.noCompatMode=r.noCompatMode||!1,this.condenseFlow=r.condenseFlow||!1,this.quotingType=r.quotingType==='"'?bd:z3,this.forceQuotes=r.forceQuotes||!1,this.replacer=typeof r.replacer=="function"?r.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Bq(r,e){let t=Pg.repeat(" ",e),n=0,i="",s=r.length;for(;n<s;){let a,l=r.indexOf(`
|
|
260
260
|
`,n);l===-1?(a=r.slice(n),n=s):(a=r.slice(n,l+1),n=l+1),a.length&&a!==`
|
|
261
261
|
`&&(i+=t),i+=a}return i}function DR(r,e){return`
|
|
262
|
-
`+
|
|
262
|
+
`+Pg.repeat(" ",r.indent*e)}function G3(r,e){for(let t=0,n=r.implicitTypes.length;t<n;t+=1)if(r.implicitTypes[t].resolve(e))return!0;return!1}function Ig(r){return r===I3||r===E3}function Sd(r){return r>=32&&r<=126||r>=161&&r<=55295&&r!==8232&&r!==8233||r>=57344&&r<=65533&&r!==jR||r>=65536&&r<=1114111}function Vq(r){return Sd(r)&&r!==jR&&r!==O3&&r!==vd}function Wq(r,e,t){let n=Vq(r),i=n&&!Ig(r);return(t?n:n&&r!==Xq&&r!==eA&&r!==tA&&r!==rA&&r!==nA)&&r!==NR&&!(e===Og&&!i)||Vq(e)&&!Ig(e)&&r===NR||e===Og&&i}function Y3(r){return Sd(r)&&r!==jR&&!Ig(r)&&r!==M3&&r!==F3&&r!==Og&&r!==Xq&&r!==eA&&r!==tA&&r!==rA&&r!==nA&&r!==NR&&r!==q3&&r!==$3&&r!==P3&&r!==U3&&r!==N3&&r!==D3&&r!==A3&&r!==k3&&r!==T3&&r!==L3&&r!==j3}function K3(r){return!Ig(r)&&r!==Og}function yd(r,e){let t=r.charCodeAt(e),n;return t>=55296&&t<=56319&&e+1<r.length&&(n=r.charCodeAt(e+1),n>=56320&&n<=57343)?(t-55296)*1024+n-56320+65536:t}function iA(r){return/^\n* /.test(r)}var sA=1,FR=2,oA=3,aA=4,Ou=5;function Q3(r,e,t,n,i,s,a,l){let f,d=0,h=null,g=!1,y=!1,S=n!==-1,_=-1,R=Y3(yd(r,0))&&K3(yd(r,r.length-1));if(e||a)for(f=0;f<r.length;d>=65536?f+=2:f++){if(d=yd(r,f),!Sd(d))return Ou;R=R&&Wq(d,h,l),h=d}else{for(f=0;f<r.length;d>=65536?f+=2:f++){if(d=yd(r,f),d===vd)g=!0,S&&(y=y||f-_-1>n&&r[_+1]!==" ",_=f);else if(!Sd(d))return Ou;R=R&&Wq(d,h,l),h=d}y=y||S&&f-_-1>n&&r[_+1]!==" "}return!g&&!y?R&&!a&&!i(r)?sA:s===bd?Ou:FR:t>9&&iA(r)?Ou:a?s===bd?Ou:FR:y?aA:oA}function Z3(r,e,t,n,i){r.dump=(function(){if(e.length===0)return r.quotingType===bd?'""':"''";if(!r.noCompatMode&&(H3.indexOf(e)!==-1||B3.test(e)))return r.quotingType===bd?'"'+e+'"':"'"+e+"'";let s=r.indent*Math.max(1,t),a=r.lineWidth===-1?-1:Math.max(Math.min(r.lineWidth,40),r.lineWidth-s),l=n||r.flowLevel>-1&&t>=r.flowLevel;function f(d){return G3(r,d)}switch(Q3(e,l,r.indent,a,f,r.quotingType,r.forceQuotes&&!n,i)){case sA:return e;case FR:return"'"+e.replace(/'/g,"''")+"'";case oA:return"|"+zq(e,r.indent)+Jq(Bq(e,s));case aA:return">"+zq(e,r.indent)+Jq(Bq(X3(e,a),s));case Ou:return'"'+e9(e,a)+'"';default:throw new wd("impossible error: invalid scalar style")}})()}function zq(r,e){let t=iA(r)?String(e):"",n=r[r.length-1]===`
|
|
263
263
|
`,s=n&&(r[r.length-2]===`
|
|
264
264
|
`||r===`
|
|
265
265
|
`)?"+":n?"":"-";return t+s+`
|
|
@@ -270,11 +270,11 @@ Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new xa.Unma
|
|
|
270
270
|
`:"")+Gq(f,e),i=s}return n}function Gq(r,e){if(r===""||r[0]===" ")return r;let t=/ [^ ]/g,n,i=0,s,a=0,l=0,f="";for(;n=t.exec(r);)l=n.index,l-i>e&&(s=a>i?a:l,f+=`
|
|
271
271
|
`+r.slice(i,s),i=s+1),a=l;return f+=`
|
|
272
272
|
`,r.length-i>e&&a>i?f+=r.slice(i,a)+`
|
|
273
|
-
`+r.slice(a+1):f+=r.slice(i),f.slice(1)}function e9(r){let e="",t=0;for(let n=0;n<r.length;t>=65536?n+=2:n++){t=
|
|
274
|
-
`:""}lA.exports.dump=s9});var HR=F((wte,Ir)=>{"use strict";var cA=Hq(),o9=uA();function UR(r,e){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}Ir.exports.Type=pr();Ir.exports.Schema=hR();Ir.exports.FAILSAFE_SCHEMA=vR();Ir.exports.JSON_SCHEMA=RR();Ir.exports.CORE_SCHEMA=CR();Ir.exports.DEFAULT_SCHEMA=
|
|
273
|
+
`+r.slice(a+1):f+=r.slice(i),f.slice(1)}function e9(r){let e="",t=0;for(let n=0;n<r.length;t>=65536?n+=2:n++){t=yd(r,n);let i=hr[t];!i&&Sd(t)?(e+=r[n],t>=65536&&(e+=r[n+1])):e+=i||W3(t)}return e}function t9(r,e,t){let n="",i=r.tag;for(let s=0,a=t.length;s<a;s+=1){let l=t[s];r.replacer&&(l=r.replacer.call(t,String(s),l)),(us(r,e,l,!1,!1)||typeof l>"u"&&us(r,e,null,!1,!1))&&(n!==""&&(n+=","+(r.condenseFlow?"":" ")),n+=r.dump)}r.tag=i,r.dump="["+n+"]"}function Yq(r,e,t,n){let i="",s=r.tag;for(let a=0,l=t.length;a<l;a+=1){let f=t[a];r.replacer&&(f=r.replacer.call(t,String(a),f)),(us(r,e+1,f,!0,!0,!1,!0)||typeof f>"u"&&us(r,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=DR(r,e)),r.dump&&vd===r.dump.charCodeAt(0)?i+="-":i+="- ",i+=r.dump)}r.tag=s,r.dump=i||"[]"}function r9(r,e,t){let n="",i=r.tag,s=Object.keys(t);for(let a=0,l=s.length;a<l;a+=1){let f="";n!==""&&(f+=", "),r.condenseFlow&&(f+='"');let d=s[a],h=t[d];r.replacer&&(h=r.replacer.call(t,d,h)),us(r,e,d,!1,!1)&&(r.dump.length>1024&&(f+="? "),f+=r.dump+(r.condenseFlow?'"':"")+":"+(r.condenseFlow?"":" "),us(r,e,h,!1,!1)&&(f+=r.dump,n+=f))}r.tag=i,r.dump="{"+n+"}"}function n9(r,e,t,n){let i="",s=r.tag,a=Object.keys(t);if(r.sortKeys===!0)a.sort();else if(typeof r.sortKeys=="function")a.sort(r.sortKeys);else if(r.sortKeys)throw new wd("sortKeys must be a boolean or a function");for(let l=0,f=a.length;l<f;l+=1){let d="";(!n||i!=="")&&(d+=DR(r,e));let h=a[l],g=t[h];if(r.replacer&&(g=r.replacer.call(t,h,g)),!us(r,e+1,h,!0,!0,!0))continue;let y=r.tag!==null&&r.tag!=="?"||r.dump&&r.dump.length>1024;y&&(r.dump&&vd===r.dump.charCodeAt(0)?d+="?":d+="? "),d+=r.dump,y&&(d+=DR(r,e)),us(r,e+1,g,!0,y)&&(r.dump&&vd===r.dump.charCodeAt(0)?d+=":":d+=": ",d+=r.dump,i+=d)}r.tag=s,r.dump=i||"{}"}function Kq(r,e,t){let n=t?r.explicitTypes:r.implicitTypes;for(let i=0,s=n.length;i<s;i+=1){let a=n[i];if((a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(t?a.multi&&a.representName?r.tag=a.representName(e):r.tag=a.tag:r.tag="?",a.represent){let l=r.styleMap[a.tag]||a.defaultStyle,f;if(Qq.call(a.represent)==="[object Function]")f=a.represent(e,l);else if(Zq.call(a.represent,l))f=a.represent[l](e,l);else throw new wd("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');r.dump=f}return!0}}return!1}function us(r,e,t,n,i,s,a){r.tag=null,r.dump=t,Kq(r,t,!1)||Kq(r,t,!0);let l=Qq.call(r.dump),f=n;n&&(n=r.flowLevel<0||r.flowLevel>e);let d=l==="[object Object]"||l==="[object Array]",h,g;if(d&&(h=r.duplicates.indexOf(t),g=h!==-1),(r.tag!==null&&r.tag!=="?"||g||r.indent!==2&&e>0)&&(i=!1),g&&r.usedDuplicates[h])r.dump="*ref_"+h;else{if(d&&g&&!r.usedDuplicates[h]&&(r.usedDuplicates[h]=!0),l==="[object Object]")n&&Object.keys(r.dump).length!==0?(n9(r,e,r.dump,i),g&&(r.dump="&ref_"+h+r.dump)):(r9(r,e,r.dump),g&&(r.dump="&ref_"+h+" "+r.dump));else if(l==="[object Array]")n&&r.dump.length!==0?(r.noArrayIndent&&!a&&e>0?Yq(r,e-1,r.dump,i):Yq(r,e,r.dump,i),g&&(r.dump="&ref_"+h+r.dump)):(t9(r,e,r.dump),g&&(r.dump="&ref_"+h+" "+r.dump));else if(l==="[object String]")r.tag!=="?"&&Z3(r,r.dump,e,s,f);else{if(l==="[object Undefined]")return!1;if(r.skipInvalid)return!1;throw new wd("unacceptable kind of an object to dump "+l)}if(r.tag!==null&&r.tag!=="?"){let y=encodeURI(r.tag[0]==="!"?r.tag.slice(1):r.tag).replace(/!/g,"%21");r.tag[0]==="!"?y="!"+y:y.slice(0,18)==="tag:yaml.org,2002:"?y="!!"+y.slice(18):y="!<"+y+">",r.dump=y+" "+r.dump}}return!0}function i9(r,e){let t=[],n=[];LR(r,t,n);let i=n.length;for(let s=0;s<i;s+=1)e.duplicates.push(t[n[s]]);e.usedDuplicates=new Array(i)}function LR(r,e,t){if(r!==null&&typeof r=="object"){let n=e.indexOf(r);if(n!==-1)t.indexOf(n)===-1&&t.push(n);else if(e.push(r),Array.isArray(r))for(let i=0,s=r.length;i<s;i+=1)LR(r[i],e,t);else{let i=Object.keys(r);for(let s=0,a=i.length;s<a;s+=1)LR(r[i[s]],e,t)}}}function s9(r,e){e=e||{};let t=new J3(e);t.noRefs||i9(r,t);let n=r;return t.replacer&&(n=t.replacer.call({"":n},"",n)),us(t,0,n,!0,!0)?t.dump+`
|
|
274
|
+
`:""}lA.exports.dump=s9});var HR=F((wte,Ir)=>{"use strict";var cA=Hq(),o9=uA();function UR(r,e){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}Ir.exports.Type=pr();Ir.exports.Schema=hR();Ir.exports.FAILSAFE_SCHEMA=vR();Ir.exports.JSON_SCHEMA=RR();Ir.exports.CORE_SCHEMA=CR();Ir.exports.DEFAULT_SCHEMA=_g();Ir.exports.load=cA.load;Ir.exports.loadAll=cA.loadAll;Ir.exports.dump=o9.dump;Ir.exports.YAMLException=Ru();Ir.exports.types={binary:IR(),float:_R(),map:yR(),null:bR(),pairs:kR(),set:TR(),timestamp:xR(),bool:SR(),int:wR(),merge:ER(),omap:PR(),seq:gR(),str:mR()};Ir.exports.safeLoad=UR("safeLoad","load");Ir.exports.safeLoadAll=UR("safeLoadAll","loadAll");Ir.exports.safeDump=UR("safeDump","dump")});var fA=F(_d=>{"use strict";var a9=_d&&_d.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_d,"__esModule",{value:!0});var l9=In(),u9=a9(HR()),c9=HR();_d.default={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(r){let e=r.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string")try{return u9.default.load(e,{schema:c9.JSON_SCHEMA})}catch(t){throw new l9.ParserError(t?.message||"Parser Error",r.url)}else return e}}});var dA=F(BR=>{"use strict";Object.defineProperty(BR,"__esModule",{value:!0});var f9=In(),d9=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;BR.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(r){return(typeof r.data=="string"||Buffer.isBuffer(r.data))&&d9.test(r.url)},parse(r){if(typeof r.data=="string")return r.data;if(Buffer.isBuffer(r.data))return r.data.toString(this.encoding);throw new f9.ParserError("data is not text",r.url)}}});var pA=F(VR=>{"use strict";Object.defineProperty(VR,"__esModule",{value:!0});var p9=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;VR.default={order:400,allowEmpty:!0,canParse(r){return Buffer.isBuffer(r.data)&&p9.test(r.url)},parse(r){return Buffer.isBuffer(r.data)?r.data:Buffer.from(r.data)}}});var yA=F(ii=>{"use strict";var h9=ii&&ii.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),m9=ii&&ii.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),g9=ii&&ii.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&h9(t,e,n[i]);return m9(t,e),t}})(),y9=ii&&ii.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ii,"__esModule",{value:!0});var v9=y9(it("fs")),hA=ao(),mA=g9(On()),gA=In();ii.default={order:100,canRead(r){return mA.isFileSystemPath(r.url)},async read(r){let e;try{e=mA.toFileSystemPath(r.url)}catch(t){throw new gA.ResolverError(hA.ono.uri(t,`Malformed URI: ${r.url}`),r.url)}try{return await v9.default.promises.readFile(e)}catch(t){throw new gA.ResolverError((0,hA.ono)(t,`Error opening file "${e}"`),e)}}}});var SA=F(cs=>{"use strict";var b9=cs&&cs.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),S9=cs&&cs.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),w9=cs&&cs.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&b9(t,e,n[i]);return S9(t,e),t}})();Object.defineProperty(cs,"__esModule",{value:!0});var kg=ao(),Rd=w9(On()),vA=In();cs.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(r){return Rd.isHttp(r.url)},read(r){let e=Rd.parse(r.url);return typeof window<"u"&&!e.protocol&&(e.protocol=Rd.parse(location.href).protocol),bA(e,this)}};async function bA(r,e,t){r=Rd.parse(r);let n=t||[];n.push(r.href);try{let i=await _9(r,e);if(i.status>=400)throw(0,kg.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new vA.ResolverError((0,kg.ono)({status:i.status},`Error downloading ${n[0]}.
|
|
275
275
|
Too many redirects:
|
|
276
276
|
${n.join(`
|
|
277
|
-
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,Tg.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Cd.resolve(r.href,i.headers.location);return bA(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new vA.ResolverError((0,Tg.ono)(i,`Error downloading ${r.href}`),r.href)}}async function _9(r,e){let t,n;e.timeout&&(t=new AbortController,n=setTimeout(()=>t.abort(),e.timeout));let i=await fetch(r,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:t?t.signal:null});return n&&clearTimeout(n),i}});var WR=F(fs=>{"use strict";var Iu=fs&&fs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fs,"__esModule",{value:!0});fs.getNewOptions=fs.getJsonSchemaRefParserDefaultOptions=void 0;var R9=Iu(J1()),C9=Iu(fA()),x9=Iu(dA()),E9=Iu(pA()),O9=Iu(yA()),I9=Iu(SA()),P9=()=>({parse:{json:{...R9.default},yaml:{...C9.default},text:{...x9.default},binary:{...E9.default}},resolve:{file:{...O9.default},http:{...I9.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});fs.getJsonSchemaRefParserDefaultOptions=P9;var k9=r=>{let e=(0,fs.getJsonSchemaRefParserDefaultOptions)();return r&&_A(e,r),e};fs.getNewOptions=k9;function _A(r,e){if(wA(e)){let t=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<t.length;n++){let i=t[n],s=e[i],a=r[i];wA(s)?r[i]=_A(a||{},s):s!==void 0&&(r[i]=s)}}return r}function wA(r){return r&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}});var CA=F(qg=>{"use strict";Object.defineProperty(qg,"__esModule",{value:!0});qg.normalizeArgs=RA;var T9=WR();function RA(r){let e,t,n,i,s=Array.prototype.slice.call(r);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(t=s[1],n=s[2]):(t=void 0,n=s[1])):(e="",t=s[0],n=s[1]);try{n=(0,T9.getNewOptions)(n)}catch(a){console.error(`JSON Schema Ref Parser: Error normalizing options: ${a}`)}return!n.mutateInputSchema&&typeof t=="object"&&(t=JSON.parse(JSON.stringify(t))),{path:e,schema:t,options:n,callback:i}}qg.default=RA});var xA=F(oi=>{"use strict";var q9=oi&&oi.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),A9=oi&&oi.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),$9=oi&&oi.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&q9(t,e,n[i]);return A9(t,e),t}})(),zR=oi&&oi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oi,"__esModule",{value:!0});var M9=zR(Su()),N9=zR(pd()),D9=zR(lR()),Pu=$9(On()),F9=In();function L9(r,e){if(!e.resolve?.external)return Promise.resolve();try{let t=JR(r.schema,r.$refs._root$Ref.path+"#",r.$refs,e);return Promise.all(t)}catch(t){return Promise.reject(t)}}function JR(r,e,t,n,i,s){i||(i=new Set);let a=[];if(r&&typeof r=="object"&&!ArrayBuffer.isView(r)&&!i.has(r)){i.add(r),M9.default.isExternal$Ref(r)&&a.push(j9(r,e,t,n));let l=Object.keys(r);for(let f of l){let d=N9.default.join(e,f),h=r[f];a=a.concat(JR(h,d,t,n,i,s))}}return a}async function j9(r,e,t,n){let i=n.dereference?.externalReferenceResolution==="root",s=Pu.resolve(i?Pu.cwd():e,r.$ref),a=Pu.stripHash(s),l=t._$refs[a];if(l)return Promise.resolve(l.value);try{let f=await(0,D9.default)(s,t,n),d=JR(f,a+"#",t,n,new Set,!0);return Promise.all(d)}catch(f){if(!n?.continueOnError||!(0,F9.isHandledError)(f))throw f;return t._$refs[a]&&(f.source=decodeURI(Pu.stripHash(e)),f.path=Pu.safePointerToPath(Pu.getHash(e))),[]}}oi.default=L9});var IA=F(ai=>{"use strict";var U9=ai&&ai.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),H9=ai&&ai.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),B9=ai&&ai.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&U9(t,e,n[i]);return H9(t,e),t}})(),OA=ai&&ai.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ai,"__esModule",{value:!0});var Ag=OA(Su()),xd=OA(pd()),GR=B9(On());function V9(r,e){let t=[];YR(r,"schema",r.$refs._root$Ref.path+"#","#",0,t,r.$refs,e),W9(t)}function YR(r,e,t,n,i,s,a,l){let f=e===null?r:r[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(Ag.default.isAllowed$Ref(f))EA(r,e,t,n,i,s,a,l);else{let d=Object.keys(f).sort((h,g)=>h==="definitions"?-1:g==="definitions"?1:h.length-g.length);for(let h of d){let g=xd.default.join(t,h),y=xd.default.join(n,h),S=f[h];Ag.default.isAllowed$Ref(S)?EA(f,h,t,y,i,s,a,l):YR(f,h,g,y,i,s,a,l)}}}function EA(r,e,t,n,i,s,a,l){let f=e===null?r:r[e],d=GR.resolve(t,f.$ref),h=a._resolve(d,n,l);if(h===null)return;let y=xd.default.parse(n).length,S=GR.stripHash(h.path),_=GR.getHash(h.path),R=S!==a._root$Ref.path,I=Ag.default.isExtended$Ref(f);i+=h.indirections;let q=z9(s,r,e);if(q)if(y<q.depth||i<q.indirections)J9(s,q);else return;s.push({$ref:f,parent:r,key:e,pathFromRoot:n,depth:y,file:S,hash:_,value:h.value,circular:h.circular,extended:I,external:R,indirections:i}),(!q||R)&&YR(h.value,null,h.path,n,i+1,s,a,l)}function W9(r){r.sort((i,s)=>{if(i.file!==s.file)return i.file<s.file?-1:1;if(i.hash!==s.hash)return i.hash<s.hash?-1:1;if(i.circular!==s.circular)return i.circular?-1:1;if(i.extended!==s.extended)return i.extended?1:-1;if(i.indirections!==s.indirections)return i.indirections-s.indirections;if(i.depth!==s.depth)return i.depth-s.depth;{let a=i.pathFromRoot.lastIndexOf("/definitions"),l=s.pathFromRoot.lastIndexOf("/definitions");return a!==l?l-a:i.pathFromRoot.length-s.pathFromRoot.length}});let e,t,n;for(let i of r)i.external?i.file===e&&i.hash===t?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(t+"/")===0?i.$ref.$ref=xd.default.join(n,xd.default.parse(i.hash.replace(t,"#"))):(e=i.file,t=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=Ag.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function z9(r,e,t){for(let n of r)if(n&&n.parent===e&&n.key===t)return n}function J9(r,e){let t=r.indexOf(e);r.splice(t,1)}ai.default=V9});var $A=F(li=>{"use strict";var G9=li&&li.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Y9=li&&li.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),K9=li&&li.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&G9(t,e,n[i]);return Y9(t,e),t}})(),qA=li&&li.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(li,"__esModule",{value:!0});var $g=qA(Su()),PA=qA(pd()),Q9=ao(),kA=K9(On()),Z9=In();li.default=X9;function X9(r,e){let t=Date.now(),n=KR(r.schema,r.$refs._root$Ref.path,"#",new Set,new Set,new Map,r.$refs,e,t);r.$refs.circular=n.circular,r.schema=n.value}function KR(r,e,t,n,i,s,a,l,f){let d,h={value:r,circular:!1};if(l&&l.timeoutMs&&Date.now()-f>l.timeoutMs)throw new Z9.TimeoutError(l.timeoutMs);let g=l.dereference||{},y=g.excludedPathMatcher||(()=>!1);if((g?.circular==="ignore"||!i.has(r))&&r&&typeof r=="object"&&!ArrayBuffer.isView(r)&&!y(t)){if(n.add(r),i.add(r),$g.default.isAllowed$Ref(r,l))d=TA(r,e,t,n,i,s,a,l,f),h.circular=d.circular,h.value=d.value;else for(let S of Object.keys(r)){let _=PA.default.join(e,S),R=PA.default.join(t,S);if(y(R))continue;let I=r[S],q=!1;if($g.default.isAllowed$Ref(I,l)){if(d=TA(I,_,R,n,i,s,a,l,f),q=d.circular,r[S]!==d.value){let U=new Map;g?.preservedProperties&&typeof r[S]=="object"&&!Array.isArray(r[S])&&g?.preservedProperties.forEach(B=>{B in r[S]&&U.set(B,r[S][B])}),r[S]=d.value,g?.preservedProperties&&U.size&&typeof r[S]=="object"&&!Array.isArray(r[S])&&U.forEach((B,V)=>{r[S][V]=B}),g?.onDereference?.(I.$ref,r[S],r,S)}}else n.has(I)?q=AA(_,a,l):(d=KR(I,_,R,n,i,s,a,l,f),q=d.circular,r[S]!==d.value&&(r[S]=d.value));h.circular=h.circular||q}n.delete(r)}return h}function TA(r,e,t,n,i,s,a,l,f){let h=$g.default.isExternal$Ref(r)&&l?.dereference?.externalReferenceResolution==="root",g=kA.resolve(h?kA.cwd():e,r.$ref),y=s.get(g);if(y&&!y.circular){let U=Object.keys(r);if(U.length>1){let B={};for(let V of U)V!=="$ref"&&!(V in y.value)&&(B[V]=r[V]);return{circular:y.circular,value:Object.assign({},y.value,B)}}return y}let S=a._resolve(g,e,l);if(S===null)return{circular:!1,value:null};let _=S.circular,R=_||n.has(S.value);R&&AA(e,a,l);let I=$g.default.dereference(r,S.value);if(!R){let U=KR(I,S.path,t,n,i,s,a,l,f);R=U.circular,I=U.value}R&&!_&&l.dereference?.circular==="ignore"&&(I=r),_&&(I.$ref=t);let q={circular:R,value:I};return Object.keys(r).length===1&&s.set(g,q),q}function AA(r,e,t){if(e.circular=!0,t?.dereference?.onCircular?.(r),!t.dereference.circular)throw Q9.ono.reference(`Circular $ref pointer found at ${r}`);return!0}});var MA=F(QR=>{"use strict";Object.defineProperty(QR,"__esModule",{value:!0});function e8(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}QR.default=e8()});var DA=F(Ed=>{"use strict";var t8=Ed&&Ed.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ed,"__esModule",{value:!0});Ed.default=r8;var NA=t8(MA());function r8(r,e){if(r){e.then(function(t){(0,NA.default)(function(){r(null,t)})},function(t){(0,NA.default)(function(){r(t)})});return}else return e}});var UA=F(we=>{"use strict";var n8=we&&we.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),i8=we&&we.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),s8=we&&we.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&n8(t,e,n[i]);return i8(t,e),t}})(),ka=we&&we.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(we,"__esModule",{value:!0});we.getJsonSchemaRefParserDefaultOptions=we.jsonSchemaParserNormalizeArgs=we.dereferenceInternal=we.JSONParserErrorGroup=we.isHandledError=we.UnmatchedParserError=we.ParserError=we.ResolverError=we.MissingPointerError=we.InvalidPointerError=we.JSONParserError=we.UnmatchedResolverError=we.dereference=we.bundle=we.resolve=we.parse=we.$RefParser=void 0;var FA=ka(H1()),o8=ka(lR()),Od=ka(CA());we.jsonSchemaParserNormalizeArgs=Od.default;var a8=ka(xA()),l8=ka(IA()),jA=ka($A());we.dereferenceInternal=jA.default;var Pa=s8(On()),Pn=In();Object.defineProperty(we,"JSONParserError",{enumerable:!0,get:function(){return Pn.JSONParserError}});Object.defineProperty(we,"InvalidPointerError",{enumerable:!0,get:function(){return Pn.InvalidPointerError}});Object.defineProperty(we,"MissingPointerError",{enumerable:!0,get:function(){return Pn.MissingPointerError}});Object.defineProperty(we,"ResolverError",{enumerable:!0,get:function(){return Pn.ResolverError}});Object.defineProperty(we,"ParserError",{enumerable:!0,get:function(){return Pn.ParserError}});Object.defineProperty(we,"UnmatchedParserError",{enumerable:!0,get:function(){return Pn.UnmatchedParserError}});Object.defineProperty(we,"UnmatchedResolverError",{enumerable:!0,get:function(){return Pn.UnmatchedResolverError}});Object.defineProperty(we,"isHandledError",{enumerable:!0,get:function(){return Pn.isHandledError}});Object.defineProperty(we,"JSONParserErrorGroup",{enumerable:!0,get:function(){return Pn.JSONParserErrorGroup}});var LA=ao(),ui=ka(DA()),u8=WR();Object.defineProperty(we,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return u8.getJsonSchemaRefParserDefaultOptions}});var fo=class r{constructor(){this.schema=null,this.$refs=new FA.default}async parse(){let e=(0,Od.default)(arguments),t;if(!e.path&&!e.schema){let i=(0,LA.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,ui.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new FA.default;let n="http";if(Pa.isFileSystemPath(e.path))e.path=Pa.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=Pa.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=Pa.resolve(Pa.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,t=Promise.resolve(e.schema)}else t=(0,o8.default)(e.path,this.$refs,e.options);try{let i=await t;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,ui.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,ui.default)(e.callback,Promise.resolve(this.schema));throw LA.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,Pn.isHandledError)(i)?(0,ui.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[Pa.stripHash(e.path)]&&this.$refs._$refs[Pa.stripHash(e.path)].addError(i),(0,ui.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new r;return e.parse.apply(e,arguments)}async resolve(){let e=(0,Od.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,a8.default)(this,e.options),ZR(this),(0,ui.default)(e.callback,Promise.resolve(this.$refs))}catch(t){return(0,ui.default)(e.callback,Promise.reject(t))}}static resolve(){let e=new r;return e.resolve.apply(e,arguments)}static bundle(){let e=new r;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,Od.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,l8.default)(this,e.options),ZR(this),(0,ui.default)(e.callback,Promise.resolve(this.schema))}catch(t){return(0,ui.default)(e.callback,Promise.reject(t))}}static dereference(){let e=new r;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,Od.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,jA.default)(this,e.options),ZR(this),(0,ui.default)(e.callback,Promise.resolve(this.schema))}catch(t){return(0,ui.default)(e.callback,Promise.reject(t))}}};we.$RefParser=fo;we.default=fo;function ZR(r){if(Pn.JSONParserErrorGroup.getParserErrors(r).length>0)throw new Pn.JSONParserErrorGroup(r)}we.parse=fo.parse;we.resolve=fo.resolve;we.bundle=fo.bundle;we.dereference=fo.dereference});var Mg,ku,XR=se(()=>{"use strict";Mg=Cb(UA()),ku=class{async resolve(e){try{return await Mg.default.dereference(e,{dereference:{circular:"ignore"}})}catch(t){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",t),e}}async bundle(e){try{return await Mg.default.bundle(e)}catch(t){return console.error("[RefResolver] Failed to bundle $ref pointers:",t),e}}async resolveFile(e){try{return await Mg.default.dereference(e,{dereference:{circular:"ignore"}})}catch(t){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,t),t}}}});import*as HA from"fs";var BA,c8,Tu,eC=se(()=>{"use strict";BA=Cb(D_());bn();L_();XR();c8=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Tu=class{constructor(e,t){this.collectionService=e;this.envConfigService=t;this.exampleGenerator=new mu,this.refResolver=new ku}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,t){let n=await HA.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=BA.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},a=t?.collectionName||i.info?.title||"Imported API",f={id:pt(a),name:a,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(f.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let g=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);g&&(f.auth=g)}let d=new Map;if(i.tags)for(let g of i.tags){let y={type:"folder",id:pt(g.name),name:g.name,description:g.description,items:[]};d.set(g.name,y),f.items.push(y)}if(i.paths)for(let[g,y]of Object.entries(i.paths))for(let S of["get","post","put","patch","delete","head","options","trace"]){let _=y[S];if(!_)continue;let R=this.processOperation(S,g,_,y,i,s),I=_.tags?.[0];if(I&&d.has(I))d.get(I).items.push(R);else if(I){let q={type:"folder",id:pt(I),name:I,items:[R]};d.set(I,q),f.items.push(q)}else f.items.push(R)}await this.collectionService.saveCollection(f);let h;return t?.environmentName&&i.servers&&(h=await this.createEnvironmentFromServers(i.servers,t.environmentName)),{collection:f,environmentCreated:h}}processOperation(e,t,n,i,s,a){let l=pt(n.operationId||`${e}-${t}`),f=`{{baseUrl}}${this.convertPathParams(t)}`,d=n.summary||n.operationId||`${e.toUpperCase()} ${t}`,h=n.deprecated===!0;h&&(d=`[DEPRECATED] ${d}`);let g={type:"request",id:l,name:d,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:h},y=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(g,y,a),n.requestBody&&this.processRequestBody(g,n.requestBody,a),n.responses&&(g.responseSchema=this.processResponses(n.responses,a)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)g.auth={type:"none"};else if(n.security&&n.security.length>0){let S=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);S&&(g.auth=S)}}return g}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,t,n){let i=[],s=[],a={},l=[];for(let f of t){let d=f.name,h=f.in,g=f.schema||{},y=f.example!==void 0?String(f.example):this.generateExampleForParam(g,n),S=f.deprecated===!0;switch(h){case"path":{if(f.description||g.type||g.format||g.enum||S||g.pattern||g.minimum!==void 0||g.maximum!==void 0||g.minLength!==void 0||g.maxLength!==void 0||g.multipleOf!==void 0||g.minItems!==void 0||g.maxItems!==void 0||g.uniqueItems||g.nullable||g.oneOf){let R={value:y};g.oneOf?(R.oneOf=g.oneOf,this.applyOneOfHints(R,g.oneOf)):(g.type&&(R.type=g.type),g.format&&(R.format=g.format),g.enum&&(R.enum=g.enum.map(String)),g.pattern&&(R.pattern=g.pattern),g.minimum!==void 0&&(R.minimum=g.minimum),g.maximum!==void 0&&(R.maximum=g.maximum),g.exclusiveMinimum!==void 0&&(R.exclusiveMinimum=g.exclusiveMinimum),g.exclusiveMaximum!==void 0&&(R.exclusiveMaximum=g.exclusiveMaximum),g.multipleOf!==void 0&&(R.multipleOf=g.multipleOf),g.minLength!==void 0&&(R.minLength=g.minLength),g.maxLength!==void 0&&(R.maxLength=g.maxLength),g.minItems!==void 0&&(R.minItems=g.minItems),g.maxItems!==void 0&&(R.maxItems=g.maxItems),g.uniqueItems&&(R.uniqueItems=!0),g.nullable&&(R.nullable=!0)),f.description&&(R.description=f.description),S&&(R.deprecated=!0),a[d]=R}else a[d]=y;break}case"query":{let _={key:d,value:y};this.applySchemaConstraints(_,g,f,S),s.push(_);break}case"header":{let _={key:d,value:y};this.applySchemaConstraints(_,g,f,S),i.push(_);break}case"cookie":{l.push(`${d}={{${d}}}`);break}}}l.length>0&&i.push({key:"Cookie",value:l.join("; ")}),Object.keys(a).length>0&&(e.params=a),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,t,n,i){t.oneOf?(e.oneOf=t.oneOf,this.applyOneOfHints(e,t.oneOf)):(t.type&&(e.type=t.type),t.format&&(e.format=t.format),t.enum&&(e.enum=t.enum.map(String)),t.pattern&&(e.pattern=t.pattern),t.minimum!==void 0&&(e.minimum=t.minimum),t.maximum!==void 0&&(e.maximum=t.maximum),t.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=t.exclusiveMinimum),t.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=t.exclusiveMaximum),t.multipleOf!==void 0&&(e.multipleOf=t.multipleOf),t.minLength!==void 0&&(e.minLength=t.minLength),t.maxLength!==void 0&&(e.maxLength=t.maxLength),t.minItems!==void 0&&(e.minItems=t.minItems),t.maxItems!==void 0&&(e.maxItems=t.maxItems),t.uniqueItems&&(e.uniqueItems=!0),t.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,t){let n=[],i=new Set;for(let s of t)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,t){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:t});return n==null?"":String(n)}processRequestBody(e,t,n){if(!t.content)return;let i=Object.keys(t.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),a=t.content[s],{bodyType:l,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...f&&{format:f},content:""},a){let h=this.generateBodyContent(a,s,n);h!==void 0&&(e.body.content=typeof h=="string"?h:JSON.stringify(h,null,2)),l==="form-data"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n)),l==="x-www-form-urlencoded"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n))}let d=this.buildBodySchema(t,s,n);d&&(e.bodySchema=d)}selectPrimaryContentType(e){for(let i of c8)if(e.includes(i))return i;let t=e.find(i=>i.includes("json"));if(t)return t;let n=e.find(i=>i.startsWith("text/"));return n||e[0]}mapContentTypeToBodyType(e){return e.includes("json")?{bodyType:"raw",bodyFormat:"json"}:e==="application/xml"||e==="text/xml"?{bodyType:"raw",bodyFormat:"xml"}:e==="text/html"?{bodyType:"raw",bodyFormat:"html"}:e.startsWith("text/")?{bodyType:"raw",bodyFormat:"text"}:e==="multipart/form-data"?{bodyType:"form-data"}:e==="application/x-www-form-urlencoded"?{bodyType:"x-www-form-urlencoded"}:e==="application/octet-stream"?{bodyType:"binary"}:{bodyType:"raw",bodyFormat:"text"}}generateBodyContent(e,t,n){if(e.example!==void 0)return e.example;if(e.examples){let i=Object.values(e.examples)[0];if(i?.value!==void 0)return i.value}if(e.schema)return this.exampleGenerator.generate(e.schema,{omitReadOnly:!0,components:n})}buildFormDataEntries(e,t){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[a,l]of Object.entries(i)){let f=l,d=f.type==="string"&&f.format==="binary",h={key:a,value:d?"":String(this.exampleGenerator.generate(f,{components:t})||""),type:d?"file":"text",enabled:!0};n.push(h)}return n}buildBodySchema(e,t,n){let i=Object.keys(e.content),s=e.content[t];if(!s?.schema)return;let a={contentType:t,schema:s.schema};if(i.length>1){a.content={};for(let f of i){let d=e.content[f],h={};d.schema&&(h.schema=d.schema),d.examples&&(h.examples=d.examples),d.encoding&&(h.encoding=d.encoding),a.content[f]=h}}s.encoding&&(a.encoding=s.encoding);let l=this.extractUsedComponents(s.schema,n);return Object.keys(l).length>0&&(a.components=l),a}processResponses(e,t){let n={responses:{}},i={};for(let[s,a]of Object.entries(e)){let l=a,f={description:l.description||`Status ${s}`};if(l.content){let d=Object.keys(l.content);if(d.length===1){let h=d[0],g=l.content[h];f.contentType=h,g.schema&&(f.schema=g.schema),g.examples&&(f.examples=g.examples),g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,t))}else{f.content={};for(let h of d){let g=l.content[h],y={};g.schema&&(y.schema=g.schema),g.examples&&(y.examples=g.examples),f.content[h]=y,g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,t))}}}if(l.headers){f.headers={};for(let[d,h]of Object.entries(l.headers)){let g=h;f.headers[d]={...g.description&&{description:g.description},schema:g.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,t){let n=Object.keys(e)[0];if(!n)return;let i=t[n];if(i)switch(i.type){case"http":if(i.scheme==="bearer")return{type:"bearer",bearerToken:""};if(i.scheme==="basic")return{type:"basic",basicAuth:{username:"",password:""}};break;case"apiKey":return{type:"apikey",apikey:{key:i.name||"X-Api-Key",value:"",in:i.in||"header"}};case"oauth2":{let s=i.flows||{},a=s.authorizationCode||s.clientCredentials||s.password||s.implicit||{},l="client_credentials";return s.authorizationCode?l="authorization_code":s.password?l="password":s.implicit&&(l="implicit"),{type:"oauth2",oauth2:{grantType:l,tokenUrl:a.tokenUrl||"",authUrl:a.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(a.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,t){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return t}extractUsedComponents(e,t,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&t[s]&&!i[s]&&(i[s]=t[s],this.extractUsedComponents(t[s],t,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,t,i);e.items&&this.extractUsedComponents(e.items,t,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let a of e[s])this.extractUsedComponents(a,t,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,t,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}}});var qu,tC=se(()=>{"use strict";qu=class{constructor(e,t,n){this.historyAnalyzer=e;this.scriptAnalyzer=t;this.inferrer=n}historyAnalyzer;scriptAnalyzer;inferrer;async infer(e,t,n,i){let s=await this.historyAnalyzer.analyze(e,t,{environment:i?.environment}),a;return i?.postResponseScript&&(a=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,a)}async inferBodySchema(e,t,n,i,s){let a,l;if(t==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}a=this.inferrer.inferFromValue(f),l="application/json"}else t==="form-data"&&i?(a=this.buildFormDataSchema(i),l="multipart/form-data"):t==="x-www-form-urlencoded"&&i?(a=this.buildFormDataSchema(i),l="application/x-www-form-urlencoded"):t==="raw"&&n==="xml"?(a={type:"string"},l="application/xml"):t==="raw"&&(n==="text"||n==="html")?(a={type:"string"},l=n==="html"?"text/html":"text/plain"):t==="binary"?(a={type:"string",format:"binary"},l="application/octet-stream"):t==="graphql"&&(a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l="application/json");if(a)return s?this.mergeBodySchemaWithExisting(a,s):{contentType:l,schema:a}}buildFormDataSchema(e){let t={type:"object",properties:{}},n=[];for(let i of e){if(!i.enabled&&i.enabled!==void 0)continue;let s={};i.type?s.type=i.type:s.type="string",i.description&&(s.description=i.description),i.format&&(s.format=i.format),i.enum&&(s.enum=i.enum),i.type==="file"&&(s.type="string",s.format="binary"),t.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(t.required=n),t}mergeResponseSchemas(e,t,n){let i={responses:{}};for(let[s,a]of Object.entries(t.responses))i.responses[s]={...a};if(n&&this.applyScriptHints(i,n),e){for(let[s,a]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],a):i.responses[s]={...a};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,t){for(let n of t.expectedStatuses){let i=String(n);e.responses[i]||(e.responses[i]={description:`Status ${n}`})}for(let[,n]of Object.entries(e.responses))n.schema&&this.augmentSchemaWithHints(n.schema,t)}augmentSchemaWithHints(e,t){if(!(e.type!=="object"||!e.properties))for(let n of t.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,t)}}ensureFieldPath(e,t,n,i=""){if(t.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=t[0],a=s.endsWith("[]"),l=a?s.slice(0,-2):s,f=i?`${i}.${s}`:s,d=t.slice(1);if(!e.properties[l])if(a)e.properties[l]={type:"array",items:{type:"object"}};else if(d.length>0)e.properties[l]={type:"object",properties:{}};else{let h=n.typeHints[f];e.properties[l]={type:h||"string"};return}if(d.length>0){let h=a?e.properties[l].items:e.properties[l];h&&this.ensureFieldPath(h,d,n,f)}}mergeResponseDefinitions(e,t){let n={...e};return t.description&&(n.description=t.description),t.contentType&&(n.contentType=t.contentType),t.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,t.schema):t.schema&&(n.schema=t.schema),t.examples&&(n.examples={...e.examples||{},...t.examples}),t.content&&(n.content={...e.content||{},...t.content}),t.headers&&(n.headers={...e.headers||{},...t.headers}),n}mergeBodySchemaWithExisting(e,t){let n={...t};return t.schema?n.schema=this.inferrer.mergeSchemas(e,t.schema):n.schema=e,n}}});var VA,Ng,WA,zA,JA,GA,YA,Au,rC=se(()=>{"use strict";VA=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,Ng="(?:pm|hf|ctx)",WA=new RegExp(`${Ng}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),zA=new RegExp(`${Ng}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),JA=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,GA=new RegExp(`${Ng}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),YA=new RegExp(`${Ng}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),Au=class{analyze(e){let t={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return t;let n=this.stripComments(e);return this.extractFieldPaths(n,t),this.extractTypeAssertions(n,t),this.extractEqualityAssertions(n,t),this.extractBooleanAssertions(n,t),this.extractLengthAssertions(n,t),this.extractStatusAssertions(n,t),t.fieldPaths=[...new Set(t.fieldPaths)],t.expectedStatuses=[...new Set(t.expectedStatuses)],t}stripComments(e){let t=e.replace(/\/\*[\s\S]*?\*\//g,"");return t=t.replace(/\/\/.*$/gm,""),t}extractFieldPaths(e,t){let n,i=new RegExp(VA.source,VA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&t.fieldPaths.push(s)}}extractTypeAssertions(e,t){let n,i=new RegExp(WA.source,WA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].toLowerCase();s&&(t.typeHints[s]=this.mapAssertionType(a),t.fieldPaths.includes(s)||t.fieldPaths.push(s))}}extractEqualityAssertions(e,t){let n,i=new RegExp(zA.source,zA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].trim();if(s){let l=this.parseAssertionValue(a);l!==void 0&&(t.valueHints[s]=l,typeof l=="string"?t.typeHints[s]=t.typeHints[s]||"string":typeof l=="number"?t.typeHints[s]=t.typeHints[s]||(Number.isInteger(l)?"integer":"number"):typeof l=="boolean"&&(t.typeHints[s]=t.typeHints[s]||"boolean")),t.fieldPaths.includes(s)||t.fieldPaths.push(s)}}}extractBooleanAssertions(e,t){let n,i=new RegExp(GA.source,GA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(t.typeHints[s]="boolean",t.valueHints[s]=n[2]==="true",t.fieldPaths.includes(s)||t.fieldPaths.push(s))}}extractLengthAssertions(e,t){let n,i=new RegExp(YA.source,YA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(t.typeHints[s]=t.typeHints[s]||"array",t.fieldPaths.includes(s)||t.fieldPaths.push(s))}}extractStatusAssertions(e,t){let n,i=new RegExp(JA.source,JA.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&t.expectedStatuses.push(s)}}normalizeFieldPath(e){let t=e.replace(/^\./,"");return t=t.replace(/\[\d+\]/g,"[]"),t}isCommonMethodCall(e){return new Set(["to","be","have","not","deep","any","all","that","is","has","include","includes","equal","eql","above","below","least","most","within","length","lengthOf","match","string","keys","key","property","ownProperty","status","header","json","text"]).has(e.split(".")[0])}mapAssertionType(e){return{string:"string",number:"number",object:"object",array:"array",boolean:"boolean",null:"null",undefined:"null",int:"integer",integer:"integer",float:"number",double:"number"}[e]||"string"}parseAssertionValue(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let t=Number(e);return!isNaN(t)&&e.trim().length>0?t:e==="true"?!0:e==="false"?!1:e==="null"?null:e}}});var KA={};Ns(KA,{AwsSecretResolver:()=>Dg});var Dg,nC=se(()=>{"use strict";Dg=class{providerName="aws";region;moduleRequire;constructor(e,t){this.region=e.region??process.env.AWS_DEFAULT_REGION??process.env.AWS_REGION,this.moduleRequire=t??(n=>it(n))}async resolve(e){let t=e.lastIndexOf("#"),n=t>=0?e.slice(0,t):e,i=t>=0?e.slice(t+1):void 0;try{let{SecretsManagerClient:s,GetSecretValueCommand:a}=this.moduleRequire("@aws-sdk/client-secrets-manager"),f=await new s(this.region?{region:this.region}:{}).send(new a({SecretId:n})),d=f.SecretString??(f.SecretBinary?Buffer.from(f.SecretBinary).toString("utf-8"):void 0);if(d===void 0)return;if(i)try{let h=JSON.parse(d);return h[i]!==void 0?String(h[i]):void 0}catch{return}return d}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] AWS secret resolver requires @aws-sdk/client-secrets-manager. Install it in your project: npm install @aws-sdk/client-secrets-manager"):s}}}});var QA={};Ns(QA,{AzureKeyVaultResolver:()=>Fg});var Fg,iC=se(()=>{"use strict";Fg=class{providerName="azure";vaultUrl;moduleRequire;constructor(e,t){let n=(e.vaultUrl||process.env.AZURE_KEYVAULT_URL)??"";this.vaultUrl=n.replace(/\/$/,""),this.moduleRequire=t??(i=>it(i))}async resolve(e){if(!this.vaultUrl)throw new Error("[HTTP Forge] Azure Key Vault resolver: no vault URL configured. Set secrets.providers.<alias>.vaultUrl or the AZURE_KEYVAULT_URL env var.");let t=e.split("/"),n=t[0],i=t[1];try{let{SecretClient:s}=this.moduleRequire("@azure/keyvault-secrets"),{DefaultAzureCredential:a}=this.moduleRequire("@azure/identity"),l=new a;return(await new s(this.vaultUrl,l).getSecret(n,i?{version:i}:{})).value}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] Azure Key Vault resolver requires @azure/keyvault-secrets and @azure/identity. Install them: npm install @azure/keyvault-secrets @azure/identity"):s}}}});var ZA={};Ns(ZA,{HashiCorpVaultResolver:()=>Lg});var Lg,sC=se(()=>{"use strict";Lg=class{providerName="vault";address;mountPath;namespace;constructor(e){this.address=(e.address??process.env.VAULT_ADDR??"http://127.0.0.1:8200").replace(/\/$/,""),this.mountPath=e.mountPath??"secret",this.namespace=e.namespace??process.env.VAULT_NAMESPACE}async resolve(e){let t=e.lastIndexOf("#"),n=t>=0?e.slice(0,t):e,i=t>=0?e.slice(t+1):void 0,s=process.env.VAULT_TOKEN;if(!s)throw new Error("[HTTP Forge] HashiCorp Vault resolver requires VAULT_TOKEN environment variable to be set.");let a=`${this.address}/v1/${this.mountPath}/data/${n}`,l={"X-Vault-Token":s};this.namespace&&(l["X-Vault-Namespace"]=this.namespace);let f;try{f=await fetch(a,{headers:l})}catch(y){throw new Error(`[HTTP Forge] Vault request failed: ${y?.message??y}`)}if(f.status===404)return;if(!f.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${f.status} for path: ${n}`);let h=(await f.json())?.data?.data;if(!h)return;if(i)return h[i]!==void 0?String(h[i]):void 0;if("value"in h)return String(h.value);let g=Object.keys(h);return g.length===1?String(h[g[0]]):void 0}}});var XA={};Ns(XA,{OnePasswordResolver:()=>jg});import{execFile as f8}from"child_process";import{promisify as d8}from"util";var p8,jg,oC=se(()=>{"use strict";p8=d8(f8),jg=class{providerName="1password";defaultVault;constructor(e){this.defaultVault=e.vault}async resolve(e){let t=e.split("/"),n,i,s;if(this.defaultVault){if(t.length<2)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<item>/<field>" when vault is set in config.`);n=this.defaultVault,i=t.slice(0,t.length-1).join("/"),s=t[t.length-1]}else{if(t.length<3)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<vault>/<item>/<field>".`);n=t[0],i=t.slice(1,t.length-1).join("/"),s=t[t.length-1]}let a=await this.tryResolveSdk(n,i,s);return a!==null?a:this.resolveViaCli(n,i,s)}async tryResolveSdk(e,t,n){let i=process.env.OP_SERVICE_ACCOUNT_TOKEN;if(!i)return null;try{let{createClient:s}=it("@1password/sdk"),a=await s({auth:i,integrationName:"HTTP Forge",integrationVersion:"1.0.0"}),l=`op://${e}/${t}/${n}`;return await a.secrets.resolve(l)}catch(s){if(s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND")return null;throw new Error(`[HTTP Forge] 1Password SDK error for "${e}/${t}/${n}": ${s?.message??s}`)}}async resolveViaCli(e,t,n){try{let{stdout:i}=await p8("op",["item","get",t,"--vault",e,"--field",n,"--format","json"],{env:{...process.env},timeout:1e4}),s=JSON.parse(i.trim());return typeof s=="string"?s:s&&typeof s.value=="string"?s.value:void 0}catch(i){if(i?.code==="ENOENT")throw new Error("[HTTP Forge] 1Password resolver requires either the @1password/sdk npm package or the `op` CLI to be installed.\n Service Account: set OP_SERVICE_ACCOUNT_TOKEN and install @1password/sdk\n CLI: install 1Password CLI and run `op signin`");if(i?.stderr?.includes("not found")||i?.code===1)return;throw new Error(`[HTTP Forge] 1Password CLI error: ${i?.message??i}`)}}}});var e$={};Ns(e$,{GcpSecretResolver:()=>Ug});var Ug,aC=se(()=>{"use strict";Ug=class{providerName="gcp";projectId;moduleRequire;constructor(e,t){this.projectId=e.projectId??process.env.GOOGLE_CLOUD_PROJECT??process.env.GCLOUD_PROJECT??process.env.GCP_PROJECT,this.moduleRequire=t??(n=>it(n))}async resolve(e){let t=e.split("/"),n=t[0],i=t[1]==="versions"&&t[2]?t[2]:"latest";if(!this.projectId)throw new Error("[HTTP Forge] GCP secret resolver: no projectId configured and GOOGLE_CLOUD_PROJECT env var is not set.");try{let{SecretManagerServiceClient:s}=this.moduleRequire("@google-cloud/secret-manager"),a=new s,l=`projects/${this.projectId}/secrets/${n}/versions/${i}`,[f]=await a.accessSecretVersion({name:l}),d=f.payload?.data;return d?Buffer.isBuffer(d)?d.toString("utf-8"):Buffer.from(d).toString("utf-8"):void 0}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] GCP secret resolver requires @google-cloud/secret-manager. Install it: npm install @google-cloud/secret-manager"):s}}}});var r$={};Ns(r$,{DopplerResolver:()=>Hg});import*as t$ from"https";var Hg,lC=se(()=>{"use strict";Hg=class{providerName="doppler";token;constructor(e){this.token=e.serviceToken??process.env.DOPPLER_TOKEN}async resolve(e){let t=e.trim().toUpperCase(),n=this.token;if(!n)throw new Error("[HTTP Forge] Doppler secret resolver: no service token found. Set DOPPLER_TOKEN env var or add serviceToken to config.");let i=`https://api.doppler.com/v3/configs/config/secret?name=${encodeURIComponent(t)}`;return new Promise((s,a)=>{let l=t$.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},f=>{let d=[];f.on("data",h=>d.push(h)),f.on("end",()=>{let h=Buffer.concat(d).toString("utf-8");if(f.statusCode===404){s(void 0);return}if(f.statusCode!==200){a(new Error(`[HTTP Forge] Doppler API returned ${f.statusCode} for secret "${t}": ${h}`));return}try{let y=JSON.parse(h)?.value?.computed;s(y!=null?String(y):void 0)}catch{a(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${t}"`))}})});l.on("error",a),l.end()})}}});import*as Bg from"fs";import{createRequire as h8}from"module";import*as n$ from"path";var Id,uC=se(()=>{"use strict";Id=class{resolvers=new Map;moduleRequire;constructor(e){if(this.moduleRequire=this.buildModuleRequire(e),!e)return;let t;try{t=e.getConfig().secrets}catch{return}if(!(!t?.providers||typeof t.providers!="object"))for(let[n,i]of Object.entries(t.providers))try{let s=this.createResolver(i);s&&this.resolvers.set(n,s)}catch{}}async resolveSecretTokens(e,t){let n=t??new Map,i=new Set;if(this.collectTokens(e,i),i.size===0)return{};await Promise.all(Array.from(i).map(async a=>{if(n.has(a))return;let l=a.slice(7),f=l.indexOf("/");if(f<0)return;let d=l.slice(0,f),h=l.slice(f+1),g=this.resolvers.get(d);if(g)try{let y=await g.resolve(h);y!==void 0&&n.set(a,y)}catch(y){let S=y?.message??String(y);console.warn(`[HTTP Forge] {{${a}}} could not be resolved: ${S}`)}}));let s={};for(let[a,l]of n.entries())s[a]=l;return s}get hasProviders(){return this.resolvers.size>0}collectTokens(e,t){if(typeof e=="string"){let n=/\{\{(secret:[^}]+)\}\}/g,i;for(;(i=n.exec(e))!==null;)t.add(i[1])}else Array.isArray(e)?e.forEach(n=>this.collectTokens(n,t)):e!==null&&typeof e=="object"&&Object.values(e).forEach(n=>this.collectTokens(n,t))}createResolver(e){switch(e.provider){case"aws":{let{AwsSecretResolver:t}=(nC(),El(KA));return new t(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:t}=(iC(),El(QA));return new t(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:t}=(sC(),El(ZA));return new t(e)}case"1password":{let{OnePasswordResolver:t}=(oC(),El(XA));return new t(e)}case"gcp":{let{GcpSecretResolver:t}=(aC(),El(e$));return new t(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:t}=(lC(),El(r$));return new t(e)}default:return}}buildModuleRequire(e){let t=i=>it(i);if(!e)return t;let n=[];try{n=e.getModulePaths()??[]}catch{return t}for(let i of n)try{let s=n$.resolve(i,"package.json");if(Bg.existsSync(s)){let a=Bg.realpathSync(s),l=h8(a);return f=>{try{return l(f)}catch{return t(f)}}}}catch{}return t}}});var Pd,cC=se(()=>{"use strict";Pd={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as At from"fs";import*as po from"path";var kd,fC=se(()=>{"use strict";bn();cC();kd=class{constructor(e,t,n){this.collectionService=e;this.configService=t;this.suitesDir=t.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}collectionService;configService;suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){At.existsSync(this.suitesDir)||At.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=At.watch(this.suitesDir,(e,t)=>{t&&!t.endsWith(".suite.json")||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadSuites(),this.onSuitesChanged?.()},200))}),this.fileWatcher.on("error",()=>{})}catch{}}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.close(),this.fileWatcher=null}loadSuites(){if(this.suites.clear(),!At.existsSync(this.suitesDir))return;let e=At.readdirSync(this.suitesDir);for(let t of e)if(t.endsWith(".suite.json"))try{let n=po.join(this.suitesDir,t),i=At.readFileSync(n,"utf-8"),s=JSON.parse(i);s.id&&s.name&&this.suites.set(s.id,s)}catch(n){console.error(`[TestSuiteService] Failed to load ${t}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,t=[]){let n=Date.now(),i={id:pt(e),name:e,requests:t,config:{...Pd},createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}async updateSuite(e){e.updatedAt=Date.now(),await this.saveSuiteToDisk(e),this.suites.set(e.id,e)}async duplicateSuite(e,t){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(t,n.requests.map(l=>({...l})));i.config={...n.config},i.description=n.description;let s=po.join(this.suitesDir,e),a=po.join(this.suitesDir,i.id);return At.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,t){At.existsSync(t)||At.mkdirSync(t,{recursive:!0});for(let n of At.readdirSync(e,{withFileTypes:!0})){let i=po.join(e,n.name),s=po.join(t,n.name);n.isDirectory()?this.copyDirRecursive(i,s):At.copyFileSync(i,s)}}async deleteSuite(e){let t=this.suites.get(e);if(!t)return!1;let n=`${t.id}.suite.json`,i=po.join(this.suitesDir,n);try{return At.existsSync(i)&&At.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let t=this.collectionService.getCollection(e);if(!t){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(t,e,t.name,"",n);let i=Date.now();return{id:`temp-${e}`,name:t.name,requests:n,config:{...Pd},isTemporary:!0,createdAt:i,updatedAt:i}}async createTempSuiteFromFolder(e,t,n=!0){let i=this.collectionService.getCollection(e);if(!i){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let s=[];this.extractRequestsFromCollection(i,e,i.name,"",s);let a=t.replace(/\/+$/,""),l=s.filter(h=>n?h.folderPath===a||h.folderPath.startsWith(`${a}/`):h.folderPath===a);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${t}" in collection: ${e}`);return}let f=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(a)}`,name:`${i.name} / ${a}`,requests:l,config:{...Pd},isTemporary:!0,createdAt:f,updatedAt:f}}slugifyFolderPath(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async saveTempSuite(e,t){let n=Date.now(),i={...e,id:pt(t),name:t,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],t=this.collectionService.getAllCollections();for(let n of t)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,t,n,i,s){if(e.requests)for(let a of e.requests)s.push({collectionId:t,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.items)for(let a of e.items)if(a.items||a.folders||a.requests){let l=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,t,n,l,s)}else s.push({collectionId:t,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.folders)for(let a of e.folders){let l=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,t,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let t=`${e.id}.suite.json`,n=po.join(this.suitesDir,t),i=JSON.stringify(e,null,2);At.writeFileSync(n,i,"utf-8")}}});var re,Vg=se(()=>{"use strict";re={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),TestSuite:Symbol.for("ITestSuiteService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter"),SecretResolverRegistry:Symbol.for("SecretResolverRegistry")}});import*as i$ from"path";function Wg(r,e){let{workspaceFolder:t,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:a,secretStore:l,browserService:f,applicationInfo:d,consoleService:h}=e;r.registerValue(re.WorkspaceFolder,t),r.registerSingleton(re.Config,()=>new tu(t,n,i)),r.registerSingleton(re.Console,()=>h??m8),r.registerSingleton(re.EnvironmentConfig,y=>new kf(t,s,y.resolve(re.Config),n,l)),r.registerSingleton(re.Cookie,()=>new Of(a)),r.registerSingleton(re.Collection,y=>new Ef(t,y.resolve(re.Config),n)),r.registerSingleton(re.TestSuite,y=>new kd(y.resolve(re.Collection),y.resolve(re.Config))),r.registerSingleton(re.HttpClient,()=>new Xo),r.registerSingleton(re.UrlBuilder,()=>new Wn),r.registerSingleton(re.InterceptorChain,()=>new Qi),r.registerSingleton(re.HttpRequest,y=>new Ki(y.resolve(re.UrlBuilder),y.resolve(re.InterceptorChain),y.resolve(re.HttpClient))),r.registerSingleton(re.RequestPreprocessor,()=>new da),r.registerSingleton(re.RequestHistory,y=>{let S=y.resolve(re.EnvironmentConfig);return new Mf(S.getHistoriesPath(),i$.join(S.getRootPath(),"shared-histories"))}),l&&f&&r.registerSingleton(re.OAuth2TokenManager,y=>new Rf(l,f,y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest))),r.registerSingleton(re.GraphQLSchemaService,y=>new qf(y.resolve(re.HttpClient))),r.registerSingleton(re.SecretResolverRegistry,y=>new Id(y.resolve(re.Config)));let g=d??{name:"HttpForge",version:"0.0.0"};r.registerSingleton(re.RequestPreparer,y=>new Tf(y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest),y.resolve(re.RequestPreprocessor),y.has(re.OAuth2TokenManager)?y.resolve(re.OAuth2TokenManager):void 0,g,y.resolve(re.SecretResolverRegistry))),r.registerSingleton(re.ScriptExecutor,y=>{let S=y.resolve(re.Config);return new rs(y.resolve(re.HttpRequest),S.getModulePaths(),y.resolve(re.SecretResolverRegistry),S.getScriptScope(),S.getScriptTimeout())}),r.registerSingleton(re.DataFileParser,()=>new ha),r.registerSingleton(re.CollectionRequestExecutor,y=>new Gs(y.resolve(re.HttpRequest),y.resolve(re.ScriptExecutor),y.resolve(re.EnvironmentConfig),y.resolve(re.RequestPreparer),"")),r.registerSingleton(re.PersistentCookieJar,y=>new If(y.resolve(re.Cookie))),r.registerSingleton(re.SchemaInferrer,()=>new oo),r.registerSingleton(re.HistoryAnalyzer,y=>new ru(y.resolve(re.RequestHistory),y.resolve(re.SchemaInferrer))),r.registerSingleton(re.ScriptAnalyzer,()=>new Au),r.registerSingleton(re.SchemaInferenceService,y=>new qu(y.resolve(re.HistoryAnalyzer),y.resolve(re.ScriptAnalyzer),y.resolve(re.SchemaInferrer))),r.registerSingleton(re.OpenApiExporter,y=>new hu(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig),y.resolve(re.SchemaInferenceService))),r.registerSingleton(re.OpenApiImporter,y=>new Tu(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig)))}var m8,dC=se(()=>{"use strict";M0();j0();H0();B0();V0();z0();im();J0();G0();tw();Dc();Fc();Nc();Xh();Il();rw();F_();eC();tC();og();rC();em();bf();uC();fC();Vg();m8={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function s$(){return Ta.instance}var Ta,pC=se(()=>{"use strict";Vg();Ta=class r{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return r._instance||(r._instance=new r),r._instance}static createFresh(){return new r}static reset(){r._instance&&r._instance.clear(),r._instance=void 0}registerValue(e,t){return this.primitives.set(e,t),this}registerSingleton(e,t){return this.services.set(e,{factory:t,singleton:!0}),this}registerTransient(e,t){return this.services.set(e,{factory:t,singleton:!1}),this}registerInstance(e,t){return this.services.set(e,{factory:()=>t,singleton:!0,instance:t}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let t=this.services.get(e);if(!t)throw new Error(`Service not registered: ${e.toString()}`);return t.singleton?(t.instance||(t.instance=t.factory(this)),t.instance):t.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(re.Config)}get console(){return this.resolve(re.Console)}get environmentConfig(){return this.resolve(re.EnvironmentConfig)}get collection(){return this.resolve(re.Collection)}get httpRequest(){return this.resolve(re.HttpRequest)}get httpClient(){return this.resolve(re.HttpClient)}get cookie(){return this.resolve(re.Cookie)}get requestHistory(){return this.resolve(re.RequestHistory)}get dataFileParser(){return this.resolve(re.DataFileParser)}get scriptExecutor(){return this.resolve(re.ScriptExecutor)}get requestPreparer(){return this.resolve(re.RequestPreparer)}get persistentCookieJar(){return this.resolve(re.PersistentCookieJar)}get oauth2TokenManager(){return this.has(re.OAuth2TokenManager)?this.resolve(re.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(re.GraphQLSchemaService)}get testSuite(){return this.resolve(re.TestSuite)}}});import{createHash as g8}from"crypto";function ds(r,e=40){let t=g8("sha256").update(r,"utf8").digest("hex").slice(0,y8);return r.substring(0,e)+"_"+t}function b8(r,e){return r.length>0&&r.length<=e&&/^[a-zA-Z0-9_-]+$/.test(r)&&!r.includes("__")}function qa(r,e=v8){return b8(r,e)?r:ds(r,e-20)}function hC(r,e,t){let n=`${r}request__${qa(e)}__${qa(t)}`;return n.length<=zg?n:`${r}request__${ds(e)}__${ds(t)}`}function mC(r,e){let t=`${r}collection__${qa(e,100)}`;return t.length<=zg?t:`${r}collection__${ds(e,80)}`}function gC(r,e,t){let n=`${r}folder__${qa(e)}__${qa(t)}`;return n.length<=zg?n:`${r}folder__${ds(e)}__${ds(t)}`}function yC(r,e){let t=`${r}suite__${qa(e,100)}`;return t.length<=zg?t:`${r}suite__${ds(e,80)}`}function vC(r){for(let e of["request","collection","folder","suite"]){let t=`${e}__`;if(r.startsWith(t))return{kind:e,tokens:r.slice(t.length).split("__")}}throw new Error(`Unknown MCP tool name: ${r}`)}function $u(r,e){for(let t of e)if(ds(t)===r)return t;for(let t of e)if(t===r)return t}function bC(r,e){let t=$u(r,e);if(t!==void 0)return t;try{let n=Buffer.from(r,"base64url").toString("utf8");if(e.includes(n))return n}catch{}}function SC(r,e,t,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${r}]${i} of the "${t}" collection.`}function wC(r,e){return`Run all ${e} requests in the "${r}" collection.`}function _C(r,e,t){return`Run all ${t} requests in folder "${r}" of the "${e}" collection.`}function RC(r,e,t){return`Run the "${r}" test suite (${e} requests, ${t} iteration(s) by default).`}var y8,v8,zg,CC=se(()=>{"use strict";y8=12,v8=60,zg=126});function o$(r,e){let t={type:"string",description:r};return e.length>0&&(t.enum=[...e]),t}function xC(r,e,t){let n=i=>o$("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${r}${ot.listCollections}`,description:"List all available HTTP Forge collections (name, description, and request count). Call this first to discover what collections exist, then use list_folders, list_requests or run_* tools.",inputSchema:{type:"object",properties:{}}},{name:`${r}${ot.listFolders}`,description:"List all folders in a collection with their full paths and request counts. Use this before run_folder to discover the exact folder path string to pass.",inputSchema:{type:"object",properties:{collection:n(!0)},required:["collection"]}},{name:`${r}${ot.listRequests}`,description:"List the saved requests in a collection (name, HTTP method, folder, and description). Use this to find the exact request name before calling run_request. For large collections use the folder filter and offset/limit to page through results.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Optional folder path to filter by (e.g. "Auth").'},offset:{type:"number",description:"Zero-based index to start from (default: 0)."},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 200)."}},required:["collection"]}},{name:`${r}${ot.searchRequests}`,description:"Search for requests across a collection by name, URL, method, or folder path. Returns matching requests with their folder location. Useful for large collections.",inputSchema:{type:"object",properties:{collection:n(!0),query:{type:"string",description:"Text to search for in request names, URLs, methods, and folder paths (case-insensitive)."}},required:["collection","query"]}},{name:`${r}${ot.getEnvironment}`,description:"Show the current environment variable values (merged initial + runtime pm.environment.set overrides). Use this to inspect variable state before running a folder, or to debug {{variable}} resolution failures.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name to inspect (defaults to the currently selected environment)."}}}},{name:`${r}${ot.setVariable}`,description:"Override an environment variable for the current session (in-memory only \u2014 does not write to disk). Use this to inject a token or base URL before running a folder. Changes are visible to all subsequent run_* calls until the MCP server restarts.",inputSchema:{type:"object",properties:{key:{type:"string",description:"Variable name (the part inside {{...}})."},value:{type:"string",description:"New value to set."},environment:{type:"string",description:"Environment to update (defaults to the currently selected environment)."}},required:["key","value"]}},{name:`${r}${ot.getRunStatus}`,description:"Check whether an async run is still running, completed, or failed. Poll this after calling run_folder/run_collection/run_suite with async:true.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]}},{name:`${r}${ot.getRunSummary}`,description:'Get the pass/fail summary of a completed async run (total, passed, failed counts). Use after get_run_status shows "completed".',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]}},{name:`${r}${ot.getFailedRequests}`,description:"Get the list of failed requests from a completed async run \u2014 the failures-first view. Never returns passing requests. Use this instead of get_run_summary when you need to see what broke.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."},offset:{type:"number",description:"Zero-based index to start from (default: 0)."},limit:{type:"number",description:"Maximum failures to return (default: 20, max: 100)."}},required:["runId"]}},{name:`${r}${ot.getRequestResult}`,description:"Get the full result (status, body, assertions, console output) for one specific request from an async run. Use after get_failed_requests to drill into a single failure.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."},request:{type:"string",description:"Name of the request to look up."},iteration:{type:"number",description:"Iteration number (default: 1)."}},required:["runId","request"]}},{name:`${r}${ot.runRequest}`,description:"Run a single saved request. Pick the collection, then the request name within it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Name of the request to run. Use list_requests or search_requests to find names."},requestId:{type:"string",description:'ID of the request (from list_requests/search_requests). Preferred over "request" name when available \u2014 avoids ambiguity with duplicate names.'},...Jg.properties},required:["collection","request"]}},{name:`${r}${ot.runFolder}`,description:"Run every request inside a folder of a collection.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Folder path within the collection (e.g. "Auth/Login").'},...Yg.properties},required:["collection","folder"]}},{name:`${r}${ot.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...Gg.properties},required:["collection"]}},{name:`${r}${ot.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:o$("Name of the test suite to run.",t),...Kg.properties},required:["suite"]}}]}var Jg,Gg,Yg,Kg,ot,EC=se(()=>{"use strict";Jg={type:"object",properties:{environment:{type:"string",description:"Environment name to use (defaults to the currently selected environment)"},variables:{type:"object",description:"Extra variables to inject \u2014 merged with environment variables, {{name}} syntax",additionalProperties:{type:"string"}},headers:{type:"object",description:"Override or add request headers",additionalProperties:{type:"string"}},query:{type:"object",description:"Override query parameters",additionalProperties:{type:"string"}},body:{type:"string",description:"Replace the request body (JSON string). Omit to use the saved body."},include:{type:"array",items:{type:"string",enum:["headers","cookies","tests","consoleOutput","report"]},description:"Extra fields to include in the response (default: status, ok, body, allPassed)"}}},Gg={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests."}}},Yg={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},recursive:{type:"boolean",description:"Include requests in nested subfolders (default: true)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests."}}},Kg={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations (overrides suite default)"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results."},requestFilter:{type:"array",items:{type:"string"},description:"Run only requests whose names match one of these strings (case-insensitive)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level (default: summary + failedRequests)"}}},ot={listCollections:"list_collections",listFolders:"list_folders",listRequests:"list_requests",searchRequests:"search_requests",getEnvironment:"get_environment",runRequest:"run_request",runFolder:"run_folder",runCollection:"run_collection",runSuite:"run_suite",getRunStatus:"get_run_status",getRunSummary:"get_run_summary",getFailedRequests:"get_failed_requests",getRequestResult:"get_request_result",setVariable:"set_variable"}});var Mu,OC=se(()=>{"use strict";zo();Mu=class{cookies=new Map;getCookieKey(e,t,n){return`${t||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let t=[];for(let n of this.cookies.values())lt.isExpired(n)||(!n.domain||lt.domainMatches(e,n.domain))&&t.push(n);return t}has(e,t){return this.get(e,t)!==void 0}get(e,t){let n=this.getCookieKey(e,t),i=this.cookies.get(n);if(i&&!lt.isExpired(i))return i}set(e){let t=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(t,e)}delete(e,t,n){let i=this.getCookieKey(e,t,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let t=[];for(let n of this.cookies.values())lt.isExpired(n)||t.push(n);return t}setCookiesFromResponse(e,t){let n=lt.extractDomain(e),i=lt.parseCookieHeaders(t,n);for(let s of i){let a=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(a,s)}}getCookieHeader(e){let t=lt.extractDomain(e),n=lt.extractPath(e),s=this.getCookiesForDomain(t).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return lt.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function Qg(r,e,t){let n=String(r).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${t}.json`}function S8(r){return{index:r.i,iteration:r.it,name:r.n,method:Nu[r.m]||"GET",status:r.s,duration:r.d,passed:r.p,assertionsPassed:r.ap,assertionsFailed:r.af,requestId:r.r,resultFile:Qg(r.i,r.it,r.r),error:r.e}}var IC,Nu,Zg=se(()=>{"use strict";IC={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Nu={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as Fu from"fs/promises";import*as Du from"path";function vt(r){return String(r??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Aa(r){return r>=1e3?`${(r/1e3).toFixed(2)}s`:`${r}ms`}function PC(r){try{return new Date(r).toLocaleString()}catch{return r}}function Xg(r){return r>=200&&r<300?"status-2xx":r>=300&&r<400?"status-3xx":r>=400&&r<500?"status-4xx":"status-5xx"}function w8(r,e){return e===0?"\u2014":`${Math.round(r/e*100)}%`}function u$(r){try{return typeof r=="string"&&(r=JSON.parse(r)),JSON.stringify(r,null,2)}catch{return String(r??"")}}function a$(r){return!r||Object.keys(r).length===0?'<span class="dim">\u2014</span>':`<table class="kv-table">${Object.entries(r).map(([t,n])=>{let i=Array.isArray(n)?n.join(", "):String(n??"");return`<tr><td class="kv-key">${vt(t)}</td><td class="kv-val">${vt(i)}</td></tr>`}).join("")}</table>`}function _8(r){return r==null||r===""?'<span class="dim">\u2014</span>':typeof r=="string"?vt(r):typeof r=="number"||typeof r=="boolean"?vt(String(r)):`<pre class="code">${vt(u$(r))}</pre>`}function kC(r){return!r||Object.keys(r).length===0?'<span class="dim">\u2014</span>':`<table class="kv-table meta-table">${Object.entries(r).map(([t,n])=>`
|
|
277
|
+
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,kg.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Rd.resolve(r.href,i.headers.location);return bA(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new vA.ResolverError((0,kg.ono)(i,`Error downloading ${r.href}`),r.href)}}async function _9(r,e){let t,n;e.timeout&&(t=new AbortController,n=setTimeout(()=>t.abort(),e.timeout));let i=await fetch(r,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:t?t.signal:null});return n&&clearTimeout(n),i}});var WR=F(fs=>{"use strict";var Iu=fs&&fs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fs,"__esModule",{value:!0});fs.getNewOptions=fs.getJsonSchemaRefParserDefaultOptions=void 0;var R9=Iu(J1()),C9=Iu(fA()),x9=Iu(dA()),E9=Iu(pA()),O9=Iu(yA()),I9=Iu(SA()),P9=()=>({parse:{json:{...R9.default},yaml:{...C9.default},text:{...x9.default},binary:{...E9.default}},resolve:{file:{...O9.default},http:{...I9.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});fs.getJsonSchemaRefParserDefaultOptions=P9;var k9=r=>{let e=(0,fs.getJsonSchemaRefParserDefaultOptions)();return r&&_A(e,r),e};fs.getNewOptions=k9;function _A(r,e){if(wA(e)){let t=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<t.length;n++){let i=t[n],s=e[i],a=r[i];wA(s)?r[i]=_A(a||{},s):s!==void 0&&(r[i]=s)}}return r}function wA(r){return r&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}});var CA=F(Tg=>{"use strict";Object.defineProperty(Tg,"__esModule",{value:!0});Tg.normalizeArgs=RA;var T9=WR();function RA(r){let e,t,n,i,s=Array.prototype.slice.call(r);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(t=s[1],n=s[2]):(t=void 0,n=s[1])):(e="",t=s[0],n=s[1]);try{n=(0,T9.getNewOptions)(n)}catch(a){console.error(`JSON Schema Ref Parser: Error normalizing options: ${a}`)}return!n.mutateInputSchema&&typeof t=="object"&&(t=JSON.parse(JSON.stringify(t))),{path:e,schema:t,options:n,callback:i}}Tg.default=RA});var xA=F(si=>{"use strict";var q9=si&&si.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),A9=si&&si.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),$9=si&&si.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&q9(t,e,n[i]);return A9(t,e),t}})(),zR=si&&si.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(si,"__esModule",{value:!0});var M9=zR(Su()),N9=zR(dd()),D9=zR(lR()),Pu=$9(On()),F9=In();function L9(r,e){if(!e.resolve?.external)return Promise.resolve();try{let t=JR(r.schema,r.$refs._root$Ref.path+"#",r.$refs,e);return Promise.all(t)}catch(t){return Promise.reject(t)}}function JR(r,e,t,n,i,s){i||(i=new Set);let a=[];if(r&&typeof r=="object"&&!ArrayBuffer.isView(r)&&!i.has(r)){i.add(r),M9.default.isExternal$Ref(r)&&a.push(j9(r,e,t,n));let l=Object.keys(r);for(let f of l){let d=N9.default.join(e,f),h=r[f];a=a.concat(JR(h,d,t,n,i,s))}}return a}async function j9(r,e,t,n){let i=n.dereference?.externalReferenceResolution==="root",s=Pu.resolve(i?Pu.cwd():e,r.$ref),a=Pu.stripHash(s),l=t._$refs[a];if(l)return Promise.resolve(l.value);try{let f=await(0,D9.default)(s,t,n),d=JR(f,a+"#",t,n,new Set,!0);return Promise.all(d)}catch(f){if(!n?.continueOnError||!(0,F9.isHandledError)(f))throw f;return t._$refs[a]&&(f.source=decodeURI(Pu.stripHash(e)),f.path=Pu.safePointerToPath(Pu.getHash(e))),[]}}si.default=L9});var IA=F(oi=>{"use strict";var U9=oi&&oi.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),H9=oi&&oi.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),B9=oi&&oi.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&U9(t,e,n[i]);return H9(t,e),t}})(),OA=oi&&oi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oi,"__esModule",{value:!0});var qg=OA(Su()),Cd=OA(dd()),GR=B9(On());function V9(r,e){let t=[];YR(r,"schema",r.$refs._root$Ref.path+"#","#",0,t,r.$refs,e),W9(t)}function YR(r,e,t,n,i,s,a,l){let f=e===null?r:r[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(qg.default.isAllowed$Ref(f))EA(r,e,t,n,i,s,a,l);else{let d=Object.keys(f).sort((h,g)=>h==="definitions"?-1:g==="definitions"?1:h.length-g.length);for(let h of d){let g=Cd.default.join(t,h),y=Cd.default.join(n,h),S=f[h];qg.default.isAllowed$Ref(S)?EA(f,h,t,y,i,s,a,l):YR(f,h,g,y,i,s,a,l)}}}function EA(r,e,t,n,i,s,a,l){let f=e===null?r:r[e],d=GR.resolve(t,f.$ref),h=a._resolve(d,n,l);if(h===null)return;let y=Cd.default.parse(n).length,S=GR.stripHash(h.path),_=GR.getHash(h.path),R=S!==a._root$Ref.path,I=qg.default.isExtended$Ref(f);i+=h.indirections;let q=z9(s,r,e);if(q)if(y<q.depth||i<q.indirections)J9(s,q);else return;s.push({$ref:f,parent:r,key:e,pathFromRoot:n,depth:y,file:S,hash:_,value:h.value,circular:h.circular,extended:I,external:R,indirections:i}),(!q||R)&&YR(h.value,null,h.path,n,i+1,s,a,l)}function W9(r){r.sort((i,s)=>{if(i.file!==s.file)return i.file<s.file?-1:1;if(i.hash!==s.hash)return i.hash<s.hash?-1:1;if(i.circular!==s.circular)return i.circular?-1:1;if(i.extended!==s.extended)return i.extended?1:-1;if(i.indirections!==s.indirections)return i.indirections-s.indirections;if(i.depth!==s.depth)return i.depth-s.depth;{let a=i.pathFromRoot.lastIndexOf("/definitions"),l=s.pathFromRoot.lastIndexOf("/definitions");return a!==l?l-a:i.pathFromRoot.length-s.pathFromRoot.length}});let e,t,n;for(let i of r)i.external?i.file===e&&i.hash===t?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(t+"/")===0?i.$ref.$ref=Cd.default.join(n,Cd.default.parse(i.hash.replace(t,"#"))):(e=i.file,t=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=qg.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function z9(r,e,t){for(let n of r)if(n&&n.parent===e&&n.key===t)return n}function J9(r,e){let t=r.indexOf(e);r.splice(t,1)}oi.default=V9});var $A=F(ai=>{"use strict";var G9=ai&&ai.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Y9=ai&&ai.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),K9=ai&&ai.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&G9(t,e,n[i]);return Y9(t,e),t}})(),qA=ai&&ai.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ai,"__esModule",{value:!0});var Ag=qA(Su()),PA=qA(dd()),Q9=ao(),kA=K9(On()),Z9=In();ai.default=X9;function X9(r,e){let t=Date.now(),n=KR(r.schema,r.$refs._root$Ref.path,"#",new Set,new Set,new Map,r.$refs,e,t);r.$refs.circular=n.circular,r.schema=n.value}function KR(r,e,t,n,i,s,a,l,f){let d,h={value:r,circular:!1};if(l&&l.timeoutMs&&Date.now()-f>l.timeoutMs)throw new Z9.TimeoutError(l.timeoutMs);let g=l.dereference||{},y=g.excludedPathMatcher||(()=>!1);if((g?.circular==="ignore"||!i.has(r))&&r&&typeof r=="object"&&!ArrayBuffer.isView(r)&&!y(t)){if(n.add(r),i.add(r),Ag.default.isAllowed$Ref(r,l))d=TA(r,e,t,n,i,s,a,l,f),h.circular=d.circular,h.value=d.value;else for(let S of Object.keys(r)){let _=PA.default.join(e,S),R=PA.default.join(t,S);if(y(R))continue;let I=r[S],q=!1;if(Ag.default.isAllowed$Ref(I,l)){if(d=TA(I,_,R,n,i,s,a,l,f),q=d.circular,r[S]!==d.value){let j=new Map;g?.preservedProperties&&typeof r[S]=="object"&&!Array.isArray(r[S])&&g?.preservedProperties.forEach(B=>{B in r[S]&&j.set(B,r[S][B])}),r[S]=d.value,g?.preservedProperties&&j.size&&typeof r[S]=="object"&&!Array.isArray(r[S])&&j.forEach((B,V)=>{r[S][V]=B}),g?.onDereference?.(I.$ref,r[S],r,S)}}else n.has(I)?q=AA(_,a,l):(d=KR(I,_,R,n,i,s,a,l,f),q=d.circular,r[S]!==d.value&&(r[S]=d.value));h.circular=h.circular||q}n.delete(r)}return h}function TA(r,e,t,n,i,s,a,l,f){let h=Ag.default.isExternal$Ref(r)&&l?.dereference?.externalReferenceResolution==="root",g=kA.resolve(h?kA.cwd():e,r.$ref),y=s.get(g);if(y&&!y.circular){let j=Object.keys(r);if(j.length>1){let B={};for(let V of j)V!=="$ref"&&!(V in y.value)&&(B[V]=r[V]);return{circular:y.circular,value:Object.assign({},y.value,B)}}return y}let S=a._resolve(g,e,l);if(S===null)return{circular:!1,value:null};let _=S.circular,R=_||n.has(S.value);R&&AA(e,a,l);let I=Ag.default.dereference(r,S.value);if(!R){let j=KR(I,S.path,t,n,i,s,a,l,f);R=j.circular,I=j.value}R&&!_&&l.dereference?.circular==="ignore"&&(I=r),_&&(I.$ref=t);let q={circular:R,value:I};return Object.keys(r).length===1&&s.set(g,q),q}function AA(r,e,t){if(e.circular=!0,t?.dereference?.onCircular?.(r),!t.dereference.circular)throw Q9.ono.reference(`Circular $ref pointer found at ${r}`);return!0}});var MA=F(QR=>{"use strict";Object.defineProperty(QR,"__esModule",{value:!0});function e8(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}QR.default=e8()});var DA=F(xd=>{"use strict";var t8=xd&&xd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xd,"__esModule",{value:!0});xd.default=r8;var NA=t8(MA());function r8(r,e){if(r){e.then(function(t){(0,NA.default)(function(){r(null,t)})},function(t){(0,NA.default)(function(){r(t)})});return}else return e}});var UA=F(we=>{"use strict";var n8=we&&we.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),i8=we&&we.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),s8=we&&we.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&n8(t,e,n[i]);return i8(t,e),t}})(),ka=we&&we.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(we,"__esModule",{value:!0});we.getJsonSchemaRefParserDefaultOptions=we.jsonSchemaParserNormalizeArgs=we.dereferenceInternal=we.JSONParserErrorGroup=we.isHandledError=we.UnmatchedParserError=we.ParserError=we.ResolverError=we.MissingPointerError=we.InvalidPointerError=we.JSONParserError=we.UnmatchedResolverError=we.dereference=we.bundle=we.resolve=we.parse=we.$RefParser=void 0;var FA=ka(H1()),o8=ka(lR()),Ed=ka(CA());we.jsonSchemaParserNormalizeArgs=Ed.default;var a8=ka(xA()),l8=ka(IA()),jA=ka($A());we.dereferenceInternal=jA.default;var Pa=s8(On()),Pn=In();Object.defineProperty(we,"JSONParserError",{enumerable:!0,get:function(){return Pn.JSONParserError}});Object.defineProperty(we,"InvalidPointerError",{enumerable:!0,get:function(){return Pn.InvalidPointerError}});Object.defineProperty(we,"MissingPointerError",{enumerable:!0,get:function(){return Pn.MissingPointerError}});Object.defineProperty(we,"ResolverError",{enumerable:!0,get:function(){return Pn.ResolverError}});Object.defineProperty(we,"ParserError",{enumerable:!0,get:function(){return Pn.ParserError}});Object.defineProperty(we,"UnmatchedParserError",{enumerable:!0,get:function(){return Pn.UnmatchedParserError}});Object.defineProperty(we,"UnmatchedResolverError",{enumerable:!0,get:function(){return Pn.UnmatchedResolverError}});Object.defineProperty(we,"isHandledError",{enumerable:!0,get:function(){return Pn.isHandledError}});Object.defineProperty(we,"JSONParserErrorGroup",{enumerable:!0,get:function(){return Pn.JSONParserErrorGroup}});var LA=ao(),li=ka(DA()),u8=WR();Object.defineProperty(we,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return u8.getJsonSchemaRefParserDefaultOptions}});var fo=class r{constructor(){this.schema=null,this.$refs=new FA.default}async parse(){let e=(0,Ed.default)(arguments),t;if(!e.path&&!e.schema){let i=(0,LA.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,li.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new FA.default;let n="http";if(Pa.isFileSystemPath(e.path))e.path=Pa.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=Pa.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=Pa.resolve(Pa.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,t=Promise.resolve(e.schema)}else t=(0,o8.default)(e.path,this.$refs,e.options);try{let i=await t;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,li.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,li.default)(e.callback,Promise.resolve(this.schema));throw LA.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,Pn.isHandledError)(i)?(0,li.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[Pa.stripHash(e.path)]&&this.$refs._$refs[Pa.stripHash(e.path)].addError(i),(0,li.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new r;return e.parse.apply(e,arguments)}async resolve(){let e=(0,Ed.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,a8.default)(this,e.options),ZR(this),(0,li.default)(e.callback,Promise.resolve(this.$refs))}catch(t){return(0,li.default)(e.callback,Promise.reject(t))}}static resolve(){let e=new r;return e.resolve.apply(e,arguments)}static bundle(){let e=new r;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,Ed.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,l8.default)(this,e.options),ZR(this),(0,li.default)(e.callback,Promise.resolve(this.schema))}catch(t){return(0,li.default)(e.callback,Promise.reject(t))}}static dereference(){let e=new r;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,Ed.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,jA.default)(this,e.options),ZR(this),(0,li.default)(e.callback,Promise.resolve(this.schema))}catch(t){return(0,li.default)(e.callback,Promise.reject(t))}}};we.$RefParser=fo;we.default=fo;function ZR(r){if(Pn.JSONParserErrorGroup.getParserErrors(r).length>0)throw new Pn.JSONParserErrorGroup(r)}we.parse=fo.parse;we.resolve=fo.resolve;we.bundle=fo.bundle;we.dereference=fo.dereference});var $g,ku,XR=se(()=>{"use strict";$g=Cb(UA()),ku=class{async resolve(e){try{return await $g.default.dereference(e,{dereference:{circular:"ignore"}})}catch(t){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",t),e}}async bundle(e){try{return await $g.default.bundle(e)}catch(t){return console.error("[RefResolver] Failed to bundle $ref pointers:",t),e}}async resolveFile(e){try{return await $g.default.dereference(e,{dereference:{circular:"ignore"}})}catch(t){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,t),t}}}});import*as HA from"fs";var BA,c8,Tu,eC=se(()=>{"use strict";BA=Cb(D_());bn();L_();XR();c8=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Tu=class{constructor(e,t){this.collectionService=e;this.envConfigService=t;this.exampleGenerator=new mu,this.refResolver=new ku}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,t){let n=await HA.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=BA.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},a=t?.collectionName||i.info?.title||"Imported API",f={id:pt(a),name:a,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(f.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let g=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);g&&(f.auth=g)}let d=new Map;if(i.tags)for(let g of i.tags){let y={type:"folder",id:pt(g.name),name:g.name,description:g.description,items:[]};d.set(g.name,y),f.items.push(y)}if(i.paths)for(let[g,y]of Object.entries(i.paths))for(let S of["get","post","put","patch","delete","head","options","trace"]){let _=y[S];if(!_)continue;let R=this.processOperation(S,g,_,y,i,s),I=_.tags?.[0];if(I&&d.has(I))d.get(I).items.push(R);else if(I){let q={type:"folder",id:pt(I),name:I,items:[R]};d.set(I,q),f.items.push(q)}else f.items.push(R)}await this.collectionService.saveCollection(f);let h;return t?.environmentName&&i.servers&&(h=await this.createEnvironmentFromServers(i.servers,t.environmentName)),{collection:f,environmentCreated:h}}processOperation(e,t,n,i,s,a){let l=pt(n.operationId||`${e}-${t}`),f=`{{baseUrl}}${this.convertPathParams(t)}`,d=n.summary||n.operationId||`${e.toUpperCase()} ${t}`,h=n.deprecated===!0;h&&(d=`[DEPRECATED] ${d}`);let g={type:"request",id:l,name:d,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:h},y=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(g,y,a),n.requestBody&&this.processRequestBody(g,n.requestBody,a),n.responses&&(g.responseSchema=this.processResponses(n.responses,a)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)g.auth={type:"none"};else if(n.security&&n.security.length>0){let S=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);S&&(g.auth=S)}}return g}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,t,n){let i=[],s=[],a={},l=[];for(let f of t){let d=f.name,h=f.in,g=f.schema||{},y=f.example!==void 0?String(f.example):this.generateExampleForParam(g,n),S=f.deprecated===!0;switch(h){case"path":{if(f.description||g.type||g.format||g.enum||S||g.pattern||g.minimum!==void 0||g.maximum!==void 0||g.minLength!==void 0||g.maxLength!==void 0||g.multipleOf!==void 0||g.minItems!==void 0||g.maxItems!==void 0||g.uniqueItems||g.nullable||g.oneOf){let R={value:y};g.oneOf?(R.oneOf=g.oneOf,this.applyOneOfHints(R,g.oneOf)):(g.type&&(R.type=g.type),g.format&&(R.format=g.format),g.enum&&(R.enum=g.enum.map(String)),g.pattern&&(R.pattern=g.pattern),g.minimum!==void 0&&(R.minimum=g.minimum),g.maximum!==void 0&&(R.maximum=g.maximum),g.exclusiveMinimum!==void 0&&(R.exclusiveMinimum=g.exclusiveMinimum),g.exclusiveMaximum!==void 0&&(R.exclusiveMaximum=g.exclusiveMaximum),g.multipleOf!==void 0&&(R.multipleOf=g.multipleOf),g.minLength!==void 0&&(R.minLength=g.minLength),g.maxLength!==void 0&&(R.maxLength=g.maxLength),g.minItems!==void 0&&(R.minItems=g.minItems),g.maxItems!==void 0&&(R.maxItems=g.maxItems),g.uniqueItems&&(R.uniqueItems=!0),g.nullable&&(R.nullable=!0)),f.description&&(R.description=f.description),S&&(R.deprecated=!0),a[d]=R}else a[d]=y;break}case"query":{let _={key:d,value:y};this.applySchemaConstraints(_,g,f,S),s.push(_);break}case"header":{let _={key:d,value:y};this.applySchemaConstraints(_,g,f,S),i.push(_);break}case"cookie":{l.push(`${d}={{${d}}}`);break}}}l.length>0&&i.push({key:"Cookie",value:l.join("; ")}),Object.keys(a).length>0&&(e.params=a),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,t,n,i){t.oneOf?(e.oneOf=t.oneOf,this.applyOneOfHints(e,t.oneOf)):(t.type&&(e.type=t.type),t.format&&(e.format=t.format),t.enum&&(e.enum=t.enum.map(String)),t.pattern&&(e.pattern=t.pattern),t.minimum!==void 0&&(e.minimum=t.minimum),t.maximum!==void 0&&(e.maximum=t.maximum),t.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=t.exclusiveMinimum),t.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=t.exclusiveMaximum),t.multipleOf!==void 0&&(e.multipleOf=t.multipleOf),t.minLength!==void 0&&(e.minLength=t.minLength),t.maxLength!==void 0&&(e.maxLength=t.maxLength),t.minItems!==void 0&&(e.minItems=t.minItems),t.maxItems!==void 0&&(e.maxItems=t.maxItems),t.uniqueItems&&(e.uniqueItems=!0),t.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,t){let n=[],i=new Set;for(let s of t)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,t){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:t});return n==null?"":String(n)}processRequestBody(e,t,n){if(!t.content)return;let i=Object.keys(t.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),a=t.content[s],{bodyType:l,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...f&&{format:f},content:""},a){let h=this.generateBodyContent(a,s,n);h!==void 0&&(e.body.content=typeof h=="string"?h:JSON.stringify(h,null,2)),l==="form-data"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n)),l==="x-www-form-urlencoded"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n))}let d=this.buildBodySchema(t,s,n);d&&(e.bodySchema=d)}selectPrimaryContentType(e){for(let i of c8)if(e.includes(i))return i;let t=e.find(i=>i.includes("json"));if(t)return t;let n=e.find(i=>i.startsWith("text/"));return n||e[0]}mapContentTypeToBodyType(e){return e.includes("json")?{bodyType:"raw",bodyFormat:"json"}:e==="application/xml"||e==="text/xml"?{bodyType:"raw",bodyFormat:"xml"}:e==="text/html"?{bodyType:"raw",bodyFormat:"html"}:e.startsWith("text/")?{bodyType:"raw",bodyFormat:"text"}:e==="multipart/form-data"?{bodyType:"form-data"}:e==="application/x-www-form-urlencoded"?{bodyType:"x-www-form-urlencoded"}:e==="application/octet-stream"?{bodyType:"binary"}:{bodyType:"raw",bodyFormat:"text"}}generateBodyContent(e,t,n){if(e.example!==void 0)return e.example;if(e.examples){let i=Object.values(e.examples)[0];if(i?.value!==void 0)return i.value}if(e.schema)return this.exampleGenerator.generate(e.schema,{omitReadOnly:!0,components:n})}buildFormDataEntries(e,t){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[a,l]of Object.entries(i)){let f=l,d=f.type==="string"&&f.format==="binary",h={key:a,value:d?"":String(this.exampleGenerator.generate(f,{components:t})||""),type:d?"file":"text",enabled:!0};n.push(h)}return n}buildBodySchema(e,t,n){let i=Object.keys(e.content),s=e.content[t];if(!s?.schema)return;let a={contentType:t,schema:s.schema};if(i.length>1){a.content={};for(let f of i){let d=e.content[f],h={};d.schema&&(h.schema=d.schema),d.examples&&(h.examples=d.examples),d.encoding&&(h.encoding=d.encoding),a.content[f]=h}}s.encoding&&(a.encoding=s.encoding);let l=this.extractUsedComponents(s.schema,n);return Object.keys(l).length>0&&(a.components=l),a}processResponses(e,t){let n={responses:{}},i={};for(let[s,a]of Object.entries(e)){let l=a,f={description:l.description||`Status ${s}`};if(l.content){let d=Object.keys(l.content);if(d.length===1){let h=d[0],g=l.content[h];f.contentType=h,g.schema&&(f.schema=g.schema),g.examples&&(f.examples=g.examples),g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,t))}else{f.content={};for(let h of d){let g=l.content[h],y={};g.schema&&(y.schema=g.schema),g.examples&&(y.examples=g.examples),f.content[h]=y,g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,t))}}}if(l.headers){f.headers={};for(let[d,h]of Object.entries(l.headers)){let g=h;f.headers[d]={...g.description&&{description:g.description},schema:g.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,t){let n=Object.keys(e)[0];if(!n)return;let i=t[n];if(i)switch(i.type){case"http":if(i.scheme==="bearer")return{type:"bearer",bearerToken:""};if(i.scheme==="basic")return{type:"basic",basicAuth:{username:"",password:""}};break;case"apiKey":return{type:"apikey",apikey:{key:i.name||"X-Api-Key",value:"",in:i.in||"header"}};case"oauth2":{let s=i.flows||{},a=s.authorizationCode||s.clientCredentials||s.password||s.implicit||{},l="client_credentials";return s.authorizationCode?l="authorization_code":s.password?l="password":s.implicit&&(l="implicit"),{type:"oauth2",oauth2:{grantType:l,tokenUrl:a.tokenUrl||"",authUrl:a.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(a.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,t){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return t}extractUsedComponents(e,t,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&t[s]&&!i[s]&&(i[s]=t[s],this.extractUsedComponents(t[s],t,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,t,i);e.items&&this.extractUsedComponents(e.items,t,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let a of e[s])this.extractUsedComponents(a,t,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,t,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}}});var qu,tC=se(()=>{"use strict";qu=class{constructor(e,t,n){this.historyAnalyzer=e;this.scriptAnalyzer=t;this.inferrer=n}historyAnalyzer;scriptAnalyzer;inferrer;async infer(e,t,n,i){let s=await this.historyAnalyzer.analyze(e,t,{environment:i?.environment}),a;return i?.postResponseScript&&(a=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,a)}async inferBodySchema(e,t,n,i,s){let a,l;if(t==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}a=this.inferrer.inferFromValue(f),l="application/json"}else t==="form-data"&&i?(a=this.buildFormDataSchema(i),l="multipart/form-data"):t==="x-www-form-urlencoded"&&i?(a=this.buildFormDataSchema(i),l="application/x-www-form-urlencoded"):t==="raw"&&n==="xml"?(a={type:"string"},l="application/xml"):t==="raw"&&(n==="text"||n==="html")?(a={type:"string"},l=n==="html"?"text/html":"text/plain"):t==="binary"?(a={type:"string",format:"binary"},l="application/octet-stream"):t==="graphql"&&(a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l="application/json");if(a)return s?this.mergeBodySchemaWithExisting(a,s):{contentType:l,schema:a}}buildFormDataSchema(e){let t={type:"object",properties:{}},n=[];for(let i of e){if(!i.enabled&&i.enabled!==void 0)continue;let s={};i.type?s.type=i.type:s.type="string",i.description&&(s.description=i.description),i.format&&(s.format=i.format),i.enum&&(s.enum=i.enum),i.type==="file"&&(s.type="string",s.format="binary"),t.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(t.required=n),t}mergeResponseSchemas(e,t,n){let i={responses:{}};for(let[s,a]of Object.entries(t.responses))i.responses[s]={...a};if(n&&this.applyScriptHints(i,n),e){for(let[s,a]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],a):i.responses[s]={...a};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,t){for(let n of t.expectedStatuses){let i=String(n);e.responses[i]||(e.responses[i]={description:`Status ${n}`})}for(let[,n]of Object.entries(e.responses))n.schema&&this.augmentSchemaWithHints(n.schema,t)}augmentSchemaWithHints(e,t){if(!(e.type!=="object"||!e.properties))for(let n of t.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,t)}}ensureFieldPath(e,t,n,i=""){if(t.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=t[0],a=s.endsWith("[]"),l=a?s.slice(0,-2):s,f=i?`${i}.${s}`:s,d=t.slice(1);if(!e.properties[l])if(a)e.properties[l]={type:"array",items:{type:"object"}};else if(d.length>0)e.properties[l]={type:"object",properties:{}};else{let h=n.typeHints[f];e.properties[l]={type:h||"string"};return}if(d.length>0){let h=a?e.properties[l].items:e.properties[l];h&&this.ensureFieldPath(h,d,n,f)}}mergeResponseDefinitions(e,t){let n={...e};return t.description&&(n.description=t.description),t.contentType&&(n.contentType=t.contentType),t.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,t.schema):t.schema&&(n.schema=t.schema),t.examples&&(n.examples={...e.examples||{},...t.examples}),t.content&&(n.content={...e.content||{},...t.content}),t.headers&&(n.headers={...e.headers||{},...t.headers}),n}mergeBodySchemaWithExisting(e,t){let n={...t};return t.schema?n.schema=this.inferrer.mergeSchemas(e,t.schema):n.schema=e,n}}});var VA,Mg,WA,zA,JA,GA,YA,Au,rC=se(()=>{"use strict";VA=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,Mg="(?:pm|hf|ctx)",WA=new RegExp(`${Mg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),zA=new RegExp(`${Mg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),JA=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,GA=new RegExp(`${Mg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),YA=new RegExp(`${Mg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),Au=class{analyze(e){let t={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return t;let n=this.stripComments(e);return this.extractFieldPaths(n,t),this.extractTypeAssertions(n,t),this.extractEqualityAssertions(n,t),this.extractBooleanAssertions(n,t),this.extractLengthAssertions(n,t),this.extractStatusAssertions(n,t),t.fieldPaths=[...new Set(t.fieldPaths)],t.expectedStatuses=[...new Set(t.expectedStatuses)],t}stripComments(e){let t=e.replace(/\/\*[\s\S]*?\*\//g,"");return t=t.replace(/\/\/.*$/gm,""),t}extractFieldPaths(e,t){let n,i=new RegExp(VA.source,VA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&t.fieldPaths.push(s)}}extractTypeAssertions(e,t){let n,i=new RegExp(WA.source,WA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].toLowerCase();s&&(t.typeHints[s]=this.mapAssertionType(a),t.fieldPaths.includes(s)||t.fieldPaths.push(s))}}extractEqualityAssertions(e,t){let n,i=new RegExp(zA.source,zA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].trim();if(s){let l=this.parseAssertionValue(a);l!==void 0&&(t.valueHints[s]=l,typeof l=="string"?t.typeHints[s]=t.typeHints[s]||"string":typeof l=="number"?t.typeHints[s]=t.typeHints[s]||(Number.isInteger(l)?"integer":"number"):typeof l=="boolean"&&(t.typeHints[s]=t.typeHints[s]||"boolean")),t.fieldPaths.includes(s)||t.fieldPaths.push(s)}}}extractBooleanAssertions(e,t){let n,i=new RegExp(GA.source,GA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(t.typeHints[s]="boolean",t.valueHints[s]=n[2]==="true",t.fieldPaths.includes(s)||t.fieldPaths.push(s))}}extractLengthAssertions(e,t){let n,i=new RegExp(YA.source,YA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(t.typeHints[s]=t.typeHints[s]||"array",t.fieldPaths.includes(s)||t.fieldPaths.push(s))}}extractStatusAssertions(e,t){let n,i=new RegExp(JA.source,JA.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&t.expectedStatuses.push(s)}}normalizeFieldPath(e){let t=e.replace(/^\./,"");return t=t.replace(/\[\d+\]/g,"[]"),t}isCommonMethodCall(e){return new Set(["to","be","have","not","deep","any","all","that","is","has","include","includes","equal","eql","above","below","least","most","within","length","lengthOf","match","string","keys","key","property","ownProperty","status","header","json","text"]).has(e.split(".")[0])}mapAssertionType(e){return{string:"string",number:"number",object:"object",array:"array",boolean:"boolean",null:"null",undefined:"null",int:"integer",integer:"integer",float:"number",double:"number"}[e]||"string"}parseAssertionValue(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let t=Number(e);return!isNaN(t)&&e.trim().length>0?t:e==="true"?!0:e==="false"?!1:e==="null"?null:e}}});var KA={};Ns(KA,{AwsSecretResolver:()=>Ng});var Ng,nC=se(()=>{"use strict";Ng=class{providerName="aws";region;moduleRequire;constructor(e,t){this.region=e.region??process.env.AWS_DEFAULT_REGION??process.env.AWS_REGION,this.moduleRequire=t??(n=>it(n))}async resolve(e){let t=e.lastIndexOf("#"),n=t>=0?e.slice(0,t):e,i=t>=0?e.slice(t+1):void 0;try{let{SecretsManagerClient:s,GetSecretValueCommand:a}=this.moduleRequire("@aws-sdk/client-secrets-manager"),f=await new s(this.region?{region:this.region}:{}).send(new a({SecretId:n})),d=f.SecretString??(f.SecretBinary?Buffer.from(f.SecretBinary).toString("utf-8"):void 0);if(d===void 0)return;if(i)try{let h=JSON.parse(d);return h[i]!==void 0?String(h[i]):void 0}catch{return}return d}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] AWS secret resolver requires @aws-sdk/client-secrets-manager. Install it in your project: npm install @aws-sdk/client-secrets-manager"):s}}}});var QA={};Ns(QA,{AzureKeyVaultResolver:()=>Dg});var Dg,iC=se(()=>{"use strict";Dg=class{providerName="azure";vaultUrl;moduleRequire;constructor(e,t){let n=(e.vaultUrl||process.env.AZURE_KEYVAULT_URL)??"";this.vaultUrl=n.replace(/\/$/,""),this.moduleRequire=t??(i=>it(i))}async resolve(e){if(!this.vaultUrl)throw new Error("[HTTP Forge] Azure Key Vault resolver: no vault URL configured. Set secrets.providers.<alias>.vaultUrl or the AZURE_KEYVAULT_URL env var.");let t=e.split("/"),n=t[0],i=t[1];try{let{SecretClient:s}=this.moduleRequire("@azure/keyvault-secrets"),{DefaultAzureCredential:a}=this.moduleRequire("@azure/identity"),l=new a;return(await new s(this.vaultUrl,l).getSecret(n,i?{version:i}:{})).value}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] Azure Key Vault resolver requires @azure/keyvault-secrets and @azure/identity. Install them: npm install @azure/keyvault-secrets @azure/identity"):s}}}});var ZA={};Ns(ZA,{HashiCorpVaultResolver:()=>Fg});var Fg,sC=se(()=>{"use strict";Fg=class{providerName="vault";address;mountPath;namespace;constructor(e){this.address=(e.address??process.env.VAULT_ADDR??"http://127.0.0.1:8200").replace(/\/$/,""),this.mountPath=e.mountPath??"secret",this.namespace=e.namespace??process.env.VAULT_NAMESPACE}async resolve(e){let t=e.lastIndexOf("#"),n=t>=0?e.slice(0,t):e,i=t>=0?e.slice(t+1):void 0,s=process.env.VAULT_TOKEN;if(!s)throw new Error("[HTTP Forge] HashiCorp Vault resolver requires VAULT_TOKEN environment variable to be set.");let a=`${this.address}/v1/${this.mountPath}/data/${n}`,l={"X-Vault-Token":s};this.namespace&&(l["X-Vault-Namespace"]=this.namespace);let f;try{f=await fetch(a,{headers:l})}catch(y){throw new Error(`[HTTP Forge] Vault request failed: ${y?.message??y}`)}if(f.status===404)return;if(!f.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${f.status} for path: ${n}`);let h=(await f.json())?.data?.data;if(!h)return;if(i)return h[i]!==void 0?String(h[i]):void 0;if("value"in h)return String(h.value);let g=Object.keys(h);return g.length===1?String(h[g[0]]):void 0}}});var XA={};Ns(XA,{OnePasswordResolver:()=>Lg});import{execFile as f8}from"child_process";import{promisify as d8}from"util";var p8,Lg,oC=se(()=>{"use strict";p8=d8(f8),Lg=class{providerName="1password";defaultVault;constructor(e){this.defaultVault=e.vault}async resolve(e){let t=e.split("/"),n,i,s;if(this.defaultVault){if(t.length<2)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<item>/<field>" when vault is set in config.`);n=this.defaultVault,i=t.slice(0,t.length-1).join("/"),s=t[t.length-1]}else{if(t.length<3)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<vault>/<item>/<field>".`);n=t[0],i=t.slice(1,t.length-1).join("/"),s=t[t.length-1]}let a=await this.tryResolveSdk(n,i,s);return a!==null?a:this.resolveViaCli(n,i,s)}async tryResolveSdk(e,t,n){let i=process.env.OP_SERVICE_ACCOUNT_TOKEN;if(!i)return null;try{let{createClient:s}=it("@1password/sdk"),a=await s({auth:i,integrationName:"HTTP Forge",integrationVersion:"1.0.0"}),l=`op://${e}/${t}/${n}`;return await a.secrets.resolve(l)}catch(s){if(s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND")return null;throw new Error(`[HTTP Forge] 1Password SDK error for "${e}/${t}/${n}": ${s?.message??s}`)}}async resolveViaCli(e,t,n){try{let{stdout:i}=await p8("op",["item","get",t,"--vault",e,"--field",n,"--format","json"],{env:{...process.env},timeout:1e4}),s=JSON.parse(i.trim());return typeof s=="string"?s:s&&typeof s.value=="string"?s.value:void 0}catch(i){if(i?.code==="ENOENT")throw new Error("[HTTP Forge] 1Password resolver requires either the @1password/sdk npm package or the `op` CLI to be installed.\n Service Account: set OP_SERVICE_ACCOUNT_TOKEN and install @1password/sdk\n CLI: install 1Password CLI and run `op signin`");if(i?.stderr?.includes("not found")||i?.code===1)return;throw new Error(`[HTTP Forge] 1Password CLI error: ${i?.message??i}`)}}}});var e$={};Ns(e$,{GcpSecretResolver:()=>jg});var jg,aC=se(()=>{"use strict";jg=class{providerName="gcp";projectId;moduleRequire;constructor(e,t){this.projectId=e.projectId??process.env.GOOGLE_CLOUD_PROJECT??process.env.GCLOUD_PROJECT??process.env.GCP_PROJECT,this.moduleRequire=t??(n=>it(n))}async resolve(e){let t=e.split("/"),n=t[0],i=t[1]==="versions"&&t[2]?t[2]:"latest";if(!this.projectId)throw new Error("[HTTP Forge] GCP secret resolver: no projectId configured and GOOGLE_CLOUD_PROJECT env var is not set.");try{let{SecretManagerServiceClient:s}=this.moduleRequire("@google-cloud/secret-manager"),a=new s,l=`projects/${this.projectId}/secrets/${n}/versions/${i}`,[f]=await a.accessSecretVersion({name:l}),d=f.payload?.data;return d?Buffer.isBuffer(d)?d.toString("utf-8"):Buffer.from(d).toString("utf-8"):void 0}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] GCP secret resolver requires @google-cloud/secret-manager. Install it: npm install @google-cloud/secret-manager"):s}}}});var r$={};Ns(r$,{DopplerResolver:()=>Ug});import*as t$ from"https";var Ug,lC=se(()=>{"use strict";Ug=class{providerName="doppler";token;constructor(e){this.token=e.serviceToken??process.env.DOPPLER_TOKEN}async resolve(e){let t=e.trim().toUpperCase(),n=this.token;if(!n)throw new Error("[HTTP Forge] Doppler secret resolver: no service token found. Set DOPPLER_TOKEN env var or add serviceToken to config.");let i=`https://api.doppler.com/v3/configs/config/secret?name=${encodeURIComponent(t)}`;return new Promise((s,a)=>{let l=t$.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},f=>{let d=[];f.on("data",h=>d.push(h)),f.on("end",()=>{let h=Buffer.concat(d).toString("utf-8");if(f.statusCode===404){s(void 0);return}if(f.statusCode!==200){a(new Error(`[HTTP Forge] Doppler API returned ${f.statusCode} for secret "${t}": ${h}`));return}try{let y=JSON.parse(h)?.value?.computed;s(y!=null?String(y):void 0)}catch{a(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${t}"`))}})});l.on("error",a),l.end()})}}});import*as Hg from"fs";import{createRequire as h8}from"module";import*as n$ from"path";var Od,uC=se(()=>{"use strict";Od=class{resolvers=new Map;moduleRequire;constructor(e){if(this.moduleRequire=this.buildModuleRequire(e),!e)return;let t;try{t=e.getConfig().secrets}catch{return}if(!(!t?.providers||typeof t.providers!="object"))for(let[n,i]of Object.entries(t.providers))try{let s=this.createResolver(i);s&&this.resolvers.set(n,s)}catch{}}async resolveSecretTokens(e,t){let n=t??new Map,i=new Set;if(this.collectTokens(e,i),i.size===0)return{};await Promise.all(Array.from(i).map(async a=>{if(n.has(a))return;let l=a.slice(7),f=l.indexOf("/");if(f<0)return;let d=l.slice(0,f),h=l.slice(f+1),g=this.resolvers.get(d);if(g)try{let y=await g.resolve(h);y!==void 0&&n.set(a,y)}catch(y){let S=y?.message??String(y);console.warn(`[HTTP Forge] {{${a}}} could not be resolved: ${S}`)}}));let s={};for(let[a,l]of n.entries())s[a]=l;return s}get hasProviders(){return this.resolvers.size>0}collectTokens(e,t){if(typeof e=="string"){let n=/\{\{(secret:[^}]+)\}\}/g,i;for(;(i=n.exec(e))!==null;)t.add(i[1])}else Array.isArray(e)?e.forEach(n=>this.collectTokens(n,t)):e!==null&&typeof e=="object"&&Object.values(e).forEach(n=>this.collectTokens(n,t))}createResolver(e){switch(e.provider){case"aws":{let{AwsSecretResolver:t}=(nC(),El(KA));return new t(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:t}=(iC(),El(QA));return new t(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:t}=(sC(),El(ZA));return new t(e)}case"1password":{let{OnePasswordResolver:t}=(oC(),El(XA));return new t(e)}case"gcp":{let{GcpSecretResolver:t}=(aC(),El(e$));return new t(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:t}=(lC(),El(r$));return new t(e)}default:return}}buildModuleRequire(e){let t=i=>it(i);if(!e)return t;let n=[];try{n=e.getModulePaths()??[]}catch{return t}for(let i of n)try{let s=n$.resolve(i,"package.json");if(Hg.existsSync(s)){let a=Hg.realpathSync(s),l=h8(a);return f=>{try{return l(f)}catch{return t(f)}}}}catch{}return t}}});var Id,cC=se(()=>{"use strict";Id={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as At from"fs";import*as po from"path";var Pd,fC=se(()=>{"use strict";bn();cC();Pd=class{constructor(e,t,n){this.collectionService=e;this.configService=t;this.suitesDir=t.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}collectionService;configService;suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){At.existsSync(this.suitesDir)||At.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=At.watch(this.suitesDir,(e,t)=>{t&&!t.endsWith(".suite.json")||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadSuites(),this.onSuitesChanged?.()},200))}),this.fileWatcher.on("error",()=>{})}catch{}}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.close(),this.fileWatcher=null}loadSuites(){if(this.suites.clear(),!At.existsSync(this.suitesDir))return;let e=At.readdirSync(this.suitesDir);for(let t of e)if(t.endsWith(".suite.json"))try{let n=po.join(this.suitesDir,t),i=At.readFileSync(n,"utf-8"),s=JSON.parse(i);s.id&&s.name&&this.suites.set(s.id,s)}catch(n){console.error(`[TestSuiteService] Failed to load ${t}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,t=[]){let n=Date.now(),i={id:pt(e),name:e,requests:t,config:{...Id},createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}async updateSuite(e){e.updatedAt=Date.now(),await this.saveSuiteToDisk(e),this.suites.set(e.id,e)}async duplicateSuite(e,t){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(t,n.requests.map(l=>({...l})));i.config={...n.config},i.description=n.description;let s=po.join(this.suitesDir,e),a=po.join(this.suitesDir,i.id);return At.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,t){At.existsSync(t)||At.mkdirSync(t,{recursive:!0});for(let n of At.readdirSync(e,{withFileTypes:!0})){let i=po.join(e,n.name),s=po.join(t,n.name);n.isDirectory()?this.copyDirRecursive(i,s):At.copyFileSync(i,s)}}async deleteSuite(e){let t=this.suites.get(e);if(!t)return!1;let n=`${t.id}.suite.json`,i=po.join(this.suitesDir,n);try{return At.existsSync(i)&&At.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let t=this.collectionService.getCollection(e);if(!t){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(t,e,t.name,"",n);let i=Date.now();return{id:`temp-${e}`,name:t.name,requests:n,config:{...Id},isTemporary:!0,createdAt:i,updatedAt:i}}async createTempSuiteFromFolder(e,t,n=!0){let i=this.collectionService.getCollection(e);if(!i){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let s=[];this.extractRequestsFromCollection(i,e,i.name,"",s);let a=t.replace(/\/+$/,""),l=s.filter(h=>n?h.folderPath===a||h.folderPath.startsWith(`${a}/`):h.folderPath===a);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${t}" in collection: ${e}`);return}let f=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(a)}`,name:`${i.name} / ${a}`,requests:l,config:{...Id},isTemporary:!0,createdAt:f,updatedAt:f}}slugifyFolderPath(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async saveTempSuite(e,t){let n=Date.now(),i={...e,id:pt(t),name:t,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],t=this.collectionService.getAllCollections();for(let n of t)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,t,n,i,s){if(e.requests)for(let a of e.requests)s.push({collectionId:t,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.items)for(let a of e.items)if(a.items||a.folders||a.requests){let l=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,t,n,l,s)}else s.push({collectionId:t,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.folders)for(let a of e.folders){let l=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,t,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let t=`${e.id}.suite.json`,n=po.join(this.suitesDir,t),i=JSON.stringify(e,null,2);At.writeFileSync(n,i,"utf-8")}}});var re,Bg=se(()=>{"use strict";re={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),TestSuite:Symbol.for("ITestSuiteService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter"),SecretResolverRegistry:Symbol.for("SecretResolverRegistry")}});import*as i$ from"path";function Vg(r,e){let{workspaceFolder:t,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:a,secretStore:l,browserService:f,applicationInfo:d,consoleService:h}=e;r.registerValue(re.WorkspaceFolder,t),r.registerSingleton(re.Config,()=>new tu(t,n,i)),r.registerSingleton(re.Console,()=>h??m8),r.registerSingleton(re.EnvironmentConfig,y=>new Pf(t,s,y.resolve(re.Config),n,l)),r.registerSingleton(re.Cookie,()=>new Ef(a)),r.registerSingleton(re.Collection,y=>new xf(t,y.resolve(re.Config),n)),r.registerSingleton(re.TestSuite,y=>new Pd(y.resolve(re.Collection),y.resolve(re.Config))),r.registerSingleton(re.HttpClient,()=>new Xo),r.registerSingleton(re.UrlBuilder,()=>new Vn),r.registerSingleton(re.InterceptorChain,()=>new Qi),r.registerSingleton(re.HttpRequest,y=>new Ki(y.resolve(re.UrlBuilder),y.resolve(re.InterceptorChain),y.resolve(re.HttpClient))),r.registerSingleton(re.RequestPreprocessor,()=>new da),r.registerSingleton(re.RequestHistory,y=>{let S=y.resolve(re.EnvironmentConfig);return new $f(S.getHistoriesPath(),i$.join(S.getRootPath(),"shared-histories"))}),l&&f&&r.registerSingleton(re.OAuth2TokenManager,y=>new _f(l,f,y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest))),r.registerSingleton(re.GraphQLSchemaService,y=>new Tf(y.resolve(re.HttpClient))),r.registerSingleton(re.SecretResolverRegistry,y=>new Od(y.resolve(re.Config)));let g=d??{name:"HttpForge",version:"0.0.0"};r.registerSingleton(re.RequestPreparer,y=>new kf(y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest),y.resolve(re.RequestPreprocessor),y.has(re.OAuth2TokenManager)?y.resolve(re.OAuth2TokenManager):void 0,g,y.resolve(re.SecretResolverRegistry))),r.registerSingleton(re.ScriptExecutor,y=>{let S=y.resolve(re.Config);return new rs(y.resolve(re.HttpRequest),S.getModulePaths(),y.resolve(re.SecretResolverRegistry),S.getScriptScope(),S.getScriptTimeout())}),r.registerSingleton(re.DataFileParser,()=>new ha),r.registerSingleton(re.CollectionRequestExecutor,y=>new Gs(y.resolve(re.HttpRequest),y.resolve(re.ScriptExecutor),y.resolve(re.EnvironmentConfig),y.resolve(re.RequestPreparer),"")),r.registerSingleton(re.PersistentCookieJar,y=>new Of(y.resolve(re.Cookie))),r.registerSingleton(re.SchemaInferrer,()=>new oo),r.registerSingleton(re.HistoryAnalyzer,y=>new ru(y.resolve(re.RequestHistory),y.resolve(re.SchemaInferrer))),r.registerSingleton(re.ScriptAnalyzer,()=>new Au),r.registerSingleton(re.SchemaInferenceService,y=>new qu(y.resolve(re.HistoryAnalyzer),y.resolve(re.ScriptAnalyzer),y.resolve(re.SchemaInferrer))),r.registerSingleton(re.OpenApiExporter,y=>new hu(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig),y.resolve(re.SchemaInferenceService))),r.registerSingleton(re.OpenApiImporter,y=>new Tu(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig)))}var m8,dC=se(()=>{"use strict";M0();j0();H0();B0();V0();z0();nm();J0();G0();tw();Nc();Dc();Mc();Zh();Il();rw();F_();eC();tC();sg();rC();Xh();vf();uC();fC();Bg();m8={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function s$(){return Ta.instance}var Ta,pC=se(()=>{"use strict";Bg();Ta=class r{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return r._instance||(r._instance=new r),r._instance}static createFresh(){return new r}static reset(){r._instance&&r._instance.clear(),r._instance=void 0}registerValue(e,t){return this.primitives.set(e,t),this}registerSingleton(e,t){return this.services.set(e,{factory:t,singleton:!0}),this}registerTransient(e,t){return this.services.set(e,{factory:t,singleton:!1}),this}registerInstance(e,t){return this.services.set(e,{factory:()=>t,singleton:!0,instance:t}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let t=this.services.get(e);if(!t)throw new Error(`Service not registered: ${e.toString()}`);return t.singleton?(t.instance||(t.instance=t.factory(this)),t.instance):t.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(re.Config)}get console(){return this.resolve(re.Console)}get environmentConfig(){return this.resolve(re.EnvironmentConfig)}get collection(){return this.resolve(re.Collection)}get httpRequest(){return this.resolve(re.HttpRequest)}get httpClient(){return this.resolve(re.HttpClient)}get cookie(){return this.resolve(re.Cookie)}get requestHistory(){return this.resolve(re.RequestHistory)}get dataFileParser(){return this.resolve(re.DataFileParser)}get scriptExecutor(){return this.resolve(re.ScriptExecutor)}get requestPreparer(){return this.resolve(re.RequestPreparer)}get persistentCookieJar(){return this.resolve(re.PersistentCookieJar)}get oauth2TokenManager(){return this.has(re.OAuth2TokenManager)?this.resolve(re.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(re.GraphQLSchemaService)}get testSuite(){return this.resolve(re.TestSuite)}}});import{createHash as g8}from"crypto";function ds(r,e=40){let t=g8("sha256").update(r,"utf8").digest("hex").slice(0,y8);return r.substring(0,e)+"_"+t}function b8(r,e){return r.length>0&&r.length<=e&&/^[a-zA-Z0-9_-]+$/.test(r)&&!r.includes("__")}function qa(r,e=v8){return b8(r,e)?r:ds(r,e-20)}function hC(r,e,t){let n=`${r}request__${qa(e)}__${qa(t)}`;return n.length<=Wg?n:`${r}request__${ds(e)}__${ds(t)}`}function mC(r,e){let t=`${r}collection__${qa(e,100)}`;return t.length<=Wg?t:`${r}collection__${ds(e,80)}`}function gC(r,e,t){let n=`${r}folder__${qa(e)}__${qa(t)}`;return n.length<=Wg?n:`${r}folder__${ds(e)}__${ds(t)}`}function yC(r,e){let t=`${r}suite__${qa(e,100)}`;return t.length<=Wg?t:`${r}suite__${ds(e,80)}`}function vC(r){for(let e of["request","collection","folder","suite"]){let t=`${e}__`;if(r.startsWith(t))return{kind:e,tokens:r.slice(t.length).split("__")}}throw new Error(`Unknown MCP tool name: ${r}`)}function $u(r,e){for(let t of e)if(ds(t)===r)return t;for(let t of e)if(t===r)return t}function bC(r,e){let t=$u(r,e);if(t!==void 0)return t;try{let n=Buffer.from(r,"base64url").toString("utf8");if(e.includes(n))return n}catch{}}function SC(r,e,t,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${r}]${i} of the "${t}" collection.`}function wC(r,e){return`Run all ${e} requests in the "${r}" collection.`}function _C(r,e,t){return`Run all ${t} requests in folder "${r}" of the "${e}" collection.`}function RC(r,e,t){return`Run the "${r}" test suite (${e} requests, ${t} iteration(s) by default).`}var y8,v8,Wg,CC=se(()=>{"use strict";y8=12,v8=60,Wg=126});function o$(r,e){let t={type:"string",description:r};return e.length>0&&(t.enum=[...e]),t}function xC(r,e,t){let n=i=>o$("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${r}${ot.listCollections}`,description:"List all available HTTP Forge collections (name, description, and request count). Call this first to discover what collections exist, then use list_folders, list_requests or run_* tools.",inputSchema:{type:"object",properties:{}}},{name:`${r}${ot.listFolders}`,description:"List all folders in a collection with their full paths and request counts. Use this before run_folder to discover the exact folder path string to pass.",inputSchema:{type:"object",properties:{collection:n(!0)},required:["collection"]}},{name:`${r}${ot.listRequests}`,description:"List the saved requests in a collection (name, HTTP method, folder, and description). Use this to find the exact request name before calling run_request. For large collections use the folder filter and offset/limit to page through results.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Optional folder path to filter by (e.g. "Auth").'},offset:{type:"number",description:"Zero-based index to start from (default: 0)."},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 200)."}},required:["collection"]}},{name:`${r}${ot.searchRequests}`,description:"Search for requests across a collection by name, URL, method, or folder path. Returns matching requests with their folder location. Useful for large collections.",inputSchema:{type:"object",properties:{collection:n(!0),query:{type:"string",description:"Text to search for in request names, URLs, methods, and folder paths (case-insensitive)."}},required:["collection","query"]}},{name:`${r}${ot.getEnvironment}`,description:"Show the current environment variable values (merged initial + runtime pm.environment.set overrides). Use this to inspect variable state before running a folder, or to debug {{variable}} resolution failures.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name to inspect (defaults to the currently selected environment)."}}}},{name:`${r}${ot.setVariable}`,description:"Override an environment variable for the current session (in-memory only \u2014 does not write to disk). Use this to inject a token or base URL before running a folder. Changes are visible to all subsequent run_* calls until the MCP server restarts.",inputSchema:{type:"object",properties:{key:{type:"string",description:"Variable name (the part inside {{...}})."},value:{type:"string",description:"New value to set."},environment:{type:"string",description:"Environment to update (defaults to the currently selected environment)."}},required:["key","value"]}},{name:`${r}${ot.getRunStatus}`,description:"Check whether an async run is still running, completed, or failed. Poll this after calling run_folder/run_collection/run_suite with async:true.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]}},{name:`${r}${ot.getRunSummary}`,description:'Get the pass/fail summary of a completed async run (total, passed, failed counts). Use after get_run_status shows "completed".',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]}},{name:`${r}${ot.getFailedRequests}`,description:"Get the list of failed requests from a completed async run \u2014 the failures-first view. Never returns passing requests. Use this instead of get_run_summary when you need to see what broke.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."},offset:{type:"number",description:"Zero-based index to start from (default: 0)."},limit:{type:"number",description:"Maximum failures to return (default: 20, max: 100)."}},required:["runId"]}},{name:`${r}${ot.getRequestResult}`,description:"Get the full result (status, body, assertions, console output) for one specific request from an async run. Use after get_failed_requests to drill into a single failure.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."},request:{type:"string",description:"Name of the request to look up."},iteration:{type:"number",description:"Iteration number (default: 1)."}},required:["runId","request"]}},{name:`${r}${ot.runRequest}`,description:"Run a single saved request. Pick the collection, then the request name within it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Name of the request to run. Use list_requests or search_requests to find names."},requestId:{type:"string",description:'ID of the request (from list_requests/search_requests). Preferred over "request" name when available \u2014 avoids ambiguity with duplicate names.'},...zg.properties},required:["collection","request"]}},{name:`${r}${ot.runFolder}`,description:"Run every request inside a folder of a collection.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Folder path within the collection (e.g. "Auth/Login").'},...Gg.properties},required:["collection","folder"]}},{name:`${r}${ot.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...Jg.properties},required:["collection"]}},{name:`${r}${ot.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:o$("Name of the test suite to run.",t),...Yg.properties},required:["suite"]}}]}var zg,Jg,Gg,Yg,ot,EC=se(()=>{"use strict";zg={type:"object",properties:{environment:{type:"string",description:"Environment name to use (defaults to the currently selected environment)"},variables:{type:"object",description:"Extra variables to inject \u2014 merged with environment variables, {{name}} syntax",additionalProperties:{type:"string"}},headers:{type:"object",description:"Override or add request headers",additionalProperties:{type:"string"}},query:{type:"object",description:"Override query parameters",additionalProperties:{type:"string"}},body:{type:"string",description:"Replace the request body (JSON string). Omit to use the saved body."},include:{type:"array",items:{type:"string",enum:["headers","cookies","tests","consoleOutput","report"]},description:"Extra fields to include in the response (default: status, ok, body, allPassed)"}}},Jg={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests."}}},Gg={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},recursive:{type:"boolean",description:"Include requests in nested subfolders (default: true)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests."}}},Yg={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations (overrides suite default)"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results."},requestFilter:{type:"array",items:{type:"string"},description:"Run only requests whose names match one of these strings (case-insensitive)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level (default: summary + failedRequests)"}}},ot={listCollections:"list_collections",listFolders:"list_folders",listRequests:"list_requests",searchRequests:"search_requests",getEnvironment:"get_environment",runRequest:"run_request",runFolder:"run_folder",runCollection:"run_collection",runSuite:"run_suite",getRunStatus:"get_run_status",getRunSummary:"get_run_summary",getFailedRequests:"get_failed_requests",getRequestResult:"get_request_result",setVariable:"set_variable"}});var Mu,OC=se(()=>{"use strict";zo();Mu=class{cookies=new Map;getCookieKey(e,t,n){return`${t||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let t=[];for(let n of this.cookies.values())lt.isExpired(n)||(!n.domain||lt.domainMatches(e,n.domain))&&t.push(n);return t}has(e,t){return this.get(e,t)!==void 0}get(e,t){let n=this.getCookieKey(e,t),i=this.cookies.get(n);if(i&&!lt.isExpired(i))return i}set(e){let t=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(t,e)}delete(e,t,n){let i=this.getCookieKey(e,t,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let t=[];for(let n of this.cookies.values())lt.isExpired(n)||t.push(n);return t}setCookiesFromResponse(e,t){let n=lt.extractDomain(e),i=lt.parseCookieHeaders(t,n);for(let s of i){let a=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(a,s)}}getCookieHeader(e){let t=lt.extractDomain(e),n=lt.extractPath(e),s=this.getCookiesForDomain(t).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return lt.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function Kg(r,e,t){let n=String(r).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${t}.json`}function S8(r){return{index:r.i,iteration:r.it,name:r.n,method:Nu[r.m]||"GET",status:r.s,duration:r.d,passed:r.p,assertionsPassed:r.ap,assertionsFailed:r.af,requestId:r.r,resultFile:Kg(r.i,r.it,r.r),error:r.e}}var IC,Nu,Qg=se(()=>{"use strict";IC={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Nu={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as Fu from"fs/promises";import*as Du from"path";function vt(r){return String(r??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Aa(r){return r>=1e3?`${(r/1e3).toFixed(2)}s`:`${r}ms`}function PC(r){try{return new Date(r).toLocaleString()}catch{return r}}function Zg(r){return r>=200&&r<300?"status-2xx":r>=300&&r<400?"status-3xx":r>=400&&r<500?"status-4xx":"status-5xx"}function w8(r,e){return e===0?"\u2014":`${Math.round(r/e*100)}%`}function u$(r){try{return typeof r=="string"&&(r=JSON.parse(r)),JSON.stringify(r,null,2)}catch{return String(r??"")}}function a$(r){return!r||Object.keys(r).length===0?'<span class="dim">\u2014</span>':`<table class="kv-table">${Object.entries(r).map(([t,n])=>{let i=Array.isArray(n)?n.join(", "):String(n??"");return`<tr><td class="kv-key">${vt(t)}</td><td class="kv-val">${vt(i)}</td></tr>`}).join("")}</table>`}function _8(r){return r==null||r===""?'<span class="dim">\u2014</span>':typeof r=="string"?vt(r):typeof r=="number"||typeof r=="boolean"?vt(String(r)):`<pre class="code">${vt(u$(r))}</pre>`}function kC(r){return!r||Object.keys(r).length===0?'<span class="dim">\u2014</span>':`<table class="kv-table meta-table">${Object.entries(r).map(([t,n])=>`
|
|
278
278
|
<tr>
|
|
279
279
|
<td class="kv-key">${vt(t)}</td>
|
|
280
280
|
<td class="kv-val">${_8(n)}</td>
|
|
@@ -282,7 +282,7 @@ Too many redirects:
|
|
|
282
282
|
<tr>
|
|
283
283
|
<td class="kv-key">${vt(t.name??"(unnamed)")}</td>
|
|
284
284
|
<td class="kv-val">${vt(t.value??"")}</td>
|
|
285
|
-
</tr>`).join("")}</table>`}function l$(r,e){if(r==null||r==="")return'<span class="dim">\u2014 empty \u2014</span>';let t=u$(r);return`<pre class="code">${vt(t)}</pre>`}var
|
|
285
|
+
</tr>`).join("")}</table>`}function l$(r,e){if(r==null||r==="")return'<span class="dim">\u2014 empty \u2014</span>';let t=u$(r);return`<pre class="code">${vt(t)}</pre>`}var kd,TC=se(()=>{"use strict";Qg();kd=class{constructor(e){this.basePath=e}basePath;async generate(e,t){let n=Du.join(this.basePath,e,t),i=JSON.parse(await Fu.readFile(Du.join(n,"manifest.json"),"utf-8")),s=await this.loadAllSummaries(n,i.totalIndexPages),a=await this.loadAllDetails(n,s),l=this.buildHtml(i,s,a),f=Du.join(n,"report.html");return await Fu.writeFile(f,l,"utf-8"),f}async loadAllSummaries(e,t){let n=[];for(let i=1;i<=t;i++){let s=Du.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let a=JSON.parse(await Fu.readFile(s,"utf-8"));n.push(...a.summaries)}catch{}}return n}async loadAllDetails(e,t){let n=new Map;for(let i of t){let s=Kg(i.i,i.it,i.r),a=`${i.i}-${i.it}`;try{let l=JSON.parse(await Fu.readFile(Du.join(e,"results",s),"utf-8"));n.set(a,l)}catch{}}return n}groupByIterCollectionFolder(e){let t=[],n=new Map;for(let i of e){n.has(i.it)||(n.set(i.it,{order:[],map:new Map}),t.push(i.it));let s=n.get(i.it),a=i.cn||"",l=i.fp||"",f=`${a}\0${l}`;s.map.has(f)||(s.map.set(f,{cn:a,fp:l,items:[]}),s.order.push(f)),s.map.get(f).items.push(i)}return t.map(i=>{let s=n.get(i);return{it:i,groups:s.order.map(a=>s.map.get(a))}})}groupLabel(e,t,n){let i=String(n).padStart(2,"0"),s=e?vt(e):"";if(t){let a=t.split("/").map(l=>vt(l.replace(/^\s*\d+\s*-\s*/,""))).join("/");s=s?`${s}: ${a}`:a}return s||(s="(root)"),`${i} - ${s}`}renderGroupedDetails(e,t,n){let i=t.config.iterations>1;return this.groupByIterCollectionFolder(e).map(s=>{let a=s.groups.map((d,h)=>{let g=d.items.filter(R=>R.p).length,y=d.items.length,S=g<y,_=d.items.map(n).join("");return`
|
|
286
286
|
<details class="group-block${S?" group-fail":""}" open>
|
|
287
287
|
<summary class="group-head">
|
|
288
288
|
<span class="group-title">\u{1F4C1} ${this.groupLabel(d.cn,d.fp,h+1)}</span>
|
|
@@ -306,22 +306,22 @@ Too many redirects:
|
|
|
306
306
|
<td>${S.p90!==void 0?Aa(S.p90):"\u2014"}</td>
|
|
307
307
|
<td>${S.p99!==void 0?Aa(S.p99):"\u2014"}</td>
|
|
308
308
|
<td class="${S.failed>0?"fail":"pass"}">${_}</td>
|
|
309
|
-
</tr>`}).join(""),l=Math.max(...t.map(S=>S.d),1),f=S=>{let _=Nu[S.m]??"GET",R=Math.max(2,Math.round(S.d/l*100)),I=S.p?"bar-pass":"bar-fail",q=S.p?"":' class="row-fail"',
|
|
309
|
+
</tr>`}).join(""),l=Math.max(...t.map(S=>S.d),1),f=S=>{let _=Nu[S.m]??"GET",R=Math.max(2,Math.round(S.d/l*100)),I=S.p?"bar-pass":"bar-fail",q=S.p?"":' class="row-fail"',j=`req-${S.i}-${S.it}`;return`
|
|
310
310
|
<tr${q}>
|
|
311
311
|
<td class="dim">${S.i}</td>
|
|
312
312
|
<td>${S.it}</td>
|
|
313
313
|
<td><span class="method method-${_.toLowerCase()}">${_}</span></td>
|
|
314
|
-
<td><a href="#${
|
|
315
|
-
<td class="${
|
|
314
|
+
<td><a href="#${j}" class="req-link">${vt(S.n)}</a></td>
|
|
315
|
+
<td class="${Zg(S.s)}">${S.s}</td>
|
|
316
316
|
<td>${Aa(S.d)}</td>
|
|
317
317
|
<td><div class="bar-wrap"><div class="${I}" style="width:${R}%"></div></div></td>
|
|
318
318
|
<td class="${S.p?"pass":"fail"}">${S.p?"\u2713":"\u2717"}</td>
|
|
319
|
-
</tr>`},d=this.renderGroupedTimeline(t,e,f),h=S=>{let _=`${S.i}-${S.it}`,R=n.get(_),I=Nu[S.m]??"GET",q=`req-${S.i}-${S.it}`,
|
|
319
|
+
</tr>`},d=this.renderGroupedTimeline(t,e,f),h=S=>{let _=`${S.i}-${S.it}`,R=n.get(_),I=Nu[S.m]??"GET",q=`req-${S.i}-${S.it}`,j=S.p,B=j?"#1f6feb40":"#f8514940",V=R?.assertions?.length?`<ul class="assert-list">${R.assertions.map(mt=>`
|
|
320
320
|
<li class="${mt.passed?"pass":"fail"}">
|
|
321
321
|
<span class="assert-icon">${mt.passed?"\u2713":"\u2717"}</span>
|
|
322
322
|
${vt(mt.name)}
|
|
323
323
|
${mt.message?`<span class="assert-msg"> \u2014 ${vt(mt.message)}</span>`:""}
|
|
324
|
-
</li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',W=a$(R?.request?.headers),X=kC(R?{method:R.request?.method,url:R.request?.url,query:R.request?.query,params:R.request?.params,bodyType:R.request?.body?.type,bodyFormat:R.request?.body?.format}:void 0),T=R?.request?.body,C=T&&typeof T=="object"?T.type:void 0,k=T&&typeof T=="object"&&"content"in T?T.content:T,N=C!=="none"&&!(k==null||k===""),
|
|
324
|
+
</li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',W=a$(R?.request?.headers),X=kC(R?{method:R.request?.method,url:R.request?.url,query:R.request?.query,params:R.request?.params,bodyType:R.request?.body?.type,bodyFormat:R.request?.body?.format}:void 0),T=R?.request?.body,C=T&&typeof T=="object"?T.type:void 0,k=T&&typeof T=="object"&&"content"in T?T.content:T,N=C!=="none"&&!(k==null||k===""),U=N?l$(k):"",$=a$(R?.response?.headers),G=kC(R?{status:R.status,statusText:R.statusText,durationMs:R.duration,responseTimeMs:R.response?.time,responseSizeBytes:R.response?.size}:void 0),K=R?.response?.body!==void 0&&R.response.body!==null?l$(R.response.body):'<span class="dim">\u2014 no body \u2014</span>',ne=R8(R?.response?.cookies),pe=kC(R?{timestamp:R.timestamp?new Date(R.timestamp).toISOString():void 0,nextRequest:R.nextRequest,visualizerTemplate:R.visualizerData?.template,visualizerData:R.visualizerData?.data}:void 0),et=`
|
|
325
325
|
<div class="detail-section">
|
|
326
326
|
<div class="pane-section-title">Assertions
|
|
327
327
|
<span class="assert-counts">
|
|
@@ -350,7 +350,7 @@ Too many redirects:
|
|
|
350
350
|
${N?`
|
|
351
351
|
<div class="pane-section">
|
|
352
352
|
<div class="pane-section-title">Body</div>
|
|
353
|
-
${
|
|
353
|
+
${U}
|
|
354
354
|
</div>`:""}`,xe=`
|
|
355
355
|
<div class="pane-section">
|
|
356
356
|
<div class="pane-section-title">Overview</div>
|
|
@@ -371,8 +371,8 @@ Too many redirects:
|
|
|
371
371
|
<div class="pane-section-title">Body</div>
|
|
372
372
|
${K}
|
|
373
373
|
</div>`,bt=he.length<=xe.length,It=bt?_e:"",ue=bt?"":_e,mr=R?.consoleOutput?.length?`<div class="console-block"><pre class="code console-code">${R.consoleOutput.map(mt=>vt(typeof mt=="string"?mt:JSON.stringify(mt))).join(`
|
|
374
|
-
`)}</pre></div>`:"",
|
|
375
|
-
<details class="req-detail ${
|
|
374
|
+
`)}</pre></div>`:"",ci=R?.error?`<div class="error-box">\u26A0 ${vt(R.error)}</div>`:"",Ct=R?`<span class="${Zg(R.status)} status-badge">${R.status} ${vt(R.statusText??"")}</span>`:"",Gr=`<span class="dur-badge">${Aa(S.d)}</span>`,Pr=e.config.iterations>1?`<span class="iter-badge">iter ${S.it}</span>`:"";return`
|
|
375
|
+
<details class="req-detail ${j?"req-pass":"req-fail"}" id="${q}" style="--border:${B}">
|
|
376
376
|
<summary class="req-summary">
|
|
377
377
|
<span class="toggle-icon">\u25B6</span>
|
|
378
378
|
<span class="req-index dim">#${S.i}</span>
|
|
@@ -381,10 +381,10 @@ Too many redirects:
|
|
|
381
381
|
${Ct}
|
|
382
382
|
${Gr}
|
|
383
383
|
${Pr}
|
|
384
|
-
<span class="req-outcome ${
|
|
384
|
+
<span class="req-outcome ${j?"pass":"fail"}">${j?"\u2713":"\u2717"}</span>
|
|
385
385
|
</summary>
|
|
386
386
|
<div class="req-body">
|
|
387
|
-
${
|
|
387
|
+
${ci}
|
|
388
388
|
<!-- URL row -->
|
|
389
389
|
<div class="detail-section url-row">
|
|
390
390
|
<span class="method method-${I.toLowerCase()}">${I}</span>
|
|
@@ -409,7 +409,7 @@ Too many redirects:
|
|
|
409
409
|
<!-- Response column -->
|
|
410
410
|
<div class="col-stack">
|
|
411
411
|
<div class="col-pane">
|
|
412
|
-
<div class="pane-title">Response <span class="${
|
|
412
|
+
<div class="pane-title">Response <span class="${Zg(S.s)} status-badge">${S.s}</span></div>
|
|
413
413
|
${xe}
|
|
414
414
|
</div>
|
|
415
415
|
${ue}
|
|
@@ -707,7 +707,7 @@ Too many redirects:
|
|
|
707
707
|
border:1px solid #f8514940;border-radius:6px;padding:8px 12px">
|
|
708
708
|
<span class="method method-${_.toLowerCase()}">${_}</span>
|
|
709
709
|
<strong>${vt(S.n)}</strong>
|
|
710
|
-
<span class="status-badge ${
|
|
710
|
+
<span class="status-badge ${Zg(S.s)}">${S.s}</span>
|
|
711
711
|
<span class="dur-badge">${Aa(S.d)}</span>
|
|
712
712
|
${S.e?`<span class="dim" style="flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"> \u2014 ${vt(S.e)}</span>`:""}
|
|
713
713
|
</a>
|
|
@@ -800,10 +800,10 @@ Too many redirects:
|
|
|
800
800
|
});
|
|
801
801
|
</script>
|
|
802
802
|
</body>
|
|
803
|
-
</html>`}}});import*as Ht from"fs/promises";import*as Jr from"path";function ey(r,e){if(r.length===0)return 0;let t=Math.ceil(e/100*r.length)-1;return r[Math.max(0,Math.min(t,r.length-1))]}var Lu,qC=se(()=>{"use strict";bn();$f();TC();Zg();Lu=class{constructor(e){this.configService=e;let t=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=t.indexPageSize,this.recentErrorsLimit=t.recentErrorsLimit}configService;basePath;currentRunPath=null;currentRunId=null;currentSuiteId=null;currentManifest=null;currentIndexPage=[];currentPageNumber=1;indexPageSize;recentErrors=[];recentErrorsLimit;resultIndex=0;requestDurations={};getBasePath(){return this.basePath}async initializeRun(e,t,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=Jr.join(this.basePath,e,s),await Ht.mkdir(Jr.join(this.currentRunPath,"results"),{recursive:!0}),await Ht.mkdir(Jr.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:t,environment:n,startTime:new Date().toISOString(),status:"running",config:i,stats:{totalRequests:0,passed:0,failed:0,skipped:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0},requestStats:{},totalIndexPages:0,indexPageSize:this.indexPageSize},this.currentIndexPage=[],this.currentPageNumber=1,this.recentErrors=[],this.resultIndex=0,this.requestDurations={},await this.saveManifest(),s}async saveResult(e,t){if(!this.currentRunPath||!this.currentManifest)throw new Error("No active run. Call initializeRun first.");this.resultIndex++;let n=Date.now(),i=String(e).padStart(4,"0"),s=String(this.resultIndex).padStart(6,"0"),a=kt(t.requestId),l=`result-${s}-iter-${i}-${a}.json`,f=Jr.join(this.currentRunPath,"results",l),d={index:this.resultIndex,iteration:e,requestId:t.requestId,name:t.name,method:t.executedRequest.method,url:t.executedRequest.url,folderPath:t.folderPath||"",collectionName:t.collectionName||"",status:t.response.status,statusText:t.response.statusText||"",duration:t.duration,passed:t.passed,timestamp:n,request:{method:t.executedRequest.method,url:t.executedRequest.url,headers:t.executedRequest.headers,query:t.executedRequest.query,params:t.executedRequest.params,body:t.executedRequest.body},response:{headers:t.response.headers,body:t.response.body,time:t.response.time,size:t.response.size,cookies:t.response.cookies},assertions:t.assertions.map(S=>({name:S.name,passed:S.passed,message:S.message||null})),error:t.error||null,consoleOutput:t.consoleOutput,modifiedVariables:t.modifiedVariables,modifiedEnvironmentVariables:t.modifiedEnvironmentVariables,modifiedCollectionVariables:t.modifiedCollectionVariables,nextRequest:t.nextRequest??null,visualizerData:t.visualizerData};await Ht.writeFile(f,JSON.stringify(ew(d),null,2),"utf-8");let h=t.assertions.filter(S=>S.passed).length,g=t.assertions.filter(S=>!S.passed).length,y={i:this.resultIndex,it:e,n:t.name,m:IC[t.executedRequest.method.toUpperCase()]??0,s:t.response.status,d:t.duration,p:t.passed,ap:h,af:g,r:t.requestId,e:t.passed?null:t.error||null,fp:t.folderPath||"",cn:t.collectionName||""};return this.currentIndexPage.push(y),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(t),this.requestDurations[t.requestId]||(this.requestDurations[t.requestId]=[]),this.requestDurations[t.requestId].push(t.duration),t.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:t.name,status:t.response.status,error:t.error||`Status ${t.response.status}`,resultFile:l}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),y}async finalizeRun(e="completed",t=!0){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let l in this.currentManifest.requestStats){let f=this.currentManifest.requestStats[l],d=this.requestDurations[l]||[];f.count>0&&(f.avgDuration=Math.round(f.totalDuration/f.count)),f.minDuration===Number.MAX_SAFE_INTEGER&&(f.minDuration=0),d.length>0&&(d.sort((h,g)=>h-g),f.p50=ey(d,50),f.p90=ey(d,90),f.p95=ey(d,95),f.p99=ey(d,99))}this.requestDurations={},await this.saveManifest();let n=null,i=this.currentRunPath,s=this.currentSuiteId,a=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,t&&s&&a&&i)try{n=await new Td(this.basePath).generate(s,a)}catch(l){console.warn("[ResultStorage] HTML report generation failed:",l)}return n}getCurrentStats(){return this.currentManifest?{stats:{...this.currentManifest.stats},requestStats:{...this.currentManifest.requestStats},recentErrors:[...this.recentErrors]}:null}getCurrentRunId(){return this.currentRunId}getCurrentSuiteId(){return this.currentSuiteId}async getResultDetails(e,t,n){let i=Jr.join(this.basePath,e,t,"results",n),s=await Ht.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,t,n){let i=Jr.join(this.basePath,e,t,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Ht.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,t){let n=Jr.join(this.basePath,e,t,"manifest.json"),i=await Ht.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let t=Jr.join(this.basePath,e);try{let n=await Ht.readdir(t),i=[];for(let s of n.sort().reverse())try{let a=await this.getManifest(e,s);i.push(a)}catch{}return i}catch{return[]}}async listSuites(){try{return(await Ht.readdir(this.basePath,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name)}catch{return[]}}async deleteRun(e,t){let n=Jr.join(this.basePath,e,t);await Ht.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let t=this.configService.getRunnerConfig().resultsRetentionDays;if(t===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-t);let i=0,s=0,a=await this.listSuites();for(let l of a){let f=await this.listRuns(l);for(let d of f)if(new Date(d.startTime)<n){let h=Jr.join(this.basePath,l,d.runId),g=await this.getDirectorySize(h);await Ht.rm(h,{recursive:!0,force:!0}),i++,s+=g}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,t=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${t}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=Jr.join(this.currentRunPath,"manifest.json");await Ht.writeFile(e,JSON.stringify(this.currentManifest,null,2),"utf-8")}async writeCurrentIndexPage(){if(!this.currentRunPath||this.currentIndexPage.length===0)return;let e=`page-${String(this.currentPageNumber).padStart(4,"0")}.json`,t=Jr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await Ht.writeFile(t,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let t=this.currentManifest.stats,n=this.currentManifest.requestStats;t.totalRequests++,t.totalDuration+=e.duration,t.minDuration=Math.min(t.minDuration,e.duration),t.maxDuration=Math.max(t.maxDuration,e.duration),e.passed?t.passed++:t.failed++,n[e.requestId]||(n[e.requestId]={name:e.name,count:0,passed:0,failed:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0});let i=n[e.requestId];i.count++,i.totalDuration+=e.duration,i.minDuration=Math.min(i.minDuration,e.duration),i.maxDuration=Math.max(i.maxDuration,e.duration),e.passed?i.passed++:i.failed++}async getDirectorySize(e){let t=0;try{let n=await Ht.readdir(e,{withFileTypes:!0});for(let i of n){let s=Jr.join(e,i.name);if(i.isDirectory())t+=await this.getDirectorySize(s);else{let a=await Ht.stat(s);t+=a.size}}}catch{}return t}}});import*as ki from"fs";import*as qd from"path";var AC,ty,Ad,ry,c$=se(()=>{"use strict";AC=class{watchers=[];constructor(e,t){let n=this.globToPath(e,t);try{let i=ki.watch(n,{recursive:!0},(s,a)=>{if(a){let l=qd.join(n,a);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,t){return t.includes("**")?e:qd.join(e,t.replace(/\*/g,""))}notifyChange(e){}onDidChange(e){return{dispose:()=>{}}}onDidCreate(e){return{dispose:()=>{}}}onDidDelete(e){return{dispose:()=>{}}}dispose(){for(let e of this.watchers)e.close();this.watchers=[]}},ty=class{createFileWatcher(e,t){return new AC(e,t)}},Ad=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(ki.existsSync(this.storeFile)){let e=ki.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=qd.dirname(this.storeFile);ki.mkdirSync(e,{recursive:!0}),ki.writeFileSync(this.storeFile,JSON.stringify(this.data,null,2),"utf-8")}catch{}}get(e,t){let n=this.data[e];return n!==void 0?n:t}async update(e,t){t===void 0?delete this.data[e]:this.data[e]=t,this.save()}},ry=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as ju from"path";function f$(r){let e=ju.resolve(r.workspaceFolder),{appInfo:t}=r,n=Ta.createFresh(),i=ju.join(e,".http-forge-cache","stores"),s=ju.join(i,"workspace-state.json"),a=ju.join(i,"global-state.json"),l={workspaceFolder:e,fileWatcherFactory:new ty,notificationService:new ry,workspaceStore:new Ad(s),globalStore:new Ad(a),applicationInfo:t||{name:"http-forge-cli",version:"0.1.0"}};return Wg(n,l),n}function kn(r){return f$({workspaceFolder:r})}var ny=se(()=>{"use strict";dC();pC();c$()});function C8(r){let e=[];return r.map(t=>{let n=Sn(t,e);return e.push(n),n})}function d$(r,e,t,n){let i=r.find(d=>d.id===e);if(i)return{item:i,tier:"id"};let s=C8(r.map(d=>d.name)),a=r.filter((d,h)=>s[h]===e);if(a.length===1)return{item:a[0],tier:"slug"};if(a.length>1)throw new $a(t,e,a.map(d=>({id:d.id,name:d.name,path:n(d)})));let l=e.toLowerCase(),f=r.filter(d=>d.name.toLowerCase()===l);if(f.length===1)return{item:f[0],tier:"name"};throw f.length>1?new $a(t,e,f.map(d=>({id:d.id,name:d.name,path:n(d)}))):new Error(`${t.charAt(0).toUpperCase()}${t.slice(1)} "${e}" not found`)}function $C(r,e){let{item:t,tier:n}=d$(r,e,"collection",()=>"");return{collection:t,tier:n}}function MC(r,e){let t=e.split("/").map(a=>a.trim()).filter(a=>a.length>0),n=r.items,i=[],s=[];for(let a of t){let l=n.filter(g=>g.type==="folder"),f=i.join("/"),{item:d,tier:h}=d$(l,a,"folder",g=>f?`${f}/${g.name}`:g.name);i.push(d.name),s.push(h),n=d.items??[]}return{folderPath:i.join("/"),tiers:s}}function p$(r,e,t){let n=[];for(let i of r)if(i.type==="request"){let s=Sn(i.name,n);n.push(s),t.push({item:i,folderPath:e,slug:s})}for(let i of r)if(i.type==="folder"){let s=i,a=e?`${e}/${s.name}`:s.name;p$(s.items??[],a,t)}}function NC(r,e,t){let n=[];p$(r.items,"",n);let i=t?t.replace(/\/+$/,""):void 0,s=i?n.filter(y=>y.folderPath===i||y.folderPath.startsWith(`${i}/`)):n,a=y=>y.folderPath?`${y.folderPath}/${y.item.name}`:y.item.name,l=s.find(y=>y.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let f=s.filter(y=>y.slug===e);if(f.length===1)return{request:f[0].item,tier:"slug",folderPath:f[0].folderPath};if(f.length>1)throw new $a("request",e,f.map(y=>({id:y.item.id,name:y.item.name,path:a(y)})));let d=e.toLowerCase(),h=s.filter(y=>y.item.name.toLowerCase()===d);if(h.length===1)return{request:h[0].item,tier:"name",folderPath:h[0].folderPath};if(h.length>1)throw new $a("request",e,h.map(y=>({id:y.item.id,name:y.item.name,path:a(y)})));let g=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${r.name}"${g}`)}var $a,DC=se(()=>{"use strict";Wo();$a=class extends Error{constructor(t,n,i){super(`Ambiguous ${t} reference "${n}" matches ${i.length} items:
|
|
803
|
+
</html>`}}});import*as Ht from"fs/promises";import*as Jr from"path";function Xg(r,e){if(r.length===0)return 0;let t=Math.ceil(e/100*r.length)-1;return r[Math.max(0,Math.min(t,r.length-1))]}var Lu,qC=se(()=>{"use strict";bn();Af();TC();Qg();Lu=class{constructor(e){this.configService=e;let t=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=t.indexPageSize,this.recentErrorsLimit=t.recentErrorsLimit}configService;basePath;currentRunPath=null;currentRunId=null;currentSuiteId=null;currentManifest=null;currentIndexPage=[];currentPageNumber=1;indexPageSize;recentErrors=[];recentErrorsLimit;resultIndex=0;requestDurations={};getBasePath(){return this.basePath}async initializeRun(e,t,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=Jr.join(this.basePath,e,s),await Ht.mkdir(Jr.join(this.currentRunPath,"results"),{recursive:!0}),await Ht.mkdir(Jr.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:t,environment:n,startTime:new Date().toISOString(),status:"running",config:i,stats:{totalRequests:0,passed:0,failed:0,skipped:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0},requestStats:{},totalIndexPages:0,indexPageSize:this.indexPageSize},this.currentIndexPage=[],this.currentPageNumber=1,this.recentErrors=[],this.resultIndex=0,this.requestDurations={},await this.saveManifest(),s}async saveResult(e,t){if(!this.currentRunPath||!this.currentManifest)throw new Error("No active run. Call initializeRun first.");this.resultIndex++;let n=Date.now(),i=String(e).padStart(4,"0"),s=String(this.resultIndex).padStart(6,"0"),a=kt(t.requestId),l=`result-${s}-iter-${i}-${a}.json`,f=Jr.join(this.currentRunPath,"results",l),d={index:this.resultIndex,iteration:e,requestId:t.requestId,name:t.name,method:t.executedRequest.method,url:t.executedRequest.url,folderPath:t.folderPath||"",collectionName:t.collectionName||"",status:t.response.status,statusText:t.response.statusText||"",duration:t.duration,passed:t.passed,timestamp:n,request:{method:t.executedRequest.method,url:t.executedRequest.url,headers:t.executedRequest.headers,query:t.executedRequest.query,params:t.executedRequest.params,body:t.executedRequest.body},response:{headers:t.response.headers,body:t.response.body,time:t.response.time,size:t.response.size,cookies:t.response.cookies},assertions:t.assertions.map(S=>({name:S.name,passed:S.passed,message:S.message||null})),error:t.error||null,consoleOutput:t.consoleOutput,modifiedVariables:t.modifiedVariables,modifiedEnvironmentVariables:t.modifiedEnvironmentVariables,modifiedCollectionVariables:t.modifiedCollectionVariables,nextRequest:t.nextRequest??null,visualizerData:t.visualizerData};await Ht.writeFile(f,JSON.stringify(ew(d),null,2),"utf-8");let h=t.assertions.filter(S=>S.passed).length,g=t.assertions.filter(S=>!S.passed).length,y={i:this.resultIndex,it:e,n:t.name,m:IC[t.executedRequest.method.toUpperCase()]??0,s:t.response.status,d:t.duration,p:t.passed,ap:h,af:g,r:t.requestId,e:t.passed?null:t.error||null,fp:t.folderPath||"",cn:t.collectionName||""};return this.currentIndexPage.push(y),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(t),this.requestDurations[t.requestId]||(this.requestDurations[t.requestId]=[]),this.requestDurations[t.requestId].push(t.duration),t.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:t.name,status:t.response.status,error:t.error||`Status ${t.response.status}`,resultFile:l}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),y}async finalizeRun(e="completed",t=!0){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let l in this.currentManifest.requestStats){let f=this.currentManifest.requestStats[l],d=this.requestDurations[l]||[];f.count>0&&(f.avgDuration=Math.round(f.totalDuration/f.count)),f.minDuration===Number.MAX_SAFE_INTEGER&&(f.minDuration=0),d.length>0&&(d.sort((h,g)=>h-g),f.p50=Xg(d,50),f.p90=Xg(d,90),f.p95=Xg(d,95),f.p99=Xg(d,99))}this.requestDurations={},await this.saveManifest();let n=null,i=this.currentRunPath,s=this.currentSuiteId,a=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,t&&s&&a&&i)try{n=await new kd(this.basePath).generate(s,a)}catch(l){console.warn("[ResultStorage] HTML report generation failed:",l)}return n}getCurrentStats(){return this.currentManifest?{stats:{...this.currentManifest.stats},requestStats:{...this.currentManifest.requestStats},recentErrors:[...this.recentErrors]}:null}getCurrentRunId(){return this.currentRunId}getCurrentSuiteId(){return this.currentSuiteId}async getResultDetails(e,t,n){let i=Jr.join(this.basePath,e,t,"results",n),s=await Ht.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,t,n){let i=Jr.join(this.basePath,e,t,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Ht.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,t){let n=Jr.join(this.basePath,e,t,"manifest.json"),i=await Ht.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let t=Jr.join(this.basePath,e);try{let n=await Ht.readdir(t),i=[];for(let s of n.sort().reverse())try{let a=await this.getManifest(e,s);i.push(a)}catch{}return i}catch{return[]}}async listSuites(){try{return(await Ht.readdir(this.basePath,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name)}catch{return[]}}async deleteRun(e,t){let n=Jr.join(this.basePath,e,t);await Ht.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let t=this.configService.getRunnerConfig().resultsRetentionDays;if(t===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-t);let i=0,s=0,a=await this.listSuites();for(let l of a){let f=await this.listRuns(l);for(let d of f)if(new Date(d.startTime)<n){let h=Jr.join(this.basePath,l,d.runId),g=await this.getDirectorySize(h);await Ht.rm(h,{recursive:!0,force:!0}),i++,s+=g}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,t=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${t}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=Jr.join(this.currentRunPath,"manifest.json");await Ht.writeFile(e,JSON.stringify(this.currentManifest,null,2),"utf-8")}async writeCurrentIndexPage(){if(!this.currentRunPath||this.currentIndexPage.length===0)return;let e=`page-${String(this.currentPageNumber).padStart(4,"0")}.json`,t=Jr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await Ht.writeFile(t,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let t=this.currentManifest.stats,n=this.currentManifest.requestStats;t.totalRequests++,t.totalDuration+=e.duration,t.minDuration=Math.min(t.minDuration,e.duration),t.maxDuration=Math.max(t.maxDuration,e.duration),e.passed?t.passed++:t.failed++,n[e.requestId]||(n[e.requestId]={name:e.name,count:0,passed:0,failed:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0});let i=n[e.requestId];i.count++,i.totalDuration+=e.duration,i.minDuration=Math.min(i.minDuration,e.duration),i.maxDuration=Math.max(i.maxDuration,e.duration),e.passed?i.passed++:i.failed++}async getDirectorySize(e){let t=0;try{let n=await Ht.readdir(e,{withFileTypes:!0});for(let i of n){let s=Jr.join(e,i.name);if(i.isDirectory())t+=await this.getDirectorySize(s);else{let a=await Ht.stat(s);t+=a.size}}}catch{}return t}}});import*as Pi from"fs";import*as Td from"path";var AC,ey,qd,ty,c$=se(()=>{"use strict";AC=class{watchers=[];constructor(e,t){let n=this.globToPath(e,t);try{let i=Pi.watch(n,{recursive:!0},(s,a)=>{if(a){let l=Td.join(n,a);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,t){return t.includes("**")?e:Td.join(e,t.replace(/\*/g,""))}notifyChange(e){}onDidChange(e){return{dispose:()=>{}}}onDidCreate(e){return{dispose:()=>{}}}onDidDelete(e){return{dispose:()=>{}}}dispose(){for(let e of this.watchers)e.close();this.watchers=[]}},ey=class{createFileWatcher(e,t){return new AC(e,t)}},qd=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(Pi.existsSync(this.storeFile)){let e=Pi.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=Td.dirname(this.storeFile);Pi.mkdirSync(e,{recursive:!0}),Pi.writeFileSync(this.storeFile,JSON.stringify(this.data,null,2),"utf-8")}catch{}}get(e,t){let n=this.data[e];return n!==void 0?n:t}async update(e,t){t===void 0?delete this.data[e]:this.data[e]=t,this.save()}},ty=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as ju from"path";function f$(r){let e=ju.resolve(r.workspaceFolder),{appInfo:t}=r,n=Ta.createFresh(),i=ju.join(e,".http-forge-cache","stores"),s=ju.join(i,"workspace-state.json"),a=ju.join(i,"global-state.json"),l={workspaceFolder:e,fileWatcherFactory:new ey,notificationService:new ty,workspaceStore:new qd(s),globalStore:new qd(a),applicationInfo:t||{name:"http-forge-cli",version:"0.1.0"}};return Vg(n,l),n}function ki(r){return f$({workspaceFolder:r})}var ry=se(()=>{"use strict";dC();pC();c$()});function C8(r){let e=[];return r.map(t=>{let n=Sn(t,e);return e.push(n),n})}function d$(r,e,t,n){let i=r.find(d=>d.id===e);if(i)return{item:i,tier:"id"};let s=C8(r.map(d=>d.name)),a=r.filter((d,h)=>s[h]===e);if(a.length===1)return{item:a[0],tier:"slug"};if(a.length>1)throw new $a(t,e,a.map(d=>({id:d.id,name:d.name,path:n(d)})));let l=e.toLowerCase(),f=r.filter(d=>d.name.toLowerCase()===l);if(f.length===1)return{item:f[0],tier:"name"};throw f.length>1?new $a(t,e,f.map(d=>({id:d.id,name:d.name,path:n(d)}))):new Error(`${t.charAt(0).toUpperCase()}${t.slice(1)} "${e}" not found`)}function $C(r,e){let{item:t,tier:n}=d$(r,e,"collection",()=>"");return{collection:t,tier:n}}function MC(r,e){let t=e.split("/").map(a=>a.trim()).filter(a=>a.length>0),n=r.items,i=[],s=[];for(let a of t){let l=n.filter(g=>g.type==="folder"),f=i.join("/"),{item:d,tier:h}=d$(l,a,"folder",g=>f?`${f}/${g.name}`:g.name);i.push(d.name),s.push(h),n=d.items??[]}return{folderPath:i.join("/"),tiers:s}}function p$(r,e,t){let n=[];for(let i of r)if(i.type==="request"){let s=Sn(i.name,n);n.push(s),t.push({item:i,folderPath:e,slug:s})}for(let i of r)if(i.type==="folder"){let s=i,a=e?`${e}/${s.name}`:s.name;p$(s.items??[],a,t)}}function NC(r,e,t){let n=[];p$(r.items,"",n);let i=t?t.replace(/\/+$/,""):void 0,s=i?n.filter(y=>y.folderPath===i||y.folderPath.startsWith(`${i}/`)):n,a=y=>y.folderPath?`${y.folderPath}/${y.item.name}`:y.item.name,l=s.find(y=>y.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let f=s.filter(y=>y.slug===e);if(f.length===1)return{request:f[0].item,tier:"slug",folderPath:f[0].folderPath};if(f.length>1)throw new $a("request",e,f.map(y=>({id:y.item.id,name:y.item.name,path:a(y)})));let d=e.toLowerCase(),h=s.filter(y=>y.item.name.toLowerCase()===d);if(h.length===1)return{request:h[0].item,tier:"name",folderPath:h[0].folderPath};if(h.length>1)throw new $a("request",e,h.map(y=>({id:y.item.id,name:y.item.name,path:a(y)})));let g=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${r.name}"${g}`)}var $a,DC=se(()=>{"use strict";Wo();$a=class extends Error{constructor(t,n,i){super(`Ambiguous ${t} reference "${n}" matches ${i.length} items:
|
|
804
804
|
`+i.map(s=>` - ${s.name} (id: ${s.id}, path: ${s.path||"/"})`).join(`
|
|
805
805
|
`)+`
|
|
806
|
-
Disambiguate by passing the id or slug.`);this.kind=t;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var Md={};Ns(Md,{runCollection:()=>ps,runFolder:()=>k8,runRequest:()=>iy,runSuite:()=>$d});function FC(r){let e=[r.testSuite,r.collection,r.environmentConfig,r.config,r.console];for(let t of e)try{t?.dispose?.()}catch{}}function m$(r){return r==="1"||r==="true"||r==="yes"||r==="on"}function x8(){return m$(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function E8(){let r=process.env.HTTP_FORGE_MAX_REQUESTS;if(!r||r.trim()==="")return 50;let e=Number(r);if(!Number.isFinite(e)||e<=0)throw new Error("HTTP_FORGE_MAX_REQUESTS must be a positive number when provided");return Math.floor(e)}function g$(r){return m$(process.env.HTTP_FORGE_GENERATE_REPORTS)?!0:r.includes("report")}function y$(r){if(typeof r!="string")return r;try{return JSON.parse(r)}catch{return r}}function O8(r){return r?Object.fromEntries(Object.entries(r).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function v$(r){return ns(O8(r))}function b$(r){return K0((r??[]).map(e=>({name:e.name,value:e.value})))}function h$(r){return r.replace(/[^a-zA-Z0-9_-]/g,"_")}function S$(r){let e=["none","inherit","basic","bearer","apikey","oauth2"],t=r.auth?.type&&e.includes(r.auth.type)?r.auth.type:void 0;return{id:r.id,name:r.name,method:r.method,url:r.url,headers:Array.isArray(r.headers)?r.headers.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):r.headers,query:Array.isArray(r.query)?r.query.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):r.query,params:r.params?Object.entries(r.params).reduce((n,[i,s])=>(n[i]=typeof s=="string"?s:s.value??"",n),{}):void 0,body:r.body??null,scripts:r.scripts,settings:r.settings,auth:{type:t==="inherit"?"none":t,bearerToken:r.auth?.bearerToken,basicAuth:r.auth?.basicAuth,apikey:r.auth?.apikey,oauth2:r.auth?.oauth2}}}function w$(r,e){let t={...r};return e.headers&&(t.headers={...r.headers??{},...e.headers}),e.query&&(t.query=e.query),e.body!==void 0&&(t.body={type:"raw",raw:e.body,contentType:"application/json"}),t}function _$(r){return r?Object.fromEntries(Object.entries(r).map(([e,t])=>[e,String(t)])):{}}function LC(r,e,t=r.items,n=[]){for(let i of t){if(i.type==="request"&&i.id===e)return{request:i,folderScriptsChain:[...n]};if(i.type==="folder"){let s=i,a=s.scripts?[...n,s.scripts]:[...n],l=LC(r,e,s.items??[],a);if(l)return l}}}function R$(r,e=r.items,t=[],n=[]){let i=[];for(let s of e)if(s.type==="request")i.push({request:s,folderScriptsChain:[...t],folderPath:n.join("/")});else{let a=s,l=a.scripts?[...t,a.scripts]:[...t],f=[...n,a.name];i.push(...R$(r,a.items??[],l,f))}return i}function I8(r,e,t=!0){if(!e)return r;let n=e.replace(/\/+$/,"");return r.filter(({folderPath:i})=>t?i===n||i.startsWith(`${n}/`):i===n)}function P8(r){return r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function C$(r,e){if(e.collectionId){let t=r.getCollection(e.collectionId);if(!t)throw new Error(`Collection "${e.collectionId}" not found`);return t}if(e.collectionRef){let{collection:t,tier:n}=$C(r.getAllCollections(),e.collectionRef);return e.onResolve?.({kind:"collection",value:e.collectionRef,tier:n,id:t.id}),t}throw new Error("A collection reference is required (collectionId or collectionRef)")}function x$(r,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:t}=MC(r,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:t,path:t}),t}}async function E$(r,e,t,n){let i=t.environment??r.environmentConfig.getSelectedEnvironment(),s=t.iterations??e.config?.iterations??1,a=t.stopOnError??e.config?.stopOnError??!1,l=t.delay??e.config?.delayBetweenRequests??0,f=t.requestFilter,d=t.include??[],h=_$(t.variables),g=x8(),y=g$(d),S=e.requests.filter(C=>!(C.enabled===!1||f&&!f.some(k=>C.name.toLowerCase().includes(k.toLowerCase()))));if(g){let C=E8(),k=S.length*s;if(k>C)throw new Error(`Suite "${e.name}" would execute ${k} request calls (${S.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${C}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let _=new Lu(r.config);await _.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:a});let R=[],I=[],q=0,U=0,B=new AbortController,V=new Mu;for(let C=1;C<=s;C++){for(let k of S){let N=r.collection.getCollection(k.collectionId);if(!N)continue;let j=LC(N,k.requestId);if(!j)continue;let $=new Gs(r.httpRequest,r.scriptExecutor,r.environmentConfig,r.requestPreparer,i,V,N.scripts,j.folderScriptsChain,void 0,N.name,C,s),G=w$(S$(j.request),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),K=await $.execute(G,h,B.signal);if(K.folderPath=k.folderPath??"",K.collectionName=N.name,await _.saveResult(C,K),K.passed?q++:U++,d.includes("perRequest")&&R.push({name:k.name,iteration:C,status:K.response?.status,ok:(K.response?.status??0)>=200&&(K.response?.status??0)<300,duration:`${K.duration}ms`,allPassed:K.passed,...d.includes("consoleOutput")&&K.consoleOutput?.length?{consoleOutput:K.consoleOutput}:{}}),!K.passed&&(I.push({name:k.name,iteration:C,status:K.response?.status,duration:`${K.duration}ms`,body:y$(K.response?.body),headers:v$(K.response?.headers),cookies:b$(K.response?.cookies),failedTests:K.assertions?.filter(ne=>!ne.passed).map(ne=>({name:ne.name,...ne.message?{message:ne.message}:{}})),...K.error?{error:K.error}:{},...d.includes("consoleOutput")&&K.consoleOutput?.length?{consoleOutput:K.consoleOutput}:{}}),a)){B.abort();break}l>0&&!B.signal.aborted&&await new Promise(ne=>setTimeout(ne,l))}if(B.signal.aborted)break}let W=await _.finalizeRun("completed",y),T={[n==="collection"?"collection":"suite"]:e.name,environment:i,summary:{total:q+U,passed:q,failed:U,...s>1?{iterations:s}:{},allPassed:U===0}};return(U>0||d.includes("failedOnly"))&&(T.failedRequests=I),d.includes("perRequest")&&(T.results=R),W!==null&&(T.report={uri:`file://${W}`,hint:"Click the URI to open the HTML report in your browser"}),T}async function iy(r){let e=kn(r.workspaceFolder),t=r.include??[],n=g$(t);try{let i=e.collection,s=C$(i,r),a=x$(s,r),l=r.requestId;if(!l){if(!r.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let I=NC(s,r.requestRef,a);l=I.request.id,r.onResolve?.({kind:"request",value:r.requestRef,tier:I.tier,id:l,path:I.folderPath?`${I.folderPath}/${I.request.name}`:I.request.name})}let f=LC(s,l);if(!f)throw new Error(`Request "${l}" not found in collection "${s.name}"`);let d=r.environment||e.environmentConfig.getSelectedEnvironment(),h=w$(S$(f.request),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),y=await new Gs(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,d,new Mu,s.scripts,f.folderScriptsChain).execute(h,_$(r.variables)),S=null;if(n){let I=new Lu(e.config),q=`request-${h$(s.id)}-${h$(l)}`,U=`Request: ${f.request.name}`;await I.initializeRun(q,U,d,{iterations:1,delayBetweenRequests:0,stopOnError:!0}),await I.saveResult(1,y),S=await I.finalizeRun("completed")}let _=v$(y.response?.headers),R=b$(y.response?.cookies);return{request:f.request.name,status:y.response?.status||0,ok:(y.response?.status??0)>=200&&(y.response?.status??0)<300,duration:`${y.duration}ms`,body:y$(y.response?.body),allPassed:y.passed,assertions:y.assertions?.map(I=>({name:I.name,passed:I.passed,message:I.message})),...t.includes("headers")?{headers:_}:{},...t.includes("cookies")?{cookies:R}:{},...t.includes("tests")?{tests:y.assertions?.map(I=>({name:I.name,passed:I.passed,...I.message?{message:I.message}:{}}))}:{},...Object.keys(y.modifiedVariables??{}).length?{modifiedVariables:y.modifiedVariables}:{},...t.includes("consoleOutput")&&y.consoleOutput?.length?{consoleOutput:y.consoleOutput}:{},...S!==null?{report:{uri:`file://${S}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...y.error?{error:y.error}:{}}}catch(i){throw i}finally{FC(e)}}async function ps(r){let e=kn(r.workspaceFolder);try{let t=e.collection,n=C$(t,r),i=x$(n,r),s=R$(n),a=I8(s,i,r.recursive);if(a.length===0&&i)throw new Error(`No requests found under folder "${i}" in collection "${n.name}"`);let l=a.map(({request:d,folderPath:h})=>({id:d.id,slug:d.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:d.id,name:d.name,method:d.method,collectionName:n.name,folderPath:h,enabled:!0})),f={id:i?`temp-${n.id}-${P8(i)}`:`temp-${n.id}`,name:i?`${n.name} / ${i}`:n.name,requests:l,config:{iterations:1,delay:0,stopOnError:r.stopOnError??!1,readFromSharedSession:!1,writeToSharedSession:!1},isTemporary:!0,createdAt:Date.now(),updatedAt:Date.now()};return E$(e,f,{environment:r.environment,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:void 0,include:r.include,variables:r.variables},"collection")}catch(t){throw t}finally{FC(e)}}async function k8(r){return ps({recursive:!0,...r})}async function $d(r){let e=kn(r.workspaceFolder);try{let n=await e.testSuite.getSuite(r.suiteId);if(!n)throw new Error(`Test suite "${r.suiteId}" not found`);return E$(e,n,{environment:r.environment,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include,variables:r.variables},"suite")}catch(t){throw t}finally{FC(e)}}var Uu=se(()=>{"use strict";OC();im();$f();qC();ny();DC()});var A$={};Ns(A$,{createMcpRuntime:()=>Y8});import*as T$ from"fs";import{createServer as T8}from"http";import*as Nd from"path";async function ci(r){let e=process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS,t=process.env.HTTP_FORGE_GENERATE_REPORTS;process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS="true",process.env.HTTP_FORGE_GENERATE_REPORTS="true";try{return await r()}finally{e===void 0?delete process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS:process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS=e,t===void 0?delete process.env.HTTP_FORGE_GENERATE_REPORTS:process.env.HTTP_FORGE_GENERATE_REPORTS=t}}function Ti(r,e=r.items,t=""){let n=[];for(let i of e)if(i.type==="request")n.push({request:i,folderPath:t});else{let s=i,a=t?`${t} / ${s.name}`:s.name;n.push(...Ti(r,s.items??[],a))}return n}function Dd(r,e=r.items,t=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,a=t?`${t}/${s.name}`:s.name;n.push({folderPath:a,requestCount:q$(s.items??[])}),n.push(...Dd(r,s.items??[],a))}return n}function q$(r){let e=0;for(let t of r)t.type==="request"?e++:e+=q$(t.items??[]);return e}function Hu(r){let e=[r.testSuite,r.collection,r.environmentConfig,r.config,r.console];for(let t of e)try{t?.dispose?.()}catch{}}function O$(r){let e=new Set,t=[];for(let n of r)e.has(n.name)||(e.add(n.name),t.push(n));return t}async function $8(r){let e=I$.get(r);if(e&&e.expiresAt>Date.now())return e.tools;let t=jC.get(r);if(t)return t;let n=M8(r).then(i=>(I$.set(r,{tools:i,expiresAt:Date.now()+A8}),i)).finally(()=>{jC.delete(r)});return jC.set(r,n),n}async function M8(r){let e=kn(r);try{let t=e.config.getMcpConfig(),n=t.toolPrefix??"",i=t.toolMode??"auto",s=t.drilldownThreshold??100,a=S=>{let _=t.excludedCollections;return!!_?.length&&(_.includes(S.id)||_.includes(S.name))},l=S=>{let _=t.excludedSuites;return!!_?.length&&(_.includes(S.id)||_.includes(S.name))},f=e.collection.getAllCollections().filter(S=>!a(S)),d=(await e.testSuite.getAllSuites()).filter(S=>!l(S)),h=0;for(let S of f)h+=Ti(S).length;let g=i==="drilldown"||i==="auto"&&h>s;if(i==="flat"&&h>500&&console.warn(`[http-forge MCP] WARNING: toolMode is "flat" but ${h} requests would produce ${h}+ tools. This will likely degrade AI tool-selection quality and bloat the context window. Consider setting toolMode to "auto" or "drilldown" in http-forge.config.json.`),g){let S=xC(n,f.map(_=>_.name),d.map(_=>_.name)).map(_=>({name:_.name,description:_.description,inputSchema:_.inputSchema}));return O$(S)}let y=[];for(let S of f){let _=Ti(S);for(let{request:R,folderPath:I}of _)y.push({name:hC(n,S.id,R.id),description:SC(R.method,R.name,S.name,I),inputSchema:Jg});y.push({name:mC(n,S.id),description:wC(S.name,_.length),inputSchema:Gg});for(let{folderPath:R,requestCount:I}of Dd(S))I!==0&&y.push({name:gC(n,S.id,R),description:_C(R,S.name,I),inputSchema:Yg})}for(let S of d)y.push({name:yC(n,S.id),description:RC(S.name,S.requests.length,S.config.iterations),inputSchema:Kg});return O$(y)}finally{Hu(e)}}function N8(r,e){let t=kn(r),n;try{n=t.config.getMcpConfig().toolPrefix??""}finally{Hu(t)}return n&&e.startsWith(n)?e.slice(n.length):e}function D8(r,e,t){return r.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${t}/report?path=${encodeURIComponent(i)}"`)}function P$(r,e,t,n){Ma(r,200,{jsonrpc:"2.0",id:e,error:{code:t,message:n}})}function F8(r){return Buffer.from(String(r)).toString("base64url")}function L8(r){if(!r)return 0;try{let e=parseInt(Buffer.from(r,"base64url").toString(),10);return Number.isFinite(e)&&e>=0?e:0}catch{return 0}}function j8(r){let e=kn(r);try{return e.config.getMcpConfig().toolPageSize??150}finally{Hu(e)}}async function U8(r,e){switch(e.method){case"initialize":return{protocolVersion:"2024-11-05",capabilities:{tools:{}},serverInfo:{name:"http-forge",version:"1.0.0"}};case"tools/list":{let t=await $8(r.workspaceFolder),n=e.params??{},i=typeof n.cursor=="string"?n.cursor:void 0,s=j8(r.workspaceFolder);if(s<=0||t.length<=s)return{tools:t};let a=L8(i),l=t.slice(a,a+s),f=a+s,d={tools:l};return f<t.length&&(d.nextCursor=F8(f)),d}case"tools/call":{let t=e.params??{},n=t.name,i=t.arguments;if(!n)throw new Error("Missing tool name");let s=await HC(r.workspaceFolder,n,i??{}),a=JSON.stringify(s,null,2);return{content:[{type:"text",text:D8(a,r.host,r.port)}]}}default:throw new Error(`Method not found: ${e.method}`)}}function H8(r,e,t){let n=kn(r.workspaceFolder),i;try{i=n.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{Hu(n)}let s=e.headers.origin??"",a=i.includes(s)?s:i[0]??"http://localhost";t.setHeader("Access-Control-Allow-Origin",a),t.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),t.setHeader("Access-Control-Allow-Headers","Content-Type, Mcp-Session-Id")}function B8(r,e,t){let i=new URL(e.url,`http://${r.host}:${r.port}`).searchParams.get("path");if(!i){t.statusCode=400,t.end("Missing path parameter");return}let s=Nd.resolve(i),a=Nd.resolve(r.workspaceFolder,".http-forge-cache");if(!s.startsWith(a+Nd.sep)||!s.endsWith(".html")){t.statusCode=403,t.end("Forbidden");return}T$.readFile(s,"utf-8",(l,f)=>{if(l){t.statusCode=404,t.end("Report not found");return}t.statusCode=200,t.setHeader("content-type","text/html; charset=utf-8"),t.end(f)})}function W8(){let r=Date.now()-V8;for(let[e,t]of oy)t.startedAt<r&&oy.delete(e)}function z8(){return`run_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function sy(r){if(typeof r!="string"||!r)throw Ot('"runId" is required');let e=oy.get(r);if(!e)throw new Error(`Run "${r}" not found. It may have expired (1-hour TTL) or never existed.`);return e}function UC(r,e,t){W8();let n=z8(),i={id:n,status:"running",suiteName:r,startedAt:Date.now(),progress:{completed:0,total:e},summary:{passed:0,failed:0,total:0,allPassed:!1},failedRequests:[],allResults:[],reportPath:null};return oy.set(n,i),t().then(s=>{i.status="completed",i.completedAt=Date.now(),i.summary=s?.summary??i.summary,s?.failedRequests&&(i.failedRequests=s.failedRequests),i.reportPath=s?.report?.uri?.replace("file://","")??null,i.progress.completed=i.progress.total}).catch(s=>{i.status="failed",i.completedAt=Date.now(),i.error=s.message}),{runId:n,status:"running",total:e,message:"Run started. Use get_run_status to poll."}}function Ot(r){return new Error(`Bad request: ${r}`)}async function J8(r,e,t){let n=kn(r);try{let i=n.collection.getAllCollections(),s=h=>{if(typeof h!="string"||!h.trim())throw Ot('the "collection" argument is required');let g=h.toLowerCase(),y=i.find(S=>S.id===h||S.name===h)??i.find(S=>S.name.toLowerCase()===g)??i.find(S=>S.name.toLowerCase().includes(g))??i.find(S=>S.id.toLowerCase().includes(g));if(!y){let S=i.map(_=>`"${_.name}"`).join(", ");throw Ot(`collection not found: "${h}". Available collections: ${S||"(none)"}. Call list_collections to see all.`)}return y};if(e===ot.listCollections)return{collections:i.map(h=>({name:h.name,id:h.id,description:h.description??"",requestCount:Ti(h).length}))};if(e===ot.listFolders){let h=s(t.collection);return{collection:h.name,folders:Dd(h).map(({folderPath:g,requestCount:y})=>({path:g,requestCount:y}))}}if(e===ot.listRequests){let h=s(t.collection),g=typeof t.folder=="string"?t.folder.toLowerCase():void 0,y=typeof t.offset=="number"?Math.max(0,t.offset):0,S=typeof t.limit=="number"?Math.min(200,Math.max(1,t.limit)):50,_=Ti(h).filter(({folderPath:R})=>!g||R.toLowerCase().includes(g)).map(({request:R,folderPath:I})=>({id:R.id,name:R.name,method:R.method,folder:I,description:R.description??""}));return{collection:h.name,total:_.length,offset:y,limit:S,requests:_.slice(y,y+S)}}if(e===ot.searchRequests){let h=s(t.collection),g=typeof t.query=="string"?t.query.toLowerCase().trim():"";if(!g)throw Ot('the "query" argument is required');let y=Ti(h).filter(({request:S,folderPath:_})=>S.name.toLowerCase().includes(g)||(S.url??"").toLowerCase().includes(g)||S.method.toLowerCase().includes(g)||_.toLowerCase().includes(g)||(S.description??"").toLowerCase().includes(g)).map(({request:S,folderPath:_})=>({id:S.id,name:S.name,method:S.method,url:S.url??"",folder:_,description:S.description??""}));return{collection:h.name,query:t.query,total:y.length,requests:y}}if(e===ot.getEnvironment){let h=typeof t.environment=="string"&&t.environment.trim()?t.environment.trim():n.environmentConfig.getSelectedEnvironment(),g=n.environmentConfig.getResolvedEnvironment(h);if(!g)throw Ot(`environment "${h}" not found`);return{name:g.name,variables:g.variables}}if(e===ot.setVariable){let h=typeof t.key=="string"?t.key.trim():"",g=typeof t.value=="string"?t.value:String(t.value??"");if(!h)throw Ot('"key" is required');let y=typeof t.environment=="string"&&t.environment.trim()?t.environment.trim():n.environmentConfig.getSelectedEnvironment();return n.environmentConfig.setEnvironmentVariable(h,g,y),{set:!0,key:h,environment:y}}if(e===ot.getRunStatus){let h=sy(t.runId);return{runId:h.id,status:h.status,suiteName:h.suiteName,progress:h.progress,...h.error?{error:h.error}:{}}}if(e===ot.getRunSummary){let h=sy(t.runId);return h.status==="running"?{runId:h.id,status:"running",progress:h.progress}:{runId:h.id,status:h.status,suiteName:h.suiteName,summary:h.summary,...h.reportPath?{report:{uri:`file://${h.reportPath}`}}:{}}}if(e===ot.getFailedRequests){let h=sy(t.runId);if(h.status==="running")return{runId:h.id,status:"running",progress:h.progress,failedSoFar:h.failedRequests.length};let g=typeof t.offset=="number"?Math.max(0,t.offset):0,y=typeof t.limit=="number"?Math.min(100,Math.max(1,t.limit)):20;return{runId:h.id,status:h.status,totalFailed:h.failedRequests.length,offset:g,limit:y,failedRequests:h.failedRequests.slice(g,g+y)}}if(e===ot.getRequestResult){let h=sy(t.runId),g=t.request;if(typeof g!="string"||!g)throw Ot('"request" is required');let y=typeof t.iteration=="number"?t.iteration:1,S=h.allResults.find(_=>_.iteration===y&&(_.name===g||_.name.toLowerCase()===g.toLowerCase()));if(!S){if(h.status==="running")return{runId:h.id,status:"running",message:`Request "${g}" has not completed yet.`};throw new Error(`Request "${g}" (iteration ${y}) not found in run "${h.id}".`)}return{runId:h.id,...S}}if(e===ot.runRequest){let h=s(t.collection),g=Ti(h),y=typeof t.requestId=="string"?t.requestId.trim():void 0,S=t.request,_;if(y){if(_=g.find(R=>R.request.id===y),!_)throw Ot(`request with id "${y}" not found in collection "${h.name}"`)}else{if(typeof S!="string"||!S.trim())throw Ot('the "request" or "requestId" argument is required');if(_=g.find(R=>R.request.name===S)??g.find(R=>R.request.name.toLowerCase()===S.toLowerCase()),!_)throw Ot(`request "${S}" not found in collection "${h.name}"`)}return ci(()=>iy({workspaceFolder:r,collectionId:h.id,requestId:_.request.id,environment:t.environment,variables:t.variables,headers:t.headers,query:t.query,body:t.body,include:t.include}))}if(e===ot.runFolder){let h=s(t.collection),g=t.folder;if(typeof g!="string"||!g.trim())throw Ot('the "folder" argument is required');let y=Dd(h).map(I=>I.folderPath),S=g.toLowerCase(),_=y.find(I=>I===g)??y.find(I=>I.toLowerCase()===S)??y.find(I=>I.toLowerCase().includes(S))??y.find(I=>I.split("/").some(q=>q.toLowerCase().includes(S)));if(!_){let I=y.map(q=>`"${q}"`).join(", ");throw Ot(`folder "${g}" not found in collection "${h.name}". Available folders: ${I||"(none)"}. Call list_folders to see all.`)}let R=Ti(h).filter(({folderPath:I})=>I===_||I.startsWith(`${_}/`)).length;return t.async===!0?UC(`${h.name} / ${_}`,R,()=>ci(()=>ps({workspaceFolder:r,collectionId:h.id,folderPath:_,recursive:t.recursive,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,include:t.include}))):ci(()=>ps({workspaceFolder:r,collectionId:h.id,folderPath:_,recursive:t.recursive,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,include:t.include}))}if(e===ot.runCollection){let h=s(t.collection),g=Ti(h).length;return t.async===!0?UC(h.name,g,()=>ci(()=>ps({workspaceFolder:r,collectionId:h.id,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,include:t.include}))):ci(()=>ps({workspaceFolder:r,collectionId:h.id,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,include:t.include}))}let a=t.suite;if(typeof a!="string"||!a.trim())throw Ot('the "suite" argument is required');let l=await n.testSuite.getAllSuites(),f=l.find(h=>h.id===a||h.name===a)??l.find(h=>h.name.toLowerCase()===a.toLowerCase());if(!f)throw Ot(`test suite not found: "${a}"`);let d=f.requests.length*(t.iterations??f.config?.iterations??1);return t.async===!0?UC(f.name,d,()=>ci(()=>$d({workspaceFolder:r,suiteId:f.id,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include}))):ci(()=>$d({workspaceFolder:r,suiteId:f.id,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include}))}finally{Hu(n)}}async function HC(r,e,t={}){let n=N8(r,e);if(Object.values(ot).includes(n))return J8(r,n,t);let i=vC(n),s=kn(r);try{let a=s.collection.getAllCollections(),l=a.map(y=>y.id),f=y=>{let S=$u(y,l),_=S?a.find(R=>R.id===S):void 0;if(!_)throw Ot(`collection not found for tool: ${e}`);return _};if(i.kind==="request"){let[y,S]=i.tokens;if(!y||!S)throw Ot(`request tool must be request__<collection>__<request>, got: ${e}`);let _=f(y),R=Ti(_).map(q=>q.request.id),I=$u(S,R);if(!I)throw Ot(`request not found in collection "${_.name}" for tool: ${e}`);return ci(()=>iy({workspaceFolder:r,collectionId:_.id,requestId:I,environment:t.environment,variables:t.variables,headers:t.headers,query:t.query,body:t.body,include:t.include}))}if(i.kind==="collection"){let[y]=i.tokens;if(!y)throw Ot(`collection tool must be collection__<collection>, got: ${e}`);let S=f(y);return ci(()=>ps({workspaceFolder:r,collectionId:S.id,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,include:t.include}))}if(i.kind==="folder"){let[y,S]=i.tokens;if(!y||!S)throw Ot(`folder tool must be folder__<collection>__<folder>, got: ${e}`);let _=f(y),R=Dd(_).map(q=>q.folderPath),I=bC(S,R);if(!I)throw Ot(`folder not found in collection "${_.name}" for tool: ${e}`);return ci(()=>ps({workspaceFolder:r,collectionId:_.id,folderPath:I,recursive:t.recursive,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,include:t.include}))}let[d]=i.tokens;if(!d)throw Ot(`suite tool must be suite__<suite>, got: ${e}`);let h=await s.testSuite.getAllSuites(),g=$u(d,h.map(y=>y.id));if(!g)throw Ot(`test suite not found for tool: ${e}`);return ci(()=>$d({workspaceFolder:r,suiteId:g,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include}))}finally{Hu(s)}}function Ma(r,e,t){r.statusCode=e,r.setHeader("content-type","application/json; charset=utf-8"),r.end(JSON.stringify(t))}function k$(r){return new Promise((e,t)=>{let n="";r.on("data",i=>{n+=i,n.length>1024*1024&&t(new Error("Request body too large (max 1MB)"))}),r.on("end",()=>{if(!n){e({});return}try{e(JSON.parse(n))}catch{t(Ot("invalid JSON body"))}}),r.on("error",t)})}function G8(r){return T8(async(e,t)=>{try{if(H8(r,e,t),e.method==="OPTIONS"){t.statusCode=204,t.end();return}if(e.method==="GET"&&e.url==="/health"){Ma(t,200,{status:"ok",port:r.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){B8(r,e,t);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await k$(e)}catch{P$(t,null,-32700,"Parse error");return}try{let i=await U8(r,n);Ma(t,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){P$(t,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await k$(e);if(!n||typeof n.name!="string"||n.name.trim()===""){Ma(t,400,{error:'Field "name" is required'});return}let i=await HC(r.workspaceFolder,n.name,n.args??{});Ma(t,200,{result:i});return}Ma(t,405,{error:"Method not allowed"})}catch(n){Ma(t,500,{error:n.message})}})}async function Y8(r){let e=r.port||3100,t=r.host||"127.0.0.1",n=`${t}:${e}`,i={workspaceFolder:r.workspaceFolder,port:e,host:t,isRunning:!1};return q8.set(n,i),{async start(){if(i.isRunning)return;let s=G8(i);await new Promise((a,l)=>{s.once("error",l),s.listen(i.port,i.host,()=>{s.off("error",l),a()})}),i.server=s,i.isRunning=!0},async stop(){if(!i.server){i.isRunning=!1;return}await new Promise((s,a)=>{i.server.close(l=>{if(l){a(l);return}s()})}),i.server=void 0,i.isRunning=!1},isRunning(){return i.isRunning},getPort(){return i.port},async executeTool(s,a){return HC(i.workspaceFolder,s,a??{})}}}var q8,A8,I$,jC,V8,oy,$$=se(()=>{"use strict";Uu();CC();EC();ny();q8=new Map;A8=3e3,I$=new Map,jC=new Map;V8=3600*1e3,oy=new Map});var Ol=class{constructor(e,t){this.fileSystem=e;this.parserRegistry=t}fileSystem;parserRegistry;directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,t={}){let n=await this.fileSystem.readFile(e);if(t.format){let s=this.parserRegistry.get(t.format);if(!s)throw new Error(`No parser registered for format: ${t.format}`);return s.parse(n,e)}let i=this.parserRegistry.detect(n);if(!i)throw new Error(`Could not detect collection format for: ${e}. Supported formats: ${this.parserRegistry.getFormats().join(", ")}`);return i.parser.parse(n,e)}async loadDirectory(e,t=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(t,e);for(let s of i)try{let a=await this.load(s);n.push(a)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let t=await this.fileSystem.readFile(e);return this.parserRegistry.detect(t)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};nh();Wo();function kb(r,e){return{id:r.id,name:r.name,description:r.description,variables:r.variables||{},auth:r.auth,scripts:r.scripts,items:(r.items||[]).map(_E),source:{format:"folder",filePath:e,version:r.version}}}function _E(r){if(r.type==="folder")return{type:"folder",id:r.id,name:r.name,description:r.description,auth:r.auth,scripts:r.scripts,items:(r.items||[]).map(_E)};let e=r;return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:e.headers||[],query:e.query||[],params:e.params,body:e.body??void 0,auth:e.auth,settings:e.settings,scripts:e.scripts,...e.deprecated&&{deprecated:e.deprecated},...e.doc&&{doc:e.doc},...e.responseSchema&&{responseSchema:e.responseSchema},...e.bodySchema&&{bodySchema:e.bodySchema}}}function zL(r){return{id:r.id,name:r.name,description:r.description,version:r.source?.version,variables:r.variables,auth:r.auth,scripts:r.scripts,items:(r.items||[]).map(Tb)}}function Tb(r){return r.type==="folder"?{type:"folder",id:r.id,name:r.name,description:r.description,auth:r.auth,scripts:r.scripts,items:(r.items||[]).map(Tb)}:{type:"request",id:r.id,name:r.name,description:r.description,method:r.method,url:r.url,headers:r.headers,query:r.query,params:r.params,body:r.body,auth:r.auth,settings:r.settings,scripts:r.scripts,...r.deprecated&&{deprecated:r.deprecated},...r.doc&&{doc:r.doc}}}var Oc=class{store;constructor(e){this.store=new Ds(e)}loadAll(){return this.store.loadAll().map(t=>kb(t,this.store.getCollectionPath(t.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let t=this.store.load(e);if(t)return kb(t,this.store.getCollectionPath(t.id))}async create(e,t){let n=await this.store.create(e,t);return kb(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(zL(e))}async delete(e){return this.store.delete(e)}exists(e){return this.store.exists(e)}getCollectionPath(e){return this.store.getCollectionPath(e)}async updateCollectionMetadata(e,t){return this.store.updateCollectionMetadata(e,t)}async saveItem(e,t,n){return this.store.saveItem(e,Tb(t),n)}async updateItem(e,t,n){let i={...n};return this.store.updateItem(e,t,i)}async deleteItem(e,t){return this.store.deleteItem(e,t)}async moveItem(e,t,n){return this.store.moveItem(e,t,n)}async reorderItems(e,t,n){return this.store.reorderItems(e,t,n)}async saveScripts(e,t,n){return this.store.saveScripts(e,t,n)}loadScripts(e,t){return this.store.loadScripts(e,t)}};var Ic=class{parsers=new Map;register(e,t){this.parsers.set(e.toLowerCase(),t)}get(e){return this.parsers.get(e.toLowerCase())}has(e){return this.parsers.has(e.toLowerCase())}getFormats(){return Array.from(this.parsers.keys())}detect(e){for(let[t,n]of this.parsers)if(n.canParse(e))return{parser:n,format:t};return null}clear(){this.parsers.clear()}};zo();var Pc=class{cookies=new Map;getCookieKey(e,t,n){return`${t||"*"}|${n||"/"}|${e}`}get(e,t){if(t){let s=this.getCookieKey(e,t),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(t&&s.domain){if(this.domainMatches(t,s.domain))return s}else return s}set(e){let t=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(t,e)}setFromResponse(e){for(let t of e){let n=this.getCookieKey(t.name,t.domain,t.path);this.cookies.set(n,t)}}has(e,t){return this.get(e,t)!==void 0}delete(e,t,n){let i=this.getCookieKey(e,t,n);return this.cookies.delete(i)}getAll(e){let t=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&t.push(n):t.push(n));return t}getCookieHeader(e){let t=this.getAll(e);return lt.formatCookieHeader(t)}clear(){this.cookies.clear()}clearDomain(e){let t=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&t.push(n);for(let n of t)this.cookies.delete(n)}parseCookieHeaders(e,t){return lt.parseCookieHeaders(e,t)}isExpired(e){return lt.isExpired(e)}domainMatches(e,t){return lt.domainMatches(e,t)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[t,n]of this.cookies.entries())this.isExpired(n)&&e.push(t);for(let t of e)this.cookies.delete(t)}};oh();var Gi=class r{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,t){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=t}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let t=e||this.selectedEnvironment,n=this.config.environments[t],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let a=this.getEnvironmentVariables(n.inherits);i={...i,...a}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(t);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let t=this.config.environments[e];if(!t)return{};let n={};return t.inherits&&this.config.environments[t.inherits]&&(n={...this.getEnvironmentVariables(t.inherits)}),{...n,...t.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,t){this.sessionGlobals[e]=t}unsetGlobal(e){delete this.sessionGlobals[e]}clearGlobals(){this.sessionGlobals={}}resolve(e){let t=e||this.selectedEnvironment;return{name:t,merged:this.getVariables(t),globals:this.getGlobals()}}static fromVariables(e,t="default"){return new r({environments:{[t]:{name:t,variables:e}},selectedEnvironment:t})}};Il();$c();var Ls=class r{envStore;interpolator;urlBuilder;constructor(e,t){this.envStore=e,this.interpolator=t||new Zo,this.urlBuilder=new Wn}get(e){return this.envStore.get(e)}set(e,t){this.envStore.set(e,t)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}getGlobals(){let e=this.envStore;return typeof e.getGlobals=="function"?e.getGlobals():{}}setGlobal(e,t){let n=this.envStore;typeof n.setGlobal=="function"&&n.setGlobal(e,t)}unsetGlobal(e){let t=this.envStore;typeof t.unsetGlobal=="function"&&t.unsetGlobal(e)}clearGlobals(){let e=this.envStore;typeof e.clearGlobals=="function"&&e.clearGlobals()}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,t={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,t)}buildUrl(e,t={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,t.params||{},t.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let t=Gi.fromVariables(e);return new r(t)}static fromResolver(e){return new r(e)}};$c();Dc();Fc();Il();bf();yf();var Yl=class{constructor(e,t,n,i,s){this.httpClient=e;this.forgeEnv=t;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let a=s?.forgeRoot?[it("path").join(s.forgeRoot,"modules")]:[],l=new Ki(new Wn,new Qi,e);this.scriptExecutor=new rs(l,a,void 0,s?.scriptScope??"shared",s?.scriptTimeout??5e3)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,t,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},a={...this.forgeEnv.getGlobals()},l={...n.additionalVariables||{}},f={...s},d=this.buildHttpRequest(e,n.overrides),h=this.findFolderPath(t,e.id),g=this.buildScriptChain(e,t,h),y={request:{url:d.url,method:d.method,headers:{...d.headers},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:void 0},variables:l,collectionVariables:t.variables||{},globals:{...a},environmentVariables:f,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:t?.name},onEnvironmentChange:n.onEnvironmentChange,onGlobalsChange:(I,q,U)=>{I==="set"&&q&&U!==void 0?this.forgeEnv.setGlobal(q,U):I==="unset"&&q?this.forgeEnv.unsetGlobal(q):I==="clear"&&this.forgeEnv.clearGlobals()}},S=this.scriptExecutor.createRequestSession(y),_,R;try{if(!n.skipPreRequest&&g.preRequest.length>0){let B=await S.executePreRequest(g.preRequest);if(_={success:B.success,error:B.error,modifiedVariables:B.modifiedVariables,modifiedEnvironment:B.modifiedEnvironmentVariables,modifiedGlobals:B.modifiedGlobals,modifiedCollectionVariables:B.modifiedCollectionVariables,consoleOutput:B.consoleOutput,modifiedRequest:B.modifiedRequest?{url:B.modifiedRequest.url,method:B.modifiedRequest.method,headers:B.modifiedRequest.headers,body:B.modifiedRequest.body?.content}:void 0},B.modifiedVariables&&(l={...l,...B.localVariables??B.modifiedVariables}),B.modifiedEnvironmentVariables&&(f={...f,...B.modifiedEnvironmentVariables}),B.modifiedRequest){let V=B.modifiedRequest;V.url&&(d.url=V.url),V.method&&(d.method=V.method),V.headers&&(d.headers={...d.headers,...V.headers}),V.body!==void 0&&(d.body=V.body?.content||V.body)}if(!B.success)throw new Error(`Pre-request script failed: ${B.error}`)}let I={...f,...l};d=this.interpolateRequest(d,I);let q=n.overrides?.body||e.body;if(this.preprocessor&&q&&typeof q!="string"&&q.type==="graphql"&&d.body!==void 0){let B=this.preprocessor.encodeBody({type:"graphql",content:d.body});B!=null&&(d.body=typeof B=="string"?B:JSON.stringify(B))}let U=await this.httpClient.send(d);if(!n.skipPostResponse&&g.postResponse.length>0){let B=await S.executePostResponse(g.postResponse,{status:U.status,statusText:U.statusText,headers:U.headers,body:U.body,cookies:Zh(U.headers,U.cookies,d.url),responseTime:U.time,responseSize:U.size,executedRequest:{url:d.url,method:d.method,headers:d.headers||{},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:{type:"none",content:""},params:{},query:{}}});R={success:!0,assertions:B.testResults,consoleOutput:B.consoleOutput,modifiedEnvironment:B.modifiedEnvironmentVariables},B.modifiedEnvironmentVariables&&(f={...f,...B.modifiedEnvironmentVariables})}return{response:U,preRequestResult:_,postResponseResult:R,totalTime:Date.now()-i,finalRequest:d,variables:{environment:f,local:l}}}finally{S.dispose?.()}}async executeSimple(e,t={}){let n=e,i={...this.forgeEnv.getAll(),...t.variables||{}};return n=this.interpolateRequest(e,i),t.timeout&&(n={...n,timeout:t.timeout}),this.httpClient.send(n)}buildHttpRequest(e,t){let n=e.url;if(e.query&&e.query.length>0){let h=new URLSearchParams;for(let g of e.query)g.enabled!==!1&&h.append(g.key,g.value);n+=(n.includes("?")?"&":"?")+h.toString()}let i=t?.url||n,s=t?.method||e.method,a={};if(e.headers&&Array.isArray(e.headers))for(let h of e.headers)h.enabled!==!1&&(a[h.key]=h.value);let l={...a,...t?.headers||{}},f,d=t?.body||e.body;if(d)if(typeof d=="string")f=d;else if(this.preprocessor&&d.type)if(d.type==="graphql")f=typeof d.content=="string"?d.content:JSON.stringify(d.content);else{let h=this.preprocessor.encodeBody(d);f=h!=null?String(h):void 0}else d.content&&(f=typeof d.content=="string"?d.content:JSON.stringify(d.content));return this.preprocessor&&d&&this.preprocessor.setContentTypeHeader(l,d),{url:i,method:s,headers:l,body:f,timeout:t?.timeout||e.settings?.timeout,settings:{...e.settings,...t?.settings}}}interpolateRequest(e,t){let n=Ls.create(t);return{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:e.body?n.resolve(typeof e.body=="string"?e.body:JSON.stringify(e.body)):void 0}}buildScriptChain(e,t,n=[]){let i=[],s=[];t.scripts?.preRequest&&i.push(t.scripts.preRequest),t.scripts?.postResponse&&s.push(t.scripts.postResponse);for(let a of n)a.scripts?.preRequest&&i.push(a.scripts.preRequest),a.scripts?.postResponse&&s.push(a.scripts.postResponse);return e.scripts?.preRequest&&i.push(e.scripts.preRequest),e.scripts?.postResponse&&s.push(e.scripts.postResponse),{preRequest:i,postResponse:s}}findFolderPath(e,t){let n=[],i=(s,a)=>{for(let l of s){if(l.type==="request"&&l.id===t)return n.push(...a),!0;if(l.type==="folder"){let f=[...a,l];if(i(l.items,f))return!0}}return!1};return i(e.items,[]),n}};function vW(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}var Sf=class{entries=new Map;requestIndex=new Map;fullResponses=new Map;maxEntriesPerRequest;storeFullResponses;constructor(e={}){this.maxEntriesPerRequest=e.maxEntriesPerRequest??100,this.storeFullResponses=e.storeFullResponses??!0}getEntries(e,t){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let a=this.entries.get(s);a&&(!t||a.environment===t)&&i.push(a)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,t,n,i,s){let a=vW(),l=Date.now(),f={id:a,timestamp:l,environment:i,method:t.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:t.url,method:t.method,headers:{...t.headers},body:t.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(a,f);let d=this.requestIndex.get(e)||[];for(d.unshift(a);d.length>this.maxEntriesPerRequest;){let h=d.pop();h&&(this.entries.delete(h),this.fullResponses.delete(h))}if(this.requestIndex.set(e,d),this.storeFullResponses){let h={timestamp:l,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(a,h)}return f}deleteEntry(e){if(!this.entries.get(e))return!1;this.entries.delete(e),this.fullResponses.delete(e);for(let[n,i]of this.requestIndex.entries()){let s=i.indexOf(e);if(s!==-1){i.splice(s,1),i.length===0&&this.requestIndex.delete(n);break}}return!0}clearHistory(e){let t=this.requestIndex.get(e);if(t){for(let n of t)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var wf=class{async send(e){let t=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let a={method:e.method,headers:e.headers,signal:n.signal};e.body!==void 0&&!["GET","HEAD"].includes(e.method.toUpperCase())&&(typeof e.body=="string"||e.body instanceof FormData||e.body instanceof URLSearchParams?a.body=e.body:typeof e.body=="object"&&(a.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(a.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(a.redirect="manual");let l=await fetch(e.url,a),f=Date.now(),d;try{d=await l.text()}catch{d=null}let h={};return l.headers.forEach((g,y)=>{let S=h[y];S!==void 0?h[y]=Array.isArray(S)?[...S,g]:[S,g]:h[y]=g}),{status:l.status,statusText:l.statusText,headers:h,cookies:[],body:d,time:f-t}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};Dc();Fc();Nc();Xh();Il();var pa=class{format="http-forge";canParse(e){try{let t=JSON.parse(e);return typeof t=="object"&&t!==null&&"id"in t&&"name"in t&&"items"in t&&Array.isArray(t.items)&&!t.info?.schema?.includes("postman")&&!t._type}catch{return!1}}parse(e,t){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:t,version:n.version}}}convertItems(e){return e.map(t=>t.type==="folder"?this.convertFolder(t):this.convertRequest(t))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let t={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(t[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(t).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};em();import*as sn from"fs/promises";import*as Kl from"path";var _f=class{async readFile(e){return sn.readFile(e,"utf-8")}async writeFile(e,t){let n=Kl.dirname(e);await this.mkdir(n),await sn.writeFile(e,t,"utf-8")}async exists(e){try{return await sn.access(e),!0}catch{return!1}}async mkdir(e){await sn.mkdir(e,{recursive:!0})}async glob(e,t){let n=t||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=Kl.basename(s);for(let l of e)if(this.matchPattern(a,l)){i.push(s);break}})}catch{}return i}async readDir(e){return sn.readdir(e)}async isDirectory(e){try{return(await sn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,t){let n=await sn.readdir(e,{withFileTypes:!0});for(let i of n){let s=Kl.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,t):i.isFile()&&t(s)}}matchPattern(e,t){let n=t.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};bf();var $0=class r{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new Zo,this.fileSystem=e.fileSystem||new _f,this.preprocessor=e.preprocessor||new da,this.dataFileParser=e.dataFileParser||new ha,this.cookieJar=e.cookieJar||new Pc,e.enableHistory?this.requestHistory=e.requestHistory||new Sf({maxEntriesPerRequest:e.maxHistoryEntries??100}):this.requestHistory=null,this.interceptorChain=e.interceptorChain||this.createInterceptorChain(e),e.httpClient)this.httpClient=e.httpClient;else if(e.useNativeHttp!==!1){let s={...e.httpSettings,timeout:e.requestTimeout??e.httpSettings?.timeout};this.httpClient=new Xo(s)}else this.httpClient=new wf;let t=e.forgeRoot?[it("path").join(e.forgeRoot,"modules")]:[],n=new Ki(new Wn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new rs(n,t,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new Ic,this.parserRegistry.register("http-forge",new pa),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=it("path").join(e.forgeRoot,"collections");this.collectionLoader=new Oc(s)}else this.collectionLoader=new Ol(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new Gi(e.environmentConfig):Gi.fromVariables({}),this.forgeEnv=Ls.fromResolver(this.environmentStore),this.requestExecutor=new Yl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let t=new Qi;if(e.requestInterceptors)for(let n of e.requestInterceptors)t.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)t.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)t.addErrorInterceptor(n);return t}async loadCollection(e){if(this.collectionLoader instanceof Ol)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,t,n){return this.requestExecutor.execute(e,t,n)}async executeSimple(e,t){return this.requestExecutor.executeSimple(e,t)}registerParser(e,t){this.parserRegistry.register(e,t)}setEnvironmentConfig(e){this.environmentStore=new Gi(e),this.forgeEnv=Ls.fromResolver(this.environmentStore),this.requestExecutor=new Yl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new r(e)}static fromForgeRoot(e="./http-forge",t={}){let n=it("path"),i=n.join(e,"environments"),s,a=kc(i);if(Object.keys(a.environments).length>0||Object.keys(a.globalVariables).length>0){s={globalVariables:{...a.globalVariables,...a.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,d]of Object.entries(a.environments)){let h=a.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...d.variables,...h}}}}else{let f=it("fs"),d=n.join(i,"environments.json");if(f.existsSync(d))try{let h=f.readFileSync(d,"utf-8"),g=JSON.parse(h);if(s={globalVariables:g.globalVariables||{},environments:{},selectedEnvironment:g.selectedEnvironment},g.environments)for(let[y,S]of Object.entries(g.environments)){let _=S;s.environments[y]={name:_.name||y,variables:_.variables||{}}}}catch(h){console.warn(`[ForgeContainer] Failed to load environments from ${d}:`,h)}}return new r({...t,forgeRoot:e,storageFormat:t.storageFormat??"folder",environmentConfig:s})}};dC();pC();Vg();CC();EC();async function K8(r){let{createMcpRuntime:e}=await Promise.resolve().then(()=>($$(),A$));return e(r)}async function Q8(r){let{runRequest:e}=await Promise.resolve().then(()=>(Uu(),Md));return e(r)}async function Z8(r){let{runCollection:e}=await Promise.resolve().then(()=>(Uu(),Md));return e(r)}async function X8(r){let{runFolder:e}=await Promise.resolve().then(()=>(Uu(),Md));return e(r)}async function e5(r){let{runSuite:e}=await Promise.resolve().then(()=>(Uu(),Md));return e(r)}ny();B0();zo();OC();V0();Dc();Fc();Mb();Nc();Xh();Il();E0();T0();bf();Kh();yf();$f();F0();j0();nh();Wo();Wo();D0();DC();z0();oh();$c();im();J0();tw();M0();function t5(r,e,t){let n=r.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=c5(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(f5(a))return{contextType:"variable_def",fieldPath:[],prefix:s};let l=a.match(/\.\.\.\s+on\s+(\w*)$/);if(l)return{contextType:"fragment_type",fieldPath:[],prefix:l[1]||""};let f=a.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&M$(a)){let g=BC(a,t),y=g.length>0?g[g.length-1]:void 0,S=N$(a);return{contextType:"argument_value",fieldPath:g,parentType:y,prefix:f[2]||"",currentArg:f[1],currentField:S||void 0}}if(M$(a)){let g=BC(a,t),y=g.length>0?g[g.length-1]:void 0,S=N$(a);return{contextType:"argument",fieldPath:g,parentType:y,prefix:s,currentField:S||void 0}}if(VC(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let h=BC(a,t);return{contextType:"selection_set",fieldPath:h,parentType:h.length>0?h[h.length-1]:void 0,prefix:s}}function r5(r,e){switch(e.contextType){case"root":return n5(r,e.prefix);case"selection_set":return i5(r,e);case"argument":return s5(r,e);case"argument_value":return o5(r,e);case"directive":return a5(r,e.prefix);case"fragment_type":return l5(r,e.prefix);case"variable_def":return u5(r,e.prefix);default:return[]}}function n5(r,e){let t=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
|
|
806
|
+
Disambiguate by passing the id or slug.`);this.kind=t;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var $d={};Ns($d,{runCollection:()=>ps,runFolder:()=>k8,runRequest:()=>ny,runSuite:()=>Ad});function FC(r){let e=[r.testSuite,r.collection,r.environmentConfig,r.config,r.console];for(let t of e)try{t?.dispose?.()}catch{}}function m$(r){return r==="1"||r==="true"||r==="yes"||r==="on"}function x8(){return m$(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function E8(){let r=process.env.HTTP_FORGE_MAX_REQUESTS;if(!r||r.trim()==="")return 50;let e=Number(r);if(!Number.isFinite(e)||e<=0)throw new Error("HTTP_FORGE_MAX_REQUESTS must be a positive number when provided");return Math.floor(e)}function g$(r){return m$(process.env.HTTP_FORGE_GENERATE_REPORTS)?!0:r.includes("report")}function y$(r){if(typeof r!="string")return r;try{return JSON.parse(r)}catch{return r}}function O8(r){return r?Object.fromEntries(Object.entries(r).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function v$(r){return ns(O8(r))}function b$(r){return K0((r??[]).map(e=>({name:e.name,value:e.value})))}function h$(r){return r.replace(/[^a-zA-Z0-9_-]/g,"_")}function S$(r){let e=["none","inherit","basic","bearer","apikey","oauth2"],t=r.auth?.type&&e.includes(r.auth.type)?r.auth.type:void 0;return{id:r.id,name:r.name,method:r.method,url:r.url,headers:Array.isArray(r.headers)?r.headers.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):r.headers,query:Array.isArray(r.query)?r.query.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):r.query,params:r.params?Object.entries(r.params).reduce((n,[i,s])=>(n[i]=typeof s=="string"?s:s.value??"",n),{}):void 0,body:r.body??null,scripts:r.scripts,settings:r.settings,auth:{type:t==="inherit"?"none":t,bearerToken:r.auth?.bearerToken,basicAuth:r.auth?.basicAuth,apikey:r.auth?.apikey,oauth2:r.auth?.oauth2}}}function w$(r,e){let t={...r};return e.headers&&(t.headers={...r.headers??{},...e.headers}),e.query&&(t.query=e.query),e.body!==void 0&&(t.body={type:"raw",raw:e.body,contentType:"application/json"}),t}function _$(r){return r?Object.fromEntries(Object.entries(r).map(([e,t])=>[e,String(t)])):{}}function LC(r,e,t=r.items,n=[]){for(let i of t){if(i.type==="request"&&i.id===e)return{request:i,folderScriptsChain:[...n]};if(i.type==="folder"){let s=i,a=s.scripts?[...n,s.scripts]:[...n],l=LC(r,e,s.items??[],a);if(l)return l}}}function R$(r,e=r.items,t=[],n=[]){let i=[];for(let s of e)if(s.type==="request")i.push({request:s,folderScriptsChain:[...t],folderPath:n.join("/")});else{let a=s,l=a.scripts?[...t,a.scripts]:[...t],f=[...n,a.name];i.push(...R$(r,a.items??[],l,f))}return i}function I8(r,e,t=!0){if(!e)return r;let n=e.replace(/\/+$/,"");return r.filter(({folderPath:i})=>t?i===n||i.startsWith(`${n}/`):i===n)}function P8(r){return r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function C$(r,e){if(e.collectionId){let t=r.getCollection(e.collectionId);if(!t)throw new Error(`Collection "${e.collectionId}" not found`);return t}if(e.collectionRef){let{collection:t,tier:n}=$C(r.getAllCollections(),e.collectionRef);return e.onResolve?.({kind:"collection",value:e.collectionRef,tier:n,id:t.id}),t}throw new Error("A collection reference is required (collectionId or collectionRef)")}function x$(r,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:t}=MC(r,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:t,path:t}),t}}async function E$(r,e,t,n){let i=t.environment??r.environmentConfig.getSelectedEnvironment(),s=t.iterations??e.config?.iterations??1,a=t.stopOnError??e.config?.stopOnError??!1,l=t.delay??e.config?.delayBetweenRequests??0,f=t.requestFilter,d=t.include??[],h=_$(t.variables),g=x8(),y=g$(d),S=e.requests.filter(C=>!(C.enabled===!1||f&&!f.some(k=>C.name.toLowerCase().includes(k.toLowerCase()))));if(g){let C=E8(),k=S.length*s;if(k>C)throw new Error(`Suite "${e.name}" would execute ${k} request calls (${S.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${C}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let _=new Lu(r.config);await _.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:a});let R=[],I=[],q=0,j=0,B=new AbortController,V=new Mu;for(let C=1;C<=s;C++){for(let k of S){let N=r.collection.getCollection(k.collectionId);if(!N)continue;let U=LC(N,k.requestId);if(!U)continue;let $=new Gs(r.httpRequest,r.scriptExecutor,r.environmentConfig,r.requestPreparer,i,V,N.scripts,U.folderScriptsChain,void 0,N.name,C,s),G=w$(S$(U.request),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),K=await $.execute(G,h,B.signal);if(K.folderPath=k.folderPath??"",K.collectionName=N.name,await _.saveResult(C,K),K.passed?q++:j++,d.includes("perRequest")&&R.push({name:k.name,iteration:C,status:K.response?.status,ok:(K.response?.status??0)>=200&&(K.response?.status??0)<300,duration:`${K.duration}ms`,allPassed:K.passed,...d.includes("consoleOutput")&&K.consoleOutput?.length?{consoleOutput:K.consoleOutput}:{}}),!K.passed&&(I.push({name:k.name,iteration:C,status:K.response?.status,duration:`${K.duration}ms`,body:y$(K.response?.body),headers:v$(K.response?.headers),cookies:b$(K.response?.cookies),failedTests:K.assertions?.filter(ne=>!ne.passed).map(ne=>({name:ne.name,...ne.message?{message:ne.message}:{}})),...K.error?{error:K.error}:{},...d.includes("consoleOutput")&&K.consoleOutput?.length?{consoleOutput:K.consoleOutput}:{}}),a)){B.abort();break}l>0&&!B.signal.aborted&&await new Promise(ne=>setTimeout(ne,l))}if(B.signal.aborted)break}let W=await _.finalizeRun("completed",y),T={[n==="collection"?"collection":"suite"]:e.name,environment:i,summary:{total:q+j,passed:q,failed:j,...s>1?{iterations:s}:{},allPassed:j===0}};return(j>0||d.includes("failedOnly"))&&(T.failedRequests=I),d.includes("perRequest")&&(T.results=R),W!==null&&(T.report={uri:`file://${W}`,hint:"Click the URI to open the HTML report in your browser"}),T}async function ny(r){let e=ki(r.workspaceFolder),t=r.include??[],n=g$(t);try{let i=e.collection,s=C$(i,r),a=x$(s,r),l=r.requestId;if(!l){if(!r.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let I=NC(s,r.requestRef,a);l=I.request.id,r.onResolve?.({kind:"request",value:r.requestRef,tier:I.tier,id:l,path:I.folderPath?`${I.folderPath}/${I.request.name}`:I.request.name})}let f=LC(s,l);if(!f)throw new Error(`Request "${l}" not found in collection "${s.name}"`);let d=r.environment||e.environmentConfig.getSelectedEnvironment(),h=w$(S$(f.request),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),y=await new Gs(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,d,new Mu,s.scripts,f.folderScriptsChain).execute(h,_$(r.variables)),S=null;if(n){let I=new Lu(e.config),q=`request-${h$(s.id)}-${h$(l)}`,j=`Request: ${f.request.name}`;await I.initializeRun(q,j,d,{iterations:1,delayBetweenRequests:0,stopOnError:!0}),await I.saveResult(1,y),S=await I.finalizeRun("completed")}let _=v$(y.response?.headers),R=b$(y.response?.cookies);return{request:f.request.name,status:y.response?.status||0,ok:(y.response?.status??0)>=200&&(y.response?.status??0)<300,duration:`${y.duration}ms`,body:y$(y.response?.body),allPassed:y.passed,assertions:y.assertions?.map(I=>({name:I.name,passed:I.passed,message:I.message})),...t.includes("headers")?{headers:_}:{},...t.includes("cookies")?{cookies:R}:{},...t.includes("tests")?{tests:y.assertions?.map(I=>({name:I.name,passed:I.passed,...I.message?{message:I.message}:{}}))}:{},...Object.keys(y.modifiedVariables??{}).length?{modifiedVariables:y.modifiedVariables}:{},...t.includes("consoleOutput")&&y.consoleOutput?.length?{consoleOutput:y.consoleOutput}:{},...S!==null?{report:{uri:`file://${S}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...y.error?{error:y.error}:{}}}catch(i){throw i}finally{FC(e)}}async function ps(r){let e=ki(r.workspaceFolder);try{let t=e.collection,n=C$(t,r),i=x$(n,r),s=R$(n),a=I8(s,i,r.recursive);if(a.length===0&&i)throw new Error(`No requests found under folder "${i}" in collection "${n.name}"`);let l=a.map(({request:d,folderPath:h})=>({id:d.id,slug:d.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:d.id,name:d.name,method:d.method,collectionName:n.name,folderPath:h,enabled:!0})),f={id:i?`temp-${n.id}-${P8(i)}`:`temp-${n.id}`,name:i?`${n.name} / ${i}`:n.name,requests:l,config:{iterations:1,delay:0,stopOnError:r.stopOnError??!1,readFromSharedSession:!1,writeToSharedSession:!1},isTemporary:!0,createdAt:Date.now(),updatedAt:Date.now()};return E$(e,f,{environment:r.environment,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:void 0,include:r.include,variables:r.variables},"collection")}catch(t){throw t}finally{FC(e)}}async function k8(r){return ps({recursive:!0,...r})}async function Ad(r){let e=ki(r.workspaceFolder);try{let n=await e.testSuite.getSuite(r.suiteId);if(!n)throw new Error(`Test suite "${r.suiteId}" not found`);return E$(e,n,{environment:r.environment,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include,variables:r.variables},"suite")}catch(t){throw t}finally{FC(e)}}var Uu=se(()=>{"use strict";OC();nm();Af();qC();ry();DC()});var A$={};Ns(A$,{createMcpRuntime:()=>Y8});import*as T$ from"fs";import{createServer as T8}from"http";import*as Md from"path";async function ui(r){let e=process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS,t=process.env.HTTP_FORGE_GENERATE_REPORTS;process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS="true",process.env.HTTP_FORGE_GENERATE_REPORTS="true";try{return await r()}finally{e===void 0?delete process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS:process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS=e,t===void 0?delete process.env.HTTP_FORGE_GENERATE_REPORTS:process.env.HTTP_FORGE_GENERATE_REPORTS=t}}function Ti(r,e=r.items,t=""){let n=[];for(let i of e)if(i.type==="request")n.push({request:i,folderPath:t});else{let s=i,a=t?`${t} / ${s.name}`:s.name;n.push(...Ti(r,s.items??[],a))}return n}function Nd(r,e=r.items,t=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,a=t?`${t}/${s.name}`:s.name;n.push({folderPath:a,requestCount:q$(s.items??[])}),n.push(...Nd(r,s.items??[],a))}return n}function q$(r){let e=0;for(let t of r)t.type==="request"?e++:e+=q$(t.items??[]);return e}function oy(r){let e=[r.testSuite,r.collection,r.environmentConfig,r.config,r.console];for(let t of e)try{t?.dispose?.()}catch{}}function O$(r){let e=new Set,t=[];for(let n of r)e.has(n.name)||(e.add(n.name),t.push(n));return t}async function $8(r,e){let t=I$.get(r);if(t&&t.expiresAt>Date.now())return t.tools;let n=jC.get(r);if(n)return n;let i=M8(r,e).then(s=>(I$.set(r,{tools:s,expiresAt:Date.now()+A8}),s)).finally(()=>{jC.delete(r)});return jC.set(r,i),i}async function M8(r,e){let t=e.config.getMcpConfig(),n=t.toolPrefix??"",i=t.toolMode??"auto",s=t.drilldownThreshold??100,a=S=>{let _=t.excludedCollections;return!!_?.length&&(_.includes(S.id)||_.includes(S.name))},l=S=>{let _=t.excludedSuites;return!!_?.length&&(_.includes(S.id)||_.includes(S.name))},f=e.collection.getAllCollections().filter(S=>!a(S)),d=(await e.testSuite.getAllSuites()).filter(S=>!l(S)),h=0;for(let S of f)h+=Ti(S).length;let g=i==="drilldown"||i==="auto"&&h>s;if(i==="flat"&&h>500&&console.warn(`[http-forge MCP] WARNING: toolMode is "flat" but ${h} requests would produce ${h}+ tools. This will likely degrade AI tool-selection quality and bloat the context window. Consider setting toolMode to "auto" or "drilldown" in http-forge.config.json.`),g){let S=xC(n,f.map(_=>_.name),d.map(_=>_.name)).map(_=>({name:_.name,description:_.description,inputSchema:_.inputSchema}));return O$(S)}let y=[];for(let S of f){let _=Ti(S);for(let{request:R,folderPath:I}of _)y.push({name:hC(n,S.id,R.id),description:SC(R.method,R.name,S.name,I),inputSchema:zg});y.push({name:mC(n,S.id),description:wC(S.name,_.length),inputSchema:Jg});for(let{folderPath:R,requestCount:I}of Nd(S))I!==0&&y.push({name:gC(n,S.id,R),description:_C(R,S.name,I),inputSchema:Gg})}for(let S of d)y.push({name:yC(n,S.id),description:RC(S.name,S.requests.length,S.config.iterations),inputSchema:Yg});return O$(y)}function N8(r,e){let t=r.config.getMcpConfig().toolPrefix??"";return t&&e.startsWith(t)?e.slice(t.length):e}function D8(r,e,t){return r.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${t}/report?path=${encodeURIComponent(i)}"`)}function P$(r,e,t,n){Ma(r,200,{jsonrpc:"2.0",id:e,error:{code:t,message:n}})}function F8(r){return Buffer.from(String(r)).toString("base64url")}function L8(r){if(!r)return 0;try{let e=parseInt(Buffer.from(r,"base64url").toString(),10);return Number.isFinite(e)&&e>=0?e:0}catch{return 0}}function j8(r){return r.config.getMcpConfig().toolPageSize??150}async function U8(r,e){switch(e.method){case"initialize":return{protocolVersion:"2024-11-05",capabilities:{tools:{}},serverInfo:{name:"http-forge",version:"1.0.0"}};case"tools/list":{let t=await $8(r.workspaceFolder,r.container),n=e.params??{},i=typeof n.cursor=="string"?n.cursor:void 0,s=j8(r.container);if(s<=0||t.length<=s)return{tools:t};let a=L8(i),l=t.slice(a,a+s),f=a+s,d={tools:l};return f<t.length&&(d.nextCursor=F8(f)),d}case"tools/call":{let t=e.params??{},n=t.name,i=t.arguments;if(!n)throw new Error("Missing tool name");let s=await HC(r,n,i??{}),a=JSON.stringify(s,null,2);return{content:[{type:"text",text:D8(a,r.host,r.port)}]}}default:throw new Error(`Method not found: ${e.method}`)}}function H8(r,e,t){let n=!r.container,i=r.container??ki(r.workspaceFolder),s;try{s=i.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{n&&oy(i)}let a=e.headers.origin??"",l=s.includes(a)?a:s[0]??"http://localhost";t.setHeader("Access-Control-Allow-Origin",l),t.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),t.setHeader("Access-Control-Allow-Headers","Content-Type, Mcp-Session-Id")}function B8(r,e,t){let i=new URL(e.url,`http://${r.host}:${r.port}`).searchParams.get("path");if(!i){t.statusCode=400,t.end("Missing path parameter");return}let s=Md.resolve(i),a=Md.resolve(r.workspaceFolder,".http-forge-cache");if(!s.startsWith(a+Md.sep)||!s.endsWith(".html")){t.statusCode=403,t.end("Forbidden");return}T$.readFile(s,"utf-8",(l,f)=>{if(l){t.statusCode=404,t.end("Report not found");return}t.statusCode=200,t.setHeader("content-type","text/html; charset=utf-8"),t.end(f)})}function W8(){let r=Date.now()-V8;for(let[e,t]of sy)t.startedAt<r&&sy.delete(e)}function z8(){return`run_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function iy(r){if(typeof r!="string"||!r)throw Ot('"runId" is required');let e=sy.get(r);if(!e)throw new Error(`Run "${r}" not found. It may have expired (1-hour TTL) or never existed.`);return e}function UC(r,e,t){W8();let n=z8(),i={id:n,status:"running",suiteName:r,startedAt:Date.now(),progress:{completed:0,total:e},summary:{passed:0,failed:0,total:0,allPassed:!1},failedRequests:[],allResults:[],reportPath:null};return sy.set(n,i),t().then(s=>{i.status="completed",i.completedAt=Date.now(),i.summary=s?.summary??i.summary,s?.failedRequests&&(i.failedRequests=s.failedRequests),i.reportPath=s?.report?.uri?.replace("file://","")??null,i.progress.completed=i.progress.total}).catch(s=>{i.status="failed",i.completedAt=Date.now(),i.error=s.message}),{runId:n,status:"running",total:e,message:"Run started. Use get_run_status to poll."}}function Ot(r){return new Error(`Bad request: ${r}`)}async function J8(r,e,t){let n=ki(r);try{let i=n.collection.getAllCollections(),s=h=>{if(typeof h!="string"||!h.trim())throw Ot('the "collection" argument is required');let g=h.toLowerCase(),y=i.find(S=>S.id===h||S.name===h)??i.find(S=>S.name.toLowerCase()===g)??i.find(S=>S.name.toLowerCase().includes(g))??i.find(S=>S.id.toLowerCase().includes(g));if(!y){let S=i.map(_=>`"${_.name}"`).join(", ");throw Ot(`collection not found: "${h}". Available collections: ${S||"(none)"}. Call list_collections to see all.`)}return y};if(e===ot.listCollections)return{collections:i.map(h=>({name:h.name,id:h.id,description:h.description??"",requestCount:Ti(h).length}))};if(e===ot.listFolders){let h=s(t.collection);return{collection:h.name,folders:Nd(h).map(({folderPath:g,requestCount:y})=>({path:g,requestCount:y}))}}if(e===ot.listRequests){let h=s(t.collection),g=typeof t.folder=="string"?t.folder.toLowerCase():void 0,y=typeof t.offset=="number"?Math.max(0,t.offset):0,S=typeof t.limit=="number"?Math.min(200,Math.max(1,t.limit)):50,_=Ti(h).filter(({folderPath:R})=>!g||R.toLowerCase().includes(g)).map(({request:R,folderPath:I})=>({id:R.id,name:R.name,method:R.method,folder:I,description:R.description??""}));return{collection:h.name,total:_.length,offset:y,limit:S,requests:_.slice(y,y+S)}}if(e===ot.searchRequests){let h=s(t.collection),g=typeof t.query=="string"?t.query.toLowerCase().trim():"";if(!g)throw Ot('the "query" argument is required');let y=Ti(h).filter(({request:S,folderPath:_})=>S.name.toLowerCase().includes(g)||(S.url??"").toLowerCase().includes(g)||S.method.toLowerCase().includes(g)||_.toLowerCase().includes(g)||(S.description??"").toLowerCase().includes(g)).map(({request:S,folderPath:_})=>({id:S.id,name:S.name,method:S.method,url:S.url??"",folder:_,description:S.description??""}));return{collection:h.name,query:t.query,total:y.length,requests:y}}if(e===ot.getEnvironment){let h=typeof t.environment=="string"&&t.environment.trim()?t.environment.trim():n.environmentConfig.getSelectedEnvironment(),g=n.environmentConfig.getResolvedEnvironment(h);if(!g)throw Ot(`environment "${h}" not found`);return{name:g.name,variables:g.variables}}if(e===ot.setVariable){let h=typeof t.key=="string"?t.key.trim():"",g=typeof t.value=="string"?t.value:String(t.value??"");if(!h)throw Ot('"key" is required');let y=typeof t.environment=="string"&&t.environment.trim()?t.environment.trim():n.environmentConfig.getSelectedEnvironment();return n.environmentConfig.setEnvironmentVariable(h,g,y),{set:!0,key:h,environment:y}}if(e===ot.getRunStatus){let h=iy(t.runId);return{runId:h.id,status:h.status,suiteName:h.suiteName,progress:h.progress,...h.error?{error:h.error}:{}}}if(e===ot.getRunSummary){let h=iy(t.runId);return h.status==="running"?{runId:h.id,status:"running",progress:h.progress}:{runId:h.id,status:h.status,suiteName:h.suiteName,summary:h.summary,...h.reportPath?{report:{uri:`file://${h.reportPath}`}}:{}}}if(e===ot.getFailedRequests){let h=iy(t.runId);if(h.status==="running")return{runId:h.id,status:"running",progress:h.progress,failedSoFar:h.failedRequests.length};let g=typeof t.offset=="number"?Math.max(0,t.offset):0,y=typeof t.limit=="number"?Math.min(100,Math.max(1,t.limit)):20;return{runId:h.id,status:h.status,totalFailed:h.failedRequests.length,offset:g,limit:y,failedRequests:h.failedRequests.slice(g,g+y)}}if(e===ot.getRequestResult){let h=iy(t.runId),g=t.request;if(typeof g!="string"||!g)throw Ot('"request" is required');let y=typeof t.iteration=="number"?t.iteration:1,S=h.allResults.find(_=>_.iteration===y&&(_.name===g||_.name.toLowerCase()===g.toLowerCase()));if(!S){if(h.status==="running")return{runId:h.id,status:"running",message:`Request "${g}" has not completed yet.`};throw new Error(`Request "${g}" (iteration ${y}) not found in run "${h.id}".`)}return{runId:h.id,...S}}if(e===ot.runRequest){let h=s(t.collection),g=Ti(h),y=typeof t.requestId=="string"?t.requestId.trim():void 0,S=t.request,_;if(y){if(_=g.find(R=>R.request.id===y),!_)throw Ot(`request with id "${y}" not found in collection "${h.name}"`)}else{if(typeof S!="string"||!S.trim())throw Ot('the "request" or "requestId" argument is required');if(_=g.find(R=>R.request.name===S)??g.find(R=>R.request.name.toLowerCase()===S.toLowerCase()),!_)throw Ot(`request "${S}" not found in collection "${h.name}"`)}return ui(()=>ny({workspaceFolder:r,collectionId:h.id,requestId:_.request.id,environment:t.environment,variables:t.variables,headers:t.headers,query:t.query,body:t.body,include:t.include}))}if(e===ot.runFolder){let h=s(t.collection),g=t.folder;if(typeof g!="string"||!g.trim())throw Ot('the "folder" argument is required');let y=Nd(h).map(I=>I.folderPath),S=g.toLowerCase(),_=y.find(I=>I===g)??y.find(I=>I.toLowerCase()===S)??y.find(I=>I.toLowerCase().includes(S))??y.find(I=>I.split("/").some(q=>q.toLowerCase().includes(S)));if(!_){let I=y.map(q=>`"${q}"`).join(", ");throw Ot(`folder "${g}" not found in collection "${h.name}". Available folders: ${I||"(none)"}. Call list_folders to see all.`)}let R=Ti(h).filter(({folderPath:I})=>I===_||I.startsWith(`${_}/`)).length;return t.async===!0?UC(`${h.name} / ${_}`,R,()=>ui(()=>ps({workspaceFolder:r,collectionId:h.id,folderPath:_,recursive:t.recursive,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,include:t.include}))):ui(()=>ps({workspaceFolder:r,collectionId:h.id,folderPath:_,recursive:t.recursive,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,include:t.include}))}if(e===ot.runCollection){let h=s(t.collection),g=Ti(h).length;return t.async===!0?UC(h.name,g,()=>ui(()=>ps({workspaceFolder:r,collectionId:h.id,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,include:t.include}))):ui(()=>ps({workspaceFolder:r,collectionId:h.id,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,include:t.include}))}let a=t.suite;if(typeof a!="string"||!a.trim())throw Ot('the "suite" argument is required');let l=await n.testSuite.getAllSuites(),f=l.find(h=>h.id===a||h.name===a)??l.find(h=>h.name.toLowerCase()===a.toLowerCase());if(!f)throw Ot(`test suite not found: "${a}"`);let d=f.requests.length*(t.iterations??f.config?.iterations??1);return t.async===!0?UC(f.name,d,()=>ui(()=>Ad({workspaceFolder:r,suiteId:f.id,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include}))):ui(()=>Ad({workspaceFolder:r,suiteId:f.id,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include}))}finally{oy(n)}}async function HC(r,e,t={}){let n=r.workspaceFolder,i=N8(r.container,e);if(Object.values(ot).includes(i))return J8(n,i,t);let s=vC(i),a=ki(n);try{let l=a.collection.getAllCollections(),f=l.map(S=>S.id),d=S=>{let _=$u(S,f),R=_?l.find(I=>I.id===_):void 0;if(!R)throw Ot(`collection not found for tool: ${e}`);return R};if(s.kind==="request"){let[S,_]=s.tokens;if(!S||!_)throw Ot(`request tool must be request__<collection>__<request>, got: ${e}`);let R=d(S),I=Ti(R).map(j=>j.request.id),q=$u(_,I);if(!q)throw Ot(`request not found in collection "${R.name}" for tool: ${e}`);return ui(()=>ny({workspaceFolder:n,collectionId:R.id,requestId:q,environment:t.environment,variables:t.variables,headers:t.headers,query:t.query,body:t.body,include:t.include}))}if(s.kind==="collection"){let[S]=s.tokens;if(!S)throw Ot(`collection tool must be collection__<collection>, got: ${e}`);let _=d(S);return ui(()=>ps({workspaceFolder:n,collectionId:_.id,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,include:t.include}))}if(s.kind==="folder"){let[S,_]=s.tokens;if(!S||!_)throw Ot(`folder tool must be folder__<collection>__<folder>, got: ${e}`);let R=d(S),I=Nd(R).map(j=>j.folderPath),q=bC(_,I);if(!q)throw Ot(`folder not found in collection "${R.name}" for tool: ${e}`);return ui(()=>ps({workspaceFolder:n,collectionId:R.id,folderPath:q,recursive:t.recursive,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,include:t.include}))}let[h]=s.tokens;if(!h)throw Ot(`suite tool must be suite__<suite>, got: ${e}`);let g=await a.testSuite.getAllSuites(),y=$u(h,g.map(S=>S.id));if(!y)throw Ot(`test suite not found for tool: ${e}`);return ui(()=>Ad({workspaceFolder:n,suiteId:y,environment:t.environment,variables:t.variables,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include}))}finally{oy(a)}}function Ma(r,e,t){r.statusCode=e,r.setHeader("content-type","application/json; charset=utf-8"),r.end(JSON.stringify(t))}function k$(r){return new Promise((e,t)=>{let n="";r.on("data",i=>{n+=i,n.length>1024*1024&&t(new Error("Request body too large (max 1MB)"))}),r.on("end",()=>{if(!n){e({});return}try{e(JSON.parse(n))}catch{t(Ot("invalid JSON body"))}}),r.on("error",t)})}function G8(r){return T8(async(e,t)=>{try{if(H8(r,e,t),e.method==="OPTIONS"){t.statusCode=204,t.end();return}if(e.method==="GET"&&e.url==="/health"){Ma(t,200,{status:"ok",port:r.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){B8(r,e,t);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await k$(e)}catch{P$(t,null,-32700,"Parse error");return}try{let i=await U8(r,n);Ma(t,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){P$(t,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await k$(e);if(!n||typeof n.name!="string"||n.name.trim()===""){Ma(t,400,{error:'Field "name" is required'});return}let i=await HC(r,n.name,n.args??{});Ma(t,200,{result:i});return}Ma(t,405,{error:"Method not allowed"})}catch(n){Ma(t,500,{error:n.message})}})}async function Y8(r){let e=r.port||3100,t=r.host||"127.0.0.1",n=`${t}:${e}`,i={workspaceFolder:r.workspaceFolder,port:e,host:t,isRunning:!1};return q8.set(n,i),{async start(){if(i.isRunning)return;i.container||(i.container=ki(i.workspaceFolder));let s=G8(i);await new Promise((a,l)=>{s.once("error",l),s.listen(i.port,i.host,()=>{s.off("error",l),a()})}),i.server=s,i.isRunning=!0},async stop(){if(i.container&&(oy(i.container),i.container=void 0),!i.server){i.isRunning=!1;return}await new Promise((s,a)=>{i.server.close(l=>{if(l){a(l);return}s()})}),i.server=void 0,i.isRunning=!1},isRunning(){return i.isRunning},getPort(){return i.port},async executeTool(s,a){return HC(i,s,a??{})}}}var q8,A8,I$,jC,V8,sy,$$=se(()=>{"use strict";Uu();CC();EC();ry();q8=new Map;A8=3e3,I$=new Map,jC=new Map;V8=3600*1e3,sy=new Map});var Ol=class{constructor(e,t){this.fileSystem=e;this.parserRegistry=t}fileSystem;parserRegistry;directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,t={}){let n=await this.fileSystem.readFile(e);if(t.format){let s=this.parserRegistry.get(t.format);if(!s)throw new Error(`No parser registered for format: ${t.format}`);return s.parse(n,e)}let i=this.parserRegistry.detect(n);if(!i)throw new Error(`Could not detect collection format for: ${e}. Supported formats: ${this.parserRegistry.getFormats().join(", ")}`);return i.parser.parse(n,e)}async loadDirectory(e,t=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(t,e);for(let s of i)try{let a=await this.load(s);n.push(a)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let t=await this.fileSystem.readFile(e);return this.parserRegistry.detect(t)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};rh();Wo();function kb(r,e){return{id:r.id,name:r.name,description:r.description,variables:r.variables||{},auth:r.auth,scripts:r.scripts,items:(r.items||[]).map(_E),source:{format:"folder",filePath:e,version:r.version}}}function _E(r){if(r.type==="folder")return{type:"folder",id:r.id,name:r.name,description:r.description,auth:r.auth,scripts:r.scripts,items:(r.items||[]).map(_E)};let e=r;return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:e.headers||[],query:e.query||[],params:e.params,body:e.body??void 0,auth:e.auth,settings:e.settings,scripts:e.scripts,...e.deprecated&&{deprecated:e.deprecated},...e.doc&&{doc:e.doc},...e.responseSchema&&{responseSchema:e.responseSchema},...e.bodySchema&&{bodySchema:e.bodySchema}}}function zL(r){return{id:r.id,name:r.name,description:r.description,version:r.source?.version,variables:r.variables,auth:r.auth,scripts:r.scripts,items:(r.items||[]).map(Tb)}}function Tb(r){return r.type==="folder"?{type:"folder",id:r.id,name:r.name,description:r.description,auth:r.auth,scripts:r.scripts,items:(r.items||[]).map(Tb)}:{type:"request",id:r.id,name:r.name,description:r.description,method:r.method,url:r.url,headers:r.headers,query:r.query,params:r.params,body:r.body,auth:r.auth,settings:r.settings,scripts:r.scripts,...r.deprecated&&{deprecated:r.deprecated},...r.doc&&{doc:r.doc}}}var Ec=class{store;constructor(e){this.store=new Ds(e)}loadAll(){return this.store.loadAll().map(t=>kb(t,this.store.getCollectionPath(t.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let t=this.store.load(e);if(t)return kb(t,this.store.getCollectionPath(t.id))}async create(e,t){let n=await this.store.create(e,t);return kb(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(zL(e))}async delete(e){return this.store.delete(e)}exists(e){return this.store.exists(e)}getCollectionPath(e){return this.store.getCollectionPath(e)}async updateCollectionMetadata(e,t){return this.store.updateCollectionMetadata(e,t)}async saveItem(e,t,n){return this.store.saveItem(e,Tb(t),n)}async updateItem(e,t,n){let i={...n};return this.store.updateItem(e,t,i)}async deleteItem(e,t){return this.store.deleteItem(e,t)}async moveItem(e,t,n){return this.store.moveItem(e,t,n)}async reorderItems(e,t,n){return this.store.reorderItems(e,t,n)}async saveScripts(e,t,n){return this.store.saveScripts(e,t,n)}loadScripts(e,t){return this.store.loadScripts(e,t)}};var Oc=class{parsers=new Map;register(e,t){this.parsers.set(e.toLowerCase(),t)}get(e){return this.parsers.get(e.toLowerCase())}has(e){return this.parsers.has(e.toLowerCase())}getFormats(){return Array.from(this.parsers.keys())}detect(e){for(let[t,n]of this.parsers)if(n.canParse(e))return{parser:n,format:t};return null}clear(){this.parsers.clear()}};zo();var Ic=class{cookies=new Map;getCookieKey(e,t,n){return`${t||"*"}|${n||"/"}|${e}`}get(e,t){if(t){let s=this.getCookieKey(e,t),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(t&&s.domain){if(this.domainMatches(t,s.domain))return s}else return s}set(e){let t=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(t,e)}setFromResponse(e){for(let t of e){let n=this.getCookieKey(t.name,t.domain,t.path);this.cookies.set(n,t)}}has(e,t){return this.get(e,t)!==void 0}delete(e,t,n){let i=this.getCookieKey(e,t,n);return this.cookies.delete(i)}getAll(e){let t=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&t.push(n):t.push(n));return t}getCookieHeader(e){let t=this.getAll(e);return lt.formatCookieHeader(t)}clear(){this.cookies.clear()}clearDomain(e){let t=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&t.push(n);for(let n of t)this.cookies.delete(n)}parseCookieHeaders(e,t){return lt.parseCookieHeaders(e,t)}isExpired(e){return lt.isExpired(e)}domainMatches(e,t){return lt.domainMatches(e,t)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[t,n]of this.cookies.entries())this.isExpired(n)&&e.push(t);for(let t of e)this.cookies.delete(t)}};sh();var Gi=class r{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,t){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=t}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let t=e||this.selectedEnvironment,n=this.config.environments[t],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let a=this.getEnvironmentVariables(n.inherits);i={...i,...a}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(t);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let t=this.config.environments[e];if(!t)return{};let n={};return t.inherits&&this.config.environments[t.inherits]&&(n={...this.getEnvironmentVariables(t.inherits)}),{...n,...t.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,t){this.sessionGlobals[e]=t}unsetGlobal(e){delete this.sessionGlobals[e]}clearGlobals(){this.sessionGlobals={}}resolve(e){let t=e||this.selectedEnvironment;return{name:t,merged:this.getVariables(t),globals:this.getGlobals()}}static fromVariables(e,t="default"){return new r({environments:{[t]:{name:t,variables:e}},selectedEnvironment:t})}};Il();Ac();var Ls=class r{envStore;interpolator;urlBuilder;constructor(e,t){this.envStore=e,this.interpolator=t||new Zo,this.urlBuilder=new Vn}get(e){return this.envStore.get(e)}set(e,t){this.envStore.set(e,t)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}getGlobals(){let e=this.envStore;return typeof e.getGlobals=="function"?e.getGlobals():{}}setGlobal(e,t){let n=this.envStore;typeof n.setGlobal=="function"&&n.setGlobal(e,t)}unsetGlobal(e){let t=this.envStore;typeof t.unsetGlobal=="function"&&t.unsetGlobal(e)}clearGlobals(){let e=this.envStore;typeof e.clearGlobals=="function"&&e.clearGlobals()}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,t={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,t)}buildUrl(e,t={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,t.params||{},t.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let t=Gi.fromVariables(e);return new r(t)}static fromResolver(e){return new r(e)}};Ac();Nc();Dc();Il();vf();gf();var Yl=class{constructor(e,t,n,i,s){this.httpClient=e;this.forgeEnv=t;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let a=s?.forgeRoot?[it("path").join(s.forgeRoot,"modules")]:[],l=new Ki(new Vn,new Qi,e);this.scriptExecutor=new rs(l,a,void 0,s?.scriptScope??"shared",s?.scriptTimeout??5e3)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,t,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},a={...this.forgeEnv.getGlobals()},l={...n.additionalVariables||{}},f={...s},d=this.buildHttpRequest(e,n.overrides),h=this.findFolderPath(t,e.id),g=this.buildScriptChain(e,t,h),y={request:{url:d.url,method:d.method,headers:{...d.headers},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:void 0},variables:l,collectionVariables:t.variables||{},globals:{...a},environmentVariables:f,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:t?.name},onEnvironmentChange:n.onEnvironmentChange,onGlobalsChange:(I,q,j)=>{I==="set"&&q&&j!==void 0?this.forgeEnv.setGlobal(q,j):I==="unset"&&q?this.forgeEnv.unsetGlobal(q):I==="clear"&&this.forgeEnv.clearGlobals()}},S=this.scriptExecutor.createRequestSession(y),_,R;try{if(!n.skipPreRequest&&g.preRequest.length>0){let B=await S.executePreRequest(g.preRequest);if(_={success:B.success,error:B.error,modifiedVariables:B.modifiedVariables,modifiedEnvironment:B.modifiedEnvironmentVariables,modifiedGlobals:B.modifiedGlobals,modifiedCollectionVariables:B.modifiedCollectionVariables,consoleOutput:B.consoleOutput,modifiedRequest:B.modifiedRequest?{url:B.modifiedRequest.url,method:B.modifiedRequest.method,headers:B.modifiedRequest.headers,body:B.modifiedRequest.body?.content}:void 0},B.modifiedVariables&&(l={...l,...B.localVariables??B.modifiedVariables}),B.modifiedEnvironmentVariables&&(f={...f,...B.modifiedEnvironmentVariables}),B.modifiedRequest){let V=B.modifiedRequest;V.url&&(d.url=V.url),V.method&&(d.method=V.method),V.headers&&(d.headers={...d.headers,...V.headers}),V.body!==void 0&&(d.body=V.body?.content||V.body)}if(!B.success)throw new Error(`Pre-request script failed: ${B.error}`)}let I={...f,...l};d=this.interpolateRequest(d,I);let q=n.overrides?.body||e.body;if(this.preprocessor&&q&&typeof q!="string"&&q.type==="graphql"&&d.body!==void 0){let B=this.preprocessor.encodeBody({type:"graphql",content:d.body});B!=null&&(d.body=typeof B=="string"?B:JSON.stringify(B))}let j=await this.httpClient.send(d);if(!n.skipPostResponse&&g.postResponse.length>0){let B=await S.executePostResponse(g.postResponse,{status:j.status,statusText:j.statusText,headers:j.headers,body:j.body,cookies:Qh(j.headers,j.cookies,d.url),responseTime:j.time,responseSize:j.size,executedRequest:{url:d.url,method:d.method,headers:d.headers||{},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:{type:"none",content:""},params:{},query:{}}});R={success:!0,assertions:B.testResults,consoleOutput:B.consoleOutput,modifiedEnvironment:B.modifiedEnvironmentVariables},B.modifiedEnvironmentVariables&&(f={...f,...B.modifiedEnvironmentVariables})}return{response:j,preRequestResult:_,postResponseResult:R,totalTime:Date.now()-i,finalRequest:d,variables:{environment:f,local:l}}}finally{S.dispose?.()}}async executeSimple(e,t={}){let n=e,i={...this.forgeEnv.getAll(),...t.variables||{}};return n=this.interpolateRequest(e,i),t.timeout&&(n={...n,timeout:t.timeout}),this.httpClient.send(n)}buildHttpRequest(e,t){let n=e.url;if(e.query&&e.query.length>0){let h=new URLSearchParams;for(let g of e.query)g.enabled!==!1&&h.append(g.key,g.value);n+=(n.includes("?")?"&":"?")+h.toString()}let i=t?.url||n,s=t?.method||e.method,a={};if(e.headers&&Array.isArray(e.headers))for(let h of e.headers)h.enabled!==!1&&(a[h.key]=h.value);let l={...a,...t?.headers||{}},f,d=t?.body||e.body;if(d)if(typeof d=="string")f=d;else if(this.preprocessor&&d.type)if(d.type==="graphql")f=typeof d.content=="string"?d.content:JSON.stringify(d.content);else{let h=this.preprocessor.encodeBody(d);f=h!=null?String(h):void 0}else d.content&&(f=typeof d.content=="string"?d.content:JSON.stringify(d.content));return this.preprocessor&&d&&this.preprocessor.setContentTypeHeader(l,d),{url:i,method:s,headers:l,body:f,timeout:t?.timeout||e.settings?.timeout,settings:{...e.settings,...t?.settings}}}interpolateRequest(e,t){let n=Ls.create(t);return{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:e.body?n.resolve(typeof e.body=="string"?e.body:JSON.stringify(e.body)):void 0}}buildScriptChain(e,t,n=[]){let i=[],s=[];t.scripts?.preRequest&&i.push(t.scripts.preRequest),t.scripts?.postResponse&&s.push(t.scripts.postResponse);for(let a of n)a.scripts?.preRequest&&i.push(a.scripts.preRequest),a.scripts?.postResponse&&s.push(a.scripts.postResponse);return e.scripts?.preRequest&&i.push(e.scripts.preRequest),e.scripts?.postResponse&&s.push(e.scripts.postResponse),{preRequest:i,postResponse:s}}findFolderPath(e,t){let n=[],i=(s,a)=>{for(let l of s){if(l.type==="request"&&l.id===t)return n.push(...a),!0;if(l.type==="folder"){let f=[...a,l];if(i(l.items,f))return!0}}return!1};return i(e.items,[]),n}};function vW(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}var bf=class{entries=new Map;requestIndex=new Map;fullResponses=new Map;maxEntriesPerRequest;storeFullResponses;constructor(e={}){this.maxEntriesPerRequest=e.maxEntriesPerRequest??100,this.storeFullResponses=e.storeFullResponses??!0}getEntries(e,t){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let a=this.entries.get(s);a&&(!t||a.environment===t)&&i.push(a)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,t,n,i,s){let a=vW(),l=Date.now(),f={id:a,timestamp:l,environment:i,method:t.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:t.url,method:t.method,headers:{...t.headers},body:t.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(a,f);let d=this.requestIndex.get(e)||[];for(d.unshift(a);d.length>this.maxEntriesPerRequest;){let h=d.pop();h&&(this.entries.delete(h),this.fullResponses.delete(h))}if(this.requestIndex.set(e,d),this.storeFullResponses){let h={timestamp:l,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(a,h)}return f}deleteEntry(e){if(!this.entries.get(e))return!1;this.entries.delete(e),this.fullResponses.delete(e);for(let[n,i]of this.requestIndex.entries()){let s=i.indexOf(e);if(s!==-1){i.splice(s,1),i.length===0&&this.requestIndex.delete(n);break}}return!0}clearHistory(e){let t=this.requestIndex.get(e);if(t){for(let n of t)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var Sf=class{async send(e){let t=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let a={method:e.method,headers:e.headers,signal:n.signal};e.body!==void 0&&!["GET","HEAD"].includes(e.method.toUpperCase())&&(typeof e.body=="string"||e.body instanceof FormData||e.body instanceof URLSearchParams?a.body=e.body:typeof e.body=="object"&&(a.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(a.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(a.redirect="manual");let l=await fetch(e.url,a),f=Date.now(),d;try{d=await l.text()}catch{d=null}let h={};return l.headers.forEach((g,y)=>{let S=h[y];S!==void 0?h[y]=Array.isArray(S)?[...S,g]:[S,g]:h[y]=g}),{status:l.status,statusText:l.statusText,headers:h,cookies:[],body:d,time:f-t}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};Nc();Dc();Mc();Zh();Il();var pa=class{format="http-forge";canParse(e){try{let t=JSON.parse(e);return typeof t=="object"&&t!==null&&"id"in t&&"name"in t&&"items"in t&&Array.isArray(t.items)&&!t.info?.schema?.includes("postman")&&!t._type}catch{return!1}}parse(e,t){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:t,version:n.version}}}convertItems(e){return e.map(t=>t.type==="folder"?this.convertFolder(t):this.convertRequest(t))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let t={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(t[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(t).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};Xh();import*as sn from"fs/promises";import*as Kl from"path";var wf=class{async readFile(e){return sn.readFile(e,"utf-8")}async writeFile(e,t){let n=Kl.dirname(e);await this.mkdir(n),await sn.writeFile(e,t,"utf-8")}async exists(e){try{return await sn.access(e),!0}catch{return!1}}async mkdir(e){await sn.mkdir(e,{recursive:!0})}async glob(e,t){let n=t||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=Kl.basename(s);for(let l of e)if(this.matchPattern(a,l)){i.push(s);break}})}catch{}return i}async readDir(e){return sn.readdir(e)}async isDirectory(e){try{return(await sn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,t){let n=await sn.readdir(e,{withFileTypes:!0});for(let i of n){let s=Kl.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,t):i.isFile()&&t(s)}}matchPattern(e,t){let n=t.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};vf();var $0=class r{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new Zo,this.fileSystem=e.fileSystem||new wf,this.preprocessor=e.preprocessor||new da,this.dataFileParser=e.dataFileParser||new ha,this.cookieJar=e.cookieJar||new Ic,e.enableHistory?this.requestHistory=e.requestHistory||new bf({maxEntriesPerRequest:e.maxHistoryEntries??100}):this.requestHistory=null,this.interceptorChain=e.interceptorChain||this.createInterceptorChain(e),e.httpClient)this.httpClient=e.httpClient;else if(e.useNativeHttp!==!1){let s={...e.httpSettings,timeout:e.requestTimeout??e.httpSettings?.timeout};this.httpClient=new Xo(s)}else this.httpClient=new Sf;let t=e.forgeRoot?[it("path").join(e.forgeRoot,"modules")]:[],n=new Ki(new Vn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new rs(n,t,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new Oc,this.parserRegistry.register("http-forge",new pa),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=it("path").join(e.forgeRoot,"collections");this.collectionLoader=new Ec(s)}else this.collectionLoader=new Ol(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new Gi(e.environmentConfig):Gi.fromVariables({}),this.forgeEnv=Ls.fromResolver(this.environmentStore),this.requestExecutor=new Yl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let t=new Qi;if(e.requestInterceptors)for(let n of e.requestInterceptors)t.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)t.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)t.addErrorInterceptor(n);return t}async loadCollection(e){if(this.collectionLoader instanceof Ol)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,t,n){return this.requestExecutor.execute(e,t,n)}async executeSimple(e,t){return this.requestExecutor.executeSimple(e,t)}registerParser(e,t){this.parserRegistry.register(e,t)}setEnvironmentConfig(e){this.environmentStore=new Gi(e),this.forgeEnv=Ls.fromResolver(this.environmentStore),this.requestExecutor=new Yl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new r(e)}static fromForgeRoot(e="./http-forge",t={}){let n=it("path"),i=n.join(e,"environments"),s,a=Pc(i);if(Object.keys(a.environments).length>0||Object.keys(a.globalVariables).length>0){s={globalVariables:{...a.globalVariables,...a.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,d]of Object.entries(a.environments)){let h=a.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...d.variables,...h}}}}else{let f=it("fs"),d=n.join(i,"environments.json");if(f.existsSync(d))try{let h=f.readFileSync(d,"utf-8"),g=JSON.parse(h);if(s={globalVariables:g.globalVariables||{},environments:{},selectedEnvironment:g.selectedEnvironment},g.environments)for(let[y,S]of Object.entries(g.environments)){let _=S;s.environments[y]={name:_.name||y,variables:_.variables||{}}}}catch(h){console.warn(`[ForgeContainer] Failed to load environments from ${d}:`,h)}}return new r({...t,forgeRoot:e,storageFormat:t.storageFormat??"folder",environmentConfig:s})}};dC();pC();Bg();CC();EC();async function K8(r){let{createMcpRuntime:e}=await Promise.resolve().then(()=>($$(),A$));return e(r)}async function Q8(r){let{runRequest:e}=await Promise.resolve().then(()=>(Uu(),$d));return e(r)}async function Z8(r){let{runCollection:e}=await Promise.resolve().then(()=>(Uu(),$d));return e(r)}async function X8(r){let{runFolder:e}=await Promise.resolve().then(()=>(Uu(),$d));return e(r)}async function e5(r){let{runSuite:e}=await Promise.resolve().then(()=>(Uu(),$d));return e(r)}ry();B0();zo();OC();V0();Nc();Dc();Mb();Mc();Zh();Il();E0();T0();vf();Yh();gf();Af();F0();j0();rh();Wo();Wo();D0();DC();z0();sh();Ac();nm();J0();tw();M0();function t5(r,e,t){let n=r.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=c5(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(f5(a))return{contextType:"variable_def",fieldPath:[],prefix:s};let l=a.match(/\.\.\.\s+on\s+(\w*)$/);if(l)return{contextType:"fragment_type",fieldPath:[],prefix:l[1]||""};let f=a.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&M$(a)){let g=BC(a,t),y=g.length>0?g[g.length-1]:void 0,S=N$(a);return{contextType:"argument_value",fieldPath:g,parentType:y,prefix:f[2]||"",currentArg:f[1],currentField:S||void 0}}if(M$(a)){let g=BC(a,t),y=g.length>0?g[g.length-1]:void 0,S=N$(a);return{contextType:"argument",fieldPath:g,parentType:y,prefix:s,currentField:S||void 0}}if(VC(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let h=BC(a,t);return{contextType:"selection_set",fieldPath:h,parentType:h.length>0?h[h.length-1]:void 0,prefix:s}}function r5(r,e){switch(e.contextType){case"root":return n5(r,e.prefix);case"selection_set":return i5(r,e);case"argument":return s5(r,e);case"argument_value":return o5(r,e);case"directive":return a5(r,e.prefix);case"fragment_type":return l5(r,e.prefix);case"variable_def":return u5(r,e.prefix);default:return[]}}function n5(r,e){let t=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
|
|
807
807
|
$0
|
|
808
808
|
}`},{label:"mutation",detail:"Mutation operation",insertText:`mutation \${1:OperationName} {
|
|
809
809
|
$0
|
|
@@ -813,4 +813,4 @@ Disambiguate by passing the id or slug.`);this.kind=t;this.value=n;this.candidat
|
|
|
813
813
|
$0
|
|
814
814
|
}`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&t.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),t}function s5(r,e){if(!e.currentField||!e.parentType)return[];let t=r.types.get(e.parentType);if(!t)return[];let n=t.fields.find(s=>s.name===e.currentField);if(!n)return[];let i=[];for(let s of n.args)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&i.push({label:s.name,kind:"argument",detail:s.type,description:s.description,insertText:`${s.name}: `,sortOrder:0});return i}function o5(r,e){if(!e.currentArg||!e.currentField||!e.parentType)return[];let t=[],n=r.types.get(e.parentType);if(!n)return t;let i=n.fields.find(f=>f.name===e.currentField);if(!i)return t;let s=i.args.find(f=>f.name===e.currentArg);if(!s)return t;let a=s.type.replace(/[!\[\]]/g,""),l=r.types.get(a);if(l&&l.kind==="ENUM")for(let f of l.enumValues)(!e.prefix||f.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&t.push({label:f.name,kind:"enum",detail:l.name,description:f.description,deprecated:f.isDeprecated,sortOrder:0});else if(a==="Boolean")for(let f of["true","false"])(!e.prefix||f.startsWith(e.prefix.toLowerCase()))&&t.push({label:f,kind:"keyword",detail:"Boolean",sortOrder:0});return t}function a5(r,e){let t=[];for(let n of r.directives)if(!e||n.name.toLowerCase().startsWith(e.toLowerCase())){let i=n.args.length>0?`(${n.args.map(s=>`${s.name}: ${s.type}`).join(", ")})`:"";t.push({label:`@${n.name}`,kind:"directive",detail:i||void 0,description:n.description,insertText:n.args.length>0?`@${n.name}($1)`:`@${n.name}`,sortOrder:0})}return t}function l5(r,e){let t=[];for(let[n,i]of r.types)(i.kind==="OBJECT"||i.kind==="INTERFACE"||i.kind==="UNION")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&t.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return t}function u5(r,e){let t=[];for(let[n,i]of r.types)(i.kind==="SCALAR"||i.kind==="INPUT_OBJECT"||i.kind==="ENUM")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&t.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return t}function D$(r,e,t){let n=r.type.replace(/[!\[\]]/g,""),i=!1;if(t){let a=t.types.get(n);i=!!a&&(a.kind==="OBJECT"||a.kind==="INTERFACE"||a.kind==="UNION")}else i=!new Set(["String","Int","Float","Boolean","ID"]).has(n);let s=r.name;if(r.args.length>0){let a=r.args.filter(l=>l.type.endsWith("!"));if(a.length>0){let l=a.map((f,d)=>`${f.name}: \${${d+1}}`).join(", ");s=`${r.name}(${l})`}}return i&&(s+=` {
|
|
815
815
|
$0
|
|
816
|
-
}`),{label:r.name,kind:"field",detail:r.type,description:r.description,insertText:s,deprecated:r.isDeprecated,sortOrder:e}}function c5(r){return r.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function VC(r,e,t){let n=0;for(let i of r)i===e?n++:i===t&&n--;return n}function M$(r){return VC(r,"(",")")>0}function f5(r){if(VC(r,"(",")")<=0)return!1;let t=r.indexOf("{"),n=t>=0?r.slice(0,t):r;return/\$\w+\s*:\s*\w*$/.test(n)}function N$(r){let e=0;for(let t=r.length-1;t>=0;t--)if(r[t]===")")e++;else if(r[t]==="("){if(e===0){let i=r.slice(0,t).trimEnd().match(/(\w+)$/);return i?i[1]:null}e--}return null}function BC(r,e){if(!e)return[];let t=[],n=e.queryType,i=r.match(/\b(query|mutation|subscription)\b/);i&&(i[1]==="mutation"&&e.mutationType?n=e.mutationType:i[1]==="subscription"&&e.subscriptionType&&(n=e.subscriptionType)),t.push(n);let s=d5(r),a=e.types.get(n);for(let l=0;l<s.length;l++){let f=s[l];if(f!=="{"){if(f==="}"){t.pop(),a=t.length>0?e.types.get(t[t.length-1]):void 0;continue}if(l+1<s.length&&(s[l+1]==="{"||s[l+1]==="(")){let d=l+1;if(s[d]==="("){let h=1;for(d++;d<s.length&&h>0;)s[d]==="("?h++:s[d]===")"&&h--,d++}if(d<s.length&&s[d]==="{"&&a){let h=a.fields.find(g=>g.name===f);if(h){let g=h.type.replace(/[!\[\]]/g,"");t.push(g),a=e.types.get(g)}}}}}return t}function d5(r){let e=[],t=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=t.exec(r))!==null;)e.push(n[1]);return e}G0();L_();rw();XR();og();rC();tC();F_();eC();U0();H0();TC();cC();Zg();qC();function ay(r,e){if(r.length===0)return 0;let t=Math.ceil(e/100*r.length)-1;return r[Math.max(0,t)]}function WC(r){return{name:r,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function F$(r){if(r.durations.length===0){r.min=0,r.max=0,r.avg=0,r.p50=0,r.p90=0,r.p95=0,r.p99=0;return}let e=[...r.durations].sort((n,i)=>n-i),t=r.durations.reduce((n,i)=>n+i,0);r.min=e[0],r.max=e[e.length-1],r.avg=Math.round(t/r.durations.length),r.p50=ay(e,50),r.p90=ay(e,90),r.p95=ay(e,95),r.p99=ay(e,99)}var zC=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=WC("Overall"),this.errors=new Map}createEmptySummary(){return{totalRequests:0,passed:0,failed:0,skipped:0,passRate:0,duration:0,isRunning:!1}}start(){this.startTime=Date.now(),this.summary.isRunning=!0}reset(){this.summary=this.createEmptySummary(),this.byRequest.clear(),this.overall=WC("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,t,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let a=this.summary.passed+this.summary.failed;if(this.summary.passRate=a>0?Math.round(this.summary.passed/a*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,WC(e));let l=this.byRequest.get(e);if(l.count++,n?l.passed++:l.failed++,l.durations.push(t),F$(l),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(t),F$(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((t,n)=>{e.push({message:n,count:t})}),e.sort((t,n)=>n.count-t.count),{summary:{...this.summary},byRequest:new Map(this.byRequest),overall:{...this.overall},errors:e}}getSerializableStatistics(){let e=this.getStatistics();return{summary:e.summary,byRequest:Array.from(e.byRequest.values()),overall:e.overall,errors:e.errors}}};fC();Wo();import*as hs from"fs";import*as Na from"path";var JC=class{constructor(e){this.collectionService=e}collectionService;suite;suiteDir;setSuite(e){this.suite=e}setSuiteDir(e){this.suiteDir=e}getSuite(){return this.suite}loadSuiteRequest(e){if(!this.suiteDir)return;let t=Na.join(this.suiteDir,e,"request.json");if(hs.existsSync(t))try{let n=JSON.parse(hs.readFileSync(t,"utf-8")),i=Na.join(this.suiteDir,e,"scripts"),s=th(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,t){if(!this.suiteDir)return;let n=Na.join(this.suiteDir,e);hs.mkdirSync(n,{recursive:!0});let i=t.scripts,s={...t};if(delete s.scripts,hs.writeFileSync(Na.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=Na.join(n,"scripts");rh(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:hs.existsSync(Na.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let t=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(t){let s,a=[];if(n){s=n.scripts;let l=this.findRequestInCollection(n,e.requestId);l&&(a=l.folderScriptsChain)}return{request:t,suiteRequest:e,collectionScripts:s,folderScriptsChain:a}}if(!n){console.warn(`[TestSuiteStore] Collection not found: ${e.collectionId}`);return}let i=this.findRequestInCollection(n,e.requestId);if(!i){console.warn(`[TestSuiteStore] Request not found: ${e.requestId}`);return}return{request:i.request,suiteRequest:e,collectionScripts:n.scripts,folderScriptsChain:i.folderScriptsChain}}findRequestInCollection(e,t,n=[]){let i=e.items||[];return this.searchItems(i,t,n)}searchItems(e,t,n){for(let i of e)if(i.type==="folder"){let s=i;if(!s.items)continue;let a=s.scripts?[...n,s.scripts]:n,l=this.searchItems(s.items||[],t,a);if(l)return l}else if(i.id===t)return{request:this.normalizeRequest(i),folderScriptsChain:n}}normalizeRequest(e){let{type:t,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(t=>({key:t.key||"",value:t.value||"",enabled:t.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([t,n])=>({key:t,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,t){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===t);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let t=this.suite.requests.find(n=>n.slug===e);if(t)return this.resolveRequest(t)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let t of this.suite.requests){let n=this.resolveRequest(t);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let t of this.suite.requests){if(!t.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);t.slug=Sn(t.name||"request",i)}let n=this.resolveRequest(t);if(n){let i=this.collectionService.getCollection(t.collectionId);e.push({id:`${t.collectionId}:${t.requestId}`,collectionId:t.collectionId,requestId:t.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:t.folderPath||"",enabled:t.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(t.slug),slug:t.slug})}}return e}getSelectedRequests(e){let t=[];for(let n of e){let[i,s]=n.split(":"),a=this.suite?.requests.find(l=>l.collectionId===i&&l.requestId===s);if(a){let l=this.resolveRequest(a);l&&t.push(l)}}return t}addRequest(e,t){if(this.suite){if(this.suiteDir&&t){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=Sn(e.name||t.name||"request",n)}this.saveSuiteRequest(e.slug,t)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let t=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!t.has(e))return e;let n=2;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(t=>t.requestId!==e))}reorderRequests(e){if(!this.suite)return;let t=new Map;for(let i of this.suite.requests)t.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=t.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,t){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,t);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=t.name||n.name,n.method=t.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let t=this.suite.requests.find(s=>s.slug===e);if(!t)return;let n=this.collectionService.getCollection(t.collectionId);if(!n)return;let i=this.findRequestInCollection(n,t.requestId);if(i)return this.saveSuiteRequest(e,i.request),t.name=i.request.name||t.name,t.method=i.request.method||t.method,i.request}};W0();rm();em();nC();iC();lC();aC();sC();oC();uC();ah();uh();fh();bn();export{$a as AmbiguousRefError,Dg as AwsSecretResolver,Fg as AzureKeyVaultResolver,mE as BODY_FILE_MAP,Gg as COLLECTION_INPUT_SCHEMA,eu as CONFIG_FILES,Ol as CollectionLoader,xf as CollectionLoaderFactory,Gs as CollectionRequestExecutor,Ef as CollectionService,tu as ConfigService,Pc as CookieJar,Of as CookieService,lt as CookieUtils,zt as DEFAULT_CONFIG,zn as DEFAULT_REQUEST_SETTINGS,Pd as DEFAULT_SUITE_CONFIG,PE as DYNAMIC_VARIABLES,ha as DataFileParser,Hg as DopplerResolver,kf as EnvironmentConfigService,Gi as EnvironmentResolver,mu as ExampleGenerator,Yg as FOLDER_INPUT_SCHEMA,wf as FetchHttpClient,Oc as FolderCollectionLoader,Ds as FolderCollectionStore,$0 as ForgeContainer,Ls as ForgeEnv,ot as GENERIC_TOOL_NAMES,Ug as GcpSecretResolver,qf as GraphQLSchemaService,IC as HTTP_METHOD_MAP,Nu as HTTP_METHOD_REVERSE,Lg as HashiCorpVaultResolver,ru as HistoryAnalyzer,Td as HtmlReportGenerator,pa as HttpForgeParser,Ki as HttpRequestService,Mu as InMemoryCookieJar,Qi as InterceptorChain,Xl as JsonCollectionLoader,Nb as LoggingRequestInterceptor,xr as METADATA_FILES,Jh as ModuleLoader,_f as NodeFileSystem,Xo as NodeHttpClient,Rf as OAuth2TokenManager,jg as OnePasswordResolver,hu as OpenApiExporter,Tu as OpenApiImporter,Ic as ParserRegistry,If as PersistentCookieJar,Jg as REQUEST_INPUT_SCHEMA,ga as ROOT_DIRECTORIES,ku as RefResolver,Yl as RequestExecutor,Mf as RequestHistoryService,Sf as RequestHistoryStore,Tf as RequestPreparer,da as RequestPreprocessor,vf as RequestScriptSession,Lu as ResultStorageService,Fb as RetryErrorInterceptor,Ec as SCHEMA_FILES,nn as SCRIPTS_DIR,eh as SCRIPT_FILES,Kg as SUITE_INPUT_SCHEMA,qu as SchemaInferenceService,oo as SchemaInferrer,Au as ScriptAnalyzer,rs as ScriptExecutor,Id as SecretResolverRegistry,Ta as ServiceContainer,re as ServiceIdentifiers,zC as StatisticsService,kd as TestSuiteService,JC as TestSuiteStore,Db as TimingResponseInterceptor,Wn as UrlBuilder,Zo as VariableInterpolator,Qo as VariableResolver,DW as applyExtractionPlan,Ac as applyFilterChain,Go as augmentWithDynamicVars,f$ as bootstrapNodeRuntime,wC as buildCollectionToolDescription,mC as buildCollectionToolName,NW as buildExtractionPlan,_C as buildFolderToolDescription,gC as buildFolderToolName,xC as buildGenericTools,SC as buildRequestToolDescription,hC as buildRequestToolName,Qg as buildResultFileName,RC as buildSuiteToolDescription,yC as buildSuiteToolName,vE as cleanupOldBodyFiles,Qh as concatenateScripts,mf as createExpectChain,hP as createLodashShim,K8 as createMcpRuntime,x0 as createModuleLoader,Gh as createMomentShim,kn as createNodeContainer,Yh as createResponseObject,pW as createScriptConsole,I0 as createTestFunction,_j as createVariableResolver,jL as deepClone,Ob as deleteItemFromTree,MW as detectSensitiveData,Ko as evaluateExpression,S8 as expandSummary,wW as exportCollectionToRestClient,Eb as findItemById,BL as formatBytes,Gl as formatConsoleOutput,VL as formatDuration,pt as generateId,Sn as generateSlug,xb as generateUUID,r5 as getCompletions,SW as getRestClientExportFolder,s$ as getServiceContainer,gf as hasChanged,Yo as isExpression,UL as isPlainObject,sh as isSystemEnvironmentFile,kc as loadEnvironmentsFromFolder,qa as mcpToolSegment,ds as mcpToolToken,xc as mergeHeadersCaseInsensitive,$b as mergeRequestSettings,P0 as normalizeHeaders,qc as parseFilterChain,vC as parseMcpToolName,nm as parsePostmanEnvironment,TW as parsePostmanEnvironmentFile,t5 as parseQueryContext,yE as prepareBodyForSave,gE as readBodyFromDir,bE as readSchemaFile,th as readScriptsFromDir,Q0 as redactBody,X0 as redactFullResponse,ew as redactFullResultDetails,ns as redactHeaders,Z0 as redactHistoryEntry,am as redactUrl,Wg as registerCoreServices,$C as resolveCollectionRef,Yi as resolveDynamicVariable,pj as resolveDynamicVariablesInString,MC as resolveFolderRef,bC as resolveFolderToken,NC as resolveRequestRef,$u as resolveToken,Z8 as runCollection,X8 as runFolder,Q8 as runRequest,e5 as runSuite,HL as safeJsonParse,kt as sanitizeName,Ib as searchForItemPath,Pb as searchForItemPathById,wE as sortItemsByOrder,Zl as writeEnvFile,tm as writeFolderItems,SE as writeSchemaFiles,Cf as writeScriptFile,rh as writeScriptsToDir};
|
|
816
|
+
}`),{label:r.name,kind:"field",detail:r.type,description:r.description,insertText:s,deprecated:r.isDeprecated,sortOrder:e}}function c5(r){return r.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function VC(r,e,t){let n=0;for(let i of r)i===e?n++:i===t&&n--;return n}function M$(r){return VC(r,"(",")")>0}function f5(r){if(VC(r,"(",")")<=0)return!1;let t=r.indexOf("{"),n=t>=0?r.slice(0,t):r;return/\$\w+\s*:\s*\w*$/.test(n)}function N$(r){let e=0;for(let t=r.length-1;t>=0;t--)if(r[t]===")")e++;else if(r[t]==="("){if(e===0){let i=r.slice(0,t).trimEnd().match(/(\w+)$/);return i?i[1]:null}e--}return null}function BC(r,e){if(!e)return[];let t=[],n=e.queryType,i=r.match(/\b(query|mutation|subscription)\b/);i&&(i[1]==="mutation"&&e.mutationType?n=e.mutationType:i[1]==="subscription"&&e.subscriptionType&&(n=e.subscriptionType)),t.push(n);let s=d5(r),a=e.types.get(n);for(let l=0;l<s.length;l++){let f=s[l];if(f!=="{"){if(f==="}"){t.pop(),a=t.length>0?e.types.get(t[t.length-1]):void 0;continue}if(l+1<s.length&&(s[l+1]==="{"||s[l+1]==="(")){let d=l+1;if(s[d]==="("){let h=1;for(d++;d<s.length&&h>0;)s[d]==="("?h++:s[d]===")"&&h--,d++}if(d<s.length&&s[d]==="{"&&a){let h=a.fields.find(g=>g.name===f);if(h){let g=h.type.replace(/[!\[\]]/g,"");t.push(g),a=e.types.get(g)}}}}}return t}function d5(r){let e=[],t=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=t.exec(r))!==null;)e.push(n[1]);return e}G0();L_();rw();XR();sg();rC();tC();F_();eC();U0();H0();TC();cC();Qg();qC();function ay(r,e){if(r.length===0)return 0;let t=Math.ceil(e/100*r.length)-1;return r[Math.max(0,t)]}function WC(r){return{name:r,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function F$(r){if(r.durations.length===0){r.min=0,r.max=0,r.avg=0,r.p50=0,r.p90=0,r.p95=0,r.p99=0;return}let e=[...r.durations].sort((n,i)=>n-i),t=r.durations.reduce((n,i)=>n+i,0);r.min=e[0],r.max=e[e.length-1],r.avg=Math.round(t/r.durations.length),r.p50=ay(e,50),r.p90=ay(e,90),r.p95=ay(e,95),r.p99=ay(e,99)}var zC=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=WC("Overall"),this.errors=new Map}createEmptySummary(){return{totalRequests:0,passed:0,failed:0,skipped:0,passRate:0,duration:0,isRunning:!1}}start(){this.startTime=Date.now(),this.summary.isRunning=!0}reset(){this.summary=this.createEmptySummary(),this.byRequest.clear(),this.overall=WC("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,t,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let a=this.summary.passed+this.summary.failed;if(this.summary.passRate=a>0?Math.round(this.summary.passed/a*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,WC(e));let l=this.byRequest.get(e);if(l.count++,n?l.passed++:l.failed++,l.durations.push(t),F$(l),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(t),F$(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((t,n)=>{e.push({message:n,count:t})}),e.sort((t,n)=>n.count-t.count),{summary:{...this.summary},byRequest:new Map(this.byRequest),overall:{...this.overall},errors:e}}getSerializableStatistics(){let e=this.getStatistics();return{summary:e.summary,byRequest:Array.from(e.byRequest.values()),overall:e.overall,errors:e.errors}}};fC();Wo();import*as hs from"fs";import*as Na from"path";var JC=class{constructor(e){this.collectionService=e}collectionService;suite;suiteDir;setSuite(e){this.suite=e}setSuiteDir(e){this.suiteDir=e}getSuite(){return this.suite}loadSuiteRequest(e){if(!this.suiteDir)return;let t=Na.join(this.suiteDir,e,"request.json");if(hs.existsSync(t))try{let n=JSON.parse(hs.readFileSync(t,"utf-8")),i=Na.join(this.suiteDir,e,"scripts"),s=eh(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,t){if(!this.suiteDir)return;let n=Na.join(this.suiteDir,e);hs.mkdirSync(n,{recursive:!0});let i=t.scripts,s={...t};if(delete s.scripts,hs.writeFileSync(Na.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=Na.join(n,"scripts");th(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:hs.existsSync(Na.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let t=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(t){let s,a=[];if(n){s=n.scripts;let l=this.findRequestInCollection(n,e.requestId);l&&(a=l.folderScriptsChain)}return{request:t,suiteRequest:e,collectionScripts:s,folderScriptsChain:a}}if(!n){console.warn(`[TestSuiteStore] Collection not found: ${e.collectionId}`);return}let i=this.findRequestInCollection(n,e.requestId);if(!i){console.warn(`[TestSuiteStore] Request not found: ${e.requestId}`);return}return{request:i.request,suiteRequest:e,collectionScripts:n.scripts,folderScriptsChain:i.folderScriptsChain}}findRequestInCollection(e,t,n=[]){let i=e.items||[];return this.searchItems(i,t,n)}searchItems(e,t,n){for(let i of e)if(i.type==="folder"){let s=i;if(!s.items)continue;let a=s.scripts?[...n,s.scripts]:n,l=this.searchItems(s.items||[],t,a);if(l)return l}else if(i.id===t)return{request:this.normalizeRequest(i),folderScriptsChain:n}}normalizeRequest(e){let{type:t,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(t=>({key:t.key||"",value:t.value||"",enabled:t.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([t,n])=>({key:t,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,t){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===t);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let t=this.suite.requests.find(n=>n.slug===e);if(t)return this.resolveRequest(t)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let t of this.suite.requests){let n=this.resolveRequest(t);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let t of this.suite.requests){if(!t.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);t.slug=Sn(t.name||"request",i)}let n=this.resolveRequest(t);if(n){let i=this.collectionService.getCollection(t.collectionId);e.push({id:`${t.collectionId}:${t.requestId}`,collectionId:t.collectionId,requestId:t.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:t.folderPath||"",enabled:t.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(t.slug),slug:t.slug})}}return e}getSelectedRequests(e){let t=[];for(let n of e){let[i,s]=n.split(":"),a=this.suite?.requests.find(l=>l.collectionId===i&&l.requestId===s);if(a){let l=this.resolveRequest(a);l&&t.push(l)}}return t}addRequest(e,t){if(this.suite){if(this.suiteDir&&t){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=Sn(e.name||t.name||"request",n)}this.saveSuiteRequest(e.slug,t)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let t=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!t.has(e))return e;let n=2;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(t=>t.requestId!==e))}reorderRequests(e){if(!this.suite)return;let t=new Map;for(let i of this.suite.requests)t.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=t.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,t){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,t);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=t.name||n.name,n.method=t.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let t=this.suite.requests.find(s=>s.slug===e);if(!t)return;let n=this.collectionService.getCollection(t.collectionId);if(!n)return;let i=this.findRequestInCollection(n,t.requestId);if(i)return this.saveSuiteRequest(e,i.request),t.name=i.request.name||t.name,t.method=i.request.method||t.method,i.request}};W0();tm();Xh();nC();iC();lC();aC();sC();oC();uC();oh();lh();ch();bn();export{$a as AmbiguousRefError,Ng as AwsSecretResolver,Dg as AzureKeyVaultResolver,mE as BODY_FILE_MAP,Jg as COLLECTION_INPUT_SCHEMA,eu as CONFIG_FILES,Ol as CollectionLoader,Cf as CollectionLoaderFactory,Gs as CollectionRequestExecutor,xf as CollectionService,tu as ConfigService,Ic as CookieJar,Ef as CookieService,lt as CookieUtils,zt as DEFAULT_CONFIG,Wn as DEFAULT_REQUEST_SETTINGS,Id as DEFAULT_SUITE_CONFIG,PE as DYNAMIC_VARIABLES,ha as DataFileParser,Ug as DopplerResolver,Pf as EnvironmentConfigService,Gi as EnvironmentResolver,mu as ExampleGenerator,Gg as FOLDER_INPUT_SCHEMA,Sf as FetchHttpClient,Ec as FolderCollectionLoader,Ds as FolderCollectionStore,$0 as ForgeContainer,Ls as ForgeEnv,ot as GENERIC_TOOL_NAMES,jg as GcpSecretResolver,Tf as GraphQLSchemaService,IC as HTTP_METHOD_MAP,Nu as HTTP_METHOD_REVERSE,Fg as HashiCorpVaultResolver,ru as HistoryAnalyzer,kd as HtmlReportGenerator,pa as HttpForgeParser,Ki as HttpRequestService,Mu as InMemoryCookieJar,Qi as InterceptorChain,Xl as JsonCollectionLoader,Nb as LoggingRequestInterceptor,xr as METADATA_FILES,zh as ModuleLoader,wf as NodeFileSystem,Xo as NodeHttpClient,_f as OAuth2TokenManager,Lg as OnePasswordResolver,hu as OpenApiExporter,Tu as OpenApiImporter,Oc as ParserRegistry,Of as PersistentCookieJar,zg as REQUEST_INPUT_SCHEMA,ga as ROOT_DIRECTORIES,ku as RefResolver,Yl as RequestExecutor,$f as RequestHistoryService,bf as RequestHistoryStore,kf as RequestPreparer,da as RequestPreprocessor,yf as RequestScriptSession,Lu as ResultStorageService,Fb as RetryErrorInterceptor,xc as SCHEMA_FILES,nn as SCRIPTS_DIR,Xp as SCRIPT_FILES,Yg as SUITE_INPUT_SCHEMA,qu as SchemaInferenceService,oo as SchemaInferrer,Au as ScriptAnalyzer,rs as ScriptExecutor,Od as SecretResolverRegistry,Ta as ServiceContainer,re as ServiceIdentifiers,zC as StatisticsService,Pd as TestSuiteService,JC as TestSuiteStore,Db as TimingResponseInterceptor,Vn as UrlBuilder,Zo as VariableInterpolator,Qo as VariableResolver,DW as applyExtractionPlan,qc as applyFilterChain,Go as augmentWithDynamicVars,f$ as bootstrapNodeRuntime,wC as buildCollectionToolDescription,mC as buildCollectionToolName,NW as buildExtractionPlan,_C as buildFolderToolDescription,gC as buildFolderToolName,xC as buildGenericTools,SC as buildRequestToolDescription,hC as buildRequestToolName,Kg as buildResultFileName,RC as buildSuiteToolDescription,yC as buildSuiteToolName,vE as cleanupOldBodyFiles,Kh as concatenateScripts,hf as createExpectChain,hP as createLodashShim,K8 as createMcpRuntime,x0 as createModuleLoader,Jh as createMomentShim,ki as createNodeContainer,Gh as createResponseObject,pW as createScriptConsole,I0 as createTestFunction,_j as createVariableResolver,jL as deepClone,Ob as deleteItemFromTree,MW as detectSensitiveData,Ko as evaluateExpression,S8 as expandSummary,wW as exportCollectionToRestClient,Eb as findItemById,BL as formatBytes,Gl as formatConsoleOutput,VL as formatDuration,pt as generateId,Sn as generateSlug,xb as generateUUID,r5 as getCompletions,SW as getRestClientExportFolder,s$ as getServiceContainer,mf as hasChanged,Yo as isExpression,UL as isPlainObject,ih as isSystemEnvironmentFile,Pc as loadEnvironmentsFromFolder,qa as mcpToolSegment,ds as mcpToolToken,Cc as mergeHeadersCaseInsensitive,$b as mergeRequestSettings,P0 as normalizeHeaders,Tc as parseFilterChain,vC as parseMcpToolName,rm as parsePostmanEnvironment,TW as parsePostmanEnvironmentFile,t5 as parseQueryContext,yE as prepareBodyForSave,gE as readBodyFromDir,bE as readSchemaFile,eh as readScriptsFromDir,Q0 as redactBody,X0 as redactFullResponse,ew as redactFullResultDetails,ns as redactHeaders,Z0 as redactHistoryEntry,om as redactUrl,Vg as registerCoreServices,$C as resolveCollectionRef,Yi as resolveDynamicVariable,pj as resolveDynamicVariablesInString,MC as resolveFolderRef,bC as resolveFolderToken,NC as resolveRequestRef,$u as resolveToken,Z8 as runCollection,X8 as runFolder,Q8 as runRequest,e5 as runSuite,HL as safeJsonParse,kt as sanitizeName,Ib as searchForItemPath,Pb as searchForItemPathById,wE as sortItemsByOrder,Zl as writeEnvFile,em as writeFolderItems,SE as writeSchemaFiles,Rf as writeScriptFile,th as writeScriptsToDir};
|