@http-forge/core 0.6.10 → 0.6.11

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.mjs CHANGED
@@ -1,10 +1,10 @@
1
- var Rj=Object.create;var _h=Object.defineProperty;var Cj=Object.getOwnPropertyDescriptor;var xj=Object.getOwnPropertyNames;var Ej=Object.getPrototypeOf,Ij=Object.prototype.hasOwnProperty;var ft=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var se=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var H=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ws=(t,e)=>{for(var r in e)_h(t,r,{get:e[r],enumerable:!0})},XE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xj(e))!Ij.call(t,i)&&i!==r&&_h(t,i,{get:()=>e[i],enumerable:!(n=Cj(e,i))||n.enumerable});return t};var Uc=(t,e,r)=>(r=t!=null?Rj(Ej(t)):{},XE(e||!t||!t.__esModule?_h(r,"default",{value:t,enumerable:!0}):r,t)),Ul=t=>XE(_h({},"__esModule",{value:!0}),t);function At(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function St(t){let e=Date.now().toString(36)+(qj++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${At(t)}_${e}`:e}function Yb(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Hc(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let o=i.toLowerCase();n[o]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let o=i.toLowerCase(),l=n[o];l&&delete r[l],n[o]=i,r[i]=s}return r}function Oj(t){return JSON.parse(JSON.stringify(t))}function kj(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Pj(t,e){try{return JSON.parse(t)}catch{return e}}function Tj(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function Aj(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var qj,Cn=se(()=>{"use strict";qj=0});import*as at from"fs";import*as ln from"path";function Ch(t){if(!at.existsSync(t))return;let e={},r=ln.join(t,Rh.preRequest);at.existsSync(r)&&(e.preRequest=at.readFileSync(r,"utf-8"));let n=ln.join(t,Rh.postResponse);return at.existsSync(n)&&(e.postResponse=at.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function xh(t,e){await at.promises.mkdir(t,{recursive:!0});let r=ln.join(t,Rh.preRequest);e.preRequest?await at.promises.writeFile(r,e.preRequest,"utf-8"):at.existsSync(r)&&await at.promises.unlink(r);let n=ln.join(t,Rh.postResponse);e.postResponse?await at.promises.writeFile(n,e.postResponse,"utf-8"):at.existsSync(n)&&await at.promises.unlink(n)}function tI(t){for(let[e,r]of Object.entries(eI)){let n=ln.join(t,e);if(at.existsSync(n))try{let i=at.readFileSync(n,"utf-8"),s;if(r.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:r.type,format:r.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function rI(t){if(!t||t.type==="none")return{bodyForMetadata:t};if(t.type==="raw"){let e=t.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 t.content=="string"?t.content:JSON.stringify(t.content,null,2):String(t.content||"");return{bodyForMetadata:{type:t.type,format:t.format},externalBodyFile:{filename:n,content:i}}}}if(t.type==="graphql"){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return{bodyForMetadata:{type:t.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:t}}async function nI(t,e){for(let r of Object.keys(eI))if(r!==e){let n=ln.join(t,r);if(at.existsSync(n))try{await at.promises.unlink(n)}catch{}}}function iI(t){if(at.existsSync(t))try{let e=at.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function sI(t,e,r){let n=ln.join(t,Bc.responseSchema),i=ln.join(t,Bc.bodySchema);e?await at.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):at.existsSync(n)&&await at.promises.unlink(n),r?await at.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):at.existsSync(i)&&await at.promises.unlink(i)}function Kb(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=Kb(r.items,e);if(n)return n}}}function Qb(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(n.id===e)return t.splice(r,1),!0;if(n.type==="folder"&&n.items&&Qb(n.items,e))return!0}return!1}function oI(t,e){let r=new Map(t.map(i=>[i.id,i])),n=[];for(let i of e){let s=r.get(i);s&&(n.push(s),r.delete(i))}for(let i of r.values())n.push(i);return n}function Zb(t,e){let r;try{r=at.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===un)continue;if(n.name===e)return ln.join(t,n.name);let i=Zb(ln.join(t,n.name),e);if(i)return i}}function $j(t){for(let e of[Or.request,Or.folder]){let r=ln.join(t,e);if(at.existsSync(r))try{let n=at.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function Xb(t,e){let r;try{r=at.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===un)continue;let i=ln.join(t,n.name);if($j(i)===e)return i;let s=Xb(i,e);if(s)return s}}function xn(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],o=0;for(let g of s){let v=parseInt(g.substring(1));v>o&&(o=v)}let l="";if(o>0)l=`t${o}`;else{let g=r.match(/[_\s-](\d+\.\d+)[_\s-]/);g&&(l=`v${g[1].replace(".","_")}`)}let f=r;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 c=f.split("-").filter(g=>g.length>0),p=[];i&&p.push(i),p.push(...c),l&&p.push(l);let h=p.join("-");if(h||(h="item"),e.includes(h)){let g=2;for(;e.includes(`${h}-${g}`);)g++;h=`${h}-${g}`}return h}var Rh,Or,eI,Bc,un,na=se(()=>{"use strict";Rh={preRequest:"pre-request.js",postResponse:"post-response.js"},Or={collection:"collection.json",folder:"folder.json",request:"request.json"},eI={"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"}},Bc={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},un="scripts"});import*as Ie from"fs";import*as Te from"path";var zs,Eh=se(()=>{"use strict";Cn();na();zs=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(){Ie.existsSync(this.collectionsDir)||Ie.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=Ie.readFileSync(e,"utf-8")}catch(i){console.error(`[FolderCollectionStore] Failed to read ${r} ${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 ${r} ${e}:`,i);return}}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Ie.existsSync(this.collectionsDir))return[];let e=Ie.readdirSync(this.collectionsDir,{withFileTypes:!0}),r=[];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),r.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return r}loadCollectionFromFolder(e){let r=Te.join(this.collectionsDir,e),n=Te.join(r,Or.collection);if(!Ie.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(Te.join(r,un)),o=this.loadItemsFromDir(r,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:o}}catch(s){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,s);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,o=Ie.readdirSync(e,{withFileTypes:!0});for(let l of o){if(!l.isDirectory()||l.name===un)continue;let f=Te.join(e,l.name);if(Ie.existsSync(Te.join(f,Or.folder))){let c=this.loadFolderFromDir(f,l.name);c&&s.set(l.name,c)}else if(Ie.existsSync(Te.join(f,Or.request))){let c=this.loadRequestFromDir(f,l.name);c&&s.set(l.name,c)}}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,r){let n=Te.join(e,Or.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(Te.join(e,un)),o=this.loadItemsFromDir(e,i.id,i.order);return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"folder",name:i.name,description:i.description,auth:i.auth,scripts:s,items:o}}catch(s){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,s);return}}loadRequestFromDir(e,r){let n=Te.join(e,Or.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(Te.join(e,un)),o=i.body,l=this.loadBodyFromDir(e);l&&(o=l);let f=this.loadSchemaFile(Te.join(e,Bc.responseSchema)),c=this.loadSchemaFile(Te.join(e,Bc.bodySchema)),p=Te.join(e,"doc.md"),h=Ie.existsSync(p)?Ie.readFileSync(p,"utf-8"):void 0;return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{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:o,auth:i.auth,settings:i.settings,scripts:s,deprecated:i.deprecated,...h&&{doc:h},...f&&{responseSchema:f},...c&&{bodySchema:c}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return Ch(e)}loadBodyFromDir(e){return tI(e)}loadSchemaFile(e){return iI(e)}async saveSchemaFiles(e,r){return sI(e,r.responseSchema,r.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.idToSlugMap.get(e);if(r){let n=this.loadCollectionFromFolder(r);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=St(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=Ie.readdirSync(this.collectionsDir);r=xn(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Te.join(this.collectionsDir,r),i=!Ie.existsSync(n);await Ie.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},[o]=await Promise.all([this.saveItemsToDir(n,e.items,i),e.scripts?this.saveScriptsToDir(Te.join(n,un),e.scripts):Promise.resolve()]);o.length>0&&(s.order=o),await Ie.promises.writeFile(Te.join(n,Or.collection),JSON.stringify(s,null,2),"utf-8"),this.cache.set(e.id,e)}async saveItemsToDir(e,r,n=!1){let i=[],s=[];for(let o of r){let l=this.idToSlugMap.get(o.id);l||(l=xn(o.name,i),this.idToSlugMap.set(o.id,l),this.slugToIdMap.set(l,o.id)),i.push(l),s.push({item:o,slug:l})}return await Promise.all(s.map(async({item:o,slug:l})=>{let f=Te.join(e,l);await Ie.promises.mkdir(f,{recursive:!0}),o.type==="folder"?await this.saveFolderToDir(f,o,n):await this.saveRequestToDir(f,o,n)})),i}async saveFolderToDir(e,r,n=!1){let i={id:r.id,name:r.name,description:r.description,auth:r.auth},[s]=await Promise.all([r.items?this.saveItemsToDir(e,r.items,n):Promise.resolve([]),r.scripts?this.saveScriptsToDir(Te.join(e,un),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await Ie.promises.writeFile(Te.join(e,Or.folder),JSON.stringify(i,null,2),"utf-8")}async saveRequestToDir(e,r,n=!1){let{bodyForMetadata:i,externalBodyFile:s}=this.prepareBodyForSave(r.body),o={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:i,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated}},l=[Ie.promises.writeFile(Te.join(e,Or.request),JSON.stringify(o,null,2),"utf-8")];s&&l.push(Ie.promises.writeFile(Te.join(e,s.filename),s.content,"utf-8")),n||l.push(this.cleanupOldBodyFiles(e,s?.filename)),(!n||r.responseSchema||r.bodySchema)&&l.push(this.saveSchemaFiles(e,r)),r.doc&&l.push(Ie.promises.writeFile(Te.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(Te.join(e,un),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return rI(e)}async cleanupOldBodyFiles(e,r){return nI(e,r)}async saveScriptsToDir(e,r){return xh(e,r)}async delete(e){let r=this.idToSlugMap.get(e);if(!r&&(this.loadAll(),r=this.idToSlugMap.get(e),!r))return!1;let n=Te.join(this.collectionsDir,r);if(!Ie.existsSync(n))return!1;try{return await Ie.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(r),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let r=this.idToSlugMap.get(e);return r?Ie.existsSync(Te.join(this.collectionsDir,r,Or.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Te.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||St(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,r);if(!s)throw new Error(`Item ${r} not found in collection ${e}`);await this.saveScriptsToDir(Te.join(s,un),n);let o=this.findItemById(i.items,r);o&&(o.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(Te.join(n,un))}async updateCollectionMetadata(e,r){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=Te.join(this.collectionsDir,i),o=Te.join(s,Or.collection),l=Ie.readFileSync(o,"utf-8"),c={...JSON.parse(l),...r,id:e};await Ie.promises.writeFile(o,JSON.stringify(c,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,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 o;if(n){let p=this.findItemPath(e,n);if(!p)throw new Error(`Parent folder ${n} not found`);o=p}else o=Te.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let p=Ie.readdirSync(o).filter(h=>Ie.statSync(Te.join(o,h)).isDirectory()&&h!==un);l=xn(r.name,p),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let f=Te.join(o,l);await Ie.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let c=this.findItemById(i.items,r.id);if(c)Object.assign(c,r);else if(n){let p=this.findItemById(i.items,n);p&&p.type==="folder"&&(p.items=p.items||[],p.items.push(r))}else i.items.push(r)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,r);if(!i||!Ie.existsSync(i))return!1;try{await Ie.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,r);let s=this.idToSlugMap.get(r);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(r)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${r}:`,s),!1}}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,r);if(!s)return!1;let o=this.findItemById(i.items,r);if(!o)return!1;let{id:l,type:f,items:c,...p}=n;return Object.assign(o,p),o.type==="folder"?await this.saveFolderToDir(s,o):await this.saveRequestToDir(s,o),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let o=this.findItemPath(e,r);if(!o||!Ie.existsSync(o))return!1;let l;if(n){let p=this.findItemPath(e,n);if(!p)return!1;l=p}else l=Te.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let c=Te.join(l,f);if(Ie.existsSync(c))return!1;try{await Ie.promises.rename(o,c);let p=this.findItemById(i.items,r);if(p){let h=p.type==="folder"?{...p,items:p.items?[...p.items]:[]}:{...p};if(this.deleteItemFromTree(i.items,r),n){let g=this.findItemById(i.items,n);g&&g.type==="folder"&&(g.items=g.items||[],g.items.push(h))}else i.items.push(h)}return!0}catch(p){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,p),!1}}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let o=[];for(let l of n){let f=this.idToSlugMap.get(l);f&&o.push(f)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let f=Te.join(l,Or.folder),c=Ie.readFileSync(f,"utf-8"),p=JSON.parse(c);p.order=o,await Ie.promises.writeFile(f,JSON.stringify(p,null,2),"utf-8");let h=this.findItemById(i.items,r);h&&h.type==="folder"&&h.items&&(h.items=this.sortItemsByOrder(h.items,n))}else{let l=Te.join(this.collectionsDir,s,Or.collection),f=Ie.readFileSync(l,"utf-8"),c=JSON.parse(f);c.order=o,await Ie.promises.writeFile(l,JSON.stringify(c,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,r){return oI(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=Te.join(this.collectionsDir,n),s=Xb(i,r);if(s)return s;let o=this.load(e);if(o){let f=this.buildSlugPath(o.items,r);if(f)return Te.join(i,...f)}let l=this.idToSlugMap.get(r);if(l)return Zb(i,l)}buildSlugPath(e,r){for(let n of e){let i=this.idToSlugMap.get(n.id);if(i){if(n.id===r)return[i];if(n.type==="folder"&&n.items){let s=this.buildSlugPath(n.items,r);if(s)return[i,...s]}}}}findItemById(e,r){return Kb(e,r)}deleteItemFromTree(e,r){return Qb(e,r)}}});var ht,ia=se(()=>{"use strict";ht=class{static parseSetCookie(e,r){let n=e.split(";").map(p=>p.trim());if(n.length===0)return null;let[i,...s]=n,o=i.indexOf("=");if(o===-1)return null;let l=i.substring(0,o).trim(),f=i.substring(o+1).trim(),c={name:l,value:f,domain:r};for(let p of s){let h=p.indexOf("="),g=(h===-1?p:p.substring(0,h)).toLowerCase(),v=h===-1?"":p.substring(h+1);switch(g){case"domain":c.domain=v.startsWith(".")?v.substring(1):v;break;case"path":c.path=v;break;case"expires":c.expires=v;break;case"max-age":c.maxAge=parseInt(v,10);break;case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break;case"samesite":c.sameSite=v;break}}return c}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let o of s){let l=this.parseSetCookie(o,r);l&&n.push(l)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.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,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.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 Js from"fs";import*as sa from"path";function qh(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function Jc(t){if(!Js.existsSync(t))return Mj();let e=Ih(sa.join(t,"_global.json"))||{},r=e.variables||{},n=e.defaultHeaders||{},i=Js.readdirSync(t).filter(c=>c.endsWith(".json")).filter(c=>!c.endsWith(".local.json")).filter(c=>!qh(c)),s={};for(let c of i){let p=Ih(sa.join(t,c))||{},h=sa.basename(c,".json");s[h]={description:p.description,requiresConfirmation:p.requiresConfirmation,variables:p.variables||{},secretVariables:p.secretVariables}}let l=(Ih(sa.join(t,"_global.local.json"))||{}).variables||{},f={};for(let c of Object.keys(s)){let p=sa.join(t,`${c}.local.json`);if(Js.existsSync(p)){let h=Ih(p)||{};f[c]={variables:h.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function Mj(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function Ih(t){try{if(!Js.existsSync(t))return null;let e=Js.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${t}:`,e),null}}var Oh=se(()=>{"use strict"});var Kn,Bl=se(()=>{"use strict";Kn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,o="",l=e.indexOf("?");l!==-1&&(o=e.substring(l),s=e.substring(0,l));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let c=/:(\w+)(?:\([^)]*\))?(\?)?/g,p=s.replace(c,(h,g,v)=>{let _=r[g];return _!==void 0&&_!==""?encodeURIComponent(_):v?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${g}`),h)});return p=p.replace(/([^:])\/+/g,"$1/"),p.length>1&&p.endsWith("/")&&(p=p.slice(0,-1)),`${n}${i}${p}${o}`}extractPathParams(e){let r=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=r.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,r){let n=e,i={};if(e.includes("?")){let[f,c]=e.split("?");n=f,c&&new URLSearchParams(c).forEach((h,g)=>{i[g]=h})}let s={...i,...r},o=new URLSearchParams;for(let[f,c]of Object.entries(s))c!=null&&o.append(f,c);let l=o.toString();return l?`${n}?${l}`:n}}});function lI(t,e=0){return(ir[t[e+0]]+ir[t[e+1]]+ir[t[e+2]]+ir[t[e+3]]+"-"+ir[t[e+4]]+ir[t[e+5]]+"-"+ir[t[e+6]]+ir[t[e+7]]+"-"+ir[t[e+8]]+ir[t[e+9]]+"-"+ir[t[e+10]]+ir[t[e+11]]+ir[t[e+12]]+ir[t[e+13]]+ir[t[e+14]]+ir[t[e+15]]).toLowerCase()}var ir,uI=se(()=>{ir=[];for(let t=0;t<256;++t)ir.push((t+256).toString(16).slice(1))});function rS(){return crypto.getRandomValues(Fj)}var Fj,cI=se(()=>{Fj=new Uint8Array(16)});function Dj(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Lj(t,e,r)}function Lj(t,e,r){t=t||{};let n=t.random??t.rng?.()??rS();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(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[r+i]=n[i];return e}return lI(n)}var Vl,fI=se(()=>{cI();uI();Vl=Dj});var nS=se(()=>{fI()});function jj(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function Uj(){return Date.now()}function dI(){return Vl()}function Hj(){return Vl()}function pI(t=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function Bj(){let t=pI(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function Vj(){return Math.random()<.5}function Wj(t=10){let e="0123456789abcdef",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function zj(){return Math.floor(Date.now()/1e3)}function Jj(){return new Date().toISOString()}function Gj(){return new Date().toISOString().split("T")[0]}function Yj(){return new Date().toISOString().split("T")[1].split(".")[0]}function Kj(){return new Date().toISOString()}function Qj(t=""){return Buffer.from(String(t)).toString("base64")}function Zj(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function Xj(t=""){return encodeURIComponent(String(t))}function e2(t=""){return decodeURIComponent(String(t))}function t2(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function ns(t,e){let r=hI[t];return r?e&&e.length>0?r(...e):r():null}function r2(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?t2(n):void 0,s=ns(r,i);return s===null?e:String(s)}catch{return e}})}function oa(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],o=i[1];if(!(s in e)){let l=ns(o);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var hI,kh=se(()=>{"use strict";nS();hI={randomInt:jj,timestamp:Uj,guid:Hj,uuid:dI,randomUUID:dI,randomString:pI,randomHexadecimal:Wj,randomEmail:Bj,randomBoolean:Vj,isoTimestamp:Kj,timestamp_s:zj,datetime:Jj,date:Gj,time:Yj,base64Encode:Qj,base64Decode:Zj,urlEncode:Xj,urlDecode:e2}});import*as Ph from"vm";function aa(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function la(t,e={}){try{let r={...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=Ph.createContext(r);return Ph.runInContext(t,n,{timeout:n2,displayErrors:!1})}catch{return}}var n2,Th=se(()=>{"use strict";n2=100});import*as Ah from"crypto";function i2(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function Yc(t){if(!t||!t.includes("|"))return null;let e=s2(t);if(e.length<2)return null;let r=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let o=o2(s);o&&n.push(o)}return n.length===0?null:{input:r,filters:n}}function s2(t){let e=[],r="",n=0,i=!1,s=!1;for(let o=0;o<t.length;o++){let l=t[o],f=o>0?t[o-1]:"",c=o<t.length-1?t[o+1]:"";if(f==="\\"){r+=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(c==="|"){r+="||",o++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function o2(t){let e=t.indexOf("(");if(e===-1)return{name:t.trim(),args:[]};let r=t.substring(0,e).trim(),n=t.substring(e+1,t.lastIndexOf(")"));return{name:r,args:a2(n)}}function a2(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let o=t[s];if((s>0?t[s-1]:"")==="\\"){r+=o;continue}if(o==="'"&&!i){n=!n,r+=o;continue}else if(o==='"'&&!n){i=!i,r+=o;continue}else if(o===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=o}return r.trim()&&e.push(r.trim()),e}function $t(t,e){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=Number(t);if(!isNaN(r)&&t!=="")return r;if(t==="true")return!0;if(t==="false")return!1;if(e&&t in e){let n=i2(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Kc(t,e,r={}){let n=t;for(let i of e)n=l2(n,i.name,i.args,r);return n}function l2(t,e,r,n){switch(e){case"upper":return String(t).toUpperCase();case"lower":return String(t).toLowerCase();case"trim":return String(t).trim();case"length":return Array.isArray(t)?t.length:String(t).length;case"substring":{let i=$t(r[0],n),s=r[1]!==void 0?$t(r[1],n):void 0;return String(t).substring(i<0?String(t).length+i:i,s!==void 0?s<0?String(t).length+s:s:void 0)}case"replace":{let i=r[0]!==void 0?String($t(r[0],n)):"",s=r[1]!==void 0?String($t(r[1],n)):"";return String(t).replace(new RegExp(c2(i),"g"),s)}case"split":{let i=r[0]!==void 0?String($t(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String($t(r[0],n)):",";return Array.isArray(t)?t.join(i):String(t)}case"removeQuotes":return String(t).replace(/["']/g,"");case"removeSpaces":return String(t).replace(/\s/g,"");case"format":{let i=r[0]!==void 0?String($t(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let o=$t(r[s],n);i=i.replace(`{${s}}`,String(o))}return i}case"add":{let i=$t(r[0],n);return Number(t)+i}case"subtract":{let i=$t(r[0],n);return Number(t)-i}case"multiply":{let i=$t(r[0],n);return Number(t)*i}case"abs":return Math.abs(Number(t));case"btoa":return Buffer.from(String(t)).toString("base64");case"atob":return Buffer.from(String(t),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(t));case"urlDecode":return decodeURIComponent(String(t));case"hash":{let i=String(r[0]!==void 0?$t(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?$t(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return Ah.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String($t(r[0],n)):"",s=String(r[1]!==void 0?$t(r[1],n):"sha256").toLowerCase(),o=String(r[2]!==void 0?$t(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return Ah.createHmac(f,i).update(String(t)).digest(o)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=$t(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=$t(r[0],n),s=r[1]!==void 0?$t(r[1],n):void 0;return Array.isArray(t)?t.slice(i,s):String(t).slice(i,s)}case"unique":return Array.isArray(t)?[...new Set(t)]:t;case"filter":return!Array.isArray(t)||!r[0]?t:u2(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String($t(s,n)));return i.length===1?t.map(s=>Gc(s,i[0])):t.map(s=>{let o={};for(let l of i){let f=Gc(s,l);f!==void 0&&(o[l]=f)}return o})}case"prop":{let i=r[0]!==void 0?String($t(r[0],n)):"";if(Array.isArray(t)){let s=t.map(o=>Gc(o,i)).filter(o=>o!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?Gc(t,i):t}case"parseJSON":try{return JSON.parse(String(t))}catch{return t}case"stringify":try{return JSON.stringify(t)}catch{return String(t)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t));case"isUrl":try{return new URL(String(t)),!0}catch{return!1}case"setIfValue":return t||void 0;case"setNull":return t===null?null:t;default:return t}}function u2(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,o]=n,l=$t(o,r);return t.filter(f=>{let c=Gc(f,i);if(c===void 0)return!1;switch(s){case">":return Number(c)>Number(l);case">=":return Number(c)>=Number(l);case"<":return Number(c)<Number(l);case"<=":return Number(c)<=Number(l);case"=":return String(c)===String(l);case"!=":return String(c)!==String(l);case"*=":return String(c).includes(String(l));case"^=":return String(c).startsWith(String(l));case"$=":return String(c).endsWith(String(l));default:return!0}})}function Gc(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function c2(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var $h=se(()=>{"use strict"});function mI(t,e){if(t)return t.split(",").map(r=>{let n=r.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],o=Number(s);return!isNaN(o)&&s!==""?o:s}return n})}function f2(t){return new ua(t)}var ua,ca,Qc=se(()=>{"use strict";kh();Th();$h();ua=class t{allVariables;static MAX_RESOLUTION_DEPTH=20;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.variables}}resolveString(e,r=!1){return typeof e!="string"?e:this.resolveUntilStable(e,this.allVariables,r)}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};return this.resolveUntilStable(e,i,n)}resolveUntilStable(e,r,n){let i=e;for(let s=0;s<t.MAX_RESOLUTION_DEPTH;s++){let o=this.resolveSinglePass(i,r,n);if(o===i)break;i=o}return i}resolveSinglePass(e,r,n){if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(f,c)=>this.resolveTemplateContent(c.trim(),r,f));let i="",s=0,o=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=o.exec(e))!==null;){let f=l[1].trim(),c=this.resolveTemplateContent(f,r,l[0]);if(c!==l[0]){i+=e.slice(s,l.index);let p=this.getStringContext(e,l.index);i+=p?this.escapeForString(String(c),p):String(c)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,o]of Object.entries(e))i[s]=this.resolveObjectWithExtra(o,r,n);return i}return e}resolveTemplateContent(e,r,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let l=mI(i[2],r),f=ns(i[1],l);return f!==null?String(f):n}let s=Yc(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let f=Kc(l,s.filters,r);return f!==void 0?String(f):n}return n}let o=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(o){let l=o[1];if(r[l]!==void 0){let f=this.deserializeValue(r[l]),c=o[2],p=this.resolvePropertyAccess(f,c);if(p!==void 0)return typeof p=="object"?JSON.stringify(p):String(p)}}if(r[e]!==void 0){let l=r[e];return typeof l=="string"&&l.charCodeAt(0)===30?l.slice(1):String(l)}if(aa(e)){let l=this.deserializeVariables(r),f=oa(e,l),c=la(e,f);if(c!==void 0)return String(c)}return n}resolveFilterInput(e,r){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=mI(n[2],r),o=ns(n[1],s);return o!==null?o:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let o=this.deserializeValue(r[s]),l=this.resolvePropertyAccess(o,i[2]);if(l!==void 0)return l}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(aa(e)){let s=this.deserializeVariables(r),o=oa(e,s),l=la(e,o);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 r={};for(let[n,i]of Object.entries(e))r[n]=this.deserializeValue(i);return r}resolvePropertyAccess(e,r){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(r))!==null;){if(n==null)return;if(s[1]!==void 0){let o=s[1];/^\d+$/.test(o)?n=n[Number(o)]:n=n[o.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},ca=class{interpolate(e,r){return!e||typeof e!="string"?e:new ua({globals:{},collectionVariables:{},environmentVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}}});import*as d2 from"http";import*as Zc from"https";import{URL as gI}from"url";import*as Nh from"zlib";var Qn,fa,Xc=se(()=>{"use strict";Qn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},fa=class{settings;version;constructor(e){this.settings={...Qn,...e};try{this.version=ft("../../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 r=this.mergeSettings(e.settings);return await this.executeInternal(e,r,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,r,n,i){let s=Date.now(),o=new gI(e.url),l=o.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(h=>h.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let p={hostname:o.hostname,port:o.port||(l?443:80),path:o.pathname+o.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(p.headers["Accept-Encoding"]="gzip, deflate"),l&&(p.rejectUnauthorized=r.strictSSL,r.strictSSL?p.agent=Zc.globalAgent:p.agent=new Zc.Agent({rejectUnauthorized:!1})),new Promise((h,g)=>{if(i?.aborted){let w=new Error("Request cancelled");w.name="AbortError",g(w);return}let _=(l?Zc:d2).request(p,async w=>{let E=w.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(E)){if(n>=r.maxRedirects){g(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let T=w.headers.location;if(!T){g(new Error("Redirect response missing Location header"));return}let N=new gI(T,e.url).toString(),$=e.method;!r.followOriginalMethod&&[301,302,303].includes(E)&&($="GET");let j={...e.headers};r.followAuthHeader||(delete j.authorization,delete j.Authorization);try{let G=await this.executeInternal({...e,url:N,method:$,headers:j,body:$==="GET"?void 0:e.body},r,n+1,i),O=Date.now();G.time=O-s,h(G)}catch(G){g(G)}return}let k=[];w.on("data",T=>k.push(T)),w.on("end",()=>{let T=Date.now(),N=Buffer.concat(k),$=w.headers["content-encoding"];if(r.decompress&&$)try{$==="gzip"?N=Nh.gunzipSync(N):$==="deflate"&&(N=Nh.inflateSync(N))}catch(C){console.warn("[NodeHttpClient] Decompression failed:",C)}let j=N.toString("utf-8"),G={};for(let[C,A]of Object.entries(w.headers))(typeof A=="string"||Array.isArray(A))&&(G[C]=A);let O=this.parseCookies(w.headers["set-cookie"],o.hostname);h({status:w.statusCode||0,statusText:w.statusMessage||"",headers:G,cookies:O,body:j,time:T-s,size:N.length})})});if(i&&i.addEventListener("abort",()=>{_.destroy();let w=new Error("Request cancelled");w.name="AbortError",g(w)}),_.on("error",w=>{g(w)}),_.on("timeout",()=>{_.destroy(),g(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let w=typeof e.body=="string"?e.body:JSON.stringify(e.body);_.write(w)}_.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 r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}parseCookies(e,r){return e?e.map(n=>{let i=n.split(";").map(p=>p.trim()),[s,...o]=i,[l,f]=s.split("="),c={name:l.trim(),value:f?.trim()||"",domain:r};for(let p of o){let[h,g]=p.split("=");switch(h.toLowerCase().trim()){case"domain":c.domain=g?.trim();break;case"path":c.path=g?.trim();break;case"expires":c.expires=g?.trim();break;case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break}}return c}):[]}}});function iS(t){return{timeout:t?.timeout??Qn.timeout,followRedirects:t?.followRedirects??Qn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Qn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Qn.followAuthHeader,maxRedirects:t?.maxRedirects??Qn.maxRedirects,strictSSL:t?.strictSSL??Qn.strictSSL,decompress:t?.decompress??Qn.decompress,includeCookies:t?.includeCookies??Qn.includeCookies}}var sS=se(()=>{"use strict";Xc()});var is,ef=se(()=>{"use strict";sS();is=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=iS(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let o=await this.interceptors.executeErrorInterceptors(s,e,n);if(o)return o;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let o=await this.interceptors.executeErrorInterceptors(s,i,n);if(o)return o;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var ss,oS,aS,lS,tf=se(()=>{"use strict";ss=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 r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(o){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,o),o}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,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((r,n)=>(r.priority??100)-(n.priority??100))}},oS=class{name="logging";priority=1e3;intercept(e,r){return e}},aS=class{name="timing";priority=1;intercept(e,r,n){return e}},lS=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,r=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=r}handle(e,r,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}}});var yI=H((Wl,rf)=>{(function(){var t,e="4.18.1",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",o="Invalid `imports` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,c="__lodash_placeholder__",p=1,h=2,g=4,v=1,_=2,w=1,E=2,k=4,T=8,N=16,$=32,j=64,G=128,O=256,C=512,A=30,D="...",B=800,F=16,K=1,ee=2,ie=3,pe=1/0,ke=9007199254740991,de=17976931348623157e292,le=NaN,ve=4294967295,We=ve-1,mt=ve>>>1,ce=[["ary",G],["bind",w],["bindKey",E],["curry",T],["curryRight",N],["flip",C],["partial",$],["partialRight",j],["rearg",O]],rr="[object Arguments]",$e="[object Array]",nt="[object AsyncFunction]",Xr="[object Boolean]",Ar="[object Date]",_t="[object DOMException]",Rt="[object Error]",pn="[object Function]",Eo="[object GeneratorFunction]",Zt="[object Map]",Io="[object Number]",Ay="[object Null]",Mn="[object Object]",ap="[object Promise]",lp="[object Proxy]",Xt="[object RegExp]",Sr="[object Set]",qo="[object String]",Za="[object Symbol]",up="[object Undefined]",zt="[object WeakMap]",cp="[object WeakSet]",ji="[object ArrayBuffer]",Fn="[object DataView]",pt="[object Float32Array]",Xa="[object Float64Array]",el="[object Int8Array]",Cs="[object Int16Array]",Oo="[object Int32Array]",xs="[object Uint8Array]",yi="[object Uint8ClampedArray]",Es="[object Uint16Array]",sc="[object Uint32Array]",tl=/\b__p \+= '';/g,$y=/\b(__p \+=) '' \+/g,ko=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ui=/&(?:amp|lt|gt|quot|#39);/g,rl=/[&<>"']/g,nl=RegExp(Ui.source),fe=RegExp(rl.source),Ny=/<%-([\s\S]+?)%>/g,My=/<%([\s\S]+?)%>/g,hn=/<%=([\s\S]+?)%>/g,$r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fe=/^\w*$/,oc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,it=/[\\^$.*+?()[\]{}|]/g,Po=RegExp(it.source),ac=/^\s+/,il=/\s/,er=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Dn=/\{\n\/\* \[wrapped with (.+)\] \*/,mn=/,? & /,Ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Nr=/[()=,{}\[\]\/\s]/,Ln=/\\(\\)?/g,Hi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fp=/\w*$/,Fy=/^[-+]0x[0-9a-f]+$/i,To=/^0b[01]+$/i,dp=/^\[object .+?Constructor\]$/,Dy=/^0o[0-7]+$/i,Is=/^(?:0|[1-9]\d*)$/,Ao=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$o=/($^)/,Ly=/['\n\r\u2028\u2029\\]/g,sl="\\ud800-\\udfff",jy="\\u0300-\\u036f",kt="\\ufe20-\\ufe2f",lc="\\u20d0-\\u20ff",pp=jy+kt+lc,uc="\\u2700-\\u27bf",cc="a-z\\xdf-\\xf6\\xf8-\\xff",Uy="\\xac\\xb1\\xd7\\xf7",Hy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",By="\\u2000-\\u206f",Vy=" \\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",hp="A-Z\\xc0-\\xd6\\xd8-\\xde",mp="\\ufe0e\\ufe0f",fc=Uy+Hy+By+Vy,ol="['\u2019]",Wy="["+sl+"]",gp="["+fc+"]",al="["+pp+"]",dc="\\d+",zy="["+uc+"]",qs="["+cc+"]",No="[^"+sl+fc+dc+uc+cc+hp+"]",ll="\\ud83c[\\udffb-\\udfff]",Mo="(?:"+al+"|"+ll+")",gn="[^"+sl+"]",pc="(?:\\ud83c[\\udde6-\\uddff]){2}",hc="[\\ud800-\\udbff][\\udc00-\\udfff]",Os="["+hp+"]",yp="\\u200d",vp="(?:"+qs+"|"+No+")",Jy="(?:"+Os+"|"+No+")",bp="(?:"+ol+"(?:d|ll|m|re|s|t|ve))?",Sp="(?:"+ol+"(?:D|LL|M|RE|S|T|VE))?",ul=Mo+"?",wp="["+mp+"]?",_p="(?:"+yp+"(?:"+[gn,pc,hc].join("|")+")"+wp+ul+")*",Gy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Yy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Rp=wp+ul+_p,Ky="(?:"+[zy,pc,hc].join("|")+")"+Rp,Qy="(?:"+[gn+al+"?",al,pc,hc,Wy].join("|")+")",Zy=RegExp(ol,"g"),Xy=RegExp(al,"g"),mc=RegExp(ll+"(?="+ll+")|"+Qy+Rp,"g"),ev=RegExp([Os+"?"+qs+"+"+bp+"(?="+[gp,Os,"$"].join("|")+")",Jy+"+"+Sp+"(?="+[gp,Os+vp,"$"].join("|")+")",Os+"?"+vp+"+"+bp,Os+"+"+Sp,Yy,Gy,dc,Ky].join("|"),"g"),tv=RegExp("["+yp+sl+pp+mp+"]"),rv=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nv=["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"],iv=-1,bt={};bt[pt]=bt[Xa]=bt[el]=bt[Cs]=bt[Oo]=bt[xs]=bt[yi]=bt[Es]=bt[sc]=!0,bt[rr]=bt[$e]=bt[ji]=bt[Xr]=bt[Fn]=bt[Ar]=bt[Rt]=bt[pn]=bt[Zt]=bt[Io]=bt[Mn]=bt[Xt]=bt[Sr]=bt[qo]=bt[zt]=!1;var gt={};gt[rr]=gt[$e]=gt[ji]=gt[Fn]=gt[Xr]=gt[Ar]=gt[pt]=gt[Xa]=gt[el]=gt[Cs]=gt[Oo]=gt[Zt]=gt[Io]=gt[Mn]=gt[Xt]=gt[Sr]=gt[qo]=gt[Za]=gt[xs]=gt[yi]=gt[Es]=gt[sc]=!0,gt[Rt]=gt[pn]=gt[zt]=!1;var gc={\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"},yc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},sv={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Cp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xp=parseFloat,ov=parseInt,Ep=typeof global=="object"&&global&&global.Object===Object&&global,av=typeof self=="object"&&self&&self.Object===Object&&self,Ut=Ep||av||Function("return this")(),cl=typeof Wl=="object"&&Wl&&!Wl.nodeType&&Wl,st=cl&&typeof rf=="object"&&rf&&!rf.nodeType&&rf,ks=st&&st.exports===cl,Bi=ks&&Ep.process,Mr=(function(){try{var V=st&&st.require&&st.require("util").types;return V||Bi&&Bi.binding&&Bi.binding("util")}catch{}})(),vc=Mr&&Mr.isArrayBuffer,Ip=Mr&&Mr.isDate,qp=Mr&&Mr.isMap,Fo=Mr&&Mr.isRegExp,jn=Mr&&Mr.isSet,fl=Mr&&Mr.isTypedArray;function wr(V,Q,z){switch(z.length){case 0:return V.call(Q);case 1:return V.call(Q,z[0]);case 2:return V.call(Q,z[0],z[1]);case 3:return V.call(Q,z[0],z[1],z[2])}return V.apply(Q,z)}function Un(V,Q,z,ue){for(var Re=-1,tt=V==null?0:V.length;++Re<tt;){var ut=V[Re];Q(ue,ut,z(ut),V)}return ue}function _r(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue&&Q(V[z],z,V)!==!1;);return V}function bc(V,Q){for(var z=V==null?0:V.length;z--&&Q(V[z],z,V)!==!1;);return V}function Op(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue;)if(!Q(V[z],z,V))return!1;return!0}function vi(V,Q){for(var z=-1,ue=V==null?0:V.length,Re=0,tt=[];++z<ue;){var ut=V[z];Q(ut,z,V)&&(tt[Re++]=ut)}return tt}function dl(V,Q){var z=V==null?0:V.length;return!!z&&Vi(V,Q,0)>-1}function Ps(V,Q,z){for(var ue=-1,Re=V==null?0:V.length;++ue<Re;)if(z(Q,V[ue]))return!0;return!1}function yt(V,Q){for(var z=-1,ue=V==null?0:V.length,Re=Array(ue);++z<ue;)Re[z]=Q(V[z],z,V);return Re}function bi(V,Q){for(var z=-1,ue=Q.length,Re=V.length;++z<ue;)V[Re+z]=Q[z];return V}function Sc(V,Q,z,ue){var Re=-1,tt=V==null?0:V.length;for(ue&&tt&&(z=V[++Re]);++Re<tt;)z=Q(z,V[Re],Re,V);return z}function lv(V,Q,z,ue){var Re=V==null?0:V.length;for(ue&&Re&&(z=V[--Re]);Re--;)z=Q(z,V[Re],Re,V);return z}function pl(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue;)if(Q(V[z],z,V))return!0;return!1}var uv=Do("length");function cv(V){return V.split("")}function fv(V){return V.match(Ft)||[]}function kp(V,Q,z){var ue;return z(V,function(Re,tt,ut){if(Q(Re,tt,ut))return ue=tt,!1}),ue}function hl(V,Q,z,ue){for(var Re=V.length,tt=z+(ue?1:-1);ue?tt--:++tt<Re;)if(Q(V[tt],tt,V))return tt;return-1}function Vi(V,Q,z){return Q===Q?Sv(V,Q,z):hl(V,Wi,z)}function dv(V,Q,z,ue){for(var Re=z-1,tt=V.length;++Re<tt;)if(ue(V[Re],Q))return Re;return-1}function Wi(V){return V!==V}function Pp(V,Q){var z=V==null?0:V.length;return z?_c(V,Q)/z:le}function Do(V){return function(Q){return Q==null?t:Q[V]}}function wc(V){return function(Q){return V==null?t:V[Q]}}function ml(V,Q,z,ue,Re){return Re(V,function(tt,ut,ze){z=ue?(ue=!1,tt):Q(z,tt,ut,ze)}),z}function pv(V,Q){var z=V.length;for(V.sort(Q);z--;)V[z]=V[z].value;return V}function _c(V,Q){for(var z,ue=-1,Re=V.length;++ue<Re;){var tt=Q(V[ue]);tt!==t&&(z=z===t?tt:z+tt)}return z}function Rc(V,Q){for(var z=-1,ue=Array(V);++z<V;)ue[z]=Q(z);return ue}function hv(V,Q){return yt(Q,function(z){return[z,V[z]]})}function Cc(V){return V&&V.slice(0,Mp(V)+1).replace(ac,"")}function Rr(V){return function(Q){return V(Q)}}function gl(V,Q){return yt(Q,function(z){return V[z]})}function lt(V,Q){return V.has(Q)}function Tp(V,Q){for(var z=-1,ue=V.length;++z<ue&&Vi(Q,V[z],0)>-1;);return z}function Ap(V,Q){for(var z=V.length;z--&&Vi(Q,V[z],0)>-1;);return z}function $p(V,Q){for(var z=V.length,ue=0;z--;)V[z]===Q&&++ue;return ue}var mv=wc(gc),gv=wc(yc);function yv(V){return"\\"+Cp[V]}function Lo(V,Q){return V==null?t:V[Q]}function Ts(V){return tv.test(V)}function vv(V){return rv.test(V)}function bv(V){for(var Q,z=[];!(Q=V.next()).done;)z.push(Q.value);return z}function As(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue,Re){z[++Q]=[Re,ue]}),z}function jo(V,Q){return function(z){return V(Q(z))}}function yn(V,Q){for(var z=-1,ue=V.length,Re=0,tt=[];++z<ue;){var ut=V[z];(ut===Q||ut===c)&&(V[z]=c,tt[Re++]=z)}return tt}function yl(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue){z[++Q]=ue}),z}function Np(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue){z[++Q]=[ue,ue]}),z}function Sv(V,Q,z){for(var ue=z-1,Re=V.length;++ue<Re;)if(V[ue]===Q)return ue;return-1}function xc(V,Q,z){for(var ue=z+1;ue--;)if(V[ue]===Q)return ue;return ue}function Si(V){return Ts(V)?_v(V):uv(V)}function Cr(V){return Ts(V)?Rv(V):cv(V)}function Mp(V){for(var Q=V.length;Q--&&il.test(V.charAt(Q)););return Q}var wv=wc(sv);function _v(V){for(var Q=mc.lastIndex=0;mc.test(V);)++Q;return Q}function Rv(V){return V.match(mc)||[]}function Cv(V){return V.match(ev)||[]}var xv=(function V(Q){Q=Q==null?Ut:wi.defaults(Ut.Object(),Q,wi.pick(Ut,nv));var z=Q.Array,ue=Q.Date,Re=Q.Error,tt=Q.Function,ut=Q.Math,ze=Q.Object,vl=Q.RegExp,Ev=Q.String,xr=Q.TypeError,Uo=z.prototype,Iv=tt.prototype,$s=ze.prototype,Ho=Q["__core-js_shared__"],bl=Iv.toString,ot=$s.hasOwnProperty,qv=0,Fp=(function(){var a=/[^.]+$/.exec(Ho&&Ho.keys&&Ho.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),Sl=$s.toString,Ov=bl.call(ze),kv=Ut._,Pv=vl("^"+bl.call(ot).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wl=ks?Q.Buffer:t,_i=Q.Symbol,_l=Q.Uint8Array,Dp=wl?wl.allocUnsafe:t,Rl=jo(ze.getPrototypeOf,ze),Lp=ze.create,Bo=$s.propertyIsEnumerable,Cl=Uo.splice,jp=_i?_i.isConcatSpreadable:t,Vo=_i?_i.iterator:t,zi=_i?_i.toStringTag:t,xl=(function(){try{var a=ea(ze,"defineProperty");return a({},"",{}),a}catch{}})(),Tv=Q.clearTimeout!==Ut.clearTimeout&&Q.clearTimeout,Av=ue&&ue.now!==Ut.Date.now&&ue.now,$v=Q.setTimeout!==Ut.setTimeout&&Q.setTimeout,Wo=ut.ceil,zo=ut.floor,El=ze.getOwnPropertySymbols,Il=wl?wl.isBuffer:t,Ji=Q.isFinite,ql=Uo.join,Up=jo(ze.keys,ze),Ct=ut.max,Jt=ut.min,Hp=ue.now,Nv=Q.parseInt,Bp=ut.random,Mv=Uo.reverse,Ec=ea(Q,"DataView"),Jo=ea(Q,"Map"),Ic=ea(Q,"Promise"),Ns=ea(Q,"Set"),Go=ea(Q,"WeakMap"),Yo=ea(ze,"create"),Ol=Go&&new Go,Ms={},Fv=ta(Ec),Dv=ta(Jo),Lv=ta(Ic),jv=ta(Ns),Uv=ta(Go),kl=_i?_i.prototype:t,Ko=kl?kl.valueOf:t,Vp=kl?kl.toString:t;function q(a){if(Tt(a)&&!Ee(a)&&!(a instanceof De)){if(a instanceof ur)return a;if(ot.call(a,"__wrapped__"))return yE(a)}return new ur(a)}var Fs=(function(){function a(){}return function(u){if(!Pt(u))return{};if(Lp)return Lp(u);a.prototype=u;var m=new a;return a.prototype=t,m}})();function Pl(){}function ur(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}q.templateSettings={escape:Ny,evaluate:My,interpolate:hn,variable:"",imports:{_:q}},q.prototype=Pl.prototype,q.prototype.constructor=q,ur.prototype=Fs(Pl.prototype),ur.prototype.constructor=ur;function De(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ve,this.__views__=[]}function Hv(){var a=new De(this.__wrapped__);return a.__actions__=Fr(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Fr(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Fr(this.__views__),a}function Bv(){if(this.__filtered__){var a=new De(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function qc(){var a=this.__wrapped__.value(),u=this.__dir__,m=Ee(a),b=u<0,x=m?a.length:0,P=QN(0,x,this.__views__),M=P.start,U=P.end,W=U-M,Z=b?U:M-1,X=this.__iteratees__,te=X.length,oe=0,he=Jt(W,this.__takeCount__);if(!m||!b&&x==W&&he==W)return jx(a,this.__actions__);var we=[];e:for(;W--&&oe<he;){Z+=u;for(var Pe=-1,be=a[Z];++Pe<te;){var Be=X[Pe],Je=Be.iteratee,on=Be.type,qr=Je(be);if(on==ee)be=qr;else if(!qr){if(on==K)continue e;break e}}we[oe++]=be}return we}De.prototype=Fs(Pl.prototype),De.prototype.constructor=De;function vn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Vv(){this.__data__=Yo?Yo(null):{},this.size=0}function Wv(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function zv(a){var u=this.__data__;if(Yo){var m=u[a];return m===l?t:m}return ot.call(u,a)?u[a]:t}function Jv(a){var u=this.__data__;return Yo?u[a]!==t:ot.call(u,a)}function Gv(a,u){var m=this.__data__;return this.size+=this.has(a)?0:1,m[a]=Yo&&u===t?l:u,this}vn.prototype.clear=Vv,vn.prototype.delete=Wv,vn.prototype.get=zv,vn.prototype.has=Jv,vn.prototype.set=Gv;function Hn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Wp(){this.__data__=[],this.size=0}function Yv(a){var u=this.__data__,m=Al(u,a);if(m<0)return!1;var b=u.length-1;return m==b?u.pop():Cl.call(u,m,1),--this.size,!0}function Kv(a){var u=this.__data__,m=Al(u,a);return m<0?t:u[m][1]}function zp(a){return Al(this.__data__,a)>-1}function Qv(a,u){var m=this.__data__,b=Al(m,a);return b<0?(++this.size,m.push([a,u])):m[b][1]=u,this}Hn.prototype.clear=Wp,Hn.prototype.delete=Yv,Hn.prototype.get=Kv,Hn.prototype.has=zp,Hn.prototype.set=Qv;function Bn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Zv(){this.size=0,this.__data__={hash:new vn,map:new(Jo||Hn),string:new vn}}function Ri(a){var u=ph(this,a).delete(a);return this.size-=u?1:0,u}function Jp(a){return ph(this,a).get(a)}function Xv(a){return ph(this,a).has(a)}function eb(a,u){var m=ph(this,a),b=m.size;return m.set(a,u),this.size+=m.size==b?0:1,this}Bn.prototype.clear=Zv,Bn.prototype.delete=Ri,Bn.prototype.get=Jp,Bn.prototype.has=Xv,Bn.prototype.set=eb;function Gi(a){var u=-1,m=a==null?0:a.length;for(this.__data__=new Bn;++u<m;)this.add(a[u])}function re(a){return this.__data__.set(a,l),this}function tb(a){return this.__data__.has(a)}Gi.prototype.add=Gi.prototype.push=re,Gi.prototype.has=tb;function en(a){var u=this.__data__=new Hn(a);this.size=u.size}function Gp(){this.__data__=new Hn,this.size=0}function Ye(a){var u=this.__data__,m=u.delete(a);return this.size=u.size,m}function Tl(a){return this.__data__.get(a)}function Yp(a){return this.__data__.has(a)}function Oc(a,u){var m=this.__data__;if(m instanceof Hn){var b=m.__data__;if(!Jo||b.length<r-1)return b.push([a,u]),this.size=++m.size,this;m=this.__data__=new Bn(b)}return m.set(a,u),this.size=m.size,this}en.prototype.clear=Gp,en.prototype.delete=Ye,en.prototype.get=Tl,en.prototype.has=Yp,en.prototype.set=Oc;function Kp(a,u){var m=Ee(a),b=!m&&ra(a),x=!m&&!b&&Vs(a),P=!m&&!b&&!x&&Ll(a),M=m||b||x||P,U=M?Rc(a.length,Ev):[],W=U.length;for(var Z in a)(u||ot.call(a,Z))&&!(M&&(Z=="length"||x&&(Z=="offset"||Z=="parent")||P&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||Zi(Z,W)))&&U.push(Z);return U}function Qp(a){var u=a.length;return u?a[hb(0,u-1)]:t}function rb(a,u){return hh(Fr(a),Ci(u,0,a.length))}function nb(a){return hh(Fr(a))}function kc(a,u,m){(m!==t&&!Gn(a[u],m)||m===t&&!(u in a))&&tn(a,u,m)}function Er(a,u,m){var b=a[u];(!(ot.call(a,u)&&Gn(b,m))||m===t&&!(u in a))&&tn(a,u,m)}function Al(a,u){for(var m=a.length;m--;)if(Gn(a[m][0],u))return m;return-1}function Zp(a,u,m,b){return xi(a,function(x,P,M){u(b,x,m(x),M)}),b}function Xp(a,u){return a&&Ei(u,tr(u),a)}function ib(a,u){return a&&Ei(u,Lr(u),a)}function tn(a,u,m){u=="__proto__"&&xl?xl(a,u,{configurable:!0,enumerable:!0,value:m,writable:!0}):a[u]=m}function Pc(a,u){for(var m=-1,b=u.length,x=z(b),P=a==null;++m<b;)x[m]=P?t:jb(a,u[m]);return x}function Ci(a,u,m){return a===a&&(m!==t&&(a=a<=m?a:m),u!==t&&(a=a>=u?a:u)),a}function cr(a,u,m,b,x,P){var M,U=u&p,W=u&h,Z=u&g;if(m&&(M=x?m(a,b,x,P):m(a)),M!==t)return M;if(!Pt(a))return a;var X=Ee(a);if(X){if(M=XN(a),!U)return Fr(a,M)}else{var te=fr(a),oe=te==pn||te==Eo;if(Vs(a))return Bx(a,U);if(te==Mn||te==rr||oe&&!x){if(M=W||oe?{}:lE(a),!U)return W?HN(a,ib(M,a)):UN(a,Xp(M,a))}else{if(!gt[te])return x?a:{};M=eM(a,te,U)}}P||(P=new en);var he=P.get(a);if(he)return he;P.set(a,M),FE(a)?a.forEach(function(be){M.add(cr(be,u,m,be,a,P))}):NE(a)&&a.forEach(function(be,Be){M.set(Be,cr(be,u,m,Be,a,P))});var we=Z?W?xb:Cb:W?Lr:tr,Pe=X?t:we(a);return _r(Pe||a,function(be,Be){Pe&&(Be=be,be=a[Be]),Er(M,Be,cr(be,u,m,Be,a,P))}),M}function sb(a){var u=tr(a);return function(m){return bn(m,a,u)}}function bn(a,u,m){var b=m.length;if(a==null)return!b;for(a=ze(a);b--;){var x=m[b],P=u[x],M=a[x];if(M===t&&!(x in a)||!P(M))return!1}return!0}function Tc(a,u,m){if(typeof a!="function")throw new xr(i);return Lc(function(){a.apply(t,m)},u)}function Qo(a,u,m,b){var x=-1,P=dl,M=!0,U=a.length,W=[],Z=u.length;if(!U)return W;m&&(u=yt(u,Rr(m))),b?(P=Ps,M=!1):u.length>=r&&(P=lt,M=!1,u=new Gi(u));e:for(;++x<U;){var X=a[x],te=m==null?X:m(X);if(X=b||X!==0?X:0,M&&te===te){for(var oe=Z;oe--;)if(u[oe]===te)continue e;W.push(X)}else P(u,te,b)||W.push(X)}return W}var xi=Gx(Sn),eh=Gx(Vn,!0);function ob(a,u){var m=!0;return xi(a,function(b,x,P){return m=!!u(b,x,P),m}),m}function $l(a,u,m){for(var b=-1,x=a.length;++b<x;){var P=a[b],M=u(P);if(M!=null&&(U===t?M===M&&!sn(M):m(M,U)))var U=M,W=P}return W}function ab(a,u,m,b){var x=a.length;for(m=qe(m),m<0&&(m=-m>x?0:x+m),b=b===t||b>x?x:qe(b),b<0&&(b+=x),b=m>b?0:LE(b);m<b;)a[m++]=u;return a}function th(a,u){var m=[];return xi(a,function(b,x,P){u(b,x,P)&&m.push(b)}),m}function Gt(a,u,m,b,x){var P=-1,M=a.length;for(m||(m=rM),x||(x=[]);++P<M;){var U=a[P];u>0&&m(U)?u>1?Gt(U,u-1,m,b,x):bi(x,U):b||(x[x.length]=U)}return x}var Ac=Yx(),rh=Yx(!0);function Sn(a,u){return a&&Ac(a,u,tr)}function Vn(a,u){return a&&rh(a,u,tr)}function Nl(a,u){return vi(u,function(m){return Xi(a[m])})}function Yi(a,u){u=Hs(u,a);for(var m=0,b=u.length;a!=null&&m<b;)a=a[Jn(u[m++])];return m&&m==b?a:t}function nh(a,u,m){var b=u(a);return Ee(a)?b:bi(b,m(a))}function nr(a){return a==null?a===t?up:Ay:zi&&zi in ze(a)?KN(a):uM(a)}function $c(a,u){return a>u}function lb(a,u){return a!=null&&ot.call(a,u)}function ub(a,u){return a!=null&&u in ze(a)}function cb(a,u,m){return a>=Jt(u,m)&&a<Ct(u,m)}function rn(a,u,m){for(var b=m?Ps:dl,x=a[0].length,P=a.length,M=P,U=z(P),W=1/0,Z=[];M--;){var X=a[M];M&&u&&(X=yt(X,Rr(u))),W=Jt(X.length,W),U[M]=!m&&(u||x>=120&&X.length>=120)?new Gi(M&&X):t}X=a[0];var te=-1,oe=U[0];e:for(;++te<x&&Z.length<W;){var he=X[te],we=u?u(he):he;if(he=m||he!==0?he:0,!(oe?lt(oe,we):b(Z,we,m))){for(M=P;--M;){var Pe=U[M];if(!(Pe?lt(Pe,we):b(a[M],we,m)))continue e}oe&&oe.push(we),Z.push(he)}}return Z}function Ds(a,u,m,b){return Sn(a,function(x,P,M){u(b,m(x),P,M)}),b}function Zo(a,u,m){u=Hs(u,a),a=dE(a,u);var b=a==null?a:a[Jn(_n(u))];return b==null?t:wr(b,a,m)}function ih(a){return Tt(a)&&nr(a)==rr}function fb(a){return Tt(a)&&nr(a)==ji}function db(a){return Tt(a)&&nr(a)==Ar}function Xo(a,u,m,b,x){return a===u?!0:a==null||u==null||!Tt(a)&&!Tt(u)?a!==a&&u!==u:Nc(a,u,m,b,Xo,x)}function Nc(a,u,m,b,x,P){var M=Ee(a),U=Ee(u),W=M?$e:fr(a),Z=U?$e:fr(u);W=W==rr?Mn:W,Z=Z==rr?Mn:Z;var X=W==Mn,te=Z==Mn,oe=W==Z;if(oe&&Vs(a)){if(!Vs(u))return!1;M=!0,X=!1}if(oe&&!X)return P||(P=new en),M||Ll(a)?sE(a,u,m,b,x,P):GN(a,u,W,m,b,x,P);if(!(m&v)){var he=X&&ot.call(a,"__wrapped__"),we=te&&ot.call(u,"__wrapped__");if(he||we){var Pe=he?a.value():a,be=we?u.value():u;return P||(P=new en),x(Pe,be,m,b,P)}}return oe?(P||(P=new en),YN(a,u,m,b,x,P)):!1}function Ls(a){return Tt(a)&&fr(a)==Zt}function js(a,u,m,b){var x=m.length,P=x,M=!b;if(a==null)return!P;for(a=ze(a);x--;){var U=m[x];if(M&&U[2]?U[1]!==a[U[0]]:!(U[0]in a))return!1}for(;++x<P;){U=m[x];var W=U[0],Z=a[W],X=U[1];if(M&&U[2]){if(Z===t&&!(W in a))return!1}else{var te=new en;if(b)var oe=b(Z,X,W,a,u,te);if(!(oe===t?Xo(X,Z,v|_,b,te):oe))return!1}}return!0}function He(a){if(!Pt(a)||iM(a))return!1;var u=Xi(a)?Pv:dp;return u.test(ta(a))}function d(a){return Tt(a)&&nr(a)==Xt}function y(a){return Tt(a)&&fr(a)==Sr}function S(a){return Tt(a)&&Sh(a.length)&&!!bt[nr(a)]}function R(a){return typeof a=="function"?a:a==null?jr:typeof a=="object"?Ee(a)?Le(a[0],a[1]):_e(a):QE(a)}function I(a){if(!Dc(a))return Up(a);var u=[];for(var m in ze(a))ot.call(a,m)&&m!="constructor"&&u.push(m);return u}function L(a){if(!Pt(a))return lM(a);var u=Dc(a),m=[];for(var b in a)b=="constructor"&&(u||!ot.call(a,b))||m.push(b);return m}function Y(a,u){return a<u}function ae(a,u){var m=-1,b=Dr(a)?z(a.length):[];return xi(a,function(x,P,M){b[++m]=u(x,P,M)}),b}function _e(a){var u=Ib(a);return u.length==1&&u[0][2]?cE(u[0][0],u[0][1]):function(m){return m===a||js(m,a,u)}}function Le(a,u){return Ob(a)&&uE(u)?cE(Jn(a),u):function(m){var b=jb(m,a);return b===t&&b===u?Ub(m,a):Xo(u,b,v|_)}}function Ht(a,u,m,b,x){a!==u&&Ac(u,function(P,M){if(x||(x=new en),Pt(P))Wn(a,u,M,m,Ht,b,x);else{var U=b?b(Pb(a,M),P,M+"",a,u,x):t;U===t&&(U=P),kc(a,M,U)}},Lr)}function Wn(a,u,m,b,x,P,M){var U=Pb(a,m),W=Pb(u,m),Z=M.get(W);if(Z){kc(a,m,Z);return}var X=P?P(U,W,m+"",a,u,M):t,te=X===t;if(te){var oe=Ee(W),he=!oe&&Vs(W),we=!oe&&!he&&Ll(W);X=W,oe||he||we?Ee(U)?X=U:Dt(U)?X=Fr(U):he?(te=!1,X=Bx(W,!0)):we?(te=!1,X=Vx(W,!0)):X=[]:jc(W)||ra(W)?(X=U,ra(U)?X=jE(U):(!Pt(U)||Xi(U))&&(X=lE(W))):te=!1}te&&(M.set(W,X),x(X,W,b,P,M),M.delete(W)),kc(a,m,X)}function zn(a,u){var m=a.length;if(m)return u+=u<0?m:0,Zi(u,m)?a[u]:t}function Ax(a,u,m){u.length?u=yt(u,function(P){return Ee(P)?function(M){return Yi(M,P.length===1?P[0]:P)}:P}):u=[jr];var b=-1;u=yt(u,Rr(Se()));var x=ae(a,function(P,M,U){var W=yt(u,function(Z){return Z(P)});return{criteria:W,index:++b,value:P}});return pv(x,function(P,M){return jN(P,M,m)})}function qN(a,u){return $x(a,u,function(m,b){return Ub(a,b)})}function $x(a,u,m){for(var b=-1,x=u.length,P={};++b<x;){var M=u[b],U=Yi(a,M);m(U,M)&&Mc(P,Hs(M,a),U)}return P}function ON(a){return function(u){return Yi(u,a)}}function pb(a,u,m,b){var x=b?dv:Vi,P=-1,M=u.length,U=a;for(a===u&&(u=Fr(u)),m&&(U=yt(a,Rr(m)));++P<M;)for(var W=0,Z=u[P],X=m?m(Z):Z;(W=x(U,X,W,b))>-1;)U!==a&&Cl.call(U,W,1),Cl.call(a,W,1);return a}function Nx(a,u){for(var m=a?u.length:0,b=m-1;m--;){var x=u[m];if(m==b||x!==P){var P=x;Zi(x)?Cl.call(a,x,1):yb(a,x)}}return a}function hb(a,u){return a+zo(Bp()*(u-a+1))}function kN(a,u,m,b){for(var x=-1,P=Ct(Wo((u-a)/(m||1)),0),M=z(P);P--;)M[b?P:++x]=a,a+=m;return M}function mb(a,u){var m="";if(!a||u<1||u>ke)return m;do u%2&&(m+=a),u=zo(u/2),u&&(a+=a);while(u);return m}function Ne(a,u){return Tb(fE(a,u,jr),a+"")}function PN(a){return Qp(jl(a))}function TN(a,u){var m=jl(a);return hh(m,Ci(u,0,m.length))}function Mc(a,u,m,b){if(!Pt(a))return a;u=Hs(u,a);for(var x=-1,P=u.length,M=P-1,U=a;U!=null&&++x<P;){var W=Jn(u[x]),Z=m;if(W==="__proto__"||W==="constructor"||W==="prototype")return a;if(x!=M){var X=U[W];Z=b?b(X,W,U):t,Z===t&&(Z=Pt(X)?X:Zi(u[x+1])?[]:{})}Er(U,W,Z),U=U[W]}return a}var Mx=Ol?function(a,u){return Ol.set(a,u),a}:jr,AN=xl?function(a,u){return xl(a,"toString",{configurable:!0,enumerable:!1,value:Bb(u),writable:!0})}:jr;function $N(a){return hh(jl(a))}function wn(a,u,m){var b=-1,x=a.length;u<0&&(u=-u>x?0:x+u),m=m>x?x:m,m<0&&(m+=x),x=u>m?0:m-u>>>0,u>>>=0;for(var P=z(x);++b<x;)P[b]=a[b+u];return P}function NN(a,u){var m;return xi(a,function(b,x,P){return m=u(b,x,P),!m}),!!m}function sh(a,u,m){var b=0,x=a==null?b:a.length;if(typeof u=="number"&&u===u&&x<=mt){for(;b<x;){var P=b+x>>>1,M=a[P];M!==null&&!sn(M)&&(m?M<=u:M<u)?b=P+1:x=P}return x}return gb(a,u,jr,m)}function gb(a,u,m,b){var x=0,P=a==null?0:a.length;if(P===0)return 0;u=m(u);for(var M=u!==u,U=u===null,W=sn(u),Z=u===t;x<P;){var X=zo((x+P)/2),te=m(a[X]),oe=te!==t,he=te===null,we=te===te,Pe=sn(te);if(M)var be=b||we;else Z?be=we&&(b||oe):U?be=we&&oe&&(b||!he):W?be=we&&oe&&!he&&(b||!Pe):he||Pe?be=!1:be=b?te<=u:te<u;be?x=X+1:P=X}return Jt(P,We)}function Fx(a,u){for(var m=-1,b=a.length,x=0,P=[];++m<b;){var M=a[m],U=u?u(M):M;if(!m||!Gn(U,W)){var W=U;P[x++]=M===0?0:M}}return P}function Dx(a){return typeof a=="number"?a:sn(a)?le:+a}function nn(a){if(typeof a=="string")return a;if(Ee(a))return yt(a,nn)+"";if(sn(a))return Vp?Vp.call(a):"";var u=a+"";return u=="0"&&1/a==-pe?"-0":u}function Us(a,u,m){var b=-1,x=dl,P=a.length,M=!0,U=[],W=U;if(m)M=!1,x=Ps;else if(P>=r){var Z=u?null:zN(a);if(Z)return yl(Z);M=!1,x=lt,W=new Gi}else W=u?[]:U;e:for(;++b<P;){var X=a[b],te=u?u(X):X;if(X=m||X!==0?X:0,M&&te===te){for(var oe=W.length;oe--;)if(W[oe]===te)continue e;u&&W.push(te),U.push(X)}else x(W,te,m)||(W!==U&&W.push(te),U.push(X))}return U}function yb(a,u){u=Hs(u,a);var m=-1,b=u.length;if(!b)return!0;for(;++m<b;){var x=Jn(u[m]);if(x==="__proto__"&&!ot.call(a,"__proto__")||(x==="constructor"||x==="prototype")&&m<b-1)return!1}var P=dE(a,u);return P==null||delete P[Jn(_n(u))]}function Lx(a,u,m,b){return Mc(a,u,m(Yi(a,u)),b)}function oh(a,u,m,b){for(var x=a.length,P=b?x:-1;(b?P--:++P<x)&&u(a[P],P,a););return m?wn(a,b?0:P,b?P+1:x):wn(a,b?P+1:0,b?x:P)}function jx(a,u){var m=a;return m instanceof De&&(m=m.value()),Sc(u,function(b,x){return x.func.apply(x.thisArg,bi([b],x.args))},m)}function vb(a,u,m){var b=a.length;if(b<2)return b?Us(a[0]):[];for(var x=-1,P=z(b);++x<b;)for(var M=a[x],U=-1;++U<b;)U!=x&&(P[x]=Qo(P[x]||M,a[U],u,m));return Us(Gt(P,1),u,m)}function Ux(a,u,m){for(var b=-1,x=a.length,P=u.length,M={};++b<x;){var U=b<P?u[b]:t;m(M,a[b],U)}return M}function bb(a){return Dt(a)?a:[]}function Sb(a){return typeof a=="function"?a:jr}function Hs(a,u){return Ee(a)?a:Ob(a,u)?[a]:gE(ct(a))}var MN=Ne;function Bs(a,u,m){var b=a.length;return m=m===t?b:m,!u&&m>=b?a:wn(a,u,m)}var Hx=Tv||function(a){return Ut.clearTimeout(a)};function Bx(a,u){if(u)return a.slice();var m=a.length,b=Dp?Dp(m):new a.constructor(m);return a.copy(b),b}function wb(a){var u=new a.constructor(a.byteLength);return new _l(u).set(new _l(a)),u}function FN(a,u){var m=u?wb(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.byteLength)}function DN(a){var u=new a.constructor(a.source,fp.exec(a));return u.lastIndex=a.lastIndex,u}function LN(a){return Ko?ze(Ko.call(a)):{}}function Vx(a,u){var m=u?wb(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.length)}function Wx(a,u){if(a!==u){var m=a!==t,b=a===null,x=a===a,P=sn(a),M=u!==t,U=u===null,W=u===u,Z=sn(u);if(!U&&!Z&&!P&&a>u||P&&M&&W&&!U&&!Z||b&&M&&W||!m&&W||!x)return 1;if(!b&&!P&&!Z&&a<u||Z&&m&&x&&!b&&!P||U&&m&&x||!M&&x||!W)return-1}return 0}function jN(a,u,m){for(var b=-1,x=a.criteria,P=u.criteria,M=x.length,U=m.length;++b<M;){var W=Wx(x[b],P[b]);if(W){if(b>=U)return W;var Z=m[b];return W*(Z=="desc"?-1:1)}}return a.index-u.index}function zx(a,u,m,b){for(var x=-1,P=a.length,M=m.length,U=-1,W=u.length,Z=Ct(P-M,0),X=z(W+Z),te=!b;++U<W;)X[U]=u[U];for(;++x<M;)(te||x<P)&&(X[m[x]]=a[x]);for(;Z--;)X[U++]=a[x++];return X}function Jx(a,u,m,b){for(var x=-1,P=a.length,M=-1,U=m.length,W=-1,Z=u.length,X=Ct(P-U,0),te=z(X+Z),oe=!b;++x<X;)te[x]=a[x];for(var he=x;++W<Z;)te[he+W]=u[W];for(;++M<U;)(oe||x<P)&&(te[he+m[M]]=a[x++]);return te}function Fr(a,u){var m=-1,b=a.length;for(u||(u=z(b));++m<b;)u[m]=a[m];return u}function Ei(a,u,m,b){var x=!m;m||(m={});for(var P=-1,M=u.length;++P<M;){var U=u[P],W=b?b(m[U],a[U],U,m,a):t;W===t&&(W=a[U]),x?tn(m,U,W):Er(m,U,W)}return m}function UN(a,u){return Ei(a,qb(a),u)}function HN(a,u){return Ei(a,oE(a),u)}function ah(a,u){return function(m,b){var x=Ee(m)?Un:Zp,P=u?u():{};return x(m,a,Se(b,2),P)}}function Ml(a){return Ne(function(u,m){var b=-1,x=m.length,P=x>1?m[x-1]:t,M=x>2?m[2]:t;for(P=a.length>3&&typeof P=="function"?(x--,P):t,M&&Ir(m[0],m[1],M)&&(P=x<3?t:P,x=1),u=ze(u);++b<x;){var U=m[b];U&&a(u,U,b,P)}return u})}function Gx(a,u){return function(m,b){if(m==null)return m;if(!Dr(m))return a(m,b);for(var x=m.length,P=u?x:-1,M=ze(m);(u?P--:++P<x)&&b(M[P],P,M)!==!1;);return m}}function Yx(a){return function(u,m,b){for(var x=-1,P=ze(u),M=b(u),U=M.length;U--;){var W=M[a?U:++x];if(m(P[W],W,P)===!1)break}return u}}function BN(a,u,m){var b=u&w,x=Fc(a);function P(){var M=this&&this!==Ut&&this instanceof P?x:a;return M.apply(b?m:this,arguments)}return P}function Kx(a){return function(u){u=ct(u);var m=Ts(u)?Cr(u):t,b=m?m[0]:u.charAt(0),x=m?Bs(m,1).join(""):u.slice(1);return b[a]()+x}}function Fl(a){return function(u){return Sc(YE(GE(u).replace(Zy,"")),a,"")}}function Fc(a){return function(){var u=arguments;switch(u.length){case 0:return new a;case 1:return new a(u[0]);case 2:return new a(u[0],u[1]);case 3:return new a(u[0],u[1],u[2]);case 4:return new a(u[0],u[1],u[2],u[3]);case 5:return new a(u[0],u[1],u[2],u[3],u[4]);case 6:return new a(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new a(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var m=Fs(a.prototype),b=a.apply(m,u);return Pt(b)?b:m}}function VN(a,u,m){var b=Fc(a);function x(){for(var P=arguments.length,M=z(P),U=P,W=Dl(x);U--;)M[U]=arguments[U];var Z=P<3&&M[0]!==W&&M[P-1]!==W?[]:yn(M,W);if(P-=Z.length,P<m)return tE(a,u,lh,x.placeholder,t,M,Z,t,t,m-P);var X=this&&this!==Ut&&this instanceof x?b:a;return wr(X,this,M)}return x}function Qx(a){return function(u,m,b){var x=ze(u);if(!Dr(u)){var P=Se(m,3);u=tr(u),m=function(U){return P(x[U],U,x)}}var M=a(u,m,b);return M>-1?x[P?u[M]:M]:t}}function Zx(a){return Qi(function(u){var m=u.length,b=m,x=ur.prototype.thru;for(a&&u.reverse();b--;){var P=u[b];if(typeof P!="function")throw new xr(i);if(x&&!M&&dh(P)=="wrapper")var M=new ur([],!0)}for(b=M?b:m;++b<m;){P=u[b];var U=dh(P),W=U=="wrapper"?Eb(P):t;W&&kb(W[0])&&W[1]==(G|T|$|O)&&!W[4].length&&W[9]==1?M=M[dh(W[0])].apply(M,W[3]):M=P.length==1&&kb(P)?M[U]():M.thru(P)}return function(){var Z=arguments,X=Z[0];if(M&&Z.length==1&&Ee(X))return M.plant(X).value();for(var te=0,oe=m?u[te].apply(this,Z):X;++te<m;)oe=u[te].call(this,oe);return oe}})}function lh(a,u,m,b,x,P,M,U,W,Z){var X=u&G,te=u&w,oe=u&E,he=u&(T|N),we=u&C,Pe=oe?t:Fc(a);function be(){for(var Be=arguments.length,Je=z(Be),on=Be;on--;)Je[on]=arguments[on];if(he)var qr=Dl(be),an=$p(Je,qr);if(b&&(Je=zx(Je,b,x,he)),P&&(Je=Jx(Je,P,M,he)),Be-=an,he&&Be<Z){var Lt=yn(Je,qr);return tE(a,u,lh,be.placeholder,m,Je,Lt,U,W,Z-Be)}var Yn=te?m:this,ts=oe?Yn[a]:a;return Be=Je.length,U?Je=cM(Je,U):we&&Be>1&&Je.reverse(),X&&W<Be&&(Je.length=W),this&&this!==Ut&&this instanceof be&&(ts=Pe||Fc(ts)),ts.apply(Yn,Je)}return be}function Xx(a,u){return function(m,b){return Ds(m,a,u(b),{})}}function uh(a,u){return function(m,b){var x;if(m===t&&b===t)return u;if(m!==t&&(x=m),b!==t){if(x===t)return b;typeof m=="string"||typeof b=="string"?(m=nn(m),b=nn(b)):(m=Dx(m),b=Dx(b)),x=a(m,b)}return x}}function _b(a){return Qi(function(u){return u=yt(u,Rr(Se())),Ne(function(m){var b=this;return a(u,function(x){return wr(x,b,m)})})})}function ch(a,u){u=u===t?" ":nn(u);var m=u.length;if(m<2)return m?mb(u,a):u;var b=mb(u,Wo(a/Si(u)));return Ts(u)?Bs(Cr(b),0,a).join(""):b.slice(0,a)}function WN(a,u,m,b){var x=u&w,P=Fc(a);function M(){for(var U=-1,W=arguments.length,Z=-1,X=b.length,te=z(X+W),oe=this&&this!==Ut&&this instanceof M?P:a;++Z<X;)te[Z]=b[Z];for(;W--;)te[Z++]=arguments[++U];return wr(oe,x?m:this,te)}return M}function eE(a){return function(u,m,b){return b&&typeof b!="number"&&Ir(u,m,b)&&(m=b=t),u=es(u),m===t?(m=u,u=0):m=es(m),b=b===t?u<m?1:-1:es(b),kN(u,m,b,a)}}function fh(a){return function(u,m){return typeof u=="string"&&typeof m=="string"||(u=Rn(u),m=Rn(m)),a(u,m)}}function tE(a,u,m,b,x,P,M,U,W,Z){var X=u&T,te=X?M:t,oe=X?t:M,he=X?P:t,we=X?t:P;u|=X?$:j,u&=~(X?j:$),u&k||(u&=~(w|E));var Pe=[a,u,x,he,te,we,oe,U,W,Z],be=m.apply(t,Pe);return kb(a)&&pE(be,Pe),be.placeholder=b,hE(be,a,u)}function Rb(a){var u=ut[a];return function(m,b){if(m=Rn(m),b=b==null?0:Jt(qe(b),292),b&&Ji(m)){var x=(ct(m)+"e").split("e"),P=u(x[0]+"e"+(+x[1]+b));return x=(ct(P)+"e").split("e"),+(x[0]+"e"+(+x[1]-b))}return u(m)}}var zN=Ns&&1/yl(new Ns([,-0]))[1]==pe?function(a){return new Ns(a)}:zb;function rE(a){return function(u){var m=fr(u);return m==Zt?As(u):m==Sr?Np(u):hv(u,a(u))}}function Ki(a,u,m,b,x,P,M,U){var W=u&E;if(!W&&typeof a!="function")throw new xr(i);var Z=b?b.length:0;if(Z||(u&=~($|j),b=x=t),M=M===t?M:Ct(qe(M),0),U=U===t?U:qe(U),Z-=x?x.length:0,u&j){var X=b,te=x;b=x=t}var oe=W?t:Eb(a),he=[a,u,m,b,x,X,te,P,M,U];if(oe&&aM(he,oe),a=he[0],u=he[1],m=he[2],b=he[3],x=he[4],U=he[9]=he[9]===t?W?0:a.length:Ct(he[9]-Z,0),!U&&u&(T|N)&&(u&=~(T|N)),!u||u==w)var we=BN(a,u,m);else u==T||u==N?we=VN(a,u,U):(u==$||u==(w|$))&&!x.length?we=WN(a,u,m,b):we=lh.apply(t,he);var Pe=oe?Mx:pE;return hE(Pe(we,he),a,u)}function nE(a,u,m,b){return a===t||Gn(a,$s[m])&&!ot.call(b,m)?u:a}function iE(a,u,m,b,x,P){return Pt(a)&&Pt(u)&&(P.set(u,a),Ht(a,u,t,iE,P),P.delete(u)),a}function JN(a){return jc(a)?t:a}function sE(a,u,m,b,x,P){var M=m&v,U=a.length,W=u.length;if(U!=W&&!(M&&W>U))return!1;var Z=P.get(a),X=P.get(u);if(Z&&X)return Z==u&&X==a;var te=-1,oe=!0,he=m&_?new Gi:t;for(P.set(a,u),P.set(u,a);++te<U;){var we=a[te],Pe=u[te];if(b)var be=M?b(Pe,we,te,u,a,P):b(we,Pe,te,a,u,P);if(be!==t){if(be)continue;oe=!1;break}if(he){if(!pl(u,function(Be,Je){if(!lt(he,Je)&&(we===Be||x(we,Be,m,b,P)))return he.push(Je)})){oe=!1;break}}else if(!(we===Pe||x(we,Pe,m,b,P))){oe=!1;break}}return P.delete(a),P.delete(u),oe}function GN(a,u,m,b,x,P,M){switch(m){case Fn:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case ji:return!(a.byteLength!=u.byteLength||!P(new _l(a),new _l(u)));case Xr:case Ar:case Io:return Gn(+a,+u);case Rt:return a.name==u.name&&a.message==u.message;case Xt:case qo:return a==u+"";case Zt:var U=As;case Sr:var W=b&v;if(U||(U=yl),a.size!=u.size&&!W)return!1;var Z=M.get(a);if(Z)return Z==u;b|=_,M.set(a,u);var X=sE(U(a),U(u),b,x,P,M);return M.delete(a),X;case Za:if(Ko)return Ko.call(a)==Ko.call(u)}return!1}function YN(a,u,m,b,x,P){var M=m&v,U=Cb(a),W=U.length,Z=Cb(u),X=Z.length;if(W!=X&&!M)return!1;for(var te=W;te--;){var oe=U[te];if(!(M?oe in u:ot.call(u,oe)))return!1}var he=P.get(a),we=P.get(u);if(he&&we)return he==u&&we==a;var Pe=!0;P.set(a,u),P.set(u,a);for(var be=M;++te<W;){oe=U[te];var Be=a[oe],Je=u[oe];if(b)var on=M?b(Je,Be,oe,u,a,P):b(Be,Je,oe,a,u,P);if(!(on===t?Be===Je||x(Be,Je,m,b,P):on)){Pe=!1;break}be||(be=oe=="constructor")}if(Pe&&!be){var qr=a.constructor,an=u.constructor;qr!=an&&"constructor"in a&&"constructor"in u&&!(typeof qr=="function"&&qr instanceof qr&&typeof an=="function"&&an instanceof an)&&(Pe=!1)}return P.delete(a),P.delete(u),Pe}function Qi(a){return Tb(fE(a,t,SE),a+"")}function Cb(a){return nh(a,tr,qb)}function xb(a){return nh(a,Lr,oE)}var Eb=Ol?function(a){return Ol.get(a)}:zb;function dh(a){for(var u=a.name+"",m=Ms[u],b=ot.call(Ms,u)?m.length:0;b--;){var x=m[b],P=x.func;if(P==null||P==a)return x.name}return u}function Dl(a){var u=ot.call(q,"placeholder")?q:a;return u.placeholder}function Se(){var a=q.iteratee||Vb;return a=a===Vb?R:a,arguments.length?a(arguments[0],arguments[1]):a}function ph(a,u){var m=a.__data__;return nM(u)?m[typeof u=="string"?"string":"hash"]:m.map}function Ib(a){for(var u=tr(a),m=u.length;m--;){var b=u[m],x=a[b];u[m]=[b,x,uE(x)]}return u}function ea(a,u){var m=Lo(a,u);return He(m)?m:t}function KN(a){var u=ot.call(a,zi),m=a[zi];try{a[zi]=t;var b=!0}catch{}var x=Sl.call(a);return b&&(u?a[zi]=m:delete a[zi]),x}var qb=El?function(a){return a==null?[]:(a=ze(a),vi(El(a),function(u){return Bo.call(a,u)}))}:Jb,oE=El?function(a){for(var u=[];a;)bi(u,qb(a)),a=Rl(a);return u}:Jb,fr=nr;(Ec&&fr(new Ec(new ArrayBuffer(1)))!=Fn||Jo&&fr(new Jo)!=Zt||Ic&&fr(Ic.resolve())!=ap||Ns&&fr(new Ns)!=Sr||Go&&fr(new Go)!=zt)&&(fr=function(a){var u=nr(a),m=u==Mn?a.constructor:t,b=m?ta(m):"";if(b)switch(b){case Fv:return Fn;case Dv:return Zt;case Lv:return ap;case jv:return Sr;case Uv:return zt}return u});function QN(a,u,m){for(var b=-1,x=m.length;++b<x;){var P=m[b],M=P.size;switch(P.type){case"drop":a+=M;break;case"dropRight":u-=M;break;case"take":u=Jt(u,a+M);break;case"takeRight":a=Ct(a,u-M);break}}return{start:a,end:u}}function ZN(a){var u=a.match(Dn);return u?u[1].split(mn):[]}function aE(a,u,m){u=Hs(u,a);for(var b=-1,x=u.length,P=!1;++b<x;){var M=Jn(u[b]);if(!(P=a!=null&&m(a,M)))break;a=a[M]}return P||++b!=x?P:(x=a==null?0:a.length,!!x&&Sh(x)&&Zi(M,x)&&(Ee(a)||ra(a)))}function XN(a){var u=a.length,m=new a.constructor(u);return u&&typeof a[0]=="string"&&ot.call(a,"index")&&(m.index=a.index,m.input=a.input),m}function lE(a){return typeof a.constructor=="function"&&!Dc(a)?Fs(Rl(a)):{}}function eM(a,u,m){var b=a.constructor;switch(u){case ji:return wb(a);case Xr:case Ar:return new b(+a);case Fn:return FN(a,m);case pt:case Xa:case el:case Cs:case Oo:case xs:case yi:case Es:case sc:return Vx(a,m);case Zt:return new b;case Io:case qo:return new b(a);case Xt:return DN(a);case Sr:return new b;case Za:return LN(a)}}function tM(a,u){var m=u.length;if(!m)return a;var b=m-1;return u[b]=(m>1?"& ":"")+u[b],u=u.join(m>2?", ":" "),a.replace(er,`{
1
+ var Rj=Object.create;var _h=Object.defineProperty;var Cj=Object.getOwnPropertyDescriptor;var xj=Object.getOwnPropertyNames;var Ej=Object.getPrototypeOf,Ij=Object.prototype.hasOwnProperty;var ft=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var se=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var H=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ws=(t,e)=>{for(var r in e)_h(t,r,{get:e[r],enumerable:!0})},XE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xj(e))!Ij.call(t,i)&&i!==r&&_h(t,i,{get:()=>e[i],enumerable:!(n=Cj(e,i))||n.enumerable});return t};var Uc=(t,e,r)=>(r=t!=null?Rj(Ej(t)):{},XE(e||!t||!t.__esModule?_h(r,"default",{value:t,enumerable:!0}):r,t)),Ul=t=>XE(_h({},"__esModule",{value:!0}),t);function At(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function St(t){let e=Date.now().toString(36)+(Oj++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${At(t)}_${e}`:e}function Yb(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Hc(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let o=i.toLowerCase();n[o]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let o=i.toLowerCase(),l=n[o];l&&delete r[l],n[o]=i,r[i]=s}return r}function qj(t){return JSON.parse(JSON.stringify(t))}function kj(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Pj(t,e){try{return JSON.parse(t)}catch{return e}}function Tj(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function Aj(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var Oj,Cn=se(()=>{"use strict";Oj=0});import*as at from"fs";import*as ln from"path";function Ch(t){if(!at.existsSync(t))return;let e={},r=ln.join(t,Rh.preRequest);at.existsSync(r)&&(e.preRequest=at.readFileSync(r,"utf-8"));let n=ln.join(t,Rh.postResponse);return at.existsSync(n)&&(e.postResponse=at.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function xh(t,e){await at.promises.mkdir(t,{recursive:!0});let r=ln.join(t,Rh.preRequest);e.preRequest?await at.promises.writeFile(r,e.preRequest,"utf-8"):at.existsSync(r)&&await at.promises.unlink(r);let n=ln.join(t,Rh.postResponse);e.postResponse?await at.promises.writeFile(n,e.postResponse,"utf-8"):at.existsSync(n)&&await at.promises.unlink(n)}function tI(t){for(let[e,r]of Object.entries(eI)){let n=ln.join(t,e);if(at.existsSync(n))try{let i=at.readFileSync(n,"utf-8"),s;if(r.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:r.type,format:r.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function rI(t){if(!t||t.type==="none")return{bodyForMetadata:t};if(t.type==="raw"){let e=t.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 t.content=="string"?t.content:JSON.stringify(t.content,null,2):String(t.content||"");return{bodyForMetadata:{type:t.type,format:t.format},externalBodyFile:{filename:n,content:i}}}}if(t.type==="graphql"){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return{bodyForMetadata:{type:t.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:t}}async function nI(t,e){for(let r of Object.keys(eI))if(r!==e){let n=ln.join(t,r);if(at.existsSync(n))try{await at.promises.unlink(n)}catch{}}}function iI(t){if(at.existsSync(t))try{let e=at.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function sI(t,e,r){let n=ln.join(t,Bc.responseSchema),i=ln.join(t,Bc.bodySchema);e?await at.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):at.existsSync(n)&&await at.promises.unlink(n),r?await at.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):at.existsSync(i)&&await at.promises.unlink(i)}function Kb(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=Kb(r.items,e);if(n)return n}}}function Qb(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(n.id===e)return t.splice(r,1),!0;if(n.type==="folder"&&n.items&&Qb(n.items,e))return!0}return!1}function oI(t,e){let r=new Map(t.map(i=>[i.id,i])),n=[];for(let i of e){let s=r.get(i);s&&(n.push(s),r.delete(i))}for(let i of r.values())n.push(i);return n}function Zb(t,e){let r;try{r=at.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===un)continue;if(n.name===e)return ln.join(t,n.name);let i=Zb(ln.join(t,n.name),e);if(i)return i}}function $j(t){for(let e of[qr.request,qr.folder]){let r=ln.join(t,e);if(at.existsSync(r))try{let n=at.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function Xb(t,e){let r;try{r=at.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===un)continue;let i=ln.join(t,n.name);if($j(i)===e)return i;let s=Xb(i,e);if(s)return s}}function xn(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],o=0;for(let g of s){let v=parseInt(g.substring(1));v>o&&(o=v)}let l="";if(o>0)l=`t${o}`;else{let g=r.match(/[_\s-](\d+\.\d+)[_\s-]/);g&&(l=`v${g[1].replace(".","_")}`)}let f=r;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 c=f.split("-").filter(g=>g.length>0),p=[];i&&p.push(i),p.push(...c),l&&p.push(l);let h=p.join("-");if(h||(h="item"),e.includes(h)){let g=2;for(;e.includes(`${h}-${g}`);)g++;h=`${h}-${g}`}return h}var Rh,qr,eI,Bc,un,na=se(()=>{"use strict";Rh={preRequest:"pre-request.js",postResponse:"post-response.js"},qr={collection:"collection.json",folder:"folder.json",request:"request.json"},eI={"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"}},Bc={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},un="scripts"});import*as Ie from"fs";import*as Te from"path";var zs,Eh=se(()=>{"use strict";Cn();na();zs=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(){Ie.existsSync(this.collectionsDir)||Ie.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=Ie.readFileSync(e,"utf-8")}catch(i){console.error(`[FolderCollectionStore] Failed to read ${r} ${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 ${r} ${e}:`,i);return}}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Ie.existsSync(this.collectionsDir))return[];let e=Ie.readdirSync(this.collectionsDir,{withFileTypes:!0}),r=[];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),r.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return r}loadCollectionFromFolder(e){let r=Te.join(this.collectionsDir,e),n=Te.join(r,qr.collection);if(!Ie.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(Te.join(r,un)),o=this.loadItemsFromDir(r,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:o}}catch(s){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,s);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,o=Ie.readdirSync(e,{withFileTypes:!0});for(let l of o){if(!l.isDirectory()||l.name===un)continue;let f=Te.join(e,l.name);if(Ie.existsSync(Te.join(f,qr.folder))){let c=this.loadFolderFromDir(f,l.name);c&&s.set(l.name,c)}else if(Ie.existsSync(Te.join(f,qr.request))){let c=this.loadRequestFromDir(f,l.name);c&&s.set(l.name,c)}}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,r){let n=Te.join(e,qr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(Te.join(e,un)),o=this.loadItemsFromDir(e,i.id,i.order);return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"folder",name:i.name,description:i.description,auth:i.auth,scripts:s,items:o}}catch(s){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,s);return}}loadRequestFromDir(e,r){let n=Te.join(e,qr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(Te.join(e,un)),o=i.body,l=this.loadBodyFromDir(e);l&&(o=l);let f=this.loadSchemaFile(Te.join(e,Bc.responseSchema)),c=this.loadSchemaFile(Te.join(e,Bc.bodySchema)),p=Te.join(e,"doc.md"),h=Ie.existsSync(p)?Ie.readFileSync(p,"utf-8"):void 0;return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{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:o,auth:i.auth,settings:i.settings,scripts:s,deprecated:i.deprecated,operationId:i.operationId,summary:i.summary,tags:i.tags,examples:i.examples,responses:i.responses,security:i.security,...h&&{doc:h},...f&&{responseSchema:f},...c&&{bodySchema:c}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return Ch(e)}loadBodyFromDir(e){return tI(e)}loadSchemaFile(e){return iI(e)}async saveSchemaFiles(e,r){return sI(e,r.responseSchema,r.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.idToSlugMap.get(e);if(r){let n=this.loadCollectionFromFolder(r);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=St(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=Ie.readdirSync(this.collectionsDir);r=xn(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Te.join(this.collectionsDir,r),i=!Ie.existsSync(n);await Ie.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},[o]=await Promise.all([this.saveItemsToDir(n,e.items,i),e.scripts?this.saveScriptsToDir(Te.join(n,un),e.scripts):Promise.resolve()]);o.length>0&&(s.order=o),await Ie.promises.writeFile(Te.join(n,qr.collection),JSON.stringify(s,null,2),"utf-8"),this.cache.set(e.id,e)}async saveItemsToDir(e,r,n=!1){let i=[],s=[];for(let o of r){let l=this.idToSlugMap.get(o.id);l||(l=xn(o.name,i),this.idToSlugMap.set(o.id,l),this.slugToIdMap.set(l,o.id)),i.push(l),s.push({item:o,slug:l})}return await Promise.all(s.map(async({item:o,slug:l})=>{let f=Te.join(e,l);await Ie.promises.mkdir(f,{recursive:!0}),o.type==="folder"?await this.saveFolderToDir(f,o,n):await this.saveRequestToDir(f,o,n)})),i}async saveFolderToDir(e,r,n=!1){let i={id:r.id,name:r.name,description:r.description,auth:r.auth},[s]=await Promise.all([r.items?this.saveItemsToDir(e,r.items,n):Promise.resolve([]),r.scripts?this.saveScriptsToDir(Te.join(e,un),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await Ie.promises.writeFile(Te.join(e,qr.folder),JSON.stringify(i,null,2),"utf-8")}async saveRequestToDir(e,r,n=!1){let{bodyForMetadata:i,externalBodyFile:s}=this.prepareBodyForSave(r.body),o={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:i,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated},...r.operationId&&{operationId:r.operationId},...r.summary&&{summary:r.summary},...r.tags&&r.tags.length>0&&{tags:r.tags},...r.examples&&r.examples.length>0&&{examples:r.examples},...r.responses&&Object.keys(r.responses).length>0&&{responses:r.responses},...r.security&&r.security.length>0&&{security:r.security}},l=[Ie.promises.writeFile(Te.join(e,qr.request),JSON.stringify(o,null,2),"utf-8")];s&&l.push(Ie.promises.writeFile(Te.join(e,s.filename),s.content,"utf-8")),n||l.push(this.cleanupOldBodyFiles(e,s?.filename)),(!n||r.responseSchema||r.bodySchema)&&l.push(this.saveSchemaFiles(e,r)),r.doc&&l.push(Ie.promises.writeFile(Te.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(Te.join(e,un),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return rI(e)}async cleanupOldBodyFiles(e,r){return nI(e,r)}async saveScriptsToDir(e,r){return xh(e,r)}async delete(e){let r=this.idToSlugMap.get(e);if(!r&&(this.loadAll(),r=this.idToSlugMap.get(e),!r))return!1;let n=Te.join(this.collectionsDir,r);if(!Ie.existsSync(n))return!1;try{return await Ie.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(r),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let r=this.idToSlugMap.get(e);return r?Ie.existsSync(Te.join(this.collectionsDir,r,qr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Te.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||St(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,r);if(!s)throw new Error(`Item ${r} not found in collection ${e}`);await this.saveScriptsToDir(Te.join(s,un),n);let o=this.findItemById(i.items,r);o&&(o.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(Te.join(n,un))}async updateCollectionMetadata(e,r){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=Te.join(this.collectionsDir,i),o=Te.join(s,qr.collection),l=Ie.readFileSync(o,"utf-8"),c={...JSON.parse(l),...r,id:e};await Ie.promises.writeFile(o,JSON.stringify(c,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,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 o;if(n){let p=this.findItemPath(e,n);if(!p)throw new Error(`Parent folder ${n} not found`);o=p}else o=Te.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let p=Ie.readdirSync(o).filter(h=>Ie.statSync(Te.join(o,h)).isDirectory()&&h!==un);l=xn(r.name,p),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let f=Te.join(o,l);await Ie.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let c=this.findItemById(i.items,r.id);if(c)Object.assign(c,r);else if(n){let p=this.findItemById(i.items,n);p&&p.type==="folder"&&(p.items=p.items||[],p.items.push(r))}else i.items.push(r)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,r);if(!i||!Ie.existsSync(i))return!1;try{await Ie.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,r);let s=this.idToSlugMap.get(r);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(r)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${r}:`,s),!1}}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,r);if(!s)return!1;let o=this.findItemById(i.items,r);if(!o)return!1;let{id:l,type:f,items:c,...p}=n;return Object.assign(o,p),o.type==="folder"?await this.saveFolderToDir(s,o):await this.saveRequestToDir(s,o),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let o=this.findItemPath(e,r);if(!o||!Ie.existsSync(o))return!1;let l;if(n){let p=this.findItemPath(e,n);if(!p)return!1;l=p}else l=Te.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let c=Te.join(l,f);if(Ie.existsSync(c))return!1;try{await Ie.promises.rename(o,c);let p=this.findItemById(i.items,r);if(p){let h=p.type==="folder"?{...p,items:p.items?[...p.items]:[]}:{...p};if(this.deleteItemFromTree(i.items,r),n){let g=this.findItemById(i.items,n);g&&g.type==="folder"&&(g.items=g.items||[],g.items.push(h))}else i.items.push(h)}return!0}catch(p){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,p),!1}}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let o=[];for(let l of n){let f=this.idToSlugMap.get(l);f&&o.push(f)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let f=Te.join(l,qr.folder),c=Ie.readFileSync(f,"utf-8"),p=JSON.parse(c);p.order=o,await Ie.promises.writeFile(f,JSON.stringify(p,null,2),"utf-8");let h=this.findItemById(i.items,r);h&&h.type==="folder"&&h.items&&(h.items=this.sortItemsByOrder(h.items,n))}else{let l=Te.join(this.collectionsDir,s,qr.collection),f=Ie.readFileSync(l,"utf-8"),c=JSON.parse(f);c.order=o,await Ie.promises.writeFile(l,JSON.stringify(c,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,r){return oI(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=Te.join(this.collectionsDir,n),s=Xb(i,r);if(s)return s;let o=this.load(e);if(o){let f=this.buildSlugPath(o.items,r);if(f)return Te.join(i,...f)}let l=this.idToSlugMap.get(r);if(l)return Zb(i,l)}buildSlugPath(e,r){for(let n of e){let i=this.idToSlugMap.get(n.id);if(i){if(n.id===r)return[i];if(n.type==="folder"&&n.items){let s=this.buildSlugPath(n.items,r);if(s)return[i,...s]}}}}findItemById(e,r){return Kb(e,r)}deleteItemFromTree(e,r){return Qb(e,r)}}});var ht,ia=se(()=>{"use strict";ht=class{static parseSetCookie(e,r){let n=e.split(";").map(p=>p.trim());if(n.length===0)return null;let[i,...s]=n,o=i.indexOf("=");if(o===-1)return null;let l=i.substring(0,o).trim(),f=i.substring(o+1).trim(),c={name:l,value:f,domain:r};for(let p of s){let h=p.indexOf("="),g=(h===-1?p:p.substring(0,h)).toLowerCase(),v=h===-1?"":p.substring(h+1);switch(g){case"domain":c.domain=v.startsWith(".")?v.substring(1):v;break;case"path":c.path=v;break;case"expires":c.expires=v;break;case"max-age":c.maxAge=parseInt(v,10);break;case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break;case"samesite":c.sameSite=v;break}}return c}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let o of s){let l=this.parseSetCookie(o,r);l&&n.push(l)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.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,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.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 Js from"fs";import*as sa from"path";function Oh(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function Jc(t){if(!Js.existsSync(t))return Mj();let e=Ih(sa.join(t,"_global.json"))||{},r=e.variables||{},n=e.defaultHeaders||{},i=Js.readdirSync(t).filter(c=>c.endsWith(".json")).filter(c=>!c.endsWith(".local.json")).filter(c=>!Oh(c)),s={};for(let c of i){let p=Ih(sa.join(t,c))||{},h=sa.basename(c,".json");s[h]={description:p.description,requiresConfirmation:p.requiresConfirmation,variables:p.variables||{},secretVariables:p.secretVariables}}let l=(Ih(sa.join(t,"_global.local.json"))||{}).variables||{},f={};for(let c of Object.keys(s)){let p=sa.join(t,`${c}.local.json`);if(Js.existsSync(p)){let h=Ih(p)||{};f[c]={variables:h.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function Mj(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function Ih(t){try{if(!Js.existsSync(t))return null;let e=Js.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${t}:`,e),null}}var qh=se(()=>{"use strict"});var Kn,Bl=se(()=>{"use strict";Kn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,o="",l=e.indexOf("?");l!==-1&&(o=e.substring(l),s=e.substring(0,l));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let c=/:(\w+)(?:\([^)]*\))?(\?)?/g,p=s.replace(c,(h,g,v)=>{let _=r[g];return _!==void 0&&_!==""?encodeURIComponent(_):v?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${g}`),h)});return p=p.replace(/([^:])\/+/g,"$1/"),p.length>1&&p.endsWith("/")&&(p=p.slice(0,-1)),`${n}${i}${p}${o}`}extractPathParams(e){let r=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=r.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,r){let n=e,i={};if(e.includes("?")){let[f,c]=e.split("?");n=f,c&&new URLSearchParams(c).forEach((h,g)=>{i[g]=h})}let s={...i,...r},o=new URLSearchParams;for(let[f,c]of Object.entries(s))c!=null&&o.append(f,c);let l=o.toString();return l?`${n}?${l}`:n}}});function lI(t,e=0){return(ir[t[e+0]]+ir[t[e+1]]+ir[t[e+2]]+ir[t[e+3]]+"-"+ir[t[e+4]]+ir[t[e+5]]+"-"+ir[t[e+6]]+ir[t[e+7]]+"-"+ir[t[e+8]]+ir[t[e+9]]+"-"+ir[t[e+10]]+ir[t[e+11]]+ir[t[e+12]]+ir[t[e+13]]+ir[t[e+14]]+ir[t[e+15]]).toLowerCase()}var ir,uI=se(()=>{ir=[];for(let t=0;t<256;++t)ir.push((t+256).toString(16).slice(1))});function rS(){return crypto.getRandomValues(Fj)}var Fj,cI=se(()=>{Fj=new Uint8Array(16)});function Dj(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Lj(t,e,r)}function Lj(t,e,r){t=t||{};let n=t.random??t.rng?.()??rS();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(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[r+i]=n[i];return e}return lI(n)}var Vl,fI=se(()=>{cI();uI();Vl=Dj});var nS=se(()=>{fI()});function jj(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function Uj(){return Date.now()}function dI(){return Vl()}function Hj(){return Vl()}function pI(t=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function Bj(){let t=pI(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function Vj(){return Math.random()<.5}function Wj(t=10){let e="0123456789abcdef",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function zj(){return Math.floor(Date.now()/1e3)}function Jj(){return new Date().toISOString()}function Gj(){return new Date().toISOString().split("T")[0]}function Yj(){return new Date().toISOString().split("T")[1].split(".")[0]}function Kj(){return new Date().toISOString()}function Qj(t=""){return Buffer.from(String(t)).toString("base64")}function Zj(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function Xj(t=""){return encodeURIComponent(String(t))}function e2(t=""){return decodeURIComponent(String(t))}function t2(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function ns(t,e){let r=hI[t];return r?e&&e.length>0?r(...e):r():null}function r2(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?t2(n):void 0,s=ns(r,i);return s===null?e:String(s)}catch{return e}})}function oa(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],o=i[1];if(!(s in e)){let l=ns(o);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var hI,kh=se(()=>{"use strict";nS();hI={randomInt:jj,timestamp:Uj,guid:Hj,uuid:dI,randomUUID:dI,randomString:pI,randomHexadecimal:Wj,randomEmail:Bj,randomBoolean:Vj,isoTimestamp:Kj,timestamp_s:zj,datetime:Jj,date:Gj,time:Yj,base64Encode:Qj,base64Decode:Zj,urlEncode:Xj,urlDecode:e2}});import*as Ph from"vm";function aa(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function la(t,e={}){try{let r={...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=Ph.createContext(r);return Ph.runInContext(t,n,{timeout:n2,displayErrors:!1})}catch{return}}var n2,Th=se(()=>{"use strict";n2=100});import*as Ah from"crypto";function i2(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function Yc(t){if(!t||!t.includes("|"))return null;let e=s2(t);if(e.length<2)return null;let r=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let o=o2(s);o&&n.push(o)}return n.length===0?null:{input:r,filters:n}}function s2(t){let e=[],r="",n=0,i=!1,s=!1;for(let o=0;o<t.length;o++){let l=t[o],f=o>0?t[o-1]:"",c=o<t.length-1?t[o+1]:"";if(f==="\\"){r+=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(c==="|"){r+="||",o++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function o2(t){let e=t.indexOf("(");if(e===-1)return{name:t.trim(),args:[]};let r=t.substring(0,e).trim(),n=t.substring(e+1,t.lastIndexOf(")"));return{name:r,args:a2(n)}}function a2(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let o=t[s];if((s>0?t[s-1]:"")==="\\"){r+=o;continue}if(o==="'"&&!i){n=!n,r+=o;continue}else if(o==='"'&&!n){i=!i,r+=o;continue}else if(o===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=o}return r.trim()&&e.push(r.trim()),e}function $t(t,e){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=Number(t);if(!isNaN(r)&&t!=="")return r;if(t==="true")return!0;if(t==="false")return!1;if(e&&t in e){let n=i2(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Kc(t,e,r={}){let n=t;for(let i of e)n=l2(n,i.name,i.args,r);return n}function l2(t,e,r,n){switch(e){case"upper":return String(t).toUpperCase();case"lower":return String(t).toLowerCase();case"trim":return String(t).trim();case"length":return Array.isArray(t)?t.length:String(t).length;case"substring":{let i=$t(r[0],n),s=r[1]!==void 0?$t(r[1],n):void 0;return String(t).substring(i<0?String(t).length+i:i,s!==void 0?s<0?String(t).length+s:s:void 0)}case"replace":{let i=r[0]!==void 0?String($t(r[0],n)):"",s=r[1]!==void 0?String($t(r[1],n)):"";return String(t).replace(new RegExp(c2(i),"g"),s)}case"split":{let i=r[0]!==void 0?String($t(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String($t(r[0],n)):",";return Array.isArray(t)?t.join(i):String(t)}case"removeQuotes":return String(t).replace(/["']/g,"");case"removeSpaces":return String(t).replace(/\s/g,"");case"format":{let i=r[0]!==void 0?String($t(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let o=$t(r[s],n);i=i.replace(`{${s}}`,String(o))}return i}case"add":{let i=$t(r[0],n);return Number(t)+i}case"subtract":{let i=$t(r[0],n);return Number(t)-i}case"multiply":{let i=$t(r[0],n);return Number(t)*i}case"abs":return Math.abs(Number(t));case"btoa":return Buffer.from(String(t)).toString("base64");case"atob":return Buffer.from(String(t),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(t));case"urlDecode":return decodeURIComponent(String(t));case"hash":{let i=String(r[0]!==void 0?$t(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?$t(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return Ah.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String($t(r[0],n)):"",s=String(r[1]!==void 0?$t(r[1],n):"sha256").toLowerCase(),o=String(r[2]!==void 0?$t(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return Ah.createHmac(f,i).update(String(t)).digest(o)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=$t(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=$t(r[0],n),s=r[1]!==void 0?$t(r[1],n):void 0;return Array.isArray(t)?t.slice(i,s):String(t).slice(i,s)}case"unique":return Array.isArray(t)?[...new Set(t)]:t;case"filter":return!Array.isArray(t)||!r[0]?t:u2(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String($t(s,n)));return i.length===1?t.map(s=>Gc(s,i[0])):t.map(s=>{let o={};for(let l of i){let f=Gc(s,l);f!==void 0&&(o[l]=f)}return o})}case"prop":{let i=r[0]!==void 0?String($t(r[0],n)):"";if(Array.isArray(t)){let s=t.map(o=>Gc(o,i)).filter(o=>o!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?Gc(t,i):t}case"parseJSON":try{return JSON.parse(String(t))}catch{return t}case"stringify":try{return JSON.stringify(t)}catch{return String(t)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t));case"isUrl":try{return new URL(String(t)),!0}catch{return!1}case"setIfValue":return t||void 0;case"setNull":return t===null?null:t;default:return t}}function u2(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,o]=n,l=$t(o,r);return t.filter(f=>{let c=Gc(f,i);if(c===void 0)return!1;switch(s){case">":return Number(c)>Number(l);case">=":return Number(c)>=Number(l);case"<":return Number(c)<Number(l);case"<=":return Number(c)<=Number(l);case"=":return String(c)===String(l);case"!=":return String(c)!==String(l);case"*=":return String(c).includes(String(l));case"^=":return String(c).startsWith(String(l));case"$=":return String(c).endsWith(String(l));default:return!0}})}function Gc(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function c2(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var $h=se(()=>{"use strict"});function mI(t,e){if(t)return t.split(",").map(r=>{let n=r.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],o=Number(s);return!isNaN(o)&&s!==""?o:s}return n})}function f2(t){return new ua(t)}var ua,ca,Qc=se(()=>{"use strict";kh();Th();$h();ua=class t{allVariables;static MAX_RESOLUTION_DEPTH=20;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.variables}}resolveString(e,r=!1){return typeof e!="string"?e:this.resolveUntilStable(e,this.allVariables,r)}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};return this.resolveUntilStable(e,i,n)}resolveUntilStable(e,r,n){let i=e;for(let s=0;s<t.MAX_RESOLUTION_DEPTH;s++){let o=this.resolveSinglePass(i,r,n);if(o===i)break;i=o}return i}resolveSinglePass(e,r,n){if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(f,c)=>this.resolveTemplateContent(c.trim(),r,f));let i="",s=0,o=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=o.exec(e))!==null;){let f=l[1].trim(),c=this.resolveTemplateContent(f,r,l[0]);if(c!==l[0]){i+=e.slice(s,l.index);let p=this.getStringContext(e,l.index);i+=p?this.escapeForString(String(c),p):String(c)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,o]of Object.entries(e))i[s]=this.resolveObjectWithExtra(o,r,n);return i}return e}resolveTemplateContent(e,r,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let l=mI(i[2],r),f=ns(i[1],l);return f!==null?String(f):n}let s=Yc(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let f=Kc(l,s.filters,r);return f!==void 0?String(f):n}return n}let o=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(o){let l=o[1];if(r[l]!==void 0){let f=this.deserializeValue(r[l]),c=o[2],p=this.resolvePropertyAccess(f,c);if(p!==void 0)return typeof p=="object"?JSON.stringify(p):String(p)}}if(r[e]!==void 0){let l=r[e];return typeof l=="string"&&l.charCodeAt(0)===30?l.slice(1):String(l)}if(aa(e)){let l=this.deserializeVariables(r),f=oa(e,l),c=la(e,f);if(c!==void 0)return String(c)}return n}resolveFilterInput(e,r){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=mI(n[2],r),o=ns(n[1],s);return o!==null?o:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let o=this.deserializeValue(r[s]),l=this.resolvePropertyAccess(o,i[2]);if(l!==void 0)return l}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(aa(e)){let s=this.deserializeVariables(r),o=oa(e,s),l=la(e,o);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 r={};for(let[n,i]of Object.entries(e))r[n]=this.deserializeValue(i);return r}resolvePropertyAccess(e,r){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(r))!==null;){if(n==null)return;if(s[1]!==void 0){let o=s[1];/^\d+$/.test(o)?n=n[Number(o)]:n=n[o.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},ca=class{interpolate(e,r){return!e||typeof e!="string"?e:new ua({globals:{},collectionVariables:{},environmentVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}}});import*as d2 from"http";import*as Zc from"https";import{URL as gI}from"url";import*as Nh from"zlib";var Qn,fa,Xc=se(()=>{"use strict";Qn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},fa=class{settings;version;constructor(e){this.settings={...Qn,...e};try{this.version=ft("../../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 r=this.mergeSettings(e.settings);return await this.executeInternal(e,r,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,r,n,i){let s=Date.now(),o=new gI(e.url),l=o.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(h=>h.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let p={hostname:o.hostname,port:o.port||(l?443:80),path:o.pathname+o.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(p.headers["Accept-Encoding"]="gzip, deflate"),l&&(p.rejectUnauthorized=r.strictSSL,r.strictSSL?p.agent=Zc.globalAgent:p.agent=new Zc.Agent({rejectUnauthorized:!1})),new Promise((h,g)=>{if(i?.aborted){let w=new Error("Request cancelled");w.name="AbortError",g(w);return}let _=(l?Zc:d2).request(p,async w=>{let E=w.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(E)){if(n>=r.maxRedirects){g(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let T=w.headers.location;if(!T){g(new Error("Redirect response missing Location header"));return}let N=new gI(T,e.url).toString(),$=e.method;!r.followOriginalMethod&&[301,302,303].includes(E)&&($="GET");let j={...e.headers};r.followAuthHeader||(delete j.authorization,delete j.Authorization);try{let G=await this.executeInternal({...e,url:N,method:$,headers:j,body:$==="GET"?void 0:e.body},r,n+1,i),q=Date.now();G.time=q-s,h(G)}catch(G){g(G)}return}let k=[];w.on("data",T=>k.push(T)),w.on("end",()=>{let T=Date.now(),N=Buffer.concat(k),$=w.headers["content-encoding"];if(r.decompress&&$)try{$==="gzip"?N=Nh.gunzipSync(N):$==="deflate"&&(N=Nh.inflateSync(N))}catch(C){console.warn("[NodeHttpClient] Decompression failed:",C)}let j=N.toString("utf-8"),G={};for(let[C,A]of Object.entries(w.headers))(typeof A=="string"||Array.isArray(A))&&(G[C]=A);let q=this.parseCookies(w.headers["set-cookie"],o.hostname);h({status:w.statusCode||0,statusText:w.statusMessage||"",headers:G,cookies:q,body:j,time:T-s,size:N.length})})});if(i&&i.addEventListener("abort",()=>{_.destroy();let w=new Error("Request cancelled");w.name="AbortError",g(w)}),_.on("error",w=>{g(w)}),_.on("timeout",()=>{_.destroy(),g(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let w=typeof e.body=="string"?e.body:JSON.stringify(e.body);_.write(w)}_.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 r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}parseCookies(e,r){return e?e.map(n=>{let i=n.split(";").map(p=>p.trim()),[s,...o]=i,[l,f]=s.split("="),c={name:l.trim(),value:f?.trim()||"",domain:r};for(let p of o){let[h,g]=p.split("=");switch(h.toLowerCase().trim()){case"domain":c.domain=g?.trim();break;case"path":c.path=g?.trim();break;case"expires":c.expires=g?.trim();break;case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break}}return c}):[]}}});function iS(t){return{timeout:t?.timeout??Qn.timeout,followRedirects:t?.followRedirects??Qn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Qn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Qn.followAuthHeader,maxRedirects:t?.maxRedirects??Qn.maxRedirects,strictSSL:t?.strictSSL??Qn.strictSSL,decompress:t?.decompress??Qn.decompress,includeCookies:t?.includeCookies??Qn.includeCookies}}var sS=se(()=>{"use strict";Xc()});var is,ef=se(()=>{"use strict";sS();is=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=iS(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let o=await this.interceptors.executeErrorInterceptors(s,e,n);if(o)return o;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let o=await this.interceptors.executeErrorInterceptors(s,i,n);if(o)return o;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var ss,oS,aS,lS,tf=se(()=>{"use strict";ss=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 r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(o){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,o),o}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,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((r,n)=>(r.priority??100)-(n.priority??100))}},oS=class{name="logging";priority=1e3;intercept(e,r){return e}},aS=class{name="timing";priority=1;intercept(e,r,n){return e}},lS=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,r=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=r}handle(e,r,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}}});var yI=H((Wl,rf)=>{(function(){var t,e="4.18.1",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",o="Invalid `imports` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,c="__lodash_placeholder__",p=1,h=2,g=4,v=1,_=2,w=1,E=2,k=4,T=8,N=16,$=32,j=64,G=128,q=256,C=512,A=30,D="...",B=800,F=16,K=1,ee=2,ie=3,pe=1/0,ke=9007199254740991,de=17976931348623157e292,le=NaN,ve=4294967295,We=ve-1,mt=ve>>>1,ce=[["ary",G],["bind",w],["bindKey",E],["curry",T],["curryRight",N],["flip",C],["partial",$],["partialRight",j],["rearg",q]],rr="[object Arguments]",$e="[object Array]",nt="[object AsyncFunction]",Xr="[object Boolean]",Ar="[object Date]",_t="[object DOMException]",Rt="[object Error]",pn="[object Function]",Eo="[object GeneratorFunction]",Zt="[object Map]",Io="[object Number]",Ay="[object Null]",Mn="[object Object]",ap="[object Promise]",lp="[object Proxy]",Xt="[object RegExp]",Sr="[object Set]",Oo="[object String]",Za="[object Symbol]",up="[object Undefined]",zt="[object WeakMap]",cp="[object WeakSet]",ji="[object ArrayBuffer]",Fn="[object DataView]",pt="[object Float32Array]",Xa="[object Float64Array]",el="[object Int8Array]",Cs="[object Int16Array]",qo="[object Int32Array]",xs="[object Uint8Array]",yi="[object Uint8ClampedArray]",Es="[object Uint16Array]",sc="[object Uint32Array]",tl=/\b__p \+= '';/g,$y=/\b(__p \+=) '' \+/g,ko=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ui=/&(?:amp|lt|gt|quot|#39);/g,rl=/[&<>"']/g,nl=RegExp(Ui.source),fe=RegExp(rl.source),Ny=/<%-([\s\S]+?)%>/g,My=/<%([\s\S]+?)%>/g,hn=/<%=([\s\S]+?)%>/g,$r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fe=/^\w*$/,oc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,it=/[\\^$.*+?()[\]{}|]/g,Po=RegExp(it.source),ac=/^\s+/,il=/\s/,er=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Dn=/\{\n\/\* \[wrapped with (.+)\] \*/,mn=/,? & /,Ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Nr=/[()=,{}\[\]\/\s]/,Ln=/\\(\\)?/g,Hi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fp=/\w*$/,Fy=/^[-+]0x[0-9a-f]+$/i,To=/^0b[01]+$/i,dp=/^\[object .+?Constructor\]$/,Dy=/^0o[0-7]+$/i,Is=/^(?:0|[1-9]\d*)$/,Ao=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$o=/($^)/,Ly=/['\n\r\u2028\u2029\\]/g,sl="\\ud800-\\udfff",jy="\\u0300-\\u036f",kt="\\ufe20-\\ufe2f",lc="\\u20d0-\\u20ff",pp=jy+kt+lc,uc="\\u2700-\\u27bf",cc="a-z\\xdf-\\xf6\\xf8-\\xff",Uy="\\xac\\xb1\\xd7\\xf7",Hy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",By="\\u2000-\\u206f",Vy=" \\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",hp="A-Z\\xc0-\\xd6\\xd8-\\xde",mp="\\ufe0e\\ufe0f",fc=Uy+Hy+By+Vy,ol="['\u2019]",Wy="["+sl+"]",gp="["+fc+"]",al="["+pp+"]",dc="\\d+",zy="["+uc+"]",Os="["+cc+"]",No="[^"+sl+fc+dc+uc+cc+hp+"]",ll="\\ud83c[\\udffb-\\udfff]",Mo="(?:"+al+"|"+ll+")",gn="[^"+sl+"]",pc="(?:\\ud83c[\\udde6-\\uddff]){2}",hc="[\\ud800-\\udbff][\\udc00-\\udfff]",qs="["+hp+"]",yp="\\u200d",vp="(?:"+Os+"|"+No+")",Jy="(?:"+qs+"|"+No+")",bp="(?:"+ol+"(?:d|ll|m|re|s|t|ve))?",Sp="(?:"+ol+"(?:D|LL|M|RE|S|T|VE))?",ul=Mo+"?",wp="["+mp+"]?",_p="(?:"+yp+"(?:"+[gn,pc,hc].join("|")+")"+wp+ul+")*",Gy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Yy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Rp=wp+ul+_p,Ky="(?:"+[zy,pc,hc].join("|")+")"+Rp,Qy="(?:"+[gn+al+"?",al,pc,hc,Wy].join("|")+")",Zy=RegExp(ol,"g"),Xy=RegExp(al,"g"),mc=RegExp(ll+"(?="+ll+")|"+Qy+Rp,"g"),ev=RegExp([qs+"?"+Os+"+"+bp+"(?="+[gp,qs,"$"].join("|")+")",Jy+"+"+Sp+"(?="+[gp,qs+vp,"$"].join("|")+")",qs+"?"+vp+"+"+bp,qs+"+"+Sp,Yy,Gy,dc,Ky].join("|"),"g"),tv=RegExp("["+yp+sl+pp+mp+"]"),rv=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nv=["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"],iv=-1,bt={};bt[pt]=bt[Xa]=bt[el]=bt[Cs]=bt[qo]=bt[xs]=bt[yi]=bt[Es]=bt[sc]=!0,bt[rr]=bt[$e]=bt[ji]=bt[Xr]=bt[Fn]=bt[Ar]=bt[Rt]=bt[pn]=bt[Zt]=bt[Io]=bt[Mn]=bt[Xt]=bt[Sr]=bt[Oo]=bt[zt]=!1;var gt={};gt[rr]=gt[$e]=gt[ji]=gt[Fn]=gt[Xr]=gt[Ar]=gt[pt]=gt[Xa]=gt[el]=gt[Cs]=gt[qo]=gt[Zt]=gt[Io]=gt[Mn]=gt[Xt]=gt[Sr]=gt[Oo]=gt[Za]=gt[xs]=gt[yi]=gt[Es]=gt[sc]=!0,gt[Rt]=gt[pn]=gt[zt]=!1;var gc={\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"},yc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},sv={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Cp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xp=parseFloat,ov=parseInt,Ep=typeof global=="object"&&global&&global.Object===Object&&global,av=typeof self=="object"&&self&&self.Object===Object&&self,Ut=Ep||av||Function("return this")(),cl=typeof Wl=="object"&&Wl&&!Wl.nodeType&&Wl,st=cl&&typeof rf=="object"&&rf&&!rf.nodeType&&rf,ks=st&&st.exports===cl,Bi=ks&&Ep.process,Mr=(function(){try{var V=st&&st.require&&st.require("util").types;return V||Bi&&Bi.binding&&Bi.binding("util")}catch{}})(),vc=Mr&&Mr.isArrayBuffer,Ip=Mr&&Mr.isDate,Op=Mr&&Mr.isMap,Fo=Mr&&Mr.isRegExp,jn=Mr&&Mr.isSet,fl=Mr&&Mr.isTypedArray;function wr(V,Q,z){switch(z.length){case 0:return V.call(Q);case 1:return V.call(Q,z[0]);case 2:return V.call(Q,z[0],z[1]);case 3:return V.call(Q,z[0],z[1],z[2])}return V.apply(Q,z)}function Un(V,Q,z,ue){for(var Re=-1,tt=V==null?0:V.length;++Re<tt;){var ut=V[Re];Q(ue,ut,z(ut),V)}return ue}function _r(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue&&Q(V[z],z,V)!==!1;);return V}function bc(V,Q){for(var z=V==null?0:V.length;z--&&Q(V[z],z,V)!==!1;);return V}function qp(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue;)if(!Q(V[z],z,V))return!1;return!0}function vi(V,Q){for(var z=-1,ue=V==null?0:V.length,Re=0,tt=[];++z<ue;){var ut=V[z];Q(ut,z,V)&&(tt[Re++]=ut)}return tt}function dl(V,Q){var z=V==null?0:V.length;return!!z&&Vi(V,Q,0)>-1}function Ps(V,Q,z){for(var ue=-1,Re=V==null?0:V.length;++ue<Re;)if(z(Q,V[ue]))return!0;return!1}function yt(V,Q){for(var z=-1,ue=V==null?0:V.length,Re=Array(ue);++z<ue;)Re[z]=Q(V[z],z,V);return Re}function bi(V,Q){for(var z=-1,ue=Q.length,Re=V.length;++z<ue;)V[Re+z]=Q[z];return V}function Sc(V,Q,z,ue){var Re=-1,tt=V==null?0:V.length;for(ue&&tt&&(z=V[++Re]);++Re<tt;)z=Q(z,V[Re],Re,V);return z}function lv(V,Q,z,ue){var Re=V==null?0:V.length;for(ue&&Re&&(z=V[--Re]);Re--;)z=Q(z,V[Re],Re,V);return z}function pl(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue;)if(Q(V[z],z,V))return!0;return!1}var uv=Do("length");function cv(V){return V.split("")}function fv(V){return V.match(Ft)||[]}function kp(V,Q,z){var ue;return z(V,function(Re,tt,ut){if(Q(Re,tt,ut))return ue=tt,!1}),ue}function hl(V,Q,z,ue){for(var Re=V.length,tt=z+(ue?1:-1);ue?tt--:++tt<Re;)if(Q(V[tt],tt,V))return tt;return-1}function Vi(V,Q,z){return Q===Q?Sv(V,Q,z):hl(V,Wi,z)}function dv(V,Q,z,ue){for(var Re=z-1,tt=V.length;++Re<tt;)if(ue(V[Re],Q))return Re;return-1}function Wi(V){return V!==V}function Pp(V,Q){var z=V==null?0:V.length;return z?_c(V,Q)/z:le}function Do(V){return function(Q){return Q==null?t:Q[V]}}function wc(V){return function(Q){return V==null?t:V[Q]}}function ml(V,Q,z,ue,Re){return Re(V,function(tt,ut,ze){z=ue?(ue=!1,tt):Q(z,tt,ut,ze)}),z}function pv(V,Q){var z=V.length;for(V.sort(Q);z--;)V[z]=V[z].value;return V}function _c(V,Q){for(var z,ue=-1,Re=V.length;++ue<Re;){var tt=Q(V[ue]);tt!==t&&(z=z===t?tt:z+tt)}return z}function Rc(V,Q){for(var z=-1,ue=Array(V);++z<V;)ue[z]=Q(z);return ue}function hv(V,Q){return yt(Q,function(z){return[z,V[z]]})}function Cc(V){return V&&V.slice(0,Mp(V)+1).replace(ac,"")}function Rr(V){return function(Q){return V(Q)}}function gl(V,Q){return yt(Q,function(z){return V[z]})}function lt(V,Q){return V.has(Q)}function Tp(V,Q){for(var z=-1,ue=V.length;++z<ue&&Vi(Q,V[z],0)>-1;);return z}function Ap(V,Q){for(var z=V.length;z--&&Vi(Q,V[z],0)>-1;);return z}function $p(V,Q){for(var z=V.length,ue=0;z--;)V[z]===Q&&++ue;return ue}var mv=wc(gc),gv=wc(yc);function yv(V){return"\\"+Cp[V]}function Lo(V,Q){return V==null?t:V[Q]}function Ts(V){return tv.test(V)}function vv(V){return rv.test(V)}function bv(V){for(var Q,z=[];!(Q=V.next()).done;)z.push(Q.value);return z}function As(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue,Re){z[++Q]=[Re,ue]}),z}function jo(V,Q){return function(z){return V(Q(z))}}function yn(V,Q){for(var z=-1,ue=V.length,Re=0,tt=[];++z<ue;){var ut=V[z];(ut===Q||ut===c)&&(V[z]=c,tt[Re++]=z)}return tt}function yl(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue){z[++Q]=ue}),z}function Np(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue){z[++Q]=[ue,ue]}),z}function Sv(V,Q,z){for(var ue=z-1,Re=V.length;++ue<Re;)if(V[ue]===Q)return ue;return-1}function xc(V,Q,z){for(var ue=z+1;ue--;)if(V[ue]===Q)return ue;return ue}function Si(V){return Ts(V)?_v(V):uv(V)}function Cr(V){return Ts(V)?Rv(V):cv(V)}function Mp(V){for(var Q=V.length;Q--&&il.test(V.charAt(Q)););return Q}var wv=wc(sv);function _v(V){for(var Q=mc.lastIndex=0;mc.test(V);)++Q;return Q}function Rv(V){return V.match(mc)||[]}function Cv(V){return V.match(ev)||[]}var xv=(function V(Q){Q=Q==null?Ut:wi.defaults(Ut.Object(),Q,wi.pick(Ut,nv));var z=Q.Array,ue=Q.Date,Re=Q.Error,tt=Q.Function,ut=Q.Math,ze=Q.Object,vl=Q.RegExp,Ev=Q.String,xr=Q.TypeError,Uo=z.prototype,Iv=tt.prototype,$s=ze.prototype,Ho=Q["__core-js_shared__"],bl=Iv.toString,ot=$s.hasOwnProperty,Ov=0,Fp=(function(){var a=/[^.]+$/.exec(Ho&&Ho.keys&&Ho.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),Sl=$s.toString,qv=bl.call(ze),kv=Ut._,Pv=vl("^"+bl.call(ot).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wl=ks?Q.Buffer:t,_i=Q.Symbol,_l=Q.Uint8Array,Dp=wl?wl.allocUnsafe:t,Rl=jo(ze.getPrototypeOf,ze),Lp=ze.create,Bo=$s.propertyIsEnumerable,Cl=Uo.splice,jp=_i?_i.isConcatSpreadable:t,Vo=_i?_i.iterator:t,zi=_i?_i.toStringTag:t,xl=(function(){try{var a=ea(ze,"defineProperty");return a({},"",{}),a}catch{}})(),Tv=Q.clearTimeout!==Ut.clearTimeout&&Q.clearTimeout,Av=ue&&ue.now!==Ut.Date.now&&ue.now,$v=Q.setTimeout!==Ut.setTimeout&&Q.setTimeout,Wo=ut.ceil,zo=ut.floor,El=ze.getOwnPropertySymbols,Il=wl?wl.isBuffer:t,Ji=Q.isFinite,Ol=Uo.join,Up=jo(ze.keys,ze),Ct=ut.max,Jt=ut.min,Hp=ue.now,Nv=Q.parseInt,Bp=ut.random,Mv=Uo.reverse,Ec=ea(Q,"DataView"),Jo=ea(Q,"Map"),Ic=ea(Q,"Promise"),Ns=ea(Q,"Set"),Go=ea(Q,"WeakMap"),Yo=ea(ze,"create"),ql=Go&&new Go,Ms={},Fv=ta(Ec),Dv=ta(Jo),Lv=ta(Ic),jv=ta(Ns),Uv=ta(Go),kl=_i?_i.prototype:t,Ko=kl?kl.valueOf:t,Vp=kl?kl.toString:t;function O(a){if(Tt(a)&&!Ee(a)&&!(a instanceof De)){if(a instanceof ur)return a;if(ot.call(a,"__wrapped__"))return yE(a)}return new ur(a)}var Fs=(function(){function a(){}return function(u){if(!Pt(u))return{};if(Lp)return Lp(u);a.prototype=u;var m=new a;return a.prototype=t,m}})();function Pl(){}function ur(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}O.templateSettings={escape:Ny,evaluate:My,interpolate:hn,variable:"",imports:{_:O}},O.prototype=Pl.prototype,O.prototype.constructor=O,ur.prototype=Fs(Pl.prototype),ur.prototype.constructor=ur;function De(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ve,this.__views__=[]}function Hv(){var a=new De(this.__wrapped__);return a.__actions__=Fr(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Fr(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Fr(this.__views__),a}function Bv(){if(this.__filtered__){var a=new De(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function Oc(){var a=this.__wrapped__.value(),u=this.__dir__,m=Ee(a),b=u<0,x=m?a.length:0,P=QN(0,x,this.__views__),M=P.start,U=P.end,W=U-M,Z=b?U:M-1,X=this.__iteratees__,te=X.length,oe=0,he=Jt(W,this.__takeCount__);if(!m||!b&&x==W&&he==W)return jx(a,this.__actions__);var we=[];e:for(;W--&&oe<he;){Z+=u;for(var Pe=-1,be=a[Z];++Pe<te;){var Be=X[Pe],Je=Be.iteratee,on=Be.type,Or=Je(be);if(on==ee)be=Or;else if(!Or){if(on==K)continue e;break e}}we[oe++]=be}return we}De.prototype=Fs(Pl.prototype),De.prototype.constructor=De;function vn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Vv(){this.__data__=Yo?Yo(null):{},this.size=0}function Wv(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function zv(a){var u=this.__data__;if(Yo){var m=u[a];return m===l?t:m}return ot.call(u,a)?u[a]:t}function Jv(a){var u=this.__data__;return Yo?u[a]!==t:ot.call(u,a)}function Gv(a,u){var m=this.__data__;return this.size+=this.has(a)?0:1,m[a]=Yo&&u===t?l:u,this}vn.prototype.clear=Vv,vn.prototype.delete=Wv,vn.prototype.get=zv,vn.prototype.has=Jv,vn.prototype.set=Gv;function Hn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Wp(){this.__data__=[],this.size=0}function Yv(a){var u=this.__data__,m=Al(u,a);if(m<0)return!1;var b=u.length-1;return m==b?u.pop():Cl.call(u,m,1),--this.size,!0}function Kv(a){var u=this.__data__,m=Al(u,a);return m<0?t:u[m][1]}function zp(a){return Al(this.__data__,a)>-1}function Qv(a,u){var m=this.__data__,b=Al(m,a);return b<0?(++this.size,m.push([a,u])):m[b][1]=u,this}Hn.prototype.clear=Wp,Hn.prototype.delete=Yv,Hn.prototype.get=Kv,Hn.prototype.has=zp,Hn.prototype.set=Qv;function Bn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Zv(){this.size=0,this.__data__={hash:new vn,map:new(Jo||Hn),string:new vn}}function Ri(a){var u=ph(this,a).delete(a);return this.size-=u?1:0,u}function Jp(a){return ph(this,a).get(a)}function Xv(a){return ph(this,a).has(a)}function eb(a,u){var m=ph(this,a),b=m.size;return m.set(a,u),this.size+=m.size==b?0:1,this}Bn.prototype.clear=Zv,Bn.prototype.delete=Ri,Bn.prototype.get=Jp,Bn.prototype.has=Xv,Bn.prototype.set=eb;function Gi(a){var u=-1,m=a==null?0:a.length;for(this.__data__=new Bn;++u<m;)this.add(a[u])}function re(a){return this.__data__.set(a,l),this}function tb(a){return this.__data__.has(a)}Gi.prototype.add=Gi.prototype.push=re,Gi.prototype.has=tb;function en(a){var u=this.__data__=new Hn(a);this.size=u.size}function Gp(){this.__data__=new Hn,this.size=0}function Ye(a){var u=this.__data__,m=u.delete(a);return this.size=u.size,m}function Tl(a){return this.__data__.get(a)}function Yp(a){return this.__data__.has(a)}function qc(a,u){var m=this.__data__;if(m instanceof Hn){var b=m.__data__;if(!Jo||b.length<r-1)return b.push([a,u]),this.size=++m.size,this;m=this.__data__=new Bn(b)}return m.set(a,u),this.size=m.size,this}en.prototype.clear=Gp,en.prototype.delete=Ye,en.prototype.get=Tl,en.prototype.has=Yp,en.prototype.set=qc;function Kp(a,u){var m=Ee(a),b=!m&&ra(a),x=!m&&!b&&Vs(a),P=!m&&!b&&!x&&Ll(a),M=m||b||x||P,U=M?Rc(a.length,Ev):[],W=U.length;for(var Z in a)(u||ot.call(a,Z))&&!(M&&(Z=="length"||x&&(Z=="offset"||Z=="parent")||P&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||Zi(Z,W)))&&U.push(Z);return U}function Qp(a){var u=a.length;return u?a[hb(0,u-1)]:t}function rb(a,u){return hh(Fr(a),Ci(u,0,a.length))}function nb(a){return hh(Fr(a))}function kc(a,u,m){(m!==t&&!Gn(a[u],m)||m===t&&!(u in a))&&tn(a,u,m)}function Er(a,u,m){var b=a[u];(!(ot.call(a,u)&&Gn(b,m))||m===t&&!(u in a))&&tn(a,u,m)}function Al(a,u){for(var m=a.length;m--;)if(Gn(a[m][0],u))return m;return-1}function Zp(a,u,m,b){return xi(a,function(x,P,M){u(b,x,m(x),M)}),b}function Xp(a,u){return a&&Ei(u,tr(u),a)}function ib(a,u){return a&&Ei(u,Lr(u),a)}function tn(a,u,m){u=="__proto__"&&xl?xl(a,u,{configurable:!0,enumerable:!0,value:m,writable:!0}):a[u]=m}function Pc(a,u){for(var m=-1,b=u.length,x=z(b),P=a==null;++m<b;)x[m]=P?t:jb(a,u[m]);return x}function Ci(a,u,m){return a===a&&(m!==t&&(a=a<=m?a:m),u!==t&&(a=a>=u?a:u)),a}function cr(a,u,m,b,x,P){var M,U=u&p,W=u&h,Z=u&g;if(m&&(M=x?m(a,b,x,P):m(a)),M!==t)return M;if(!Pt(a))return a;var X=Ee(a);if(X){if(M=XN(a),!U)return Fr(a,M)}else{var te=fr(a),oe=te==pn||te==Eo;if(Vs(a))return Bx(a,U);if(te==Mn||te==rr||oe&&!x){if(M=W||oe?{}:lE(a),!U)return W?HN(a,ib(M,a)):UN(a,Xp(M,a))}else{if(!gt[te])return x?a:{};M=eM(a,te,U)}}P||(P=new en);var he=P.get(a);if(he)return he;P.set(a,M),FE(a)?a.forEach(function(be){M.add(cr(be,u,m,be,a,P))}):NE(a)&&a.forEach(function(be,Be){M.set(Be,cr(be,u,m,Be,a,P))});var we=Z?W?xb:Cb:W?Lr:tr,Pe=X?t:we(a);return _r(Pe||a,function(be,Be){Pe&&(Be=be,be=a[Be]),Er(M,Be,cr(be,u,m,Be,a,P))}),M}function sb(a){var u=tr(a);return function(m){return bn(m,a,u)}}function bn(a,u,m){var b=m.length;if(a==null)return!b;for(a=ze(a);b--;){var x=m[b],P=u[x],M=a[x];if(M===t&&!(x in a)||!P(M))return!1}return!0}function Tc(a,u,m){if(typeof a!="function")throw new xr(i);return Lc(function(){a.apply(t,m)},u)}function Qo(a,u,m,b){var x=-1,P=dl,M=!0,U=a.length,W=[],Z=u.length;if(!U)return W;m&&(u=yt(u,Rr(m))),b?(P=Ps,M=!1):u.length>=r&&(P=lt,M=!1,u=new Gi(u));e:for(;++x<U;){var X=a[x],te=m==null?X:m(X);if(X=b||X!==0?X:0,M&&te===te){for(var oe=Z;oe--;)if(u[oe]===te)continue e;W.push(X)}else P(u,te,b)||W.push(X)}return W}var xi=Gx(Sn),eh=Gx(Vn,!0);function ob(a,u){var m=!0;return xi(a,function(b,x,P){return m=!!u(b,x,P),m}),m}function $l(a,u,m){for(var b=-1,x=a.length;++b<x;){var P=a[b],M=u(P);if(M!=null&&(U===t?M===M&&!sn(M):m(M,U)))var U=M,W=P}return W}function ab(a,u,m,b){var x=a.length;for(m=Oe(m),m<0&&(m=-m>x?0:x+m),b=b===t||b>x?x:Oe(b),b<0&&(b+=x),b=m>b?0:LE(b);m<b;)a[m++]=u;return a}function th(a,u){var m=[];return xi(a,function(b,x,P){u(b,x,P)&&m.push(b)}),m}function Gt(a,u,m,b,x){var P=-1,M=a.length;for(m||(m=rM),x||(x=[]);++P<M;){var U=a[P];u>0&&m(U)?u>1?Gt(U,u-1,m,b,x):bi(x,U):b||(x[x.length]=U)}return x}var Ac=Yx(),rh=Yx(!0);function Sn(a,u){return a&&Ac(a,u,tr)}function Vn(a,u){return a&&rh(a,u,tr)}function Nl(a,u){return vi(u,function(m){return Xi(a[m])})}function Yi(a,u){u=Hs(u,a);for(var m=0,b=u.length;a!=null&&m<b;)a=a[Jn(u[m++])];return m&&m==b?a:t}function nh(a,u,m){var b=u(a);return Ee(a)?b:bi(b,m(a))}function nr(a){return a==null?a===t?up:Ay:zi&&zi in ze(a)?KN(a):uM(a)}function $c(a,u){return a>u}function lb(a,u){return a!=null&&ot.call(a,u)}function ub(a,u){return a!=null&&u in ze(a)}function cb(a,u,m){return a>=Jt(u,m)&&a<Ct(u,m)}function rn(a,u,m){for(var b=m?Ps:dl,x=a[0].length,P=a.length,M=P,U=z(P),W=1/0,Z=[];M--;){var X=a[M];M&&u&&(X=yt(X,Rr(u))),W=Jt(X.length,W),U[M]=!m&&(u||x>=120&&X.length>=120)?new Gi(M&&X):t}X=a[0];var te=-1,oe=U[0];e:for(;++te<x&&Z.length<W;){var he=X[te],we=u?u(he):he;if(he=m||he!==0?he:0,!(oe?lt(oe,we):b(Z,we,m))){for(M=P;--M;){var Pe=U[M];if(!(Pe?lt(Pe,we):b(a[M],we,m)))continue e}oe&&oe.push(we),Z.push(he)}}return Z}function Ds(a,u,m,b){return Sn(a,function(x,P,M){u(b,m(x),P,M)}),b}function Zo(a,u,m){u=Hs(u,a),a=dE(a,u);var b=a==null?a:a[Jn(_n(u))];return b==null?t:wr(b,a,m)}function ih(a){return Tt(a)&&nr(a)==rr}function fb(a){return Tt(a)&&nr(a)==ji}function db(a){return Tt(a)&&nr(a)==Ar}function Xo(a,u,m,b,x){return a===u?!0:a==null||u==null||!Tt(a)&&!Tt(u)?a!==a&&u!==u:Nc(a,u,m,b,Xo,x)}function Nc(a,u,m,b,x,P){var M=Ee(a),U=Ee(u),W=M?$e:fr(a),Z=U?$e:fr(u);W=W==rr?Mn:W,Z=Z==rr?Mn:Z;var X=W==Mn,te=Z==Mn,oe=W==Z;if(oe&&Vs(a)){if(!Vs(u))return!1;M=!0,X=!1}if(oe&&!X)return P||(P=new en),M||Ll(a)?sE(a,u,m,b,x,P):GN(a,u,W,m,b,x,P);if(!(m&v)){var he=X&&ot.call(a,"__wrapped__"),we=te&&ot.call(u,"__wrapped__");if(he||we){var Pe=he?a.value():a,be=we?u.value():u;return P||(P=new en),x(Pe,be,m,b,P)}}return oe?(P||(P=new en),YN(a,u,m,b,x,P)):!1}function Ls(a){return Tt(a)&&fr(a)==Zt}function js(a,u,m,b){var x=m.length,P=x,M=!b;if(a==null)return!P;for(a=ze(a);x--;){var U=m[x];if(M&&U[2]?U[1]!==a[U[0]]:!(U[0]in a))return!1}for(;++x<P;){U=m[x];var W=U[0],Z=a[W],X=U[1];if(M&&U[2]){if(Z===t&&!(W in a))return!1}else{var te=new en;if(b)var oe=b(Z,X,W,a,u,te);if(!(oe===t?Xo(X,Z,v|_,b,te):oe))return!1}}return!0}function He(a){if(!Pt(a)||iM(a))return!1;var u=Xi(a)?Pv:dp;return u.test(ta(a))}function d(a){return Tt(a)&&nr(a)==Xt}function y(a){return Tt(a)&&fr(a)==Sr}function S(a){return Tt(a)&&Sh(a.length)&&!!bt[nr(a)]}function R(a){return typeof a=="function"?a:a==null?jr:typeof a=="object"?Ee(a)?Le(a[0],a[1]):_e(a):QE(a)}function I(a){if(!Dc(a))return Up(a);var u=[];for(var m in ze(a))ot.call(a,m)&&m!="constructor"&&u.push(m);return u}function L(a){if(!Pt(a))return lM(a);var u=Dc(a),m=[];for(var b in a)b=="constructor"&&(u||!ot.call(a,b))||m.push(b);return m}function Y(a,u){return a<u}function ae(a,u){var m=-1,b=Dr(a)?z(a.length):[];return xi(a,function(x,P,M){b[++m]=u(x,P,M)}),b}function _e(a){var u=Ib(a);return u.length==1&&u[0][2]?cE(u[0][0],u[0][1]):function(m){return m===a||js(m,a,u)}}function Le(a,u){return qb(a)&&uE(u)?cE(Jn(a),u):function(m){var b=jb(m,a);return b===t&&b===u?Ub(m,a):Xo(u,b,v|_)}}function Ht(a,u,m,b,x){a!==u&&Ac(u,function(P,M){if(x||(x=new en),Pt(P))Wn(a,u,M,m,Ht,b,x);else{var U=b?b(Pb(a,M),P,M+"",a,u,x):t;U===t&&(U=P),kc(a,M,U)}},Lr)}function Wn(a,u,m,b,x,P,M){var U=Pb(a,m),W=Pb(u,m),Z=M.get(W);if(Z){kc(a,m,Z);return}var X=P?P(U,W,m+"",a,u,M):t,te=X===t;if(te){var oe=Ee(W),he=!oe&&Vs(W),we=!oe&&!he&&Ll(W);X=W,oe||he||we?Ee(U)?X=U:Dt(U)?X=Fr(U):he?(te=!1,X=Bx(W,!0)):we?(te=!1,X=Vx(W,!0)):X=[]:jc(W)||ra(W)?(X=U,ra(U)?X=jE(U):(!Pt(U)||Xi(U))&&(X=lE(W))):te=!1}te&&(M.set(W,X),x(X,W,b,P,M),M.delete(W)),kc(a,m,X)}function zn(a,u){var m=a.length;if(m)return u+=u<0?m:0,Zi(u,m)?a[u]:t}function Ax(a,u,m){u.length?u=yt(u,function(P){return Ee(P)?function(M){return Yi(M,P.length===1?P[0]:P)}:P}):u=[jr];var b=-1;u=yt(u,Rr(Se()));var x=ae(a,function(P,M,U){var W=yt(u,function(Z){return Z(P)});return{criteria:W,index:++b,value:P}});return pv(x,function(P,M){return jN(P,M,m)})}function ON(a,u){return $x(a,u,function(m,b){return Ub(a,b)})}function $x(a,u,m){for(var b=-1,x=u.length,P={};++b<x;){var M=u[b],U=Yi(a,M);m(U,M)&&Mc(P,Hs(M,a),U)}return P}function qN(a){return function(u){return Yi(u,a)}}function pb(a,u,m,b){var x=b?dv:Vi,P=-1,M=u.length,U=a;for(a===u&&(u=Fr(u)),m&&(U=yt(a,Rr(m)));++P<M;)for(var W=0,Z=u[P],X=m?m(Z):Z;(W=x(U,X,W,b))>-1;)U!==a&&Cl.call(U,W,1),Cl.call(a,W,1);return a}function Nx(a,u){for(var m=a?u.length:0,b=m-1;m--;){var x=u[m];if(m==b||x!==P){var P=x;Zi(x)?Cl.call(a,x,1):yb(a,x)}}return a}function hb(a,u){return a+zo(Bp()*(u-a+1))}function kN(a,u,m,b){for(var x=-1,P=Ct(Wo((u-a)/(m||1)),0),M=z(P);P--;)M[b?P:++x]=a,a+=m;return M}function mb(a,u){var m="";if(!a||u<1||u>ke)return m;do u%2&&(m+=a),u=zo(u/2),u&&(a+=a);while(u);return m}function Ne(a,u){return Tb(fE(a,u,jr),a+"")}function PN(a){return Qp(jl(a))}function TN(a,u){var m=jl(a);return hh(m,Ci(u,0,m.length))}function Mc(a,u,m,b){if(!Pt(a))return a;u=Hs(u,a);for(var x=-1,P=u.length,M=P-1,U=a;U!=null&&++x<P;){var W=Jn(u[x]),Z=m;if(W==="__proto__"||W==="constructor"||W==="prototype")return a;if(x!=M){var X=U[W];Z=b?b(X,W,U):t,Z===t&&(Z=Pt(X)?X:Zi(u[x+1])?[]:{})}Er(U,W,Z),U=U[W]}return a}var Mx=ql?function(a,u){return ql.set(a,u),a}:jr,AN=xl?function(a,u){return xl(a,"toString",{configurable:!0,enumerable:!1,value:Bb(u),writable:!0})}:jr;function $N(a){return hh(jl(a))}function wn(a,u,m){var b=-1,x=a.length;u<0&&(u=-u>x?0:x+u),m=m>x?x:m,m<0&&(m+=x),x=u>m?0:m-u>>>0,u>>>=0;for(var P=z(x);++b<x;)P[b]=a[b+u];return P}function NN(a,u){var m;return xi(a,function(b,x,P){return m=u(b,x,P),!m}),!!m}function sh(a,u,m){var b=0,x=a==null?b:a.length;if(typeof u=="number"&&u===u&&x<=mt){for(;b<x;){var P=b+x>>>1,M=a[P];M!==null&&!sn(M)&&(m?M<=u:M<u)?b=P+1:x=P}return x}return gb(a,u,jr,m)}function gb(a,u,m,b){var x=0,P=a==null?0:a.length;if(P===0)return 0;u=m(u);for(var M=u!==u,U=u===null,W=sn(u),Z=u===t;x<P;){var X=zo((x+P)/2),te=m(a[X]),oe=te!==t,he=te===null,we=te===te,Pe=sn(te);if(M)var be=b||we;else Z?be=we&&(b||oe):U?be=we&&oe&&(b||!he):W?be=we&&oe&&!he&&(b||!Pe):he||Pe?be=!1:be=b?te<=u:te<u;be?x=X+1:P=X}return Jt(P,We)}function Fx(a,u){for(var m=-1,b=a.length,x=0,P=[];++m<b;){var M=a[m],U=u?u(M):M;if(!m||!Gn(U,W)){var W=U;P[x++]=M===0?0:M}}return P}function Dx(a){return typeof a=="number"?a:sn(a)?le:+a}function nn(a){if(typeof a=="string")return a;if(Ee(a))return yt(a,nn)+"";if(sn(a))return Vp?Vp.call(a):"";var u=a+"";return u=="0"&&1/a==-pe?"-0":u}function Us(a,u,m){var b=-1,x=dl,P=a.length,M=!0,U=[],W=U;if(m)M=!1,x=Ps;else if(P>=r){var Z=u?null:zN(a);if(Z)return yl(Z);M=!1,x=lt,W=new Gi}else W=u?[]:U;e:for(;++b<P;){var X=a[b],te=u?u(X):X;if(X=m||X!==0?X:0,M&&te===te){for(var oe=W.length;oe--;)if(W[oe]===te)continue e;u&&W.push(te),U.push(X)}else x(W,te,m)||(W!==U&&W.push(te),U.push(X))}return U}function yb(a,u){u=Hs(u,a);var m=-1,b=u.length;if(!b)return!0;for(;++m<b;){var x=Jn(u[m]);if(x==="__proto__"&&!ot.call(a,"__proto__")||(x==="constructor"||x==="prototype")&&m<b-1)return!1}var P=dE(a,u);return P==null||delete P[Jn(_n(u))]}function Lx(a,u,m,b){return Mc(a,u,m(Yi(a,u)),b)}function oh(a,u,m,b){for(var x=a.length,P=b?x:-1;(b?P--:++P<x)&&u(a[P],P,a););return m?wn(a,b?0:P,b?P+1:x):wn(a,b?P+1:0,b?x:P)}function jx(a,u){var m=a;return m instanceof De&&(m=m.value()),Sc(u,function(b,x){return x.func.apply(x.thisArg,bi([b],x.args))},m)}function vb(a,u,m){var b=a.length;if(b<2)return b?Us(a[0]):[];for(var x=-1,P=z(b);++x<b;)for(var M=a[x],U=-1;++U<b;)U!=x&&(P[x]=Qo(P[x]||M,a[U],u,m));return Us(Gt(P,1),u,m)}function Ux(a,u,m){for(var b=-1,x=a.length,P=u.length,M={};++b<x;){var U=b<P?u[b]:t;m(M,a[b],U)}return M}function bb(a){return Dt(a)?a:[]}function Sb(a){return typeof a=="function"?a:jr}function Hs(a,u){return Ee(a)?a:qb(a,u)?[a]:gE(ct(a))}var MN=Ne;function Bs(a,u,m){var b=a.length;return m=m===t?b:m,!u&&m>=b?a:wn(a,u,m)}var Hx=Tv||function(a){return Ut.clearTimeout(a)};function Bx(a,u){if(u)return a.slice();var m=a.length,b=Dp?Dp(m):new a.constructor(m);return a.copy(b),b}function wb(a){var u=new a.constructor(a.byteLength);return new _l(u).set(new _l(a)),u}function FN(a,u){var m=u?wb(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.byteLength)}function DN(a){var u=new a.constructor(a.source,fp.exec(a));return u.lastIndex=a.lastIndex,u}function LN(a){return Ko?ze(Ko.call(a)):{}}function Vx(a,u){var m=u?wb(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.length)}function Wx(a,u){if(a!==u){var m=a!==t,b=a===null,x=a===a,P=sn(a),M=u!==t,U=u===null,W=u===u,Z=sn(u);if(!U&&!Z&&!P&&a>u||P&&M&&W&&!U&&!Z||b&&M&&W||!m&&W||!x)return 1;if(!b&&!P&&!Z&&a<u||Z&&m&&x&&!b&&!P||U&&m&&x||!M&&x||!W)return-1}return 0}function jN(a,u,m){for(var b=-1,x=a.criteria,P=u.criteria,M=x.length,U=m.length;++b<M;){var W=Wx(x[b],P[b]);if(W){if(b>=U)return W;var Z=m[b];return W*(Z=="desc"?-1:1)}}return a.index-u.index}function zx(a,u,m,b){for(var x=-1,P=a.length,M=m.length,U=-1,W=u.length,Z=Ct(P-M,0),X=z(W+Z),te=!b;++U<W;)X[U]=u[U];for(;++x<M;)(te||x<P)&&(X[m[x]]=a[x]);for(;Z--;)X[U++]=a[x++];return X}function Jx(a,u,m,b){for(var x=-1,P=a.length,M=-1,U=m.length,W=-1,Z=u.length,X=Ct(P-U,0),te=z(X+Z),oe=!b;++x<X;)te[x]=a[x];for(var he=x;++W<Z;)te[he+W]=u[W];for(;++M<U;)(oe||x<P)&&(te[he+m[M]]=a[x++]);return te}function Fr(a,u){var m=-1,b=a.length;for(u||(u=z(b));++m<b;)u[m]=a[m];return u}function Ei(a,u,m,b){var x=!m;m||(m={});for(var P=-1,M=u.length;++P<M;){var U=u[P],W=b?b(m[U],a[U],U,m,a):t;W===t&&(W=a[U]),x?tn(m,U,W):Er(m,U,W)}return m}function UN(a,u){return Ei(a,Ob(a),u)}function HN(a,u){return Ei(a,oE(a),u)}function ah(a,u){return function(m,b){var x=Ee(m)?Un:Zp,P=u?u():{};return x(m,a,Se(b,2),P)}}function Ml(a){return Ne(function(u,m){var b=-1,x=m.length,P=x>1?m[x-1]:t,M=x>2?m[2]:t;for(P=a.length>3&&typeof P=="function"?(x--,P):t,M&&Ir(m[0],m[1],M)&&(P=x<3?t:P,x=1),u=ze(u);++b<x;){var U=m[b];U&&a(u,U,b,P)}return u})}function Gx(a,u){return function(m,b){if(m==null)return m;if(!Dr(m))return a(m,b);for(var x=m.length,P=u?x:-1,M=ze(m);(u?P--:++P<x)&&b(M[P],P,M)!==!1;);return m}}function Yx(a){return function(u,m,b){for(var x=-1,P=ze(u),M=b(u),U=M.length;U--;){var W=M[a?U:++x];if(m(P[W],W,P)===!1)break}return u}}function BN(a,u,m){var b=u&w,x=Fc(a);function P(){var M=this&&this!==Ut&&this instanceof P?x:a;return M.apply(b?m:this,arguments)}return P}function Kx(a){return function(u){u=ct(u);var m=Ts(u)?Cr(u):t,b=m?m[0]:u.charAt(0),x=m?Bs(m,1).join(""):u.slice(1);return b[a]()+x}}function Fl(a){return function(u){return Sc(YE(GE(u).replace(Zy,"")),a,"")}}function Fc(a){return function(){var u=arguments;switch(u.length){case 0:return new a;case 1:return new a(u[0]);case 2:return new a(u[0],u[1]);case 3:return new a(u[0],u[1],u[2]);case 4:return new a(u[0],u[1],u[2],u[3]);case 5:return new a(u[0],u[1],u[2],u[3],u[4]);case 6:return new a(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new a(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var m=Fs(a.prototype),b=a.apply(m,u);return Pt(b)?b:m}}function VN(a,u,m){var b=Fc(a);function x(){for(var P=arguments.length,M=z(P),U=P,W=Dl(x);U--;)M[U]=arguments[U];var Z=P<3&&M[0]!==W&&M[P-1]!==W?[]:yn(M,W);if(P-=Z.length,P<m)return tE(a,u,lh,x.placeholder,t,M,Z,t,t,m-P);var X=this&&this!==Ut&&this instanceof x?b:a;return wr(X,this,M)}return x}function Qx(a){return function(u,m,b){var x=ze(u);if(!Dr(u)){var P=Se(m,3);u=tr(u),m=function(U){return P(x[U],U,x)}}var M=a(u,m,b);return M>-1?x[P?u[M]:M]:t}}function Zx(a){return Qi(function(u){var m=u.length,b=m,x=ur.prototype.thru;for(a&&u.reverse();b--;){var P=u[b];if(typeof P!="function")throw new xr(i);if(x&&!M&&dh(P)=="wrapper")var M=new ur([],!0)}for(b=M?b:m;++b<m;){P=u[b];var U=dh(P),W=U=="wrapper"?Eb(P):t;W&&kb(W[0])&&W[1]==(G|T|$|q)&&!W[4].length&&W[9]==1?M=M[dh(W[0])].apply(M,W[3]):M=P.length==1&&kb(P)?M[U]():M.thru(P)}return function(){var Z=arguments,X=Z[0];if(M&&Z.length==1&&Ee(X))return M.plant(X).value();for(var te=0,oe=m?u[te].apply(this,Z):X;++te<m;)oe=u[te].call(this,oe);return oe}})}function lh(a,u,m,b,x,P,M,U,W,Z){var X=u&G,te=u&w,oe=u&E,he=u&(T|N),we=u&C,Pe=oe?t:Fc(a);function be(){for(var Be=arguments.length,Je=z(Be),on=Be;on--;)Je[on]=arguments[on];if(he)var Or=Dl(be),an=$p(Je,Or);if(b&&(Je=zx(Je,b,x,he)),P&&(Je=Jx(Je,P,M,he)),Be-=an,he&&Be<Z){var Lt=yn(Je,Or);return tE(a,u,lh,be.placeholder,m,Je,Lt,U,W,Z-Be)}var Yn=te?m:this,ts=oe?Yn[a]:a;return Be=Je.length,U?Je=cM(Je,U):we&&Be>1&&Je.reverse(),X&&W<Be&&(Je.length=W),this&&this!==Ut&&this instanceof be&&(ts=Pe||Fc(ts)),ts.apply(Yn,Je)}return be}function Xx(a,u){return function(m,b){return Ds(m,a,u(b),{})}}function uh(a,u){return function(m,b){var x;if(m===t&&b===t)return u;if(m!==t&&(x=m),b!==t){if(x===t)return b;typeof m=="string"||typeof b=="string"?(m=nn(m),b=nn(b)):(m=Dx(m),b=Dx(b)),x=a(m,b)}return x}}function _b(a){return Qi(function(u){return u=yt(u,Rr(Se())),Ne(function(m){var b=this;return a(u,function(x){return wr(x,b,m)})})})}function ch(a,u){u=u===t?" ":nn(u);var m=u.length;if(m<2)return m?mb(u,a):u;var b=mb(u,Wo(a/Si(u)));return Ts(u)?Bs(Cr(b),0,a).join(""):b.slice(0,a)}function WN(a,u,m,b){var x=u&w,P=Fc(a);function M(){for(var U=-1,W=arguments.length,Z=-1,X=b.length,te=z(X+W),oe=this&&this!==Ut&&this instanceof M?P:a;++Z<X;)te[Z]=b[Z];for(;W--;)te[Z++]=arguments[++U];return wr(oe,x?m:this,te)}return M}function eE(a){return function(u,m,b){return b&&typeof b!="number"&&Ir(u,m,b)&&(m=b=t),u=es(u),m===t?(m=u,u=0):m=es(m),b=b===t?u<m?1:-1:es(b),kN(u,m,b,a)}}function fh(a){return function(u,m){return typeof u=="string"&&typeof m=="string"||(u=Rn(u),m=Rn(m)),a(u,m)}}function tE(a,u,m,b,x,P,M,U,W,Z){var X=u&T,te=X?M:t,oe=X?t:M,he=X?P:t,we=X?t:P;u|=X?$:j,u&=~(X?j:$),u&k||(u&=~(w|E));var Pe=[a,u,x,he,te,we,oe,U,W,Z],be=m.apply(t,Pe);return kb(a)&&pE(be,Pe),be.placeholder=b,hE(be,a,u)}function Rb(a){var u=ut[a];return function(m,b){if(m=Rn(m),b=b==null?0:Jt(Oe(b),292),b&&Ji(m)){var x=(ct(m)+"e").split("e"),P=u(x[0]+"e"+(+x[1]+b));return x=(ct(P)+"e").split("e"),+(x[0]+"e"+(+x[1]-b))}return u(m)}}var zN=Ns&&1/yl(new Ns([,-0]))[1]==pe?function(a){return new Ns(a)}:zb;function rE(a){return function(u){var m=fr(u);return m==Zt?As(u):m==Sr?Np(u):hv(u,a(u))}}function Ki(a,u,m,b,x,P,M,U){var W=u&E;if(!W&&typeof a!="function")throw new xr(i);var Z=b?b.length:0;if(Z||(u&=~($|j),b=x=t),M=M===t?M:Ct(Oe(M),0),U=U===t?U:Oe(U),Z-=x?x.length:0,u&j){var X=b,te=x;b=x=t}var oe=W?t:Eb(a),he=[a,u,m,b,x,X,te,P,M,U];if(oe&&aM(he,oe),a=he[0],u=he[1],m=he[2],b=he[3],x=he[4],U=he[9]=he[9]===t?W?0:a.length:Ct(he[9]-Z,0),!U&&u&(T|N)&&(u&=~(T|N)),!u||u==w)var we=BN(a,u,m);else u==T||u==N?we=VN(a,u,U):(u==$||u==(w|$))&&!x.length?we=WN(a,u,m,b):we=lh.apply(t,he);var Pe=oe?Mx:pE;return hE(Pe(we,he),a,u)}function nE(a,u,m,b){return a===t||Gn(a,$s[m])&&!ot.call(b,m)?u:a}function iE(a,u,m,b,x,P){return Pt(a)&&Pt(u)&&(P.set(u,a),Ht(a,u,t,iE,P),P.delete(u)),a}function JN(a){return jc(a)?t:a}function sE(a,u,m,b,x,P){var M=m&v,U=a.length,W=u.length;if(U!=W&&!(M&&W>U))return!1;var Z=P.get(a),X=P.get(u);if(Z&&X)return Z==u&&X==a;var te=-1,oe=!0,he=m&_?new Gi:t;for(P.set(a,u),P.set(u,a);++te<U;){var we=a[te],Pe=u[te];if(b)var be=M?b(Pe,we,te,u,a,P):b(we,Pe,te,a,u,P);if(be!==t){if(be)continue;oe=!1;break}if(he){if(!pl(u,function(Be,Je){if(!lt(he,Je)&&(we===Be||x(we,Be,m,b,P)))return he.push(Je)})){oe=!1;break}}else if(!(we===Pe||x(we,Pe,m,b,P))){oe=!1;break}}return P.delete(a),P.delete(u),oe}function GN(a,u,m,b,x,P,M){switch(m){case Fn:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case ji:return!(a.byteLength!=u.byteLength||!P(new _l(a),new _l(u)));case Xr:case Ar:case Io:return Gn(+a,+u);case Rt:return a.name==u.name&&a.message==u.message;case Xt:case Oo:return a==u+"";case Zt:var U=As;case Sr:var W=b&v;if(U||(U=yl),a.size!=u.size&&!W)return!1;var Z=M.get(a);if(Z)return Z==u;b|=_,M.set(a,u);var X=sE(U(a),U(u),b,x,P,M);return M.delete(a),X;case Za:if(Ko)return Ko.call(a)==Ko.call(u)}return!1}function YN(a,u,m,b,x,P){var M=m&v,U=Cb(a),W=U.length,Z=Cb(u),X=Z.length;if(W!=X&&!M)return!1;for(var te=W;te--;){var oe=U[te];if(!(M?oe in u:ot.call(u,oe)))return!1}var he=P.get(a),we=P.get(u);if(he&&we)return he==u&&we==a;var Pe=!0;P.set(a,u),P.set(u,a);for(var be=M;++te<W;){oe=U[te];var Be=a[oe],Je=u[oe];if(b)var on=M?b(Je,Be,oe,u,a,P):b(Be,Je,oe,a,u,P);if(!(on===t?Be===Je||x(Be,Je,m,b,P):on)){Pe=!1;break}be||(be=oe=="constructor")}if(Pe&&!be){var Or=a.constructor,an=u.constructor;Or!=an&&"constructor"in a&&"constructor"in u&&!(typeof Or=="function"&&Or instanceof Or&&typeof an=="function"&&an instanceof an)&&(Pe=!1)}return P.delete(a),P.delete(u),Pe}function Qi(a){return Tb(fE(a,t,SE),a+"")}function Cb(a){return nh(a,tr,Ob)}function xb(a){return nh(a,Lr,oE)}var Eb=ql?function(a){return ql.get(a)}:zb;function dh(a){for(var u=a.name+"",m=Ms[u],b=ot.call(Ms,u)?m.length:0;b--;){var x=m[b],P=x.func;if(P==null||P==a)return x.name}return u}function Dl(a){var u=ot.call(O,"placeholder")?O:a;return u.placeholder}function Se(){var a=O.iteratee||Vb;return a=a===Vb?R:a,arguments.length?a(arguments[0],arguments[1]):a}function ph(a,u){var m=a.__data__;return nM(u)?m[typeof u=="string"?"string":"hash"]:m.map}function Ib(a){for(var u=tr(a),m=u.length;m--;){var b=u[m],x=a[b];u[m]=[b,x,uE(x)]}return u}function ea(a,u){var m=Lo(a,u);return He(m)?m:t}function KN(a){var u=ot.call(a,zi),m=a[zi];try{a[zi]=t;var b=!0}catch{}var x=Sl.call(a);return b&&(u?a[zi]=m:delete a[zi]),x}var Ob=El?function(a){return a==null?[]:(a=ze(a),vi(El(a),function(u){return Bo.call(a,u)}))}:Jb,oE=El?function(a){for(var u=[];a;)bi(u,Ob(a)),a=Rl(a);return u}:Jb,fr=nr;(Ec&&fr(new Ec(new ArrayBuffer(1)))!=Fn||Jo&&fr(new Jo)!=Zt||Ic&&fr(Ic.resolve())!=ap||Ns&&fr(new Ns)!=Sr||Go&&fr(new Go)!=zt)&&(fr=function(a){var u=nr(a),m=u==Mn?a.constructor:t,b=m?ta(m):"";if(b)switch(b){case Fv:return Fn;case Dv:return Zt;case Lv:return ap;case jv:return Sr;case Uv:return zt}return u});function QN(a,u,m){for(var b=-1,x=m.length;++b<x;){var P=m[b],M=P.size;switch(P.type){case"drop":a+=M;break;case"dropRight":u-=M;break;case"take":u=Jt(u,a+M);break;case"takeRight":a=Ct(a,u-M);break}}return{start:a,end:u}}function ZN(a){var u=a.match(Dn);return u?u[1].split(mn):[]}function aE(a,u,m){u=Hs(u,a);for(var b=-1,x=u.length,P=!1;++b<x;){var M=Jn(u[b]);if(!(P=a!=null&&m(a,M)))break;a=a[M]}return P||++b!=x?P:(x=a==null?0:a.length,!!x&&Sh(x)&&Zi(M,x)&&(Ee(a)||ra(a)))}function XN(a){var u=a.length,m=new a.constructor(u);return u&&typeof a[0]=="string"&&ot.call(a,"index")&&(m.index=a.index,m.input=a.input),m}function lE(a){return typeof a.constructor=="function"&&!Dc(a)?Fs(Rl(a)):{}}function eM(a,u,m){var b=a.constructor;switch(u){case ji:return wb(a);case Xr:case Ar:return new b(+a);case Fn:return FN(a,m);case pt:case Xa:case el:case Cs:case qo:case xs:case yi:case Es:case sc:return Vx(a,m);case Zt:return new b;case Io:case Oo:return new b(a);case Xt:return DN(a);case Sr:return new b;case Za:return LN(a)}}function tM(a,u){var m=u.length;if(!m)return a;var b=m-1;return u[b]=(m>1?"& ":"")+u[b],u=u.join(m>2?", ":" "),a.replace(er,`{
2
2
  /* [wrapped with `+u+`] */
3
- `)}function rM(a){return Ee(a)||ra(a)||!!(jp&&a&&a[jp])}function Zi(a,u){var m=typeof a;return u=u??ke,!!u&&(m=="number"||m!="symbol"&&Is.test(a))&&a>-1&&a%1==0&&a<u}function Ir(a,u,m){if(!Pt(m))return!1;var b=typeof u;return(b=="number"?Dr(m)&&Zi(u,m.length):b=="string"&&u in m)?Gn(m[u],a):!1}function Ob(a,u){if(Ee(a))return!1;var m=typeof a;return m=="number"||m=="symbol"||m=="boolean"||a==null||sn(a)?!0:Fe.test(a)||!$r.test(a)||u!=null&&a in ze(u)}function nM(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function kb(a){var u=dh(a),m=q[u];if(typeof m!="function"||!(u in De.prototype))return!1;if(a===m)return!0;var b=Eb(m);return!!b&&a===b[0]}function iM(a){return!!Fp&&Fp in a}var sM=Ho?Xi:Gb;function Dc(a){var u=a&&a.constructor,m=typeof u=="function"&&u.prototype||$s;return a===m}function uE(a){return a===a&&!Pt(a)}function cE(a,u){return function(m){return m==null?!1:m[a]===u&&(u!==t||a in ze(m))}}function oM(a){var u=vh(a,function(b){return m.size===f&&m.clear(),b}),m=u.cache;return u}function aM(a,u){var m=a[1],b=u[1],x=m|b,P=x<(w|E|G),M=b==G&&m==T||b==G&&m==O&&a[7].length<=u[8]||b==(G|O)&&u[7].length<=u[8]&&m==T;if(!(P||M))return a;b&w&&(a[2]=u[2],x|=m&w?0:k);var U=u[3];if(U){var W=a[3];a[3]=W?zx(W,U,u[4]):U,a[4]=W?yn(a[3],c):u[4]}return U=u[5],U&&(W=a[5],a[5]=W?Jx(W,U,u[6]):U,a[6]=W?yn(a[5],c):u[6]),U=u[7],U&&(a[7]=U),b&G&&(a[8]=a[8]==null?u[8]:Jt(a[8],u[8])),a[9]==null&&(a[9]=u[9]),a[0]=u[0],a[1]=x,a}function lM(a){var u=[];if(a!=null)for(var m in ze(a))u.push(m);return u}function uM(a){return Sl.call(a)}function fE(a,u,m){return u=Ct(u===t?a.length-1:u,0),function(){for(var b=arguments,x=-1,P=Ct(b.length-u,0),M=z(P);++x<P;)M[x]=b[u+x];x=-1;for(var U=z(u+1);++x<u;)U[x]=b[x];return U[u]=m(M),wr(a,this,U)}}function dE(a,u){return u.length<2?a:Yi(a,wn(u,0,-1))}function cM(a,u){for(var m=a.length,b=Jt(u.length,m),x=Fr(a);b--;){var P=u[b];a[b]=Zi(P,m)?x[P]:t}return a}function Pb(a,u){if(!(u==="constructor"&&typeof a[u]=="function")&&u!="__proto__")return a[u]}var pE=mE(Mx),Lc=$v||function(a,u){return Ut.setTimeout(a,u)},Tb=mE(AN);function hE(a,u,m){var b=u+"";return Tb(a,tM(b,fM(ZN(b),m)))}function mE(a){var u=0,m=0;return function(){var b=Hp(),x=F-(b-m);if(m=b,x>0){if(++u>=B)return arguments[0]}else u=0;return a.apply(t,arguments)}}function hh(a,u){var m=-1,b=a.length,x=b-1;for(u=u===t?b:u;++m<u;){var P=hb(m,x),M=a[P];a[P]=a[m],a[m]=M}return a.length=u,a}var gE=oM(function(a){var u=[];return a.charCodeAt(0)===46&&u.push(""),a.replace(oc,function(m,b,x,P){u.push(x?P.replace(Ln,"$1"):b||m)}),u});function Jn(a){if(typeof a=="string"||sn(a))return a;var u=a+"";return u=="0"&&1/a==-pe?"-0":u}function ta(a){if(a!=null){try{return bl.call(a)}catch{}try{return a+""}catch{}}return""}function fM(a,u){return _r(ce,function(m){var b="_."+m[0];u&m[1]&&!dl(a,b)&&a.push(b)}),a.sort()}function yE(a){if(a instanceof De)return a.clone();var u=new ur(a.__wrapped__,a.__chain__);return u.__actions__=Fr(a.__actions__),u.__index__=a.__index__,u.__values__=a.__values__,u}function dM(a,u,m){(m?Ir(a,u,m):u===t)?u=1:u=Ct(qe(u),0);var b=a==null?0:a.length;if(!b||u<1)return[];for(var x=0,P=0,M=z(Wo(b/u));x<b;)M[P++]=wn(a,x,x+=u);return M}function pM(a){for(var u=-1,m=a==null?0:a.length,b=0,x=[];++u<m;){var P=a[u];P&&(x[b++]=P)}return x}function hM(){var a=arguments.length;if(!a)return[];for(var u=z(a-1),m=arguments[0],b=a;b--;)u[b-1]=arguments[b];return bi(Ee(m)?Fr(m):[m],Gt(u,1))}var mM=Ne(function(a,u){return Dt(a)?Qo(a,Gt(u,1,Dt,!0)):[]}),gM=Ne(function(a,u){var m=_n(u);return Dt(m)&&(m=t),Dt(a)?Qo(a,Gt(u,1,Dt,!0),Se(m,2)):[]}),yM=Ne(function(a,u){var m=_n(u);return Dt(m)&&(m=t),Dt(a)?Qo(a,Gt(u,1,Dt,!0),t,m):[]});function vM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:qe(u),wn(a,u<0?0:u,b)):[]}function bM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:qe(u),u=b-u,wn(a,0,u<0?0:u)):[]}function SM(a,u){return a&&a.length?oh(a,Se(u,3),!0,!0):[]}function wM(a,u){return a&&a.length?oh(a,Se(u,3),!0):[]}function _M(a,u,m,b){var x=a==null?0:a.length;return x?(m&&typeof m!="number"&&Ir(a,u,m)&&(m=0,b=x),ab(a,u,m,b)):[]}function vE(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=m==null?0:qe(m);return x<0&&(x=Ct(b+x,0)),hl(a,Se(u,3),x)}function bE(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=b-1;return m!==t&&(x=qe(m),x=m<0?Ct(b+x,0):Jt(x,b-1)),hl(a,Se(u,3),x,!0)}function SE(a){var u=a==null?0:a.length;return u?Gt(a,1):[]}function RM(a){var u=a==null?0:a.length;return u?Gt(a,pe):[]}function CM(a,u){var m=a==null?0:a.length;return m?(u=u===t?1:qe(u),Gt(a,u)):[]}function xM(a){for(var u=-1,m=a==null?0:a.length,b={};++u<m;){var x=a[u];tn(b,x[0],x[1])}return b}function wE(a){return a&&a.length?a[0]:t}function EM(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=m==null?0:qe(m);return x<0&&(x=Ct(b+x,0)),Vi(a,u,x)}function IM(a){var u=a==null?0:a.length;return u?wn(a,0,-1):[]}var qM=Ne(function(a){var u=yt(a,bb);return u.length&&u[0]===a[0]?rn(u):[]}),OM=Ne(function(a){var u=_n(a),m=yt(a,bb);return u===_n(m)?u=t:m.pop(),m.length&&m[0]===a[0]?rn(m,Se(u,2)):[]}),kM=Ne(function(a){var u=_n(a),m=yt(a,bb);return u=typeof u=="function"?u:t,u&&m.pop(),m.length&&m[0]===a[0]?rn(m,t,u):[]});function PM(a,u){return a==null?"":ql.call(a,u)}function _n(a){var u=a==null?0:a.length;return u?a[u-1]:t}function TM(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=b;return m!==t&&(x=qe(m),x=x<0?Ct(b+x,0):Jt(x,b-1)),u===u?xc(a,u,x):hl(a,Wi,x,!0)}function AM(a,u){return a&&a.length?zn(a,qe(u)):t}var $M=Ne(_E);function _E(a,u){return a&&a.length&&u&&u.length?pb(a,u):a}function NM(a,u,m){return a&&a.length&&u&&u.length?pb(a,u,Se(m,2)):a}function MM(a,u,m){return a&&a.length&&u&&u.length?pb(a,u,t,m):a}var FM=Qi(function(a,u){var m=a==null?0:a.length,b=Pc(a,u);return Nx(a,yt(u,function(x){return Zi(x,m)?+x:x}).sort(Wx)),b});function DM(a,u){var m=[];if(!(a&&a.length))return m;var b=-1,x=[],P=a.length;for(u=Se(u,3);++b<P;){var M=a[b];u(M,b,a)&&(m.push(M),x.push(b))}return Nx(a,x),m}function Ab(a){return a==null?a:Mv.call(a)}function LM(a,u,m){var b=a==null?0:a.length;return b?(m&&typeof m!="number"&&Ir(a,u,m)?(u=0,m=b):(u=u==null?0:qe(u),m=m===t?b:qe(m)),wn(a,u,m)):[]}function jM(a,u){return sh(a,u)}function UM(a,u,m){return gb(a,u,Se(m,2))}function HM(a,u){var m=a==null?0:a.length;if(m){var b=sh(a,u);if(b<m&&Gn(a[b],u))return b}return-1}function BM(a,u){return sh(a,u,!0)}function VM(a,u,m){return gb(a,u,Se(m,2),!0)}function WM(a,u){var m=a==null?0:a.length;if(m){var b=sh(a,u,!0)-1;if(Gn(a[b],u))return b}return-1}function zM(a){return a&&a.length?Fx(a):[]}function JM(a,u){return a&&a.length?Fx(a,Se(u,2)):[]}function GM(a){var u=a==null?0:a.length;return u?wn(a,1,u):[]}function YM(a,u,m){return a&&a.length?(u=m||u===t?1:qe(u),wn(a,0,u<0?0:u)):[]}function KM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:qe(u),u=b-u,wn(a,u<0?0:u,b)):[]}function QM(a,u){return a&&a.length?oh(a,Se(u,3),!1,!0):[]}function ZM(a,u){return a&&a.length?oh(a,Se(u,3)):[]}var XM=Ne(function(a){return Us(Gt(a,1,Dt,!0))}),eF=Ne(function(a){var u=_n(a);return Dt(u)&&(u=t),Us(Gt(a,1,Dt,!0),Se(u,2))}),tF=Ne(function(a){var u=_n(a);return u=typeof u=="function"?u:t,Us(Gt(a,1,Dt,!0),t,u)});function rF(a){return a&&a.length?Us(a):[]}function nF(a,u){return a&&a.length?Us(a,Se(u,2)):[]}function iF(a,u){return u=typeof u=="function"?u:t,a&&a.length?Us(a,t,u):[]}function $b(a){if(!(a&&a.length))return[];var u=0;return a=vi(a,function(m){if(Dt(m))return u=Ct(m.length,u),!0}),Rc(u,function(m){return yt(a,Do(m))})}function RE(a,u){if(!(a&&a.length))return[];var m=$b(a);return u==null?m:yt(m,function(b){return wr(u,t,b)})}var sF=Ne(function(a,u){return Dt(a)?Qo(a,u):[]}),oF=Ne(function(a){return vb(vi(a,Dt))}),aF=Ne(function(a){var u=_n(a);return Dt(u)&&(u=t),vb(vi(a,Dt),Se(u,2))}),lF=Ne(function(a){var u=_n(a);return u=typeof u=="function"?u:t,vb(vi(a,Dt),t,u)}),uF=Ne($b);function cF(a,u){return Ux(a||[],u||[],Er)}function fF(a,u){return Ux(a||[],u||[],Mc)}var dF=Ne(function(a){var u=a.length,m=u>1?a[u-1]:t;return m=typeof m=="function"?(a.pop(),m):t,RE(a,m)});function CE(a){var u=q(a);return u.__chain__=!0,u}function pF(a,u){return u(a),a}function mh(a,u){return u(a)}var hF=Qi(function(a){var u=a.length,m=u?a[0]:0,b=this.__wrapped__,x=function(P){return Pc(P,a)};return u>1||this.__actions__.length||!(b instanceof De)||!Zi(m)?this.thru(x):(b=b.slice(m,+m+(u?1:0)),b.__actions__.push({func:mh,args:[x],thisArg:t}),new ur(b,this.__chain__).thru(function(P){return u&&!P.length&&P.push(t),P}))});function mF(){return CE(this)}function gF(){return new ur(this.value(),this.__chain__)}function yF(){this.__values__===t&&(this.__values__=DE(this.value()));var a=this.__index__>=this.__values__.length,u=a?t:this.__values__[this.__index__++];return{done:a,value:u}}function vF(){return this}function bF(a){for(var u,m=this;m instanceof Pl;){var b=yE(m);b.__index__=0,b.__values__=t,u?x.__wrapped__=b:u=b;var x=b;m=m.__wrapped__}return x.__wrapped__=a,u}function SF(){var a=this.__wrapped__;if(a instanceof De){var u=a;return this.__actions__.length&&(u=new De(this)),u=u.reverse(),u.__actions__.push({func:mh,args:[Ab],thisArg:t}),new ur(u,this.__chain__)}return this.thru(Ab)}function wF(){return jx(this.__wrapped__,this.__actions__)}var _F=ah(function(a,u,m){ot.call(a,m)?++a[m]:tn(a,m,1)});function RF(a,u,m){var b=Ee(a)?Op:ob;return m&&Ir(a,u,m)&&(u=t),b(a,Se(u,3))}function CF(a,u){var m=Ee(a)?vi:th;return m(a,Se(u,3))}var xF=Qx(vE),EF=Qx(bE);function IF(a,u){return Gt(gh(a,u),1)}function qF(a,u){return Gt(gh(a,u),pe)}function OF(a,u,m){return m=m===t?1:qe(m),Gt(gh(a,u),m)}function xE(a,u){var m=Ee(a)?_r:xi;return m(a,Se(u,3))}function EE(a,u){var m=Ee(a)?bc:eh;return m(a,Se(u,3))}var kF=ah(function(a,u,m){ot.call(a,m)?a[m].push(u):tn(a,m,[u])});function PF(a,u,m,b){a=Dr(a)?a:jl(a),m=m&&!b?qe(m):0;var x=a.length;return m<0&&(m=Ct(x+m,0)),wh(a)?m<=x&&a.indexOf(u,m)>-1:!!x&&Vi(a,u,m)>-1}var TF=Ne(function(a,u,m){var b=-1,x=typeof u=="function",P=Dr(a)?z(a.length):[];return xi(a,function(M){P[++b]=x?wr(u,M,m):Zo(M,u,m)}),P}),AF=ah(function(a,u,m){tn(a,m,u)});function gh(a,u){var m=Ee(a)?yt:ae;return m(a,Se(u,3))}function $F(a,u,m,b){return a==null?[]:(Ee(u)||(u=u==null?[]:[u]),m=b?t:m,Ee(m)||(m=m==null?[]:[m]),Ax(a,u,m))}var NF=ah(function(a,u,m){a[m?0:1].push(u)},function(){return[[],[]]});function MF(a,u,m){var b=Ee(a)?Sc:ml,x=arguments.length<3;return b(a,Se(u,4),m,x,xi)}function FF(a,u,m){var b=Ee(a)?lv:ml,x=arguments.length<3;return b(a,Se(u,4),m,x,eh)}function DF(a,u){var m=Ee(a)?vi:th;return m(a,bh(Se(u,3)))}function LF(a){var u=Ee(a)?Qp:PN;return u(a)}function jF(a,u,m){(m?Ir(a,u,m):u===t)?u=1:u=qe(u);var b=Ee(a)?rb:TN;return b(a,u)}function UF(a){var u=Ee(a)?nb:$N;return u(a)}function HF(a){if(a==null)return 0;if(Dr(a))return wh(a)?Si(a):a.length;var u=fr(a);return u==Zt||u==Sr?a.size:I(a).length}function BF(a,u,m){var b=Ee(a)?pl:NN;return m&&Ir(a,u,m)&&(u=t),b(a,Se(u,3))}var VF=Ne(function(a,u){if(a==null)return[];var m=u.length;return m>1&&Ir(a,u[0],u[1])?u=[]:m>2&&Ir(u[0],u[1],u[2])&&(u=[u[0]]),Ax(a,Gt(u,1),[])}),yh=Av||function(){return Ut.Date.now()};function WF(a,u){if(typeof u!="function")throw new xr(i);return a=qe(a),function(){if(--a<1)return u.apply(this,arguments)}}function IE(a,u,m){return u=m?t:u,u=a&&u==null?a.length:u,Ki(a,G,t,t,t,t,u)}function qE(a,u){var m;if(typeof u!="function")throw new xr(i);return a=qe(a),function(){return--a>0&&(m=u.apply(this,arguments)),a<=1&&(u=t),m}}var Nb=Ne(function(a,u,m){var b=w;if(m.length){var x=yn(m,Dl(Nb));b|=$}return Ki(a,b,u,m,x)}),OE=Ne(function(a,u,m){var b=w|E;if(m.length){var x=yn(m,Dl(OE));b|=$}return Ki(u,b,a,m,x)});function kE(a,u,m){u=m?t:u;var b=Ki(a,T,t,t,t,t,t,u);return b.placeholder=kE.placeholder,b}function PE(a,u,m){u=m?t:u;var b=Ki(a,N,t,t,t,t,t,u);return b.placeholder=PE.placeholder,b}function TE(a,u,m){var b,x,P,M,U,W,Z=0,X=!1,te=!1,oe=!0;if(typeof a!="function")throw new xr(i);u=Rn(u)||0,Pt(m)&&(X=!!m.leading,te="maxWait"in m,P=te?Ct(Rn(m.maxWait)||0,u):P,oe="trailing"in m?!!m.trailing:oe);function he(Lt){var Yn=b,ts=x;return b=x=t,Z=Lt,M=a.apply(ts,Yn),M}function we(Lt){return Z=Lt,U=Lc(Be,u),X?he(Lt):M}function Pe(Lt){var Yn=Lt-W,ts=Lt-Z,ZE=u-Yn;return te?Jt(ZE,P-ts):ZE}function be(Lt){var Yn=Lt-W,ts=Lt-Z;return W===t||Yn>=u||Yn<0||te&&ts>=P}function Be(){var Lt=yh();if(be(Lt))return Je(Lt);U=Lc(Be,Pe(Lt))}function Je(Lt){return U=t,oe&&b?he(Lt):(b=x=t,M)}function on(){U!==t&&Hx(U),Z=0,b=W=x=U=t}function qr(){return U===t?M:Je(yh())}function an(){var Lt=yh(),Yn=be(Lt);if(b=arguments,x=this,W=Lt,Yn){if(U===t)return we(W);if(te)return Hx(U),U=Lc(Be,u),he(W)}return U===t&&(U=Lc(Be,u)),M}return an.cancel=on,an.flush=qr,an}var zF=Ne(function(a,u){return Tc(a,1,u)}),JF=Ne(function(a,u,m){return Tc(a,Rn(u)||0,m)});function GF(a){return Ki(a,C)}function vh(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new xr(i);var m=function(){var b=arguments,x=u?u.apply(this,b):b[0],P=m.cache;if(P.has(x))return P.get(x);var M=a.apply(this,b);return m.cache=P.set(x,M)||P,M};return m.cache=new(vh.Cache||Bn),m}vh.Cache=Bn;function bh(a){if(typeof a!="function")throw new xr(i);return function(){var u=arguments;switch(u.length){case 0:return!a.call(this);case 1:return!a.call(this,u[0]);case 2:return!a.call(this,u[0],u[1]);case 3:return!a.call(this,u[0],u[1],u[2])}return!a.apply(this,u)}}function YF(a){return qE(2,a)}var KF=MN(function(a,u){u=u.length==1&&Ee(u[0])?yt(u[0],Rr(Se())):yt(Gt(u,1),Rr(Se()));var m=u.length;return Ne(function(b){for(var x=-1,P=Jt(b.length,m);++x<P;)b[x]=u[x].call(this,b[x]);return wr(a,this,b)})}),Mb=Ne(function(a,u){var m=yn(u,Dl(Mb));return Ki(a,$,t,u,m)}),AE=Ne(function(a,u){var m=yn(u,Dl(AE));return Ki(a,j,t,u,m)}),QF=Qi(function(a,u){return Ki(a,O,t,t,t,u)});function ZF(a,u){if(typeof a!="function")throw new xr(i);return u=u===t?u:qe(u),Ne(a,u)}function XF(a,u){if(typeof a!="function")throw new xr(i);return u=u==null?0:Ct(qe(u),0),Ne(function(m){var b=m[u],x=Bs(m,0,u);return b&&bi(x,b),wr(a,this,x)})}function eD(a,u,m){var b=!0,x=!0;if(typeof a!="function")throw new xr(i);return Pt(m)&&(b="leading"in m?!!m.leading:b,x="trailing"in m?!!m.trailing:x),TE(a,u,{leading:b,maxWait:u,trailing:x})}function tD(a){return IE(a,1)}function rD(a,u){return Mb(Sb(u),a)}function nD(){if(!arguments.length)return[];var a=arguments[0];return Ee(a)?a:[a]}function iD(a){return cr(a,g)}function sD(a,u){return u=typeof u=="function"?u:t,cr(a,g,u)}function oD(a){return cr(a,p|g)}function aD(a,u){return u=typeof u=="function"?u:t,cr(a,p|g,u)}function lD(a,u){return u==null||bn(a,u,tr(u))}function Gn(a,u){return a===u||a!==a&&u!==u}var uD=fh($c),cD=fh(function(a,u){return a>=u}),ra=ih((function(){return arguments})())?ih:function(a){return Tt(a)&&ot.call(a,"callee")&&!Bo.call(a,"callee")},Ee=z.isArray,fD=vc?Rr(vc):fb;function Dr(a){return a!=null&&Sh(a.length)&&!Xi(a)}function Dt(a){return Tt(a)&&Dr(a)}function dD(a){return a===!0||a===!1||Tt(a)&&nr(a)==Xr}var Vs=Il||Gb,pD=Ip?Rr(Ip):db;function hD(a){return Tt(a)&&a.nodeType===1&&!jc(a)}function mD(a){if(a==null)return!0;if(Dr(a)&&(Ee(a)||typeof a=="string"||typeof a.splice=="function"||Vs(a)||Ll(a)||ra(a)))return!a.length;var u=fr(a);if(u==Zt||u==Sr)return!a.size;if(Dc(a))return!I(a).length;for(var m in a)if(ot.call(a,m))return!1;return!0}function gD(a,u){return Xo(a,u)}function yD(a,u,m){m=typeof m=="function"?m:t;var b=m?m(a,u):t;return b===t?Xo(a,u,t,m):!!b}function Fb(a){if(!Tt(a))return!1;var u=nr(a);return u==Rt||u==_t||typeof a.message=="string"&&typeof a.name=="string"&&!jc(a)}function vD(a){return typeof a=="number"&&Ji(a)}function Xi(a){if(!Pt(a))return!1;var u=nr(a);return u==pn||u==Eo||u==nt||u==lp}function $E(a){return typeof a=="number"&&a==qe(a)}function Sh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=ke}function Pt(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function Tt(a){return a!=null&&typeof a=="object"}var NE=qp?Rr(qp):Ls;function bD(a,u){return a===u||js(a,u,Ib(u))}function SD(a,u,m){return m=typeof m=="function"?m:t,js(a,u,Ib(u),m)}function wD(a){return ME(a)&&a!=+a}function _D(a){if(sM(a))throw new Re(n);return He(a)}function RD(a){return a===null}function CD(a){return a==null}function ME(a){return typeof a=="number"||Tt(a)&&nr(a)==Io}function jc(a){if(!Tt(a)||nr(a)!=Mn)return!1;var u=Rl(a);if(u===null)return!0;var m=ot.call(u,"constructor")&&u.constructor;return typeof m=="function"&&m instanceof m&&bl.call(m)==Ov}var Db=Fo?Rr(Fo):d;function xD(a){return $E(a)&&a>=-ke&&a<=ke}var FE=jn?Rr(jn):y;function wh(a){return typeof a=="string"||!Ee(a)&&Tt(a)&&nr(a)==qo}function sn(a){return typeof a=="symbol"||Tt(a)&&nr(a)==Za}var Ll=fl?Rr(fl):S;function ED(a){return a===t}function ID(a){return Tt(a)&&fr(a)==zt}function qD(a){return Tt(a)&&nr(a)==cp}var OD=fh(Y),kD=fh(function(a,u){return a<=u});function DE(a){if(!a)return[];if(Dr(a))return wh(a)?Cr(a):Fr(a);if(Vo&&a[Vo])return bv(a[Vo]());var u=fr(a),m=u==Zt?As:u==Sr?yl:jl;return m(a)}function es(a){if(!a)return a===0?a:0;if(a=Rn(a),a===pe||a===-pe){var u=a<0?-1:1;return u*de}return a===a?a:0}function qe(a){var u=es(a),m=u%1;return u===u?m?u-m:u:0}function LE(a){return a?Ci(qe(a),0,ve):0}function Rn(a){if(typeof a=="number")return a;if(sn(a))return le;if(Pt(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=Pt(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=Cc(a);var m=To.test(a);return m||Dy.test(a)?ov(a.slice(2),m?2:8):Fy.test(a)?le:+a}function jE(a){return Ei(a,Lr(a))}function PD(a){return a?Ci(qe(a),-ke,ke):a===0?a:0}function ct(a){return a==null?"":nn(a)}var TD=Ml(function(a,u){if(Dc(u)||Dr(u)){Ei(u,tr(u),a);return}for(var m in u)ot.call(u,m)&&Er(a,m,u[m])}),UE=Ml(function(a,u){Ei(u,Lr(u),a)}),HE=Ml(function(a,u,m,b){Ei(u,Lr(u),a,b)}),Lb=Ml(function(a,u,m,b){Ei(u,tr(u),a,b)}),AD=Qi(Pc);function $D(a,u){var m=Fs(a);return u==null?m:Xp(m,u)}var ND=Ne(function(a,u){a=ze(a);var m=-1,b=u.length,x=b>2?u[2]:t;for(x&&Ir(u[0],u[1],x)&&(b=1);++m<b;)for(var P=u[m],M=Lr(P),U=-1,W=M.length;++U<W;){var Z=M[U],X=a[Z];(X===t||Gn(X,$s[Z])&&!ot.call(a,Z))&&(a[Z]=P[Z])}return a}),MD=Ne(function(a){return a.push(t,iE),wr(BE,t,a)});function FD(a,u){return kp(a,Se(u,3),Sn)}function DD(a,u){return kp(a,Se(u,3),Vn)}function LD(a,u){return a==null?a:Ac(a,Se(u,3),Lr)}function jD(a,u){return a==null?a:rh(a,Se(u,3),Lr)}function UD(a,u){return a&&Sn(a,Se(u,3))}function HD(a,u){return a&&Vn(a,Se(u,3))}function BD(a){return a==null?[]:Nl(a,tr(a))}function VD(a){return a==null?[]:Nl(a,Lr(a))}function jb(a,u,m){var b=a==null?t:Yi(a,u);return b===t?m:b}function WD(a,u){return a!=null&&aE(a,u,lb)}function Ub(a,u){return a!=null&&aE(a,u,ub)}var zD=Xx(function(a,u,m){u!=null&&typeof u.toString!="function"&&(u=Sl.call(u)),a[u]=m},Bb(jr)),JD=Xx(function(a,u,m){u!=null&&typeof u.toString!="function"&&(u=Sl.call(u)),ot.call(a,u)?a[u].push(m):a[u]=[m]},Se),GD=Ne(Zo);function tr(a){return Dr(a)?Kp(a):I(a)}function Lr(a){return Dr(a)?Kp(a,!0):L(a)}function YD(a,u){var m={};return u=Se(u,3),Sn(a,function(b,x,P){tn(m,u(b,x,P),b)}),m}function KD(a,u){var m={};return u=Se(u,3),Sn(a,function(b,x,P){tn(m,x,u(b,x,P))}),m}var QD=Ml(function(a,u,m){Ht(a,u,m)}),BE=Ml(function(a,u,m,b){Ht(a,u,m,b)}),ZD=Qi(function(a,u){var m={};if(a==null)return m;var b=!1;u=yt(u,function(P){return P=Hs(P,a),b||(b=P.length>1),P}),Ei(a,xb(a),m),b&&(m=cr(m,p|h|g,JN));for(var x=u.length;x--;)yb(m,u[x]);return m});function XD(a,u){return VE(a,bh(Se(u)))}var eL=Qi(function(a,u){return a==null?{}:qN(a,u)});function VE(a,u){if(a==null)return{};var m=yt(xb(a),function(b){return[b]});return u=Se(u),$x(a,m,function(b,x){return u(b,x[0])})}function tL(a,u,m){u=Hs(u,a);var b=-1,x=u.length;for(x||(x=1,a=t);++b<x;){var P=a==null?t:a[Jn(u[b])];P===t&&(b=x,P=m),a=Xi(P)?P.call(a):P}return a}function rL(a,u,m){return a==null?a:Mc(a,u,m)}function nL(a,u,m,b){return b=typeof b=="function"?b:t,a==null?a:Mc(a,u,m,b)}var WE=rE(tr),zE=rE(Lr);function iL(a,u,m){var b=Ee(a),x=b||Vs(a)||Ll(a);if(u=Se(u,4),m==null){var P=a&&a.constructor;x?m=b?new P:[]:Pt(a)?m=Xi(P)?Fs(Rl(a)):{}:m={}}return(x?_r:Sn)(a,function(M,U,W){return u(m,M,U,W)}),m}function sL(a,u){return a==null?!0:yb(a,u)}function oL(a,u,m){return a==null?a:Lx(a,u,Sb(m))}function aL(a,u,m,b){return b=typeof b=="function"?b:t,a==null?a:Lx(a,u,Sb(m),b)}function jl(a){return a==null?[]:gl(a,tr(a))}function lL(a){return a==null?[]:gl(a,Lr(a))}function uL(a,u,m){return m===t&&(m=u,u=t),m!==t&&(m=Rn(m),m=m===m?m:0),u!==t&&(u=Rn(u),u=u===u?u:0),Ci(Rn(a),u,m)}function cL(a,u,m){return u=es(u),m===t?(m=u,u=0):m=es(m),a=Rn(a),cb(a,u,m)}function fL(a,u,m){if(m&&typeof m!="boolean"&&Ir(a,u,m)&&(u=m=t),m===t&&(typeof u=="boolean"?(m=u,u=t):typeof a=="boolean"&&(m=a,a=t)),a===t&&u===t?(a=0,u=1):(a=es(a),u===t?(u=a,a=0):u=es(u)),a>u){var b=a;a=u,u=b}if(m||a%1||u%1){var x=Bp();return Jt(a+x*(u-a+xp("1e-"+((x+"").length-1))),u)}return hb(a,u)}var dL=Fl(function(a,u,m){return u=u.toLowerCase(),a+(m?JE(u):u)});function JE(a){return Hb(ct(a).toLowerCase())}function GE(a){return a=ct(a),a&&a.replace(Ao,mv).replace(Xy,"")}function pL(a,u,m){a=ct(a),u=nn(u);var b=a.length;m=m===t?b:Ci(qe(m),0,b);var x=m;return m-=u.length,m>=0&&a.slice(m,x)==u}function hL(a){return a=ct(a),a&&fe.test(a)?a.replace(rl,gv):a}function mL(a){return a=ct(a),a&&Po.test(a)?a.replace(it,"\\$&"):a}var gL=Fl(function(a,u,m){return a+(m?"-":"")+u.toLowerCase()}),yL=Fl(function(a,u,m){return a+(m?" ":"")+u.toLowerCase()}),vL=Kx("toLowerCase");function bL(a,u,m){a=ct(a),u=qe(u);var b=u?Si(a):0;if(!u||b>=u)return a;var x=(u-b)/2;return ch(zo(x),m)+a+ch(Wo(x),m)}function SL(a,u,m){a=ct(a),u=qe(u);var b=u?Si(a):0;return u&&b<u?a+ch(u-b,m):a}function wL(a,u,m){a=ct(a),u=qe(u);var b=u?Si(a):0;return u&&b<u?ch(u-b,m)+a:a}function _L(a,u,m){return m||u==null?u=0:u&&(u=+u),Nv(ct(a).replace(ac,""),u||0)}function RL(a,u,m){return(m?Ir(a,u,m):u===t)?u=1:u=qe(u),mb(ct(a),u)}function CL(){var a=arguments,u=ct(a[0]);return a.length<3?u:u.replace(a[1],a[2])}var xL=Fl(function(a,u,m){return a+(m?"_":"")+u.toLowerCase()});function EL(a,u,m){return m&&typeof m!="number"&&Ir(a,u,m)&&(u=m=t),m=m===t?ve:m>>>0,m?(a=ct(a),a&&(typeof u=="string"||u!=null&&!Db(u))&&(u=nn(u),!u&&Ts(a))?Bs(Cr(a),0,m):a.split(u,m)):[]}var IL=Fl(function(a,u,m){return a+(m?" ":"")+Hb(u)});function qL(a,u,m){return a=ct(a),m=m==null?0:Ci(qe(m),0,a.length),u=nn(u),a.slice(m,m+u.length)==u}function OL(a,u,m){var b=q.templateSettings;m&&Ir(a,u,m)&&(u=t),a=ct(a),u=Lb({},u,b,nE);var x=Lb({},u.imports,b.imports,nE),P=tr(x),M=gl(x,P);_r(P,function(be){if(Nr.test(be))throw new Re(o)});var U,W,Z=0,X=u.interpolate||$o,te="__p += '",oe=vl((u.escape||$o).source+"|"+X.source+"|"+(X===hn?Hi:$o).source+"|"+(u.evaluate||$o).source+"|$","g"),he="//# sourceURL="+(ot.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++iv+"]")+`
4
- `;a.replace(oe,function(be,Be,Je,on,qr,an){return Je||(Je=on),te+=a.slice(Z,an).replace(Ly,yv),Be&&(U=!0,te+=`' +
3
+ `)}function rM(a){return Ee(a)||ra(a)||!!(jp&&a&&a[jp])}function Zi(a,u){var m=typeof a;return u=u??ke,!!u&&(m=="number"||m!="symbol"&&Is.test(a))&&a>-1&&a%1==0&&a<u}function Ir(a,u,m){if(!Pt(m))return!1;var b=typeof u;return(b=="number"?Dr(m)&&Zi(u,m.length):b=="string"&&u in m)?Gn(m[u],a):!1}function qb(a,u){if(Ee(a))return!1;var m=typeof a;return m=="number"||m=="symbol"||m=="boolean"||a==null||sn(a)?!0:Fe.test(a)||!$r.test(a)||u!=null&&a in ze(u)}function nM(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function kb(a){var u=dh(a),m=O[u];if(typeof m!="function"||!(u in De.prototype))return!1;if(a===m)return!0;var b=Eb(m);return!!b&&a===b[0]}function iM(a){return!!Fp&&Fp in a}var sM=Ho?Xi:Gb;function Dc(a){var u=a&&a.constructor,m=typeof u=="function"&&u.prototype||$s;return a===m}function uE(a){return a===a&&!Pt(a)}function cE(a,u){return function(m){return m==null?!1:m[a]===u&&(u!==t||a in ze(m))}}function oM(a){var u=vh(a,function(b){return m.size===f&&m.clear(),b}),m=u.cache;return u}function aM(a,u){var m=a[1],b=u[1],x=m|b,P=x<(w|E|G),M=b==G&&m==T||b==G&&m==q&&a[7].length<=u[8]||b==(G|q)&&u[7].length<=u[8]&&m==T;if(!(P||M))return a;b&w&&(a[2]=u[2],x|=m&w?0:k);var U=u[3];if(U){var W=a[3];a[3]=W?zx(W,U,u[4]):U,a[4]=W?yn(a[3],c):u[4]}return U=u[5],U&&(W=a[5],a[5]=W?Jx(W,U,u[6]):U,a[6]=W?yn(a[5],c):u[6]),U=u[7],U&&(a[7]=U),b&G&&(a[8]=a[8]==null?u[8]:Jt(a[8],u[8])),a[9]==null&&(a[9]=u[9]),a[0]=u[0],a[1]=x,a}function lM(a){var u=[];if(a!=null)for(var m in ze(a))u.push(m);return u}function uM(a){return Sl.call(a)}function fE(a,u,m){return u=Ct(u===t?a.length-1:u,0),function(){for(var b=arguments,x=-1,P=Ct(b.length-u,0),M=z(P);++x<P;)M[x]=b[u+x];x=-1;for(var U=z(u+1);++x<u;)U[x]=b[x];return U[u]=m(M),wr(a,this,U)}}function dE(a,u){return u.length<2?a:Yi(a,wn(u,0,-1))}function cM(a,u){for(var m=a.length,b=Jt(u.length,m),x=Fr(a);b--;){var P=u[b];a[b]=Zi(P,m)?x[P]:t}return a}function Pb(a,u){if(!(u==="constructor"&&typeof a[u]=="function")&&u!="__proto__")return a[u]}var pE=mE(Mx),Lc=$v||function(a,u){return Ut.setTimeout(a,u)},Tb=mE(AN);function hE(a,u,m){var b=u+"";return Tb(a,tM(b,fM(ZN(b),m)))}function mE(a){var u=0,m=0;return function(){var b=Hp(),x=F-(b-m);if(m=b,x>0){if(++u>=B)return arguments[0]}else u=0;return a.apply(t,arguments)}}function hh(a,u){var m=-1,b=a.length,x=b-1;for(u=u===t?b:u;++m<u;){var P=hb(m,x),M=a[P];a[P]=a[m],a[m]=M}return a.length=u,a}var gE=oM(function(a){var u=[];return a.charCodeAt(0)===46&&u.push(""),a.replace(oc,function(m,b,x,P){u.push(x?P.replace(Ln,"$1"):b||m)}),u});function Jn(a){if(typeof a=="string"||sn(a))return a;var u=a+"";return u=="0"&&1/a==-pe?"-0":u}function ta(a){if(a!=null){try{return bl.call(a)}catch{}try{return a+""}catch{}}return""}function fM(a,u){return _r(ce,function(m){var b="_."+m[0];u&m[1]&&!dl(a,b)&&a.push(b)}),a.sort()}function yE(a){if(a instanceof De)return a.clone();var u=new ur(a.__wrapped__,a.__chain__);return u.__actions__=Fr(a.__actions__),u.__index__=a.__index__,u.__values__=a.__values__,u}function dM(a,u,m){(m?Ir(a,u,m):u===t)?u=1:u=Ct(Oe(u),0);var b=a==null?0:a.length;if(!b||u<1)return[];for(var x=0,P=0,M=z(Wo(b/u));x<b;)M[P++]=wn(a,x,x+=u);return M}function pM(a){for(var u=-1,m=a==null?0:a.length,b=0,x=[];++u<m;){var P=a[u];P&&(x[b++]=P)}return x}function hM(){var a=arguments.length;if(!a)return[];for(var u=z(a-1),m=arguments[0],b=a;b--;)u[b-1]=arguments[b];return bi(Ee(m)?Fr(m):[m],Gt(u,1))}var mM=Ne(function(a,u){return Dt(a)?Qo(a,Gt(u,1,Dt,!0)):[]}),gM=Ne(function(a,u){var m=_n(u);return Dt(m)&&(m=t),Dt(a)?Qo(a,Gt(u,1,Dt,!0),Se(m,2)):[]}),yM=Ne(function(a,u){var m=_n(u);return Dt(m)&&(m=t),Dt(a)?Qo(a,Gt(u,1,Dt,!0),t,m):[]});function vM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:Oe(u),wn(a,u<0?0:u,b)):[]}function bM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:Oe(u),u=b-u,wn(a,0,u<0?0:u)):[]}function SM(a,u){return a&&a.length?oh(a,Se(u,3),!0,!0):[]}function wM(a,u){return a&&a.length?oh(a,Se(u,3),!0):[]}function _M(a,u,m,b){var x=a==null?0:a.length;return x?(m&&typeof m!="number"&&Ir(a,u,m)&&(m=0,b=x),ab(a,u,m,b)):[]}function vE(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=m==null?0:Oe(m);return x<0&&(x=Ct(b+x,0)),hl(a,Se(u,3),x)}function bE(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=b-1;return m!==t&&(x=Oe(m),x=m<0?Ct(b+x,0):Jt(x,b-1)),hl(a,Se(u,3),x,!0)}function SE(a){var u=a==null?0:a.length;return u?Gt(a,1):[]}function RM(a){var u=a==null?0:a.length;return u?Gt(a,pe):[]}function CM(a,u){var m=a==null?0:a.length;return m?(u=u===t?1:Oe(u),Gt(a,u)):[]}function xM(a){for(var u=-1,m=a==null?0:a.length,b={};++u<m;){var x=a[u];tn(b,x[0],x[1])}return b}function wE(a){return a&&a.length?a[0]:t}function EM(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=m==null?0:Oe(m);return x<0&&(x=Ct(b+x,0)),Vi(a,u,x)}function IM(a){var u=a==null?0:a.length;return u?wn(a,0,-1):[]}var OM=Ne(function(a){var u=yt(a,bb);return u.length&&u[0]===a[0]?rn(u):[]}),qM=Ne(function(a){var u=_n(a),m=yt(a,bb);return u===_n(m)?u=t:m.pop(),m.length&&m[0]===a[0]?rn(m,Se(u,2)):[]}),kM=Ne(function(a){var u=_n(a),m=yt(a,bb);return u=typeof u=="function"?u:t,u&&m.pop(),m.length&&m[0]===a[0]?rn(m,t,u):[]});function PM(a,u){return a==null?"":Ol.call(a,u)}function _n(a){var u=a==null?0:a.length;return u?a[u-1]:t}function TM(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=b;return m!==t&&(x=Oe(m),x=x<0?Ct(b+x,0):Jt(x,b-1)),u===u?xc(a,u,x):hl(a,Wi,x,!0)}function AM(a,u){return a&&a.length?zn(a,Oe(u)):t}var $M=Ne(_E);function _E(a,u){return a&&a.length&&u&&u.length?pb(a,u):a}function NM(a,u,m){return a&&a.length&&u&&u.length?pb(a,u,Se(m,2)):a}function MM(a,u,m){return a&&a.length&&u&&u.length?pb(a,u,t,m):a}var FM=Qi(function(a,u){var m=a==null?0:a.length,b=Pc(a,u);return Nx(a,yt(u,function(x){return Zi(x,m)?+x:x}).sort(Wx)),b});function DM(a,u){var m=[];if(!(a&&a.length))return m;var b=-1,x=[],P=a.length;for(u=Se(u,3);++b<P;){var M=a[b];u(M,b,a)&&(m.push(M),x.push(b))}return Nx(a,x),m}function Ab(a){return a==null?a:Mv.call(a)}function LM(a,u,m){var b=a==null?0:a.length;return b?(m&&typeof m!="number"&&Ir(a,u,m)?(u=0,m=b):(u=u==null?0:Oe(u),m=m===t?b:Oe(m)),wn(a,u,m)):[]}function jM(a,u){return sh(a,u)}function UM(a,u,m){return gb(a,u,Se(m,2))}function HM(a,u){var m=a==null?0:a.length;if(m){var b=sh(a,u);if(b<m&&Gn(a[b],u))return b}return-1}function BM(a,u){return sh(a,u,!0)}function VM(a,u,m){return gb(a,u,Se(m,2),!0)}function WM(a,u){var m=a==null?0:a.length;if(m){var b=sh(a,u,!0)-1;if(Gn(a[b],u))return b}return-1}function zM(a){return a&&a.length?Fx(a):[]}function JM(a,u){return a&&a.length?Fx(a,Se(u,2)):[]}function GM(a){var u=a==null?0:a.length;return u?wn(a,1,u):[]}function YM(a,u,m){return a&&a.length?(u=m||u===t?1:Oe(u),wn(a,0,u<0?0:u)):[]}function KM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:Oe(u),u=b-u,wn(a,u<0?0:u,b)):[]}function QM(a,u){return a&&a.length?oh(a,Se(u,3),!1,!0):[]}function ZM(a,u){return a&&a.length?oh(a,Se(u,3)):[]}var XM=Ne(function(a){return Us(Gt(a,1,Dt,!0))}),eF=Ne(function(a){var u=_n(a);return Dt(u)&&(u=t),Us(Gt(a,1,Dt,!0),Se(u,2))}),tF=Ne(function(a){var u=_n(a);return u=typeof u=="function"?u:t,Us(Gt(a,1,Dt,!0),t,u)});function rF(a){return a&&a.length?Us(a):[]}function nF(a,u){return a&&a.length?Us(a,Se(u,2)):[]}function iF(a,u){return u=typeof u=="function"?u:t,a&&a.length?Us(a,t,u):[]}function $b(a){if(!(a&&a.length))return[];var u=0;return a=vi(a,function(m){if(Dt(m))return u=Ct(m.length,u),!0}),Rc(u,function(m){return yt(a,Do(m))})}function RE(a,u){if(!(a&&a.length))return[];var m=$b(a);return u==null?m:yt(m,function(b){return wr(u,t,b)})}var sF=Ne(function(a,u){return Dt(a)?Qo(a,u):[]}),oF=Ne(function(a){return vb(vi(a,Dt))}),aF=Ne(function(a){var u=_n(a);return Dt(u)&&(u=t),vb(vi(a,Dt),Se(u,2))}),lF=Ne(function(a){var u=_n(a);return u=typeof u=="function"?u:t,vb(vi(a,Dt),t,u)}),uF=Ne($b);function cF(a,u){return Ux(a||[],u||[],Er)}function fF(a,u){return Ux(a||[],u||[],Mc)}var dF=Ne(function(a){var u=a.length,m=u>1?a[u-1]:t;return m=typeof m=="function"?(a.pop(),m):t,RE(a,m)});function CE(a){var u=O(a);return u.__chain__=!0,u}function pF(a,u){return u(a),a}function mh(a,u){return u(a)}var hF=Qi(function(a){var u=a.length,m=u?a[0]:0,b=this.__wrapped__,x=function(P){return Pc(P,a)};return u>1||this.__actions__.length||!(b instanceof De)||!Zi(m)?this.thru(x):(b=b.slice(m,+m+(u?1:0)),b.__actions__.push({func:mh,args:[x],thisArg:t}),new ur(b,this.__chain__).thru(function(P){return u&&!P.length&&P.push(t),P}))});function mF(){return CE(this)}function gF(){return new ur(this.value(),this.__chain__)}function yF(){this.__values__===t&&(this.__values__=DE(this.value()));var a=this.__index__>=this.__values__.length,u=a?t:this.__values__[this.__index__++];return{done:a,value:u}}function vF(){return this}function bF(a){for(var u,m=this;m instanceof Pl;){var b=yE(m);b.__index__=0,b.__values__=t,u?x.__wrapped__=b:u=b;var x=b;m=m.__wrapped__}return x.__wrapped__=a,u}function SF(){var a=this.__wrapped__;if(a instanceof De){var u=a;return this.__actions__.length&&(u=new De(this)),u=u.reverse(),u.__actions__.push({func:mh,args:[Ab],thisArg:t}),new ur(u,this.__chain__)}return this.thru(Ab)}function wF(){return jx(this.__wrapped__,this.__actions__)}var _F=ah(function(a,u,m){ot.call(a,m)?++a[m]:tn(a,m,1)});function RF(a,u,m){var b=Ee(a)?qp:ob;return m&&Ir(a,u,m)&&(u=t),b(a,Se(u,3))}function CF(a,u){var m=Ee(a)?vi:th;return m(a,Se(u,3))}var xF=Qx(vE),EF=Qx(bE);function IF(a,u){return Gt(gh(a,u),1)}function OF(a,u){return Gt(gh(a,u),pe)}function qF(a,u,m){return m=m===t?1:Oe(m),Gt(gh(a,u),m)}function xE(a,u){var m=Ee(a)?_r:xi;return m(a,Se(u,3))}function EE(a,u){var m=Ee(a)?bc:eh;return m(a,Se(u,3))}var kF=ah(function(a,u,m){ot.call(a,m)?a[m].push(u):tn(a,m,[u])});function PF(a,u,m,b){a=Dr(a)?a:jl(a),m=m&&!b?Oe(m):0;var x=a.length;return m<0&&(m=Ct(x+m,0)),wh(a)?m<=x&&a.indexOf(u,m)>-1:!!x&&Vi(a,u,m)>-1}var TF=Ne(function(a,u,m){var b=-1,x=typeof u=="function",P=Dr(a)?z(a.length):[];return xi(a,function(M){P[++b]=x?wr(u,M,m):Zo(M,u,m)}),P}),AF=ah(function(a,u,m){tn(a,m,u)});function gh(a,u){var m=Ee(a)?yt:ae;return m(a,Se(u,3))}function $F(a,u,m,b){return a==null?[]:(Ee(u)||(u=u==null?[]:[u]),m=b?t:m,Ee(m)||(m=m==null?[]:[m]),Ax(a,u,m))}var NF=ah(function(a,u,m){a[m?0:1].push(u)},function(){return[[],[]]});function MF(a,u,m){var b=Ee(a)?Sc:ml,x=arguments.length<3;return b(a,Se(u,4),m,x,xi)}function FF(a,u,m){var b=Ee(a)?lv:ml,x=arguments.length<3;return b(a,Se(u,4),m,x,eh)}function DF(a,u){var m=Ee(a)?vi:th;return m(a,bh(Se(u,3)))}function LF(a){var u=Ee(a)?Qp:PN;return u(a)}function jF(a,u,m){(m?Ir(a,u,m):u===t)?u=1:u=Oe(u);var b=Ee(a)?rb:TN;return b(a,u)}function UF(a){var u=Ee(a)?nb:$N;return u(a)}function HF(a){if(a==null)return 0;if(Dr(a))return wh(a)?Si(a):a.length;var u=fr(a);return u==Zt||u==Sr?a.size:I(a).length}function BF(a,u,m){var b=Ee(a)?pl:NN;return m&&Ir(a,u,m)&&(u=t),b(a,Se(u,3))}var VF=Ne(function(a,u){if(a==null)return[];var m=u.length;return m>1&&Ir(a,u[0],u[1])?u=[]:m>2&&Ir(u[0],u[1],u[2])&&(u=[u[0]]),Ax(a,Gt(u,1),[])}),yh=Av||function(){return Ut.Date.now()};function WF(a,u){if(typeof u!="function")throw new xr(i);return a=Oe(a),function(){if(--a<1)return u.apply(this,arguments)}}function IE(a,u,m){return u=m?t:u,u=a&&u==null?a.length:u,Ki(a,G,t,t,t,t,u)}function OE(a,u){var m;if(typeof u!="function")throw new xr(i);return a=Oe(a),function(){return--a>0&&(m=u.apply(this,arguments)),a<=1&&(u=t),m}}var Nb=Ne(function(a,u,m){var b=w;if(m.length){var x=yn(m,Dl(Nb));b|=$}return Ki(a,b,u,m,x)}),qE=Ne(function(a,u,m){var b=w|E;if(m.length){var x=yn(m,Dl(qE));b|=$}return Ki(u,b,a,m,x)});function kE(a,u,m){u=m?t:u;var b=Ki(a,T,t,t,t,t,t,u);return b.placeholder=kE.placeholder,b}function PE(a,u,m){u=m?t:u;var b=Ki(a,N,t,t,t,t,t,u);return b.placeholder=PE.placeholder,b}function TE(a,u,m){var b,x,P,M,U,W,Z=0,X=!1,te=!1,oe=!0;if(typeof a!="function")throw new xr(i);u=Rn(u)||0,Pt(m)&&(X=!!m.leading,te="maxWait"in m,P=te?Ct(Rn(m.maxWait)||0,u):P,oe="trailing"in m?!!m.trailing:oe);function he(Lt){var Yn=b,ts=x;return b=x=t,Z=Lt,M=a.apply(ts,Yn),M}function we(Lt){return Z=Lt,U=Lc(Be,u),X?he(Lt):M}function Pe(Lt){var Yn=Lt-W,ts=Lt-Z,ZE=u-Yn;return te?Jt(ZE,P-ts):ZE}function be(Lt){var Yn=Lt-W,ts=Lt-Z;return W===t||Yn>=u||Yn<0||te&&ts>=P}function Be(){var Lt=yh();if(be(Lt))return Je(Lt);U=Lc(Be,Pe(Lt))}function Je(Lt){return U=t,oe&&b?he(Lt):(b=x=t,M)}function on(){U!==t&&Hx(U),Z=0,b=W=x=U=t}function Or(){return U===t?M:Je(yh())}function an(){var Lt=yh(),Yn=be(Lt);if(b=arguments,x=this,W=Lt,Yn){if(U===t)return we(W);if(te)return Hx(U),U=Lc(Be,u),he(W)}return U===t&&(U=Lc(Be,u)),M}return an.cancel=on,an.flush=Or,an}var zF=Ne(function(a,u){return Tc(a,1,u)}),JF=Ne(function(a,u,m){return Tc(a,Rn(u)||0,m)});function GF(a){return Ki(a,C)}function vh(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new xr(i);var m=function(){var b=arguments,x=u?u.apply(this,b):b[0],P=m.cache;if(P.has(x))return P.get(x);var M=a.apply(this,b);return m.cache=P.set(x,M)||P,M};return m.cache=new(vh.Cache||Bn),m}vh.Cache=Bn;function bh(a){if(typeof a!="function")throw new xr(i);return function(){var u=arguments;switch(u.length){case 0:return!a.call(this);case 1:return!a.call(this,u[0]);case 2:return!a.call(this,u[0],u[1]);case 3:return!a.call(this,u[0],u[1],u[2])}return!a.apply(this,u)}}function YF(a){return OE(2,a)}var KF=MN(function(a,u){u=u.length==1&&Ee(u[0])?yt(u[0],Rr(Se())):yt(Gt(u,1),Rr(Se()));var m=u.length;return Ne(function(b){for(var x=-1,P=Jt(b.length,m);++x<P;)b[x]=u[x].call(this,b[x]);return wr(a,this,b)})}),Mb=Ne(function(a,u){var m=yn(u,Dl(Mb));return Ki(a,$,t,u,m)}),AE=Ne(function(a,u){var m=yn(u,Dl(AE));return Ki(a,j,t,u,m)}),QF=Qi(function(a,u){return Ki(a,q,t,t,t,u)});function ZF(a,u){if(typeof a!="function")throw new xr(i);return u=u===t?u:Oe(u),Ne(a,u)}function XF(a,u){if(typeof a!="function")throw new xr(i);return u=u==null?0:Ct(Oe(u),0),Ne(function(m){var b=m[u],x=Bs(m,0,u);return b&&bi(x,b),wr(a,this,x)})}function eD(a,u,m){var b=!0,x=!0;if(typeof a!="function")throw new xr(i);return Pt(m)&&(b="leading"in m?!!m.leading:b,x="trailing"in m?!!m.trailing:x),TE(a,u,{leading:b,maxWait:u,trailing:x})}function tD(a){return IE(a,1)}function rD(a,u){return Mb(Sb(u),a)}function nD(){if(!arguments.length)return[];var a=arguments[0];return Ee(a)?a:[a]}function iD(a){return cr(a,g)}function sD(a,u){return u=typeof u=="function"?u:t,cr(a,g,u)}function oD(a){return cr(a,p|g)}function aD(a,u){return u=typeof u=="function"?u:t,cr(a,p|g,u)}function lD(a,u){return u==null||bn(a,u,tr(u))}function Gn(a,u){return a===u||a!==a&&u!==u}var uD=fh($c),cD=fh(function(a,u){return a>=u}),ra=ih((function(){return arguments})())?ih:function(a){return Tt(a)&&ot.call(a,"callee")&&!Bo.call(a,"callee")},Ee=z.isArray,fD=vc?Rr(vc):fb;function Dr(a){return a!=null&&Sh(a.length)&&!Xi(a)}function Dt(a){return Tt(a)&&Dr(a)}function dD(a){return a===!0||a===!1||Tt(a)&&nr(a)==Xr}var Vs=Il||Gb,pD=Ip?Rr(Ip):db;function hD(a){return Tt(a)&&a.nodeType===1&&!jc(a)}function mD(a){if(a==null)return!0;if(Dr(a)&&(Ee(a)||typeof a=="string"||typeof a.splice=="function"||Vs(a)||Ll(a)||ra(a)))return!a.length;var u=fr(a);if(u==Zt||u==Sr)return!a.size;if(Dc(a))return!I(a).length;for(var m in a)if(ot.call(a,m))return!1;return!0}function gD(a,u){return Xo(a,u)}function yD(a,u,m){m=typeof m=="function"?m:t;var b=m?m(a,u):t;return b===t?Xo(a,u,t,m):!!b}function Fb(a){if(!Tt(a))return!1;var u=nr(a);return u==Rt||u==_t||typeof a.message=="string"&&typeof a.name=="string"&&!jc(a)}function vD(a){return typeof a=="number"&&Ji(a)}function Xi(a){if(!Pt(a))return!1;var u=nr(a);return u==pn||u==Eo||u==nt||u==lp}function $E(a){return typeof a=="number"&&a==Oe(a)}function Sh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=ke}function Pt(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function Tt(a){return a!=null&&typeof a=="object"}var NE=Op?Rr(Op):Ls;function bD(a,u){return a===u||js(a,u,Ib(u))}function SD(a,u,m){return m=typeof m=="function"?m:t,js(a,u,Ib(u),m)}function wD(a){return ME(a)&&a!=+a}function _D(a){if(sM(a))throw new Re(n);return He(a)}function RD(a){return a===null}function CD(a){return a==null}function ME(a){return typeof a=="number"||Tt(a)&&nr(a)==Io}function jc(a){if(!Tt(a)||nr(a)!=Mn)return!1;var u=Rl(a);if(u===null)return!0;var m=ot.call(u,"constructor")&&u.constructor;return typeof m=="function"&&m instanceof m&&bl.call(m)==qv}var Db=Fo?Rr(Fo):d;function xD(a){return $E(a)&&a>=-ke&&a<=ke}var FE=jn?Rr(jn):y;function wh(a){return typeof a=="string"||!Ee(a)&&Tt(a)&&nr(a)==Oo}function sn(a){return typeof a=="symbol"||Tt(a)&&nr(a)==Za}var Ll=fl?Rr(fl):S;function ED(a){return a===t}function ID(a){return Tt(a)&&fr(a)==zt}function OD(a){return Tt(a)&&nr(a)==cp}var qD=fh(Y),kD=fh(function(a,u){return a<=u});function DE(a){if(!a)return[];if(Dr(a))return wh(a)?Cr(a):Fr(a);if(Vo&&a[Vo])return bv(a[Vo]());var u=fr(a),m=u==Zt?As:u==Sr?yl:jl;return m(a)}function es(a){if(!a)return a===0?a:0;if(a=Rn(a),a===pe||a===-pe){var u=a<0?-1:1;return u*de}return a===a?a:0}function Oe(a){var u=es(a),m=u%1;return u===u?m?u-m:u:0}function LE(a){return a?Ci(Oe(a),0,ve):0}function Rn(a){if(typeof a=="number")return a;if(sn(a))return le;if(Pt(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=Pt(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=Cc(a);var m=To.test(a);return m||Dy.test(a)?ov(a.slice(2),m?2:8):Fy.test(a)?le:+a}function jE(a){return Ei(a,Lr(a))}function PD(a){return a?Ci(Oe(a),-ke,ke):a===0?a:0}function ct(a){return a==null?"":nn(a)}var TD=Ml(function(a,u){if(Dc(u)||Dr(u)){Ei(u,tr(u),a);return}for(var m in u)ot.call(u,m)&&Er(a,m,u[m])}),UE=Ml(function(a,u){Ei(u,Lr(u),a)}),HE=Ml(function(a,u,m,b){Ei(u,Lr(u),a,b)}),Lb=Ml(function(a,u,m,b){Ei(u,tr(u),a,b)}),AD=Qi(Pc);function $D(a,u){var m=Fs(a);return u==null?m:Xp(m,u)}var ND=Ne(function(a,u){a=ze(a);var m=-1,b=u.length,x=b>2?u[2]:t;for(x&&Ir(u[0],u[1],x)&&(b=1);++m<b;)for(var P=u[m],M=Lr(P),U=-1,W=M.length;++U<W;){var Z=M[U],X=a[Z];(X===t||Gn(X,$s[Z])&&!ot.call(a,Z))&&(a[Z]=P[Z])}return a}),MD=Ne(function(a){return a.push(t,iE),wr(BE,t,a)});function FD(a,u){return kp(a,Se(u,3),Sn)}function DD(a,u){return kp(a,Se(u,3),Vn)}function LD(a,u){return a==null?a:Ac(a,Se(u,3),Lr)}function jD(a,u){return a==null?a:rh(a,Se(u,3),Lr)}function UD(a,u){return a&&Sn(a,Se(u,3))}function HD(a,u){return a&&Vn(a,Se(u,3))}function BD(a){return a==null?[]:Nl(a,tr(a))}function VD(a){return a==null?[]:Nl(a,Lr(a))}function jb(a,u,m){var b=a==null?t:Yi(a,u);return b===t?m:b}function WD(a,u){return a!=null&&aE(a,u,lb)}function Ub(a,u){return a!=null&&aE(a,u,ub)}var zD=Xx(function(a,u,m){u!=null&&typeof u.toString!="function"&&(u=Sl.call(u)),a[u]=m},Bb(jr)),JD=Xx(function(a,u,m){u!=null&&typeof u.toString!="function"&&(u=Sl.call(u)),ot.call(a,u)?a[u].push(m):a[u]=[m]},Se),GD=Ne(Zo);function tr(a){return Dr(a)?Kp(a):I(a)}function Lr(a){return Dr(a)?Kp(a,!0):L(a)}function YD(a,u){var m={};return u=Se(u,3),Sn(a,function(b,x,P){tn(m,u(b,x,P),b)}),m}function KD(a,u){var m={};return u=Se(u,3),Sn(a,function(b,x,P){tn(m,x,u(b,x,P))}),m}var QD=Ml(function(a,u,m){Ht(a,u,m)}),BE=Ml(function(a,u,m,b){Ht(a,u,m,b)}),ZD=Qi(function(a,u){var m={};if(a==null)return m;var b=!1;u=yt(u,function(P){return P=Hs(P,a),b||(b=P.length>1),P}),Ei(a,xb(a),m),b&&(m=cr(m,p|h|g,JN));for(var x=u.length;x--;)yb(m,u[x]);return m});function XD(a,u){return VE(a,bh(Se(u)))}var eL=Qi(function(a,u){return a==null?{}:ON(a,u)});function VE(a,u){if(a==null)return{};var m=yt(xb(a),function(b){return[b]});return u=Se(u),$x(a,m,function(b,x){return u(b,x[0])})}function tL(a,u,m){u=Hs(u,a);var b=-1,x=u.length;for(x||(x=1,a=t);++b<x;){var P=a==null?t:a[Jn(u[b])];P===t&&(b=x,P=m),a=Xi(P)?P.call(a):P}return a}function rL(a,u,m){return a==null?a:Mc(a,u,m)}function nL(a,u,m,b){return b=typeof b=="function"?b:t,a==null?a:Mc(a,u,m,b)}var WE=rE(tr),zE=rE(Lr);function iL(a,u,m){var b=Ee(a),x=b||Vs(a)||Ll(a);if(u=Se(u,4),m==null){var P=a&&a.constructor;x?m=b?new P:[]:Pt(a)?m=Xi(P)?Fs(Rl(a)):{}:m={}}return(x?_r:Sn)(a,function(M,U,W){return u(m,M,U,W)}),m}function sL(a,u){return a==null?!0:yb(a,u)}function oL(a,u,m){return a==null?a:Lx(a,u,Sb(m))}function aL(a,u,m,b){return b=typeof b=="function"?b:t,a==null?a:Lx(a,u,Sb(m),b)}function jl(a){return a==null?[]:gl(a,tr(a))}function lL(a){return a==null?[]:gl(a,Lr(a))}function uL(a,u,m){return m===t&&(m=u,u=t),m!==t&&(m=Rn(m),m=m===m?m:0),u!==t&&(u=Rn(u),u=u===u?u:0),Ci(Rn(a),u,m)}function cL(a,u,m){return u=es(u),m===t?(m=u,u=0):m=es(m),a=Rn(a),cb(a,u,m)}function fL(a,u,m){if(m&&typeof m!="boolean"&&Ir(a,u,m)&&(u=m=t),m===t&&(typeof u=="boolean"?(m=u,u=t):typeof a=="boolean"&&(m=a,a=t)),a===t&&u===t?(a=0,u=1):(a=es(a),u===t?(u=a,a=0):u=es(u)),a>u){var b=a;a=u,u=b}if(m||a%1||u%1){var x=Bp();return Jt(a+x*(u-a+xp("1e-"+((x+"").length-1))),u)}return hb(a,u)}var dL=Fl(function(a,u,m){return u=u.toLowerCase(),a+(m?JE(u):u)});function JE(a){return Hb(ct(a).toLowerCase())}function GE(a){return a=ct(a),a&&a.replace(Ao,mv).replace(Xy,"")}function pL(a,u,m){a=ct(a),u=nn(u);var b=a.length;m=m===t?b:Ci(Oe(m),0,b);var x=m;return m-=u.length,m>=0&&a.slice(m,x)==u}function hL(a){return a=ct(a),a&&fe.test(a)?a.replace(rl,gv):a}function mL(a){return a=ct(a),a&&Po.test(a)?a.replace(it,"\\$&"):a}var gL=Fl(function(a,u,m){return a+(m?"-":"")+u.toLowerCase()}),yL=Fl(function(a,u,m){return a+(m?" ":"")+u.toLowerCase()}),vL=Kx("toLowerCase");function bL(a,u,m){a=ct(a),u=Oe(u);var b=u?Si(a):0;if(!u||b>=u)return a;var x=(u-b)/2;return ch(zo(x),m)+a+ch(Wo(x),m)}function SL(a,u,m){a=ct(a),u=Oe(u);var b=u?Si(a):0;return u&&b<u?a+ch(u-b,m):a}function wL(a,u,m){a=ct(a),u=Oe(u);var b=u?Si(a):0;return u&&b<u?ch(u-b,m)+a:a}function _L(a,u,m){return m||u==null?u=0:u&&(u=+u),Nv(ct(a).replace(ac,""),u||0)}function RL(a,u,m){return(m?Ir(a,u,m):u===t)?u=1:u=Oe(u),mb(ct(a),u)}function CL(){var a=arguments,u=ct(a[0]);return a.length<3?u:u.replace(a[1],a[2])}var xL=Fl(function(a,u,m){return a+(m?"_":"")+u.toLowerCase()});function EL(a,u,m){return m&&typeof m!="number"&&Ir(a,u,m)&&(u=m=t),m=m===t?ve:m>>>0,m?(a=ct(a),a&&(typeof u=="string"||u!=null&&!Db(u))&&(u=nn(u),!u&&Ts(a))?Bs(Cr(a),0,m):a.split(u,m)):[]}var IL=Fl(function(a,u,m){return a+(m?" ":"")+Hb(u)});function OL(a,u,m){return a=ct(a),m=m==null?0:Ci(Oe(m),0,a.length),u=nn(u),a.slice(m,m+u.length)==u}function qL(a,u,m){var b=O.templateSettings;m&&Ir(a,u,m)&&(u=t),a=ct(a),u=Lb({},u,b,nE);var x=Lb({},u.imports,b.imports,nE),P=tr(x),M=gl(x,P);_r(P,function(be){if(Nr.test(be))throw new Re(o)});var U,W,Z=0,X=u.interpolate||$o,te="__p += '",oe=vl((u.escape||$o).source+"|"+X.source+"|"+(X===hn?Hi:$o).source+"|"+(u.evaluate||$o).source+"|$","g"),he="//# sourceURL="+(ot.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++iv+"]")+`
4
+ `;a.replace(oe,function(be,Be,Je,on,Or,an){return Je||(Je=on),te+=a.slice(Z,an).replace(Ly,yv),Be&&(U=!0,te+=`' +
5
5
  __e(`+Be+`) +
6
- '`),qr&&(W=!0,te+=`';
7
- `+qr+`;
6
+ '`),Or&&(W=!0,te+=`';
7
+ `+Or+`;
8
8
  __p += '`),Je&&(te+=`' +
9
9
  ((__t = (`+Je+`)) == null ? '' : __t) +
10
10
  '`),Z=an+be.length,be}),te+=`';
@@ -17,17 +17,17 @@ __p += '`),Je&&(te+=`' +
17
17
  function print() { __p += __j.call(arguments, '') }
18
18
  `:`;
19
19
  `)+te+`return __p
20
- }`;var Pe=KE(function(){return tt(P,he+"return "+te).apply(t,M)});if(Pe.source=te,Fb(Pe))throw Pe;return Pe}function kL(a){return ct(a).toLowerCase()}function PL(a){return ct(a).toUpperCase()}function TL(a,u,m){if(a=ct(a),a&&(m||u===t))return Cc(a);if(!a||!(u=nn(u)))return a;var b=Cr(a),x=Cr(u),P=Tp(b,x),M=Ap(b,x)+1;return Bs(b,P,M).join("")}function AL(a,u,m){if(a=ct(a),a&&(m||u===t))return a.slice(0,Mp(a)+1);if(!a||!(u=nn(u)))return a;var b=Cr(a),x=Ap(b,Cr(u))+1;return Bs(b,0,x).join("")}function $L(a,u,m){if(a=ct(a),a&&(m||u===t))return a.replace(ac,"");if(!a||!(u=nn(u)))return a;var b=Cr(a),x=Tp(b,Cr(u));return Bs(b,x).join("")}function NL(a,u){var m=A,b=D;if(Pt(u)){var x="separator"in u?u.separator:x;m="length"in u?qe(u.length):m,b="omission"in u?nn(u.omission):b}a=ct(a);var P=a.length;if(Ts(a)){var M=Cr(a);P=M.length}if(m>=P)return a;var U=m-Si(b);if(U<1)return b;var W=M?Bs(M,0,U).join(""):a.slice(0,U);if(x===t)return W+b;if(M&&(U+=W.length-U),Db(x)){if(a.slice(U).search(x)){var Z,X=W;for(x.global||(x=vl(x.source,ct(fp.exec(x))+"g")),x.lastIndex=0;Z=x.exec(X);)var te=Z.index;W=W.slice(0,te===t?U:te)}}else if(a.indexOf(nn(x),U)!=U){var oe=W.lastIndexOf(x);oe>-1&&(W=W.slice(0,oe))}return W+b}function ML(a){return a=ct(a),a&&nl.test(a)?a.replace(Ui,wv):a}var FL=Fl(function(a,u,m){return a+(m?" ":"")+u.toUpperCase()}),Hb=Kx("toUpperCase");function YE(a,u,m){return a=ct(a),u=m?t:u,u===t?vv(a)?Cv(a):fv(a):a.match(u)||[]}var KE=Ne(function(a,u){try{return wr(a,t,u)}catch(m){return Fb(m)?m:new Re(m)}}),DL=Qi(function(a,u){return _r(u,function(m){m=Jn(m),tn(a,m,Nb(a[m],a))}),a});function LL(a){var u=a==null?0:a.length,m=Se();return a=u?yt(a,function(b){if(typeof b[1]!="function")throw new xr(i);return[m(b[0]),b[1]]}):[],Ne(function(b){for(var x=-1;++x<u;){var P=a[x];if(wr(P[0],this,b))return wr(P[1],this,b)}})}function jL(a){return sb(cr(a,p))}function Bb(a){return function(){return a}}function UL(a,u){return a==null||a!==a?u:a}var HL=Zx(),BL=Zx(!0);function jr(a){return a}function Vb(a){return R(typeof a=="function"?a:cr(a,p))}function VL(a){return _e(cr(a,p))}function WL(a,u){return Le(a,cr(u,p))}var zL=Ne(function(a,u){return function(m){return Zo(m,a,u)}}),JL=Ne(function(a,u){return function(m){return Zo(a,m,u)}});function Wb(a,u,m){var b=tr(u),x=Nl(u,b);m==null&&!(Pt(u)&&(x.length||!b.length))&&(m=u,u=a,a=this,x=Nl(u,tr(u)));var P=!(Pt(m)&&"chain"in m)||!!m.chain,M=Xi(a);return _r(x,function(U){var W=u[U];a[U]=W,M&&(a.prototype[U]=function(){var Z=this.__chain__;if(P||Z){var X=a(this.__wrapped__),te=X.__actions__=Fr(this.__actions__);return te.push({func:W,args:arguments,thisArg:a}),X.__chain__=Z,X}return W.apply(a,bi([this.value()],arguments))})}),a}function GL(){return Ut._===this&&(Ut._=kv),this}function zb(){}function YL(a){return a=qe(a),Ne(function(u){return zn(u,a)})}var KL=_b(yt),QL=_b(Op),ZL=_b(pl);function QE(a){return Ob(a)?Do(Jn(a)):ON(a)}function XL(a){return function(u){return a==null?t:Yi(a,u)}}var ej=eE(),tj=eE(!0);function Jb(){return[]}function Gb(){return!1}function rj(){return{}}function nj(){return""}function ij(){return!0}function sj(a,u){if(a=qe(a),a<1||a>ke)return[];var m=ve,b=Jt(a,ve);u=Se(u),a-=ve;for(var x=Rc(b,u);++m<a;)u(m);return x}function oj(a){return Ee(a)?yt(a,Jn):sn(a)?[a]:Fr(gE(ct(a)))}function aj(a){var u=++qv;return ct(a)+u}var lj=uh(function(a,u){return a+u},0),uj=Rb("ceil"),cj=uh(function(a,u){return a/u},1),fj=Rb("floor");function dj(a){return a&&a.length?$l(a,jr,$c):t}function pj(a,u){return a&&a.length?$l(a,Se(u,2),$c):t}function hj(a){return Pp(a,jr)}function mj(a,u){return Pp(a,Se(u,2))}function gj(a){return a&&a.length?$l(a,jr,Y):t}function yj(a,u){return a&&a.length?$l(a,Se(u,2),Y):t}var vj=uh(function(a,u){return a*u},1),bj=Rb("round"),Sj=uh(function(a,u){return a-u},0);function wj(a){return a&&a.length?_c(a,jr):0}function _j(a,u){return a&&a.length?_c(a,Se(u,2)):0}return q.after=WF,q.ary=IE,q.assign=TD,q.assignIn=UE,q.assignInWith=HE,q.assignWith=Lb,q.at=AD,q.before=qE,q.bind=Nb,q.bindAll=DL,q.bindKey=OE,q.castArray=nD,q.chain=CE,q.chunk=dM,q.compact=pM,q.concat=hM,q.cond=LL,q.conforms=jL,q.constant=Bb,q.countBy=_F,q.create=$D,q.curry=kE,q.curryRight=PE,q.debounce=TE,q.defaults=ND,q.defaultsDeep=MD,q.defer=zF,q.delay=JF,q.difference=mM,q.differenceBy=gM,q.differenceWith=yM,q.drop=vM,q.dropRight=bM,q.dropRightWhile=SM,q.dropWhile=wM,q.fill=_M,q.filter=CF,q.flatMap=IF,q.flatMapDeep=qF,q.flatMapDepth=OF,q.flatten=SE,q.flattenDeep=RM,q.flattenDepth=CM,q.flip=GF,q.flow=HL,q.flowRight=BL,q.fromPairs=xM,q.functions=BD,q.functionsIn=VD,q.groupBy=kF,q.initial=IM,q.intersection=qM,q.intersectionBy=OM,q.intersectionWith=kM,q.invert=zD,q.invertBy=JD,q.invokeMap=TF,q.iteratee=Vb,q.keyBy=AF,q.keys=tr,q.keysIn=Lr,q.map=gh,q.mapKeys=YD,q.mapValues=KD,q.matches=VL,q.matchesProperty=WL,q.memoize=vh,q.merge=QD,q.mergeWith=BE,q.method=zL,q.methodOf=JL,q.mixin=Wb,q.negate=bh,q.nthArg=YL,q.omit=ZD,q.omitBy=XD,q.once=YF,q.orderBy=$F,q.over=KL,q.overArgs=KF,q.overEvery=QL,q.overSome=ZL,q.partial=Mb,q.partialRight=AE,q.partition=NF,q.pick=eL,q.pickBy=VE,q.property=QE,q.propertyOf=XL,q.pull=$M,q.pullAll=_E,q.pullAllBy=NM,q.pullAllWith=MM,q.pullAt=FM,q.range=ej,q.rangeRight=tj,q.rearg=QF,q.reject=DF,q.remove=DM,q.rest=ZF,q.reverse=Ab,q.sampleSize=jF,q.set=rL,q.setWith=nL,q.shuffle=UF,q.slice=LM,q.sortBy=VF,q.sortedUniq=zM,q.sortedUniqBy=JM,q.split=EL,q.spread=XF,q.tail=GM,q.take=YM,q.takeRight=KM,q.takeRightWhile=QM,q.takeWhile=ZM,q.tap=pF,q.throttle=eD,q.thru=mh,q.toArray=DE,q.toPairs=WE,q.toPairsIn=zE,q.toPath=oj,q.toPlainObject=jE,q.transform=iL,q.unary=tD,q.union=XM,q.unionBy=eF,q.unionWith=tF,q.uniq=rF,q.uniqBy=nF,q.uniqWith=iF,q.unset=sL,q.unzip=$b,q.unzipWith=RE,q.update=oL,q.updateWith=aL,q.values=jl,q.valuesIn=lL,q.without=sF,q.words=YE,q.wrap=rD,q.xor=oF,q.xorBy=aF,q.xorWith=lF,q.zip=uF,q.zipObject=cF,q.zipObjectDeep=fF,q.zipWith=dF,q.entries=WE,q.entriesIn=zE,q.extend=UE,q.extendWith=HE,Wb(q,q),q.add=lj,q.attempt=KE,q.camelCase=dL,q.capitalize=JE,q.ceil=uj,q.clamp=uL,q.clone=iD,q.cloneDeep=oD,q.cloneDeepWith=aD,q.cloneWith=sD,q.conformsTo=lD,q.deburr=GE,q.defaultTo=UL,q.divide=cj,q.endsWith=pL,q.eq=Gn,q.escape=hL,q.escapeRegExp=mL,q.every=RF,q.find=xF,q.findIndex=vE,q.findKey=FD,q.findLast=EF,q.findLastIndex=bE,q.findLastKey=DD,q.floor=fj,q.forEach=xE,q.forEachRight=EE,q.forIn=LD,q.forInRight=jD,q.forOwn=UD,q.forOwnRight=HD,q.get=jb,q.gt=uD,q.gte=cD,q.has=WD,q.hasIn=Ub,q.head=wE,q.identity=jr,q.includes=PF,q.indexOf=EM,q.inRange=cL,q.invoke=GD,q.isArguments=ra,q.isArray=Ee,q.isArrayBuffer=fD,q.isArrayLike=Dr,q.isArrayLikeObject=Dt,q.isBoolean=dD,q.isBuffer=Vs,q.isDate=pD,q.isElement=hD,q.isEmpty=mD,q.isEqual=gD,q.isEqualWith=yD,q.isError=Fb,q.isFinite=vD,q.isFunction=Xi,q.isInteger=$E,q.isLength=Sh,q.isMap=NE,q.isMatch=bD,q.isMatchWith=SD,q.isNaN=wD,q.isNative=_D,q.isNil=CD,q.isNull=RD,q.isNumber=ME,q.isObject=Pt,q.isObjectLike=Tt,q.isPlainObject=jc,q.isRegExp=Db,q.isSafeInteger=xD,q.isSet=FE,q.isString=wh,q.isSymbol=sn,q.isTypedArray=Ll,q.isUndefined=ED,q.isWeakMap=ID,q.isWeakSet=qD,q.join=PM,q.kebabCase=gL,q.last=_n,q.lastIndexOf=TM,q.lowerCase=yL,q.lowerFirst=vL,q.lt=OD,q.lte=kD,q.max=dj,q.maxBy=pj,q.mean=hj,q.meanBy=mj,q.min=gj,q.minBy=yj,q.stubArray=Jb,q.stubFalse=Gb,q.stubObject=rj,q.stubString=nj,q.stubTrue=ij,q.multiply=vj,q.nth=AM,q.noConflict=GL,q.noop=zb,q.now=yh,q.pad=bL,q.padEnd=SL,q.padStart=wL,q.parseInt=_L,q.random=fL,q.reduce=MF,q.reduceRight=FF,q.repeat=RL,q.replace=CL,q.result=tL,q.round=bj,q.runInContext=V,q.sample=LF,q.size=HF,q.snakeCase=xL,q.some=BF,q.sortedIndex=jM,q.sortedIndexBy=UM,q.sortedIndexOf=HM,q.sortedLastIndex=BM,q.sortedLastIndexBy=VM,q.sortedLastIndexOf=WM,q.startCase=IL,q.startsWith=qL,q.subtract=Sj,q.sum=wj,q.sumBy=_j,q.template=OL,q.times=sj,q.toFinite=es,q.toInteger=qe,q.toLength=LE,q.toLower=kL,q.toNumber=Rn,q.toSafeInteger=PD,q.toString=ct,q.toUpper=PL,q.trim=TL,q.trimEnd=AL,q.trimStart=$L,q.truncate=NL,q.unescape=ML,q.uniqueId=aj,q.upperCase=FL,q.upperFirst=Hb,q.each=xE,q.eachRight=EE,q.first=wE,Wb(q,(function(){var a={};return Sn(q,function(u,m){ot.call(q.prototype,m)||(a[m]=u)}),a})(),{chain:!1}),q.VERSION=e,_r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){q[a].placeholder=q}),_r(["drop","take"],function(a,u){De.prototype[a]=function(m){m=m===t?1:Ct(qe(m),0);var b=this.__filtered__&&!u?new De(this):this.clone();return b.__filtered__?b.__takeCount__=Jt(m,b.__takeCount__):b.__views__.push({size:Jt(m,ve),type:a+(b.__dir__<0?"Right":"")}),b},De.prototype[a+"Right"]=function(m){return this.reverse()[a](m).reverse()}}),_r(["filter","map","takeWhile"],function(a,u){var m=u+1,b=m==K||m==ie;De.prototype[a]=function(x){var P=this.clone();return P.__iteratees__.push({iteratee:Se(x,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),_r(["head","last"],function(a,u){var m="take"+(u?"Right":"");De.prototype[a]=function(){return this[m](1).value()[0]}}),_r(["initial","tail"],function(a,u){var m="drop"+(u?"":"Right");De.prototype[a]=function(){return this.__filtered__?new De(this):this[m](1)}}),De.prototype.compact=function(){return this.filter(jr)},De.prototype.find=function(a){return this.filter(a).head()},De.prototype.findLast=function(a){return this.reverse().find(a)},De.prototype.invokeMap=Ne(function(a,u){return typeof a=="function"?new De(this):this.map(function(m){return Zo(m,a,u)})}),De.prototype.reject=function(a){return this.filter(bh(Se(a)))},De.prototype.slice=function(a,u){a=qe(a);var m=this;return m.__filtered__&&(a>0||u<0)?new De(m):(a<0?m=m.takeRight(-a):a&&(m=m.drop(a)),u!==t&&(u=qe(u),m=u<0?m.dropRight(-u):m.take(u-a)),m)},De.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},De.prototype.toArray=function(){return this.take(ve)},Sn(De.prototype,function(a,u){var m=/^(?:filter|find|map|reject)|While$/.test(u),b=/^(?:head|last)$/.test(u),x=q[b?"take"+(u=="last"?"Right":""):u],P=b||/^find/.test(u);x&&(q.prototype[u]=function(){var M=this.__wrapped__,U=b?[1]:arguments,W=M instanceof De,Z=U[0],X=W||Ee(M),te=function(Be){var Je=x.apply(q,bi([Be],U));return b&&oe?Je[0]:Je};X&&m&&typeof Z=="function"&&Z.length!=1&&(W=X=!1);var oe=this.__chain__,he=!!this.__actions__.length,we=P&&!oe,Pe=W&&!he;if(!P&&X){M=Pe?M:new De(this);var be=a.apply(M,U);return be.__actions__.push({func:mh,args:[te],thisArg:t}),new ur(be,oe)}return we&&Pe?a.apply(this,U):(be=this.thru(te),we?b?be.value()[0]:be.value():be)})}),_r(["pop","push","shift","sort","splice","unshift"],function(a){var u=Uo[a],m=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",b=/^(?:pop|shift)$/.test(a);q.prototype[a]=function(){var x=arguments;if(b&&!this.__chain__){var P=this.value();return u.apply(Ee(P)?P:[],x)}return this[m](function(M){return u.apply(Ee(M)?M:[],x)})}}),Sn(De.prototype,function(a,u){var m=q[u];if(m){var b=m.name+"";ot.call(Ms,b)||(Ms[b]=[]),Ms[b].push({name:u,func:m})}}),Ms[lh(t,E).name]=[{name:"wrapper",func:t}],De.prototype.clone=Hv,De.prototype.reverse=Bv,De.prototype.value=qc,q.prototype.at=hF,q.prototype.chain=mF,q.prototype.commit=gF,q.prototype.next=yF,q.prototype.plant=bF,q.prototype.reverse=SF,q.prototype.toJSON=q.prototype.valueOf=q.prototype.value=wF,q.prototype.first=q.prototype.head,Vo&&(q.prototype[Vo]=vF),q}),wi=xv();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ut._=wi,define(function(){return wi})):st?((st.exports=wi)._=wi,cl._=wi):Ut._=wi}).call(Wl)});var vI=H((uS,zl)=>{(function(t,e){typeof uS=="object"&&typeof zl<"u"?zl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(uS,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(d){t=d}function n(d){return d instanceof Array||Object.prototype.toString.call(d)==="[object Array]"}function i(d){return d!=null&&Object.prototype.toString.call(d)==="[object Object]"}function s(d,y){return Object.prototype.hasOwnProperty.call(d,y)}function o(d){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(d).length===0;var y;for(y in d)if(s(d,y))return!1;return!0}function l(d){return d===void 0}function f(d){return typeof d=="number"||Object.prototype.toString.call(d)==="[object Number]"}function c(d){return d instanceof Date||Object.prototype.toString.call(d)==="[object Date]"}function p(d,y){var S=[],R,I=d.length;for(R=0;R<I;++R)S.push(y(d[R],R));return S}function h(d,y){for(var S in y)s(y,S)&&(d[S]=y[S]);return s(y,"toString")&&(d.toString=y.toString),s(y,"valueOf")&&(d.valueOf=y.valueOf),d}function g(d,y,S,R){return gl(d,y,S,R,!0).utc()}function v(){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 _(d){return d._pf==null&&(d._pf=v()),d._pf}var w;Array.prototype.some?w=Array.prototype.some:w=function(d){var y=Object(this),S=y.length>>>0,R;for(R=0;R<S;R++)if(R in y&&d.call(this,y[R],R,y))return!0;return!1};function E(d){var y=null,S=!1,R=d._d&&!isNaN(d._d.getTime());if(R&&(y=_(d),S=w.call(y.parsedDateParts,function(I){return I!=null}),R=y.overflow<0&&!y.empty&&!y.invalidEra&&!y.invalidMonth&&!y.invalidWeekday&&!y.weekdayMismatch&&!y.nullInput&&!y.invalidFormat&&!y.userInvalidated&&(!y.meridiem||y.meridiem&&S),d._strict&&(R=R&&y.charsLeftOver===0&&y.unusedTokens.length===0&&y.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(d))d._isValid=R;else return R;return d._isValid}function k(d){var y=g(NaN);return d!=null?h(_(y),d):_(y).userInvalidated=!0,y}var T=e.momentProperties=[],N=!1;function $(d,y){var S,R,I,L=T.length;if(l(y._isAMomentObject)||(d._isAMomentObject=y._isAMomentObject),l(y._i)||(d._i=y._i),l(y._f)||(d._f=y._f),l(y._l)||(d._l=y._l),l(y._strict)||(d._strict=y._strict),l(y._tzm)||(d._tzm=y._tzm),l(y._isUTC)||(d._isUTC=y._isUTC),l(y._offset)||(d._offset=y._offset),l(y._pf)||(d._pf=_(y)),l(y._locale)||(d._locale=y._locale),L>0)for(S=0;S<L;S++)R=T[S],I=y[R],l(I)||(d[R]=I);return d}function j(d){$(this,d),this._d=new Date(d._d!=null?d._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),N===!1&&(N=!0,e.updateOffset(this),N=!1)}function G(d){return d instanceof j||d!=null&&d._isAMomentObject!=null}function O(d){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+d)}function C(d,y){var S=!0;return h(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,d),S){var R=[],I,L,Y,ae=arguments.length;for(L=0;L<ae;L++){if(I="",typeof arguments[L]=="object"){I+=`
21
- [`+L+"] ";for(Y in arguments[0])s(arguments[0],Y)&&(I+=Y+": "+arguments[0][Y]+", ");I=I.slice(0,-2)}else I=arguments[L];R.push(I)}O(d+`
20
+ }`;var Pe=KE(function(){return tt(P,he+"return "+te).apply(t,M)});if(Pe.source=te,Fb(Pe))throw Pe;return Pe}function kL(a){return ct(a).toLowerCase()}function PL(a){return ct(a).toUpperCase()}function TL(a,u,m){if(a=ct(a),a&&(m||u===t))return Cc(a);if(!a||!(u=nn(u)))return a;var b=Cr(a),x=Cr(u),P=Tp(b,x),M=Ap(b,x)+1;return Bs(b,P,M).join("")}function AL(a,u,m){if(a=ct(a),a&&(m||u===t))return a.slice(0,Mp(a)+1);if(!a||!(u=nn(u)))return a;var b=Cr(a),x=Ap(b,Cr(u))+1;return Bs(b,0,x).join("")}function $L(a,u,m){if(a=ct(a),a&&(m||u===t))return a.replace(ac,"");if(!a||!(u=nn(u)))return a;var b=Cr(a),x=Tp(b,Cr(u));return Bs(b,x).join("")}function NL(a,u){var m=A,b=D;if(Pt(u)){var x="separator"in u?u.separator:x;m="length"in u?Oe(u.length):m,b="omission"in u?nn(u.omission):b}a=ct(a);var P=a.length;if(Ts(a)){var M=Cr(a);P=M.length}if(m>=P)return a;var U=m-Si(b);if(U<1)return b;var W=M?Bs(M,0,U).join(""):a.slice(0,U);if(x===t)return W+b;if(M&&(U+=W.length-U),Db(x)){if(a.slice(U).search(x)){var Z,X=W;for(x.global||(x=vl(x.source,ct(fp.exec(x))+"g")),x.lastIndex=0;Z=x.exec(X);)var te=Z.index;W=W.slice(0,te===t?U:te)}}else if(a.indexOf(nn(x),U)!=U){var oe=W.lastIndexOf(x);oe>-1&&(W=W.slice(0,oe))}return W+b}function ML(a){return a=ct(a),a&&nl.test(a)?a.replace(Ui,wv):a}var FL=Fl(function(a,u,m){return a+(m?" ":"")+u.toUpperCase()}),Hb=Kx("toUpperCase");function YE(a,u,m){return a=ct(a),u=m?t:u,u===t?vv(a)?Cv(a):fv(a):a.match(u)||[]}var KE=Ne(function(a,u){try{return wr(a,t,u)}catch(m){return Fb(m)?m:new Re(m)}}),DL=Qi(function(a,u){return _r(u,function(m){m=Jn(m),tn(a,m,Nb(a[m],a))}),a});function LL(a){var u=a==null?0:a.length,m=Se();return a=u?yt(a,function(b){if(typeof b[1]!="function")throw new xr(i);return[m(b[0]),b[1]]}):[],Ne(function(b){for(var x=-1;++x<u;){var P=a[x];if(wr(P[0],this,b))return wr(P[1],this,b)}})}function jL(a){return sb(cr(a,p))}function Bb(a){return function(){return a}}function UL(a,u){return a==null||a!==a?u:a}var HL=Zx(),BL=Zx(!0);function jr(a){return a}function Vb(a){return R(typeof a=="function"?a:cr(a,p))}function VL(a){return _e(cr(a,p))}function WL(a,u){return Le(a,cr(u,p))}var zL=Ne(function(a,u){return function(m){return Zo(m,a,u)}}),JL=Ne(function(a,u){return function(m){return Zo(a,m,u)}});function Wb(a,u,m){var b=tr(u),x=Nl(u,b);m==null&&!(Pt(u)&&(x.length||!b.length))&&(m=u,u=a,a=this,x=Nl(u,tr(u)));var P=!(Pt(m)&&"chain"in m)||!!m.chain,M=Xi(a);return _r(x,function(U){var W=u[U];a[U]=W,M&&(a.prototype[U]=function(){var Z=this.__chain__;if(P||Z){var X=a(this.__wrapped__),te=X.__actions__=Fr(this.__actions__);return te.push({func:W,args:arguments,thisArg:a}),X.__chain__=Z,X}return W.apply(a,bi([this.value()],arguments))})}),a}function GL(){return Ut._===this&&(Ut._=kv),this}function zb(){}function YL(a){return a=Oe(a),Ne(function(u){return zn(u,a)})}var KL=_b(yt),QL=_b(qp),ZL=_b(pl);function QE(a){return qb(a)?Do(Jn(a)):qN(a)}function XL(a){return function(u){return a==null?t:Yi(a,u)}}var ej=eE(),tj=eE(!0);function Jb(){return[]}function Gb(){return!1}function rj(){return{}}function nj(){return""}function ij(){return!0}function sj(a,u){if(a=Oe(a),a<1||a>ke)return[];var m=ve,b=Jt(a,ve);u=Se(u),a-=ve;for(var x=Rc(b,u);++m<a;)u(m);return x}function oj(a){return Ee(a)?yt(a,Jn):sn(a)?[a]:Fr(gE(ct(a)))}function aj(a){var u=++Ov;return ct(a)+u}var lj=uh(function(a,u){return a+u},0),uj=Rb("ceil"),cj=uh(function(a,u){return a/u},1),fj=Rb("floor");function dj(a){return a&&a.length?$l(a,jr,$c):t}function pj(a,u){return a&&a.length?$l(a,Se(u,2),$c):t}function hj(a){return Pp(a,jr)}function mj(a,u){return Pp(a,Se(u,2))}function gj(a){return a&&a.length?$l(a,jr,Y):t}function yj(a,u){return a&&a.length?$l(a,Se(u,2),Y):t}var vj=uh(function(a,u){return a*u},1),bj=Rb("round"),Sj=uh(function(a,u){return a-u},0);function wj(a){return a&&a.length?_c(a,jr):0}function _j(a,u){return a&&a.length?_c(a,Se(u,2)):0}return O.after=WF,O.ary=IE,O.assign=TD,O.assignIn=UE,O.assignInWith=HE,O.assignWith=Lb,O.at=AD,O.before=OE,O.bind=Nb,O.bindAll=DL,O.bindKey=qE,O.castArray=nD,O.chain=CE,O.chunk=dM,O.compact=pM,O.concat=hM,O.cond=LL,O.conforms=jL,O.constant=Bb,O.countBy=_F,O.create=$D,O.curry=kE,O.curryRight=PE,O.debounce=TE,O.defaults=ND,O.defaultsDeep=MD,O.defer=zF,O.delay=JF,O.difference=mM,O.differenceBy=gM,O.differenceWith=yM,O.drop=vM,O.dropRight=bM,O.dropRightWhile=SM,O.dropWhile=wM,O.fill=_M,O.filter=CF,O.flatMap=IF,O.flatMapDeep=OF,O.flatMapDepth=qF,O.flatten=SE,O.flattenDeep=RM,O.flattenDepth=CM,O.flip=GF,O.flow=HL,O.flowRight=BL,O.fromPairs=xM,O.functions=BD,O.functionsIn=VD,O.groupBy=kF,O.initial=IM,O.intersection=OM,O.intersectionBy=qM,O.intersectionWith=kM,O.invert=zD,O.invertBy=JD,O.invokeMap=TF,O.iteratee=Vb,O.keyBy=AF,O.keys=tr,O.keysIn=Lr,O.map=gh,O.mapKeys=YD,O.mapValues=KD,O.matches=VL,O.matchesProperty=WL,O.memoize=vh,O.merge=QD,O.mergeWith=BE,O.method=zL,O.methodOf=JL,O.mixin=Wb,O.negate=bh,O.nthArg=YL,O.omit=ZD,O.omitBy=XD,O.once=YF,O.orderBy=$F,O.over=KL,O.overArgs=KF,O.overEvery=QL,O.overSome=ZL,O.partial=Mb,O.partialRight=AE,O.partition=NF,O.pick=eL,O.pickBy=VE,O.property=QE,O.propertyOf=XL,O.pull=$M,O.pullAll=_E,O.pullAllBy=NM,O.pullAllWith=MM,O.pullAt=FM,O.range=ej,O.rangeRight=tj,O.rearg=QF,O.reject=DF,O.remove=DM,O.rest=ZF,O.reverse=Ab,O.sampleSize=jF,O.set=rL,O.setWith=nL,O.shuffle=UF,O.slice=LM,O.sortBy=VF,O.sortedUniq=zM,O.sortedUniqBy=JM,O.split=EL,O.spread=XF,O.tail=GM,O.take=YM,O.takeRight=KM,O.takeRightWhile=QM,O.takeWhile=ZM,O.tap=pF,O.throttle=eD,O.thru=mh,O.toArray=DE,O.toPairs=WE,O.toPairsIn=zE,O.toPath=oj,O.toPlainObject=jE,O.transform=iL,O.unary=tD,O.union=XM,O.unionBy=eF,O.unionWith=tF,O.uniq=rF,O.uniqBy=nF,O.uniqWith=iF,O.unset=sL,O.unzip=$b,O.unzipWith=RE,O.update=oL,O.updateWith=aL,O.values=jl,O.valuesIn=lL,O.without=sF,O.words=YE,O.wrap=rD,O.xor=oF,O.xorBy=aF,O.xorWith=lF,O.zip=uF,O.zipObject=cF,O.zipObjectDeep=fF,O.zipWith=dF,O.entries=WE,O.entriesIn=zE,O.extend=UE,O.extendWith=HE,Wb(O,O),O.add=lj,O.attempt=KE,O.camelCase=dL,O.capitalize=JE,O.ceil=uj,O.clamp=uL,O.clone=iD,O.cloneDeep=oD,O.cloneDeepWith=aD,O.cloneWith=sD,O.conformsTo=lD,O.deburr=GE,O.defaultTo=UL,O.divide=cj,O.endsWith=pL,O.eq=Gn,O.escape=hL,O.escapeRegExp=mL,O.every=RF,O.find=xF,O.findIndex=vE,O.findKey=FD,O.findLast=EF,O.findLastIndex=bE,O.findLastKey=DD,O.floor=fj,O.forEach=xE,O.forEachRight=EE,O.forIn=LD,O.forInRight=jD,O.forOwn=UD,O.forOwnRight=HD,O.get=jb,O.gt=uD,O.gte=cD,O.has=WD,O.hasIn=Ub,O.head=wE,O.identity=jr,O.includes=PF,O.indexOf=EM,O.inRange=cL,O.invoke=GD,O.isArguments=ra,O.isArray=Ee,O.isArrayBuffer=fD,O.isArrayLike=Dr,O.isArrayLikeObject=Dt,O.isBoolean=dD,O.isBuffer=Vs,O.isDate=pD,O.isElement=hD,O.isEmpty=mD,O.isEqual=gD,O.isEqualWith=yD,O.isError=Fb,O.isFinite=vD,O.isFunction=Xi,O.isInteger=$E,O.isLength=Sh,O.isMap=NE,O.isMatch=bD,O.isMatchWith=SD,O.isNaN=wD,O.isNative=_D,O.isNil=CD,O.isNull=RD,O.isNumber=ME,O.isObject=Pt,O.isObjectLike=Tt,O.isPlainObject=jc,O.isRegExp=Db,O.isSafeInteger=xD,O.isSet=FE,O.isString=wh,O.isSymbol=sn,O.isTypedArray=Ll,O.isUndefined=ED,O.isWeakMap=ID,O.isWeakSet=OD,O.join=PM,O.kebabCase=gL,O.last=_n,O.lastIndexOf=TM,O.lowerCase=yL,O.lowerFirst=vL,O.lt=qD,O.lte=kD,O.max=dj,O.maxBy=pj,O.mean=hj,O.meanBy=mj,O.min=gj,O.minBy=yj,O.stubArray=Jb,O.stubFalse=Gb,O.stubObject=rj,O.stubString=nj,O.stubTrue=ij,O.multiply=vj,O.nth=AM,O.noConflict=GL,O.noop=zb,O.now=yh,O.pad=bL,O.padEnd=SL,O.padStart=wL,O.parseInt=_L,O.random=fL,O.reduce=MF,O.reduceRight=FF,O.repeat=RL,O.replace=CL,O.result=tL,O.round=bj,O.runInContext=V,O.sample=LF,O.size=HF,O.snakeCase=xL,O.some=BF,O.sortedIndex=jM,O.sortedIndexBy=UM,O.sortedIndexOf=HM,O.sortedLastIndex=BM,O.sortedLastIndexBy=VM,O.sortedLastIndexOf=WM,O.startCase=IL,O.startsWith=OL,O.subtract=Sj,O.sum=wj,O.sumBy=_j,O.template=qL,O.times=sj,O.toFinite=es,O.toInteger=Oe,O.toLength=LE,O.toLower=kL,O.toNumber=Rn,O.toSafeInteger=PD,O.toString=ct,O.toUpper=PL,O.trim=TL,O.trimEnd=AL,O.trimStart=$L,O.truncate=NL,O.unescape=ML,O.uniqueId=aj,O.upperCase=FL,O.upperFirst=Hb,O.each=xE,O.eachRight=EE,O.first=wE,Wb(O,(function(){var a={};return Sn(O,function(u,m){ot.call(O.prototype,m)||(a[m]=u)}),a})(),{chain:!1}),O.VERSION=e,_r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){O[a].placeholder=O}),_r(["drop","take"],function(a,u){De.prototype[a]=function(m){m=m===t?1:Ct(Oe(m),0);var b=this.__filtered__&&!u?new De(this):this.clone();return b.__filtered__?b.__takeCount__=Jt(m,b.__takeCount__):b.__views__.push({size:Jt(m,ve),type:a+(b.__dir__<0?"Right":"")}),b},De.prototype[a+"Right"]=function(m){return this.reverse()[a](m).reverse()}}),_r(["filter","map","takeWhile"],function(a,u){var m=u+1,b=m==K||m==ie;De.prototype[a]=function(x){var P=this.clone();return P.__iteratees__.push({iteratee:Se(x,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),_r(["head","last"],function(a,u){var m="take"+(u?"Right":"");De.prototype[a]=function(){return this[m](1).value()[0]}}),_r(["initial","tail"],function(a,u){var m="drop"+(u?"":"Right");De.prototype[a]=function(){return this.__filtered__?new De(this):this[m](1)}}),De.prototype.compact=function(){return this.filter(jr)},De.prototype.find=function(a){return this.filter(a).head()},De.prototype.findLast=function(a){return this.reverse().find(a)},De.prototype.invokeMap=Ne(function(a,u){return typeof a=="function"?new De(this):this.map(function(m){return Zo(m,a,u)})}),De.prototype.reject=function(a){return this.filter(bh(Se(a)))},De.prototype.slice=function(a,u){a=Oe(a);var m=this;return m.__filtered__&&(a>0||u<0)?new De(m):(a<0?m=m.takeRight(-a):a&&(m=m.drop(a)),u!==t&&(u=Oe(u),m=u<0?m.dropRight(-u):m.take(u-a)),m)},De.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},De.prototype.toArray=function(){return this.take(ve)},Sn(De.prototype,function(a,u){var m=/^(?:filter|find|map|reject)|While$/.test(u),b=/^(?:head|last)$/.test(u),x=O[b?"take"+(u=="last"?"Right":""):u],P=b||/^find/.test(u);x&&(O.prototype[u]=function(){var M=this.__wrapped__,U=b?[1]:arguments,W=M instanceof De,Z=U[0],X=W||Ee(M),te=function(Be){var Je=x.apply(O,bi([Be],U));return b&&oe?Je[0]:Je};X&&m&&typeof Z=="function"&&Z.length!=1&&(W=X=!1);var oe=this.__chain__,he=!!this.__actions__.length,we=P&&!oe,Pe=W&&!he;if(!P&&X){M=Pe?M:new De(this);var be=a.apply(M,U);return be.__actions__.push({func:mh,args:[te],thisArg:t}),new ur(be,oe)}return we&&Pe?a.apply(this,U):(be=this.thru(te),we?b?be.value()[0]:be.value():be)})}),_r(["pop","push","shift","sort","splice","unshift"],function(a){var u=Uo[a],m=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",b=/^(?:pop|shift)$/.test(a);O.prototype[a]=function(){var x=arguments;if(b&&!this.__chain__){var P=this.value();return u.apply(Ee(P)?P:[],x)}return this[m](function(M){return u.apply(Ee(M)?M:[],x)})}}),Sn(De.prototype,function(a,u){var m=O[u];if(m){var b=m.name+"";ot.call(Ms,b)||(Ms[b]=[]),Ms[b].push({name:u,func:m})}}),Ms[lh(t,E).name]=[{name:"wrapper",func:t}],De.prototype.clone=Hv,De.prototype.reverse=Bv,De.prototype.value=Oc,O.prototype.at=hF,O.prototype.chain=mF,O.prototype.commit=gF,O.prototype.next=yF,O.prototype.plant=bF,O.prototype.reverse=SF,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=wF,O.prototype.first=O.prototype.head,Vo&&(O.prototype[Vo]=vF),O}),wi=xv();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ut._=wi,define(function(){return wi})):st?((st.exports=wi)._=wi,cl._=wi):Ut._=wi}).call(Wl)});var vI=H((uS,zl)=>{(function(t,e){typeof uS=="object"&&typeof zl<"u"?zl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(uS,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(d){t=d}function n(d){return d instanceof Array||Object.prototype.toString.call(d)==="[object Array]"}function i(d){return d!=null&&Object.prototype.toString.call(d)==="[object Object]"}function s(d,y){return Object.prototype.hasOwnProperty.call(d,y)}function o(d){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(d).length===0;var y;for(y in d)if(s(d,y))return!1;return!0}function l(d){return d===void 0}function f(d){return typeof d=="number"||Object.prototype.toString.call(d)==="[object Number]"}function c(d){return d instanceof Date||Object.prototype.toString.call(d)==="[object Date]"}function p(d,y){var S=[],R,I=d.length;for(R=0;R<I;++R)S.push(y(d[R],R));return S}function h(d,y){for(var S in y)s(y,S)&&(d[S]=y[S]);return s(y,"toString")&&(d.toString=y.toString),s(y,"valueOf")&&(d.valueOf=y.valueOf),d}function g(d,y,S,R){return gl(d,y,S,R,!0).utc()}function v(){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 _(d){return d._pf==null&&(d._pf=v()),d._pf}var w;Array.prototype.some?w=Array.prototype.some:w=function(d){var y=Object(this),S=y.length>>>0,R;for(R=0;R<S;R++)if(R in y&&d.call(this,y[R],R,y))return!0;return!1};function E(d){var y=null,S=!1,R=d._d&&!isNaN(d._d.getTime());if(R&&(y=_(d),S=w.call(y.parsedDateParts,function(I){return I!=null}),R=y.overflow<0&&!y.empty&&!y.invalidEra&&!y.invalidMonth&&!y.invalidWeekday&&!y.weekdayMismatch&&!y.nullInput&&!y.invalidFormat&&!y.userInvalidated&&(!y.meridiem||y.meridiem&&S),d._strict&&(R=R&&y.charsLeftOver===0&&y.unusedTokens.length===0&&y.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(d))d._isValid=R;else return R;return d._isValid}function k(d){var y=g(NaN);return d!=null?h(_(y),d):_(y).userInvalidated=!0,y}var T=e.momentProperties=[],N=!1;function $(d,y){var S,R,I,L=T.length;if(l(y._isAMomentObject)||(d._isAMomentObject=y._isAMomentObject),l(y._i)||(d._i=y._i),l(y._f)||(d._f=y._f),l(y._l)||(d._l=y._l),l(y._strict)||(d._strict=y._strict),l(y._tzm)||(d._tzm=y._tzm),l(y._isUTC)||(d._isUTC=y._isUTC),l(y._offset)||(d._offset=y._offset),l(y._pf)||(d._pf=_(y)),l(y._locale)||(d._locale=y._locale),L>0)for(S=0;S<L;S++)R=T[S],I=y[R],l(I)||(d[R]=I);return d}function j(d){$(this,d),this._d=new Date(d._d!=null?d._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),N===!1&&(N=!0,e.updateOffset(this),N=!1)}function G(d){return d instanceof j||d!=null&&d._isAMomentObject!=null}function q(d){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+d)}function C(d,y){var S=!0;return h(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,d),S){var R=[],I,L,Y,ae=arguments.length;for(L=0;L<ae;L++){if(I="",typeof arguments[L]=="object"){I+=`
21
+ [`+L+"] ";for(Y in arguments[0])s(arguments[0],Y)&&(I+=Y+": "+arguments[0][Y]+", ");I=I.slice(0,-2)}else I=arguments[L];R.push(I)}q(d+`
22
22
  Arguments: `+Array.prototype.slice.call(R).join("")+`
23
- `+new Error().stack),S=!1}return y.apply(this,arguments)},y)}var A={};function D(d,y){e.deprecationHandler!=null&&e.deprecationHandler(d,y),A[d]||(O(y),A[d]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function B(d){return typeof Function<"u"&&d instanceof Function||Object.prototype.toString.call(d)==="[object Function]"}function F(d){var y,S;for(S in d)s(d,S)&&(y=d[S],B(y)?this[S]=y:this["_"+S]=y);this._config=d,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function K(d,y){var S=h({},d),R;for(R in y)s(y,R)&&(i(d[R])&&i(y[R])?(S[R]={},h(S[R],d[R]),h(S[R],y[R])):y[R]!=null?S[R]=y[R]:delete S[R]);for(R in d)s(d,R)&&!s(y,R)&&i(d[R])&&(S[R]=h({},S[R]));return S}function ee(d){d!=null&&this.set(d)}var ie;Object.keys?ie=Object.keys:ie=function(d){var y,S=[];for(y in d)s(d,y)&&S.push(y);return S};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 ke(d,y,S){var R=this._calendar[d]||this._calendar.sameElse;return B(R)?R.call(y,S):R}function de(d,y,S){var R=""+Math.abs(d),I=y-R.length,L=d>=0;return(L?S?"+":"":"-")+Math.pow(10,Math.max(0,I)).toString().substr(1)+R}var le=/(\[[^\[]*\])|(\\)?([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,ve=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,We={},mt={};function ce(d,y,S,R){var I=R;typeof R=="string"&&(I=function(){return this[R]()}),d&&(mt[d]=I),y&&(mt[y[0]]=function(){return de(I.apply(this,arguments),y[1],y[2])}),S&&(mt[S]=function(){return this.localeData().ordinal(I.apply(this,arguments),d)})}function rr(d){return d.match(/\[[\s\S]/)?d.replace(/^\[|\]$/g,""):d.replace(/\\/g,"")}function $e(d){var y=d.match(le),S,R;for(S=0,R=y.length;S<R;S++)mt[y[S]]?y[S]=mt[y[S]]:y[S]=rr(y[S]);return function(I){var L="",Y;for(Y=0;Y<R;Y++)L+=B(y[Y])?y[Y].call(I,d):y[Y];return L}}function nt(d,y){return d.isValid()?(y=Xr(y,d.localeData()),We[y]=We[y]||$e(y),We[y](d)):d.localeData().invalidDate()}function Xr(d,y){var S=5;function R(I){return y.longDateFormat(I)||I}for(ve.lastIndex=0;S>=0&&ve.test(d);)d=d.replace(ve,R),ve.lastIndex=0,S-=1;return d}var Ar={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 _t(d){var y=this._longDateFormat[d],S=this._longDateFormat[d.toUpperCase()];return y||!S?y:(this._longDateFormat[d]=S.match(le).map(function(R){return R==="MMMM"||R==="MM"||R==="DD"||R==="dddd"?R.slice(1):R}).join(""),this._longDateFormat[d])}var Rt="Invalid date";function pn(){return this._invalidDate}var Eo="%d",Zt=/\d{1,2}/;function Io(d){return this._ordinal.replace("%d",d)}var Ay={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 Mn(d,y,S,R){var I=this._relativeTime[S];return B(I)?I(d,y,S,R):I.replace(/%d/i,d)}function ap(d,y){var S=this._relativeTime[d>0?"future":"past"];return B(S)?S(y):S.replace(/%s/i,y)}var lp={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 Xt(d){return typeof d=="string"?lp[d]||lp[d.toLowerCase()]:void 0}function Sr(d){var y={},S,R;for(R in d)s(d,R)&&(S=Xt(R),S&&(y[S]=d[R]));return y}var qo={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 Za(d){var y=[],S;for(S in d)s(d,S)&&y.push({unit:S,priority:qo[S]});return y.sort(function(R,I){return R.priority-I.priority}),y}var up=/\d/,zt=/\d\d/,cp=/\d{3}/,ji=/\d{4}/,Fn=/[+-]?\d{6}/,pt=/\d\d?/,Xa=/\d\d\d\d?/,el=/\d\d\d\d\d\d?/,Cs=/\d{1,3}/,Oo=/\d{1,4}/,xs=/[+-]?\d{1,6}/,yi=/\d+/,Es=/[+-]?\d+/,sc=/Z|[+-]\d\d:?\d\d/gi,tl=/Z|[+-]\d\d(?::?\d\d)?/gi,$y=/[+-]?\d+(\.\d{1,3})?/,ko=/[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,Ui=/^[1-9]\d?/,rl=/^([1-9]\d|\d)/,nl;nl={};function fe(d,y,S){nl[d]=B(y)?y:function(R,I){return R&&S?S:y}}function Ny(d,y){return s(nl,d)?nl[d](y._strict,y._locale):new RegExp(My(d))}function My(d){return hn(d.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(y,S,R,I,L){return S||R||I||L}))}function hn(d){return d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $r(d){return d<0?Math.ceil(d)||0:Math.floor(d)}function Fe(d){var y=+d,S=0;return y!==0&&isFinite(y)&&(S=$r(y)),S}var oc={};function it(d,y){var S,R=y,I;for(typeof d=="string"&&(d=[d]),f(y)&&(R=function(L,Y){Y[y]=Fe(L)}),I=d.length,S=0;S<I;S++)oc[d[S]]=R}function Po(d,y){it(d,function(S,R,I,L){I._w=I._w||{},y(S,I._w,I,L)})}function ac(d,y,S){y!=null&&s(oc,d)&&oc[d](y,S._a,S,d)}function il(d){return d%4===0&&d%100!==0||d%400===0}var er=0,Dn=1,mn=2,Ft=3,Nr=4,Ln=5,Hi=6,fp=7,Fy=8;ce("Y",0,0,function(){var d=this.year();return d<=9999?de(d,4):"+"+d}),ce(0,["YY",2],0,function(){return this.year()%100}),ce(0,["YYYY",4],0,"year"),ce(0,["YYYYY",5],0,"year"),ce(0,["YYYYYY",6,!0],0,"year"),fe("Y",Es),fe("YY",pt,zt),fe("YYYY",Oo,ji),fe("YYYYY",xs,Fn),fe("YYYYYY",xs,Fn),it(["YYYYY","YYYYYY"],er),it("YYYY",function(d,y){y[er]=d.length===2?e.parseTwoDigitYear(d):Fe(d)}),it("YY",function(d,y){y[er]=e.parseTwoDigitYear(d)}),it("Y",function(d,y){y[er]=parseInt(d,10)});function To(d){return il(d)?366:365}e.parseTwoDigitYear=function(d){return Fe(d)+(Fe(d)>68?1900:2e3)};var dp=Is("FullYear",!0);function Dy(){return il(this.year())}function Is(d,y){return function(S){return S!=null?($o(this,d,S),e.updateOffset(this,y),this):Ao(this,d)}}function Ao(d,y){if(!d.isValid())return NaN;var S=d._d,R=d._isUTC;switch(y){case"Milliseconds":return R?S.getUTCMilliseconds():S.getMilliseconds();case"Seconds":return R?S.getUTCSeconds():S.getSeconds();case"Minutes":return R?S.getUTCMinutes():S.getMinutes();case"Hours":return R?S.getUTCHours():S.getHours();case"Date":return R?S.getUTCDate():S.getDate();case"Day":return R?S.getUTCDay():S.getDay();case"Month":return R?S.getUTCMonth():S.getMonth();case"FullYear":return R?S.getUTCFullYear():S.getFullYear();default:return NaN}}function $o(d,y,S){var R,I,L,Y,ae;if(!(!d.isValid()||isNaN(S))){switch(R=d._d,I=d._isUTC,y){case"Milliseconds":return void(I?R.setUTCMilliseconds(S):R.setMilliseconds(S));case"Seconds":return void(I?R.setUTCSeconds(S):R.setSeconds(S));case"Minutes":return void(I?R.setUTCMinutes(S):R.setMinutes(S));case"Hours":return void(I?R.setUTCHours(S):R.setHours(S));case"Date":return void(I?R.setUTCDate(S):R.setDate(S));case"FullYear":break;default:return}L=S,Y=d.month(),ae=d.date(),ae=ae===29&&Y===1&&!il(L)?28:ae,I?R.setUTCFullYear(L,Y,ae):R.setFullYear(L,Y,ae)}}function Ly(d){return d=Xt(d),B(this[d])?this[d]():this}function sl(d,y){if(typeof d=="object"){d=Sr(d);var S=Za(d),R,I=S.length;for(R=0;R<I;R++)this[S[R].unit](d[S[R].unit])}else if(d=Xt(d),B(this[d]))return this[d](y);return this}function jy(d,y){return(d%y+y)%y}var kt;Array.prototype.indexOf?kt=Array.prototype.indexOf:kt=function(d){var y;for(y=0;y<this.length;++y)if(this[y]===d)return y;return-1};function lc(d,y){if(isNaN(d)||isNaN(y))return NaN;var S=jy(y,12);return d+=(y-S)/12,S===1?il(d)?29:28:31-S%7%2}ce("M",["MM",2],"Mo",function(){return this.month()+1}),ce("MMM",0,0,function(d){return this.localeData().monthsShort(this,d)}),ce("MMMM",0,0,function(d){return this.localeData().months(this,d)}),fe("M",pt,Ui),fe("MM",pt,zt),fe("MMM",function(d,y){return y.monthsShortRegex(d)}),fe("MMMM",function(d,y){return y.monthsRegex(d)}),it(["M","MM"],function(d,y){y[Dn]=Fe(d)-1}),it(["MMM","MMMM"],function(d,y,S,R){var I=S._locale.monthsParse(d,R,S._strict);I!=null?y[Dn]=I:_(S).invalidMonth=d});var pp="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),uc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),cc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Uy=ko,Hy=ko;function By(d,y){return d?n(this._months)?this._months[d.month()]:this._months[(this._months.isFormat||cc).test(y)?"format":"standalone"][d.month()]:n(this._months)?this._months:this._months.standalone}function Vy(d,y){return d?n(this._monthsShort)?this._monthsShort[d.month()]:this._monthsShort[cc.test(y)?"format":"standalone"][d.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function hp(d,y,S){var R,I,L,Y=d.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],R=0;R<12;++R)L=g([2e3,R]),this._shortMonthsParse[R]=this.monthsShort(L,"").toLocaleLowerCase(),this._longMonthsParse[R]=this.months(L,"").toLocaleLowerCase();return S?y==="MMM"?(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:null):(I=kt.call(this._longMonthsParse,Y),I!==-1?I:null):y==="MMM"?(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:(I=kt.call(this._longMonthsParse,Y),I!==-1?I:null)):(I=kt.call(this._longMonthsParse,Y),I!==-1?I:(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:null))}function mp(d,y,S){var R,I,L;if(this._monthsParseExact)return hp.call(this,d,y,S);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),R=0;R<12;R++){if(I=g([2e3,R]),S&&!this._longMonthsParse[R]&&(this._longMonthsParse[R]=new RegExp("^"+this.months(I,"").replace(".","")+"$","i"),this._shortMonthsParse[R]=new RegExp("^"+this.monthsShort(I,"").replace(".","")+"$","i")),!S&&!this._monthsParse[R]&&(L="^"+this.months(I,"")+"|^"+this.monthsShort(I,""),this._monthsParse[R]=new RegExp(L.replace(".",""),"i")),S&&y==="MMMM"&&this._longMonthsParse[R].test(d))return R;if(S&&y==="MMM"&&this._shortMonthsParse[R].test(d))return R;if(!S&&this._monthsParse[R].test(d))return R}}function fc(d,y){if(!d.isValid())return d;if(typeof y=="string"){if(/^\d+$/.test(y))y=Fe(y);else if(y=d.localeData().monthsParse(y),!f(y))return d}var S=y,R=d.date();return R=R<29?R:Math.min(R,lc(d.year(),S)),d._isUTC?d._d.setUTCMonth(S,R):d._d.setMonth(S,R),d}function ol(d){return d!=null?(fc(this,d),e.updateOffset(this,!0),this):Ao(this,"Month")}function Wy(){return lc(this.year(),this.month())}function gp(d){return this._monthsParseExact?(s(this,"_monthsRegex")||dc.call(this),d?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Uy),this._monthsShortStrictRegex&&d?this._monthsShortStrictRegex:this._monthsShortRegex)}function al(d){return this._monthsParseExact?(s(this,"_monthsRegex")||dc.call(this),d?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Hy),this._monthsStrictRegex&&d?this._monthsStrictRegex:this._monthsRegex)}function dc(){function d(_e,Le){return Le.length-_e.length}var y=[],S=[],R=[],I,L,Y,ae;for(I=0;I<12;I++)L=g([2e3,I]),Y=hn(this.monthsShort(L,"")),ae=hn(this.months(L,"")),y.push(Y),S.push(ae),R.push(ae),R.push(Y);y.sort(d),S.sort(d),R.sort(d),this._monthsRegex=new RegExp("^("+R.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+y.join("|")+")","i")}function zy(d,y,S,R,I,L,Y){var ae;return d<100&&d>=0?(ae=new Date(d+400,y,S,R,I,L,Y),isFinite(ae.getFullYear())&&ae.setFullYear(d)):ae=new Date(d,y,S,R,I,L,Y),ae}function qs(d){var y,S;return d<100&&d>=0?(S=Array.prototype.slice.call(arguments),S[0]=d+400,y=new Date(Date.UTC.apply(null,S)),isFinite(y.getUTCFullYear())&&y.setUTCFullYear(d)):y=new Date(Date.UTC.apply(null,arguments)),y}function No(d,y,S){var R=7+y-S,I=(7+qs(d,0,R).getUTCDay()-y)%7;return-I+R-1}function ll(d,y,S,R,I){var L=(7+S-R)%7,Y=No(d,R,I),ae=1+7*(y-1)+L+Y,_e,Le;return ae<=0?(_e=d-1,Le=To(_e)+ae):ae>To(d)?(_e=d+1,Le=ae-To(d)):(_e=d,Le=ae),{year:_e,dayOfYear:Le}}function Mo(d,y,S){var R=No(d.year(),y,S),I=Math.floor((d.dayOfYear()-R-1)/7)+1,L,Y;return I<1?(Y=d.year()-1,L=I+gn(Y,y,S)):I>gn(d.year(),y,S)?(L=I-gn(d.year(),y,S),Y=d.year()+1):(Y=d.year(),L=I),{week:L,year:Y}}function gn(d,y,S){var R=No(d,y,S),I=No(d+1,y,S);return(To(d)-R+I)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),fe("w",pt,Ui),fe("ww",pt,zt),fe("W",pt,Ui),fe("WW",pt,zt),Po(["w","ww","W","WW"],function(d,y,S,R){y[R.substr(0,1)]=Fe(d)});function pc(d){return Mo(d,this._week.dow,this._week.doy).week}var hc={dow:0,doy:6};function Os(){return this._week.dow}function yp(){return this._week.doy}function vp(d){var y=this.localeData().week(this);return d==null?y:this.add((d-y)*7,"d")}function Jy(d){var y=Mo(this,1,4).week;return d==null?y:this.add((d-y)*7,"d")}ce("d",0,"do","day"),ce("dd",0,0,function(d){return this.localeData().weekdaysMin(this,d)}),ce("ddd",0,0,function(d){return this.localeData().weekdaysShort(this,d)}),ce("dddd",0,0,function(d){return this.localeData().weekdays(this,d)}),ce("e",0,0,"weekday"),ce("E",0,0,"isoWeekday"),fe("d",pt),fe("e",pt),fe("E",pt),fe("dd",function(d,y){return y.weekdaysMinRegex(d)}),fe("ddd",function(d,y){return y.weekdaysShortRegex(d)}),fe("dddd",function(d,y){return y.weekdaysRegex(d)}),Po(["dd","ddd","dddd"],function(d,y,S,R){var I=S._locale.weekdaysParse(d,R,S._strict);I!=null?y.d=I:_(S).invalidWeekday=d}),Po(["d","e","E"],function(d,y,S,R){y[R]=Fe(d)});function bp(d,y){return typeof d!="string"?d:isNaN(d)?(d=y.weekdaysParse(d),typeof d=="number"?d:null):parseInt(d,10)}function Sp(d,y){return typeof d=="string"?y.weekdaysParse(d)%7||7:isNaN(d)?null:d}function ul(d,y){return d.slice(y,7).concat(d.slice(0,y))}var wp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),_p="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Gy="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Yy=ko,Rp=ko,Ky=ko;function Qy(d,y){var S=n(this._weekdays)?this._weekdays:this._weekdays[d&&d!==!0&&this._weekdays.isFormat.test(y)?"format":"standalone"];return d===!0?ul(S,this._week.dow):d?S[d.day()]:S}function Zy(d){return d===!0?ul(this._weekdaysShort,this._week.dow):d?this._weekdaysShort[d.day()]:this._weekdaysShort}function Xy(d){return d===!0?ul(this._weekdaysMin,this._week.dow):d?this._weekdaysMin[d.day()]:this._weekdaysMin}function mc(d,y,S){var R,I,L,Y=d.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],R=0;R<7;++R)L=g([2e3,1]).day(R),this._minWeekdaysParse[R]=this.weekdaysMin(L,"").toLocaleLowerCase(),this._shortWeekdaysParse[R]=this.weekdaysShort(L,"").toLocaleLowerCase(),this._weekdaysParse[R]=this.weekdays(L,"").toLocaleLowerCase();return S?y==="dddd"?(I=kt.call(this._weekdaysParse,Y),I!==-1?I:null):y==="ddd"?(I=kt.call(this._shortWeekdaysParse,Y),I!==-1?I:null):(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null):y==="dddd"?(I=kt.call(this._weekdaysParse,Y),I!==-1||(I=kt.call(this._shortWeekdaysParse,Y),I!==-1)?I:(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null)):y==="ddd"?(I=kt.call(this._shortWeekdaysParse,Y),I!==-1||(I=kt.call(this._weekdaysParse,Y),I!==-1)?I:(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null)):(I=kt.call(this._minWeekdaysParse,Y),I!==-1||(I=kt.call(this._weekdaysParse,Y),I!==-1)?I:(I=kt.call(this._shortWeekdaysParse,Y),I!==-1?I:null))}function ev(d,y,S){var R,I,L;if(this._weekdaysParseExact)return mc.call(this,d,y,S);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),R=0;R<7;R++){if(I=g([2e3,1]).day(R),S&&!this._fullWeekdaysParse[R]&&(this._fullWeekdaysParse[R]=new RegExp("^"+this.weekdays(I,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[R]=new RegExp("^"+this.weekdaysShort(I,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[R]=new RegExp("^"+this.weekdaysMin(I,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[R]||(L="^"+this.weekdays(I,"")+"|^"+this.weekdaysShort(I,"")+"|^"+this.weekdaysMin(I,""),this._weekdaysParse[R]=new RegExp(L.replace(".",""),"i")),S&&y==="dddd"&&this._fullWeekdaysParse[R].test(d))return R;if(S&&y==="ddd"&&this._shortWeekdaysParse[R].test(d))return R;if(S&&y==="dd"&&this._minWeekdaysParse[R].test(d))return R;if(!S&&this._weekdaysParse[R].test(d))return R}}function tv(d){if(!this.isValid())return d!=null?this:NaN;var y=Ao(this,"Day");return d!=null?(d=bp(d,this.localeData()),this.add(d-y,"d")):y}function rv(d){if(!this.isValid())return d!=null?this:NaN;var y=(this.day()+7-this.localeData()._week.dow)%7;return d==null?y:this.add(d-y,"d")}function nv(d){if(!this.isValid())return d!=null?this:NaN;if(d!=null){var y=Sp(d,this.localeData());return this.day(this.day()%7?y:y-7)}else return this.day()||7}function iv(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||gc.call(this),d?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Yy),this._weekdaysStrictRegex&&d?this._weekdaysStrictRegex:this._weekdaysRegex)}function bt(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||gc.call(this),d?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Rp),this._weekdaysShortStrictRegex&&d?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function gt(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||gc.call(this),d?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ky),this._weekdaysMinStrictRegex&&d?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function gc(){function d(Ht,Wn){return Wn.length-Ht.length}var y=[],S=[],R=[],I=[],L,Y,ae,_e,Le;for(L=0;L<7;L++)Y=g([2e3,1]).day(L),ae=hn(this.weekdaysMin(Y,"")),_e=hn(this.weekdaysShort(Y,"")),Le=hn(this.weekdays(Y,"")),y.push(ae),S.push(_e),R.push(Le),I.push(ae),I.push(_e),I.push(Le);y.sort(d),S.sort(d),R.sort(d),I.sort(d),this._weekdaysRegex=new RegExp("^("+I.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+y.join("|")+")","i")}function yc(){return this.hours()%12||12}function sv(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,yc),ce("k",["kk",2],0,sv),ce("hmm",0,0,function(){return""+yc.apply(this)+de(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+yc.apply(this)+de(this.minutes(),2)+de(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+de(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+de(this.minutes(),2)+de(this.seconds(),2)});function Cp(d,y){ce(d,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),y)})}Cp("a",!0),Cp("A",!1);function xp(d,y){return y._meridiemParse}fe("a",xp),fe("A",xp),fe("H",pt,rl),fe("h",pt,Ui),fe("k",pt,Ui),fe("HH",pt,zt),fe("hh",pt,zt),fe("kk",pt,zt),fe("hmm",Xa),fe("hmmss",el),fe("Hmm",Xa),fe("Hmmss",el),it(["H","HH"],Ft),it(["k","kk"],function(d,y,S){var R=Fe(d);y[Ft]=R===24?0:R}),it(["a","A"],function(d,y,S){S._isPm=S._locale.isPM(d),S._meridiem=d}),it(["h","hh"],function(d,y,S){y[Ft]=Fe(d),_(S).bigHour=!0}),it("hmm",function(d,y,S){var R=d.length-2;y[Ft]=Fe(d.substr(0,R)),y[Nr]=Fe(d.substr(R)),_(S).bigHour=!0}),it("hmmss",function(d,y,S){var R=d.length-4,I=d.length-2;y[Ft]=Fe(d.substr(0,R)),y[Nr]=Fe(d.substr(R,2)),y[Ln]=Fe(d.substr(I)),_(S).bigHour=!0}),it("Hmm",function(d,y,S){var R=d.length-2;y[Ft]=Fe(d.substr(0,R)),y[Nr]=Fe(d.substr(R))}),it("Hmmss",function(d,y,S){var R=d.length-4,I=d.length-2;y[Ft]=Fe(d.substr(0,R)),y[Nr]=Fe(d.substr(R,2)),y[Ln]=Fe(d.substr(I))});function ov(d){return(d+"").toLowerCase().charAt(0)==="p"}var Ep=/[ap]\.?m?\.?/i,av=Is("Hours",!0);function Ut(d,y,S){return d>11?S?"pm":"PM":S?"am":"AM"}var cl={calendar:pe,longDateFormat:Ar,invalidDate:Rt,ordinal:Eo,dayOfMonthOrdinalParse:Zt,relativeTime:Ay,months:pp,monthsShort:uc,week:hc,weekdays:wp,weekdaysMin:Gy,weekdaysShort:_p,meridiemParse:Ep},st={},ks={},Bi;function Mr(d,y){var S,R=Math.min(d.length,y.length);for(S=0;S<R;S+=1)if(d[S]!==y[S])return S;return R}function vc(d){return d&&d.toLowerCase().replace("_","-")}function Ip(d){for(var y=0,S,R,I,L;y<d.length;){for(L=vc(d[y]).split("-"),S=L.length,R=vc(d[y+1]),R=R?R.split("-"):null;S>0;){if(I=Fo(L.slice(0,S).join("-")),I)return I;if(R&&R.length>=S&&Mr(L,R)>=S-1)break;S--}y++}return Bi}function qp(d){return!!(d&&d.match("^[^/\\\\]*$"))}function Fo(d){var y=null,S;if(st[d]===void 0&&typeof zl<"u"&&zl&&zl.exports&&qp(d))try{y=Bi._abbr,S=ft,S("./locale/"+d),jn(y)}catch{st[d]=null}return st[d]}function jn(d,y){var S;return d&&(l(y)?S=Un(d):S=fl(d,y),S?Bi=S:typeof console<"u"&&console.warn&&console.warn("Locale "+d+" not found. Did you forget to load it?")),Bi._abbr}function fl(d,y){if(y!==null){var S,R=cl;if(y.abbr=d,st[d]!=null)D("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."),R=st[d]._config;else if(y.parentLocale!=null)if(st[y.parentLocale]!=null)R=st[y.parentLocale]._config;else if(S=Fo(y.parentLocale),S!=null)R=S._config;else return ks[y.parentLocale]||(ks[y.parentLocale]=[]),ks[y.parentLocale].push({name:d,config:y}),null;return st[d]=new ee(K(R,y)),ks[d]&&ks[d].forEach(function(I){fl(I.name,I.config)}),jn(d),st[d]}else return delete st[d],null}function wr(d,y){if(y!=null){var S,R,I=cl;st[d]!=null&&st[d].parentLocale!=null?st[d].set(K(st[d]._config,y)):(R=Fo(d),R!=null&&(I=R._config),y=K(I,y),R==null&&(y.abbr=d),S=new ee(y),S.parentLocale=st[d],st[d]=S),jn(d)}else st[d]!=null&&(st[d].parentLocale!=null?(st[d]=st[d].parentLocale,d===jn()&&jn(d)):st[d]!=null&&delete st[d]);return st[d]}function Un(d){var y;if(d&&d._locale&&d._locale._abbr&&(d=d._locale._abbr),!d)return Bi;if(!n(d)){if(y=Fo(d),y)return y;d=[d]}return Ip(d)}function _r(){return ie(st)}function bc(d){var y,S=d._a;return S&&_(d).overflow===-2&&(y=S[Dn]<0||S[Dn]>11?Dn:S[mn]<1||S[mn]>lc(S[er],S[Dn])?mn:S[Ft]<0||S[Ft]>24||S[Ft]===24&&(S[Nr]!==0||S[Ln]!==0||S[Hi]!==0)?Ft:S[Nr]<0||S[Nr]>59?Nr:S[Ln]<0||S[Ln]>59?Ln:S[Hi]<0||S[Hi]>999?Hi:-1,_(d)._overflowDayOfYear&&(y<er||y>mn)&&(y=mn),_(d)._overflowWeeks&&y===-1&&(y=fp),_(d)._overflowWeekday&&y===-1&&(y=Fy),_(d).overflow=y),d}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)?)?$/,vi=/^\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)?)?$/,dl=/Z|[+-]\d\d(?::?\d\d)?/,Ps=[["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]],yt=[["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/]],bi=/^\/?Date\((-?\d+)/i,Sc=/^(?:(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}))$/,lv={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function pl(d){var y,S,R=d._i,I=Op.exec(R)||vi.exec(R),L,Y,ae,_e,Le=Ps.length,Ht=yt.length;if(I){for(_(d).iso=!0,y=0,S=Le;y<S;y++)if(Ps[y][1].exec(I[1])){Y=Ps[y][0],L=Ps[y][2]!==!1;break}if(Y==null){d._isValid=!1;return}if(I[3]){for(y=0,S=Ht;y<S;y++)if(yt[y][1].exec(I[3])){ae=(I[2]||" ")+yt[y][0];break}if(ae==null){d._isValid=!1;return}}if(!L&&ae!=null){d._isValid=!1;return}if(I[4])if(dl.exec(I[4]))_e="Z";else{d._isValid=!1;return}d._f=Y+(ae||"")+(_e||""),ml(d)}else d._isValid=!1}function uv(d,y,S,R,I,L){var Y=[cv(d),uc.indexOf(y),parseInt(S,10),parseInt(R,10),parseInt(I,10)];return L&&Y.push(parseInt(L,10)),Y}function cv(d){var y=parseInt(d,10);return y<=49?2e3+y:y<=999?1900+y:y}function fv(d){return d.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function kp(d,y,S){if(d){var R=_p.indexOf(d),I=new Date(y[0],y[1],y[2]).getDay();if(R!==I)return _(S).weekdayMismatch=!0,S._isValid=!1,!1}return!0}function hl(d,y,S){if(d)return lv[d];if(y)return 0;var R=parseInt(S,10),I=R%100,L=(R-I)/100;return L*60+I}function Vi(d){var y=Sc.exec(fv(d._i)),S;if(y){if(S=uv(y[4],y[3],y[2],y[5],y[6],y[7]),!kp(y[1],S,d))return;d._a=S,d._tzm=hl(y[8],y[9],y[10]),d._d=qs.apply(null,d._a),d._d.setUTCMinutes(d._d.getUTCMinutes()-d._tzm),_(d).rfc2822=!0}else d._isValid=!1}function dv(d){var y=bi.exec(d._i);if(y!==null){d._d=new Date(+y[1]);return}if(pl(d),d._isValid===!1)delete d._isValid;else return;if(Vi(d),d._isValid===!1)delete d._isValid;else return;d._strict?d._isValid=!1:e.createFromInputFallback(d)}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(d){d._d=new Date(d._i+(d._useUTC?" UTC":""))});function Wi(d,y,S){return d??y??S}function Pp(d){var y=new Date(e.now());return d._useUTC?[y.getUTCFullYear(),y.getUTCMonth(),y.getUTCDate()]:[y.getFullYear(),y.getMonth(),y.getDate()]}function Do(d){var y,S,R=[],I,L,Y;if(!d._d){for(I=Pp(d),d._w&&d._a[mn]==null&&d._a[Dn]==null&&wc(d),d._dayOfYear!=null&&(Y=Wi(d._a[er],I[er]),(d._dayOfYear>To(Y)||d._dayOfYear===0)&&(_(d)._overflowDayOfYear=!0),S=qs(Y,0,d._dayOfYear),d._a[Dn]=S.getUTCMonth(),d._a[mn]=S.getUTCDate()),y=0;y<3&&d._a[y]==null;++y)d._a[y]=R[y]=I[y];for(;y<7;y++)d._a[y]=R[y]=d._a[y]==null?y===2?1:0:d._a[y];d._a[Ft]===24&&d._a[Nr]===0&&d._a[Ln]===0&&d._a[Hi]===0&&(d._nextDay=!0,d._a[Ft]=0),d._d=(d._useUTC?qs:zy).apply(null,R),L=d._useUTC?d._d.getUTCDay():d._d.getDay(),d._tzm!=null&&d._d.setUTCMinutes(d._d.getUTCMinutes()-d._tzm),d._nextDay&&(d._a[Ft]=24),d._w&&typeof d._w.d<"u"&&d._w.d!==L&&(_(d).weekdayMismatch=!0)}}function wc(d){var y,S,R,I,L,Y,ae,_e,Le;y=d._w,y.GG!=null||y.W!=null||y.E!=null?(L=1,Y=4,S=Wi(y.GG,d._a[er],Mo(lt(),1,4).year),R=Wi(y.W,1),I=Wi(y.E,1),(I<1||I>7)&&(_e=!0)):(L=d._locale._week.dow,Y=d._locale._week.doy,Le=Mo(lt(),L,Y),S=Wi(y.gg,d._a[er],Le.year),R=Wi(y.w,Le.week),y.d!=null?(I=y.d,(I<0||I>6)&&(_e=!0)):y.e!=null?(I=y.e+L,(y.e<0||y.e>6)&&(_e=!0)):I=L),R<1||R>gn(S,L,Y)?_(d)._overflowWeeks=!0:_e!=null?_(d)._overflowWeekday=!0:(ae=ll(S,R,I,L,Y),d._a[er]=ae.year,d._dayOfYear=ae.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function ml(d){if(d._f===e.ISO_8601){pl(d);return}if(d._f===e.RFC_2822){Vi(d);return}d._a=[],_(d).empty=!0;var y=""+d._i,S,R,I,L,Y,ae=y.length,_e=0,Le,Ht;for(I=Xr(d._f,d._locale).match(le)||[],Ht=I.length,S=0;S<Ht;S++)L=I[S],R=(y.match(Ny(L,d))||[])[0],R&&(Y=y.substr(0,y.indexOf(R)),Y.length>0&&_(d).unusedInput.push(Y),y=y.slice(y.indexOf(R)+R.length),_e+=R.length),mt[L]?(R?_(d).empty=!1:_(d).unusedTokens.push(L),ac(L,R,d)):d._strict&&!R&&_(d).unusedTokens.push(L);_(d).charsLeftOver=ae-_e,y.length>0&&_(d).unusedInput.push(y),d._a[Ft]<=12&&_(d).bigHour===!0&&d._a[Ft]>0&&(_(d).bigHour=void 0),_(d).parsedDateParts=d._a.slice(0),_(d).meridiem=d._meridiem,d._a[Ft]=pv(d._locale,d._a[Ft],d._meridiem),Le=_(d).era,Le!==null&&(d._a[er]=d._locale.erasConvertYear(Le,d._a[er])),Do(d),bc(d)}function pv(d,y,S){var R;return S==null?y:d.meridiemHour!=null?d.meridiemHour(y,S):(d.isPM!=null&&(R=d.isPM(S),R&&y<12&&(y+=12),!R&&y===12&&(y=0)),y)}function _c(d){var y,S,R,I,L,Y,ae=!1,_e=d._f.length;if(_e===0){_(d).invalidFormat=!0,d._d=new Date(NaN);return}for(I=0;I<_e;I++)L=0,Y=!1,y=$({},d),d._useUTC!=null&&(y._useUTC=d._useUTC),y._f=d._f[I],ml(y),E(y)&&(Y=!0),L+=_(y).charsLeftOver,L+=_(y).unusedTokens.length*10,_(y).score=L,ae?L<R&&(R=L,S=y):(R==null||L<R||Y)&&(R=L,S=y,Y&&(ae=!0));h(d,S||y)}function Rc(d){if(!d._d){var y=Sr(d._i),S=y.day===void 0?y.date:y.day;d._a=p([y.year,y.month,S,y.hour,y.minute,y.second,y.millisecond],function(R){return R&&parseInt(R,10)}),Do(d)}}function hv(d){var y=new j(bc(Cc(d)));return y._nextDay&&(y.add(1,"d"),y._nextDay=void 0),y}function Cc(d){var y=d._i,S=d._f;return d._locale=d._locale||Un(d._l),y===null||S===void 0&&y===""?k({nullInput:!0}):(typeof y=="string"&&(d._i=y=d._locale.preparse(y)),G(y)?new j(bc(y)):(c(y)?d._d=y:n(S)?_c(d):S?ml(d):Rr(d),E(d)||(d._d=null),d))}function Rr(d){var y=d._i;l(y)?d._d=new Date(e.now()):c(y)?d._d=new Date(y.valueOf()):typeof y=="string"?dv(d):n(y)?(d._a=p(y.slice(0),function(S){return parseInt(S,10)}),Do(d)):i(y)?Rc(d):f(y)?d._d=new Date(y):e.createFromInputFallback(d)}function gl(d,y,S,R,I){var L={};return(y===!0||y===!1)&&(R=y,y=void 0),(S===!0||S===!1)&&(R=S,S=void 0),(i(d)&&o(d)||n(d)&&d.length===0)&&(d=void 0),L._isAMomentObject=!0,L._useUTC=L._isUTC=I,L._l=S,L._i=d,L._f=y,L._strict=R,hv(L)}function lt(d,y,S,R){return gl(d,y,S,R,!1)}var Tp=C("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var d=lt.apply(null,arguments);return this.isValid()&&d.isValid()?d<this?this:d:k()}),Ap=C("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var d=lt.apply(null,arguments);return this.isValid()&&d.isValid()?d>this?this:d:k()});function $p(d,y){var S,R;if(y.length===1&&n(y[0])&&(y=y[0]),!y.length)return lt();for(S=y[0],R=1;R<y.length;++R)(!y[R].isValid()||y[R][d](S))&&(S=y[R]);return S}function mv(){var d=[].slice.call(arguments,0);return $p("isBefore",d)}function gv(){var d=[].slice.call(arguments,0);return $p("isAfter",d)}var yv=function(){return Date.now?Date.now():+new Date},Lo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ts(d){var y,S=!1,R,I=Lo.length;for(y in d)if(s(d,y)&&!(kt.call(Lo,y)!==-1&&(d[y]==null||!isNaN(d[y]))))return!1;for(R=0;R<I;++R)if(d[Lo[R]]){if(S)return!1;parseFloat(d[Lo[R]])!==Fe(d[Lo[R]])&&(S=!0)}return!0}function vv(){return this._isValid}function bv(){return ut(NaN)}function As(d){var y=Sr(d),S=y.year||0,R=y.quarter||0,I=y.month||0,L=y.week||y.isoWeek||0,Y=y.day||0,ae=y.hour||0,_e=y.minute||0,Le=y.second||0,Ht=y.millisecond||0;this._isValid=Ts(y),this._milliseconds=+Ht+Le*1e3+_e*6e4+ae*1e3*60*60,this._days=+Y+L*7,this._months=+I+R*3+S*12,this._data={},this._locale=Un(),this._bubble()}function jo(d){return d instanceof As}function yn(d){return d<0?Math.round(-1*d)*-1:Math.round(d)}function yl(d,y,S){var R=Math.min(d.length,y.length),I=Math.abs(d.length-y.length),L=0,Y;for(Y=0;Y<R;Y++)(S&&d[Y]!==y[Y]||!S&&Fe(d[Y])!==Fe(y[Y]))&&L++;return L+I}function Np(d,y){ce(d,0,0,function(){var S=this.utcOffset(),R="+";return S<0&&(S=-S,R="-"),R+de(~~(S/60),2)+y+de(~~S%60,2)})}Np("Z",":"),Np("ZZ",""),fe("Z",tl),fe("ZZ",tl),it(["Z","ZZ"],function(d,y,S){S._useUTC=!0,S._tzm=xc(tl,d)});var Sv=/([\+\-]|\d\d)/gi;function xc(d,y){var S=(y||"").match(d),R,I,L;return S===null?null:(R=S[S.length-1]||[],I=(R+"").match(Sv)||["-",0,0],L=+(I[1]*60)+Fe(I[2]),L===0?0:I[0]==="+"?L:-L)}function Si(d,y){var S,R;return y._isUTC?(S=y.clone(),R=(G(d)||c(d)?d.valueOf():lt(d).valueOf())-S.valueOf(),S._d.setTime(S._d.valueOf()+R),e.updateOffset(S,!1),S):lt(d).local()}function Cr(d){return-Math.round(d._d.getTimezoneOffset())}e.updateOffset=function(){};function Mp(d,y,S){var R=this._offset||0,I;if(!this.isValid())return d!=null?this:NaN;if(d!=null){if(typeof d=="string"){if(d=xc(tl,d),d===null)return this}else Math.abs(d)<16&&!S&&(d=d*60);return!this._isUTC&&y&&(I=Cr(this)),this._offset=d,this._isUTC=!0,I!=null&&this.add(I,"m"),R!==d&&(!y||this._changeInProgress?Uo(this,ut(d-R,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?R:Cr(this)}function wv(d,y){return d!=null?(typeof d!="string"&&(d=-d),this.utcOffset(d,y),this):-this.utcOffset()}function _v(d){return this.utcOffset(0,d)}function Rv(d){return this._isUTC&&(this.utcOffset(0,d),this._isUTC=!1,d&&this.subtract(Cr(this),"m")),this}function Cv(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var d=xc(sc,this._i);d!=null?this.utcOffset(d):this.utcOffset(0,!0)}return this}function xv(d){return this.isValid()?(d=d?lt(d).utcOffset():0,(this.utcOffset()-d)%60===0):!1}function wi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function V(){if(!l(this._isDSTShifted))return this._isDSTShifted;var d={},y;return $(d,this),d=Cc(d),d._a?(y=d._isUTC?g(d._a):lt(d._a),this._isDSTShifted=this.isValid()&&yl(d._a,y.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Q(){return this.isValid()?!this._isUTC:!1}function z(){return this.isValid()?this._isUTC:!1}function ue(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Re=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,tt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ut(d,y){var S=d,R=null,I,L,Y;return jo(d)?S={ms:d._milliseconds,d:d._days,M:d._months}:f(d)||!isNaN(+d)?(S={},y?S[y]=+d:S.milliseconds=+d):(R=Re.exec(d))?(I=R[1]==="-"?-1:1,S={y:0,d:Fe(R[mn])*I,h:Fe(R[Ft])*I,m:Fe(R[Nr])*I,s:Fe(R[Ln])*I,ms:Fe(yn(R[Hi]*1e3))*I}):(R=tt.exec(d))?(I=R[1]==="-"?-1:1,S={y:ze(R[2],I),M:ze(R[3],I),w:ze(R[4],I),d:ze(R[5],I),h:ze(R[6],I),m:ze(R[7],I),s:ze(R[8],I)}):S==null?S={}:typeof S=="object"&&("from"in S||"to"in S)&&(Y=Ev(lt(S.from),lt(S.to)),S={},S.ms=Y.milliseconds,S.M=Y.months),L=new As(S),jo(d)&&s(d,"_locale")&&(L._locale=d._locale),jo(d)&&s(d,"_isValid")&&(L._isValid=d._isValid),L}ut.fn=As.prototype,ut.invalid=bv;function ze(d,y){var S=d&&parseFloat(d.replace(",","."));return(isNaN(S)?0:S)*y}function vl(d,y){var S={};return S.months=y.month()-d.month()+(y.year()-d.year())*12,d.clone().add(S.months,"M").isAfter(y)&&--S.months,S.milliseconds=+y-+d.clone().add(S.months,"M"),S}function Ev(d,y){var S;return d.isValid()&&y.isValid()?(y=Si(y,d),d.isBefore(y)?S=vl(d,y):(S=vl(y,d),S.milliseconds=-S.milliseconds,S.months=-S.months),S):{milliseconds:0,months:0}}function xr(d,y){return function(S,R){var I,L;return R!==null&&!isNaN(+R)&&(D(y,"moment()."+y+"(period, number) is deprecated. Please use moment()."+y+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),L=S,S=R,R=L),I=ut(S,R),Uo(this,I,d),this}}function Uo(d,y,S,R){var I=y._milliseconds,L=yn(y._days),Y=yn(y._months);d.isValid()&&(R=R??!0,Y&&fc(d,Ao(d,"Month")+Y*S),L&&$o(d,"Date",Ao(d,"Date")+L*S),I&&d._d.setTime(d._d.valueOf()+I*S),R&&e.updateOffset(d,L||Y))}var Iv=xr(1,"add"),$s=xr(-1,"subtract");function Ho(d){return typeof d=="string"||d instanceof String}function bl(d){return G(d)||c(d)||Ho(d)||f(d)||qv(d)||ot(d)||d===null||d===void 0}function ot(d){var y=i(d)&&!o(d),S=!1,R=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],I,L,Y=R.length;for(I=0;I<Y;I+=1)L=R[I],S=S||s(d,L);return y&&S}function qv(d){var y=n(d),S=!1;return y&&(S=d.filter(function(R){return!f(R)&&Ho(d)}).length===0),y&&S}function Fp(d){var y=i(d)&&!o(d),S=!1,R=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],I,L;for(I=0;I<R.length;I+=1)L=R[I],S=S||s(d,L);return y&&S}function Sl(d,y){var S=d.diff(y,"days",!0);return S<-6?"sameElse":S<-1?"lastWeek":S<0?"lastDay":S<1?"sameDay":S<2?"nextDay":S<7?"nextWeek":"sameElse"}function Ov(d,y){arguments.length===1&&(arguments[0]?bl(arguments[0])?(d=arguments[0],y=void 0):Fp(arguments[0])&&(y=arguments[0],d=void 0):(d=void 0,y=void 0));var S=d||lt(),R=Si(S,this).startOf("day"),I=e.calendarFormat(this,R)||"sameElse",L=y&&(B(y[I])?y[I].call(this,S):y[I]);return this.format(L||this.localeData().calendar(I,this,lt(S)))}function kv(){return new j(this)}function Pv(d,y){var S=G(d)?d:lt(d);return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()>S.valueOf():S.valueOf()<this.clone().startOf(y).valueOf()):!1}function wl(d,y){var S=G(d)?d:lt(d);return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()<S.valueOf():this.clone().endOf(y).valueOf()<S.valueOf()):!1}function _i(d,y,S,R){var I=G(d)?d:lt(d),L=G(y)?y:lt(y);return this.isValid()&&I.isValid()&&L.isValid()?(R=R||"()",(R[0]==="("?this.isAfter(I,S):!this.isBefore(I,S))&&(R[1]===")"?this.isBefore(L,S):!this.isAfter(L,S))):!1}function _l(d,y){var S=G(d)?d:lt(d),R;return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()===S.valueOf():(R=S.valueOf(),this.clone().startOf(y).valueOf()<=R&&R<=this.clone().endOf(y).valueOf())):!1}function Dp(d,y){return this.isSame(d,y)||this.isAfter(d,y)}function Rl(d,y){return this.isSame(d,y)||this.isBefore(d,y)}function Lp(d,y,S){var R,I,L;if(!this.isValid())return NaN;if(R=Si(d,this),!R.isValid())return NaN;switch(I=(R.utcOffset()-this.utcOffset())*6e4,y=Xt(y),y){case"year":L=Bo(this,R)/12;break;case"month":L=Bo(this,R);break;case"quarter":L=Bo(this,R)/3;break;case"second":L=(this-R)/1e3;break;case"minute":L=(this-R)/6e4;break;case"hour":L=(this-R)/36e5;break;case"day":L=(this-R-I)/864e5;break;case"week":L=(this-R-I)/6048e5;break;default:L=this-R}return S?L:$r(L)}function Bo(d,y){if(d.date()<y.date())return-Bo(y,d);var S=(y.year()-d.year())*12+(y.month()-d.month()),R=d.clone().add(S,"months"),I,L;return y-R<0?(I=d.clone().add(S-1,"months"),L=(y-R)/(R-I)):(I=d.clone().add(S+1,"months"),L=(y-R)/(I-R)),-(S+L)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Cl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function jp(d){if(!this.isValid())return null;var y=d!==!0,S=y?this.clone().utc():this;return S.year()<0||S.year()>9999?nt(S,y?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):B(Date.prototype.toISOString)?y?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",nt(S,"Z")):nt(S,y?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Vo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var d="moment",y="",S,R,I,L;return this.isLocal()||(d=this.utcOffset()===0?"moment.utc":"moment.parseZone",y="Z"),S="["+d+'("]',R=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",I="-MM-DD[T]HH:mm:ss.SSS",L=y+'[")]',this.format(S+R+I+L)}function zi(d){d||(d=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var y=nt(this,d);return this.localeData().postformat(y)}function xl(d,y){return this.isValid()&&(G(d)&&d.isValid()||lt(d).isValid())?ut({to:this,from:d}).locale(this.locale()).humanize(!y):this.localeData().invalidDate()}function Tv(d){return this.from(lt(),d)}function Av(d,y){return this.isValid()&&(G(d)&&d.isValid()||lt(d).isValid())?ut({from:this,to:d}).locale(this.locale()).humanize(!y):this.localeData().invalidDate()}function $v(d){return this.to(lt(),d)}function Wo(d){var y;return d===void 0?this._locale._abbr:(y=Un(d),y!=null&&(this._locale=y),this)}var zo=C("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(d){return d===void 0?this.localeData():this.locale(d)});function El(){return this._locale}var Il=1e3,Ji=60*Il,ql=60*Ji,Up=(365*400+97)*24*ql;function Ct(d,y){return(d%y+y)%y}function Jt(d,y,S){return d<100&&d>=0?new Date(d+400,y,S)-Up:new Date(d,y,S).valueOf()}function Hp(d,y,S){return d<100&&d>=0?Date.UTC(d+400,y,S)-Up:Date.UTC(d,y,S)}function Nv(d){var y,S;if(d=Xt(d),d===void 0||d==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?Hp:Jt,d){case"year":y=S(this.year(),0,1);break;case"quarter":y=S(this.year(),this.month()-this.month()%3,1);break;case"month":y=S(this.year(),this.month(),1);break;case"week":y=S(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":y=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":y=S(this.year(),this.month(),this.date());break;case"hour":y=this._d.valueOf(),y-=Ct(y+(this._isUTC?0:this.utcOffset()*Ji),ql);break;case"minute":y=this._d.valueOf(),y-=Ct(y,Ji);break;case"second":y=this._d.valueOf(),y-=Ct(y,Il);break}return this._d.setTime(y),e.updateOffset(this,!0),this}function Bp(d){var y,S;if(d=Xt(d),d===void 0||d==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?Hp:Jt,d){case"year":y=S(this.year()+1,0,1)-1;break;case"quarter":y=S(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":y=S(this.year(),this.month()+1,1)-1;break;case"week":y=S(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":y=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":y=S(this.year(),this.month(),this.date()+1)-1;break;case"hour":y=this._d.valueOf(),y+=ql-Ct(y+(this._isUTC?0:this.utcOffset()*Ji),ql)-1;break;case"minute":y=this._d.valueOf(),y+=Ji-Ct(y,Ji)-1;break;case"second":y=this._d.valueOf(),y+=Il-Ct(y,Il)-1;break}return this._d.setTime(y),e.updateOffset(this,!0),this}function Mv(){return this._d.valueOf()-(this._offset||0)*6e4}function Ec(){return Math.floor(this.valueOf()/1e3)}function Jo(){return new Date(this.valueOf())}function Ic(){var d=this;return[d.year(),d.month(),d.date(),d.hour(),d.minute(),d.second(),d.millisecond()]}function Ns(){var d=this;return{years:d.year(),months:d.month(),date:d.date(),hours:d.hours(),minutes:d.minutes(),seconds:d.seconds(),milliseconds:d.milliseconds()}}function Go(){return this.isValid()?this.toISOString():null}function Yo(){return E(this)}function Ol(){return h({},_(this))}function Ms(){return _(this).overflow}function Fv(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ce("N",0,0,"eraAbbr"),ce("NN",0,0,"eraAbbr"),ce("NNN",0,0,"eraAbbr"),ce("NNNN",0,0,"eraName"),ce("NNNNN",0,0,"eraNarrow"),ce("y",["y",1],"yo","eraYear"),ce("y",["yy",2],0,"eraYear"),ce("y",["yyy",3],0,"eraYear"),ce("y",["yyyy",4],0,"eraYear"),fe("N",ur),fe("NN",ur),fe("NNN",ur),fe("NNNN",De),fe("NNNNN",Hv),it(["N","NN","NNN","NNNN","NNNNN"],function(d,y,S,R){var I=S._locale.erasParse(d,R,S._strict);I?_(S).era=I:_(S).invalidEra=d}),fe("y",yi),fe("yy",yi),fe("yyy",yi),fe("yyyy",yi),fe("yo",Bv),it(["y","yy","yyy","yyyy"],er),it(["yo"],function(d,y,S,R){var I;S._locale._eraYearOrdinalRegex&&(I=d.match(S._locale._eraYearOrdinalRegex)),S._locale.eraYearOrdinalParse?y[er]=S._locale.eraYearOrdinalParse(d,I):y[er]=parseInt(d,10)});function Dv(d,y){var S,R,I,L=this._eras||Un("en")._eras;for(S=0,R=L.length;S<R;++S)switch(typeof L[S].since==="string"&&(I=e(L[S].since).startOf("day"),L[S].since=I.valueOf()),typeof L[S].until){case"undefined":L[S].until=1/0;break;case"string":I=e(L[S].until).startOf("day").valueOf(),L[S].until=I.valueOf();break}return L}function Lv(d,y,S){var R,I,L=this.eras(),Y,ae,_e;for(d=d.toUpperCase(),R=0,I=L.length;R<I;++R)if(Y=L[R].name.toUpperCase(),ae=L[R].abbr.toUpperCase(),_e=L[R].narrow.toUpperCase(),S)switch(y){case"N":case"NN":case"NNN":if(ae===d)return L[R];break;case"NNNN":if(Y===d)return L[R];break;case"NNNNN":if(_e===d)return L[R];break}else if([Y,ae,_e].indexOf(d)>=0)return L[R]}function jv(d,y){var S=d.since<=d.until?1:-1;return y===void 0?e(d.since).year():e(d.since).year()+(y-d.offset)*S}function Uv(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].name;return""}function kl(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].narrow;return""}function Ko(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].abbr;return""}function Vp(){var d,y,S,R,I=this.localeData().eras();for(d=0,y=I.length;d<y;++d)if(S=I[d].since<=I[d].until?1:-1,R=this.clone().startOf("day").valueOf(),I[d].since<=R&&R<=I[d].until||I[d].until<=R&&R<=I[d].since)return(this.year()-e(I[d].since).year())*S+I[d].offset;return this.year()}function q(d){return s(this,"_erasNameRegex")||qc.call(this),d?this._erasNameRegex:this._erasRegex}function Fs(d){return s(this,"_erasAbbrRegex")||qc.call(this),d?this._erasAbbrRegex:this._erasRegex}function Pl(d){return s(this,"_erasNarrowRegex")||qc.call(this),d?this._erasNarrowRegex:this._erasRegex}function ur(d,y){return y.erasAbbrRegex(d)}function De(d,y){return y.erasNameRegex(d)}function Hv(d,y){return y.erasNarrowRegex(d)}function Bv(d,y){return y._eraYearOrdinalRegex||yi}function qc(){var d=[],y=[],S=[],R=[],I,L,Y,ae,_e,Le=this.eras();for(I=0,L=Le.length;I<L;++I)Y=hn(Le[I].name),ae=hn(Le[I].abbr),_e=hn(Le[I].narrow),y.push(Y),d.push(ae),S.push(_e),R.push(Y),R.push(ae),R.push(_e);this._erasRegex=new RegExp("^("+R.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+y.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+d.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+S.join("|")+")","i")}ce(0,["gg",2],0,function(){return this.weekYear()%100}),ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function vn(d,y){ce(0,[d,d.length],0,y)}vn("gggg","weekYear"),vn("ggggg","weekYear"),vn("GGGG","isoWeekYear"),vn("GGGGG","isoWeekYear"),fe("G",Es),fe("g",Es),fe("GG",pt,zt),fe("gg",pt,zt),fe("GGGG",Oo,ji),fe("gggg",Oo,ji),fe("GGGGG",xs,Fn),fe("ggggg",xs,Fn),Po(["gggg","ggggg","GGGG","GGGGG"],function(d,y,S,R){y[R.substr(0,2)]=Fe(d)}),Po(["gg","GG"],function(d,y,S,R){y[R]=e.parseTwoDigitYear(d)});function Vv(d){return Wp.call(this,d,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Wv(d){return Wp.call(this,d,this.isoWeek(),this.isoWeekday(),1,4)}function zv(){return gn(this.year(),1,4)}function Jv(){return gn(this.isoWeekYear(),1,4)}function Gv(){var d=this.localeData()._week;return gn(this.year(),d.dow,d.doy)}function Hn(){var d=this.localeData()._week;return gn(this.weekYear(),d.dow,d.doy)}function Wp(d,y,S,R,I){var L;return d==null?Mo(this,R,I).year:(L=gn(d,R,I),y>L&&(y=L),Yv.call(this,d,y,S,R,I))}function Yv(d,y,S,R,I){var L=ll(d,y,S,R,I),Y=qs(L.year,0,L.dayOfYear);return this.year(Y.getUTCFullYear()),this.month(Y.getUTCMonth()),this.date(Y.getUTCDate()),this}ce("Q",0,"Qo","quarter"),fe("Q",up),it("Q",function(d,y){y[Dn]=(Fe(d)-1)*3});function Kv(d){return d==null?Math.ceil((this.month()+1)/3):this.month((d-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),fe("D",pt,Ui),fe("DD",pt,zt),fe("Do",function(d,y){return d?y._dayOfMonthOrdinalParse||y._ordinalParse:y._dayOfMonthOrdinalParseLenient}),it(["D","DD"],mn),it("Do",function(d,y){y[mn]=Fe(d.match(pt)[0])});var zp=Is("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),fe("DDD",Cs),fe("DDDD",cp),it(["DDD","DDDD"],function(d,y,S){S._dayOfYear=Fe(d)});function Qv(d){var y=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return d==null?y:this.add(d-y,"d")}ce("m",["mm",2],0,"minute"),fe("m",pt,rl),fe("mm",pt,zt),it(["m","mm"],Nr);var Bn=Is("Minutes",!1);ce("s",["ss",2],0,"second"),fe("s",pt,rl),fe("ss",pt,zt),it(["s","ss"],Ln);var Zv=Is("Seconds",!1);ce("S",0,0,function(){return~~(this.millisecond()/100)}),ce(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ce(0,["SSS",3],0,"millisecond"),ce(0,["SSSS",4],0,function(){return this.millisecond()*10}),ce(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ce(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ce(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ce(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ce(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),fe("S",Cs,up),fe("SS",Cs,zt),fe("SSS",Cs,cp);var Ri,Jp;for(Ri="SSSS";Ri.length<=9;Ri+="S")fe(Ri,yi);function Xv(d,y){y[Hi]=Fe(("0."+d)*1e3)}for(Ri="S";Ri.length<=9;Ri+="S")it(Ri,Xv);Jp=Is("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function eb(){return this._isUTC?"UTC":""}function Gi(){return this._isUTC?"Coordinated Universal Time":""}var re=j.prototype;re.add=Iv,re.calendar=Ov,re.clone=kv,re.diff=Lp,re.endOf=Bp,re.format=zi,re.from=xl,re.fromNow=Tv,re.to=Av,re.toNow=$v,re.get=Ly,re.invalidAt=Ms,re.isAfter=Pv,re.isBefore=wl,re.isBetween=_i,re.isSame=_l,re.isSameOrAfter=Dp,re.isSameOrBefore=Rl,re.isValid=Yo,re.lang=zo,re.locale=Wo,re.localeData=El,re.max=Ap,re.min=Tp,re.parsingFlags=Ol,re.set=sl,re.startOf=Nv,re.subtract=$s,re.toArray=Ic,re.toObject=Ns,re.toDate=Jo,re.toISOString=jp,re.inspect=Vo,typeof Symbol<"u"&&Symbol.for!=null&&(re[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),re.toJSON=Go,re.toString=Cl,re.unix=Ec,re.valueOf=Mv,re.creationData=Fv,re.eraName=Uv,re.eraNarrow=kl,re.eraAbbr=Ko,re.eraYear=Vp,re.year=dp,re.isLeapYear=Dy,re.weekYear=Vv,re.isoWeekYear=Wv,re.quarter=re.quarters=Kv,re.month=ol,re.daysInMonth=Wy,re.week=re.weeks=vp,re.isoWeek=re.isoWeeks=Jy,re.weeksInYear=Gv,re.weeksInWeekYear=Hn,re.isoWeeksInYear=zv,re.isoWeeksInISOWeekYear=Jv,re.date=zp,re.day=re.days=tv,re.weekday=rv,re.isoWeekday=nv,re.dayOfYear=Qv,re.hour=re.hours=av,re.minute=re.minutes=Bn,re.second=re.seconds=Zv,re.millisecond=re.milliseconds=Jp,re.utcOffset=Mp,re.utc=_v,re.local=Rv,re.parseZone=Cv,re.hasAlignedHourOffset=xv,re.isDST=wi,re.isLocal=Q,re.isUtcOffset=z,re.isUtc=ue,re.isUTC=ue,re.zoneAbbr=eb,re.zoneName=Gi,re.dates=C("dates accessor is deprecated. Use date instead.",zp),re.months=C("months accessor is deprecated. Use month instead",ol),re.years=C("years accessor is deprecated. Use year instead",dp),re.zone=C("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",wv),re.isDSTShifted=C("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",V);function tb(d){return lt(d*1e3)}function en(){return lt.apply(null,arguments).parseZone()}function Gp(d){return d}var Ye=ee.prototype;Ye.calendar=ke,Ye.longDateFormat=_t,Ye.invalidDate=pn,Ye.ordinal=Io,Ye.preparse=Gp,Ye.postformat=Gp,Ye.relativeTime=Mn,Ye.pastFuture=ap,Ye.set=F,Ye.eras=Dv,Ye.erasParse=Lv,Ye.erasConvertYear=jv,Ye.erasAbbrRegex=Fs,Ye.erasNameRegex=q,Ye.erasNarrowRegex=Pl,Ye.months=By,Ye.monthsShort=Vy,Ye.monthsParse=mp,Ye.monthsRegex=al,Ye.monthsShortRegex=gp,Ye.week=pc,Ye.firstDayOfYear=yp,Ye.firstDayOfWeek=Os,Ye.weekdays=Qy,Ye.weekdaysMin=Xy,Ye.weekdaysShort=Zy,Ye.weekdaysParse=ev,Ye.weekdaysRegex=iv,Ye.weekdaysShortRegex=bt,Ye.weekdaysMinRegex=gt,Ye.isPM=ov,Ye.meridiem=Ut;function Tl(d,y,S,R){var I=Un(),L=g().set(R,y);return I[S](L,d)}function Yp(d,y,S){if(f(d)&&(y=d,d=void 0),d=d||"",y!=null)return Tl(d,y,S,"month");var R,I=[];for(R=0;R<12;R++)I[R]=Tl(d,R,S,"month");return I}function Oc(d,y,S,R){typeof d=="boolean"?(f(y)&&(S=y,y=void 0),y=y||""):(y=d,S=y,d=!1,f(y)&&(S=y,y=void 0),y=y||"");var I=Un(),L=d?I._week.dow:0,Y,ae=[];if(S!=null)return Tl(y,(S+L)%7,R,"day");for(Y=0;Y<7;Y++)ae[Y]=Tl(y,(Y+L)%7,R,"day");return ae}function Kp(d,y){return Yp(d,y,"months")}function Qp(d,y){return Yp(d,y,"monthsShort")}function rb(d,y,S){return Oc(d,y,S,"weekdays")}function nb(d,y,S){return Oc(d,y,S,"weekdaysShort")}function kc(d,y,S){return Oc(d,y,S,"weekdaysMin")}jn("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(d){var y=d%10,S=Fe(d%100/10)===1?"th":y===1?"st":y===2?"nd":y===3?"rd":"th";return d+S}}),e.lang=C("moment.lang is deprecated. Use moment.locale instead.",jn),e.langData=C("moment.langData is deprecated. Use moment.localeData instead.",Un);var Er=Math.abs;function Al(){var d=this._data;return this._milliseconds=Er(this._milliseconds),this._days=Er(this._days),this._months=Er(this._months),d.milliseconds=Er(d.milliseconds),d.seconds=Er(d.seconds),d.minutes=Er(d.minutes),d.hours=Er(d.hours),d.months=Er(d.months),d.years=Er(d.years),this}function Zp(d,y,S,R){var I=ut(y,S);return d._milliseconds+=R*I._milliseconds,d._days+=R*I._days,d._months+=R*I._months,d._bubble()}function Xp(d,y){return Zp(this,d,y,1)}function ib(d,y){return Zp(this,d,y,-1)}function tn(d){return d<0?Math.floor(d):Math.ceil(d)}function Pc(){var d=this._milliseconds,y=this._days,S=this._months,R=this._data,I,L,Y,ae,_e;return d>=0&&y>=0&&S>=0||d<=0&&y<=0&&S<=0||(d+=tn(cr(S)+y)*864e5,y=0,S=0),R.milliseconds=d%1e3,I=$r(d/1e3),R.seconds=I%60,L=$r(I/60),R.minutes=L%60,Y=$r(L/60),R.hours=Y%24,y+=$r(Y/24),_e=$r(Ci(y)),S+=_e,y-=tn(cr(_e)),ae=$r(S/12),S%=12,R.days=y,R.months=S,R.years=ae,this}function Ci(d){return d*4800/146097}function cr(d){return d*146097/4800}function sb(d){if(!this.isValid())return NaN;var y,S,R=this._milliseconds;if(d=Xt(d),d==="month"||d==="quarter"||d==="year")switch(y=this._days+R/864e5,S=this._months+Ci(y),d){case"month":return S;case"quarter":return S/3;case"year":return S/12}else switch(y=this._days+Math.round(cr(this._months)),d){case"week":return y/7+R/6048e5;case"day":return y+R/864e5;case"hour":return y*24+R/36e5;case"minute":return y*1440+R/6e4;case"second":return y*86400+R/1e3;case"millisecond":return Math.floor(y*864e5)+R;default:throw new Error("Unknown unit "+d)}}function bn(d){return function(){return this.as(d)}}var Tc=bn("ms"),Qo=bn("s"),xi=bn("m"),eh=bn("h"),ob=bn("d"),$l=bn("w"),ab=bn("M"),th=bn("Q"),Gt=bn("y"),Ac=Tc;function rh(){return ut(this)}function Sn(d){return d=Xt(d),this.isValid()?this[d+"s"]():NaN}function Vn(d){return function(){return this.isValid()?this._data[d]:NaN}}var Nl=Vn("milliseconds"),Yi=Vn("seconds"),nh=Vn("minutes"),nr=Vn("hours"),$c=Vn("days"),lb=Vn("months"),ub=Vn("years");function cb(){return $r(this.days()/7)}var rn=Math.round,Ds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Zo(d,y,S,R,I){return I.relativeTime(y||1,!!S,d,R)}function ih(d,y,S,R){var I=ut(d).abs(),L=rn(I.as("s")),Y=rn(I.as("m")),ae=rn(I.as("h")),_e=rn(I.as("d")),Le=rn(I.as("M")),Ht=rn(I.as("w")),Wn=rn(I.as("y")),zn=L<=S.ss&&["s",L]||L<S.s&&["ss",L]||Y<=1&&["m"]||Y<S.m&&["mm",Y]||ae<=1&&["h"]||ae<S.h&&["hh",ae]||_e<=1&&["d"]||_e<S.d&&["dd",_e];return S.w!=null&&(zn=zn||Ht<=1&&["w"]||Ht<S.w&&["ww",Ht]),zn=zn||Le<=1&&["M"]||Le<S.M&&["MM",Le]||Wn<=1&&["y"]||["yy",Wn],zn[2]=y,zn[3]=+d>0,zn[4]=R,Zo.apply(null,zn)}function fb(d){return d===void 0?rn:typeof d=="function"?(rn=d,!0):!1}function db(d,y){return Ds[d]===void 0?!1:y===void 0?Ds[d]:(Ds[d]=y,d==="s"&&(Ds.ss=y-1),!0)}function Xo(d,y){if(!this.isValid())return this.localeData().invalidDate();var S=!1,R=Ds,I,L;return typeof d=="object"&&(y=d,d=!1),typeof d=="boolean"&&(S=d),typeof y=="object"&&(R=Object.assign({},Ds,y),y.s!=null&&y.ss==null&&(R.ss=y.s-1)),I=this.localeData(),L=ih(this,!S,R,I),S&&(L=I.pastFuture(+this,L)),I.postformat(L)}var Nc=Math.abs;function Ls(d){return(d>0)-(d<0)||+d}function js(){if(!this.isValid())return this.localeData().invalidDate();var d=Nc(this._milliseconds)/1e3,y=Nc(this._days),S=Nc(this._months),R,I,L,Y,ae=this.asSeconds(),_e,Le,Ht,Wn;return ae?(R=$r(d/60),I=$r(R/60),d%=60,R%=60,L=$r(S/12),S%=12,Y=d?d.toFixed(3).replace(/\.?0+$/,""):"",_e=ae<0?"-":"",Le=Ls(this._months)!==Ls(ae)?"-":"",Ht=Ls(this._days)!==Ls(ae)?"-":"",Wn=Ls(this._milliseconds)!==Ls(ae)?"-":"",_e+"P"+(L?Le+L+"Y":"")+(S?Le+S+"M":"")+(y?Ht+y+"D":"")+(I||R||d?"T":"")+(I?Wn+I+"H":"")+(R?Wn+R+"M":"")+(d?Wn+Y+"S":"")):"P0D"}var He=As.prototype;He.isValid=vv,He.abs=Al,He.add=Xp,He.subtract=ib,He.as=sb,He.asMilliseconds=Tc,He.asSeconds=Qo,He.asMinutes=xi,He.asHours=eh,He.asDays=ob,He.asWeeks=$l,He.asMonths=ab,He.asQuarters=th,He.asYears=Gt,He.valueOf=Ac,He._bubble=Pc,He.clone=rh,He.get=Sn,He.milliseconds=Nl,He.seconds=Yi,He.minutes=nh,He.hours=nr,He.days=$c,He.weeks=cb,He.months=lb,He.years=ub,He.humanize=Xo,He.toISOString=js,He.toString=js,He.toJSON=js,He.locale=Wo,He.localeData=El,He.toIsoString=C("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",js),He.lang=zo,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),fe("x",Es),fe("X",$y),it("X",function(d,y,S){S._d=new Date(parseFloat(d)*1e3)}),it("x",function(d,y,S){S._d=new Date(Fe(d))});return e.version="2.30.1",r(lt),e.fn=re,e.min=mv,e.max=gv,e.now=yv,e.utc=g,e.unix=tb,e.months=Kp,e.isDate=c,e.locale=jn,e.invalid=k,e.duration=ut,e.isMoment=G,e.weekdays=rb,e.parseZone=en,e.localeData=Un,e.isDuration=jo,e.monthsShort=Qp,e.weekdaysMin=kc,e.defineLocale=fl,e.updateLocale=wr,e.locales=_r,e.weekdaysShort=nb,e.normalizeUnits=Xt,e.relativeTimeRounding=fb,e.relativeTimeThreshold=db,e.calendarFormat=Sl,e.prototype=re,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 SI=H((bI,Mh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Mh<"u"&&Mh.exports?Mh.exports=e():t.tv4=e()})(bI,function(){Object.keys||(Object.keys=(function(){var O=Object.prototype.hasOwnProperty,C=!{toString:null}.propertyIsEnumerable("toString"),A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],D=A.length;return function(B){if(typeof B!="object"&&typeof B!="function"||B===null)throw new TypeError("Object.keys called on non-object");var F=[];for(var K in B)O.call(B,K)&&F.push(K);if(C)for(var ee=0;ee<D;ee++)O.call(B,A[ee])&&F.push(A[ee]);return F}})()),Object.create||(Object.create=(function(){function O(){}return function(C){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return O.prototype=C,new O}})()),Array.isArray||(Array.isArray=function(O){return Object.prototype.toString.call(O)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(O){if(this===null)throw new TypeError;var C=Object(this),A=C.length>>>0;if(A===0)return-1;var D=0;if(arguments.length>1&&(D=Number(arguments[1]),D!==D?D=0:D!==0&&D!==1/0&&D!==-1/0&&(D=(D>0||-1)*Math.floor(Math.abs(D)))),D>=A)return-1;for(var B=D>=0?D:Math.max(A-Math.abs(D),0);B<A;B++)if(B in C&&C[B]===O)return B;return-1}),Object.isFrozen||(Object.isFrozen=function(O){for(var C="tv4_test_frozen_key";O.hasOwnProperty(C);)C+=Math.random();try{return O[C]=!0,delete O[C],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(O){return encodeURI(O).replace(/%25[0-9][0-9]/g,function(C){return"%"+C.substring(3)})}function n(O){var C="";t[O.charAt(0)]&&(C=O.charAt(0),O=O.substring(1));var A="",D="",B=!0,F=!1,K=!1;C==="+"?B=!1:C==="."?(D=".",A="."):C==="/"?(D="/",A="/"):C==="#"?(D="#",B=!1):C===";"?(D=";",A=";",F=!0,K=!0):C==="?"?(D="?",A="&",F=!0):C==="&"&&(D="&",A="&",F=!0);for(var ee=[],ie=O.split(","),pe=[],ke={},de=0;de<ie.length;de++){var le=ie[de],ve=null;if(le.indexOf(":")!==-1){var We=le.split(":");le=We[0],ve=parseInt(We[1],10)}for(var mt={};e[le.charAt(le.length-1)];)mt[le.charAt(le.length-1)]=!0,le=le.substring(0,le.length-1);var ce={truncate:ve,name:le,suffices:mt};pe.push(ce),ke[le]=ce,ee.push(le)}var rr=function($e){for(var nt="",Xr=0,Ar=0;Ar<pe.length;Ar++){var _t=pe[Ar],Rt=$e(_t.name);if(Rt==null||Array.isArray(Rt)&&Rt.length===0||typeof Rt=="object"&&Object.keys(Rt).length===0){Xr++;continue}if(Ar===Xr?nt+=D:nt+=A||",",Array.isArray(Rt)){F&&(nt+=_t.name+"=");for(var pn=0;pn<Rt.length;pn++)pn>0&&(nt+=_t.suffices["*"]&&A||",",_t.suffices["*"]&&F&&(nt+=_t.name+"=")),nt+=B?encodeURIComponent(Rt[pn]).replace(/!/g,"%21"):r(Rt[pn])}else if(typeof Rt=="object"){F&&!_t.suffices["*"]&&(nt+=_t.name+"=");var Eo=!0;for(var Zt in Rt)Eo||(nt+=_t.suffices["*"]&&A||","),Eo=!1,nt+=B?encodeURIComponent(Zt).replace(/!/g,"%21"):r(Zt),nt+=_t.suffices["*"]?"=":",",nt+=B?encodeURIComponent(Rt[Zt]).replace(/!/g,"%21"):r(Rt[Zt])}else F&&(nt+=_t.name,(!K||Rt!=="")&&(nt+="=")),_t.truncate!=null&&(Rt=Rt.substring(0,_t.truncate)),nt+=B?encodeURIComponent(Rt).replace(/!/g,"%21"):r(Rt)}return nt};return rr.varNames=ee,{prefix:D,substitution:rr}}function i(O){if(!(this instanceof i))return new i(O);for(var C=O.split("{"),A=[C.shift()],D=[],B=[],F=[];C.length>0;){var K=C.shift(),ee=K.split("}")[0],ie=K.substring(ee.length+1),pe=n(ee);B.push(pe.substitution),D.push(pe.prefix),A.push(ie),F=F.concat(pe.substitution.varNames)}this.fill=function(ke){for(var de=A[0],le=0;le<B.length;le++){var ve=B[le];de+=ve(ke),de+=A[le+1]}return de},this.varNames=F,this.template=O}i.prototype={toString:function(){return this.template},fillFromObject:function(O){return this.fill(function(C){return O[C]})}};var s=function(C,A,D,B,F){if(this.missing=[],this.missingMap={},this.formatValidators=C?Object.create(C.formatValidators):{},this.schemas=C?Object.create(C.schemas):{},this.collectMultiple=A,this.errors=[],this.handleError=A?this.collectError:this.returnError,B&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),F&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=D||v("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},C)for(var K in C.definedKeywords)this.definedKeywords[K]=C.definedKeywords[K].slice(0)};s.prototype.defineKeyword=function(O,C){this.definedKeywords[O]=this.definedKeywords[O]||[],this.definedKeywords[O].push(C)},s.prototype.createError=function(O,C,A,D,B,F,K){var ee=new T(O,C,A,D,B);return ee.message=this.errorReporter(ee,F,K),ee},s.prototype.returnError=function(O){return O},s.prototype.collectError=function(O){return O&&this.errors.push(O),null},s.prototype.prefixErrors=function(O,C,A){for(var D=O;D<this.errors.length;D++)this.errors[D]=this.errors[D].prefixWith(C,A);return this},s.prototype.banUnknownProperties=function(O,C){for(var A in this.unknownPropertyPaths){var D=this.createError(_.UNKNOWN_PROPERTY,{path:A},A,"",null,O,C),B=this.handleError(D);if(B)return B}return null},s.prototype.addFormat=function(O,C){if(typeof O=="object"){for(var A in O)this.addFormat(A,O[A]);return this}this.formatValidators[O]=C},s.prototype.resolveRefs=function(O,C){if(O.$ref!==void 0){if(C=C||{},C[O.$ref])return this.createError(_.CIRCULAR_REFERENCE,{urls:Object.keys(C).join(", ")},"","",null,void 0,O);C[O.$ref]=!0,O=this.getSchema(O.$ref,C)}return O},s.prototype.getSchema=function(O,C){var A;if(this.schemas[O]!==void 0)return A=this.schemas[O],this.resolveRefs(A,C);var D=O,B="";if(O.indexOf("#")!==-1&&(B=O.substring(O.indexOf("#")+1),D=O.substring(0,O.indexOf("#"))),typeof this.schemas[D]=="object"){A=this.schemas[D];var F=decodeURIComponent(B);if(F==="")return this.resolveRefs(A,C);if(F.charAt(0)!=="/")return;for(var K=F.split("/").slice(1),ee=0;ee<K.length;ee++){var ie=K[ee].replace(/~1/g,"/").replace(/~0/g,"~");if(A[ie]===void 0){A=void 0;break}A=A[ie]}if(A!==void 0)return this.resolveRefs(A,C)}this.missing[D]===void 0&&(this.missing.push(D),this.missing[D]=D,this.missingMap[D]=D)},s.prototype.searchSchemas=function(O,C){if(Array.isArray(O))for(var A=0;A<O.length;A++)this.searchSchemas(O[A],C);else if(O&&typeof O=="object"){typeof O.id=="string"&&N(C,O.id)&&this.schemas[O.id]===void 0&&(this.schemas[O.id]=O);for(var D in O)if(D!=="enum"){if(typeof O[D]=="object")this.searchSchemas(O[D],C);else if(D==="$ref"){var B=h(O[D]);B&&this.schemas[B]===void 0&&this.missingMap[B]===void 0&&(this.missingMap[B]=B)}}}},s.prototype.addSchema=function(O,C){if(typeof O!="string"||typeof C>"u")if(typeof O=="object"&&typeof O.id=="string")C=O,O=C.id;else return;O===h(O)+"#"&&(O=h(O)),this.schemas[O]=C,delete this.missingMap[O],g(C,O),this.searchSchemas(C,O)},s.prototype.getSchemaMap=function(){var O={};for(var C in this.schemas)O[C]=this.schemas[C];return O},s.prototype.getSchemaUris=function(O){var C=[];for(var A in this.schemas)(!O||O.test(A))&&C.push(A);return C},s.prototype.getMissingUris=function(O){var C=[];for(var A in this.missingMap)(!O||O.test(A))&&C.push(A);return C},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(O,C,A,D,B){var F;if(C=this.resolveRefs(C),C){if(C instanceof T)return this.errors.push(C),C}else return null;var K=this.errors.length,ee,ie=null,pe=null;if(this.checkRecursive&&O&&typeof O=="object"){if(F=!this.scanned.length,O[this.validatedSchemasKey]){var ke=O[this.validatedSchemasKey].indexOf(C);if(ke!==-1)return this.errors=this.errors.concat(O[this.validationErrorsKey][ke]),null}if(Object.isFrozen(O)&&(ee=this.scannedFrozen.indexOf(O),ee!==-1)){var de=this.scannedFrozenSchemas[ee].indexOf(C);if(de!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[ee][de]),null}if(this.scanned.push(O),Object.isFrozen(O))ee===-1&&(ee=this.scannedFrozen.length,this.scannedFrozen.push(O),this.scannedFrozenSchemas.push([])),ie=this.scannedFrozenSchemas[ee].length,this.scannedFrozenSchemas[ee][ie]=C,this.scannedFrozenValidationErrors[ee][ie]=[];else{if(!O[this.validatedSchemasKey])try{Object.defineProperty(O,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(O,this.validationErrorsKey,{value:[],configurable:!0})}catch{O[this.validatedSchemasKey]=[],O[this.validationErrorsKey]=[]}pe=O[this.validatedSchemasKey].length,O[this.validatedSchemasKey][pe]=C,O[this.validationErrorsKey][pe]=[]}}var le=this.errors.length,ve=this.validateBasic(O,C,B)||this.validateNumeric(O,C,B)||this.validateString(O,C,B)||this.validateArray(O,C,B)||this.validateObject(O,C,B)||this.validateCombinations(O,C,B)||this.validateHypermedia(O,C,B)||this.validateFormat(O,C,B)||this.validateDefinedKeywords(O,C,B)||null;if(F){for(;this.scanned.length;){var We=this.scanned.pop();delete We[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(ve||le!==this.errors.length)for(;A&&A.length||D&&D.length;){var mt=A&&A.length?""+A.pop():null,ce=D&&D.length?""+D.pop():null;ve&&(ve=ve.prefixWith(mt,ce)),this.prefixErrors(le,mt,ce)}return ie!==null?this.scannedFrozenValidationErrors[ee][ie]=this.errors.slice(K):pe!==null&&(O[this.validationErrorsKey][pe]=this.errors.slice(K)),this.handleError(ve)},s.prototype.validateFormat=function(O,C){if(typeof C.format!="string"||!this.formatValidators[C.format])return null;var A=this.formatValidators[C.format].call(null,O,C);return typeof A=="string"||typeof A=="number"?this.createError(_.FORMAT_CUSTOM,{message:A},"","/format",null,O,C):A&&typeof A=="object"?this.createError(_.FORMAT_CUSTOM,{message:A.message||"?"},A.dataPath||"",A.schemaPath||"/format",null,O,C):null},s.prototype.validateDefinedKeywords=function(O,C,A){for(var D in this.definedKeywords)if(!(typeof C[D]>"u"))for(var B=this.definedKeywords[D],F=0;F<B.length;F++){var K=B[F],ee=K(O,C[D],C,A);if(typeof ee=="string"||typeof ee=="number")return this.createError(_.KEYWORD_CUSTOM,{key:D,message:ee},"","",null,O,C).prefixWith(null,D);if(ee&&typeof ee=="object"){var ie=ee.code;if(typeof ie=="string"){if(!_[ie])throw new Error("Undefined error code (use defineError): "+ie);ie=_[ie]}else typeof ie!="number"&&(ie=_.KEYWORD_CUSTOM);var pe=typeof ee.message=="object"?ee.message:{key:D,message:ee.message||"?"},ke=ee.schemaPath||"/"+D.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ie,pe,ee.dataPath||null,ke,null,O,C)}}return null};function o(O,C){if(O===C)return!0;if(O&&C&&typeof O=="object"&&typeof C=="object"){if(Array.isArray(O)!==Array.isArray(C))return!1;if(Array.isArray(O)){if(O.length!==C.length)return!1;for(var A=0;A<O.length;A++)if(!o(O[A],C[A]))return!1}else{var D;for(D in O)if(C[D]===void 0&&O[D]!==void 0)return!1;for(D in C)if(O[D]===void 0&&C[D]!==void 0)return!1;for(D in O)if(!o(O[D],C[D]))return!1}return!0}return!1}s.prototype.validateBasic=function(C,A,D){var B;return(B=this.validateType(C,A,D))||(B=this.validateEnum(C,A,D))?B.prefixWith(null,"type"):null},s.prototype.validateType=function(C,A){if(A.type===void 0)return null;var D=typeof C;C===null?D="null":Array.isArray(C)&&(D="array");var B=A.type;Array.isArray(B)||(B=[B]);for(var F=0;F<B.length;F++){var K=B[F];if(K===D||K==="integer"&&D==="number"&&C%1===0)return null}return this.createError(_.INVALID_TYPE,{type:D,expected:B.join("/")},"","",null,C,A)},s.prototype.validateEnum=function(C,A){if(A.enum===void 0)return null;for(var D=0;D<A.enum.length;D++){var B=A.enum[D];if(o(C,B))return null}return this.createError(_.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(C):C},"","",null,C,A)},s.prototype.validateNumeric=function(C,A,D){return this.validateMultipleOf(C,A,D)||this.validateMinMax(C,A,D)||this.validateNaN(C,A,D)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(C,A){var D=A.multipleOf||A.divisibleBy;if(D===void 0)return null;if(typeof C=="number"){var B=C/D%1;if(B>=l&&B<f)return this.createError(_.NUMBER_MULTIPLE_OF,{value:C,multipleOf:D},"","",null,C,A)}return null},s.prototype.validateMinMax=function(C,A){if(typeof C!="number")return null;if(A.minimum!==void 0){if(C<A.minimum)return this.createError(_.NUMBER_MINIMUM,{value:C,minimum:A.minimum},"","/minimum",null,C,A);if(A.exclusiveMinimum&&C===A.minimum)return this.createError(_.NUMBER_MINIMUM_EXCLUSIVE,{value:C,minimum:A.minimum},"","/exclusiveMinimum",null,C,A)}if(A.maximum!==void 0){if(C>A.maximum)return this.createError(_.NUMBER_MAXIMUM,{value:C,maximum:A.maximum},"","/maximum",null,C,A);if(A.exclusiveMaximum&&C===A.maximum)return this.createError(_.NUMBER_MAXIMUM_EXCLUSIVE,{value:C,maximum:A.maximum},"","/exclusiveMaximum",null,C,A)}return null},s.prototype.validateNaN=function(C,A){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,A):null},s.prototype.validateString=function(C,A,D){return this.validateStringLength(C,A,D)||this.validateStringPattern(C,A,D)||null},s.prototype.validateStringLength=function(C,A){return typeof C!="string"?null:A.minLength!==void 0&&C.length<A.minLength?this.createError(_.STRING_LENGTH_SHORT,{length:C.length,minimum:A.minLength},"","/minLength",null,C,A):A.maxLength!==void 0&&C.length>A.maxLength?this.createError(_.STRING_LENGTH_LONG,{length:C.length,maximum:A.maxLength},"","/maxLength",null,C,A):null},s.prototype.validateStringPattern=function(C,A){if(typeof C!="string"||typeof A.pattern!="string"&&!(A.pattern instanceof RegExp))return null;var D;if(A.pattern instanceof RegExp)D=A.pattern;else{var B,F="",K=A.pattern.match(/^\/(.+)\/([img]*)$/);K?(B=K[1],F=K[2]):B=A.pattern,D=new RegExp(B,F)}return D.test(C)?null:this.createError(_.STRING_PATTERN,{pattern:A.pattern},"","/pattern",null,C,A)},s.prototype.validateArray=function(C,A,D){return Array.isArray(C)&&(this.validateArrayLength(C,A,D)||this.validateArrayUniqueItems(C,A,D)||this.validateArrayItems(C,A,D))||null},s.prototype.validateArrayLength=function(C,A){var D;return A.minItems!==void 0&&C.length<A.minItems&&(D=this.createError(_.ARRAY_LENGTH_SHORT,{length:C.length,minimum:A.minItems},"","/minItems",null,C,A),this.handleError(D))||A.maxItems!==void 0&&C.length>A.maxItems&&(D=this.createError(_.ARRAY_LENGTH_LONG,{length:C.length,maximum:A.maxItems},"","/maxItems",null,C,A),this.handleError(D))?D:null},s.prototype.validateArrayUniqueItems=function(C,A){if(A.uniqueItems){for(var D=0;D<C.length;D++)for(var B=D+1;B<C.length;B++)if(o(C[D],C[B])){var F=this.createError(_.ARRAY_UNIQUE,{match1:D,match2:B},"","/uniqueItems",null,C,A);if(this.handleError(F))return F}}return null},s.prototype.validateArrayItems=function(C,A,D){if(A.items===void 0)return null;var B,F;if(Array.isArray(A.items)){for(F=0;F<C.length;F++)if(F<A.items.length){if(B=this.validateAll(C[F],A.items[F],[F],["items",F],D+"/"+F))return B}else if(A.additionalItems!==void 0){if(typeof A.additionalItems=="boolean"){if(!A.additionalItems&&(B=this.createError(_.ARRAY_ADDITIONAL_ITEMS,{},"/"+F,"/additionalItems",null,C,A),this.handleError(B)))return B}else if(B=this.validateAll(C[F],A.additionalItems,[F],["additionalItems"],D+"/"+F))return B}}else for(F=0;F<C.length;F++)if(B=this.validateAll(C[F],A.items,[F],["items"],D+"/"+F))return B;return null},s.prototype.validateObject=function(C,A,D){return typeof C!="object"||C===null||Array.isArray(C)?null:this.validateObjectMinMaxProperties(C,A,D)||this.validateObjectRequiredProperties(C,A,D)||this.validateObjectProperties(C,A,D)||this.validateObjectDependencies(C,A,D)||null},s.prototype.validateObjectMinMaxProperties=function(C,A){var D=Object.keys(C),B;return A.minProperties!==void 0&&D.length<A.minProperties&&(B=this.createError(_.OBJECT_PROPERTIES_MINIMUM,{propertyCount:D.length,minimum:A.minProperties},"","/minProperties",null,C,A),this.handleError(B))||A.maxProperties!==void 0&&D.length>A.maxProperties&&(B=this.createError(_.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:D.length,maximum:A.maxProperties},"","/maxProperties",null,C,A),this.handleError(B))?B:null},s.prototype.validateObjectRequiredProperties=function(C,A){if(A.required!==void 0)for(var D=0;D<A.required.length;D++){var B=A.required[D];if(C[B]===void 0){var F=this.createError(_.OBJECT_REQUIRED,{key:B},"","/required/"+D,null,C,A);if(this.handleError(F))return F}}return null},s.prototype.validateObjectProperties=function(C,A,D){var B;for(var F in C){var K=D+"/"+F.replace(/~/g,"~0").replace(/\//g,"~1"),ee=!1;if(A.properties!==void 0&&A.properties[F]!==void 0&&(ee=!0,B=this.validateAll(C[F],A.properties[F],[F],["properties",F],K)))return B;if(A.patternProperties!==void 0)for(var ie in A.patternProperties){var pe=new RegExp(ie);if(pe.test(F)&&(ee=!0,B=this.validateAll(C[F],A.patternProperties[ie],[F],["patternProperties",ie],K)))return B}if(ee)this.trackUnknownProperties&&(this.knownPropertyPaths[K]=!0,delete this.unknownPropertyPaths[K]);else if(A.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[K]=!0,delete this.unknownPropertyPaths[K]),typeof A.additionalProperties=="boolean"){if(!A.additionalProperties&&(B=this.createError(_.OBJECT_ADDITIONAL_PROPERTIES,{key:F},"","/additionalProperties",null,C,A).prefixWith(F,null),this.handleError(B)))return B}else if(B=this.validateAll(C[F],A.additionalProperties,[F],["additionalProperties"],K))return B}else this.trackUnknownProperties&&!this.knownPropertyPaths[K]&&(this.unknownPropertyPaths[K]=!0)}return null},s.prototype.validateObjectDependencies=function(C,A,D){var B;if(A.dependencies!==void 0){for(var F in A.dependencies)if(C[F]!==void 0){var K=A.dependencies[F];if(typeof K=="string"){if(C[K]===void 0&&(B=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:F,missing:K},"","",null,C,A).prefixWith(null,F).prefixWith(null,"dependencies"),this.handleError(B)))return B}else if(Array.isArray(K))for(var ee=0;ee<K.length;ee++){var ie=K[ee];if(C[ie]===void 0&&(B=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:F,missing:ie},"","/"+ee,null,C,A).prefixWith(null,F).prefixWith(null,"dependencies"),this.handleError(B)))return B}else if(B=this.validateAll(C,K,[],["dependencies",F],D))return B}}return null},s.prototype.validateCombinations=function(C,A,D){return this.validateAllOf(C,A,D)||this.validateAnyOf(C,A,D)||this.validateOneOf(C,A,D)||this.validateNot(C,A,D)||null},s.prototype.validateAllOf=function(C,A,D){if(A.allOf===void 0)return null;for(var B,F=0;F<A.allOf.length;F++){var K=A.allOf[F];if(B=this.validateAll(C,K,[],["allOf",F],D))return B}return null},s.prototype.validateAnyOf=function(C,A,D){if(A.anyOf===void 0)return null;var B=[],F=this.errors.length,K,ee;this.trackUnknownProperties&&(K=this.unknownPropertyPaths,ee=this.knownPropertyPaths);for(var ie=!0,pe=0;pe<A.anyOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var ke=A.anyOf[pe],de=this.errors.length,le=this.validateAll(C,ke,[],["anyOf",pe],D);if(le===null&&de===this.errors.length){if(this.errors=this.errors.slice(0,F),this.trackUnknownProperties){for(var ve in this.knownPropertyPaths)ee[ve]=!0,delete K[ve];for(var We in this.unknownPropertyPaths)ee[We]||(K[We]=!0);ie=!1;continue}return null}le&&B.push(le.prefixWith(null,""+pe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=K,this.knownPropertyPaths=ee),ie)return B=B.concat(this.errors.slice(F)),this.errors=this.errors.slice(0,F),this.createError(_.ANY_OF_MISSING,{},"","/anyOf",B,C,A)},s.prototype.validateOneOf=function(C,A,D){if(A.oneOf===void 0)return null;var B=null,F=[],K=this.errors.length,ee,ie;this.trackUnknownProperties&&(ee=this.unknownPropertyPaths,ie=this.knownPropertyPaths);for(var pe=0;pe<A.oneOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var ke=A.oneOf[pe],de=this.errors.length,le=this.validateAll(C,ke,[],["oneOf",pe],D);if(le===null&&de===this.errors.length){if(B===null)B=pe;else return this.errors=this.errors.slice(0,K),this.createError(_.ONE_OF_MULTIPLE,{index1:B,index2:pe},"","/oneOf",null,C,A);if(this.trackUnknownProperties){for(var ve in this.knownPropertyPaths)ie[ve]=!0,delete ee[ve];for(var We in this.unknownPropertyPaths)ie[We]||(ee[We]=!0)}}else le&&F.push(le)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=ee,this.knownPropertyPaths=ie),B===null?(F=F.concat(this.errors.slice(K)),this.errors=this.errors.slice(0,K),this.createError(_.ONE_OF_MISSING,{},"","/oneOf",F,C,A)):(this.errors=this.errors.slice(0,K),null)},s.prototype.validateNot=function(C,A,D){if(A.not===void 0)return null;var B=this.errors.length,F,K;this.trackUnknownProperties&&(F=this.unknownPropertyPaths,K=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var ee=this.validateAll(C,A.not,null,null,D),ie=this.errors.slice(B);return this.errors=this.errors.slice(0,B),this.trackUnknownProperties&&(this.unknownPropertyPaths=F,this.knownPropertyPaths=K),ee===null&&ie.length===0?this.createError(_.NOT_PASSED,{},"","/not",null,C,A):null},s.prototype.validateHypermedia=function(C,A,D){if(!A.links)return null;for(var B,F=0;F<A.links.length;F++){var K=A.links[F];if(K.rel==="describedby"){for(var ee=new i(K.href),ie=!0,pe=0;pe<ee.varNames.length;pe++)if(!(ee.varNames[pe]in C)){ie=!1;break}if(ie){var ke=ee.fillFromObject(C),de={$ref:ke};if(B=this.validateAll(C,de,[],["links",F],D))return B}}}};function c(O){var C=String(O).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 p(O,C){function A(D){var B=[];return D.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(F){F==="/.."?B.pop():B.push(F)}),B.join("").replace(/^\//,D.charAt(0)==="/"?"/":"")}return C=c(C||""),O=c(O||""),!C||!O?null:(C.protocol||O.protocol)+(C.protocol||C.authority?C.authority:O.authority)+A(C.protocol||C.authority||C.pathname.charAt(0)==="/"?C.pathname:C.pathname?(O.authority&&!O.pathname?"/":"")+O.pathname.slice(0,O.pathname.lastIndexOf("/")+1)+C.pathname:O.pathname)+(C.protocol||C.authority||C.pathname?C.search:C.search||O.search)+C.hash}function h(O){return O.split("#")[0]}function g(O,C){if(O&&typeof O=="object")if(C===void 0?C=O.id:typeof O.id=="string"&&(C=p(C,O.id),O.id=C),Array.isArray(O))for(var A=0;A<O.length;A++)g(O[A],C);else{typeof O.$ref=="string"&&(O.$ref=p(C,O.$ref));for(var D in O)D!=="enum"&&g(O[D],C)}}function v(O){O=O||"en";var C=$[O];return function(A){var D=C[A.code]||k[A.code];if(typeof D!="string")return"Unknown error code "+A.code+": "+JSON.stringify(A.messageParams);var B=A.params;return D.replace(/\{([^{}]*)\}/g,function(F,K){var ee=B[K];return typeof ee=="string"||typeof ee=="number"?ee:F})}}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},w={};for(var E in _)w[_[E]]=E;var k={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 T(O,C,A,D,B){if(Error.call(this),O===void 0)throw new Error("No error code supplied: "+D);this.message="",this.params=C,this.code=O,this.dataPath=A||"",this.schemaPath=D||"",this.subErrors=B||null;var F=new Error(this.message);if(this.stack=F.stack||F.stacktrace,!this.stack)try{throw F}catch(K){this.stack=K.stack||K.stacktrace}}T.prototype=Object.create(Error.prototype),T.prototype.constructor=T,T.prototype.name="ValidationError",T.prototype.prefixWith=function(O,C){if(O!==null&&(O=O.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+O+this.dataPath),C!==null&&(C=C.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+C+this.schemaPath),this.subErrors!==null)for(var A=0;A<this.subErrors.length;A++)this.subErrors[A].prefixWith(O,C);return this};function N(O,C){if(C.substring(0,O.length)===O){var A=C.substring(O.length);if(C.length>0&&C.charAt(O.length-1)==="/"||A.charAt(0)==="#"||A.charAt(0)==="?")return!0}return!1}var $={};function j(O){var C=new s,A,D,B={setErrorReporter:function(F){return typeof F=="string"?this.language(F):(D=F,!0)},addFormat:function(){C.addFormat.apply(C,arguments)},language:function(F){return F?($[F]||(F=F.split("-")[0]),$[F]?(A=F,F):!1):A},addLanguage:function(F,K){var ee;for(ee in _)K[ee]&&!K[_[ee]]&&(K[_[ee]]=K[ee]);var ie=F.split("-")[0];if(!$[ie])$[F]=K,$[ie]=K;else{$[F]=Object.create($[ie]);for(ee in K)typeof $[ie][ee]>"u"&&($[ie][ee]=K[ee]),$[F][ee]=K[ee]}return this},freshApi:function(F){var K=j();return F&&K.language(F),K},validate:function(F,K,ee,ie){var pe=v(A),ke=D?function(ve,We,mt){return D(ve,We,mt)||pe(ve,We,mt)}:pe,de=new s(C,!1,ke,ee,ie);typeof K=="string"&&(K={$ref:K}),de.addSchema("",K);var le=de.validateAll(F,K,null,null,"");return!le&&ie&&(le=de.banUnknownProperties(F,K)),this.error=le,this.missing=de.missing,this.valid=le===null,this.valid},validateResult:function(){var F={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(F,arguments),F},validateMultiple:function(F,K,ee,ie){var pe=v(A),ke=D?function(ve,We,mt){return D(ve,We,mt)||pe(ve,We,mt)}:pe,de=new s(C,!0,ke,ee,ie);typeof K=="string"&&(K={$ref:K}),de.addSchema("",K),de.validateAll(F,K,null,null,""),ie&&de.banUnknownProperties(F,K);var le={toString:function(){return this.valid?"valid":this.error.message}};return le.errors=de.errors,le.missing=de.missing,le.valid=le.errors.length===0,le},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(F,K,ee){if(typeof F!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(F))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof K!="number"||K%1!==0||K<1e4)throw new Error("Code number must be an integer > 10000");if(typeof _[F]<"u")throw new Error("Error already defined: "+F+" as "+_[F]);if(typeof w[K]<"u")throw new Error("Error code already used: "+w[K]+" as "+K);_[F]=K,w[K]=F,k[F]=k[K]=ee;for(var ie in $){var pe=$[ie];pe[F]&&(pe[K]=pe[K]||pe[F])}},reset:function(){C.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:g,resolveUrl:p,getDocumentUri:h,errorCodes:_};return B.language(O||"en"),B}var G=j();return G.addLanguage("en-gb",k),G.tv4=G,G})});var of=H(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.regexpCode=rt.getEsmExportName=rt.getProperty=rt.safeStringify=rt.stringify=rt.strConcat=rt.addCodeArg=rt.str=rt._=rt.nil=rt._Code=rt.Name=rt.IDENTIFIER=rt._CodeOrName=void 0;var nf=class{};rt._CodeOrName=nf;rt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var da=class extends nf{constructor(e){if(super(),!rt.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}}};rt.Name=da;var En=class extends nf{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((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof da&&(r[n.str]=(r[n.str]||0)+1),r),{})}};rt._Code=En;rt.nil=new En("");function wI(t,...e){let r=[t[0]],n=0;for(;n<e.length;)fS(r,e[n]),r.push(t[++n]);return new En(r)}rt._=wI;var cS=new En("+");function _I(t,...e){let r=[sf(t[0])],n=0;for(;n<e.length;)r.push(cS),fS(r,e[n]),r.push(cS,sf(t[++n]));return p2(r),new En(r)}rt.str=_I;function fS(t,e){e instanceof En?t.push(...e._items):e instanceof da?t.push(e):t.push(g2(e))}rt.addCodeArg=fS;function p2(t){let e=1;for(;e<t.length-1;){if(t[e]===cS){let r=h2(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function h2(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof da||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof da))return`"${t}${e.slice(1)}`}function m2(t,e){return e.emptyStr()?t:t.emptyStr()?e:_I`${t}${e}`}rt.strConcat=m2;function g2(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:sf(Array.isArray(t)?t.join(","):t)}function y2(t){return new En(sf(t))}rt.stringify=y2;function sf(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}rt.safeStringify=sf;function v2(t){return typeof t=="string"&&rt.IDENTIFIER.test(t)?new En(`.${t}`):wI`[${t}]`}rt.getProperty=v2;function b2(t){if(typeof t=="string"&&rt.IDENTIFIER.test(t))return new En(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}rt.getEsmExportName=b2;function S2(t){return new En(t.toString())}rt.regexpCode=S2});var hS=H(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.ValueScope=Hr.ValueScopeName=Hr.Scope=Hr.varKinds=Hr.UsedValueState=void 0;var Ur=of(),dS=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Fh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Fh||(Hr.UsedValueState=Fh={}));Hr.varKinds={const:new Ur.Name("const"),let:new Ur.Name("let"),var:new Ur.Name("var")};var Dh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Ur.Name?e:this.name(e)}name(e){return new Ur.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._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}}};Hr.Scope=Dh;var Lh=class extends Ur.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Ur._)`.${new Ur.Name(r)}[${n}]`}};Hr.ValueScopeName=Lh;var w2=(0,Ur._)`\n`,pS=class extends Dh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?w2:Ur.nil}}get(){return this._scope}name(e){return new Lh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let p=l.get(o);if(p)return p}else l=this._values[s]=new Map;l.set(o,i);let f=this._scope[s]||(this._scope[s]=[]),c=f.length;return f[c]=r.ref,i.setValue(r,{property:s,itemIndex:c}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ur._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=Ur.nil;for(let o in e){let l=e[o];if(!l)continue;let f=n[o]=n[o]||new Map;l.forEach(c=>{if(f.has(c))return;f.set(c,Fh.Started);let p=r(c);if(p){let h=this.opts.es5?Hr.varKinds.var:Hr.varKinds.const;s=(0,Ur._)`${s}${h} ${c} = ${p};${this.opts._n}`}else if(p=i?.(c))s=(0,Ur._)`${s}${p}${this.opts._n}`;else throw new dS(c);f.set(c,Fh.Completed)})}return s}};Hr.ValueScope=pS});var je=H(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.or=Me.and=Me.not=Me.CodeGen=Me.operators=Me.varKinds=Me.ValueScopeName=Me.ValueScope=Me.Scope=Me.Name=Me.regexpCode=Me.stringify=Me.getProperty=Me.nil=Me.strConcat=Me.str=Me._=void 0;var Ge=of(),Zn=hS(),Ys=of();Object.defineProperty(Me,"_",{enumerable:!0,get:function(){return Ys._}});Object.defineProperty(Me,"str",{enumerable:!0,get:function(){return Ys.str}});Object.defineProperty(Me,"strConcat",{enumerable:!0,get:function(){return Ys.strConcat}});Object.defineProperty(Me,"nil",{enumerable:!0,get:function(){return Ys.nil}});Object.defineProperty(Me,"getProperty",{enumerable:!0,get:function(){return Ys.getProperty}});Object.defineProperty(Me,"stringify",{enumerable:!0,get:function(){return Ys.stringify}});Object.defineProperty(Me,"regexpCode",{enumerable:!0,get:function(){return Ys.regexpCode}});Object.defineProperty(Me,"Name",{enumerable:!0,get:function(){return Ys.Name}});var Bh=hS();Object.defineProperty(Me,"Scope",{enumerable:!0,get:function(){return Bh.Scope}});Object.defineProperty(Me,"ValueScope",{enumerable:!0,get:function(){return Bh.ValueScope}});Object.defineProperty(Me,"ValueScopeName",{enumerable:!0,get:function(){return Bh.ValueScopeName}});Object.defineProperty(Me,"varKinds",{enumerable:!0,get:function(){return Bh.varKinds}});Me.operators={GT:new Ge._Code(">"),GTE:new Ge._Code(">="),LT:new Ge._Code("<"),LTE:new Ge._Code("<="),EQ:new Ge._Code("==="),NEQ:new Ge._Code("!=="),NOT:new Ge._Code("!"),OR:new Ge._Code("||"),AND:new Ge._Code("&&"),ADD:new Ge._Code("+")};var os=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},mS=class extends os{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Zn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Gl(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ge._CodeOrName?this.rhs.names:{}}},jh=class extends os{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Ge.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Gl(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ge.Name?{}:{...this.lhs.names};return Hh(e,this.rhs)}},gS=class extends jh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},yS=class extends os{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},vS=class extends os{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},bS=class extends os{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},SS=class extends os{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Gl(this.code,e,r),this}get names(){return this.code instanceof Ge._CodeOrName?this.code.names:{}}},af=class extends os{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(_2(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>ma(e,r.names),{})}},as=class extends af{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},wS=class extends af{},Jl=class extends as{};Jl.kind="else";var pa=class t extends as{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Jl(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(RI(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Gl(this.condition,e,r),this}get names(){let e=super.names;return Hh(e,this.condition),this.else&&ma(e,this.else.names),e}};pa.kind="if";var ha=class extends as{};ha.kind="for";var _S=class extends ha{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Gl(this.iteration,e,r),this}get names(){return ma(super.names,this.iteration.names)}},RS=class extends ha{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Zn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Hh(super.names,this.from);return Hh(e,this.to)}},Uh=class extends ha{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Gl(this.iterable,e,r),this}get names(){return ma(super.names,this.iterable.names)}},lf=class extends as{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};lf.kind="func";var uf=class extends af{render(e){return"return "+super.render(e)}};uf.kind="return";var CS=class extends as{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&ma(e,this.catch.names),this.finally&&ma(e,this.finally.names),e}},cf=class extends as{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};cf.kind="catch";var ff=class extends as{render(e){return"finally"+super.render(e)}};ff.kind="finally";var xS=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
24
- `:""},this._extScope=e,this._scope=new Zn.Scope({parent:e}),this._nodes=[new wS]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new mS(e,s,n)),s}const(e,r,n){return this._def(Zn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Zn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Zn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new jh(e,r,n))}add(e,r){return this._leafNode(new gS(e,Me.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ge.nil&&this._leafNode(new SS(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Ge.addCodeArg)(r,i));return r.push("}"),new Ge._Code(r)}if(e,r,n){if(this._blockNode(new pa(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new pa(e))}else(){return this._elseNode(new Jl)}endIf(){return this._endBlockNode(pa,Jl)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new _S(e),r)}forRange(e,r,n,i,s=this.opts.es5?Zn.varKinds.var:Zn.varKinds.let){let o=this._scope.toName(e);return this._for(new RS(s,o,r,n),()=>i(o))}forOf(e,r,n,i=Zn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof Ge.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ge._)`${o}.length`,l=>{this.var(s,(0,Ge._)`${o}[${l}]`),n(s)})}return this._for(new Uh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Zn.varKinds.var:Zn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ge._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Uh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(ha)}label(e){return this._leafNode(new yS(e))}break(e){return this._leafNode(new vS(e))}return(e){let r=new uf;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(uf)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new CS;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new cf(s),r(s)}return n&&(this._currNode=i.finally=new ff,this.code(n)),this._endBlockNode(cf,ff)}throw(e){return this._leafNode(new bS(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Ge.nil,n,i){return this._blockNode(new lf(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(lf)}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,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof pa))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Me.CodeGen=xS;function ma(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Hh(t,e){return e instanceof Ge._CodeOrName?ma(t,e.names):t}function Gl(t,e,r){if(t instanceof Ge.Name)return n(t);if(!i(t))return t;return new Ge._Code(t._items.reduce((s,o)=>(o instanceof Ge.Name&&(o=n(o)),o instanceof Ge._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof Ge._Code&&s._items.some(o=>o instanceof Ge.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function _2(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function RI(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ge._)`!${ES(t)}`}Me.not=RI;var R2=CI(Me.operators.AND);function C2(...t){return t.reduce(R2)}Me.and=C2;var x2=CI(Me.operators.OR);function E2(...t){return t.reduce(x2)}Me.or=E2;function CI(t){return(e,r)=>e===Ge.nil?r:r===Ge.nil?e:(0,Ge._)`${ES(e)} ${t} ${ES(r)}`}function ES(t){return t instanceof Ge.Name?t:(0,Ge._)`(${t})`}});var Ke=H(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.checkStrictMode=Ue.getErrorPath=Ue.Type=Ue.useFunc=Ue.setEvaluated=Ue.evaluatedPropsToName=Ue.mergeEvaluated=Ue.eachItem=Ue.unescapeJsonPointer=Ue.escapeJsonPointer=Ue.escapeFragment=Ue.unescapeFragment=Ue.schemaRefOrVal=Ue.schemaHasRulesButRef=Ue.schemaHasRules=Ue.checkUnknownRules=Ue.alwaysValidSchema=Ue.toHash=void 0;var wt=je(),I2=of();function q2(t){let e={};for(let r of t)e[r]=!0;return e}Ue.toHash=q2;function O2(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(II(t,e),!qI(e,t.self.RULES.all))}Ue.alwaysValidSchema=O2;function II(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||PI(t,`unknown keyword: "${s}"`)}Ue.checkUnknownRules=II;function qI(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ue.schemaHasRules=qI;function k2(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Ue.schemaHasRulesButRef=k2;function P2({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,wt._)`${r}`}return(0,wt._)`${t}${e}${(0,wt.getProperty)(n)}`}Ue.schemaRefOrVal=P2;function T2(t){return OI(decodeURIComponent(t))}Ue.unescapeFragment=T2;function A2(t){return encodeURIComponent(qS(t))}Ue.escapeFragment=A2;function qS(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ue.escapeJsonPointer=qS;function OI(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ue.unescapeJsonPointer=OI;function $2(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ue.eachItem=$2;function xI({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,l)=>{let f=o===void 0?s:o instanceof wt.Name?(s instanceof wt.Name?t(i,s,o):e(i,s,o),o):s instanceof wt.Name?(e(i,o,s),s):r(s,o);return l===wt.Name&&!(f instanceof wt.Name)?n(i,f):f}}Ue.mergeEvaluated={props:xI({mergeNames:(t,e,r)=>t.if((0,wt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,wt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,wt._)`${r} || {}`).code((0,wt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,wt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,wt._)`${r} || {}`),OS(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:kI}),items:xI({mergeNames:(t,e,r)=>t.if((0,wt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,wt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,wt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,wt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function kI(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,wt._)`{}`);return e!==void 0&&OS(t,r,e),r}Ue.evaluatedPropsToName=kI;function OS(t,e,r){Object.keys(r).forEach(n=>t.assign((0,wt._)`${e}${(0,wt.getProperty)(n)}`,!0))}Ue.setEvaluated=OS;var EI={};function N2(t,e){return t.scopeValue("func",{ref:e,code:EI[e.code]||(EI[e.code]=new I2._Code(e.code))})}Ue.useFunc=N2;var IS;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(IS||(Ue.Type=IS={}));function M2(t,e,r){if(t instanceof wt.Name){let n=e===IS.Num;return r?n?(0,wt._)`"[" + ${t} + "]"`:(0,wt._)`"['" + ${t} + "']"`:n?(0,wt._)`"/" + ${t}`:(0,wt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,wt.getProperty)(t).toString():"/"+qS(t)}Ue.getErrorPath=M2;function PI(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Ue.checkStrictMode=PI});var ls=H(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});var dr=je(),F2={data:new dr.Name("data"),valCxt:new dr.Name("valCxt"),instancePath:new dr.Name("instancePath"),parentData:new dr.Name("parentData"),parentDataProperty:new dr.Name("parentDataProperty"),rootData:new dr.Name("rootData"),dynamicAnchors:new dr.Name("dynamicAnchors"),vErrors:new dr.Name("vErrors"),errors:new dr.Name("errors"),this:new dr.Name("this"),self:new dr.Name("self"),scope:new dr.Name("scope"),json:new dr.Name("json"),jsonPos:new dr.Name("jsonPos"),jsonLen:new dr.Name("jsonLen"),jsonPart:new dr.Name("jsonPart")};kS.default=F2});var df=H(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.extendErrors=pr.resetErrorsCount=pr.reportExtraError=pr.reportError=pr.keyword$DataError=pr.keywordError=void 0;var Qe=je(),Vh=Ke(),kr=ls();pr.keywordError={message:({keyword:t})=>(0,Qe.str)`must pass "${t}" keyword validation`};pr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Qe.str)`"${t}" keyword must be ${e} ($data)`:(0,Qe.str)`"${t}" keyword is invalid ($data)`};function D2(t,e=pr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:l}=i,f=$I(t,e,r);n??(o||l)?TI(s,f):AI(i,(0,Qe._)`[${f}]`)}pr.reportError=D2;function L2(t,e=pr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,l=$I(t,e,r);TI(i,l),s||o||AI(n,kr.default.vErrors)}pr.reportExtraError=L2;function j2(t,e){t.assign(kr.default.errors,e),t.if((0,Qe._)`${kr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Qe._)`${kr.default.vErrors}.length`,e),()=>t.assign(kr.default.vErrors,null)))}pr.resetErrorsCount=j2;function U2({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,kr.default.errors,l=>{t.const(o,(0,Qe._)`${kr.default.vErrors}[${l}]`),t.if((0,Qe._)`${o}.instancePath === undefined`,()=>t.assign((0,Qe._)`${o}.instancePath`,(0,Qe.strConcat)(kr.default.instancePath,s.errorPath))),t.assign((0,Qe._)`${o}.schemaPath`,(0,Qe.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Qe._)`${o}.schema`,r),t.assign((0,Qe._)`${o}.data`,n))})}pr.extendErrors=U2;function TI(t,e){let r=t.const("err",e);t.if((0,Qe._)`${kr.default.vErrors} === null`,()=>t.assign(kr.default.vErrors,(0,Qe._)`[${r}]`),(0,Qe._)`${kr.default.vErrors}.push(${r})`),t.code((0,Qe._)`${kr.default.errors}++`)}function AI(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,Qe._)`new ${t.ValidationError}(${e})`):(r.assign((0,Qe._)`${n}.errors`,e),r.return(!1))}var ga={keyword:new Qe.Name("keyword"),schemaPath:new Qe.Name("schemaPath"),params:new Qe.Name("params"),propertyName:new Qe.Name("propertyName"),message:new Qe.Name("message"),schema:new Qe.Name("schema"),parentSchema:new Qe.Name("parentSchema")};function $I(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Qe._)`{}`:H2(t,e,r)}function H2(t,e,r={}){let{gen:n,it:i}=t,s=[B2(i,r),V2(t,r)];return W2(t,e,s),n.object(...s)}function B2({errorPath:t},{instancePath:e}){let r=e?(0,Qe.str)`${t}${(0,Vh.getErrorPath)(e,Vh.Type.Str)}`:t;return[kr.default.instancePath,(0,Qe.strConcat)(kr.default.instancePath,r)]}function V2({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Qe.str)`${e}/${t}`;return r&&(i=(0,Qe.str)`${i}${(0,Vh.getErrorPath)(r,Vh.Type.Str)}`),[ga.schemaPath,i]}function W2(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:l}=t,{opts:f,propertyName:c,topSchemaRef:p,schemaPath:h}=l;n.push([ga.keyword,i],[ga.params,typeof e=="function"?e(t):e||(0,Qe._)`{}`]),f.messages&&n.push([ga.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([ga.schema,o],[ga.parentSchema,(0,Qe._)`${p}${h}`],[kr.default.data,s]),c&&n.push([ga.propertyName,c])}});var MI=H(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.boolOrEmptySchema=Yl.topBoolOrEmptySchema=void 0;var z2=df(),J2=je(),G2=ls(),Y2={message:"boolean schema is false"};function K2(t){let{gen:e,schema:r,validateName:n}=t;r===!1?NI(t,!1):typeof r=="object"&&r.$async===!0?e.return(G2.default.data):(e.assign((0,J2._)`${n}.errors`,null),e.return(!0))}Yl.topBoolOrEmptySchema=K2;function Q2(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),NI(t)):r.var(e,!0)}Yl.boolOrEmptySchema=Q2;function NI(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,z2.reportError)(i,Y2,void 0,e)}});var PS=H(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});Kl.getRules=Kl.isJSONType=void 0;var Z2=["string","number","integer","boolean","null","object","array"],X2=new Set(Z2);function eU(t){return typeof t=="string"&&X2.has(t)}Kl.isJSONType=eU;function tU(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Kl.getRules=tU});var TS=H(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.shouldUseRule=Ks.shouldUseGroup=Ks.schemaHasRulesForType=void 0;function rU({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&FI(t,n)}Ks.schemaHasRulesForType=rU;function FI(t,e){return e.rules.some(r=>DI(t,r))}Ks.shouldUseGroup=FI;function DI(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Ks.shouldUseRule=DI});var pf=H(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.reportTypeError=hr.checkDataTypes=hr.checkDataType=hr.coerceAndCheckDataType=hr.getJSONTypes=hr.getSchemaTypes=hr.DataType=void 0;var nU=PS(),iU=TS(),sU=df(),Oe=je(),LI=Ke(),Ql;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ql||(hr.DataType=Ql={}));function oU(t){let e=jI(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}hr.getSchemaTypes=oU;function jI(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(nU.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}hr.getJSONTypes=jI;function aU(t,e){let{gen:r,data:n,opts:i}=t,s=lU(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,iU.schemaHasRulesForType)(t,e[0]));if(o){let l=$S(e,n,i.strictNumbers,Ql.Wrong);r.if(l,()=>{s.length?uU(t,e,s):NS(t)})}return o}hr.coerceAndCheckDataType=aU;var UI=new Set(["string","number","integer","boolean","null"]);function lU(t,e){return e?t.filter(r=>UI.has(r)||e==="array"&&r==="array"):[]}function uU(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,Oe._)`typeof ${i}`),l=n.let("coerced",(0,Oe._)`undefined`);s.coerceTypes==="array"&&n.if((0,Oe._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Oe._)`${i}[0]`).assign(o,(0,Oe._)`typeof ${i}`).if($S(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,Oe._)`${l} !== undefined`);for(let c of r)(UI.has(c)||c==="array"&&s.coerceTypes==="array")&&f(c);n.else(),NS(t),n.endIf(),n.if((0,Oe._)`${l} !== undefined`,()=>{n.assign(i,l),cU(t,l)});function f(c){switch(c){case"string":n.elseIf((0,Oe._)`${o} == "number" || ${o} == "boolean"`).assign(l,(0,Oe._)`"" + ${i}`).elseIf((0,Oe._)`${i} === null`).assign(l,(0,Oe._)`""`);return;case"number":n.elseIf((0,Oe._)`${o} == "boolean" || ${i} === null
25
- || (${o} == "string" && ${i} && ${i} == +${i})`).assign(l,(0,Oe._)`+${i}`);return;case"integer":n.elseIf((0,Oe._)`${o} === "boolean" || ${i} === null
26
- || (${o} === "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._)`${o} === "string" || ${o} === "number"
27
- || ${o} === "boolean" || ${i} === null`).assign(l,(0,Oe._)`[${i}]`)}}}function cU({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Oe._)`${e} !== undefined`,()=>t.assign((0,Oe._)`${e}[${r}]`,n))}function AS(t,e,r,n=Ql.Correct){let i=n===Ql.Correct?Oe.operators.EQ:Oe.operators.NEQ,s;switch(t){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=o((0,Oe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,Oe._)`typeof ${e} ${i} ${t}`}return n===Ql.Correct?s:(0,Oe.not)(s);function o(l=Oe.nil){return(0,Oe.and)((0,Oe._)`typeof ${e} == "number"`,l,r?(0,Oe._)`isFinite(${e})`:Oe.nil)}}hr.checkDataType=AS;function $S(t,e,r,n){if(t.length===1)return AS(t[0],e,r,n);let i,s=(0,LI.toHash)(t);if(s.array&&s.object){let o=(0,Oe._)`typeof ${e} != "object"`;i=s.null?o:(0,Oe._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=Oe.nil;s.number&&delete s.integer;for(let o in s)i=(0,Oe.and)(i,AS(o,e,r,n));return i}hr.checkDataTypes=$S;var fU={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Oe._)`{type: ${t}}`:(0,Oe._)`{type: ${e}}`};function NS(t){let e=dU(t);(0,sU.reportError)(e,fU)}hr.reportTypeError=NS;function dU(t){let{gen:e,data:r,schema:n}=t,i=(0,LI.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var BI=H(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.assignDefaults=void 0;var Zl=je(),pU=Ke();function hU(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)HI(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>HI(t,s,i.default))}Wh.assignDefaults=hU;function HI(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let l=(0,Zl._)`${s}${(0,Zl.getProperty)(e)}`;if(i){(0,pU.checkStrictMode)(t,`default is ignored for: ${l}`);return}let f=(0,Zl._)`${l} === undefined`;o.useDefaults==="empty"&&(f=(0,Zl._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,Zl._)`${l} = ${(0,Zl.stringify)(r)}`)}});var In=H(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.validateUnion=vt.validateArray=vt.usePattern=vt.callValidateCode=vt.schemaProperties=vt.allSchemaProperties=vt.noPropertyInData=vt.propertyInData=vt.isOwnProperty=vt.hasPropFunc=vt.reportMissingProp=vt.checkMissingProp=vt.checkReportMissingProp=void 0;var Et=je(),MS=Ke(),Qs=ls(),mU=Ke();function gU(t,e){let{gen:r,data:n,it:i}=t;r.if(DS(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Et._)`${e}`},!0),t.error()})}vt.checkReportMissingProp=gU;function yU({gen:t,data:e,it:{opts:r}},n,i){return(0,Et.or)(...n.map(s=>(0,Et.and)(DS(t,e,s,r.ownProperties),(0,Et._)`${i} = ${s}`)))}vt.checkMissingProp=yU;function vU(t,e){t.setParams({missingProperty:e},!0),t.error()}vt.reportMissingProp=vU;function VI(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Et._)`Object.prototype.hasOwnProperty`})}vt.hasPropFunc=VI;function FS(t,e,r){return(0,Et._)`${VI(t)}.call(${e}, ${r})`}vt.isOwnProperty=FS;function bU(t,e,r,n){let i=(0,Et._)`${e}${(0,Et.getProperty)(r)} !== undefined`;return n?(0,Et._)`${i} && ${FS(t,e,r)}`:i}vt.propertyInData=bU;function DS(t,e,r,n){let i=(0,Et._)`${e}${(0,Et.getProperty)(r)} === undefined`;return n?(0,Et.or)(i,(0,Et.not)(FS(t,e,r))):i}vt.noPropertyInData=DS;function WI(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}vt.allSchemaProperties=WI;function SU(t,e){return WI(e).filter(r=>!(0,MS.alwaysValidSchema)(t,e[r]))}vt.schemaProperties=SU;function wU({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},l,f,c){let p=c?(0,Et._)`${t}, ${e}, ${n}${i}`:e,h=[[Qs.default.instancePath,(0,Et.strConcat)(Qs.default.instancePath,s)],[Qs.default.parentData,o.parentData],[Qs.default.parentDataProperty,o.parentDataProperty],[Qs.default.rootData,Qs.default.rootData]];o.opts.dynamicRef&&h.push([Qs.default.dynamicAnchors,Qs.default.dynamicAnchors]);let g=(0,Et._)`${p}, ${r.object(...h)}`;return f!==Et.nil?(0,Et._)`${l}.call(${f}, ${g})`:(0,Et._)`${l}(${g})`}vt.callValidateCode=wU;var _U=(0,Et._)`new RegExp`;function RU({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,Et._)`${i.code==="new RegExp"?_U:(0,mU.useFunc)(t,i)}(${r}, ${n})`})}vt.usePattern=RU;function CU(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let l=e.let("valid",!0);return o(()=>e.assign(l,!1)),l}return e.var(s,!0),o(()=>e.break()),s;function o(l){let f=e.const("len",(0,Et._)`${r}.length`);e.forRange("i",0,f,c=>{t.subschema({keyword:n,dataProp:c,dataPropType:MS.Type.Num},s),e.if((0,Et.not)(s),l)})}}vt.validateArray=CU;function xU(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,MS.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((f,c)=>{let p=t.subschema({keyword:n,schemaProp:c,compositeRule:!0},l);e.assign(o,(0,Et._)`${o} || ${l}`),t.mergeValidEvaluated(p,l)||e.if((0,Et.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}vt.validateUnion=xU});var GI=H(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.validateKeywordUsage=Ii.validSchemaType=Ii.funcKeywordCode=Ii.macroKeywordCode=void 0;var Pr=je(),ya=ls(),EU=In(),IU=df();function qU(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,l=e.macro.call(o.self,i,s,o),f=JI(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);let c=r.name("valid");t.subschema({schema:l,schemaPath:Pr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},c),t.pass(c,()=>t.error(!0))}Ii.macroKeywordCode=qU;function OU(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:l,it:f}=t;PU(f,e);let c=!l&&e.compile?e.compile.call(f.self,s,o,f):e.validate,p=JI(n,i,c),h=n.let("valid");t.block$data(h,g),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function g(){if(e.errors===!1)w(),e.modifying&&zI(t),E(()=>t.error());else{let k=e.async?v():_();e.modifying&&zI(t),E(()=>kU(t,k))}}function v(){let k=n.let("ruleErrs",null);return n.try(()=>w((0,Pr._)`await `),T=>n.assign(h,!1).if((0,Pr._)`${T} instanceof ${f.ValidationError}`,()=>n.assign(k,(0,Pr._)`${T}.errors`),()=>n.throw(T))),k}function _(){let k=(0,Pr._)`${p}.errors`;return n.assign(k,null),w(Pr.nil),k}function w(k=e.async?(0,Pr._)`await `:Pr.nil){let T=f.opts.passContext?ya.default.this:ya.default.self,N=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,Pr._)`${k}${(0,EU.callValidateCode)(t,p,T,N)}`,e.modifying)}function E(k){var T;n.if((0,Pr.not)((T=e.valid)!==null&&T!==void 0?T:h),k)}}Ii.funcKeywordCode=OU;function zI(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Pr._)`${n.parentData}[${n.parentDataProperty}]`))}function kU(t,e){let{gen:r}=t;r.if((0,Pr._)`Array.isArray(${e})`,()=>{r.assign(ya.default.vErrors,(0,Pr._)`${ya.default.vErrors} === null ? ${e} : ${ya.default.vErrors}.concat(${e})`).assign(ya.default.errors,(0,Pr._)`${ya.default.vErrors}.length`),(0,IU.extendErrors)(t)},()=>t.error())}function PU({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function JI(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Pr.stringify)(r)})}function TU(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Ii.validSchemaType=TU;function AU({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let o=i.dependencies;if(o?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}Ii.validateKeywordUsage=AU});var KI=H(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.extendSubschemaMode=Zs.extendSubschemaData=Zs.getSubschema=void 0;var qi=je(),YI=Ke();function $U(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,qi._)`${t.schemaPath}${(0,qi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,qi._)`${t.schemaPath}${(0,qi.getProperty)(e)}${(0,qi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,YI.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Zs.getSubschema=$U;function NU(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:c,dataPathArr:p,opts:h}=e,g=l.let("data",(0,qi._)`${e.data}${(0,qi.getProperty)(r)}`,!0);f(g),t.errorPath=(0,qi.str)`${c}${(0,YI.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,qi._)`${r}`,t.dataPathArr=[...p,t.parentDataProperty]}if(i!==void 0){let c=i instanceof qi.Name?i:l.let("data",i,!0);f(c),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function f(c){t.data=c,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,c]}}Zs.extendSubschemaData=NU;function MU(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}Zs.extendSubschemaMode=MU});var LS=H((CQ,QI)=>{"use strict";QI.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var XI=H((xQ,ZI)=>{"use strict";var Xs=ZI.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};zh(e,n,i,t,"",t)};Xs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Xs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Xs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Xs.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 zh(t,e,r,n,i,s,o,l,f,c){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,l,f,c);for(var p in n){var h=n[p];if(Array.isArray(h)){if(p in Xs.arrayKeywords)for(var g=0;g<h.length;g++)zh(t,e,r,h[g],i+"/"+p+"/"+g,s,i,p,n,g)}else if(p in Xs.propsKeywords){if(h&&typeof h=="object")for(var v in h)zh(t,e,r,h[v],i+"/"+p+"/"+FU(v),s,i,p,n,v)}else(p in Xs.keywords||t.allKeys&&!(p in Xs.skipKeywords))&&zh(t,e,r,h,i+"/"+p,s,i,p,n)}r(n,i,s,o,l,f,c)}}function FU(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var hf=H(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.getSchemaRefs=Br.resolveUrl=Br.normalizeId=Br._getFullPath=Br.getFullPath=Br.inlineRef=void 0;var DU=Ke(),LU=LS(),jU=XI(),UU=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function HU(t,e=!0){return typeof t=="boolean"?!0:e===!0?!jS(t):e?eq(t)<=e:!1}Br.inlineRef=HU;var BU=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function jS(t){for(let e in t){if(BU.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(jS)||typeof r=="object"&&jS(r))return!0}return!1}function eq(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!UU.has(r)&&(typeof t[r]=="object"&&(0,DU.eachItem)(t[r],n=>e+=eq(n)),e===1/0))return 1/0}return e}function tq(t,e="",r){r!==!1&&(e=Xl(e));let n=t.parse(e);return rq(t,n)}Br.getFullPath=tq;function rq(t,e){return t.serialize(e).split("#")[0]+"#"}Br._getFullPath=rq;var VU=/#\/?$/;function Xl(t){return t?t.replace(VU,""):""}Br.normalizeId=Xl;function WU(t,e,r){return r=Xl(r),t.resolve(e,r)}Br.resolveUrl=WU;var zU=/^[a-z_][-a-z0-9._]*$/i;function JU(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Xl(t[r]||e),s={"":i},o=tq(n,i,!1),l={},f=new Set;return jU(t,{allKeys:!0},(h,g,v,_)=>{if(_===void 0)return;let w=o+g,E=s[_];typeof h[r]=="string"&&(E=k.call(this,h[r])),T.call(this,h.$anchor),T.call(this,h.$dynamicAnchor),s[g]=E;function k(N){let $=this.opts.uriResolver.resolve;if(N=Xl(E?$(E,N):N),f.has(N))throw p(N);f.add(N);let j=this.refs[N];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?c(h,j.schema,N):N!==Xl(w)&&(N[0]==="#"?(c(h,l[N],N),l[N]=h):this.refs[N]=w),N}function T(N){if(typeof N=="string"){if(!zU.test(N))throw new Error(`invalid anchor "${N}"`);k.call(this,`#${N}`)}}}),l;function c(h,g,v){if(g!==void 0&&!LU(h,g))throw p(v)}function p(h){return new Error(`reference "${h}" resolves to more than one schema`)}}Br.getSchemaRefs=JU});var yf=H(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.getData=eo.KeywordCxt=eo.validateFunctionCode=void 0;var aq=MI(),nq=pf(),HS=TS(),Jh=pf(),GU=BI(),gf=GI(),US=KI(),ye=je(),Ce=ls(),YU=hf(),us=Ke(),mf=df();function KU(t){if(cq(t)&&(fq(t),uq(t))){XU(t);return}lq(t,()=>(0,aq.topBoolOrEmptySchema)(t))}eo.validateFunctionCode=KU;function lq({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,ye._)`${Ce.default.data}, ${Ce.default.valCxt}`,n.$async,()=>{t.code((0,ye._)`"use strict"; ${iq(r,i)}`),ZU(t,i),t.code(s)}):t.func(e,(0,ye._)`${Ce.default.data}, ${QU(i)}`,n.$async,()=>t.code(iq(r,i)).code(s))}function QU(t){return(0,ye._)`{${Ce.default.instancePath}="", ${Ce.default.parentData}, ${Ce.default.parentDataProperty}, ${Ce.default.rootData}=${Ce.default.data}${t.dynamicRef?(0,ye._)`, ${Ce.default.dynamicAnchors}={}`:ye.nil}}={}`}function ZU(t,e){t.if(Ce.default.valCxt,()=>{t.var(Ce.default.instancePath,(0,ye._)`${Ce.default.valCxt}.${Ce.default.instancePath}`),t.var(Ce.default.parentData,(0,ye._)`${Ce.default.valCxt}.${Ce.default.parentData}`),t.var(Ce.default.parentDataProperty,(0,ye._)`${Ce.default.valCxt}.${Ce.default.parentDataProperty}`),t.var(Ce.default.rootData,(0,ye._)`${Ce.default.valCxt}.${Ce.default.rootData}`),e.dynamicRef&&t.var(Ce.default.dynamicAnchors,(0,ye._)`${Ce.default.valCxt}.${Ce.default.dynamicAnchors}`)},()=>{t.var(Ce.default.instancePath,(0,ye._)`""`),t.var(Ce.default.parentData,(0,ye._)`undefined`),t.var(Ce.default.parentDataProperty,(0,ye._)`undefined`),t.var(Ce.default.rootData,Ce.default.data),e.dynamicRef&&t.var(Ce.default.dynamicAnchors,(0,ye._)`{}`)})}function XU(t){let{schema:e,opts:r,gen:n}=t;lq(t,()=>{r.$comment&&e.$comment&&pq(t),iH(t),n.let(Ce.default.vErrors,null),n.let(Ce.default.errors,0),r.unevaluated&&eH(t),dq(t),aH(t)})}function eH(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ye._)`${r}.evaluated`),e.if((0,ye._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ye._)`${t.evaluated}.props`,(0,ye._)`undefined`)),e.if((0,ye._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ye._)`${t.evaluated}.items`,(0,ye._)`undefined`))}function iq(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ye._)`/*# sourceURL=${r} */`:ye.nil}function tH(t,e){if(cq(t)&&(fq(t),uq(t))){rH(t,e);return}(0,aq.boolOrEmptySchema)(t,e)}function uq({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function cq(t){return typeof t.schema!="boolean"}function rH(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&pq(t),sH(t),oH(t);let s=n.const("_errs",Ce.default.errors);dq(t,s),n.var(e,(0,ye._)`${s} === ${Ce.default.errors}`)}function fq(t){(0,us.checkUnknownRules)(t),nH(t)}function dq(t,e){if(t.opts.jtd)return sq(t,[],!1,e);let r=(0,nq.getSchemaTypes)(t.schema),n=(0,nq.coerceAndCheckDataType)(t,r);sq(t,r,!n,e)}function nH(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,us.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function iH(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,us.checkStrictMode)(t,"default is ignored in the schema root")}function sH(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,YU.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function oH(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function pq({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,ye._)`${Ce.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,ye.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ye._)`${Ce.default.self}.opts.$comment(${s}, ${o}, ${l}.schema)`)}}function aH(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,ye._)`${Ce.default.errors} === 0`,()=>e.return(Ce.default.data),()=>e.throw((0,ye._)`new ${i}(${Ce.default.vErrors})`)):(e.assign((0,ye._)`${n}.errors`,Ce.default.vErrors),s.unevaluated&&lH(t),e.return((0,ye._)`${Ce.default.errors} === 0`))}function lH({gen:t,evaluated:e,props:r,items:n}){r instanceof ye.Name&&t.assign((0,ye._)`${e}.props`,r),n instanceof ye.Name&&t.assign((0,ye._)`${e}.items`,n)}function sq(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:l,opts:f,self:c}=t,{RULES:p}=c;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,us.schemaHasRulesButRef)(s,p))){i.block(()=>mq(t,"$ref",p.all.$ref.definition));return}f.jtd||uH(t,e),i.block(()=>{for(let g of p.rules)h(g);h(p.post)});function h(g){(0,HS.shouldUseGroup)(s,g)&&(g.type?(i.if((0,Jh.checkDataType)(g.type,o,f.strictNumbers)),oq(t,g),e.length===1&&e[0]===g.type&&r&&(i.else(),(0,Jh.reportTypeError)(t)),i.endIf()):oq(t,g),l||i.if((0,ye._)`${Ce.default.errors} === ${n||0}`))}}function oq(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,GU.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,HS.shouldUseRule)(n,s)&&mq(t,s.keyword,s.definition,e.type)})}function uH(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(cH(t,e),t.opts.allowUnionTypes||fH(t,e),dH(t,t.dataTypes))}function cH(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{hq(t.dataTypes,r)||BS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),hH(t,e)}}function fH(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&BS(t,"use allowUnionTypes to allow union type keyword")}function dH(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,HS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>pH(e,o))&&BS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function pH(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function hq(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function hH(t,e){let r=[];for(let n of t.dataTypes)hq(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function BS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,us.checkStrictMode)(t,e,t.opts.strictTypes)}var Gh=class{constructor(e,r,n){if((0,gf.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,us.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",gq(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,gf.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Ce.default.errors))}result(e,r,n){this.failResult((0,ye.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,ye.not)(e),void 0,r)}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:r}=this;this.fail((0,ye._)`${r} !== undefined && (${(0,ye.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?mf.reportExtraError:mf.reportError)(this,this.def.error,r)}$dataError(){(0,mf.reportError)(this,this.def.$dataError||mf.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,mf.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=ye.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ye.nil,r=ye.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,ye.or)((0,ye._)`${i} === undefined`,r)),e!==ye.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ye.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,ye.or)(o(),l());function o(){if(n.length){if(!(r instanceof ye.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,ye._)`${(0,Jh.checkDataTypes)(f,r,s.opts.strictNumbers,Jh.DataType.Wrong)}`}return ye.nil}function l(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,ye._)`!${f}(${r})`}return ye.nil}}subschema(e,r){let n=(0,US.getSubschema)(this.it,e);(0,US.extendSubschemaData)(n,this.it,e),(0,US.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return tH(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=us.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=us.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,ye.Name)),!0}};eo.KeywordCxt=Gh;function mq(t,e,r,n){let i=new Gh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,gf.funcKeywordCode)(i,r):"macro"in r?(0,gf.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,gf.funcKeywordCode)(i,r)}var mH=/^\/(?:[^~]|~0|~1)*$/,gH=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function gq(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return Ce.default.rootData;if(t[0]==="/"){if(!mH.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=Ce.default.rootData}else{let c=gH.exec(t);if(!c)throw new Error(`Invalid JSON-pointer: ${t}`);let p=+c[1];if(i=c[2],i==="#"){if(p>=e)throw new Error(f("property/index",p));return n[e-p]}if(p>e)throw new Error(f("data",p));if(s=r[e-p],!i)return s}let o=s,l=i.split("/");for(let c of l)c&&(s=(0,ye._)`${s}${(0,ye.getProperty)((0,us.unescapeJsonPointer)(c))}`,o=(0,ye._)`${o} && ${s}`);return o;function f(c,p){return`Cannot access ${c} ${p} levels up, current level is ${e}`}}eo.getData=gq});var Yh=H(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var VS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};WS.default=VS});var vf=H(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var zS=hf(),JS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,zS.resolveUrl)(e,r,n),this.missingSchema=(0,zS.normalizeId)((0,zS.getFullPath)(e,this.missingRef))}};GS.default=JS});var Qh=H(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.resolveSchema=qn.getCompilingSchema=qn.resolveRef=qn.compileSchema=qn.SchemaEnv=void 0;var Xn=je(),yH=Yh(),va=ls(),ei=hf(),yq=Ke(),vH=yf(),eu=class{constructor(e){var r;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=(r=e.baseId)!==null&&r!==void 0?r:(0,ei.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};qn.SchemaEnv=eu;function KS(t){let e=vq.call(this,t);if(e)return e;let r=(0,ei.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new Xn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=o.scopeValue("Error",{ref:yH.default,code:(0,Xn._)`require("ajv/dist/runtime/validation_error").default`}));let f=o.scopeName("validate");t.validateName=f;let c={gen:o,allErrors:this.opts.allErrors,data:va.default.data,parentData:va.default.parentData,parentDataProperty:va.default.parentDataProperty,dataNames:[va.default.data],dataPathArr:[Xn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Xn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Xn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Xn._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(t),(0,vH.validateFunctionCode)(c),o.optimize(this.opts.code.optimize);let h=o.toString();p=`${o.scopeRefs(va.default.scope)}return ${h}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let v=new Function(`${va.default.self}`,`${va.default.scope}`,p)(this,this.scope.get());if(this.scope.value(f,{ref:v}),v.errors=null,v.schema=t.schema,v.schemaEnv=t,t.$async&&(v.$async=!0),this.opts.code.source===!0&&(v.source={validateName:f,validateCode:h,scopeValues:o._values}),this.opts.unevaluated){let{props:_,items:w}=c;v.evaluated={props:_ instanceof Xn.Name?void 0:_,items:w instanceof Xn.Name?void 0:w,dynamicProps:_ instanceof Xn.Name,dynamicItems:w instanceof Xn.Name},v.source&&(v.source.evaluated=(0,Xn.stringify)(v.evaluated))}return t.validate=v,t}catch(h){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),h}finally{this._compilations.delete(t)}}qn.compileSchema=KS;function bH(t,e,r){var n;r=(0,ei.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=_H.call(this,t,r);if(s===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;o&&(s=new eu({schema:o,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=SH.call(this,s)}qn.resolveRef=bH;function SH(t){return(0,ei.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:KS.call(this,t)}function vq(t){for(let e of this._compilations)if(wH(e,t))return e}qn.getCompilingSchema=vq;function wH(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function _H(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Kh.call(this,t,e)}function Kh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,ei._getFullPath)(this.opts.uriResolver,r),i=(0,ei.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return YS.call(this,r,t);let s=(0,ei.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let l=Kh.call(this,t,o);return typeof l?.schema!="object"?void 0:YS.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||KS.call(this,o),s===(0,ei.normalizeId)(e)){let{schema:l}=o,{schemaId:f}=this.opts,c=l[f];return c&&(i=(0,ei.resolveUrl)(this.opts.uriResolver,i,c)),new eu({schema:l,schemaId:f,root:t,baseId:i})}return YS.call(this,r,o)}}qn.resolveSchema=Kh;var RH=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function YS(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let f=r[(0,yq.unescapeFragment)(l)];if(f===void 0)return;r=f;let c=typeof r=="object"&&r[this.opts.schemaId];!RH.has(l)&&c&&(e=(0,ei.resolveUrl)(this.opts.uriResolver,e,c))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,yq.schemaHasRulesButRef)(r,this.RULES)){let l=(0,ei.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Kh.call(this,n,l)}let{schemaId:o}=this.opts;if(s=s||new eu({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var bq=H((PQ,CH)=>{CH.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 XS=H((TQ,xq)=>{"use strict";var xH=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),wq=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),QS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),_q=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),EH=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function ZS(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var IH=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Sq(t){return t.length=0,!0}function qH(t,e,r){if(t.length){let n=ZS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function OH(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,l=qH;for(let f=0;f<t.length;f++){let c=t[f];if(!(c==="["||c==="]"))if(c===":"){if(s===!0&&(o=!0),!l(i,n,r))break;if(++e>7){r.error=!0;break}f>0&&t[f-1]===":"&&(s=!0),n.push(":");continue}else if(c==="%"){if(!l(i,n,r))break;l=Sq}else{i.push(c);continue}}return i.length&&(l===Sq?r.zone=i.join(""):o?n.push(i.join("")):n.push(ZS(i))),r.address=n.join(""),r}function Rq(t){if(kH(t,":")<2)return{host:t,isIPV6:!1};let e=OH(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function kH(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function PH(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.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]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.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),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var TH={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},AH=/[@/?#:]/g,$H=/[@/?#]/g;function Cq(t,e){let r=e?$H:AH;return r.lastIndex=0,t.replace(r,n=>TH[n])}function NH(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(QS(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));e&&_q(o)?r+=o:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function MH(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(QS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&_q(s)?e+=s:e+="%"+i,r+=2;continue}}EH(t[r])?e+=t[r]:e+=escape(t[r])}return e}function FH(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(QS(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function DH(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!wq(r)){let n=Rq(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=Cq(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}xq.exports={nonSimpleDomain:IH,recomposeAuthority:DH,reescapeHostDelimiters:Cq,normalizePercentEncoding:NH,normalizePathEncoding:MH,escapePreservingEscapes:FH,removeDotSegments:PH,isIPv4:wq,isUUID:xH,normalizeIPv6:Rq,stringArrayToHexStripped:ZS}});var kq=H((AQ,Oq)=>{"use strict";var{isUUID:LH}=XS(),jH=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,UH=["http","https","ws","wss","urn","urn:uuid"];function HH(t){return UH.indexOf(t)!==-1}function ew(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function Eq(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function Iq(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function BH(t){return t.secure=ew(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function VH(t){if((t.port===(ew(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function WH(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(jH);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=tw(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function zH(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=tw(i);s&&(t=s.serialize(t,e));let o=t,l=t.nss;return o.path=`${n||e.nid}:${l}`,e.skipEscape=!0,o}function JH(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!LH(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function GH(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var qq={scheme:"http",domainHost:!0,parse:Eq,serialize:Iq},YH={scheme:"https",domainHost:qq.domainHost,parse:Eq,serialize:Iq},Zh={scheme:"ws",domainHost:!0,parse:BH,serialize:VH},KH={scheme:"wss",domainHost:Zh.domainHost,parse:Zh.parse,serialize:Zh.serialize},QH={scheme:"urn",parse:WH,serialize:zH,skipNormalize:!0},ZH={scheme:"urn:uuid",parse:JH,serialize:GH,skipNormalize:!0},Xh={http:qq,https:YH,ws:Zh,wss:KH,urn:QH,"urn:uuid":ZH};Object.setPrototypeOf(Xh,null);function tw(t){return t&&(Xh[t]||Xh[t.toLowerCase()])||void 0}Oq.exports={wsIsSecure:ew,SCHEMES:Xh,isValidSchemeName:HH,getSchemeHandler:tw}});var Mq=H(($Q,em)=>{"use strict";var{normalizeIPv6:XH,removeDotSegments:bf,recomposeAuthority:eB,normalizePercentEncoding:tB,normalizePathEncoding:rB,escapePreservingEscapes:nB,reescapeHostDelimiters:iB,isIPv4:sB,nonSimpleDomain:oB}=XS(),{SCHEMES:aB,getSchemeHandler:Tq}=kq();function lB(t,e){return typeof t=="string"?t=pB(t,e):typeof t=="object"&&(t=tu(ba(t,e),e)),t}function uB(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Aq(tu(t,n),tu(e,n),n,!0);return n.skipEscape=!0,ba(i,n)}function Aq(t,e,r,n){let i={};return n||(t=tu(ba(t,r),r),e=tu(ba(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=bf(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=bf(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=bf(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=bf(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function cB(t,e,r){let n=Pq(t,r),i=Pq(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function ba(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=Tq(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=tB(r.path):(r.path=nB(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=eB(r);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=bf(l)),o===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),i.push(l)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var fB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function dB(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function $q(t,e){let r=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;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let o=t.match(fB);if(o){n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]);let l=dB(n,o);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(sB(n.host)===!1){let p=XH(n.host);n.host=p.host.toLowerCase(),s=p.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",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let f=Tq(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&oB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}if((!f||f&&!f.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=iB(unescape(n.host),s))),n.path&&(n.path=rB(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}f&&f.parse&&f.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function tu(t,e){return $q(t,e).parsed}function pB(t,e){return Nq(t,e).normalized}function Nq(t,e){let{parsed:r,malformedAuthorityOrPort:n}=$q(t,e);return{normalized:n?t:ba(r,e),malformedAuthorityOrPort:n}}function Pq(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Nq(t,e);return n?void 0:r}if(typeof t=="object")return ba(t,e)}var rw={SCHEMES:aB,normalize:lB,resolve:uB,resolveComponent:Aq,equal:cB,serialize:ba,parse:tu};em.exports=rw;em.exports.default=rw;em.exports.fastUri=rw});var Dq=H(nw=>{"use strict";Object.defineProperty(nw,"__esModule",{value:!0});var Fq=Mq();Fq.code='require("ajv/dist/runtime/uri").default';nw.default=Fq});var zq=H(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.CodeGen=sr.Name=sr.nil=sr.stringify=sr.str=sr._=sr.KeywordCxt=void 0;var hB=yf();Object.defineProperty(sr,"KeywordCxt",{enumerable:!0,get:function(){return hB.KeywordCxt}});var ru=je();Object.defineProperty(sr,"_",{enumerable:!0,get:function(){return ru._}});Object.defineProperty(sr,"str",{enumerable:!0,get:function(){return ru.str}});Object.defineProperty(sr,"stringify",{enumerable:!0,get:function(){return ru.stringify}});Object.defineProperty(sr,"nil",{enumerable:!0,get:function(){return ru.nil}});Object.defineProperty(sr,"Name",{enumerable:!0,get:function(){return ru.Name}});Object.defineProperty(sr,"CodeGen",{enumerable:!0,get:function(){return ru.CodeGen}});var mB=Yh(),Bq=vf(),gB=PS(),Sf=Qh(),yB=je(),wf=hf(),tm=pf(),sw=Ke(),Lq=bq(),vB=Dq(),Vq=(t,e)=>new RegExp(t,e);Vq.code="new RegExp";var bB=["removeAdditional","useDefaults","coerceTypes"],SB=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),wB={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."},_B={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},jq=200;function RB(t){var e,r,n,i,s,o,l,f,c,p,h,g,v,_,w,E,k,T,N,$,j,G,O,C,A;let D=t.strict,B=(e=t.code)===null||e===void 0?void 0:e.optimize,F=B===!0||B===void 0?1:B||0,K=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Vq,ee=(i=t.uriResolver)!==null&&i!==void 0?i:vB.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:D)!==null&&o!==void 0?o:!0,strictNumbers:(f=(l=t.strictNumbers)!==null&&l!==void 0?l:D)!==null&&f!==void 0?f:!0,strictTypes:(p=(c=t.strictTypes)!==null&&c!==void 0?c:D)!==null&&p!==void 0?p:"log",strictTuples:(g=(h=t.strictTuples)!==null&&h!==void 0?h:D)!==null&&g!==void 0?g:"log",strictRequired:(_=(v=t.strictRequired)!==null&&v!==void 0?v:D)!==null&&_!==void 0?_:!1,code:t.code?{...t.code,optimize:F,regExp:K}:{optimize:F,regExp:K},loopRequired:(w=t.loopRequired)!==null&&w!==void 0?w:jq,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:jq,meta:(k=t.meta)!==null&&k!==void 0?k:!0,messages:(T=t.messages)!==null&&T!==void 0?T:!0,inlineRefs:(N=t.inlineRefs)!==null&&N!==void 0?N:!0,schemaId:($=t.schemaId)!==null&&$!==void 0?$:"$id",addUsedSchema:(j=t.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(G=t.validateSchema)!==null&&G!==void 0?G:!0,validateFormats:(O=t.validateFormats)!==null&&O!==void 0?O:!0,unicodeRegExp:(C=t.unicodeRegExp)!==null&&C!==void 0?C:!0,int32range:(A=t.int32range)!==null&&A!==void 0?A:!0,uriResolver:ee}}var _f=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,...RB(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new yB.ValueScope({scope:{},prefixes:SB,es5:r,lines:n}),this.logger=OB(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,gB.getRules)(),Uq.call(this,wB,e,"NOT SUPPORTED"),Uq.call(this,_B,e,"DEPRECATED","warn"),this._metaOpts=IB.call(this),e.formats&&xB.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&EB.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),CB.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Lq;n==="id"&&(i={...Lq},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){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(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){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,r);async function i(p,h){await s.call(this,p.$schema);let g=this._addSchema(p,h);return g.validate||o.call(this,g)}async function s(p){p&&!this.getSchema(p)&&await i.call(this,{$ref:p},!0)}async function o(p){try{return this._compileSchemaEnv(p)}catch(h){if(!(h instanceof Bq.default))throw h;return l.call(this,h),await f.call(this,h.missingSchema),o.call(this,p)}}function l({missingSchema:p,missingRef:h}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${h} cannot be resolved`)}async function f(p){let h=await c.call(this,p);this.refs[p]||await s.call(this,h.$schema),this.refs[p]||this.addSchema(h,p,r)}async function c(p){let h=this._loading[p];if(h)return h;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,wf.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){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&&r){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 r;for(;typeof(r=Hq.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Sf.SchemaEnv({schema:{},schemaId:n});if(r=Sf.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}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 r=Hq.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,wf.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.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(PB.call(this,n,r),!r)return(0,sw.eachItem)(n,s=>iw.call(this,s)),this;AB.call(this,r);let i={...r,type:(0,tm.getJSONTypes)(r.type),schemaType:(0,tm.getJSONTypes)(r.schemaType)};return(0,sw.eachItem)(n,i.type.length===0?s=>iw.call(this,s,i):s=>i.type.forEach(o=>iw.call(this,s,i,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),o=e;for(let l of s)o=o[l];for(let l in n){let f=n[l];if(typeof f!="object")continue;let{$data:c}=f.definition,p=o[l];c&&p&&(o[l]=Wq(p))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:l}=this.opts;if(typeof e=="object")o=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,wf.normalizeId)(o||n);let c=wf.getSchemaRefs.call(this,e,n);return f=new Sf.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:c}),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):Sf.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Sf.compileSchema.call(this,e)}finally{this.opts=r}}};_f.ValidationError=mB.default;_f.MissingRefError=Bq.default;sr.default=_f;function Uq(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function Hq(t){return t=(0,wf.normalizeId)(t),this.schemas[t]||this.refs[t]}function CB(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function xB(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function EB(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function IB(){let t={...this.opts};for(let e of bB)delete t[e];return t}var qB={log(){},warn(){},error(){}};function OB(t){if(t===!1)return qB;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var kB=/^[a-z_$][a-z0-9_$:-]*$/i;function PB(t,e){let{RULES:r}=this;if((0,sw.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!kB.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 iw(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:f})=>f===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,tm.getJSONTypes)(e.type),schemaType:(0,tm.getJSONTypes)(e.schemaType)}};e.before?TB.call(this,o,l,e.before):o.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function TB(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function AB(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Wq(e)),t.validateSchema=this.compile(e,!0))}var $B={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Wq(t){return{anyOf:[t,$B]}}});var Jq=H(ow=>{"use strict";Object.defineProperty(ow,"__esModule",{value:!0});var NB={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ow.default=NB});var Qq=H(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.callRef=Sa.getValidate=void 0;var MB=vf(),Gq=In(),Vr=je(),nu=ls(),Yq=Qh(),rm=Ke(),FB={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:l,self:f}=n,{root:c}=s;if((r==="#"||r==="#/")&&i===c.baseId)return h();let p=Yq.resolveRef.call(f,c,i,r);if(p===void 0)throw new MB.default(n.opts.uriResolver,i,r);if(p instanceof Yq.SchemaEnv)return g(p);return v(p);function h(){if(s===c)return nm(t,o,s,s.$async);let _=e.scopeValue("root",{ref:c});return nm(t,(0,Vr._)`${_}.validate`,c,c.$async)}function g(_){let w=Kq(t,_);nm(t,w,_,_.$async)}function v(_){let w=e.scopeValue("schema",l.code.source===!0?{ref:_,code:(0,Vr.stringify)(_)}:{ref:_}),E=e.name("valid"),k=t.subschema({schema:_,dataTypes:[],schemaPath:Vr.nil,topSchemaRef:w,errSchemaPath:r},E);t.mergeEvaluated(k),t.ok(E)}}};function Kq(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Vr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Sa.getValidate=Kq;function nm(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:l,opts:f}=s,c=f.passContext?nu.default.this:Vr.nil;n?p():h();function p(){if(!l.$async)throw new Error("async schema referenced by sync schema");let _=i.let("valid");i.try(()=>{i.code((0,Vr._)`await ${(0,Gq.callValidateCode)(t,e,c)}`),v(e),o||i.assign(_,!0)},w=>{i.if((0,Vr._)`!(${w} instanceof ${s.ValidationError})`,()=>i.throw(w)),g(w),o||i.assign(_,!1)}),t.ok(_)}function h(){t.result((0,Gq.callValidateCode)(t,e,c),()=>v(e),()=>g(e))}function g(_){let w=(0,Vr._)`${_}.errors`;i.assign(nu.default.vErrors,(0,Vr._)`${nu.default.vErrors} === null ? ${w} : ${nu.default.vErrors}.concat(${w})`),i.assign(nu.default.errors,(0,Vr._)`${nu.default.vErrors}.length`)}function v(_){var w;if(!s.opts.unevaluated)return;let E=(w=r?.validate)===null||w===void 0?void 0:w.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=rm.mergeEvaluated.props(i,E.props,s.props));else{let k=i.var("props",(0,Vr._)`${_}.evaluated.props`);s.props=rm.mergeEvaluated.props(i,k,s.props,Vr.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=rm.mergeEvaluated.items(i,E.items,s.items));else{let k=i.var("items",(0,Vr._)`${_}.evaluated.items`);s.items=rm.mergeEvaluated.items(i,k,s.items,Vr.Name)}}}Sa.callRef=nm;Sa.default=FB});var Zq=H(aw=>{"use strict";Object.defineProperty(aw,"__esModule",{value:!0});var DB=Jq(),LB=Qq(),jB=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",DB.default,LB.default];aw.default=jB});var Xq=H(lw=>{"use strict";Object.defineProperty(lw,"__esModule",{value:!0});var im=je(),to=im.operators,sm={maximum:{okStr:"<=",ok:to.LTE,fail:to.GT},minimum:{okStr:">=",ok:to.GTE,fail:to.LT},exclusiveMaximum:{okStr:"<",ok:to.LT,fail:to.GTE},exclusiveMinimum:{okStr:">",ok:to.GT,fail:to.LTE}},UB={message:({keyword:t,schemaCode:e})=>(0,im.str)`must be ${sm[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,im._)`{comparison: ${sm[t].okStr}, limit: ${e}}`},HB={keyword:Object.keys(sm),type:"number",schemaType:"number",$data:!0,error:UB,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,im._)`${r} ${sm[e].fail} ${n} || isNaN(${r})`)}};lw.default=HB});var eO=H(uw=>{"use strict";Object.defineProperty(uw,"__esModule",{value:!0});var Rf=je(),BB={message:({schemaCode:t})=>(0,Rf.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Rf._)`{multipleOf: ${t}}`},VB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:BB,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),l=s?(0,Rf._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,Rf._)`${o} !== parseInt(${o})`;t.fail$data((0,Rf._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};uw.default=VB});var rO=H(cw=>{"use strict";Object.defineProperty(cw,"__esModule",{value:!0});function tO(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}cw.default=tO;tO.code='require("ajv/dist/runtime/ucs2length").default'});var nO=H(fw=>{"use strict";Object.defineProperty(fw,"__esModule",{value:!0});var wa=je(),WB=Ke(),zB=rO(),JB={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,wa.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,wa._)`{limit: ${t}}`},GB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:JB,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?wa.operators.GT:wa.operators.LT,o=i.opts.unicode===!1?(0,wa._)`${r}.length`:(0,wa._)`${(0,WB.useFunc)(t.gen,zB.default)}(${r})`;t.fail$data((0,wa._)`${o} ${s} ${n}`)}};fw.default=GB});var iO=H(dw=>{"use strict";Object.defineProperty(dw,"__esModule",{value:!0});var YB=In(),KB=Ke(),iu=je(),QB={message:({schemaCode:t})=>(0,iu.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,iu._)`{pattern: ${t}}`},ZB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:QB,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t,l=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:f}=o.opts.code,c=f.code==="new RegExp"?(0,iu._)`new RegExp`:(0,KB.useFunc)(e,f),p=e.let("valid");e.try(()=>e.assign(p,(0,iu._)`${c}(${s}, ${l}).test(${r})`),()=>e.assign(p,!1)),t.fail$data((0,iu._)`!${p}`)}else{let f=(0,YB.usePattern)(t,i);t.fail$data((0,iu._)`!${f}.test(${r})`)}}};dw.default=ZB});var sO=H(pw=>{"use strict";Object.defineProperty(pw,"__esModule",{value:!0});var Cf=je(),XB={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Cf.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Cf._)`{limit: ${t}}`},eV={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:XB,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Cf.operators.GT:Cf.operators.LT;t.fail$data((0,Cf._)`Object.keys(${r}).length ${i} ${n}`)}};pw.default=eV});var oO=H(hw=>{"use strict";Object.defineProperty(hw,"__esModule",{value:!0});var xf=In(),Ef=je(),tV=Ke(),rV={message:({params:{missingProperty:t}})=>(0,Ef.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Ef._)`{missingProperty: ${t}}`},nV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:rV,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:o}=t,{opts:l}=o;if(!s&&r.length===0)return;let f=r.length>=l.loopRequired;if(o.allErrors?c():p(),l.strictRequired){let v=t.parentSchema.properties,{definedProperties:_}=t.it;for(let w of r)if(v?.[w]===void 0&&!_.has(w)){let E=o.schemaEnv.baseId+o.errSchemaPath,k=`required property "${w}" is not defined at "${E}" (strictRequired)`;(0,tV.checkStrictMode)(o,k,o.opts.strictRequired)}}function c(){if(f||s)t.block$data(Ef.nil,h);else for(let v of r)(0,xf.checkReportMissingProp)(t,v)}function p(){let v=e.let("missing");if(f||s){let _=e.let("valid",!0);t.block$data(_,()=>g(v,_)),t.ok(_)}else e.if((0,xf.checkMissingProp)(t,r,v)),(0,xf.reportMissingProp)(t,v),e.else()}function h(){e.forOf("prop",n,v=>{t.setParams({missingProperty:v}),e.if((0,xf.noPropertyInData)(e,i,v,l.ownProperties),()=>t.error())})}function g(v,_){t.setParams({missingProperty:v}),e.forOf(v,n,()=>{e.assign(_,(0,xf.propertyInData)(e,i,v,l.ownProperties)),e.if((0,Ef.not)(_),()=>{t.error(),e.break()})},Ef.nil)}}};hw.default=nV});var aO=H(mw=>{"use strict";Object.defineProperty(mw,"__esModule",{value:!0});var If=je(),iV={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,If.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,If._)`{limit: ${t}}`},sV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:iV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?If.operators.GT:If.operators.LT;t.fail$data((0,If._)`${r}.length ${i} ${n}`)}};mw.default=sV});var om=H(gw=>{"use strict";Object.defineProperty(gw,"__esModule",{value:!0});var lO=LS();lO.code='require("ajv/dist/runtime/equal").default';gw.default=lO});var uO=H(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});var yw=pf(),or=je(),oV=Ke(),aV=om(),lV={message:({params:{i:t,j:e}})=>(0,or.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,or._)`{i: ${t}, j: ${e}}`},uV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:lV,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:l}=t;if(!n&&!i)return;let f=e.let("valid"),c=s.items?(0,yw.getSchemaTypes)(s.items):[];t.block$data(f,p,(0,or._)`${o} === false`),t.ok(f);function p(){let _=e.let("i",(0,or._)`${r}.length`),w=e.let("j");t.setParams({i:_,j:w}),e.assign(f,!0),e.if((0,or._)`${_} > 1`,()=>(h()?g:v)(_,w))}function h(){return c.length>0&&!c.some(_=>_==="object"||_==="array")}function g(_,w){let E=e.name("item"),k=(0,yw.checkDataTypes)(c,E,l.opts.strictNumbers,yw.DataType.Wrong),T=e.const("indices",(0,or._)`{}`);e.for((0,or._)`;${_}--;`,()=>{e.let(E,(0,or._)`${r}[${_}]`),e.if(k,(0,or._)`continue`),c.length>1&&e.if((0,or._)`typeof ${E} == "string"`,(0,or._)`${E} += "_"`),e.if((0,or._)`typeof ${T}[${E}] == "number"`,()=>{e.assign(w,(0,or._)`${T}[${E}]`),t.error(),e.assign(f,!1).break()}).code((0,or._)`${T}[${E}] = ${_}`)})}function v(_,w){let E=(0,oV.useFunc)(e,aV.default),k=e.name("outer");e.label(k).for((0,or._)`;${_}--;`,()=>e.for((0,or._)`${w} = ${_}; ${w}--;`,()=>e.if((0,or._)`${E}(${r}[${_}], ${r}[${w}])`,()=>{t.error(),e.assign(f,!1).break(k)})))}}};vw.default=uV});var cO=H(Sw=>{"use strict";Object.defineProperty(Sw,"__esModule",{value:!0});var bw=je(),cV=Ke(),fV=om(),dV={message:"must be equal to constant",params:({schemaCode:t})=>(0,bw._)`{allowedValue: ${t}}`},pV={keyword:"const",$data:!0,error:dV,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,bw._)`!${(0,cV.useFunc)(e,fV.default)}(${r}, ${i})`):t.fail((0,bw._)`${s} !== ${r}`)}};Sw.default=pV});var fO=H(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});var qf=je(),hV=Ke(),mV=om(),gV={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,qf._)`{allowedValues: ${t}}`},yV={keyword:"enum",schemaType:"array",$data:!0,error:gV,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let l=i.length>=o.opts.loopEnum,f,c=()=>f??(f=(0,hV.useFunc)(e,mV.default)),p;if(l||n)p=e.let("valid"),t.block$data(p,h);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let v=e.const("vSchema",s);p=(0,qf.or)(...i.map((_,w)=>g(v,w)))}t.pass(p);function h(){e.assign(p,!1),e.forOf("v",s,v=>e.if((0,qf._)`${c()}(${r}, ${v})`,()=>e.assign(p,!0).break()))}function g(v,_){let w=i[_];return typeof w=="object"&&w!==null?(0,qf._)`${c()}(${r}, ${v}[${_}])`:(0,qf._)`${r} === ${w}`}}};ww.default=yV});var dO=H(_w=>{"use strict";Object.defineProperty(_w,"__esModule",{value:!0});var vV=Xq(),bV=eO(),SV=nO(),wV=iO(),_V=sO(),RV=oO(),CV=aO(),xV=uO(),EV=cO(),IV=fO(),qV=[vV.default,bV.default,SV.default,wV.default,_V.default,RV.default,CV.default,xV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},EV.default,IV.default];_w.default=qV});var Cw=H(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.validateAdditionalItems=void 0;var _a=je(),Rw=Ke(),OV={message:({params:{len:t}})=>(0,_a.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,_a._)`{limit: ${t}}`},kV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:OV,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Rw.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}pO(t,n)}};function pO(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let l=r.const("len",(0,_a._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,_a._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Rw.alwaysValidSchema)(o,n)){let c=r.var("valid",(0,_a._)`${l} <= ${e.length}`);r.if((0,_a.not)(c),()=>f(c)),t.ok(c)}function f(c){r.forRange("i",e.length,l,p=>{t.subschema({keyword:s,dataProp:p,dataPropType:Rw.Type.Num},c),o.allErrors||r.if((0,_a.not)(c),()=>r.break())})}}Of.validateAdditionalItems=pO;Of.default=kV});var xw=H(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.validateTuple=void 0;var hO=je(),am=Ke(),PV=In(),TV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return mO(t,"additionalItems",e);r.items=!0,!(0,am.alwaysValidSchema)(r,e)&&t.ok((0,PV.validateArray)(t))}};function mO(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:l}=t;p(i),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=am.mergeEvaluated.items(n,r.length,l.items));let f=n.name("valid"),c=n.const("len",(0,hO._)`${s}.length`);r.forEach((h,g)=>{(0,am.alwaysValidSchema)(l,h)||(n.if((0,hO._)`${c} > ${g}`,()=>t.subschema({keyword:o,schemaProp:g,dataProp:g},f)),t.ok(f))});function p(h){let{opts:g,errSchemaPath:v}=l,_=r.length,w=_===h.minItems&&(_===h.maxItems||h[e]===!1);if(g.strictTuples&&!w){let E=`"${o}" is ${_}-tuple, but minItems or maxItems/${e} are not specified or different at path "${v}"`;(0,am.checkStrictMode)(l,E,g.strictTuples)}}}kf.validateTuple=mO;kf.default=TV});var gO=H(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});var AV=xw(),$V={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,AV.validateTuple)(t,"items")};Ew.default=$V});var vO=H(Iw=>{"use strict";Object.defineProperty(Iw,"__esModule",{value:!0});var yO=je(),NV=Ke(),MV=In(),FV=Cw(),DV={message:({params:{len:t}})=>(0,yO.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,yO._)`{limit: ${t}}`},LV={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:DV,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,NV.alwaysValidSchema)(n,e)&&(i?(0,FV.validateAdditionalItems)(t,i):t.ok((0,MV.validateArray)(t)))}};Iw.default=LV});var bO=H(qw=>{"use strict";Object.defineProperty(qw,"__esModule",{value:!0});var On=je(),lm=Ke(),jV={message:({params:{min:t,max:e}})=>e===void 0?(0,On.str)`must contain at least ${t} valid item(s)`:(0,On.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,On._)`{minContains: ${t}}`:(0,On._)`{minContains: ${t}, maxContains: ${e}}`},UV={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:jV,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,l,{minContains:f,maxContains:c}=n;s.opts.next?(o=f===void 0?1:f,l=c):o=1;let p=e.const("len",(0,On._)`${i}.length`);if(t.setParams({min:o,max:l}),l===void 0&&o===0){(0,lm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,lm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,lm.alwaysValidSchema)(s,r)){let w=(0,On._)`${p} >= ${o}`;l!==void 0&&(w=(0,On._)`${w} && ${p} <= ${l}`),t.pass(w);return}s.items=!0;let h=e.name("valid");l===void 0&&o===1?v(h,()=>e.if(h,()=>e.break())):o===0?(e.let(h,!0),l!==void 0&&e.if((0,On._)`${i}.length > 0`,g)):(e.let(h,!1),g()),t.result(h,()=>t.reset());function g(){let w=e.name("_valid"),E=e.let("count",0);v(w,()=>e.if(w,()=>_(E)))}function v(w,E){e.forRange("i",0,p,k=>{t.subschema({keyword:"contains",dataProp:k,dataPropType:lm.Type.Num,compositeRule:!0},w),E()})}function _(w){e.code((0,On._)`${w}++`),l===void 0?e.if((0,On._)`${w} >= ${o}`,()=>e.assign(h,!0).break()):(e.if((0,On._)`${w} > ${l}`,()=>e.assign(h,!1).break()),o===1?e.assign(h,!0):e.if((0,On._)`${w} >= ${o}`,()=>e.assign(h,!0)))}}};qw.default=UV});var _O=H(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.validateSchemaDeps=Oi.validatePropertyDeps=Oi.error=void 0;var Ow=je(),HV=Ke(),Pf=In();Oi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Ow.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Ow._)`{property: ${t},
23
+ `+new Error().stack),S=!1}return y.apply(this,arguments)},y)}var A={};function D(d,y){e.deprecationHandler!=null&&e.deprecationHandler(d,y),A[d]||(q(y),A[d]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function B(d){return typeof Function<"u"&&d instanceof Function||Object.prototype.toString.call(d)==="[object Function]"}function F(d){var y,S;for(S in d)s(d,S)&&(y=d[S],B(y)?this[S]=y:this["_"+S]=y);this._config=d,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function K(d,y){var S=h({},d),R;for(R in y)s(y,R)&&(i(d[R])&&i(y[R])?(S[R]={},h(S[R],d[R]),h(S[R],y[R])):y[R]!=null?S[R]=y[R]:delete S[R]);for(R in d)s(d,R)&&!s(y,R)&&i(d[R])&&(S[R]=h({},S[R]));return S}function ee(d){d!=null&&this.set(d)}var ie;Object.keys?ie=Object.keys:ie=function(d){var y,S=[];for(y in d)s(d,y)&&S.push(y);return S};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 ke(d,y,S){var R=this._calendar[d]||this._calendar.sameElse;return B(R)?R.call(y,S):R}function de(d,y,S){var R=""+Math.abs(d),I=y-R.length,L=d>=0;return(L?S?"+":"":"-")+Math.pow(10,Math.max(0,I)).toString().substr(1)+R}var le=/(\[[^\[]*\])|(\\)?([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,ve=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,We={},mt={};function ce(d,y,S,R){var I=R;typeof R=="string"&&(I=function(){return this[R]()}),d&&(mt[d]=I),y&&(mt[y[0]]=function(){return de(I.apply(this,arguments),y[1],y[2])}),S&&(mt[S]=function(){return this.localeData().ordinal(I.apply(this,arguments),d)})}function rr(d){return d.match(/\[[\s\S]/)?d.replace(/^\[|\]$/g,""):d.replace(/\\/g,"")}function $e(d){var y=d.match(le),S,R;for(S=0,R=y.length;S<R;S++)mt[y[S]]?y[S]=mt[y[S]]:y[S]=rr(y[S]);return function(I){var L="",Y;for(Y=0;Y<R;Y++)L+=B(y[Y])?y[Y].call(I,d):y[Y];return L}}function nt(d,y){return d.isValid()?(y=Xr(y,d.localeData()),We[y]=We[y]||$e(y),We[y](d)):d.localeData().invalidDate()}function Xr(d,y){var S=5;function R(I){return y.longDateFormat(I)||I}for(ve.lastIndex=0;S>=0&&ve.test(d);)d=d.replace(ve,R),ve.lastIndex=0,S-=1;return d}var Ar={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 _t(d){var y=this._longDateFormat[d],S=this._longDateFormat[d.toUpperCase()];return y||!S?y:(this._longDateFormat[d]=S.match(le).map(function(R){return R==="MMMM"||R==="MM"||R==="DD"||R==="dddd"?R.slice(1):R}).join(""),this._longDateFormat[d])}var Rt="Invalid date";function pn(){return this._invalidDate}var Eo="%d",Zt=/\d{1,2}/;function Io(d){return this._ordinal.replace("%d",d)}var Ay={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 Mn(d,y,S,R){var I=this._relativeTime[S];return B(I)?I(d,y,S,R):I.replace(/%d/i,d)}function ap(d,y){var S=this._relativeTime[d>0?"future":"past"];return B(S)?S(y):S.replace(/%s/i,y)}var lp={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 Xt(d){return typeof d=="string"?lp[d]||lp[d.toLowerCase()]:void 0}function Sr(d){var y={},S,R;for(R in d)s(d,R)&&(S=Xt(R),S&&(y[S]=d[R]));return y}var Oo={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 Za(d){var y=[],S;for(S in d)s(d,S)&&y.push({unit:S,priority:Oo[S]});return y.sort(function(R,I){return R.priority-I.priority}),y}var up=/\d/,zt=/\d\d/,cp=/\d{3}/,ji=/\d{4}/,Fn=/[+-]?\d{6}/,pt=/\d\d?/,Xa=/\d\d\d\d?/,el=/\d\d\d\d\d\d?/,Cs=/\d{1,3}/,qo=/\d{1,4}/,xs=/[+-]?\d{1,6}/,yi=/\d+/,Es=/[+-]?\d+/,sc=/Z|[+-]\d\d:?\d\d/gi,tl=/Z|[+-]\d\d(?::?\d\d)?/gi,$y=/[+-]?\d+(\.\d{1,3})?/,ko=/[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,Ui=/^[1-9]\d?/,rl=/^([1-9]\d|\d)/,nl;nl={};function fe(d,y,S){nl[d]=B(y)?y:function(R,I){return R&&S?S:y}}function Ny(d,y){return s(nl,d)?nl[d](y._strict,y._locale):new RegExp(My(d))}function My(d){return hn(d.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(y,S,R,I,L){return S||R||I||L}))}function hn(d){return d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $r(d){return d<0?Math.ceil(d)||0:Math.floor(d)}function Fe(d){var y=+d,S=0;return y!==0&&isFinite(y)&&(S=$r(y)),S}var oc={};function it(d,y){var S,R=y,I;for(typeof d=="string"&&(d=[d]),f(y)&&(R=function(L,Y){Y[y]=Fe(L)}),I=d.length,S=0;S<I;S++)oc[d[S]]=R}function Po(d,y){it(d,function(S,R,I,L){I._w=I._w||{},y(S,I._w,I,L)})}function ac(d,y,S){y!=null&&s(oc,d)&&oc[d](y,S._a,S,d)}function il(d){return d%4===0&&d%100!==0||d%400===0}var er=0,Dn=1,mn=2,Ft=3,Nr=4,Ln=5,Hi=6,fp=7,Fy=8;ce("Y",0,0,function(){var d=this.year();return d<=9999?de(d,4):"+"+d}),ce(0,["YY",2],0,function(){return this.year()%100}),ce(0,["YYYY",4],0,"year"),ce(0,["YYYYY",5],0,"year"),ce(0,["YYYYYY",6,!0],0,"year"),fe("Y",Es),fe("YY",pt,zt),fe("YYYY",qo,ji),fe("YYYYY",xs,Fn),fe("YYYYYY",xs,Fn),it(["YYYYY","YYYYYY"],er),it("YYYY",function(d,y){y[er]=d.length===2?e.parseTwoDigitYear(d):Fe(d)}),it("YY",function(d,y){y[er]=e.parseTwoDigitYear(d)}),it("Y",function(d,y){y[er]=parseInt(d,10)});function To(d){return il(d)?366:365}e.parseTwoDigitYear=function(d){return Fe(d)+(Fe(d)>68?1900:2e3)};var dp=Is("FullYear",!0);function Dy(){return il(this.year())}function Is(d,y){return function(S){return S!=null?($o(this,d,S),e.updateOffset(this,y),this):Ao(this,d)}}function Ao(d,y){if(!d.isValid())return NaN;var S=d._d,R=d._isUTC;switch(y){case"Milliseconds":return R?S.getUTCMilliseconds():S.getMilliseconds();case"Seconds":return R?S.getUTCSeconds():S.getSeconds();case"Minutes":return R?S.getUTCMinutes():S.getMinutes();case"Hours":return R?S.getUTCHours():S.getHours();case"Date":return R?S.getUTCDate():S.getDate();case"Day":return R?S.getUTCDay():S.getDay();case"Month":return R?S.getUTCMonth():S.getMonth();case"FullYear":return R?S.getUTCFullYear():S.getFullYear();default:return NaN}}function $o(d,y,S){var R,I,L,Y,ae;if(!(!d.isValid()||isNaN(S))){switch(R=d._d,I=d._isUTC,y){case"Milliseconds":return void(I?R.setUTCMilliseconds(S):R.setMilliseconds(S));case"Seconds":return void(I?R.setUTCSeconds(S):R.setSeconds(S));case"Minutes":return void(I?R.setUTCMinutes(S):R.setMinutes(S));case"Hours":return void(I?R.setUTCHours(S):R.setHours(S));case"Date":return void(I?R.setUTCDate(S):R.setDate(S));case"FullYear":break;default:return}L=S,Y=d.month(),ae=d.date(),ae=ae===29&&Y===1&&!il(L)?28:ae,I?R.setUTCFullYear(L,Y,ae):R.setFullYear(L,Y,ae)}}function Ly(d){return d=Xt(d),B(this[d])?this[d]():this}function sl(d,y){if(typeof d=="object"){d=Sr(d);var S=Za(d),R,I=S.length;for(R=0;R<I;R++)this[S[R].unit](d[S[R].unit])}else if(d=Xt(d),B(this[d]))return this[d](y);return this}function jy(d,y){return(d%y+y)%y}var kt;Array.prototype.indexOf?kt=Array.prototype.indexOf:kt=function(d){var y;for(y=0;y<this.length;++y)if(this[y]===d)return y;return-1};function lc(d,y){if(isNaN(d)||isNaN(y))return NaN;var S=jy(y,12);return d+=(y-S)/12,S===1?il(d)?29:28:31-S%7%2}ce("M",["MM",2],"Mo",function(){return this.month()+1}),ce("MMM",0,0,function(d){return this.localeData().monthsShort(this,d)}),ce("MMMM",0,0,function(d){return this.localeData().months(this,d)}),fe("M",pt,Ui),fe("MM",pt,zt),fe("MMM",function(d,y){return y.monthsShortRegex(d)}),fe("MMMM",function(d,y){return y.monthsRegex(d)}),it(["M","MM"],function(d,y){y[Dn]=Fe(d)-1}),it(["MMM","MMMM"],function(d,y,S,R){var I=S._locale.monthsParse(d,R,S._strict);I!=null?y[Dn]=I:_(S).invalidMonth=d});var pp="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),uc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),cc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Uy=ko,Hy=ko;function By(d,y){return d?n(this._months)?this._months[d.month()]:this._months[(this._months.isFormat||cc).test(y)?"format":"standalone"][d.month()]:n(this._months)?this._months:this._months.standalone}function Vy(d,y){return d?n(this._monthsShort)?this._monthsShort[d.month()]:this._monthsShort[cc.test(y)?"format":"standalone"][d.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function hp(d,y,S){var R,I,L,Y=d.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],R=0;R<12;++R)L=g([2e3,R]),this._shortMonthsParse[R]=this.monthsShort(L,"").toLocaleLowerCase(),this._longMonthsParse[R]=this.months(L,"").toLocaleLowerCase();return S?y==="MMM"?(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:null):(I=kt.call(this._longMonthsParse,Y),I!==-1?I:null):y==="MMM"?(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:(I=kt.call(this._longMonthsParse,Y),I!==-1?I:null)):(I=kt.call(this._longMonthsParse,Y),I!==-1?I:(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:null))}function mp(d,y,S){var R,I,L;if(this._monthsParseExact)return hp.call(this,d,y,S);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),R=0;R<12;R++){if(I=g([2e3,R]),S&&!this._longMonthsParse[R]&&(this._longMonthsParse[R]=new RegExp("^"+this.months(I,"").replace(".","")+"$","i"),this._shortMonthsParse[R]=new RegExp("^"+this.monthsShort(I,"").replace(".","")+"$","i")),!S&&!this._monthsParse[R]&&(L="^"+this.months(I,"")+"|^"+this.monthsShort(I,""),this._monthsParse[R]=new RegExp(L.replace(".",""),"i")),S&&y==="MMMM"&&this._longMonthsParse[R].test(d))return R;if(S&&y==="MMM"&&this._shortMonthsParse[R].test(d))return R;if(!S&&this._monthsParse[R].test(d))return R}}function fc(d,y){if(!d.isValid())return d;if(typeof y=="string"){if(/^\d+$/.test(y))y=Fe(y);else if(y=d.localeData().monthsParse(y),!f(y))return d}var S=y,R=d.date();return R=R<29?R:Math.min(R,lc(d.year(),S)),d._isUTC?d._d.setUTCMonth(S,R):d._d.setMonth(S,R),d}function ol(d){return d!=null?(fc(this,d),e.updateOffset(this,!0),this):Ao(this,"Month")}function Wy(){return lc(this.year(),this.month())}function gp(d){return this._monthsParseExact?(s(this,"_monthsRegex")||dc.call(this),d?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Uy),this._monthsShortStrictRegex&&d?this._monthsShortStrictRegex:this._monthsShortRegex)}function al(d){return this._monthsParseExact?(s(this,"_monthsRegex")||dc.call(this),d?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Hy),this._monthsStrictRegex&&d?this._monthsStrictRegex:this._monthsRegex)}function dc(){function d(_e,Le){return Le.length-_e.length}var y=[],S=[],R=[],I,L,Y,ae;for(I=0;I<12;I++)L=g([2e3,I]),Y=hn(this.monthsShort(L,"")),ae=hn(this.months(L,"")),y.push(Y),S.push(ae),R.push(ae),R.push(Y);y.sort(d),S.sort(d),R.sort(d),this._monthsRegex=new RegExp("^("+R.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+y.join("|")+")","i")}function zy(d,y,S,R,I,L,Y){var ae;return d<100&&d>=0?(ae=new Date(d+400,y,S,R,I,L,Y),isFinite(ae.getFullYear())&&ae.setFullYear(d)):ae=new Date(d,y,S,R,I,L,Y),ae}function Os(d){var y,S;return d<100&&d>=0?(S=Array.prototype.slice.call(arguments),S[0]=d+400,y=new Date(Date.UTC.apply(null,S)),isFinite(y.getUTCFullYear())&&y.setUTCFullYear(d)):y=new Date(Date.UTC.apply(null,arguments)),y}function No(d,y,S){var R=7+y-S,I=(7+Os(d,0,R).getUTCDay()-y)%7;return-I+R-1}function ll(d,y,S,R,I){var L=(7+S-R)%7,Y=No(d,R,I),ae=1+7*(y-1)+L+Y,_e,Le;return ae<=0?(_e=d-1,Le=To(_e)+ae):ae>To(d)?(_e=d+1,Le=ae-To(d)):(_e=d,Le=ae),{year:_e,dayOfYear:Le}}function Mo(d,y,S){var R=No(d.year(),y,S),I=Math.floor((d.dayOfYear()-R-1)/7)+1,L,Y;return I<1?(Y=d.year()-1,L=I+gn(Y,y,S)):I>gn(d.year(),y,S)?(L=I-gn(d.year(),y,S),Y=d.year()+1):(Y=d.year(),L=I),{week:L,year:Y}}function gn(d,y,S){var R=No(d,y,S),I=No(d+1,y,S);return(To(d)-R+I)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),fe("w",pt,Ui),fe("ww",pt,zt),fe("W",pt,Ui),fe("WW",pt,zt),Po(["w","ww","W","WW"],function(d,y,S,R){y[R.substr(0,1)]=Fe(d)});function pc(d){return Mo(d,this._week.dow,this._week.doy).week}var hc={dow:0,doy:6};function qs(){return this._week.dow}function yp(){return this._week.doy}function vp(d){var y=this.localeData().week(this);return d==null?y:this.add((d-y)*7,"d")}function Jy(d){var y=Mo(this,1,4).week;return d==null?y:this.add((d-y)*7,"d")}ce("d",0,"do","day"),ce("dd",0,0,function(d){return this.localeData().weekdaysMin(this,d)}),ce("ddd",0,0,function(d){return this.localeData().weekdaysShort(this,d)}),ce("dddd",0,0,function(d){return this.localeData().weekdays(this,d)}),ce("e",0,0,"weekday"),ce("E",0,0,"isoWeekday"),fe("d",pt),fe("e",pt),fe("E",pt),fe("dd",function(d,y){return y.weekdaysMinRegex(d)}),fe("ddd",function(d,y){return y.weekdaysShortRegex(d)}),fe("dddd",function(d,y){return y.weekdaysRegex(d)}),Po(["dd","ddd","dddd"],function(d,y,S,R){var I=S._locale.weekdaysParse(d,R,S._strict);I!=null?y.d=I:_(S).invalidWeekday=d}),Po(["d","e","E"],function(d,y,S,R){y[R]=Fe(d)});function bp(d,y){return typeof d!="string"?d:isNaN(d)?(d=y.weekdaysParse(d),typeof d=="number"?d:null):parseInt(d,10)}function Sp(d,y){return typeof d=="string"?y.weekdaysParse(d)%7||7:isNaN(d)?null:d}function ul(d,y){return d.slice(y,7).concat(d.slice(0,y))}var wp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),_p="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Gy="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Yy=ko,Rp=ko,Ky=ko;function Qy(d,y){var S=n(this._weekdays)?this._weekdays:this._weekdays[d&&d!==!0&&this._weekdays.isFormat.test(y)?"format":"standalone"];return d===!0?ul(S,this._week.dow):d?S[d.day()]:S}function Zy(d){return d===!0?ul(this._weekdaysShort,this._week.dow):d?this._weekdaysShort[d.day()]:this._weekdaysShort}function Xy(d){return d===!0?ul(this._weekdaysMin,this._week.dow):d?this._weekdaysMin[d.day()]:this._weekdaysMin}function mc(d,y,S){var R,I,L,Y=d.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],R=0;R<7;++R)L=g([2e3,1]).day(R),this._minWeekdaysParse[R]=this.weekdaysMin(L,"").toLocaleLowerCase(),this._shortWeekdaysParse[R]=this.weekdaysShort(L,"").toLocaleLowerCase(),this._weekdaysParse[R]=this.weekdays(L,"").toLocaleLowerCase();return S?y==="dddd"?(I=kt.call(this._weekdaysParse,Y),I!==-1?I:null):y==="ddd"?(I=kt.call(this._shortWeekdaysParse,Y),I!==-1?I:null):(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null):y==="dddd"?(I=kt.call(this._weekdaysParse,Y),I!==-1||(I=kt.call(this._shortWeekdaysParse,Y),I!==-1)?I:(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null)):y==="ddd"?(I=kt.call(this._shortWeekdaysParse,Y),I!==-1||(I=kt.call(this._weekdaysParse,Y),I!==-1)?I:(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null)):(I=kt.call(this._minWeekdaysParse,Y),I!==-1||(I=kt.call(this._weekdaysParse,Y),I!==-1)?I:(I=kt.call(this._shortWeekdaysParse,Y),I!==-1?I:null))}function ev(d,y,S){var R,I,L;if(this._weekdaysParseExact)return mc.call(this,d,y,S);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),R=0;R<7;R++){if(I=g([2e3,1]).day(R),S&&!this._fullWeekdaysParse[R]&&(this._fullWeekdaysParse[R]=new RegExp("^"+this.weekdays(I,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[R]=new RegExp("^"+this.weekdaysShort(I,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[R]=new RegExp("^"+this.weekdaysMin(I,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[R]||(L="^"+this.weekdays(I,"")+"|^"+this.weekdaysShort(I,"")+"|^"+this.weekdaysMin(I,""),this._weekdaysParse[R]=new RegExp(L.replace(".",""),"i")),S&&y==="dddd"&&this._fullWeekdaysParse[R].test(d))return R;if(S&&y==="ddd"&&this._shortWeekdaysParse[R].test(d))return R;if(S&&y==="dd"&&this._minWeekdaysParse[R].test(d))return R;if(!S&&this._weekdaysParse[R].test(d))return R}}function tv(d){if(!this.isValid())return d!=null?this:NaN;var y=Ao(this,"Day");return d!=null?(d=bp(d,this.localeData()),this.add(d-y,"d")):y}function rv(d){if(!this.isValid())return d!=null?this:NaN;var y=(this.day()+7-this.localeData()._week.dow)%7;return d==null?y:this.add(d-y,"d")}function nv(d){if(!this.isValid())return d!=null?this:NaN;if(d!=null){var y=Sp(d,this.localeData());return this.day(this.day()%7?y:y-7)}else return this.day()||7}function iv(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||gc.call(this),d?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Yy),this._weekdaysStrictRegex&&d?this._weekdaysStrictRegex:this._weekdaysRegex)}function bt(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||gc.call(this),d?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Rp),this._weekdaysShortStrictRegex&&d?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function gt(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||gc.call(this),d?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ky),this._weekdaysMinStrictRegex&&d?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function gc(){function d(Ht,Wn){return Wn.length-Ht.length}var y=[],S=[],R=[],I=[],L,Y,ae,_e,Le;for(L=0;L<7;L++)Y=g([2e3,1]).day(L),ae=hn(this.weekdaysMin(Y,"")),_e=hn(this.weekdaysShort(Y,"")),Le=hn(this.weekdays(Y,"")),y.push(ae),S.push(_e),R.push(Le),I.push(ae),I.push(_e),I.push(Le);y.sort(d),S.sort(d),R.sort(d),I.sort(d),this._weekdaysRegex=new RegExp("^("+I.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+y.join("|")+")","i")}function yc(){return this.hours()%12||12}function sv(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,yc),ce("k",["kk",2],0,sv),ce("hmm",0,0,function(){return""+yc.apply(this)+de(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+yc.apply(this)+de(this.minutes(),2)+de(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+de(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+de(this.minutes(),2)+de(this.seconds(),2)});function Cp(d,y){ce(d,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),y)})}Cp("a",!0),Cp("A",!1);function xp(d,y){return y._meridiemParse}fe("a",xp),fe("A",xp),fe("H",pt,rl),fe("h",pt,Ui),fe("k",pt,Ui),fe("HH",pt,zt),fe("hh",pt,zt),fe("kk",pt,zt),fe("hmm",Xa),fe("hmmss",el),fe("Hmm",Xa),fe("Hmmss",el),it(["H","HH"],Ft),it(["k","kk"],function(d,y,S){var R=Fe(d);y[Ft]=R===24?0:R}),it(["a","A"],function(d,y,S){S._isPm=S._locale.isPM(d),S._meridiem=d}),it(["h","hh"],function(d,y,S){y[Ft]=Fe(d),_(S).bigHour=!0}),it("hmm",function(d,y,S){var R=d.length-2;y[Ft]=Fe(d.substr(0,R)),y[Nr]=Fe(d.substr(R)),_(S).bigHour=!0}),it("hmmss",function(d,y,S){var R=d.length-4,I=d.length-2;y[Ft]=Fe(d.substr(0,R)),y[Nr]=Fe(d.substr(R,2)),y[Ln]=Fe(d.substr(I)),_(S).bigHour=!0}),it("Hmm",function(d,y,S){var R=d.length-2;y[Ft]=Fe(d.substr(0,R)),y[Nr]=Fe(d.substr(R))}),it("Hmmss",function(d,y,S){var R=d.length-4,I=d.length-2;y[Ft]=Fe(d.substr(0,R)),y[Nr]=Fe(d.substr(R,2)),y[Ln]=Fe(d.substr(I))});function ov(d){return(d+"").toLowerCase().charAt(0)==="p"}var Ep=/[ap]\.?m?\.?/i,av=Is("Hours",!0);function Ut(d,y,S){return d>11?S?"pm":"PM":S?"am":"AM"}var cl={calendar:pe,longDateFormat:Ar,invalidDate:Rt,ordinal:Eo,dayOfMonthOrdinalParse:Zt,relativeTime:Ay,months:pp,monthsShort:uc,week:hc,weekdays:wp,weekdaysMin:Gy,weekdaysShort:_p,meridiemParse:Ep},st={},ks={},Bi;function Mr(d,y){var S,R=Math.min(d.length,y.length);for(S=0;S<R;S+=1)if(d[S]!==y[S])return S;return R}function vc(d){return d&&d.toLowerCase().replace("_","-")}function Ip(d){for(var y=0,S,R,I,L;y<d.length;){for(L=vc(d[y]).split("-"),S=L.length,R=vc(d[y+1]),R=R?R.split("-"):null;S>0;){if(I=Fo(L.slice(0,S).join("-")),I)return I;if(R&&R.length>=S&&Mr(L,R)>=S-1)break;S--}y++}return Bi}function Op(d){return!!(d&&d.match("^[^/\\\\]*$"))}function Fo(d){var y=null,S;if(st[d]===void 0&&typeof zl<"u"&&zl&&zl.exports&&Op(d))try{y=Bi._abbr,S=ft,S("./locale/"+d),jn(y)}catch{st[d]=null}return st[d]}function jn(d,y){var S;return d&&(l(y)?S=Un(d):S=fl(d,y),S?Bi=S:typeof console<"u"&&console.warn&&console.warn("Locale "+d+" not found. Did you forget to load it?")),Bi._abbr}function fl(d,y){if(y!==null){var S,R=cl;if(y.abbr=d,st[d]!=null)D("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."),R=st[d]._config;else if(y.parentLocale!=null)if(st[y.parentLocale]!=null)R=st[y.parentLocale]._config;else if(S=Fo(y.parentLocale),S!=null)R=S._config;else return ks[y.parentLocale]||(ks[y.parentLocale]=[]),ks[y.parentLocale].push({name:d,config:y}),null;return st[d]=new ee(K(R,y)),ks[d]&&ks[d].forEach(function(I){fl(I.name,I.config)}),jn(d),st[d]}else return delete st[d],null}function wr(d,y){if(y!=null){var S,R,I=cl;st[d]!=null&&st[d].parentLocale!=null?st[d].set(K(st[d]._config,y)):(R=Fo(d),R!=null&&(I=R._config),y=K(I,y),R==null&&(y.abbr=d),S=new ee(y),S.parentLocale=st[d],st[d]=S),jn(d)}else st[d]!=null&&(st[d].parentLocale!=null?(st[d]=st[d].parentLocale,d===jn()&&jn(d)):st[d]!=null&&delete st[d]);return st[d]}function Un(d){var y;if(d&&d._locale&&d._locale._abbr&&(d=d._locale._abbr),!d)return Bi;if(!n(d)){if(y=Fo(d),y)return y;d=[d]}return Ip(d)}function _r(){return ie(st)}function bc(d){var y,S=d._a;return S&&_(d).overflow===-2&&(y=S[Dn]<0||S[Dn]>11?Dn:S[mn]<1||S[mn]>lc(S[er],S[Dn])?mn:S[Ft]<0||S[Ft]>24||S[Ft]===24&&(S[Nr]!==0||S[Ln]!==0||S[Hi]!==0)?Ft:S[Nr]<0||S[Nr]>59?Nr:S[Ln]<0||S[Ln]>59?Ln:S[Hi]<0||S[Hi]>999?Hi:-1,_(d)._overflowDayOfYear&&(y<er||y>mn)&&(y=mn),_(d)._overflowWeeks&&y===-1&&(y=fp),_(d)._overflowWeekday&&y===-1&&(y=Fy),_(d).overflow=y),d}var qp=/^\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)?)?$/,vi=/^\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)?)?$/,dl=/Z|[+-]\d\d(?::?\d\d)?/,Ps=[["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]],yt=[["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/]],bi=/^\/?Date\((-?\d+)/i,Sc=/^(?:(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}))$/,lv={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function pl(d){var y,S,R=d._i,I=qp.exec(R)||vi.exec(R),L,Y,ae,_e,Le=Ps.length,Ht=yt.length;if(I){for(_(d).iso=!0,y=0,S=Le;y<S;y++)if(Ps[y][1].exec(I[1])){Y=Ps[y][0],L=Ps[y][2]!==!1;break}if(Y==null){d._isValid=!1;return}if(I[3]){for(y=0,S=Ht;y<S;y++)if(yt[y][1].exec(I[3])){ae=(I[2]||" ")+yt[y][0];break}if(ae==null){d._isValid=!1;return}}if(!L&&ae!=null){d._isValid=!1;return}if(I[4])if(dl.exec(I[4]))_e="Z";else{d._isValid=!1;return}d._f=Y+(ae||"")+(_e||""),ml(d)}else d._isValid=!1}function uv(d,y,S,R,I,L){var Y=[cv(d),uc.indexOf(y),parseInt(S,10),parseInt(R,10),parseInt(I,10)];return L&&Y.push(parseInt(L,10)),Y}function cv(d){var y=parseInt(d,10);return y<=49?2e3+y:y<=999?1900+y:y}function fv(d){return d.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function kp(d,y,S){if(d){var R=_p.indexOf(d),I=new Date(y[0],y[1],y[2]).getDay();if(R!==I)return _(S).weekdayMismatch=!0,S._isValid=!1,!1}return!0}function hl(d,y,S){if(d)return lv[d];if(y)return 0;var R=parseInt(S,10),I=R%100,L=(R-I)/100;return L*60+I}function Vi(d){var y=Sc.exec(fv(d._i)),S;if(y){if(S=uv(y[4],y[3],y[2],y[5],y[6],y[7]),!kp(y[1],S,d))return;d._a=S,d._tzm=hl(y[8],y[9],y[10]),d._d=Os.apply(null,d._a),d._d.setUTCMinutes(d._d.getUTCMinutes()-d._tzm),_(d).rfc2822=!0}else d._isValid=!1}function dv(d){var y=bi.exec(d._i);if(y!==null){d._d=new Date(+y[1]);return}if(pl(d),d._isValid===!1)delete d._isValid;else return;if(Vi(d),d._isValid===!1)delete d._isValid;else return;d._strict?d._isValid=!1:e.createFromInputFallback(d)}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(d){d._d=new Date(d._i+(d._useUTC?" UTC":""))});function Wi(d,y,S){return d??y??S}function Pp(d){var y=new Date(e.now());return d._useUTC?[y.getUTCFullYear(),y.getUTCMonth(),y.getUTCDate()]:[y.getFullYear(),y.getMonth(),y.getDate()]}function Do(d){var y,S,R=[],I,L,Y;if(!d._d){for(I=Pp(d),d._w&&d._a[mn]==null&&d._a[Dn]==null&&wc(d),d._dayOfYear!=null&&(Y=Wi(d._a[er],I[er]),(d._dayOfYear>To(Y)||d._dayOfYear===0)&&(_(d)._overflowDayOfYear=!0),S=Os(Y,0,d._dayOfYear),d._a[Dn]=S.getUTCMonth(),d._a[mn]=S.getUTCDate()),y=0;y<3&&d._a[y]==null;++y)d._a[y]=R[y]=I[y];for(;y<7;y++)d._a[y]=R[y]=d._a[y]==null?y===2?1:0:d._a[y];d._a[Ft]===24&&d._a[Nr]===0&&d._a[Ln]===0&&d._a[Hi]===0&&(d._nextDay=!0,d._a[Ft]=0),d._d=(d._useUTC?Os:zy).apply(null,R),L=d._useUTC?d._d.getUTCDay():d._d.getDay(),d._tzm!=null&&d._d.setUTCMinutes(d._d.getUTCMinutes()-d._tzm),d._nextDay&&(d._a[Ft]=24),d._w&&typeof d._w.d<"u"&&d._w.d!==L&&(_(d).weekdayMismatch=!0)}}function wc(d){var y,S,R,I,L,Y,ae,_e,Le;y=d._w,y.GG!=null||y.W!=null||y.E!=null?(L=1,Y=4,S=Wi(y.GG,d._a[er],Mo(lt(),1,4).year),R=Wi(y.W,1),I=Wi(y.E,1),(I<1||I>7)&&(_e=!0)):(L=d._locale._week.dow,Y=d._locale._week.doy,Le=Mo(lt(),L,Y),S=Wi(y.gg,d._a[er],Le.year),R=Wi(y.w,Le.week),y.d!=null?(I=y.d,(I<0||I>6)&&(_e=!0)):y.e!=null?(I=y.e+L,(y.e<0||y.e>6)&&(_e=!0)):I=L),R<1||R>gn(S,L,Y)?_(d)._overflowWeeks=!0:_e!=null?_(d)._overflowWeekday=!0:(ae=ll(S,R,I,L,Y),d._a[er]=ae.year,d._dayOfYear=ae.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function ml(d){if(d._f===e.ISO_8601){pl(d);return}if(d._f===e.RFC_2822){Vi(d);return}d._a=[],_(d).empty=!0;var y=""+d._i,S,R,I,L,Y,ae=y.length,_e=0,Le,Ht;for(I=Xr(d._f,d._locale).match(le)||[],Ht=I.length,S=0;S<Ht;S++)L=I[S],R=(y.match(Ny(L,d))||[])[0],R&&(Y=y.substr(0,y.indexOf(R)),Y.length>0&&_(d).unusedInput.push(Y),y=y.slice(y.indexOf(R)+R.length),_e+=R.length),mt[L]?(R?_(d).empty=!1:_(d).unusedTokens.push(L),ac(L,R,d)):d._strict&&!R&&_(d).unusedTokens.push(L);_(d).charsLeftOver=ae-_e,y.length>0&&_(d).unusedInput.push(y),d._a[Ft]<=12&&_(d).bigHour===!0&&d._a[Ft]>0&&(_(d).bigHour=void 0),_(d).parsedDateParts=d._a.slice(0),_(d).meridiem=d._meridiem,d._a[Ft]=pv(d._locale,d._a[Ft],d._meridiem),Le=_(d).era,Le!==null&&(d._a[er]=d._locale.erasConvertYear(Le,d._a[er])),Do(d),bc(d)}function pv(d,y,S){var R;return S==null?y:d.meridiemHour!=null?d.meridiemHour(y,S):(d.isPM!=null&&(R=d.isPM(S),R&&y<12&&(y+=12),!R&&y===12&&(y=0)),y)}function _c(d){var y,S,R,I,L,Y,ae=!1,_e=d._f.length;if(_e===0){_(d).invalidFormat=!0,d._d=new Date(NaN);return}for(I=0;I<_e;I++)L=0,Y=!1,y=$({},d),d._useUTC!=null&&(y._useUTC=d._useUTC),y._f=d._f[I],ml(y),E(y)&&(Y=!0),L+=_(y).charsLeftOver,L+=_(y).unusedTokens.length*10,_(y).score=L,ae?L<R&&(R=L,S=y):(R==null||L<R||Y)&&(R=L,S=y,Y&&(ae=!0));h(d,S||y)}function Rc(d){if(!d._d){var y=Sr(d._i),S=y.day===void 0?y.date:y.day;d._a=p([y.year,y.month,S,y.hour,y.minute,y.second,y.millisecond],function(R){return R&&parseInt(R,10)}),Do(d)}}function hv(d){var y=new j(bc(Cc(d)));return y._nextDay&&(y.add(1,"d"),y._nextDay=void 0),y}function Cc(d){var y=d._i,S=d._f;return d._locale=d._locale||Un(d._l),y===null||S===void 0&&y===""?k({nullInput:!0}):(typeof y=="string"&&(d._i=y=d._locale.preparse(y)),G(y)?new j(bc(y)):(c(y)?d._d=y:n(S)?_c(d):S?ml(d):Rr(d),E(d)||(d._d=null),d))}function Rr(d){var y=d._i;l(y)?d._d=new Date(e.now()):c(y)?d._d=new Date(y.valueOf()):typeof y=="string"?dv(d):n(y)?(d._a=p(y.slice(0),function(S){return parseInt(S,10)}),Do(d)):i(y)?Rc(d):f(y)?d._d=new Date(y):e.createFromInputFallback(d)}function gl(d,y,S,R,I){var L={};return(y===!0||y===!1)&&(R=y,y=void 0),(S===!0||S===!1)&&(R=S,S=void 0),(i(d)&&o(d)||n(d)&&d.length===0)&&(d=void 0),L._isAMomentObject=!0,L._useUTC=L._isUTC=I,L._l=S,L._i=d,L._f=y,L._strict=R,hv(L)}function lt(d,y,S,R){return gl(d,y,S,R,!1)}var Tp=C("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var d=lt.apply(null,arguments);return this.isValid()&&d.isValid()?d<this?this:d:k()}),Ap=C("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var d=lt.apply(null,arguments);return this.isValid()&&d.isValid()?d>this?this:d:k()});function $p(d,y){var S,R;if(y.length===1&&n(y[0])&&(y=y[0]),!y.length)return lt();for(S=y[0],R=1;R<y.length;++R)(!y[R].isValid()||y[R][d](S))&&(S=y[R]);return S}function mv(){var d=[].slice.call(arguments,0);return $p("isBefore",d)}function gv(){var d=[].slice.call(arguments,0);return $p("isAfter",d)}var yv=function(){return Date.now?Date.now():+new Date},Lo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ts(d){var y,S=!1,R,I=Lo.length;for(y in d)if(s(d,y)&&!(kt.call(Lo,y)!==-1&&(d[y]==null||!isNaN(d[y]))))return!1;for(R=0;R<I;++R)if(d[Lo[R]]){if(S)return!1;parseFloat(d[Lo[R]])!==Fe(d[Lo[R]])&&(S=!0)}return!0}function vv(){return this._isValid}function bv(){return ut(NaN)}function As(d){var y=Sr(d),S=y.year||0,R=y.quarter||0,I=y.month||0,L=y.week||y.isoWeek||0,Y=y.day||0,ae=y.hour||0,_e=y.minute||0,Le=y.second||0,Ht=y.millisecond||0;this._isValid=Ts(y),this._milliseconds=+Ht+Le*1e3+_e*6e4+ae*1e3*60*60,this._days=+Y+L*7,this._months=+I+R*3+S*12,this._data={},this._locale=Un(),this._bubble()}function jo(d){return d instanceof As}function yn(d){return d<0?Math.round(-1*d)*-1:Math.round(d)}function yl(d,y,S){var R=Math.min(d.length,y.length),I=Math.abs(d.length-y.length),L=0,Y;for(Y=0;Y<R;Y++)(S&&d[Y]!==y[Y]||!S&&Fe(d[Y])!==Fe(y[Y]))&&L++;return L+I}function Np(d,y){ce(d,0,0,function(){var S=this.utcOffset(),R="+";return S<0&&(S=-S,R="-"),R+de(~~(S/60),2)+y+de(~~S%60,2)})}Np("Z",":"),Np("ZZ",""),fe("Z",tl),fe("ZZ",tl),it(["Z","ZZ"],function(d,y,S){S._useUTC=!0,S._tzm=xc(tl,d)});var Sv=/([\+\-]|\d\d)/gi;function xc(d,y){var S=(y||"").match(d),R,I,L;return S===null?null:(R=S[S.length-1]||[],I=(R+"").match(Sv)||["-",0,0],L=+(I[1]*60)+Fe(I[2]),L===0?0:I[0]==="+"?L:-L)}function Si(d,y){var S,R;return y._isUTC?(S=y.clone(),R=(G(d)||c(d)?d.valueOf():lt(d).valueOf())-S.valueOf(),S._d.setTime(S._d.valueOf()+R),e.updateOffset(S,!1),S):lt(d).local()}function Cr(d){return-Math.round(d._d.getTimezoneOffset())}e.updateOffset=function(){};function Mp(d,y,S){var R=this._offset||0,I;if(!this.isValid())return d!=null?this:NaN;if(d!=null){if(typeof d=="string"){if(d=xc(tl,d),d===null)return this}else Math.abs(d)<16&&!S&&(d=d*60);return!this._isUTC&&y&&(I=Cr(this)),this._offset=d,this._isUTC=!0,I!=null&&this.add(I,"m"),R!==d&&(!y||this._changeInProgress?Uo(this,ut(d-R,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?R:Cr(this)}function wv(d,y){return d!=null?(typeof d!="string"&&(d=-d),this.utcOffset(d,y),this):-this.utcOffset()}function _v(d){return this.utcOffset(0,d)}function Rv(d){return this._isUTC&&(this.utcOffset(0,d),this._isUTC=!1,d&&this.subtract(Cr(this),"m")),this}function Cv(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var d=xc(sc,this._i);d!=null?this.utcOffset(d):this.utcOffset(0,!0)}return this}function xv(d){return this.isValid()?(d=d?lt(d).utcOffset():0,(this.utcOffset()-d)%60===0):!1}function wi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function V(){if(!l(this._isDSTShifted))return this._isDSTShifted;var d={},y;return $(d,this),d=Cc(d),d._a?(y=d._isUTC?g(d._a):lt(d._a),this._isDSTShifted=this.isValid()&&yl(d._a,y.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Q(){return this.isValid()?!this._isUTC:!1}function z(){return this.isValid()?this._isUTC:!1}function ue(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Re=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,tt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ut(d,y){var S=d,R=null,I,L,Y;return jo(d)?S={ms:d._milliseconds,d:d._days,M:d._months}:f(d)||!isNaN(+d)?(S={},y?S[y]=+d:S.milliseconds=+d):(R=Re.exec(d))?(I=R[1]==="-"?-1:1,S={y:0,d:Fe(R[mn])*I,h:Fe(R[Ft])*I,m:Fe(R[Nr])*I,s:Fe(R[Ln])*I,ms:Fe(yn(R[Hi]*1e3))*I}):(R=tt.exec(d))?(I=R[1]==="-"?-1:1,S={y:ze(R[2],I),M:ze(R[3],I),w:ze(R[4],I),d:ze(R[5],I),h:ze(R[6],I),m:ze(R[7],I),s:ze(R[8],I)}):S==null?S={}:typeof S=="object"&&("from"in S||"to"in S)&&(Y=Ev(lt(S.from),lt(S.to)),S={},S.ms=Y.milliseconds,S.M=Y.months),L=new As(S),jo(d)&&s(d,"_locale")&&(L._locale=d._locale),jo(d)&&s(d,"_isValid")&&(L._isValid=d._isValid),L}ut.fn=As.prototype,ut.invalid=bv;function ze(d,y){var S=d&&parseFloat(d.replace(",","."));return(isNaN(S)?0:S)*y}function vl(d,y){var S={};return S.months=y.month()-d.month()+(y.year()-d.year())*12,d.clone().add(S.months,"M").isAfter(y)&&--S.months,S.milliseconds=+y-+d.clone().add(S.months,"M"),S}function Ev(d,y){var S;return d.isValid()&&y.isValid()?(y=Si(y,d),d.isBefore(y)?S=vl(d,y):(S=vl(y,d),S.milliseconds=-S.milliseconds,S.months=-S.months),S):{milliseconds:0,months:0}}function xr(d,y){return function(S,R){var I,L;return R!==null&&!isNaN(+R)&&(D(y,"moment()."+y+"(period, number) is deprecated. Please use moment()."+y+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),L=S,S=R,R=L),I=ut(S,R),Uo(this,I,d),this}}function Uo(d,y,S,R){var I=y._milliseconds,L=yn(y._days),Y=yn(y._months);d.isValid()&&(R=R??!0,Y&&fc(d,Ao(d,"Month")+Y*S),L&&$o(d,"Date",Ao(d,"Date")+L*S),I&&d._d.setTime(d._d.valueOf()+I*S),R&&e.updateOffset(d,L||Y))}var Iv=xr(1,"add"),$s=xr(-1,"subtract");function Ho(d){return typeof d=="string"||d instanceof String}function bl(d){return G(d)||c(d)||Ho(d)||f(d)||Ov(d)||ot(d)||d===null||d===void 0}function ot(d){var y=i(d)&&!o(d),S=!1,R=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],I,L,Y=R.length;for(I=0;I<Y;I+=1)L=R[I],S=S||s(d,L);return y&&S}function Ov(d){var y=n(d),S=!1;return y&&(S=d.filter(function(R){return!f(R)&&Ho(d)}).length===0),y&&S}function Fp(d){var y=i(d)&&!o(d),S=!1,R=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],I,L;for(I=0;I<R.length;I+=1)L=R[I],S=S||s(d,L);return y&&S}function Sl(d,y){var S=d.diff(y,"days",!0);return S<-6?"sameElse":S<-1?"lastWeek":S<0?"lastDay":S<1?"sameDay":S<2?"nextDay":S<7?"nextWeek":"sameElse"}function qv(d,y){arguments.length===1&&(arguments[0]?bl(arguments[0])?(d=arguments[0],y=void 0):Fp(arguments[0])&&(y=arguments[0],d=void 0):(d=void 0,y=void 0));var S=d||lt(),R=Si(S,this).startOf("day"),I=e.calendarFormat(this,R)||"sameElse",L=y&&(B(y[I])?y[I].call(this,S):y[I]);return this.format(L||this.localeData().calendar(I,this,lt(S)))}function kv(){return new j(this)}function Pv(d,y){var S=G(d)?d:lt(d);return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()>S.valueOf():S.valueOf()<this.clone().startOf(y).valueOf()):!1}function wl(d,y){var S=G(d)?d:lt(d);return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()<S.valueOf():this.clone().endOf(y).valueOf()<S.valueOf()):!1}function _i(d,y,S,R){var I=G(d)?d:lt(d),L=G(y)?y:lt(y);return this.isValid()&&I.isValid()&&L.isValid()?(R=R||"()",(R[0]==="("?this.isAfter(I,S):!this.isBefore(I,S))&&(R[1]===")"?this.isBefore(L,S):!this.isAfter(L,S))):!1}function _l(d,y){var S=G(d)?d:lt(d),R;return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()===S.valueOf():(R=S.valueOf(),this.clone().startOf(y).valueOf()<=R&&R<=this.clone().endOf(y).valueOf())):!1}function Dp(d,y){return this.isSame(d,y)||this.isAfter(d,y)}function Rl(d,y){return this.isSame(d,y)||this.isBefore(d,y)}function Lp(d,y,S){var R,I,L;if(!this.isValid())return NaN;if(R=Si(d,this),!R.isValid())return NaN;switch(I=(R.utcOffset()-this.utcOffset())*6e4,y=Xt(y),y){case"year":L=Bo(this,R)/12;break;case"month":L=Bo(this,R);break;case"quarter":L=Bo(this,R)/3;break;case"second":L=(this-R)/1e3;break;case"minute":L=(this-R)/6e4;break;case"hour":L=(this-R)/36e5;break;case"day":L=(this-R-I)/864e5;break;case"week":L=(this-R-I)/6048e5;break;default:L=this-R}return S?L:$r(L)}function Bo(d,y){if(d.date()<y.date())return-Bo(y,d);var S=(y.year()-d.year())*12+(y.month()-d.month()),R=d.clone().add(S,"months"),I,L;return y-R<0?(I=d.clone().add(S-1,"months"),L=(y-R)/(R-I)):(I=d.clone().add(S+1,"months"),L=(y-R)/(I-R)),-(S+L)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Cl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function jp(d){if(!this.isValid())return null;var y=d!==!0,S=y?this.clone().utc():this;return S.year()<0||S.year()>9999?nt(S,y?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):B(Date.prototype.toISOString)?y?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",nt(S,"Z")):nt(S,y?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Vo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var d="moment",y="",S,R,I,L;return this.isLocal()||(d=this.utcOffset()===0?"moment.utc":"moment.parseZone",y="Z"),S="["+d+'("]',R=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",I="-MM-DD[T]HH:mm:ss.SSS",L=y+'[")]',this.format(S+R+I+L)}function zi(d){d||(d=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var y=nt(this,d);return this.localeData().postformat(y)}function xl(d,y){return this.isValid()&&(G(d)&&d.isValid()||lt(d).isValid())?ut({to:this,from:d}).locale(this.locale()).humanize(!y):this.localeData().invalidDate()}function Tv(d){return this.from(lt(),d)}function Av(d,y){return this.isValid()&&(G(d)&&d.isValid()||lt(d).isValid())?ut({from:this,to:d}).locale(this.locale()).humanize(!y):this.localeData().invalidDate()}function $v(d){return this.to(lt(),d)}function Wo(d){var y;return d===void 0?this._locale._abbr:(y=Un(d),y!=null&&(this._locale=y),this)}var zo=C("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(d){return d===void 0?this.localeData():this.locale(d)});function El(){return this._locale}var Il=1e3,Ji=60*Il,Ol=60*Ji,Up=(365*400+97)*24*Ol;function Ct(d,y){return(d%y+y)%y}function Jt(d,y,S){return d<100&&d>=0?new Date(d+400,y,S)-Up:new Date(d,y,S).valueOf()}function Hp(d,y,S){return d<100&&d>=0?Date.UTC(d+400,y,S)-Up:Date.UTC(d,y,S)}function Nv(d){var y,S;if(d=Xt(d),d===void 0||d==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?Hp:Jt,d){case"year":y=S(this.year(),0,1);break;case"quarter":y=S(this.year(),this.month()-this.month()%3,1);break;case"month":y=S(this.year(),this.month(),1);break;case"week":y=S(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":y=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":y=S(this.year(),this.month(),this.date());break;case"hour":y=this._d.valueOf(),y-=Ct(y+(this._isUTC?0:this.utcOffset()*Ji),Ol);break;case"minute":y=this._d.valueOf(),y-=Ct(y,Ji);break;case"second":y=this._d.valueOf(),y-=Ct(y,Il);break}return this._d.setTime(y),e.updateOffset(this,!0),this}function Bp(d){var y,S;if(d=Xt(d),d===void 0||d==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?Hp:Jt,d){case"year":y=S(this.year()+1,0,1)-1;break;case"quarter":y=S(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":y=S(this.year(),this.month()+1,1)-1;break;case"week":y=S(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":y=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":y=S(this.year(),this.month(),this.date()+1)-1;break;case"hour":y=this._d.valueOf(),y+=Ol-Ct(y+(this._isUTC?0:this.utcOffset()*Ji),Ol)-1;break;case"minute":y=this._d.valueOf(),y+=Ji-Ct(y,Ji)-1;break;case"second":y=this._d.valueOf(),y+=Il-Ct(y,Il)-1;break}return this._d.setTime(y),e.updateOffset(this,!0),this}function Mv(){return this._d.valueOf()-(this._offset||0)*6e4}function Ec(){return Math.floor(this.valueOf()/1e3)}function Jo(){return new Date(this.valueOf())}function Ic(){var d=this;return[d.year(),d.month(),d.date(),d.hour(),d.minute(),d.second(),d.millisecond()]}function Ns(){var d=this;return{years:d.year(),months:d.month(),date:d.date(),hours:d.hours(),minutes:d.minutes(),seconds:d.seconds(),milliseconds:d.milliseconds()}}function Go(){return this.isValid()?this.toISOString():null}function Yo(){return E(this)}function ql(){return h({},_(this))}function Ms(){return _(this).overflow}function Fv(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ce("N",0,0,"eraAbbr"),ce("NN",0,0,"eraAbbr"),ce("NNN",0,0,"eraAbbr"),ce("NNNN",0,0,"eraName"),ce("NNNNN",0,0,"eraNarrow"),ce("y",["y",1],"yo","eraYear"),ce("y",["yy",2],0,"eraYear"),ce("y",["yyy",3],0,"eraYear"),ce("y",["yyyy",4],0,"eraYear"),fe("N",ur),fe("NN",ur),fe("NNN",ur),fe("NNNN",De),fe("NNNNN",Hv),it(["N","NN","NNN","NNNN","NNNNN"],function(d,y,S,R){var I=S._locale.erasParse(d,R,S._strict);I?_(S).era=I:_(S).invalidEra=d}),fe("y",yi),fe("yy",yi),fe("yyy",yi),fe("yyyy",yi),fe("yo",Bv),it(["y","yy","yyy","yyyy"],er),it(["yo"],function(d,y,S,R){var I;S._locale._eraYearOrdinalRegex&&(I=d.match(S._locale._eraYearOrdinalRegex)),S._locale.eraYearOrdinalParse?y[er]=S._locale.eraYearOrdinalParse(d,I):y[er]=parseInt(d,10)});function Dv(d,y){var S,R,I,L=this._eras||Un("en")._eras;for(S=0,R=L.length;S<R;++S)switch(typeof L[S].since==="string"&&(I=e(L[S].since).startOf("day"),L[S].since=I.valueOf()),typeof L[S].until){case"undefined":L[S].until=1/0;break;case"string":I=e(L[S].until).startOf("day").valueOf(),L[S].until=I.valueOf();break}return L}function Lv(d,y,S){var R,I,L=this.eras(),Y,ae,_e;for(d=d.toUpperCase(),R=0,I=L.length;R<I;++R)if(Y=L[R].name.toUpperCase(),ae=L[R].abbr.toUpperCase(),_e=L[R].narrow.toUpperCase(),S)switch(y){case"N":case"NN":case"NNN":if(ae===d)return L[R];break;case"NNNN":if(Y===d)return L[R];break;case"NNNNN":if(_e===d)return L[R];break}else if([Y,ae,_e].indexOf(d)>=0)return L[R]}function jv(d,y){var S=d.since<=d.until?1:-1;return y===void 0?e(d.since).year():e(d.since).year()+(y-d.offset)*S}function Uv(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].name;return""}function kl(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].narrow;return""}function Ko(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].abbr;return""}function Vp(){var d,y,S,R,I=this.localeData().eras();for(d=0,y=I.length;d<y;++d)if(S=I[d].since<=I[d].until?1:-1,R=this.clone().startOf("day").valueOf(),I[d].since<=R&&R<=I[d].until||I[d].until<=R&&R<=I[d].since)return(this.year()-e(I[d].since).year())*S+I[d].offset;return this.year()}function O(d){return s(this,"_erasNameRegex")||Oc.call(this),d?this._erasNameRegex:this._erasRegex}function Fs(d){return s(this,"_erasAbbrRegex")||Oc.call(this),d?this._erasAbbrRegex:this._erasRegex}function Pl(d){return s(this,"_erasNarrowRegex")||Oc.call(this),d?this._erasNarrowRegex:this._erasRegex}function ur(d,y){return y.erasAbbrRegex(d)}function De(d,y){return y.erasNameRegex(d)}function Hv(d,y){return y.erasNarrowRegex(d)}function Bv(d,y){return y._eraYearOrdinalRegex||yi}function Oc(){var d=[],y=[],S=[],R=[],I,L,Y,ae,_e,Le=this.eras();for(I=0,L=Le.length;I<L;++I)Y=hn(Le[I].name),ae=hn(Le[I].abbr),_e=hn(Le[I].narrow),y.push(Y),d.push(ae),S.push(_e),R.push(Y),R.push(ae),R.push(_e);this._erasRegex=new RegExp("^("+R.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+y.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+d.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+S.join("|")+")","i")}ce(0,["gg",2],0,function(){return this.weekYear()%100}),ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function vn(d,y){ce(0,[d,d.length],0,y)}vn("gggg","weekYear"),vn("ggggg","weekYear"),vn("GGGG","isoWeekYear"),vn("GGGGG","isoWeekYear"),fe("G",Es),fe("g",Es),fe("GG",pt,zt),fe("gg",pt,zt),fe("GGGG",qo,ji),fe("gggg",qo,ji),fe("GGGGG",xs,Fn),fe("ggggg",xs,Fn),Po(["gggg","ggggg","GGGG","GGGGG"],function(d,y,S,R){y[R.substr(0,2)]=Fe(d)}),Po(["gg","GG"],function(d,y,S,R){y[R]=e.parseTwoDigitYear(d)});function Vv(d){return Wp.call(this,d,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Wv(d){return Wp.call(this,d,this.isoWeek(),this.isoWeekday(),1,4)}function zv(){return gn(this.year(),1,4)}function Jv(){return gn(this.isoWeekYear(),1,4)}function Gv(){var d=this.localeData()._week;return gn(this.year(),d.dow,d.doy)}function Hn(){var d=this.localeData()._week;return gn(this.weekYear(),d.dow,d.doy)}function Wp(d,y,S,R,I){var L;return d==null?Mo(this,R,I).year:(L=gn(d,R,I),y>L&&(y=L),Yv.call(this,d,y,S,R,I))}function Yv(d,y,S,R,I){var L=ll(d,y,S,R,I),Y=Os(L.year,0,L.dayOfYear);return this.year(Y.getUTCFullYear()),this.month(Y.getUTCMonth()),this.date(Y.getUTCDate()),this}ce("Q",0,"Qo","quarter"),fe("Q",up),it("Q",function(d,y){y[Dn]=(Fe(d)-1)*3});function Kv(d){return d==null?Math.ceil((this.month()+1)/3):this.month((d-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),fe("D",pt,Ui),fe("DD",pt,zt),fe("Do",function(d,y){return d?y._dayOfMonthOrdinalParse||y._ordinalParse:y._dayOfMonthOrdinalParseLenient}),it(["D","DD"],mn),it("Do",function(d,y){y[mn]=Fe(d.match(pt)[0])});var zp=Is("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),fe("DDD",Cs),fe("DDDD",cp),it(["DDD","DDDD"],function(d,y,S){S._dayOfYear=Fe(d)});function Qv(d){var y=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return d==null?y:this.add(d-y,"d")}ce("m",["mm",2],0,"minute"),fe("m",pt,rl),fe("mm",pt,zt),it(["m","mm"],Nr);var Bn=Is("Minutes",!1);ce("s",["ss",2],0,"second"),fe("s",pt,rl),fe("ss",pt,zt),it(["s","ss"],Ln);var Zv=Is("Seconds",!1);ce("S",0,0,function(){return~~(this.millisecond()/100)}),ce(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ce(0,["SSS",3],0,"millisecond"),ce(0,["SSSS",4],0,function(){return this.millisecond()*10}),ce(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ce(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ce(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ce(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ce(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),fe("S",Cs,up),fe("SS",Cs,zt),fe("SSS",Cs,cp);var Ri,Jp;for(Ri="SSSS";Ri.length<=9;Ri+="S")fe(Ri,yi);function Xv(d,y){y[Hi]=Fe(("0."+d)*1e3)}for(Ri="S";Ri.length<=9;Ri+="S")it(Ri,Xv);Jp=Is("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function eb(){return this._isUTC?"UTC":""}function Gi(){return this._isUTC?"Coordinated Universal Time":""}var re=j.prototype;re.add=Iv,re.calendar=qv,re.clone=kv,re.diff=Lp,re.endOf=Bp,re.format=zi,re.from=xl,re.fromNow=Tv,re.to=Av,re.toNow=$v,re.get=Ly,re.invalidAt=Ms,re.isAfter=Pv,re.isBefore=wl,re.isBetween=_i,re.isSame=_l,re.isSameOrAfter=Dp,re.isSameOrBefore=Rl,re.isValid=Yo,re.lang=zo,re.locale=Wo,re.localeData=El,re.max=Ap,re.min=Tp,re.parsingFlags=ql,re.set=sl,re.startOf=Nv,re.subtract=$s,re.toArray=Ic,re.toObject=Ns,re.toDate=Jo,re.toISOString=jp,re.inspect=Vo,typeof Symbol<"u"&&Symbol.for!=null&&(re[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),re.toJSON=Go,re.toString=Cl,re.unix=Ec,re.valueOf=Mv,re.creationData=Fv,re.eraName=Uv,re.eraNarrow=kl,re.eraAbbr=Ko,re.eraYear=Vp,re.year=dp,re.isLeapYear=Dy,re.weekYear=Vv,re.isoWeekYear=Wv,re.quarter=re.quarters=Kv,re.month=ol,re.daysInMonth=Wy,re.week=re.weeks=vp,re.isoWeek=re.isoWeeks=Jy,re.weeksInYear=Gv,re.weeksInWeekYear=Hn,re.isoWeeksInYear=zv,re.isoWeeksInISOWeekYear=Jv,re.date=zp,re.day=re.days=tv,re.weekday=rv,re.isoWeekday=nv,re.dayOfYear=Qv,re.hour=re.hours=av,re.minute=re.minutes=Bn,re.second=re.seconds=Zv,re.millisecond=re.milliseconds=Jp,re.utcOffset=Mp,re.utc=_v,re.local=Rv,re.parseZone=Cv,re.hasAlignedHourOffset=xv,re.isDST=wi,re.isLocal=Q,re.isUtcOffset=z,re.isUtc=ue,re.isUTC=ue,re.zoneAbbr=eb,re.zoneName=Gi,re.dates=C("dates accessor is deprecated. Use date instead.",zp),re.months=C("months accessor is deprecated. Use month instead",ol),re.years=C("years accessor is deprecated. Use year instead",dp),re.zone=C("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",wv),re.isDSTShifted=C("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",V);function tb(d){return lt(d*1e3)}function en(){return lt.apply(null,arguments).parseZone()}function Gp(d){return d}var Ye=ee.prototype;Ye.calendar=ke,Ye.longDateFormat=_t,Ye.invalidDate=pn,Ye.ordinal=Io,Ye.preparse=Gp,Ye.postformat=Gp,Ye.relativeTime=Mn,Ye.pastFuture=ap,Ye.set=F,Ye.eras=Dv,Ye.erasParse=Lv,Ye.erasConvertYear=jv,Ye.erasAbbrRegex=Fs,Ye.erasNameRegex=O,Ye.erasNarrowRegex=Pl,Ye.months=By,Ye.monthsShort=Vy,Ye.monthsParse=mp,Ye.monthsRegex=al,Ye.monthsShortRegex=gp,Ye.week=pc,Ye.firstDayOfYear=yp,Ye.firstDayOfWeek=qs,Ye.weekdays=Qy,Ye.weekdaysMin=Xy,Ye.weekdaysShort=Zy,Ye.weekdaysParse=ev,Ye.weekdaysRegex=iv,Ye.weekdaysShortRegex=bt,Ye.weekdaysMinRegex=gt,Ye.isPM=ov,Ye.meridiem=Ut;function Tl(d,y,S,R){var I=Un(),L=g().set(R,y);return I[S](L,d)}function Yp(d,y,S){if(f(d)&&(y=d,d=void 0),d=d||"",y!=null)return Tl(d,y,S,"month");var R,I=[];for(R=0;R<12;R++)I[R]=Tl(d,R,S,"month");return I}function qc(d,y,S,R){typeof d=="boolean"?(f(y)&&(S=y,y=void 0),y=y||""):(y=d,S=y,d=!1,f(y)&&(S=y,y=void 0),y=y||"");var I=Un(),L=d?I._week.dow:0,Y,ae=[];if(S!=null)return Tl(y,(S+L)%7,R,"day");for(Y=0;Y<7;Y++)ae[Y]=Tl(y,(Y+L)%7,R,"day");return ae}function Kp(d,y){return Yp(d,y,"months")}function Qp(d,y){return Yp(d,y,"monthsShort")}function rb(d,y,S){return qc(d,y,S,"weekdays")}function nb(d,y,S){return qc(d,y,S,"weekdaysShort")}function kc(d,y,S){return qc(d,y,S,"weekdaysMin")}jn("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(d){var y=d%10,S=Fe(d%100/10)===1?"th":y===1?"st":y===2?"nd":y===3?"rd":"th";return d+S}}),e.lang=C("moment.lang is deprecated. Use moment.locale instead.",jn),e.langData=C("moment.langData is deprecated. Use moment.localeData instead.",Un);var Er=Math.abs;function Al(){var d=this._data;return this._milliseconds=Er(this._milliseconds),this._days=Er(this._days),this._months=Er(this._months),d.milliseconds=Er(d.milliseconds),d.seconds=Er(d.seconds),d.minutes=Er(d.minutes),d.hours=Er(d.hours),d.months=Er(d.months),d.years=Er(d.years),this}function Zp(d,y,S,R){var I=ut(y,S);return d._milliseconds+=R*I._milliseconds,d._days+=R*I._days,d._months+=R*I._months,d._bubble()}function Xp(d,y){return Zp(this,d,y,1)}function ib(d,y){return Zp(this,d,y,-1)}function tn(d){return d<0?Math.floor(d):Math.ceil(d)}function Pc(){var d=this._milliseconds,y=this._days,S=this._months,R=this._data,I,L,Y,ae,_e;return d>=0&&y>=0&&S>=0||d<=0&&y<=0&&S<=0||(d+=tn(cr(S)+y)*864e5,y=0,S=0),R.milliseconds=d%1e3,I=$r(d/1e3),R.seconds=I%60,L=$r(I/60),R.minutes=L%60,Y=$r(L/60),R.hours=Y%24,y+=$r(Y/24),_e=$r(Ci(y)),S+=_e,y-=tn(cr(_e)),ae=$r(S/12),S%=12,R.days=y,R.months=S,R.years=ae,this}function Ci(d){return d*4800/146097}function cr(d){return d*146097/4800}function sb(d){if(!this.isValid())return NaN;var y,S,R=this._milliseconds;if(d=Xt(d),d==="month"||d==="quarter"||d==="year")switch(y=this._days+R/864e5,S=this._months+Ci(y),d){case"month":return S;case"quarter":return S/3;case"year":return S/12}else switch(y=this._days+Math.round(cr(this._months)),d){case"week":return y/7+R/6048e5;case"day":return y+R/864e5;case"hour":return y*24+R/36e5;case"minute":return y*1440+R/6e4;case"second":return y*86400+R/1e3;case"millisecond":return Math.floor(y*864e5)+R;default:throw new Error("Unknown unit "+d)}}function bn(d){return function(){return this.as(d)}}var Tc=bn("ms"),Qo=bn("s"),xi=bn("m"),eh=bn("h"),ob=bn("d"),$l=bn("w"),ab=bn("M"),th=bn("Q"),Gt=bn("y"),Ac=Tc;function rh(){return ut(this)}function Sn(d){return d=Xt(d),this.isValid()?this[d+"s"]():NaN}function Vn(d){return function(){return this.isValid()?this._data[d]:NaN}}var Nl=Vn("milliseconds"),Yi=Vn("seconds"),nh=Vn("minutes"),nr=Vn("hours"),$c=Vn("days"),lb=Vn("months"),ub=Vn("years");function cb(){return $r(this.days()/7)}var rn=Math.round,Ds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Zo(d,y,S,R,I){return I.relativeTime(y||1,!!S,d,R)}function ih(d,y,S,R){var I=ut(d).abs(),L=rn(I.as("s")),Y=rn(I.as("m")),ae=rn(I.as("h")),_e=rn(I.as("d")),Le=rn(I.as("M")),Ht=rn(I.as("w")),Wn=rn(I.as("y")),zn=L<=S.ss&&["s",L]||L<S.s&&["ss",L]||Y<=1&&["m"]||Y<S.m&&["mm",Y]||ae<=1&&["h"]||ae<S.h&&["hh",ae]||_e<=1&&["d"]||_e<S.d&&["dd",_e];return S.w!=null&&(zn=zn||Ht<=1&&["w"]||Ht<S.w&&["ww",Ht]),zn=zn||Le<=1&&["M"]||Le<S.M&&["MM",Le]||Wn<=1&&["y"]||["yy",Wn],zn[2]=y,zn[3]=+d>0,zn[4]=R,Zo.apply(null,zn)}function fb(d){return d===void 0?rn:typeof d=="function"?(rn=d,!0):!1}function db(d,y){return Ds[d]===void 0?!1:y===void 0?Ds[d]:(Ds[d]=y,d==="s"&&(Ds.ss=y-1),!0)}function Xo(d,y){if(!this.isValid())return this.localeData().invalidDate();var S=!1,R=Ds,I,L;return typeof d=="object"&&(y=d,d=!1),typeof d=="boolean"&&(S=d),typeof y=="object"&&(R=Object.assign({},Ds,y),y.s!=null&&y.ss==null&&(R.ss=y.s-1)),I=this.localeData(),L=ih(this,!S,R,I),S&&(L=I.pastFuture(+this,L)),I.postformat(L)}var Nc=Math.abs;function Ls(d){return(d>0)-(d<0)||+d}function js(){if(!this.isValid())return this.localeData().invalidDate();var d=Nc(this._milliseconds)/1e3,y=Nc(this._days),S=Nc(this._months),R,I,L,Y,ae=this.asSeconds(),_e,Le,Ht,Wn;return ae?(R=$r(d/60),I=$r(R/60),d%=60,R%=60,L=$r(S/12),S%=12,Y=d?d.toFixed(3).replace(/\.?0+$/,""):"",_e=ae<0?"-":"",Le=Ls(this._months)!==Ls(ae)?"-":"",Ht=Ls(this._days)!==Ls(ae)?"-":"",Wn=Ls(this._milliseconds)!==Ls(ae)?"-":"",_e+"P"+(L?Le+L+"Y":"")+(S?Le+S+"M":"")+(y?Ht+y+"D":"")+(I||R||d?"T":"")+(I?Wn+I+"H":"")+(R?Wn+R+"M":"")+(d?Wn+Y+"S":"")):"P0D"}var He=As.prototype;He.isValid=vv,He.abs=Al,He.add=Xp,He.subtract=ib,He.as=sb,He.asMilliseconds=Tc,He.asSeconds=Qo,He.asMinutes=xi,He.asHours=eh,He.asDays=ob,He.asWeeks=$l,He.asMonths=ab,He.asQuarters=th,He.asYears=Gt,He.valueOf=Ac,He._bubble=Pc,He.clone=rh,He.get=Sn,He.milliseconds=Nl,He.seconds=Yi,He.minutes=nh,He.hours=nr,He.days=$c,He.weeks=cb,He.months=lb,He.years=ub,He.humanize=Xo,He.toISOString=js,He.toString=js,He.toJSON=js,He.locale=Wo,He.localeData=El,He.toIsoString=C("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",js),He.lang=zo,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),fe("x",Es),fe("X",$y),it("X",function(d,y,S){S._d=new Date(parseFloat(d)*1e3)}),it("x",function(d,y,S){S._d=new Date(Fe(d))});return e.version="2.30.1",r(lt),e.fn=re,e.min=mv,e.max=gv,e.now=yv,e.utc=g,e.unix=tb,e.months=Kp,e.isDate=c,e.locale=jn,e.invalid=k,e.duration=ut,e.isMoment=G,e.weekdays=rb,e.parseZone=en,e.localeData=Un,e.isDuration=jo,e.monthsShort=Qp,e.weekdaysMin=kc,e.defineLocale=fl,e.updateLocale=wr,e.locales=_r,e.weekdaysShort=nb,e.normalizeUnits=Xt,e.relativeTimeRounding=fb,e.relativeTimeThreshold=db,e.calendarFormat=Sl,e.prototype=re,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 SI=H((bI,Mh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Mh<"u"&&Mh.exports?Mh.exports=e():t.tv4=e()})(bI,function(){Object.keys||(Object.keys=(function(){var q=Object.prototype.hasOwnProperty,C=!{toString:null}.propertyIsEnumerable("toString"),A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],D=A.length;return function(B){if(typeof B!="object"&&typeof B!="function"||B===null)throw new TypeError("Object.keys called on non-object");var F=[];for(var K in B)q.call(B,K)&&F.push(K);if(C)for(var ee=0;ee<D;ee++)q.call(B,A[ee])&&F.push(A[ee]);return F}})()),Object.create||(Object.create=(function(){function q(){}return function(C){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return q.prototype=C,new q}})()),Array.isArray||(Array.isArray=function(q){return Object.prototype.toString.call(q)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(q){if(this===null)throw new TypeError;var C=Object(this),A=C.length>>>0;if(A===0)return-1;var D=0;if(arguments.length>1&&(D=Number(arguments[1]),D!==D?D=0:D!==0&&D!==1/0&&D!==-1/0&&(D=(D>0||-1)*Math.floor(Math.abs(D)))),D>=A)return-1;for(var B=D>=0?D:Math.max(A-Math.abs(D),0);B<A;B++)if(B in C&&C[B]===q)return B;return-1}),Object.isFrozen||(Object.isFrozen=function(q){for(var C="tv4_test_frozen_key";q.hasOwnProperty(C);)C+=Math.random();try{return q[C]=!0,delete q[C],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(q){return encodeURI(q).replace(/%25[0-9][0-9]/g,function(C){return"%"+C.substring(3)})}function n(q){var C="";t[q.charAt(0)]&&(C=q.charAt(0),q=q.substring(1));var A="",D="",B=!0,F=!1,K=!1;C==="+"?B=!1:C==="."?(D=".",A="."):C==="/"?(D="/",A="/"):C==="#"?(D="#",B=!1):C===";"?(D=";",A=";",F=!0,K=!0):C==="?"?(D="?",A="&",F=!0):C==="&"&&(D="&",A="&",F=!0);for(var ee=[],ie=q.split(","),pe=[],ke={},de=0;de<ie.length;de++){var le=ie[de],ve=null;if(le.indexOf(":")!==-1){var We=le.split(":");le=We[0],ve=parseInt(We[1],10)}for(var mt={};e[le.charAt(le.length-1)];)mt[le.charAt(le.length-1)]=!0,le=le.substring(0,le.length-1);var ce={truncate:ve,name:le,suffices:mt};pe.push(ce),ke[le]=ce,ee.push(le)}var rr=function($e){for(var nt="",Xr=0,Ar=0;Ar<pe.length;Ar++){var _t=pe[Ar],Rt=$e(_t.name);if(Rt==null||Array.isArray(Rt)&&Rt.length===0||typeof Rt=="object"&&Object.keys(Rt).length===0){Xr++;continue}if(Ar===Xr?nt+=D:nt+=A||",",Array.isArray(Rt)){F&&(nt+=_t.name+"=");for(var pn=0;pn<Rt.length;pn++)pn>0&&(nt+=_t.suffices["*"]&&A||",",_t.suffices["*"]&&F&&(nt+=_t.name+"=")),nt+=B?encodeURIComponent(Rt[pn]).replace(/!/g,"%21"):r(Rt[pn])}else if(typeof Rt=="object"){F&&!_t.suffices["*"]&&(nt+=_t.name+"=");var Eo=!0;for(var Zt in Rt)Eo||(nt+=_t.suffices["*"]&&A||","),Eo=!1,nt+=B?encodeURIComponent(Zt).replace(/!/g,"%21"):r(Zt),nt+=_t.suffices["*"]?"=":",",nt+=B?encodeURIComponent(Rt[Zt]).replace(/!/g,"%21"):r(Rt[Zt])}else F&&(nt+=_t.name,(!K||Rt!=="")&&(nt+="=")),_t.truncate!=null&&(Rt=Rt.substring(0,_t.truncate)),nt+=B?encodeURIComponent(Rt).replace(/!/g,"%21"):r(Rt)}return nt};return rr.varNames=ee,{prefix:D,substitution:rr}}function i(q){if(!(this instanceof i))return new i(q);for(var C=q.split("{"),A=[C.shift()],D=[],B=[],F=[];C.length>0;){var K=C.shift(),ee=K.split("}")[0],ie=K.substring(ee.length+1),pe=n(ee);B.push(pe.substitution),D.push(pe.prefix),A.push(ie),F=F.concat(pe.substitution.varNames)}this.fill=function(ke){for(var de=A[0],le=0;le<B.length;le++){var ve=B[le];de+=ve(ke),de+=A[le+1]}return de},this.varNames=F,this.template=q}i.prototype={toString:function(){return this.template},fillFromObject:function(q){return this.fill(function(C){return q[C]})}};var s=function(C,A,D,B,F){if(this.missing=[],this.missingMap={},this.formatValidators=C?Object.create(C.formatValidators):{},this.schemas=C?Object.create(C.schemas):{},this.collectMultiple=A,this.errors=[],this.handleError=A?this.collectError:this.returnError,B&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),F&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=D||v("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},C)for(var K in C.definedKeywords)this.definedKeywords[K]=C.definedKeywords[K].slice(0)};s.prototype.defineKeyword=function(q,C){this.definedKeywords[q]=this.definedKeywords[q]||[],this.definedKeywords[q].push(C)},s.prototype.createError=function(q,C,A,D,B,F,K){var ee=new T(q,C,A,D,B);return ee.message=this.errorReporter(ee,F,K),ee},s.prototype.returnError=function(q){return q},s.prototype.collectError=function(q){return q&&this.errors.push(q),null},s.prototype.prefixErrors=function(q,C,A){for(var D=q;D<this.errors.length;D++)this.errors[D]=this.errors[D].prefixWith(C,A);return this},s.prototype.banUnknownProperties=function(q,C){for(var A in this.unknownPropertyPaths){var D=this.createError(_.UNKNOWN_PROPERTY,{path:A},A,"",null,q,C),B=this.handleError(D);if(B)return B}return null},s.prototype.addFormat=function(q,C){if(typeof q=="object"){for(var A in q)this.addFormat(A,q[A]);return this}this.formatValidators[q]=C},s.prototype.resolveRefs=function(q,C){if(q.$ref!==void 0){if(C=C||{},C[q.$ref])return this.createError(_.CIRCULAR_REFERENCE,{urls:Object.keys(C).join(", ")},"","",null,void 0,q);C[q.$ref]=!0,q=this.getSchema(q.$ref,C)}return q},s.prototype.getSchema=function(q,C){var A;if(this.schemas[q]!==void 0)return A=this.schemas[q],this.resolveRefs(A,C);var D=q,B="";if(q.indexOf("#")!==-1&&(B=q.substring(q.indexOf("#")+1),D=q.substring(0,q.indexOf("#"))),typeof this.schemas[D]=="object"){A=this.schemas[D];var F=decodeURIComponent(B);if(F==="")return this.resolveRefs(A,C);if(F.charAt(0)!=="/")return;for(var K=F.split("/").slice(1),ee=0;ee<K.length;ee++){var ie=K[ee].replace(/~1/g,"/").replace(/~0/g,"~");if(A[ie]===void 0){A=void 0;break}A=A[ie]}if(A!==void 0)return this.resolveRefs(A,C)}this.missing[D]===void 0&&(this.missing.push(D),this.missing[D]=D,this.missingMap[D]=D)},s.prototype.searchSchemas=function(q,C){if(Array.isArray(q))for(var A=0;A<q.length;A++)this.searchSchemas(q[A],C);else if(q&&typeof q=="object"){typeof q.id=="string"&&N(C,q.id)&&this.schemas[q.id]===void 0&&(this.schemas[q.id]=q);for(var D in q)if(D!=="enum"){if(typeof q[D]=="object")this.searchSchemas(q[D],C);else if(D==="$ref"){var B=h(q[D]);B&&this.schemas[B]===void 0&&this.missingMap[B]===void 0&&(this.missingMap[B]=B)}}}},s.prototype.addSchema=function(q,C){if(typeof q!="string"||typeof C>"u")if(typeof q=="object"&&typeof q.id=="string")C=q,q=C.id;else return;q===h(q)+"#"&&(q=h(q)),this.schemas[q]=C,delete this.missingMap[q],g(C,q),this.searchSchemas(C,q)},s.prototype.getSchemaMap=function(){var q={};for(var C in this.schemas)q[C]=this.schemas[C];return q},s.prototype.getSchemaUris=function(q){var C=[];for(var A in this.schemas)(!q||q.test(A))&&C.push(A);return C},s.prototype.getMissingUris=function(q){var C=[];for(var A in this.missingMap)(!q||q.test(A))&&C.push(A);return C},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(q,C,A,D,B){var F;if(C=this.resolveRefs(C),C){if(C instanceof T)return this.errors.push(C),C}else return null;var K=this.errors.length,ee,ie=null,pe=null;if(this.checkRecursive&&q&&typeof q=="object"){if(F=!this.scanned.length,q[this.validatedSchemasKey]){var ke=q[this.validatedSchemasKey].indexOf(C);if(ke!==-1)return this.errors=this.errors.concat(q[this.validationErrorsKey][ke]),null}if(Object.isFrozen(q)&&(ee=this.scannedFrozen.indexOf(q),ee!==-1)){var de=this.scannedFrozenSchemas[ee].indexOf(C);if(de!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[ee][de]),null}if(this.scanned.push(q),Object.isFrozen(q))ee===-1&&(ee=this.scannedFrozen.length,this.scannedFrozen.push(q),this.scannedFrozenSchemas.push([])),ie=this.scannedFrozenSchemas[ee].length,this.scannedFrozenSchemas[ee][ie]=C,this.scannedFrozenValidationErrors[ee][ie]=[];else{if(!q[this.validatedSchemasKey])try{Object.defineProperty(q,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(q,this.validationErrorsKey,{value:[],configurable:!0})}catch{q[this.validatedSchemasKey]=[],q[this.validationErrorsKey]=[]}pe=q[this.validatedSchemasKey].length,q[this.validatedSchemasKey][pe]=C,q[this.validationErrorsKey][pe]=[]}}var le=this.errors.length,ve=this.validateBasic(q,C,B)||this.validateNumeric(q,C,B)||this.validateString(q,C,B)||this.validateArray(q,C,B)||this.validateObject(q,C,B)||this.validateCombinations(q,C,B)||this.validateHypermedia(q,C,B)||this.validateFormat(q,C,B)||this.validateDefinedKeywords(q,C,B)||null;if(F){for(;this.scanned.length;){var We=this.scanned.pop();delete We[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(ve||le!==this.errors.length)for(;A&&A.length||D&&D.length;){var mt=A&&A.length?""+A.pop():null,ce=D&&D.length?""+D.pop():null;ve&&(ve=ve.prefixWith(mt,ce)),this.prefixErrors(le,mt,ce)}return ie!==null?this.scannedFrozenValidationErrors[ee][ie]=this.errors.slice(K):pe!==null&&(q[this.validationErrorsKey][pe]=this.errors.slice(K)),this.handleError(ve)},s.prototype.validateFormat=function(q,C){if(typeof C.format!="string"||!this.formatValidators[C.format])return null;var A=this.formatValidators[C.format].call(null,q,C);return typeof A=="string"||typeof A=="number"?this.createError(_.FORMAT_CUSTOM,{message:A},"","/format",null,q,C):A&&typeof A=="object"?this.createError(_.FORMAT_CUSTOM,{message:A.message||"?"},A.dataPath||"",A.schemaPath||"/format",null,q,C):null},s.prototype.validateDefinedKeywords=function(q,C,A){for(var D in this.definedKeywords)if(!(typeof C[D]>"u"))for(var B=this.definedKeywords[D],F=0;F<B.length;F++){var K=B[F],ee=K(q,C[D],C,A);if(typeof ee=="string"||typeof ee=="number")return this.createError(_.KEYWORD_CUSTOM,{key:D,message:ee},"","",null,q,C).prefixWith(null,D);if(ee&&typeof ee=="object"){var ie=ee.code;if(typeof ie=="string"){if(!_[ie])throw new Error("Undefined error code (use defineError): "+ie);ie=_[ie]}else typeof ie!="number"&&(ie=_.KEYWORD_CUSTOM);var pe=typeof ee.message=="object"?ee.message:{key:D,message:ee.message||"?"},ke=ee.schemaPath||"/"+D.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ie,pe,ee.dataPath||null,ke,null,q,C)}}return null};function o(q,C){if(q===C)return!0;if(q&&C&&typeof q=="object"&&typeof C=="object"){if(Array.isArray(q)!==Array.isArray(C))return!1;if(Array.isArray(q)){if(q.length!==C.length)return!1;for(var A=0;A<q.length;A++)if(!o(q[A],C[A]))return!1}else{var D;for(D in q)if(C[D]===void 0&&q[D]!==void 0)return!1;for(D in C)if(q[D]===void 0&&C[D]!==void 0)return!1;for(D in q)if(!o(q[D],C[D]))return!1}return!0}return!1}s.prototype.validateBasic=function(C,A,D){var B;return(B=this.validateType(C,A,D))||(B=this.validateEnum(C,A,D))?B.prefixWith(null,"type"):null},s.prototype.validateType=function(C,A){if(A.type===void 0)return null;var D=typeof C;C===null?D="null":Array.isArray(C)&&(D="array");var B=A.type;Array.isArray(B)||(B=[B]);for(var F=0;F<B.length;F++){var K=B[F];if(K===D||K==="integer"&&D==="number"&&C%1===0)return null}return this.createError(_.INVALID_TYPE,{type:D,expected:B.join("/")},"","",null,C,A)},s.prototype.validateEnum=function(C,A){if(A.enum===void 0)return null;for(var D=0;D<A.enum.length;D++){var B=A.enum[D];if(o(C,B))return null}return this.createError(_.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(C):C},"","",null,C,A)},s.prototype.validateNumeric=function(C,A,D){return this.validateMultipleOf(C,A,D)||this.validateMinMax(C,A,D)||this.validateNaN(C,A,D)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(C,A){var D=A.multipleOf||A.divisibleBy;if(D===void 0)return null;if(typeof C=="number"){var B=C/D%1;if(B>=l&&B<f)return this.createError(_.NUMBER_MULTIPLE_OF,{value:C,multipleOf:D},"","",null,C,A)}return null},s.prototype.validateMinMax=function(C,A){if(typeof C!="number")return null;if(A.minimum!==void 0){if(C<A.minimum)return this.createError(_.NUMBER_MINIMUM,{value:C,minimum:A.minimum},"","/minimum",null,C,A);if(A.exclusiveMinimum&&C===A.minimum)return this.createError(_.NUMBER_MINIMUM_EXCLUSIVE,{value:C,minimum:A.minimum},"","/exclusiveMinimum",null,C,A)}if(A.maximum!==void 0){if(C>A.maximum)return this.createError(_.NUMBER_MAXIMUM,{value:C,maximum:A.maximum},"","/maximum",null,C,A);if(A.exclusiveMaximum&&C===A.maximum)return this.createError(_.NUMBER_MAXIMUM_EXCLUSIVE,{value:C,maximum:A.maximum},"","/exclusiveMaximum",null,C,A)}return null},s.prototype.validateNaN=function(C,A){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,A):null},s.prototype.validateString=function(C,A,D){return this.validateStringLength(C,A,D)||this.validateStringPattern(C,A,D)||null},s.prototype.validateStringLength=function(C,A){return typeof C!="string"?null:A.minLength!==void 0&&C.length<A.minLength?this.createError(_.STRING_LENGTH_SHORT,{length:C.length,minimum:A.minLength},"","/minLength",null,C,A):A.maxLength!==void 0&&C.length>A.maxLength?this.createError(_.STRING_LENGTH_LONG,{length:C.length,maximum:A.maxLength},"","/maxLength",null,C,A):null},s.prototype.validateStringPattern=function(C,A){if(typeof C!="string"||typeof A.pattern!="string"&&!(A.pattern instanceof RegExp))return null;var D;if(A.pattern instanceof RegExp)D=A.pattern;else{var B,F="",K=A.pattern.match(/^\/(.+)\/([img]*)$/);K?(B=K[1],F=K[2]):B=A.pattern,D=new RegExp(B,F)}return D.test(C)?null:this.createError(_.STRING_PATTERN,{pattern:A.pattern},"","/pattern",null,C,A)},s.prototype.validateArray=function(C,A,D){return Array.isArray(C)&&(this.validateArrayLength(C,A,D)||this.validateArrayUniqueItems(C,A,D)||this.validateArrayItems(C,A,D))||null},s.prototype.validateArrayLength=function(C,A){var D;return A.minItems!==void 0&&C.length<A.minItems&&(D=this.createError(_.ARRAY_LENGTH_SHORT,{length:C.length,minimum:A.minItems},"","/minItems",null,C,A),this.handleError(D))||A.maxItems!==void 0&&C.length>A.maxItems&&(D=this.createError(_.ARRAY_LENGTH_LONG,{length:C.length,maximum:A.maxItems},"","/maxItems",null,C,A),this.handleError(D))?D:null},s.prototype.validateArrayUniqueItems=function(C,A){if(A.uniqueItems){for(var D=0;D<C.length;D++)for(var B=D+1;B<C.length;B++)if(o(C[D],C[B])){var F=this.createError(_.ARRAY_UNIQUE,{match1:D,match2:B},"","/uniqueItems",null,C,A);if(this.handleError(F))return F}}return null},s.prototype.validateArrayItems=function(C,A,D){if(A.items===void 0)return null;var B,F;if(Array.isArray(A.items)){for(F=0;F<C.length;F++)if(F<A.items.length){if(B=this.validateAll(C[F],A.items[F],[F],["items",F],D+"/"+F))return B}else if(A.additionalItems!==void 0){if(typeof A.additionalItems=="boolean"){if(!A.additionalItems&&(B=this.createError(_.ARRAY_ADDITIONAL_ITEMS,{},"/"+F,"/additionalItems",null,C,A),this.handleError(B)))return B}else if(B=this.validateAll(C[F],A.additionalItems,[F],["additionalItems"],D+"/"+F))return B}}else for(F=0;F<C.length;F++)if(B=this.validateAll(C[F],A.items,[F],["items"],D+"/"+F))return B;return null},s.prototype.validateObject=function(C,A,D){return typeof C!="object"||C===null||Array.isArray(C)?null:this.validateObjectMinMaxProperties(C,A,D)||this.validateObjectRequiredProperties(C,A,D)||this.validateObjectProperties(C,A,D)||this.validateObjectDependencies(C,A,D)||null},s.prototype.validateObjectMinMaxProperties=function(C,A){var D=Object.keys(C),B;return A.minProperties!==void 0&&D.length<A.minProperties&&(B=this.createError(_.OBJECT_PROPERTIES_MINIMUM,{propertyCount:D.length,minimum:A.minProperties},"","/minProperties",null,C,A),this.handleError(B))||A.maxProperties!==void 0&&D.length>A.maxProperties&&(B=this.createError(_.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:D.length,maximum:A.maxProperties},"","/maxProperties",null,C,A),this.handleError(B))?B:null},s.prototype.validateObjectRequiredProperties=function(C,A){if(A.required!==void 0)for(var D=0;D<A.required.length;D++){var B=A.required[D];if(C[B]===void 0){var F=this.createError(_.OBJECT_REQUIRED,{key:B},"","/required/"+D,null,C,A);if(this.handleError(F))return F}}return null},s.prototype.validateObjectProperties=function(C,A,D){var B;for(var F in C){var K=D+"/"+F.replace(/~/g,"~0").replace(/\//g,"~1"),ee=!1;if(A.properties!==void 0&&A.properties[F]!==void 0&&(ee=!0,B=this.validateAll(C[F],A.properties[F],[F],["properties",F],K)))return B;if(A.patternProperties!==void 0)for(var ie in A.patternProperties){var pe=new RegExp(ie);if(pe.test(F)&&(ee=!0,B=this.validateAll(C[F],A.patternProperties[ie],[F],["patternProperties",ie],K)))return B}if(ee)this.trackUnknownProperties&&(this.knownPropertyPaths[K]=!0,delete this.unknownPropertyPaths[K]);else if(A.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[K]=!0,delete this.unknownPropertyPaths[K]),typeof A.additionalProperties=="boolean"){if(!A.additionalProperties&&(B=this.createError(_.OBJECT_ADDITIONAL_PROPERTIES,{key:F},"","/additionalProperties",null,C,A).prefixWith(F,null),this.handleError(B)))return B}else if(B=this.validateAll(C[F],A.additionalProperties,[F],["additionalProperties"],K))return B}else this.trackUnknownProperties&&!this.knownPropertyPaths[K]&&(this.unknownPropertyPaths[K]=!0)}return null},s.prototype.validateObjectDependencies=function(C,A,D){var B;if(A.dependencies!==void 0){for(var F in A.dependencies)if(C[F]!==void 0){var K=A.dependencies[F];if(typeof K=="string"){if(C[K]===void 0&&(B=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:F,missing:K},"","",null,C,A).prefixWith(null,F).prefixWith(null,"dependencies"),this.handleError(B)))return B}else if(Array.isArray(K))for(var ee=0;ee<K.length;ee++){var ie=K[ee];if(C[ie]===void 0&&(B=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:F,missing:ie},"","/"+ee,null,C,A).prefixWith(null,F).prefixWith(null,"dependencies"),this.handleError(B)))return B}else if(B=this.validateAll(C,K,[],["dependencies",F],D))return B}}return null},s.prototype.validateCombinations=function(C,A,D){return this.validateAllOf(C,A,D)||this.validateAnyOf(C,A,D)||this.validateOneOf(C,A,D)||this.validateNot(C,A,D)||null},s.prototype.validateAllOf=function(C,A,D){if(A.allOf===void 0)return null;for(var B,F=0;F<A.allOf.length;F++){var K=A.allOf[F];if(B=this.validateAll(C,K,[],["allOf",F],D))return B}return null},s.prototype.validateAnyOf=function(C,A,D){if(A.anyOf===void 0)return null;var B=[],F=this.errors.length,K,ee;this.trackUnknownProperties&&(K=this.unknownPropertyPaths,ee=this.knownPropertyPaths);for(var ie=!0,pe=0;pe<A.anyOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var ke=A.anyOf[pe],de=this.errors.length,le=this.validateAll(C,ke,[],["anyOf",pe],D);if(le===null&&de===this.errors.length){if(this.errors=this.errors.slice(0,F),this.trackUnknownProperties){for(var ve in this.knownPropertyPaths)ee[ve]=!0,delete K[ve];for(var We in this.unknownPropertyPaths)ee[We]||(K[We]=!0);ie=!1;continue}return null}le&&B.push(le.prefixWith(null,""+pe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=K,this.knownPropertyPaths=ee),ie)return B=B.concat(this.errors.slice(F)),this.errors=this.errors.slice(0,F),this.createError(_.ANY_OF_MISSING,{},"","/anyOf",B,C,A)},s.prototype.validateOneOf=function(C,A,D){if(A.oneOf===void 0)return null;var B=null,F=[],K=this.errors.length,ee,ie;this.trackUnknownProperties&&(ee=this.unknownPropertyPaths,ie=this.knownPropertyPaths);for(var pe=0;pe<A.oneOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var ke=A.oneOf[pe],de=this.errors.length,le=this.validateAll(C,ke,[],["oneOf",pe],D);if(le===null&&de===this.errors.length){if(B===null)B=pe;else return this.errors=this.errors.slice(0,K),this.createError(_.ONE_OF_MULTIPLE,{index1:B,index2:pe},"","/oneOf",null,C,A);if(this.trackUnknownProperties){for(var ve in this.knownPropertyPaths)ie[ve]=!0,delete ee[ve];for(var We in this.unknownPropertyPaths)ie[We]||(ee[We]=!0)}}else le&&F.push(le)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=ee,this.knownPropertyPaths=ie),B===null?(F=F.concat(this.errors.slice(K)),this.errors=this.errors.slice(0,K),this.createError(_.ONE_OF_MISSING,{},"","/oneOf",F,C,A)):(this.errors=this.errors.slice(0,K),null)},s.prototype.validateNot=function(C,A,D){if(A.not===void 0)return null;var B=this.errors.length,F,K;this.trackUnknownProperties&&(F=this.unknownPropertyPaths,K=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var ee=this.validateAll(C,A.not,null,null,D),ie=this.errors.slice(B);return this.errors=this.errors.slice(0,B),this.trackUnknownProperties&&(this.unknownPropertyPaths=F,this.knownPropertyPaths=K),ee===null&&ie.length===0?this.createError(_.NOT_PASSED,{},"","/not",null,C,A):null},s.prototype.validateHypermedia=function(C,A,D){if(!A.links)return null;for(var B,F=0;F<A.links.length;F++){var K=A.links[F];if(K.rel==="describedby"){for(var ee=new i(K.href),ie=!0,pe=0;pe<ee.varNames.length;pe++)if(!(ee.varNames[pe]in C)){ie=!1;break}if(ie){var ke=ee.fillFromObject(C),de={$ref:ke};if(B=this.validateAll(C,de,[],["links",F],D))return B}}}};function c(q){var C=String(q).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 p(q,C){function A(D){var B=[];return D.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(F){F==="/.."?B.pop():B.push(F)}),B.join("").replace(/^\//,D.charAt(0)==="/"?"/":"")}return C=c(C||""),q=c(q||""),!C||!q?null:(C.protocol||q.protocol)+(C.protocol||C.authority?C.authority:q.authority)+A(C.protocol||C.authority||C.pathname.charAt(0)==="/"?C.pathname:C.pathname?(q.authority&&!q.pathname?"/":"")+q.pathname.slice(0,q.pathname.lastIndexOf("/")+1)+C.pathname:q.pathname)+(C.protocol||C.authority||C.pathname?C.search:C.search||q.search)+C.hash}function h(q){return q.split("#")[0]}function g(q,C){if(q&&typeof q=="object")if(C===void 0?C=q.id:typeof q.id=="string"&&(C=p(C,q.id),q.id=C),Array.isArray(q))for(var A=0;A<q.length;A++)g(q[A],C);else{typeof q.$ref=="string"&&(q.$ref=p(C,q.$ref));for(var D in q)D!=="enum"&&g(q[D],C)}}function v(q){q=q||"en";var C=$[q];return function(A){var D=C[A.code]||k[A.code];if(typeof D!="string")return"Unknown error code "+A.code+": "+JSON.stringify(A.messageParams);var B=A.params;return D.replace(/\{([^{}]*)\}/g,function(F,K){var ee=B[K];return typeof ee=="string"||typeof ee=="number"?ee:F})}}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},w={};for(var E in _)w[_[E]]=E;var k={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 T(q,C,A,D,B){if(Error.call(this),q===void 0)throw new Error("No error code supplied: "+D);this.message="",this.params=C,this.code=q,this.dataPath=A||"",this.schemaPath=D||"",this.subErrors=B||null;var F=new Error(this.message);if(this.stack=F.stack||F.stacktrace,!this.stack)try{throw F}catch(K){this.stack=K.stack||K.stacktrace}}T.prototype=Object.create(Error.prototype),T.prototype.constructor=T,T.prototype.name="ValidationError",T.prototype.prefixWith=function(q,C){if(q!==null&&(q=q.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+q+this.dataPath),C!==null&&(C=C.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+C+this.schemaPath),this.subErrors!==null)for(var A=0;A<this.subErrors.length;A++)this.subErrors[A].prefixWith(q,C);return this};function N(q,C){if(C.substring(0,q.length)===q){var A=C.substring(q.length);if(C.length>0&&C.charAt(q.length-1)==="/"||A.charAt(0)==="#"||A.charAt(0)==="?")return!0}return!1}var $={};function j(q){var C=new s,A,D,B={setErrorReporter:function(F){return typeof F=="string"?this.language(F):(D=F,!0)},addFormat:function(){C.addFormat.apply(C,arguments)},language:function(F){return F?($[F]||(F=F.split("-")[0]),$[F]?(A=F,F):!1):A},addLanguage:function(F,K){var ee;for(ee in _)K[ee]&&!K[_[ee]]&&(K[_[ee]]=K[ee]);var ie=F.split("-")[0];if(!$[ie])$[F]=K,$[ie]=K;else{$[F]=Object.create($[ie]);for(ee in K)typeof $[ie][ee]>"u"&&($[ie][ee]=K[ee]),$[F][ee]=K[ee]}return this},freshApi:function(F){var K=j();return F&&K.language(F),K},validate:function(F,K,ee,ie){var pe=v(A),ke=D?function(ve,We,mt){return D(ve,We,mt)||pe(ve,We,mt)}:pe,de=new s(C,!1,ke,ee,ie);typeof K=="string"&&(K={$ref:K}),de.addSchema("",K);var le=de.validateAll(F,K,null,null,"");return!le&&ie&&(le=de.banUnknownProperties(F,K)),this.error=le,this.missing=de.missing,this.valid=le===null,this.valid},validateResult:function(){var F={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(F,arguments),F},validateMultiple:function(F,K,ee,ie){var pe=v(A),ke=D?function(ve,We,mt){return D(ve,We,mt)||pe(ve,We,mt)}:pe,de=new s(C,!0,ke,ee,ie);typeof K=="string"&&(K={$ref:K}),de.addSchema("",K),de.validateAll(F,K,null,null,""),ie&&de.banUnknownProperties(F,K);var le={toString:function(){return this.valid?"valid":this.error.message}};return le.errors=de.errors,le.missing=de.missing,le.valid=le.errors.length===0,le},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(F,K,ee){if(typeof F!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(F))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof K!="number"||K%1!==0||K<1e4)throw new Error("Code number must be an integer > 10000");if(typeof _[F]<"u")throw new Error("Error already defined: "+F+" as "+_[F]);if(typeof w[K]<"u")throw new Error("Error code already used: "+w[K]+" as "+K);_[F]=K,w[K]=F,k[F]=k[K]=ee;for(var ie in $){var pe=$[ie];pe[F]&&(pe[K]=pe[K]||pe[F])}},reset:function(){C.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:g,resolveUrl:p,getDocumentUri:h,errorCodes:_};return B.language(q||"en"),B}var G=j();return G.addLanguage("en-gb",k),G.tv4=G,G})});var of=H(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.regexpCode=rt.getEsmExportName=rt.getProperty=rt.safeStringify=rt.stringify=rt.strConcat=rt.addCodeArg=rt.str=rt._=rt.nil=rt._Code=rt.Name=rt.IDENTIFIER=rt._CodeOrName=void 0;var nf=class{};rt._CodeOrName=nf;rt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var da=class extends nf{constructor(e){if(super(),!rt.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}}};rt.Name=da;var En=class extends nf{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((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof da&&(r[n.str]=(r[n.str]||0)+1),r),{})}};rt._Code=En;rt.nil=new En("");function wI(t,...e){let r=[t[0]],n=0;for(;n<e.length;)fS(r,e[n]),r.push(t[++n]);return new En(r)}rt._=wI;var cS=new En("+");function _I(t,...e){let r=[sf(t[0])],n=0;for(;n<e.length;)r.push(cS),fS(r,e[n]),r.push(cS,sf(t[++n]));return p2(r),new En(r)}rt.str=_I;function fS(t,e){e instanceof En?t.push(...e._items):e instanceof da?t.push(e):t.push(g2(e))}rt.addCodeArg=fS;function p2(t){let e=1;for(;e<t.length-1;){if(t[e]===cS){let r=h2(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function h2(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof da||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof da))return`"${t}${e.slice(1)}`}function m2(t,e){return e.emptyStr()?t:t.emptyStr()?e:_I`${t}${e}`}rt.strConcat=m2;function g2(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:sf(Array.isArray(t)?t.join(","):t)}function y2(t){return new En(sf(t))}rt.stringify=y2;function sf(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}rt.safeStringify=sf;function v2(t){return typeof t=="string"&&rt.IDENTIFIER.test(t)?new En(`.${t}`):wI`[${t}]`}rt.getProperty=v2;function b2(t){if(typeof t=="string"&&rt.IDENTIFIER.test(t))return new En(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}rt.getEsmExportName=b2;function S2(t){return new En(t.toString())}rt.regexpCode=S2});var hS=H(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.ValueScope=Hr.ValueScopeName=Hr.Scope=Hr.varKinds=Hr.UsedValueState=void 0;var Ur=of(),dS=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Fh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Fh||(Hr.UsedValueState=Fh={}));Hr.varKinds={const:new Ur.Name("const"),let:new Ur.Name("let"),var:new Ur.Name("var")};var Dh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Ur.Name?e:this.name(e)}name(e){return new Ur.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._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}}};Hr.Scope=Dh;var Lh=class extends Ur.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Ur._)`.${new Ur.Name(r)}[${n}]`}};Hr.ValueScopeName=Lh;var w2=(0,Ur._)`\n`,pS=class extends Dh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?w2:Ur.nil}}get(){return this._scope}name(e){return new Lh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let p=l.get(o);if(p)return p}else l=this._values[s]=new Map;l.set(o,i);let f=this._scope[s]||(this._scope[s]=[]),c=f.length;return f[c]=r.ref,i.setValue(r,{property:s,itemIndex:c}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ur._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=Ur.nil;for(let o in e){let l=e[o];if(!l)continue;let f=n[o]=n[o]||new Map;l.forEach(c=>{if(f.has(c))return;f.set(c,Fh.Started);let p=r(c);if(p){let h=this.opts.es5?Hr.varKinds.var:Hr.varKinds.const;s=(0,Ur._)`${s}${h} ${c} = ${p};${this.opts._n}`}else if(p=i?.(c))s=(0,Ur._)`${s}${p}${this.opts._n}`;else throw new dS(c);f.set(c,Fh.Completed)})}return s}};Hr.ValueScope=pS});var je=H(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.or=Me.and=Me.not=Me.CodeGen=Me.operators=Me.varKinds=Me.ValueScopeName=Me.ValueScope=Me.Scope=Me.Name=Me.regexpCode=Me.stringify=Me.getProperty=Me.nil=Me.strConcat=Me.str=Me._=void 0;var Ge=of(),Zn=hS(),Ys=of();Object.defineProperty(Me,"_",{enumerable:!0,get:function(){return Ys._}});Object.defineProperty(Me,"str",{enumerable:!0,get:function(){return Ys.str}});Object.defineProperty(Me,"strConcat",{enumerable:!0,get:function(){return Ys.strConcat}});Object.defineProperty(Me,"nil",{enumerable:!0,get:function(){return Ys.nil}});Object.defineProperty(Me,"getProperty",{enumerable:!0,get:function(){return Ys.getProperty}});Object.defineProperty(Me,"stringify",{enumerable:!0,get:function(){return Ys.stringify}});Object.defineProperty(Me,"regexpCode",{enumerable:!0,get:function(){return Ys.regexpCode}});Object.defineProperty(Me,"Name",{enumerable:!0,get:function(){return Ys.Name}});var Bh=hS();Object.defineProperty(Me,"Scope",{enumerable:!0,get:function(){return Bh.Scope}});Object.defineProperty(Me,"ValueScope",{enumerable:!0,get:function(){return Bh.ValueScope}});Object.defineProperty(Me,"ValueScopeName",{enumerable:!0,get:function(){return Bh.ValueScopeName}});Object.defineProperty(Me,"varKinds",{enumerable:!0,get:function(){return Bh.varKinds}});Me.operators={GT:new Ge._Code(">"),GTE:new Ge._Code(">="),LT:new Ge._Code("<"),LTE:new Ge._Code("<="),EQ:new Ge._Code("==="),NEQ:new Ge._Code("!=="),NOT:new Ge._Code("!"),OR:new Ge._Code("||"),AND:new Ge._Code("&&"),ADD:new Ge._Code("+")};var os=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},mS=class extends os{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Zn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Gl(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ge._CodeOrName?this.rhs.names:{}}},jh=class extends os{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Ge.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Gl(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ge.Name?{}:{...this.lhs.names};return Hh(e,this.rhs)}},gS=class extends jh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},yS=class extends os{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},vS=class extends os{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},bS=class extends os{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},SS=class extends os{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Gl(this.code,e,r),this}get names(){return this.code instanceof Ge._CodeOrName?this.code.names:{}}},af=class extends os{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(_2(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>ma(e,r.names),{})}},as=class extends af{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},wS=class extends af{},Jl=class extends as{};Jl.kind="else";var pa=class t extends as{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Jl(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(RI(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Gl(this.condition,e,r),this}get names(){let e=super.names;return Hh(e,this.condition),this.else&&ma(e,this.else.names),e}};pa.kind="if";var ha=class extends as{};ha.kind="for";var _S=class extends ha{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Gl(this.iteration,e,r),this}get names(){return ma(super.names,this.iteration.names)}},RS=class extends ha{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Zn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Hh(super.names,this.from);return Hh(e,this.to)}},Uh=class extends ha{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Gl(this.iterable,e,r),this}get names(){return ma(super.names,this.iterable.names)}},lf=class extends as{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};lf.kind="func";var uf=class extends af{render(e){return"return "+super.render(e)}};uf.kind="return";var CS=class extends as{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&ma(e,this.catch.names),this.finally&&ma(e,this.finally.names),e}},cf=class extends as{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};cf.kind="catch";var ff=class extends as{render(e){return"finally"+super.render(e)}};ff.kind="finally";var xS=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
24
+ `:""},this._extScope=e,this._scope=new Zn.Scope({parent:e}),this._nodes=[new wS]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new mS(e,s,n)),s}const(e,r,n){return this._def(Zn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Zn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Zn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new jh(e,r,n))}add(e,r){return this._leafNode(new gS(e,Me.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ge.nil&&this._leafNode(new SS(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Ge.addCodeArg)(r,i));return r.push("}"),new Ge._Code(r)}if(e,r,n){if(this._blockNode(new pa(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new pa(e))}else(){return this._elseNode(new Jl)}endIf(){return this._endBlockNode(pa,Jl)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new _S(e),r)}forRange(e,r,n,i,s=this.opts.es5?Zn.varKinds.var:Zn.varKinds.let){let o=this._scope.toName(e);return this._for(new RS(s,o,r,n),()=>i(o))}forOf(e,r,n,i=Zn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof Ge.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ge._)`${o}.length`,l=>{this.var(s,(0,Ge._)`${o}[${l}]`),n(s)})}return this._for(new Uh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Zn.varKinds.var:Zn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ge._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Uh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(ha)}label(e){return this._leafNode(new yS(e))}break(e){return this._leafNode(new vS(e))}return(e){let r=new uf;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(uf)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new CS;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new cf(s),r(s)}return n&&(this._currNode=i.finally=new ff,this.code(n)),this._endBlockNode(cf,ff)}throw(e){return this._leafNode(new bS(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Ge.nil,n,i){return this._blockNode(new lf(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(lf)}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,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof pa))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Me.CodeGen=xS;function ma(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Hh(t,e){return e instanceof Ge._CodeOrName?ma(t,e.names):t}function Gl(t,e,r){if(t instanceof Ge.Name)return n(t);if(!i(t))return t;return new Ge._Code(t._items.reduce((s,o)=>(o instanceof Ge.Name&&(o=n(o)),o instanceof Ge._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof Ge._Code&&s._items.some(o=>o instanceof Ge.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function _2(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function RI(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ge._)`!${ES(t)}`}Me.not=RI;var R2=CI(Me.operators.AND);function C2(...t){return t.reduce(R2)}Me.and=C2;var x2=CI(Me.operators.OR);function E2(...t){return t.reduce(x2)}Me.or=E2;function CI(t){return(e,r)=>e===Ge.nil?r:r===Ge.nil?e:(0,Ge._)`${ES(e)} ${t} ${ES(r)}`}function ES(t){return t instanceof Ge.Name?t:(0,Ge._)`(${t})`}});var Ke=H(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.checkStrictMode=Ue.getErrorPath=Ue.Type=Ue.useFunc=Ue.setEvaluated=Ue.evaluatedPropsToName=Ue.mergeEvaluated=Ue.eachItem=Ue.unescapeJsonPointer=Ue.escapeJsonPointer=Ue.escapeFragment=Ue.unescapeFragment=Ue.schemaRefOrVal=Ue.schemaHasRulesButRef=Ue.schemaHasRules=Ue.checkUnknownRules=Ue.alwaysValidSchema=Ue.toHash=void 0;var wt=je(),I2=of();function O2(t){let e={};for(let r of t)e[r]=!0;return e}Ue.toHash=O2;function q2(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(II(t,e),!OI(e,t.self.RULES.all))}Ue.alwaysValidSchema=q2;function II(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||PI(t,`unknown keyword: "${s}"`)}Ue.checkUnknownRules=II;function OI(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ue.schemaHasRules=OI;function k2(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Ue.schemaHasRulesButRef=k2;function P2({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,wt._)`${r}`}return(0,wt._)`${t}${e}${(0,wt.getProperty)(n)}`}Ue.schemaRefOrVal=P2;function T2(t){return qI(decodeURIComponent(t))}Ue.unescapeFragment=T2;function A2(t){return encodeURIComponent(OS(t))}Ue.escapeFragment=A2;function OS(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ue.escapeJsonPointer=OS;function qI(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ue.unescapeJsonPointer=qI;function $2(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ue.eachItem=$2;function xI({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,l)=>{let f=o===void 0?s:o instanceof wt.Name?(s instanceof wt.Name?t(i,s,o):e(i,s,o),o):s instanceof wt.Name?(e(i,o,s),s):r(s,o);return l===wt.Name&&!(f instanceof wt.Name)?n(i,f):f}}Ue.mergeEvaluated={props:xI({mergeNames:(t,e,r)=>t.if((0,wt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,wt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,wt._)`${r} || {}`).code((0,wt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,wt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,wt._)`${r} || {}`),qS(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:kI}),items:xI({mergeNames:(t,e,r)=>t.if((0,wt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,wt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,wt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,wt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function kI(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,wt._)`{}`);return e!==void 0&&qS(t,r,e),r}Ue.evaluatedPropsToName=kI;function qS(t,e,r){Object.keys(r).forEach(n=>t.assign((0,wt._)`${e}${(0,wt.getProperty)(n)}`,!0))}Ue.setEvaluated=qS;var EI={};function N2(t,e){return t.scopeValue("func",{ref:e,code:EI[e.code]||(EI[e.code]=new I2._Code(e.code))})}Ue.useFunc=N2;var IS;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(IS||(Ue.Type=IS={}));function M2(t,e,r){if(t instanceof wt.Name){let n=e===IS.Num;return r?n?(0,wt._)`"[" + ${t} + "]"`:(0,wt._)`"['" + ${t} + "']"`:n?(0,wt._)`"/" + ${t}`:(0,wt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,wt.getProperty)(t).toString():"/"+OS(t)}Ue.getErrorPath=M2;function PI(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Ue.checkStrictMode=PI});var ls=H(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});var dr=je(),F2={data:new dr.Name("data"),valCxt:new dr.Name("valCxt"),instancePath:new dr.Name("instancePath"),parentData:new dr.Name("parentData"),parentDataProperty:new dr.Name("parentDataProperty"),rootData:new dr.Name("rootData"),dynamicAnchors:new dr.Name("dynamicAnchors"),vErrors:new dr.Name("vErrors"),errors:new dr.Name("errors"),this:new dr.Name("this"),self:new dr.Name("self"),scope:new dr.Name("scope"),json:new dr.Name("json"),jsonPos:new dr.Name("jsonPos"),jsonLen:new dr.Name("jsonLen"),jsonPart:new dr.Name("jsonPart")};kS.default=F2});var df=H(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.extendErrors=pr.resetErrorsCount=pr.reportExtraError=pr.reportError=pr.keyword$DataError=pr.keywordError=void 0;var Qe=je(),Vh=Ke(),kr=ls();pr.keywordError={message:({keyword:t})=>(0,Qe.str)`must pass "${t}" keyword validation`};pr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Qe.str)`"${t}" keyword must be ${e} ($data)`:(0,Qe.str)`"${t}" keyword is invalid ($data)`};function D2(t,e=pr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:l}=i,f=$I(t,e,r);n??(o||l)?TI(s,f):AI(i,(0,Qe._)`[${f}]`)}pr.reportError=D2;function L2(t,e=pr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,l=$I(t,e,r);TI(i,l),s||o||AI(n,kr.default.vErrors)}pr.reportExtraError=L2;function j2(t,e){t.assign(kr.default.errors,e),t.if((0,Qe._)`${kr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Qe._)`${kr.default.vErrors}.length`,e),()=>t.assign(kr.default.vErrors,null)))}pr.resetErrorsCount=j2;function U2({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,kr.default.errors,l=>{t.const(o,(0,Qe._)`${kr.default.vErrors}[${l}]`),t.if((0,Qe._)`${o}.instancePath === undefined`,()=>t.assign((0,Qe._)`${o}.instancePath`,(0,Qe.strConcat)(kr.default.instancePath,s.errorPath))),t.assign((0,Qe._)`${o}.schemaPath`,(0,Qe.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Qe._)`${o}.schema`,r),t.assign((0,Qe._)`${o}.data`,n))})}pr.extendErrors=U2;function TI(t,e){let r=t.const("err",e);t.if((0,Qe._)`${kr.default.vErrors} === null`,()=>t.assign(kr.default.vErrors,(0,Qe._)`[${r}]`),(0,Qe._)`${kr.default.vErrors}.push(${r})`),t.code((0,Qe._)`${kr.default.errors}++`)}function AI(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,Qe._)`new ${t.ValidationError}(${e})`):(r.assign((0,Qe._)`${n}.errors`,e),r.return(!1))}var ga={keyword:new Qe.Name("keyword"),schemaPath:new Qe.Name("schemaPath"),params:new Qe.Name("params"),propertyName:new Qe.Name("propertyName"),message:new Qe.Name("message"),schema:new Qe.Name("schema"),parentSchema:new Qe.Name("parentSchema")};function $I(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Qe._)`{}`:H2(t,e,r)}function H2(t,e,r={}){let{gen:n,it:i}=t,s=[B2(i,r),V2(t,r)];return W2(t,e,s),n.object(...s)}function B2({errorPath:t},{instancePath:e}){let r=e?(0,Qe.str)`${t}${(0,Vh.getErrorPath)(e,Vh.Type.Str)}`:t;return[kr.default.instancePath,(0,Qe.strConcat)(kr.default.instancePath,r)]}function V2({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Qe.str)`${e}/${t}`;return r&&(i=(0,Qe.str)`${i}${(0,Vh.getErrorPath)(r,Vh.Type.Str)}`),[ga.schemaPath,i]}function W2(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:l}=t,{opts:f,propertyName:c,topSchemaRef:p,schemaPath:h}=l;n.push([ga.keyword,i],[ga.params,typeof e=="function"?e(t):e||(0,Qe._)`{}`]),f.messages&&n.push([ga.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([ga.schema,o],[ga.parentSchema,(0,Qe._)`${p}${h}`],[kr.default.data,s]),c&&n.push([ga.propertyName,c])}});var MI=H(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.boolOrEmptySchema=Yl.topBoolOrEmptySchema=void 0;var z2=df(),J2=je(),G2=ls(),Y2={message:"boolean schema is false"};function K2(t){let{gen:e,schema:r,validateName:n}=t;r===!1?NI(t,!1):typeof r=="object"&&r.$async===!0?e.return(G2.default.data):(e.assign((0,J2._)`${n}.errors`,null),e.return(!0))}Yl.topBoolOrEmptySchema=K2;function Q2(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),NI(t)):r.var(e,!0)}Yl.boolOrEmptySchema=Q2;function NI(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,z2.reportError)(i,Y2,void 0,e)}});var PS=H(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});Kl.getRules=Kl.isJSONType=void 0;var Z2=["string","number","integer","boolean","null","object","array"],X2=new Set(Z2);function eU(t){return typeof t=="string"&&X2.has(t)}Kl.isJSONType=eU;function tU(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Kl.getRules=tU});var TS=H(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.shouldUseRule=Ks.shouldUseGroup=Ks.schemaHasRulesForType=void 0;function rU({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&FI(t,n)}Ks.schemaHasRulesForType=rU;function FI(t,e){return e.rules.some(r=>DI(t,r))}Ks.shouldUseGroup=FI;function DI(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Ks.shouldUseRule=DI});var pf=H(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.reportTypeError=hr.checkDataTypes=hr.checkDataType=hr.coerceAndCheckDataType=hr.getJSONTypes=hr.getSchemaTypes=hr.DataType=void 0;var nU=PS(),iU=TS(),sU=df(),qe=je(),LI=Ke(),Ql;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ql||(hr.DataType=Ql={}));function oU(t){let e=jI(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}hr.getSchemaTypes=oU;function jI(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(nU.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}hr.getJSONTypes=jI;function aU(t,e){let{gen:r,data:n,opts:i}=t,s=lU(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,iU.schemaHasRulesForType)(t,e[0]));if(o){let l=$S(e,n,i.strictNumbers,Ql.Wrong);r.if(l,()=>{s.length?uU(t,e,s):NS(t)})}return o}hr.coerceAndCheckDataType=aU;var UI=new Set(["string","number","integer","boolean","null"]);function lU(t,e){return e?t.filter(r=>UI.has(r)||e==="array"&&r==="array"):[]}function uU(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,qe._)`typeof ${i}`),l=n.let("coerced",(0,qe._)`undefined`);s.coerceTypes==="array"&&n.if((0,qe._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,qe._)`${i}[0]`).assign(o,(0,qe._)`typeof ${i}`).if($S(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,qe._)`${l} !== undefined`);for(let c of r)(UI.has(c)||c==="array"&&s.coerceTypes==="array")&&f(c);n.else(),NS(t),n.endIf(),n.if((0,qe._)`${l} !== undefined`,()=>{n.assign(i,l),cU(t,l)});function f(c){switch(c){case"string":n.elseIf((0,qe._)`${o} == "number" || ${o} == "boolean"`).assign(l,(0,qe._)`"" + ${i}`).elseIf((0,qe._)`${i} === null`).assign(l,(0,qe._)`""`);return;case"number":n.elseIf((0,qe._)`${o} == "boolean" || ${i} === null
25
+ || (${o} == "string" && ${i} && ${i} == +${i})`).assign(l,(0,qe._)`+${i}`);return;case"integer":n.elseIf((0,qe._)`${o} === "boolean" || ${i} === null
26
+ || (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,(0,qe._)`+${i}`);return;case"boolean":n.elseIf((0,qe._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf((0,qe._)`${i} === "true" || ${i} === 1`).assign(l,!0);return;case"null":n.elseIf((0,qe._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(l,null);return;case"array":n.elseIf((0,qe._)`${o} === "string" || ${o} === "number"
27
+ || ${o} === "boolean" || ${i} === null`).assign(l,(0,qe._)`[${i}]`)}}}function cU({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,qe._)`${e} !== undefined`,()=>t.assign((0,qe._)`${e}[${r}]`,n))}function AS(t,e,r,n=Ql.Correct){let i=n===Ql.Correct?qe.operators.EQ:qe.operators.NEQ,s;switch(t){case"null":return(0,qe._)`${e} ${i} null`;case"array":s=(0,qe._)`Array.isArray(${e})`;break;case"object":s=(0,qe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,qe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,qe._)`typeof ${e} ${i} ${t}`}return n===Ql.Correct?s:(0,qe.not)(s);function o(l=qe.nil){return(0,qe.and)((0,qe._)`typeof ${e} == "number"`,l,r?(0,qe._)`isFinite(${e})`:qe.nil)}}hr.checkDataType=AS;function $S(t,e,r,n){if(t.length===1)return AS(t[0],e,r,n);let i,s=(0,LI.toHash)(t);if(s.array&&s.object){let o=(0,qe._)`typeof ${e} != "object"`;i=s.null?o:(0,qe._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=qe.nil;s.number&&delete s.integer;for(let o in s)i=(0,qe.and)(i,AS(o,e,r,n));return i}hr.checkDataTypes=$S;var fU={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,qe._)`{type: ${t}}`:(0,qe._)`{type: ${e}}`};function NS(t){let e=dU(t);(0,sU.reportError)(e,fU)}hr.reportTypeError=NS;function dU(t){let{gen:e,data:r,schema:n}=t,i=(0,LI.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var BI=H(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.assignDefaults=void 0;var Zl=je(),pU=Ke();function hU(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)HI(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>HI(t,s,i.default))}Wh.assignDefaults=hU;function HI(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let l=(0,Zl._)`${s}${(0,Zl.getProperty)(e)}`;if(i){(0,pU.checkStrictMode)(t,`default is ignored for: ${l}`);return}let f=(0,Zl._)`${l} === undefined`;o.useDefaults==="empty"&&(f=(0,Zl._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,Zl._)`${l} = ${(0,Zl.stringify)(r)}`)}});var In=H(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.validateUnion=vt.validateArray=vt.usePattern=vt.callValidateCode=vt.schemaProperties=vt.allSchemaProperties=vt.noPropertyInData=vt.propertyInData=vt.isOwnProperty=vt.hasPropFunc=vt.reportMissingProp=vt.checkMissingProp=vt.checkReportMissingProp=void 0;var Et=je(),MS=Ke(),Qs=ls(),mU=Ke();function gU(t,e){let{gen:r,data:n,it:i}=t;r.if(DS(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Et._)`${e}`},!0),t.error()})}vt.checkReportMissingProp=gU;function yU({gen:t,data:e,it:{opts:r}},n,i){return(0,Et.or)(...n.map(s=>(0,Et.and)(DS(t,e,s,r.ownProperties),(0,Et._)`${i} = ${s}`)))}vt.checkMissingProp=yU;function vU(t,e){t.setParams({missingProperty:e},!0),t.error()}vt.reportMissingProp=vU;function VI(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Et._)`Object.prototype.hasOwnProperty`})}vt.hasPropFunc=VI;function FS(t,e,r){return(0,Et._)`${VI(t)}.call(${e}, ${r})`}vt.isOwnProperty=FS;function bU(t,e,r,n){let i=(0,Et._)`${e}${(0,Et.getProperty)(r)} !== undefined`;return n?(0,Et._)`${i} && ${FS(t,e,r)}`:i}vt.propertyInData=bU;function DS(t,e,r,n){let i=(0,Et._)`${e}${(0,Et.getProperty)(r)} === undefined`;return n?(0,Et.or)(i,(0,Et.not)(FS(t,e,r))):i}vt.noPropertyInData=DS;function WI(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}vt.allSchemaProperties=WI;function SU(t,e){return WI(e).filter(r=>!(0,MS.alwaysValidSchema)(t,e[r]))}vt.schemaProperties=SU;function wU({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},l,f,c){let p=c?(0,Et._)`${t}, ${e}, ${n}${i}`:e,h=[[Qs.default.instancePath,(0,Et.strConcat)(Qs.default.instancePath,s)],[Qs.default.parentData,o.parentData],[Qs.default.parentDataProperty,o.parentDataProperty],[Qs.default.rootData,Qs.default.rootData]];o.opts.dynamicRef&&h.push([Qs.default.dynamicAnchors,Qs.default.dynamicAnchors]);let g=(0,Et._)`${p}, ${r.object(...h)}`;return f!==Et.nil?(0,Et._)`${l}.call(${f}, ${g})`:(0,Et._)`${l}(${g})`}vt.callValidateCode=wU;var _U=(0,Et._)`new RegExp`;function RU({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,Et._)`${i.code==="new RegExp"?_U:(0,mU.useFunc)(t,i)}(${r}, ${n})`})}vt.usePattern=RU;function CU(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let l=e.let("valid",!0);return o(()=>e.assign(l,!1)),l}return e.var(s,!0),o(()=>e.break()),s;function o(l){let f=e.const("len",(0,Et._)`${r}.length`);e.forRange("i",0,f,c=>{t.subschema({keyword:n,dataProp:c,dataPropType:MS.Type.Num},s),e.if((0,Et.not)(s),l)})}}vt.validateArray=CU;function xU(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,MS.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((f,c)=>{let p=t.subschema({keyword:n,schemaProp:c,compositeRule:!0},l);e.assign(o,(0,Et._)`${o} || ${l}`),t.mergeValidEvaluated(p,l)||e.if((0,Et.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}vt.validateUnion=xU});var GI=H(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.validateKeywordUsage=Ii.validSchemaType=Ii.funcKeywordCode=Ii.macroKeywordCode=void 0;var Pr=je(),ya=ls(),EU=In(),IU=df();function OU(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,l=e.macro.call(o.self,i,s,o),f=JI(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);let c=r.name("valid");t.subschema({schema:l,schemaPath:Pr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},c),t.pass(c,()=>t.error(!0))}Ii.macroKeywordCode=OU;function qU(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:l,it:f}=t;PU(f,e);let c=!l&&e.compile?e.compile.call(f.self,s,o,f):e.validate,p=JI(n,i,c),h=n.let("valid");t.block$data(h,g),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function g(){if(e.errors===!1)w(),e.modifying&&zI(t),E(()=>t.error());else{let k=e.async?v():_();e.modifying&&zI(t),E(()=>kU(t,k))}}function v(){let k=n.let("ruleErrs",null);return n.try(()=>w((0,Pr._)`await `),T=>n.assign(h,!1).if((0,Pr._)`${T} instanceof ${f.ValidationError}`,()=>n.assign(k,(0,Pr._)`${T}.errors`),()=>n.throw(T))),k}function _(){let k=(0,Pr._)`${p}.errors`;return n.assign(k,null),w(Pr.nil),k}function w(k=e.async?(0,Pr._)`await `:Pr.nil){let T=f.opts.passContext?ya.default.this:ya.default.self,N=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,Pr._)`${k}${(0,EU.callValidateCode)(t,p,T,N)}`,e.modifying)}function E(k){var T;n.if((0,Pr.not)((T=e.valid)!==null&&T!==void 0?T:h),k)}}Ii.funcKeywordCode=qU;function zI(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Pr._)`${n.parentData}[${n.parentDataProperty}]`))}function kU(t,e){let{gen:r}=t;r.if((0,Pr._)`Array.isArray(${e})`,()=>{r.assign(ya.default.vErrors,(0,Pr._)`${ya.default.vErrors} === null ? ${e} : ${ya.default.vErrors}.concat(${e})`).assign(ya.default.errors,(0,Pr._)`${ya.default.vErrors}.length`),(0,IU.extendErrors)(t)},()=>t.error())}function PU({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function JI(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Pr.stringify)(r)})}function TU(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Ii.validSchemaType=TU;function AU({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let o=i.dependencies;if(o?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}Ii.validateKeywordUsage=AU});var KI=H(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.extendSubschemaMode=Zs.extendSubschemaData=Zs.getSubschema=void 0;var Oi=je(),YI=Ke();function $U(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,Oi._)`${t.schemaPath}${(0,Oi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Oi._)`${t.schemaPath}${(0,Oi.getProperty)(e)}${(0,Oi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,YI.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Zs.getSubschema=$U;function NU(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:c,dataPathArr:p,opts:h}=e,g=l.let("data",(0,Oi._)`${e.data}${(0,Oi.getProperty)(r)}`,!0);f(g),t.errorPath=(0,Oi.str)`${c}${(0,YI.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,Oi._)`${r}`,t.dataPathArr=[...p,t.parentDataProperty]}if(i!==void 0){let c=i instanceof Oi.Name?i:l.let("data",i,!0);f(c),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function f(c){t.data=c,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,c]}}Zs.extendSubschemaData=NU;function MU(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}Zs.extendSubschemaMode=MU});var LS=H((CQ,QI)=>{"use strict";QI.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var XI=H((xQ,ZI)=>{"use strict";var Xs=ZI.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};zh(e,n,i,t,"",t)};Xs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Xs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Xs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Xs.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 zh(t,e,r,n,i,s,o,l,f,c){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,l,f,c);for(var p in n){var h=n[p];if(Array.isArray(h)){if(p in Xs.arrayKeywords)for(var g=0;g<h.length;g++)zh(t,e,r,h[g],i+"/"+p+"/"+g,s,i,p,n,g)}else if(p in Xs.propsKeywords){if(h&&typeof h=="object")for(var v in h)zh(t,e,r,h[v],i+"/"+p+"/"+FU(v),s,i,p,n,v)}else(p in Xs.keywords||t.allKeys&&!(p in Xs.skipKeywords))&&zh(t,e,r,h,i+"/"+p,s,i,p,n)}r(n,i,s,o,l,f,c)}}function FU(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var hf=H(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.getSchemaRefs=Br.resolveUrl=Br.normalizeId=Br._getFullPath=Br.getFullPath=Br.inlineRef=void 0;var DU=Ke(),LU=LS(),jU=XI(),UU=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function HU(t,e=!0){return typeof t=="boolean"?!0:e===!0?!jS(t):e?eO(t)<=e:!1}Br.inlineRef=HU;var BU=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function jS(t){for(let e in t){if(BU.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(jS)||typeof r=="object"&&jS(r))return!0}return!1}function eO(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!UU.has(r)&&(typeof t[r]=="object"&&(0,DU.eachItem)(t[r],n=>e+=eO(n)),e===1/0))return 1/0}return e}function tO(t,e="",r){r!==!1&&(e=Xl(e));let n=t.parse(e);return rO(t,n)}Br.getFullPath=tO;function rO(t,e){return t.serialize(e).split("#")[0]+"#"}Br._getFullPath=rO;var VU=/#\/?$/;function Xl(t){return t?t.replace(VU,""):""}Br.normalizeId=Xl;function WU(t,e,r){return r=Xl(r),t.resolve(e,r)}Br.resolveUrl=WU;var zU=/^[a-z_][-a-z0-9._]*$/i;function JU(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Xl(t[r]||e),s={"":i},o=tO(n,i,!1),l={},f=new Set;return jU(t,{allKeys:!0},(h,g,v,_)=>{if(_===void 0)return;let w=o+g,E=s[_];typeof h[r]=="string"&&(E=k.call(this,h[r])),T.call(this,h.$anchor),T.call(this,h.$dynamicAnchor),s[g]=E;function k(N){let $=this.opts.uriResolver.resolve;if(N=Xl(E?$(E,N):N),f.has(N))throw p(N);f.add(N);let j=this.refs[N];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?c(h,j.schema,N):N!==Xl(w)&&(N[0]==="#"?(c(h,l[N],N),l[N]=h):this.refs[N]=w),N}function T(N){if(typeof N=="string"){if(!zU.test(N))throw new Error(`invalid anchor "${N}"`);k.call(this,`#${N}`)}}}),l;function c(h,g,v){if(g!==void 0&&!LU(h,g))throw p(v)}function p(h){return new Error(`reference "${h}" resolves to more than one schema`)}}Br.getSchemaRefs=JU});var yf=H(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.getData=eo.KeywordCxt=eo.validateFunctionCode=void 0;var aO=MI(),nO=pf(),HS=TS(),Jh=pf(),GU=BI(),gf=GI(),US=KI(),ye=je(),Ce=ls(),YU=hf(),us=Ke(),mf=df();function KU(t){if(cO(t)&&(fO(t),uO(t))){XU(t);return}lO(t,()=>(0,aO.topBoolOrEmptySchema)(t))}eo.validateFunctionCode=KU;function lO({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,ye._)`${Ce.default.data}, ${Ce.default.valCxt}`,n.$async,()=>{t.code((0,ye._)`"use strict"; ${iO(r,i)}`),ZU(t,i),t.code(s)}):t.func(e,(0,ye._)`${Ce.default.data}, ${QU(i)}`,n.$async,()=>t.code(iO(r,i)).code(s))}function QU(t){return(0,ye._)`{${Ce.default.instancePath}="", ${Ce.default.parentData}, ${Ce.default.parentDataProperty}, ${Ce.default.rootData}=${Ce.default.data}${t.dynamicRef?(0,ye._)`, ${Ce.default.dynamicAnchors}={}`:ye.nil}}={}`}function ZU(t,e){t.if(Ce.default.valCxt,()=>{t.var(Ce.default.instancePath,(0,ye._)`${Ce.default.valCxt}.${Ce.default.instancePath}`),t.var(Ce.default.parentData,(0,ye._)`${Ce.default.valCxt}.${Ce.default.parentData}`),t.var(Ce.default.parentDataProperty,(0,ye._)`${Ce.default.valCxt}.${Ce.default.parentDataProperty}`),t.var(Ce.default.rootData,(0,ye._)`${Ce.default.valCxt}.${Ce.default.rootData}`),e.dynamicRef&&t.var(Ce.default.dynamicAnchors,(0,ye._)`${Ce.default.valCxt}.${Ce.default.dynamicAnchors}`)},()=>{t.var(Ce.default.instancePath,(0,ye._)`""`),t.var(Ce.default.parentData,(0,ye._)`undefined`),t.var(Ce.default.parentDataProperty,(0,ye._)`undefined`),t.var(Ce.default.rootData,Ce.default.data),e.dynamicRef&&t.var(Ce.default.dynamicAnchors,(0,ye._)`{}`)})}function XU(t){let{schema:e,opts:r,gen:n}=t;lO(t,()=>{r.$comment&&e.$comment&&pO(t),iH(t),n.let(Ce.default.vErrors,null),n.let(Ce.default.errors,0),r.unevaluated&&eH(t),dO(t),aH(t)})}function eH(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ye._)`${r}.evaluated`),e.if((0,ye._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ye._)`${t.evaluated}.props`,(0,ye._)`undefined`)),e.if((0,ye._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ye._)`${t.evaluated}.items`,(0,ye._)`undefined`))}function iO(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ye._)`/*# sourceURL=${r} */`:ye.nil}function tH(t,e){if(cO(t)&&(fO(t),uO(t))){rH(t,e);return}(0,aO.boolOrEmptySchema)(t,e)}function uO({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function cO(t){return typeof t.schema!="boolean"}function rH(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&pO(t),sH(t),oH(t);let s=n.const("_errs",Ce.default.errors);dO(t,s),n.var(e,(0,ye._)`${s} === ${Ce.default.errors}`)}function fO(t){(0,us.checkUnknownRules)(t),nH(t)}function dO(t,e){if(t.opts.jtd)return sO(t,[],!1,e);let r=(0,nO.getSchemaTypes)(t.schema),n=(0,nO.coerceAndCheckDataType)(t,r);sO(t,r,!n,e)}function nH(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,us.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function iH(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,us.checkStrictMode)(t,"default is ignored in the schema root")}function sH(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,YU.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function oH(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function pO({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,ye._)`${Ce.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,ye.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ye._)`${Ce.default.self}.opts.$comment(${s}, ${o}, ${l}.schema)`)}}function aH(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,ye._)`${Ce.default.errors} === 0`,()=>e.return(Ce.default.data),()=>e.throw((0,ye._)`new ${i}(${Ce.default.vErrors})`)):(e.assign((0,ye._)`${n}.errors`,Ce.default.vErrors),s.unevaluated&&lH(t),e.return((0,ye._)`${Ce.default.errors} === 0`))}function lH({gen:t,evaluated:e,props:r,items:n}){r instanceof ye.Name&&t.assign((0,ye._)`${e}.props`,r),n instanceof ye.Name&&t.assign((0,ye._)`${e}.items`,n)}function sO(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:l,opts:f,self:c}=t,{RULES:p}=c;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,us.schemaHasRulesButRef)(s,p))){i.block(()=>mO(t,"$ref",p.all.$ref.definition));return}f.jtd||uH(t,e),i.block(()=>{for(let g of p.rules)h(g);h(p.post)});function h(g){(0,HS.shouldUseGroup)(s,g)&&(g.type?(i.if((0,Jh.checkDataType)(g.type,o,f.strictNumbers)),oO(t,g),e.length===1&&e[0]===g.type&&r&&(i.else(),(0,Jh.reportTypeError)(t)),i.endIf()):oO(t,g),l||i.if((0,ye._)`${Ce.default.errors} === ${n||0}`))}}function oO(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,GU.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,HS.shouldUseRule)(n,s)&&mO(t,s.keyword,s.definition,e.type)})}function uH(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(cH(t,e),t.opts.allowUnionTypes||fH(t,e),dH(t,t.dataTypes))}function cH(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{hO(t.dataTypes,r)||BS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),hH(t,e)}}function fH(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&BS(t,"use allowUnionTypes to allow union type keyword")}function dH(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,HS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>pH(e,o))&&BS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function pH(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function hO(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function hH(t,e){let r=[];for(let n of t.dataTypes)hO(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function BS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,us.checkStrictMode)(t,e,t.opts.strictTypes)}var Gh=class{constructor(e,r,n){if((0,gf.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,us.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",gO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,gf.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Ce.default.errors))}result(e,r,n){this.failResult((0,ye.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,ye.not)(e),void 0,r)}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:r}=this;this.fail((0,ye._)`${r} !== undefined && (${(0,ye.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?mf.reportExtraError:mf.reportError)(this,this.def.error,r)}$dataError(){(0,mf.reportError)(this,this.def.$dataError||mf.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,mf.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=ye.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ye.nil,r=ye.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,ye.or)((0,ye._)`${i} === undefined`,r)),e!==ye.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ye.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,ye.or)(o(),l());function o(){if(n.length){if(!(r instanceof ye.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,ye._)`${(0,Jh.checkDataTypes)(f,r,s.opts.strictNumbers,Jh.DataType.Wrong)}`}return ye.nil}function l(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,ye._)`!${f}(${r})`}return ye.nil}}subschema(e,r){let n=(0,US.getSubschema)(this.it,e);(0,US.extendSubschemaData)(n,this.it,e),(0,US.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return tH(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=us.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=us.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,ye.Name)),!0}};eo.KeywordCxt=Gh;function mO(t,e,r,n){let i=new Gh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,gf.funcKeywordCode)(i,r):"macro"in r?(0,gf.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,gf.funcKeywordCode)(i,r)}var mH=/^\/(?:[^~]|~0|~1)*$/,gH=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function gO(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return Ce.default.rootData;if(t[0]==="/"){if(!mH.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=Ce.default.rootData}else{let c=gH.exec(t);if(!c)throw new Error(`Invalid JSON-pointer: ${t}`);let p=+c[1];if(i=c[2],i==="#"){if(p>=e)throw new Error(f("property/index",p));return n[e-p]}if(p>e)throw new Error(f("data",p));if(s=r[e-p],!i)return s}let o=s,l=i.split("/");for(let c of l)c&&(s=(0,ye._)`${s}${(0,ye.getProperty)((0,us.unescapeJsonPointer)(c))}`,o=(0,ye._)`${o} && ${s}`);return o;function f(c,p){return`Cannot access ${c} ${p} levels up, current level is ${e}`}}eo.getData=gO});var Yh=H(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var VS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};WS.default=VS});var vf=H(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var zS=hf(),JS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,zS.resolveUrl)(e,r,n),this.missingSchema=(0,zS.normalizeId)((0,zS.getFullPath)(e,this.missingRef))}};GS.default=JS});var Qh=H(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.resolveSchema=On.getCompilingSchema=On.resolveRef=On.compileSchema=On.SchemaEnv=void 0;var Xn=je(),yH=Yh(),va=ls(),ei=hf(),yO=Ke(),vH=yf(),eu=class{constructor(e){var r;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=(r=e.baseId)!==null&&r!==void 0?r:(0,ei.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};On.SchemaEnv=eu;function KS(t){let e=vO.call(this,t);if(e)return e;let r=(0,ei.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new Xn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=o.scopeValue("Error",{ref:yH.default,code:(0,Xn._)`require("ajv/dist/runtime/validation_error").default`}));let f=o.scopeName("validate");t.validateName=f;let c={gen:o,allErrors:this.opts.allErrors,data:va.default.data,parentData:va.default.parentData,parentDataProperty:va.default.parentDataProperty,dataNames:[va.default.data],dataPathArr:[Xn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Xn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Xn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Xn._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(t),(0,vH.validateFunctionCode)(c),o.optimize(this.opts.code.optimize);let h=o.toString();p=`${o.scopeRefs(va.default.scope)}return ${h}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let v=new Function(`${va.default.self}`,`${va.default.scope}`,p)(this,this.scope.get());if(this.scope.value(f,{ref:v}),v.errors=null,v.schema=t.schema,v.schemaEnv=t,t.$async&&(v.$async=!0),this.opts.code.source===!0&&(v.source={validateName:f,validateCode:h,scopeValues:o._values}),this.opts.unevaluated){let{props:_,items:w}=c;v.evaluated={props:_ instanceof Xn.Name?void 0:_,items:w instanceof Xn.Name?void 0:w,dynamicProps:_ instanceof Xn.Name,dynamicItems:w instanceof Xn.Name},v.source&&(v.source.evaluated=(0,Xn.stringify)(v.evaluated))}return t.validate=v,t}catch(h){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),h}finally{this._compilations.delete(t)}}On.compileSchema=KS;function bH(t,e,r){var n;r=(0,ei.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=_H.call(this,t,r);if(s===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;o&&(s=new eu({schema:o,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=SH.call(this,s)}On.resolveRef=bH;function SH(t){return(0,ei.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:KS.call(this,t)}function vO(t){for(let e of this._compilations)if(wH(e,t))return e}On.getCompilingSchema=vO;function wH(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function _H(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Kh.call(this,t,e)}function Kh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,ei._getFullPath)(this.opts.uriResolver,r),i=(0,ei.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return YS.call(this,r,t);let s=(0,ei.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let l=Kh.call(this,t,o);return typeof l?.schema!="object"?void 0:YS.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||KS.call(this,o),s===(0,ei.normalizeId)(e)){let{schema:l}=o,{schemaId:f}=this.opts,c=l[f];return c&&(i=(0,ei.resolveUrl)(this.opts.uriResolver,i,c)),new eu({schema:l,schemaId:f,root:t,baseId:i})}return YS.call(this,r,o)}}On.resolveSchema=Kh;var RH=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function YS(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let f=r[(0,yO.unescapeFragment)(l)];if(f===void 0)return;r=f;let c=typeof r=="object"&&r[this.opts.schemaId];!RH.has(l)&&c&&(e=(0,ei.resolveUrl)(this.opts.uriResolver,e,c))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,yO.schemaHasRulesButRef)(r,this.RULES)){let l=(0,ei.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Kh.call(this,n,l)}let{schemaId:o}=this.opts;if(s=s||new eu({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var bO=H((PQ,CH)=>{CH.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 XS=H((TQ,xO)=>{"use strict";var xH=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),wO=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),QS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),_O=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),EH=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function ZS(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var IH=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function SO(t){return t.length=0,!0}function OH(t,e,r){if(t.length){let n=ZS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function qH(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,l=OH;for(let f=0;f<t.length;f++){let c=t[f];if(!(c==="["||c==="]"))if(c===":"){if(s===!0&&(o=!0),!l(i,n,r))break;if(++e>7){r.error=!0;break}f>0&&t[f-1]===":"&&(s=!0),n.push(":");continue}else if(c==="%"){if(!l(i,n,r))break;l=SO}else{i.push(c);continue}}return i.length&&(l===SO?r.zone=i.join(""):o?n.push(i.join("")):n.push(ZS(i))),r.address=n.join(""),r}function RO(t){if(kH(t,":")<2)return{host:t,isIPV6:!1};let e=qH(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function kH(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function PH(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.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]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.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),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var TH={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},AH=/[@/?#:]/g,$H=/[@/?#]/g;function CO(t,e){let r=e?$H:AH;return r.lastIndex=0,t.replace(r,n=>TH[n])}function NH(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(QS(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));e&&_O(o)?r+=o:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function MH(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(QS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&_O(s)?e+=s:e+="%"+i,r+=2;continue}}EH(t[r])?e+=t[r]:e+=escape(t[r])}return e}function FH(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(QS(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function DH(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!wO(r)){let n=RO(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=CO(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}xO.exports={nonSimpleDomain:IH,recomposeAuthority:DH,reescapeHostDelimiters:CO,normalizePercentEncoding:NH,normalizePathEncoding:MH,escapePreservingEscapes:FH,removeDotSegments:PH,isIPv4:wO,isUUID:xH,normalizeIPv6:RO,stringArrayToHexStripped:ZS}});var kO=H((AQ,qO)=>{"use strict";var{isUUID:LH}=XS(),jH=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,UH=["http","https","ws","wss","urn","urn:uuid"];function HH(t){return UH.indexOf(t)!==-1}function ew(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function EO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function IO(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function BH(t){return t.secure=ew(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function VH(t){if((t.port===(ew(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function WH(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(jH);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=tw(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function zH(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=tw(i);s&&(t=s.serialize(t,e));let o=t,l=t.nss;return o.path=`${n||e.nid}:${l}`,e.skipEscape=!0,o}function JH(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!LH(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function GH(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var OO={scheme:"http",domainHost:!0,parse:EO,serialize:IO},YH={scheme:"https",domainHost:OO.domainHost,parse:EO,serialize:IO},Zh={scheme:"ws",domainHost:!0,parse:BH,serialize:VH},KH={scheme:"wss",domainHost:Zh.domainHost,parse:Zh.parse,serialize:Zh.serialize},QH={scheme:"urn",parse:WH,serialize:zH,skipNormalize:!0},ZH={scheme:"urn:uuid",parse:JH,serialize:GH,skipNormalize:!0},Xh={http:OO,https:YH,ws:Zh,wss:KH,urn:QH,"urn:uuid":ZH};Object.setPrototypeOf(Xh,null);function tw(t){return t&&(Xh[t]||Xh[t.toLowerCase()])||void 0}qO.exports={wsIsSecure:ew,SCHEMES:Xh,isValidSchemeName:HH,getSchemeHandler:tw}});var MO=H(($Q,em)=>{"use strict";var{normalizeIPv6:XH,removeDotSegments:bf,recomposeAuthority:eB,normalizePercentEncoding:tB,normalizePathEncoding:rB,escapePreservingEscapes:nB,reescapeHostDelimiters:iB,isIPv4:sB,nonSimpleDomain:oB}=XS(),{SCHEMES:aB,getSchemeHandler:TO}=kO();function lB(t,e){return typeof t=="string"?t=pB(t,e):typeof t=="object"&&(t=tu(ba(t,e),e)),t}function uB(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=AO(tu(t,n),tu(e,n),n,!0);return n.skipEscape=!0,ba(i,n)}function AO(t,e,r,n){let i={};return n||(t=tu(ba(t,r),r),e=tu(ba(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=bf(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=bf(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=bf(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=bf(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function cB(t,e,r){let n=PO(t,r),i=PO(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function ba(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=TO(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=tB(r.path):(r.path=nB(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=eB(r);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=bf(l)),o===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),i.push(l)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var fB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function dB(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function $O(t,e){let r=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;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let o=t.match(fB);if(o){n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]);let l=dB(n,o);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(sB(n.host)===!1){let p=XH(n.host);n.host=p.host.toLowerCase(),s=p.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",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let f=TO(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&oB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}if((!f||f&&!f.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=iB(unescape(n.host),s))),n.path&&(n.path=rB(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}f&&f.parse&&f.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function tu(t,e){return $O(t,e).parsed}function pB(t,e){return NO(t,e).normalized}function NO(t,e){let{parsed:r,malformedAuthorityOrPort:n}=$O(t,e);return{normalized:n?t:ba(r,e),malformedAuthorityOrPort:n}}function PO(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=NO(t,e);return n?void 0:r}if(typeof t=="object")return ba(t,e)}var rw={SCHEMES:aB,normalize:lB,resolve:uB,resolveComponent:AO,equal:cB,serialize:ba,parse:tu};em.exports=rw;em.exports.default=rw;em.exports.fastUri=rw});var DO=H(nw=>{"use strict";Object.defineProperty(nw,"__esModule",{value:!0});var FO=MO();FO.code='require("ajv/dist/runtime/uri").default';nw.default=FO});var zO=H(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.CodeGen=sr.Name=sr.nil=sr.stringify=sr.str=sr._=sr.KeywordCxt=void 0;var hB=yf();Object.defineProperty(sr,"KeywordCxt",{enumerable:!0,get:function(){return hB.KeywordCxt}});var ru=je();Object.defineProperty(sr,"_",{enumerable:!0,get:function(){return ru._}});Object.defineProperty(sr,"str",{enumerable:!0,get:function(){return ru.str}});Object.defineProperty(sr,"stringify",{enumerable:!0,get:function(){return ru.stringify}});Object.defineProperty(sr,"nil",{enumerable:!0,get:function(){return ru.nil}});Object.defineProperty(sr,"Name",{enumerable:!0,get:function(){return ru.Name}});Object.defineProperty(sr,"CodeGen",{enumerable:!0,get:function(){return ru.CodeGen}});var mB=Yh(),BO=vf(),gB=PS(),Sf=Qh(),yB=je(),wf=hf(),tm=pf(),sw=Ke(),LO=bO(),vB=DO(),VO=(t,e)=>new RegExp(t,e);VO.code="new RegExp";var bB=["removeAdditional","useDefaults","coerceTypes"],SB=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),wB={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."},_B={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},jO=200;function RB(t){var e,r,n,i,s,o,l,f,c,p,h,g,v,_,w,E,k,T,N,$,j,G,q,C,A;let D=t.strict,B=(e=t.code)===null||e===void 0?void 0:e.optimize,F=B===!0||B===void 0?1:B||0,K=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:VO,ee=(i=t.uriResolver)!==null&&i!==void 0?i:vB.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:D)!==null&&o!==void 0?o:!0,strictNumbers:(f=(l=t.strictNumbers)!==null&&l!==void 0?l:D)!==null&&f!==void 0?f:!0,strictTypes:(p=(c=t.strictTypes)!==null&&c!==void 0?c:D)!==null&&p!==void 0?p:"log",strictTuples:(g=(h=t.strictTuples)!==null&&h!==void 0?h:D)!==null&&g!==void 0?g:"log",strictRequired:(_=(v=t.strictRequired)!==null&&v!==void 0?v:D)!==null&&_!==void 0?_:!1,code:t.code?{...t.code,optimize:F,regExp:K}:{optimize:F,regExp:K},loopRequired:(w=t.loopRequired)!==null&&w!==void 0?w:jO,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:jO,meta:(k=t.meta)!==null&&k!==void 0?k:!0,messages:(T=t.messages)!==null&&T!==void 0?T:!0,inlineRefs:(N=t.inlineRefs)!==null&&N!==void 0?N:!0,schemaId:($=t.schemaId)!==null&&$!==void 0?$:"$id",addUsedSchema:(j=t.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(G=t.validateSchema)!==null&&G!==void 0?G:!0,validateFormats:(q=t.validateFormats)!==null&&q!==void 0?q:!0,unicodeRegExp:(C=t.unicodeRegExp)!==null&&C!==void 0?C:!0,int32range:(A=t.int32range)!==null&&A!==void 0?A:!0,uriResolver:ee}}var _f=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,...RB(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new yB.ValueScope({scope:{},prefixes:SB,es5:r,lines:n}),this.logger=qB(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,gB.getRules)(),UO.call(this,wB,e,"NOT SUPPORTED"),UO.call(this,_B,e,"DEPRECATED","warn"),this._metaOpts=IB.call(this),e.formats&&xB.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&EB.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),CB.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=LO;n==="id"&&(i={...LO},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){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(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){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,r);async function i(p,h){await s.call(this,p.$schema);let g=this._addSchema(p,h);return g.validate||o.call(this,g)}async function s(p){p&&!this.getSchema(p)&&await i.call(this,{$ref:p},!0)}async function o(p){try{return this._compileSchemaEnv(p)}catch(h){if(!(h instanceof BO.default))throw h;return l.call(this,h),await f.call(this,h.missingSchema),o.call(this,p)}}function l({missingSchema:p,missingRef:h}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${h} cannot be resolved`)}async function f(p){let h=await c.call(this,p);this.refs[p]||await s.call(this,h.$schema),this.refs[p]||this.addSchema(h,p,r)}async function c(p){let h=this._loading[p];if(h)return h;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,wf.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){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&&r){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 r;for(;typeof(r=HO.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Sf.SchemaEnv({schema:{},schemaId:n});if(r=Sf.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}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 r=HO.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,wf.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.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(PB.call(this,n,r),!r)return(0,sw.eachItem)(n,s=>iw.call(this,s)),this;AB.call(this,r);let i={...r,type:(0,tm.getJSONTypes)(r.type),schemaType:(0,tm.getJSONTypes)(r.schemaType)};return(0,sw.eachItem)(n,i.type.length===0?s=>iw.call(this,s,i):s=>i.type.forEach(o=>iw.call(this,s,i,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),o=e;for(let l of s)o=o[l];for(let l in n){let f=n[l];if(typeof f!="object")continue;let{$data:c}=f.definition,p=o[l];c&&p&&(o[l]=WO(p))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:l}=this.opts;if(typeof e=="object")o=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,wf.normalizeId)(o||n);let c=wf.getSchemaRefs.call(this,e,n);return f=new Sf.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:c}),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):Sf.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Sf.compileSchema.call(this,e)}finally{this.opts=r}}};_f.ValidationError=mB.default;_f.MissingRefError=BO.default;sr.default=_f;function UO(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function HO(t){return t=(0,wf.normalizeId)(t),this.schemas[t]||this.refs[t]}function CB(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function xB(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function EB(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function IB(){let t={...this.opts};for(let e of bB)delete t[e];return t}var OB={log(){},warn(){},error(){}};function qB(t){if(t===!1)return OB;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var kB=/^[a-z_$][a-z0-9_$:-]*$/i;function PB(t,e){let{RULES:r}=this;if((0,sw.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!kB.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 iw(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:f})=>f===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,tm.getJSONTypes)(e.type),schemaType:(0,tm.getJSONTypes)(e.schemaType)}};e.before?TB.call(this,o,l,e.before):o.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function TB(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function AB(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=WO(e)),t.validateSchema=this.compile(e,!0))}var $B={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function WO(t){return{anyOf:[t,$B]}}});var JO=H(ow=>{"use strict";Object.defineProperty(ow,"__esModule",{value:!0});var NB={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ow.default=NB});var QO=H(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.callRef=Sa.getValidate=void 0;var MB=vf(),GO=In(),Vr=je(),nu=ls(),YO=Qh(),rm=Ke(),FB={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:l,self:f}=n,{root:c}=s;if((r==="#"||r==="#/")&&i===c.baseId)return h();let p=YO.resolveRef.call(f,c,i,r);if(p===void 0)throw new MB.default(n.opts.uriResolver,i,r);if(p instanceof YO.SchemaEnv)return g(p);return v(p);function h(){if(s===c)return nm(t,o,s,s.$async);let _=e.scopeValue("root",{ref:c});return nm(t,(0,Vr._)`${_}.validate`,c,c.$async)}function g(_){let w=KO(t,_);nm(t,w,_,_.$async)}function v(_){let w=e.scopeValue("schema",l.code.source===!0?{ref:_,code:(0,Vr.stringify)(_)}:{ref:_}),E=e.name("valid"),k=t.subschema({schema:_,dataTypes:[],schemaPath:Vr.nil,topSchemaRef:w,errSchemaPath:r},E);t.mergeEvaluated(k),t.ok(E)}}};function KO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Vr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Sa.getValidate=KO;function nm(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:l,opts:f}=s,c=f.passContext?nu.default.this:Vr.nil;n?p():h();function p(){if(!l.$async)throw new Error("async schema referenced by sync schema");let _=i.let("valid");i.try(()=>{i.code((0,Vr._)`await ${(0,GO.callValidateCode)(t,e,c)}`),v(e),o||i.assign(_,!0)},w=>{i.if((0,Vr._)`!(${w} instanceof ${s.ValidationError})`,()=>i.throw(w)),g(w),o||i.assign(_,!1)}),t.ok(_)}function h(){t.result((0,GO.callValidateCode)(t,e,c),()=>v(e),()=>g(e))}function g(_){let w=(0,Vr._)`${_}.errors`;i.assign(nu.default.vErrors,(0,Vr._)`${nu.default.vErrors} === null ? ${w} : ${nu.default.vErrors}.concat(${w})`),i.assign(nu.default.errors,(0,Vr._)`${nu.default.vErrors}.length`)}function v(_){var w;if(!s.opts.unevaluated)return;let E=(w=r?.validate)===null||w===void 0?void 0:w.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=rm.mergeEvaluated.props(i,E.props,s.props));else{let k=i.var("props",(0,Vr._)`${_}.evaluated.props`);s.props=rm.mergeEvaluated.props(i,k,s.props,Vr.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=rm.mergeEvaluated.items(i,E.items,s.items));else{let k=i.var("items",(0,Vr._)`${_}.evaluated.items`);s.items=rm.mergeEvaluated.items(i,k,s.items,Vr.Name)}}}Sa.callRef=nm;Sa.default=FB});var ZO=H(aw=>{"use strict";Object.defineProperty(aw,"__esModule",{value:!0});var DB=JO(),LB=QO(),jB=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",DB.default,LB.default];aw.default=jB});var XO=H(lw=>{"use strict";Object.defineProperty(lw,"__esModule",{value:!0});var im=je(),to=im.operators,sm={maximum:{okStr:"<=",ok:to.LTE,fail:to.GT},minimum:{okStr:">=",ok:to.GTE,fail:to.LT},exclusiveMaximum:{okStr:"<",ok:to.LT,fail:to.GTE},exclusiveMinimum:{okStr:">",ok:to.GT,fail:to.LTE}},UB={message:({keyword:t,schemaCode:e})=>(0,im.str)`must be ${sm[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,im._)`{comparison: ${sm[t].okStr}, limit: ${e}}`},HB={keyword:Object.keys(sm),type:"number",schemaType:"number",$data:!0,error:UB,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,im._)`${r} ${sm[e].fail} ${n} || isNaN(${r})`)}};lw.default=HB});var eq=H(uw=>{"use strict";Object.defineProperty(uw,"__esModule",{value:!0});var Rf=je(),BB={message:({schemaCode:t})=>(0,Rf.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Rf._)`{multipleOf: ${t}}`},VB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:BB,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),l=s?(0,Rf._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,Rf._)`${o} !== parseInt(${o})`;t.fail$data((0,Rf._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};uw.default=VB});var rq=H(cw=>{"use strict";Object.defineProperty(cw,"__esModule",{value:!0});function tq(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}cw.default=tq;tq.code='require("ajv/dist/runtime/ucs2length").default'});var nq=H(fw=>{"use strict";Object.defineProperty(fw,"__esModule",{value:!0});var wa=je(),WB=Ke(),zB=rq(),JB={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,wa.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,wa._)`{limit: ${t}}`},GB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:JB,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?wa.operators.GT:wa.operators.LT,o=i.opts.unicode===!1?(0,wa._)`${r}.length`:(0,wa._)`${(0,WB.useFunc)(t.gen,zB.default)}(${r})`;t.fail$data((0,wa._)`${o} ${s} ${n}`)}};fw.default=GB});var iq=H(dw=>{"use strict";Object.defineProperty(dw,"__esModule",{value:!0});var YB=In(),KB=Ke(),iu=je(),QB={message:({schemaCode:t})=>(0,iu.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,iu._)`{pattern: ${t}}`},ZB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:QB,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t,l=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:f}=o.opts.code,c=f.code==="new RegExp"?(0,iu._)`new RegExp`:(0,KB.useFunc)(e,f),p=e.let("valid");e.try(()=>e.assign(p,(0,iu._)`${c}(${s}, ${l}).test(${r})`),()=>e.assign(p,!1)),t.fail$data((0,iu._)`!${p}`)}else{let f=(0,YB.usePattern)(t,i);t.fail$data((0,iu._)`!${f}.test(${r})`)}}};dw.default=ZB});var sq=H(pw=>{"use strict";Object.defineProperty(pw,"__esModule",{value:!0});var Cf=je(),XB={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Cf.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Cf._)`{limit: ${t}}`},eV={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:XB,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Cf.operators.GT:Cf.operators.LT;t.fail$data((0,Cf._)`Object.keys(${r}).length ${i} ${n}`)}};pw.default=eV});var oq=H(hw=>{"use strict";Object.defineProperty(hw,"__esModule",{value:!0});var xf=In(),Ef=je(),tV=Ke(),rV={message:({params:{missingProperty:t}})=>(0,Ef.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Ef._)`{missingProperty: ${t}}`},nV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:rV,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:o}=t,{opts:l}=o;if(!s&&r.length===0)return;let f=r.length>=l.loopRequired;if(o.allErrors?c():p(),l.strictRequired){let v=t.parentSchema.properties,{definedProperties:_}=t.it;for(let w of r)if(v?.[w]===void 0&&!_.has(w)){let E=o.schemaEnv.baseId+o.errSchemaPath,k=`required property "${w}" is not defined at "${E}" (strictRequired)`;(0,tV.checkStrictMode)(o,k,o.opts.strictRequired)}}function c(){if(f||s)t.block$data(Ef.nil,h);else for(let v of r)(0,xf.checkReportMissingProp)(t,v)}function p(){let v=e.let("missing");if(f||s){let _=e.let("valid",!0);t.block$data(_,()=>g(v,_)),t.ok(_)}else e.if((0,xf.checkMissingProp)(t,r,v)),(0,xf.reportMissingProp)(t,v),e.else()}function h(){e.forOf("prop",n,v=>{t.setParams({missingProperty:v}),e.if((0,xf.noPropertyInData)(e,i,v,l.ownProperties),()=>t.error())})}function g(v,_){t.setParams({missingProperty:v}),e.forOf(v,n,()=>{e.assign(_,(0,xf.propertyInData)(e,i,v,l.ownProperties)),e.if((0,Ef.not)(_),()=>{t.error(),e.break()})},Ef.nil)}}};hw.default=nV});var aq=H(mw=>{"use strict";Object.defineProperty(mw,"__esModule",{value:!0});var If=je(),iV={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,If.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,If._)`{limit: ${t}}`},sV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:iV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?If.operators.GT:If.operators.LT;t.fail$data((0,If._)`${r}.length ${i} ${n}`)}};mw.default=sV});var om=H(gw=>{"use strict";Object.defineProperty(gw,"__esModule",{value:!0});var lq=LS();lq.code='require("ajv/dist/runtime/equal").default';gw.default=lq});var uq=H(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});var yw=pf(),or=je(),oV=Ke(),aV=om(),lV={message:({params:{i:t,j:e}})=>(0,or.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,or._)`{i: ${t}, j: ${e}}`},uV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:lV,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:l}=t;if(!n&&!i)return;let f=e.let("valid"),c=s.items?(0,yw.getSchemaTypes)(s.items):[];t.block$data(f,p,(0,or._)`${o} === false`),t.ok(f);function p(){let _=e.let("i",(0,or._)`${r}.length`),w=e.let("j");t.setParams({i:_,j:w}),e.assign(f,!0),e.if((0,or._)`${_} > 1`,()=>(h()?g:v)(_,w))}function h(){return c.length>0&&!c.some(_=>_==="object"||_==="array")}function g(_,w){let E=e.name("item"),k=(0,yw.checkDataTypes)(c,E,l.opts.strictNumbers,yw.DataType.Wrong),T=e.const("indices",(0,or._)`{}`);e.for((0,or._)`;${_}--;`,()=>{e.let(E,(0,or._)`${r}[${_}]`),e.if(k,(0,or._)`continue`),c.length>1&&e.if((0,or._)`typeof ${E} == "string"`,(0,or._)`${E} += "_"`),e.if((0,or._)`typeof ${T}[${E}] == "number"`,()=>{e.assign(w,(0,or._)`${T}[${E}]`),t.error(),e.assign(f,!1).break()}).code((0,or._)`${T}[${E}] = ${_}`)})}function v(_,w){let E=(0,oV.useFunc)(e,aV.default),k=e.name("outer");e.label(k).for((0,or._)`;${_}--;`,()=>e.for((0,or._)`${w} = ${_}; ${w}--;`,()=>e.if((0,or._)`${E}(${r}[${_}], ${r}[${w}])`,()=>{t.error(),e.assign(f,!1).break(k)})))}}};vw.default=uV});var cq=H(Sw=>{"use strict";Object.defineProperty(Sw,"__esModule",{value:!0});var bw=je(),cV=Ke(),fV=om(),dV={message:"must be equal to constant",params:({schemaCode:t})=>(0,bw._)`{allowedValue: ${t}}`},pV={keyword:"const",$data:!0,error:dV,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,bw._)`!${(0,cV.useFunc)(e,fV.default)}(${r}, ${i})`):t.fail((0,bw._)`${s} !== ${r}`)}};Sw.default=pV});var fq=H(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});var Of=je(),hV=Ke(),mV=om(),gV={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Of._)`{allowedValues: ${t}}`},yV={keyword:"enum",schemaType:"array",$data:!0,error:gV,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let l=i.length>=o.opts.loopEnum,f,c=()=>f??(f=(0,hV.useFunc)(e,mV.default)),p;if(l||n)p=e.let("valid"),t.block$data(p,h);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let v=e.const("vSchema",s);p=(0,Of.or)(...i.map((_,w)=>g(v,w)))}t.pass(p);function h(){e.assign(p,!1),e.forOf("v",s,v=>e.if((0,Of._)`${c()}(${r}, ${v})`,()=>e.assign(p,!0).break()))}function g(v,_){let w=i[_];return typeof w=="object"&&w!==null?(0,Of._)`${c()}(${r}, ${v}[${_}])`:(0,Of._)`${r} === ${w}`}}};ww.default=yV});var dq=H(_w=>{"use strict";Object.defineProperty(_w,"__esModule",{value:!0});var vV=XO(),bV=eq(),SV=nq(),wV=iq(),_V=sq(),RV=oq(),CV=aq(),xV=uq(),EV=cq(),IV=fq(),OV=[vV.default,bV.default,SV.default,wV.default,_V.default,RV.default,CV.default,xV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},EV.default,IV.default];_w.default=OV});var Cw=H(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.validateAdditionalItems=void 0;var _a=je(),Rw=Ke(),qV={message:({params:{len:t}})=>(0,_a.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,_a._)`{limit: ${t}}`},kV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:qV,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Rw.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}pq(t,n)}};function pq(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let l=r.const("len",(0,_a._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,_a._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Rw.alwaysValidSchema)(o,n)){let c=r.var("valid",(0,_a._)`${l} <= ${e.length}`);r.if((0,_a.not)(c),()=>f(c)),t.ok(c)}function f(c){r.forRange("i",e.length,l,p=>{t.subschema({keyword:s,dataProp:p,dataPropType:Rw.Type.Num},c),o.allErrors||r.if((0,_a.not)(c),()=>r.break())})}}qf.validateAdditionalItems=pq;qf.default=kV});var xw=H(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.validateTuple=void 0;var hq=je(),am=Ke(),PV=In(),TV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return mq(t,"additionalItems",e);r.items=!0,!(0,am.alwaysValidSchema)(r,e)&&t.ok((0,PV.validateArray)(t))}};function mq(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:l}=t;p(i),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=am.mergeEvaluated.items(n,r.length,l.items));let f=n.name("valid"),c=n.const("len",(0,hq._)`${s}.length`);r.forEach((h,g)=>{(0,am.alwaysValidSchema)(l,h)||(n.if((0,hq._)`${c} > ${g}`,()=>t.subschema({keyword:o,schemaProp:g,dataProp:g},f)),t.ok(f))});function p(h){let{opts:g,errSchemaPath:v}=l,_=r.length,w=_===h.minItems&&(_===h.maxItems||h[e]===!1);if(g.strictTuples&&!w){let E=`"${o}" is ${_}-tuple, but minItems or maxItems/${e} are not specified or different at path "${v}"`;(0,am.checkStrictMode)(l,E,g.strictTuples)}}}kf.validateTuple=mq;kf.default=TV});var gq=H(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});var AV=xw(),$V={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,AV.validateTuple)(t,"items")};Ew.default=$V});var vq=H(Iw=>{"use strict";Object.defineProperty(Iw,"__esModule",{value:!0});var yq=je(),NV=Ke(),MV=In(),FV=Cw(),DV={message:({params:{len:t}})=>(0,yq.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,yq._)`{limit: ${t}}`},LV={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:DV,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,NV.alwaysValidSchema)(n,e)&&(i?(0,FV.validateAdditionalItems)(t,i):t.ok((0,MV.validateArray)(t)))}};Iw.default=LV});var bq=H(Ow=>{"use strict";Object.defineProperty(Ow,"__esModule",{value:!0});var qn=je(),lm=Ke(),jV={message:({params:{min:t,max:e}})=>e===void 0?(0,qn.str)`must contain at least ${t} valid item(s)`:(0,qn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,qn._)`{minContains: ${t}}`:(0,qn._)`{minContains: ${t}, maxContains: ${e}}`},UV={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:jV,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,l,{minContains:f,maxContains:c}=n;s.opts.next?(o=f===void 0?1:f,l=c):o=1;let p=e.const("len",(0,qn._)`${i}.length`);if(t.setParams({min:o,max:l}),l===void 0&&o===0){(0,lm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,lm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,lm.alwaysValidSchema)(s,r)){let w=(0,qn._)`${p} >= ${o}`;l!==void 0&&(w=(0,qn._)`${w} && ${p} <= ${l}`),t.pass(w);return}s.items=!0;let h=e.name("valid");l===void 0&&o===1?v(h,()=>e.if(h,()=>e.break())):o===0?(e.let(h,!0),l!==void 0&&e.if((0,qn._)`${i}.length > 0`,g)):(e.let(h,!1),g()),t.result(h,()=>t.reset());function g(){let w=e.name("_valid"),E=e.let("count",0);v(w,()=>e.if(w,()=>_(E)))}function v(w,E){e.forRange("i",0,p,k=>{t.subschema({keyword:"contains",dataProp:k,dataPropType:lm.Type.Num,compositeRule:!0},w),E()})}function _(w){e.code((0,qn._)`${w}++`),l===void 0?e.if((0,qn._)`${w} >= ${o}`,()=>e.assign(h,!0).break()):(e.if((0,qn._)`${w} > ${l}`,()=>e.assign(h,!1).break()),o===1?e.assign(h,!0):e.if((0,qn._)`${w} >= ${o}`,()=>e.assign(h,!0)))}}};Ow.default=UV});var _q=H(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.validateSchemaDeps=qi.validatePropertyDeps=qi.error=void 0;var qw=je(),HV=Ke(),Pf=In();qi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,qw.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,qw._)`{property: ${t},
28
28
  missingProperty: ${n},
29
29
  depsCount: ${e},
30
- deps: ${r}}`};var BV={keyword:"dependencies",type:"object",schemaType:"object",error:Oi.error,code(t){let[e,r]=VV(t);SO(t,e),wO(t,r)}};function VV({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function SO(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let o in e){let l=e[o];if(l.length===0)continue;let f=(0,Pf.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(f,()=>{for(let c of l)(0,Pf.checkReportMissingProp)(t,c)}):(r.if((0,Ow._)`${f} && (${(0,Pf.checkMissingProp)(t,l,s)})`),(0,Pf.reportMissingProp)(t,s),r.else())}}Oi.validatePropertyDeps=SO;function wO(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let l in e)(0,HV.alwaysValidSchema)(s,e[l])||(r.if((0,Pf.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:l},o);t.mergeValidEvaluated(f,o)},()=>r.var(o,!0)),t.ok(o))}Oi.validateSchemaDeps=wO;Oi.default=BV});var CO=H(kw=>{"use strict";Object.defineProperty(kw,"__esModule",{value:!0});var RO=je(),WV=Ke(),zV={message:"property name must be valid",params:({params:t})=>(0,RO._)`{propertyName: ${t.propertyName}}`},JV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:zV,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,WV.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,RO.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};kw.default=JV});var Tw=H(Pw=>{"use strict";Object.defineProperty(Pw,"__esModule",{value:!0});var um=In(),ti=je(),GV=ls(),cm=Ke(),YV={message:"must NOT have additional properties",params:({params:t})=>(0,ti._)`{additionalProperty: ${t.additionalProperty}}`},KV={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:YV,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:f}=o;if(o.props=!0,f.removeAdditional!=="all"&&(0,cm.alwaysValidSchema)(o,r))return;let c=(0,um.allSchemaProperties)(n.properties),p=(0,um.allSchemaProperties)(n.patternProperties);h(),t.ok((0,ti._)`${s} === ${GV.default.errors}`);function h(){e.forIn("key",i,E=>{!c.length&&!p.length?_(E):e.if(g(E),()=>_(E))})}function g(E){let k;if(c.length>8){let T=(0,cm.schemaRefOrVal)(o,n.properties,"properties");k=(0,um.isOwnProperty)(e,T,E)}else c.length?k=(0,ti.or)(...c.map(T=>(0,ti._)`${E} === ${T}`)):k=ti.nil;return p.length&&(k=(0,ti.or)(k,...p.map(T=>(0,ti._)`${(0,um.usePattern)(t,T)}.test(${E})`))),(0,ti.not)(k)}function v(E){e.code((0,ti._)`delete ${i}[${E}]`)}function _(E){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){v(E);return}if(r===!1){t.setParams({additionalProperty:E}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,cm.alwaysValidSchema)(o,r)){let k=e.name("valid");f.removeAdditional==="failing"?(w(E,k,!1),e.if((0,ti.not)(k),()=>{t.reset(),v(E)})):(w(E,k),l||e.if((0,ti.not)(k),()=>e.break()))}}function w(E,k,T){let N={keyword:"additionalProperties",dataProp:E,dataPropType:cm.Type.Str};T===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(N,k)}}};Pw.default=KV});var IO=H($w=>{"use strict";Object.defineProperty($w,"__esModule",{value:!0});var QV=yf(),xO=In(),Aw=Ke(),EO=Tw(),ZV={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&EO.default.code(new QV.KeywordCxt(s,EO.default,"additionalProperties"));let o=(0,xO.allSchemaProperties)(r);for(let h of o)s.definedProperties.add(h);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=Aw.mergeEvaluated.props(e,(0,Aw.toHash)(o),s.props));let l=o.filter(h=>!(0,Aw.alwaysValidSchema)(s,r[h]));if(l.length===0)return;let f=e.name("valid");for(let h of l)c(h)?p(h):(e.if((0,xO.propertyInData)(e,i,h,s.opts.ownProperties)),p(h),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(f);function c(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}function p(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},f)}}};$w.default=ZV});var PO=H(Nw=>{"use strict";Object.defineProperty(Nw,"__esModule",{value:!0});var qO=In(),fm=je(),OO=Ke(),kO=Ke(),XV={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:o}=s,l=(0,qO.allSchemaProperties)(r),f=l.filter(w=>(0,OO.alwaysValidSchema)(s,r[w]));if(l.length===0||f.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let c=o.strictSchema&&!o.allowMatchingProperties&&i.properties,p=e.name("valid");s.props!==!0&&!(s.props instanceof fm.Name)&&(s.props=(0,kO.evaluatedPropsToName)(e,s.props));let{props:h}=s;g();function g(){for(let w of l)c&&v(w),s.allErrors?_(w):(e.var(p,!0),_(w),e.if(p))}function v(w){for(let E in c)new RegExp(w).test(E)&&(0,OO.checkStrictMode)(s,`property ${E} matches pattern ${w} (use allowMatchingProperties)`)}function _(w){e.forIn("key",n,E=>{e.if((0,fm._)`${(0,qO.usePattern)(t,w)}.test(${E})`,()=>{let k=f.includes(w);k||t.subschema({keyword:"patternProperties",schemaProp:w,dataProp:E,dataPropType:kO.Type.Str},p),s.opts.unevaluated&&h!==!0?e.assign((0,fm._)`${h}[${E}]`,!0):!k&&!s.allErrors&&e.if((0,fm.not)(p),()=>e.break())})})}}};Nw.default=XV});var TO=H(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});var eW=Ke(),tW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,eW.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Mw.default=tW});var AO=H(Fw=>{"use strict";Object.defineProperty(Fw,"__esModule",{value:!0});var rW=In(),nW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:rW.validateUnion,error:{message:"must match a schema in anyOf"}};Fw.default=nW});var $O=H(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});var dm=je(),iW=Ke(),sW={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,dm._)`{passingSchemas: ${t.passing}}`},oW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:sW,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=e.let("valid",!1),l=e.let("passing",null),f=e.name("_valid");t.setParams({passing:l}),e.block(c),t.result(o,()=>t.reset(),()=>t.error(!0));function c(){s.forEach((p,h)=>{let g;(0,iW.alwaysValidSchema)(i,p)?e.var(f,!0):g=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},f),h>0&&e.if((0,dm._)`${f} && ${o}`).assign(o,!1).assign(l,(0,dm._)`[${l}, ${h}]`).else(),e.if(f,()=>{e.assign(o,!0),e.assign(l,h),g&&t.mergeEvaluated(g,dm.Name)})})}}};Dw.default=oW});var NO=H(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});var aW=Ke(),lW={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,o)=>{if((0,aW.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(l)})}};Lw.default=lW});var DO=H(jw=>{"use strict";Object.defineProperty(jw,"__esModule",{value:!0});var pm=je(),FO=Ke(),uW={message:({params:t})=>(0,pm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,pm._)`{failingKeyword: ${t.ifClause}}`},cW={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:uW,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,FO.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=MO(n,"then"),s=MO(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),l=e.name("_valid");if(f(),t.reset(),i&&s){let p=e.let("ifClause");t.setParams({ifClause:p}),e.if(l,c("then",p),c("else",p))}else i?e.if(l,c("then")):e.if((0,pm.not)(l),c("else"));t.pass(o,()=>t.error(!0));function f(){let p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(p)}function c(p,h){return()=>{let g=t.subschema({keyword:p},l);e.assign(o,l),t.mergeValidEvaluated(g,o),h?e.assign(h,(0,pm._)`${p}`):t.setParams({ifClause:p})}}}};function MO(t,e){let r=t.schema[e];return r!==void 0&&!(0,FO.alwaysValidSchema)(t,r)}jw.default=cW});var LO=H(Uw=>{"use strict";Object.defineProperty(Uw,"__esModule",{value:!0});var fW=Ke(),dW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,fW.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Uw.default=dW});var jO=H(Hw=>{"use strict";Object.defineProperty(Hw,"__esModule",{value:!0});var pW=Cw(),hW=gO(),mW=xw(),gW=vO(),yW=bO(),vW=_O(),bW=CO(),SW=Tw(),wW=IO(),_W=PO(),RW=TO(),CW=AO(),xW=$O(),EW=NO(),IW=DO(),qW=LO();function OW(t=!1){let e=[RW.default,CW.default,xW.default,EW.default,IW.default,qW.default,bW.default,SW.default,vW.default,wW.default,_W.default];return t?e.push(hW.default,gW.default):e.push(pW.default,mW.default),e.push(yW.default),e}Hw.default=OW});var UO=H(Bw=>{"use strict";Object.defineProperty(Bw,"__esModule",{value:!0});var jt=je(),kW={message:({schemaCode:t})=>(0,jt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,jt._)`{format: ${t}}`},PW={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:kW,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:l}=t,{opts:f,errSchemaPath:c,schemaEnv:p,self:h}=l;if(!f.validateFormats)return;i?g():v();function g(){let _=r.scopeValue("formats",{ref:h.formats,code:f.code.formats}),w=r.const("fDef",(0,jt._)`${_}[${o}]`),E=r.let("fType"),k=r.let("format");r.if((0,jt._)`typeof ${w} == "object" && !(${w} instanceof RegExp)`,()=>r.assign(E,(0,jt._)`${w}.type || "string"`).assign(k,(0,jt._)`${w}.validate`),()=>r.assign(E,(0,jt._)`"string"`).assign(k,w)),t.fail$data((0,jt.or)(T(),N()));function T(){return f.strictSchema===!1?jt.nil:(0,jt._)`${o} && !${k}`}function N(){let $=p.$async?(0,jt._)`(${w}.async ? await ${k}(${n}) : ${k}(${n}))`:(0,jt._)`${k}(${n})`,j=(0,jt._)`(typeof ${k} == "function" ? ${$} : ${k}.test(${n}))`;return(0,jt._)`${k} && ${k} !== true && ${E} === ${e} && !${j}`}}function v(){let _=h.formats[s];if(!_){T();return}if(_===!0)return;let[w,E,k]=N(_);w===e&&t.pass($());function T(){if(f.strictSchema===!1){h.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${s}" ignored in schema at path "${c}"`}}function N(j){let G=j instanceof RegExp?(0,jt.regexpCode)(j):f.code.formats?(0,jt._)`${f.code.formats}${(0,jt.getProperty)(s)}`:void 0,O=r.scopeValue("formats",{key:s,ref:j,code:G});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,jt._)`${O}.validate`]:["string",j,O]}function $(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!p.$async)throw new Error("async format in sync schema");return(0,jt._)`await ${k}(${n})`}return typeof E=="function"?(0,jt._)`${k}(${n})`:(0,jt._)`${k}.test(${n})`}}}};Bw.default=PW});var HO=H(Vw=>{"use strict";Object.defineProperty(Vw,"__esModule",{value:!0});var TW=UO(),AW=[TW.default];Vw.default=AW});var BO=H(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.contentVocabulary=su.metadataVocabulary=void 0;su.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];su.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var WO=H(Ww=>{"use strict";Object.defineProperty(Ww,"__esModule",{value:!0});var $W=Zq(),NW=dO(),MW=jO(),FW=HO(),VO=BO(),DW=[$W.default,NW.default,(0,MW.default)(),FW.default,VO.metadataVocabulary,VO.contentVocabulary];Ww.default=DW});var JO=H(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.DiscrError=void 0;var zO;(function(t){t.Tag="tag",t.Mapping="mapping"})(zO||(hm.DiscrError=zO={}))});var YO=H(Jw=>{"use strict";Object.defineProperty(Jw,"__esModule",{value:!0});var ou=je(),zw=JO(),GO=Qh(),LW=vf(),jW=Ke(),UW={message:({params:{discrError:t,tagName:e}})=>t===zw.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,ou._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},HW={keyword:"discriminator",type:"object",schemaType:"object",error:UW,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:o}=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(!o)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),c=e.const("tag",(0,ou._)`${r}${(0,ou.getProperty)(l)}`);e.if((0,ou._)`typeof ${c} == "string"`,()=>p(),()=>t.error(!1,{discrError:zw.DiscrError.Tag,tag:c,tagName:l})),t.ok(f);function p(){let v=g();e.if(!1);for(let _ in v)e.elseIf((0,ou._)`${c} === ${_}`),e.assign(f,h(v[_]));e.else(),t.error(!1,{discrError:zw.DiscrError.Mapping,tag:c,tagName:l}),e.endIf()}function h(v){let _=e.name("valid"),w=t.subschema({keyword:"oneOf",schemaProp:v},_);return t.mergeEvaluated(w,ou.Name),_}function g(){var v;let _={},w=k(i),E=!0;for(let $=0;$<o.length;$++){let j=o[$];if(j?.$ref&&!(0,jW.schemaHasRulesButRef)(j,s.self.RULES)){let O=j.$ref;if(j=GO.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,O),j instanceof GO.SchemaEnv&&(j=j.schema),j===void 0)throw new LW.default(s.opts.uriResolver,s.baseId,O)}let G=(v=j?.properties)===null||v===void 0?void 0:v[l];if(typeof G!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);E=E&&(w||k(j)),T(G,$)}if(!E)throw new Error(`discriminator: "${l}" must be required`);return _;function k({required:$}){return Array.isArray($)&&$.includes(l)}function T($,j){if($.const)N($.const,j);else if($.enum)for(let G of $.enum)N(G,j);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function N($,j){if(typeof $!="string"||$ in _)throw new Error(`discriminator: "${l}" values must be unique strings`);_[$]=j}}}};Jw.default=HW});var KO=H((_Z,BW)=>{BW.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 ZO=H((It,Gw)=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.MissingRefError=It.ValidationError=It.CodeGen=It.Name=It.nil=It.stringify=It.str=It._=It.KeywordCxt=It.Ajv=void 0;var VW=zq(),WW=WO(),zW=YO(),QO=KO(),JW=["/properties"],mm="http://json-schema.org/draft-07/schema",au=class extends VW.default{_addVocabularies(){super._addVocabularies(),WW.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(zW.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(QO,JW):QO;this.addMetaSchema(e,mm,!1),this.refs["http://json-schema.org/schema"]=mm}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(mm)?mm:void 0)}};It.Ajv=au;Gw.exports=It=au;Gw.exports.Ajv=au;Object.defineProperty(It,"__esModule",{value:!0});It.default=au;var GW=yf();Object.defineProperty(It,"KeywordCxt",{enumerable:!0,get:function(){return GW.KeywordCxt}});var lu=je();Object.defineProperty(It,"_",{enumerable:!0,get:function(){return lu._}});Object.defineProperty(It,"str",{enumerable:!0,get:function(){return lu.str}});Object.defineProperty(It,"stringify",{enumerable:!0,get:function(){return lu.stringify}});Object.defineProperty(It,"nil",{enumerable:!0,get:function(){return lu.nil}});Object.defineProperty(It,"Name",{enumerable:!0,get:function(){return lu.Name}});Object.defineProperty(It,"CodeGen",{enumerable:!0,get:function(){return lu.CodeGen}});var YW=Yh();Object.defineProperty(It,"ValidationError",{enumerable:!0,get:function(){return YW.default}});var KW=vf();Object.defineProperty(It,"MissingRefError",{enumerable:!0,get:function(){return KW.default}})});import*as QW from"crypto";import*as Ra from"fs";import{createRequire as ZW}from"module";import*as ri from"path";function ym(){return{format:(t,e)=>{let r=t?new Date(t):new Date;return e==="YYYY-MM-DD"?r.toISOString().split("T")[0]:r.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let t=new Date;return{format:()=>t.toISOString(),toISOString:()=>t.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function XO(){return{get:(t,e,r)=>{let n=e.split("."),i=t;for(let s of n)if(i=i?.[s],i===void 0)return r;return i},set:(t,e,r)=>{let n=e.split("."),i=t;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]]=r,t},cloneDeep:t=>JSON.parse(JSON.stringify(t)),keys:t=>Object.keys(t??{}),values:t=>Object.values(t??{}),entries:t=>Object.entries(t??{}),each(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},forEach(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},map:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).map(r=>e(r)),filter:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).filter(r=>e(r)),find:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).find(r=>e(r)),reduce:(t,e,r)=>(Array.isArray(t)?t:Object.values(t??{})).reduce((n,i)=>e(n,i),r),includes:(t,e)=>Array.isArray(t)?t.includes(e):Object.values(t??{}).includes(e),isObject:t=>t!==null&&typeof t=="object"&&!Array.isArray(t),isArray:t=>Array.isArray(t),isString:t=>typeof t=="string",isNumber:t=>typeof t=="number",isFunction:t=>typeof t=="function",isNil:t=>t==null,isEmpty:t=>t==null?!0:Array.isArray(t)||typeof t=="string"?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1,assign:(t,...e)=>Object.assign(t,...e),merge:(t,...e)=>{let r={...t};for(let n of e)for(let[i,s]of Object.entries(n??{}))r[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...r[i]??{},...s}:s;return r},omit:(t,e)=>{let r={...t};for(let n of e)delete r[n];return r},pick:(t,e)=>{let r={};for(let n of e)n in(t??{})&&(r[n]=t[n]);return r}}}function Yw(t,e){return new gm(t,e)}var gm,Kw=se(()=>{"use strict";nS();gm=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Vl}),crypto:()=>QW,path:()=>ri,querystring:()=>ft("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>yI(),XO),moment:()=>this.loadOptionalModule("moment",()=>vI(),ym),tv4:()=>this.loadOptionalModule("tv4",()=>SI()),ajv:()=>this.loadOptionalModule("ajv",()=>ZO()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>ft("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=[],r={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...r,outputChannel:r.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e){let i=ri.resolve(n);if(this.initializeModules(i)){this.modulesPath=i;break}}}loadOptionalModule(e,r,n){try{return r()}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,r){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: ${r}}`};var BV={keyword:"dependencies",type:"object",schemaType:"object",error:qi.error,code(t){let[e,r]=VV(t);Sq(t,e),wq(t,r)}};function VV({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function Sq(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let o in e){let l=e[o];if(l.length===0)continue;let f=(0,Pf.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(f,()=>{for(let c of l)(0,Pf.checkReportMissingProp)(t,c)}):(r.if((0,qw._)`${f} && (${(0,Pf.checkMissingProp)(t,l,s)})`),(0,Pf.reportMissingProp)(t,s),r.else())}}qi.validatePropertyDeps=Sq;function wq(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let l in e)(0,HV.alwaysValidSchema)(s,e[l])||(r.if((0,Pf.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:l},o);t.mergeValidEvaluated(f,o)},()=>r.var(o,!0)),t.ok(o))}qi.validateSchemaDeps=wq;qi.default=BV});var Cq=H(kw=>{"use strict";Object.defineProperty(kw,"__esModule",{value:!0});var Rq=je(),WV=Ke(),zV={message:"property name must be valid",params:({params:t})=>(0,Rq._)`{propertyName: ${t.propertyName}}`},JV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:zV,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,WV.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,Rq.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};kw.default=JV});var Tw=H(Pw=>{"use strict";Object.defineProperty(Pw,"__esModule",{value:!0});var um=In(),ti=je(),GV=ls(),cm=Ke(),YV={message:"must NOT have additional properties",params:({params:t})=>(0,ti._)`{additionalProperty: ${t.additionalProperty}}`},KV={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:YV,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:f}=o;if(o.props=!0,f.removeAdditional!=="all"&&(0,cm.alwaysValidSchema)(o,r))return;let c=(0,um.allSchemaProperties)(n.properties),p=(0,um.allSchemaProperties)(n.patternProperties);h(),t.ok((0,ti._)`${s} === ${GV.default.errors}`);function h(){e.forIn("key",i,E=>{!c.length&&!p.length?_(E):e.if(g(E),()=>_(E))})}function g(E){let k;if(c.length>8){let T=(0,cm.schemaRefOrVal)(o,n.properties,"properties");k=(0,um.isOwnProperty)(e,T,E)}else c.length?k=(0,ti.or)(...c.map(T=>(0,ti._)`${E} === ${T}`)):k=ti.nil;return p.length&&(k=(0,ti.or)(k,...p.map(T=>(0,ti._)`${(0,um.usePattern)(t,T)}.test(${E})`))),(0,ti.not)(k)}function v(E){e.code((0,ti._)`delete ${i}[${E}]`)}function _(E){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){v(E);return}if(r===!1){t.setParams({additionalProperty:E}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,cm.alwaysValidSchema)(o,r)){let k=e.name("valid");f.removeAdditional==="failing"?(w(E,k,!1),e.if((0,ti.not)(k),()=>{t.reset(),v(E)})):(w(E,k),l||e.if((0,ti.not)(k),()=>e.break()))}}function w(E,k,T){let N={keyword:"additionalProperties",dataProp:E,dataPropType:cm.Type.Str};T===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(N,k)}}};Pw.default=KV});var Iq=H($w=>{"use strict";Object.defineProperty($w,"__esModule",{value:!0});var QV=yf(),xq=In(),Aw=Ke(),Eq=Tw(),ZV={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Eq.default.code(new QV.KeywordCxt(s,Eq.default,"additionalProperties"));let o=(0,xq.allSchemaProperties)(r);for(let h of o)s.definedProperties.add(h);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=Aw.mergeEvaluated.props(e,(0,Aw.toHash)(o),s.props));let l=o.filter(h=>!(0,Aw.alwaysValidSchema)(s,r[h]));if(l.length===0)return;let f=e.name("valid");for(let h of l)c(h)?p(h):(e.if((0,xq.propertyInData)(e,i,h,s.opts.ownProperties)),p(h),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(f);function c(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}function p(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},f)}}};$w.default=ZV});var Pq=H(Nw=>{"use strict";Object.defineProperty(Nw,"__esModule",{value:!0});var Oq=In(),fm=je(),qq=Ke(),kq=Ke(),XV={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:o}=s,l=(0,Oq.allSchemaProperties)(r),f=l.filter(w=>(0,qq.alwaysValidSchema)(s,r[w]));if(l.length===0||f.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let c=o.strictSchema&&!o.allowMatchingProperties&&i.properties,p=e.name("valid");s.props!==!0&&!(s.props instanceof fm.Name)&&(s.props=(0,kq.evaluatedPropsToName)(e,s.props));let{props:h}=s;g();function g(){for(let w of l)c&&v(w),s.allErrors?_(w):(e.var(p,!0),_(w),e.if(p))}function v(w){for(let E in c)new RegExp(w).test(E)&&(0,qq.checkStrictMode)(s,`property ${E} matches pattern ${w} (use allowMatchingProperties)`)}function _(w){e.forIn("key",n,E=>{e.if((0,fm._)`${(0,Oq.usePattern)(t,w)}.test(${E})`,()=>{let k=f.includes(w);k||t.subschema({keyword:"patternProperties",schemaProp:w,dataProp:E,dataPropType:kq.Type.Str},p),s.opts.unevaluated&&h!==!0?e.assign((0,fm._)`${h}[${E}]`,!0):!k&&!s.allErrors&&e.if((0,fm.not)(p),()=>e.break())})})}}};Nw.default=XV});var Tq=H(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});var eW=Ke(),tW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,eW.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Mw.default=tW});var Aq=H(Fw=>{"use strict";Object.defineProperty(Fw,"__esModule",{value:!0});var rW=In(),nW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:rW.validateUnion,error:{message:"must match a schema in anyOf"}};Fw.default=nW});var $q=H(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});var dm=je(),iW=Ke(),sW={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,dm._)`{passingSchemas: ${t.passing}}`},oW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:sW,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=e.let("valid",!1),l=e.let("passing",null),f=e.name("_valid");t.setParams({passing:l}),e.block(c),t.result(o,()=>t.reset(),()=>t.error(!0));function c(){s.forEach((p,h)=>{let g;(0,iW.alwaysValidSchema)(i,p)?e.var(f,!0):g=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},f),h>0&&e.if((0,dm._)`${f} && ${o}`).assign(o,!1).assign(l,(0,dm._)`[${l}, ${h}]`).else(),e.if(f,()=>{e.assign(o,!0),e.assign(l,h),g&&t.mergeEvaluated(g,dm.Name)})})}}};Dw.default=oW});var Nq=H(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});var aW=Ke(),lW={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,o)=>{if((0,aW.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(l)})}};Lw.default=lW});var Dq=H(jw=>{"use strict";Object.defineProperty(jw,"__esModule",{value:!0});var pm=je(),Fq=Ke(),uW={message:({params:t})=>(0,pm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,pm._)`{failingKeyword: ${t.ifClause}}`},cW={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:uW,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Fq.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=Mq(n,"then"),s=Mq(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),l=e.name("_valid");if(f(),t.reset(),i&&s){let p=e.let("ifClause");t.setParams({ifClause:p}),e.if(l,c("then",p),c("else",p))}else i?e.if(l,c("then")):e.if((0,pm.not)(l),c("else"));t.pass(o,()=>t.error(!0));function f(){let p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(p)}function c(p,h){return()=>{let g=t.subschema({keyword:p},l);e.assign(o,l),t.mergeValidEvaluated(g,o),h?e.assign(h,(0,pm._)`${p}`):t.setParams({ifClause:p})}}}};function Mq(t,e){let r=t.schema[e];return r!==void 0&&!(0,Fq.alwaysValidSchema)(t,r)}jw.default=cW});var Lq=H(Uw=>{"use strict";Object.defineProperty(Uw,"__esModule",{value:!0});var fW=Ke(),dW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,fW.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Uw.default=dW});var jq=H(Hw=>{"use strict";Object.defineProperty(Hw,"__esModule",{value:!0});var pW=Cw(),hW=gq(),mW=xw(),gW=vq(),yW=bq(),vW=_q(),bW=Cq(),SW=Tw(),wW=Iq(),_W=Pq(),RW=Tq(),CW=Aq(),xW=$q(),EW=Nq(),IW=Dq(),OW=Lq();function qW(t=!1){let e=[RW.default,CW.default,xW.default,EW.default,IW.default,OW.default,bW.default,SW.default,vW.default,wW.default,_W.default];return t?e.push(hW.default,gW.default):e.push(pW.default,mW.default),e.push(yW.default),e}Hw.default=qW});var Uq=H(Bw=>{"use strict";Object.defineProperty(Bw,"__esModule",{value:!0});var jt=je(),kW={message:({schemaCode:t})=>(0,jt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,jt._)`{format: ${t}}`},PW={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:kW,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:l}=t,{opts:f,errSchemaPath:c,schemaEnv:p,self:h}=l;if(!f.validateFormats)return;i?g():v();function g(){let _=r.scopeValue("formats",{ref:h.formats,code:f.code.formats}),w=r.const("fDef",(0,jt._)`${_}[${o}]`),E=r.let("fType"),k=r.let("format");r.if((0,jt._)`typeof ${w} == "object" && !(${w} instanceof RegExp)`,()=>r.assign(E,(0,jt._)`${w}.type || "string"`).assign(k,(0,jt._)`${w}.validate`),()=>r.assign(E,(0,jt._)`"string"`).assign(k,w)),t.fail$data((0,jt.or)(T(),N()));function T(){return f.strictSchema===!1?jt.nil:(0,jt._)`${o} && !${k}`}function N(){let $=p.$async?(0,jt._)`(${w}.async ? await ${k}(${n}) : ${k}(${n}))`:(0,jt._)`${k}(${n})`,j=(0,jt._)`(typeof ${k} == "function" ? ${$} : ${k}.test(${n}))`;return(0,jt._)`${k} && ${k} !== true && ${E} === ${e} && !${j}`}}function v(){let _=h.formats[s];if(!_){T();return}if(_===!0)return;let[w,E,k]=N(_);w===e&&t.pass($());function T(){if(f.strictSchema===!1){h.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${s}" ignored in schema at path "${c}"`}}function N(j){let G=j instanceof RegExp?(0,jt.regexpCode)(j):f.code.formats?(0,jt._)`${f.code.formats}${(0,jt.getProperty)(s)}`:void 0,q=r.scopeValue("formats",{key:s,ref:j,code:G});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,jt._)`${q}.validate`]:["string",j,q]}function $(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!p.$async)throw new Error("async format in sync schema");return(0,jt._)`await ${k}(${n})`}return typeof E=="function"?(0,jt._)`${k}(${n})`:(0,jt._)`${k}.test(${n})`}}}};Bw.default=PW});var Hq=H(Vw=>{"use strict";Object.defineProperty(Vw,"__esModule",{value:!0});var TW=Uq(),AW=[TW.default];Vw.default=AW});var Bq=H(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.contentVocabulary=su.metadataVocabulary=void 0;su.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];su.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Wq=H(Ww=>{"use strict";Object.defineProperty(Ww,"__esModule",{value:!0});var $W=ZO(),NW=dq(),MW=jq(),FW=Hq(),Vq=Bq(),DW=[$W.default,NW.default,(0,MW.default)(),FW.default,Vq.metadataVocabulary,Vq.contentVocabulary];Ww.default=DW});var Jq=H(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.DiscrError=void 0;var zq;(function(t){t.Tag="tag",t.Mapping="mapping"})(zq||(hm.DiscrError=zq={}))});var Yq=H(Jw=>{"use strict";Object.defineProperty(Jw,"__esModule",{value:!0});var ou=je(),zw=Jq(),Gq=Qh(),LW=vf(),jW=Ke(),UW={message:({params:{discrError:t,tagName:e}})=>t===zw.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,ou._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},HW={keyword:"discriminator",type:"object",schemaType:"object",error:UW,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:o}=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(!o)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),c=e.const("tag",(0,ou._)`${r}${(0,ou.getProperty)(l)}`);e.if((0,ou._)`typeof ${c} == "string"`,()=>p(),()=>t.error(!1,{discrError:zw.DiscrError.Tag,tag:c,tagName:l})),t.ok(f);function p(){let v=g();e.if(!1);for(let _ in v)e.elseIf((0,ou._)`${c} === ${_}`),e.assign(f,h(v[_]));e.else(),t.error(!1,{discrError:zw.DiscrError.Mapping,tag:c,tagName:l}),e.endIf()}function h(v){let _=e.name("valid"),w=t.subschema({keyword:"oneOf",schemaProp:v},_);return t.mergeEvaluated(w,ou.Name),_}function g(){var v;let _={},w=k(i),E=!0;for(let $=0;$<o.length;$++){let j=o[$];if(j?.$ref&&!(0,jW.schemaHasRulesButRef)(j,s.self.RULES)){let q=j.$ref;if(j=Gq.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,q),j instanceof Gq.SchemaEnv&&(j=j.schema),j===void 0)throw new LW.default(s.opts.uriResolver,s.baseId,q)}let G=(v=j?.properties)===null||v===void 0?void 0:v[l];if(typeof G!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);E=E&&(w||k(j)),T(G,$)}if(!E)throw new Error(`discriminator: "${l}" must be required`);return _;function k({required:$}){return Array.isArray($)&&$.includes(l)}function T($,j){if($.const)N($.const,j);else if($.enum)for(let G of $.enum)N(G,j);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function N($,j){if(typeof $!="string"||$ in _)throw new Error(`discriminator: "${l}" values must be unique strings`);_[$]=j}}}};Jw.default=HW});var Kq=H((_Z,BW)=>{BW.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 Zq=H((It,Gw)=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.MissingRefError=It.ValidationError=It.CodeGen=It.Name=It.nil=It.stringify=It.str=It._=It.KeywordCxt=It.Ajv=void 0;var VW=zO(),WW=Wq(),zW=Yq(),Qq=Kq(),JW=["/properties"],mm="http://json-schema.org/draft-07/schema",au=class extends VW.default{_addVocabularies(){super._addVocabularies(),WW.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(zW.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Qq,JW):Qq;this.addMetaSchema(e,mm,!1),this.refs["http://json-schema.org/schema"]=mm}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(mm)?mm:void 0)}};It.Ajv=au;Gw.exports=It=au;Gw.exports.Ajv=au;Object.defineProperty(It,"__esModule",{value:!0});It.default=au;var GW=yf();Object.defineProperty(It,"KeywordCxt",{enumerable:!0,get:function(){return GW.KeywordCxt}});var lu=je();Object.defineProperty(It,"_",{enumerable:!0,get:function(){return lu._}});Object.defineProperty(It,"str",{enumerable:!0,get:function(){return lu.str}});Object.defineProperty(It,"stringify",{enumerable:!0,get:function(){return lu.stringify}});Object.defineProperty(It,"nil",{enumerable:!0,get:function(){return lu.nil}});Object.defineProperty(It,"Name",{enumerable:!0,get:function(){return lu.Name}});Object.defineProperty(It,"CodeGen",{enumerable:!0,get:function(){return lu.CodeGen}});var YW=Yh();Object.defineProperty(It,"ValidationError",{enumerable:!0,get:function(){return YW.default}});var KW=vf();Object.defineProperty(It,"MissingRefError",{enumerable:!0,get:function(){return KW.default}})});import*as QW from"crypto";import*as Ra from"fs";import{createRequire as ZW}from"module";import*as ri from"path";function ym(){return{format:(t,e)=>{let r=t?new Date(t):new Date;return e==="YYYY-MM-DD"?r.toISOString().split("T")[0]:r.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let t=new Date;return{format:()=>t.toISOString(),toISOString:()=>t.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function Xq(){return{get:(t,e,r)=>{let n=e.split("."),i=t;for(let s of n)if(i=i?.[s],i===void 0)return r;return i},set:(t,e,r)=>{let n=e.split("."),i=t;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]]=r,t},cloneDeep:t=>JSON.parse(JSON.stringify(t)),keys:t=>Object.keys(t??{}),values:t=>Object.values(t??{}),entries:t=>Object.entries(t??{}),each(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},forEach(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},map:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).map(r=>e(r)),filter:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).filter(r=>e(r)),find:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).find(r=>e(r)),reduce:(t,e,r)=>(Array.isArray(t)?t:Object.values(t??{})).reduce((n,i)=>e(n,i),r),includes:(t,e)=>Array.isArray(t)?t.includes(e):Object.values(t??{}).includes(e),isObject:t=>t!==null&&typeof t=="object"&&!Array.isArray(t),isArray:t=>Array.isArray(t),isString:t=>typeof t=="string",isNumber:t=>typeof t=="number",isFunction:t=>typeof t=="function",isNil:t=>t==null,isEmpty:t=>t==null?!0:Array.isArray(t)||typeof t=="string"?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1,assign:(t,...e)=>Object.assign(t,...e),merge:(t,...e)=>{let r={...t};for(let n of e)for(let[i,s]of Object.entries(n??{}))r[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...r[i]??{},...s}:s;return r},omit:(t,e)=>{let r={...t};for(let n of e)delete r[n];return r},pick:(t,e)=>{let r={};for(let n of e)n in(t??{})&&(r[n]=t[n]);return r}}}function Yw(t,e){return new gm(t,e)}var gm,Kw=se(()=>{"use strict";nS();gm=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Vl}),crypto:()=>QW,path:()=>ri,querystring:()=>ft("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>yI(),Xq),moment:()=>this.loadOptionalModule("moment",()=>vI(),ym),tv4:()=>this.loadOptionalModule("tv4",()=>SI()),ajv:()=>this.loadOptionalModule("ajv",()=>Zq()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>ft("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=[],r={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...r,outputChannel:r.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e){let i=ri.resolve(n);if(this.initializeModules(i)){this.modulesPath=i;break}}}loadOptionalModule(e,r,n){try{return r()}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,r){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": {
@@ -47,10 +47,10 @@ ${i}
47
47
 
48
48
  // --- Next Script ---
49
49
 
50
- `)}function Af(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function uu(t){return t.map(e=>{let r=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}] ${r}`})}function nz(t){return{log:(...e)=>t.push({level:"log",args:e}),info:(...e)=>t.push({level:"info",args:e}),warn:(...e)=>t.push({level:"warn",args:e}),error:(...e)=>t.push({level:"error",args:e})}}function Zw(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let o=s.then(()=>{t.push({name:n,passed:!0})},l=>{t.push({name:n,passed:!1,message:l.message||String(l)})});e.push(o)}else t.push({name:n,passed:!0})}catch(s){t.push({name:n,passed:!1,message:s.message})}};return r.skip=(n,i)=>{t.push({name:n,passed:!0,skipped:!0})},r.fail=n=>{t.push({name:n||"Failed test",passed:!1,message:n||"pm.test.fail()"})},r.index=()=>t.length,r._pendingTests=e,r}function Xw(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function wm(t,e,r){let n;if(r)try{n=new URL(r).hostname}catch{n=void 0}let i=ht.parseCookieHeaders(t||{},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 $f=se(()=>{"use strict";ia()});import*as e0 from"vm";function iz(t){let e=null;try{e=new URL(t)}catch{}return{toString(){return t},valueOf(){return t},[Symbol.toPrimitive](n){return n==="number"?NaN:t},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:t},getPathWithQuery(){return e?e.pathname+e.search:t},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}`:t},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 Nf,t0=se(()=>{"use strict";tk();bm();$f();Nf=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=ek(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,r={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,r,this.timerRegistry.timers)}createSharedContext(){let e=this.initialContext,r=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 c of l)f[c.name]=c.value;return f},jar:()=>{let l=e.cookieJar;return{getAll(f,c){try{if(!l){c(null,[]);return}let p=l.getAll(f).map(h=>({name:h.name,value:h.value,domain:h.domain,path:h.path,httpOnly:h.httpOnly,secure:h.secure}));c(null,p)}catch(p){c(p,[])}},get(f,c,p){try{if(!l){p(null,void 0);return}let h=l.get(c,f);p(null,h?{name:h.name,value:h.value,domain:h.domain}:void 0)}catch(h){p(h,void 0)}},set(f,c,p,h){try{if(!l){(h||p)?.(null);return}typeof c=="string"&&typeof p=="string"?(l.set({name:c,value:p,domain:f}),h?.(null)):typeof c=="object"&&(l.set({...c,domain:f}),p?.(null))}catch(g){(h||p)?.(g)}},unset(f,c,p){try{if(!l){p?.(null);return}l.delete(c,f),p?.(null)}catch(h){p?.(h)}},clear(f){try{if(!l){f?.(null);return}l.clear(),f?.(null)}catch(c){f?.(c)}}}},remove:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},unset:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},o=this;return{request:this.createRequestObject(r,e),response:null,test:Zw(this.assertions),expect:Tf,cookies:s,execution:{setNextRequest(l){o._nextRequest=l},skipRequest(){o._skipRequest=!0},runRequest(l,f){let p=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let h=typeof l=="string"?{url:l,method:"GET"}:l,g=await n.sendRequest(h),v=Array.isArray(g?.cookies)?g.cookies.filter(E=>E?.name):[],_=g?.body,w=0;if(typeof _=="string")w=Buffer.byteLength(_,"utf8");else if(Buffer.isBuffer(_))w=_.length;else if(_!=null)try{w=Buffer.byteLength(JSON.stringify(_),"utf8")}catch{}return vm({executedRequest:null,status:g?.status??0,statusText:g?.statusText??"",headers:g?.headers??{},body:_,cookies:v,responseTime:g?.time,responseSize:w})})();if(typeof f=="function"){p.then(h=>f(null,h),h=>f(h));return}return p},location:{current:n.info?.requestName||"",currentRequestName:n.info?.requestName||"",eventName:"prerequest",toString(){return n.info?.requestName||""}}},setNextRequest(l){o._nextRequest=l},visualizer:{set(l,f){o._visualizerData={template:l,data:f}},clear(){o._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,r){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,c]of Object.entries(e.headers))if(f.toLowerCase()===l.toLowerCase())return c},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,c]of Object.entries(e.headers))typeof c=="string"&&(l[f]=c);return l},each:l=>{for(let[f,c]of Object.entries(e.headers))typeof c=="string"&&l({key:f,value:c})}},o={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 iz(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 o},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 r.request?.auth||null},set auth(l){r.request&&(r.request.auth=l)},get certificate(){return r.request?.certificate||null},set certificate(l){r.request&&(r.request.certificate=l)},get description(){return r.request?.description||null},set description(l){r.request&&(r.request.description=l)},get name(){return r.request?.name||null},set name(l){r.request&&(r.request.name=l)},get id(){return r.request?.id||null},get disabled(){return r.request?.disabled||!1},set disabled(l){r.request&&(r.request.disabled=l)},get messages(){return r.request?.messages||[]},get methodPath(){return r.request?.methodPath||null},get metadata(){return r.request?.metadata||[]},getHeaders(l){let f={};for(let[c,p]of Object.entries(e.headers))typeof p=="string"&&(f[c]=p);return f},addQueryParams(l){if(typeof l=="string"){let f=new URLSearchParams(l);for(let[c,p]of f)e.query||(e.query={}),e.query[c]=p}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 c=typeof f=="string"?f:f.key;c&&delete e.query[c]}))},authorizeUsing(l,f){r.request&&(typeof l=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=l,f&&(r.request.auth.parameters=f)):typeof l=="object"&&(r.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:r.request?.auth,certificate:r.request?.certificate,description:r.request?.description,name:r.request?.name,id:r.request?.id,disabled:r.request?.disabled,metadata:r.request?.metadata,messages:r.request?.messages,methodPath:r.request?.methodPath}},describe(l,f){r.request&&(r.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,c){e.body={type:f||e.body?.type||"raw",format:c||e.body?.format,content:l}}}}injectLegacyGlobals(e,r){let n=this.vmContext;if(!n)return;let i=this.initialContext,s=e==="test"&&r?.executedRequest?r.executedRequest:this.modifiedRequest,o={};for(let[v,_]of Object.entries(s?.headers||{}))typeof _=="string"&&(o[v]=_);let l=s?.body,f=l==null?null:typeof l=="object"&&"content"in l?l.content:l,c=i.request;if(n.request={id:c?.id??"",name:c?.name??"",description:c?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:o,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"||!r)return;let p=r.body;n.responseBody=p==null?"":typeof p=="string"?p:JSON.stringify(p);let h=r.statusText||"";n.responseCode={code:r.status,name:h,detail:h},n.responseHeaders={...r.headers||{}},n.responseTime=r.responseTime??0,n.responseCookies=(r.cookies||[]).map(v=>({...v}));let g=this;n.tests=new Proxy({},{set(v,_,w){return g.assertions.push({name:String(_),passed:!!w,message:w?void 0:`"${String(_)}" was false`}),!0}})}async executePreRequest(e){let r=Sm(e,this.deps.isolateScripts);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0,this.injectLegacyGlobals("prerequest");let n=this.ctx.variables.replaceIn(r),i=this.deps.scriptTimeoutMs??5e3,s=e0.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=uu(this.consoleMessages),f=this.initialContext.request.body,c=!this.bodiesEqual(this.modifiedRequest.body,f);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:Af(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:c?this.modifiedRequest.body:void 0,params:Af(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:Af(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=[...uu(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,r){let n=Sm(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=vm(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.injectLegacyGlobals("test",r);let i=this.ctx.variables.replaceIn(n),s=this.deps.scriptTimeoutMs??5e3,o=e0.runInContext(i,this.vmContext,{timeout:s});this.deps.isolateScripts&&o&&typeof o.then=="function"&&await o,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=uu(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=[...uu(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,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.timerRegistry.clearAll(),this.vmContext=null,this.ctx=null,this.assertions=[]}}});import*as ar from"crypto";import*as sz from"querystring";import*as nk from"vm";function ik(t,e){if(t)return t.split(",").map(r=>{let n=r.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],o=Number(s);return!isNaN(o)&&s!==""?o:s}return n})}function sk(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function oz(t,e){if(t==="@")return"";if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=t.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(r){let n=ik(r[2],e),i=ns(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return sk(e[t]);if(aa(t)){let n=oa(t,e),i=la(t,n);if(i!==void 0)return i}}function rk(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],o=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)o=ar.createHash("md5").update(Buffer.concat([o,i])).digest(),s.push(o);let l=Buffer.concat(s);return{key:l.subarray(0,e),iv:l.subarray(e,e+r)}}function r0(t,e,r){let n=i=>t==="aes"?`aes-${i*8}-cbc`:t==="des"?"des-cbc":t==="des-ede3"?"des-ede3-cbc":t;return{encrypt(i,s,o){let l=i instanceof Ve?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=ar.randomBytes(8),{key:c,iv:p}=rk(s,e,r,f),h=ar.createCipheriv(n(e),c,p),g=Buffer.concat([h.update(l),h.final()]),v=Buffer.concat([Buffer.from("Salted__"),f,g]);return{ciphertext:new Ve(g),salt:new Ve(f),toString:_=>_?_.stringify(new Ve(v)):v.toString("base64")}}else{let f=s.toBuffer(),c=o?.iv&&o.iv instanceof Ve?o.iv.toBuffer():Buffer.alloc(r),p=ar.createCipheriv(n(f.length),f,c);o?.padding===!1&&p.setAutoPadding(!1);let h=Buffer.concat([p.update(l),p.final()]);return{ciphertext:new Ve(h),toString:g=>g?g.stringify(new Ve(h)):h.toString("base64")}}},decrypt(i,s,o){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,c;l.subarray(0,8).toString()==="Salted__"?(c=l.subarray(8,16),f=l.subarray(16)):(c=Buffer.alloc(0),f=l);let{key:p,iv:h}=rk(s,e,r,c),g=ar.createDecipheriv(n(e),p,h);return new Ve(Buffer.concat([g.update(f),g.final()]))}else{let l=s.toBuffer(),f=o?.iv&&o.iv instanceof Ve?o.iv.toBuffer():Buffer.alloc(r),c=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),p=ar.createDecipheriv(n(l.length),l,f);return o?.padding===!1&&p.setAutoPadding(!1),new Ve(Buffer.concat([p.update(c),p.final()]))}}}}function az(){let t=r=>n=>{let i=n instanceof Ve?n.toBuffer():Buffer.from(String(n),"utf8");return new Ve(ar.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Ve?n.toBuffer():Buffer.from(String(n),"utf8"),o=i instanceof Ve?i.toBuffer():Buffer.from(String(i),"utf8");return new Ve(ar.createHmac(r,o).update(s).digest())};return{MD5:t("md5"),SHA1:t("sha1"),SHA224:t("sha224"),SHA256:t("sha256"),SHA384:t("sha384"),SHA512:t("sha512"),SHA3:t("sha3-256"),RIPEMD160:t("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:r0("aes",32,16),DES:r0("des",8,8),TripleDES:r0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Ve?r.toBuffer():Buffer.from(String(r),"utf8"),o=n instanceof Ve?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,f=i?.iterations||1;return new Ve(ar.pbkdf2Sync(s,o,f,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Ve.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Ve.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Ve.fromHex(r)},Latin1:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Ve(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Ve(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Ve(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Ve(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Ve(r):new Ve(Buffer.from(String(r))):new Ve(Buffer.alloc(0)),random:r=>new Ve(ar.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var Ve,cs,Mf=se(()=>{"use strict";kh();Th();$h();Kw();t0();bm();Ve=class t{_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 t(Buffer.from(e,"hex"))}static fromBase64(e){return new t(Buffer.from(e,"base64"))}static fromUtf8(e){return new t(Buffer.from(e,"utf8"))}};cs=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=Yw(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new Nf({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this),isolateScripts:this.scopeMode==="isolated",scriptTimeoutMs:this.scriptTimeoutMs},e)}createVM(e,r,n){let i=this.moduleLoader.getGlobalSetupExports(),s=this.moduleLoader.createRequireFunction();e.require=s,e.vault=this.createVault();let o={ctx:e,hf:e,pm:e,console:r,...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:ar,_:s("lodash"),require:s,moment:ym(),querystring:sz,CryptoJS:az(),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 c of f)if(c?.name&&c.name.toLowerCase()===l.toLowerCase())return{...c}}return null}},jsonStringify:(l,f,c)=>JSON.stringify(l,f,c),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let f=this.moduleLoader.createRequireFunction()("xml2js"),c;return f.parseString(l,{explicitArray:!1},(p,h)=>{if(p)throw p;c=h}),c}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return nk.createContext(o)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},o={...e.environmentVariables||{}},l=e.iterationData||{},f=this.createMergedVariableScope(n,o,i,s,l),c=this.createGlobalsScope(s,e.onGlobalsChange),p=this.createVariableScope(i),h=this.createEnvironmentScope(o,e.environmentName,e.onEnvironmentChange,!0),g={...h,set:(_,w)=>{let E=this.serializeValue(w);h.set(_,E),n[_]=E},unset(_){h.unset(_),delete n[_]},clear(){let _=Object.keys(o);h.clear();for(let w of _)delete n[w]}};return c.replaceIn=f.replaceIn,p.replaceIn=f.replaceIn,g.replaceIn=f.replaceIn,{globals:c,collectionVariables:p,variables:f,environment:g,iterationData:{get:_=>l[_],has:_=>_ in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:Tf,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.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:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createGlobalsScope(e,r){let n=(i,s,o)=>{r&&r(i,s,o)};return{get:i=>this.deserializeValue(e[i]),set:(i,s)=>{let o=this.serializeValue(s);e[i]=o,n("set",i,o)},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,r,n,i,s={}){let o={get:l=>l in e?this.deserializeValue(e[l]):l in s?s[l]:l in r?this.deserializeValue(r[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 r||l in r||l in n||l in i},unset(l){delete e[l]},clear(){Object.keys(e).forEach(l=>delete e[l])},toObject(){return{...i,...n,...r,...s,...e}},toLocalObject(){return{...n,...r,...s,...e}},replaceIn(l){if(!l||typeof l!="string")return l;let f=o.toObject(),c=20,p=g=>g.replace(/\{\{([^}]+)\}\}/g,(v,_)=>{let w=_.trim(),E=w.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(E)try{let N=ik(E[2],f),$=ns(E[1],N);return $!==null?String($):v}catch{return v}let k=Yc(w);if(k){let N=oz(k.input,f);if(N!==void 0){let $=Kc(N,k.filters,f);return $!==void 0?String($):v}return v}let T=o.get(w);if(T!==void 0)return String(T);if(aa(w)){let N={};for(let[G,O]of Object.entries(f))N[G]=sk(O);let $=oa(w,N),j=la(w,$);if(j!==void 0)return String(j)}return v}),h=l;for(let g=0;g<c;g++){let v=p(h);if(v===h)break;h=v}return h}};return o}createEnvironmentScope(e,r,n,i){let s=(o,l,f)=>{n&&(i?n(o,l,f):n(l||"",o==="set"?f:void 0))};return{name:r||"",get:o=>this.deserializeValue(e[o]),set:(o,l)=>{let f=this.serializeValue(l);e[o]=f,s("set",o,f)},has(o){return o in e},unset(o){delete e[o],s("unset",o)},clear(){Object.keys(e).forEach(o=>delete e[o]),s("clear")},toObject(){return{...e}}}}createVault(){let e=this.secretRegistry,r=()=>{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:r,unset:r}}createSendRequest(){return this.httpService?(e,r)=>{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(r){i.then(s=>r(null,s)).catch(s=>r(s,null));return}return i}:(e,r)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(r){r(n,null);return}return Promise.reject(n)}}}});var n0,Ca,_m=se(()=>{"use strict";n0={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"},Ca=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 r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}encodeBody(e){if(!e||e.type==="none")return null;let{type:r,content:n}=e;switch(r){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 r=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&r.append(n.key,n.value||"");return r.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 r=e.variables;if(typeof r=="string")try{r=r.trim()?JSON.parse(r):void 0}catch{r=void 0}return JSON.stringify({query:e.query,...r!=null?{variables:r}:{},...e.operationName?{operationName:e.operationName}:{}})}return JSON.stringify(e)}setContentTypeHeader(e,r,n){if(Object.keys(e).some(o=>o.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!r||r.type==="none")return;let s;switch(r.type){case"x-www-form-urlencoded":s=n0["x-www-form-urlencoded"];break;case"raw":s=r.format?n0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=n0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var Ea,Rm=se(()=>{"use strict";Ea=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let o=this.parseCsvLine(r[s]),l={};n.forEach((f,c)=>{l[f]=o[c]||""}),i.push(l)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let o=e[s],l=e[s+1];o==='"'?i&&l==='"'?(n+='"',s++):i=!i:o===","&&!i?(r.push(n.trim()),n=""):n+=o}return r.push(n.trim()),r}}});import*as du from"crypto";var uz,jf,s0=se(()=>{"use strict";uz=3e4,jf=class{constructor(e,r,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=r;this.envConfigService=n;this.httpService=i;this.callbackPath=s}secretStore;browserService;envConfigService;httpService;callbackPath;tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,r){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,r),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,r)}catch{this.tokenCache.delete(n)}if(!i){let o=await this.secretStore.get(`oauth2_refresh_${n}`);if(o)try{return await this.refreshToken(e,o,r)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,r,"client_credentials");break;case"password":s=await this.fetchToken(e,r,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,r);break;case"implicit":s=await this.implicitFlow(e,r);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,r,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),o=this.resolve(e.clientSecret||"",n),l=new URLSearchParams;l.append("grant_type","refresh_token"),l.append("refresh_token",r);let f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,l,s,o,n);let c=await this.httpService.execute({method:"POST",url:i,headers:f,body:l.toString()}),p=this.parseTokenResponse(c.body,e);p.refreshToken||(p.refreshToken=r);let h=this.buildCacheKeyString(e);return this.tokenCache.set(h,p),p.refreshToken&&await this.storeRefreshToken(h,p.refreshToken),p}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),o=this.resolve(e.clientSecret||"",r),l=e.scope?this.resolve(e.scope,r):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,c,p,h;if(f){c=this.generateCodeVerifier();let G=e.pkceMethod||"S256";p=G==="S256"?this.generateCodeChallengeS256(c):c,h=G}let g=e.state||du.randomBytes(16).toString("hex"),v=await this.getCallbackUri(),_=new URL(n);if(_.searchParams.set("response_type","code"),_.searchParams.set("client_id",s),_.searchParams.set("redirect_uri",v),l&&_.searchParams.set("scope",l),_.searchParams.set("state",g),p&&(_.searchParams.set("code_challenge",p),_.searchParams.set("code_challenge_method",h)),e.audience&&_.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&_.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[G,O]of Object.entries(e.extraParams))_.searchParams.set(G,this.resolve(O,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let w=new Promise((G,O)=>{this.pendingAuthCallback={resolve:G,reject:O,state:g}});await this.browserService.openExternal(_.toString());let E;try{E=await Promise.race([w,new Promise((G,O)=>setTimeout(()=>{this.pendingAuthCallback=null,O(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(E.state&&E.state!==g)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let k=new URLSearchParams;k.append("grant_type","authorization_code"),k.append("code",E.code),k.append("redirect_uri",v),c&&k.append("code_verifier",c);let T={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,T,k,s,o,r);let N=await this.httpService.execute({method:"POST",url:i,headers:T,body:k.toString()}),$=this.parseTokenResponse(N.body,e),j=this.buildCacheKeyString(e);return this.tokenCache.set(j,$),$.refreshToken&&await this.storeRefreshToken(j,$.refreshToken),$}async implicitFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.clientId||"",r),s=e.scope?this.resolve(e.scope,r):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 o=e.state||du.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",o),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[v,_]of Object.entries(e.extraParams))f.searchParams.set(v,this.resolve(_,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let c=new Promise((v,_)=>{this.pendingImplicitCallback={resolve:v,reject:_,state:o}});await this.browserService.openExternal(f.toString());let p;try{p=await Promise.race([c,new Promise((v,_)=>setTimeout(()=>{this.pendingImplicitCallback=null,_(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(p.state&&p.state!==o)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let h={accessToken:p.accessToken,tokenType:p.tokenType||e.tokenPrefix||"Bearer",expiresAt:p.expiresIn?Date.now()+p.expiresIn*1e3:void 0,raw:{access_token:p.accessToken,token_type:p.tokenType,expires_in:p.expiresIn}},g=this.buildCacheKeyString(e);return this.tokenCache.set(g,h),h}handleAuthorizationCallback(e,r,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:r}),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,r,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:r,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let r=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(r),this.secretStore.delete(`oauth2_refresh_${r}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,r,n){let i=this.resolve(e.tokenUrl||"",r);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",r),o=this.resolve(e.clientSecret||"",r),l=e.scope?this.resolve(e.scope,r):void 0,f=new URLSearchParams;if(f.append("grant_type",n),l&&f.append("scope",l),n==="password"){let h=this.resolve(e.username||"",r),g=this.resolve(e.password||"",r);if(!h)throw new Error("OAuth2 password grant requires username");f.append("username",h),f.append("password",g)}if(e.audience&&f.append("audience",this.resolve(e.audience,r)),e.resource&&f.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[h,g]of Object.entries(e.extraParams))f.append(h,this.resolve(g,r));let c={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,c,f,s,o,r);let p=await this.httpService.execute({method:"POST",url:i,headers:c,body:f.toString()});return this.parseTokenResponse(p.body,e)}applyClientAuth(e,r,n,i,s,o){if(e.clientAuthentication==="header"){let l=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${l}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){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=r.tokenField||"access_token",o=i[s];if(!o)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:o,tokenType:i.token_type||r.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-uz:!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,r){return this.envConfigService.resolveVariables(e,r)}generateCodeVerifier(){return du.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return du.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});import*as Ia from"fs";import*as ro from"path";function pu(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&Ia.writeFileSync(t,r.join(`
50
+ `)}function Af(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function uu(t){return t.map(e=>{let r=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}] ${r}`})}function nz(t){return{log:(...e)=>t.push({level:"log",args:e}),info:(...e)=>t.push({level:"info",args:e}),warn:(...e)=>t.push({level:"warn",args:e}),error:(...e)=>t.push({level:"error",args:e})}}function Zw(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let o=s.then(()=>{t.push({name:n,passed:!0})},l=>{t.push({name:n,passed:!1,message:l.message||String(l)})});e.push(o)}else t.push({name:n,passed:!0})}catch(s){t.push({name:n,passed:!1,message:s.message})}};return r.skip=(n,i)=>{t.push({name:n,passed:!0,skipped:!0})},r.fail=n=>{t.push({name:n||"Failed test",passed:!1,message:n||"pm.test.fail()"})},r.index=()=>t.length,r._pendingTests=e,r}function Xw(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function wm(t,e,r){let n;if(r)try{n=new URL(r).hostname}catch{n=void 0}let i=ht.parseCookieHeaders(t||{},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 $f=se(()=>{"use strict";ia()});import*as e0 from"vm";function iz(t){let e=null;try{e=new URL(t)}catch{}return{toString(){return t},valueOf(){return t},[Symbol.toPrimitive](n){return n==="number"?NaN:t},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:t},getPathWithQuery(){return e?e.pathname+e.search:t},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}`:t},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 Nf,t0=se(()=>{"use strict";tk();bm();$f();Nf=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=ek(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,r={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,r,this.timerRegistry.timers)}createSharedContext(){let e=this.initialContext,r=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 c of l)f[c.name]=c.value;return f},jar:()=>{let l=e.cookieJar;return{getAll(f,c){try{if(!l){c(null,[]);return}let p=l.getAll(f).map(h=>({name:h.name,value:h.value,domain:h.domain,path:h.path,httpOnly:h.httpOnly,secure:h.secure}));c(null,p)}catch(p){c(p,[])}},get(f,c,p){try{if(!l){p(null,void 0);return}let h=l.get(c,f);p(null,h?{name:h.name,value:h.value,domain:h.domain}:void 0)}catch(h){p(h,void 0)}},set(f,c,p,h){try{if(!l){(h||p)?.(null);return}typeof c=="string"&&typeof p=="string"?(l.set({name:c,value:p,domain:f}),h?.(null)):typeof c=="object"&&(l.set({...c,domain:f}),p?.(null))}catch(g){(h||p)?.(g)}},unset(f,c,p){try{if(!l){p?.(null);return}l.delete(c,f),p?.(null)}catch(h){p?.(h)}},clear(f){try{if(!l){f?.(null);return}l.clear(),f?.(null)}catch(c){f?.(c)}}}},remove:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},unset:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},o=this;return{request:this.createRequestObject(r,e),response:null,test:Zw(this.assertions),expect:Tf,cookies:s,execution:{setNextRequest(l){o._nextRequest=l},skipRequest(){o._skipRequest=!0},runRequest(l,f){let p=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let h=typeof l=="string"?{url:l,method:"GET"}:l,g=await n.sendRequest(h),v=Array.isArray(g?.cookies)?g.cookies.filter(E=>E?.name):[],_=g?.body,w=0;if(typeof _=="string")w=Buffer.byteLength(_,"utf8");else if(Buffer.isBuffer(_))w=_.length;else if(_!=null)try{w=Buffer.byteLength(JSON.stringify(_),"utf8")}catch{}return vm({executedRequest:null,status:g?.status??0,statusText:g?.statusText??"",headers:g?.headers??{},body:_,cookies:v,responseTime:g?.time,responseSize:w})})();if(typeof f=="function"){p.then(h=>f(null,h),h=>f(h));return}return p},location:{current:n.info?.requestName||"",currentRequestName:n.info?.requestName||"",eventName:"prerequest",toString(){return n.info?.requestName||""}}},setNextRequest(l){o._nextRequest=l},visualizer:{set(l,f){o._visualizerData={template:l,data:f}},clear(){o._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,r){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,c]of Object.entries(e.headers))if(f.toLowerCase()===l.toLowerCase())return c},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,c]of Object.entries(e.headers))typeof c=="string"&&(l[f]=c);return l},each:l=>{for(let[f,c]of Object.entries(e.headers))typeof c=="string"&&l({key:f,value:c})}},o={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 iz(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 o},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 r.request?.auth||null},set auth(l){r.request&&(r.request.auth=l)},get certificate(){return r.request?.certificate||null},set certificate(l){r.request&&(r.request.certificate=l)},get description(){return r.request?.description||null},set description(l){r.request&&(r.request.description=l)},get name(){return r.request?.name||null},set name(l){r.request&&(r.request.name=l)},get id(){return r.request?.id||null},get disabled(){return r.request?.disabled||!1},set disabled(l){r.request&&(r.request.disabled=l)},get messages(){return r.request?.messages||[]},get methodPath(){return r.request?.methodPath||null},get metadata(){return r.request?.metadata||[]},getHeaders(l){let f={};for(let[c,p]of Object.entries(e.headers))typeof p=="string"&&(f[c]=p);return f},addQueryParams(l){if(typeof l=="string"){let f=new URLSearchParams(l);for(let[c,p]of f)e.query||(e.query={}),e.query[c]=p}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 c=typeof f=="string"?f:f.key;c&&delete e.query[c]}))},authorizeUsing(l,f){r.request&&(typeof l=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=l,f&&(r.request.auth.parameters=f)):typeof l=="object"&&(r.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:r.request?.auth,certificate:r.request?.certificate,description:r.request?.description,name:r.request?.name,id:r.request?.id,disabled:r.request?.disabled,metadata:r.request?.metadata,messages:r.request?.messages,methodPath:r.request?.methodPath}},describe(l,f){r.request&&(r.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,c){e.body={type:f||e.body?.type||"raw",format:c||e.body?.format,content:l}}}}injectLegacyGlobals(e,r){let n=this.vmContext;if(!n)return;let i=this.initialContext,s=e==="test"&&r?.executedRequest?r.executedRequest:this.modifiedRequest,o={};for(let[v,_]of Object.entries(s?.headers||{}))typeof _=="string"&&(o[v]=_);let l=s?.body,f=l==null?null:typeof l=="object"&&"content"in l?l.content:l,c=i.request;if(n.request={id:c?.id??"",name:c?.name??"",description:c?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:o,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"||!r)return;let p=r.body;n.responseBody=p==null?"":typeof p=="string"?p:JSON.stringify(p);let h=r.statusText||"";n.responseCode={code:r.status,name:h,detail:h},n.responseHeaders={...r.headers||{}},n.responseTime=r.responseTime??0,n.responseCookies=(r.cookies||[]).map(v=>({...v}));let g=this;n.tests=new Proxy({},{set(v,_,w){return g.assertions.push({name:String(_),passed:!!w,message:w?void 0:`"${String(_)}" was false`}),!0}})}async executePreRequest(e){let r=Sm(e,this.deps.isolateScripts);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0,this.injectLegacyGlobals("prerequest");let n=this.ctx.variables.replaceIn(r),i=this.deps.scriptTimeoutMs??5e3,s=e0.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=uu(this.consoleMessages),f=this.initialContext.request.body,c=!this.bodiesEqual(this.modifiedRequest.body,f);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:Af(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:c?this.modifiedRequest.body:void 0,params:Af(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:Af(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=[...uu(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,r){let n=Sm(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=vm(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.injectLegacyGlobals("test",r);let i=this.ctx.variables.replaceIn(n),s=this.deps.scriptTimeoutMs??5e3,o=e0.runInContext(i,this.vmContext,{timeout:s});this.deps.isolateScripts&&o&&typeof o.then=="function"&&await o,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=uu(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=[...uu(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,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.timerRegistry.clearAll(),this.vmContext=null,this.ctx=null,this.assertions=[]}}});import*as ar from"crypto";import*as sz from"querystring";import*as nk from"vm";function ik(t,e){if(t)return t.split(",").map(r=>{let n=r.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],o=Number(s);return!isNaN(o)&&s!==""?o:s}return n})}function sk(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function oz(t,e){if(t==="@")return"";if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=t.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(r){let n=ik(r[2],e),i=ns(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return sk(e[t]);if(aa(t)){let n=oa(t,e),i=la(t,n);if(i!==void 0)return i}}function rk(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],o=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)o=ar.createHash("md5").update(Buffer.concat([o,i])).digest(),s.push(o);let l=Buffer.concat(s);return{key:l.subarray(0,e),iv:l.subarray(e,e+r)}}function r0(t,e,r){let n=i=>t==="aes"?`aes-${i*8}-cbc`:t==="des"?"des-cbc":t==="des-ede3"?"des-ede3-cbc":t;return{encrypt(i,s,o){let l=i instanceof Ve?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=ar.randomBytes(8),{key:c,iv:p}=rk(s,e,r,f),h=ar.createCipheriv(n(e),c,p),g=Buffer.concat([h.update(l),h.final()]),v=Buffer.concat([Buffer.from("Salted__"),f,g]);return{ciphertext:new Ve(g),salt:new Ve(f),toString:_=>_?_.stringify(new Ve(v)):v.toString("base64")}}else{let f=s.toBuffer(),c=o?.iv&&o.iv instanceof Ve?o.iv.toBuffer():Buffer.alloc(r),p=ar.createCipheriv(n(f.length),f,c);o?.padding===!1&&p.setAutoPadding(!1);let h=Buffer.concat([p.update(l),p.final()]);return{ciphertext:new Ve(h),toString:g=>g?g.stringify(new Ve(h)):h.toString("base64")}}},decrypt(i,s,o){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,c;l.subarray(0,8).toString()==="Salted__"?(c=l.subarray(8,16),f=l.subarray(16)):(c=Buffer.alloc(0),f=l);let{key:p,iv:h}=rk(s,e,r,c),g=ar.createDecipheriv(n(e),p,h);return new Ve(Buffer.concat([g.update(f),g.final()]))}else{let l=s.toBuffer(),f=o?.iv&&o.iv instanceof Ve?o.iv.toBuffer():Buffer.alloc(r),c=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),p=ar.createDecipheriv(n(l.length),l,f);return o?.padding===!1&&p.setAutoPadding(!1),new Ve(Buffer.concat([p.update(c),p.final()]))}}}}function az(){let t=r=>n=>{let i=n instanceof Ve?n.toBuffer():Buffer.from(String(n),"utf8");return new Ve(ar.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Ve?n.toBuffer():Buffer.from(String(n),"utf8"),o=i instanceof Ve?i.toBuffer():Buffer.from(String(i),"utf8");return new Ve(ar.createHmac(r,o).update(s).digest())};return{MD5:t("md5"),SHA1:t("sha1"),SHA224:t("sha224"),SHA256:t("sha256"),SHA384:t("sha384"),SHA512:t("sha512"),SHA3:t("sha3-256"),RIPEMD160:t("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:r0("aes",32,16),DES:r0("des",8,8),TripleDES:r0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Ve?r.toBuffer():Buffer.from(String(r),"utf8"),o=n instanceof Ve?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,f=i?.iterations||1;return new Ve(ar.pbkdf2Sync(s,o,f,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Ve.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Ve.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Ve.fromHex(r)},Latin1:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Ve(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Ve(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Ve(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Ve(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Ve(r):new Ve(Buffer.from(String(r))):new Ve(Buffer.alloc(0)),random:r=>new Ve(ar.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var Ve,cs,Mf=se(()=>{"use strict";kh();Th();$h();Kw();t0();bm();Ve=class t{_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 t(Buffer.from(e,"hex"))}static fromBase64(e){return new t(Buffer.from(e,"base64"))}static fromUtf8(e){return new t(Buffer.from(e,"utf8"))}};cs=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=Yw(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new Nf({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this),isolateScripts:this.scopeMode==="isolated",scriptTimeoutMs:this.scriptTimeoutMs},e)}createVM(e,r,n){let i=this.moduleLoader.getGlobalSetupExports(),s=this.moduleLoader.createRequireFunction();e.require=s,e.vault=this.createVault();let o={ctx:e,hf:e,pm:e,console:r,...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:ar,_:s("lodash"),require:s,moment:ym(),querystring:sz,CryptoJS:az(),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 c of f)if(c?.name&&c.name.toLowerCase()===l.toLowerCase())return{...c}}return null}},jsonStringify:(l,f,c)=>JSON.stringify(l,f,c),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let f=this.moduleLoader.createRequireFunction()("xml2js"),c;return f.parseString(l,{explicitArray:!1},(p,h)=>{if(p)throw p;c=h}),c}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return nk.createContext(o)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},o={...e.environmentVariables||{}},l=e.iterationData||{},f=this.createMergedVariableScope(n,o,i,s,l),c=this.createGlobalsScope(s,e.onGlobalsChange),p=this.createVariableScope(i),h=this.createEnvironmentScope(o,e.environmentName,e.onEnvironmentChange,!0),g={...h,set:(_,w)=>{let E=this.serializeValue(w);h.set(_,E),n[_]=E},unset(_){h.unset(_),delete n[_]},clear(){let _=Object.keys(o);h.clear();for(let w of _)delete n[w]}};return c.replaceIn=f.replaceIn,p.replaceIn=f.replaceIn,g.replaceIn=f.replaceIn,{globals:c,collectionVariables:p,variables:f,environment:g,iterationData:{get:_=>l[_],has:_=>_ in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:Tf,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.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:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createGlobalsScope(e,r){let n=(i,s,o)=>{r&&r(i,s,o)};return{get:i=>this.deserializeValue(e[i]),set:(i,s)=>{let o=this.serializeValue(s);e[i]=o,n("set",i,o)},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,r,n,i,s={}){let o={get:l=>l in e?this.deserializeValue(e[l]):l in s?s[l]:l in r?this.deserializeValue(r[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 r||l in r||l in n||l in i},unset(l){delete e[l]},clear(){Object.keys(e).forEach(l=>delete e[l])},toObject(){return{...i,...n,...r,...s,...e}},toLocalObject(){return{...n,...r,...s,...e}},replaceIn(l){if(!l||typeof l!="string")return l;let f=o.toObject(),c=20,p=g=>g.replace(/\{\{([^}]+)\}\}/g,(v,_)=>{let w=_.trim(),E=w.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(E)try{let N=ik(E[2],f),$=ns(E[1],N);return $!==null?String($):v}catch{return v}let k=Yc(w);if(k){let N=oz(k.input,f);if(N!==void 0){let $=Kc(N,k.filters,f);return $!==void 0?String($):v}return v}let T=o.get(w);if(T!==void 0)return String(T);if(aa(w)){let N={};for(let[G,q]of Object.entries(f))N[G]=sk(q);let $=oa(w,N),j=la(w,$);if(j!==void 0)return String(j)}return v}),h=l;for(let g=0;g<c;g++){let v=p(h);if(v===h)break;h=v}return h}};return o}createEnvironmentScope(e,r,n,i){let s=(o,l,f)=>{n&&(i?n(o,l,f):n(l||"",o==="set"?f:void 0))};return{name:r||"",get:o=>this.deserializeValue(e[o]),set:(o,l)=>{let f=this.serializeValue(l);e[o]=f,s("set",o,f)},has(o){return o in e},unset(o){delete e[o],s("unset",o)},clear(){Object.keys(e).forEach(o=>delete e[o]),s("clear")},toObject(){return{...e}}}}createVault(){let e=this.secretRegistry,r=()=>{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:r,unset:r}}createSendRequest(){return this.httpService?(e,r)=>{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(r){i.then(s=>r(null,s)).catch(s=>r(s,null));return}return i}:(e,r)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(r){r(n,null);return}return Promise.reject(n)}}}});var n0,Ca,_m=se(()=>{"use strict";n0={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"},Ca=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 r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}encodeBody(e){if(!e||e.type==="none")return null;let{type:r,content:n}=e;switch(r){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 r=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&r.append(n.key,n.value||"");return r.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 r=e.variables;if(typeof r=="string")try{r=r.trim()?JSON.parse(r):void 0}catch{r=void 0}return JSON.stringify({query:e.query,...r!=null?{variables:r}:{},...e.operationName?{operationName:e.operationName}:{}})}return JSON.stringify(e)}setContentTypeHeader(e,r,n){if(Object.keys(e).some(o=>o.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!r||r.type==="none")return;let s;switch(r.type){case"x-www-form-urlencoded":s=n0["x-www-form-urlencoded"];break;case"raw":s=r.format?n0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=n0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var Ea,Rm=se(()=>{"use strict";Ea=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let o=this.parseCsvLine(r[s]),l={};n.forEach((f,c)=>{l[f]=o[c]||""}),i.push(l)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let o=e[s],l=e[s+1];o==='"'?i&&l==='"'?(n+='"',s++):i=!i:o===","&&!i?(r.push(n.trim()),n=""):n+=o}return r.push(n.trim()),r}}});import*as du from"crypto";var uz,jf,s0=se(()=>{"use strict";uz=3e4,jf=class{constructor(e,r,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=r;this.envConfigService=n;this.httpService=i;this.callbackPath=s}secretStore;browserService;envConfigService;httpService;callbackPath;tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,r){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,r),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,r)}catch{this.tokenCache.delete(n)}if(!i){let o=await this.secretStore.get(`oauth2_refresh_${n}`);if(o)try{return await this.refreshToken(e,o,r)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,r,"client_credentials");break;case"password":s=await this.fetchToken(e,r,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,r);break;case"implicit":s=await this.implicitFlow(e,r);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,r,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),o=this.resolve(e.clientSecret||"",n),l=new URLSearchParams;l.append("grant_type","refresh_token"),l.append("refresh_token",r);let f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,l,s,o,n);let c=await this.httpService.execute({method:"POST",url:i,headers:f,body:l.toString()}),p=this.parseTokenResponse(c.body,e);p.refreshToken||(p.refreshToken=r);let h=this.buildCacheKeyString(e);return this.tokenCache.set(h,p),p.refreshToken&&await this.storeRefreshToken(h,p.refreshToken),p}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),o=this.resolve(e.clientSecret||"",r),l=e.scope?this.resolve(e.scope,r):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,c,p,h;if(f){c=this.generateCodeVerifier();let G=e.pkceMethod||"S256";p=G==="S256"?this.generateCodeChallengeS256(c):c,h=G}let g=e.state||du.randomBytes(16).toString("hex"),v=await this.getCallbackUri(),_=new URL(n);if(_.searchParams.set("response_type","code"),_.searchParams.set("client_id",s),_.searchParams.set("redirect_uri",v),l&&_.searchParams.set("scope",l),_.searchParams.set("state",g),p&&(_.searchParams.set("code_challenge",p),_.searchParams.set("code_challenge_method",h)),e.audience&&_.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&_.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[G,q]of Object.entries(e.extraParams))_.searchParams.set(G,this.resolve(q,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let w=new Promise((G,q)=>{this.pendingAuthCallback={resolve:G,reject:q,state:g}});await this.browserService.openExternal(_.toString());let E;try{E=await Promise.race([w,new Promise((G,q)=>setTimeout(()=>{this.pendingAuthCallback=null,q(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(E.state&&E.state!==g)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let k=new URLSearchParams;k.append("grant_type","authorization_code"),k.append("code",E.code),k.append("redirect_uri",v),c&&k.append("code_verifier",c);let T={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,T,k,s,o,r);let N=await this.httpService.execute({method:"POST",url:i,headers:T,body:k.toString()}),$=this.parseTokenResponse(N.body,e),j=this.buildCacheKeyString(e);return this.tokenCache.set(j,$),$.refreshToken&&await this.storeRefreshToken(j,$.refreshToken),$}async implicitFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.clientId||"",r),s=e.scope?this.resolve(e.scope,r):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 o=e.state||du.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",o),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[v,_]of Object.entries(e.extraParams))f.searchParams.set(v,this.resolve(_,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let c=new Promise((v,_)=>{this.pendingImplicitCallback={resolve:v,reject:_,state:o}});await this.browserService.openExternal(f.toString());let p;try{p=await Promise.race([c,new Promise((v,_)=>setTimeout(()=>{this.pendingImplicitCallback=null,_(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(p.state&&p.state!==o)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let h={accessToken:p.accessToken,tokenType:p.tokenType||e.tokenPrefix||"Bearer",expiresAt:p.expiresIn?Date.now()+p.expiresIn*1e3:void 0,raw:{access_token:p.accessToken,token_type:p.tokenType,expires_in:p.expiresIn}},g=this.buildCacheKeyString(e);return this.tokenCache.set(g,h),h}handleAuthorizationCallback(e,r,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:r}),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,r,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:r,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let r=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(r),this.secretStore.delete(`oauth2_refresh_${r}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,r,n){let i=this.resolve(e.tokenUrl||"",r);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",r),o=this.resolve(e.clientSecret||"",r),l=e.scope?this.resolve(e.scope,r):void 0,f=new URLSearchParams;if(f.append("grant_type",n),l&&f.append("scope",l),n==="password"){let h=this.resolve(e.username||"",r),g=this.resolve(e.password||"",r);if(!h)throw new Error("OAuth2 password grant requires username");f.append("username",h),f.append("password",g)}if(e.audience&&f.append("audience",this.resolve(e.audience,r)),e.resource&&f.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[h,g]of Object.entries(e.extraParams))f.append(h,this.resolve(g,r));let c={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,c,f,s,o,r);let p=await this.httpService.execute({method:"POST",url:i,headers:c,body:f.toString()});return this.parseTokenResponse(p.body,e)}applyClientAuth(e,r,n,i,s,o){if(e.clientAuthentication==="header"){let l=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${l}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){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=r.tokenField||"access_token",o=i[s];if(!o)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:o,tokenType:i.token_type||r.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-uz:!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,r){return this.envConfigService.resolveVariables(e,r)}generateCodeVerifier(){return du.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return du.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});import*as Ia from"fs";import*as ro from"path";function pu(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&Ia.writeFileSync(t,r.join(`
51
51
  `),"utf-8")}function Uf(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&Ia.writeFileSync(ro.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&Ia.writeFileSync(ro.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function cz(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return ro.isAbsolute(n)?n:ro.join(t,n)}async function fz(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function Cm(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=ro.join(e,At(n.name));Ia.mkdirSync(i,{recursive:!0}),Uf(i,At(n.name),n.scripts),Cm(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=At(i.name)+".http",o=ro.join(e,s),l=dz(i,r);Ia.writeFileSync(o,l,"utf-8"),Uf(e,At(i.name),i.scripts)}})}function dz(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${At(e.name)}.env`),r.push(`# request scripts: ${At(t.name)}.pre.js and .post.js`);let n=pz(t);return r.push(`${t.method} ${n}`),(t.headers||[]).filter(i=>i.enabled!==!1).forEach(i=>{r.push(`${i.key}: ${i.value}`)}),t.body&&t.body.content&&r.push("",t.body.content),r.join(`
52
- `)}function pz(t){let e=t.url;if(t.query&&t.query.length){let r=t.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");r&&(e+=(e.includes("?")?"&":"?")+r)}return e}var xm=se(()=>{"use strict";Cn()});import*as mr from"fs";import*as o0 from"path";var hu,a0=se(()=>{"use strict";Cn();hu=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){mr.existsSync(this.collectionsDir)||mr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!mr.existsSync(this.collectionsDir))return[];let e=mr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=o0.join(this.collectionsDir,n),s=mr.readFileSync(i,"utf-8"),o=JSON.parse(s);o.id&&o.name&&(this.cache.set(o.id,o),r.push(o))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return r}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.getCollectionPath(e);if(mr.existsSync(r))try{let n=mr.readFileSync(r,"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=St(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await mr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!mr.existsSync(r))return!1;try{return await mr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return mr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return o0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||St(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r);s&&(s.scripts=n,await this.save(i))}loadScripts(e,r){let n=this.load(e);return n?this.findItemById(n.items,r)?.scripts:void 0}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth),await this.save(n)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r.id);if(s)Object.assign(s,r);else if(n){let o=this.findItemById(i.items,n);if(o&&o.type==="folder")o.items=o.items||[],o.items.push(r);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(r);await this.save(i)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,r);return i&&await this.save(n),i}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let{id:o,type:l,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let o={...s};if(!this.deleteItemById(i.items,r))return!1;if(n){let l=this.findItemById(i.items,n);if(l&&l.type==="folder")l.items=l.items||[],l.items.push(o);else return i.items.push(o),!1}else i.items.push(o);return await this.save(i),!0}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;try{let s;if(r){let f=this.findItemById(i.items,r);if(!f||!f.items)return!1;s=f.items}else s=i.items;let o=new Map(s.map(f=>[f.id,f])),l=[];for(let f of n){let c=o.get(f);c&&(l.push(c),o.delete(f))}for(let f of o.values())l.push(f);if(r){let f=this.findItemById(i.items,r);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,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}deleteItemById(e,r){for(let n=0;n<e.length;n++){if(e[n].id===r)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}}});var Hf,l0=se(()=>{"use strict";Eh();a0();Hf=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new zs(n):new hu(n)}static createForFormat(e,r){return e==="folder"?new zs(r):new hu(r)}}});import*as qt from"fs";import*as ni from"path";function ok(t){if(typeof t!="string")return"text";let e=t.trim();try{let r=JSON.parse(e);if(typeof r=="object"&&r!==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 hz(t){return{info:{name:t.name,_postman_id:t.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:t.items.map(e=>ak(e)),event:u0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function ak(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(ak):[],event:u0(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(r=>r.enabled!==!1).map(mz),url:gz(e),body:yz(e),auth:vz(e.auth),description:e.description},event:u0(e.scripts),protocolProfileBehavior:bz(e.settings)}}}function mz(t){return{key:t.key,value:t.value,disabled:t.enabled===!1,...t.description!==void 0?{description:t.description}:{},...t.type!==void 0?{type:t.type}:{},...t.required!==void 0?{required:t.required}:{},...t.format!==void 0?{format:t.format}:{},...t.enum!==void 0?{enum:t.enum}:{},...t.deprecated!==void 0?{deprecated:t.deprecated}:{},...t.pattern!==void 0?{pattern:t.pattern}:{},...t.minLength!==void 0?{minLength:t.minLength}:{},...t.maxLength!==void 0?{maxLength:t.maxLength}:{},...t.minimum!==void 0?{minimum:t.minimum}:{},...t.maximum!==void 0?{maximum:t.maximum}:{},...t.exclusiveMinimum!==void 0?{exclusiveMinimum:t.exclusiveMinimum}:{},...t.exclusiveMaximum!==void 0?{exclusiveMaximum:t.exclusiveMaximum}:{},...t.multipleOf!==void 0?{multipleOf:t.multipleOf}:{},...t.minItems!==void 0?{minItems:t.minItems}:{},...t.maxItems!==void 0?{maxItems:t.maxItems}:{},...t.uniqueItems!==void 0?{uniqueItems:t.uniqueItems}:{},...t.nullable!==void 0?{nullable:t.nullable}:{},...t.oneOf!==void 0?{oneOf:t.oneOf}:{}}}function gz(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let c=i[1];/^{{.*}}$/.test(c)?n=[c]:n=c.split(".")}let s=[],o=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(o&&o[1]!==void 0){let c=o[1].replace(/^\//,"");c.endsWith("/")?(s=c.slice(0,-1).split("/"),s.push("")):s=c.length>0?c.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(c=>{let p={key:c.key,value:c.value};return c.enabled===!1&&(p.enabled=!1),c.description!==void 0&&(p.description=c.description),c.type!==void 0&&(p.type=c.type),c.required!==void 0&&(p.required=c.required),c.format!==void 0&&(p.format=c.format),c.enum!==void 0&&(p.enum=c.enum),c.deprecated!==void 0&&(p.deprecated=c.deprecated),c.pattern!==void 0&&(p.pattern=c.pattern),c.minLength!==void 0&&(p.minLength=c.minLength),c.maxLength!==void 0&&(p.maxLength=c.maxLength),c.minimum!==void 0&&(p.minimum=c.minimum),c.maximum!==void 0&&(p.maximum=c.maximum),c.exclusiveMinimum!==void 0&&(p.exclusiveMinimum=c.exclusiveMinimum),c.exclusiveMaximum!==void 0&&(p.exclusiveMaximum=c.exclusiveMaximum),c.multipleOf!==void 0&&(p.multipleOf=c.multipleOf),c.minItems!==void 0&&(p.minItems=c.minItems),c.maxItems!==void 0&&(p.maxItems=c.maxItems),c.uniqueItems!==void 0&&(p.uniqueItems=c.uniqueItems),c.nullable!==void 0&&(p.nullable=c.nullable),c.oneOf!==void 0&&(p.oneOf=c.oneOf),p});else{let c=r.indexOf("?");c!==-1&&(l=r.substring(c+1).split("&").map(h=>{let[g,...v]=h.split("=");return{key:g,value:v.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([c,p])=>({key:c,value:String(p)}))),{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 yz(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=ok(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||ok(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let r=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(r)return{mode:"formdata",formdata:r.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??"",o=i.variables;return{mode:"graphql",graphql:{query:s,variables:o?typeof o=="string"?o:JSON.stringify(o):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function vz(t){if(!(!t||!t.type||t.type==="none")){if(t.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:t.bearerToken,type:"string"}]};if(t.type==="basic"&&t.basicAuth)return{type:"basic",basic:[{key:"username",value:t.basicAuth.username,type:"string"},{key:"password",value:t.basicAuth.password,type:"string"}]}}}function bz(t){if(!t)return;let e={};return t.followRedirects===!1&&(e.followRedirects=!1),t.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),t.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),t.maxRedirects!==void 0&&(e.maxRedirects=t.maxRedirects),t.strictSSL===!1&&(e.disableUrlEncoding=!1),t.timeout!==void 0&&(e.requestTimeout=t.timeout),Object.keys(e).length>0?e:void 0}function u0(t){if(!t)return[];let e=[];return t.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[t.preRequest]}}),t.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[t.postResponse]}}),e}var Bf,c0=se(()=>{"use strict";Cn();xm();l0();Bf=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Hf.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;debounceTimer=null;selfWritePending=!1;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){qt.existsSync(this.collectionsDir)||qt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}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 r=this.selfWritePending;this.selfWritePending=!1,r||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 r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=St(e.name)),this.selfWritePending=!0,await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}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,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,n);if(s){let o=this.findItemRecursive(i.items,r);if(o){let{id:l,type:f,...c}=n;Object.assign(o,c)}}return s}async addRequest(e,r,n){if(!this.collections.get(e))return!1;r.id||(r.id=St(r.name)),this.selfWritePending=!0;try{return await this.loader.saveItem(e,r,n),!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(o=>o.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,r,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===r)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,r,n))return!0}return!1}deleteItemRecursive(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,r))return!0}return!1}collectRequestsRecursive(e,r){for(let n of e)n.type==="request"?r.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,r)}async createCollection(e){let r={id:St(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);this.selfWritePending=!0;let i=St(r),s=this.loader.getCollectionPath(e),o=ni.join(this.collectionsDir,i);if(!qt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,o);let l=ni.join(o,"collection.json");if(qt.existsSync(l)){let c=JSON.parse(qt.readFileSync(l,"utf-8"));c.id=i,c.name=r,qt.writeFileSync(l,JSON.stringify(c,null,2))}else qt.writeFileSync(l,JSON.stringify({id:i,name:r},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){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:St(e.name),type:"folder",name:e.name,items:[]};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async deleteFolder(e,r){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let o=this.findItemById(i.items,r);o&&(o.name=n)}return s}async duplicateFolder(e,r,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,r);if(!s||!qt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let o=ni.dirname(s),l=St(n),f=ni.join(o,l);this.selfWritePending=!0,this.copyDirRecursive(s,f);let c=ni.join(f,"folder.json");if(qt.existsSync(c)){let g=JSON.parse(qt.readFileSync(c,"utf-8"));g.id=l,g.name=n,qt.writeFileSync(c,JSON.stringify(g,null,2))}else qt.writeFileSync(c,JSON.stringify({id:l,name:n,type:"folder"},null,2));this.loadCollections();let p=this.collections.get(e),h=p?this.findItemById(p.items,l):void 0;return h||{id:l,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:e.id||St(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};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async renameRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let o=this.findItemById(i.items,r);o&&(o.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}getRequestScript(e,r,n){let i=this.collections.get(e);if(!i)return;let s=this.findItemById(i.items,r);if(!s||s.type!=="request")return;let o=s;return n==="pre-request"?o.scripts?.preRequest:o.scripts?.postResponse}async setRequestScript(e,r,n,i){let s=this.collections.get(e);if(!s)return!1;let o=this.findItemById(s.items,r);if(!o||o.type!=="request")return!1;let l=o,c={...l.scripts??{},...n==="pre-request"?{preRequest:i}:{postResponse:i}};l.scripts=c,this.selfWritePending=!0;try{return await this.loader.saveScripts(e,r,c),!0}catch{return!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}copyDirRecursive(e,r){qt.existsSync(r)||qt.mkdirSync(r,{recursive:!0});for(let n of qt.readdirSync(e,{withFileTypes:!0})){let i=ni.join(e,n.name),s=ni.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):qt.copyFileSync(i,s)}}deleteItemById(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}async importCollection(e){let r=qt.readFileSync(e,"utf-8"),n;try{n=JSON.parse(r)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||St(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 r=p=>{if(!p)return;switch(p.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:p.bearer?.find(T=>T.key==="token")?.value||""};case"basic":let v=p.basic?.find(T=>T.key==="username"),_=p.basic?.find(T=>T.key==="password");return{type:"basic",basicAuth:{username:v?.value||"",password:_?.value||""}};case"apikey":let w=p.apikey?.find(T=>T.key==="key"),E=p.apikey?.find(T=>T.key==="value"),k=p.apikey?.find(T=>T.key==="in");return{type:"apikey",apikey:{key:w?.value||"",value:E?.value||"",in:k?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=p=>{if(!Array.isArray(p)||p.length===0)return;let h={};for(let g of p){let v=g.script?.exec;if(!v)continue;let _=Array.isArray(v)?v.join(`
53
- `):v;g.listen==="prerequest"?h.preRequest=_:g.listen==="test"&&(h.postResponse=_)}return h.preRequest||h.postResponse?h:void 0},i=p=>{if(!p||typeof p!="object")return;let h={};return p.followRedirects===!1&&(h.followRedirects=!1),p.followOriginalHttpMethod===!0&&(h.followOriginalMethod=!0),p.followAuthorizationHeader===!1&&(h.followAuthHeader=!1),p.maxRedirects!==void 0&&(h.maxRedirects=p.maxRedirects),p.requestTimeout!==void 0&&(h.timeout=p.requestTimeout),Object.keys(h).length>0?h:void 0},s=p=>{if(!p||typeof p=="string")return;let h=p.query;if(!(!Array.isArray(h)||h.length===0))return h.map(g=>({key:g.key||"",value:g.value||"",enabled:g.disabled!==!0,...g.description!==void 0?{description:g.description}:{},...g.type!==void 0?{type:g.type}:{},...g.required!==void 0?{required:g.required}:{},...g.format!==void 0?{format:g.format}:{},...g.enum!==void 0?{enum:g.enum}:{},...g.deprecated!==void 0?{deprecated:g.deprecated}:{},...g.pattern!==void 0?{pattern:g.pattern}:{},...g.minLength!==void 0?{minLength:g.minLength}:{},...g.maxLength!==void 0?{maxLength:g.maxLength}:{},...g.minimum!==void 0?{minimum:g.minimum}:{},...g.maximum!==void 0?{maximum:g.maximum}:{},...g.exclusiveMinimum!==void 0?{exclusiveMinimum:g.exclusiveMinimum}:{},...g.exclusiveMaximum!==void 0?{exclusiveMaximum:g.exclusiveMaximum}:{},...g.multipleOf!==void 0?{multipleOf:g.multipleOf}:{},...g.minItems!==void 0?{minItems:g.minItems}:{},...g.maxItems!==void 0?{maxItems:g.maxItems}:{},...g.uniqueItems!==void 0?{uniqueItems:g.uniqueItems}:{},...g.nullable!==void 0?{nullable:g.nullable}:{},...g.oneOf!==void 0?{oneOf:g.oneOf}:{}}))},o=p=>{if(typeof p=="string")return p;if(!p)return"";let h=new Set;if(Array.isArray(p.variable))for(let v of p.variable)v.key&&h.add(v.key);if(h.size===0&&p.raw)return p.raw;let g="";if(p.protocol&&(g+=p.protocol+"://"),p.host&&(g+=Array.isArray(p.host)?p.host.join("."):p.host),p.port&&(g+=":"+p.port),p.path){let _=(Array.isArray(p.path)?p.path:[p.path]).map(w=>{let E=w.startsWith(":")?w.substring(1):w;return h.has(E)?":"+E:(w.startsWith(":"),w)});g+="/"+_.join("/")}return!g&&p.raw?p.raw:g},l=p=>{if(!Array.isArray(p)||p.length===0)return;let h={responses:{}};for(let g of p){let v=String(g.code||200),_,w={};if(Array.isArray(g.header))for(let $ of g.header)!$.key||$.disabled||($.key.toLowerCase()==="content-type"?_=$.value?.split(";")[0]?.trim():w[$.key]={description:String($.value??""),schema:{type:"string"}});let E=g.body;if(typeof g.body=="string"&&g.body)try{E=JSON.parse(g.body)}catch{}let k=g.originalRequest,T;if(k){let $=typeof k.url=="string"?k.url:k.url?.raw??"";T=`${k.method||""} ${$}`.trim()||void 0}let N=g.name?g.name.replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()||`example_${v}`:`example_${v}`;if(h.responses[v]){let $=h.responses[v];$.examples=$.examples??{},$.examples[N]={summary:T,value:E}}else h.responses[v]={description:g.name,contentType:_,examples:{[N]:{summary:T,value:E}},...Object.keys(w).length>0?{headers:w}:{}}}return Object.keys(h.responses).length>0?h:void 0},f=p=>p.map(h=>{if(h.item)return{id:St(h.name),type:"folder",name:h.name,description:h.description,auth:r(h.auth),scripts:n(h.event),items:f(h.item)};{let g=h.request||{};return{id:St(h.name),type:"request",name:h.name,description:h.description||g.description,method:typeof g.method=="string"?g.method:"GET",url:o(g.url),query:s(g.url),headers:Array.isArray(g.header)?g.header.map(v=>({key:v.key||v.name||"",value:v.value||v.value||"",enabled:v.disabled!==!0,...v.description!==void 0?{description:v.description}:{},...v.type!==void 0?{type:v.type}:{},...v.required!==void 0?{required:v.required}:{},...v.format!==void 0?{format:v.format}:{},...v.enum!==void 0?{enum:v.enum}:{},...v.deprecated!==void 0?{deprecated:v.deprecated}:{},...v.pattern!==void 0?{pattern:v.pattern}:{},...v.minLength!==void 0?{minLength:v.minLength}:{},...v.maxLength!==void 0?{maxLength:v.maxLength}:{},...v.minimum!==void 0?{minimum:v.minimum}:{},...v.maximum!==void 0?{maximum:v.maximum}:{},...v.exclusiveMinimum!==void 0?{exclusiveMinimum:v.exclusiveMinimum}:{},...v.exclusiveMaximum!==void 0?{exclusiveMaximum:v.exclusiveMaximum}:{},...v.multipleOf!==void 0?{multipleOf:v.multipleOf}:{},...v.minItems!==void 0?{minItems:v.minItems}:{},...v.maxItems!==void 0?{maxItems:v.maxItems}:{},...v.uniqueItems!==void 0?{uniqueItems:v.uniqueItems}:{},...v.nullable!==void 0?{nullable:v.nullable}:{},...v.oneOf!==void 0?{oneOf:v.oneOf}:{}})):[],body:(()=>{let v=g.body;if(v){if(v.mode==="raw"&&v.raw){let _=v.options?.raw?.language;return{type:"raw",format:_==="xml"?"xml":_==="html"?"html":_==="javascript"?"javascript":_==="text"?"text":"json",content:v.raw}}if(v.mode==="urlencoded"&&Array.isArray(v.urlencoded))return{type:"x-www-form-urlencoded",content:v.urlencoded.map(_=>({key:_.key||"",value:_.value||"",enabled:_.disabled!==!0}))};if(v.mode==="formdata"&&Array.isArray(v.formdata))return{type:"form-data",content:v.formdata.map(_=>({key:_.key||"",value:_.value||"",type:_.type||"text",enabled:_.disabled!==!0}))};if(v.mode==="graphql"&&v.graphql){let _;if(v.graphql.variables)try{_=JSON.parse(v.graphql.variables)}catch{_=void 0}return{type:"graphql",content:{query:v.graphql.query||"",variables:_}}}if(v.mode==="binary")return{type:"binary",content:""}}})(),auth:r(g.auth),scripts:n(h.event),settings:i(h.protocolProfileBehavior),responseSchema:l(h.response)}}}),c={id:St(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:r(e.auth),scripts:n(e.event),variables:Array.isArray(e.variable)?Object.fromEntries(e.variable.filter(p=>p&&p.key).map(p=>[p.key,String(p.value??"")])):typeof e.variable=="object"&&e.variable!==null?Object.fromEntries(Object.entries(e.variable).map(([p,h])=>[p,String(h??"")])):void 0,items:f(e.item||[])};return await this.saveCollection(c),c}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=hz(n),s=JSON.stringify(i,null,2);qt.writeFileSync(r,s,"utf-8")}async exportCollectionAsRestClientFolder(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=ni.join(r,At(n.name));qt.mkdirSync(i,{recursive:!0});let s=n.variables||{};pu(ni.join(i,`${At(n.name)}.env`),s),Uf(i,At(n.name),n.scripts),Cm(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var Yt,mu,qa,f0=se(()=>{"use strict";Yt={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:200,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"}}}},mu={config:"http-forge.config.json"},qa={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as Wr from"fs";import*as kn from"path";var gu,d0=se(()=>{"use strict";f0();gu=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=kn.join(e,mu.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!Wr.existsSync(this.configPath))return{...Yt};try{let e=Wr.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${mu.config}. Using default configuration.`),{...Yt}}}mergeWithDefaults(e){return{version:e.version??Yt.version,storage:{...Yt.storage,...e.storage},request:{...Yt.request,...e.request},scripts:{...Yt.scripts,...e.scripts},runner:{...Yt.runner,...e.runner},environments:{...Yt.environments,...e.environments},restClientExport:{...Yt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Yt.proxy,mcp:{...Yt.mcp,...e.mcp,cors:{...Yt.mcp.cors,...e.mcp?.cors}},secrets:{...Yt.secrets,...e.secrets,providers:{...Yt.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,mu.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 kn.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??Yt.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??200)),maxRequestsPerCall:Math.min(1e4,Math.max(1,e.maxRequestsPerCall??500))}}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return kn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return kn.join(this.getRootPath(),qa.collections)}getEnvironmentsPath(){return kn.join(this.getRootPath(),qa.environments)}getFlowsPath(){return kn.join(this.getRootPath(),qa.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return kn.join(this.getRootPath(),qa.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 Wr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Yt,null,2);await Wr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Wr.existsSync(i)||await Wr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Wr.existsSync(i)||await Wr.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await Wr.promises.writeFile(kn.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await Wr.promises.writeFile(kn.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 Wr.promises.writeFile(kn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}}});var Sz,Vf,p0=se(()=>{"use strict";ia();Sz="httpForge.cookies",Vf=class{constructor(e,r=Sz){this.store=e;this.storeKey=r;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((r,n)=>{e[n]=r}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),o=this.cookies.get(s);if(o&&!this.isExpired(o))return o}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(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}async set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e),await this.saveCookies()}async setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}await this.saveCookies()}has(e,r){return this.get(e,r)!==void 0}async delete(e,r,n){let i=this.getCookieKey(e,r,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return ht.formatCookieHeader(r)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,r){return ht.parseCookieHeaders(e,r)}isExpired(e){return ht.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r);e.length>0&&this.saveCookies()}domainMatches(e,r){return ht.domainMatches(e,r)}get count(){return this.cookies.size}}});var Wf,h0=se(()=>{"use strict";ia();Wf=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}cookieService;localCache=[];pendingOperations=[];get(e,r){return r?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===r||r.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,r){return this.get(e,r)!==void 0}set(e){let r=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));r>=0?this.localCache[r]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,r,n){let i=this.localCache.findIndex(s=>s.name===e&&(!r||s.domain===r||s.domain&&r.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:r,path:n}),!0}getAll(e){return e?this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,r){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(r,n);i.length>0&&(i.forEach(s=>{let o=this.localCache.findIndex(l=>l.name===s.name&&l.domain===(s.domain||n));o>=0?this.localCache[o]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let r=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(ht.isExpired(s)||s.domain&&!ht.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return ht.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 Em(t){try{let e=JSON.parse(typeof t=="string"?t:t.toString("utf-8"));if(!e)return null;let r=e.environment||e,n=r.name||e.name||"imported-environment",i=r.values||r.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let l of i){if(!l)continue;let f=l.key??l.name,c=typeof l.enabled=="boolean"?l.enabled:!0;f&&c!==!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 o=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:o}}catch{return null}}async function wz(t,e){try{let r=await e.readFile(t);return Em(r)}catch{return null}}var m0=se(()=>{"use strict"});import*as Kt from"fs";import*as fn from"path";var zf,Jf,g0=se(()=>{"use strict";Cn();m0();xm();Oh();Qc();zf={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Jf=class{constructor(e,r,n,i,s,o=!0){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;this.secretStore=s;this.persistOverrides=o;let l=n.getEnvironmentsPath();this.environmentsPath=l,this.sharedConfigPath=fn.join(l,"_global.json"),this.localConfigPath=fn.join(l,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r?.get(zf.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.persistOverrides&&this.loadPersistedEnvironmentOverrides(),this.loadSecretVariables(this.selectedEnvironment).catch(()=>{}),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;secretStore;persistOverrides;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;secretValuesCache=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Kt.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(!Kt.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(zf.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let r=this.getEnvOverridesStateKey(e),n=this.workspaceStore?.get(r,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}await this.loadSecretVariables(e)}getEnvOverridesStateKey(e){return`${zf.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),r=this.workspaceStore?.get(e,{});r&&Object.keys(r).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...r})}persistEnvironmentOverrides(e){if(!this.persistOverrides)return;let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore?.update(r,n)}setEnvironmentVariable(e,r,n){let i=n??this.selectedEnvironment;this.localEnvironmentValues.has(i)||this.localEnvironmentValues.set(i,{}),this.localEnvironmentValues.get(i)[e]=String(r),this.persistEnvironmentOverrides(i)}deleteEnvironmentVariable(e,r){let n=r??this.selectedEnvironment,i=this.localEnvironmentValues.get(n);i&&(delete i[e],this.persistEnvironmentOverrides(n))}clearEnvironmentVariables(e){let r=e??this.selectedEnvironment;this.localEnvironmentValues.set(r,{}),this.persistEnvironmentOverrides(r)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore?.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}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 r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],o=i?.credentials?.[r],l=i?.variables||{},f=o?.variables||{},c=o&&o.headers||{},p=Hc(n.defaultHeaders||{},c),h=this.localEnvironmentValues.get(r)||{},g=this.secretValuesCache.get(r)||{},v={...s.variables||{},...f,...h,...g};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:p,variables:v}}async getSecretVariable(e,r){return this.secretStore?.get(`${e}:${r}`)}async setSecretVariable(e,r,n){await this.secretStore?.store(`${e}:${r}`,n),this.secretValuesCache.has(e)||this.secretValuesCache.set(e,{}),this.secretValuesCache.get(e)[r]=n}async deleteSecretVariable(e,r){await this.secretStore?.delete(`${e}:${r}`),this.secretValuesCache.get(e)&&delete this.secretValuesCache.get(e)[r]}async loadSecretVariables(e){if(!this.secretStore)return;let r=e||this.selectedEnvironment,n=this.getSharedConfig()?.environments?.[r]?.secretVariables??[];if(n.length===0)return;let i={};await Promise.all(n.map(async s=>{let o=await this.secretStore.get(`${r}:${s}`);o!==void 0&&(i[s]=o)})),this.secretValuesCache.set(r,i)}resolveVariables(e,r){return this.createResolver(r).resolveString(e,!0)}exportEnvironmentsToFolder(e,r=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!r&&Object.keys(s).length){let o=fn.join(e,"globals.env");pu(o,s)}n.forEach(o=>{let l=i?.environments?.[o];if(!l)return;let f={...l.variables||{}};r&&(f={...s,...f});let c=fn.join(e,`${At(o)}.env`);pu(c,f)})}resolveVariablesWithExtra(e,r,n){return this.createResolver(n,r).resolveString(e,!0)}resolveVariablesInObject(e,r){return this.createResolver(r).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,r,n){return this.createResolver(n,r).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return fn.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Kt.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let r={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,r);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),o={variables:i.variables||{}};this.saveJsonFile(s,o)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Kt.readFileSync(e,"utf-8"),n=Em(r);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(r){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",r),r}}saveEnvLocalConfig(e,r){let n=this.getEnvLocalConfigPath(e),i={variables:r};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:r}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return fn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=Jc(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,r){let s={...this.getResolvedEnvironment(e)?.variables||{},...r||{}},o=this.getGlobalVariables();return new ua({globals:o,collectionVariables:{},environmentVariables:s,variables:{}})}saveFolderSharedConfig(e){Kt.existsSync(this.environmentsPath)||Kt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Kt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!qh(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let o=fn.basename(s,".json");if(!i.has(o))try{Kt.unlinkSync(fn.join(this.environmentsPath,s))}catch{}}for(let[s,o]of Object.entries(e.environments||{})){let l={name:s,description:o.description,requiresConfirmation:o.requiresConfirmation,variables:o.variables||{}};this.saveJsonFile(fn.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,r])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:r.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 r=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=r.length>0?r[0]:"dev",await this.workspaceStore?.update(zf.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(r);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[r]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[r].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),r!==e&&(this.validateEnvironmentNameNotTaken(r),this.sharedConfig.environments[r]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=r,await this.workspaceStore?.update(zf.SELECTED_ENVIRONMENT,r)),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,r){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=r,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Kt.existsSync(e))return null;let r=Kt.readFileSync(e,"utf-8");return JSON.parse(r)}catch(r){return console.error(`Failed to load JSON from ${e}:`,r),null}}saveJsonFile(e,r){try{let n=fn.dirname(e);Kt.existsSync(n)||Kt.mkdirSync(n,{recursive:!0}),Kt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var no,Im=se(()=>{"use strict";$f();no=class t{constructor(e,r,n,i,s,o,l,f,c,p,h,g,v){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=o;this.collectionScripts=l;this.folderScriptsChain=f;this.onConsoleOutput=c;this.collectionName=p;this.collectionAuth=h;this.iteration=g;this.iterationCount=v}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;collectionAuth;iteration;iterationCount;async execute(e,r,n){let i=Date.now();return this.executeWithSession(e,r,n,i)}async executeWithSession(e,r,n,i){let s=this.collectPreRequestScripts(e),o=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(),c={request:e,variables:{...r},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(g,v,_)=>{g==="set"&&v&&_!==void 0?this.envConfigService.setEnvironmentVariable(v,_,this.environment):g==="unset"&&v?this.envConfigService.deleteEnvironmentVariable(v,this.environment):g==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(g,v,_)=>{g==="set"&&v&&_!==void 0?this.envConfigService.setGlobalVariable(v,_):g==="unset"&&v?this.envConfigService.deleteGlobalVariable(v):g==="clear"&&this.envConfigService.clearGlobalVariables()}},p=this.scriptExecutor.createRequestSession(c),h=null;try{let g={...r},v={...e},_;if((!v.auth||v.auth.type==="inherit")&&(v.auth=this.collectionAuth&&this.collectionAuth.type!=="inherit"?this.collectionAuth:void 0),s.length>0){let F=await p.executePreRequest(s);if(F.consoleOutput&&F.consoleOutput.length>0&&this.onConsoleOutput?.(F.consoleOutput,{requestName:e.name||"",phase:"pre-request"}),F.nextRequest!==void 0&&(_=F.nextRequest),F.skipRequest){let K={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:K,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:g,nextRequest:_}}F.success&&(F.modifiedRequest&&(F.modifiedRequest.url&&(v.url=F.modifiedRequest.url),F.modifiedRequest.headers&&(v.headers=F.modifiedRequest.headers),F.modifiedRequest.params&&(v.params=F.modifiedRequest.params),F.modifiedRequest.query&&(v.query=F.modifiedRequest.query),F.modifiedRequest.body!==void 0&&(v.body=F.modifiedRequest.body)),(F.localVariables??F.modifiedVariables)&&(g=F.localVariables??F.modifiedVariables))}h=await this.requestPreparer.prepareRequest(v,this.environment,l,g);let{url:w,headers:E,body:k,method:T}=h,N={};for(let F in E)Object.prototype.hasOwnProperty.call(E,F)&&(N[F.toUpperCase()]=E[F]);if(!N.COOKIE&&v.settings?.includeCookies!==!1&&this.cookieJar){let K=this.cookieJar.getCookieHeader(w);K&&(N.COOKIE=K)}let $={method:T,url:w,headers:N,body:k.content,signal:n,settings:v.settings?{timeout:v.settings.timeout,followRedirects:v.settings.followRedirects,maxRedirects:v.settings.maxRedirects,strictSSL:v.settings.strictSSL}:void 0},j=await this.httpService.execute($);this.cookieJar&&j.headers&&await this.cookieJar.setCookiesFromResponse(w,j.headers);let G=Date.now()-i,O=[],C={},A;if(o.length>0){let F=0;if(j.body)if(typeof j.body=="string")F=Buffer.byteLength(j.body,"utf8");else if(Buffer.isBuffer(j.body))F=j.body.length;else try{F=Buffer.byteLength(JSON.stringify(j.body),"utf8")}catch{F=0}let K=wm(j.headers,j.cookies,h.url),ee={executedRequest:h,status:j.status,statusText:j.statusText,headers:Xw(j.headers||{}),body:j.body,cookies:K,responseTime:j.time,responseSize:F},ie=await p.executePostResponse(o,ee);O=ie.testResults,C=ie.modifiedEnvironmentVariables||{},A=ie.visualizerData,ie.nextRequest!==void 0&&(_=ie.nextRequest),ie.consoleOutput&&ie.consoleOutput.length>0&&this.onConsoleOutput?.(ie.consoleOutput,{requestName:e.name||"",phase:"post-response"})}let D=O.length===0||O.every(F=>F.passed),B=O.length>0?D:j.status>=200&&j.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...h,headers:N},response:{status:j.status,statusText:j.statusText,headers:j.headers||{},body:j.body,time:j.time||G,cookies:j.cookies||[]},duration:G,timestamp:Date.now(),passed:B,assertions:O,modifiedVariables:g,modifiedEnvironmentVariables:C,nextRequest:_,visualizerData:A}}catch(g){return this.handleError(e,h,g,i)}finally{p.dispose?.()}}collectPreRequestScripts(e){let r=[];if(this.collectionScripts?.preRequest&&r.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&r.push(n.preRequest);else this.folderScriptsChain.preRequest&&r.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&r.push(e.scripts.preRequest),r}collectPostResponseScripts(e){let r=[];if(e.scripts?.postResponse&&r.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&r.push(i.postResponse)}else this.folderScriptsChain.postResponse&&r.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&r.push(this.collectionScripts.postResponse),r}handleError(e,r,n,i){let s=Date.now()-i,o=r?.method||e.method,l=r?.url||e.url;this.onConsoleOutput?.([`${n.message||n}`],{requestName:e.name||"",phase:"error"});let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),c=n?.stack?String(n.stack):"",p=this.errorBodyFormat,h,g;p==="html"||p==="both"?(h=t.formatErrorAsHtml(f,c),g={"content-type":"text/html; charset=utf-8"}):(h=f,g={});let v={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:o||"GET",headers:r?.headers||{},body:r?.body||v,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:g,cookies:[],body:h,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");return`<!doctype html>
52
+ `)}function pz(t){let e=t.url;if(t.query&&t.query.length){let r=t.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");r&&(e+=(e.includes("?")?"&":"?")+r)}return e}var xm=se(()=>{"use strict";Cn()});import*as mr from"fs";import*as o0 from"path";var hu,a0=se(()=>{"use strict";Cn();hu=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){mr.existsSync(this.collectionsDir)||mr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!mr.existsSync(this.collectionsDir))return[];let e=mr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=o0.join(this.collectionsDir,n),s=mr.readFileSync(i,"utf-8"),o=JSON.parse(s);o.id&&o.name&&(this.cache.set(o.id,o),r.push(o))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return r}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.getCollectionPath(e);if(mr.existsSync(r))try{let n=mr.readFileSync(r,"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=St(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await mr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!mr.existsSync(r))return!1;try{return await mr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return mr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return o0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||St(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r);s&&(s.scripts=n,await this.save(i))}loadScripts(e,r){let n=this.load(e);return n?this.findItemById(n.items,r)?.scripts:void 0}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth),await this.save(n)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r.id);if(s)Object.assign(s,r);else if(n){let o=this.findItemById(i.items,n);if(o&&o.type==="folder")o.items=o.items||[],o.items.push(r);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(r);await this.save(i)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,r);return i&&await this.save(n),i}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let{id:o,type:l,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let o={...s};if(!this.deleteItemById(i.items,r))return!1;if(n){let l=this.findItemById(i.items,n);if(l&&l.type==="folder")l.items=l.items||[],l.items.push(o);else return i.items.push(o),!1}else i.items.push(o);return await this.save(i),!0}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;try{let s;if(r){let f=this.findItemById(i.items,r);if(!f||!f.items)return!1;s=f.items}else s=i.items;let o=new Map(s.map(f=>[f.id,f])),l=[];for(let f of n){let c=o.get(f);c&&(l.push(c),o.delete(f))}for(let f of o.values())l.push(f);if(r){let f=this.findItemById(i.items,r);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,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}deleteItemById(e,r){for(let n=0;n<e.length;n++){if(e[n].id===r)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}}});var Hf,l0=se(()=>{"use strict";Eh();a0();Hf=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new zs(n):new hu(n)}static createForFormat(e,r){return e==="folder"?new zs(r):new hu(r)}}});import*as Ot from"fs";import*as ni from"path";function ok(t){if(typeof t!="string")return"text";let e=t.trim();try{let r=JSON.parse(e);if(typeof r=="object"&&r!==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 hz(t){return{info:{name:t.name,_postman_id:t.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:t.items.map(e=>ak(e)),event:u0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function ak(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(ak):[],event:u0(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(r=>r.enabled!==!1).map(mz),url:gz(e),body:yz(e),auth:vz(e.auth),description:e.description},event:u0(e.scripts),protocolProfileBehavior:bz(e.settings)}}}function mz(t){return{key:t.key,value:t.value,disabled:t.enabled===!1,...t.description!==void 0?{description:t.description}:{},...t.type!==void 0?{type:t.type}:{},...t.required!==void 0?{required:t.required}:{},...t.format!==void 0?{format:t.format}:{},...t.enum!==void 0?{enum:t.enum}:{},...t.deprecated!==void 0?{deprecated:t.deprecated}:{},...t.pattern!==void 0?{pattern:t.pattern}:{},...t.minLength!==void 0?{minLength:t.minLength}:{},...t.maxLength!==void 0?{maxLength:t.maxLength}:{},...t.minimum!==void 0?{minimum:t.minimum}:{},...t.maximum!==void 0?{maximum:t.maximum}:{},...t.exclusiveMinimum!==void 0?{exclusiveMinimum:t.exclusiveMinimum}:{},...t.exclusiveMaximum!==void 0?{exclusiveMaximum:t.exclusiveMaximum}:{},...t.multipleOf!==void 0?{multipleOf:t.multipleOf}:{},...t.minItems!==void 0?{minItems:t.minItems}:{},...t.maxItems!==void 0?{maxItems:t.maxItems}:{},...t.uniqueItems!==void 0?{uniqueItems:t.uniqueItems}:{},...t.nullable!==void 0?{nullable:t.nullable}:{},...t.oneOf!==void 0?{oneOf:t.oneOf}:{}}}function gz(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let c=i[1];/^{{.*}}$/.test(c)?n=[c]:n=c.split(".")}let s=[],o=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(o&&o[1]!==void 0){let c=o[1].replace(/^\//,"");c.endsWith("/")?(s=c.slice(0,-1).split("/"),s.push("")):s=c.length>0?c.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(c=>{let p={key:c.key,value:c.value};return c.enabled===!1&&(p.enabled=!1),c.description!==void 0&&(p.description=c.description),c.type!==void 0&&(p.type=c.type),c.required!==void 0&&(p.required=c.required),c.format!==void 0&&(p.format=c.format),c.enum!==void 0&&(p.enum=c.enum),c.deprecated!==void 0&&(p.deprecated=c.deprecated),c.pattern!==void 0&&(p.pattern=c.pattern),c.minLength!==void 0&&(p.minLength=c.minLength),c.maxLength!==void 0&&(p.maxLength=c.maxLength),c.minimum!==void 0&&(p.minimum=c.minimum),c.maximum!==void 0&&(p.maximum=c.maximum),c.exclusiveMinimum!==void 0&&(p.exclusiveMinimum=c.exclusiveMinimum),c.exclusiveMaximum!==void 0&&(p.exclusiveMaximum=c.exclusiveMaximum),c.multipleOf!==void 0&&(p.multipleOf=c.multipleOf),c.minItems!==void 0&&(p.minItems=c.minItems),c.maxItems!==void 0&&(p.maxItems=c.maxItems),c.uniqueItems!==void 0&&(p.uniqueItems=c.uniqueItems),c.nullable!==void 0&&(p.nullable=c.nullable),c.oneOf!==void 0&&(p.oneOf=c.oneOf),p});else{let c=r.indexOf("?");c!==-1&&(l=r.substring(c+1).split("&").map(h=>{let[g,...v]=h.split("=");return{key:g,value:v.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([c,p])=>({key:c,value:String(p)}))),{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 yz(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=ok(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||ok(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let r=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(r)return{mode:"formdata",formdata:r.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??"",o=i.variables;return{mode:"graphql",graphql:{query:s,variables:o?typeof o=="string"?o:JSON.stringify(o):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function vz(t){if(!(!t||!t.type||t.type==="none")){if(t.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:t.bearerToken,type:"string"}]};if(t.type==="basic"&&t.basicAuth)return{type:"basic",basic:[{key:"username",value:t.basicAuth.username,type:"string"},{key:"password",value:t.basicAuth.password,type:"string"}]}}}function bz(t){if(!t)return;let e={};return t.followRedirects===!1&&(e.followRedirects=!1),t.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),t.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),t.maxRedirects!==void 0&&(e.maxRedirects=t.maxRedirects),t.strictSSL===!1&&(e.disableUrlEncoding=!1),t.timeout!==void 0&&(e.requestTimeout=t.timeout),Object.keys(e).length>0?e:void 0}function u0(t){if(!t)return[];let e=[];return t.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[t.preRequest]}}),t.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[t.postResponse]}}),e}var Bf,c0=se(()=>{"use strict";Cn();xm();l0();Bf=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Hf.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;debounceTimer=null;selfWritePending=!1;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){Ot.existsSync(this.collectionsDir)||Ot.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}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 r=this.selfWritePending;this.selfWritePending=!1,r||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 r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=St(e.name)),this.selfWritePending=!0,await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}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,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,n);if(s){let o=this.findItemRecursive(i.items,r);if(o){let{id:l,type:f,...c}=n;Object.assign(o,c)}}return s}async addRequest(e,r,n){if(!this.collections.get(e))return!1;r.id||(r.id=St(r.name)),this.selfWritePending=!0;try{return await this.loader.saveItem(e,r,n),!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(o=>o.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,r,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===r)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,r,n))return!0}return!1}deleteItemRecursive(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,r))return!0}return!1}collectRequestsRecursive(e,r){for(let n of e)n.type==="request"?r.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,r)}async createCollection(e){let r={id:St(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);this.selfWritePending=!0;let i=St(r),s=this.loader.getCollectionPath(e),o=ni.join(this.collectionsDir,i);if(!Ot.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,o);let l=ni.join(o,"collection.json");if(Ot.existsSync(l)){let c=JSON.parse(Ot.readFileSync(l,"utf-8"));c.id=i,c.name=r,Ot.writeFileSync(l,JSON.stringify(c,null,2))}else Ot.writeFileSync(l,JSON.stringify({id:i,name:r},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){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:St(e.name),type:"folder",name:e.name,items:[]};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async deleteFolder(e,r){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let o=this.findItemById(i.items,r);o&&(o.name=n)}return s}async duplicateFolder(e,r,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,r);if(!s||!Ot.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let o=ni.dirname(s),l=St(n),f=ni.join(o,l);this.selfWritePending=!0,this.copyDirRecursive(s,f);let c=ni.join(f,"folder.json");if(Ot.existsSync(c)){let g=JSON.parse(Ot.readFileSync(c,"utf-8"));g.id=l,g.name=n,Ot.writeFileSync(c,JSON.stringify(g,null,2))}else Ot.writeFileSync(c,JSON.stringify({id:l,name:n,type:"folder"},null,2));this.loadCollections();let p=this.collections.get(e),h=p?this.findItemById(p.items,l):void 0;return h||{id:l,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:e.id||St(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,operationId:e.operationId,summary:e.summary,tags:e.tags,examples:e.examples,responses:e.responses,security:e.security};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async renameRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let o=this.findItemById(i.items,r);o&&(o.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}getRequestScript(e,r,n){let i=this.collections.get(e);if(!i)return;let s=this.findItemById(i.items,r);if(!s||s.type!=="request")return;let o=s;return n==="pre-request"?o.scripts?.preRequest:o.scripts?.postResponse}async setRequestScript(e,r,n,i){let s=this.collections.get(e);if(!s)return!1;let o=this.findItemById(s.items,r);if(!o||o.type!=="request")return!1;let l=o,c={...l.scripts??{},...n==="pre-request"?{preRequest:i}:{postResponse:i}};l.scripts=c,this.selfWritePending=!0;try{return await this.loader.saveScripts(e,r,c),!0}catch{return!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}copyDirRecursive(e,r){Ot.existsSync(r)||Ot.mkdirSync(r,{recursive:!0});for(let n of Ot.readdirSync(e,{withFileTypes:!0})){let i=ni.join(e,n.name),s=ni.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Ot.copyFileSync(i,s)}}deleteItemById(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}async importCollection(e){let r=Ot.readFileSync(e,"utf-8"),n;try{n=JSON.parse(r)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||St(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 r=p=>{if(!p)return;switch(p.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:p.bearer?.find(T=>T.key==="token")?.value||""};case"basic":let v=p.basic?.find(T=>T.key==="username"),_=p.basic?.find(T=>T.key==="password");return{type:"basic",basicAuth:{username:v?.value||"",password:_?.value||""}};case"apikey":let w=p.apikey?.find(T=>T.key==="key"),E=p.apikey?.find(T=>T.key==="value"),k=p.apikey?.find(T=>T.key==="in");return{type:"apikey",apikey:{key:w?.value||"",value:E?.value||"",in:k?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=p=>{if(!Array.isArray(p)||p.length===0)return;let h={};for(let g of p){let v=g.script?.exec;if(!v)continue;let _=Array.isArray(v)?v.join(`
53
+ `):v;g.listen==="prerequest"?h.preRequest=_:g.listen==="test"&&(h.postResponse=_)}return h.preRequest||h.postResponse?h:void 0},i=p=>{if(!p||typeof p!="object")return;let h={};return p.followRedirects===!1&&(h.followRedirects=!1),p.followOriginalHttpMethod===!0&&(h.followOriginalMethod=!0),p.followAuthorizationHeader===!1&&(h.followAuthHeader=!1),p.maxRedirects!==void 0&&(h.maxRedirects=p.maxRedirects),p.requestTimeout!==void 0&&(h.timeout=p.requestTimeout),Object.keys(h).length>0?h:void 0},s=p=>{if(!p||typeof p=="string")return;let h=p.query;if(!(!Array.isArray(h)||h.length===0))return h.map(g=>({key:g.key||"",value:g.value||"",enabled:g.disabled!==!0,...g.description!==void 0?{description:g.description}:{},...g.type!==void 0?{type:g.type}:{},...g.required!==void 0?{required:g.required}:{},...g.format!==void 0?{format:g.format}:{},...g.enum!==void 0?{enum:g.enum}:{},...g.deprecated!==void 0?{deprecated:g.deprecated}:{},...g.pattern!==void 0?{pattern:g.pattern}:{},...g.minLength!==void 0?{minLength:g.minLength}:{},...g.maxLength!==void 0?{maxLength:g.maxLength}:{},...g.minimum!==void 0?{minimum:g.minimum}:{},...g.maximum!==void 0?{maximum:g.maximum}:{},...g.exclusiveMinimum!==void 0?{exclusiveMinimum:g.exclusiveMinimum}:{},...g.exclusiveMaximum!==void 0?{exclusiveMaximum:g.exclusiveMaximum}:{},...g.multipleOf!==void 0?{multipleOf:g.multipleOf}:{},...g.minItems!==void 0?{minItems:g.minItems}:{},...g.maxItems!==void 0?{maxItems:g.maxItems}:{},...g.uniqueItems!==void 0?{uniqueItems:g.uniqueItems}:{},...g.nullable!==void 0?{nullable:g.nullable}:{},...g.oneOf!==void 0?{oneOf:g.oneOf}:{}}))},o=p=>{if(typeof p=="string")return p;if(!p)return"";let h=new Set;if(Array.isArray(p.variable))for(let v of p.variable)v.key&&h.add(v.key);if(h.size===0&&p.raw)return p.raw;let g="";if(p.protocol&&(g+=p.protocol+"://"),p.host&&(g+=Array.isArray(p.host)?p.host.join("."):p.host),p.port&&(g+=":"+p.port),p.path){let _=(Array.isArray(p.path)?p.path:[p.path]).map(w=>{let E=w.startsWith(":")?w.substring(1):w;return h.has(E)?":"+E:(w.startsWith(":"),w)});g+="/"+_.join("/")}return!g&&p.raw?p.raw:g},l=p=>{if(!Array.isArray(p)||p.length===0)return;let h={responses:{}};for(let g of p){let v=String(g.code||200),_,w={};if(Array.isArray(g.header))for(let $ of g.header)!$.key||$.disabled||($.key.toLowerCase()==="content-type"?_=$.value?.split(";")[0]?.trim():w[$.key]={description:String($.value??""),schema:{type:"string"}});let E=g.body;if(typeof g.body=="string"&&g.body)try{E=JSON.parse(g.body)}catch{}let k=g.originalRequest,T;if(k){let $=typeof k.url=="string"?k.url:k.url?.raw??"";T=`${k.method||""} ${$}`.trim()||void 0}let N=g.name?g.name.replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()||`example_${v}`:`example_${v}`;if(h.responses[v]){let $=h.responses[v];$.examples=$.examples??{},$.examples[N]={summary:T,value:E}}else h.responses[v]={description:g.name,contentType:_,examples:{[N]:{summary:T,value:E}},...Object.keys(w).length>0?{headers:w}:{}}}return Object.keys(h.responses).length>0?h:void 0},f=p=>p.map(h=>{if(h.item)return{id:St(h.name),type:"folder",name:h.name,description:h.description,auth:r(h.auth),scripts:n(h.event),items:f(h.item)};{let g=h.request||{};return{id:St(h.name),type:"request",name:h.name,description:h.description||g.description,method:typeof g.method=="string"?g.method:"GET",url:o(g.url),query:s(g.url),headers:Array.isArray(g.header)?g.header.map(v=>({key:v.key||v.name||"",value:v.value||v.value||"",enabled:v.disabled!==!0,...v.description!==void 0?{description:v.description}:{},...v.type!==void 0?{type:v.type}:{},...v.required!==void 0?{required:v.required}:{},...v.format!==void 0?{format:v.format}:{},...v.enum!==void 0?{enum:v.enum}:{},...v.deprecated!==void 0?{deprecated:v.deprecated}:{},...v.pattern!==void 0?{pattern:v.pattern}:{},...v.minLength!==void 0?{minLength:v.minLength}:{},...v.maxLength!==void 0?{maxLength:v.maxLength}:{},...v.minimum!==void 0?{minimum:v.minimum}:{},...v.maximum!==void 0?{maximum:v.maximum}:{},...v.exclusiveMinimum!==void 0?{exclusiveMinimum:v.exclusiveMinimum}:{},...v.exclusiveMaximum!==void 0?{exclusiveMaximum:v.exclusiveMaximum}:{},...v.multipleOf!==void 0?{multipleOf:v.multipleOf}:{},...v.minItems!==void 0?{minItems:v.minItems}:{},...v.maxItems!==void 0?{maxItems:v.maxItems}:{},...v.uniqueItems!==void 0?{uniqueItems:v.uniqueItems}:{},...v.nullable!==void 0?{nullable:v.nullable}:{},...v.oneOf!==void 0?{oneOf:v.oneOf}:{}})):[],body:(()=>{let v=g.body;if(v){if(v.mode==="raw"&&v.raw){let _=v.options?.raw?.language;return{type:"raw",format:_==="xml"?"xml":_==="html"?"html":_==="javascript"?"javascript":_==="text"?"text":"json",content:v.raw}}if(v.mode==="urlencoded"&&Array.isArray(v.urlencoded))return{type:"x-www-form-urlencoded",content:v.urlencoded.map(_=>({key:_.key||"",value:_.value||"",enabled:_.disabled!==!0}))};if(v.mode==="formdata"&&Array.isArray(v.formdata))return{type:"form-data",content:v.formdata.map(_=>({key:_.key||"",value:_.value||"",type:_.type||"text",enabled:_.disabled!==!0}))};if(v.mode==="graphql"&&v.graphql){let _;if(v.graphql.variables)try{_=JSON.parse(v.graphql.variables)}catch{_=void 0}return{type:"graphql",content:{query:v.graphql.query||"",variables:_}}}if(v.mode==="binary")return{type:"binary",content:""}}})(),auth:r(g.auth),scripts:n(h.event),settings:i(h.protocolProfileBehavior),responseSchema:l(h.response)}}}),c={id:St(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:r(e.auth),scripts:n(e.event),variables:Array.isArray(e.variable)?Object.fromEntries(e.variable.filter(p=>p&&p.key).map(p=>[p.key,String(p.value??"")])):typeof e.variable=="object"&&e.variable!==null?Object.fromEntries(Object.entries(e.variable).map(([p,h])=>[p,String(h??"")])):void 0,items:f(e.item||[])};return await this.saveCollection(c),c}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=hz(n),s=JSON.stringify(i,null,2);Ot.writeFileSync(r,s,"utf-8")}async exportCollectionAsRestClientFolder(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=ni.join(r,At(n.name));Ot.mkdirSync(i,{recursive:!0});let s=n.variables||{};pu(ni.join(i,`${At(n.name)}.env`),s),Uf(i,At(n.name),n.scripts),Cm(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var Yt,mu,Oa,f0=se(()=>{"use strict";Yt={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:200,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"}}}},mu={config:"http-forge.config.json"},Oa={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as Wr from"fs";import*as kn from"path";var gu,d0=se(()=>{"use strict";f0();gu=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=kn.join(e,mu.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!Wr.existsSync(this.configPath))return{...Yt};try{let e=Wr.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${mu.config}. Using default configuration.`),{...Yt}}}mergeWithDefaults(e){return{version:e.version??Yt.version,storage:{...Yt.storage,...e.storage},request:{...Yt.request,...e.request},scripts:{...Yt.scripts,...e.scripts},runner:{...Yt.runner,...e.runner},environments:{...Yt.environments,...e.environments},restClientExport:{...Yt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Yt.proxy,mcp:{...Yt.mcp,...e.mcp,cors:{...Yt.mcp.cors,...e.mcp?.cors}},secrets:{...Yt.secrets,...e.secrets,providers:{...Yt.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,mu.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 kn.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??Yt.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??200)),maxRequestsPerCall:Math.min(1e4,Math.max(1,e.maxRequestsPerCall??500))}}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return kn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return kn.join(this.getRootPath(),Oa.collections)}getEnvironmentsPath(){return kn.join(this.getRootPath(),Oa.environments)}getFlowsPath(){return kn.join(this.getRootPath(),Oa.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return kn.join(this.getRootPath(),Oa.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 Wr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Yt,null,2);await Wr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Wr.existsSync(i)||await Wr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Wr.existsSync(i)||await Wr.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await Wr.promises.writeFile(kn.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await Wr.promises.writeFile(kn.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 Wr.promises.writeFile(kn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}}});var Sz,Vf,p0=se(()=>{"use strict";ia();Sz="httpForge.cookies",Vf=class{constructor(e,r=Sz){this.store=e;this.storeKey=r;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((r,n)=>{e[n]=r}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),o=this.cookies.get(s);if(o&&!this.isExpired(o))return o}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(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}async set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e),await this.saveCookies()}async setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}await this.saveCookies()}has(e,r){return this.get(e,r)!==void 0}async delete(e,r,n){let i=this.getCookieKey(e,r,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return ht.formatCookieHeader(r)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,r){return ht.parseCookieHeaders(e,r)}isExpired(e){return ht.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r);e.length>0&&this.saveCookies()}domainMatches(e,r){return ht.domainMatches(e,r)}get count(){return this.cookies.size}}});var Wf,h0=se(()=>{"use strict";ia();Wf=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}cookieService;localCache=[];pendingOperations=[];get(e,r){return r?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===r||r.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,r){return this.get(e,r)!==void 0}set(e){let r=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));r>=0?this.localCache[r]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,r,n){let i=this.localCache.findIndex(s=>s.name===e&&(!r||s.domain===r||s.domain&&r.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:r,path:n}),!0}getAll(e){return e?this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,r){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(r,n);i.length>0&&(i.forEach(s=>{let o=this.localCache.findIndex(l=>l.name===s.name&&l.domain===(s.domain||n));o>=0?this.localCache[o]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let r=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(ht.isExpired(s)||s.domain&&!ht.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return ht.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 Em(t){try{let e=JSON.parse(typeof t=="string"?t:t.toString("utf-8"));if(!e)return null;let r=e.environment||e,n=r.name||e.name||"imported-environment",i=r.values||r.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let l of i){if(!l)continue;let f=l.key??l.name,c=typeof l.enabled=="boolean"?l.enabled:!0;f&&c!==!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 o=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:o}}catch{return null}}async function wz(t,e){try{let r=await e.readFile(t);return Em(r)}catch{return null}}var m0=se(()=>{"use strict"});import*as Kt from"fs";import*as fn from"path";var zf,Jf,g0=se(()=>{"use strict";Cn();m0();xm();qh();Qc();zf={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Jf=class{constructor(e,r,n,i,s,o=!0){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;this.secretStore=s;this.persistOverrides=o;let l=n.getEnvironmentsPath();this.environmentsPath=l,this.sharedConfigPath=fn.join(l,"_global.json"),this.localConfigPath=fn.join(l,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r?.get(zf.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.persistOverrides&&this.loadPersistedEnvironmentOverrides(),this.loadSecretVariables(this.selectedEnvironment).catch(()=>{}),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;secretStore;persistOverrides;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;secretValuesCache=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Kt.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(!Kt.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(zf.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let r=this.getEnvOverridesStateKey(e),n=this.workspaceStore?.get(r,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}await this.loadSecretVariables(e)}getEnvOverridesStateKey(e){return`${zf.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),r=this.workspaceStore?.get(e,{});r&&Object.keys(r).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...r})}persistEnvironmentOverrides(e){if(!this.persistOverrides)return;let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore?.update(r,n)}setEnvironmentVariable(e,r,n){let i=n??this.selectedEnvironment;this.localEnvironmentValues.has(i)||this.localEnvironmentValues.set(i,{}),this.localEnvironmentValues.get(i)[e]=String(r),this.persistEnvironmentOverrides(i)}deleteEnvironmentVariable(e,r){let n=r??this.selectedEnvironment,i=this.localEnvironmentValues.get(n);i&&(delete i[e],this.persistEnvironmentOverrides(n))}clearEnvironmentVariables(e){let r=e??this.selectedEnvironment;this.localEnvironmentValues.set(r,{}),this.persistEnvironmentOverrides(r)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore?.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}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 r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],o=i?.credentials?.[r],l=i?.variables||{},f=o?.variables||{},c=o&&o.headers||{},p=Hc(n.defaultHeaders||{},c),h=this.localEnvironmentValues.get(r)||{},g=this.secretValuesCache.get(r)||{},v={...s.variables||{},...f,...h,...g};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:p,variables:v}}async getSecretVariable(e,r){return this.secretStore?.get(`${e}:${r}`)}async setSecretVariable(e,r,n){await this.secretStore?.store(`${e}:${r}`,n),this.secretValuesCache.has(e)||this.secretValuesCache.set(e,{}),this.secretValuesCache.get(e)[r]=n}async deleteSecretVariable(e,r){await this.secretStore?.delete(`${e}:${r}`),this.secretValuesCache.get(e)&&delete this.secretValuesCache.get(e)[r]}async loadSecretVariables(e){if(!this.secretStore)return;let r=e||this.selectedEnvironment,n=this.getSharedConfig()?.environments?.[r]?.secretVariables??[];if(n.length===0)return;let i={};await Promise.all(n.map(async s=>{let o=await this.secretStore.get(`${r}:${s}`);o!==void 0&&(i[s]=o)})),this.secretValuesCache.set(r,i)}resolveVariables(e,r){return this.createResolver(r).resolveString(e,!0)}exportEnvironmentsToFolder(e,r=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!r&&Object.keys(s).length){let o=fn.join(e,"globals.env");pu(o,s)}n.forEach(o=>{let l=i?.environments?.[o];if(!l)return;let f={...l.variables||{}};r&&(f={...s,...f});let c=fn.join(e,`${At(o)}.env`);pu(c,f)})}resolveVariablesWithExtra(e,r,n){return this.createResolver(n,r).resolveString(e,!0)}resolveVariablesInObject(e,r){return this.createResolver(r).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,r,n){return this.createResolver(n,r).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return fn.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Kt.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let r={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,r);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),o={variables:i.variables||{}};this.saveJsonFile(s,o)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Kt.readFileSync(e,"utf-8"),n=Em(r);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(r){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",r),r}}saveEnvLocalConfig(e,r){let n=this.getEnvLocalConfigPath(e),i={variables:r};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:r}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return fn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=Jc(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,r){let s={...this.getResolvedEnvironment(e)?.variables||{},...r||{}},o=this.getGlobalVariables();return new ua({globals:o,collectionVariables:{},environmentVariables:s,variables:{}})}saveFolderSharedConfig(e){Kt.existsSync(this.environmentsPath)||Kt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Kt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!Oh(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let o=fn.basename(s,".json");if(!i.has(o))try{Kt.unlinkSync(fn.join(this.environmentsPath,s))}catch{}}for(let[s,o]of Object.entries(e.environments||{})){let l={name:s,description:o.description,requiresConfirmation:o.requiresConfirmation,variables:o.variables||{}};this.saveJsonFile(fn.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,r])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:r.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 r=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=r.length>0?r[0]:"dev",await this.workspaceStore?.update(zf.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(r);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[r]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[r].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),r!==e&&(this.validateEnvironmentNameNotTaken(r),this.sharedConfig.environments[r]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=r,await this.workspaceStore?.update(zf.SELECTED_ENVIRONMENT,r)),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,r){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=r,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Kt.existsSync(e))return null;let r=Kt.readFileSync(e,"utf-8");return JSON.parse(r)}catch(r){return console.error(`Failed to load JSON from ${e}:`,r),null}}saveJsonFile(e,r){try{let n=fn.dirname(e);Kt.existsSync(n)||Kt.mkdirSync(n,{recursive:!0}),Kt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var no,Im=se(()=>{"use strict";$f();no=class t{constructor(e,r,n,i,s,o,l,f,c,p,h,g,v){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=o;this.collectionScripts=l;this.folderScriptsChain=f;this.onConsoleOutput=c;this.collectionName=p;this.collectionAuth=h;this.iteration=g;this.iterationCount=v}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;collectionAuth;iteration;iterationCount;async execute(e,r,n){let i=Date.now();return this.executeWithSession(e,r,n,i)}async executeWithSession(e,r,n,i){let s=this.collectPreRequestScripts(e),o=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(),c={request:e,variables:{...r},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(g,v,_)=>{g==="set"&&v&&_!==void 0?this.envConfigService.setEnvironmentVariable(v,_,this.environment):g==="unset"&&v?this.envConfigService.deleteEnvironmentVariable(v,this.environment):g==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(g,v,_)=>{g==="set"&&v&&_!==void 0?this.envConfigService.setGlobalVariable(v,_):g==="unset"&&v?this.envConfigService.deleteGlobalVariable(v):g==="clear"&&this.envConfigService.clearGlobalVariables()}},p=this.scriptExecutor.createRequestSession(c),h=null;try{let g={...r},v={...e},_;if((!v.auth||v.auth.type==="inherit")&&(v.auth=this.collectionAuth&&this.collectionAuth.type!=="inherit"?this.collectionAuth:void 0),s.length>0){let F=await p.executePreRequest(s);if(F.consoleOutput&&F.consoleOutput.length>0&&this.onConsoleOutput?.(F.consoleOutput,{requestName:e.name||"",phase:"pre-request"}),F.nextRequest!==void 0&&(_=F.nextRequest),F.skipRequest){let K={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:K,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:g,nextRequest:_}}F.success&&(F.modifiedRequest&&(F.modifiedRequest.url&&(v.url=F.modifiedRequest.url),F.modifiedRequest.headers&&(v.headers=F.modifiedRequest.headers),F.modifiedRequest.params&&(v.params=F.modifiedRequest.params),F.modifiedRequest.query&&(v.query=F.modifiedRequest.query),F.modifiedRequest.body!==void 0&&(v.body=F.modifiedRequest.body)),(F.localVariables??F.modifiedVariables)&&(g=F.localVariables??F.modifiedVariables))}h=await this.requestPreparer.prepareRequest(v,this.environment,l,g);let{url:w,headers:E,body:k,method:T}=h,N={};for(let F in E)Object.prototype.hasOwnProperty.call(E,F)&&(N[F.toUpperCase()]=E[F]);if(!N.COOKIE&&v.settings?.includeCookies!==!1&&this.cookieJar){let K=this.cookieJar.getCookieHeader(w);K&&(N.COOKIE=K)}let $={method:T,url:w,headers:N,body:k.content,signal:n,settings:v.settings?{timeout:v.settings.timeout,followRedirects:v.settings.followRedirects,maxRedirects:v.settings.maxRedirects,strictSSL:v.settings.strictSSL}:void 0},j=await this.httpService.execute($);this.cookieJar&&j.headers&&await this.cookieJar.setCookiesFromResponse(w,j.headers);let G=Date.now()-i,q=[],C={},A;if(o.length>0){let F=0;if(j.body)if(typeof j.body=="string")F=Buffer.byteLength(j.body,"utf8");else if(Buffer.isBuffer(j.body))F=j.body.length;else try{F=Buffer.byteLength(JSON.stringify(j.body),"utf8")}catch{F=0}let K=wm(j.headers,j.cookies,h.url),ee={executedRequest:h,status:j.status,statusText:j.statusText,headers:Xw(j.headers||{}),body:j.body,cookies:K,responseTime:j.time,responseSize:F},ie=await p.executePostResponse(o,ee);q=ie.testResults,C=ie.modifiedEnvironmentVariables||{},A=ie.visualizerData,ie.nextRequest!==void 0&&(_=ie.nextRequest),ie.consoleOutput&&ie.consoleOutput.length>0&&this.onConsoleOutput?.(ie.consoleOutput,{requestName:e.name||"",phase:"post-response"})}let D=q.length===0||q.every(F=>F.passed),B=q.length>0?D:j.status>=200&&j.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...h,headers:N},response:{status:j.status,statusText:j.statusText,headers:j.headers||{},body:j.body,time:j.time||G,cookies:j.cookies||[]},duration:G,timestamp:Date.now(),passed:B,assertions:q,modifiedVariables:g,modifiedEnvironmentVariables:C,nextRequest:_,visualizerData:A}}catch(g){return this.handleError(e,h,g,i)}finally{p.dispose?.()}}collectPreRequestScripts(e){let r=[];if(this.collectionScripts?.preRequest&&r.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&r.push(n.preRequest);else this.folderScriptsChain.preRequest&&r.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&r.push(e.scripts.preRequest),r}collectPostResponseScripts(e){let r=[];if(e.scripts?.postResponse&&r.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&r.push(i.postResponse)}else this.folderScriptsChain.postResponse&&r.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&r.push(this.collectionScripts.postResponse),r}handleError(e,r,n,i){let s=Date.now()-i,o=r?.method||e.method,l=r?.url||e.url;this.onConsoleOutput?.([`${n.message||n}`],{requestName:e.name||"",phase:"error"});let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),c=n?.stack?String(n.stack):"",p=this.errorBodyFormat,h,g;p==="html"||p==="both"?(h=t.formatErrorAsHtml(f,c),g={"content-type":"text/html; charset=utf-8"}):(h=f,g={});let v={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:o||"GET",headers:r?.headers||{},body:r?.body||v,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:g,cookies:[],body:h,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");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>
@@ -89,11 +89,11 @@ fragment TypeRef on __Type {
89
89
  }
90
90
  `.trim(),Yf=class{constructor(e){this.httpClient=e}httpClient;schemaCache=new Map;async fetchSchema(e,r){let n={method:"POST",url:e,headers:{"Content-Type":"application/json",Accept:"application/json",...r||{}},body:JSON.stringify({query:_z,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 o=this.parseSchema(s.data.__schema,e);return this.schemaCache.set(e,o),o}getCachedSchema(e){return this.schemaCache.get(e)}extractOperations(e){let r=[],n=e.split(`
91
91
  `),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let o=n[s].match(i);o&&r.push({type:o[1],name:o[2],line:s+1})}return r.length===0&&e.trim().startsWith("{")&&r.push({type:"query",name:"(anonymous)",line:1}),r}clearCache(e){e?this.schemaCache.delete(e):this.schemaCache.clear()}schemaToSerializable(e){let r={};for(let[n,i]of e.types)r[n]=i;return{queryType:e.queryType,mutationType:e.mutationType,subscriptionType:e.subscriptionType,types:r,directives:e.directives,fetchedAt:e.fetchedAt,endpointUrl:e.endpointUrl}}parseSchema(e,r){let n=new Map;for(let s of e.types||[]){if(s.name.startsWith("__"))continue;let o={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(o.name,o)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(o=>this.parseArg(o))}));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:r}}parseField(e){return{name:e.name,type:this.renderTypeRef(e.type),args:(e.args||[]).map(r=>this.parseArg(r)),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 ki(t){let e={};for(let[r,n]of Object.entries(t))b0.test(r)?e[r]=Array.isArray(n)?n.map(()=>io):io:e[r]=n;return e}function S0(t=[]){return t.map(e=>e&&typeof e=="object"&&e.name&&dn.test(e.name)?{...e,value:io}:e)}function km(t){try{let e=new URL(t),r=!1;for(let[n]of e.searchParams)dn.test(n)&&(e.searchParams.set(n,io),r=!0);return r?e.toString():t}catch{return t}}function Kf(t){if(t==null)return t;if(Array.isArray(t))return t.map(r=>Kf(r));if(typeof t!="object")return t;let e={};for(let[r,n]of Object.entries(t)){let i=dn.test(r);n===null||typeof n!="object"?e[r]=i?io:n:i&&Array.isArray(n)?e[r]=n.map(s=>s===null||typeof s!="object"?io:Kf(s)):e[r]=Kf(n)}return e}function Rz(t){try{let e=new URLSearchParams(t),r=!1;for(let[n]of e)dn.test(n)&&(e.set(n,io),r=!0);return r?e.toString():t}catch{return t}}function w0(t){if(t==null)return t;if(typeof t=="object"&&!Buffer.isBuffer(t))return Kf(t);if(typeof t=="string"){let e=t.trim();if(e.startsWith("{")||e.startsWith("["))try{let r=JSON.parse(e),n=Kf(r);return JSON.stringify(n)}catch{}if(e.includes("=")&&!e.includes(`
92
- `))return Rz(e)}return t}function _0(t){return{...t,sentRequest:{...t.sentRequest,url:km(t.sentRequest.url),headers:ki(t.sentRequest.headers),body:t.sentRequest.body!=null?w0(t.sentRequest.body):t.sentRequest.body}}}function R0(t){return{...t,headers:ki(t.headers),cookies:t.cookies.map(e=>e&&typeof e=="object"&&e.name&&dn.test(e.name)?{...e,value:io}:e)}}function C0(t){return{...t,url:km(t.url),request:{...t.request,url:km(t.request.url),headers:ki(t.request.headers),query:ki(t.request.query),params:ki(t.request.params),body:t.request.body!=null?w0(t.request.body):t.request.body},response:{headers:ki(t.response.headers),body:t.response.body,time:t.response.time,size:t.response.size,cookies:t.response.cookies?S0(t.response.cookies):t.response.cookies}}}function gr(t){return typeof t=="string"&&Cz.test(t)}function xz(t){let e=[];if(t.url)try{let r=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[n,i]of r.searchParams)dn.test(n)&&i&&!gr(i)&&e.push({location:"url",field:n,message:`URL query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}if(t.headers){let r=Array.isArray(t.headers)?t.headers.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.headers);for(let[n,i]of r)b0.test(n)&&i&&!gr(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(t.query){let r=Array.isArray(t.query)?t.query.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.query);for(let[n,i]of r)dn.test(n)&&i&&!gr(i)&&e.push({location:"query",field:n,message:`Query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}if(t.auth){let r=t.auth;if(r.bearerToken&&!gr(r.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."}),r.basicAuth&&r.basicAuth.password&&!gr(r.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",message:"Basic auth password contains a hardcoded value. Use a {{variable}} instead."}),r.apikey||r.apiKey){let n=r.apikey||r.apiKey;n.value&&!gr(n.value)&&e.push({location:"auth",field:"apiKey.value",message:"API key contains a hardcoded value. Use a {{variable}} instead."})}}if(t.body){let r=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;r&&qm(r,e)}return e}function qm(t,e){if(t!=null){if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")||r.startsWith("[")){try{qm(JSON.parse(r),e)}catch{}return}if(r.includes("=")&&!r.includes(`
93
- `)){try{let n=new URLSearchParams(r);for(let[i,s]of n)dn.test(i)&&s&&!gr(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(t)){t.forEach(r=>qm(r,e));return}if(typeof t=="object")for(let[r,n]of Object.entries(t))dn.test(r)&&n&&typeof n=="string"&&!gr(n)?e.push({location:"body",field:r,message:`Body field "${r}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&qm(n,e)}}function Oa(t){return t.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function Ez(t){let e=[],r=new Set;function n(i){let s=i,o=2;for(;r.has(s);)s=`${i}_${o++}`;return r.add(s),s}if(t.url)try{let i=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[s,o]of i.searchParams)dn.test(s)&&o&&!gr(o)&&e.push({location:"url",field:s,value:o,variableName:n(Oa(s))})}catch{}if(t.headers){let i=Array.isArray(t.headers)?t.headers.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.headers);for(let[s,o]of i)b0.test(s)&&o&&!gr(o)&&e.push({location:"header",field:s,value:o,variableName:n(Oa(s))})}if(t.query){let i=Array.isArray(t.query)?t.query.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.query);for(let[s,o]of i)dn.test(s)&&o&&!gr(o)&&e.push({location:"query",field:s,value:o,variableName:n(Oa(s))})}if(t.auth){let i=t.auth;if(i.bearerToken&&!gr(i.bearerToken)&&e.push({location:"auth",field:"bearerToken",value:i.bearerToken,variableName:n("bearer_token")}),i.basicAuth&&i.basicAuth.password&&!gr(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&&!gr(s.value)&&e.push({location:"auth",field:"apiKey.value",value:s.value,variableName:n("api_key")})}}if(t.body){let i=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;i&&Om(i,e,r,"")}return e}function Om(t,e,r,n){if(t!=null){if(typeof t=="string"){let i=t.trim();if(i.startsWith("{")||i.startsWith("[")){try{Om(JSON.parse(i),e,r,n)}catch{}return}if(i.includes("=")&&!i.includes(`
94
- `)){try{let s=new URLSearchParams(i);for(let[o,l]of s)if(dn.test(o)&&l&&!gr(l)){let f=Oa(o),c=2;for(;r.has(f);)f=`${Oa(o)}_${c++}`;r.add(f),e.push({location:"body",field:o,path:n?`${n}.${o}`:o,value:l,variableName:f})}}catch{}return}return}if(Array.isArray(t)){t.forEach((i,s)=>Om(i,e,r,`${n}[${s}]`));return}if(typeof t=="object")for(let[i,s]of Object.entries(t)){let o=n?`${n}.${i}`:i;if(dn.test(i)&&s&&typeof s=="string"&&!gr(s)){let l=Oa(i),f=2;for(;r.has(l);)l=`${Oa(i)}_${f++}`;r.add(l),e.push({location:"body",field:i,path:o,value:s,variableName:l})}else typeof s=="object"&&s!==null&&Om(s,e,r,o)}}}function Iz(t,e){let r=JSON.parse(JSON.stringify(t));for(let n of e){let i=`{{${n.variableName}}}`;switch(n.location){case"url":r.url&&(r.url=r.url.replace(new RegExp(`([?&])${Oz(n.field)}=[^&]*`),`$1${n.field}=${i}`));break;case"header":if(Array.isArray(r.headers)){let s=r.headers.find(o=>o.key===n.field&&o.value===n.value);s&&(s.value=i)}else r.headers&&r.headers[n.field]===n.value&&(r.headers[n.field]=i);break;case"query":if(Array.isArray(r.query)){let s=r.query.find(o=>o.key===n.field&&o.value===n.value);s&&(s.value=i)}else r.query&&r.query[n.field]===n.value&&(r.query[n.field]=i);break;case"auth":if(r.auth){if(n.field==="bearerToken")r.auth.bearerToken=i;else if(n.field==="basicAuth.password"&&r.auth.basicAuth)r.auth.basicAuth.password=i;else if(n.field==="apiKey.value"){let s=r.auth.apikey||r.auth.apiKey;s&&(s.value=i)}}break;case"body":qz(r,n.field,n.path,n.value,i);break}}return r}function qz(t,e,r,n,i){let s=typeof t.body=="object"&&t.body!==null&&"content"in t.body?t.body:null,o=s?s.content:t.body;if(o){if(typeof o=="string"){let l=o.trim();if(l.startsWith("{")||l.startsWith("[")){try{let f=JSON.parse(l);lk(f,e,r||e,n,i);let c=JSON.stringify(f,null,2);s?s.content=c:t.body=c}catch{}return}if(l.includes("=")&&!l.includes(`
95
- `)){let f=new URLSearchParams(l);if(f.get(e)===n){f.set(e,i);let c=f.toString();s?s.content=c:t.body=c}return}return}typeof o=="object"&&o!==null&&lk(o,e,r||e,n,i)}}function lk(t,e,r,n,i){let s=r.split("."),o=t;for(let f=0;f<s.length-1;f++){let c=s[f],p=c.match(/^(.+)\[(\d+)\]$/);if(p?o=o?.[p[1]]?.[parseInt(p[2])]:o=o?.[c],o==null)return}let l=s[s.length-1];o&&o[l]===n&&(o[l]=i)}function Oz(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var io,b0,dn,Cz,Qf=se(()=>{"use strict";io="***",b0=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,dn=/(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;Cz=/\{\{[^}]+\}\}/});import*as Ae from"fs";import*as zr from"path";var Zf,x0=se(()=>{"use strict";Cn();Qf();Zf=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return zr.join(this.historyPath,At(e))}getCollectionHistoryPath(e,r){return zr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return zr.join(this.getCollectionHistoryPath(e,r),At(n))}getSharedEnvironmentHistoryPath(e){return zr.join(this.sharedHistoryPath,At(e))}getSharedCollectionHistoryPath(e,r){return zr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return zr.join(this.getSharedCollectionHistoryPath(e,r),At(n))}getHistoryFilePath(e,r,n){return zr.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return zr.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return zr.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return zr.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!Ae.existsSync(i))return null;let s=Ae.readFileSync(i,"utf-8"),o=JSON.parse(s);return{environment:e||o.environment,requestPath:r||o.requestPath,requestId:n||o.requestId,method:o.method,requests:o.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,r,n){let i=this.getSharedHistoryFilePath(e,r,n);try{if(!Ae.existsSync(i))return null;let s=Ae.readFileSync(i,"utf-8"),o=JSON.parse(s);return{environment:e||o.environment,requestPath:r||o.requestPath,requestId:n||o.requestId,method:o.method,requests:o.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,r,n){let i=this.loadHistory(e,r,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,r,n){let i=this.getEntriesForEnvironment(e,r,n),s=new Map;for(let o of i){let l=o.ticket||o.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(o)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let o of i){let l=o.ticket||o.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(o)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Ae.existsSync(r)||Ae.mkdirSync(r,{recursive:!0}),Ae.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 r=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Ae.existsSync(r)||Ae.mkdirSync(r,{recursive:!0}),Ae.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,r,n,i,s){let o=this.loadHistory(e,r,n);o||(o={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let l=_0({...s,method:i,id:Yb(),timestamp:Date.now()});return o.requests.unshift(l),o.requests.length>100&&(o.requests=o.requests.slice(0,100)),this.saveHistory(o),l}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let o=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==o){this.saveHistory(s);let l=this.getResponseFilePath(e,r,n,i);return Ae.existsSync(l)&&Ae.unlinkSync(l),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let o=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==o){this.saveSharedHistory(s);let l=this.getSharedResponseFilePath(e,r,n,i);return Ae.existsSync(l)&&Ae.unlinkSync(l),!0}return!1}shareEntry(e,r,n,i,s){let o=(s||"").trim();if(!o)return!1;let l=this.loadHistory(e,r,n);if(!l)return!1;let f=l.requests.findIndex(v=>v.id===i);if(f===-1)return!1;let[c]=l.requests.splice(f,1);this.saveHistory(l);let p=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:l.method,requests:[]};if(!p.requests.some(v=>v.id===i)){let v={...c,ticket:null,branch:o};p.requests.unshift(v),p.requests.length>100&&(p.requests=p.requests.slice(0,100)),this.saveSharedHistory(p)}let h=this.getResponseFilePath(e,r,n,i),g=this.getSharedResponseFilePath(e,r,n,i);if(Ae.existsSync(h)){let v=zr.dirname(g);Ae.existsSync(v)||Ae.mkdirSync(v,{recursive:!0});try{Ae.renameSync(h,g)}catch{try{Ae.copyFileSync(h,g)}catch(w){return console.error(`Failed to copy full response from ${h} to ${g}:`,w),!0}try{Ae.unlinkSync(h)}catch(w){console.warn(`Failed to remove original full response after copy: ${h}`,w)}}}return!0}moveSharedEntry(e,r,n,i,s){let o=(s||"").trim();if(!o)return!1;let l=this.loadSharedHistory(e,r,n);if(!l)return!1;let f=!1;return l.requests=l.requests.map(c=>c.id===i?(f=!0,{...c,ticket:null,branch:o}):c),f?(this.saveSharedHistory(l),!0):!1}renameSharedGroup(e,r,n,i,s){let o=(i||"").trim(),l=(s||"").trim();if(!o||!l||o===l)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let c=!1;return f.requests=f.requests.map(p=>!p.ticket&&p.branch===o?(c=!0,{...p,branch:l}):p),c?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(Ae.existsSync(i)){let s=Ae.readdirSync(i);for(let o of s)Ae.unlinkSync(zr.join(i,o));Ae.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let o=this.getRequestPath(e,r,n),l=this.getResponseFilePath(e,r,n,i);try{Ae.existsSync(o)||Ae.mkdirSync(o,{recursive:!0});let f=R0(s);Ae.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,r,n,i){let s=this.getResponseFilePath(e,r,n,i);try{if(!Ae.existsSync(s))return null;let o=Ae.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load full response for ${i}:`,o),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!Ae.existsSync(s))return null;let o=Ae.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load shared full response for ${i}:`,o),null}}}});var yu,E0=se(()=>{"use strict";yu=class{constructor(e,r){this.historyService=e;this.inferrer=r}historyService;inferrer;async analyze(e,r,n){let i=n?.environment||"default",s=n?.maxSamples||50,o=this.historyService.loadHistory(i,e,r),l=this.historyService.loadSharedHistory(i,e,r),f=[...o?.requests||[],...l?.requests||[]];if(f.length===0)return{responses:{}};let c=f.slice(0,s),p=new Map;for(let g of c){let v=this.historyService.loadFullResponse(i,e,r,g.id);if(v||(v=this.historyService.loadSharedFullResponse(i,e,r,g.id)),v){let _=v.status;p.has(_)||p.set(_,[]),p.get(_).push(v)}}let h={};for(let[g,v]of p){let _=this.buildResponseDefinition(v);h[String(g)]=_}return{responses:h}}buildResponseDefinition(e){let r={};if(e.length===0)return r;let n=e[0];r.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(r.contentType=i),i&&this.isJsonContentType(i)){let o=this.inferBodySchema(n);for(let l=1;l<e.length;l++){let f=this.inferBodySchema(e[l]);f&&o?o=this.inferrer.mergeSchemas(o,f):f&&(o=f)}if(o&&(r.schema=o),n.body!==void 0&&n.body!==null){let l=typeof n.body=="string"?this.tryParseJson(n.body):n.body;l!==void 0&&(r.examples={default:{summary:"Captured from history",value:l}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(r.headers=s),r}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let r=e.body;if(!(typeof r=="string"&&(r=this.tryParseJson(r),r===void 0)))return this.inferrer.inferFromValue(r)}extractContentType(e){for(let[r,n]of Object.entries(e))if(r.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 r=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,c]of Object.entries(l.headers)){let p=f.toLowerCase();r.has(p)||(n.set(p,(n.get(p)||0)+1),i.has(p)||i.set(p,Array.isArray(c)?c.join(", "):c))}let s=Math.ceil(e.length/2),o={};for(let[l,f]of n)if(f>=s){let c=i.get(l);o[l]={schema:this.inferHeaderSchema(c)}}return o}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}}});var Ze=H(lr=>{"use strict";var I0=Symbol.for("yaml.alias"),uk=Symbol.for("yaml.document"),Pm=Symbol.for("yaml.map"),ck=Symbol.for("yaml.pair"),q0=Symbol.for("yaml.scalar"),Tm=Symbol.for("yaml.seq"),fs=Symbol.for("yaml.node.type"),kz=t=>!!t&&typeof t=="object"&&t[fs]===I0,Pz=t=>!!t&&typeof t=="object"&&t[fs]===uk,Tz=t=>!!t&&typeof t=="object"&&t[fs]===Pm,Az=t=>!!t&&typeof t=="object"&&t[fs]===ck,fk=t=>!!t&&typeof t=="object"&&t[fs]===q0,$z=t=>!!t&&typeof t=="object"&&t[fs]===Tm;function dk(t){if(t&&typeof t=="object")switch(t[fs]){case Pm:case Tm:return!0}return!1}function Nz(t){if(t&&typeof t=="object")switch(t[fs]){case I0:case Pm:case q0:case Tm:return!0}return!1}var Mz=t=>(fk(t)||dk(t))&&!!t.anchor;lr.ALIAS=I0;lr.DOC=uk;lr.MAP=Pm;lr.NODE_TYPE=fs;lr.PAIR=ck;lr.SCALAR=q0;lr.SEQ=Tm;lr.hasAnchor=Mz;lr.isAlias=kz;lr.isCollection=dk;lr.isDocument=Pz;lr.isMap=Tz;lr.isNode=Nz;lr.isPair=Az;lr.isScalar=fk;lr.isSeq=$z});var Xf=H(O0=>{"use strict";var Qt=Ze(),Jr=Symbol("break visit"),pk=Symbol("skip children"),Pi=Symbol("remove node");function Am(t,e){let r=hk(e);Qt.isDocument(t)?vu(null,t.contents,r,Object.freeze([t]))===Pi&&(t.contents=null):vu(null,t,r,Object.freeze([]))}Am.BREAK=Jr;Am.SKIP=pk;Am.REMOVE=Pi;function vu(t,e,r,n){let i=mk(t,e,r,n);if(Qt.isNode(i)||Qt.isPair(i))return gk(t,n,i),vu(t,i,r,n);if(typeof i!="symbol"){if(Qt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=vu(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Jr)return Jr;o===Pi&&(e.items.splice(s,1),s-=1)}}}else if(Qt.isPair(e)){n=Object.freeze(n.concat(e));let s=vu("key",e.key,r,n);if(s===Jr)return Jr;s===Pi&&(e.key=null);let o=vu("value",e.value,r,n);if(o===Jr)return Jr;o===Pi&&(e.value=null)}}return i}async function $m(t,e){let r=hk(e);Qt.isDocument(t)?await bu(null,t.contents,r,Object.freeze([t]))===Pi&&(t.contents=null):await bu(null,t,r,Object.freeze([]))}$m.BREAK=Jr;$m.SKIP=pk;$m.REMOVE=Pi;async function bu(t,e,r,n){let i=await mk(t,e,r,n);if(Qt.isNode(i)||Qt.isPair(i))return gk(t,n,i),bu(t,i,r,n);if(typeof i!="symbol"){if(Qt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=await bu(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Jr)return Jr;o===Pi&&(e.items.splice(s,1),s-=1)}}}else if(Qt.isPair(e)){n=Object.freeze(n.concat(e));let s=await bu("key",e.key,r,n);if(s===Jr)return Jr;s===Pi&&(e.key=null);let o=await bu("value",e.value,r,n);if(o===Jr)return Jr;o===Pi&&(e.value=null)}}return i}function hk(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function mk(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Qt.isMap(e))return r.Map?.(t,e,n);if(Qt.isSeq(e))return r.Seq?.(t,e,n);if(Qt.isPair(e))return r.Pair?.(t,e,n);if(Qt.isScalar(e))return r.Scalar?.(t,e,n);if(Qt.isAlias(e))return r.Alias?.(t,e,n)}function gk(t,e,r){let n=e[e.length-1];if(Qt.isCollection(n))n.items[t]=r;else if(Qt.isPair(n))t==="key"?n.key=r:n.value=r;else if(Qt.isDocument(n))n.contents=r;else{let i=Qt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}O0.visit=Am;O0.visitAsync=$m});var k0=H(vk=>{"use strict";var yk=Ze(),Fz=Xf(),Dz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Lz=t=>t.replace(/[!,[\]{}]/g,e=>Dz[e]),ed=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,o]=n;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(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 o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(o){return r(String(o)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+Lz(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&yk.isNode(e.contents)){let s={};Fz.visit(e.contents,(o,l)=>{yk.isNode(l)&&l.tag&&(s[l.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of n)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
96
- `)}};ed.defaultYaml={explicit:!1,version:"1.2"};ed.defaultTags={"!!":"tag:yaml.org,2002:"};vk.Directives=ed});var Nm=H(td=>{"use strict";var bk=Ze(),jz=Xf();function Uz(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function Sk(t){let e=new Set;return jz.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function wk(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function Hz(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=Sk(t));let o=wk(e,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o=="object"&&o.anchor&&(bk.isScalar(o.node)||bk.isCollection(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:n}}td.anchorIsValid=Uz;td.anchorNames=Sk;td.createNodeAnchors=Hz;td.findNewAnchor=wk});var P0=H(_k=>{"use strict";function rd(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let o=n[i],l=rd(t,n,String(i),o);l===void 0?delete n[i]:l!==o&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),o=rd(t,n,i,s);o===void 0?n.delete(i):o!==s&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let s=rd(t,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 o=rd(t,n,i,s);o===void 0?delete n[i]:o!==s&&(n[i]=o)}return t.call(e,r,n)}_k.applyReviver=rd});var so=H(Ck=>{"use strict";var Bz=Ze();function Rk(t,e,r){if(Array.isArray(t))return t.map((n,i)=>Rk(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!Bz.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}Ck.toJS=Rk});var Mm=H(Ek=>{"use strict";var Vz=P0(),xk=Ze(),Wz=so(),T0=class{constructor(e){Object.defineProperty(this,xk.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:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!xk.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=Wz.toJS(this,"",o);if(typeof i=="function")for(let{count:f,res:c}of o.anchors.values())i(c,f);return typeof s=="function"?Vz.applyReviver(s,{"":l},"",l):l}};Ek.NodeBase=T0});var nd=H(Ik=>{"use strict";var zz=Nm(),Jz=Xf(),Su=Ze(),Gz=Mm(),Yz=so(),A0=class extends Gz.NodeBase{constructor(e){super(Su.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Jz.visit(e,{Node:(s,o)=>{(Su.isAlias(o)||Su.hasAnchor(o))&&n.push(o)}}),r&&(r.aliasResolveCache=n));let i;for(let s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,o=this.resolve(i,r);if(!o){let f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let l=n.get(o);if(l||(Yz.toJS(o,null,r),l=n.get(o)),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=Fm(i,o,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,r,n){let i=`*${this.source}`;if(e){if(zz.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 Fm(t,e,r){if(Su.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.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=Fm(t,i,r);s>n&&(n=s)}return n}else if(Su.isPair(e)){let n=Fm(t,e.key,r),i=Fm(t,e.value,r);return Math.max(n,i)}return 1}Ik.Alias=A0});var Bt=H($0=>{"use strict";var Kz=Ze(),Qz=Mm(),Zz=so(),Xz=t=>!t||typeof t!="function"&&typeof t!="object",oo=class extends Qz.NodeBase{constructor(e){super(Kz.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Zz.toJS(this.value,e,r)}toString(){return String(this.value)}};oo.BLOCK_FOLDED="BLOCK_FOLDED";oo.BLOCK_LITERAL="BLOCK_LITERAL";oo.PLAIN="PLAIN";oo.QUOTE_DOUBLE="QUOTE_DOUBLE";oo.QUOTE_SINGLE="QUOTE_SINGLE";$0.Scalar=oo;$0.isScalarValue=Xz});var id=H(Ok=>{"use strict";var eJ=nd(),ka=Ze(),qk=Bt(),tJ="tag:yaml.org,2002:";function rJ(t,e,r){if(e){let n=r.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 r.find(n=>n.identify?.(t)&&!n.format)}function nJ(t,e,r){if(ka.isDocument(t)&&(t=t.contents),ka.isNode(t))return t;if(ka.isPair(t)){let h=r.schema[ka.MAP].createNode?.(r.schema,null,r);return h.items.push(t),h}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:o,sourceObjects:l}=r,f;if(n&&t&&typeof t=="object"){if(f=l.get(t),f)return f.anchor??(f.anchor=i(t)),new eJ.Alias(f.anchor);f={anchor:null,node:null},l.set(t,f)}e?.startsWith("!!")&&(e=tJ+e.slice(2));let c=rJ(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new qk.Scalar(t);return f&&(f.node=h),h}c=t instanceof Map?o[ka.MAP]:Symbol.iterator in Object(t)?o[ka.SEQ]:o[ka.MAP]}s&&(s(c),delete r.onTagObj);let p=c?.createNode?c.createNode(r.schema,t,r):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(r.schema,t,r):new qk.Scalar(t);return e?p.tag=e:c.default||(p.tag=c.tag),f&&(f.node=p),p}Ok.createNode=nJ});var Lm=H(Dm=>{"use strict";var iJ=id(),Ti=Ze(),sJ=Mm();function N0(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=n,n=o}else n=new Map([[s,n]])}return iJ.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var kk=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,M0=class extends sJ.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Ti.isNode(n)||Ti.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(kk(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(Ti.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,N0(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Ti.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&Ti.isScalar(s)?s.value:s:Ti.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ti.isPair(r))return!1;let n=r.value;return n==null||e&&Ti.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Ti.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(Ti.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,N0(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Dm.Collection=M0;Dm.collectionFromPath=N0;Dm.isEmptyPath=kk});var sd=H(jm=>{"use strict";var oJ=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function F0(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var aJ=(t,e,r)=>t.endsWith(`
92
+ `))return Rz(e)}return t}function _0(t){return{...t,sentRequest:{...t.sentRequest,url:km(t.sentRequest.url),headers:ki(t.sentRequest.headers),body:t.sentRequest.body!=null?w0(t.sentRequest.body):t.sentRequest.body}}}function R0(t){return{...t,headers:ki(t.headers),cookies:t.cookies.map(e=>e&&typeof e=="object"&&e.name&&dn.test(e.name)?{...e,value:io}:e)}}function C0(t){return{...t,url:km(t.url),request:{...t.request,url:km(t.request.url),headers:ki(t.request.headers),query:ki(t.request.query),params:ki(t.request.params),body:t.request.body!=null?w0(t.request.body):t.request.body},response:{headers:ki(t.response.headers),body:t.response.body,time:t.response.time,size:t.response.size,cookies:t.response.cookies?S0(t.response.cookies):t.response.cookies}}}function gr(t){return typeof t=="string"&&Cz.test(t)}function xz(t){let e=[];if(t.url)try{let r=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[n,i]of r.searchParams)dn.test(n)&&i&&!gr(i)&&e.push({location:"url",field:n,message:`URL query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}if(t.headers){let r=Array.isArray(t.headers)?t.headers.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.headers);for(let[n,i]of r)b0.test(n)&&i&&!gr(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(t.query){let r=Array.isArray(t.query)?t.query.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.query);for(let[n,i]of r)dn.test(n)&&i&&!gr(i)&&e.push({location:"query",field:n,message:`Query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}if(t.auth){let r=t.auth;if(r.bearerToken&&!gr(r.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."}),r.basicAuth&&r.basicAuth.password&&!gr(r.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",message:"Basic auth password contains a hardcoded value. Use a {{variable}} instead."}),r.apikey||r.apiKey){let n=r.apikey||r.apiKey;n.value&&!gr(n.value)&&e.push({location:"auth",field:"apiKey.value",message:"API key contains a hardcoded value. Use a {{variable}} instead."})}}if(t.body){let r=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;r&&Om(r,e)}return e}function Om(t,e){if(t!=null){if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")||r.startsWith("[")){try{Om(JSON.parse(r),e)}catch{}return}if(r.includes("=")&&!r.includes(`
93
+ `)){try{let n=new URLSearchParams(r);for(let[i,s]of n)dn.test(i)&&s&&!gr(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(t)){t.forEach(r=>Om(r,e));return}if(typeof t=="object")for(let[r,n]of Object.entries(t))dn.test(r)&&n&&typeof n=="string"&&!gr(n)?e.push({location:"body",field:r,message:`Body field "${r}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&Om(n,e)}}function qa(t){return t.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function Ez(t){let e=[],r=new Set;function n(i){let s=i,o=2;for(;r.has(s);)s=`${i}_${o++}`;return r.add(s),s}if(t.url)try{let i=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[s,o]of i.searchParams)dn.test(s)&&o&&!gr(o)&&e.push({location:"url",field:s,value:o,variableName:n(qa(s))})}catch{}if(t.headers){let i=Array.isArray(t.headers)?t.headers.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.headers);for(let[s,o]of i)b0.test(s)&&o&&!gr(o)&&e.push({location:"header",field:s,value:o,variableName:n(qa(s))})}if(t.query){let i=Array.isArray(t.query)?t.query.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.query);for(let[s,o]of i)dn.test(s)&&o&&!gr(o)&&e.push({location:"query",field:s,value:o,variableName:n(qa(s))})}if(t.auth){let i=t.auth;if(i.bearerToken&&!gr(i.bearerToken)&&e.push({location:"auth",field:"bearerToken",value:i.bearerToken,variableName:n("bearer_token")}),i.basicAuth&&i.basicAuth.password&&!gr(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&&!gr(s.value)&&e.push({location:"auth",field:"apiKey.value",value:s.value,variableName:n("api_key")})}}if(t.body){let i=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;i&&qm(i,e,r,"")}return e}function qm(t,e,r,n){if(t!=null){if(typeof t=="string"){let i=t.trim();if(i.startsWith("{")||i.startsWith("[")){try{qm(JSON.parse(i),e,r,n)}catch{}return}if(i.includes("=")&&!i.includes(`
94
+ `)){try{let s=new URLSearchParams(i);for(let[o,l]of s)if(dn.test(o)&&l&&!gr(l)){let f=qa(o),c=2;for(;r.has(f);)f=`${qa(o)}_${c++}`;r.add(f),e.push({location:"body",field:o,path:n?`${n}.${o}`:o,value:l,variableName:f})}}catch{}return}return}if(Array.isArray(t)){t.forEach((i,s)=>qm(i,e,r,`${n}[${s}]`));return}if(typeof t=="object")for(let[i,s]of Object.entries(t)){let o=n?`${n}.${i}`:i;if(dn.test(i)&&s&&typeof s=="string"&&!gr(s)){let l=qa(i),f=2;for(;r.has(l);)l=`${qa(i)}_${f++}`;r.add(l),e.push({location:"body",field:i,path:o,value:s,variableName:l})}else typeof s=="object"&&s!==null&&qm(s,e,r,o)}}}function Iz(t,e){let r=JSON.parse(JSON.stringify(t));for(let n of e){let i=`{{${n.variableName}}}`;switch(n.location){case"url":r.url&&(r.url=r.url.replace(new RegExp(`([?&])${qz(n.field)}=[^&]*`),`$1${n.field}=${i}`));break;case"header":if(Array.isArray(r.headers)){let s=r.headers.find(o=>o.key===n.field&&o.value===n.value);s&&(s.value=i)}else r.headers&&r.headers[n.field]===n.value&&(r.headers[n.field]=i);break;case"query":if(Array.isArray(r.query)){let s=r.query.find(o=>o.key===n.field&&o.value===n.value);s&&(s.value=i)}else r.query&&r.query[n.field]===n.value&&(r.query[n.field]=i);break;case"auth":if(r.auth){if(n.field==="bearerToken")r.auth.bearerToken=i;else if(n.field==="basicAuth.password"&&r.auth.basicAuth)r.auth.basicAuth.password=i;else if(n.field==="apiKey.value"){let s=r.auth.apikey||r.auth.apiKey;s&&(s.value=i)}}break;case"body":Oz(r,n.field,n.path,n.value,i);break}}return r}function Oz(t,e,r,n,i){let s=typeof t.body=="object"&&t.body!==null&&"content"in t.body?t.body:null,o=s?s.content:t.body;if(o){if(typeof o=="string"){let l=o.trim();if(l.startsWith("{")||l.startsWith("[")){try{let f=JSON.parse(l);lk(f,e,r||e,n,i);let c=JSON.stringify(f,null,2);s?s.content=c:t.body=c}catch{}return}if(l.includes("=")&&!l.includes(`
95
+ `)){let f=new URLSearchParams(l);if(f.get(e)===n){f.set(e,i);let c=f.toString();s?s.content=c:t.body=c}return}return}typeof o=="object"&&o!==null&&lk(o,e,r||e,n,i)}}function lk(t,e,r,n,i){let s=r.split("."),o=t;for(let f=0;f<s.length-1;f++){let c=s[f],p=c.match(/^(.+)\[(\d+)\]$/);if(p?o=o?.[p[1]]?.[parseInt(p[2])]:o=o?.[c],o==null)return}let l=s[s.length-1];o&&o[l]===n&&(o[l]=i)}function qz(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var io,b0,dn,Cz,Qf=se(()=>{"use strict";io="***",b0=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,dn=/(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;Cz=/\{\{[^}]+\}\}/});import*as Ae from"fs";import*as zr from"path";var Zf,x0=se(()=>{"use strict";Cn();Qf();Zf=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return zr.join(this.historyPath,At(e))}getCollectionHistoryPath(e,r){return zr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return zr.join(this.getCollectionHistoryPath(e,r),At(n))}getSharedEnvironmentHistoryPath(e){return zr.join(this.sharedHistoryPath,At(e))}getSharedCollectionHistoryPath(e,r){return zr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return zr.join(this.getSharedCollectionHistoryPath(e,r),At(n))}getHistoryFilePath(e,r,n){return zr.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return zr.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return zr.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return zr.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!Ae.existsSync(i))return null;let s=Ae.readFileSync(i,"utf-8"),o=JSON.parse(s);return{environment:e||o.environment,requestPath:r||o.requestPath,requestId:n||o.requestId,method:o.method,requests:o.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,r,n){let i=this.getSharedHistoryFilePath(e,r,n);try{if(!Ae.existsSync(i))return null;let s=Ae.readFileSync(i,"utf-8"),o=JSON.parse(s);return{environment:e||o.environment,requestPath:r||o.requestPath,requestId:n||o.requestId,method:o.method,requests:o.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,r,n){let i=this.loadHistory(e,r,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,r,n){let i=this.getEntriesForEnvironment(e,r,n),s=new Map;for(let o of i){let l=o.ticket||o.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(o)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let o of i){let l=o.ticket||o.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(o)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Ae.existsSync(r)||Ae.mkdirSync(r,{recursive:!0}),Ae.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 r=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Ae.existsSync(r)||Ae.mkdirSync(r,{recursive:!0}),Ae.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,r,n,i,s){let o=this.loadHistory(e,r,n);o||(o={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let l=_0({...s,method:i,id:Yb(),timestamp:Date.now()});return o.requests.unshift(l),o.requests.length>100&&(o.requests=o.requests.slice(0,100)),this.saveHistory(o),l}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let o=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==o){this.saveHistory(s);let l=this.getResponseFilePath(e,r,n,i);return Ae.existsSync(l)&&Ae.unlinkSync(l),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let o=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==o){this.saveSharedHistory(s);let l=this.getSharedResponseFilePath(e,r,n,i);return Ae.existsSync(l)&&Ae.unlinkSync(l),!0}return!1}shareEntry(e,r,n,i,s){let o=(s||"").trim();if(!o)return!1;let l=this.loadHistory(e,r,n);if(!l)return!1;let f=l.requests.findIndex(v=>v.id===i);if(f===-1)return!1;let[c]=l.requests.splice(f,1);this.saveHistory(l);let p=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:l.method,requests:[]};if(!p.requests.some(v=>v.id===i)){let v={...c,ticket:null,branch:o};p.requests.unshift(v),p.requests.length>100&&(p.requests=p.requests.slice(0,100)),this.saveSharedHistory(p)}let h=this.getResponseFilePath(e,r,n,i),g=this.getSharedResponseFilePath(e,r,n,i);if(Ae.existsSync(h)){let v=zr.dirname(g);Ae.existsSync(v)||Ae.mkdirSync(v,{recursive:!0});try{Ae.renameSync(h,g)}catch{try{Ae.copyFileSync(h,g)}catch(w){return console.error(`Failed to copy full response from ${h} to ${g}:`,w),!0}try{Ae.unlinkSync(h)}catch(w){console.warn(`Failed to remove original full response after copy: ${h}`,w)}}}return!0}moveSharedEntry(e,r,n,i,s){let o=(s||"").trim();if(!o)return!1;let l=this.loadSharedHistory(e,r,n);if(!l)return!1;let f=!1;return l.requests=l.requests.map(c=>c.id===i?(f=!0,{...c,ticket:null,branch:o}):c),f?(this.saveSharedHistory(l),!0):!1}renameSharedGroup(e,r,n,i,s){let o=(i||"").trim(),l=(s||"").trim();if(!o||!l||o===l)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let c=!1;return f.requests=f.requests.map(p=>!p.ticket&&p.branch===o?(c=!0,{...p,branch:l}):p),c?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(Ae.existsSync(i)){let s=Ae.readdirSync(i);for(let o of s)Ae.unlinkSync(zr.join(i,o));Ae.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let o=this.getRequestPath(e,r,n),l=this.getResponseFilePath(e,r,n,i);try{Ae.existsSync(o)||Ae.mkdirSync(o,{recursive:!0});let f=R0(s);Ae.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,r,n,i){let s=this.getResponseFilePath(e,r,n,i);try{if(!Ae.existsSync(s))return null;let o=Ae.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load full response for ${i}:`,o),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!Ae.existsSync(s))return null;let o=Ae.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load shared full response for ${i}:`,o),null}}}});var yu,E0=se(()=>{"use strict";yu=class{constructor(e,r){this.historyService=e;this.inferrer=r}historyService;inferrer;async analyze(e,r,n){let i=n?.environment||"default",s=n?.maxSamples||50,o=this.historyService.loadHistory(i,e,r),l=this.historyService.loadSharedHistory(i,e,r),f=[...o?.requests||[],...l?.requests||[]];if(f.length===0)return{responses:{}};let c=f.slice(0,s),p=new Map;for(let g of c){let v=this.historyService.loadFullResponse(i,e,r,g.id);if(v||(v=this.historyService.loadSharedFullResponse(i,e,r,g.id)),v){let _=v.status;p.has(_)||p.set(_,[]),p.get(_).push(v)}}let h={};for(let[g,v]of p){let _=this.buildResponseDefinition(v);h[String(g)]=_}return{responses:h}}buildResponseDefinition(e){let r={};if(e.length===0)return r;let n=e[0];r.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(r.contentType=i),i&&this.isJsonContentType(i)){let o=this.inferBodySchema(n);for(let l=1;l<e.length;l++){let f=this.inferBodySchema(e[l]);f&&o?o=this.inferrer.mergeSchemas(o,f):f&&(o=f)}if(o&&(r.schema=o),n.body!==void 0&&n.body!==null){let l=typeof n.body=="string"?this.tryParseJson(n.body):n.body;l!==void 0&&(r.examples={default:{summary:"Captured from history",value:l}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(r.headers=s),r}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let r=e.body;if(!(typeof r=="string"&&(r=this.tryParseJson(r),r===void 0)))return this.inferrer.inferFromValue(r)}extractContentType(e){for(let[r,n]of Object.entries(e))if(r.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 r=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,c]of Object.entries(l.headers)){let p=f.toLowerCase();r.has(p)||(n.set(p,(n.get(p)||0)+1),i.has(p)||i.set(p,Array.isArray(c)?c.join(", "):c))}let s=Math.ceil(e.length/2),o={};for(let[l,f]of n)if(f>=s){let c=i.get(l);o[l]={schema:this.inferHeaderSchema(c)}}return o}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}}});var Ze=H(lr=>{"use strict";var I0=Symbol.for("yaml.alias"),uk=Symbol.for("yaml.document"),Pm=Symbol.for("yaml.map"),ck=Symbol.for("yaml.pair"),O0=Symbol.for("yaml.scalar"),Tm=Symbol.for("yaml.seq"),fs=Symbol.for("yaml.node.type"),kz=t=>!!t&&typeof t=="object"&&t[fs]===I0,Pz=t=>!!t&&typeof t=="object"&&t[fs]===uk,Tz=t=>!!t&&typeof t=="object"&&t[fs]===Pm,Az=t=>!!t&&typeof t=="object"&&t[fs]===ck,fk=t=>!!t&&typeof t=="object"&&t[fs]===O0,$z=t=>!!t&&typeof t=="object"&&t[fs]===Tm;function dk(t){if(t&&typeof t=="object")switch(t[fs]){case Pm:case Tm:return!0}return!1}function Nz(t){if(t&&typeof t=="object")switch(t[fs]){case I0:case Pm:case O0:case Tm:return!0}return!1}var Mz=t=>(fk(t)||dk(t))&&!!t.anchor;lr.ALIAS=I0;lr.DOC=uk;lr.MAP=Pm;lr.NODE_TYPE=fs;lr.PAIR=ck;lr.SCALAR=O0;lr.SEQ=Tm;lr.hasAnchor=Mz;lr.isAlias=kz;lr.isCollection=dk;lr.isDocument=Pz;lr.isMap=Tz;lr.isNode=Nz;lr.isPair=Az;lr.isScalar=fk;lr.isSeq=$z});var Xf=H(q0=>{"use strict";var Qt=Ze(),Jr=Symbol("break visit"),pk=Symbol("skip children"),Pi=Symbol("remove node");function Am(t,e){let r=hk(e);Qt.isDocument(t)?vu(null,t.contents,r,Object.freeze([t]))===Pi&&(t.contents=null):vu(null,t,r,Object.freeze([]))}Am.BREAK=Jr;Am.SKIP=pk;Am.REMOVE=Pi;function vu(t,e,r,n){let i=mk(t,e,r,n);if(Qt.isNode(i)||Qt.isPair(i))return gk(t,n,i),vu(t,i,r,n);if(typeof i!="symbol"){if(Qt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=vu(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Jr)return Jr;o===Pi&&(e.items.splice(s,1),s-=1)}}}else if(Qt.isPair(e)){n=Object.freeze(n.concat(e));let s=vu("key",e.key,r,n);if(s===Jr)return Jr;s===Pi&&(e.key=null);let o=vu("value",e.value,r,n);if(o===Jr)return Jr;o===Pi&&(e.value=null)}}return i}async function $m(t,e){let r=hk(e);Qt.isDocument(t)?await bu(null,t.contents,r,Object.freeze([t]))===Pi&&(t.contents=null):await bu(null,t,r,Object.freeze([]))}$m.BREAK=Jr;$m.SKIP=pk;$m.REMOVE=Pi;async function bu(t,e,r,n){let i=await mk(t,e,r,n);if(Qt.isNode(i)||Qt.isPair(i))return gk(t,n,i),bu(t,i,r,n);if(typeof i!="symbol"){if(Qt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=await bu(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Jr)return Jr;o===Pi&&(e.items.splice(s,1),s-=1)}}}else if(Qt.isPair(e)){n=Object.freeze(n.concat(e));let s=await bu("key",e.key,r,n);if(s===Jr)return Jr;s===Pi&&(e.key=null);let o=await bu("value",e.value,r,n);if(o===Jr)return Jr;o===Pi&&(e.value=null)}}return i}function hk(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function mk(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Qt.isMap(e))return r.Map?.(t,e,n);if(Qt.isSeq(e))return r.Seq?.(t,e,n);if(Qt.isPair(e))return r.Pair?.(t,e,n);if(Qt.isScalar(e))return r.Scalar?.(t,e,n);if(Qt.isAlias(e))return r.Alias?.(t,e,n)}function gk(t,e,r){let n=e[e.length-1];if(Qt.isCollection(n))n.items[t]=r;else if(Qt.isPair(n))t==="key"?n.key=r:n.value=r;else if(Qt.isDocument(n))n.contents=r;else{let i=Qt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}q0.visit=Am;q0.visitAsync=$m});var k0=H(vk=>{"use strict";var yk=Ze(),Fz=Xf(),Dz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Lz=t=>t.replace(/[!,[\]{}]/g,e=>Dz[e]),ed=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,o]=n;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(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 o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(o){return r(String(o)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+Lz(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&yk.isNode(e.contents)){let s={};Fz.visit(e.contents,(o,l)=>{yk.isNode(l)&&l.tag&&(s[l.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of n)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
96
+ `)}};ed.defaultYaml={explicit:!1,version:"1.2"};ed.defaultTags={"!!":"tag:yaml.org,2002:"};vk.Directives=ed});var Nm=H(td=>{"use strict";var bk=Ze(),jz=Xf();function Uz(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function Sk(t){let e=new Set;return jz.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function wk(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function Hz(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=Sk(t));let o=wk(e,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o=="object"&&o.anchor&&(bk.isScalar(o.node)||bk.isCollection(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:n}}td.anchorIsValid=Uz;td.anchorNames=Sk;td.createNodeAnchors=Hz;td.findNewAnchor=wk});var P0=H(_k=>{"use strict";function rd(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let o=n[i],l=rd(t,n,String(i),o);l===void 0?delete n[i]:l!==o&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),o=rd(t,n,i,s);o===void 0?n.delete(i):o!==s&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let s=rd(t,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 o=rd(t,n,i,s);o===void 0?delete n[i]:o!==s&&(n[i]=o)}return t.call(e,r,n)}_k.applyReviver=rd});var so=H(Ck=>{"use strict";var Bz=Ze();function Rk(t,e,r){if(Array.isArray(t))return t.map((n,i)=>Rk(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!Bz.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}Ck.toJS=Rk});var Mm=H(Ek=>{"use strict";var Vz=P0(),xk=Ze(),Wz=so(),T0=class{constructor(e){Object.defineProperty(this,xk.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:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!xk.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=Wz.toJS(this,"",o);if(typeof i=="function")for(let{count:f,res:c}of o.anchors.values())i(c,f);return typeof s=="function"?Vz.applyReviver(s,{"":l},"",l):l}};Ek.NodeBase=T0});var nd=H(Ik=>{"use strict";var zz=Nm(),Jz=Xf(),Su=Ze(),Gz=Mm(),Yz=so(),A0=class extends Gz.NodeBase{constructor(e){super(Su.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Jz.visit(e,{Node:(s,o)=>{(Su.isAlias(o)||Su.hasAnchor(o))&&n.push(o)}}),r&&(r.aliasResolveCache=n));let i;for(let s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,o=this.resolve(i,r);if(!o){let f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let l=n.get(o);if(l||(Yz.toJS(o,null,r),l=n.get(o)),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=Fm(i,o,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,r,n){let i=`*${this.source}`;if(e){if(zz.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 Fm(t,e,r){if(Su.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.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=Fm(t,i,r);s>n&&(n=s)}return n}else if(Su.isPair(e)){let n=Fm(t,e.key,r),i=Fm(t,e.value,r);return Math.max(n,i)}return 1}Ik.Alias=A0});var Bt=H($0=>{"use strict";var Kz=Ze(),Qz=Mm(),Zz=so(),Xz=t=>!t||typeof t!="function"&&typeof t!="object",oo=class extends Qz.NodeBase{constructor(e){super(Kz.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Zz.toJS(this.value,e,r)}toString(){return String(this.value)}};oo.BLOCK_FOLDED="BLOCK_FOLDED";oo.BLOCK_LITERAL="BLOCK_LITERAL";oo.PLAIN="PLAIN";oo.QUOTE_DOUBLE="QUOTE_DOUBLE";oo.QUOTE_SINGLE="QUOTE_SINGLE";$0.Scalar=oo;$0.isScalarValue=Xz});var id=H(qk=>{"use strict";var eJ=nd(),ka=Ze(),Ok=Bt(),tJ="tag:yaml.org,2002:";function rJ(t,e,r){if(e){let n=r.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 r.find(n=>n.identify?.(t)&&!n.format)}function nJ(t,e,r){if(ka.isDocument(t)&&(t=t.contents),ka.isNode(t))return t;if(ka.isPair(t)){let h=r.schema[ka.MAP].createNode?.(r.schema,null,r);return h.items.push(t),h}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:o,sourceObjects:l}=r,f;if(n&&t&&typeof t=="object"){if(f=l.get(t),f)return f.anchor??(f.anchor=i(t)),new eJ.Alias(f.anchor);f={anchor:null,node:null},l.set(t,f)}e?.startsWith("!!")&&(e=tJ+e.slice(2));let c=rJ(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new Ok.Scalar(t);return f&&(f.node=h),h}c=t instanceof Map?o[ka.MAP]:Symbol.iterator in Object(t)?o[ka.SEQ]:o[ka.MAP]}s&&(s(c),delete r.onTagObj);let p=c?.createNode?c.createNode(r.schema,t,r):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(r.schema,t,r):new Ok.Scalar(t);return e?p.tag=e:c.default||(p.tag=c.tag),f&&(f.node=p),p}qk.createNode=nJ});var Lm=H(Dm=>{"use strict";var iJ=id(),Ti=Ze(),sJ=Mm();function N0(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=n,n=o}else n=new Map([[s,n]])}return iJ.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var kk=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,M0=class extends sJ.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Ti.isNode(n)||Ti.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(kk(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(Ti.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,N0(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Ti.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&Ti.isScalar(s)?s.value:s:Ti.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ti.isPair(r))return!1;let n=r.value;return n==null||e&&Ti.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Ti.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(Ti.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,N0(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Dm.Collection=M0;Dm.collectionFromPath=N0;Dm.isEmptyPath=kk});var sd=H(jm=>{"use strict";var oJ=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function F0(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var aJ=(t,e,r)=>t.endsWith(`
97
97
  `)?F0(r,e):r.includes(`
98
98
  `)?`
99
99
  `+F0(r,e):(t.endsWith(" ")?"":" ")+r;jm.indentComment=F0;jm.lineComment=aJ;jm.stringifyComment=oJ});var Tk=H(od=>{"use strict";var lJ="flow",D0="block",Um="quoted";function uJ(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return t;i<s&&(s=0);let f=Math.max(1+s,1+i-e.length);if(t.length<=f)return t;let c=[],p={},h=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?c.push(0):h=i-n);let g,v,_=!1,w=-1,E=-1,k=-1;r===D0&&(w=Pk(t,w,e.length),w!==-1&&(h=w+f));for(let N;N=t[w+=1];){if(r===Um&&N==="\\"){switch(E=w,t[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}k=w}if(N===`
@@ -118,24 +118,24 @@ ${r}`)+"'";return e.implicitKey?n:ao.foldFlowLines(n,r,ao.FOLD_FLOW,Bm(e,!1))}fu
118
118
  `);_===-1?h="-":r===v||_!==v.length-1?(h="+",s&&s()):h="",v&&(r=r.slice(0,-v.length),v[v.length-1]===`
119
119
  `&&(v=v.slice(0,-1)),v=v.replace(j0,`$&${c}`));let w=!1,E,k=-1;for(E=0;E<r.length;++E){let j=r[E];if(j===" ")w=!0;else if(j===`
120
120
  `)k=E;else break}let T=r.substring(0,k<E?k+1:E);T&&(r=r.substring(T.length),T=T.replace(/\n+/g,`$&${c}`));let $=(w?c?"2":"1":"")+h;if(t&&($+=" "+l(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){let j=r.replace(/\n+/g,`
121
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),G=!1,O=Bm(n,!0);o!=="folded"&&e!==ii.Scalar.BLOCK_FOLDED&&(O.onOverflow=()=>{G=!0});let C=ao.foldFlowLines(`${T}${j}${v}`,c,ao.FOLD_BLOCK,O);if(!G)return`>${$}
121
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),G=!1,q=Bm(n,!0);o!=="folded"&&e!==ii.Scalar.BLOCK_FOLDED&&(q.onOverflow=()=>{G=!0});let C=ao.foldFlowLines(`${T}${j}${v}`,c,ao.FOLD_BLOCK,q);if(!G)return`>${$}
122
122
  ${c}${C}`}return r=r.replace(/\n+/g,`$&${c}`),`|${$}
123
123
  ${c}${T}${r}${v}`}function fJ(t,e,r,n){let{type:i,value:s}=t,{actualString:o,implicitKey:l,indent:f,indentStep:c,inFlow:p}=e;if(l&&s.includes(`
124
124
  `)||p&&/[[\]{},]/.test(s))return wu(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||p||!s.includes(`
125
125
  `)?wu(s,e):Hm(t,e,r,n);if(!l&&!p&&i!==ii.Scalar.PLAIN&&s.includes(`
126
126
  `))return Hm(t,e,r,n);if(Vm(s)){if(f==="")return e.forceBlockIndent=!0,Hm(t,e,r,n);if(l&&f===c)return wu(s,e)}let h=s.replace(/\n+/g,`$&
127
127
  ${f}`);if(o){let g=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(h),{compat:v,tags:_}=e.doc.schema;if(_.some(g)||v?.some(g))return wu(s,e)}return l?h:ao.foldFlowLines(h,f,ao.FOLD_FLOW,Bm(e,!1))}function dJ(t,e,r,n){let{implicitKey:i,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==ii.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=ii.Scalar.QUOTE_DOUBLE);let f=p=>{switch(p){case ii.Scalar.BLOCK_FOLDED:case ii.Scalar.BLOCK_LITERAL:return i||s?wu(o.value,e):Hm(o,e,r,n);case ii.Scalar.QUOTE_DOUBLE:return ad(o.value,e);case ii.Scalar.QUOTE_SINGLE:return L0(o.value,e);case ii.Scalar.PLAIN:return fJ(o,e,r,n);default:return null}},c=f(l);if(c===null){let{defaultKeyType:p,defaultStringType:h}=e.options,g=i&&p||h;if(c=f(g),c===null)throw new Error(`Unsupported default string type ${g}`)}return c}Ak.stringifyString=dJ});var ud=H(U0=>{"use strict";var pJ=Nm(),lo=Ze(),hJ=sd(),mJ=ld();function gJ(t,e){let r=Object.assign({blockQuote:!0,commentString:hJ.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},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function yJ(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let r,n;if(lo.isScalar(e)){n=e.value;let i=t.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(o=>o.test);s.length>0&&(i=s)}r=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function vJ(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(lo.isScalar(t)||lo.isCollection(t))&&t.anchor;s&&pJ.anchorIsValid(s)&&(r.add(s),i.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}function bJ(t,e,r,n){if(lo.isPair(t))return t.toString(e,r,n);if(lo.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=lo.isNode(t)?t:e.doc.createNode(t,{onTagObj:f=>i=f});i??(i=yJ(e.doc.schema.tags,s));let o=vJ(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let l=typeof i.stringify=="function"?i.stringify(s,e,r,n):lo.isScalar(s)?mJ.stringifyString(s,e,r,n):s.toString(e,r,n);return o?lo.isScalar(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
128
- ${e.indent}${l}`:l}U0.createStringifyContext=gJ;U0.stringify=bJ});var Fk=H(Mk=>{"use strict";var ds=Ze(),$k=Bt(),Nk=ud(),cd=sd();function SJ({key:t,value:e},r,n,i){let{allNullValues:s,doc:o,indent:l,indentStep:f,options:{commentString:c,indentSeq:p,simpleKeys:h}}=r,g=ds.isNode(t)&&t.comment||null;if(h){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(ds.isCollection(t)||!ds.isNode(t)&&typeof t=="object"){let O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let v=!h&&(!t||g&&e==null&&!r.inFlow||ds.isCollection(t)||(ds.isScalar(t)?t.type===$k.Scalar.BLOCK_FOLDED||t.type===$k.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!v&&(h||!s),indent:l+f});let _=!1,w=!1,E=Nk.stringify(t,r,()=>_=!0,()=>w=!0);if(!v&&!r.inFlow&&E.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(r.inFlow){if(s||e==null)return _&&n&&n(),E===""?"?":v?`? ${E}`:E}else if(s&&!h||e==null&&v)return E=`? ${E}`,g&&!_?E+=cd.lineComment(E,r.indent,c(g)):w&&i&&i(),E;_&&(g=null),v?(g&&(E+=cd.lineComment(E,r.indent,c(g))),E=`? ${E}
128
+ ${e.indent}${l}`:l}U0.createStringifyContext=gJ;U0.stringify=bJ});var Fk=H(Mk=>{"use strict";var ds=Ze(),$k=Bt(),Nk=ud(),cd=sd();function SJ({key:t,value:e},r,n,i){let{allNullValues:s,doc:o,indent:l,indentStep:f,options:{commentString:c,indentSeq:p,simpleKeys:h}}=r,g=ds.isNode(t)&&t.comment||null;if(h){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(ds.isCollection(t)||!ds.isNode(t)&&typeof t=="object"){let q="With simple keys, collection cannot be used as a key value";throw new Error(q)}}let v=!h&&(!t||g&&e==null&&!r.inFlow||ds.isCollection(t)||(ds.isScalar(t)?t.type===$k.Scalar.BLOCK_FOLDED||t.type===$k.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!v&&(h||!s),indent:l+f});let _=!1,w=!1,E=Nk.stringify(t,r,()=>_=!0,()=>w=!0);if(!v&&!r.inFlow&&E.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(r.inFlow){if(s||e==null)return _&&n&&n(),E===""?"?":v?`? ${E}`:E}else if(s&&!h||e==null&&v)return E=`? ${E}`,g&&!_?E+=cd.lineComment(E,r.indent,c(g)):w&&i&&i(),E;_&&(g=null),v?(g&&(E+=cd.lineComment(E,r.indent,c(g))),E=`? ${E}
129
129
  ${l}:`):(E=`${E}:`,g&&(E+=cd.lineComment(E,r.indent,c(g))));let k,T,N;ds.isNode(e)?(k=!!e.spaceBefore,T=e.commentBefore,N=e.comment):(k=!1,T=null,N=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!v&&!g&&ds.isScalar(e)&&(r.indentAtStart=E.length+1),w=!1,!p&&f.length>=2&&!r.inFlow&&!v&&ds.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let $=!1,j=Nk.stringify(e,r,()=>$=!0,()=>w=!0),G=" ";if(g||k||T){if(G=k?`
130
- `:"",T){let O=c(T);G+=`
131
- ${cd.indentComment(O,r.indent)}`}j===""&&!r.inFlow?G===`
130
+ `:"",T){let q=c(T);G+=`
131
+ ${cd.indentComment(q,r.indent)}`}j===""&&!r.inFlow?G===`
132
132
  `&&N&&(G=`
133
133
 
134
134
  `):G+=`
135
- ${r.indent}`}else if(!v&&ds.isCollection(e)){let O=j[0],C=j.indexOf(`
136
- `),A=C!==-1,D=r.inFlow??e.flow??e.items.length===0;if(A||!D){let B=!1;if(A&&(O==="&"||O==="!")){let F=j.indexOf(" ");O==="&"&&F!==-1&&F<C&&j[F+1]==="!"&&(F=j.indexOf(" ",F+1)),(F===-1||C<F)&&(B=!0)}B||(G=`
135
+ ${r.indent}`}else if(!v&&ds.isCollection(e)){let q=j[0],C=j.indexOf(`
136
+ `),A=C!==-1,D=r.inFlow??e.flow??e.items.length===0;if(A||!D){let B=!1;if(A&&(q==="&"||q==="!")){let F=j.indexOf(" ");q==="&"&&F!==-1&&F<C&&j[F+1]==="!"&&(F=j.indexOf(" ",F+1)),(F===-1||C<F)&&(B=!0)}B||(G=`
137
137
  ${r.indent}`)}}else(j===""||j[0]===`
138
- `)&&(G="");return E+=G+j,r.inFlow?$&&n&&n():N&&!$?E+=cd.lineComment(E,r.indent,c(N)):w&&i&&i(),E}Mk.stringifyPair=SJ});var B0=H(H0=>{"use strict";var Dk=ft("process");function wJ(t,...e){t==="debug"&&console.log(...e)}function _J(t,e){(t==="debug"||t==="warn")&&(typeof Dk.emitWarning=="function"?Dk.emitWarning(e):console.warn(e))}H0.debug=wJ;H0.warn=_J});var Ym=H(Gm=>{"use strict";var Jm=Ze(),Lk=Bt(),Wm="<<",zm={identify:t=>t===Wm||typeof t=="symbol"&&t.description===Wm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Lk.Scalar(Symbol(Wm)),{addToJSMap:jk}),stringify:()=>Wm},RJ=(t,e)=>(zm.identify(e)||Jm.isScalar(e)&&(!e.type||e.type===Lk.Scalar.PLAIN)&&zm.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===zm.tag&&r.default);function jk(t,e,r){let n=Uk(t,r);if(Jm.isSeq(n))for(let i of n.items)V0(t,e,i);else if(Array.isArray(n))for(let i of n)V0(t,e,i);else V0(t,e,n)}function V0(t,e,r){let n=Uk(t,r);if(!Jm.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,o]of i)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Uk(t,e){return t&&Jm.isAlias(e)?e.resolve(t.doc,t):e}Gm.addMergeToJSMap=jk;Gm.isMergeKey=RJ;Gm.merge=zm});var z0=H(Vk=>{"use strict";var CJ=B0(),Hk=Ym(),xJ=ud(),Bk=Ze(),W0=so();function EJ(t,e,{key:r,value:n}){if(Bk.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(Hk.isMergeKey(t,r))Hk.addMergeToJSMap(t,e,n);else{let i=W0.toJS(r,"",t);if(e instanceof Map)e.set(i,W0.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=IJ(r,i,t),o=W0.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function IJ(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Bk.isNode(t)&&r?.doc){let n=xJ.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),CJ.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}Vk.addPairToJSMap=EJ});var uo=H(J0=>{"use strict";var Wk=id(),qJ=Fk(),OJ=z0(),Km=Ze();function kJ(t,e,r){let n=Wk.createNode(t,void 0,r),i=Wk.createNode(e,void 0,r);return new Qm(n,i)}var Qm=class t{constructor(e,r=null){Object.defineProperty(this,Km.NODE_TYPE,{value:Km.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Km.isNode(r)&&(r=r.clone(e)),Km.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return OJ.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?qJ.stringifyPair(this,e,r,n):JSON.stringify(this)}};J0.Pair=Qm;J0.createPair=kJ});var G0=H(Jk=>{"use strict";var Pa=Ze(),zk=ud(),Zm=sd();function PJ(t,e,r){return(e.inFlow??t.flow?AJ:TJ)(t,e,r)}function TJ({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:f,options:{commentString:c}}=r,p=Object.assign({},r,{indent:s,type:null}),h=!1,g=[];for(let _=0;_<e.length;++_){let w=e[_],E=null;if(Pa.isNode(w))!h&&w.spaceBefore&&g.push(""),Xm(r,g,w.commentBefore,h),w.comment&&(E=w.comment);else if(Pa.isPair(w)){let T=Pa.isNode(w.key)?w.key:null;T&&(!h&&T.spaceBefore&&g.push(""),Xm(r,g,T.commentBefore,h))}h=!1;let k=zk.stringify(w,p,()=>E=null,()=>h=!0);E&&(k+=Zm.lineComment(k,s,c(E))),h&&E&&(h=!1),g.push(n+k)}let v;if(g.length===0)v=i.start+i.end;else{v=g[0];for(let _=1;_<g.length;++_){let w=g[_];v+=w?`
138
+ `)&&(G="");return E+=G+j,r.inFlow?$&&n&&n():N&&!$?E+=cd.lineComment(E,r.indent,c(N)):w&&i&&i(),E}Mk.stringifyPair=SJ});var B0=H(H0=>{"use strict";var Dk=ft("process");function wJ(t,...e){t==="debug"&&console.log(...e)}function _J(t,e){(t==="debug"||t==="warn")&&(typeof Dk.emitWarning=="function"?Dk.emitWarning(e):console.warn(e))}H0.debug=wJ;H0.warn=_J});var Ym=H(Gm=>{"use strict";var Jm=Ze(),Lk=Bt(),Wm="<<",zm={identify:t=>t===Wm||typeof t=="symbol"&&t.description===Wm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Lk.Scalar(Symbol(Wm)),{addToJSMap:jk}),stringify:()=>Wm},RJ=(t,e)=>(zm.identify(e)||Jm.isScalar(e)&&(!e.type||e.type===Lk.Scalar.PLAIN)&&zm.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===zm.tag&&r.default);function jk(t,e,r){let n=Uk(t,r);if(Jm.isSeq(n))for(let i of n.items)V0(t,e,i);else if(Array.isArray(n))for(let i of n)V0(t,e,i);else V0(t,e,n)}function V0(t,e,r){let n=Uk(t,r);if(!Jm.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,o]of i)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Uk(t,e){return t&&Jm.isAlias(e)?e.resolve(t.doc,t):e}Gm.addMergeToJSMap=jk;Gm.isMergeKey=RJ;Gm.merge=zm});var z0=H(Vk=>{"use strict";var CJ=B0(),Hk=Ym(),xJ=ud(),Bk=Ze(),W0=so();function EJ(t,e,{key:r,value:n}){if(Bk.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(Hk.isMergeKey(t,r))Hk.addMergeToJSMap(t,e,n);else{let i=W0.toJS(r,"",t);if(e instanceof Map)e.set(i,W0.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=IJ(r,i,t),o=W0.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function IJ(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Bk.isNode(t)&&r?.doc){let n=xJ.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),CJ.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}Vk.addPairToJSMap=EJ});var uo=H(J0=>{"use strict";var Wk=id(),OJ=Fk(),qJ=z0(),Km=Ze();function kJ(t,e,r){let n=Wk.createNode(t,void 0,r),i=Wk.createNode(e,void 0,r);return new Qm(n,i)}var Qm=class t{constructor(e,r=null){Object.defineProperty(this,Km.NODE_TYPE,{value:Km.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Km.isNode(r)&&(r=r.clone(e)),Km.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return qJ.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?OJ.stringifyPair(this,e,r,n):JSON.stringify(this)}};J0.Pair=Qm;J0.createPair=kJ});var G0=H(Jk=>{"use strict";var Pa=Ze(),zk=ud(),Zm=sd();function PJ(t,e,r){return(e.inFlow??t.flow?AJ:TJ)(t,e,r)}function TJ({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:f,options:{commentString:c}}=r,p=Object.assign({},r,{indent:s,type:null}),h=!1,g=[];for(let _=0;_<e.length;++_){let w=e[_],E=null;if(Pa.isNode(w))!h&&w.spaceBefore&&g.push(""),Xm(r,g,w.commentBefore,h),w.comment&&(E=w.comment);else if(Pa.isPair(w)){let T=Pa.isNode(w.key)?w.key:null;T&&(!h&&T.spaceBefore&&g.push(""),Xm(r,g,T.commentBefore,h))}h=!1;let k=zk.stringify(w,p,()=>E=null,()=>h=!0);E&&(k+=Zm.lineComment(k,s,c(E))),h&&E&&(h=!1),g.push(n+k)}let v;if(g.length===0)v=i.start+i.end;else{v=g[0];for(let _=1;_<g.length;++_){let w=g[_];v+=w?`
139
139
  ${f}${w}`:`
140
140
  `}}return t?(v+=`
141
141
  `+Zm.indentComment(c(t),f),l&&l()):h&&o&&o(),v}function AJ({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=e;n+=s;let f=Object.assign({},e,{indent:n,inFlow:!0,type:null}),c=!1,p=0,h=[];for(let _=0;_<t.length;++_){let w=t[_],E=null;if(Pa.isNode(w))w.spaceBefore&&h.push(""),Xm(e,h,w.commentBefore,!1),w.comment&&(E=w.comment);else if(Pa.isPair(w)){let T=Pa.isNode(w.key)?w.key:null;T&&(T.spaceBefore&&h.push(""),Xm(e,h,T.commentBefore,!1),T.comment&&(c=!0));let N=Pa.isNode(w.value)?w.value:null;N?(N.comment&&(E=N.comment),N.commentBefore&&(c=!0)):w.value==null&&T?.comment&&(E=T.comment)}E&&(c=!0);let k=zk.stringify(w,f,()=>E=null);c||(c=h.length>p||k.includes(`
@@ -145,21 +145,21 @@ ${s}${i}${w}`:`
145
145
  ${i}${v}`}else return`${g}${o}${h.join(" ")}${o}${v}`}function Xm({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=Zm.indentComment(e(n),t);r.push(s.trimStart())}}Jk.stringifyCollection=PJ});var fo=H(K0=>{"use strict";var $J=G0(),NJ=z0(),MJ=Lm(),co=Ze(),eg=uo(),FJ=Bt();function fd(t,e){let r=co.isScalar(e)?e.value:e;for(let n of t)if(co.isPair(n)&&(n.key===e||n.key===r||co.isScalar(n.key)&&n.key.value===r))return n}var Y0=class extends MJ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(co.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,o=new this(e),l=(f,c)=>{if(typeof s=="function")c=s.call(r,f,c);else if(Array.isArray(s)&&!s.includes(f))return;(c!==void 0||i)&&o.items.push(eg.createPair(f,c,n))};if(r instanceof Map)for(let[f,c]of r)l(f,c);else if(r&&typeof r=="object")for(let f of Object.keys(r))l(f,r[f]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let n;co.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new eg.Pair(e,e?.value):n=new eg.Pair(e.key,e.value);let i=fd(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);co.isScalar(i.value)&&FJ.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let o=this.items.findIndex(l=>s(n,l)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let r=fd(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=fd(this.items,e)?.value;return(!r&&co.isScalar(i)?i.value:i)??void 0}has(e){return!!fd(this.items,e)}set(e,r){this.add(new eg.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let s of this.items)NJ.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!co.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})),$J.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};K0.YAMLMap=Y0;K0.findPair=fd});var _u=H(Yk=>{"use strict";var DJ=Ze(),Gk=fo(),LJ={collection:"map",default:!0,nodeClass:Gk.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return DJ.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>Gk.YAMLMap.from(t,e,r)};Yk.map=LJ});var po=H(Kk=>{"use strict";var jJ=id(),UJ=G0(),HJ=Lm(),rg=Ze(),BJ=Bt(),VJ=so(),Q0=class extends HJ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(rg.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=tg(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=tg(e);if(typeof n!="number")return;let i=this.items[n];return!r&&rg.isScalar(i)?i.value:i}has(e){let r=tg(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=tg(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];rg.isScalar(i)&&BJ.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let s of this.items)n.push(VJ.toJS(s,String(i++),r));return n}toString(e,r,n){return e?UJ.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r)){let o=0;for(let l of r){if(typeof i=="function"){let f=r instanceof Set?l:String(o++);l=i.call(r,f,l)}s.items.push(jJ.createNode(l,void 0,n))}}return s}};function tg(t){let e=rg.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Kk.YAMLSeq=Q0});var Ru=H(Zk=>{"use strict";var WJ=Ze(),Qk=po(),zJ={collection:"seq",default:!0,nodeClass:Qk.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return WJ.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>Qk.YAMLSeq.from(t,e,r)};Zk.seq=zJ});var dd=H(Xk=>{"use strict";var JJ=ld(),GJ={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),JJ.stringifyString(t,e,r,n)}};Xk.string=GJ});var ng=H(rP=>{"use strict";var eP=Bt(),tP={identify:t=>t==null,createNode:()=>new eP.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new eP.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&tP.test.test(t)?t:e.options.nullStr};rP.nullTag=tP});var Z0=H(iP=>{"use strict";var YJ=Bt(),nP={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new YJ.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&nP.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};iP.boolTag=nP});var Cu=H(sP=>{"use strict";function KJ({format:t,minFractionDigits:e,tag:r,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(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=e-(s.length-o-1);for(;l-- >0;)s+="0"}return s}sP.stringifyNumber=KJ});var e_=H(ig=>{"use strict";var QJ=Bt(),X0=Cu(),ZJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:X0.stringifyNumber},XJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():X0.stringifyNumber(t)}},eG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new QJ.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:X0.stringifyNumber};ig.float=eG;ig.floatExp=XJ;ig.floatNaN=ZJ});var r_=H(og=>{"use strict";var oP=Cu(),sg=t=>typeof t=="bigint"||Number.isInteger(t),t_=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function aP(t,e,r){let{value:n}=t;return sg(n)&&n>=0?r+n.toString(e):oP.stringifyNumber(t)}var tG={identify:t=>sg(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>t_(t,2,8,r),stringify:t=>aP(t,8,"0o")},rG={identify:sg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>t_(t,0,10,r),stringify:oP.stringifyNumber},nG={identify:t=>sg(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>t_(t,2,16,r),stringify:t=>aP(t,16,"0x")};og.int=rG;og.intHex=nG;og.intOct=tG});var uP=H(lP=>{"use strict";var iG=_u(),sG=ng(),oG=Ru(),aG=dd(),lG=Z0(),n_=e_(),i_=r_(),uG=[iG.map,oG.seq,aG.string,sG.nullTag,lG.boolTag,i_.intOct,i_.int,i_.intHex,n_.floatNaN,n_.floatExp,n_.float];lP.schema=uG});var dP=H(fP=>{"use strict";var cG=Bt(),fG=_u(),dG=Ru();function cP(t){return typeof t=="bigint"||Number.isInteger(t)}var ag=({value:t})=>JSON.stringify(t),pG=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:ag},{identify:t=>t==null,createNode:()=>new cG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ag},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:ag},{identify:cP,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>cP(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:ag}],hG={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},mG=[fG.map,dG.seq].concat(pG,hG);fP.schema=mG});var o_=H(pP=>{"use strict";var pd=ft("buffer"),s_=Bt(),gG=ld(),yG={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof pd.Buffer=="function")return pd.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,s){if(!r)return"";let o=r,l;if(typeof pd.Buffer=="function")l=o instanceof pd.Buffer?o.toString("base64"):pd.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let f="";for(let c=0;c<o.length;++c)f+=String.fromCharCode(o[c]);l=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=s_.Scalar.BLOCK_LITERAL),e!==s_.Scalar.QUOTE_DOUBLE){let f=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(l.length/f),p=new Array(c);for(let h=0,g=0;h<c;++h,g+=f)p[h]=l.substr(g,f);l=p.join(e===s_.Scalar.BLOCK_LITERAL?`
146
146
  `:" ")}return gG.stringifyString({comment:t,type:e,value:l},n,i,s)}};pP.binary=yG});var cg=H(ug=>{"use strict";var lg=Ze(),a_=uo(),vG=Bt(),bG=po();function hP(t,e){if(lg.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!lg.isPair(n)){if(lg.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new a_.Pair(new vG.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}t.items[r]=lg.isPair(n)?n:new a_.Pair(n)}}else e("Expected a sequence for this tag");return t}function mP(t,e,r){let{replacer:n}=r,i=new bG.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(s++),o));let l,f;if(Array.isArray(o))if(o.length===2)l=o[0],f=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)l=c[0],f=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;i.items.push(a_.createPair(l,f,r))}return i}var SG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:hP,createNode:mP};ug.createPairs=mP;ug.pairs=SG;ug.resolvePairs=hP});var c_=H(u_=>{"use strict";var gP=Ze(),l_=so(),hd=fo(),wG=po(),yP=cg(),Ta=class t extends wG.YAMLSeq{constructor(){super(),this.add=hd.YAMLMap.prototype.add.bind(this),this.delete=hd.YAMLMap.prototype.delete.bind(this),this.get=hd.YAMLMap.prototype.get.bind(this),this.has=hd.YAMLMap.prototype.has.bind(this),this.set=hd.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,o;if(gP.isPair(i)?(s=l_.toJS(i.key,"",r),o=l_.toJS(i.value,s,r)):s=l_.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,o)}return n}static from(e,r,n){let i=yP.createPairs(e,r,n),s=new this;return s.items=i.items,s}};Ta.tag="tag:yaml.org,2002:omap";var _G={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ta,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=yP.resolvePairs(t,e),n=[];for(let{key:i}of r.items)gP.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Ta,r)},createNode:(t,e,r)=>Ta.from(t,e,r)};u_.YAMLOMap=Ta;u_.omap=_G});var _P=H(f_=>{"use strict";var vP=Bt();function bP({value:t,source:e},r){return e&&(t?SP:wP).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var SP={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new vP.Scalar(!0),stringify:bP},wP={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new vP.Scalar(!1),stringify:bP};f_.falseTag=wP;f_.trueTag=SP});var RP=H(fg=>{"use strict";var RG=Bt(),d_=Cu(),CG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:d_.stringifyNumber},xG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():d_.stringifyNumber(t)}},EG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new RG.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:d_.stringifyNumber};fg.float=EG;fg.floatExp=xG;fg.floatNaN=CG});var xP=H(gd=>{"use strict";var CP=Cu(),md=t=>typeof t=="bigint"||Number.isInteger(t);function dg(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let s=parseInt(t,r);return i==="-"?-1*s:s}function p_(t,e,r){let{value:n}=t;if(md(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return CP.stringifyNumber(t)}var IG={identify:md,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>dg(t,2,2,r),stringify:t=>p_(t,2,"0b")},qG={identify:md,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>dg(t,1,8,r),stringify:t=>p_(t,8,"0")},OG={identify:md,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>dg(t,0,10,r),stringify:CP.stringifyNumber},kG={identify:md,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>dg(t,2,16,r),stringify:t=>p_(t,16,"0x")};gd.int=OG;gd.intBin=IG;gd.intHex=kG;gd.intOct=qG});var m_=H(h_=>{"use strict";var mg=Ze(),pg=uo(),hg=fo(),Aa=class t extends hg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;mg.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new pg.Pair(e.key,null):r=new pg.Pair(e,null),hg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=hg.findPair(this.items,e);return!r&&mg.isPair(n)?mg.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=hg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new pg.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof i=="function"&&(o=i.call(r,o,o)),s.items.push(pg.createPair(o,null,n));return s}};Aa.tag="tag:yaml.org,2002:set";var PG={collection:"map",identify:t=>t instanceof Set,nodeClass:Aa,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Aa.from(t,e,r),resolve(t,e){if(mg.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Aa,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};h_.YAMLSet=Aa;h_.set=PG});var y_=H(gg=>{"use strict";var TG=Cu();function g_(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=n.replace(/_/g,"").split(":").reduce((o,l)=>o*i(60)+i(l),i(0));return r==="-"?i(-1)*s:s}function EP(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return TG.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(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(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var AG={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>g_(t,r),stringify:EP},$G={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>g_(t,!1),stringify:EP},IP={identify:t=>t 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(t){let e=t.match(IP.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,o,l]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(r,n-1,i,s||0,o||0,l||0,f),p=e[8];if(p&&p!=="Z"){let h=g_(p,!1);Math.abs(h)<30&&(h*=60),c-=6e4*h}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};gg.floatTime=$G;gg.intTime=AG;gg.timestamp=IP});var kP=H(OP=>{"use strict";var NG=_u(),MG=ng(),FG=Ru(),DG=dd(),LG=o_(),qP=_P(),v_=RP(),yg=xP(),jG=Ym(),UG=c_(),HG=cg(),BG=m_(),b_=y_(),VG=[NG.map,FG.seq,DG.string,MG.nullTag,qP.trueTag,qP.falseTag,yg.intBin,yg.intOct,yg.int,yg.intHex,v_.floatNaN,v_.floatExp,v_.float,LG.binary,jG.merge,UG.omap,HG.pairs,BG.set,b_.intTime,b_.floatTime,b_.timestamp];OP.schema=VG});var jP=H(__=>{"use strict";var $P=_u(),WG=ng(),NP=Ru(),zG=dd(),JG=Z0(),S_=e_(),w_=r_(),GG=uP(),YG=dP(),MP=o_(),yd=Ym(),FP=c_(),DP=cg(),PP=kP(),LP=m_(),vg=y_(),TP=new Map([["core",GG.schema],["failsafe",[$P.map,NP.seq,zG.string]],["json",YG.schema],["yaml11",PP.schema],["yaml-1.1",PP.schema]]),AP={binary:MP.binary,bool:JG.boolTag,float:S_.float,floatExp:S_.floatExp,floatNaN:S_.floatNaN,floatTime:vg.floatTime,int:w_.int,intHex:w_.intHex,intOct:w_.intOct,intTime:vg.intTime,map:$P.map,merge:yd.merge,null:WG.nullTag,omap:FP.omap,pairs:DP.pairs,seq:NP.seq,set:LP.set,timestamp:vg.timestamp},KG={"tag:yaml.org,2002:binary":MP.binary,"tag:yaml.org,2002:merge":yd.merge,"tag:yaml.org,2002:omap":FP.omap,"tag:yaml.org,2002:pairs":DP.pairs,"tag:yaml.org,2002:set":LP.set,"tag:yaml.org,2002:timestamp":vg.timestamp};function QG(t,e,r){let n=TP.get(e);if(n&&!t)return r&&!n.includes(yd.merge)?n.concat(yd.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(TP.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(yd.merge)),i.reduce((s,o)=>{let l=typeof o=="string"?AP[o]:o;if(!l){let f=JSON.stringify(o),c=Object.keys(AP).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${c}`)}return s.includes(l)||s.push(l),s},[])}__.coreKnownTags=KG;__.getTags=QG});var x_=H(UP=>{"use strict";var R_=Ze(),ZG=_u(),XG=Ru(),eY=dd(),bg=jP(),tY=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,C_=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?bg.getTags(e,"compat"):e?bg.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?bg.coreKnownTags:{},this.tags=bg.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,R_.MAP,{value:ZG.map}),Object.defineProperty(this,R_.SCALAR,{value:eY.string}),Object.defineProperty(this,R_.SEQ,{value:XG.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?tY:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};UP.Schema=C_});var BP=H(HP=>{"use strict";var rY=Ze(),E_=ud(),vd=sd();function nY(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let f=t.directives.toString(t);f?(r.push(f),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=E_.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(vd.indentComment(f,""))}let o=!1,l=null;if(t.contents){if(rY.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let p=s(t.contents.commentBefore);r.push(vd.indentComment(p,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let f=l?void 0:()=>o=!0,c=E_.stringify(t.contents,i,()=>l=null,f);l&&(c+=vd.lineComment(c,"",s(l))),(c[0]==="|"||c[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${c}`:r.push(c)}else r.push(E_.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
148
+ ${s.comment}`:n.comment}n=i}t.items[r]=lg.isPair(n)?n:new a_.Pair(n)}}else e("Expected a sequence for this tag");return t}function mP(t,e,r){let{replacer:n}=r,i=new bG.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(s++),o));let l,f;if(Array.isArray(o))if(o.length===2)l=o[0],f=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)l=c[0],f=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;i.items.push(a_.createPair(l,f,r))}return i}var SG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:hP,createNode:mP};ug.createPairs=mP;ug.pairs=SG;ug.resolvePairs=hP});var c_=H(u_=>{"use strict";var gP=Ze(),l_=so(),hd=fo(),wG=po(),yP=cg(),Ta=class t extends wG.YAMLSeq{constructor(){super(),this.add=hd.YAMLMap.prototype.add.bind(this),this.delete=hd.YAMLMap.prototype.delete.bind(this),this.get=hd.YAMLMap.prototype.get.bind(this),this.has=hd.YAMLMap.prototype.has.bind(this),this.set=hd.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,o;if(gP.isPair(i)?(s=l_.toJS(i.key,"",r),o=l_.toJS(i.value,s,r)):s=l_.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,o)}return n}static from(e,r,n){let i=yP.createPairs(e,r,n),s=new this;return s.items=i.items,s}};Ta.tag="tag:yaml.org,2002:omap";var _G={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ta,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=yP.resolvePairs(t,e),n=[];for(let{key:i}of r.items)gP.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Ta,r)},createNode:(t,e,r)=>Ta.from(t,e,r)};u_.YAMLOMap=Ta;u_.omap=_G});var _P=H(f_=>{"use strict";var vP=Bt();function bP({value:t,source:e},r){return e&&(t?SP:wP).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var SP={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new vP.Scalar(!0),stringify:bP},wP={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new vP.Scalar(!1),stringify:bP};f_.falseTag=wP;f_.trueTag=SP});var RP=H(fg=>{"use strict";var RG=Bt(),d_=Cu(),CG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:d_.stringifyNumber},xG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():d_.stringifyNumber(t)}},EG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new RG.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:d_.stringifyNumber};fg.float=EG;fg.floatExp=xG;fg.floatNaN=CG});var xP=H(gd=>{"use strict";var CP=Cu(),md=t=>typeof t=="bigint"||Number.isInteger(t);function dg(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let s=parseInt(t,r);return i==="-"?-1*s:s}function p_(t,e,r){let{value:n}=t;if(md(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return CP.stringifyNumber(t)}var IG={identify:md,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>dg(t,2,2,r),stringify:t=>p_(t,2,"0b")},OG={identify:md,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>dg(t,1,8,r),stringify:t=>p_(t,8,"0")},qG={identify:md,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>dg(t,0,10,r),stringify:CP.stringifyNumber},kG={identify:md,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>dg(t,2,16,r),stringify:t=>p_(t,16,"0x")};gd.int=qG;gd.intBin=IG;gd.intHex=kG;gd.intOct=OG});var m_=H(h_=>{"use strict";var mg=Ze(),pg=uo(),hg=fo(),Aa=class t extends hg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;mg.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new pg.Pair(e.key,null):r=new pg.Pair(e,null),hg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=hg.findPair(this.items,e);return!r&&mg.isPair(n)?mg.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=hg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new pg.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof i=="function"&&(o=i.call(r,o,o)),s.items.push(pg.createPair(o,null,n));return s}};Aa.tag="tag:yaml.org,2002:set";var PG={collection:"map",identify:t=>t instanceof Set,nodeClass:Aa,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Aa.from(t,e,r),resolve(t,e){if(mg.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Aa,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};h_.YAMLSet=Aa;h_.set=PG});var y_=H(gg=>{"use strict";var TG=Cu();function g_(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=n.replace(/_/g,"").split(":").reduce((o,l)=>o*i(60)+i(l),i(0));return r==="-"?i(-1)*s:s}function EP(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return TG.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(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(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var AG={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>g_(t,r),stringify:EP},$G={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>g_(t,!1),stringify:EP},IP={identify:t=>t 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(t){let e=t.match(IP.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,o,l]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(r,n-1,i,s||0,o||0,l||0,f),p=e[8];if(p&&p!=="Z"){let h=g_(p,!1);Math.abs(h)<30&&(h*=60),c-=6e4*h}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};gg.floatTime=$G;gg.intTime=AG;gg.timestamp=IP});var kP=H(qP=>{"use strict";var NG=_u(),MG=ng(),FG=Ru(),DG=dd(),LG=o_(),OP=_P(),v_=RP(),yg=xP(),jG=Ym(),UG=c_(),HG=cg(),BG=m_(),b_=y_(),VG=[NG.map,FG.seq,DG.string,MG.nullTag,OP.trueTag,OP.falseTag,yg.intBin,yg.intOct,yg.int,yg.intHex,v_.floatNaN,v_.floatExp,v_.float,LG.binary,jG.merge,UG.omap,HG.pairs,BG.set,b_.intTime,b_.floatTime,b_.timestamp];qP.schema=VG});var jP=H(__=>{"use strict";var $P=_u(),WG=ng(),NP=Ru(),zG=dd(),JG=Z0(),S_=e_(),w_=r_(),GG=uP(),YG=dP(),MP=o_(),yd=Ym(),FP=c_(),DP=cg(),PP=kP(),LP=m_(),vg=y_(),TP=new Map([["core",GG.schema],["failsafe",[$P.map,NP.seq,zG.string]],["json",YG.schema],["yaml11",PP.schema],["yaml-1.1",PP.schema]]),AP={binary:MP.binary,bool:JG.boolTag,float:S_.float,floatExp:S_.floatExp,floatNaN:S_.floatNaN,floatTime:vg.floatTime,int:w_.int,intHex:w_.intHex,intOct:w_.intOct,intTime:vg.intTime,map:$P.map,merge:yd.merge,null:WG.nullTag,omap:FP.omap,pairs:DP.pairs,seq:NP.seq,set:LP.set,timestamp:vg.timestamp},KG={"tag:yaml.org,2002:binary":MP.binary,"tag:yaml.org,2002:merge":yd.merge,"tag:yaml.org,2002:omap":FP.omap,"tag:yaml.org,2002:pairs":DP.pairs,"tag:yaml.org,2002:set":LP.set,"tag:yaml.org,2002:timestamp":vg.timestamp};function QG(t,e,r){let n=TP.get(e);if(n&&!t)return r&&!n.includes(yd.merge)?n.concat(yd.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(TP.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(yd.merge)),i.reduce((s,o)=>{let l=typeof o=="string"?AP[o]:o;if(!l){let f=JSON.stringify(o),c=Object.keys(AP).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${c}`)}return s.includes(l)||s.push(l),s},[])}__.coreKnownTags=KG;__.getTags=QG});var x_=H(UP=>{"use strict";var R_=Ze(),ZG=_u(),XG=Ru(),eY=dd(),bg=jP(),tY=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,C_=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?bg.getTags(e,"compat"):e?bg.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?bg.coreKnownTags:{},this.tags=bg.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,R_.MAP,{value:ZG.map}),Object.defineProperty(this,R_.SCALAR,{value:eY.string}),Object.defineProperty(this,R_.SEQ,{value:XG.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?tY:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};UP.Schema=C_});var BP=H(HP=>{"use strict";var rY=Ze(),E_=ud(),vd=sd();function nY(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let f=t.directives.toString(t);f?(r.push(f),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=E_.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(vd.indentComment(f,""))}let o=!1,l=null;if(t.contents){if(rY.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let p=s(t.contents.commentBefore);r.push(vd.indentComment(p,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let f=l?void 0:()=>o=!0,c=E_.stringify(t.contents,i,()=>l=null,f);l&&(c+=vd.lineComment(c,"",s(l))),(c[0]==="|"||c[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${c}`:r.push(c)}else r.push(E_.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
149
149
  `)?(r.push("..."),r.push(vd.indentComment(f,""))):r.push(`... ${f}`)}else r.push("...");else{let f=t.comment;f&&o&&(f=f.replace(/^\n+/,"")),f&&((!o||l)&&r[r.length-1]!==""&&r.push(""),r.push(vd.indentComment(s(f),"")))}return r.join(`
150
150
  `)+`
151
- `}HP.stringifyDocument=nY});var bd=H(VP=>{"use strict";var iY=nd(),xu=Lm(),Pn=Ze(),sY=uo(),oY=so(),aY=x_(),lY=BP(),I_=Nm(),uY=P0(),cY=id(),q_=k0(),O_=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Pn.NODE_TYPE,{value:Pn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=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:o}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new q_.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[Pn.NODE_TYPE]:{value:Pn.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=Pn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Eu(this.contents)&&this.contents.add(e)}addIn(e,r){Eu(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=I_.anchorNames(this);e.anchor=!r||n.has(r)?I_.findNewAnchor(r||"a",n):r}return new iY.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let E=T=>typeof T=="number"||T instanceof String||T instanceof Number,k=r.filter(E).map(String);k.length>0&&(r=r.concat(k)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:f,onTagObj:c,tag:p}=n??{},{onAnchor:h,setAnchors:g,sourceObjects:v}=I_.createNodeAnchors(this,o||"a"),_={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:h,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:v},w=cY.createNode(e,p,_);return l&&Pn.isCollection(w)&&(w.flow=!0),g(),w}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new sY.Pair(i,s)}delete(e){return Eu(this.contents)?this.contents.delete(e):!1}deleteIn(e){return xu.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Eu(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Pn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return xu.isEmptyPath(e)?!r&&Pn.isScalar(this.contents)?this.contents.value:this.contents:Pn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Pn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return xu.isEmptyPath(e)?this.contents!==void 0:Pn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=xu.collectionFromPath(this.schema,[e],r):Eu(this.contents)&&this.contents.set(e,r)}setIn(e,r){xu.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=xu.collectionFromPath(this.schema,Array.from(e),r):Eu(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new q_.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 q_.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(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new aY.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:o}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=oY.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:c,res:p}of l.anchors.values())s(p,c);return typeof o=="function"?uY.applyReviver(o,{"":f},"",f):f}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}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 r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return lY.stringifyDocument(this,e)}};function Eu(t){if(Pn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}VP.Document=O_});var _d=H(wd=>{"use strict";var Sd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},k_=class extends Sd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},P_=class extends Sd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},fY=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(l=>e.linePos(l));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let l=Math.min(s-39,o.length-79);o="\u2026"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,s))){let l=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
151
+ `}HP.stringifyDocument=nY});var bd=H(VP=>{"use strict";var iY=nd(),xu=Lm(),Pn=Ze(),sY=uo(),oY=so(),aY=x_(),lY=BP(),I_=Nm(),uY=P0(),cY=id(),O_=k0(),q_=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Pn.NODE_TYPE,{value:Pn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=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:o}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new O_.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[Pn.NODE_TYPE]:{value:Pn.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=Pn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Eu(this.contents)&&this.contents.add(e)}addIn(e,r){Eu(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=I_.anchorNames(this);e.anchor=!r||n.has(r)?I_.findNewAnchor(r||"a",n):r}return new iY.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let E=T=>typeof T=="number"||T instanceof String||T instanceof Number,k=r.filter(E).map(String);k.length>0&&(r=r.concat(k)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:f,onTagObj:c,tag:p}=n??{},{onAnchor:h,setAnchors:g,sourceObjects:v}=I_.createNodeAnchors(this,o||"a"),_={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:h,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:v},w=cY.createNode(e,p,_);return l&&Pn.isCollection(w)&&(w.flow=!0),g(),w}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new sY.Pair(i,s)}delete(e){return Eu(this.contents)?this.contents.delete(e):!1}deleteIn(e){return xu.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Eu(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Pn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return xu.isEmptyPath(e)?!r&&Pn.isScalar(this.contents)?this.contents.value:this.contents:Pn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Pn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return xu.isEmptyPath(e)?this.contents!==void 0:Pn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=xu.collectionFromPath(this.schema,[e],r):Eu(this.contents)&&this.contents.set(e,r)}setIn(e,r){xu.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=xu.collectionFromPath(this.schema,Array.from(e),r):Eu(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new O_.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 O_.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(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new aY.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:o}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=oY.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:c,res:p}of l.anchors.values())s(p,c);return typeof o=="function"?uY.applyReviver(o,{"":f},"",f):f}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}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 r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return lY.stringifyDocument(this,e)}};function Eu(t){if(Pn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}VP.Document=q_});var _d=H(wd=>{"use strict";var Sd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},k_=class extends Sd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},P_=class extends Sd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},fY=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(l=>e.linePos(l));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let l=Math.min(s-39,o.length-79);o="\u2026"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,s))){let l=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
152
152
  `),o=l+o}if(/[^ ]/.test(o)){let l=1,f=r.linePos[1];f?.line===n&&f.col>i&&(l=Math.max(1,Math.min(f.col-i,80-s)));let c=" ".repeat(s)+"^".repeat(l);r.message+=`:
153
153
 
154
154
  ${o}
155
155
  ${c}
156
- `}};wd.YAMLError=Sd;wd.YAMLParseError=k_;wd.YAMLWarning=P_;wd.prettifyError=fY});var Rd=H(WP=>{"use strict";function dY(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:l}){let f=!1,c=l,p=l,h="",g="",v=!1,_=!1,w=null,E=null,k=null,T=null,N=null,$=null,j=null;for(let C of t)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),w&&(c&&C.type!=="comment"&&C.type!=="newline"&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),C.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&C.source.includes(" ")&&(w=C),p=!0;break;case"comment":{p||s(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=C.source.substring(1)||" ";h?h+=g+A:h=A,g="",c=!1;break}case"newline":c?h?h+=C.source:(!$||r!=="seq-item-ind")&&(f=!0):g+=C.source,c=!0,v=!0,(E||k)&&(T=C),p=!0;break;case"anchor":E&&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),E=C,j??(j=C.offset),c=!1,p=!1,_=!0;break;case"tag":{k&&s(C,"MULTIPLE_TAGS","A node can have at most one tag"),k=C,j??(j=C.offset),c=!1,p=!1,_=!0;break}case r:(E||k)&&s(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),$&&s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${e??"collection"}`),$=C,c=r==="seq-item-ind"||r==="explicit-key-ind",p=!1;break;case"comma":if(e){N&&s(C,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),N=C,c=!1,p=!1;break}default:s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),c=!1,p=!1}let G=t[t.length-1],O=G?G.offset+G.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"),w&&(c&&w.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:N,found:$,spaceBefore:f,comment:h,hasNewline:v,anchor:E,tag:k,newlineAfterProp:T,end:O,start:j??O}}WP.resolveProps=dY});var Sg=H(zP=>{"use strict";function T_(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
156
+ `}};wd.YAMLError=Sd;wd.YAMLParseError=k_;wd.YAMLWarning=P_;wd.prettifyError=fY});var Rd=H(WP=>{"use strict";function dY(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:l}){let f=!1,c=l,p=l,h="",g="",v=!1,_=!1,w=null,E=null,k=null,T=null,N=null,$=null,j=null;for(let C of t)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),w&&(c&&C.type!=="comment"&&C.type!=="newline"&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),C.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&C.source.includes(" ")&&(w=C),p=!0;break;case"comment":{p||s(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=C.source.substring(1)||" ";h?h+=g+A:h=A,g="",c=!1;break}case"newline":c?h?h+=C.source:(!$||r!=="seq-item-ind")&&(f=!0):g+=C.source,c=!0,v=!0,(E||k)&&(T=C),p=!0;break;case"anchor":E&&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),E=C,j??(j=C.offset),c=!1,p=!1,_=!0;break;case"tag":{k&&s(C,"MULTIPLE_TAGS","A node can have at most one tag"),k=C,j??(j=C.offset),c=!1,p=!1,_=!0;break}case r:(E||k)&&s(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),$&&s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${e??"collection"}`),$=C,c=r==="seq-item-ind"||r==="explicit-key-ind",p=!1;break;case"comma":if(e){N&&s(C,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),N=C,c=!1,p=!1;break}default:s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),c=!1,p=!1}let G=t[t.length-1],q=G?G.offset+G.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"),w&&(c&&w.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:N,found:$,spaceBefore:f,comment:h,hasNewline:v,anchor:E,tag:k,newlineAfterProp:T,end:q,start:j??q}}WP.resolveProps=dY});var Sg=H(zP=>{"use strict";function T_(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
157
157
  `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(T_(e.key)||T_(e.value))return!0}return!1;default:return!0}}zP.containsNewline=T_});var A_=H(JP=>{"use strict";var pY=Sg();function hY(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&pY.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}JP.flowIndentCheck=hY});var $_=H(YP=>{"use strict";var GP=Ze();function mY(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,o)=>s===o||GP.isScalar(s)&&GP.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,r))}YP.mapIncludes=mY});var tT=H(eT=>{"use strict";var KP=uo(),gY=fo(),QP=Rd(),yY=Sg(),ZP=A_(),vY=$_(),XP="All mapping items must start at the same column";function bY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??gY.YAMLMap,l=new o(r.schema);r.atRoot&&(r.atRoot=!1);let f=n.offset,c=null;for(let p of n.items){let{start:h,key:g,sep:v,value:_}=p,w=QP.resolveProps(h,{indicator:"explicit-key-ind",next:g??v?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0}),E=!w.found;if(E){if(g&&(g.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==n.indent&&i(f,"BAD_INDENT",XP)),!w.anchor&&!w.tag&&!v){c=w.end,w.comment&&(l.comment?l.comment+=`
158
158
  `+w.comment:l.comment=w.comment);continue}(w.newlineAfterProp||yY.containsNewline(g))&&i(g??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else w.found?.indent!==n.indent&&i(f,"BAD_INDENT",XP);r.atKey=!0;let k=w.end,T=g?t(r,g,w,i):e(r,k,h,null,w,i);r.schema.compat&&ZP.flowIndentCheck(n.indent,g,i),r.atKey=!1,vY.mapIncludes(r,l.items,T)&&i(k,"DUPLICATE_KEY","Map keys must be unique");let N=QP.resolveProps(v??[],{indicator:"map-value-ind",next:_,offset:T.range[2],onError:i,parentIndent:n.indent,startOnNewline:!g||g.type==="block-scalar"});if(f=N.end,N.found){E&&(_?.type==="block-map"&&!N.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&w.start<N.found.offset-1024&&i(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let $=_?t(r,_,N,i):e(r,f,v,null,N,i);r.schema.compat&&ZP.flowIndentCheck(n.indent,_,i),f=$.range[2];let j=new KP.Pair(T,$);r.options.keepSourceTokens&&(j.srcToken=p),l.items.push(j)}else{E&&i(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),N.comment&&(T.comment?T.comment+=`
159
- `+N.comment:T.comment=N.comment);let $=new KP.Pair(T);r.options.keepSourceTokens&&($.srcToken=p),l.items.push($)}}return c&&c<f&&i(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,f,c??f],l}eT.resolveBlockMap=bY});var nT=H(rT=>{"use strict";var SY=po(),wY=Rd(),_Y=A_();function RY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??SY.YAMLSeq,l=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset,c=null;for(let{start:p,value:h}of n.items){let g=wY.resolveProps(p,{indicator:"seq-item-ind",next:h,offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||h)h?.type==="block-seq"?i(g.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{c=g.end,g.comment&&(l.comment=g.comment);continue}let v=h?t(r,h,g,i):e(r,g.end,p,null,g,i);r.schema.compat&&_Y.flowIndentCheck(n.indent,h,i),f=v.range[2],l.items.push(v)}return l.range=[n.offset,f,c??f],l}rT.resolveBlockSeq=RY});var Iu=H(iT=>{"use strict";function CY(t,e,r,n){let i="";if(t){let s=!1,o="";for(let l of t){let{source:f,type:c}=l;switch(c){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=f.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=f),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=f.length}}return{comment:i,offset:e}}iT.resolveEnd=CY});var lT=H(aT=>{"use strict";var xY=Ze(),EY=uo(),sT=fo(),IY=po(),qY=Iu(),oT=Rd(),OY=Sg(),kY=$_(),N_="Block collections are not allowed within flow collections",M_=t=>t&&(t.type==="block-map"||t.type==="block-seq");function PY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=n.start.source==="{",l=o?"flow map":"flow sequence",f=s?.nodeClass??(o?sT.YAMLMap:IY.YAMLSeq),c=new f(r.schema);c.flow=!0;let p=r.atRoot;p&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let h=n.offset+n.start.source.length;for(let E=0;E<n.items.length;++E){let k=n.items[E],{start:T,key:N,sep:$,value:j}=k,G=oT.resolveProps(T,{flow:l,indicator:"explicit-key-ind",next:N??$?.[0],offset:h,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!G.found){if(!G.anchor&&!G.tag&&!$&&!j){E===0&&G.comma?i(G.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):E<n.items.length-1&&i(G.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),G.comment&&(c.comment?c.comment+=`
160
- `+G.comment:c.comment=G.comment),h=G.end;continue}!o&&r.options.strict&&OY.containsNewline(N)&&i(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)G.comma&&i(G.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(G.comma||i(G.start,"MISSING_CHAR",`Missing , between ${l} items`),G.comment){let O="";e:for(let C of T)switch(C.type){case"comma":case"space":break;case"comment":O=C.source.substring(1);break e;default:break e}if(O){let C=c.items[c.items.length-1];xY.isPair(C)&&(C=C.value??C.key),C.comment?C.comment+=`
161
- `+O:C.comment=O,G.comment=G.comment.substring(O.length+1)}}if(!o&&!$&&!G.found){let O=j?t(r,j,G,i):e(r,G.end,$,null,G,i);c.items.push(O),h=O.range[2],M_(j)&&i(O.range,"BLOCK_IN_FLOW",N_)}else{r.atKey=!0;let O=G.end,C=N?t(r,N,G,i):e(r,O,T,null,G,i);M_(N)&&i(C.range,"BLOCK_IN_FLOW",N_),r.atKey=!1;let A=oT.resolveProps($??[],{flow:l,indicator:"map-value-ind",next:j,offset:C.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(A.found){if(!o&&!G.found&&r.options.strict){if($)for(let F of $){if(F===A.found)break;if(F.type==="newline"){i(F,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}G.start<A.found.offset-1024&&i(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else j&&("source"in j&&j.source?.[0]===":"?i(j,"MISSING_CHAR",`Missing space after : in ${l}`):i(A.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let D=j?t(r,j,A,i):A.found?e(r,A.end,$,null,A,i):null;D?M_(j)&&i(D.range,"BLOCK_IN_FLOW",N_):A.comment&&(C.comment?C.comment+=`
162
- `+A.comment:C.comment=A.comment);let B=new EY.Pair(C,D);if(r.options.keepSourceTokens&&(B.srcToken=k),o){let F=c;kY.mapIncludes(r,F.items,C)&&i(O,"DUPLICATE_KEY","Map keys must be unique"),F.items.push(B)}else{let F=new sT.YAMLMap(r.schema);F.flow=!0,F.items.push(B);let K=(D??C).range;F.range=[C.range[0],K[1],K[2]],c.items.push(F)}h=D?D.range[2]:A.end}}let g=o?"}":"]",[v,..._]=n.end,w=h;if(v?.source===g)w=v.offset+v.source.length;else{let E=l[0].toUpperCase()+l.substring(1),k=p?`${E} must end with a ${g}`:`${E} in block collection must be sufficiently indented and end with a ${g}`;i(h,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&_.unshift(v)}if(_.length>0){let E=qY.resolveEnd(_,w,r.options.strict,i);E.comment&&(c.comment?c.comment+=`
159
+ `+N.comment:T.comment=N.comment);let $=new KP.Pair(T);r.options.keepSourceTokens&&($.srcToken=p),l.items.push($)}}return c&&c<f&&i(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,f,c??f],l}eT.resolveBlockMap=bY});var nT=H(rT=>{"use strict";var SY=po(),wY=Rd(),_Y=A_();function RY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??SY.YAMLSeq,l=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset,c=null;for(let{start:p,value:h}of n.items){let g=wY.resolveProps(p,{indicator:"seq-item-ind",next:h,offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||h)h?.type==="block-seq"?i(g.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{c=g.end,g.comment&&(l.comment=g.comment);continue}let v=h?t(r,h,g,i):e(r,g.end,p,null,g,i);r.schema.compat&&_Y.flowIndentCheck(n.indent,h,i),f=v.range[2],l.items.push(v)}return l.range=[n.offset,f,c??f],l}rT.resolveBlockSeq=RY});var Iu=H(iT=>{"use strict";function CY(t,e,r,n){let i="";if(t){let s=!1,o="";for(let l of t){let{source:f,type:c}=l;switch(c){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=f.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=f),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=f.length}}return{comment:i,offset:e}}iT.resolveEnd=CY});var lT=H(aT=>{"use strict";var xY=Ze(),EY=uo(),sT=fo(),IY=po(),OY=Iu(),oT=Rd(),qY=Sg(),kY=$_(),N_="Block collections are not allowed within flow collections",M_=t=>t&&(t.type==="block-map"||t.type==="block-seq");function PY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=n.start.source==="{",l=o?"flow map":"flow sequence",f=s?.nodeClass??(o?sT.YAMLMap:IY.YAMLSeq),c=new f(r.schema);c.flow=!0;let p=r.atRoot;p&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let h=n.offset+n.start.source.length;for(let E=0;E<n.items.length;++E){let k=n.items[E],{start:T,key:N,sep:$,value:j}=k,G=oT.resolveProps(T,{flow:l,indicator:"explicit-key-ind",next:N??$?.[0],offset:h,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!G.found){if(!G.anchor&&!G.tag&&!$&&!j){E===0&&G.comma?i(G.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):E<n.items.length-1&&i(G.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),G.comment&&(c.comment?c.comment+=`
160
+ `+G.comment:c.comment=G.comment),h=G.end;continue}!o&&r.options.strict&&qY.containsNewline(N)&&i(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)G.comma&&i(G.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(G.comma||i(G.start,"MISSING_CHAR",`Missing , between ${l} items`),G.comment){let q="";e:for(let C of T)switch(C.type){case"comma":case"space":break;case"comment":q=C.source.substring(1);break e;default:break e}if(q){let C=c.items[c.items.length-1];xY.isPair(C)&&(C=C.value??C.key),C.comment?C.comment+=`
161
+ `+q:C.comment=q,G.comment=G.comment.substring(q.length+1)}}if(!o&&!$&&!G.found){let q=j?t(r,j,G,i):e(r,G.end,$,null,G,i);c.items.push(q),h=q.range[2],M_(j)&&i(q.range,"BLOCK_IN_FLOW",N_)}else{r.atKey=!0;let q=G.end,C=N?t(r,N,G,i):e(r,q,T,null,G,i);M_(N)&&i(C.range,"BLOCK_IN_FLOW",N_),r.atKey=!1;let A=oT.resolveProps($??[],{flow:l,indicator:"map-value-ind",next:j,offset:C.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(A.found){if(!o&&!G.found&&r.options.strict){if($)for(let F of $){if(F===A.found)break;if(F.type==="newline"){i(F,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}G.start<A.found.offset-1024&&i(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else j&&("source"in j&&j.source?.[0]===":"?i(j,"MISSING_CHAR",`Missing space after : in ${l}`):i(A.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let D=j?t(r,j,A,i):A.found?e(r,A.end,$,null,A,i):null;D?M_(j)&&i(D.range,"BLOCK_IN_FLOW",N_):A.comment&&(C.comment?C.comment+=`
162
+ `+A.comment:C.comment=A.comment);let B=new EY.Pair(C,D);if(r.options.keepSourceTokens&&(B.srcToken=k),o){let F=c;kY.mapIncludes(r,F.items,C)&&i(q,"DUPLICATE_KEY","Map keys must be unique"),F.items.push(B)}else{let F=new sT.YAMLMap(r.schema);F.flow=!0,F.items.push(B);let K=(D??C).range;F.range=[C.range[0],K[1],K[2]],c.items.push(F)}h=D?D.range[2]:A.end}}let g=o?"}":"]",[v,..._]=n.end,w=h;if(v?.source===g)w=v.offset+v.source.length;else{let E=l[0].toUpperCase()+l.substring(1),k=p?`${E} must end with a ${g}`:`${E} in block collection must be sufficiently indented and end with a ${g}`;i(h,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&_.unshift(v)}if(_.length>0){let E=OY.resolveEnd(_,w,r.options.strict,i);E.comment&&(c.comment?c.comment+=`
163
163
  `+E.comment:c.comment=E.comment),c.range=[n.offset,w,E.offset]}else c.range=[n.offset,w,w];return c}aT.resolveFlowCollection=PY});var cT=H(uT=>{"use strict";var TY=Ze(),AY=Bt(),$Y=fo(),NY=po(),MY=tT(),FY=nT(),DY=lT();function F_(t,e,r,n,i,s){let o=r.type==="block-map"?MY.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?FY.resolveBlockSeq(t,e,r,n,s):DY.resolveFlowCollection(t,e,r,n,s),l=o.constructor;return i==="!"||i===l.tagName?(o.tag=l.tagName,o):(i&&(o.tag=i),o)}function LY(t,e,r,n,i){let s=n.tag,o=s?e.directives.tagName(s.source,g=>i(s,"TAG_RESOLVE_FAILED",g)):null;if(r.type==="block-seq"){let{anchor:g,newlineAfterProp:v}=n,_=g&&s?g.offset>s.offset?g:s:g??s;_&&(!v||v.offset<_.offset)&&i(_,"MISSING_CHAR","Missing newline after block sequence props")}let l=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===$Y.YAMLMap.tagName&&l==="map"||o===NY.YAMLSeq.tagName&&l==="seq")return F_(t,e,r,i,o);let f=e.schema.tags.find(g=>g.tag===o&&g.collection===l);if(!f){let g=e.schema.knownTags[o];if(g?.collection===l)e.schema.tags.push(Object.assign({},g,{default:!1})),f=g;else return g?i(s,"BAD_COLLECTION_TYPE",`${g.tag} used for ${l} collection, but expects ${g.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),F_(t,e,r,i,o)}let c=F_(t,e,r,i,o,f),p=f.resolve?.(c,g=>i(s,"TAG_RESOLVE_FAILED",g),e.options)??c,h=TY.isNode(p)?p:new AY.Scalar(p);return h.range=c.range,h.tag=o,f?.format&&(h.format=f.format),h}uT.composeCollection=LY});var L_=H(fT=>{"use strict";var D_=Bt();function jY(t,e,r){let n=e.offset,i=UY(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?D_.Scalar.BLOCK_FOLDED:D_.Scalar.BLOCK_LITERAL,o=e.source?HY(e.source):[],l=o.length;for(let w=o.length-1;w>=0;--w){let E=o[w][1];if(E===""||E==="\r")l=w;else break}if(l===0){let w=i.chomp==="+"&&o.length>0?`
164
164
  `.repeat(Math.max(1,o.length-1)):"",E=n+i.length;return e.source&&(E+=e.source.length),{value:w,type:s,comment:i.comment,range:[n,E,E]}}let f=e.indent+i.indent,c=e.offset+i.length,p=0;for(let w=0;w<l;++w){let[E,k]=o[w];if(k===""||k==="\r")i.indent===0&&E.length>f&&(f=E.length);else{E.length<f&&r(c+E.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=E.length),p=w,f===0&&!t.atRoot&&r(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=E.length+k.length+1}for(let w=o.length-1;w>=l;--w)o[w][0].length>f&&(l=w+1);let h="",g="",v=!1;for(let w=0;w<p;++w)h+=o[w][0].slice(f)+`
165
165
  `;for(let w=p;w<l;++w){let[E,k]=o[w];c+=E.length+k.length+1;let T=k[k.length-1]==="\r";if(T&&(k=k.slice(0,-1)),k&&E.length<f){let $=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(c-k.length-(T?2:1),"BAD_INDENT",$),E=""}s===D_.Scalar.BLOCK_LITERAL?(h+=g+E.slice(f)+k,g=`
@@ -197,17 +197,17 @@ ${c}
197
197
  ${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(xT.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];xT.isPair(o)&&(o=o.key);let l=o.commentBefore;o.commentBefore=l?`${n}
198
198
  ${l}`:n}else{let o=s.commentBefore;s.commentBefore=o?`${n}
199
199
  ${o}`:n}}if(r){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:ET(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(hK.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let s=xd(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=yK.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Cd.YAMLParseError(xd(e),"UNEXPECTED_TOKEN",r);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 Cd.YAMLParseError(xd(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=vK.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
200
- ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Cd.YAMLParseError(xd(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-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 gK.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};IT.Composer=V_});var kT=H(wg=>{"use strict";var bK=L_(),SK=U_(),wK=_d(),qT=ld();function _K(t,e=!0,r){if(t){let n=(i,s,o)=>{let l=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(l,s,o);else throw new wK.YAMLParseError([l,l+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return SK.resolveFlowScalar(t,e,n);case"block-scalar":return bK.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function RK(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,l=qT.stringifyString({type:o,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),f=e.end??[{type:"newline",offset:-1,indent:n,source:`
200
+ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Cd.YAMLParseError(xd(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-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 gK.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};IT.Composer=V_});var kT=H(wg=>{"use strict";var bK=L_(),SK=U_(),wK=_d(),OT=ld();function _K(t,e=!0,r){if(t){let n=(i,s,o)=>{let l=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(l,s,o);else throw new wK.YAMLParseError([l,l+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return SK.resolveFlowScalar(t,e,n);case"block-scalar":return bK.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function RK(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,l=OT.stringifyString({type:o,value:t},{implicitKey:r,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 c=l.indexOf(`
202
202
  `),p=l.substring(0,c),h=l.substring(c+1)+`
203
- `,g=[{type:"block-scalar-header",offset:s,indent:n,source:p}];return OT(g,f)||g.push({type:"newline",offset:-1,indent:n,source:`
204
- `}),{type:"block-scalar",offset:s,indent:n,props:g,source:h}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:l,end:f};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:l,end:f};default:return{type:"scalar",offset:s,indent:n,source:l,end:f}}}function CK(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=r,l="indent"in t?t.indent:null;if(n&&typeof l=="number"&&(l+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=t.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let f=qT.stringifyString({type:o,value:e},{implicitKey:i||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":xK(t,f);break;case'"':z_(t,f,"double-quoted-scalar");break;case"'":z_(t,f,"single-quoted-scalar");break;default:z_(t,f,"scalar")}}function xK(t,e){let r=e.indexOf(`
203
+ `,g=[{type:"block-scalar-header",offset:s,indent:n,source:p}];return qT(g,f)||g.push({type:"newline",offset:-1,indent:n,source:`
204
+ `}),{type:"block-scalar",offset:s,indent:n,props:g,source:h}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:l,end:f};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:l,end:f};default:return{type:"scalar",offset:s,indent:n,source:l,end:f}}}function CK(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=r,l="indent"in t?t.indent:null;if(n&&typeof l=="number"&&(l+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=t.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let f=OT.stringifyString({type:o,value:e},{implicitKey:i||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":xK(t,f);break;case'"':z_(t,f,"double-quoted-scalar");break;case"'":z_(t,f,"single-quoted-scalar");break;default:z_(t,f,"scalar")}}function xK(t,e){let r=e.indexOf(`
205
205
  `),n=e.substring(0,r),i=e.substring(r+1)+`
206
- `;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,o="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:o,source:n}];OT(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:o,source:`
207
- `});for(let f of Object.keys(t))f!=="type"&&f!=="offset"&&delete t[f];Object.assign(t,{type:"block-scalar",indent:o,props:l,source:i})}}function OT(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function z_(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of n)s.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
208
- `};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}wg.createScalarToken=RK;wg.resolveAsScalar=_K;wg.setScalarValue=CK});var TT=H(PT=>{"use strict";var EK=t=>"type"in t?Rg(t):_g(t);function Rg(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Rg(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=_g(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=_g(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=_g(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function _g({start:t,key:e,sep:r,value:n}){let i="";for(let s of t)i+=s.source;if(e&&(i+=Rg(e)),r)for(let s of r)i+=s.source;return n&&(i+=Rg(n)),i}PT.stringify=EK});var MT=H(NT=>{"use strict";var J_=Symbol("break visit"),IK=Symbol("skip children"),AT=Symbol("remove item");function Na(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),$T(Object.freeze([]),t,e)}Na.BREAK=J_;Na.SKIP=IK;Na.REMOVE=AT;Na.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[i];else return}return r};Na.parentCollection=(t,e)=>{let r=Na.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function $T(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let l=$T(Object.freeze(t.concat([[i,o]])),s.items[o],r);if(typeof l=="number")o=l-1;else{if(l===J_)return J_;l===AT&&(s.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}NT.visit=Na});var Cg=H(Gr=>{"use strict";var G_=kT(),qK=TT(),OK=MT(),Y_="\uFEFF",K_="",Q_="",Z_="",kK=t=>!!t&&"items"in t,PK=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function TK(t){switch(t){case Y_:return"<BOM>";case K_:return"<DOC>";case Q_:return"<FLOW_END>";case Z_:return"<SCALAR>";default:return JSON.stringify(t)}}function AK(t){switch(t){case Y_:return"byte-order-mark";case K_:return"doc-mode";case Q_:return"flow-error-end";case Z_:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
206
+ `;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,o="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:o,source:n}];qT(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:o,source:`
207
+ `});for(let f of Object.keys(t))f!=="type"&&f!=="offset"&&delete t[f];Object.assign(t,{type:"block-scalar",indent:o,props:l,source:i})}}function qT(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function z_(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of n)s.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
208
+ `};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}wg.createScalarToken=RK;wg.resolveAsScalar=_K;wg.setScalarValue=CK});var TT=H(PT=>{"use strict";var EK=t=>"type"in t?Rg(t):_g(t);function Rg(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Rg(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=_g(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=_g(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=_g(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function _g({start:t,key:e,sep:r,value:n}){let i="";for(let s of t)i+=s.source;if(e&&(i+=Rg(e)),r)for(let s of r)i+=s.source;return n&&(i+=Rg(n)),i}PT.stringify=EK});var MT=H(NT=>{"use strict";var J_=Symbol("break visit"),IK=Symbol("skip children"),AT=Symbol("remove item");function Na(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),$T(Object.freeze([]),t,e)}Na.BREAK=J_;Na.SKIP=IK;Na.REMOVE=AT;Na.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[i];else return}return r};Na.parentCollection=(t,e)=>{let r=Na.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function $T(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let l=$T(Object.freeze(t.concat([[i,o]])),s.items[o],r);if(typeof l=="number")o=l-1;else{if(l===J_)return J_;l===AT&&(s.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}NT.visit=Na});var Cg=H(Gr=>{"use strict";var G_=kT(),OK=TT(),qK=MT(),Y_="\uFEFF",K_="",Q_="",Z_="",kK=t=>!!t&&"items"in t,PK=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function TK(t){switch(t){case Y_:return"<BOM>";case K_:return"<DOC>";case Q_:return"<FLOW_END>";case Z_:return"<SCALAR>";default:return JSON.stringify(t)}}function AK(t){switch(t){case Y_:return"byte-order-mark";case K_:return"doc-mode";case Q_:return"flow-error-end";case Z_: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(t[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}Gr.createScalarToken=G_.createScalarToken;Gr.resolveAsScalar=G_.resolveAsScalar;Gr.setScalarValue=G_.setScalarValue;Gr.stringify=qK.stringify;Gr.visit=OK.visit;Gr.BOM=Y_;Gr.DOCUMENT=K_;Gr.FLOW_END=Q_;Gr.SCALAR=Z_;Gr.isCollection=kK;Gr.isScalar=PK;Gr.prettyToken=TK;Gr.tokenType=AK});var tR=H(DT=>{"use strict";var Ed=Cg();function si(t){switch(t){case void 0:case" ":case`
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(t[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}Gr.createScalarToken=G_.createScalarToken;Gr.resolveAsScalar=G_.resolveAsScalar;Gr.setScalarValue=G_.setScalarValue;Gr.stringify=OK.stringify;Gr.visit=qK.visit;Gr.BOM=Y_;Gr.DOCUMENT=K_;Gr.FLOW_END=Q_;Gr.SCALAR=Z_;Gr.isCollection=kK;Gr.isScalar=PK;Gr.prettyToken=TK;Gr.tokenType=AK});var tR=H(DT=>{"use strict";var Ed=Cg();function si(t){switch(t){case void 0:case" ":case`
211
211
  `:case"\r":case" ":return!0;default:return!1}}var FT=new Set("0123456789ABCDEFabcdef"),$K=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),xg=new Set(",[]{}"),NK=new Set(` ,[]{}
212
212
  \r `),X_=t=>!t||NK.has(t),eR=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,r=!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=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
213
213
  `?!0:r==="\r"?this.buffer[e+1]===`
@@ -226,20 +226,20 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
226
226
  `,s=this.buffer[n+1]):r=n),s==="#"||e&&xg.has(s))break;if(i===`
227
227
  `){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&xg.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ed.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(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(X_),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(si(n)||r&&xg.has(n)){r?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,r=this.buffer[e];for(;!si(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if($K.has(r))r=this.buffer[++e];else if(r==="%"&&FT.has(this.buffer[e+1])&&FT.has(this.buffer[e+2]))r=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 r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};DT.Lexer=eR});var nR=H(LT=>{"use strict";var rR=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<e?r=s+1:n=s}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};LT.LineCounter=rR});var sR=H(VT=>{"use strict";var MK=ft("process"),jT=Cg(),FK=tR();function ho(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function UT(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function BT(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Eg(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function qu(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Ig(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function HT(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!ho(e.start,"explicit-key-ind")&&!ho(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,BT(e.value)?e.value.end?Ig(e.value.end,e.sep):e.value.end=e.sep:Ig(e.start,e.sep),delete e.sep)}var iR=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 FK.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,MK.env.LOG_TOKENS&&console.log("|",jT.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=jT.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){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 r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&HT(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,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:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&UT(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.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":{UT(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 r=this.startBlockValue(e);r?this.stack.push(r):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 r=Eg(this.peek(2)),n=qu(r),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 r=this.source.indexOf(`
229
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};DT.Lexer=eR});var nR=H(LT=>{"use strict";var rR=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<e?r=s+1:n=s}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};LT.LineCounter=rR});var sR=H(VT=>{"use strict";var MK=ft("process"),jT=Cg(),FK=tR();function ho(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function UT(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function BT(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Eg(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Ou(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Ig(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function HT(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!ho(e.start,"explicit-key-ind")&&!ho(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,BT(e.value)?e.value.end?Ig(e.value.end,e.sep):e.value.end=e.sep:Ig(e.start,e.sep),delete e.sep)}var iR=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 FK.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,MK.env.LOG_TOKENS&&console.log("|",jT.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=jT.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){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 r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&HT(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,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:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&UT(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.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":{UT(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 r=this.startBlockValue(e);r?this.stack.push(r):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 r=Eg(this.peek(2)),n=Ou(r),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 r=this.source.indexOf(`
230
230
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
231
- `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.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 r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Ig(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let o=[];for(let l=0;l<r.sep.length;++l){let f=r.sep[l];switch(f.type){case"newline":o.push(l);break;case"space":break;case"comment":f.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.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(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ho(r.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(BT(r.key)&&!ho(r.sep,"newline")){let o=qu(r.start),l=r.key,f=r.sep;f.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:f}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(ho(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=qu(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):ho(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||r.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!r.explicitKey&&r.sep&&!ho(r.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(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.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 r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Ig(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||ho(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.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 r=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":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{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=Eg(n),s=qu(i);HT(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
231
+ `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.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 r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Ig(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let o=[];for(let l=0;l<r.sep.length;++l){let f=r.sep[l];switch(f.type){case"newline":o.push(l);break;case"space":break;case"comment":f.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.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(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ho(r.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(BT(r.key)&&!ho(r.sep,"newline")){let o=Ou(r.start),l=r.key,f=r.sep;f.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:f}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(ho(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=Ou(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):ho(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||r.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!r.explicitKey&&r.sep&&!ho(r.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(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.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 r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Ig(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||ho(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.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 r=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":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{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=Eg(n),s=Ou(i);HT(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
232
232
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
233
- `,r)+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 r=Eg(e),n=qu(r);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 r=Eg(e),n=qu(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!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())}}};VT.Parser=iR});var YT=H(qd=>{"use strict";var WT=W_(),DK=bd(),Id=_d(),LK=B0(),jK=Ze(),UK=nR(),zT=sR();function JT(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new UK.LineCounter||null,prettyErrors:e}}function HK(t,e={}){let{lineCounter:r,prettyErrors:n}=JT(e),i=new zT.Parser(r?.addNewLine),s=new WT.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of o)l.errors.forEach(Id.prettifyError(t,r)),l.warnings.forEach(Id.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function GT(t,e={}){let{lineCounter:r,prettyErrors:n}=JT(e),i=new zT.Parser(r?.addNewLine),s=new WT.Composer(e),o=null;for(let l of s.compose(i.parse(t),!0,t.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Id.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Id.prettifyError(t,r)),o.warnings.forEach(Id.prettifyError(t,r))),o}function BK(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=GT(t,r);if(!i)return null;if(i.warnings.forEach(s=>LK.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},r))}function VK(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return jK.isDocument(t)&&!n?t.toString(r):new DK.Document(t,n,r).toString(r)}qd.parse=BK;qd.parseAllDocuments=HK;qd.parseDocument=GT;qd.stringify=VK});var Od=H(dt=>{"use strict";var WK=W_(),zK=bd(),JK=x_(),oR=_d(),GK=nd(),mo=Ze(),YK=uo(),KK=Bt(),QK=fo(),ZK=po(),XK=Cg(),e4=tR(),t4=nR(),r4=sR(),qg=YT(),KT=Xf();dt.Composer=WK.Composer;dt.Document=zK.Document;dt.Schema=JK.Schema;dt.YAMLError=oR.YAMLError;dt.YAMLParseError=oR.YAMLParseError;dt.YAMLWarning=oR.YAMLWarning;dt.Alias=GK.Alias;dt.isAlias=mo.isAlias;dt.isCollection=mo.isCollection;dt.isDocument=mo.isDocument;dt.isMap=mo.isMap;dt.isNode=mo.isNode;dt.isPair=mo.isPair;dt.isScalar=mo.isScalar;dt.isSeq=mo.isSeq;dt.Pair=YK.Pair;dt.Scalar=KK.Scalar;dt.YAMLMap=QK.YAMLMap;dt.YAMLSeq=ZK.YAMLSeq;dt.CST=XK;dt.Lexer=e4.Lexer;dt.LineCounter=t4.LineCounter;dt.Parser=r4.Parser;dt.parse=qg.parse;dt.parseAllDocuments=qg.parseAllDocuments;dt.parseDocument=qg.parseDocument;dt.stringify=qg.stringify;dt.visit=KT.visit;dt.visitAsync=KT.visitAsync});var n4,i4,s4,o4,a4,l4,u4,go,Og=se(()=>{"use strict";n4=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,i4=/^\d{4}-\d{2}-\d{2}$/,s4=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,o4=/^https?:\/\/[^\s]+$/,a4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,l4=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,u4=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,go=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,r){if(!e||Object.keys(e).length===0)return{...r};if(!r||Object.keys(r).length===0)return{...e};let n=e.nullable||r.nullable;if(!e.type&&e.nullable)return{...r,nullable:!0};if(!r.type&&r.nullable)return{...e,nullable:!0};if(e.type!==r.type)return e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&r.type==="object"?this.mergeObjectSchemas(e,r,n):e.type==="array"&&r.type==="array"?this.mergeArraySchemas(e,r,n):(e.format&&e.format===r.format&&(i.format=e.format),i)}inferStringFormat(e){if(n4.test(e))return"date-time";if(i4.test(e))return"date";if(s4.test(e))return"email";if(a4.test(e))return"uuid";if(o4.test(e))return"uri";if(l4.test(e))return"ipv4";if(u4.test(e))return"ipv6"}inferStringSchema(e){let r={type:"string"},n=this.inferStringFormat(e);return n&&(r.format=n),r}inferArraySchema(e){let r={type:"array"};if(e.length===0)return r;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return r.items=n,r}inferObjectSchema(e){let r={type:"object",properties:{}},n=Object.keys(e);for(let i of n)r.properties[i]=this.inferFromValue(e[i]);return r}mergeObjectSchemas(e,r,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},o=r.properties||{},l=new Set([...Object.keys(s),...Object.keys(o)]);for(let h of l)s[h]&&o[h]?i.properties[h]=this.mergeSchemas(s[h],o[h]):s[h]?i.properties[h]={...s[h]}:i.properties[h]={...o[h]};let f=new Set(e.required||Object.keys(s)),c=new Set(r.required||Object.keys(o)),p=[...l].filter(h=>f.has(h)&&c.has(h));return p.length>0&&(i.required=p),i}mergeArraySchemas(e,r,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&r.items?i.items=this.mergeSchemas(e.items,r.items):e.items?i.items={...e.items}:r.items&&(i.items={...r.items}),i}}});var QT,c4,Ou,aR=se(()=>{"use strict";QT=Uc(Od());Og();c4=new Set(["content-type","authorization","accept","cookie","host","content-length"]),Ou=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new go}collectionService;envConfigService;inferenceService;inferrer;async export(e,r){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,r),servers:this.buildServers(r),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:c,scheme:p,requirement:h}=f;s.set(c,p),i.security=[h]}}let o=new Set,l=new Set;if(await this.processItems(n.items,i,s,o,l,void 0,n,r),this.augmentServersFromHostVars(l,i.servers,r),s.size>0)for(let[f,c]of s)i.components.securitySchemes[f]=c;else delete i.components.securitySchemes;return i.tags=[...o].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,r.format==="yaml"?QT.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,r){return{title:r.info?.title||e.name,description:r.info?.description||e.description||"",version:r.info?.version||e.version||"1.0.0"}}buildServers(e){let r=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&r.push({url:s,description:i})}}else{let i=new Set;for(let s of n){let o=this.envConfigService.resolveVariables("{{baseUrl}}",s);o&&o!=="{{baseUrl}}"&&!i.has(o)&&(i.add(o),r.push({url:o,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,o,l,f){for(let c of e)if(c.type==="folder"){let p=c,h=o||p.name;i.add(h),p.items&&await this.processItems(p.items,r,n,i,s,h,l,f)}else{let p=c;await this.processRequest(p,r,n,i,s,o,l,f)}}async processRequest(e,r,n,i,s,o,l,f){let{path:c,hostVar:p}=this.normalizeUrl(e.url);p&&s.add(p);let h=(e.method||"GET").toLowerCase();r.paths[c]||(r.paths[c]={});let g={};g.operationId=this.generateOperationId(e,h,c,r),g.summary=this.cleanSummary(e.name),e.description&&(g.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(g.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(g.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,""))),o&&(g.tags=[o]);let v=this.buildParameters(e);v.length>0&&(g.parameters=v);let _=await this.buildRequestBody(e,f);_&&(g.requestBody=_);let w=await this.buildResponses(e,l.id,f);g.responses=w;let E=this.buildOperationSecurity(e,l,n);E!==void 0&&(g.security=E);let k=r.paths[c][h];k?this.mergeOperation(k,g,e.name):r.paths[c][h]=g}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
233
+ `,r)+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 r=Eg(e),n=Ou(r);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 r=Eg(e),n=Ou(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!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())}}};VT.Parser=iR});var YT=H(Od=>{"use strict";var WT=W_(),DK=bd(),Id=_d(),LK=B0(),jK=Ze(),UK=nR(),zT=sR();function JT(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new UK.LineCounter||null,prettyErrors:e}}function HK(t,e={}){let{lineCounter:r,prettyErrors:n}=JT(e),i=new zT.Parser(r?.addNewLine),s=new WT.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of o)l.errors.forEach(Id.prettifyError(t,r)),l.warnings.forEach(Id.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function GT(t,e={}){let{lineCounter:r,prettyErrors:n}=JT(e),i=new zT.Parser(r?.addNewLine),s=new WT.Composer(e),o=null;for(let l of s.compose(i.parse(t),!0,t.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Id.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Id.prettifyError(t,r)),o.warnings.forEach(Id.prettifyError(t,r))),o}function BK(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=GT(t,r);if(!i)return null;if(i.warnings.forEach(s=>LK.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},r))}function VK(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return jK.isDocument(t)&&!n?t.toString(r):new DK.Document(t,n,r).toString(r)}Od.parse=BK;Od.parseAllDocuments=HK;Od.parseDocument=GT;Od.stringify=VK});var qd=H(dt=>{"use strict";var WK=W_(),zK=bd(),JK=x_(),oR=_d(),GK=nd(),mo=Ze(),YK=uo(),KK=Bt(),QK=fo(),ZK=po(),XK=Cg(),e4=tR(),t4=nR(),r4=sR(),Og=YT(),KT=Xf();dt.Composer=WK.Composer;dt.Document=zK.Document;dt.Schema=JK.Schema;dt.YAMLError=oR.YAMLError;dt.YAMLParseError=oR.YAMLParseError;dt.YAMLWarning=oR.YAMLWarning;dt.Alias=GK.Alias;dt.isAlias=mo.isAlias;dt.isCollection=mo.isCollection;dt.isDocument=mo.isDocument;dt.isMap=mo.isMap;dt.isNode=mo.isNode;dt.isPair=mo.isPair;dt.isScalar=mo.isScalar;dt.isSeq=mo.isSeq;dt.Pair=YK.Pair;dt.Scalar=KK.Scalar;dt.YAMLMap=QK.YAMLMap;dt.YAMLSeq=ZK.YAMLSeq;dt.CST=XK;dt.Lexer=e4.Lexer;dt.LineCounter=t4.LineCounter;dt.Parser=r4.Parser;dt.parse=Og.parse;dt.parseAllDocuments=Og.parseAllDocuments;dt.parseDocument=Og.parseDocument;dt.stringify=Og.stringify;dt.visit=KT.visit;dt.visitAsync=KT.visitAsync});var n4,i4,s4,o4,a4,l4,u4,go,qg=se(()=>{"use strict";n4=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,i4=/^\d{4}-\d{2}-\d{2}$/,s4=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,o4=/^https?:\/\/[^\s]+$/,a4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,l4=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,u4=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,go=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,r){if(!e||Object.keys(e).length===0)return{...r};if(!r||Object.keys(r).length===0)return{...e};let n=e.nullable||r.nullable;if(!e.type&&e.nullable)return{...r,nullable:!0};if(!r.type&&r.nullable)return{...e,nullable:!0};if(e.type!==r.type)return e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&r.type==="object"?this.mergeObjectSchemas(e,r,n):e.type==="array"&&r.type==="array"?this.mergeArraySchemas(e,r,n):(e.format&&e.format===r.format&&(i.format=e.format),i)}inferStringFormat(e){if(n4.test(e))return"date-time";if(i4.test(e))return"date";if(s4.test(e))return"email";if(a4.test(e))return"uuid";if(o4.test(e))return"uri";if(l4.test(e))return"ipv4";if(u4.test(e))return"ipv6"}inferStringSchema(e){let r={type:"string"},n=this.inferStringFormat(e);return n&&(r.format=n),r}inferArraySchema(e){let r={type:"array"};if(e.length===0)return r;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return r.items=n,r}inferObjectSchema(e){let r={type:"object",properties:{}},n=Object.keys(e);for(let i of n)r.properties[i]=this.inferFromValue(e[i]);return r}mergeObjectSchemas(e,r,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},o=r.properties||{},l=new Set([...Object.keys(s),...Object.keys(o)]);for(let h of l)s[h]&&o[h]?i.properties[h]=this.mergeSchemas(s[h],o[h]):s[h]?i.properties[h]={...s[h]}:i.properties[h]={...o[h]};let f=new Set(e.required||Object.keys(s)),c=new Set(r.required||Object.keys(o)),p=[...l].filter(h=>f.has(h)&&c.has(h));return p.length>0&&(i.required=p),i}mergeArraySchemas(e,r,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&r.items?i.items=this.mergeSchemas(e.items,r.items):e.items?i.items={...e.items}:r.items&&(i.items={...r.items}),i}}});var QT,c4,qu,aR=se(()=>{"use strict";QT=Uc(qd());qg();c4=new Set(["content-type","authorization","accept","cookie","host","content-length"]),qu=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new go}collectionService;envConfigService;inferenceService;inferrer;async export(e,r){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,r),servers:this.buildServers(r),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:c,scheme:p,requirement:h}=f;s.set(c,p),i.security=[h]}}let o=new Set,l=new Set;if(await this.processItems(n.items,i,s,o,l,void 0,n,r),this.augmentServersFromHostVars(l,i.servers,r),s.size>0)for(let[f,c]of s)i.components.securitySchemes[f]=c;else delete i.components.securitySchemes;return i.tags=[...o].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,r.format==="yaml"?QT.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,r){return{title:r.info?.title||e.name,description:r.info?.description||e.description||"",version:r.info?.version||e.version||"1.0.0"}}buildServers(e){let r=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&r.push({url:s,description:i})}}else{let i=new Set;for(let s of n){let o=this.envConfigService.resolveVariables("{{baseUrl}}",s);o&&o!=="{{baseUrl}}"&&!i.has(o)&&(i.add(o),r.push({url:o,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,o,l,f){for(let c of e)if(c.type==="folder"){let p=c,h=o||p.name;i.add(h),p.items&&await this.processItems(p.items,r,n,i,s,h,l,f)}else{let p=c;await this.processRequest(p,r,n,i,s,o,l,f)}}async processRequest(e,r,n,i,s,o,l,f){let{path:c,hostVar:p}=this.normalizeUrl(e.url);p&&s.add(p);let h=(e.method||"GET").toLowerCase();r.paths[c]||(r.paths[c]={});let g={};g.operationId=e.operationId||this.generateOperationId(e,h,c,r),g.summary=e.summary||this.cleanSummary(e.name),e.description&&(g.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(g.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(g.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,"")));let v=e.tags;if(v&&v.length>0){g.tags=v;for(let N of v)i.add(N)}else o&&(g.tags=[o]);let _=this.buildParameters(e);_.length>0&&(g.parameters=_);let w=await this.buildRequestBody(e,f);w&&(g.requestBody=w);let E=e.responses;E&&Object.keys(E).length>0?g.responses=this.mapResponseDefinitions(E):g.responses=await this.buildResponses(e,l.id,f);let k=e.security;if(k&&k.length>0)g.security=k;else{let N=this.buildOperationSecurity(e,l,n);N!==void 0&&(g.security=N)}let T=r.paths[c][h];T?this.mergeOperation(T,g,e.name):r.paths[c][h]=g}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
234
234
 
235
- Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(o=>o.name===i.name&&o.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(r.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(r.responses))e.responses[i]||(e.responses[i]=s)}if(r.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(r.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else r.requestBody&&!e.requestBody&&(e.requestBody=r.requestBody)}mergeParameterSchema(e,r,n){e.schema||(e.schema={});let i=e.schema,s=r.schema||{},o=this.getConstraintKind(i),l=this.getConstraintKind(s);if(o==="none"&&l==="none")this.widenType(i,s);else if(o==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(l==="none")this.widenType(i,s);else if(o===l)this.mergeSameKindConstraints(i,s,o),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(c=>JSON.stringify(c)===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),c=this.buildVariantSchema(s);i.oneOf=[f,c]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.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:r.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,r,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of r.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{r.pattern&&r.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${r.pattern})`);break}case"range":{r.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,r.minimum):r.minimum),r.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,r.maximum):r.maximum),r.exclusiveMinimum&&(e.exclusiveMinimum=!0),r.exclusiveMaximum&&(e.exclusiveMaximum=!0),r.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,r.multipleOf):r.multipleOf);break}case"length":{r.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,r.minLength):r.minLength),r.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,r.maxLength):r.maxLength);break}case"array":{r.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,r.minItems):r.minItems),r.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,r.maxItems):r.maxItems),r.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(r.format&&r.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:r.type||"string",format:r.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(r.oneOf)for(let i of r.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let r={};return e.type&&(r.type=e.type),e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}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 r={};return e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}widenType(e,r){!r.type||r.type===e.type||(e.type?(e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer")&&(e.type="number"):e.type=r.type)}normalizeUrl(e){let r=e,n=null,i=r.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],r=r.slice(i[0].length)),r=r.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),r=r.replace(/\{\{(\w+)\}\}/g,"{$1}"),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r=r.replace(/\/\//g,"/"),{path:r,hostVar:n}}generateOperationId(e,r,n,i){let s=this.toCamelCase(e.name),o=this.collectOperationIds(i);if(o.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||o.has(s)){let l=n.split("/").filter(f=>f&&!f.startsWith("{"));s=r+l.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let r=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&r.add(i.operationId);return r}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(r,n)=>n.toUpperCase()).replace(/^[A-Z]/,r=>r.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let r=[];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 o=i;o.oneOf?(s.schema={oneOf:o.oneOf},o.type&&(s.schema.type=o.type)):(s.schema={type:o.type||this.inferTypeFromValue(o.value)},o.format&&(s.schema.format=o.format),o.enum&&(s.schema.enum=o.enum),o.pattern&&(s.schema.pattern=o.pattern),o.minimum!==void 0&&(s.schema.minimum=o.minimum),o.maximum!==void 0&&(s.schema.maximum=o.maximum),o.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=o.exclusiveMinimum),o.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=o.exclusiveMaximum),o.multipleOf!==void 0&&(s.schema.multipleOf=o.multipleOf),o.minLength!==void 0&&(s.schema.minLength=o.minLength),o.maxLength!==void 0&&(s.schema.maxLength=o.maxLength),o.minItems!==void 0&&(s.schema.minItems=o.minItems),o.maxItems!==void 0&&(s.schema.maxItems=o.maxItems),o.uniqueItems&&(s.schema.uniqueItems=!0),o.nullable&&(s.schema.nullable=!0)),o.description&&(s.description=o.description),o.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(o.value,s.schema.type||"string")}r.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");r.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);r.push(...i)}for(let i of e.headers){if(!i.key||c4.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");r.push(s)}}return r}buildKeyValueParam(e,r){let n={name:e.key,in:r,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 r=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let o=i.substring(0,s).trim(),l=i.substring(s+1).trim();r.push({name:o,in:"cookie",schema:{type:"string"},example:l})}}return r}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,r){let n=this.sanitizeEnvVar(e);switch(r){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(r=>this.sanitizeObjectExamples(r));if(e!==null&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeObjectExamples(i);return r}return e}async buildRequestBody(e,r){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,o,l,f;if(e.bodySchema){if(e.bodySchema.content){for(let[h,g]of Object.entries(e.bodySchema.content)){let v={};g.schema&&(v.schema=g.schema),g.examples&&(v.examples=g.examples),g.encoding&&(v.encoding=g.encoding),i.content[h]=v}let p=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(p&&n.content){let h=this.tryParseBodyContent(n);h!==void 0&&i.content[p]&&(i.content[p].example=h)}return i}s=e.bodySchema.contentType||this.getContentType(n),o=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 p=this.tryParseBodyContent(n);p!==void 0?(o=this.inferrer.inferFromValue(p),l=p):o={type:"string"}}else o={type:"string"},l=typeof n.content=="string"?n.content:void 0;break}case"form-data":{o=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{o=this.buildFormDataSchemaFromBody(n);break}case"binary":{o={type:"string",format:"binary"};break}case"graphql":{o={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l=this.tryParseBodyContent(n);break}default:return null}let c={};return o&&(c.schema=o),l!==void 0&&(c.example=l),f&&(c.encoding=f),i.content[s]=c,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 r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,o]of Object.entries(e.responseSchema.responses)){let l={description:o.description||`Status ${s}`};if(o.content){l.content={};for(let[f,c]of Object.entries(o.content)){let p={};c.schema&&(p.schema=c.schema),c.examples&&(p.examples=c.examples),l.content[f]=p}}else if(o.schema){let f=o.contentType||"application/json",c={schema:o.schema};o.examples&&(c.examples=o.examples),l.content={[f]:c}}if(o.headers){l.headers={};for(let[f,c]of Object.entries(o.headers))l.headers[f]={...c.description&&{description:c.description},schema:c.schema}}i[s]=l}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}buildOperationSecurity(e,r,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:o,requirement:l}=i;return n.set(s,o),[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 r=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${r.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:r.in||"header",name:r.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let r=e.oauth2;if(!r)return;let n={};switch(r.grantType){case"client_credentials":n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:r.authUrl||"",tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"password":n.password={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"implicit":n.implicit={authorizationUrl:r.authUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;default:n.clientCredentials={tokenUrl:r.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 r={};for(let n of e.split(/\s+/))n&&(r[n]="");return r}deduplicateComponents(e){let r=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[o,l]of Object.entries(s)){let f=l;if(f.responses){for(let[c,p]of Object.entries(f.responses))if(p.content)for(let h of Object.values(p.content))h.schema&&this.trackSchema(h.schema,`${o}${i}Response${c}`,r,n)}if(f.requestBody?.content)for(let c of Object.values(f.requestBody.content))c.schema&&this.trackSchema(c.schema,`${o}${i}Request`,r,n)}for(let[i,s]of r)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,r,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:r,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,r,n){let i=JSON.stringify(r);if(e.paths)for(let s of Object.values(e.paths))for(let o of Object.values(s)){if(o.responses){for(let l of Object.values(o.responses))if(l.content)for(let f of Object.values(l.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(o.requestBody?.content)for(let l of Object.values(o.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,r,n){if(e.size===0)return;let i=new Set(r.map(o=>o.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(o=>!!o);for(let o of e){let l=`{{${o}}}`,f=!1;for(let c of s){let p=this.envConfigService.resolveVariables(l,c);p&&p!==l&&!i.has(p)&&(r.push({url:p,description:c}),i.add(p),f=!0)}if(!f){let c=`{${o}}`;i.has(c)||(r.push({url:c,variables:{[o]:{default:""}}}),i.add(c))}}}}});var ku,lR=se(()=>{"use strict";ku=class{generate(e,r){if(!e)return;let n=r||{};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,r){return e.items?[this.generate(e.items,r)]:[]}generateObject(e,r){let n={},i=e.properties||{};for(let[s,o]of Object.entries(i))r.omitReadOnly&&o.readOnly||(n[s]=this.generate(o,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let o of e){let l=o.$ref?this.resolveLocalRef(o.$ref,n.components)||{}:o;l.properties&&Object.assign(i.properties,l.properties),l.required&&(i.required=[...i.required||[],...l.required])}let s=this.generateObject(i,n);return r?.propertyName&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,r,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 r?.propertyName&&typeof s=="object"&&s!==null&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,r){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,r){if(!e||!r)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return r[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return r[i[1]]}}});var kg=H(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.getDeepKeys=Pu.toJSON=void 0;var f4=["function","symbol","undefined"],d4=["constructor","prototype","__proto__"],p4=Object.getPrototypeOf({});function h4(){let t={},e=this;for(let r of ZT(e))if(typeof r=="string"){let n=e[r],i=typeof n;f4.includes(i)||(t[r]=n)}return t}Pu.toJSON=h4;function ZT(t,e=[]){let r=[];for(;t&&t!==p4;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(d4))n.delete(i);return n}Pu.getDeepKeys=ZT});var uR=H(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.addInspectMethod=Tu.format=void 0;var XT=ft("util"),m4=kg(),eA=XT.inspect.custom||Symbol.for("nodejs.util.inspect.custom");Tu.format=XT.format;function g4(t){t[eA]=y4}Tu.addInspectMethod=g4;function y4(){let t={},e=this;for(let r of m4.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[eA],t}});var nA=H(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.lazyJoinStacks=Ai.joinStacks=Ai.isWritableStack=Ai.isLazyStack=void 0;var v4=/\r?\n/,b4=/\bono[ @]/;function S4(t){return!!(t&&t.configurable&&typeof t.get=="function")}Ai.isLazyStack=S4;function w4(t){return!!(!t||t.writable||typeof t.set=="function")}Ai.isWritableStack=w4;function tA(t,e){let r=rA(t.stack),n=e?e.stack:void 0;return r&&n?r+`
235
+ Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(o=>o.name===i.name&&o.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(r.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(r.responses))e.responses[i]||(e.responses[i]=s)}if(r.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(r.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else r.requestBody&&!e.requestBody&&(e.requestBody=r.requestBody)}mergeParameterSchema(e,r,n){e.schema||(e.schema={});let i=e.schema,s=r.schema||{},o=this.getConstraintKind(i),l=this.getConstraintKind(s);if(o==="none"&&l==="none")this.widenType(i,s);else if(o==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(l==="none")this.widenType(i,s);else if(o===l)this.mergeSameKindConstraints(i,s,o),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(c=>JSON.stringify(c)===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),c=this.buildVariantSchema(s);i.oneOf=[f,c]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.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:r.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,r,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of r.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{r.pattern&&r.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${r.pattern})`);break}case"range":{r.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,r.minimum):r.minimum),r.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,r.maximum):r.maximum),r.exclusiveMinimum&&(e.exclusiveMinimum=!0),r.exclusiveMaximum&&(e.exclusiveMaximum=!0),r.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,r.multipleOf):r.multipleOf);break}case"length":{r.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,r.minLength):r.minLength),r.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,r.maxLength):r.maxLength);break}case"array":{r.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,r.minItems):r.minItems),r.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,r.maxItems):r.maxItems),r.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(r.format&&r.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:r.type||"string",format:r.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(r.oneOf)for(let i of r.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let r={};return e.type&&(r.type=e.type),e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}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 r={};return e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}widenType(e,r){!r.type||r.type===e.type||(e.type?(e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer")&&(e.type="number"):e.type=r.type)}normalizeUrl(e){let r=e,n=null,i=r.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],r=r.slice(i[0].length)),r=r.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),r=r.replace(/\{\{(\w+)\}\}/g,"{$1}"),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r=r.replace(/\/\//g,"/"),{path:r,hostVar:n}}generateOperationId(e,r,n,i){let s=this.toCamelCase(e.name),o=this.collectOperationIds(i);if(o.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||o.has(s)){let l=n.split("/").filter(f=>f&&!f.startsWith("{"));s=r+l.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let r=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&r.add(i.operationId);return r}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(r,n)=>n.toUpperCase()).replace(/^[A-Z]/,r=>r.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let r=[];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 o=i;o.oneOf?(s.schema={oneOf:o.oneOf},o.type&&(s.schema.type=o.type)):(s.schema={type:o.type||this.inferTypeFromValue(o.value)},o.format&&(s.schema.format=o.format),o.enum&&(s.schema.enum=o.enum),o.pattern&&(s.schema.pattern=o.pattern),o.minimum!==void 0&&(s.schema.minimum=o.minimum),o.maximum!==void 0&&(s.schema.maximum=o.maximum),o.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=o.exclusiveMinimum),o.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=o.exclusiveMaximum),o.multipleOf!==void 0&&(s.schema.multipleOf=o.multipleOf),o.minLength!==void 0&&(s.schema.minLength=o.minLength),o.maxLength!==void 0&&(s.schema.maxLength=o.maxLength),o.minItems!==void 0&&(s.schema.minItems=o.minItems),o.maxItems!==void 0&&(s.schema.maxItems=o.maxItems),o.uniqueItems&&(s.schema.uniqueItems=!0),o.nullable&&(s.schema.nullable=!0)),o.description&&(s.description=o.description),o.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(o.value,s.schema.type||"string")}r.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");r.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);r.push(...i)}for(let i of e.headers){if(!i.key||c4.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");r.push(s)}}return r}buildKeyValueParam(e,r){let n={name:e.key,in:r,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 r=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let o=i.substring(0,s).trim(),l=i.substring(s+1).trim();r.push({name:o,in:"cookie",schema:{type:"string"},example:l})}}return r}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,r){let n=this.sanitizeEnvVar(e);switch(r){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(r=>this.sanitizeObjectExamples(r));if(e!==null&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeObjectExamples(i);return r}return e}async buildRequestBody(e,r){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,o,l,f;if(e.bodySchema){if(e.bodySchema.content){for(let[h,g]of Object.entries(e.bodySchema.content)){let v={};g.schema&&(v.schema=g.schema),g.examples&&(v.examples=g.examples),g.encoding&&(v.encoding=g.encoding),i.content[h]=v}let p=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(p&&n.content){let h=this.tryParseBodyContent(n);h!==void 0&&i.content[p]&&(i.content[p].example=h)}return i}s=e.bodySchema.contentType||this.getContentType(n),o=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 p=this.tryParseBodyContent(n);p!==void 0?(o=this.inferrer.inferFromValue(p),l=p):o={type:"string"}}else o={type:"string"},l=typeof n.content=="string"?n.content:void 0;break}case"form-data":{o=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{o=this.buildFormDataSchemaFromBody(n);break}case"binary":{o={type:"string",format:"binary"};break}case"graphql":{o={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l=this.tryParseBodyContent(n);break}default:return null}let c={};return o&&(c.schema=o),l!==void 0&&(c.example=l),f&&(c.encoding=f),i.content[s]=c,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 r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,o]of Object.entries(e.responseSchema.responses)){let l={description:o.description||`Status ${s}`};if(o.content){l.content={};for(let[f,c]of Object.entries(o.content)){let p={};c.schema&&(p.schema=c.schema),c.examples&&(p.examples=c.examples),l.content[f]=p}}else if(o.schema){let f=o.contentType||"application/json",c={schema:o.schema};o.examples&&(c.examples=o.examples),l.content={[f]:c}}if(o.headers){l.headers={};for(let[f,c]of Object.entries(o.headers))l.headers[f]={...c.description&&{description:c.description},schema:c.schema}}i[s]=l}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}mapResponseDefinitions(e){let r={};for(let[n,i]of Object.entries(e)){let s={description:i.description||`Status ${n}`};if(i.schema||i.examples){let o=i.contentType||"application/json",l={};i.schema&&(l.schema=i.schema),i.examples&&Object.keys(i.examples).length>0&&(l.examples=i.examples),s.content={[o]:l}}if(i.headers&&Object.keys(i.headers).length>0){s.headers={};for(let[o,l]of Object.entries(i.headers)){let f=l;s.headers[o]={...f.description&&{description:f.description},...f.schema&&{schema:f.schema}}}}r[n]=s}return Object.keys(r).length===0&&(r[200]={description:"Successful response"}),r}buildOperationSecurity(e,r,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:o,requirement:l}=i;return n.set(s,o),[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 r=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${r.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:r.in||"header",name:r.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let r=e.oauth2;if(!r)return;let n={};switch(r.grantType){case"client_credentials":n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:r.authUrl||"",tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"password":n.password={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"implicit":n.implicit={authorizationUrl:r.authUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;default:n.clientCredentials={tokenUrl:r.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 r={};for(let n of e.split(/\s+/))n&&(r[n]="");return r}deduplicateComponents(e){let r=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[o,l]of Object.entries(s)){let f=l;if(f.responses){for(let[c,p]of Object.entries(f.responses))if(p.content)for(let h of Object.values(p.content))h.schema&&this.trackSchema(h.schema,`${o}${i}Response${c}`,r,n)}if(f.requestBody?.content)for(let c of Object.values(f.requestBody.content))c.schema&&this.trackSchema(c.schema,`${o}${i}Request`,r,n)}for(let[i,s]of r)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,r,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:r,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,r,n){let i=JSON.stringify(r);if(e.paths)for(let s of Object.values(e.paths))for(let o of Object.values(s)){if(o.responses){for(let l of Object.values(o.responses))if(l.content)for(let f of Object.values(l.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(o.requestBody?.content)for(let l of Object.values(o.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,r,n){if(e.size===0)return;let i=new Set(r.map(o=>o.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(o=>!!o);for(let o of e){let l=`{{${o}}}`,f=!1;for(let c of s){let p=this.envConfigService.resolveVariables(l,c);p&&p!==l&&!i.has(p)&&(r.push({url:p,description:c}),i.add(p),f=!0)}if(!f){let c=`{${o}}`;i.has(c)||(r.push({url:c,variables:{[o]:{default:""}}}),i.add(c))}}}}});var ku,lR=se(()=>{"use strict";ku=class{generate(e,r){if(!e)return;let n=r||{};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,r){return e.items?[this.generate(e.items,r)]:[]}generateObject(e,r){let n={},i=e.properties||{};for(let[s,o]of Object.entries(i))r.omitReadOnly&&o.readOnly||(n[s]=this.generate(o,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let o of e){let l=o.$ref?this.resolveLocalRef(o.$ref,n.components)||{}:o;l.properties&&Object.assign(i.properties,l.properties),l.required&&(i.required=[...i.required||[],...l.required])}let s=this.generateObject(i,n);return r?.propertyName&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,r,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 r?.propertyName&&typeof s=="object"&&s!==null&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,r){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,r){if(!e||!r)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return r[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return r[i[1]]}}});var kg=H(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.getDeepKeys=Pu.toJSON=void 0;var f4=["function","symbol","undefined"],d4=["constructor","prototype","__proto__"],p4=Object.getPrototypeOf({});function h4(){let t={},e=this;for(let r of ZT(e))if(typeof r=="string"){let n=e[r],i=typeof n;f4.includes(i)||(t[r]=n)}return t}Pu.toJSON=h4;function ZT(t,e=[]){let r=[];for(;t&&t!==p4;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(d4))n.delete(i);return n}Pu.getDeepKeys=ZT});var uR=H(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.addInspectMethod=Tu.format=void 0;var XT=ft("util"),m4=kg(),eA=XT.inspect.custom||Symbol.for("nodejs.util.inspect.custom");Tu.format=XT.format;function g4(t){t[eA]=y4}Tu.addInspectMethod=g4;function y4(){let t={},e=this;for(let r of m4.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[eA],t}});var nA=H(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.lazyJoinStacks=Ai.joinStacks=Ai.isWritableStack=Ai.isLazyStack=void 0;var v4=/\r?\n/,b4=/\bono[ @]/;function S4(t){return!!(t&&t.configurable&&typeof t.get=="function")}Ai.isLazyStack=S4;function w4(t){return!!(!t||t.writable||typeof t.set=="function")}Ai.isWritableStack=w4;function tA(t,e){let r=rA(t.stack),n=e?e.stack:void 0;return r&&n?r+`
236
236
 
237
237
  `+n:r||n}Ai.joinStacks=tA;function _4(t,e,r){r?Object.defineProperty(e,"stack",{get:()=>{let n=t.get.apply(e);return tA({stack:n},r)},enumerable:!1,configurable:!0}):R4(e,t)}Ai.lazyJoinStacks=_4;function rA(t){if(t){let e=t.split(v4),r;for(let n=0;n<e.length;n++){let i=e[n];if(b4.test(i))r===void 0&&(r=n);else if(r!==void 0){e.splice(r,n-r);break}}if(e.length>0)return e.join(`
238
- `)}return t}function R4(t,e){Object.defineProperty(t,"stack",{get:()=>rA(e.get.apply(t)),enumerable:!1,configurable:!0})}});var oA=H(Tg=>{"use strict";Object.defineProperty(Tg,"__esModule",{value:!0});Tg.extendError=void 0;var iA=uR(),Pg=nA(),sA=kg(),C4=["name","message","stack"];function x4(t,e,r){let n=t;return E4(n,e),e&&typeof e=="object"&&I4(n,e),n.toJSON=sA.toJSON,iA.addInspectMethod&&iA.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}Tg.extendError=x4;function E4(t,e){let r=Object.getOwnPropertyDescriptor(t,"stack");Pg.isLazyStack(r)?Pg.lazyJoinStacks(r,t,e):Pg.isWritableStack(r)&&(t.stack=Pg.joinStacks(t,e))}function I4(t,e){let r=sA.getDeepKeys(e,C4),n=t,i=e;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}});var aA=H(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.normalizeArgs=Au.normalizeOptions=void 0;var q4=uR();function O4(t){return t=t||{},{concatMessages:t.concatMessages===void 0?!0:!!t.concatMessages,format:t.format===void 0?q4.format:typeof t.format=="function"?t.format:!1}}Au.normalizeOptions=O4;function k4(t,e){let r,n,i,s="";return typeof t[0]=="string"?i=t:typeof t[1]=="string"?(t[0]instanceof Error?r=t[0]:n=t[0],i=t.slice(1)):(r=t[0],n=t[1],i=t.slice(2)),i.length>0&&(e.format?s=e.format.apply(void 0,i):s=i.join(" ")),e.concatMessages&&r&&r.message&&(s+=(s?`
239
- `:"")+r.message),{originalError:r,props:n,message:s}}Au.normalizeArgs=k4});var fR=H($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});$g.Ono=void 0;var Ag=oA(),lA=aA(),P4=kg(),T4=cR;$g.Ono=T4;function cR(t,e){e=lA.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:o}=lA.normalizeArgs(n,e),l=new t(o);return Ag.extendError(l,i,s)}return r[Symbol.species]=t,r}cR.toJSON=function(e){return P4.toJSON.call(e)};cR.extend=function(e,r,n){return n||r instanceof Error?Ag.extendError(e,r,n):r?Ag.extendError(e,void 0,r):Ag.extendError(e)}});var uA=H(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.ono=void 0;var Ma=fR(),A4=$i;Ng.ono=A4;$i.error=new Ma.Ono(Error);$i.eval=new Ma.Ono(EvalError);$i.range=new Ma.Ono(RangeError);$i.reference=new Ma.Ono(ReferenceError);$i.syntax=new Ma.Ono(SyntaxError);$i.type=new Ma.Ono(TypeError);$i.uri=new Ma.Ono(URIError);var $4=$i;function $i(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values($4))if(typeof r=="function"&&r.name==="ono"){let n=r[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return r.apply(void 0,t)}}return $i.error.apply(void 0,t)}});var fA=H(cA=>{"use strict";Object.defineProperty(cA,"__esModule",{value:!0});var Wte=ft("util")});var yo=H((oi,$u)=>{"use strict";var N4=oi&&oi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M4=oi&&oi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&N4(e,t,r)};Object.defineProperty(oi,"__esModule",{value:!0});oi.ono=void 0;var dA=uA();Object.defineProperty(oi,"ono",{enumerable:!0,get:function(){return dA.ono}});var F4=fR();Object.defineProperty(oi,"Ono",{enumerable:!0,get:function(){return F4.Ono}});M4(fA(),oi);oi.default=dA.ono;typeof $u=="object"&&typeof $u.exports=="object"&&($u.exports=Object.assign($u.exports.default,$u.exports))});var dR=H(kd=>{"use strict";var D4=kd&&kd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kd,"__esModule",{value:!0});kd.default=L4;var pA=D4(ft("path"));function L4(t){return t.startsWith("\\\\?\\")?t:t.split(pA.default?.win32?.sep).join(pA.default?.posix?.sep??"/")}});var hA=H(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.isWindows=void 0;var j4=/^win/.test(globalThis.process?globalThis.process.platform:""),U4=()=>j4;Mg.isWindows=U4});var Tn=H(Ot=>{"use strict";var H4=Ot&&Ot.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B4=Ot&&Ot.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),V4=Ot&&Ot.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&H4(r,e,n[i]);return B4(r,e),r}})(),W4=Ot&&Ot.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.parse=void 0;Ot.resolve=mA;Ot.cwd=gA;Ot.getProtocol=yR;Ot.getExtension=X4;Ot.stripQuery=yA;Ot.getHash=vA;Ot.stripHash=mR;Ot.isHttp=e3;Ot.isFileSystemPath=gR;Ot.fromFileSystemPath=t3;Ot.toFileSystemPath=r3;Ot.safePointerToPath=n3;Ot.relative=i3;var Dg=W4(dR()),hR=V4(ft("path")),z4=/\//g,J4=/^(\w{2,}):\/\//i,G4=/~1/g,Y4=/~0/g,K4=ft("path"),Fg=hA(),Q4=[[/\?/g,"%3F"],[/#/g,"%23"]],pR=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],Z4=t=>new URL(t);Ot.parse=Z4;function mA(t,e){let r=new URL((0,Dg.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,Dg.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:o,hash:l}=n;return s+o+l+i}return n.toString()+i}function gA(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function yR(t){let e=J4.exec(t||"");if(e)return e[1].toLowerCase()}function X4(t){let e=t.lastIndexOf(".");return e>=0?yA(t.substr(e).toLowerCase()):""}function yA(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function vA(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function mR(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function e3(t){let e=yR(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function gR(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=yR(t);return e===void 0||e==="file"}function t3(t){if((0,Fg.isWindows)()){let e=gA(),r=t.toUpperCase(),i=(0,Dg.default)(e).toUpperCase(),s=r.includes(i),o=r.includes(i),l=hR.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||o||l)&&!e.startsWith("http")&&(t=(0,K4.join)(e,t)),t=(0,Dg.default)(t)}t=encodeURI(t);for(let e of Q4)t=t.replace(e[0],e[1]);return t}function r3(t,e){t=decodeURI(t);for(let n=0;n<pR.length;n+=2)t=t.replace(pR[n],pR[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,Fg.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,Fg.isWindows)()?t:"/"+t)),(0,Fg.isWindows)()&&!r&&(t=t.replace(z4,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function n3(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(G4,"/").replace(Y4,"~"))}function i3(t,e){if(!gR(t)||!gR(e))return mA(t,e);let r=hR.default.dirname(mR(t)),n=mR(e);return hR.default.relative(r,n)+vA(e)}});var An=H(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.InvalidPointerError=Nt.TimeoutError=Nt.MissingPointerError=Nt.UnmatchedResolverError=Nt.ResolverError=Nt.UnmatchedParserError=Nt.ParserError=Nt.JSONParserErrorGroup=Nt.JSONParserError=void 0;Nt.isHandledError=s3;Nt.normalizeError=o3;var bA=yo(),Lg=Tn(),ai=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,bA.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Nt.JSONParserError=ai;var jg=class t 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,Lg.toFileSystemPath)(e.$refs._root$Ref.path)}'`,bA.Ono.extend(this)}static getParserErrors(e){let r=[];for(let n of Object.values(e.$refs._$refs))n.errors&&r.push(...n.errors);return r}get errors(){return t.getParserErrors(this.files)}};Nt.JSONParserErrorGroup=jg;var vR=class extends ai{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};Nt.ParserError=vR;var bR=class extends ai{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};Nt.UnmatchedParserError=bR;var SR=class extends ai{constructor(e,r){super(e.message||`Error reading file "${r}"`,r),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};Nt.ResolverError=SR;var wR=class extends ai{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};Nt.UnmatchedResolverError=wR;var _R=class extends ai{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,Lg.getHash)(r)}". Token "${e}" does not exist.`,(0,Lg.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};Nt.MissingPointerError=_R;var RR=class extends ai{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};Nt.TimeoutError=RR;var CR=class extends ai{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,Lg.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};Nt.InvalidPointerError=CR;function s3(t){return t instanceof ai||t instanceof jg}function o3(t){return t.path===null&&(t.path=[]),t}});var Pd=H(Yr=>{"use strict";var a3=Yr&&Yr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),l3=Yr&&Yr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),u3=Yr&&Yr.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&a3(r,e,n[i]);return l3(r,e),r}})(),c3=Yr&&Yr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.nullSymbol=void 0;var xR=c3(Nu()),ER=u3(Tn()),Hg=An();Yr.nullSymbol=Symbol("null");var f3=/\//g,d3=/~/g,p3=/~1/g,h3=/~0/g,m3=t=>{try{return decodeURIComponent(t)}catch{return t}},Bg=class t{constructor(e,r,n){this.$ref=e,this.path=r,this.originalPath=n||r,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,r,n){let i=t.parse(this.path,this.originalPath),s=[];this.value=wA(e);for(let o=0;o<i.length;o++){if(Ug(this,r,n)&&(this.path=t.join(this.path,i.slice(o))),typeof this.value=="object"&&this.value!==null&&!_A(n)&&"$ref"in this.value)return this;let l=i[o];if(this.value[l]===void 0||this.value[l]===null&&o===i.length-1){let f=!1;for(let v=i.length-1;v>o;v--){let _=i.slice(o,v+1).join("/");if(this.value[_]!==void 0){this.value=this.value[_],o=v,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Yr.nullSymbol;continue}this.value=null;let c=this.$ref.path||"",p=this.path.replace(c,""),h=t.join("",s),g=n?.replace(c,"");throw new Hg.MissingPointerError(l,decodeURI(this.originalPath),p,h,g)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&ER.resolve(this.path,this.value.$ref)!==n)&&Ug(this,r,n),this}set(e,r,n){let i=t.parse(this.path),s;if(i.length===0)return this.value=r,r;this.value=wA(e);for(let o=0;o<i.length-1;o++)Ug(this,n),s=i[o],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=SA(this,s,{});return Ug(this,n),s=i[i.length-1],SA(this,s,r),e}static parse(e,r){let n=ER.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=m3(i[s].replace(p3,"/").replace(h3,"~"));if(i[0]!=="")throw new Hg.InvalidPointerError(n,r===void 0?e:r);return i.slice(1)}static join(e,r){e.indexOf("#")===-1&&(e+="#"),r=Array.isArray(r)?r:[r];for(let n=0;n<r.length;n++){let i=r[n];e+="/"+encodeURIComponent(i.replace(d3,"~0").replace(f3,"~1"))}return e}};function Ug(t,e,r){if(xR.default.isAllowed$Ref(t.value,e)){let n=ER.resolve(t.path,t.value.$ref);if(n===t.path&&!_A(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,xR.default.isExtended$Ref(t.value)?(t.value=xR.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Yr.default=Bg;function SA(t,e,r){if(t.value&&typeof t.value=="object")e==="-"&&Array.isArray(t.value)?t.value.push(r):t.value[e]=r;else throw new Hg.JSONParserError(`Error assigning $ref pointer "${t.path}".
240
- Cannot set "${e}" of a non-object.`);return r}function wA(t){if((0,Hg.isHandledError)(t))throw t;return t}function _A(t){return typeof t=="string"&&Bg.parse(t).length==0}});var Nu=H(ps=>{"use strict";var g3=ps&&ps.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y3=ps&&ps.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),v3=ps&&ps.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&g3(r,e,n[i]);return y3(r,e),r}})();Object.defineProperty(ps,"__esModule",{value:!0});var Vg=v3(Pd()),Wg=An(),IR=Tn(),qR=class t{constructor(e){this.errors=[],this.$refs=e}addError(e){this.errors===void 0&&(this.errors=[]);let r=this.errors.map(({footprint:n})=>n);"errors"in e&&Array.isArray(e.errors)?this.errors.push(...e.errors.map(Wg.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,Wg.normalizeError)(e))}exists(e,r){try{return this.resolve(e,r),!0}catch{return!1}}get(e,r){return this.resolve(e,r)?.value}resolve(e,r,n,i){let s=new Vg.default(this,e,n);try{let o=s.resolve(this.value,r,i);return o.value===Vg.nullSymbol&&(o.value=null),o}catch(o){if(!r||!r.continueOnError||!(0,Wg.isHandledError)(o))throw o;return o.path===null&&(o.path=(0,IR.safePointerToPath)((0,IR.getHash)(i))),o instanceof Wg.InvalidPointerError&&(o.source=decodeURI((0,IR.stripHash)(i))),this.addError(o),null}}set(e,r){let n=new Vg.default(this,e);this.value=n.set(this.value,r),this.value===Vg.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 t.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,r){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||e.$ref==="#")return!0;if(e.$ref[0]!=="#"&&(!r||r.resolve?.external))return!0}}static isExtended$Ref(e){return t.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,r){if(r&&typeof r=="object"&&t.isExtended$Ref(e)){let n={};for(let i of Object.keys(e))i!=="$ref"&&(n[i]=e[i]);for(let i of Object.keys(r))i in n||(n[i]=r[i]);return n}else return r}};ps.default=qR});var IA=H(li=>{"use strict";var b3=li&&li.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),S3=li&&li.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w3=li&&li.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&b3(r,e,n[i]);return S3(r,e),r}})(),EA=li&&li.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(li,"__esModule",{value:!0});var RA=yo(),_3=EA(Nu()),vo=w3(Tn()),CA=EA(dR()),OR=class{paths(...e){return xA(this._$refs,e.flat()).map(n=>(0,CA.default)(n.decoded))}values(...e){let r=this._$refs;return xA(r,e.flat()).reduce((i,s)=>(i[(0,CA.default)(s.decoded)]=r[s.encoded].value,i),{})}exists(e,r){try{return this._resolve(e,"",r),!0}catch{return!1}}get(e,r){return this._resolve(e,"",r).value}set(e,r){let n=vo.resolve(this._root$Ref.path,e),i=vo.stripHash(n),s=this._$refs[i];if(!s)throw(0,RA.ono)(`Error resolving $ref pointer "${e}".
238
+ `)}return t}function R4(t,e){Object.defineProperty(t,"stack",{get:()=>rA(e.get.apply(t)),enumerable:!1,configurable:!0})}});var oA=H(Tg=>{"use strict";Object.defineProperty(Tg,"__esModule",{value:!0});Tg.extendError=void 0;var iA=uR(),Pg=nA(),sA=kg(),C4=["name","message","stack"];function x4(t,e,r){let n=t;return E4(n,e),e&&typeof e=="object"&&I4(n,e),n.toJSON=sA.toJSON,iA.addInspectMethod&&iA.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}Tg.extendError=x4;function E4(t,e){let r=Object.getOwnPropertyDescriptor(t,"stack");Pg.isLazyStack(r)?Pg.lazyJoinStacks(r,t,e):Pg.isWritableStack(r)&&(t.stack=Pg.joinStacks(t,e))}function I4(t,e){let r=sA.getDeepKeys(e,C4),n=t,i=e;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}});var aA=H(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.normalizeArgs=Au.normalizeOptions=void 0;var O4=uR();function q4(t){return t=t||{},{concatMessages:t.concatMessages===void 0?!0:!!t.concatMessages,format:t.format===void 0?O4.format:typeof t.format=="function"?t.format:!1}}Au.normalizeOptions=q4;function k4(t,e){let r,n,i,s="";return typeof t[0]=="string"?i=t:typeof t[1]=="string"?(t[0]instanceof Error?r=t[0]:n=t[0],i=t.slice(1)):(r=t[0],n=t[1],i=t.slice(2)),i.length>0&&(e.format?s=e.format.apply(void 0,i):s=i.join(" ")),e.concatMessages&&r&&r.message&&(s+=(s?`
239
+ `:"")+r.message),{originalError:r,props:n,message:s}}Au.normalizeArgs=k4});var fR=H($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});$g.Ono=void 0;var Ag=oA(),lA=aA(),P4=kg(),T4=cR;$g.Ono=T4;function cR(t,e){e=lA.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:o}=lA.normalizeArgs(n,e),l=new t(o);return Ag.extendError(l,i,s)}return r[Symbol.species]=t,r}cR.toJSON=function(e){return P4.toJSON.call(e)};cR.extend=function(e,r,n){return n||r instanceof Error?Ag.extendError(e,r,n):r?Ag.extendError(e,void 0,r):Ag.extendError(e)}});var uA=H(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.ono=void 0;var Ma=fR(),A4=$i;Ng.ono=A4;$i.error=new Ma.Ono(Error);$i.eval=new Ma.Ono(EvalError);$i.range=new Ma.Ono(RangeError);$i.reference=new Ma.Ono(ReferenceError);$i.syntax=new Ma.Ono(SyntaxError);$i.type=new Ma.Ono(TypeError);$i.uri=new Ma.Ono(URIError);var $4=$i;function $i(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values($4))if(typeof r=="function"&&r.name==="ono"){let n=r[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return r.apply(void 0,t)}}return $i.error.apply(void 0,t)}});var fA=H(cA=>{"use strict";Object.defineProperty(cA,"__esModule",{value:!0});var Wte=ft("util")});var yo=H((oi,$u)=>{"use strict";var N4=oi&&oi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M4=oi&&oi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&N4(e,t,r)};Object.defineProperty(oi,"__esModule",{value:!0});oi.ono=void 0;var dA=uA();Object.defineProperty(oi,"ono",{enumerable:!0,get:function(){return dA.ono}});var F4=fR();Object.defineProperty(oi,"Ono",{enumerable:!0,get:function(){return F4.Ono}});M4(fA(),oi);oi.default=dA.ono;typeof $u=="object"&&typeof $u.exports=="object"&&($u.exports=Object.assign($u.exports.default,$u.exports))});var dR=H(kd=>{"use strict";var D4=kd&&kd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kd,"__esModule",{value:!0});kd.default=L4;var pA=D4(ft("path"));function L4(t){return t.startsWith("\\\\?\\")?t:t.split(pA.default?.win32?.sep).join(pA.default?.posix?.sep??"/")}});var hA=H(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.isWindows=void 0;var j4=/^win/.test(globalThis.process?globalThis.process.platform:""),U4=()=>j4;Mg.isWindows=U4});var Tn=H(qt=>{"use strict";var H4=qt&&qt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B4=qt&&qt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),V4=qt&&qt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&H4(r,e,n[i]);return B4(r,e),r}})(),W4=qt&&qt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qt,"__esModule",{value:!0});qt.parse=void 0;qt.resolve=mA;qt.cwd=gA;qt.getProtocol=yR;qt.getExtension=X4;qt.stripQuery=yA;qt.getHash=vA;qt.stripHash=mR;qt.isHttp=e3;qt.isFileSystemPath=gR;qt.fromFileSystemPath=t3;qt.toFileSystemPath=r3;qt.safePointerToPath=n3;qt.relative=i3;var Dg=W4(dR()),hR=V4(ft("path")),z4=/\//g,J4=/^(\w{2,}):\/\//i,G4=/~1/g,Y4=/~0/g,K4=ft("path"),Fg=hA(),Q4=[[/\?/g,"%3F"],[/#/g,"%23"]],pR=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],Z4=t=>new URL(t);qt.parse=Z4;function mA(t,e){let r=new URL((0,Dg.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,Dg.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:o,hash:l}=n;return s+o+l+i}return n.toString()+i}function gA(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function yR(t){let e=J4.exec(t||"");if(e)return e[1].toLowerCase()}function X4(t){let e=t.lastIndexOf(".");return e>=0?yA(t.substr(e).toLowerCase()):""}function yA(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function vA(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function mR(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function e3(t){let e=yR(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function gR(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=yR(t);return e===void 0||e==="file"}function t3(t){if((0,Fg.isWindows)()){let e=gA(),r=t.toUpperCase(),i=(0,Dg.default)(e).toUpperCase(),s=r.includes(i),o=r.includes(i),l=hR.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||o||l)&&!e.startsWith("http")&&(t=(0,K4.join)(e,t)),t=(0,Dg.default)(t)}t=encodeURI(t);for(let e of Q4)t=t.replace(e[0],e[1]);return t}function r3(t,e){t=decodeURI(t);for(let n=0;n<pR.length;n+=2)t=t.replace(pR[n],pR[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,Fg.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,Fg.isWindows)()?t:"/"+t)),(0,Fg.isWindows)()&&!r&&(t=t.replace(z4,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function n3(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(G4,"/").replace(Y4,"~"))}function i3(t,e){if(!gR(t)||!gR(e))return mA(t,e);let r=hR.default.dirname(mR(t)),n=mR(e);return hR.default.relative(r,n)+vA(e)}});var An=H(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.InvalidPointerError=Nt.TimeoutError=Nt.MissingPointerError=Nt.UnmatchedResolverError=Nt.ResolverError=Nt.UnmatchedParserError=Nt.ParserError=Nt.JSONParserErrorGroup=Nt.JSONParserError=void 0;Nt.isHandledError=s3;Nt.normalizeError=o3;var bA=yo(),Lg=Tn(),ai=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,bA.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Nt.JSONParserError=ai;var jg=class t 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,Lg.toFileSystemPath)(e.$refs._root$Ref.path)}'`,bA.Ono.extend(this)}static getParserErrors(e){let r=[];for(let n of Object.values(e.$refs._$refs))n.errors&&r.push(...n.errors);return r}get errors(){return t.getParserErrors(this.files)}};Nt.JSONParserErrorGroup=jg;var vR=class extends ai{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};Nt.ParserError=vR;var bR=class extends ai{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};Nt.UnmatchedParserError=bR;var SR=class extends ai{constructor(e,r){super(e.message||`Error reading file "${r}"`,r),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};Nt.ResolverError=SR;var wR=class extends ai{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};Nt.UnmatchedResolverError=wR;var _R=class extends ai{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,Lg.getHash)(r)}". Token "${e}" does not exist.`,(0,Lg.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};Nt.MissingPointerError=_R;var RR=class extends ai{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};Nt.TimeoutError=RR;var CR=class extends ai{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,Lg.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};Nt.InvalidPointerError=CR;function s3(t){return t instanceof ai||t instanceof jg}function o3(t){return t.path===null&&(t.path=[]),t}});var Pd=H(Yr=>{"use strict";var a3=Yr&&Yr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),l3=Yr&&Yr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),u3=Yr&&Yr.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&a3(r,e,n[i]);return l3(r,e),r}})(),c3=Yr&&Yr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.nullSymbol=void 0;var xR=c3(Nu()),ER=u3(Tn()),Hg=An();Yr.nullSymbol=Symbol("null");var f3=/\//g,d3=/~/g,p3=/~1/g,h3=/~0/g,m3=t=>{try{return decodeURIComponent(t)}catch{return t}},Bg=class t{constructor(e,r,n){this.$ref=e,this.path=r,this.originalPath=n||r,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,r,n){let i=t.parse(this.path,this.originalPath),s=[];this.value=wA(e);for(let o=0;o<i.length;o++){if(Ug(this,r,n)&&(this.path=t.join(this.path,i.slice(o))),typeof this.value=="object"&&this.value!==null&&!_A(n)&&"$ref"in this.value)return this;let l=i[o];if(this.value[l]===void 0||this.value[l]===null&&o===i.length-1){let f=!1;for(let v=i.length-1;v>o;v--){let _=i.slice(o,v+1).join("/");if(this.value[_]!==void 0){this.value=this.value[_],o=v,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Yr.nullSymbol;continue}this.value=null;let c=this.$ref.path||"",p=this.path.replace(c,""),h=t.join("",s),g=n?.replace(c,"");throw new Hg.MissingPointerError(l,decodeURI(this.originalPath),p,h,g)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&ER.resolve(this.path,this.value.$ref)!==n)&&Ug(this,r,n),this}set(e,r,n){let i=t.parse(this.path),s;if(i.length===0)return this.value=r,r;this.value=wA(e);for(let o=0;o<i.length-1;o++)Ug(this,n),s=i[o],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=SA(this,s,{});return Ug(this,n),s=i[i.length-1],SA(this,s,r),e}static parse(e,r){let n=ER.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=m3(i[s].replace(p3,"/").replace(h3,"~"));if(i[0]!=="")throw new Hg.InvalidPointerError(n,r===void 0?e:r);return i.slice(1)}static join(e,r){e.indexOf("#")===-1&&(e+="#"),r=Array.isArray(r)?r:[r];for(let n=0;n<r.length;n++){let i=r[n];e+="/"+encodeURIComponent(i.replace(d3,"~0").replace(f3,"~1"))}return e}};function Ug(t,e,r){if(xR.default.isAllowed$Ref(t.value,e)){let n=ER.resolve(t.path,t.value.$ref);if(n===t.path&&!_A(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,xR.default.isExtended$Ref(t.value)?(t.value=xR.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Yr.default=Bg;function SA(t,e,r){if(t.value&&typeof t.value=="object")e==="-"&&Array.isArray(t.value)?t.value.push(r):t.value[e]=r;else throw new Hg.JSONParserError(`Error assigning $ref pointer "${t.path}".
240
+ Cannot set "${e}" of a non-object.`);return r}function wA(t){if((0,Hg.isHandledError)(t))throw t;return t}function _A(t){return typeof t=="string"&&Bg.parse(t).length==0}});var Nu=H(ps=>{"use strict";var g3=ps&&ps.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y3=ps&&ps.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),v3=ps&&ps.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&g3(r,e,n[i]);return y3(r,e),r}})();Object.defineProperty(ps,"__esModule",{value:!0});var Vg=v3(Pd()),Wg=An(),IR=Tn(),OR=class t{constructor(e){this.errors=[],this.$refs=e}addError(e){this.errors===void 0&&(this.errors=[]);let r=this.errors.map(({footprint:n})=>n);"errors"in e&&Array.isArray(e.errors)?this.errors.push(...e.errors.map(Wg.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,Wg.normalizeError)(e))}exists(e,r){try{return this.resolve(e,r),!0}catch{return!1}}get(e,r){return this.resolve(e,r)?.value}resolve(e,r,n,i){let s=new Vg.default(this,e,n);try{let o=s.resolve(this.value,r,i);return o.value===Vg.nullSymbol&&(o.value=null),o}catch(o){if(!r||!r.continueOnError||!(0,Wg.isHandledError)(o))throw o;return o.path===null&&(o.path=(0,IR.safePointerToPath)((0,IR.getHash)(i))),o instanceof Wg.InvalidPointerError&&(o.source=decodeURI((0,IR.stripHash)(i))),this.addError(o),null}}set(e,r){let n=new Vg.default(this,e);this.value=n.set(this.value,r),this.value===Vg.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 t.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,r){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||e.$ref==="#")return!0;if(e.$ref[0]!=="#"&&(!r||r.resolve?.external))return!0}}static isExtended$Ref(e){return t.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,r){if(r&&typeof r=="object"&&t.isExtended$Ref(e)){let n={};for(let i of Object.keys(e))i!=="$ref"&&(n[i]=e[i]);for(let i of Object.keys(r))i in n||(n[i]=r[i]);return n}else return r}};ps.default=OR});var IA=H(li=>{"use strict";var b3=li&&li.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),S3=li&&li.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w3=li&&li.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&b3(r,e,n[i]);return S3(r,e),r}})(),EA=li&&li.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(li,"__esModule",{value:!0});var RA=yo(),_3=EA(Nu()),vo=w3(Tn()),CA=EA(dR()),qR=class{paths(...e){return xA(this._$refs,e.flat()).map(n=>(0,CA.default)(n.decoded))}values(...e){let r=this._$refs;return xA(r,e.flat()).reduce((i,s)=>(i[(0,CA.default)(s.decoded)]=r[s.encoded].value,i),{})}exists(e,r){try{return this._resolve(e,"",r),!0}catch{return!1}}get(e,r){return this._resolve(e,"",r).value}set(e,r){let n=vo.resolve(this._root$Ref.path,e),i=vo.stripHash(n),s=this._$refs[i];if(!s)throw(0,RA.ono)(`Error resolving $ref pointer "${e}".
241
241
  "${i}" not found.`);s.set(n,r)}_get$Ref(e){e=vo.resolve(this._root$Ref.path,e);let r=vo.stripHash(e);return this._$refs[r]}_add(e){let r=vo.stripHash(e),n=new _3.default(this);return n.path=r,this._$refs[r]=n,this._root$Ref=this._root$Ref||n,n}_resolve(e,r,n){let i=vo.resolve(this._root$Ref.path,e),s=vo.stripHash(i),o=this._$refs[s];if(!o)throw(0,RA.ono)(`Error resolving $ref pointer "${e}".
242
- "${s}" not found.`);return o.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};li.default=OR;function xA(t,e){let r=Object.keys(t);return e=Array.isArray(e[0])?e[0]:Array.prototype.slice.call(e),e.length>0&&e[0]&&(r=r.filter(n=>e.includes(t[n].pathType))),r.map(n=>({encoded:n,decoded:t[n].pathType==="file"?vo.toFileSystemPath(n,!0):n}))}});var OA=H(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.all=R3;Mu.filter=C3;Mu.sort=x3;Mu.run=E3;function R3(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function C3(t,e,r){return t.filter(n=>!!qA(n,e,r))}function x3(t){for(let e of t)e.order=e.order||Number.MAX_SAFE_INTEGER;return t.sort((e,r)=>e.order-r.order)}async function E3(t,e,r,n){let i,s,o=0;return new Promise((l,f)=>{c();function c(){if(i=t[o++],!i)return f(s);try{let v=qA(i,e,r,p,n);if(v&&typeof v.then=="function")v.then(h,g);else if(v!==void 0)h(v);else if(o===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(v){g(v)}}function p(v,_){v?g(v):h(_)}function h(v){l({plugin:i,result:v})}function g(v){s={plugin:i,error:v},c()}})}function qA(t,e,r,n,i){let s=t[e];if(typeof s=="function")return s.apply(t,[r,n,i]);if(!n){if(s instanceof RegExp)return s.test(r.url);if(typeof s=="string")return s===r.extension;if(Array.isArray(s))return s.indexOf(r.extension)!==-1}return s}});var PR=H(hs=>{"use strict";var I3=hs&&hs.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),q3=hs&&hs.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kA=hs&&hs.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&I3(r,e,n[i]);return q3(r,e),r}})();Object.defineProperty(hs,"__esModule",{value:!0});var kR=yo(),O3=kA(Tn()),bo=kA(OA()),Fa=An();async function k3(t,e,r){let n=t.indexOf("#"),i="";n>=0&&(i=t.substring(n),t=t.substring(0,n));let s=e._add(t),o={url:t,hash:i,extension:O3.getExtension(t)};try{let l=await P3(o,r,e);s.pathType=l.plugin.name,o.data=l.result;let f=await T3(o,r,e);return s.value=f.result,f.result}catch(l){throw(0,Fa.isHandledError)(l)&&(s.value=l),l}}async function P3(t,e,r){let n=bo.all(e.resolve);n=bo.filter(n,"canRead",t),bo.sort(n);try{return await bo.run(n,"read",t,r)}catch(i){throw!i&&e.continueOnError?new Fa.UnmatchedResolverError(t.url):!i||!("error"in i)?kR.ono.syntax(`Unable to resolve $ref pointer "${t.url}"`):i.error instanceof Fa.ResolverError?i.error:new Fa.ResolverError(i,t.url)}}async function T3(t,e,r){let n=bo.all(e.parse),i=bo.filter(n,"canParse",t),s=i.length>0?i:n;bo.sort(s);try{let o=await bo.run(s,"parse",t,r);if(!o.plugin.allowEmpty&&A3(o.result))throw kR.ono.syntax(`Error parsing "${t.url}" as ${o.plugin.name}.
242
+ "${s}" not found.`);return o.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};li.default=qR;function xA(t,e){let r=Object.keys(t);return e=Array.isArray(e[0])?e[0]:Array.prototype.slice.call(e),e.length>0&&e[0]&&(r=r.filter(n=>e.includes(t[n].pathType))),r.map(n=>({encoded:n,decoded:t[n].pathType==="file"?vo.toFileSystemPath(n,!0):n}))}});var qA=H(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.all=R3;Mu.filter=C3;Mu.sort=x3;Mu.run=E3;function R3(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function C3(t,e,r){return t.filter(n=>!!OA(n,e,r))}function x3(t){for(let e of t)e.order=e.order||Number.MAX_SAFE_INTEGER;return t.sort((e,r)=>e.order-r.order)}async function E3(t,e,r,n){let i,s,o=0;return new Promise((l,f)=>{c();function c(){if(i=t[o++],!i)return f(s);try{let v=OA(i,e,r,p,n);if(v&&typeof v.then=="function")v.then(h,g);else if(v!==void 0)h(v);else if(o===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(v){g(v)}}function p(v,_){v?g(v):h(_)}function h(v){l({plugin:i,result:v})}function g(v){s={plugin:i,error:v},c()}})}function OA(t,e,r,n,i){let s=t[e];if(typeof s=="function")return s.apply(t,[r,n,i]);if(!n){if(s instanceof RegExp)return s.test(r.url);if(typeof s=="string")return s===r.extension;if(Array.isArray(s))return s.indexOf(r.extension)!==-1}return s}});var PR=H(hs=>{"use strict";var I3=hs&&hs.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),O3=hs&&hs.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kA=hs&&hs.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&I3(r,e,n[i]);return O3(r,e),r}})();Object.defineProperty(hs,"__esModule",{value:!0});var kR=yo(),q3=kA(Tn()),bo=kA(qA()),Fa=An();async function k3(t,e,r){let n=t.indexOf("#"),i="";n>=0&&(i=t.substring(n),t=t.substring(0,n));let s=e._add(t),o={url:t,hash:i,extension:q3.getExtension(t)};try{let l=await P3(o,r,e);s.pathType=l.plugin.name,o.data=l.result;let f=await T3(o,r,e);return s.value=f.result,f.result}catch(l){throw(0,Fa.isHandledError)(l)&&(s.value=l),l}}async function P3(t,e,r){let n=bo.all(e.resolve);n=bo.filter(n,"canRead",t),bo.sort(n);try{return await bo.run(n,"read",t,r)}catch(i){throw!i&&e.continueOnError?new Fa.UnmatchedResolverError(t.url):!i||!("error"in i)?kR.ono.syntax(`Unable to resolve $ref pointer "${t.url}"`):i.error instanceof Fa.ResolverError?i.error:new Fa.ResolverError(i,t.url)}}async function T3(t,e,r){let n=bo.all(e.parse),i=bo.filter(n,"canParse",t),s=i.length>0?i:n;bo.sort(s);try{let o=await bo.run(s,"parse",t,r);if(!o.plugin.allowEmpty&&A3(o.result))throw kR.ono.syntax(`Error parsing "${t.url}" as ${o.plugin.name}.
243
243
  Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new Fa.UnmatchedParserError(t.url):o&&o.message&&o.message.startsWith("Error parsing")?o:!o||!("error"in o)?kR.ono.syntax(`Unable to parse ${t.url}`):o.error instanceof Fa.ParserError?o.error:new Fa.ParserError(o.error.message,t.url)}}function A3(t){return t===void 0||typeof t=="object"&&Object.keys(t).length===0||typeof t=="string"&&t.trim().length===0||Buffer.isBuffer(t)&&t.length===0}hs.default=k3});var TA=H(TR=>{"use strict";Object.defineProperty(TR,"__esModule",{value:!0});var PA=An();TR.default={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string"){if(e.trim().length===0)return;try{return JSON.parse(e)}catch(r){if(this.allowBOM)try{let n=e.indexOf("{");return e=e.slice(n),JSON.parse(e)}catch(n){throw new PA.ParserError(n.message,t.url)}throw new PA.ParserError(r.message,t.url)}}else return e}}});var Fu=H((nre,Da)=>{"use strict";function AA(t){return typeof t>"u"||t===null}function $3(t){return typeof t=="object"&&t!==null}function N3(t){return Array.isArray(t)?t:AA(t)?[]:[t]}function M3(t,e){if(e){let r=Object.keys(e);for(let n=0,i=r.length;n<i;n+=1){let s=r[n];t[s]=e[s]}}return t}function F3(t,e){let r="";for(let n=0;n<e;n+=1)r+=t;return r}function D3(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}Da.exports.isNothing=AA;Da.exports.isObject=$3;Da.exports.toArray=N3;Da.exports.repeat=F3;Da.exports.isNegativeZero=D3;Da.exports.extend=M3});var Du=H((ire,NA)=>{"use strict";function $A(t,e){let r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
244
244
 
245
245
  `+t.mark.snippet),n+" "+r):n}function Td(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=$A(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Td.prototype=Object.create(Error.prototype);Td.prototype.constructor=Td;Td.prototype.toString=function(e){return this.name+": "+$A(this,e)};NA.exports=Td});var FA=H((sre,MA)=>{"use strict";var Ad=Fu();function AR(t,e,r,n,i){let s="",o="",l=Math.floor(i/2)-1;return n-e>l&&(s=" ... ",e=n-l+s.length),r-n>l&&(o=" ...",r=n+l-o.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+o,pos:n-e+s.length}}function $R(t,e){return Ad.repeat(" ",e-t.length)+t}function L3(t,e){if(e=Object.create(e||null),!t.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 r=/\r?\n|\r|\0/g,n=[0],i=[],s,o=-1;for(;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);let l="",f=Math.min(t.line+e.linesAfter,i.length).toString().length,c=e.maxLength-(e.indent+f+3);for(let h=1;h<=e.linesBefore&&!(o-h<0);h++){let g=AR(t.buffer,n[o-h],i[o-h],t.position-(n[o]-n[o-h]),c);l=Ad.repeat(" ",e.indent)+$R((t.line-h+1).toString(),f)+" | "+g.str+`
@@ -247,7 +247,7 @@ Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new Fa.Unma
247
247
  `,l+=Ad.repeat("-",e.indent+f+3+p.pos)+`^
248
248
  `;for(let h=1;h<=e.linesAfter&&!(o+h>=i.length);h++){let g=AR(t.buffer,n[o+h],i[o+h],t.position-(n[o]-n[o+h]),c);l+=Ad.repeat(" ",e.indent)+$R((t.line+h+1).toString(),f)+" | "+g.str+`
249
249
  `}return l.replace(/\n$/,"")}MA.exports=L3});var yr=H((ore,LA)=>{"use strict";var DA=Du(),j3=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],U3=["scalar","sequence","mapping"];function H3(t){let e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function B3(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(j3.indexOf(r)===-1)throw new DA('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},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=H3(e.styleAliases||null),U3.indexOf(this.kind)===-1)throw new DA('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}LA.exports=B3});var FR=H((are,UA)=>{"use strict";var $d=Du(),NR=yr();function jA(t,e){let r=[];return t[e].forEach(function(n){let i=r.length;r.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=o)}),r[i]=n}),r}function V3(){let t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function e(r){r.multi?(t.multi[r.kind].push(r),t.multi.fallback.push(r)):t[r.kind][r.tag]=t.fallback[r.tag]=r}for(let r=0,n=arguments.length;r<n;r+=1)arguments[r].forEach(e);return t}function MR(t){return this.extend(t)}MR.prototype.extend=function(e){let r=[],n=[];if(e instanceof NR)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&&(r=r.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new $d("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof NR))throw new $d("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new $d("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 $d("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 NR))throw new $d("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(MR.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=jA(i,"implicit"),i.compiledExplicit=jA(i,"explicit"),i.compiledTypeMap=V3(i.compiledImplicit,i.compiledExplicit),i};UA.exports=MR});var DR=H((lre,HA)=>{"use strict";var W3=yr();HA.exports=new W3("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var LR=H((ure,BA)=>{"use strict";var z3=yr();BA.exports=new z3("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var jR=H((cre,VA)=>{"use strict";var J3=yr();VA.exports=new J3("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var UR=H((fre,WA)=>{"use strict";var G3=FR();WA.exports=new G3({explicit:[DR(),LR(),jR()]})});var HR=H((dre,zA)=>{"use strict";var Y3=yr();function K3(t){if(t===null)return!0;let e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function Q3(){return null}function Z3(t){return t===null}zA.exports=new Y3("tag:yaml.org,2002:null",{kind:"scalar",resolve:K3,construct:Q3,predicate:Z3,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var BR=H((pre,JA)=>{"use strict";var X3=yr();function e6(t){if(t===null)return!1;let e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function t6(t){return t==="true"||t==="True"||t==="TRUE"}function r6(t){return Object.prototype.toString.call(t)==="[object Boolean]"}JA.exports=new X3("tag:yaml.org,2002:bool",{kind:"scalar",resolve:e6,construct:t6,predicate:r6,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})});var VR=H((hre,GA)=>{"use strict";var n6=Fu(),i6=yr();function s6(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function o6(t){return t>=48&&t<=55}function a6(t){return t>=48&&t<=57}function l6(t){if(t===null)return!1;let e=t.length,r=0,n=!1;if(!e)return!1;let i=t[r];if((i==="-"||i==="+")&&(i=t[++r]),i==="0"){if(r+1===e)return!0;if(i=t[++r],i==="b"){for(r++;r<e;r++){if(i=t[r],i!=="0"&&i!=="1")return!1;n=!0}return n&&Number.isFinite(Nd(t))}if(i==="x"){for(r++;r<e;r++){if(!s6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Nd(t))}if(i==="o"){for(r++;r<e;r++){if(!o6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Nd(t))}}for(;r<e;r++){if(!a6(t.charCodeAt(r)))return!1;n=!0}return n?Number.isFinite(Nd(t)):!1}function Nd(t){let e=t,r=1,n=e[0];if((n==="-"||n==="+")&&(n==="-"&&(r=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return r*parseInt(e.slice(2),2);if(e[1]==="x")return r*parseInt(e.slice(2),16);if(e[1]==="o")return r*parseInt(e.slice(2),8)}return r*parseInt(e,10)}function u6(t){return Nd(t)}function c6(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!n6.isNegativeZero(t)}GA.exports=new i6("tag:yaml.org,2002:int",{kind:"scalar",resolve:l6,construct:u6,predicate:c6,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var WR=H((mre,KA)=>{"use strict";var YA=Fu(),f6=yr(),d6=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),p6=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function h6(t){return t===null||!d6.test(t)?!1:Number.isFinite(parseFloat(t,10))?!0:p6.test(t)}function m6(t){let e=t.toLowerCase(),r=e[0]==="-"?-1:1;return"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}var g6=/^[-+]?[0-9]+e/;function y6(t,e){if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(YA.isNegativeZero(t))return"-0.0";let r=t.toString(10);return g6.test(r)?r.replace("e",".e"):r}function v6(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||YA.isNegativeZero(t))}KA.exports=new f6("tag:yaml.org,2002:float",{kind:"scalar",resolve:h6,construct:m6,predicate:v6,represent:y6,defaultStyle:"lowercase"})});var zR=H((gre,QA)=>{"use strict";QA.exports=UR().extend({implicit:[HR(),BR(),VR(),WR()]})});var JR=H((yre,ZA)=>{"use strict";ZA.exports=zR()});var GR=H((vre,t1)=>{"use strict";var b6=yr(),XA=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),e1=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 S6(t){return t===null?!1:XA.exec(t)!==null||e1.exec(t)!==null}function w6(t){let e=0,r=null,n=XA.exec(t);if(n===null&&(n=e1.exec(t)),n===null)throw new Error("Date resolve error");let i=+n[1],s=+n[2]-1,o=+n[3];if(!n[4])return new Date(Date.UTC(i,s,o));let l=+n[4],f=+n[5],c=+n[6];if(n[7]){for(e=n[7].slice(0,3);e.length<3;)e+="0";e=+e}if(n[9]){let h=+n[10],g=+(n[11]||0);r=(h*60+g)*6e4,n[9]==="-"&&(r=-r)}let p=new Date(Date.UTC(i,s,o,l,f,c,e));return r&&p.setTime(p.getTime()-r),p}function _6(t){return t.toISOString()}t1.exports=new b6("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:S6,construct:w6,instanceOf:Date,represent:_6})});var YR=H((bre,r1)=>{"use strict";var R6=yr();function C6(t){return t==="<<"||t===null}r1.exports=new R6("tag:yaml.org,2002:merge",{kind:"scalar",resolve:C6})});var QR=H((Sre,n1)=>{"use strict";var x6=yr(),KR=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
250
- \r`;function E6(t){if(t===null)return!1;let e=0,r=t.length,n=KR;for(let i=0;i<r;i++){let s=n.indexOf(t.charAt(i));if(!(s>64)){if(s<0)return!1;e+=6}}return e%8===0}function I6(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=KR,i=0,s=[];for(let l=0;l<r;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 o=r%4*6;return o===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):o===18?(s.push(i>>10&255),s.push(i>>2&255)):o===12&&s.push(i>>4&255),new Uint8Array(s)}function q6(t){let e="",r=0,n=t.length,i=KR;for(let o=0;o<n;o++)o%3===0&&o&&(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]),r=(r<<8)+t[o];let s=n%3;return s===0?(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]):s===2?(e+=i[r>>10&63],e+=i[r>>4&63],e+=i[r<<2&63],e+=i[64]):s===1&&(e+=i[r>>2&63],e+=i[r<<4&63],e+=i[64],e+=i[64]),e}function O6(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}n1.exports=new x6("tag:yaml.org,2002:binary",{kind:"scalar",resolve:E6,construct:I6,predicate:O6,represent:q6})});var ZR=H((wre,i1)=>{"use strict";var k6=yr(),P6=Object.prototype.hasOwnProperty,T6=Object.prototype.toString;function A6(t){if(t===null)return!0;let e=[],r=t;for(let n=0,i=r.length;n<i;n+=1){let s=r[n],o=!1;if(T6.call(s)!=="[object Object]")return!1;let l;for(l in s)if(P6.call(s,l))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(l)===-1)e.push(l);else return!1}return!0}function $6(t){return t!==null?t:[]}i1.exports=new k6("tag:yaml.org,2002:omap",{kind:"sequence",resolve:A6,construct:$6})});var XR=H((_re,s1)=>{"use strict";var N6=yr(),M6=Object.prototype.toString;function F6(t){if(t===null)return!0;let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n];if(M6.call(s)!=="[object Object]")return!1;let o=Object.keys(s);if(o.length!==1)return!1;r[n]=[o[0],s[o[0]]]}return!0}function D6(t){if(t===null)return[];let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n],o=Object.keys(s);r[n]=[o[0],s[o[0]]]}return r}s1.exports=new N6("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:F6,construct:D6})});var eC=H((Rre,o1)=>{"use strict";var L6=yr(),j6=Object.prototype.hasOwnProperty;function U6(t){if(t===null)return!0;let e=t;for(let r in e)if(j6.call(e,r)&&e[r]!==null)return!1;return!0}function H6(t){return t!==null?t:{}}o1.exports=new L6("tag:yaml.org,2002:set",{kind:"mapping",resolve:U6,construct:H6})});var zg=H((Cre,a1)=>{"use strict";a1.exports=JR().extend({implicit:[GR(),YR()],explicit:[QR(),ZR(),XR(),eC()]})});var I1=H((xre,iC)=>{"use strict";var La=Fu(),m1=Du(),B6=FA(),V6=zg(),ui=Object.prototype.hasOwnProperty,Jg=1,g1=2,y1=3,Gg=4,tC=1,W6=2,l1=3,z6=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,J6=/[\x85\u2028\u2029]/,G6=/[,\[\]{}]/,v1=/^(?:!|!!|![0-9A-Za-z-]+!)$/,b1=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function u1(t){return Object.prototype.toString.call(t)}function Ni(t){return t===10||t===13}function ms(t){return t===9||t===32}function Kr(t){return t===9||t===32||t===10||t===13}function Lu(t){return t===44||t===91||t===93||t===123||t===125}function Y6(t){if(t>=48&&t<=57)return t-48;let e=t|32;return e>=97&&e<=102?e-97+10:-1}function K6(t){return t===120?2:t===117?4:t===85?8:0}function Q6(t){return t>=48&&t<=57?t-48:-1}function c1(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
250
+ \r`;function E6(t){if(t===null)return!1;let e=0,r=t.length,n=KR;for(let i=0;i<r;i++){let s=n.indexOf(t.charAt(i));if(!(s>64)){if(s<0)return!1;e+=6}}return e%8===0}function I6(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=KR,i=0,s=[];for(let l=0;l<r;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 o=r%4*6;return o===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):o===18?(s.push(i>>10&255),s.push(i>>2&255)):o===12&&s.push(i>>4&255),new Uint8Array(s)}function O6(t){let e="",r=0,n=t.length,i=KR;for(let o=0;o<n;o++)o%3===0&&o&&(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]),r=(r<<8)+t[o];let s=n%3;return s===0?(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]):s===2?(e+=i[r>>10&63],e+=i[r>>4&63],e+=i[r<<2&63],e+=i[64]):s===1&&(e+=i[r>>2&63],e+=i[r<<4&63],e+=i[64],e+=i[64]),e}function q6(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}n1.exports=new x6("tag:yaml.org,2002:binary",{kind:"scalar",resolve:E6,construct:I6,predicate:q6,represent:O6})});var ZR=H((wre,i1)=>{"use strict";var k6=yr(),P6=Object.prototype.hasOwnProperty,T6=Object.prototype.toString;function A6(t){if(t===null)return!0;let e=[],r=t;for(let n=0,i=r.length;n<i;n+=1){let s=r[n],o=!1;if(T6.call(s)!=="[object Object]")return!1;let l;for(l in s)if(P6.call(s,l))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(l)===-1)e.push(l);else return!1}return!0}function $6(t){return t!==null?t:[]}i1.exports=new k6("tag:yaml.org,2002:omap",{kind:"sequence",resolve:A6,construct:$6})});var XR=H((_re,s1)=>{"use strict";var N6=yr(),M6=Object.prototype.toString;function F6(t){if(t===null)return!0;let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n];if(M6.call(s)!=="[object Object]")return!1;let o=Object.keys(s);if(o.length!==1)return!1;r[n]=[o[0],s[o[0]]]}return!0}function D6(t){if(t===null)return[];let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n],o=Object.keys(s);r[n]=[o[0],s[o[0]]]}return r}s1.exports=new N6("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:F6,construct:D6})});var eC=H((Rre,o1)=>{"use strict";var L6=yr(),j6=Object.prototype.hasOwnProperty;function U6(t){if(t===null)return!0;let e=t;for(let r in e)if(j6.call(e,r)&&e[r]!==null)return!1;return!0}function H6(t){return t!==null?t:{}}o1.exports=new L6("tag:yaml.org,2002:set",{kind:"mapping",resolve:U6,construct:H6})});var zg=H((Cre,a1)=>{"use strict";a1.exports=JR().extend({implicit:[GR(),YR()],explicit:[QR(),ZR(),XR(),eC()]})});var I1=H((xre,iC)=>{"use strict";var La=Fu(),m1=Du(),B6=FA(),V6=zg(),ui=Object.prototype.hasOwnProperty,Jg=1,g1=2,y1=3,Gg=4,tC=1,W6=2,l1=3,z6=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,J6=/[\x85\u2028\u2029]/,G6=/[,\[\]{}]/,v1=/^(?:!|!!|![0-9A-Za-z-]+!)$/,b1=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function u1(t){return Object.prototype.toString.call(t)}function Ni(t){return t===10||t===13}function ms(t){return t===9||t===32}function Kr(t){return t===9||t===32||t===10||t===13}function Lu(t){return t===44||t===91||t===93||t===123||t===125}function Y6(t){if(t>=48&&t<=57)return t-48;let e=t|32;return e>=97&&e<=102?e-97+10:-1}function K6(t){return t===120?2:t===117?4:t===85?8:0}function Q6(t){return t>=48&&t<=57?t-48:-1}function c1(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
251
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 Z6(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function S1(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var w1=new Array(256),_1=new Array(256);for(let t=0;t<256;t++)w1[t]=c1(t)?1:0,_1[t]=c1(t);function X6(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||V6,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=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function R1(t,e){let r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=B6(r),new m1(e,r)}function me(t,e){throw R1(t,e)}function Yg(t,e){t.onWarning&&t.onWarning.call(null,R1(t,e))}function ja(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];ui.call(i,e)||(i[e]={existed:ui.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function e9(t){t.anchorMapTransactions.push(Object.create(null))}function t9(t){let e=t.anchorMapTransactions.pop(),r=t.anchorMapTransactions;if(r.length===0)return;let n=r[r.length-1],i=Object.keys(e);for(let s=0,o=i.length;s<o;s+=1){let l=i[s];ui.call(n,l)||(n[l]=e[l])}}function r9(t){let e=t.anchorMapTransactions.pop(),r=Object.keys(e);for(let n=r.length-1;n>=0;n-=1){let i=e[r[n]];i.existed?t.anchorMap[r[n]]=i.value:delete t.anchorMap[r[n]]}}function C1(t){return{position:t.position,line:t.line,lineStart:t.lineStart,lineIndent:t.lineIndent,firstTabInLine:t.firstTabInLine,tag:t.tag,anchor:t.anchor,kind:t.kind,result:t.result}}function f1(t,e){t.position=e.position,t.line=e.line,t.lineStart=e.lineStart,t.lineIndent=e.lineIndent,t.firstTabInLine=e.firstTabInLine,t.tag=e.tag,t.anchor=e.anchor,t.kind=e.kind,t.result=e.result}var d1={YAML:function(e,r,n){e.version!==null&&me(e,"duplication of %YAML directive"),n.length!==1&&me(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&me(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),o=parseInt(i[2],10);s!==1&&me(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&Yg(e,"unsupported YAML version of the document")},TAG:function(e,r,n){let i;n.length!==2&&me(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],v1.test(s)||me(e,"ill-formed tag handle (first argument) of the TAG directive"),ui.call(e.tagMap,s)&&me(e,'there is a previously declared suffix for "'+s+'" tag handle'),b1.test(i)||me(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{me(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}};function So(t,e,r,n){if(e<r){let i=t.input.slice(e,r);if(n)for(let s=0,o=i.length;s<o;s+=1){let l=i.charCodeAt(s);l===9||l>=32&&l<=1114111||me(t,"expected valid JSON character")}else z6.test(i)&&me(t,"the stream contains non-printable characters");t.result+=i}}function p1(t,e,r,n){La.isObject(r)||me(t,"cannot merge mappings; the provided source object is unacceptable");let i=Object.keys(r);for(let s=0,o=i.length;s<o;s+=1){let l=i[s];ui.call(e,l)||(S1(e,l,r[l]),n[l]=!0)}}function ju(t,e,r,n,i,s,o,l,f){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let c=0,p=i.length;c<p;c+=1)Array.isArray(i[c])&&me(t,"nested arrays are not supported inside keys"),typeof i=="object"&&u1(i[c])==="[object Object]"&&(i[c]="[object Object]")}if(typeof i=="object"&&u1(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s)){s.length>t.maxMergeSeqLength&&me(t,"merge sequence length exceeded maxMergeSeqLength ("+t.maxMergeSeqLength+")");let c=new Set;for(let p=0,h=s.length;p<h;p+=1){let g=s[p];c.has(g)||(c.add(g),p1(t,e,g,r))}}else p1(t,e,s,r);else!t.json&&!ui.call(r,i)&&ui.call(e,i)&&(t.line=o||t.line,t.lineStart=l||t.lineStart,t.position=f||t.position,me(t,"duplicated mapping key")),S1(e,i,s),delete r[i];return e}function rC(t){let e=t.input.charCodeAt(t.position);e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):me(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Vt(t,e,r){let n=0,i=t.input.charCodeAt(t.position);for(;i!==0;){for(;ms(i);)i===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&i===35)do i=t.input.charCodeAt(++t.position);while(i!==10&&i!==13&&i!==0);if(Ni(i))for(rC(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;i===32;)t.lineIndent++,i=t.input.charCodeAt(++t.position);else break}return r!==-1&&n!==0&&t.lineIndent<r&&Yg(t,"deficient indentation"),n}function Kg(t){let e=t.position,r=t.input.charCodeAt(e);return!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||Kr(r)))}function nC(t,e){e===1?t.result+=" ":e>1&&(t.result+=La.repeat(`
252
252
  `,e-1))}function n9(t,e,r){let n,i,s,o,l,f,c=t.kind,p=t.result,h=t.input.charCodeAt(t.position);if(Kr(h)||Lu(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96)return!1;if(h===63||h===45){let g=t.input.charCodeAt(t.position+1);if(Kr(g)||r&&Lu(g))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;h!==0;){if(h===58){let g=t.input.charCodeAt(t.position+1);if(Kr(g)||r&&Lu(g))break}else if(h===35){let g=t.input.charCodeAt(t.position-1);if(Kr(g))break}else{if(t.position===t.lineStart&&Kg(t)||r&&Lu(h))break;if(Ni(h))if(o=t.line,l=t.lineStart,f=t.lineIndent,Vt(t,!1,-1),t.lineIndent>=e){s=!0,h=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=o,t.lineStart=l,t.lineIndent=f;break}}s&&(So(t,n,i,!1),nC(t,t.line-o),n=i=t.position,s=!1),ms(h)||(i=t.position+1),h=t.input.charCodeAt(++t.position)}return So(t,n,i,!1),t.result?!0:(t.kind=c,t.result=p,!1)}function i9(t,e){let r,n,i=t.input.charCodeAt(t.position);if(i!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(i=t.input.charCodeAt(t.position))!==0;)if(i===39)if(So(t,r,t.position,!0),i=t.input.charCodeAt(++t.position),i===39)r=t.position,t.position++,n=t.position;else return!0;else Ni(i)?(So(t,r,n,!0),nC(t,Vt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Kg(t)?me(t,"unexpected end of the document within a single quoted scalar"):(t.position++,ms(i)||(n=t.position));me(t,"unexpected end of the stream within a single quoted scalar")}function s9(t,e){let r,n,i,s=t.input.charCodeAt(t.position);if(s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return So(t,r,t.position,!0),t.position++,!0;if(s===92){if(So(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),Ni(s))Vt(t,!1,e);else if(s<256&&w1[s])t.result+=_1[s],t.position++;else if((i=K6(s))>0){let o=i,l=0;for(;o>0;o--)s=t.input.charCodeAt(++t.position),(i=Y6(s))>=0?l=(l<<4)+i:me(t,"expected hexadecimal character");t.result+=Z6(l),t.position++}else me(t,"unknown escape sequence");r=n=t.position}else Ni(s)?(So(t,r,n,!0),nC(t,Vt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Kg(t)?me(t,"unexpected end of the document within a double quoted scalar"):(t.position++,ms(s)||(n=t.position))}me(t,"unexpected end of the stream within a double quoted scalar")}function o9(t,e){let r=!0,n,i,s,o=t.tag,l,f=t.anchor,c,p,h,g,v=Object.create(null),_,w,E,k=t.input.charCodeAt(t.position);if(k===91)c=93,g=!1,l=[];else if(k===123)c=125,g=!0,l={};else return!1;for(t.anchor!==null&&ja(t,t.anchor,l),k=t.input.charCodeAt(++t.position);k!==0;){if(Vt(t,!0,e),k=t.input.charCodeAt(t.position),k===c)return t.position++,t.tag=o,t.anchor=f,t.kind=g?"mapping":"sequence",t.result=l,!0;if(r?k===44&&me(t,"expected the node content, but found ','"):me(t,"missed comma between flow collection entries"),w=_=E=null,p=h=!1,k===63){let T=t.input.charCodeAt(t.position+1);Kr(T)&&(p=h=!0,t.position++,Vt(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,Uu(t,e,Jg,!1,!0),w=t.tag,_=t.result,Vt(t,!0,e),k=t.input.charCodeAt(t.position),(h||t.line===n)&&k===58&&(p=!0,k=t.input.charCodeAt(++t.position),Vt(t,!0,e),Uu(t,e,Jg,!1,!0),E=t.result),g?ju(t,l,v,w,_,E,n,i,s):p?l.push(ju(t,null,v,w,_,E,n,i,s)):l.push(_),Vt(t,!0,e),k=t.input.charCodeAt(t.position),k===44?(r=!0,k=t.input.charCodeAt(++t.position)):r=!1}me(t,"unexpected end of the stream within a flow collection")}function a9(t,e){let r,n=tC,i=!1,s=!1,o=e,l=0,f=!1,c,p=t.input.charCodeAt(t.position);if(p===124)r=!1;else if(p===62)r=!0;else return!1;for(t.kind="scalar",t.result="";p!==0;)if(p=t.input.charCodeAt(++t.position),p===43||p===45)tC===n?n=p===43?l1:W6:me(t,"repeat of a chomping mode identifier");else if((c=Q6(p))>=0)c===0?me(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?me(t,"repeat of an indentation width identifier"):(o=e+c-1,s=!0);else break;if(ms(p)){do p=t.input.charCodeAt(++t.position);while(ms(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!Ni(p)&&p!==0)}for(;p!==0;){for(rC(t),t.lineIndent=0,p=t.input.charCodeAt(t.position);(!s||t.lineIndent<o)&&p===32;)t.lineIndent++,p=t.input.charCodeAt(++t.position);if(!s&&t.lineIndent>o&&(o=t.lineIndent),Ni(p)){l++;continue}if(!s&&o===0&&me(t,"missing indentation for block scalar"),t.lineIndent<o){n===l1?t.result+=La.repeat(`
253
253
  `,i?1+l:l):n===tC&&i&&(t.result+=`
@@ -256,10 +256,10 @@ Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new Fa.Unma
256
256
  `,l+1)):l===0?i&&(t.result+=" "):t.result+=La.repeat(`
257
257
  `,l):t.result+=La.repeat(`
258
258
  `,i?1+l:l),i=!0,s=!0,l=0;let h=t.position;for(;!Ni(p)&&p!==0;)p=t.input.charCodeAt(++t.position);So(t,h,t.position,!1)}return!0}function h1(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&ja(t,t.anchor,i);let o=t.input.charCodeAt(t.position);for(;o!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,me(t,"tab characters must not be used in indentation")),o===45);){let l=t.input.charCodeAt(t.position+1);if(!Kr(l))break;if(s=!0,t.position++,Vt(t,!0,-1)&&t.lineIndent<=e){i.push(null),o=t.input.charCodeAt(t.position);continue}let f=t.line;if(Uu(t,e,y1,!1,!0),i.push(t.result),Vt(t,!0,-1),o=t.input.charCodeAt(t.position),(t.line===f||t.lineIndent>e)&&o!==0)me(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return s?(t.tag=r,t.anchor=n,t.kind="sequence",t.result=i,!0):!1}function x1(t,e,r){let n,i,s,o,l=t.tag,f=t.anchor,c={},p=Object.create(null),h=null,g=null,v=null,_=!1,w=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&ja(t,t.anchor,c);let E=t.input.charCodeAt(t.position);for(;E!==0;){!_&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,me(t,"tab characters must not be used in indentation"));let k=t.input.charCodeAt(t.position+1),T=t.line;if((E===63||E===58)&&Kr(k))E===63?(_&&(ju(t,c,p,h,g,null,i,s,o),h=g=v=null),w=!0,_=!0,n=!0):_?(_=!1,n=!0):me(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,E=k;else{if(i=t.line,s=t.lineStart,o=t.position,!Uu(t,r,g1,!1,!0))break;if(t.line===T){for(E=t.input.charCodeAt(t.position);ms(E);)E=t.input.charCodeAt(++t.position);if(E===58)E=t.input.charCodeAt(++t.position),Kr(E)||me(t,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(ju(t,c,p,h,g,null,i,s,o),h=g=v=null),w=!0,_=!1,n=!1,h=t.tag,g=t.result;else if(w)me(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=f,!0}else if(w)me(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=l,t.anchor=f,!0}if((t.line===T||t.lineIndent>e)&&(_&&(i=t.line,s=t.lineStart,o=t.position),Uu(t,e,Gg,!0,n)&&(_?g=t.result:v=t.result),_||(ju(t,c,p,h,g,v,i,s,o),h=g=v=null),Vt(t,!0,-1),E=t.input.charCodeAt(t.position)),(t.line===T||t.lineIndent>e)&&E!==0)me(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return _&&ju(t,c,p,h,g,null,i,s,o),w&&(t.tag=l,t.anchor=f,t.kind="mapping",t.result=c),w}function l9(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&me(t,"duplication of a tag property"),s=t.input.charCodeAt(++t.position),s===60?(e=!0,s=t.input.charCodeAt(++t.position)):s===33?(r=!0,n="!!",s=t.input.charCodeAt(++t.position)):n="!";let o=t.position;if(e){do s=t.input.charCodeAt(++t.position);while(s!==0&&s!==62);t.position<t.length?(i=t.input.slice(o,t.position),s=t.input.charCodeAt(++t.position)):me(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Kr(s);)s===33&&(r?me(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(o-1,t.position+1),v1.test(n)||me(t,"named tag handle cannot contain such characters"),r=!0,o=t.position+1)),s=t.input.charCodeAt(++t.position);i=t.input.slice(o,t.position),G6.test(i)&&me(t,"tag suffix cannot contain flow indicator characters")}i&&!b1.test(i)&&me(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{me(t,"tag name is malformed: "+i)}return e?t.tag=i:ui.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:me(t,'undeclared tag handle "'+n+'"'),!0}function u9(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&me(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!Kr(e)&&!Lu(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&me(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function c9(t){let e=t.input.charCodeAt(t.position);if(e!==42)return!1;e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!Kr(e)&&!Lu(e);)e=t.input.charCodeAt(++t.position);t.position===r&&me(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return ui.call(t.anchorMap,n)||me(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Vt(t,!0,-1),!0}function f9(t,e,r,n){let i=C1(t);return e9(t),f1(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,x1(t,r,n)&&t.kind==="mapping"?(t9(t),!0):(r9(t),f1(t,i),!1)}function Uu(t,e,r,n,i){let s,o,l=1,f=!1,c=!1,p=null,h,g,v;t.depth>=t.maxDepth&&me(t,"nesting exceeded maxDepth ("+t.maxDepth+")"),t.depth+=1,t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null;let _=s=o=Gg===r||y1===r;if(n&&Vt(t,!0,-1)&&(f=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;;){let w=t.input.charCodeAt(t.position),E=C1(t);if(f&&(w===33&&t.tag!==null||w===38&&t.anchor!==null)||!l9(t)&&!u9(t))break;p===null&&(p=E),Vt(t,!0,-1)?(f=!0,o=_,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):o=!1}if(o&&(o=f||i),l===1||Gg===r)if(Jg===r||g1===r?g=e:g=e+1,v=t.position-t.lineStart,l===1)if(o&&(h1(t,v)||x1(t,v,g))||o9(t,g))c=!0;else{let w=t.input.charCodeAt(t.position);p!==null&&_&&!o&&w!==124&&w!==62&&f9(t,p,p.position-p.lineStart,g)||s&&a9(t,g)||i9(t,g)||s9(t,g)?c=!0:c9(t)?(c=!0,(t.tag!==null||t.anchor!==null)&&me(t,"alias node should not have any properties")):n9(t,g,Jg===r)&&(c=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&ja(t,t.anchor,t.result)}else l===0&&(c=o&&h1(t,v));if(t.tag===null)t.anchor!==null&&ja(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&me(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let w=0,E=t.implicitTypes.length;w<E;w+=1)if(h=t.implicitTypes[w],h.resolve(t.result)){t.result=h.construct(t.result),t.tag=h.tag,t.anchor!==null&&ja(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(ui.call(t.typeMap[t.kind||"fallback"],t.tag))h=t.typeMap[t.kind||"fallback"][t.tag];else{h=null;let w=t.typeMap.multi[t.kind||"fallback"];for(let E=0,k=w.length;E<k;E+=1)if(t.tag.slice(0,w[E].tag.length)===w[E].tag){h=w[E];break}}h||me(t,"unknown tag !<"+t.tag+">"),t.result!==null&&h.kind!==t.kind&&me(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+h.kind+'", not "'+t.kind+'"'),h.resolve(t.result,t.tag)?(t.result=h.construct(t.result,t.tag),t.anchor!==null&&ja(t,t.anchor,t.result)):me(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.depth-=1,t.tag!==null||t.anchor!==null||c}function d9(t){let e=t.position,r=!1,n;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(n=t.input.charCodeAt(t.position))!==0&&(Vt(t,!0,-1),n=t.input.charCodeAt(t.position),!(t.lineIndent>0||n!==37));){r=!0,n=t.input.charCodeAt(++t.position);let i=t.position;for(;n!==0&&!Kr(n);)n=t.input.charCodeAt(++t.position);let s=t.input.slice(i,t.position),o=[];for(s.length<1&&me(t,"directive name must not be less than one character in length");n!==0;){for(;ms(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!Ni(n));break}if(Ni(n))break;for(i=t.position;n!==0&&!Kr(n);)n=t.input.charCodeAt(++t.position);o.push(t.input.slice(i,t.position))}n!==0&&rC(t),ui.call(d1,s)?d1[s](t,s,o):Yg(t,'unknown document directive "'+s+'"')}if(Vt(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Vt(t,!0,-1)):r&&me(t,"directives end mark is expected"),Uu(t,t.lineIndent-1,Gg,!1,!0),Vt(t,!0,-1),t.checkLineBreaks&&J6.test(t.input.slice(e,t.position))&&Yg(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Kg(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Vt(t,!0,-1));return}t.position<t.length-1&&me(t,"end of the stream or a document separator is expected")}function E1(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
259
- `),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new X6(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,me(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)d9(r);return r.documents}function p9(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);let n=E1(t,r);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function h9(t,e){let r=E1(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new m1("expected a single document in the stream, but found more")}}iC.exports.loadAll=p9;iC.exports.load=h9});var G1=H((Ere,J1)=>{"use strict";var Xg=Fu(),jd=Du(),m9=zg(),M1=Object.prototype.toString,F1=Object.prototype.hasOwnProperty,uC=65279,g9=9,Fd=10,y9=13,v9=32,b9=33,S9=34,sC=35,w9=37,_9=38,R9=39,C9=42,D1=44,x9=45,Qg=58,E9=61,I9=62,q9=63,O9=64,L1=91,j1=93,k9=96,U1=123,P9=124,H1=125,vr={};vr[0]="\\0";vr[7]="\\a";vr[8]="\\b";vr[9]="\\t";vr[10]="\\n";vr[11]="\\v";vr[12]="\\f";vr[13]="\\r";vr[27]="\\e";vr[34]='\\"';vr[92]="\\\\";vr[133]="\\N";vr[160]="\\_";vr[8232]="\\L";vr[8233]="\\P";var T9=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],A9=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function $9(t,e){if(e===null)return{};let r={},n=Object.keys(e);for(let i=0,s=n.length;i<s;i+=1){let o=n[i],l=String(e[o]);o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2));let f=t.compiledTypeMap.fallback[o];f&&F1.call(f.styleAliases,l)&&(l=f.styleAliases[l]),r[o]=l}return r}function N9(t){let e,r,n=t.toString(16).toUpperCase();if(t<=255)e="x",r=2;else if(t<=65535)e="u",r=4;else if(t<=4294967295)e="U",r=8;else throw new jd("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+Xg.repeat("0",r-n.length)+n}var M9=1,Dd=2;function F9(t){this.schema=t.schema||m9,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Xg.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=$9(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Dd:M9,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function q1(t,e){let r=Xg.repeat(" ",e),n=0,i="",s=t.length;for(;n<s;){let o,l=t.indexOf(`
259
+ `),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new X6(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,me(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)d9(r);return r.documents}function p9(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);let n=E1(t,r);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function h9(t,e){let r=E1(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new m1("expected a single document in the stream, but found more")}}iC.exports.loadAll=p9;iC.exports.load=h9});var G1=H((Ere,J1)=>{"use strict";var Xg=Fu(),jd=Du(),m9=zg(),M1=Object.prototype.toString,F1=Object.prototype.hasOwnProperty,uC=65279,g9=9,Fd=10,y9=13,v9=32,b9=33,S9=34,sC=35,w9=37,_9=38,R9=39,C9=42,D1=44,x9=45,Qg=58,E9=61,I9=62,O9=63,q9=64,L1=91,j1=93,k9=96,U1=123,P9=124,H1=125,vr={};vr[0]="\\0";vr[7]="\\a";vr[8]="\\b";vr[9]="\\t";vr[10]="\\n";vr[11]="\\v";vr[12]="\\f";vr[13]="\\r";vr[27]="\\e";vr[34]='\\"';vr[92]="\\\\";vr[133]="\\N";vr[160]="\\_";vr[8232]="\\L";vr[8233]="\\P";var T9=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],A9=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function $9(t,e){if(e===null)return{};let r={},n=Object.keys(e);for(let i=0,s=n.length;i<s;i+=1){let o=n[i],l=String(e[o]);o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2));let f=t.compiledTypeMap.fallback[o];f&&F1.call(f.styleAliases,l)&&(l=f.styleAliases[l]),r[o]=l}return r}function N9(t){let e,r,n=t.toString(16).toUpperCase();if(t<=255)e="x",r=2;else if(t<=65535)e="u",r=4;else if(t<=4294967295)e="U",r=8;else throw new jd("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+Xg.repeat("0",r-n.length)+n}var M9=1,Dd=2;function F9(t){this.schema=t.schema||m9,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Xg.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=$9(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Dd:M9,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function O1(t,e){let r=Xg.repeat(" ",e),n=0,i="",s=t.length;for(;n<s;){let o,l=t.indexOf(`
260
260
  `,n);l===-1?(o=t.slice(n),n=s):(o=t.slice(n,l+1),n=l+1),o.length&&o!==`
261
261
  `&&(i+=r),i+=o}return i}function oC(t,e){return`
262
- `+Xg.repeat(" ",t.indent*e)}function D9(t,e){for(let r=0,n=t.implicitTypes.length;r<n;r+=1)if(t.implicitTypes[r].resolve(e))return!0;return!1}function Zg(t){return t===v9||t===g9}function Ld(t){return t>=32&&t<=126||t>=161&&t<=55295&&t!==8232&&t!==8233||t>=57344&&t<=65533&&t!==uC||t>=65536&&t<=1114111}function O1(t){return Ld(t)&&t!==uC&&t!==y9&&t!==Fd}function k1(t,e,r){let n=O1(t),i=n&&!Zg(t);return(r?n:n&&t!==D1&&t!==L1&&t!==j1&&t!==U1&&t!==H1)&&t!==sC&&!(e===Qg&&!i)||O1(e)&&!Zg(e)&&t===sC||e===Qg&&i}function L9(t){return Ld(t)&&t!==uC&&!Zg(t)&&t!==x9&&t!==q9&&t!==Qg&&t!==D1&&t!==L1&&t!==j1&&t!==U1&&t!==H1&&t!==sC&&t!==_9&&t!==C9&&t!==b9&&t!==P9&&t!==E9&&t!==I9&&t!==R9&&t!==S9&&t!==w9&&t!==O9&&t!==k9}function j9(t){return!Zg(t)&&t!==Qg}function Md(t,e){let r=t.charCodeAt(e),n;return r>=55296&&r<=56319&&e+1<t.length&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function B1(t){return/^\n* /.test(t)}var V1=1,aC=2,W1=3,z1=4,Hu=5;function U9(t,e,r,n,i,s,o,l){let f,c=0,p=null,h=!1,g=!1,v=n!==-1,_=-1,w=L9(Md(t,0))&&j9(Md(t,t.length-1));if(e||o)for(f=0;f<t.length;c>=65536?f+=2:f++){if(c=Md(t,f),!Ld(c))return Hu;w=w&&k1(c,p,l),p=c}else{for(f=0;f<t.length;c>=65536?f+=2:f++){if(c=Md(t,f),c===Fd)h=!0,v&&(g=g||f-_-1>n&&t[_+1]!==" ",_=f);else if(!Ld(c))return Hu;w=w&&k1(c,p,l),p=c}g=g||v&&f-_-1>n&&t[_+1]!==" "}return!h&&!g?w&&!o&&!i(t)?V1:s===Dd?Hu:aC:r>9&&B1(t)?Hu:o?s===Dd?Hu:aC:g?z1:W1}function H9(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===Dd?'""':"''";if(!t.noCompatMode&&(T9.indexOf(e)!==-1||A9.test(e)))return t.quotingType===Dd?'"'+e+'"':"'"+e+"'";let s=t.indent*Math.max(1,r),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),l=n||t.flowLevel>-1&&r>=t.flowLevel;function f(c){return D9(t,c)}switch(U9(e,l,t.indent,o,f,t.quotingType,t.forceQuotes&&!n,i)){case V1:return e;case aC:return"'"+e.replace(/'/g,"''")+"'";case W1:return"|"+P1(e,t.indent)+T1(q1(e,s));case z1:return">"+P1(e,t.indent)+T1(q1(B9(e,o),s));case Hu:return'"'+V9(e,o)+'"';default:throw new jd("impossible error: invalid scalar style")}})()}function P1(t,e){let r=B1(t)?String(e):"",n=t[t.length-1]===`
262
+ `+Xg.repeat(" ",t.indent*e)}function D9(t,e){for(let r=0,n=t.implicitTypes.length;r<n;r+=1)if(t.implicitTypes[r].resolve(e))return!0;return!1}function Zg(t){return t===v9||t===g9}function Ld(t){return t>=32&&t<=126||t>=161&&t<=55295&&t!==8232&&t!==8233||t>=57344&&t<=65533&&t!==uC||t>=65536&&t<=1114111}function q1(t){return Ld(t)&&t!==uC&&t!==y9&&t!==Fd}function k1(t,e,r){let n=q1(t),i=n&&!Zg(t);return(r?n:n&&t!==D1&&t!==L1&&t!==j1&&t!==U1&&t!==H1)&&t!==sC&&!(e===Qg&&!i)||q1(e)&&!Zg(e)&&t===sC||e===Qg&&i}function L9(t){return Ld(t)&&t!==uC&&!Zg(t)&&t!==x9&&t!==O9&&t!==Qg&&t!==D1&&t!==L1&&t!==j1&&t!==U1&&t!==H1&&t!==sC&&t!==_9&&t!==C9&&t!==b9&&t!==P9&&t!==E9&&t!==I9&&t!==R9&&t!==S9&&t!==w9&&t!==q9&&t!==k9}function j9(t){return!Zg(t)&&t!==Qg}function Md(t,e){let r=t.charCodeAt(e),n;return r>=55296&&r<=56319&&e+1<t.length&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function B1(t){return/^\n* /.test(t)}var V1=1,aC=2,W1=3,z1=4,Hu=5;function U9(t,e,r,n,i,s,o,l){let f,c=0,p=null,h=!1,g=!1,v=n!==-1,_=-1,w=L9(Md(t,0))&&j9(Md(t,t.length-1));if(e||o)for(f=0;f<t.length;c>=65536?f+=2:f++){if(c=Md(t,f),!Ld(c))return Hu;w=w&&k1(c,p,l),p=c}else{for(f=0;f<t.length;c>=65536?f+=2:f++){if(c=Md(t,f),c===Fd)h=!0,v&&(g=g||f-_-1>n&&t[_+1]!==" ",_=f);else if(!Ld(c))return Hu;w=w&&k1(c,p,l),p=c}g=g||v&&f-_-1>n&&t[_+1]!==" "}return!h&&!g?w&&!o&&!i(t)?V1:s===Dd?Hu:aC:r>9&&B1(t)?Hu:o?s===Dd?Hu:aC:g?z1:W1}function H9(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===Dd?'""':"''";if(!t.noCompatMode&&(T9.indexOf(e)!==-1||A9.test(e)))return t.quotingType===Dd?'"'+e+'"':"'"+e+"'";let s=t.indent*Math.max(1,r),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),l=n||t.flowLevel>-1&&r>=t.flowLevel;function f(c){return D9(t,c)}switch(U9(e,l,t.indent,o,f,t.quotingType,t.forceQuotes&&!n,i)){case V1:return e;case aC:return"'"+e.replace(/'/g,"''")+"'";case W1:return"|"+P1(e,t.indent)+T1(O1(e,s));case z1:return">"+P1(e,t.indent)+T1(O1(B9(e,o),s));case Hu:return'"'+V9(e,o)+'"';default:throw new jd("impossible error: invalid scalar style")}})()}function P1(t,e){let r=B1(t)?String(e):"",n=t[t.length-1]===`
263
263
  `,s=n&&(t[t.length-2]===`
264
264
  `||t===`
265
265
  `)?"+":n?"":"-";return r+s+`
@@ -274,7 +274,7 @@ Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new Fa.Unma
274
274
  `:""}J1.exports.dump=Y9});var fC=H((Ire,Tr)=>{"use strict";var Y1=I1(),K9=G1();function cC(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}Tr.exports.Type=yr();Tr.exports.Schema=FR();Tr.exports.FAILSAFE_SCHEMA=UR();Tr.exports.JSON_SCHEMA=zR();Tr.exports.CORE_SCHEMA=JR();Tr.exports.DEFAULT_SCHEMA=zg();Tr.exports.load=Y1.load;Tr.exports.loadAll=Y1.loadAll;Tr.exports.dump=K9.dump;Tr.exports.YAMLException=Du();Tr.exports.types={binary:QR(),float:WR(),map:jR(),null:HR(),pairs:XR(),set:eC(),timestamp:GR(),bool:BR(),int:VR(),merge:YR(),omap:ZR(),seq:LR(),str:DR()};Tr.exports.safeLoad=cC("safeLoad","load");Tr.exports.safeLoadAll=cC("safeLoadAll","loadAll");Tr.exports.safeDump=cC("safeDump","dump")});var K1=H(Ud=>{"use strict";var Q9=Ud&&Ud.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ud,"__esModule",{value:!0});var Z9=An(),X9=Q9(fC()),e8=fC();Ud.default={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string")try{return X9.default.load(e,{schema:e8.JSON_SCHEMA})}catch(r){throw new Z9.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var Q1=H(dC=>{"use strict";Object.defineProperty(dC,"__esModule",{value:!0});var t8=An(),r8=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;dC.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&r8.test(t.url)},parse(t){if(typeof t.data=="string")return t.data;if(Buffer.isBuffer(t.data))return t.data.toString(this.encoding);throw new t8.ParserError("data is not text",t.url)}}});var Z1=H(pC=>{"use strict";Object.defineProperty(pC,"__esModule",{value:!0});var n8=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;pC.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&n8.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var r$=H(ci=>{"use strict";var i8=ci&&ci.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),s8=ci&&ci.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o8=ci&&ci.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&i8(r,e,n[i]);return s8(r,e),r}})(),a8=ci&&ci.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ci,"__esModule",{value:!0});var l8=a8(ft("fs")),X1=yo(),e$=o8(Tn()),t$=An();ci.default={order:100,canRead(t){return e$.isFileSystemPath(t.url)},async read(t){let e;try{e=e$.toFileSystemPath(t.url)}catch(r){throw new t$.ResolverError(X1.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await l8.default.promises.readFile(e)}catch(r){throw new t$.ResolverError((0,X1.ono)(r,`Error opening file "${e}"`),e)}}}});var s$=H(ys=>{"use strict";var u8=ys&&ys.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),c8=ys&&ys.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),f8=ys&&ys.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&u8(r,e,n[i]);return c8(r,e),r}})();Object.defineProperty(ys,"__esModule",{value:!0});var ey=yo(),Hd=f8(Tn()),n$=An();ys.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return Hd.isHttp(t.url)},read(t){let e=Hd.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=Hd.parse(location.href).protocol),i$(e,this)}};async function i$(t,e,r){t=Hd.parse(t);let n=r||[];n.push(t.href);try{let i=await d8(t,e);if(i.status>=400)throw(0,ey.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new n$.ResolverError((0,ey.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,ey.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Hd.resolve(t.href,i.headers.location);return i$(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new n$.ResolverError((0,ey.ono)(i,`Error downloading ${t.href}`),t.href)}}async function d8(t,e){let r,n;e.timeout&&(r=new AbortController,n=setTimeout(()=>r.abort(),e.timeout));let i=await fetch(t,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:r?r.signal:null});return n&&clearTimeout(n),i}});var hC=H(vs=>{"use strict";var Bu=vs&&vs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vs,"__esModule",{value:!0});vs.getNewOptions=vs.getJsonSchemaRefParserDefaultOptions=void 0;var p8=Bu(TA()),h8=Bu(K1()),m8=Bu(Q1()),g8=Bu(Z1()),y8=Bu(r$()),v8=Bu(s$()),b8=()=>({parse:{json:{...p8.default},yaml:{...h8.default},text:{...m8.default},binary:{...g8.default}},resolve:{file:{...y8.default},http:{...v8.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});vs.getJsonSchemaRefParserDefaultOptions=b8;var S8=t=>{let e=(0,vs.getJsonSchemaRefParserDefaultOptions)();return t&&a$(e,t),e};vs.getNewOptions=S8;function a$(t,e){if(o$(e)){let r=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=e[i],o=t[i];o$(s)?t[i]=a$(o||{},s):s!==void 0&&(t[i]=s)}}return t}function o$(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var u$=H(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.normalizeArgs=l$;var w8=hC();function l$(t){let e,r,n,i,s=Array.prototype.slice.call(t);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(r=s[1],n=s[2]):(r=void 0,n=s[1])):(e="",r=s[0],n=s[1]);try{n=(0,w8.getNewOptions)(n)}catch(o){console.error(`JSON Schema Ref Parser: Error normalizing options: ${o}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}ty.default=l$});var c$=H(fi=>{"use strict";var _8=fi&&fi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),R8=fi&&fi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C8=fi&&fi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&_8(r,e,n[i]);return R8(r,e),r}})(),mC=fi&&fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fi,"__esModule",{value:!0});var x8=mC(Nu()),E8=mC(Pd()),I8=mC(PR()),Vu=C8(Tn()),q8=An();function O8(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=gC(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function gC(t,e,r,n,i,s){i||(i=new Set);let o=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),x8.default.isExternal$Ref(t)&&o.push(k8(t,e,r,n));let l=Object.keys(t);for(let f of l){let c=E8.default.join(e,f),p=t[f];o=o.concat(gC(p,c,r,n,i,s))}}return o}async function k8(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Vu.resolve(i?Vu.cwd():e,t.$ref),o=Vu.stripHash(s),l=r._$refs[o];if(l)return Promise.resolve(l.value);try{let f=await(0,I8.default)(s,r,n),c=gC(f,o+"#",r,n,new Set,!0);return Promise.all(c)}catch(f){if(!n?.continueOnError||!(0,q8.isHandledError)(f))throw f;return r._$refs[o]&&(f.source=decodeURI(Vu.stripHash(e)),f.path=Vu.safePointerToPath(Vu.getHash(e))),[]}}fi.default=O8});var p$=H(di=>{"use strict";var P8=di&&di.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),T8=di&&di.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),A8=di&&di.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&P8(r,e,n[i]);return T8(r,e),r}})(),d$=di&&di.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(di,"__esModule",{value:!0});var ry=d$(Nu()),Bd=d$(Pd()),yC=A8(Tn());function $8(t,e){let r=[];vC(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),N8(r)}function vC(t,e,r,n,i,s,o,l){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(ry.default.isAllowed$Ref(f))f$(t,e,r,n,i,s,o,l);else{let c=Object.keys(f).sort((p,h)=>p==="definitions"?-1:h==="definitions"?1:p.length-h.length);for(let p of c){let h=Bd.default.join(r,p),g=Bd.default.join(n,p),v=f[p];ry.default.isAllowed$Ref(v)?f$(f,p,r,g,i,s,o,l):vC(f,p,h,g,i,s,o,l)}}}function f$(t,e,r,n,i,s,o,l){let f=e===null?t:t[e],c=yC.resolve(r,f.$ref),p=o._resolve(c,n,l);if(p===null)return;let g=Bd.default.parse(n).length,v=yC.stripHash(p.path),_=yC.getHash(p.path),w=v!==o._root$Ref.path,E=ry.default.isExtended$Ref(f);i+=p.indirections;let k=M8(s,t,e);if(k)if(g<k.depth||i<k.indirections)F8(s,k);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:g,file:v,hash:_,value:p.value,circular:p.circular,extended:E,external:w,indirections:i}),(!k||w)&&vC(p.value,null,p.path,n,i+1,s,o,l)}function N8(t){t.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 o=i.pathFromRoot.lastIndexOf("/definitions"),l=s.pathFromRoot.lastIndexOf("/definitions");return o!==l?l-o:i.pathFromRoot.length-s.pathFromRoot.length}});let e,r,n;for(let i of t)i.external?i.file===e&&i.hash===r?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(r+"/")===0?i.$ref.$ref=Bd.default.join(n,Bd.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=ry.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function M8(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function F8(t,e){let r=t.indexOf(e);t.splice(r,1)}di.default=$8});var b$=H(pi=>{"use strict";var D8=pi&&pi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L8=pi&&pi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),j8=pi&&pi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&D8(r,e,n[i]);return L8(r,e),r}})(),y$=pi&&pi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pi,"__esModule",{value:!0});var ny=y$(Nu()),h$=y$(Pd()),U8=yo(),m$=j8(Tn()),H8=An();pi.default=B8;function B8(t,e){let r=Date.now(),n=bC(t.schema,t.$refs._root$Ref.path,"#",new Set,new Set,new Map,t.$refs,e,r);t.$refs.circular=n.circular,t.schema=n.value}function bC(t,e,r,n,i,s,o,l,f){let c,p={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-f>l.timeoutMs)throw new H8.TimeoutError(l.timeoutMs);let h=l.dereference||{},g=h.excludedPathMatcher||(()=>!1);if((h?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!g(r)){if(n.add(t),i.add(t),ny.default.isAllowed$Ref(t,l))c=g$(t,e,r,n,i,s,o,l,f),p.circular=c.circular,p.value=c.value;else for(let v of Object.keys(t)){let _=h$.default.join(e,v),w=h$.default.join(r,v);if(g(w))continue;let E=t[v],k=!1;if(ny.default.isAllowed$Ref(E,l)){if(c=g$(E,_,w,n,i,s,o,l,f),k=c.circular,t[v]!==c.value){let T=new Map;h?.preservedProperties&&typeof t[v]=="object"&&!Array.isArray(t[v])&&h?.preservedProperties.forEach(N=>{N in t[v]&&T.set(N,t[v][N])}),t[v]=c.value,h?.preservedProperties&&T.size&&typeof t[v]=="object"&&!Array.isArray(t[v])&&T.forEach((N,$)=>{t[v][$]=N}),h?.onDereference?.(E.$ref,t[v],t,v)}}else n.has(E)?k=v$(_,o,l):(c=bC(E,_,w,n,i,s,o,l,f),k=c.circular,t[v]!==c.value&&(t[v]=c.value));p.circular=p.circular||k}n.delete(t)}return p}function g$(t,e,r,n,i,s,o,l,f){let p=ny.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",h=m$.resolve(p?m$.cwd():e,t.$ref),g=s.get(h);if(g&&!g.circular){let T=Object.keys(t);if(T.length>1){let N={};for(let $ of T)$!=="$ref"&&!($ in g.value)&&(N[$]=t[$]);return{circular:g.circular,value:Object.assign({},g.value,N)}}return g}let v=o._resolve(h,e,l);if(v===null)return{circular:!1,value:null};let _=v.circular,w=_||n.has(v.value);w&&v$(e,o,l);let E=ny.default.dereference(t,v.value);if(!w){let T=bC(E,v.path,r,n,i,s,o,l,f);w=T.circular,E=T.value}w&&!_&&l.dereference?.circular==="ignore"&&(E=t),_&&(E.$ref=r);let k={circular:w,value:E};return Object.keys(t).length===1&&s.set(h,k),k}function v$(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw U8.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var S$=H(SC=>{"use strict";Object.defineProperty(SC,"__esModule",{value:!0});function V8(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}SC.default=V8()});var _$=H(Vd=>{"use strict";var W8=Vd&&Vd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Vd,"__esModule",{value:!0});Vd.default=z8;var w$=W8(S$());function z8(t,e){if(t){e.then(function(r){(0,w$.default)(function(){t(null,r)})},function(r){(0,w$.default)(function(){t(r)})});return}else return e}});var E$=H(xe=>{"use strict";var J8=xe&&xe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),G8=xe&&xe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Y8=xe&&xe.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&J8(r,e,n[i]);return G8(r,e),r}})(),Ha=xe&&xe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xe,"__esModule",{value:!0});xe.getJsonSchemaRefParserDefaultOptions=xe.jsonSchemaParserNormalizeArgs=xe.dereferenceInternal=xe.JSONParserErrorGroup=xe.isHandledError=xe.UnmatchedParserError=xe.ParserError=xe.ResolverError=xe.MissingPointerError=xe.InvalidPointerError=xe.JSONParserError=xe.UnmatchedResolverError=xe.dereference=xe.bundle=xe.resolve=xe.parse=xe.$RefParser=void 0;var R$=Ha(IA()),K8=Ha(PR()),Wd=Ha(u$());xe.jsonSchemaParserNormalizeArgs=Wd.default;var Q8=Ha(c$()),Z8=Ha(p$()),x$=Ha(b$());xe.dereferenceInternal=x$.default;var Ua=Y8(Tn()),$n=An();Object.defineProperty(xe,"JSONParserError",{enumerable:!0,get:function(){return $n.JSONParserError}});Object.defineProperty(xe,"InvalidPointerError",{enumerable:!0,get:function(){return $n.InvalidPointerError}});Object.defineProperty(xe,"MissingPointerError",{enumerable:!0,get:function(){return $n.MissingPointerError}});Object.defineProperty(xe,"ResolverError",{enumerable:!0,get:function(){return $n.ResolverError}});Object.defineProperty(xe,"ParserError",{enumerable:!0,get:function(){return $n.ParserError}});Object.defineProperty(xe,"UnmatchedParserError",{enumerable:!0,get:function(){return $n.UnmatchedParserError}});Object.defineProperty(xe,"UnmatchedResolverError",{enumerable:!0,get:function(){return $n.UnmatchedResolverError}});Object.defineProperty(xe,"isHandledError",{enumerable:!0,get:function(){return $n.isHandledError}});Object.defineProperty(xe,"JSONParserErrorGroup",{enumerable:!0,get:function(){return $n.JSONParserErrorGroup}});var C$=yo(),hi=Ha(_$()),X8=hC();Object.defineProperty(xe,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return X8.getJsonSchemaRefParserDefaultOptions}});var wo=class t{constructor(){this.schema=null,this.$refs=new R$.default}async parse(){let e=(0,Wd.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,C$.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,hi.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new R$.default;let n="http";if(Ua.isFileSystemPath(e.path))e.path=Ua.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=Ua.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=Ua.resolve(Ua.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,r=Promise.resolve(e.schema)}else r=(0,K8.default)(e.path,this.$refs,e.options);try{let i=await r;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,hi.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,hi.default)(e.callback,Promise.resolve(this.schema));throw C$.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,$n.isHandledError)(i)?(0,hi.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[Ua.stripHash(e.path)]&&this.$refs._$refs[Ua.stripHash(e.path)].addError(i),(0,hi.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,Wd.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,Q8.default)(this,e.options),wC(this),(0,hi.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,hi.default)(e.callback,Promise.reject(r))}}static resolve(){let e=new t;return e.resolve.apply(e,arguments)}static bundle(){let e=new t;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,Wd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,Z8.default)(this,e.options),wC(this),(0,hi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,hi.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,Wd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,x$.default)(this,e.options),wC(this),(0,hi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,hi.default)(e.callback,Promise.reject(r))}}};xe.$RefParser=wo;xe.default=wo;function wC(t){if($n.JSONParserErrorGroup.getParserErrors(t).length>0)throw new $n.JSONParserErrorGroup(t)}xe.parse=wo.parse;xe.resolve=wo.resolve;xe.bundle=wo.bundle;xe.dereference=wo.dereference});var iy,Wu,_C=se(()=>{"use strict";iy=Uc(E$()),Wu=class{async resolve(e){try{return await iy.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",r),e}}async bundle(e){try{return await iy.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await iy.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});import*as I$ from"fs";var q$,e5,_o,sy=se(()=>{"use strict";q$=Uc(Od());Cn();lR();_C();e5=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],_o=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new ku,this.refResolver=new Wu}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await I$.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=q$.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},o=r?.collectionName||i.info?.title||"Imported API",f={id:St(o),name:o,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 h=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);h&&(f.auth=h)}let c=new Map;if(i.tags)for(let h of i.tags){let g={type:"folder",id:St(h.name),name:h.name,description:h.description,items:[]};c.set(h.name,g),f.items.push(g)}if(i.paths)for(let[h,g]of Object.entries(i.paths))for(let v of["get","post","put","patch","delete","head","options","trace"]){let _=g[v];if(!_)continue;let w=this.processOperation(v,h,_,g,i,s),E=_.tags?.[0];if(E&&c.has(E))c.get(E).items.push(w);else if(E){let k={type:"folder",id:St(E),name:E,items:[w]};c.set(E,k),f.items.push(k)}else f.items.push(w)}await this.collectionService.saveCollection(f);let p;return r?.environmentName&&i.servers&&(p=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:p}}processOperation(e,r,n,i,s,o){let l=St(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,c=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,p=n.deprecated===!0;p&&(c=`[DEPRECATED] ${c}`);let h={type:"request",id:l,name:c,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:p},g=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(h,g,o),n.requestBody&&this.processRequestBody(h,n.requestBody,o),n.responses&&(h.responseSchema=this.processResponses(n.responses,o)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)h.auth={type:"none"};else if(n.security&&n.security.length>0){let v=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);v&&(h.auth=v)}}return h}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],o={},l=[];for(let f of r){let c=f.name,p=f.in,h=f.schema||{},g=f.example!==void 0?String(f.example):this.generateExampleForParam(h,n),v=f.deprecated===!0;switch(p){case"path":{if(f.description||h.type||h.format||h.enum||v||h.pattern||h.minimum!==void 0||h.maximum!==void 0||h.minLength!==void 0||h.maxLength!==void 0||h.multipleOf!==void 0||h.minItems!==void 0||h.maxItems!==void 0||h.uniqueItems||h.nullable||h.oneOf){let w={value:g};h.oneOf?(w.oneOf=h.oneOf,this.applyOneOfHints(w,h.oneOf)):(h.type&&(w.type=h.type),h.format&&(w.format=h.format),h.enum&&(w.enum=h.enum.map(String)),h.pattern&&(w.pattern=h.pattern),h.minimum!==void 0&&(w.minimum=h.minimum),h.maximum!==void 0&&(w.maximum=h.maximum),h.exclusiveMinimum!==void 0&&(w.exclusiveMinimum=h.exclusiveMinimum),h.exclusiveMaximum!==void 0&&(w.exclusiveMaximum=h.exclusiveMaximum),h.multipleOf!==void 0&&(w.multipleOf=h.multipleOf),h.minLength!==void 0&&(w.minLength=h.minLength),h.maxLength!==void 0&&(w.maxLength=h.maxLength),h.minItems!==void 0&&(w.minItems=h.minItems),h.maxItems!==void 0&&(w.maxItems=h.maxItems),h.uniqueItems&&(w.uniqueItems=!0),h.nullable&&(w.nullable=!0)),f.description&&(w.description=f.description),v&&(w.deprecated=!0),o[c]=w}else o[c]=g;break}case"query":{let _={key:c,value:g};this.applySchemaConstraints(_,h,f,v),s.push(_);break}case"header":{let _={key:c,value:g};this.applySchemaConstraints(_,h,f,v),i.push(_);break}case"cookie":{l.push(`${c}={{${c}}}`);break}}}l.length>0&&i.push({key:"Cookie",value:l.join("; ")}),Object.keys(o).length>0&&(e.params=o),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)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,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),o=r.content[s],{bodyType:l,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...f&&{format:f},content:""},o){let p=this.generateBodyContent(o,s,n);p!==void 0&&(e.body.content=typeof p=="string"?p:JSON.stringify(p,null,2)),l==="form-data"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n)),l==="x-www-form-urlencoded"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n))}let c=this.buildBodySchema(r,s,n);c&&(e.bodySchema=c)}selectPrimaryContentType(e){for(let i of e5)if(e.includes(i))return i;let r=e.find(i=>i.includes("json"));if(r)return r;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,r,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,r){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[o,l]of Object.entries(i)){let f=l,c=f.type==="string"&&f.format==="binary",p={key:o,value:c?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:c?"file":"text",enabled:!0};n.push(p)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let o={contentType:r,schema:s.schema};if(i.length>1){o.content={};for(let f of i){let c=e.content[f],p={};c.schema&&(p.schema=c.schema),c.examples&&(p.examples=c.examples),c.encoding&&(p.encoding=c.encoding),o.content[f]=p}}s.encoding&&(o.encoding=s.encoding);let l=this.extractUsedComponents(s.schema,n);return Object.keys(l).length>0&&(o.components=l),o}processResponses(e,r){let n={responses:{}},i={};for(let[s,o]of Object.entries(e)){let l=o,f={description:l.description||`Status ${s}`};if(l.content){let c=Object.keys(l.content);if(c.length===1){let p=c[0],h=l.content[p];f.contentType=p,h.schema&&(f.schema=h.schema),h.examples&&(f.examples=h.examples),h.schema&&Object.assign(i,this.extractUsedComponents(h.schema,r))}else{f.content={};for(let p of c){let h=l.content[p],g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),f.content[p]=g,h.schema&&Object.assign(i,this.extractUsedComponents(h.schema,r))}}}if(l.headers){f.headers={};for(let[c,p]of Object.entries(l.headers)){let h=p;f.headers[c]={...h.description&&{description:h.description},schema:h.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,r){let n=Object.keys(e)[0];if(!n)return;let i=r[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||{},o=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:o.tokenUrl||"",authUrl:o.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(o.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,r){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return r}extractUsedComponents(e,r,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&r[s]&&!i[s]&&(i[s]=r[s],this.extractUsedComponents(r[s],r,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,r,i);e.items&&this.extractUsedComponents(e.items,r,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let o of e[s])this.extractUsedComponents(o,r,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,r,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}}});var zu,RC=se(()=>{"use strict";zu=class{constructor(e,r,n){this.historyAnalyzer=e;this.scriptAnalyzer=r;this.inferrer=n}historyAnalyzer;scriptAnalyzer;inferrer;async infer(e,r,n,i){let s=await this.historyAnalyzer.analyze(e,r,{environment:i?.environment}),o;return i?.postResponseScript&&(o=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,o)}async inferBodySchema(e,r,n,i,s){let o,l;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}o=this.inferrer.inferFromValue(f),l="application/json"}else r==="form-data"&&i?(o=this.buildFormDataSchema(i),l="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(o=this.buildFormDataSchema(i),l="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(o={type:"string"},l="application/xml"):r==="raw"&&(n==="text"||n==="html")?(o={type:"string"},l=n==="html"?"text/html":"text/plain"):r==="binary"?(o={type:"string",format:"binary"},l="application/octet-stream"):r==="graphql"&&(o={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l="application/json");if(o)return s?this.mergeBodySchemaWithExisting(o,s):{contentType:l,schema:o}}buildFormDataSchema(e){let r={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"),r.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(r.required=n),r}mergeResponseSchemas(e,r,n){let i={responses:{}};for(let[s,o]of Object.entries(r.responses))i.responses[s]={...o};if(n&&this.applyScriptHints(i,n),e){for(let[s,o]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],o):i.responses[s]={...o};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,r){for(let n of r.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,r)}augmentSchemaWithHints(e,r){if(!(e.type!=="object"||!e.properties))for(let n of r.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,r)}}ensureFieldPath(e,r,n,i=""){if(r.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=r[0],o=s.endsWith("[]"),l=o?s.slice(0,-2):s,f=i?`${i}.${s}`:s,c=r.slice(1);if(!e.properties[l])if(o)e.properties[l]={type:"array",items:{type:"object"}};else if(c.length>0)e.properties[l]={type:"object",properties:{}};else{let p=n.typeHints[f];e.properties[l]={type:p||"string"};return}if(c.length>0){let p=o?e.properties[l].items:e.properties[l];p&&this.ensureFieldPath(p,c,n,f)}}mergeResponseDefinitions(e,r){let n={...e};return r.description&&(n.description=r.description),r.contentType&&(n.contentType=r.contentType),r.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,r.schema):r.schema&&(n.schema=r.schema),r.examples&&(n.examples={...e.examples||{},...r.examples}),r.content&&(n.content={...e.content||{},...r.content}),r.headers&&(n.headers={...e.headers||{},...r.headers}),n}mergeBodySchemaWithExisting(e,r){let n={...r};return r.schema?n.schema=this.inferrer.mergeSchemas(e,r.schema):n.schema=e,n}}});var O$,oy,k$,P$,T$,A$,$$,Ju,CC=se(()=>{"use strict";O$=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,oy="(?:pm|hf|ctx)",k$=new RegExp(`${oy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),P$=new RegExp(`${oy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),T$=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,A$=new RegExp(`${oy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),$$=new RegExp(`${oy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),Ju=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(O$.source,O$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&r.fieldPaths.push(s)}}extractTypeAssertions(e,r){let n,i=new RegExp(k$.source,k$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),o=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(o),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(P$.source,P$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),o=n[2].trim();if(s){let l=this.parseAssertionValue(o);l!==void 0&&(r.valueHints[s]=l,typeof l=="string"?r.typeHints[s]=r.typeHints[s]||"string":typeof l=="number"?r.typeHints[s]=r.typeHints[s]||(Number.isInteger(l)?"integer":"number"):typeof l=="boolean"&&(r.typeHints[s]=r.typeHints[s]||"boolean")),r.fieldPaths.includes(s)||r.fieldPaths.push(s)}}}extractBooleanAssertions(e,r){let n,i=new RegExp(A$.source,A$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]="boolean",r.valueHints[s]=n[2]==="true",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractLengthAssertions(e,r){let n,i=new RegExp($$.source,$$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]=r.typeHints[s]||"array",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractStatusAssertions(e,r){let n,i=new RegExp(T$.source,T$.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&r.expectedStatuses.push(s)}}normalizeFieldPath(e){let r=e.replace(/^\./,"");return r=r.replace(/\[\d+\]/g,"[]"),r}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 r=Number(e);return!isNaN(r)&&e.trim().length>0?r:e==="true"?!0:e==="false"?!1:e==="null"?null:e}}});var N$={};Ws(N$,{AwsSecretResolver:()=>ay});var ay,xC=se(()=>{"use strict";ay=class{providerName="aws";region;moduleRequire;constructor(e,r){this.region=e.region??process.env.AWS_DEFAULT_REGION??process.env.AWS_REGION,this.moduleRequire=r??(n=>ft(n))}async resolve(e){let r=e.lastIndexOf("#"),n=r>=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):void 0;try{let{SecretsManagerClient:s,GetSecretValueCommand:o}=this.moduleRequire("@aws-sdk/client-secrets-manager"),f=await new s(this.region?{region:this.region}:{}).send(new o({SecretId:n})),c=f.SecretString??(f.SecretBinary?Buffer.from(f.SecretBinary).toString("utf-8"):void 0);if(c===void 0)return;if(i)try{let p=JSON.parse(c);return p[i]!==void 0?String(p[i]):void 0}catch{return}return c}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 M$={};Ws(M$,{AzureKeyVaultResolver:()=>ly});var ly,EC=se(()=>{"use strict";ly=class{providerName="azure";vaultUrl;moduleRequire;constructor(e,r){let n=(e.vaultUrl||process.env.AZURE_KEYVAULT_URL)??"";this.vaultUrl=n.replace(/\/$/,""),this.moduleRequire=r??(i=>ft(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 r=e.split("/"),n=r[0],i=r[1];try{let{SecretClient:s}=this.moduleRequire("@azure/keyvault-secrets"),{DefaultAzureCredential:o}=this.moduleRequire("@azure/identity"),l=new o;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 F$={};Ws(F$,{HashiCorpVaultResolver:()=>uy});var uy,IC=se(()=>{"use strict";uy=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 r=e.lastIndexOf("#"),n=r>=0?e.slice(0,r):e,i=r>=0?e.slice(r+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 o=`${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(o,{headers:l})}catch(g){throw new Error(`[HTTP Forge] Vault request failed: ${g?.message??g}`)}if(f.status===404)return;if(!f.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${f.status} for path: ${n}`);let p=(await f.json())?.data?.data;if(!p)return;if(i)return p[i]!==void 0?String(p[i]):void 0;if("value"in p)return String(p.value);let h=Object.keys(p);return h.length===1?String(p[h[0]]):void 0}}});var D$={};Ws(D$,{OnePasswordResolver:()=>cy});import{execFile as t5}from"child_process";import{promisify as r5}from"util";var n5,cy,qC=se(()=>{"use strict";n5=r5(t5),cy=class{providerName="1password";defaultVault;constructor(e){this.defaultVault=e.vault}async resolve(e){let r=e.split("/"),n,i,s;if(this.defaultVault){if(r.length<2)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<item>/<field>" when vault is set in config.`);n=this.defaultVault,i=r.slice(0,r.length-1).join("/"),s=r[r.length-1]}else{if(r.length<3)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<vault>/<item>/<field>".`);n=r[0],i=r.slice(1,r.length-1).join("/"),s=r[r.length-1]}let o=await this.tryResolveSdk(n,i,s);return o!==null?o:this.resolveViaCli(n,i,s)}async tryResolveSdk(e,r,n){let i=process.env.OP_SERVICE_ACCOUNT_TOKEN;if(!i)return null;try{let{createClient:s}=ft("@1password/sdk"),o=await s({auth:i,integrationName:"HTTP Forge",integrationVersion:"1.0.0"}),l=`op://${e}/${r}/${n}`;return await o.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}/${r}/${n}": ${s?.message??s}`)}}async resolveViaCli(e,r,n){try{let{stdout:i}=await n5("op",["item","get",r,"--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 L$={};Ws(L$,{GcpSecretResolver:()=>fy});var fy,OC=se(()=>{"use strict";fy=class{providerName="gcp";projectId;moduleRequire;constructor(e,r){this.projectId=e.projectId??process.env.GOOGLE_CLOUD_PROJECT??process.env.GCLOUD_PROJECT??process.env.GCP_PROJECT,this.moduleRequire=r??(n=>ft(n))}async resolve(e){let r=e.split("/"),n=r[0],i=r[1]==="versions"&&r[2]?r[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"),o=new s,l=`projects/${this.projectId}/secrets/${n}/versions/${i}`,[f]=await o.accessSecretVersion({name:l}),c=f.payload?.data;return c?Buffer.isBuffer(c)?c.toString("utf-8"):Buffer.from(c).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 U$={};Ws(U$,{DopplerResolver:()=>dy});import*as j$ from"https";var dy,kC=se(()=>{"use strict";dy=class{providerName="doppler";token;constructor(e){this.token=e.serviceToken??process.env.DOPPLER_TOKEN}async resolve(e){let r=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(r)}`;return new Promise((s,o)=>{let l=j$.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},f=>{let c=[];f.on("data",p=>c.push(p)),f.on("end",()=>{let p=Buffer.concat(c).toString("utf-8");if(f.statusCode===404){s(void 0);return}if(f.statusCode!==200){o(new Error(`[HTTP Forge] Doppler API returned ${f.statusCode} for secret "${r}": ${p}`));return}try{let g=JSON.parse(p)?.value?.computed;s(g!=null?String(g):void 0)}catch{o(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",o),l.end()})}}});import*as py from"fs";import{createRequire as i5}from"module";import*as H$ from"path";var zd,PC=se(()=>{"use strict";zd=class{resolvers=new Map;moduleRequire;constructor(e){if(this.moduleRequire=this.buildModuleRequire(e),!e)return;let r;try{r=e.getConfig().secrets}catch{return}if(!(!r?.providers||typeof r.providers!="object"))for(let[n,i]of Object.entries(r.providers))try{let s=this.createResolver(i);s&&this.resolvers.set(n,s)}catch{}}async resolveSecretTokens(e,r){let n=r??new Map,i=new Set;if(this.collectTokens(e,i),i.size===0)return{};await Promise.all(Array.from(i).map(async o=>{if(n.has(o))return;let l=o.slice(7),f=l.indexOf("/");if(f<0)return;let c=l.slice(0,f),p=l.slice(f+1),h=this.resolvers.get(c);if(h)try{let g=await h.resolve(p);g!==void 0&&n.set(o,g)}catch(g){let v=g?.message??String(g);console.warn(`[HTTP Forge] {{${o}}} could not be resolved: ${v}`)}}));let s={};for(let[o,l]of n.entries())s[o]=l;return s}get hasProviders(){return this.resolvers.size>0}collectTokens(e,r){if(typeof e=="string"){let n=/\{\{(secret:[^}]+)\}\}/g,i;for(;(i=n.exec(e))!==null;)r.add(i[1])}else Array.isArray(e)?e.forEach(n=>this.collectTokens(n,r)):e!==null&&typeof e=="object"&&Object.values(e).forEach(n=>this.collectTokens(n,r))}createResolver(e){switch(e.provider){case"aws":{let{AwsSecretResolver:r}=(xC(),Ul(N$));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(EC(),Ul(M$));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(IC(),Ul(F$));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(qC(),Ul(D$));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(OC(),Ul(L$));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(kC(),Ul(U$));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>ft(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=H$.resolve(i,"package.json");if(py.existsSync(s)){let o=py.realpathSync(s),l=i5(o);return f=>{try{return l(f)}catch{return r(f)}}}}catch{}return r}}});function br(t){return t.replace(/\//g,"%2F")}function B$(t){return t.replace(/%2F/gi,"/")}function bs(t){return t?t.split("/").map(B$).join(" / "):""}function hy(t){return t.includes(" / ")?t.split(" / ").map(e=>br(e.trim())).join("/"):br(t)}function Xe(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="request")n.push({request:i,folderPath:r});else{let s=i,o=br(s.name),l=r?`${r}/${o}`:o;n.push(...Xe(t,s.items??[],l))}return n}function Qr(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,o=br(s.name),l=r?`${r}/${o}`:o;n.push({folderId:s.id,folderPath:l,requestCount:TC(s.items??[])}),n.push(...Qr(t,s.items??[],l))}return n}function TC(t){let e=0;for(let r of t)r.type==="request"?e++:e+=TC(r.items??[]);return e}var mi=se(()=>{"use strict"});var Jd,AC=se(()=>{"use strict";Jd={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as Mt from"fs";import*as Ro from"path";var Gd,$C=se(()=>{"use strict";mi();Cn();AC();Gd=class{constructor(e,r,n){this.collectionService=e;this.configService=r;this.suitesDir=r.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(){Mt.existsSync(this.suitesDir)||Mt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Mt.watch(this.suitesDir,(e,r)=>{r&&!r.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(),!Mt.existsSync(this.suitesDir))return;let e=Mt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=Ro.join(this.suitesDir,r),i=Mt.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 ${r}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,r=[]){let n=Date.now(),i={id:St(e),name:e,requests:r,config:{...Jd},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,r){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(r,n.requests.map(l=>({...l})));i.config={...n.config},i.description=n.description;let s=Ro.join(this.suitesDir,e),o=Ro.join(this.suitesDir,i.id);return Mt.existsSync(s)&&this.copyDirRecursive(s,o),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Mt.existsSync(r)||Mt.mkdirSync(r,{recursive:!0});for(let n of Mt.readdirSync(e,{withFileTypes:!0})){let i=Ro.join(e,n.name),s=Ro.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Mt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=Ro.join(this.suitesDir,n);try{return Mt.existsSync(i)&&Mt.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let r=this.collectionService.getCollection(e);if(!r){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(r,e,r.name,"",n);let i=Date.now();return{id:`temp-${e}`,name:r.name,requests:n,config:{...Jd},isTemporary:!0,createdAt:i,updatedAt:i}}async createTempSuiteFromFolder(e,r,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 o=r.replace(/\/+$/,""),l=s.filter(p=>n?p.folderPath===o||p.folderPath.startsWith(`${o}/`):p.folderPath===o);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${r}" in collection: ${e}`);return}let f=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(o)}`,name:`${i.name} / ${bs(o)}`,requests:l,config:{...Jd},isTemporary:!0,createdAt:f,updatedAt:f}}slugifyFolderPath(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:St(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],r=this.collectionService.getAllCollections();for(let n of r)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,r,n,i,s){if(e.requests)for(let o of e.requests)s.push({collectionId:r,collectionName:n,requestId:o.id,name:o.name||"Unnamed Request",method:o.method||"GET",folderPath:i});if(e.items)for(let o of e.items)if(o.items||o.folders||o.requests){let l=i?`${i}/${br(o.name)}`:br(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}else s.push({collectionId:r,collectionName:n,requestId:o.id,name:o.name||"Unnamed Request",method:o.method||"GET",folderPath:i});if(e.folders)for(let o of e.folders){let l=i?`${i}/${br(o.name)}`:br(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=Ro.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Mt.writeFileSync(n,i,"utf-8")}}});var ne,my=se(()=>{"use strict";ne={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 V$ from"path";function gy(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:o,secretStore:l,browserService:f,applicationInfo:c,consoleService:p}=e;t.registerValue(ne.WorkspaceFolder,r),t.registerSingleton(ne.Config,()=>new gu(r,n,i)),t.registerSingleton(ne.Console,()=>p??s5),t.registerSingleton(ne.EnvironmentConfig,g=>new Jf(r,s,g.resolve(ne.Config),n,l,e.persistOverrides??!0)),t.registerSingleton(ne.Cookie,()=>new Vf(o)),t.registerSingleton(ne.Collection,g=>new Bf(r,g.resolve(ne.Config),n)),t.registerSingleton(ne.TestSuite,g=>new Gd(g.resolve(ne.Collection),g.resolve(ne.Config))),t.registerSingleton(ne.HttpClient,()=>new fa),t.registerSingleton(ne.UrlBuilder,()=>new Kn),t.registerSingleton(ne.InterceptorChain,()=>new ss),t.registerSingleton(ne.HttpRequest,g=>new is(g.resolve(ne.UrlBuilder),g.resolve(ne.InterceptorChain),g.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new Ca),t.registerSingleton(ne.RequestHistory,g=>{let v=g.resolve(ne.EnvironmentConfig);return new Zf(v.getHistoriesPath(),V$.join(v.getRootPath(),"shared-histories"))}),l&&f&&t.registerSingleton(ne.OAuth2TokenManager,g=>new jf(l,f,g.resolve(ne.EnvironmentConfig),g.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,g=>new Yf(g.resolve(ne.HttpClient))),t.registerSingleton(ne.SecretResolverRegistry,g=>new zd(g.resolve(ne.Config)));let h=c??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,g=>new Gf(g.resolve(ne.EnvironmentConfig),g.resolve(ne.HttpRequest),g.resolve(ne.RequestPreprocessor),g.has(ne.OAuth2TokenManager)?g.resolve(ne.OAuth2TokenManager):void 0,h,g.resolve(ne.SecretResolverRegistry))),t.registerSingleton(ne.ScriptExecutor,g=>{let v=g.resolve(ne.Config);return new cs(g.resolve(ne.HttpRequest),v.getModulePaths(),g.resolve(ne.SecretResolverRegistry),v.getScriptScope(),v.getScriptTimeout())}),t.registerSingleton(ne.DataFileParser,()=>new Ea),t.registerSingleton(ne.CollectionRequestExecutor,g=>new no(g.resolve(ne.HttpRequest),g.resolve(ne.ScriptExecutor),g.resolve(ne.EnvironmentConfig),g.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,g=>new Wf(g.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new go),t.registerSingleton(ne.HistoryAnalyzer,g=>new yu(g.resolve(ne.RequestHistory),g.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new Ju),t.registerSingleton(ne.SchemaInferenceService,g=>new zu(g.resolve(ne.HistoryAnalyzer),g.resolve(ne.ScriptAnalyzer),g.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,g=>new Ou(g.resolve(ne.Collection),g.resolve(ne.EnvironmentConfig),g.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,g=>new _o(g.resolve(ne.Collection),g.resolve(ne.EnvironmentConfig)))}var s5,NC=se(()=>{"use strict";s0();c0();d0();p0();h0();g0();Im();y0();v0();x0();ef();tf();Xc();_m();Bl();E0();aR();sy();RC();Og();CC();Rm();Mf();PC();$C();my();s5={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function W$(){return Ba.instance}var Ba,MC=se(()=>{"use strict";my();Ba=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static createFresh(){return new t}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.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(ne.Config)}get console(){return this.resolve(ne.Console)}get environmentConfig(){return this.resolve(ne.EnvironmentConfig)}get collection(){return this.resolve(ne.Collection)}get httpRequest(){return this.resolve(ne.HttpRequest)}get httpClient(){return this.resolve(ne.HttpClient)}get cookie(){return this.resolve(ne.Cookie)}get requestHistory(){return this.resolve(ne.RequestHistory)}get dataFileParser(){return this.resolve(ne.DataFileParser)}get scriptExecutor(){return this.resolve(ne.ScriptExecutor)}get requestPreparer(){return this.resolve(ne.RequestPreparer)}get persistentCookieJar(){return this.resolve(ne.PersistentCookieJar)}get oauth2TokenManager(){return this.has(ne.OAuth2TokenManager)?this.resolve(ne.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(ne.GraphQLSchemaService)}get testSuite(){return this.resolve(ne.TestSuite)}}});function z$(t){return/\{\{[^}]+\}\}/.test(t)}function Yd(t,e=16){return!!t&&t.length>=e&&!z$(t)}function FC(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function Kd(t,e,r,n,i,s=10){let o=t.get(e);o||(o={varName:r,reason:n,occurrences:[],priority:s},t.set(e,o));let l=`${i.requestId}::${i.field}`;o.occurrences.some(f=>`${f.requestId}::${f.field}`===l)||o.occurrences.push(i)}function yy(t,e=1){let r=Xe(t),n=new Map;for(let{request:s}of r){let o=l=>({requestId:s.id,requestName:s.name,field:l});for(let l of s.headers??[]){if(l.enabled===!1)continue;let f=l.key.toLowerCase(),c=l.value;if(f==="authorization"){let p=c.match(/^(bearer|basic|token|digest)\s+(.+)$/i);p&&Yd(p[2])?Kd(n,p[2],`${p[1].toUpperCase()}_TOKEN`,`Authorization ${p[1]} token`,o(`header:${l.key}`),1):Yd(c)&&Kd(n,c,"AUTH_TOKEN","Authorization header value",o(`header:${l.key}`),1)}else o5.has(f)&&Yd(c)?Kd(n,c,FC(l.key),`Sensitive header: ${l.key}`,o(`header:${l.key}`),2):Yd(c,20)&&!c.includes(" ")&&/^[A-Za-z0-9+/=_.-]+$/.test(c)&&Kd(n,c,FC(l.key)||"HEADER_VALUE",`Long opaque value in header: ${l.key}`,o(`header:${l.key}`),5)}for(let l of s.query??[])l.enabled!==!1&&a5.has(l.key.toLowerCase())&&Yd(l.value)&&Kd(n,l.value,FC(l.key),`Sensitive query param: ${l.key}`,o(`query:${l.key}`),2)}let i=new Map;for(let{request:s}of r)if(!(!s.url||z$(s.url)))try{let o=new URL(s.url);if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)){let f=`${o.protocol}//${o.host}`,c=i.get(f)??[];c.push({requestId:s.id,requestName:s.name,field:"url"}),i.set(f,c)}}catch{}for(let[s,o]of i)o.length>=Math.max(e,2)&&!n.has(s)&&n.set(s,{varName:"BASE_URL",reason:`Shared base URL across ${o.length} requests`,occurrences:o,priority:3});return[...n.entries()].filter(([,s])=>s.occurrences.length>=e).sort((s,o)=>s[1].priority-o[1].priority||s[0].localeCompare(o[0])).map(([s,o])=>({varName:o.varName,value:s,reason:o.reason,occurrences:o.occurrences}))}function DC(t,e){let r={};return J$(t,e,r),r}function J$(t,e,r){for(let n of t){if(n.type==="folder"){n.items&&J$(n.items,e,r);continue}let i=n;for(let s of e){let o=`{{${s.varName}}}`;i.url?.includes(s.value)&&(i.url=i.url.split(s.value).join(o),r[s.varName]=(r[s.varName]??0)+1);for(let l of i.headers??[]){let f=l.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);f&&f[2]===s.value?(l.value=`${f[1]} ${o}`,r[s.varName]=(r[s.varName]??0)+1):l.value===s.value&&(l.value=o,r[s.varName]=(r[s.varName]??0)+1)}for(let l of i.query??[])l.value===s.value&&(l.value=o,r[s.varName]=(r[s.varName]??0)+1)}}}var o5,a5,LC=se(()=>{"use strict";mi();o5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),a5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"])});function Ss(t,e){let r={type:"string",description:t};return e.length>0&&(r.enum=[...e]),r}function jC(t,e,r){let n=i=>Ss("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${t}${J.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:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.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"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.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"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.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"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getRequest}`,description:"Get the full details of a single saved request: URL, method, headers, body, auth, and scripts. Use this to inspect a request before editing it, or to read a script before rewriting it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id. Use list_requests to find names."}},required:["collection","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.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)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${J.setVariable}`,description:'Override an environment variable for the current session. In the VS Code extension the change is saved to VS Code workspace storage (survives restarts, but is not in the env JSON file and not source-controlled). In the standalone CLI/core runtime the change is in-memory only and lost when the server restarts. Use set_environment_variable with scope:"permanent" to write to the env JSON file (source-controlled, works in both runtimes).',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"]},annotations:{idempotentHint:!0}},{name:`${t}${J.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"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getRunSummary}`,description:'Get the pass/fail summary of a completed async run (total, passed, failed counts). Use after get_run_status shows "completed". When failures are present the response includes a failedRequests array with full details (method, url, requestBody, status, responseBody, failedTests) and a _nextStep directive. You MUST follow the _nextStep directive immediately \u2014 analyze the failures and provide diagnosis without waiting for the user to ask.',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.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"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.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"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.cancelRun}`,description:'Request cancellation of an in-progress async run. Cancellation is best-effort: the currently-executing HTTP request completes normally, but no further requests in the run are started. The run status changes to "cancelled". Has no effect on runs that are already completed, failed, or cancelled.',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by run_collection, run_folder, or run_suite with async:true."}},required:["runId"]},annotations:{idempotentHint:!0}},{name:`${t}${J.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.'},...vy.properties},required:["collection","request"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.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").'},...Sy.properties},required:["collection","folder"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...by.properties},required:["collection"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:Ss("Name of the test suite to run.",r),...wy.properties},required:["suite"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.createCollection}`,description:"Create a new empty collection.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new collection."}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.renameCollection}`,description:"Rename an existing collection.",inputSchema:{type:"object",properties:{collection:n(!0),newName:{type:"string",description:"New display name for the collection."}},required:["collection","newName"]},annotations:{idempotentHint:!0}},{name:`${t}${J.deleteCollection}`,description:"Permanently delete a collection and all its contents. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.duplicateCollection}`,description:"Clone a collection under a new name (all folders, requests, and scripts are copied).",inputSchema:{type:"object",properties:{collection:n(!0),newName:{type:"string",description:"Name for the duplicated collection."}},required:["collection","newName"]},annotations:{idempotentHint:!1}},{name:`${t}${J.createFolder}`,description:"Create a folder inside a collection (optionally nested inside another folder).",inputSchema:{type:"object",properties:{collection:n(!0),name:{type:"string",description:"Display name for the new folder."},parentFolder:{type:"string",description:"Slash-separated folder path or folder id of the parent. Omit to create at collection root."}},required:["collection","name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.deleteFolder}`,description:"Delete a folder and all its requests. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Slash-separated folder path or folder id to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","folder","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.createRequest}`,description:"Create a new HTTP request inside a collection (optionally inside a folder).",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Folder path or id. Omit to add at collection root."},name:{type:"string",description:"Display name for the request."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],description:"HTTP method."},url:{type:"string",description:"Request URL, may include {{variable}} placeholders."},headers:{type:"object",description:"Key/value header map.",additionalProperties:{type:"string"}},body:{type:"string",description:"Raw request body (JSON, text, etc.)."},description:{type:"string",description:"Human-readable description."}},required:["collection","name","method","url"]},annotations:{idempotentHint:!1}},{name:`${t}${J.updateRequest}`,description:"Update fields on an existing request (partial update \u2014 omit fields to keep current values).",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},name:{type:"string",description:"New display name."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},url:{type:"string"},headers:{type:"object",additionalProperties:{type:"string"}},body:{type:"string"},description:{type:"string"}},required:["collection","request"]},annotations:{idempotentHint:!0}},{name:`${t}${J.deleteRequest}`,description:"Remove a request from a collection. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","request","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.getRequestScript}`,description:"Read the pre-request or post-response script of a request.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},phase:{type:"string",enum:["pre-request","post-response"],description:"Which script phase to read."}},required:["collection","request","phase"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.setRequestScript}`,description:"Write or replace the pre-request or post-response script of a request.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},phase:{type:"string",enum:["pre-request","post-response"],description:"Which script phase to write."},script:{type:"string",description:"Full JavaScript source to write."}},required:["collection","request","phase","script"]},annotations:{idempotentHint:!0}},{name:`${t}${J.reorderCollectionItems}`,description:"Set the execution/display order of direct children of a collection root or folder. Items not listed are appended at the end.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Folder path or id. Omit to reorder collection root."},order:{type:"array",items:{type:"string"},description:"Ordered list of item names or ids."}},required:["collection","order"]},annotations:{idempotentHint:!0}},{name:`${t}${J.listSuites}`,description:"List all test suites with name, id, request count, and configuration summary.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.getSuite}`,description:"Get full details of a test suite including its request list.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the test suite.",r)},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.createSuite}`,description:"Create a new test suite (empty or pre-populated from a collection/folder).",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new suite."},description:{type:"string",description:"Optional description."},fromCollection:{type:"string",description:"Collection name or id to seed the suite from (all requests in execution order)."},fromFolder:{type:"string",description:"Folder path within fromCollection to seed from."},iterations:{type:"number",description:"Number of iterations (default: 1)."},stopOnError:{type:"boolean",description:"Stop on first failure (default: false)."},delayBetweenRequests:{type:"number",description:"Milliseconds delay between requests (default: 0)."}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.updateSuiteConfig}`,description:"Change a suite's name, description, or run configuration.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite to update.",r),name:{type:"string",description:"New display name."},description:{type:"string",description:"New description."},iterations:{type:"number"},stopOnError:{type:"boolean"},delayBetweenRequests:{type:"number"}},required:["suite"]},annotations:{idempotentHint:!0}},{name:`${t}${J.addSuiteRequests}`,description:"Append or insert one or more requests into a suite.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite.",r),requests:{type:"array",items:{type:"object",properties:{collection:{type:"string",description:"Collection name or id."},request:{type:"string",description:"Request name or id."}},required:["collection","request"]},description:"Requests to add."},insertAt:{type:"number",description:"Zero-based index to insert at. Omit to append at end."}},required:["suite","requests"]},annotations:{idempotentHint:!1}},{name:`${t}${J.removeSuiteRequest}`,description:"Remove a request from a suite by position (0-based) or by name.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite.",r),index:{type:"number",description:"Zero-based position in the suite requests list."},request:{type:"string",description:"Request name to remove (used if index is not provided)."}},required:["suite"]},annotations:{destructiveHint:!0}},{name:`${t}${J.reorderSuiteRequests}`,description:"Reorder requests in a suite. Requests not listed are moved to the end.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite.",r),order:{type:"array",items:{type:"string"},description:"Ordered list of request names."}},required:["suite","order"]},annotations:{idempotentHint:!0}},{name:`${t}${J.duplicateSuite}`,description:"Clone an existing suite under a new name.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite to clone.",r),newName:{type:"string",description:"Name for the duplicated suite."}},required:["suite","newName"]},annotations:{idempotentHint:!1}},{name:`${t}${J.deleteSuite}`,description:"Delete a test suite permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite to delete.",r),confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["suite","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.listEnvironments}`,description:"List all environments with their variable keys (values hidden). Use get_environment_variables to see values.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.getEnvironmentVariables}`,description:"Get the resolved (merged file + session overrides) variables for an environment.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${J.selectEnvironment}`,description:"Set the active environment for all subsequent run_* calls in this session.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Name of the environment to activate."}},required:["environment"]},annotations:{idempotentHint:!0}},{name:`${t}${J.createEnvironment}`,description:"Create a new environment file, optionally pre-populated with variables.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Environment name (becomes the filename)."},variables:{type:"object",description:"Initial key/value variable map.",additionalProperties:{type:"string"}}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.deleteEnvironment}`,description:"Delete an environment file permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["environment","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.setEnvironmentVariable}`,description:'Set a variable in an environment. Scope "session" (default) is in-memory only and always temporary (both runtimes). Scope "permanent" writes to the env JSON config file \u2014 source-controlled and shared with the CLI runtime.',inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."},key:{type:"string",description:"Variable name."},value:{type:"string",description:"New value."},scope:{type:"string",enum:["session","permanent"],description:'Storage scope. "permanent" writes to disk.'}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${J.unsetEnvironmentVariable}`,description:"Remove a session-scoped variable override, restoring the file value.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."},key:{type:"string",description:"Variable name to unset."}},required:["key"]},annotations:{idempotentHint:!0}},{name:`${t}${J.setGlobalVariable}`,description:'Set a global variable visible across all environments. Scope "session" (default) is in-memory only and lost on restart (both runtimes). Scope "permanent" writes to _global.json \u2014 source-controlled and shared with the CLI runtime.',inputSchema:{type:"object",properties:{key:{type:"string",description:"Global variable name."},value:{type:"string",description:"Value to set."},scope:{type:"string",enum:["session","permanent"],description:'Storage scope. "permanent" writes to _global.json.'}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${J.getGlobals}`,description:"Return all global variables (merged _global.json + runtime pm.globals.set() values).",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.scaffoldCollectionFromOpenApi}`,description:"Import an OpenAPI 3.0 spec (JSON or YAML) and scaffold a complete HTTP Forge collection from it. All operations become requests grouped by tag/path. An optional environment is created from the server URL. Returns the new collection id and name. Use this to quickly bootstrap API testing from a spec file.",inputSchema:{type:"object",properties:{specPath:{type:"string",description:"Absolute or workspace-relative path to the OpenAPI 3.0 JSON or YAML file."},collectionName:{type:"string",description:"Override the collection name (defaults to the spec title)."},environmentName:{type:"string",description:"Name for the generated environment that contains the server base URL. Omit to skip environment creation."}},required:["specPath"]},annotations:{idempotentHint:!1}},{name:`${t}${J.suggestAssertions}`,description:"Analyse the last execution history for a request and suggest pm.test() assertions to add to its post-response script. Covers status code, response time, required JSON fields, Content-Type header, and schema conformance. Returns an array of ready-to-paste JavaScript test snippets and a rationale for each.",inputSchema:{type:"object",properties:{collection:{type:"string",description:"Collection name or id that owns the request."},request:{type:"string",description:"Request name or id to analyse."},environment:{type:"string",description:"Environment used when the run was recorded (defaults to active environment)."},maxSuggestions:{type:"number",description:"Cap the number of suggestions returned (default: 10)."}},required:["collection","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.explainFailure}`,description:"Explain why a specific request failed in a recent run. Returns the full request (URL, method, headers, body), the response received (status, headers, body), all assertion results, any script errors, and a plain-English diagnosis with suggested fixes. Provide either runId (from a prior run_suite/run_collection call) + request name, or the collection and request names to pull the most recent history entry.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"MCP run id (from run_suite or run_collection). Mutually exclusive with collection+request history lookup."},collection:{type:"string",description:"Collection name or id. Required when runId is omitted."},request:{type:"string",description:"Request name or id."},iteration:{type:"number",description:"Iteration number within the run (default: 1)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${J.suggestEnvVars}`,description:`Scan a collection for hardcoded values (API keys, base URLs, tokens, tenant IDs) that should become environment variables.
277
+ `)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,ey.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Hd.resolve(t.href,i.headers.location);return i$(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new n$.ResolverError((0,ey.ono)(i,`Error downloading ${t.href}`),t.href)}}async function d8(t,e){let r,n;e.timeout&&(r=new AbortController,n=setTimeout(()=>r.abort(),e.timeout));let i=await fetch(t,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:r?r.signal:null});return n&&clearTimeout(n),i}});var hC=H(vs=>{"use strict";var Bu=vs&&vs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vs,"__esModule",{value:!0});vs.getNewOptions=vs.getJsonSchemaRefParserDefaultOptions=void 0;var p8=Bu(TA()),h8=Bu(K1()),m8=Bu(Q1()),g8=Bu(Z1()),y8=Bu(r$()),v8=Bu(s$()),b8=()=>({parse:{json:{...p8.default},yaml:{...h8.default},text:{...m8.default},binary:{...g8.default}},resolve:{file:{...y8.default},http:{...v8.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});vs.getJsonSchemaRefParserDefaultOptions=b8;var S8=t=>{let e=(0,vs.getJsonSchemaRefParserDefaultOptions)();return t&&a$(e,t),e};vs.getNewOptions=S8;function a$(t,e){if(o$(e)){let r=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=e[i],o=t[i];o$(s)?t[i]=a$(o||{},s):s!==void 0&&(t[i]=s)}}return t}function o$(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var u$=H(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.normalizeArgs=l$;var w8=hC();function l$(t){let e,r,n,i,s=Array.prototype.slice.call(t);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(r=s[1],n=s[2]):(r=void 0,n=s[1])):(e="",r=s[0],n=s[1]);try{n=(0,w8.getNewOptions)(n)}catch(o){console.error(`JSON Schema Ref Parser: Error normalizing options: ${o}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}ty.default=l$});var c$=H(fi=>{"use strict";var _8=fi&&fi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),R8=fi&&fi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C8=fi&&fi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&_8(r,e,n[i]);return R8(r,e),r}})(),mC=fi&&fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fi,"__esModule",{value:!0});var x8=mC(Nu()),E8=mC(Pd()),I8=mC(PR()),Vu=C8(Tn()),O8=An();function q8(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=gC(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function gC(t,e,r,n,i,s){i||(i=new Set);let o=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),x8.default.isExternal$Ref(t)&&o.push(k8(t,e,r,n));let l=Object.keys(t);for(let f of l){let c=E8.default.join(e,f),p=t[f];o=o.concat(gC(p,c,r,n,i,s))}}return o}async function k8(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Vu.resolve(i?Vu.cwd():e,t.$ref),o=Vu.stripHash(s),l=r._$refs[o];if(l)return Promise.resolve(l.value);try{let f=await(0,I8.default)(s,r,n),c=gC(f,o+"#",r,n,new Set,!0);return Promise.all(c)}catch(f){if(!n?.continueOnError||!(0,O8.isHandledError)(f))throw f;return r._$refs[o]&&(f.source=decodeURI(Vu.stripHash(e)),f.path=Vu.safePointerToPath(Vu.getHash(e))),[]}}fi.default=q8});var p$=H(di=>{"use strict";var P8=di&&di.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),T8=di&&di.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),A8=di&&di.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&P8(r,e,n[i]);return T8(r,e),r}})(),d$=di&&di.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(di,"__esModule",{value:!0});var ry=d$(Nu()),Bd=d$(Pd()),yC=A8(Tn());function $8(t,e){let r=[];vC(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),N8(r)}function vC(t,e,r,n,i,s,o,l){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(ry.default.isAllowed$Ref(f))f$(t,e,r,n,i,s,o,l);else{let c=Object.keys(f).sort((p,h)=>p==="definitions"?-1:h==="definitions"?1:p.length-h.length);for(let p of c){let h=Bd.default.join(r,p),g=Bd.default.join(n,p),v=f[p];ry.default.isAllowed$Ref(v)?f$(f,p,r,g,i,s,o,l):vC(f,p,h,g,i,s,o,l)}}}function f$(t,e,r,n,i,s,o,l){let f=e===null?t:t[e],c=yC.resolve(r,f.$ref),p=o._resolve(c,n,l);if(p===null)return;let g=Bd.default.parse(n).length,v=yC.stripHash(p.path),_=yC.getHash(p.path),w=v!==o._root$Ref.path,E=ry.default.isExtended$Ref(f);i+=p.indirections;let k=M8(s,t,e);if(k)if(g<k.depth||i<k.indirections)F8(s,k);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:g,file:v,hash:_,value:p.value,circular:p.circular,extended:E,external:w,indirections:i}),(!k||w)&&vC(p.value,null,p.path,n,i+1,s,o,l)}function N8(t){t.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 o=i.pathFromRoot.lastIndexOf("/definitions"),l=s.pathFromRoot.lastIndexOf("/definitions");return o!==l?l-o:i.pathFromRoot.length-s.pathFromRoot.length}});let e,r,n;for(let i of t)i.external?i.file===e&&i.hash===r?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(r+"/")===0?i.$ref.$ref=Bd.default.join(n,Bd.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=ry.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function M8(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function F8(t,e){let r=t.indexOf(e);t.splice(r,1)}di.default=$8});var b$=H(pi=>{"use strict";var D8=pi&&pi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L8=pi&&pi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),j8=pi&&pi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&D8(r,e,n[i]);return L8(r,e),r}})(),y$=pi&&pi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pi,"__esModule",{value:!0});var ny=y$(Nu()),h$=y$(Pd()),U8=yo(),m$=j8(Tn()),H8=An();pi.default=B8;function B8(t,e){let r=Date.now(),n=bC(t.schema,t.$refs._root$Ref.path,"#",new Set,new Set,new Map,t.$refs,e,r);t.$refs.circular=n.circular,t.schema=n.value}function bC(t,e,r,n,i,s,o,l,f){let c,p={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-f>l.timeoutMs)throw new H8.TimeoutError(l.timeoutMs);let h=l.dereference||{},g=h.excludedPathMatcher||(()=>!1);if((h?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!g(r)){if(n.add(t),i.add(t),ny.default.isAllowed$Ref(t,l))c=g$(t,e,r,n,i,s,o,l,f),p.circular=c.circular,p.value=c.value;else for(let v of Object.keys(t)){let _=h$.default.join(e,v),w=h$.default.join(r,v);if(g(w))continue;let E=t[v],k=!1;if(ny.default.isAllowed$Ref(E,l)){if(c=g$(E,_,w,n,i,s,o,l,f),k=c.circular,t[v]!==c.value){let T=new Map;h?.preservedProperties&&typeof t[v]=="object"&&!Array.isArray(t[v])&&h?.preservedProperties.forEach(N=>{N in t[v]&&T.set(N,t[v][N])}),t[v]=c.value,h?.preservedProperties&&T.size&&typeof t[v]=="object"&&!Array.isArray(t[v])&&T.forEach((N,$)=>{t[v][$]=N}),h?.onDereference?.(E.$ref,t[v],t,v)}}else n.has(E)?k=v$(_,o,l):(c=bC(E,_,w,n,i,s,o,l,f),k=c.circular,t[v]!==c.value&&(t[v]=c.value));p.circular=p.circular||k}n.delete(t)}return p}function g$(t,e,r,n,i,s,o,l,f){let p=ny.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",h=m$.resolve(p?m$.cwd():e,t.$ref),g=s.get(h);if(g&&!g.circular){let T=Object.keys(t);if(T.length>1){let N={};for(let $ of T)$!=="$ref"&&!($ in g.value)&&(N[$]=t[$]);return{circular:g.circular,value:Object.assign({},g.value,N)}}return g}let v=o._resolve(h,e,l);if(v===null)return{circular:!1,value:null};let _=v.circular,w=_||n.has(v.value);w&&v$(e,o,l);let E=ny.default.dereference(t,v.value);if(!w){let T=bC(E,v.path,r,n,i,s,o,l,f);w=T.circular,E=T.value}w&&!_&&l.dereference?.circular==="ignore"&&(E=t),_&&(E.$ref=r);let k={circular:w,value:E};return Object.keys(t).length===1&&s.set(h,k),k}function v$(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw U8.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var S$=H(SC=>{"use strict";Object.defineProperty(SC,"__esModule",{value:!0});function V8(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}SC.default=V8()});var _$=H(Vd=>{"use strict";var W8=Vd&&Vd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Vd,"__esModule",{value:!0});Vd.default=z8;var w$=W8(S$());function z8(t,e){if(t){e.then(function(r){(0,w$.default)(function(){t(null,r)})},function(r){(0,w$.default)(function(){t(r)})});return}else return e}});var E$=H(xe=>{"use strict";var J8=xe&&xe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),G8=xe&&xe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Y8=xe&&xe.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&J8(r,e,n[i]);return G8(r,e),r}})(),Ha=xe&&xe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xe,"__esModule",{value:!0});xe.getJsonSchemaRefParserDefaultOptions=xe.jsonSchemaParserNormalizeArgs=xe.dereferenceInternal=xe.JSONParserErrorGroup=xe.isHandledError=xe.UnmatchedParserError=xe.ParserError=xe.ResolverError=xe.MissingPointerError=xe.InvalidPointerError=xe.JSONParserError=xe.UnmatchedResolverError=xe.dereference=xe.bundle=xe.resolve=xe.parse=xe.$RefParser=void 0;var R$=Ha(IA()),K8=Ha(PR()),Wd=Ha(u$());xe.jsonSchemaParserNormalizeArgs=Wd.default;var Q8=Ha(c$()),Z8=Ha(p$()),x$=Ha(b$());xe.dereferenceInternal=x$.default;var Ua=Y8(Tn()),$n=An();Object.defineProperty(xe,"JSONParserError",{enumerable:!0,get:function(){return $n.JSONParserError}});Object.defineProperty(xe,"InvalidPointerError",{enumerable:!0,get:function(){return $n.InvalidPointerError}});Object.defineProperty(xe,"MissingPointerError",{enumerable:!0,get:function(){return $n.MissingPointerError}});Object.defineProperty(xe,"ResolverError",{enumerable:!0,get:function(){return $n.ResolverError}});Object.defineProperty(xe,"ParserError",{enumerable:!0,get:function(){return $n.ParserError}});Object.defineProperty(xe,"UnmatchedParserError",{enumerable:!0,get:function(){return $n.UnmatchedParserError}});Object.defineProperty(xe,"UnmatchedResolverError",{enumerable:!0,get:function(){return $n.UnmatchedResolverError}});Object.defineProperty(xe,"isHandledError",{enumerable:!0,get:function(){return $n.isHandledError}});Object.defineProperty(xe,"JSONParserErrorGroup",{enumerable:!0,get:function(){return $n.JSONParserErrorGroup}});var C$=yo(),hi=Ha(_$()),X8=hC();Object.defineProperty(xe,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return X8.getJsonSchemaRefParserDefaultOptions}});var wo=class t{constructor(){this.schema=null,this.$refs=new R$.default}async parse(){let e=(0,Wd.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,C$.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,hi.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new R$.default;let n="http";if(Ua.isFileSystemPath(e.path))e.path=Ua.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=Ua.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=Ua.resolve(Ua.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,r=Promise.resolve(e.schema)}else r=(0,K8.default)(e.path,this.$refs,e.options);try{let i=await r;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,hi.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,hi.default)(e.callback,Promise.resolve(this.schema));throw C$.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,$n.isHandledError)(i)?(0,hi.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[Ua.stripHash(e.path)]&&this.$refs._$refs[Ua.stripHash(e.path)].addError(i),(0,hi.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,Wd.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,Q8.default)(this,e.options),wC(this),(0,hi.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,hi.default)(e.callback,Promise.reject(r))}}static resolve(){let e=new t;return e.resolve.apply(e,arguments)}static bundle(){let e=new t;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,Wd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,Z8.default)(this,e.options),wC(this),(0,hi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,hi.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,Wd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,x$.default)(this,e.options),wC(this),(0,hi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,hi.default)(e.callback,Promise.reject(r))}}};xe.$RefParser=wo;xe.default=wo;function wC(t){if($n.JSONParserErrorGroup.getParserErrors(t).length>0)throw new $n.JSONParserErrorGroup(t)}xe.parse=wo.parse;xe.resolve=wo.resolve;xe.bundle=wo.bundle;xe.dereference=wo.dereference});var iy,Wu,_C=se(()=>{"use strict";iy=Uc(E$()),Wu=class{async resolve(e){try{return await iy.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",r),e}}async bundle(e){try{return await iy.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await iy.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});import*as I$ from"fs";var O$,e5,_o,sy=se(()=>{"use strict";O$=Uc(qd());Cn();lR();_C();e5=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],_o=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new ku,this.refResolver=new Wu}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await I$.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=O$.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},o=r?.collectionName||i.info?.title||"Imported API",f={id:St(o),name:o,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 h=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);h&&(f.auth=h)}let c=new Map;if(i.tags)for(let h of i.tags){let g={type:"folder",id:St(h.name),name:h.name,description:h.description,items:[]};c.set(h.name,g),f.items.push(g)}if(i.paths)for(let[h,g]of Object.entries(i.paths))for(let v of["get","post","put","patch","delete","head","options","trace"]){let _=g[v];if(!_)continue;let w=this.processOperation(v,h,_,g,i,s),E=_.tags?.[0];if(E&&c.has(E))c.get(E).items.push(w);else if(E){let k={type:"folder",id:St(E),name:E,items:[w]};c.set(E,k),f.items.push(k)}else f.items.push(w)}await this.collectionService.saveCollection(f);let p;return r?.environmentName&&i.servers&&(p=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:p}}processOperation(e,r,n,i,s,o){let l=St(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,c=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,p=n.deprecated===!0;p&&(c=`[DEPRECATED] ${c}`);let h={type:"request",id:l,name:c,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:p},g=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(h,g,o),n.requestBody&&this.processRequestBody(h,n.requestBody,o),n.responses&&(h.responseSchema=this.processResponses(n.responses,o)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)h.auth={type:"none"};else if(n.security&&n.security.length>0){let v=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);v&&(h.auth=v)}}return h}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],o={},l=[];for(let f of r){let c=f.name,p=f.in,h=f.schema||{},g=f.example!==void 0?String(f.example):this.generateExampleForParam(h,n),v=f.deprecated===!0;switch(p){case"path":{if(f.description||h.type||h.format||h.enum||v||h.pattern||h.minimum!==void 0||h.maximum!==void 0||h.minLength!==void 0||h.maxLength!==void 0||h.multipleOf!==void 0||h.minItems!==void 0||h.maxItems!==void 0||h.uniqueItems||h.nullable||h.oneOf){let w={value:g};h.oneOf?(w.oneOf=h.oneOf,this.applyOneOfHints(w,h.oneOf)):(h.type&&(w.type=h.type),h.format&&(w.format=h.format),h.enum&&(w.enum=h.enum.map(String)),h.pattern&&(w.pattern=h.pattern),h.minimum!==void 0&&(w.minimum=h.minimum),h.maximum!==void 0&&(w.maximum=h.maximum),h.exclusiveMinimum!==void 0&&(w.exclusiveMinimum=h.exclusiveMinimum),h.exclusiveMaximum!==void 0&&(w.exclusiveMaximum=h.exclusiveMaximum),h.multipleOf!==void 0&&(w.multipleOf=h.multipleOf),h.minLength!==void 0&&(w.minLength=h.minLength),h.maxLength!==void 0&&(w.maxLength=h.maxLength),h.minItems!==void 0&&(w.minItems=h.minItems),h.maxItems!==void 0&&(w.maxItems=h.maxItems),h.uniqueItems&&(w.uniqueItems=!0),h.nullable&&(w.nullable=!0)),f.description&&(w.description=f.description),v&&(w.deprecated=!0),o[c]=w}else o[c]=g;break}case"query":{let _={key:c,value:g};this.applySchemaConstraints(_,h,f,v),s.push(_);break}case"header":{let _={key:c,value:g};this.applySchemaConstraints(_,h,f,v),i.push(_);break}case"cookie":{l.push(`${c}={{${c}}}`);break}}}l.length>0&&i.push({key:"Cookie",value:l.join("; ")}),Object.keys(o).length>0&&(e.params=o),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)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,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),o=r.content[s],{bodyType:l,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...f&&{format:f},content:""},o){let p=this.generateBodyContent(o,s,n);p!==void 0&&(e.body.content=typeof p=="string"?p:JSON.stringify(p,null,2)),l==="form-data"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n)),l==="x-www-form-urlencoded"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n))}let c=this.buildBodySchema(r,s,n);c&&(e.bodySchema=c)}selectPrimaryContentType(e){for(let i of e5)if(e.includes(i))return i;let r=e.find(i=>i.includes("json"));if(r)return r;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,r,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,r){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[o,l]of Object.entries(i)){let f=l,c=f.type==="string"&&f.format==="binary",p={key:o,value:c?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:c?"file":"text",enabled:!0};n.push(p)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let o={contentType:r,schema:s.schema};if(i.length>1){o.content={};for(let f of i){let c=e.content[f],p={};c.schema&&(p.schema=c.schema),c.examples&&(p.examples=c.examples),c.encoding&&(p.encoding=c.encoding),o.content[f]=p}}s.encoding&&(o.encoding=s.encoding);let l=this.extractUsedComponents(s.schema,n);return Object.keys(l).length>0&&(o.components=l),o}processResponses(e,r){let n={responses:{}},i={};for(let[s,o]of Object.entries(e)){let l=o,f={description:l.description||`Status ${s}`};if(l.content){let c=Object.keys(l.content);if(c.length===1){let p=c[0],h=l.content[p];f.contentType=p,h.schema&&(f.schema=h.schema),h.examples&&(f.examples=h.examples),h.schema&&Object.assign(i,this.extractUsedComponents(h.schema,r))}else{f.content={};for(let p of c){let h=l.content[p],g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),f.content[p]=g,h.schema&&Object.assign(i,this.extractUsedComponents(h.schema,r))}}}if(l.headers){f.headers={};for(let[c,p]of Object.entries(l.headers)){let h=p;f.headers[c]={...h.description&&{description:h.description},schema:h.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,r){let n=Object.keys(e)[0];if(!n)return;let i=r[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||{},o=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:o.tokenUrl||"",authUrl:o.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(o.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,r){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return r}extractUsedComponents(e,r,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&r[s]&&!i[s]&&(i[s]=r[s],this.extractUsedComponents(r[s],r,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,r,i);e.items&&this.extractUsedComponents(e.items,r,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let o of e[s])this.extractUsedComponents(o,r,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,r,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}}});var zu,RC=se(()=>{"use strict";zu=class{constructor(e,r,n){this.historyAnalyzer=e;this.scriptAnalyzer=r;this.inferrer=n}historyAnalyzer;scriptAnalyzer;inferrer;async infer(e,r,n,i){let s=await this.historyAnalyzer.analyze(e,r,{environment:i?.environment}),o;return i?.postResponseScript&&(o=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,o)}async inferBodySchema(e,r,n,i,s){let o,l;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}o=this.inferrer.inferFromValue(f),l="application/json"}else r==="form-data"&&i?(o=this.buildFormDataSchema(i),l="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(o=this.buildFormDataSchema(i),l="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(o={type:"string"},l="application/xml"):r==="raw"&&(n==="text"||n==="html")?(o={type:"string"},l=n==="html"?"text/html":"text/plain"):r==="binary"?(o={type:"string",format:"binary"},l="application/octet-stream"):r==="graphql"&&(o={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l="application/json");if(o)return s?this.mergeBodySchemaWithExisting(o,s):{contentType:l,schema:o}}buildFormDataSchema(e){let r={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"),r.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(r.required=n),r}mergeResponseSchemas(e,r,n){let i={responses:{}};for(let[s,o]of Object.entries(r.responses))i.responses[s]={...o};if(n&&this.applyScriptHints(i,n),e){for(let[s,o]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],o):i.responses[s]={...o};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,r){for(let n of r.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,r)}augmentSchemaWithHints(e,r){if(!(e.type!=="object"||!e.properties))for(let n of r.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,r)}}ensureFieldPath(e,r,n,i=""){if(r.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=r[0],o=s.endsWith("[]"),l=o?s.slice(0,-2):s,f=i?`${i}.${s}`:s,c=r.slice(1);if(!e.properties[l])if(o)e.properties[l]={type:"array",items:{type:"object"}};else if(c.length>0)e.properties[l]={type:"object",properties:{}};else{let p=n.typeHints[f];e.properties[l]={type:p||"string"};return}if(c.length>0){let p=o?e.properties[l].items:e.properties[l];p&&this.ensureFieldPath(p,c,n,f)}}mergeResponseDefinitions(e,r){let n={...e};return r.description&&(n.description=r.description),r.contentType&&(n.contentType=r.contentType),r.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,r.schema):r.schema&&(n.schema=r.schema),r.examples&&(n.examples={...e.examples||{},...r.examples}),r.content&&(n.content={...e.content||{},...r.content}),r.headers&&(n.headers={...e.headers||{},...r.headers}),n}mergeBodySchemaWithExisting(e,r){let n={...r};return r.schema?n.schema=this.inferrer.mergeSchemas(e,r.schema):n.schema=e,n}}});var q$,oy,k$,P$,T$,A$,$$,Ju,CC=se(()=>{"use strict";q$=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,oy="(?:pm|hf|ctx)",k$=new RegExp(`${oy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),P$=new RegExp(`${oy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),T$=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,A$=new RegExp(`${oy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),$$=new RegExp(`${oy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),Ju=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(q$.source,q$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&r.fieldPaths.push(s)}}extractTypeAssertions(e,r){let n,i=new RegExp(k$.source,k$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),o=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(o),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(P$.source,P$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),o=n[2].trim();if(s){let l=this.parseAssertionValue(o);l!==void 0&&(r.valueHints[s]=l,typeof l=="string"?r.typeHints[s]=r.typeHints[s]||"string":typeof l=="number"?r.typeHints[s]=r.typeHints[s]||(Number.isInteger(l)?"integer":"number"):typeof l=="boolean"&&(r.typeHints[s]=r.typeHints[s]||"boolean")),r.fieldPaths.includes(s)||r.fieldPaths.push(s)}}}extractBooleanAssertions(e,r){let n,i=new RegExp(A$.source,A$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]="boolean",r.valueHints[s]=n[2]==="true",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractLengthAssertions(e,r){let n,i=new RegExp($$.source,$$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]=r.typeHints[s]||"array",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractStatusAssertions(e,r){let n,i=new RegExp(T$.source,T$.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&r.expectedStatuses.push(s)}}normalizeFieldPath(e){let r=e.replace(/^\./,"");return r=r.replace(/\[\d+\]/g,"[]"),r}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 r=Number(e);return!isNaN(r)&&e.trim().length>0?r:e==="true"?!0:e==="false"?!1:e==="null"?null:e}}});var N$={};Ws(N$,{AwsSecretResolver:()=>ay});var ay,xC=se(()=>{"use strict";ay=class{providerName="aws";region;moduleRequire;constructor(e,r){this.region=e.region??process.env.AWS_DEFAULT_REGION??process.env.AWS_REGION,this.moduleRequire=r??(n=>ft(n))}async resolve(e){let r=e.lastIndexOf("#"),n=r>=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):void 0;try{let{SecretsManagerClient:s,GetSecretValueCommand:o}=this.moduleRequire("@aws-sdk/client-secrets-manager"),f=await new s(this.region?{region:this.region}:{}).send(new o({SecretId:n})),c=f.SecretString??(f.SecretBinary?Buffer.from(f.SecretBinary).toString("utf-8"):void 0);if(c===void 0)return;if(i)try{let p=JSON.parse(c);return p[i]!==void 0?String(p[i]):void 0}catch{return}return c}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 M$={};Ws(M$,{AzureKeyVaultResolver:()=>ly});var ly,EC=se(()=>{"use strict";ly=class{providerName="azure";vaultUrl;moduleRequire;constructor(e,r){let n=(e.vaultUrl||process.env.AZURE_KEYVAULT_URL)??"";this.vaultUrl=n.replace(/\/$/,""),this.moduleRequire=r??(i=>ft(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 r=e.split("/"),n=r[0],i=r[1];try{let{SecretClient:s}=this.moduleRequire("@azure/keyvault-secrets"),{DefaultAzureCredential:o}=this.moduleRequire("@azure/identity"),l=new o;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 F$={};Ws(F$,{HashiCorpVaultResolver:()=>uy});var uy,IC=se(()=>{"use strict";uy=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 r=e.lastIndexOf("#"),n=r>=0?e.slice(0,r):e,i=r>=0?e.slice(r+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 o=`${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(o,{headers:l})}catch(g){throw new Error(`[HTTP Forge] Vault request failed: ${g?.message??g}`)}if(f.status===404)return;if(!f.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${f.status} for path: ${n}`);let p=(await f.json())?.data?.data;if(!p)return;if(i)return p[i]!==void 0?String(p[i]):void 0;if("value"in p)return String(p.value);let h=Object.keys(p);return h.length===1?String(p[h[0]]):void 0}}});var D$={};Ws(D$,{OnePasswordResolver:()=>cy});import{execFile as t5}from"child_process";import{promisify as r5}from"util";var n5,cy,OC=se(()=>{"use strict";n5=r5(t5),cy=class{providerName="1password";defaultVault;constructor(e){this.defaultVault=e.vault}async resolve(e){let r=e.split("/"),n,i,s;if(this.defaultVault){if(r.length<2)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<item>/<field>" when vault is set in config.`);n=this.defaultVault,i=r.slice(0,r.length-1).join("/"),s=r[r.length-1]}else{if(r.length<3)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<vault>/<item>/<field>".`);n=r[0],i=r.slice(1,r.length-1).join("/"),s=r[r.length-1]}let o=await this.tryResolveSdk(n,i,s);return o!==null?o:this.resolveViaCli(n,i,s)}async tryResolveSdk(e,r,n){let i=process.env.OP_SERVICE_ACCOUNT_TOKEN;if(!i)return null;try{let{createClient:s}=ft("@1password/sdk"),o=await s({auth:i,integrationName:"HTTP Forge",integrationVersion:"1.0.0"}),l=`op://${e}/${r}/${n}`;return await o.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}/${r}/${n}": ${s?.message??s}`)}}async resolveViaCli(e,r,n){try{let{stdout:i}=await n5("op",["item","get",r,"--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 L$={};Ws(L$,{GcpSecretResolver:()=>fy});var fy,qC=se(()=>{"use strict";fy=class{providerName="gcp";projectId;moduleRequire;constructor(e,r){this.projectId=e.projectId??process.env.GOOGLE_CLOUD_PROJECT??process.env.GCLOUD_PROJECT??process.env.GCP_PROJECT,this.moduleRequire=r??(n=>ft(n))}async resolve(e){let r=e.split("/"),n=r[0],i=r[1]==="versions"&&r[2]?r[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"),o=new s,l=`projects/${this.projectId}/secrets/${n}/versions/${i}`,[f]=await o.accessSecretVersion({name:l}),c=f.payload?.data;return c?Buffer.isBuffer(c)?c.toString("utf-8"):Buffer.from(c).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 U$={};Ws(U$,{DopplerResolver:()=>dy});import*as j$ from"https";var dy,kC=se(()=>{"use strict";dy=class{providerName="doppler";token;constructor(e){this.token=e.serviceToken??process.env.DOPPLER_TOKEN}async resolve(e){let r=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(r)}`;return new Promise((s,o)=>{let l=j$.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},f=>{let c=[];f.on("data",p=>c.push(p)),f.on("end",()=>{let p=Buffer.concat(c).toString("utf-8");if(f.statusCode===404){s(void 0);return}if(f.statusCode!==200){o(new Error(`[HTTP Forge] Doppler API returned ${f.statusCode} for secret "${r}": ${p}`));return}try{let g=JSON.parse(p)?.value?.computed;s(g!=null?String(g):void 0)}catch{o(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",o),l.end()})}}});import*as py from"fs";import{createRequire as i5}from"module";import*as H$ from"path";var zd,PC=se(()=>{"use strict";zd=class{resolvers=new Map;moduleRequire;constructor(e){if(this.moduleRequire=this.buildModuleRequire(e),!e)return;let r;try{r=e.getConfig().secrets}catch{return}if(!(!r?.providers||typeof r.providers!="object"))for(let[n,i]of Object.entries(r.providers))try{let s=this.createResolver(i);s&&this.resolvers.set(n,s)}catch{}}async resolveSecretTokens(e,r){let n=r??new Map,i=new Set;if(this.collectTokens(e,i),i.size===0)return{};await Promise.all(Array.from(i).map(async o=>{if(n.has(o))return;let l=o.slice(7),f=l.indexOf("/");if(f<0)return;let c=l.slice(0,f),p=l.slice(f+1),h=this.resolvers.get(c);if(h)try{let g=await h.resolve(p);g!==void 0&&n.set(o,g)}catch(g){let v=g?.message??String(g);console.warn(`[HTTP Forge] {{${o}}} could not be resolved: ${v}`)}}));let s={};for(let[o,l]of n.entries())s[o]=l;return s}get hasProviders(){return this.resolvers.size>0}collectTokens(e,r){if(typeof e=="string"){let n=/\{\{(secret:[^}]+)\}\}/g,i;for(;(i=n.exec(e))!==null;)r.add(i[1])}else Array.isArray(e)?e.forEach(n=>this.collectTokens(n,r)):e!==null&&typeof e=="object"&&Object.values(e).forEach(n=>this.collectTokens(n,r))}createResolver(e){switch(e.provider){case"aws":{let{AwsSecretResolver:r}=(xC(),Ul(N$));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(EC(),Ul(M$));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(IC(),Ul(F$));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(OC(),Ul(D$));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(qC(),Ul(L$));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(kC(),Ul(U$));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>ft(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=H$.resolve(i,"package.json");if(py.existsSync(s)){let o=py.realpathSync(s),l=i5(o);return f=>{try{return l(f)}catch{return r(f)}}}}catch{}return r}}});function br(t){return t.replace(/\//g,"%2F")}function B$(t){return t.replace(/%2F/gi,"/")}function bs(t){return t?t.split("/").map(B$).join(" / "):""}function hy(t){return t.includes(" / ")?t.split(" / ").map(e=>br(e.trim())).join("/"):br(t)}function Xe(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="request")n.push({request:i,folderPath:r});else{let s=i,o=br(s.name),l=r?`${r}/${o}`:o;n.push(...Xe(t,s.items??[],l))}return n}function Qr(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,o=br(s.name),l=r?`${r}/${o}`:o;n.push({folderId:s.id,folderPath:l,requestCount:TC(s.items??[])}),n.push(...Qr(t,s.items??[],l))}return n}function TC(t){let e=0;for(let r of t)r.type==="request"?e++:e+=TC(r.items??[]);return e}var mi=se(()=>{"use strict"});var Jd,AC=se(()=>{"use strict";Jd={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as Mt from"fs";import*as Ro from"path";var Gd,$C=se(()=>{"use strict";mi();Cn();AC();Gd=class{constructor(e,r,n){this.collectionService=e;this.configService=r;this.suitesDir=r.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(){Mt.existsSync(this.suitesDir)||Mt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Mt.watch(this.suitesDir,(e,r)=>{r&&!r.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(),!Mt.existsSync(this.suitesDir))return;let e=Mt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=Ro.join(this.suitesDir,r),i=Mt.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 ${r}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,r=[]){let n=Date.now(),i={id:St(e),name:e,requests:r,config:{...Jd},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,r){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(r,n.requests.map(l=>({...l})));i.config={...n.config},i.description=n.description;let s=Ro.join(this.suitesDir,e),o=Ro.join(this.suitesDir,i.id);return Mt.existsSync(s)&&this.copyDirRecursive(s,o),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Mt.existsSync(r)||Mt.mkdirSync(r,{recursive:!0});for(let n of Mt.readdirSync(e,{withFileTypes:!0})){let i=Ro.join(e,n.name),s=Ro.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Mt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=Ro.join(this.suitesDir,n);try{return Mt.existsSync(i)&&Mt.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let r=this.collectionService.getCollection(e);if(!r){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(r,e,r.name,"",n);let i=Date.now();return{id:`temp-${e}`,name:r.name,requests:n,config:{...Jd},isTemporary:!0,createdAt:i,updatedAt:i}}async createTempSuiteFromFolder(e,r,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 o=r.replace(/\/+$/,""),l=s.filter(p=>n?p.folderPath===o||p.folderPath.startsWith(`${o}/`):p.folderPath===o);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${r}" in collection: ${e}`);return}let f=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(o)}`,name:`${i.name} / ${bs(o)}`,requests:l,config:{...Jd},isTemporary:!0,createdAt:f,updatedAt:f}}slugifyFolderPath(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:St(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],r=this.collectionService.getAllCollections();for(let n of r)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,r,n,i,s){if(e.requests)for(let o of e.requests)s.push({collectionId:r,collectionName:n,requestId:o.id,name:o.name||"Unnamed Request",method:o.method||"GET",folderPath:i});if(e.items)for(let o of e.items)if(o.items||o.folders||o.requests){let l=i?`${i}/${br(o.name)}`:br(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}else s.push({collectionId:r,collectionName:n,requestId:o.id,name:o.name||"Unnamed Request",method:o.method||"GET",folderPath:i});if(e.folders)for(let o of e.folders){let l=i?`${i}/${br(o.name)}`:br(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=Ro.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Mt.writeFileSync(n,i,"utf-8")}}});var ne,my=se(()=>{"use strict";ne={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 V$ from"path";function gy(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:o,secretStore:l,browserService:f,applicationInfo:c,consoleService:p}=e;t.registerValue(ne.WorkspaceFolder,r),t.registerSingleton(ne.Config,()=>new gu(r,n,i)),t.registerSingleton(ne.Console,()=>p??s5),t.registerSingleton(ne.EnvironmentConfig,g=>new Jf(r,s,g.resolve(ne.Config),n,l,e.persistOverrides??!0)),t.registerSingleton(ne.Cookie,()=>new Vf(o)),t.registerSingleton(ne.Collection,g=>new Bf(r,g.resolve(ne.Config),n)),t.registerSingleton(ne.TestSuite,g=>new Gd(g.resolve(ne.Collection),g.resolve(ne.Config))),t.registerSingleton(ne.HttpClient,()=>new fa),t.registerSingleton(ne.UrlBuilder,()=>new Kn),t.registerSingleton(ne.InterceptorChain,()=>new ss),t.registerSingleton(ne.HttpRequest,g=>new is(g.resolve(ne.UrlBuilder),g.resolve(ne.InterceptorChain),g.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new Ca),t.registerSingleton(ne.RequestHistory,g=>{let v=g.resolve(ne.EnvironmentConfig);return new Zf(v.getHistoriesPath(),V$.join(v.getRootPath(),"shared-histories"))}),l&&f&&t.registerSingleton(ne.OAuth2TokenManager,g=>new jf(l,f,g.resolve(ne.EnvironmentConfig),g.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,g=>new Yf(g.resolve(ne.HttpClient))),t.registerSingleton(ne.SecretResolverRegistry,g=>new zd(g.resolve(ne.Config)));let h=c??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,g=>new Gf(g.resolve(ne.EnvironmentConfig),g.resolve(ne.HttpRequest),g.resolve(ne.RequestPreprocessor),g.has(ne.OAuth2TokenManager)?g.resolve(ne.OAuth2TokenManager):void 0,h,g.resolve(ne.SecretResolverRegistry))),t.registerSingleton(ne.ScriptExecutor,g=>{let v=g.resolve(ne.Config);return new cs(g.resolve(ne.HttpRequest),v.getModulePaths(),g.resolve(ne.SecretResolverRegistry),v.getScriptScope(),v.getScriptTimeout())}),t.registerSingleton(ne.DataFileParser,()=>new Ea),t.registerSingleton(ne.CollectionRequestExecutor,g=>new no(g.resolve(ne.HttpRequest),g.resolve(ne.ScriptExecutor),g.resolve(ne.EnvironmentConfig),g.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,g=>new Wf(g.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new go),t.registerSingleton(ne.HistoryAnalyzer,g=>new yu(g.resolve(ne.RequestHistory),g.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new Ju),t.registerSingleton(ne.SchemaInferenceService,g=>new zu(g.resolve(ne.HistoryAnalyzer),g.resolve(ne.ScriptAnalyzer),g.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,g=>new qu(g.resolve(ne.Collection),g.resolve(ne.EnvironmentConfig),g.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,g=>new _o(g.resolve(ne.Collection),g.resolve(ne.EnvironmentConfig)))}var s5,NC=se(()=>{"use strict";s0();c0();d0();p0();h0();g0();Im();y0();v0();x0();ef();tf();Xc();_m();Bl();E0();aR();sy();RC();qg();CC();Rm();Mf();PC();$C();my();s5={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function W$(){return Ba.instance}var Ba,MC=se(()=>{"use strict";my();Ba=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static createFresh(){return new t}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.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(ne.Config)}get console(){return this.resolve(ne.Console)}get environmentConfig(){return this.resolve(ne.EnvironmentConfig)}get collection(){return this.resolve(ne.Collection)}get httpRequest(){return this.resolve(ne.HttpRequest)}get httpClient(){return this.resolve(ne.HttpClient)}get cookie(){return this.resolve(ne.Cookie)}get requestHistory(){return this.resolve(ne.RequestHistory)}get dataFileParser(){return this.resolve(ne.DataFileParser)}get scriptExecutor(){return this.resolve(ne.ScriptExecutor)}get requestPreparer(){return this.resolve(ne.RequestPreparer)}get persistentCookieJar(){return this.resolve(ne.PersistentCookieJar)}get oauth2TokenManager(){return this.has(ne.OAuth2TokenManager)?this.resolve(ne.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(ne.GraphQLSchemaService)}get testSuite(){return this.resolve(ne.TestSuite)}}});function z$(t){return/\{\{[^}]+\}\}/.test(t)}function Yd(t,e=16){return!!t&&t.length>=e&&!z$(t)}function FC(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function Kd(t,e,r,n,i,s=10){let o=t.get(e);o||(o={varName:r,reason:n,occurrences:[],priority:s},t.set(e,o));let l=`${i.requestId}::${i.field}`;o.occurrences.some(f=>`${f.requestId}::${f.field}`===l)||o.occurrences.push(i)}function yy(t,e=1){let r=Xe(t),n=new Map;for(let{request:s}of r){let o=l=>({requestId:s.id,requestName:s.name,field:l});for(let l of s.headers??[]){if(l.enabled===!1)continue;let f=l.key.toLowerCase(),c=l.value;if(f==="authorization"){let p=c.match(/^(bearer|basic|token|digest)\s+(.+)$/i);p&&Yd(p[2])?Kd(n,p[2],`${p[1].toUpperCase()}_TOKEN`,`Authorization ${p[1]} token`,o(`header:${l.key}`),1):Yd(c)&&Kd(n,c,"AUTH_TOKEN","Authorization header value",o(`header:${l.key}`),1)}else o5.has(f)&&Yd(c)?Kd(n,c,FC(l.key),`Sensitive header: ${l.key}`,o(`header:${l.key}`),2):Yd(c,20)&&!c.includes(" ")&&/^[A-Za-z0-9+/=_.-]+$/.test(c)&&Kd(n,c,FC(l.key)||"HEADER_VALUE",`Long opaque value in header: ${l.key}`,o(`header:${l.key}`),5)}for(let l of s.query??[])l.enabled!==!1&&a5.has(l.key.toLowerCase())&&Yd(l.value)&&Kd(n,l.value,FC(l.key),`Sensitive query param: ${l.key}`,o(`query:${l.key}`),2)}let i=new Map;for(let{request:s}of r)if(!(!s.url||z$(s.url)))try{let o=new URL(s.url);if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)){let f=`${o.protocol}//${o.host}`,c=i.get(f)??[];c.push({requestId:s.id,requestName:s.name,field:"url"}),i.set(f,c)}}catch{}for(let[s,o]of i)o.length>=Math.max(e,2)&&!n.has(s)&&n.set(s,{varName:"BASE_URL",reason:`Shared base URL across ${o.length} requests`,occurrences:o,priority:3});return[...n.entries()].filter(([,s])=>s.occurrences.length>=e).sort((s,o)=>s[1].priority-o[1].priority||s[0].localeCompare(o[0])).map(([s,o])=>({varName:o.varName,value:s,reason:o.reason,occurrences:o.occurrences}))}function DC(t,e){let r={};return J$(t,e,r),r}function J$(t,e,r){for(let n of t){if(n.type==="folder"){n.items&&J$(n.items,e,r);continue}let i=n;for(let s of e){let o=`{{${s.varName}}}`;i.url?.includes(s.value)&&(i.url=i.url.split(s.value).join(o),r[s.varName]=(r[s.varName]??0)+1);for(let l of i.headers??[]){let f=l.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);f&&f[2]===s.value?(l.value=`${f[1]} ${o}`,r[s.varName]=(r[s.varName]??0)+1):l.value===s.value&&(l.value=o,r[s.varName]=(r[s.varName]??0)+1)}for(let l of i.query??[])l.value===s.value&&(l.value=o,r[s.varName]=(r[s.varName]??0)+1)}}}var o5,a5,LC=se(()=>{"use strict";mi();o5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),a5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"])});function Ss(t,e){let r={type:"string",description:t};return e.length>0&&(r.enum=[...e]),r}function jC(t,e,r){let n=i=>Ss("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${t}${J.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:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.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"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.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"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.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"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getRequest}`,description:"Get the full details of a single saved request: URL, method, headers, body, auth, and scripts. Use this to inspect a request before editing it, or to read a script before rewriting it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id. Use list_requests to find names."}},required:["collection","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.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)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${J.setVariable}`,description:'Override an environment variable for the current session. In the VS Code extension the change is saved to VS Code workspace storage (survives restarts, but is not in the env JSON file and not source-controlled). In the standalone CLI/core runtime the change is in-memory only and lost when the server restarts. Use set_environment_variable with scope:"permanent" to write to the env JSON file (source-controlled, works in both runtimes).',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"]},annotations:{idempotentHint:!0}},{name:`${t}${J.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"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getRunSummary}`,description:'Get the pass/fail summary of a completed async run (total, passed, failed counts). Use after get_run_status shows "completed". When failures are present the response includes a failedRequests array with full details (method, url, requestBody, status, responseBody, failedTests) and a _nextStep directive. You MUST follow the _nextStep directive immediately \u2014 analyze the failures and provide diagnosis without waiting for the user to ask.',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.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"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.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"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.cancelRun}`,description:'Request cancellation of an in-progress async run. Cancellation is best-effort: the currently-executing HTTP request completes normally, but no further requests in the run are started. The run status changes to "cancelled". Has no effect on runs that are already completed, failed, or cancelled.',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by run_collection, run_folder, or run_suite with async:true."}},required:["runId"]},annotations:{idempotentHint:!0}},{name:`${t}${J.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.'},...vy.properties},required:["collection","request"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.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").'},...Sy.properties},required:["collection","folder"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...by.properties},required:["collection"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:Ss("Name of the test suite to run.",r),...wy.properties},required:["suite"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.createCollection}`,description:"Create a new empty collection.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new collection."}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.renameCollection}`,description:"Rename an existing collection.",inputSchema:{type:"object",properties:{collection:n(!0),newName:{type:"string",description:"New display name for the collection."}},required:["collection","newName"]},annotations:{idempotentHint:!0}},{name:`${t}${J.deleteCollection}`,description:"Permanently delete a collection and all its contents. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.duplicateCollection}`,description:"Clone a collection under a new name (all folders, requests, and scripts are copied).",inputSchema:{type:"object",properties:{collection:n(!0),newName:{type:"string",description:"Name for the duplicated collection."}},required:["collection","newName"]},annotations:{idempotentHint:!1}},{name:`${t}${J.createFolder}`,description:"Create a folder inside a collection (optionally nested inside another folder).",inputSchema:{type:"object",properties:{collection:n(!0),name:{type:"string",description:"Display name for the new folder."},parentFolder:{type:"string",description:"Slash-separated folder path or folder id of the parent. Omit to create at collection root."}},required:["collection","name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.deleteFolder}`,description:"Delete a folder and all its requests. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Slash-separated folder path or folder id to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","folder","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.createRequest}`,description:"Create a new HTTP request inside a collection (optionally inside a folder).",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Folder path or id. Omit to add at collection root."},name:{type:"string",description:"Display name for the request."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],description:"HTTP method."},url:{type:"string",description:"Request URL, may include {{variable}} placeholders."},headers:{type:"object",description:"Key/value header map.",additionalProperties:{type:"string"}},body:{type:"string",description:"Raw request body (JSON, text, etc.)."},description:{type:"string",description:"Human-readable description."}},required:["collection","name","method","url"]},annotations:{idempotentHint:!1}},{name:`${t}${J.updateRequest}`,description:"Update fields on an existing request (partial update \u2014 omit fields to keep current values).",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},name:{type:"string",description:"New display name."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},url:{type:"string"},headers:{type:"object",additionalProperties:{type:"string"}},body:{type:"string"},description:{type:"string"}},required:["collection","request"]},annotations:{idempotentHint:!0}},{name:`${t}${J.deleteRequest}`,description:"Remove a request from a collection. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","request","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.getRequestScript}`,description:"Read the pre-request or post-response script of a request.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},phase:{type:"string",enum:["pre-request","post-response"],description:"Which script phase to read."}},required:["collection","request","phase"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.setRequestScript}`,description:"Write or replace the pre-request or post-response script of a request.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},phase:{type:"string",enum:["pre-request","post-response"],description:"Which script phase to write."},script:{type:"string",description:"Full JavaScript source to write."}},required:["collection","request","phase","script"]},annotations:{idempotentHint:!0}},{name:`${t}${J.reorderCollectionItems}`,description:"Set the execution/display order of direct children of a collection root or folder. Items not listed are appended at the end.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Folder path or id. Omit to reorder collection root."},order:{type:"array",items:{type:"string"},description:"Ordered list of item names or ids."}},required:["collection","order"]},annotations:{idempotentHint:!0}},{name:`${t}${J.listSuites}`,description:"List all test suites with name, id, request count, and configuration summary.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.getSuite}`,description:"Get full details of a test suite including its request list.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the test suite.",r)},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.createSuite}`,description:"Create a new test suite (empty or pre-populated from a collection/folder).",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new suite."},description:{type:"string",description:"Optional description."},fromCollection:{type:"string",description:"Collection name or id to seed the suite from (all requests in execution order)."},fromFolder:{type:"string",description:"Folder path within fromCollection to seed from."},iterations:{type:"number",description:"Number of iterations (default: 1)."},stopOnError:{type:"boolean",description:"Stop on first failure (default: false)."},delayBetweenRequests:{type:"number",description:"Milliseconds delay between requests (default: 0)."}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.updateSuiteConfig}`,description:"Change a suite's name, description, or run configuration.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite to update.",r),name:{type:"string",description:"New display name."},description:{type:"string",description:"New description."},iterations:{type:"number"},stopOnError:{type:"boolean"},delayBetweenRequests:{type:"number"}},required:["suite"]},annotations:{idempotentHint:!0}},{name:`${t}${J.addSuiteRequests}`,description:"Append or insert one or more requests into a suite.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite.",r),requests:{type:"array",items:{type:"object",properties:{collection:{type:"string",description:"Collection name or id."},request:{type:"string",description:"Request name or id."}},required:["collection","request"]},description:"Requests to add."},insertAt:{type:"number",description:"Zero-based index to insert at. Omit to append at end."}},required:["suite","requests"]},annotations:{idempotentHint:!1}},{name:`${t}${J.removeSuiteRequest}`,description:"Remove a request from a suite by position (0-based) or by name.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite.",r),index:{type:"number",description:"Zero-based position in the suite requests list."},request:{type:"string",description:"Request name to remove (used if index is not provided)."}},required:["suite"]},annotations:{destructiveHint:!0}},{name:`${t}${J.reorderSuiteRequests}`,description:"Reorder requests in a suite. Requests not listed are moved to the end.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite.",r),order:{type:"array",items:{type:"string"},description:"Ordered list of request names."}},required:["suite","order"]},annotations:{idempotentHint:!0}},{name:`${t}${J.duplicateSuite}`,description:"Clone an existing suite under a new name.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite to clone.",r),newName:{type:"string",description:"Name for the duplicated suite."}},required:["suite","newName"]},annotations:{idempotentHint:!1}},{name:`${t}${J.deleteSuite}`,description:"Delete a test suite permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite to delete.",r),confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["suite","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.listEnvironments}`,description:"List all environments with their variable keys (values hidden). Use get_environment_variables to see values.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.getEnvironmentVariables}`,description:"Get the resolved (merged file + session overrides) variables for an environment.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${J.selectEnvironment}`,description:"Set the active environment for all subsequent run_* calls in this session.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Name of the environment to activate."}},required:["environment"]},annotations:{idempotentHint:!0}},{name:`${t}${J.createEnvironment}`,description:"Create a new environment file, optionally pre-populated with variables.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Environment name (becomes the filename)."},variables:{type:"object",description:"Initial key/value variable map.",additionalProperties:{type:"string"}}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.deleteEnvironment}`,description:"Delete an environment file permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["environment","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.setEnvironmentVariable}`,description:'Set a variable in an environment. Scope "session" (default) is in-memory only and always temporary (both runtimes). Scope "permanent" writes to the env JSON config file \u2014 source-controlled and shared with the CLI runtime.',inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."},key:{type:"string",description:"Variable name."},value:{type:"string",description:"New value."},scope:{type:"string",enum:["session","permanent"],description:'Storage scope. "permanent" writes to disk.'}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${J.unsetEnvironmentVariable}`,description:"Remove a session-scoped variable override, restoring the file value.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."},key:{type:"string",description:"Variable name to unset."}},required:["key"]},annotations:{idempotentHint:!0}},{name:`${t}${J.setGlobalVariable}`,description:'Set a global variable visible across all environments. Scope "session" (default) is in-memory only and lost on restart (both runtimes). Scope "permanent" writes to _global.json \u2014 source-controlled and shared with the CLI runtime.',inputSchema:{type:"object",properties:{key:{type:"string",description:"Global variable name."},value:{type:"string",description:"Value to set."},scope:{type:"string",enum:["session","permanent"],description:'Storage scope. "permanent" writes to _global.json.'}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${J.getGlobals}`,description:"Return all global variables (merged _global.json + runtime pm.globals.set() values).",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.scaffoldCollectionFromOpenApi}`,description:"Import an OpenAPI 3.0 spec (JSON or YAML) and scaffold a complete HTTP Forge collection from it. All operations become requests grouped by tag/path. An optional environment is created from the server URL. Returns the new collection id and name. Use this to quickly bootstrap API testing from a spec file.",inputSchema:{type:"object",properties:{specPath:{type:"string",description:"Absolute or workspace-relative path to the OpenAPI 3.0 JSON or YAML file."},collectionName:{type:"string",description:"Override the collection name (defaults to the spec title)."},environmentName:{type:"string",description:"Name for the generated environment that contains the server base URL. Omit to skip environment creation."}},required:["specPath"]},annotations:{idempotentHint:!1}},{name:`${t}${J.suggestAssertions}`,description:"Analyse the last execution history for a request and suggest pm.test() assertions to add to its post-response script. Covers status code, response time, required JSON fields, Content-Type header, and schema conformance. Returns an array of ready-to-paste JavaScript test snippets and a rationale for each.",inputSchema:{type:"object",properties:{collection:{type:"string",description:"Collection name or id that owns the request."},request:{type:"string",description:"Request name or id to analyse."},environment:{type:"string",description:"Environment used when the run was recorded (defaults to active environment)."},maxSuggestions:{type:"number",description:"Cap the number of suggestions returned (default: 10)."}},required:["collection","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.explainFailure}`,description:"Explain why a specific request failed in a recent run. Returns the full request (URL, method, headers, body), the response received (status, headers, body), all assertion results, any script errors, and a plain-English diagnosis with suggested fixes. Provide either runId (from a prior run_suite/run_collection call) + request name, or the collection and request names to pull the most recent history entry.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"MCP run id (from run_suite or run_collection). Mutually exclusive with collection+request history lookup."},collection:{type:"string",description:"Collection name or id. Required when runId is omitted."},request:{type:"string",description:"Request name or id."},iteration:{type:"number",description:"Iteration number within the run (default: 1)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${J.suggestEnvVars}`,description:`Scan a collection for hardcoded values (API keys, base URLs, tokens, tenant IDs) that should become environment variables.
278
278
 
279
279
  Returns:
280
280
  \u2022 heuristicSuggestions \u2014 values identified by pattern-matching rules (ready to apply)
@@ -347,7 +347,7 @@ This tool returns request details AND a structured task. You MUST:
347
347
  3. Return the rows as a JSON array under the key "iterationData" \u2014 each row is an object whose keys match the {{variable}} placeholders in the request.
348
348
  4. Respond with the JSON array directly so the user can pass it to run_collection or the CLI --variables flag.
349
349
 
350
- Example: for POST /users with body {"name":"{{name}}","email":"{{email}}"} and iterations=4, generate 4 rows: valid user, duplicate email, missing name, email with invalid format.`,inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name, slug, or id."},iterations:{type:"number",description:"Number of test data rows to generate (default: 5, max: 50)."}},required:["collection","request"]},annotations:{readOnlyHint:!0}}]}var vy,by,Sy,wy,J,Qd=se(()=>{"use strict";vy={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)"}}},by={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)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently, preserving inter-request dependencies."},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."}}},Sy={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)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently."},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."}}},wy={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations (overrides suite default)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently."},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)"}}},J={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",cancelRun:"cancel_run",setVariable:"set_variable",createCollection:"create_collection",renameCollection:"rename_collection",deleteCollection:"delete_collection",duplicateCollection:"duplicate_collection",createFolder:"create_folder",deleteFolder:"delete_folder",getRequest:"get_request",createRequest:"create_request",updateRequest:"update_request",deleteRequest:"delete_request",getRequestScript:"get_request_script",setRequestScript:"set_request_script",reorderCollectionItems:"reorder_collection_items",listSuites:"list_suites",getSuite:"get_suite",createSuite:"create_suite",updateSuiteConfig:"update_suite_config",addSuiteRequests:"add_suite_requests",removeSuiteRequest:"remove_suite_request",reorderSuiteRequests:"reorder_suite_requests",duplicateSuite:"duplicate_suite",deleteSuite:"delete_suite",listEnvironments:"list_environments",getEnvironmentVariables:"get_environment_variables",selectEnvironment:"select_environment",createEnvironment:"create_environment",deleteEnvironment:"delete_environment",setEnvironmentVariable:"set_environment_variable",unsetEnvironmentVariable:"unset_environment_variable",setGlobalVariable:"set_global_variable",getGlobals:"get_globals",scaffoldCollectionFromOpenApi:"scaffold_collection_from_openapi",suggestAssertions:"suggest_assertions",explainFailure:"explain_failure",suggestEnvVars:"suggest_env_vars",applyEnvVars:"apply_env_vars",getRequestsForEnhancement:"get_requests_for_enhancement",applyRequestEnhancements:"apply_request_enhancements",aiSuggestEnvVars:"ai_suggest_env_vars",aiEnhanceCollection:"ai_enhance_collection",analyzeCoverage:"analyze_coverage",aiAnalyzeCoverage:"ai_analyze_coverage",generateRequestFromIntent:"generate_request_from_intent",validateAgainstSpec:"validate_against_spec",generateScenarios:"generate_scenarios",healAssertions:"heal_assertions",generateIterationData:"generate_iteration_data"}});import*as Zd from"fs";import*as Fi from"path";function ge(t){return new Error(`Bad request: ${t}`)}function et(t,e){if(typeof t!="string"||!t.trim())throw ge('the "collection" argument is required');let r=t.toLowerCase(),n=e.find(i=>i.id===t||i.name===t)??e.find(i=>i.name.toLowerCase()===r)??e.find(i=>i.name.toLowerCase().includes(r))??e.find(i=>i.id.toLowerCase().includes(r));if(!n){let i=e.map(s=>`"${s.name}"`).join(", ");throw ge(`collection not found: "${t}". Available collections: ${i||"(none)"}. Call list_collections to see all.`)}return n}function Mi(t,e){if(typeof t!="string"||!t.trim())throw ge('the "request" argument is required');let r=Xe(e),n=t.toLowerCase(),i=r.find(s=>s.request.id===t||s.request.name===t)??r.find(s=>s.request.name.toLowerCase()===n)??r.find(s=>s.request.name.toLowerCase().includes(n));if(!i){let s=r.slice(0,10).map(o=>`"${o.request.name}"`).join(", ");throw ge(`request "${t}" not found in collection "${e.name}". First ${Math.min(r.length,10)} requests: ${s||"(none)"}. Call list_requests or search_requests to find the exact name.`)}return i.request}function G$(t,e){for(let r of t){if(r.type!=="folder")continue;let n=r;if(n.id===e)return n;let i=G$(n.items??[],e);if(i)return i}}async function Va(t,e){if(typeof t!="string"||!t.trim())throw ge('the "suite" argument is required');let r=await e.testSuite.getAllSuites(),n=t.toLowerCase(),i=r.find(s=>s.id===t||s.name===t)??r.find(s=>s.name.toLowerCase()===n);if(!i){let s=r.map(o=>`"${o.name}"`).join(", ");throw ge(`suite "${t}" not found. Available suites: ${s||"(none)"}. Call list_suites to see all.`)}return i}async function HC(t,e,r,n,i){let s=r.collection.getAllCollections();if(t===J.listCollections)return{collections:s.map(c=>({name:c.name,id:c.id,description:c.description??"",requestCount:Xe(c).length}))};if(t===J.listFolders){let c=et(e.collection,s);return{collection:c.name,folders:Qr(c).map(({folderPath:p,requestCount:h})=>({path:bs(p),requestCount:h}))}}if(t===J.listRequests){let c=et(e.collection,s),p=typeof e.folder=="string"?e.folder.toLowerCase():void 0,h=typeof e.offset=="number"?Math.max(0,e.offset):0,g=typeof e.limit=="number"?Math.min(200,Math.max(1,e.limit)):50,v=Xe(c).filter(({folderPath:_})=>!p||_.toLowerCase().includes(p)).map(({request:_,folderPath:w})=>({id:_.id,name:_.name,method:_.method,folder:bs(w),description:_.description??""}));return{collection:c.name,total:v.length,offset:h,limit:g,requests:v.slice(h,h+g)}}if(t===J.searchRequests){let c=et(e.collection,s),p=typeof e.query=="string"?e.query.toLowerCase().trim():"";if(!p)throw ge('the "query" argument is required');let h=Xe(c).filter(({request:g,folderPath:v})=>g.name.toLowerCase().includes(p)||(g.url??"").toLowerCase().includes(p)||g.method.toLowerCase().includes(p)||v.toLowerCase().includes(p)||(g.description??"").toLowerCase().includes(p)).map(({request:g,folderPath:v})=>({id:g.id,name:g.name,method:g.method,url:g.url??"",folder:bs(v),description:g.description??""}));return{collection:c.name,query:e.query,total:h.length,requests:h}}if(t===J.getRequest){let c=et(e.collection,s),p=Mi(e.request,c),h=r.collection.getRequestScript(c.id,p.id,"pre-request")??"",g=r.collection.getRequestScript(c.id,p.id,"post-response")??"";return{id:p.id,name:p.name,method:p.method,url:p.url??"",description:p.description??"",headers:p.headers??[],body:p.body??null,auth:p.auth??null,scripts:{preRequest:h,postResponse:g},hint:"Use update_request to modify fields, set_request_script to modify scripts, or run_request to execute it."}}if(t===J.getEnvironment){let c=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),p=r.environmentConfig.getResolvedEnvironment(c);if(!p)throw ge(`environment "${c}" not found`);return{name:p.name,variables:p.variables}}if(t===J.setVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ge('"key" is required');let h=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.setEnvironmentVariable(c,p,h),{set:!0,key:c,environment:h}}if(t===J.getRunStatus){let c=n.require(e.runId);return{runId:c.id,status:c.status,suiteName:c.suiteName,progress:c.progress,...c.error?{error:c.error}:{}}}if(t===J.getRunSummary){let c=n.require(e.runId);if(c.status==="running")return{runId:c.id,status:"running",progress:c.progress};let p=(c.summary.failed??0)>0||c.summary.allPassed===!1,h=c.noAssertionExamples??[],g=h.length,v=c.summary.total,_=g>0?g/(v||1)>.5?`${g}/${v} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${c.suiteName}") for a full coverage analysis.`:`${g} request(s) have no pm.test() assertions (e.g. ${h.slice(0,3).map(w=>`"${w}"`).join(", ")}). Invoke the "suggest-assertions" prompt (collection="${c.suiteName}") to add test coverage.`:null;return{runId:c.id,status:c.status,suiteName:c.suiteName,summary:c.summary,...c.reportPath?{report:{uri:`file://${c.reportPath}`}}:{},...p?{failedRequests:c.failedRequests}:{},...p?{_nextStep:`REQUIRED ACTION: ${c.summary.failed} request(s) failed. The failedRequests array above contains the full details (method, url, requestBody, requestHeaders, status, responseBody, failedTests). Immediately analyze each failed request and provide: (1) root cause, (2) specific fix, (3) corrected pm.test() assertions if relevant. Do NOT wait for the user to ask \u2014 diagnose now.`}:{},..._?{_suggestions:[_]}:{}}}if(t===J.getFailedRequests){let c=n.require(e.runId);if(c.status==="running")return{runId:c.id,status:"running",progress:c.progress,failedSoFar:c.failedRequests.length};let p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(100,Math.max(1,e.limit)):20;return{runId:c.id,status:c.status,totalFailed:c.failedRequests.length,offset:p,limit:h,failedRequests:c.failedRequests.slice(p,p+h)}}if(t===J.getRequestResult){let c=n.require(e.runId),p=e.request;if(typeof p!="string"||!p)throw ge('"request" is required');let h=typeof e.iteration=="number"?e.iteration:1,g=c.allResults.find(v=>v.iteration===h&&(v.name===p||v.name.toLowerCase()===p.toLowerCase()));if(!g){if(c.status==="running")return{runId:c.id,status:"running",message:`Request "${p}" has not completed yet.`};throw new Error(`Request "${p}" (iteration ${h}) not found in run "${c.id}".`)}return{runId:c.id,...g}}if(t===J.cancelRun){let c=n.require(e.runId);if(c.status!=="running")return{runId:c.id,status:c.status,cancelled:!1,message:`Run is already "${c.status}" \u2014 nothing to cancel.`};let p=n.cancel(String(e.runId));return{runId:c.id,status:"cancelled",cancelled:p,progress:c.progress,message:"Cancellation requested. The currently-executing request will finish; remaining requests will be skipped."}}if(t===J.runRequest){let c=et(e.collection,s),p=Xe(c),h=typeof e.requestId=="string"?e.requestId.trim():void 0,g=e.request,v;if(h){if(v=p.find(_=>_.request.id===h),!v)throw ge(`request with id "${h}" not found in collection "${c.name}"`)}else{if(typeof g!="string"||!g.trim())throw ge('the "request" or "requestId" argument is required');if(v=p.find(_=>_.request.name===g)??p.find(_=>_.request.name.toLowerCase()===g.toLowerCase()),!v)throw ge(`request "${g}" not found in collection "${c.name}"`)}return i.runRequest(c,v.request.id,e)}if(t===J.runFolder){let c=et(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ge('the "folder" argument is required');let p=e.folder.toLowerCase(),h=hy(e.folder),g=h.toLowerCase(),v=Qr(c).map(w=>w.folderPath),_=v.find(w=>w===h)??v.find(w=>w.toLowerCase()===g)??v.find(w=>w.toLowerCase().includes(g))??v.find(w=>w.split("/").some(E=>E.toLowerCase().includes(g)));if(!_){let w=v.map(E=>`"${E}"`).join(", ");throw ge(`folder "${e.folder}" not found in collection "${c.name}". Available folders: ${w||"(none)"}. Call list_folders to see all.`)}return i.runFolder(c,_,e)}if(t===J.runCollection){let c=et(e.collection,s);return i.runCollection(c,e)}if(t===J.createCollection){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ge('"name" is required');let p=await r.collection.createCollection(c);return{id:p.id,name:p.name,created:!0,hint:"Collection is empty. Call create_folder to add folders, or create_request to add requests directly."}}if(t===J.renameCollection){let c=et(e.collection,s),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ge('"newName" is required');return await r.collection.renameCollection(c.id,p),{id:c.id,oldName:c.name,newName:p,renamed:!0}}if(t===J.deleteCollection){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a collection');let c=et(e.collection,s);return await r.collection.deleteCollection(c.id),{deleted:!0,collection:c.name}}if(t===J.duplicateCollection){let c=et(e.collection,s),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ge('"newName" is required');let h=await r.collection.duplicateCollection(c.id,p);return{id:h.id,name:h.name,duplicatedFrom:c.name}}if(t===J.createFolder){let c=et(e.collection,s),p=typeof e.name=="string"?e.name.trim():"";if(!p)throw ge('"name" is required');let h;if(typeof e.parentFolder=="string"&&e.parentFolder.trim()){let v=e.parentFolder.toLowerCase(),_=Qr(c);if(Xe(c).map(E=>E.folderPath)&&_.find(E=>E.folderPath===e.parentFolder||E.folderPath.toLowerCase()===v)){let k=Qr(c).find(T=>T.folderPath===e.parentFolder||T.folderPath.toLowerCase()===v);if(k){let T=c.items,N=(j,G)=>{for(let O of j)if(O.type==="folder"){let C=O;if(C.name===G||G.endsWith("/"+C.name))return C;let A=N(C.items??[],G);if(A)return A}};h=N(T,k.folderPath)?.id}}}let g=await r.collection.createFolder({collectionId:c.id,name:p,parentId:h});return{id:g.id,name:g.name,created:!0,collection:c.name}}if(t===J.deleteFolder){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a folder');let c=et(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ge('"folder" is required');let p=e.folder.toLowerCase(),h=Qr(c).find(_=>_.folderPath===e.folder||_.folderPath.toLowerCase()===p);if(!h)throw ge(`folder "${e.folder}" not found in collection "${c.name}"`);let g=G$(c.items,h.folderId);if(!g)throw ge(`folder "${e.folder}" could not be resolved`);let v=h.requestCount;return await r.collection.deleteFolder(c.id,g.id),{deleted:!0,folder:h.folderPath,requestsRemoved:v}}if(t===J.createRequest){let c=et(e.collection,s),p=typeof e.name=="string"?e.name.trim():"";if(!p)throw ge('"name" is required');let h=typeof e.method=="string"?e.method.toUpperCase():"GET",g=typeof e.url=="string"?e.url:"";if(!g)throw ge('"url" is required');let v;if(typeof e.folder=="string"&&e.folder.trim()){let E=e.folder.toLowerCase(),k=Qr(c).find(T=>T.folderPath===e.folder||T.folderPath.toLowerCase()===E);k&&(v=k.folderId)}let _={collectionId:c.id,parentId:v,name:p,method:h,url:g,headers:void 0,body:e.body?{type:"raw",raw:String(e.body),contentType:"application/json"}:void 0,description:typeof e.description=="string"?e.description:void 0},w=await r.collection.createRequest(_);return{id:w.id,name:w.name,created:!0,collection:c.name,hint:"Request created. Call run_request to execute it, or set_request_script to add pre-request/post-response scripts."}}if(t===J.updateRequest){let c=et(e.collection,s),p=Mi(e.request,c),h={};return typeof e.name=="string"&&(h.name=e.name),typeof e.method=="string"&&(h.method=e.method.toUpperCase()),typeof e.url=="string"&&(h.url=e.url),e.headers&&typeof e.headers=="object"&&!Array.isArray(e.headers)&&(h.headers=Object.entries(e.headers).map(([g,v])=>({name:g,value:String(v),enabled:!0}))),typeof e.body=="string"&&(h.body={type:"raw",raw:e.body,contentType:"application/json"}),typeof e.description=="string"&&(h.description=e.description),await r.collection.updateRequest(c.id,p.id,h),{updated:!0,request:p.name}}if(t===J.deleteRequest){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a request');let c=et(e.collection,s),p=Mi(e.request,c);return await r.collection.deleteRequest(c.id,p.id),{deleted:!0,request:p.name}}if(t===J.getRequestScript){let c=et(e.collection,s),p=Mi(e.request,c),h=e.phase;if(h!=="pre-request"&&h!=="post-response")throw ge('"phase" must be "pre-request" or "post-response"');let g=r.collection.getRequestScript(c.id,p.id,h);return{collection:c.name,request:p.name,phase:h,script:g??""}}if(t===J.setRequestScript){let c=et(e.collection,s),p=Mi(e.request,c),h=e.phase;if(h!=="pre-request"&&h!=="post-response")throw ge('"phase" must be "pre-request" or "post-response"');if(typeof e.script!="string")throw ge('"script" is required');return await r.collection.setRequestScript(c.id,p.id,h,e.script),{updated:!0,collection:c.name,request:p.name,phase:h}}if(t===J.reorderCollectionItems){let c=et(e.collection,s);if(!Array.isArray(e.order))throw ge('"order" must be an array');let p;if(typeof e.folder=="string"&&e.folder.trim()){let v=e.folder.toLowerCase(),_=Qr(c).find(w=>w.folderPath===e.folder||w.folderPath.toLowerCase()===v);if(!_)throw ge(`folder "${e.folder}" not found in collection "${c.name}"`);p=_.folderId}let h=p?c.items.find(v=>v.id===p)?.items??[]:c.items,g=e.order.map(v=>h.find(w=>w.id===v||w.name===v)?.id??v);return await r.collection.reorderItems(c.id,p,g),{reordered:!0,collection:c.name,order:e.order}}if(t===J.listSuites)return{suites:(await r.testSuite.getAllSuites()).map(p=>({id:p.id,name:p.name,description:p.description??"",requestCount:p.requests.length,iterations:p.config?.iterations??1}))};if(t===J.getSuite){let c=await Va(e.suite,r);return{id:c.id,name:c.name,description:c.description??"",config:{iterations:c.config?.iterations??1,delayBetweenRequests:c.config?.delayBetweenRequests??0,stopOnError:c.config?.stopOnError??!1},requests:c.requests.map(p=>({slug:p.slug??p.requestId,collectionId:p.collectionId,requestId:p.requestId,name:p.name,method:p.method,folderPath:p.folderPath??"",enabled:p.enabled!==!1}))}}if(t===J.createSuite){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ge('"name" is required');let p;if(typeof e.fromCollection=="string"&&e.fromCollection.trim()){let h=et(e.fromCollection,s),g=await r.testSuite.createTempSuiteFromCollection(h.id);if(!g)throw new Error(`Could not build suite from collection "${h.name}"`);if(typeof e.fromFolder=="string"&&e.fromFolder.trim()){let v=hy(e.fromFolder),_=g.requests.filter(w=>w.folderPath===v||w.folderPath.startsWith(`${v}/`));g.requests=_}p=await r.testSuite.saveTempSuite(g,c)}else p=await r.testSuite.createSuite(c);return(e.iterations!==void 0||e.stopOnError!==void 0||e.delayBetweenRequests!==void 0||e.description!==void 0)&&(e.description!==void 0&&(p.description=String(e.description)),p.config={...p.config,...typeof e.iterations=="number"?{iterations:e.iterations}:{},...typeof e.stopOnError=="boolean"?{stopOnError:e.stopOnError}:{},...typeof e.delayBetweenRequests=="number"?{delayBetweenRequests:e.delayBetweenRequests}:{}},await r.testSuite.updateSuite(p)),{id:p.id,name:p.name,requestCount:p.requests.length,created:!0,hint:p.requests.length===0?"Suite is empty. Call add_suite_requests to populate it with requests from a collection.":"Suite created. Call run_suite to execute it."}}if(t===J.updateSuiteConfig){let c=await Va(e.suite,r);return typeof e.name=="string"&&e.name.trim()&&(c.name=e.name.trim()),typeof e.description=="string"&&(c.description=e.description),c.config={...c.config,...typeof e.iterations=="number"?{iterations:e.iterations}:{},...typeof e.stopOnError=="boolean"?{stopOnError:e.stopOnError}:{},...typeof e.delayBetweenRequests=="number"?{delayBetweenRequests:e.delayBetweenRequests}:{}},await r.testSuite.updateSuite(c),{updated:!0,suite:c.name}}if(t===J.addSuiteRequests){let c=await Va(e.suite,r),p=Array.isArray(e.requests)?e.requests:[];if(p.length===0)throw ge('"requests" array is required and must not be empty');let h=[];for(let v of p){let _=et(v.collection,s),w=Mi(v.request,_),E=Xe(_).find(k=>k.request.id===w.id)?.folderPath??"";h.push({slug:w.id,collectionId:_.id,requestId:w.id,name:w.name,method:w.method,collectionName:_.name,folderPath:E,enabled:!0})}let g=typeof e.insertAt=="number"?Math.max(0,e.insertAt):void 0;return g!==void 0&&g<c.requests.length?c.requests.splice(g,0,...h):c.requests.push(...h),await r.testSuite.updateSuite(c),{added:h.length,suite:c.name,newRequestCount:c.requests.length}}if(t===J.removeSuiteRequest){let c=await Va(e.suite,r),p;if(typeof e.index=="number"){if(e.index<0||e.index>=c.requests.length)throw ge(`index ${e.index} is out of range`);let[h]=c.requests.splice(e.index,1);p=h.name}else if(typeof e.request=="string"){let h=e.request.toLowerCase(),g=c.requests.findIndex(v=>v.name===e.request||v.name.toLowerCase()===h);if(g===-1)throw ge(`request "${e.request}" not found in suite "${c.name}"`);p=c.requests.splice(g,1)[0].name}else throw ge('either "index" or "request" is required');return await r.testSuite.updateSuite(c),{removed:!0,request:p,newRequestCount:c.requests.length}}if(t===J.reorderSuiteRequests){let c=await Va(e.suite,r);if(!Array.isArray(e.order))throw ge('"order" must be an array of request names');let p=e.order,h=[...c.requests].sort((g,v)=>{let _=p.findIndex(T=>T===g.name||T.toLowerCase()===g.name.toLowerCase()),w=p.findIndex(T=>T===v.name||T.toLowerCase()===v.name.toLowerCase());return(_===-1?1/0:_)-(w===-1?1/0:w)});return c.requests=h,await r.testSuite.updateSuite(c),{reordered:!0,suite:c.name,newOrder:c.requests.map(g=>g.name)}}if(t===J.duplicateSuite){let c=await Va(e.suite,r),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ge('"newName" is required');let h=await r.testSuite.duplicateSuite(c.id,p);return{id:h.id,name:h.name,duplicatedFrom:c.name,requestCount:h.requests.length}}if(t===J.deleteSuite){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a suite');let c=await Va(e.suite,r);return await r.testSuite.deleteSuite(c.id),{deleted:!0,suite:c.name}}if(t===J.listEnvironments){let c=r.environmentConfig.getAllEnvironments(),p=r.environmentConfig.getSelectedEnvironment();return{environments:c.map(h=>({name:h.name,active:h.active,variableKeys:Object.keys(h.variables)})),active:p}}if(t===J.getEnvironmentVariables){let c=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),p=r.environmentConfig.getResolvedEnvironment(c);if(!p)throw ge(`environment "${c}" not found`);let g=r.environmentConfig.getSharedConfig()?.environments?.[c]?.variables??{},v=r.environmentConfig.getEnvironmentVariableLocals();return{environment:c,active:r.environmentConfig.getSelectedEnvironment()===c,fileVariables:g,sessionOverrides:v,resolved:p.variables}}if(t===J.selectEnvironment){let c=typeof e.environment=="string"?e.environment.trim():"";if(!c)throw ge('"environment" is required');return await r.environmentConfig.setSelectedEnvironment(c),{selected:!0,environment:c}}if(t===J.createEnvironment){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ge('"name" is required');if(await r.environmentConfig.createEnvironment(c),e.variables&&typeof e.variables=="object"){let p=e.variables,h=r.environmentConfig.getSharedConfig();h&&(h.environments=h.environments??{},h.environments[c]={...h.environments[c]??{},variables:{...h.environments[c]?.variables??{},...p}},r.environmentConfig.saveSharedConfig(h))}return{created:!0,environment:c}}if(t===J.deleteEnvironment){if(e.confirm!==!0)throw ge('"confirm" must be true to delete an environment');let c=typeof e.environment=="string"?e.environment.trim():"";if(!c)throw ge('"environment" is required');let p=r.environmentConfig.getSelectedEnvironment();return await r.environmentConfig.deleteEnvironment(c),{deleted:!0,environment:c,newActive:p===c?void 0:p}}if(t===J.setEnvironmentVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ge('"key" is required');let h=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),g=e.scope==="permanent"?"permanent":"session";if(g==="permanent"){let v=r.environmentConfig.getSharedConfig();v&&(v.environments=v.environments??{},v.environments[h]=v.environments[h]??{variables:{}},v.environments[h].variables=v.environments[h].variables??{},v.environments[h].variables[c]=p,r.environmentConfig.saveSharedConfig(v))}else r.environmentConfig.setEnvironmentVariable(c,p,h);return{set:!0,key:c,environment:h,scope:g}}if(t===J.unsetEnvironmentVariable){let c=typeof e.key=="string"?e.key.trim():"";if(!c)throw ge('"key" is required');let p=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.deleteEnvironmentVariable(c,p),{unset:!0,key:c,environment:p}}if(t===J.setGlobalVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ge('"key" is required');let h=e.scope==="permanent"?"permanent":"session";if(h==="permanent"){let g=r.environmentConfig.getSharedConfig();g&&(g.globalVariables=g.globalVariables??{},g.globalVariables[c]=p,r.environmentConfig.saveSharedConfig(g))}else r.environmentConfig.setGlobalVariable(c,p);return{set:!0,key:c,scope:h}}if(t===J.getGlobals)return{globals:r.environmentConfig.getGlobalVariables()};if(t===J.scaffoldCollectionFromOpenApi){let c=typeof e.specPath=="string"?e.specPath.trim():"";if(!c)throw ge('"specPath" is required');let p=r.workspaceFolder&&!Fi.isAbsolute(c)?Fi.join(r.workspaceFolder,c):c;if(!Zd.existsSync(p))throw ge(`OpenAPI spec file not found: "${p}"`);let g=await new _o(r.collection,r.environmentConfig).import(p,{collectionName:typeof e.collectionName=="string"?e.collectionName:void 0,environmentName:typeof e.environmentName=="string"?e.environmentName:void 0});return{collectionId:g.collection.id,collectionName:g.collection.name,requestCount:g.collection.items.filter(v=>v.type==="request").length,environmentCreated:g.environmentCreated??null,hint:"Use list_requests to browse the scaffolded collection, then run_request to test individual endpoints."}}if(t===J.suggestAssertions){let c=e.collection;if(!(typeof e.request=="string"?e.request.trim():""))throw ge('"request" is required');let h=et(c,s),g=Mi(e.request,h),v=typeof e.maxSuggestions=="number"?Math.min(20,Math.max(1,e.maxSuggestions)):10,_=[],E=Array.from(n.values()).filter($=>$.status!=="running").flatMap($=>$.allResults??[]).filter($=>$.name===g.name||typeof $.name=="string"&&$.name.toLowerCase()===g.name.toLowerCase()),k=E[E.length-1],T=k?.status;T?_.push({snippet:`pm.test("Status code is ${T}", function () {
350
+ Example: for POST /users with body {"name":"{{name}}","email":"{{email}}"} and iterations=4, generate 4 rows: valid user, duplicate email, missing name, email with invalid format.`,inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name, slug, or id."},iterations:{type:"number",description:"Number of test data rows to generate (default: 5, max: 50)."}},required:["collection","request"]},annotations:{readOnlyHint:!0}}]}var vy,by,Sy,wy,J,Qd=se(()=>{"use strict";vy={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)"}}},by={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)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently, preserving inter-request dependencies."},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."}}},Sy={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)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently."},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."}}},wy={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations (overrides suite default)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently."},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)"}}},J={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",cancelRun:"cancel_run",setVariable:"set_variable",createCollection:"create_collection",renameCollection:"rename_collection",deleteCollection:"delete_collection",duplicateCollection:"duplicate_collection",createFolder:"create_folder",deleteFolder:"delete_folder",getRequest:"get_request",createRequest:"create_request",updateRequest:"update_request",deleteRequest:"delete_request",getRequestScript:"get_request_script",setRequestScript:"set_request_script",reorderCollectionItems:"reorder_collection_items",listSuites:"list_suites",getSuite:"get_suite",createSuite:"create_suite",updateSuiteConfig:"update_suite_config",addSuiteRequests:"add_suite_requests",removeSuiteRequest:"remove_suite_request",reorderSuiteRequests:"reorder_suite_requests",duplicateSuite:"duplicate_suite",deleteSuite:"delete_suite",listEnvironments:"list_environments",getEnvironmentVariables:"get_environment_variables",selectEnvironment:"select_environment",createEnvironment:"create_environment",deleteEnvironment:"delete_environment",setEnvironmentVariable:"set_environment_variable",unsetEnvironmentVariable:"unset_environment_variable",setGlobalVariable:"set_global_variable",getGlobals:"get_globals",scaffoldCollectionFromOpenApi:"scaffold_collection_from_openapi",suggestAssertions:"suggest_assertions",explainFailure:"explain_failure",suggestEnvVars:"suggest_env_vars",applyEnvVars:"apply_env_vars",getRequestsForEnhancement:"get_requests_for_enhancement",applyRequestEnhancements:"apply_request_enhancements",aiSuggestEnvVars:"ai_suggest_env_vars",aiEnhanceCollection:"ai_enhance_collection",analyzeCoverage:"analyze_coverage",aiAnalyzeCoverage:"ai_analyze_coverage",generateRequestFromIntent:"generate_request_from_intent",validateAgainstSpec:"validate_against_spec",generateScenarios:"generate_scenarios",healAssertions:"heal_assertions",generateIterationData:"generate_iteration_data"}});import*as Zd from"fs";import*as Fi from"path";function ge(t){return new Error(`Bad request: ${t}`)}function et(t,e){if(typeof t!="string"||!t.trim())throw ge('the "collection" argument is required');let r=t.toLowerCase(),n=e.find(i=>i.id===t||i.name===t)??e.find(i=>i.name.toLowerCase()===r)??e.find(i=>i.name.toLowerCase().includes(r))??e.find(i=>i.id.toLowerCase().includes(r));if(!n){let i=e.map(s=>`"${s.name}"`).join(", ");throw ge(`collection not found: "${t}". Available collections: ${i||"(none)"}. Call list_collections to see all.`)}return n}function Mi(t,e){if(typeof t!="string"||!t.trim())throw ge('the "request" argument is required');let r=Xe(e),n=t.toLowerCase(),i=r.find(s=>s.request.id===t||s.request.name===t)??r.find(s=>s.request.name.toLowerCase()===n)??r.find(s=>s.request.name.toLowerCase().includes(n));if(!i){let s=r.slice(0,10).map(o=>`"${o.request.name}"`).join(", ");throw ge(`request "${t}" not found in collection "${e.name}". First ${Math.min(r.length,10)} requests: ${s||"(none)"}. Call list_requests or search_requests to find the exact name.`)}return i.request}function G$(t,e){for(let r of t){if(r.type!=="folder")continue;let n=r;if(n.id===e)return n;let i=G$(n.items??[],e);if(i)return i}}async function Va(t,e){if(typeof t!="string"||!t.trim())throw ge('the "suite" argument is required');let r=await e.testSuite.getAllSuites(),n=t.toLowerCase(),i=r.find(s=>s.id===t||s.name===t)??r.find(s=>s.name.toLowerCase()===n);if(!i){let s=r.map(o=>`"${o.name}"`).join(", ");throw ge(`suite "${t}" not found. Available suites: ${s||"(none)"}. Call list_suites to see all.`)}return i}async function HC(t,e,r,n,i){let s=r.collection.getAllCollections();if(t===J.listCollections)return{collections:s.map(c=>({name:c.name,id:c.id,description:c.description??"",requestCount:Xe(c).length}))};if(t===J.listFolders){let c=et(e.collection,s);return{collection:c.name,folders:Qr(c).map(({folderPath:p,requestCount:h})=>({path:bs(p),requestCount:h}))}}if(t===J.listRequests){let c=et(e.collection,s),p=typeof e.folder=="string"?e.folder.toLowerCase():void 0,h=typeof e.offset=="number"?Math.max(0,e.offset):0,g=typeof e.limit=="number"?Math.min(200,Math.max(1,e.limit)):50,v=Xe(c).filter(({folderPath:_})=>!p||_.toLowerCase().includes(p)).map(({request:_,folderPath:w})=>({id:_.id,name:_.name,method:_.method,folder:bs(w),description:_.description??""}));return{collection:c.name,total:v.length,offset:h,limit:g,requests:v.slice(h,h+g)}}if(t===J.searchRequests){let c=et(e.collection,s),p=typeof e.query=="string"?e.query.toLowerCase().trim():"";if(!p)throw ge('the "query" argument is required');let h=Xe(c).filter(({request:g,folderPath:v})=>g.name.toLowerCase().includes(p)||(g.url??"").toLowerCase().includes(p)||g.method.toLowerCase().includes(p)||v.toLowerCase().includes(p)||(g.description??"").toLowerCase().includes(p)).map(({request:g,folderPath:v})=>({id:g.id,name:g.name,method:g.method,url:g.url??"",folder:bs(v),description:g.description??""}));return{collection:c.name,query:e.query,total:h.length,requests:h}}if(t===J.getRequest){let c=et(e.collection,s),p=Mi(e.request,c),h=r.collection.getRequestScript(c.id,p.id,"pre-request")??"",g=r.collection.getRequestScript(c.id,p.id,"post-response")??"";return{id:p.id,name:p.name,method:p.method,url:p.url??"",description:p.description??"",headers:p.headers??[],body:p.body??null,auth:p.auth??null,scripts:{preRequest:h,postResponse:g},hint:"Use update_request to modify fields, set_request_script to modify scripts, or run_request to execute it."}}if(t===J.getEnvironment){let c=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),p=r.environmentConfig.getResolvedEnvironment(c);if(!p)throw ge(`environment "${c}" not found`);return{name:p.name,variables:p.variables}}if(t===J.setVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ge('"key" is required');let h=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.setEnvironmentVariable(c,p,h),{set:!0,key:c,environment:h}}if(t===J.getRunStatus){let c=n.require(e.runId);return{runId:c.id,status:c.status,suiteName:c.suiteName,progress:c.progress,...c.error?{error:c.error}:{}}}if(t===J.getRunSummary){let c=n.require(e.runId);if(c.status==="running")return{runId:c.id,status:"running",progress:c.progress};let p=(c.summary.failed??0)>0||c.summary.allPassed===!1,h=c.noAssertionExamples??[],g=h.length,v=c.summary.total,_=g>0?g/(v||1)>.5?`${g}/${v} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${c.suiteName}") for a full coverage analysis.`:`${g} request(s) have no pm.test() assertions (e.g. ${h.slice(0,3).map(w=>`"${w}"`).join(", ")}). Invoke the "suggest-assertions" prompt (collection="${c.suiteName}") to add test coverage.`:null;return{runId:c.id,status:c.status,suiteName:c.suiteName,summary:c.summary,...c.reportPath?{report:{uri:`file://${c.reportPath}`}}:{},...p?{failedRequests:c.failedRequests}:{},...p?{_nextStep:`REQUIRED ACTION: ${c.summary.failed} request(s) failed. The failedRequests array above contains the full details (method, url, requestBody, requestHeaders, status, responseBody, failedTests). Immediately analyze each failed request and provide: (1) root cause, (2) specific fix, (3) corrected pm.test() assertions if relevant. Do NOT wait for the user to ask \u2014 diagnose now.`}:{},..._?{_suggestions:[_]}:{}}}if(t===J.getFailedRequests){let c=n.require(e.runId);if(c.status==="running")return{runId:c.id,status:"running",progress:c.progress,failedSoFar:c.failedRequests.length};let p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(100,Math.max(1,e.limit)):20;return{runId:c.id,status:c.status,totalFailed:c.failedRequests.length,offset:p,limit:h,failedRequests:c.failedRequests.slice(p,p+h)}}if(t===J.getRequestResult){let c=n.require(e.runId),p=e.request;if(typeof p!="string"||!p)throw ge('"request" is required');let h=typeof e.iteration=="number"?e.iteration:1,g=c.allResults.find(v=>v.iteration===h&&(v.name===p||v.name.toLowerCase()===p.toLowerCase()));if(!g){if(c.status==="running")return{runId:c.id,status:"running",message:`Request "${p}" has not completed yet.`};throw new Error(`Request "${p}" (iteration ${h}) not found in run "${c.id}".`)}return{runId:c.id,...g}}if(t===J.cancelRun){let c=n.require(e.runId);if(c.status!=="running")return{runId:c.id,status:c.status,cancelled:!1,message:`Run is already "${c.status}" \u2014 nothing to cancel.`};let p=n.cancel(String(e.runId));return{runId:c.id,status:"cancelled",cancelled:p,progress:c.progress,message:"Cancellation requested. The currently-executing request will finish; remaining requests will be skipped."}}if(t===J.runRequest){let c=et(e.collection,s),p=Xe(c),h=typeof e.requestId=="string"?e.requestId.trim():void 0,g=e.request,v;if(h){if(v=p.find(_=>_.request.id===h),!v)throw ge(`request with id "${h}" not found in collection "${c.name}"`)}else{if(typeof g!="string"||!g.trim())throw ge('the "request" or "requestId" argument is required');if(v=p.find(_=>_.request.name===g)??p.find(_=>_.request.name.toLowerCase()===g.toLowerCase()),!v)throw ge(`request "${g}" not found in collection "${c.name}"`)}return i.runRequest(c,v.request.id,e)}if(t===J.runFolder){let c=et(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ge('the "folder" argument is required');let p=e.folder.toLowerCase(),h=hy(e.folder),g=h.toLowerCase(),v=Qr(c).map(w=>w.folderPath),_=v.find(w=>w===h)??v.find(w=>w.toLowerCase()===g)??v.find(w=>w.toLowerCase().includes(g))??v.find(w=>w.split("/").some(E=>E.toLowerCase().includes(g)));if(!_){let w=v.map(E=>`"${E}"`).join(", ");throw ge(`folder "${e.folder}" not found in collection "${c.name}". Available folders: ${w||"(none)"}. Call list_folders to see all.`)}return i.runFolder(c,_,e)}if(t===J.runCollection){let c=et(e.collection,s);return i.runCollection(c,e)}if(t===J.createCollection){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ge('"name" is required');let p=await r.collection.createCollection(c);return{id:p.id,name:p.name,created:!0,hint:"Collection is empty. Call create_folder to add folders, or create_request to add requests directly."}}if(t===J.renameCollection){let c=et(e.collection,s),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ge('"newName" is required');return await r.collection.renameCollection(c.id,p),{id:c.id,oldName:c.name,newName:p,renamed:!0}}if(t===J.deleteCollection){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a collection');let c=et(e.collection,s);return await r.collection.deleteCollection(c.id),{deleted:!0,collection:c.name}}if(t===J.duplicateCollection){let c=et(e.collection,s),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ge('"newName" is required');let h=await r.collection.duplicateCollection(c.id,p);return{id:h.id,name:h.name,duplicatedFrom:c.name}}if(t===J.createFolder){let c=et(e.collection,s),p=typeof e.name=="string"?e.name.trim():"";if(!p)throw ge('"name" is required');let h;if(typeof e.parentFolder=="string"&&e.parentFolder.trim()){let v=e.parentFolder.toLowerCase(),_=Qr(c);if(Xe(c).map(E=>E.folderPath)&&_.find(E=>E.folderPath===e.parentFolder||E.folderPath.toLowerCase()===v)){let k=Qr(c).find(T=>T.folderPath===e.parentFolder||T.folderPath.toLowerCase()===v);if(k){let T=c.items,N=(j,G)=>{for(let q of j)if(q.type==="folder"){let C=q;if(C.name===G||G.endsWith("/"+C.name))return C;let A=N(C.items??[],G);if(A)return A}};h=N(T,k.folderPath)?.id}}}let g=await r.collection.createFolder({collectionId:c.id,name:p,parentId:h});return{id:g.id,name:g.name,created:!0,collection:c.name}}if(t===J.deleteFolder){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a folder');let c=et(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ge('"folder" is required');let p=e.folder.toLowerCase(),h=Qr(c).find(_=>_.folderPath===e.folder||_.folderPath.toLowerCase()===p);if(!h)throw ge(`folder "${e.folder}" not found in collection "${c.name}"`);let g=G$(c.items,h.folderId);if(!g)throw ge(`folder "${e.folder}" could not be resolved`);let v=h.requestCount;return await r.collection.deleteFolder(c.id,g.id),{deleted:!0,folder:h.folderPath,requestsRemoved:v}}if(t===J.createRequest){let c=et(e.collection,s),p=typeof e.name=="string"?e.name.trim():"";if(!p)throw ge('"name" is required');let h=typeof e.method=="string"?e.method.toUpperCase():"GET",g=typeof e.url=="string"?e.url:"";if(!g)throw ge('"url" is required');let v;if(typeof e.folder=="string"&&e.folder.trim()){let E=e.folder.toLowerCase(),k=Qr(c).find(T=>T.folderPath===e.folder||T.folderPath.toLowerCase()===E);k&&(v=k.folderId)}let _={collectionId:c.id,parentId:v,name:p,method:h,url:g,headers:void 0,body:e.body?{type:"raw",raw:String(e.body),contentType:"application/json"}:void 0,description:typeof e.description=="string"?e.description:void 0},w=await r.collection.createRequest(_);return{id:w.id,name:w.name,created:!0,collection:c.name,hint:"Request created. Call run_request to execute it, or set_request_script to add pre-request/post-response scripts."}}if(t===J.updateRequest){let c=et(e.collection,s),p=Mi(e.request,c),h={};return typeof e.name=="string"&&(h.name=e.name),typeof e.method=="string"&&(h.method=e.method.toUpperCase()),typeof e.url=="string"&&(h.url=e.url),e.headers&&typeof e.headers=="object"&&!Array.isArray(e.headers)&&(h.headers=Object.entries(e.headers).map(([g,v])=>({name:g,value:String(v),enabled:!0}))),typeof e.body=="string"&&(h.body={type:"raw",raw:e.body,contentType:"application/json"}),typeof e.description=="string"&&(h.description=e.description),await r.collection.updateRequest(c.id,p.id,h),{updated:!0,request:p.name}}if(t===J.deleteRequest){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a request');let c=et(e.collection,s),p=Mi(e.request,c);return await r.collection.deleteRequest(c.id,p.id),{deleted:!0,request:p.name}}if(t===J.getRequestScript){let c=et(e.collection,s),p=Mi(e.request,c),h=e.phase;if(h!=="pre-request"&&h!=="post-response")throw ge('"phase" must be "pre-request" or "post-response"');let g=r.collection.getRequestScript(c.id,p.id,h);return{collection:c.name,request:p.name,phase:h,script:g??""}}if(t===J.setRequestScript){let c=et(e.collection,s),p=Mi(e.request,c),h=e.phase;if(h!=="pre-request"&&h!=="post-response")throw ge('"phase" must be "pre-request" or "post-response"');if(typeof e.script!="string")throw ge('"script" is required');return await r.collection.setRequestScript(c.id,p.id,h,e.script),{updated:!0,collection:c.name,request:p.name,phase:h}}if(t===J.reorderCollectionItems){let c=et(e.collection,s);if(!Array.isArray(e.order))throw ge('"order" must be an array');let p;if(typeof e.folder=="string"&&e.folder.trim()){let v=e.folder.toLowerCase(),_=Qr(c).find(w=>w.folderPath===e.folder||w.folderPath.toLowerCase()===v);if(!_)throw ge(`folder "${e.folder}" not found in collection "${c.name}"`);p=_.folderId}let h=p?c.items.find(v=>v.id===p)?.items??[]:c.items,g=e.order.map(v=>h.find(w=>w.id===v||w.name===v)?.id??v);return await r.collection.reorderItems(c.id,p,g),{reordered:!0,collection:c.name,order:e.order}}if(t===J.listSuites)return{suites:(await r.testSuite.getAllSuites()).map(p=>({id:p.id,name:p.name,description:p.description??"",requestCount:p.requests.length,iterations:p.config?.iterations??1}))};if(t===J.getSuite){let c=await Va(e.suite,r);return{id:c.id,name:c.name,description:c.description??"",config:{iterations:c.config?.iterations??1,delayBetweenRequests:c.config?.delayBetweenRequests??0,stopOnError:c.config?.stopOnError??!1},requests:c.requests.map(p=>({slug:p.slug??p.requestId,collectionId:p.collectionId,requestId:p.requestId,name:p.name,method:p.method,folderPath:p.folderPath??"",enabled:p.enabled!==!1}))}}if(t===J.createSuite){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ge('"name" is required');let p;if(typeof e.fromCollection=="string"&&e.fromCollection.trim()){let h=et(e.fromCollection,s),g=await r.testSuite.createTempSuiteFromCollection(h.id);if(!g)throw new Error(`Could not build suite from collection "${h.name}"`);if(typeof e.fromFolder=="string"&&e.fromFolder.trim()){let v=hy(e.fromFolder),_=g.requests.filter(w=>w.folderPath===v||w.folderPath.startsWith(`${v}/`));g.requests=_}p=await r.testSuite.saveTempSuite(g,c)}else p=await r.testSuite.createSuite(c);return(e.iterations!==void 0||e.stopOnError!==void 0||e.delayBetweenRequests!==void 0||e.description!==void 0)&&(e.description!==void 0&&(p.description=String(e.description)),p.config={...p.config,...typeof e.iterations=="number"?{iterations:e.iterations}:{},...typeof e.stopOnError=="boolean"?{stopOnError:e.stopOnError}:{},...typeof e.delayBetweenRequests=="number"?{delayBetweenRequests:e.delayBetweenRequests}:{}},await r.testSuite.updateSuite(p)),{id:p.id,name:p.name,requestCount:p.requests.length,created:!0,hint:p.requests.length===0?"Suite is empty. Call add_suite_requests to populate it with requests from a collection.":"Suite created. Call run_suite to execute it."}}if(t===J.updateSuiteConfig){let c=await Va(e.suite,r);return typeof e.name=="string"&&e.name.trim()&&(c.name=e.name.trim()),typeof e.description=="string"&&(c.description=e.description),c.config={...c.config,...typeof e.iterations=="number"?{iterations:e.iterations}:{},...typeof e.stopOnError=="boolean"?{stopOnError:e.stopOnError}:{},...typeof e.delayBetweenRequests=="number"?{delayBetweenRequests:e.delayBetweenRequests}:{}},await r.testSuite.updateSuite(c),{updated:!0,suite:c.name}}if(t===J.addSuiteRequests){let c=await Va(e.suite,r),p=Array.isArray(e.requests)?e.requests:[];if(p.length===0)throw ge('"requests" array is required and must not be empty');let h=[];for(let v of p){let _=et(v.collection,s),w=Mi(v.request,_),E=Xe(_).find(k=>k.request.id===w.id)?.folderPath??"";h.push({slug:w.id,collectionId:_.id,requestId:w.id,name:w.name,method:w.method,collectionName:_.name,folderPath:E,enabled:!0})}let g=typeof e.insertAt=="number"?Math.max(0,e.insertAt):void 0;return g!==void 0&&g<c.requests.length?c.requests.splice(g,0,...h):c.requests.push(...h),await r.testSuite.updateSuite(c),{added:h.length,suite:c.name,newRequestCount:c.requests.length}}if(t===J.removeSuiteRequest){let c=await Va(e.suite,r),p;if(typeof e.index=="number"){if(e.index<0||e.index>=c.requests.length)throw ge(`index ${e.index} is out of range`);let[h]=c.requests.splice(e.index,1);p=h.name}else if(typeof e.request=="string"){let h=e.request.toLowerCase(),g=c.requests.findIndex(v=>v.name===e.request||v.name.toLowerCase()===h);if(g===-1)throw ge(`request "${e.request}" not found in suite "${c.name}"`);p=c.requests.splice(g,1)[0].name}else throw ge('either "index" or "request" is required');return await r.testSuite.updateSuite(c),{removed:!0,request:p,newRequestCount:c.requests.length}}if(t===J.reorderSuiteRequests){let c=await Va(e.suite,r);if(!Array.isArray(e.order))throw ge('"order" must be an array of request names');let p=e.order,h=[...c.requests].sort((g,v)=>{let _=p.findIndex(T=>T===g.name||T.toLowerCase()===g.name.toLowerCase()),w=p.findIndex(T=>T===v.name||T.toLowerCase()===v.name.toLowerCase());return(_===-1?1/0:_)-(w===-1?1/0:w)});return c.requests=h,await r.testSuite.updateSuite(c),{reordered:!0,suite:c.name,newOrder:c.requests.map(g=>g.name)}}if(t===J.duplicateSuite){let c=await Va(e.suite,r),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ge('"newName" is required');let h=await r.testSuite.duplicateSuite(c.id,p);return{id:h.id,name:h.name,duplicatedFrom:c.name,requestCount:h.requests.length}}if(t===J.deleteSuite){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a suite');let c=await Va(e.suite,r);return await r.testSuite.deleteSuite(c.id),{deleted:!0,suite:c.name}}if(t===J.listEnvironments){let c=r.environmentConfig.getAllEnvironments(),p=r.environmentConfig.getSelectedEnvironment();return{environments:c.map(h=>({name:h.name,active:h.active,variableKeys:Object.keys(h.variables)})),active:p}}if(t===J.getEnvironmentVariables){let c=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),p=r.environmentConfig.getResolvedEnvironment(c);if(!p)throw ge(`environment "${c}" not found`);let g=r.environmentConfig.getSharedConfig()?.environments?.[c]?.variables??{},v=r.environmentConfig.getEnvironmentVariableLocals();return{environment:c,active:r.environmentConfig.getSelectedEnvironment()===c,fileVariables:g,sessionOverrides:v,resolved:p.variables}}if(t===J.selectEnvironment){let c=typeof e.environment=="string"?e.environment.trim():"";if(!c)throw ge('"environment" is required');return await r.environmentConfig.setSelectedEnvironment(c),{selected:!0,environment:c}}if(t===J.createEnvironment){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ge('"name" is required');if(await r.environmentConfig.createEnvironment(c),e.variables&&typeof e.variables=="object"){let p=e.variables,h=r.environmentConfig.getSharedConfig();h&&(h.environments=h.environments??{},h.environments[c]={...h.environments[c]??{},variables:{...h.environments[c]?.variables??{},...p}},r.environmentConfig.saveSharedConfig(h))}return{created:!0,environment:c}}if(t===J.deleteEnvironment){if(e.confirm!==!0)throw ge('"confirm" must be true to delete an environment');let c=typeof e.environment=="string"?e.environment.trim():"";if(!c)throw ge('"environment" is required');let p=r.environmentConfig.getSelectedEnvironment();return await r.environmentConfig.deleteEnvironment(c),{deleted:!0,environment:c,newActive:p===c?void 0:p}}if(t===J.setEnvironmentVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ge('"key" is required');let h=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),g=e.scope==="permanent"?"permanent":"session";if(g==="permanent"){let v=r.environmentConfig.getSharedConfig();v&&(v.environments=v.environments??{},v.environments[h]=v.environments[h]??{variables:{}},v.environments[h].variables=v.environments[h].variables??{},v.environments[h].variables[c]=p,r.environmentConfig.saveSharedConfig(v))}else r.environmentConfig.setEnvironmentVariable(c,p,h);return{set:!0,key:c,environment:h,scope:g}}if(t===J.unsetEnvironmentVariable){let c=typeof e.key=="string"?e.key.trim():"";if(!c)throw ge('"key" is required');let p=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.deleteEnvironmentVariable(c,p),{unset:!0,key:c,environment:p}}if(t===J.setGlobalVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ge('"key" is required');let h=e.scope==="permanent"?"permanent":"session";if(h==="permanent"){let g=r.environmentConfig.getSharedConfig();g&&(g.globalVariables=g.globalVariables??{},g.globalVariables[c]=p,r.environmentConfig.saveSharedConfig(g))}else r.environmentConfig.setGlobalVariable(c,p);return{set:!0,key:c,scope:h}}if(t===J.getGlobals)return{globals:r.environmentConfig.getGlobalVariables()};if(t===J.scaffoldCollectionFromOpenApi){let c=typeof e.specPath=="string"?e.specPath.trim():"";if(!c)throw ge('"specPath" is required');let p=r.workspaceFolder&&!Fi.isAbsolute(c)?Fi.join(r.workspaceFolder,c):c;if(!Zd.existsSync(p))throw ge(`OpenAPI spec file not found: "${p}"`);let g=await new _o(r.collection,r.environmentConfig).import(p,{collectionName:typeof e.collectionName=="string"?e.collectionName:void 0,environmentName:typeof e.environmentName=="string"?e.environmentName:void 0});return{collectionId:g.collection.id,collectionName:g.collection.name,requestCount:g.collection.items.filter(v=>v.type==="request").length,environmentCreated:g.environmentCreated??null,hint:"Use list_requests to browse the scaffolded collection, then run_request to test individual endpoints."}}if(t===J.suggestAssertions){let c=e.collection;if(!(typeof e.request=="string"?e.request.trim():""))throw ge('"request" is required');let h=et(c,s),g=Mi(e.request,h),v=typeof e.maxSuggestions=="number"?Math.min(20,Math.max(1,e.maxSuggestions)):10,_=[],E=Array.from(n.values()).filter($=>$.status!=="running").flatMap($=>$.allResults??[]).filter($=>$.name===g.name||typeof $.name=="string"&&$.name.toLowerCase()===g.name.toLowerCase()),k=E[E.length-1],T=k?.status;T?_.push({snippet:`pm.test("Status code is ${T}", function () {
351
351
  pm.response.to.have.status(${T});
352
352
  });`,rationale:`Observed status ${T} in the most recent run.`}):_.push({snippet:`pm.test("Status code is 2xx", function () {
353
353
  pm.expect(pm.response.code).to.be.within(200, 299);
@@ -355,12 +355,12 @@ Example: for POST /users with body {"name":"{{name}}","email":"{{email}}"} and i
355
355
  pm.expect(pm.response.responseTime).to.be.below(2000);
356
356
  });`,rationale:"Good practice to gate on response time in CI."});let N=k?.responseBody;if(N)try{let $=JSON.parse(N);if($&&typeof $=="object"){_.push({snippet:`pm.test("Content-Type is application/json", function () {
357
357
  pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json");
358
- });`,rationale:"Response body was valid JSON \u2014 assert Content-Type accordingly."});let j=Object.keys(Array.isArray($)&&$.length>0?$[0]:$).slice(0,5);for(let G of j){if(_.length>=v)break;let O=Array.isArray($)?"body[0]":"body";_.push({snippet:`pm.test("Response has field '${G}'", function () {
358
+ });`,rationale:"Response body was valid JSON \u2014 assert Content-Type accordingly."});let j=Object.keys(Array.isArray($)&&$.length>0?$[0]:$).slice(0,5);for(let G of j){if(_.length>=v)break;let q=Array.isArray($)?"body[0]":"body";_.push({snippet:`pm.test("Response has field '${G}'", function () {
359
359
  const body = pm.response.json();
360
- pm.expect(${O}).to.have.property("${G}");
360
+ pm.expect(${q}).to.have.property("${G}");
361
361
  });`,rationale:`Field "${G}" was present in the observed response body.`})}}}catch{_.push({snippet:`pm.test("Response body is not empty", function () {
362
362
  pm.expect(pm.response.text()).to.not.be.empty;
363
- });`,rationale:"Response body was non-JSON text."})}return{collection:h.name,request:g.name,suggestions:_.slice(0,v),hint:"Paste the snippets into the request's post-response script using set_request_script."}}if(t===J.explainFailure){let c=typeof e.runId=="string"?e.runId.trim():void 0,p=typeof e.request=="string"?e.request.trim():"",h=typeof e.iteration=="number"?e.iteration:1;if(c){let w=n.require(c);if(w.status==="running")return{runId:c,status:"running",message:"The run has not completed yet. Try again in a moment."};if(!p)throw ge('"request" is required when "runId" is provided');let E=w.allResults.find(j=>j.iteration===h&&(j.name===p||typeof j.name=="string"&&j.name.toLowerCase()===p.toLowerCase()));if(!E)throw new Error(`Request "${p}" (iteration ${h}) not found in run "${c}".`);let k=E.assertions?.every(j=>j.passed)??!0,T=E.error,N=E.assertions?.filter(j=>!j.passed)??[],$="";return T?$=`The request itself failed to execute: ${T}. Check the URL, network access, authentication, and that the environment variables are set correctly.`:N.length>0?$=`${N.length} assertion(s) failed. Review the expected vs actual values below and verify the API contract.`:k?$="No failures detected. The request appears to have passed.":$="The request was marked as failed but no specific errors were captured.",{runId:c,request:E.name,iteration:h,status:E.status??"unknown",passed:E.passed??!0,error:T??null,failedAssertions:N,allAssertions:E.assertions??[],requestDetails:{method:E.method,url:E.url,requestBody:E.requestBody},responseDetails:{status:E.responseStatus,headers:E.responseHeaders,body:E.responseBody},diagnosis:$,suggestedFixes:T?["Verify the URL is correct and reachable","Check all required environment variables are set","Inspect authentication headers"]:N.map(j=>`Fix assertion "${j.name}": ${j.message??"expected value mismatch"}`)}}let g=e.collection;if(!p)throw ge('"request" is required');let v=et(g,s);return{request:Mi(e.request,v).name,collection:v.name,message:"No live run id provided. Run the request first using run_request, then call explain_failure with the runId from the result.",hint:'Use run_request or run_collection with include:["consoleOutput"] to capture a fresh run, then pass the runId here.'}}if(t===J.aiSuggestEnvVars){let c=et(e.collection,s),p=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,g=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment()??void 0,v=yy(c,p),_=Xe(c).map(({request:w,folderPath:E})=>({id:w.id,name:w.name,folder:E,method:w.method,url:w.url,headers:(w.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),query:(w.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),bodyExcerpt:w.body?.type==="raw"&&typeof w.body.content=="string"?w.body.content.slice(0,300):void 0}));return{task:{action:"analyze_and_apply_env_vars",instructions:["Review requestSummary. Find ALL hardcoded values: base URLs, API keys/tokens, tenant IDs, user IDs, secrets, repeated hostnames.","Skip placeholders ({{...}}), HTTP methods, standard header names, empty strings, booleans, short numbers.","Combine heuristicSuggestions with your own findings into one list.",`Call apply_env_vars immediately with: { collection: "${c.name}", suggestions: [...], ${g?`environment: "${g}"`:""} }`,"Do NOT ask for confirmation. Apply everything at once."],collection:c.name,heuristicSuggestions:v.map(w=>({varName:w.varName,value:w.value,reason:w.reason})),requestSummary:_,expectedCallAfterThis:"apply_env_vars"}}}if(t===J.aiEnhanceCollection){let c=et(e.collection,s),p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(20,Math.max(1,e.limit)):10,g=typeof e.folder=="string"?e.folder.toLowerCase():void 0,v=Xe(c).filter(({folderPath:E})=>!g||E.toLowerCase().includes(g)),_=v.slice(p,p+h).map(({request:E,folderPath:k})=>({id:E.id,name:E.name,folder:k,method:E.method,url:E.url,headers:(E.headers??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),query:(E.query??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),currentBody:E.body?.type==="raw"&&typeof E.body.content=="string"?E.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,E.id,"post-response")??void 0})),w=p+h<v.length;return{task:{action:"enhance_requests",instructions:["For each request in requests, produce body and/or testScript as appropriate:"," body: realistic JSON (or form) example matching the endpoint purpose. Only for POST/PUT/PATCH."," testScript: pm.test() assertions \u2014 check status code, response schema, key fields. Always provide this.",`Call apply_request_enhancements immediately with: { collection: "${c.name}", enhancements: [{ requestId, body?, testScript }] }`,w?`After applying, call ai_enhance_collection again with: { collection: "${c.name}", offset: ${p+h}, limit: ${h} } to continue.`:"This is the last batch \u2014 no further calls needed after applying.","Do NOT ask for confirmation. Apply everything at once."],collection:c.name,total:v.length,offset:p,hasMore:w,nextOffset:w?p+h:void 0,requests:_,expectedCallAfterThis:"apply_request_enhancements"}}}if(t===J.suggestEnvVars){let c=et(e.collection,s),p=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,h=yy(c,p),g=Xe(c).map(({request:v,folderPath:_})=>({id:v.id,name:v.name,folder:_,method:v.method,url:v.url,headers:(v.headers??[]).filter(w=>w.enabled!==!1).map(w=>({key:w.key,value:w.value})),query:(v.query??[]).filter(w=>w.enabled!==!1).map(w=>({key:w.key,value:w.value})),bodyExcerpt:v.body?.type==="raw"&&typeof v.body.content=="string"?v.body.content.slice(0,300):void 0}));return{collection:c.name,heuristicSuggestions:h.map(v=>({varName:v.varName,value:v.value,reason:v.reason,occurrences:v.occurrences.length})),requestSummary:g,hint:"Review requestSummary for additional hardcoded values, then call apply_env_vars with your combined {value, varName} list."}}if(t===J.applyEnvVars){let c=et(e.collection,s),p=e.suggestions;if(!Array.isArray(p)||p.length===0)throw ge('"suggestions" must be a non-empty array of {value, varName} objects');let h=p,g=DC(c.items,h);await r.collection.saveCollection(c);let _=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment();if(_)for(let E of h)r.environmentConfig.setEnvironmentVariable(E.varName,E.value,_);let w=Object.values(g).reduce((E,k)=>E+k,0);return{collection:c.name,applied:h.map(E=>({varName:E.varName,replacements:g[E.varName]??0})),totalReplacements:w,..._?{writtenToEnvironment:_}:{}}}if(t===J.getRequestsForEnhancement){let c=et(e.collection,s),p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(30,Math.max(1,e.limit)):10,g=typeof e.folder=="string"?e.folder.toLowerCase():void 0,v=Xe(c).filter(({folderPath:w})=>!g||w.toLowerCase().includes(g)),_=v.slice(p,p+h).map(({request:w,folderPath:E})=>({id:w.id,name:w.name,folder:E,method:w.method,url:w.url,headers:(w.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),query:(w.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),currentBody:w.body?.type==="raw"&&typeof w.body.content=="string"?w.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,w.id,"post-response")??void 0}));return{collection:c.name,total:v.length,offset:p,limit:h,requests:_,hasMore:p+h<v.length,hint:"For each request write a realistic body and pm.test() assertions, then call apply_request_enhancements."}}if(t===J.applyRequestEnhancements){let c=et(e.collection,s),p=e.enhancements;if(!Array.isArray(p)||p.length===0)throw ge('"enhancements" must be a non-empty array');let h=[];for(let g of p){let{requestId:v,body:_,testScript:w}=g;if(!Xe(c).find(({request:T})=>T.id===v)){h.push({requestId:v,applied:["skipped: request not found"]});continue}let k=[];typeof _=="string"&&(await r.collection.updateRequest(c.id,v,{body:{type:"raw",content:_,format:"json"}}),k.push("body")),typeof w=="string"&&(await r.collection.setRequestScript(c.id,v,"post-response",w),k.push("testScript")),h.push({requestId:v,applied:k})}return{collection:c.name,results:h,totalUpdated:h.filter(g=>g.applied.length>0&&!g.applied[0].startsWith("skipped")).length}}if(t===J.analyzeCoverage||t===J.aiAnalyzeCoverage){let c=et(e.collection,s),p=typeof e.folder=="string"?e.folder.toLowerCase():void 0,h=Xe(c).filter(({folderPath:N})=>!p||N.toLowerCase().includes(p)),g=h.map(({request:N,folderPath:$})=>{let G=((r.collection.getRequestScript(c.id,N.id,"post-response")??"").match(/pm\.test\s*\(/g)??[]).length;return{id:N.id,name:N.name,method:N.method,folder:$,hasAssertions:G>0,assertionCount:G}}),v=g.filter(N=>N.hasAssertions).length,_=g.length,w=_===0?100:Math.round(v/_*100),E=[],k=typeof e.specPath=="string"?e.specPath.trim():"";if(k)try{let N=r.workspaceFolder&&!Fi.isAbsolute(k)?Fi.join(r.workspaceFolder,k):k,$=Zd.readFileSync(N,"utf8"),{parse:j}=await Promise.resolve().then(()=>Uc(Od())),O=(k.endsWith(".json")?JSON.parse($):j($)).paths??{},C=["get","post","put","patch","delete","head","options"];for(let[A,D]of Object.entries(O))for(let B of C){if(!(B in D))continue;let F=B.toUpperCase();h.some(({request:ee})=>ee.method.toUpperCase()===F&&(ee.url??"").replace(/\{\{[^}]+\}\}/g,"{param}").includes(A.replace(/\{[^}]+\}/g,"{param}").replace(/^\//,"")))||E.push({method:F,path:A})}}catch{}let T=g.filter(N=>!N.hasAssertions);if(t===J.aiAnalyzeCoverage){let N=[];return T.length>0&&N.push(`${T.length} request(s) have no pm.test() assertions. Call ai_enhance_collection (collection="${c.name}") to add assertions to all of them.`),E.length>0&&N.push(`${E.length} spec operation(s) have no matching collection request. Call generate_scenarios (collection="${c.name}") to generate negative and edge-case requests for them.`),N.length===0&&N.push(`Coverage is ${w}% \u2014 all requests have assertions and all spec operations are covered.`),{task:{action:"ai_analyze_coverage",instructions:["Review the coverage data below.",...N,"Address the highest-impact gap first. Do NOT ask for confirmation \u2014 proceed immediately."],collection:c.name,coveragePct:w,covered:v,total:_,untestedRequests:T,untestedOperations:E,expectedCallAfterThis:T.length>0?"ai_enhance_collection":E.length>0?"generate_scenarios":null}}}return{collection:c.name,coveragePct:w,covered:v,total:_,requests:g,...E.length>0?{untestedOperations:E}:{}}}if(t===J.generateRequestFromIntent){let c=et(e.collection,s),p=typeof e.intent=="string"?e.intent.trim():"";if(!p)throw ge('"intent" is required \u2014 describe what to test in plain English');let g=Xe(c).slice(0,20).map(({request:_,folderPath:w})=>({name:_.name,method:_.method,url:_.url??"",folder:w})),v=Object.keys(r.environmentConfig.getResolvedEnvironment(r.environmentConfig.getSelectedEnvironment())?.variables??{});return{task:{action:"generate_request_from_intent",instructions:[`Intent: "${p}"`,"Using the collection context below, determine: method, full URL (reuse existing {{vars}} where possible), headers, request body (if applicable), and expected HTTP status.","Then immediately:"," 1. Call create_request with name, method, url, and body.",' 2. Call set_request_script (phase: "post-response") with pm.test() assertions that verify the intent.',"Do NOT ask for confirmation \u2014 implement the full request + assertions in one shot."],collection:c.name,intent:p,existingRequests:g,availableEnvVars:v,targetFolder:typeof e.folder=="string"?e.folder:void 0,expectedCallAfterThis:"create_request"}}}if(t===J.validateAgainstSpec){let c=et(e.collection,s),p=typeof e.specPath=="string"?e.specPath.trim():"";if(!p)throw ge('"specPath" is required');let h=r.workspaceFolder&&!Fi.isAbsolute(p)?Fi.join(r.workspaceFolder,p):p,g;try{let j=Zd.readFileSync(h,"utf8"),{parse:G}=await Promise.resolve().then(()=>Uc(Od()));g=p.endsWith(".json")?JSON.parse(j):G(j)}catch(j){throw new Error(`Could not load spec at "${h}": ${j instanceof Error?j.message:String(j)}`)}let v=g.paths??{},_=["get","post","put","patch","delete","head","options"],w=Xe(c),E=[],k=[],T=[],N=j=>j.replace(/\{\{[^}]+\}\}/g,"{p}").replace(/\{[^}]+\}/g,"{p}").replace(/\/+$/,"");for(let[j,G]of Object.entries(v))for(let O of _){if(!(O in G))continue;let C=G[O],A=O.toUpperCase(),D=N(j),B=w.find(({request:F})=>F.method.toUpperCase()===A&&N(F.url??"").includes(D));if(!B)E.push({method:A,path:j,operationId:C.operationId});else{let F=r.collection.getRequestScript(c.id,B.request.id,"post-response")??"";/pm\.test\s*\(/.test(F)||k.push({method:A,path:j,requestName:B.request.name})}}let $=new Set(Object.entries(v).flatMap(([j,G])=>_.filter(O=>O in G).map(O=>`${O.toUpperCase()}:${N(j)}`)));for(let{request:j}of w){let G=N(j.url??""),O=`${j.method.toUpperCase()}:`;[...$].some(A=>A.startsWith(O)&&G.includes(A.split(":")[1]))||T.push({method:j.method,url:j.url??"",requestName:j.name})}return{collection:c.name,spec:Fi.basename(p),summary:{untestedOperations:E.length,matchedWithoutAssertions:k.length,extraRequests:T.length},untestedOperations:E,matchedWithoutAssertions:k,extraRequests:T,hint:E.length>0?`Call generate_scenarios (collection="${c.name}") to create negative/edge-case requests for untested operations.`:"All spec operations have matching collection requests."}}if(t===J.generateScenarios){let c=et(e.collection,s),p=typeof e.request=="string"?e.request.trim().toLowerCase():void 0,h=typeof e.folder=="string"?e.folder.toLowerCase():void 0,g=typeof e.offset=="number"?Math.max(0,e.offset):0,v=typeof e.limit=="number"?Math.min(10,Math.max(1,e.limit)):5,_=Xe(c).filter(({request:E,folderPath:k})=>!(p&&E.name.toLowerCase()!==p&&!E.name.toLowerCase().includes(p)||h&&!k.toLowerCase().includes(h))),w=_.slice(g,g+v).map(({request:E,folderPath:k})=>({id:E.id,name:E.name,method:E.method,url:E.url??"",folder:k,headers:(E.headers??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),body:E.body?.type==="raw"&&typeof E.body.content=="string"?E.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,E.id,"post-response")??void 0}));return{task:{action:"generate_scenarios",instructions:["For each request below, generate negative and edge-case test scenario variants.","Scenarios to generate per request (as applicable):"," - Missing required fields \u2192 expect 400 or 422"," - Invalid field type or format (e.g. string where number expected) \u2192 expect 400"," - No Authorization header (remove it) \u2192 expect 401"," - Valid auth but insufficient scope/role \u2192 expect 403"," - Non-existent resource ID in URL \u2192 expect 404"," - Boundary values: empty string, max-length string, 0, -1, very large number","For each scenario:",' 1. Call create_request with a descriptive name (e.g. "Create User - Missing Email \u2192 422"), method, url, and body.',' 2. Immediately call set_request_script (phase: "post-response") with the status assertion.'," 3. Place the new request in the same folder as the original (use folder argument in create_request).","If task.hasMore is true, call generate_scenarios again with task.nextOffset after finishing this batch.","Do NOT ask for confirmation \u2014 generate all scenarios autonomously."],collection:c.name,requests:w,total:_.length,offset:g,hasMore:g+v<_.length,nextOffset:g+v,expectedCallAfterThis:"create_request"}}}if(t===J.healAssertions){let c=et(e.collection,s),p=Mi(e.request,c),h=r.collection.getRequestScript(c.id,p.id,"post-response")??"",g,v=typeof e.runId=="string"?e.runId.trim():void 0;if(v)try{let w=n.require(v).allResults.find(E=>typeof E.name=="string"&&E.name.toLowerCase()===p.name.toLowerCase());w&&(g={status:w.status,responseBody:w.responseBody,responseHeaders:w.responseHeaders,failedTests:w.failedTests})}catch{}return{task:{action:"heal_assertions",instructions:[`Request: ${p.method} ${p.url??""}`,"The current test script may have stale or incorrect assertions (e.g. wrong status code, missing/renamed fields).","Compare task.currentScript against task.lastResponse (if available).","Rewrite the complete post-response script so all assertions match the observed response while keeping valid checks.",'Call set_request_script (phase: "post-response") with the updated script immediately.',"Do NOT ask for confirmation."],collection:c.name,request:p.name,method:p.method,url:p.url??"",currentScript:h,lastResponse:g??null,note:g?"Last response data available \u2014 use it to align assertions with actual behavior.":"No run data available \u2014 run the request first with run_request, then call heal_assertions again with the runId.",expectedCallAfterThis:"set_request_script"}}}if(t===J.generateIterationData){let c=et(e.collection,s),p=Mi(e.request,c),h=typeof e.iterations=="number"?Math.min(50,Math.max(1,e.iterations)):5,g=p.body?.type==="raw"&&typeof p.body.content=="string"?p.body.content:void 0,v=(p.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),_=(p.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),w=/\{\{([^}]+)\}\}/g,E=new Set;for(let k of[p.url??"",g??"",...v.map(T=>T.value),..._.map(T=>T.value)]){let T;for(w.lastIndex=0;(T=w.exec(k))!==null;)E.add(T[1])}return{task:{action:"generate_iteration_data",instructions:[`Generate ${h} test data rows for: ${p.method} ${p.url??""}`,`The request uses these {{variable}} placeholders: ${[...E].join(", ")||"(none detected)"}`,"Each row must be a JSON object whose keys match the placeholder names.","Cover a mix of: (1) valid happy-path data, (2) boundary values, (3) invalid inputs that should fail, (4) edge cases.",'Return the rows as a JSON array in a code block labeled "iterationData".',"This data can be used with: http-forge run-request --collection ... --variables '[...]' or passed to run_request via the variables argument."],collection:c.name,request:p.name,method:p.method,url:p.url??"",body:g??null,headers:v,queryParams:_,placeholders:[...E],iterations:h}}}let o=e.suite;if(typeof o!="string"||!o.trim())throw ge('the "suite" argument is required');let l=await r.testSuite.getAllSuites(),f=l.find(c=>c.id===o||c.name===o)??l.find(c=>c.name.toLowerCase()===o.toLowerCase());if(!f)throw ge(`test suite not found: "${o}"`);return i.runSuite(f.id,f.name,e)}var UC,BC=se(()=>{"use strict";LC();sy();mi();Qd();UC=new Set([J.createCollection,J.renameCollection,J.deleteCollection,J.duplicateCollection,J.createFolder,J.deleteFolder,J.createRequest,J.updateRequest,J.deleteRequest,J.reorderCollectionItems,J.createSuite,J.updateSuiteConfig,J.duplicateSuite,J.deleteSuite])});function Co(t,e=2e3){return!t||t.length<=e?t:t.slice(0,e)+`
363
+ });`,rationale:"Response body was non-JSON text."})}return{collection:h.name,request:g.name,suggestions:_.slice(0,v),hint:"Paste the snippets into the request's post-response script using set_request_script."}}if(t===J.explainFailure){let c=typeof e.runId=="string"?e.runId.trim():void 0,p=typeof e.request=="string"?e.request.trim():"",h=typeof e.iteration=="number"?e.iteration:1;if(c){let w=n.require(c);if(w.status==="running")return{runId:c,status:"running",message:"The run has not completed yet. Try again in a moment."};if(!p)throw ge('"request" is required when "runId" is provided');let E=w.allResults.find(j=>j.iteration===h&&(j.name===p||typeof j.name=="string"&&j.name.toLowerCase()===p.toLowerCase()));if(!E)throw new Error(`Request "${p}" (iteration ${h}) not found in run "${c}".`);let k=E.assertions?.every(j=>j.passed)??!0,T=E.error,N=E.assertions?.filter(j=>!j.passed)??[],$="";return T?$=`The request itself failed to execute: ${T}. Check the URL, network access, authentication, and that the environment variables are set correctly.`:N.length>0?$=`${N.length} assertion(s) failed. Review the expected vs actual values below and verify the API contract.`:k?$="No failures detected. The request appears to have passed.":$="The request was marked as failed but no specific errors were captured.",{runId:c,request:E.name,iteration:h,status:E.status??"unknown",passed:E.passed??!0,error:T??null,failedAssertions:N,allAssertions:E.assertions??[],requestDetails:{method:E.method,url:E.url,requestBody:E.requestBody},responseDetails:{status:E.responseStatus,headers:E.responseHeaders,body:E.responseBody},diagnosis:$,suggestedFixes:T?["Verify the URL is correct and reachable","Check all required environment variables are set","Inspect authentication headers"]:N.map(j=>`Fix assertion "${j.name}": ${j.message??"expected value mismatch"}`)}}let g=e.collection;if(!p)throw ge('"request" is required');let v=et(g,s);return{request:Mi(e.request,v).name,collection:v.name,message:"No live run id provided. Run the request first using run_request, then call explain_failure with the runId from the result.",hint:'Use run_request or run_collection with include:["consoleOutput"] to capture a fresh run, then pass the runId here.'}}if(t===J.aiSuggestEnvVars){let c=et(e.collection,s),p=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,g=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment()??void 0,v=yy(c,p),_=Xe(c).map(({request:w,folderPath:E})=>({id:w.id,name:w.name,folder:E,method:w.method,url:w.url,headers:(w.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),query:(w.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),bodyExcerpt:w.body?.type==="raw"&&typeof w.body.content=="string"?w.body.content.slice(0,300):void 0}));return{task:{action:"analyze_and_apply_env_vars",instructions:["Review requestSummary. Find ALL hardcoded values: base URLs, API keys/tokens, tenant IDs, user IDs, secrets, repeated hostnames.","Skip placeholders ({{...}}), HTTP methods, standard header names, empty strings, booleans, short numbers.","Combine heuristicSuggestions with your own findings into one list.",`Call apply_env_vars immediately with: { collection: "${c.name}", suggestions: [...], ${g?`environment: "${g}"`:""} }`,"Do NOT ask for confirmation. Apply everything at once."],collection:c.name,heuristicSuggestions:v.map(w=>({varName:w.varName,value:w.value,reason:w.reason})),requestSummary:_,expectedCallAfterThis:"apply_env_vars"}}}if(t===J.aiEnhanceCollection){let c=et(e.collection,s),p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(20,Math.max(1,e.limit)):10,g=typeof e.folder=="string"?e.folder.toLowerCase():void 0,v=Xe(c).filter(({folderPath:E})=>!g||E.toLowerCase().includes(g)),_=v.slice(p,p+h).map(({request:E,folderPath:k})=>({id:E.id,name:E.name,folder:k,method:E.method,url:E.url,headers:(E.headers??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),query:(E.query??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),currentBody:E.body?.type==="raw"&&typeof E.body.content=="string"?E.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,E.id,"post-response")??void 0})),w=p+h<v.length;return{task:{action:"enhance_requests",instructions:["For each request in requests, produce body and/or testScript as appropriate:"," body: realistic JSON (or form) example matching the endpoint purpose. Only for POST/PUT/PATCH."," testScript: pm.test() assertions \u2014 check status code, response schema, key fields. Always provide this.",`Call apply_request_enhancements immediately with: { collection: "${c.name}", enhancements: [{ requestId, body?, testScript }] }`,w?`After applying, call ai_enhance_collection again with: { collection: "${c.name}", offset: ${p+h}, limit: ${h} } to continue.`:"This is the last batch \u2014 no further calls needed after applying.","Do NOT ask for confirmation. Apply everything at once."],collection:c.name,total:v.length,offset:p,hasMore:w,nextOffset:w?p+h:void 0,requests:_,expectedCallAfterThis:"apply_request_enhancements"}}}if(t===J.suggestEnvVars){let c=et(e.collection,s),p=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,h=yy(c,p),g=Xe(c).map(({request:v,folderPath:_})=>({id:v.id,name:v.name,folder:_,method:v.method,url:v.url,headers:(v.headers??[]).filter(w=>w.enabled!==!1).map(w=>({key:w.key,value:w.value})),query:(v.query??[]).filter(w=>w.enabled!==!1).map(w=>({key:w.key,value:w.value})),bodyExcerpt:v.body?.type==="raw"&&typeof v.body.content=="string"?v.body.content.slice(0,300):void 0}));return{collection:c.name,heuristicSuggestions:h.map(v=>({varName:v.varName,value:v.value,reason:v.reason,occurrences:v.occurrences.length})),requestSummary:g,hint:"Review requestSummary for additional hardcoded values, then call apply_env_vars with your combined {value, varName} list."}}if(t===J.applyEnvVars){let c=et(e.collection,s),p=e.suggestions;if(!Array.isArray(p)||p.length===0)throw ge('"suggestions" must be a non-empty array of {value, varName} objects');let h=p,g=DC(c.items,h);await r.collection.saveCollection(c);let _=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment();if(_)for(let E of h)r.environmentConfig.setEnvironmentVariable(E.varName,E.value,_);let w=Object.values(g).reduce((E,k)=>E+k,0);return{collection:c.name,applied:h.map(E=>({varName:E.varName,replacements:g[E.varName]??0})),totalReplacements:w,..._?{writtenToEnvironment:_}:{}}}if(t===J.getRequestsForEnhancement){let c=et(e.collection,s),p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(30,Math.max(1,e.limit)):10,g=typeof e.folder=="string"?e.folder.toLowerCase():void 0,v=Xe(c).filter(({folderPath:w})=>!g||w.toLowerCase().includes(g)),_=v.slice(p,p+h).map(({request:w,folderPath:E})=>({id:w.id,name:w.name,folder:E,method:w.method,url:w.url,headers:(w.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),query:(w.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),currentBody:w.body?.type==="raw"&&typeof w.body.content=="string"?w.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,w.id,"post-response")??void 0}));return{collection:c.name,total:v.length,offset:p,limit:h,requests:_,hasMore:p+h<v.length,hint:"For each request write a realistic body and pm.test() assertions, then call apply_request_enhancements."}}if(t===J.applyRequestEnhancements){let c=et(e.collection,s),p=e.enhancements;if(!Array.isArray(p)||p.length===0)throw ge('"enhancements" must be a non-empty array');let h=[];for(let g of p){let{requestId:v,body:_,testScript:w}=g;if(!Xe(c).find(({request:T})=>T.id===v)){h.push({requestId:v,applied:["skipped: request not found"]});continue}let k=[];typeof _=="string"&&(await r.collection.updateRequest(c.id,v,{body:{type:"raw",content:_,format:"json"}}),k.push("body")),typeof w=="string"&&(await r.collection.setRequestScript(c.id,v,"post-response",w),k.push("testScript")),h.push({requestId:v,applied:k})}return{collection:c.name,results:h,totalUpdated:h.filter(g=>g.applied.length>0&&!g.applied[0].startsWith("skipped")).length}}if(t===J.analyzeCoverage||t===J.aiAnalyzeCoverage){let c=et(e.collection,s),p=typeof e.folder=="string"?e.folder.toLowerCase():void 0,h=Xe(c).filter(({folderPath:N})=>!p||N.toLowerCase().includes(p)),g=h.map(({request:N,folderPath:$})=>{let G=((r.collection.getRequestScript(c.id,N.id,"post-response")??"").match(/pm\.test\s*\(/g)??[]).length;return{id:N.id,name:N.name,method:N.method,folder:$,hasAssertions:G>0,assertionCount:G}}),v=g.filter(N=>N.hasAssertions).length,_=g.length,w=_===0?100:Math.round(v/_*100),E=[],k=typeof e.specPath=="string"?e.specPath.trim():"";if(k)try{let N=r.workspaceFolder&&!Fi.isAbsolute(k)?Fi.join(r.workspaceFolder,k):k,$=Zd.readFileSync(N,"utf8"),{parse:j}=await Promise.resolve().then(()=>Uc(qd())),q=(k.endsWith(".json")?JSON.parse($):j($)).paths??{},C=["get","post","put","patch","delete","head","options"];for(let[A,D]of Object.entries(q))for(let B of C){if(!(B in D))continue;let F=B.toUpperCase();h.some(({request:ee})=>ee.method.toUpperCase()===F&&(ee.url??"").replace(/\{\{[^}]+\}\}/g,"{param}").includes(A.replace(/\{[^}]+\}/g,"{param}").replace(/^\//,"")))||E.push({method:F,path:A})}}catch{}let T=g.filter(N=>!N.hasAssertions);if(t===J.aiAnalyzeCoverage){let N=[];return T.length>0&&N.push(`${T.length} request(s) have no pm.test() assertions. Call ai_enhance_collection (collection="${c.name}") to add assertions to all of them.`),E.length>0&&N.push(`${E.length} spec operation(s) have no matching collection request. Call generate_scenarios (collection="${c.name}") to generate negative and edge-case requests for them.`),N.length===0&&N.push(`Coverage is ${w}% \u2014 all requests have assertions and all spec operations are covered.`),{task:{action:"ai_analyze_coverage",instructions:["Review the coverage data below.",...N,"Address the highest-impact gap first. Do NOT ask for confirmation \u2014 proceed immediately."],collection:c.name,coveragePct:w,covered:v,total:_,untestedRequests:T,untestedOperations:E,expectedCallAfterThis:T.length>0?"ai_enhance_collection":E.length>0?"generate_scenarios":null}}}return{collection:c.name,coveragePct:w,covered:v,total:_,requests:g,...E.length>0?{untestedOperations:E}:{}}}if(t===J.generateRequestFromIntent){let c=et(e.collection,s),p=typeof e.intent=="string"?e.intent.trim():"";if(!p)throw ge('"intent" is required \u2014 describe what to test in plain English');let g=Xe(c).slice(0,20).map(({request:_,folderPath:w})=>({name:_.name,method:_.method,url:_.url??"",folder:w})),v=Object.keys(r.environmentConfig.getResolvedEnvironment(r.environmentConfig.getSelectedEnvironment())?.variables??{});return{task:{action:"generate_request_from_intent",instructions:[`Intent: "${p}"`,"Using the collection context below, determine: method, full URL (reuse existing {{vars}} where possible), headers, request body (if applicable), and expected HTTP status.","Then immediately:"," 1. Call create_request with name, method, url, and body.",' 2. Call set_request_script (phase: "post-response") with pm.test() assertions that verify the intent.',"Do NOT ask for confirmation \u2014 implement the full request + assertions in one shot."],collection:c.name,intent:p,existingRequests:g,availableEnvVars:v,targetFolder:typeof e.folder=="string"?e.folder:void 0,expectedCallAfterThis:"create_request"}}}if(t===J.validateAgainstSpec){let c=et(e.collection,s),p=typeof e.specPath=="string"?e.specPath.trim():"";if(!p)throw ge('"specPath" is required');let h=r.workspaceFolder&&!Fi.isAbsolute(p)?Fi.join(r.workspaceFolder,p):p,g;try{let j=Zd.readFileSync(h,"utf8"),{parse:G}=await Promise.resolve().then(()=>Uc(qd()));g=p.endsWith(".json")?JSON.parse(j):G(j)}catch(j){throw new Error(`Could not load spec at "${h}": ${j instanceof Error?j.message:String(j)}`)}let v=g.paths??{},_=["get","post","put","patch","delete","head","options"],w=Xe(c),E=[],k=[],T=[],N=j=>j.replace(/\{\{[^}]+\}\}/g,"{p}").replace(/\{[^}]+\}/g,"{p}").replace(/\/+$/,"");for(let[j,G]of Object.entries(v))for(let q of _){if(!(q in G))continue;let C=G[q],A=q.toUpperCase(),D=N(j),B=w.find(({request:F})=>F.method.toUpperCase()===A&&N(F.url??"").includes(D));if(!B)E.push({method:A,path:j,operationId:C.operationId});else{let F=r.collection.getRequestScript(c.id,B.request.id,"post-response")??"";/pm\.test\s*\(/.test(F)||k.push({method:A,path:j,requestName:B.request.name})}}let $=new Set(Object.entries(v).flatMap(([j,G])=>_.filter(q=>q in G).map(q=>`${q.toUpperCase()}:${N(j)}`)));for(let{request:j}of w){let G=N(j.url??""),q=`${j.method.toUpperCase()}:`;[...$].some(A=>A.startsWith(q)&&G.includes(A.split(":")[1]))||T.push({method:j.method,url:j.url??"",requestName:j.name})}return{collection:c.name,spec:Fi.basename(p),summary:{untestedOperations:E.length,matchedWithoutAssertions:k.length,extraRequests:T.length},untestedOperations:E,matchedWithoutAssertions:k,extraRequests:T,hint:E.length>0?`Call generate_scenarios (collection="${c.name}") to create negative/edge-case requests for untested operations.`:"All spec operations have matching collection requests."}}if(t===J.generateScenarios){let c=et(e.collection,s),p=typeof e.request=="string"?e.request.trim().toLowerCase():void 0,h=typeof e.folder=="string"?e.folder.toLowerCase():void 0,g=typeof e.offset=="number"?Math.max(0,e.offset):0,v=typeof e.limit=="number"?Math.min(10,Math.max(1,e.limit)):5,_=Xe(c).filter(({request:E,folderPath:k})=>!(p&&E.name.toLowerCase()!==p&&!E.name.toLowerCase().includes(p)||h&&!k.toLowerCase().includes(h))),w=_.slice(g,g+v).map(({request:E,folderPath:k})=>({id:E.id,name:E.name,method:E.method,url:E.url??"",folder:k,headers:(E.headers??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),body:E.body?.type==="raw"&&typeof E.body.content=="string"?E.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,E.id,"post-response")??void 0}));return{task:{action:"generate_scenarios",instructions:["For each request below, generate negative and edge-case test scenario variants.","Scenarios to generate per request (as applicable):"," - Missing required fields \u2192 expect 400 or 422"," - Invalid field type or format (e.g. string where number expected) \u2192 expect 400"," - No Authorization header (remove it) \u2192 expect 401"," - Valid auth but insufficient scope/role \u2192 expect 403"," - Non-existent resource ID in URL \u2192 expect 404"," - Boundary values: empty string, max-length string, 0, -1, very large number","For each scenario:",' 1. Call create_request with a descriptive name (e.g. "Create User - Missing Email \u2192 422"), method, url, and body.',' 2. Immediately call set_request_script (phase: "post-response") with the status assertion.'," 3. Place the new request in the same folder as the original (use folder argument in create_request).","If task.hasMore is true, call generate_scenarios again with task.nextOffset after finishing this batch.","Do NOT ask for confirmation \u2014 generate all scenarios autonomously."],collection:c.name,requests:w,total:_.length,offset:g,hasMore:g+v<_.length,nextOffset:g+v,expectedCallAfterThis:"create_request"}}}if(t===J.healAssertions){let c=et(e.collection,s),p=Mi(e.request,c),h=r.collection.getRequestScript(c.id,p.id,"post-response")??"",g,v=typeof e.runId=="string"?e.runId.trim():void 0;if(v)try{let w=n.require(v).allResults.find(E=>typeof E.name=="string"&&E.name.toLowerCase()===p.name.toLowerCase());w&&(g={status:w.status,responseBody:w.responseBody,responseHeaders:w.responseHeaders,failedTests:w.failedTests})}catch{}return{task:{action:"heal_assertions",instructions:[`Request: ${p.method} ${p.url??""}`,"The current test script may have stale or incorrect assertions (e.g. wrong status code, missing/renamed fields).","Compare task.currentScript against task.lastResponse (if available).","Rewrite the complete post-response script so all assertions match the observed response while keeping valid checks.",'Call set_request_script (phase: "post-response") with the updated script immediately.',"Do NOT ask for confirmation."],collection:c.name,request:p.name,method:p.method,url:p.url??"",currentScript:h,lastResponse:g??null,note:g?"Last response data available \u2014 use it to align assertions with actual behavior.":"No run data available \u2014 run the request first with run_request, then call heal_assertions again with the runId.",expectedCallAfterThis:"set_request_script"}}}if(t===J.generateIterationData){let c=et(e.collection,s),p=Mi(e.request,c),h=typeof e.iterations=="number"?Math.min(50,Math.max(1,e.iterations)):5,g=p.body?.type==="raw"&&typeof p.body.content=="string"?p.body.content:void 0,v=(p.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),_=(p.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),w=/\{\{([^}]+)\}\}/g,E=new Set;for(let k of[p.url??"",g??"",...v.map(T=>T.value),..._.map(T=>T.value)]){let T;for(w.lastIndex=0;(T=w.exec(k))!==null;)E.add(T[1])}return{task:{action:"generate_iteration_data",instructions:[`Generate ${h} test data rows for: ${p.method} ${p.url??""}`,`The request uses these {{variable}} placeholders: ${[...E].join(", ")||"(none detected)"}`,"Each row must be a JSON object whose keys match the placeholder names.","Cover a mix of: (1) valid happy-path data, (2) boundary values, (3) invalid inputs that should fail, (4) edge cases.",'Return the rows as a JSON array in a code block labeled "iterationData".',"This data can be used with: http-forge run-request --collection ... --variables '[...]' or passed to run_request via the variables argument."],collection:c.name,request:p.name,method:p.method,url:p.url??"",body:g??null,headers:v,queryParams:_,placeholders:[...E],iterations:h}}}let o=e.suite;if(typeof o!="string"||!o.trim())throw ge('the "suite" argument is required');let l=await r.testSuite.getAllSuites(),f=l.find(c=>c.id===o||c.name===o)??l.find(c=>c.name.toLowerCase()===o.toLowerCase());if(!f)throw ge(`test suite not found: "${o}"`);return i.runSuite(f.id,f.name,e)}var UC,BC=se(()=>{"use strict";LC();sy();mi();Qd();UC=new Set([J.createCollection,J.renameCollection,J.deleteCollection,J.duplicateCollection,J.createFolder,J.deleteFolder,J.createRequest,J.updateRequest,J.deleteRequest,J.reorderCollectionItems,J.createSuite,J.updateSuiteConfig,J.duplicateSuite,J.deleteSuite])});function Co(t,e=2e3){return!t||t.length<=e?t:t.slice(0,e)+`
364
364
  \u2026 (truncated, ${t.length-e} chars omitted)`}function Xd(t){return t.replace(/"(Authorization|authorization)"\s*:\s*"[^"]+"/g,'"Authorization": "[REDACTED]"').replace(/Bearer\s+[A-Za-z0-9\-._~+/]+=*/g,"Bearer [REDACTED]").replace(/"(password|secret|token|api[-_]?key)"\s*:\s*"[^"]+"/gi,'"$1": "[REDACTED]"')}function Y$(t,e){let r=e.getAllCollections(),n=t.toLowerCase(),i=r.find(s=>s.id===t||s.name===t)??r.find(s=>s.name.toLowerCase()===n)??r.find(s=>s.name.toLowerCase().includes(n));if(!i){let s=r.map(o=>`"${o.name}"`).join(", ");throw new Error(`Collection "${t}" not found. Available: ${s||"(none)"}`)}return i}function l5(t,e){let r=t.runId,n=t.request?.toLowerCase(),i=e.get(r);if(!i)throw new Error(`Run "${r}" not found. It may have expired or never existed. Use get_run_status to see recent runs.`);if(i.status==="running")throw new Error(`Run "${r}" is still in progress. Wait for it to complete before analyzing.`);let o=(i.allResults??[]).filter(p=>n&&typeof p.name=="string"&&!p.name.toLowerCase().includes(n)?!1:p.passed===!1||Array.isArray(p.assertions)&&p.assertions.some(h=>!h.passed)),l=i.summary,f=o.length,c=`I ran an HTTP API test suite and got failures. Please analyze the results and provide:
365
365
 
366
366
  1. **Root cause** for each failure
@@ -473,7 +473,7 @@ Please provide recommendations for:
473
473
 
474
474
  Be specific: name the exact requests or folders that need attention.`;return{description:`Review collection "${r.name}" (${n.length} requests, ${o.length} without assertions)`,messages:[{role:"user",content:{type:"text",text:p}}]}}async function VC(t,e,r,n){switch(t){case"analyze-test-failure":return l5(e,n);case"suggest-assertions":return u5(e,r,n);case"review-collection":return c5(e,r);default:throw new Error(`Unknown prompt: "${t}". Available: ${_y.map(i=>i.name).join(", ")}`)}}var _y,WC=se(()=>{"use strict";mi();_y=[{name:"analyze-test-failure",description:"Analyze a failed API test run. Returns a structured prompt the LLM uses to diagnose each failure and suggest concrete fixes \u2014 no extra AI configuration needed.",arguments:[{name:"runId",description:"Run ID returned by run_suite, run_collection, or run_folder",required:!0},{name:"request",description:"Filter analysis to a specific request name (omit to analyze all failures)",required:!1}]},{name:"suggest-assertions",description:"Generate pm.test() assertion scripts for a request. The LLM writes Chai-style assertions based on the request definition and optionally an observed response.",arguments:[{name:"collection",description:"Collection name or id",required:!0},{name:"request",description:"Request name or id",required:!0},{name:"runId",description:"Run ID to use observed response data for more accurate assertions (optional)",required:!1}]},{name:"review-collection",description:"Get an AI review of a collection's structure, naming conventions, test coverage gaps, and assertion quality.",arguments:[{name:"collection",description:"Collection name or id",required:!0}]}]});var ep,zC=se(()=>{"use strict";ep=class{store=new Map;newId(){return`run_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}create(e,r){this.prune();let n={id:this.newId(),status:"running",suiteName:e,startedAt:Date.now(),progress:{completed:0,total:r},summary:{passed:0,failed:0,total:0,allPassed:!1},failedRequests:[],allResults:[],reportPath:null};return this.store.set(n.id,n),n}get(e){return this.store.get(e)}require(e){if(typeof e!="string"||!e)throw new Error('"runId" is required');let r=this.store.get(e);if(!r)throw new Error(`Run "${e}" not found. It may have expired (1-hour TTL) or never existed.`);return r}prune(){let e=Date.now()-36e5;for(let[r,n]of this.store)n.startedAt<e&&this.store.delete(r)}values(){return this.store.values()}cancel(e){let r=this.store.get(e);return!r||r.status!=="running"?!1:(r.status="cancelled",r.completedAt=Date.now(),!0)}}});import{createHash as f5}from"crypto";function ws(t,e=40){let r=f5("sha256").update(t,"utf8").digest("hex").slice(0,d5);return t.substring(0,e)+"_"+r}function h5(t,e){return t.length>0&&t.length<=e&&/^[a-zA-Z0-9_-]+$/.test(t)&&!t.includes("__")}function Wa(t,e=p5){return h5(t,e)?t:ws(t,e-20)}function JC(t,e,r){let n=`${t}request__${Wa(e)}__${Wa(r)}`;return n.length<=Ry?n:`${t}request__${ws(e)}__${ws(r)}`}function GC(t,e){let r=`${t}collection__${Wa(e,100)}`;return r.length<=Ry?r:`${t}collection__${ws(e,80)}`}function YC(t,e,r){let n=`${t}folder__${Wa(e)}__${Wa(r)}`;return n.length<=Ry?n:`${t}folder__${ws(e)}__${ws(r)}`}function KC(t,e){let r=`${t}suite__${Wa(e,100)}`;return r.length<=Ry?r:`${t}suite__${ws(e,80)}`}function QC(t){for(let e of["request","collection","folder","suite"]){let r=`${e}__`;if(t.startsWith(r))return{kind:e,tokens:t.slice(r.length).split("__")}}throw new Error(`Unknown MCP tool name: ${t}`)}function Gu(t,e){for(let r of e)if(ws(r)===t)return r;for(let r of e)if(r===t)return r}function ZC(t,e){let r=Gu(t,e);if(r!==void 0)return r;try{let n=Buffer.from(t,"base64url").toString("utf8");if(e.includes(n))return n}catch{}}function XC(t,e,r,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${t}]${i} of the "${r}" collection.`}function ex(t,e){return`Run all ${e} requests in the "${t}" collection.`}function tx(t,e,r){return`Run all ${r} requests in folder "${t}" of the "${e}" collection.`}function rx(t,e,r){return`Run the "${t}" test suite (${e} requests, ${r} iteration(s) by default).`}var d5,p5,Ry,Cy=se(()=>{"use strict";d5=12,p5=60,Ry=126});function nx(t){let e=new Set,r=[];for(let n of t)e.has(n.name)||(e.add(n.name),r.push(n));return r}function ix(t){return Buffer.from(String(t)).toString("base64url")}function sx(t){if(!t)return 0;try{let e=parseInt(Buffer.from(t,"base64url").toString(),10);return Number.isFinite(e)&&e>=0?e:0}catch{return 0}}function ox(t,e,r){let n=r.toolPrefix??"",i=r.toolMode??"auto",s=r.drilldownThreshold??100,o=0;for(let c of t)o+=Xe(c).length;let l=i==="drilldown"||i==="auto"&&o>s;if(i==="flat"&&o>500&&console.warn(`[http-forge MCP] WARNING: toolMode is "flat" but ${o} requests would produce ${o}+ 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.`),l)return nx(jC(n,t.map(c=>c.name),e.map(c=>c.name)).map(c=>({name:c.name,description:c.description,inputSchema:c.inputSchema,...c.annotations&&{annotations:c.annotations}})));let f=[];for(let c of t){let p=Xe(c);for(let{request:h,folderPath:g}of p)f.push({name:JC(n,c.id,h.id),description:XC(h.method,h.name,c.name,g),inputSchema:vy});f.push({name:GC(n,c.id),description:ex(c.name,p.length),inputSchema:by});for(let{folderPath:h,requestCount:g}of Qr(c))g!==0&&f.push({name:YC(n,c.id,h),description:tx(h,c.name,g),inputSchema:Sy})}for(let c of e)f.push({name:KC(n,c.id),description:rx(c.name,c.requests.length,c.config.iterations),inputSchema:wy});return nx(f)}var ax=se(()=>{"use strict";mi();Cy();Qd()});var Yu,lx=se(()=>{"use strict";ia();Yu=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())ht.isExpired(n)||(!n.domain||ht.domainMatches(e,n.domain))&&r.push(n);return r}has(e,r){return this.get(e,r)!==void 0}get(e,r){let n=this.getCookieKey(e,r),i=this.cookies.get(n);if(i&&!ht.isExpired(i))return i}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let r=[];for(let n of this.cookies.values())ht.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=ht.extractDomain(e),i=ht.parseCookieHeaders(r,n);for(let s of i){let o=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(o,s)}}getCookieHeader(e){let r=ht.extractDomain(e),n=ht.extractPath(e),s=this.getCookiesForDomain(r).filter(o=>o.path?n.startsWith(o.path):!0);if(s.length!==0)return ht.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function Ku(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function m5(t){return{index:t.i,iteration:t.it,name:t.n,method:xo[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:Ku(t.i,t.it,t.r),error:t.e}}var ux,xo,tp=se(()=>{"use strict";ux={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},xo={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as Zu from"fs/promises";import*as Qu from"path";function Di(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"")}function cx(t){return(Math.max(0,t)/1e3).toFixed(3)}var Xu,fx=se(()=>{"use strict";tp();Xu=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=Qu.join(this.basePath,e,r),i=JSON.parse(await Zu.readFile(Qu.join(n,"manifest.json"),"utf-8")),s=await this.loadAllSummaries(n,i.totalIndexPages),o=await this.loadAllDetails(n,s),l=this.buildXml(i,s,o),f=Qu.join(n,"junit.xml");return await Zu.writeFile(f,l,"utf-8"),f}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=Qu.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let o=JSON.parse(await Zu.readFile(s,"utf-8"));n.push(...o.summaries)}catch{}}return n}async loadAllDetails(e,r){let n=new Map;for(let i of r){let s=Ku(i.i,i.it,i.r),o=`${i.i}-${i.it}`;try{let l=JSON.parse(await Zu.readFile(Qu.join(e,"results",s),"utf-8"));n.set(o,l)}catch{}}return n}buildGroups(e,r,n){let i=e.config?.iterations>1,s=[],o=new Map;for(let l of r){let f=n.get(`${l.i}-${l.it}`),c=l.cn||f?.collectionName||e.suiteName||"",p=l.fp||f?.folderPath||"",h=`${c}\0${p}`;if(!o.has(h)){let w=[c,p].filter(Boolean).join(" / ")||e.suiteName||"Requests";o.set(h,{label:w,cases:[]}),s.push(h)}let g=l.n||f?.name||xo[l.m]||"request",v=i?`${g} (iteration ${l.it})`:g,_=(f?.assertions??[]).filter(w=>!w.passed).map(w=>({name:w.name,message:w.message}));_.length===0&&l.af>0&&_.push({name:`${l.af} assertion(s) failed`,message:null}),o.get(h).cases.push({name:v,classname:[c,p].filter(Boolean).join(".")||e.suiteName||"http-forge",durationMs:l.d,status:l.s,passed:l.p,error:l.e??f?.error??null,failedAssertions:_,consoleOutput:f?.consoleOutput})}return s.map(l=>o.get(l))}buildXml(e,r,n){let i=this.buildGroups(e,r,n),s=0,o=0,l=0,f=0,c=[];i.forEach((g,v)=>{let _=0,w=0,E=0,k=0,T=[];for(let N of g.cases){_++,k+=N.durationMs;let $=!N.passed&&N.failedAssertions.length===0&&!!N.error,j=!N.passed&&!$;$&&E++,j&&w++;let G=[];if(j){let C=N.failedAssertions.length>0?N.failedAssertions.map(D=>D.name).join("; "):N.error||"Assertion failed",A=N.failedAssertions.map(D=>D.message?`${D.name}: ${D.message}`:D.name).join(`
475
475
  `);G.push(` <failure message="${Di(C)}" type="AssertionFailure">${Di(A)}</failure>`)}$&&G.push(` <error message="${Di(N.error)}" type="RequestError">${Di(N.error)}</error>`),N.consoleOutput&&N.consoleOutput.length>0&&G.push(` <system-out>${Di(N.consoleOutput.join(`
476
- `))}</system-out>`);let O=` <testcase name="${Di(N.name)}" classname="${Di(N.classname)}" time="${cx(N.durationMs)}"`;G.length===0?T.push(`${O} />`):T.push(`${O}>
476
+ `))}</system-out>`);let q=` <testcase name="${Di(N.name)}" classname="${Di(N.classname)}" time="${cx(N.durationMs)}"`;G.length===0?T.push(`${q} />`):T.push(`${q}>
477
477
  ${G.join(`
478
478
  `)}
479
479
  </testcase>`)}s+=_,o+=w,l+=E,f+=k,c.push(` <testsuite name="${Di(g.label)}" tests="${_}" failures="${w}" errors="${E}" skipped="0" time="${cx(k)}" timestamp="${Di(e.startTime)}" id="${v}">
@@ -531,7 +531,7 @@ ${c.join(`
531
531
  <span class="assert-icon">${_t.passed?"\u2713":"\u2717"}</span>
532
532
  ${xt(_t.name)}
533
533
  ${_t.message?`<span class="assert-msg"> \u2014 ${xt(_t.message)}</span>`:""}
534
- </li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',j=K$(w?.request?.headers),G=px(w?{method:w.request?.method,url:w.request?.url,query:w.request?.query,params:w.request?.params,bodyType:w.request?.body?.type,bodyFormat:w.request?.body?.format}:void 0),O=w?.request?.body,C=O&&typeof O=="object"?O.type:void 0,A=O&&typeof O=="object"&&"content"in O?O.content:O,D=C!=="none"&&!(A==null||A===""),B=D?Q$(A):"",F=K$(w?.response?.headers),K=px(w?{status:w.status,statusText:w.statusText,durationMs:w.duration,responseTimeMs:w.response?.time,responseSizeBytes:w.response?.size}:void 0),ee=w?.response?.body!==void 0&&w.response.body!==null?Q$(w.response.body):'<span class="dim">\u2014 no body \u2014</span>',ie=v5(w?.response?.cookies),pe=px(w?{timestamp:w.timestamp?new Date(w.timestamp).toISOString():void 0,nextRequest:w.nextRequest,visualizerTemplate:w.visualizerData?.template,visualizerData:w.visualizerData?.data}:void 0),ke=`
534
+ </li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',j=K$(w?.request?.headers),G=px(w?{method:w.request?.method,url:w.request?.url,query:w.request?.query,params:w.request?.params,bodyType:w.request?.body?.type,bodyFormat:w.request?.body?.format}:void 0),q=w?.request?.body,C=q&&typeof q=="object"?q.type:void 0,A=q&&typeof q=="object"&&"content"in q?q.content:q,D=C!=="none"&&!(A==null||A===""),B=D?Q$(A):"",F=K$(w?.response?.headers),K=px(w?{status:w.status,statusText:w.statusText,durationMs:w.duration,responseTimeMs:w.response?.time,responseSizeBytes:w.response?.size}:void 0),ee=w?.response?.body!==void 0&&w.response.body!==null?Q$(w.response.body):'<span class="dim">\u2014 no body \u2014</span>',ie=v5(w?.response?.cookies),pe=px(w?{timestamp:w.timestamp?new Date(w.timestamp).toISOString():void 0,nextRequest:w.nextRequest,visualizerTemplate:w.visualizerData?.template,visualizerData:w.visualizerData?.data}:void 0),ke=`
535
535
  <div class="detail-section">
536
536
  <div class="pane-section-title">Assertions
537
537
  <span class="assert-counts">
@@ -1010,12 +1010,12 @@ ${c.join(`
1010
1010
  });
1011
1011
  </script>
1012
1012
  </body>
1013
- </html>`}}});import*as Wt from"fs/promises";import*as Zr from"path";function Ja(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,Math.min(r,t.length-1))]}var rc,mx=se(()=>{"use strict";Cn();Qf();hx();tp();rc=class{constructor(e){this.configService=e;let r=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=r.indexPageSize,this.recentErrorsLimit=r.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,r,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=Zr.join(this.basePath,e,s),await Wt.mkdir(Zr.join(this.currentRunPath,"results"),{recursive:!0}),await Wt.mkdir(Zr.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:r,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,r){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"),o=At(r.requestId),l=`result-${s}-iter-${i}-${o}.json`,f=Zr.join(this.currentRunPath,"results",l),c={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,folderPath:r.folderPath||"",collectionName:r.collectionName||"",status:r.response.status,statusText:r.response.statusText||"",duration:r.duration,passed:r.passed,timestamp:n,request:{method:r.executedRequest.method,url:r.executedRequest.url,headers:r.executedRequest.headers,query:r.executedRequest.query,params:r.executedRequest.params,body:r.executedRequest.body},response:{headers:r.response.headers,body:r.response.body,time:r.response.time,size:r.response.size,cookies:r.response.cookies},assertions:r.assertions.map(v=>({name:v.name,passed:v.passed,message:v.message||null})),error:r.error||null,consoleOutput:r.consoleOutput,modifiedVariables:r.modifiedVariables,modifiedEnvironmentVariables:r.modifiedEnvironmentVariables,modifiedCollectionVariables:r.modifiedCollectionVariables,nextRequest:r.nextRequest??null,visualizerData:r.visualizerData};await Wt.writeFile(f,JSON.stringify(C0(c),null,2),"utf-8");let p=r.assertions.filter(v=>v.passed).length,h=r.assertions.filter(v=>!v.passed).length,g={i:this.resultIndex,it:e,n:r.name,m:ux[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:p,af:h,r:r.requestId,e:r.passed?null:r.error||null,fp:r.folderPath||"",cn:r.collectionName||""};return this.currentIndexPage.push(g),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:l}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),g}async finalizeRun(e="completed",r=!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 f in this.currentManifest.requestStats){let c=this.currentManifest.requestStats[f],p=this.requestDurations[f]||[];c.count>0&&(c.avgDuration=Math.round(c.totalDuration/c.count)),c.minDuration===Number.MAX_SAFE_INTEGER&&(c.minDuration=0),p.length>0&&(p.sort((h,g)=>h-g),c.p50=Ja(p,50),c.p90=Ja(p,90),c.p95=Ja(p,95),c.p99=Ja(p,99))}let n=Object.values(this.requestDurations).flat();n.length>0&&(n.sort((f,c)=>f-c),this.currentManifest.stats.p50=Ja(n,50),this.currentManifest.stats.p95=Ja(n,95),this.currentManifest.stats.p99=Ja(n,99)),this.requestDurations={},await this.saveManifest();let i=null,s=this.currentRunPath,o=this.currentSuiteId,l=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,r&&o&&l&&s)try{i=await new rp(this.basePath).generate(o,l)}catch(f){console.warn("[ResultStorage] HTML report generation failed:",f)}return i}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,r,n){let i=Zr.join(this.basePath,e,r,"results",n),s=await Wt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Zr.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Wt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Zr.join(this.basePath,e,r,"manifest.json"),i=await Wt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Zr.join(this.basePath,e);try{let n=await Wt.readdir(r),i=[];for(let s of n.sort().reverse())try{let o=await this.getManifest(e,s);i.push(o)}catch{}return i}catch{return[]}}async listSuites(){try{return(await Wt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Zr.join(this.basePath,e,r);await Wt.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let r=this.configService.getRunnerConfig().resultsRetentionDays;if(r===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-r);let i=0,s=0,o=await this.listSuites();for(let l of o){let f=await this.listRuns(l);for(let c of f)if(new Date(c.startTime)<n){let p=Zr.join(this.basePath,l,c.runId),h=await this.getDirectorySize(p);await Wt.rm(p,{recursive:!0,force:!0}),i++,s+=h}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,r=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${r}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=Zr.join(this.currentRunPath,"manifest.json");await Wt.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`,r=Zr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await Wt.writeFile(r,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let r=this.currentManifest.stats,n=this.currentManifest.requestStats;r.totalRequests++,r.totalDuration+=e.duration,r.minDuration=Math.min(r.minDuration,e.duration),r.maxDuration=Math.max(r.maxDuration,e.duration),e.passed?r.passed++:r.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 r=0;try{let n=await Wt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Zr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let o=await Wt.stat(s);r+=o.size}}}catch{}return r}}});import*as Li from"fs";import*as np from"path";var gx,Ey,Iy,qy,X$=se(()=>{"use strict";gx=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=Li.watch(n,{recursive:!0},(s,o)=>{if(o){let l=np.join(n,o);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:np.join(e,r.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,r){return new gx(e,r)}},Iy=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(Li.existsSync(this.storeFile)){let e=Li.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=np.dirname(this.storeFile);Li.mkdirSync(e,{recursive:!0}),Li.writeFileSync(this.storeFile,JSON.stringify(this.data,null,2),"utf-8")}catch{}}get(e,r){let n=this.data[e];return n!==void 0?n:r}async update(e,r){r===void 0?delete this.data[e]:this.data[e]=r,this.save()}},qy=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as ip from"path";function eN(t){let e=ip.resolve(t.workspaceFolder),{appInfo:r}=t,n=Ba.createFresh(),i=ip.join(e,".http-forge-cache","stores"),s=ip.join(i,"global-state.json"),o={workspaceFolder:e,fileWatcherFactory:new Ey,notificationService:new qy,globalStore:new Iy(s),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"},persistOverrides:!1};return gy(n,o),n}function Nn(t){return eN({workspaceFolder:t})}var Oy=se(()=>{"use strict";NC();MC();X$()});function b5(t){let e=[];return t.map(r=>{let n=xn(r,e);return e.push(n),n})}function tN(t,e,r,n){let i=t.find(c=>c.id===e);if(i)return{item:i,tier:"id"};let s=b5(t.map(c=>c.name)),o=t.filter((c,p)=>s[p]===e);if(o.length===1)return{item:o[0],tier:"slug"};if(o.length>1)throw new Ga(r,e,o.map(c=>({id:c.id,name:c.name,path:n(c)})));let l=e.toLowerCase(),f=t.filter(c=>c.name.toLowerCase()===l);if(f.length===1)return{item:f[0],tier:"name"};throw f.length>1?new Ga(r,e,f.map(c=>({id:c.id,name:c.name,path:n(c)}))):new Error(`${r.charAt(0).toUpperCase()}${r.slice(1)} "${e}" not found`)}function yx(t,e){let{item:r,tier:n}=tN(t,e,"collection",()=>"");return{collection:r,tier:n}}function vx(t,e){let r=e.split("/").map(o=>o.trim()).filter(o=>o.length>0),n=t.items,i=[],s=[];for(let o of r){let l=n.filter(h=>h.type==="folder"),f=i.join("/"),{item:c,tier:p}=tN(l,o,"folder",h=>f?`${f}/${h.name}`:h.name);i.push(c.name),s.push(p),n=c.items??[]}return{folderPath:i.map(br).join("/"),tiers:s}}function rN(t,e,r){let n=[];for(let i of t)if(i.type==="request"){let s=xn(i.name,n);n.push(s),r.push({item:i,folderPath:e,slug:s})}for(let i of t)if(i.type==="folder"){let s=i,o=e?`${e}/${br(s.name)}`:br(s.name);rN(s.items??[],o,r)}}function bx(t,e,r){let n=[];rN(t.items,"",n);let i=r?r.replace(/\/+$/,""):void 0,s=i?n.filter(g=>g.folderPath===i||g.folderPath.startsWith(`${i}/`)):n,o=g=>g.folderPath?`${g.folderPath}/${g.item.name}`:g.item.name,l=s.find(g=>g.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let f=s.filter(g=>g.slug===e);if(f.length===1)return{request:f[0].item,tier:"slug",folderPath:f[0].folderPath};if(f.length>1)throw new Ga("request",e,f.map(g=>({id:g.item.id,name:g.item.name,path:o(g)})));let c=e.toLowerCase(),p=s.filter(g=>g.item.name.toLowerCase()===c);if(p.length===1)return{request:p[0].item,tier:"name",folderPath:p[0].folderPath};if(p.length>1)throw new Ga("request",e,p.map(g=>({id:g.item.id,name:g.item.name,path:o(g)})));let h=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${t.name}"${h}`)}var Ga,Sx=se(()=>{"use strict";na();mi();Ga=class extends Error{constructor(r,n,i){super(`Ambiguous ${r} reference "${n}" matches ${i.length} items:
1013
+ </html>`}}});import*as Wt from"fs/promises";import*as Zr from"path";function Ja(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,Math.min(r,t.length-1))]}var rc,mx=se(()=>{"use strict";Cn();Qf();hx();tp();rc=class{constructor(e){this.configService=e;let r=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=r.indexPageSize,this.recentErrorsLimit=r.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,r,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=Zr.join(this.basePath,e,s),await Wt.mkdir(Zr.join(this.currentRunPath,"results"),{recursive:!0}),await Wt.mkdir(Zr.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:r,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,r){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"),o=At(r.requestId),l=`result-${s}-iter-${i}-${o}.json`,f=Zr.join(this.currentRunPath,"results",l),c={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,folderPath:r.folderPath||"",collectionName:r.collectionName||"",status:r.response.status,statusText:r.response.statusText||"",duration:r.duration,passed:r.passed,timestamp:n,request:{method:r.executedRequest.method,url:r.executedRequest.url,headers:r.executedRequest.headers,query:r.executedRequest.query,params:r.executedRequest.params,body:r.executedRequest.body},response:{headers:r.response.headers,body:r.response.body,time:r.response.time,size:r.response.size,cookies:r.response.cookies},assertions:r.assertions.map(v=>({name:v.name,passed:v.passed,message:v.message||null})),error:r.error||null,consoleOutput:r.consoleOutput,modifiedVariables:r.modifiedVariables,modifiedEnvironmentVariables:r.modifiedEnvironmentVariables,modifiedCollectionVariables:r.modifiedCollectionVariables,nextRequest:r.nextRequest??null,visualizerData:r.visualizerData};await Wt.writeFile(f,JSON.stringify(C0(c),null,2),"utf-8");let p=r.assertions.filter(v=>v.passed).length,h=r.assertions.filter(v=>!v.passed).length,g={i:this.resultIndex,it:e,n:r.name,m:ux[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:p,af:h,r:r.requestId,e:r.passed?null:r.error||null,fp:r.folderPath||"",cn:r.collectionName||""};return this.currentIndexPage.push(g),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:l}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),g}async finalizeRun(e="completed",r=!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 f in this.currentManifest.requestStats){let c=this.currentManifest.requestStats[f],p=this.requestDurations[f]||[];c.count>0&&(c.avgDuration=Math.round(c.totalDuration/c.count)),c.minDuration===Number.MAX_SAFE_INTEGER&&(c.minDuration=0),p.length>0&&(p.sort((h,g)=>h-g),c.p50=Ja(p,50),c.p90=Ja(p,90),c.p95=Ja(p,95),c.p99=Ja(p,99))}let n=Object.values(this.requestDurations).flat();n.length>0&&(n.sort((f,c)=>f-c),this.currentManifest.stats.p50=Ja(n,50),this.currentManifest.stats.p95=Ja(n,95),this.currentManifest.stats.p99=Ja(n,99)),this.requestDurations={},await this.saveManifest();let i=null,s=this.currentRunPath,o=this.currentSuiteId,l=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,r&&o&&l&&s)try{i=await new rp(this.basePath).generate(o,l)}catch(f){console.warn("[ResultStorage] HTML report generation failed:",f)}return i}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,r,n){let i=Zr.join(this.basePath,e,r,"results",n),s=await Wt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Zr.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Wt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Zr.join(this.basePath,e,r,"manifest.json"),i=await Wt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Zr.join(this.basePath,e);try{let n=await Wt.readdir(r),i=[];for(let s of n.sort().reverse())try{let o=await this.getManifest(e,s);i.push(o)}catch{}return i}catch{return[]}}async listSuites(){try{return(await Wt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Zr.join(this.basePath,e,r);await Wt.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let r=this.configService.getRunnerConfig().resultsRetentionDays;if(r===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-r);let i=0,s=0,o=await this.listSuites();for(let l of o){let f=await this.listRuns(l);for(let c of f)if(new Date(c.startTime)<n){let p=Zr.join(this.basePath,l,c.runId),h=await this.getDirectorySize(p);await Wt.rm(p,{recursive:!0,force:!0}),i++,s+=h}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,r=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${r}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=Zr.join(this.currentRunPath,"manifest.json");await Wt.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`,r=Zr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await Wt.writeFile(r,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let r=this.currentManifest.stats,n=this.currentManifest.requestStats;r.totalRequests++,r.totalDuration+=e.duration,r.minDuration=Math.min(r.minDuration,e.duration),r.maxDuration=Math.max(r.maxDuration,e.duration),e.passed?r.passed++:r.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 r=0;try{let n=await Wt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Zr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let o=await Wt.stat(s);r+=o.size}}}catch{}return r}}});import*as Li from"fs";import*as np from"path";var gx,Ey,Iy,Oy,X$=se(()=>{"use strict";gx=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=Li.watch(n,{recursive:!0},(s,o)=>{if(o){let l=np.join(n,o);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:np.join(e,r.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,r){return new gx(e,r)}},Iy=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(Li.existsSync(this.storeFile)){let e=Li.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=np.dirname(this.storeFile);Li.mkdirSync(e,{recursive:!0}),Li.writeFileSync(this.storeFile,JSON.stringify(this.data,null,2),"utf-8")}catch{}}get(e,r){let n=this.data[e];return n!==void 0?n:r}async update(e,r){r===void 0?delete this.data[e]:this.data[e]=r,this.save()}},Oy=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as ip from"path";function eN(t){let e=ip.resolve(t.workspaceFolder),{appInfo:r}=t,n=Ba.createFresh(),i=ip.join(e,".http-forge-cache","stores"),s=ip.join(i,"global-state.json"),o={workspaceFolder:e,fileWatcherFactory:new Ey,notificationService:new Oy,globalStore:new Iy(s),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"},persistOverrides:!1};return gy(n,o),n}function Nn(t){return eN({workspaceFolder:t})}var qy=se(()=>{"use strict";NC();MC();X$()});function b5(t){let e=[];return t.map(r=>{let n=xn(r,e);return e.push(n),n})}function tN(t,e,r,n){let i=t.find(c=>c.id===e);if(i)return{item:i,tier:"id"};let s=b5(t.map(c=>c.name)),o=t.filter((c,p)=>s[p]===e);if(o.length===1)return{item:o[0],tier:"slug"};if(o.length>1)throw new Ga(r,e,o.map(c=>({id:c.id,name:c.name,path:n(c)})));let l=e.toLowerCase(),f=t.filter(c=>c.name.toLowerCase()===l);if(f.length===1)return{item:f[0],tier:"name"};throw f.length>1?new Ga(r,e,f.map(c=>({id:c.id,name:c.name,path:n(c)}))):new Error(`${r.charAt(0).toUpperCase()}${r.slice(1)} "${e}" not found`)}function yx(t,e){let{item:r,tier:n}=tN(t,e,"collection",()=>"");return{collection:r,tier:n}}function vx(t,e){let r=e.split("/").map(o=>o.trim()).filter(o=>o.length>0),n=t.items,i=[],s=[];for(let o of r){let l=n.filter(h=>h.type==="folder"),f=i.join("/"),{item:c,tier:p}=tN(l,o,"folder",h=>f?`${f}/${h.name}`:h.name);i.push(c.name),s.push(p),n=c.items??[]}return{folderPath:i.map(br).join("/"),tiers:s}}function rN(t,e,r){let n=[];for(let i of t)if(i.type==="request"){let s=xn(i.name,n);n.push(s),r.push({item:i,folderPath:e,slug:s})}for(let i of t)if(i.type==="folder"){let s=i,o=e?`${e}/${br(s.name)}`:br(s.name);rN(s.items??[],o,r)}}function bx(t,e,r){let n=[];rN(t.items,"",n);let i=r?r.replace(/\/+$/,""):void 0,s=i?n.filter(g=>g.folderPath===i||g.folderPath.startsWith(`${i}/`)):n,o=g=>g.folderPath?`${g.folderPath}/${g.item.name}`:g.item.name,l=s.find(g=>g.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let f=s.filter(g=>g.slug===e);if(f.length===1)return{request:f[0].item,tier:"slug",folderPath:f[0].folderPath};if(f.length>1)throw new Ga("request",e,f.map(g=>({id:g.item.id,name:g.item.name,path:o(g)})));let c=e.toLowerCase(),p=s.filter(g=>g.item.name.toLowerCase()===c);if(p.length===1)return{request:p[0].item,tier:"name",folderPath:p[0].folderPath};if(p.length>1)throw new Ga("request",e,p.map(g=>({id:g.item.id,name:g.item.name,path:o(g)})));let h=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${t.name}"${h}`)}var Ga,Sx=se(()=>{"use strict";na();mi();Ga=class extends Error{constructor(r,n,i){super(`Ambiguous ${r} reference "${n}" matches ${i.length} items:
1014
1014
  `+i.map(s=>` - ${s.name} (id: ${s.id}, path: ${s.path||"/"})`).join(`
1015
1015
  `)+`
1016
- Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var op={};Ws(op,{runCollection:()=>_s,runFolder:()=>x5,runRequest:()=>ky,runSuite:()=>sp});function _x(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function iN(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function S5(){return iN(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function w5(){let t=process.env.HTTP_FORGE_MAX_REQUESTS;if(!t||t.trim()==="")return 50;let e=Number(t);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 sN(t,e=[]){return iN(process.env.HTTP_FORGE_GENERATE_REPORTS)||e.includes("html")?!0:t.includes("report")}function wx(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function _5(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function oN(t){return ki(_5(t))}function aN(t){return S0((t??[]).map(e=>({name:e.name,value:e.value})))}function nN(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function lN(t){let e=["none","inherit","basic","bearer","apikey","oauth2"],r=t.auth?.type&&e.includes(t.auth.type)?t.auth.type:void 0;return{id:t.id,name:t.name,method:t.method,url:t.url,headers:Array.isArray(t.headers)?t.headers.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):t.headers,query:Array.isArray(t.query)?t.query.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):t.query,params:t.params?Object.entries(t.params).reduce((n,[i,s])=>(n[i]=typeof s=="string"?s:s.value??"",n),{}):void 0,body:t.body??null,scripts:t.scripts,settings:t.settings,auth:{type:r==="inherit"?"none":r,bearerToken:t.auth?.bearerToken,basicAuth:t.auth?.basicAuth,apikey:t.auth?.apikey,oauth2:t.auth?.oauth2}}}function uN(t,e){let r={...t};return e.headers&&(r.headers={...t.headers??{},...e.headers}),e.query&&(r.query=e.query),e.body!==void 0&&(r.body={type:"raw",raw:e.body,contentType:"application/json"}),r}function cN(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function fN(t,e,r){if(t&&t.type&&t.type!=="inherit")return t.type==="none"?void 0:t;for(let n=e.length-1;n>=0;n--){let i=e[n];if(i?.type&&i.type!=="inherit")return i.type==="none"?void 0:i}if(r&&r.type&&r.type!=="inherit")return r.type==="none"?void 0:r}function Rx(t,e,r=t.items,n=[],i=[]){for(let s of r){if(s.type==="request"&&s.id===e)return{request:s,folderScriptsChain:[...n],folderAuthChain:[...i]};if(s.type==="folder"){let o=s,l=o.scripts?[...n,o.scripts]:[...n],f=o.auth?[...i,o.auth]:[...i],c=Rx(t,e,o.items??[],l,f);if(c)return c}}}function dN(t,e=t.items,r=[],n=[]){let i=[];for(let s of e)if(s.type==="request")i.push({request:s,folderScriptsChain:[...r],folderPath:n.map(br).join("/")});else{let o=s,l=o.scripts?[...r,o.scripts]:[...r],f=[...n,o.name];i.push(...dN(t,o.items??[],l,f))}return i}function R5(t,e,r=!0){if(!e)return t;let n=e.replace(/\/+$/,"");return t.filter(({folderPath:i})=>r?i===n||i.startsWith(`${n}/`):i===n)}function C5(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function pN(t,e){if(e.collectionId){let r=t.getCollection(e.collectionId);if(!r)throw new Error(`Collection "${e.collectionId}" not found`);return r}if(e.collectionRef){let{collection:r,tier:n}=yx(t.getAllCollections(),e.collectionRef);return e.onResolve?.({kind:"collection",value:e.collectionRef,tier:n,id:r.id}),r}throw new Error("A collection reference is required (collectionId or collectionRef)")}function hN(t,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:r}=vx(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function mN(t,e,r,n){let i=r.environment??t.environmentConfig.getSelectedEnvironment(),s=r.iterations??e.config?.iterations??1,o=r.stopOnError??e.config?.stopOnError??!1,l=r.delay??e.config?.delayBetweenRequests??0,f=Math.max(1,Math.min(50,r.concurrency??1)),c=r.requestFilter,p=r.include??[],h=r.reporters??[],g=h.includes("junit"),v=cN(r.variables),_=S5(),w=sN(p,h),E=e.requests.filter(de=>!(de.enabled===!1||c&&!c.some(le=>de.name.toLowerCase().includes(le.toLowerCase()))));if(_){let de=w5(),le=E.length*s;if(le>de)throw new Error(`Suite "${e.name}" would execute ${le} request calls (${E.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${de}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let k=new rc(t.config),T=await k.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:o}),N=[],$=[],j=0,G=0,O=new Set,C=new AbortController,A=new Yu;async function D(de){for(let le of E){if(C.signal.aborted)break;let ve=t.collection.getCollection(le.collectionId);if(!ve)continue;let We=Rx(ve,le.requestId);if(!We)continue;let mt=fN(We.request.auth,We.folderAuthChain,ve.auth),ce=new no(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,A,ve.scripts,We.folderScriptsChain,void 0,ve.name,ve.auth,de,s),rr=uN(lN({...We.request,auth:mt}),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),$e=await ce.execute(rr,v,C.signal);if($e.folderPath=le.folderPath??"",$e.collectionName=ve.name,await k.saveResult(de,$e),$e.assertions?.length||O.add(le.name),$e.passed?j++:G++,p.includes("perRequest")&&N.push({name:le.name,iteration:de,status:$e.response?.status,ok:($e.response?.status??0)>=200&&($e.response?.status??0)<300,duration:`${$e.duration}ms`,allPassed:$e.passed,...p.includes("consoleOutput")&&$e.consoleOutput?.length?{consoleOutput:$e.consoleOutput}:{}}),!$e.passed&&($.push({name:le.name,iteration:de,method:$e.executedRequest?.method,url:$e.executedRequest?.url,requestBody:wx($e.executedRequest?.body?.content)??$e.executedRequest?.body?.content??null,requestHeaders:ki($e.executedRequest?.headers??{}),status:$e.response?.status,duration:`${$e.duration}ms`,body:wx($e.response?.body),headers:oN($e.response?.headers),cookies:aN($e.response?.cookies),failedTests:$e.assertions?.filter(nt=>!nt.passed).map(nt=>({name:nt.name,...nt.message?{message:nt.message}:{}})),...$e.error?{error:$e.error}:{},...p.includes("consoleOutput")&&$e.consoleOutput?.length?{consoleOutput:$e.consoleOutput}:{}}),o)){C.abort();break}l>0&&!C.signal.aborted&&await new Promise(nt=>setTimeout(nt,l))}}for(let de=1;de<=s&&!C.signal.aborted;de+=f){let le=Math.min(de+f-1,s),ve=Array.from({length:le-de+1},(We,mt)=>de+mt);await Promise.all(ve.map(D))}let B=await k.finalizeRun("completed",w),F=null;if(g)try{F=await new Xu(k.getBasePath()).generate(e.id,T)}catch(de){console.warn("[direct-execution] JUnit report generation failed:",de)}let K=n==="collection"?"collection":"suite",ie=k.getCurrentStats()?.stats,pe=ie?{min:ie.minDuration,max:ie.maxDuration,avg:ie.avgDuration,p50:ie.p50??null,p95:ie.p95??null,p99:ie.p99??null}:null,ke={[K]:e.name,environment:i,summary:{total:j+G,passed:j,failed:G,...s>1?{iterations:s}:{},...f>1?{concurrency:f}:{},allPassed:G===0,...pe?{durationMs:pe}:{}}};if((G>0||p.includes("failedOnly"))&&(ke.failedRequests=$),p.includes("perRequest")&&(ke.results=N),B!==null&&(ke.report={uri:`file://${B}`,hint:"Click the URI to open the HTML report in your browser"}),F!==null&&(ke.junitReport={path:F}),O.size>0){let de=E.length,le=O.size,ve=Array.from(O).slice(0,5);ke.noAssertionExamples=ve;let We=e.name;if(le/de>.5)ke._suggestions=[`${le}/${de} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${We}") for a full coverage analysis and to identify assertion gaps.`];else{let mt=ve.map(ce=>`"${ce}"`).join(", ");ke._suggestions=[`${le} request(s) have no pm.test() assertions: ${mt}. Invoke the "suggest-assertions" prompt (collection="${We}") to generate test coverage for them.`]}}return ke}async function ky(t){let e=Nn(t.workspaceFolder),r=t.include??[],n=t.reporters??[],i=n.includes("junit"),s=sN(r,n);try{let o=e.collection,l=pN(o,t),f=hN(l,t),c=t.requestId;if(!c){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let $=bx(l,t.requestRef,f);c=$.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:$.tier,id:c,path:$.folderPath?`${$.folderPath}/${$.request.name}`:$.request.name})}let p=Rx(l,c);if(!p)throw new Error(`Request "${c}" not found in collection "${l.name}"`);let h=fN(p.request.auth,p.folderAuthChain,l.auth),g=t.environment||e.environmentConfig.getSelectedEnvironment(),v=uN(lN({...p.request,auth:h}),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),w=await new no(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,g,new Yu,l.scripts,p.folderScriptsChain,void 0,l.name,l.auth).execute(v,cN(t.variables)),E=null,k=null;if(s||i){let $=new rc(e.config),j=`request-${nN(l.id)}-${nN(c)}`,G=`Request: ${p.request.name}`,O=await $.initializeRun(j,G,g,{iterations:1,delayBetweenRequests:0,stopOnError:!0});if(await $.saveResult(1,w),E=await $.finalizeRun("completed",s),i)try{k=await new Xu($.getBasePath()).generate(j,O)}catch(C){console.warn("[direct-execution] JUnit report generation failed:",C)}}let T=oN(w.response?.headers),N=aN(w.response?.cookies);return{request:p.request.name,status:w.response?.status||0,ok:(w.response?.status??0)>=200&&(w.response?.status??0)<300,duration:`${w.duration}ms`,body:wx(w.response?.body),allPassed:w.passed,assertions:w.assertions?.map($=>({name:$.name,passed:$.passed,message:$.message})),...r.includes("headers")?{headers:T}:{},...r.includes("cookies")?{cookies:N}:{},...r.includes("tests")?{tests:w.assertions?.map($=>({name:$.name,passed:$.passed,...$.message?{message:$.message}:{}}))}:{},...Object.keys(w.modifiedVariables??{}).length?{modifiedVariables:w.modifiedVariables}:{},...r.includes("consoleOutput")&&w.consoleOutput?.length?{consoleOutput:w.consoleOutput}:{},...E!==null?{report:{uri:`file://${E}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...k!==null?{junitReport:{path:k}}:{},...w.error?{error:w.error}:{}}}catch(o){throw o}finally{_x(e)}}async function _s(t){let e=Nn(t.workspaceFolder);try{let r=e.collection,n=pN(r,t),i=hN(n,t),s=dN(n),o=R5(s,i,t.recursive);if(o.length===0&&i)throw new Error(`No requests found under folder "${i}" in collection "${n.name}"`);let l=o.map(({request:c,folderPath:p})=>({id:c.id,slug:c.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:c.id,name:c.name,method:c.method,collectionName:n.name,folderPath:p,enabled:!0})),f={id:i?`temp-${n.id}-${C5(i)}`:`temp-${n.id}`,name:i?`${n.name} / ${i}`:n.name,requests:l,config:{iterations:1,delay:0,stopOnError:t.stopOnError??!1,readFromSharedSession:!1,writeToSharedSession:!1},isTemporary:!0,createdAt:Date.now(),updatedAt:Date.now()};return mN(e,f,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:void 0,include:t.include,reporters:t.reporters,concurrency:t.concurrency,variables:t.variables},"collection")}catch(r){throw r}finally{_x(e)}}async function x5(t){return _s({recursive:!0,...t})}async function sp(t){let e=Nn(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return mN(e,n,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include,reporters:t.reporters,concurrency:t.concurrency,variables:t.variables},"suite")}catch(r){throw r}finally{_x(e)}}var nc=se(()=>{"use strict";lx();Im();Qf();fx();mx();mi();Oy();Sx()});var bN={};Ws(bN,{createMcpRuntime:()=>L5});import*as vN from"fs";import{createServer as E5}from"http";import*as Ka from"path";async function gi(t){let e=process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS,r=process.env.HTTP_FORGE_GENERATE_REPORTS;process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS="true",process.env.HTTP_FORGE_GENERATE_REPORTS="true";try{return await t()}finally{e===void 0?delete process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS:process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS=e,r===void 0?delete process.env.HTTP_FORGE_GENERATE_REPORTS:process.env.HTTP_FORGE_GENERATE_REPORTS=r}}function ic(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}async function O5(t,e){let r=Ex.get(t);if(r&&r.expiresAt>Date.now())return r.tools;let n=Cx.get(t);if(n)return n;let i=(async()=>{let s=e.config.getMcpConfig(),o=(c,p)=>!!c?.length&&(c.includes(p.id)||c.includes(p.name)),l=e.collection.getAllCollections().filter(c=>!o(s.excludedCollections,c)),f=(await e.testSuite.getAllSuites()).filter(c=>!o(s.excludedSuites,c));return ox(l,f,s)})().then(s=>(Ex.set(t,{tools:s,expiresAt:Date.now()+q5}),s)).finally(()=>Cx.delete(t));return Cx.set(t,i),i}function k5(t,e){let r=t.config.getMcpConfig().toolPrefix??"";return r&&e.startsWith(r)?e.slice(r.length):e}function P5(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function gN(t,e,r,n){Ya(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}function T5(t){return t.config.getMcpConfig().toolPageSize??200}async function A5(t,e){switch(e.method){case"initialize":return{protocolVersion:"2024-11-05",capabilities:{tools:{},prompts:{}},serverInfo:{name:"http-forge",version:"1.0.0"},instructions:"You are assisting with HTTP API testing via HTTP Forge. When a run_suite, run_collection, or run_folder call completes with failures (summary.failed > 0 or allPassed === false), automatically analyze the 'failedRequests' in the response and provide: (1) root cause for each failure, (2) specific fix recommendations, (3) updated pm.test() assertion scripts where relevant. Do not wait for the user to ask \u2014 proactively diagnose and suggest fixes. For async runs (status: 'running'), poll with get_run_status until complete, then call get_run_summary. When get_run_summary returns a _nextStep field you MUST execute it immediately \u2014 the failedRequests array is already included inline so no extra tool call is needed. Analyze the failures and provide diagnosis without waiting for the user."};case"tools/list":{let r=await O5(t.workspaceFolder,t.container),n=e.params??{},i=typeof n.cursor=="string"?n.cursor:void 0,s=T5(t.container);if(s<=0||r.length<=s)return{tools:r};let o=sx(i),l=r.slice(o,o+s),f=o+s,c={tools:l};return f<r.length&&(c.nextCursor=ix(f)),c}case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await Ix(t,n,i??{}),o=s,l=o?.summary;l&&((l.failed??0)>0||l.allPassed===!1)&&(o._nextStep=`${l.failed??"Some"} request(s) failed. Please analyze the 'failedRequests' above: identify the root cause of each failure, suggest specific fixes (URL, auth, body, environment variables), and provide updated pm.test() assertion scripts where the assertions are incorrect.`);let f=JSON.stringify(s,null,2),c=P5(f,t.host,t.port),p=c.match(/"uri"\s*:\s*"(http:\/\/[^"]+\/report\?[^"]+)"/),h=p?`
1016
+ Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var op={};Ws(op,{runCollection:()=>_s,runFolder:()=>x5,runRequest:()=>ky,runSuite:()=>sp});function _x(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function iN(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function S5(){return iN(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function w5(){let t=process.env.HTTP_FORGE_MAX_REQUESTS;if(!t||t.trim()==="")return 50;let e=Number(t);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 sN(t,e=[]){return iN(process.env.HTTP_FORGE_GENERATE_REPORTS)||e.includes("html")?!0:t.includes("report")}function wx(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function _5(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function oN(t){return ki(_5(t))}function aN(t){return S0((t??[]).map(e=>({name:e.name,value:e.value})))}function nN(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function lN(t){let e=["none","inherit","basic","bearer","apikey","oauth2"],r=t.auth?.type&&e.includes(t.auth.type)?t.auth.type:void 0;return{id:t.id,name:t.name,method:t.method,url:t.url,headers:Array.isArray(t.headers)?t.headers.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):t.headers,query:Array.isArray(t.query)?t.query.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):t.query,params:t.params?Object.entries(t.params).reduce((n,[i,s])=>(n[i]=typeof s=="string"?s:s.value??"",n),{}):void 0,body:t.body??null,scripts:t.scripts,settings:t.settings,auth:{type:r==="inherit"?"none":r,bearerToken:t.auth?.bearerToken,basicAuth:t.auth?.basicAuth,apikey:t.auth?.apikey,oauth2:t.auth?.oauth2}}}function uN(t,e){let r={...t};return e.headers&&(r.headers={...t.headers??{},...e.headers}),e.query&&(r.query=e.query),e.body!==void 0&&(r.body={type:"raw",raw:e.body,contentType:"application/json"}),r}function cN(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function fN(t,e,r){if(t&&t.type&&t.type!=="inherit")return t.type==="none"?void 0:t;for(let n=e.length-1;n>=0;n--){let i=e[n];if(i?.type&&i.type!=="inherit")return i.type==="none"?void 0:i}if(r&&r.type&&r.type!=="inherit")return r.type==="none"?void 0:r}function Rx(t,e,r=t.items,n=[],i=[]){for(let s of r){if(s.type==="request"&&s.id===e)return{request:s,folderScriptsChain:[...n],folderAuthChain:[...i]};if(s.type==="folder"){let o=s,l=o.scripts?[...n,o.scripts]:[...n],f=o.auth?[...i,o.auth]:[...i],c=Rx(t,e,o.items??[],l,f);if(c)return c}}}function dN(t,e=t.items,r=[],n=[]){let i=[];for(let s of e)if(s.type==="request")i.push({request:s,folderScriptsChain:[...r],folderPath:n.map(br).join("/")});else{let o=s,l=o.scripts?[...r,o.scripts]:[...r],f=[...n,o.name];i.push(...dN(t,o.items??[],l,f))}return i}function R5(t,e,r=!0){if(!e)return t;let n=e.replace(/\/+$/,"");return t.filter(({folderPath:i})=>r?i===n||i.startsWith(`${n}/`):i===n)}function C5(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function pN(t,e){if(e.collectionId){let r=t.getCollection(e.collectionId);if(!r)throw new Error(`Collection "${e.collectionId}" not found`);return r}if(e.collectionRef){let{collection:r,tier:n}=yx(t.getAllCollections(),e.collectionRef);return e.onResolve?.({kind:"collection",value:e.collectionRef,tier:n,id:r.id}),r}throw new Error("A collection reference is required (collectionId or collectionRef)")}function hN(t,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:r}=vx(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function mN(t,e,r,n){let i=r.environment??t.environmentConfig.getSelectedEnvironment(),s=r.iterations??e.config?.iterations??1,o=r.stopOnError??e.config?.stopOnError??!1,l=r.delay??e.config?.delayBetweenRequests??0,f=Math.max(1,Math.min(50,r.concurrency??1)),c=r.requestFilter,p=r.include??[],h=r.reporters??[],g=h.includes("junit"),v=cN(r.variables),_=S5(),w=sN(p,h),E=e.requests.filter(de=>!(de.enabled===!1||c&&!c.some(le=>de.name.toLowerCase().includes(le.toLowerCase()))));if(_){let de=w5(),le=E.length*s;if(le>de)throw new Error(`Suite "${e.name}" would execute ${le} request calls (${E.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${de}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let k=new rc(t.config),T=await k.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:o}),N=[],$=[],j=0,G=0,q=new Set,C=new AbortController,A=new Yu;async function D(de){for(let le of E){if(C.signal.aborted)break;let ve=t.collection.getCollection(le.collectionId);if(!ve)continue;let We=Rx(ve,le.requestId);if(!We)continue;let mt=fN(We.request.auth,We.folderAuthChain,ve.auth),ce=new no(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,A,ve.scripts,We.folderScriptsChain,void 0,ve.name,ve.auth,de,s),rr=uN(lN({...We.request,auth:mt}),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),$e=await ce.execute(rr,v,C.signal);if($e.folderPath=le.folderPath??"",$e.collectionName=ve.name,await k.saveResult(de,$e),$e.assertions?.length||q.add(le.name),$e.passed?j++:G++,p.includes("perRequest")&&N.push({name:le.name,iteration:de,status:$e.response?.status,ok:($e.response?.status??0)>=200&&($e.response?.status??0)<300,duration:`${$e.duration}ms`,allPassed:$e.passed,...p.includes("consoleOutput")&&$e.consoleOutput?.length?{consoleOutput:$e.consoleOutput}:{}}),!$e.passed&&($.push({name:le.name,iteration:de,method:$e.executedRequest?.method,url:$e.executedRequest?.url,requestBody:wx($e.executedRequest?.body?.content)??$e.executedRequest?.body?.content??null,requestHeaders:ki($e.executedRequest?.headers??{}),status:$e.response?.status,duration:`${$e.duration}ms`,body:wx($e.response?.body),headers:oN($e.response?.headers),cookies:aN($e.response?.cookies),failedTests:$e.assertions?.filter(nt=>!nt.passed).map(nt=>({name:nt.name,...nt.message?{message:nt.message}:{}})),...$e.error?{error:$e.error}:{},...p.includes("consoleOutput")&&$e.consoleOutput?.length?{consoleOutput:$e.consoleOutput}:{}}),o)){C.abort();break}l>0&&!C.signal.aborted&&await new Promise(nt=>setTimeout(nt,l))}}for(let de=1;de<=s&&!C.signal.aborted;de+=f){let le=Math.min(de+f-1,s),ve=Array.from({length:le-de+1},(We,mt)=>de+mt);await Promise.all(ve.map(D))}let B=await k.finalizeRun("completed",w),F=null;if(g)try{F=await new Xu(k.getBasePath()).generate(e.id,T)}catch(de){console.warn("[direct-execution] JUnit report generation failed:",de)}let K=n==="collection"?"collection":"suite",ie=k.getCurrentStats()?.stats,pe=ie?{min:ie.minDuration,max:ie.maxDuration,avg:ie.avgDuration,p50:ie.p50??null,p95:ie.p95??null,p99:ie.p99??null}:null,ke={[K]:e.name,environment:i,summary:{total:j+G,passed:j,failed:G,...s>1?{iterations:s}:{},...f>1?{concurrency:f}:{},allPassed:G===0,...pe?{durationMs:pe}:{}}};if((G>0||p.includes("failedOnly"))&&(ke.failedRequests=$),p.includes("perRequest")&&(ke.results=N),B!==null&&(ke.report={uri:`file://${B}`,hint:"Click the URI to open the HTML report in your browser"}),F!==null&&(ke.junitReport={path:F}),q.size>0){let de=E.length,le=q.size,ve=Array.from(q).slice(0,5);ke.noAssertionExamples=ve;let We=e.name;if(le/de>.5)ke._suggestions=[`${le}/${de} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${We}") for a full coverage analysis and to identify assertion gaps.`];else{let mt=ve.map(ce=>`"${ce}"`).join(", ");ke._suggestions=[`${le} request(s) have no pm.test() assertions: ${mt}. Invoke the "suggest-assertions" prompt (collection="${We}") to generate test coverage for them.`]}}return ke}async function ky(t){let e=Nn(t.workspaceFolder),r=t.include??[],n=t.reporters??[],i=n.includes("junit"),s=sN(r,n);try{let o=e.collection,l=pN(o,t),f=hN(l,t),c=t.requestId;if(!c){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let $=bx(l,t.requestRef,f);c=$.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:$.tier,id:c,path:$.folderPath?`${$.folderPath}/${$.request.name}`:$.request.name})}let p=Rx(l,c);if(!p)throw new Error(`Request "${c}" not found in collection "${l.name}"`);let h=fN(p.request.auth,p.folderAuthChain,l.auth),g=t.environment||e.environmentConfig.getSelectedEnvironment(),v=uN(lN({...p.request,auth:h}),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),w=await new no(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,g,new Yu,l.scripts,p.folderScriptsChain,void 0,l.name,l.auth).execute(v,cN(t.variables)),E=null,k=null;if(s||i){let $=new rc(e.config),j=`request-${nN(l.id)}-${nN(c)}`,G=`Request: ${p.request.name}`,q=await $.initializeRun(j,G,g,{iterations:1,delayBetweenRequests:0,stopOnError:!0});if(await $.saveResult(1,w),E=await $.finalizeRun("completed",s),i)try{k=await new Xu($.getBasePath()).generate(j,q)}catch(C){console.warn("[direct-execution] JUnit report generation failed:",C)}}let T=oN(w.response?.headers),N=aN(w.response?.cookies);return{request:p.request.name,status:w.response?.status||0,ok:(w.response?.status??0)>=200&&(w.response?.status??0)<300,duration:`${w.duration}ms`,body:wx(w.response?.body),allPassed:w.passed,assertions:w.assertions?.map($=>({name:$.name,passed:$.passed,message:$.message})),...r.includes("headers")?{headers:T}:{},...r.includes("cookies")?{cookies:N}:{},...r.includes("tests")?{tests:w.assertions?.map($=>({name:$.name,passed:$.passed,...$.message?{message:$.message}:{}}))}:{},...Object.keys(w.modifiedVariables??{}).length?{modifiedVariables:w.modifiedVariables}:{},...r.includes("consoleOutput")&&w.consoleOutput?.length?{consoleOutput:w.consoleOutput}:{},...E!==null?{report:{uri:`file://${E}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...k!==null?{junitReport:{path:k}}:{},...w.error?{error:w.error}:{}}}catch(o){throw o}finally{_x(e)}}async function _s(t){let e=Nn(t.workspaceFolder);try{let r=e.collection,n=pN(r,t),i=hN(n,t),s=dN(n),o=R5(s,i,t.recursive);if(o.length===0&&i)throw new Error(`No requests found under folder "${i}" in collection "${n.name}"`);let l=o.map(({request:c,folderPath:p})=>({id:c.id,slug:c.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:c.id,name:c.name,method:c.method,collectionName:n.name,folderPath:p,enabled:!0})),f={id:i?`temp-${n.id}-${C5(i)}`:`temp-${n.id}`,name:i?`${n.name} / ${i}`:n.name,requests:l,config:{iterations:1,delay:0,stopOnError:t.stopOnError??!1,readFromSharedSession:!1,writeToSharedSession:!1},isTemporary:!0,createdAt:Date.now(),updatedAt:Date.now()};return mN(e,f,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:void 0,include:t.include,reporters:t.reporters,concurrency:t.concurrency,variables:t.variables},"collection")}catch(r){throw r}finally{_x(e)}}async function x5(t){return _s({recursive:!0,...t})}async function sp(t){let e=Nn(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return mN(e,n,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include,reporters:t.reporters,concurrency:t.concurrency,variables:t.variables},"suite")}catch(r){throw r}finally{_x(e)}}var nc=se(()=>{"use strict";lx();Im();Qf();fx();mx();mi();qy();Sx()});var bN={};Ws(bN,{createMcpRuntime:()=>L5});import*as vN from"fs";import{createServer as E5}from"http";import*as Ka from"path";async function gi(t){let e=process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS,r=process.env.HTTP_FORGE_GENERATE_REPORTS;process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS="true",process.env.HTTP_FORGE_GENERATE_REPORTS="true";try{return await t()}finally{e===void 0?delete process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS:process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS=e,r===void 0?delete process.env.HTTP_FORGE_GENERATE_REPORTS:process.env.HTTP_FORGE_GENERATE_REPORTS=r}}function ic(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}async function q5(t,e){let r=Ex.get(t);if(r&&r.expiresAt>Date.now())return r.tools;let n=Cx.get(t);if(n)return n;let i=(async()=>{let s=e.config.getMcpConfig(),o=(c,p)=>!!c?.length&&(c.includes(p.id)||c.includes(p.name)),l=e.collection.getAllCollections().filter(c=>!o(s.excludedCollections,c)),f=(await e.testSuite.getAllSuites()).filter(c=>!o(s.excludedSuites,c));return ox(l,f,s)})().then(s=>(Ex.set(t,{tools:s,expiresAt:Date.now()+O5}),s)).finally(()=>Cx.delete(t));return Cx.set(t,i),i}function k5(t,e){let r=t.config.getMcpConfig().toolPrefix??"";return r&&e.startsWith(r)?e.slice(r.length):e}function P5(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function gN(t,e,r,n){Ya(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}function T5(t){return t.config.getMcpConfig().toolPageSize??200}async function A5(t,e){switch(e.method){case"initialize":return{protocolVersion:"2024-11-05",capabilities:{tools:{},prompts:{}},serverInfo:{name:"http-forge",version:"1.0.0"},instructions:"You are assisting with HTTP API testing via HTTP Forge. When a run_suite, run_collection, or run_folder call completes with failures (summary.failed > 0 or allPassed === false), automatically analyze the 'failedRequests' in the response and provide: (1) root cause for each failure, (2) specific fix recommendations, (3) updated pm.test() assertion scripts where relevant. Do not wait for the user to ask \u2014 proactively diagnose and suggest fixes. For async runs (status: 'running'), poll with get_run_status until complete, then call get_run_summary. When get_run_summary returns a _nextStep field you MUST execute it immediately \u2014 the failedRequests array is already included inline so no extra tool call is needed. Analyze the failures and provide diagnosis without waiting for the user."};case"tools/list":{let r=await q5(t.workspaceFolder,t.container),n=e.params??{},i=typeof n.cursor=="string"?n.cursor:void 0,s=T5(t.container);if(s<=0||r.length<=s)return{tools:r};let o=sx(i),l=r.slice(o,o+s),f=o+s,c={tools:l};return f<r.length&&(c.nextCursor=ix(f)),c}case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await Ix(t,n,i??{}),o=s,l=o?.summary;l&&((l.failed??0)>0||l.allPassed===!1)&&(o._nextStep=`${l.failed??"Some"} request(s) failed. Please analyze the 'failedRequests' above: identify the root cause of each failure, suggest specific fixes (URL, auth, body, environment variables), and provide updated pm.test() assertion scripts where the assertions are incorrect.`);let f=JSON.stringify(s,null,2),c=P5(f,t.host,t.port),p=c.match(/"uri"\s*:\s*"(http:\/\/[^"]+\/report\?[^"]+)"/),h=p?`
1017
1017
 
1018
- [View HTML Report](${p[1]})`:"";return{content:[{type:"text",text:c+h}]}}case"prompts/list":return{prompts:_y};case"prompts/get":{let r=e.params??{},n=r.name,i=r.arguments??{};if(!n)throw new Error("Missing prompt name");let s=Nn(t.workspaceFolder);try{return await VC(n,i,s.collection,t.runStore)}finally{ic(s)}}default:throw new Error(`Method not found: ${e.method}`)}}function $5(t,e,r){let n=!t.container,i=t.container??Nn(t.workspaceFolder),s;try{s=i.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{n&&ic(i)}let o=e.headers.origin??"",l=s.includes(o)?o:s[0]??"http://localhost";r.setHeader("Access-Control-Allow-Origin",l),r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type, Mcp-Session-Id")}function N5(t,e,r){let i=new URL(e.url,`http://${t.host}:${t.port}`).searchParams.get("path");if(!i){r.statusCode=400,r.end("Missing path parameter");return}let s=Ka.resolve(i),o=t.container?.config.getResultsPath(),l=o?Ka.dirname(o):Ka.resolve(t.workspaceFolder,".http-forge-cache");if(!s.startsWith(l+Ka.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}vN.readFile(s,"utf-8",(f,c)=>{if(f){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(c)})}function xx(t,e,r,n){let i=t.create(e,r);return n().then(s=>{i.status!=="cancelled"&&(i.status="completed",i.completedAt=Date.now(),i.summary=s?.summary??i.summary,s?.failedRequests&&(i.failedRequests=s.failedRequests),s?.noAssertionExamples&&(i.noAssertionExamples=s.noAssertionExamples),i.reportPath=s?.report?.uri?.replace("file://","")??null,i.progress.completed=i.progress.total)}).catch(s=>{i.status!=="cancelled"&&(i.status="failed",i.completedAt=Date.now(),i.error=s.message)}),{runId:i.id,status:"running",total:r,message:"Run started. Use get_run_status to poll."}}function M5(t){let e=t.workspaceFolder;return{async runRequest(r,n,i){return gi(()=>ky({workspaceFolder:e,collectionId:r.id,requestId:n,environment:i.environment,variables:i.variables,headers:i.headers,query:i.query,body:i.body,include:i.include}))},async runFolder(r,n,i){let s=Xe(r).filter(({folderPath:o})=>o===n||o.startsWith(`${n}/`)).length;return i.async===!0?xx(t.runStore,`${r.name} / ${bs(n)}`,s,()=>gi(()=>_s({workspaceFolder:e,collectionId:r.id,folderPath:n,recursive:i.recursive,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,include:i.include}))):gi(()=>_s({workspaceFolder:e,collectionId:r.id,folderPath:n,recursive:i.recursive,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,include:i.include}))},async runCollection(r,n){let i=Xe(r).length;return n.async===!0?xx(t.runStore,r.name,i,()=>gi(()=>_s({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))):gi(()=>_s({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))},async runSuite(r,n,i){let s=Nn(e),o=0;try{let l=await s.testSuite.getSuite(r);o=(l?.requests.length??0)*(i.iterations??l?.config?.iterations??1)}finally{ic(s)}return i.async===!0?xx(t.runStore,n,o,()=>gi(()=>sp({workspaceFolder:e,suiteId:r,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,requestFilter:i.requestFilter,include:i.include}))):gi(()=>sp({workspaceFolder:e,suiteId:r,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,requestFilter:i.requestFilter,include:i.include}))}}}async function Ix(t,e,r={}){let n=t.workspaceFolder,i=k5(t.container,e);if(Object.values(J).includes(i)){let l=Nn(n);try{let f=await HC(i,r,{collection:l.collection,testSuite:l.testSuite,environmentConfig:l.environmentConfig,workspaceFolder:n},t.runStore,M5(t));return F5.has(i)&&Ex.delete(n),f}finally{ic(l)}}let s=QC(i),o=Nn(n);try{let l=o.collection.getAllCollections(),f=l.map(v=>v.id),c=v=>{let _=Gu(v,f),w=_?l.find(E=>E.id===_):void 0;if(!w)throw new Error(`Collection not found for tool: ${e}`);return w};if(s.kind==="request"){let[v,_]=s.tokens;if(!v||!_)throw new Error(`Malformed request tool: ${e}`);let w=c(v),E=Xe(w).map(T=>T.request.id),k=Gu(_,E);if(!k)throw new Error(`Request not found in collection "${w.name}" for tool: ${e}`);return gi(()=>ky({workspaceFolder:n,collectionId:w.id,requestId:k,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(s.kind==="collection"){let[v]=s.tokens;if(!v)throw new Error(`Malformed collection tool: ${e}`);let _=c(v);return gi(()=>_s({workspaceFolder:n,collectionId:_.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(s.kind==="folder"){let[v,_]=s.tokens;if(!v||!_)throw new Error(`Malformed folder tool: ${e}`);let w=c(v),E=(o.collection.getAllCollections().find(N=>N.id===w.id),void 0),k=Xe(w).map(N=>N.folderPath).filter((N,$,j)=>N&&j.indexOf(N)===$),T=ZC(_,k);if(!T)throw new Error(`Folder not found in collection "${w.name}" for tool: ${e}`);return gi(()=>_s({workspaceFolder:n,collectionId:w.id,folderPath:T,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}let[p]=s.tokens;if(!p)throw new Error(`Malformed suite tool: ${e}`);let h=await o.testSuite.getAllSuites(),g=Gu(p,h.map(v=>v.id));if(!g)throw new Error(`Test suite not found for tool: ${e}`);return gi(()=>sp({workspaceFolder:n,suiteId:g,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{ic(o)}}function Ya(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function yN(t){return new Promise((e,r)=>{let n="";t.on("data",i=>{n+=i,n.length>1024*1024&&r(new Error("Request body too large (max 1MB)"))}),t.on("end",()=>{if(!n){e({});return}try{e(JSON.parse(n))}catch{r(new Error("Invalid JSON body"))}}),t.on("error",r)})}function D5(t){return E5(async(e,r)=>{try{if($5(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){Ya(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){N5(t,e,r);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await yN(e)}catch{gN(r,null,-32700,"Parse error");return}try{let i=await A5(t,n);Ya(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){gN(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await yN(e);if(!n||typeof n.name!="string"||n.name.trim()===""){Ya(r,400,{error:'Field "name" is required'});return}let i=await Ix(t,n.name,n.args??{});Ya(r,200,{result:i});return}Ya(r,405,{error:"Method not allowed"})}catch(n){Ya(r,500,{error:n.message})}})}async function L5(t){let e=t.port||3100,r=t.host||"127.0.0.1",n=`${r}:${e}`,i={workspaceFolder:t.workspaceFolder,port:e,host:r,isRunning:!1,runStore:new ep};return I5.set(n,i),{async start(){if(i.isRunning)return;i.container||(i.container=Nn(i.workspaceFolder));let s=D5(i);await new Promise((o,l)=>{s.once("error",l),s.listen(i.port,i.host,()=>{s.off("error",l),o()})}),i.server=s,i.isRunning=!0},async stop(){if(i.container&&(ic(i.container),i.container=void 0),!i.server){i.isRunning=!1;return}await new Promise((s,o)=>{i.server.close(l=>{if(l){o(l);return}s()})}),i.server=void 0,i.isRunning=!1},isRunning(){return i.isRunning},getPort(){return i.port},async executeTool(s,o){return Ix(i,s,o??{})}}}var I5,q5,Ex,Cx,F5,SN=se(()=>{"use strict";nc();mi();BC();WC();zC();ax();Cy();Qd();Oy();I5=new Map;q5=3e3,Ex=new Map,Cx=new Map;F5=UC});var Hl=class{constructor(e,r){this.fileSystem=e;this.parserRegistry=r}fileSystem;parserRegistry;directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,r={}){let n=await this.fileSystem.readFile(e);if(r.format){let s=this.parserRegistry.get(r.format);if(!s)throw new Error(`No parser registered for format: ${r.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,r=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(r,e);for(let s of i)try{let o=await this.load(s);n.push(o)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let r=await this.fileSystem.readFile(e);return this.parserRegistry.detect(r)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};Eh();na();function eS(t,e){return{id:t.id,name:t.name,description:t.description,variables:t.variables||{},auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(aI),source:{format:"folder",filePath:e,version:t.version}}}function aI(t){if(t.type==="folder")return{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(aI)};let e=t;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 Nj(t){return{id:t.id,name:t.name,description:t.description,version:t.source?.version,variables:t.variables,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(tS)}}function tS(t){return t.type==="folder"?{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(tS)}:{type:"request",id:t.id,name:t.name,description:t.description,method:t.method,url:t.url,headers:t.headers,query:t.query,params:t.params,body:t.body,auth:t.auth,settings:t.settings,scripts:t.scripts,...t.deprecated&&{deprecated:t.deprecated},...t.doc&&{doc:t.doc}}}var Vc=class{store;constructor(e){this.store=new zs(e)}loadAll(){return this.store.loadAll().map(r=>eS(r,this.store.getCollectionPath(r.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let r=this.store.load(e);if(r)return eS(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return eS(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(Nj(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,r){return this.store.updateCollectionMetadata(e,r)}async saveItem(e,r,n){return this.store.saveItem(e,tS(r),n)}async updateItem(e,r,n){let i={...n};return this.store.updateItem(e,r,i)}async deleteItem(e,r){return this.store.deleteItem(e,r)}async moveItem(e,r,n){return this.store.moveItem(e,r,n)}async reorderItems(e,r,n){return this.store.reorderItems(e,r,n)}async saveScripts(e,r,n){return this.store.saveScripts(e,r,n)}loadScripts(e,r){return this.store.loadScripts(e,r)}};var Wc=class{parsers=new Map;register(e,r){this.parsers.set(e.toLowerCase(),r)}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[r,n]of this.parsers)if(n.canParse(e))return{parser:n,format:r};return null}clear(){this.parsers.clear()}};ia();var zc=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),o=this.cookies.get(s);if(o&&!this.isExpired(o))return o}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(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}}has(e,r){return this.get(e,r)!==void 0}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return ht.formatCookieHeader(r)}clear(){this.cookies.clear()}clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n)}parseCookieHeaders(e,r){return ht.parseCookieHeaders(e,r)}isExpired(e){return ht.isExpired(e)}domainMatches(e,r){return ht.domainMatches(e,r)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r)}};Oh();var rs=class t{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,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}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 r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let o=this.getEnvironmentVariables(n.inherits);i={...i,...o}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}unsetGlobal(e){delete this.sessionGlobals[e]}clearGlobals(){this.sessionGlobals={}}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};Bl();Qc();var Gs=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new ca,this.urlBuilder=new Kn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}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,r){let n=this.envStore;typeof n.setGlobal=="function"&&n.setGlobal(e,r)}unsetGlobal(e){let r=this.envStore;typeof r.unsetGlobal=="function"&&r.unsetGlobal(e)}clearGlobals(){let e=this.envStore;typeof e.clearGlobals=="function"&&e.clearGlobals()}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.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 r=rs.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};Qc();ef();tf();Bl();Mf();$f();var cu=class{constructor(e,r,n,i,s){this.httpClient=e;this.forgeEnv=r;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let o=s?.forgeRoot?[ft("path").join(s.forgeRoot,"modules")]:[],l=new is(new Kn,new ss,e);this.scriptExecutor=new cs(l,o,void 0,s?.scriptScope??"shared",s?.scriptTimeout??5e3)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},o={...this.forgeEnv.getGlobals()},l={...n.additionalVariables||{}},f={...s},c=this.buildHttpRequest(e,n.overrides),p=n.overrides?.body||e.body,h=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,h),v={request:{url:c.url,method:c.method,headers:{...c.headers},body:p?typeof p=="string"?{type:"raw",content:p}:p:void 0},variables:l,collectionVariables:r.variables||{},globals:{...o},environmentVariables:f,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onEnvironmentChange:n.onEnvironmentChange,onGlobalsChange:(k,T,N)=>{k==="set"&&T&&N!==void 0?this.forgeEnv.setGlobal(T,N):k==="unset"&&T?this.forgeEnv.unsetGlobal(T):k==="clear"&&this.forgeEnv.clearGlobals()}},_=this.scriptExecutor.createRequestSession(v),w,E;try{if(!n.skipPreRequest&&g.preRequest.length>0){let $=await _.executePreRequest(g.preRequest);if(w={success:$.success,error:$.error,modifiedVariables:$.modifiedVariables,modifiedEnvironment:$.modifiedEnvironmentVariables,modifiedGlobals:$.modifiedGlobals,modifiedCollectionVariables:$.modifiedCollectionVariables,consoleOutput:$.consoleOutput,modifiedRequest:$.modifiedRequest?{url:$.modifiedRequest.url,method:$.modifiedRequest.method,headers:$.modifiedRequest.headers,body:$.modifiedRequest.body?.content}:void 0},$.modifiedVariables&&(l={...l,...$.localVariables??$.modifiedVariables}),$.modifiedEnvironmentVariables&&(f={...f,...$.modifiedEnvironmentVariables}),$.modifiedRequest){let j=$.modifiedRequest;j.url&&(c.url=j.url),j.method&&(c.method=j.method),j.headers&&(c.headers={...c.headers,...j.headers}),j.body!==void 0&&(c.body=j.body?.content||j.body)}if(!$.success)throw new Error(`Pre-request script failed: ${$.error}`)}let k={...f,...l};c=this.interpolateRequest(c,k);let T=n.overrides?.body||e.body;if(this.preprocessor&&T&&typeof T!="string"&&T.type==="graphql"&&c.body!==void 0){let $=this.preprocessor.encodeBody({type:"graphql",content:c.body});$!=null&&(c.body=typeof $=="string"?$:JSON.stringify($))}if(p&&typeof p=="object"&&p.type==="form-data"&&Array.isArray(c.body)){let $=this.buildMultipartFormData({type:"form-data",content:c.body});$&&(c.body=$)}let N=await this.httpClient.send(c);if(!n.skipPostResponse&&g.postResponse.length>0){let $=await _.executePostResponse(g.postResponse,{status:N.status,statusText:N.statusText,headers:N.headers,body:N.body,cookies:wm(N.headers,N.cookies,c.url),responseTime:N.time,responseSize:N.size,executedRequest:{url:c.url,method:c.method,headers:c.headers||{},body:c.body?typeof c.body=="string"?{type:"raw",content:c.body}:c.body:{type:"none",content:""},params:{},query:{}}});E={success:!0,assertions:$.testResults,consoleOutput:$.consoleOutput,modifiedEnvironment:$.modifiedEnvironmentVariables},$.modifiedEnvironmentVariables&&(f={...f,...$.modifiedEnvironmentVariables})}return{response:N,preRequestResult:w,postResponseResult:E,totalTime:Date.now()-i,finalRequest:c,variables:{environment:f,local:l}}}finally{_.dispose?.()}}async executeSimple(e,r={}){let n=e,i={...this.forgeEnv.getAll(),...r.variables||{}};return n=this.interpolateRequest(e,i),r.timeout&&(n={...n,timeout:r.timeout}),this.httpClient.send(n)}buildHttpRequest(e,r){let n=e.url;if(e.query&&e.query.length>0){let p=new URLSearchParams;for(let h of e.query)h.enabled!==!1&&p.append(h.key,h.value);n+=(n.includes("?")?"&":"?")+p.toString()}let i=r?.url||n,s=r?.method||e.method,o={};if(e.headers&&Array.isArray(e.headers))for(let p of e.headers)p.enabled!==!1&&(o[p.key]=p.value);let l={...o,...r?.headers||{}},f,c=r?.body||e.body;if(c)if(typeof c=="string")f=c;else if(this.preprocessor&&c.type)if(c.type==="graphql")f=typeof c.content=="string"?c.content:JSON.stringify(c.content);else if(c.type==="form-data")f=this.buildMultipartFormData(c);else{let p=this.preprocessor.encodeBody(c);f=p!=null?String(p):void 0}else c.content&&(f=typeof c.content=="string"?c.content:JSON.stringify(c.content));return this.preprocessor&&c&&c.type!=="form-data"&&this.preprocessor.setContentTypeHeader(l,c),{url:i,method:s,headers:l,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Gs.create(r),i=e.body,s=i;return typeof i=="string"?s=n.resolve(i):i instanceof FormData||i instanceof URLSearchParams?s=i:i&&typeof i=="object"&&(s=n.resolve(i)),{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:s}}buildMultipartFormData(e){if(!e||e.type!=="form-data"||!Array.isArray(e.content))return;let r=new FormData;for(let n of e.content)!n?.key||n.enabled===!1||r.append(n.key,n.value==null?"":String(n.value));return r}buildScriptChain(e,r,n=[]){let i=[],s=[];r.scripts?.preRequest&&i.push(r.scripts.preRequest),r.scripts?.postResponse&&s.push(r.scripts.postResponse);for(let o of n)o.scripts?.preRequest&&i.push(o.scripts.preRequest),o.scripts?.postResponse&&s.push(o.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,r){let n=[],i=(s,o)=>{for(let l of s){if(l.type==="request"&&l.id===r)return n.push(...o),!0;if(l.type==="folder"){let f=[...o,l];if(i(l.items,f))return!0}}return!1};return i(e.items,[]),n}};function lz(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var Ff=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,r){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let o=this.entries.get(s);o&&(!r||o.environment===r)&&i.push(o)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,r,n,i,s){let o=lz(),l=Date.now(),f={id:o,timestamp:l,environment:i,method:r.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:r.url,method:r.method,headers:{...r.headers},body:r.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(o,f);let c=this.requestIndex.get(e)||[];for(c.unshift(o);c.length>this.maxEntriesPerRequest;){let p=c.pop();p&&(this.entries.delete(p),this.fullResponses.delete(p))}if(this.requestIndex.set(e,c),this.storeFullResponses){let p={timestamp:l,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(o,p)}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 r=this.requestIndex.get(e);if(r){for(let n of r)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var Df=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let o={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?o.body=e.body:typeof e.body=="object"&&(o.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(o.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(o.redirect="manual");let l=await fetch(e.url,o),f=Date.now(),c;try{c=await l.text()}catch{c=null}let p={};return l.headers.forEach((h,g)=>{let v=p[g];v!==void 0?p[g]=Array.isArray(v)?[...v,h]:[v,h]:p[g]=h}),{status:l.status,statusText:l.statusText,headers:p,cookies:[],body:c,time:f-r}}catch(o){throw o.name==="AbortError"?new Error(`Request timeout after ${i}ms`):o}finally{clearTimeout(s)}}};ef();tf();Xc();_m();Bl();var xa=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){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:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}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 r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[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(r).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}}};Rm();import*as cn from"fs/promises";import*as fu from"path";var Lf=class{async readFile(e){return cn.readFile(e,"utf-8")}async writeFile(e,r){let n=fu.dirname(e);await this.mkdir(n),await cn.writeFile(e,r,"utf-8")}async exists(e){try{return await cn.access(e),!0}catch{return!1}}async mkdir(e){await cn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let o=fu.basename(s);for(let l of e)if(this.matchPattern(o,l)){i.push(s);break}})}catch{}return i}async readDir(e){return cn.readdir(e)}async isDirectory(e){try{return(await cn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await cn.readdir(e,{withFileTypes:!0});for(let i of n){let s=fu.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};Mf();var i0=class t{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 ca,this.fileSystem=e.fileSystem||new Lf,this.preprocessor=e.preprocessor||new Ca,this.dataFileParser=e.dataFileParser||new Ea,this.cookieJar=e.cookieJar||new zc,e.enableHistory?this.requestHistory=e.requestHistory||new Ff({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 fa(s)}else this.httpClient=new Df;let r=e.forgeRoot?[ft("path").join(e.forgeRoot,"modules")]:[],n=new is(new Kn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new cs(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new Wc,this.parserRegistry.register("http-forge",new xa),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=ft("path").join(e.forgeRoot,"collections");this.collectionLoader=new Vc(s)}else this.collectionLoader=new Hl(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new rs(e.environmentConfig):rs.fromVariables({}),this.forgeEnv=Gs.fromResolver(this.environmentStore),this.requestExecutor=new cu(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new ss;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof Hl)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,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new rs(e),this.forgeEnv=Gs.fromResolver(this.environmentStore),this.requestExecutor=new cu(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new t(e)}static fromForgeRoot(e="./http-forge",r={}){let n=ft("path"),i=n.join(e,"environments"),s,o=Jc(i);if(Object.keys(o.environments).length>0||Object.keys(o.globalVariables).length>0){s={globalVariables:{...o.globalVariables,...o.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,c]of Object.entries(o.environments)){let p=o.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...c.variables,...p}}}}else{let f=ft("fs"),c=n.join(i,"environments.json");if(f.existsSync(c))try{let p=f.readFileSync(c,"utf-8"),h=JSON.parse(p);if(s={globalVariables:h.globalVariables||{},environments:{},selectedEnvironment:h.selectedEnvironment},h.environments)for(let[g,v]of Object.entries(h.environments)){let _=v;s.environments[g]={name:_.name||g,variables:_.variables||{}}}}catch(p){console.warn(`[ForgeContainer] Failed to load environments from ${c}:`,p)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};NC();MC();my();mi();BC();WC();zC();ax();Cy();Qd();async function j5(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(SN(),bN));return e(t)}async function U5(t){let{runRequest:e}=await Promise.resolve().then(()=>(nc(),op));return e(t)}async function H5(t){let{runCollection:e}=await Promise.resolve().then(()=>(nc(),op));return e(t)}async function B5(t){let{runFolder:e}=await Promise.resolve().then(()=>(nc(),op));return e(t)}async function V5(t){let{runSuite:e}=await Promise.resolve().then(()=>(nc(),op));return e(t)}Oy();p0();ia();lx();h0();ef();tf();sS();Xc();_m();Bl();Kw();t0();Mf();bm();$f();Qf();l0();c0();Eh();na();na();a0();function W5(t){let e=t.replace(/\\\n/g," "),r=[],n="",i=0;for(;i<e.length;){let s=e[i];if(s==="\\"&&i+1<e.length)n+=e[++i],i++;else if(s==="'"){for(i++;i<e.length&&e[i]!=="'";)n+=e[i++];i++}else if(s==='"'){for(i++;i<e.length&&e[i]!=='"';)if(e[i]==="\\"&&i+1<e.length){let o=e[i+1];o==='"'||o==="\\"||o==="$"||o==="`"?(n+=o,i+=2):n+=e[i++]}else n+=e[i++];i++}else/\s/.test(s)?(n.length>0&&(r.push(n),n=""),i++):(n+=s,i++)}return n.length>0&&r.push(n),r}function z5(t){try{let e="__FV__",r=[],n=t.replace(/\{\{[^}]+\}\}/g,p=>(r.push(p),`${e}${r.length-1}`)),i=n.indexOf("?");if(i===-1)return{cleanUrl:t,params:[]};let s=n.slice(0,i),o=n.slice(i+1),l=p=>p.replace(new RegExp(`${e}(\\d+)`,"g"),(h,g)=>r[parseInt(g,10)]),f=l(s),c=o.split("&").filter(Boolean).map(p=>{let h=l(p),g=h.indexOf("=");return g===-1?{key:h,value:"",enabled:!0}:{key:decodeURIComponent(h.slice(0,g)),value:decodeURIComponent(h.slice(g+1)),enabled:!0}});return{cleanUrl:f,params:c}}catch{return{cleanUrl:t,params:[]}}}function J5(t){try{let e=new URL(t.replace(/\{\{[^}]+\}\}/g,"placeholder")),r=e.pathname.split("/").filter(Boolean),n=r[r.length-1];return n&&!/^\d+$/.test(n)&&!n.startsWith("{")?n.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):r.length>1?r[r.length-2].replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):e.hostname.replace(/^www\./,"").split(".")[0]??"Request"}catch{return"Request"}}var G5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),Y5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"]);function wN(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function _N(t){return/\{\{[^}]+\}\}/.test(t)}function Py(t,e=16){return t.length>=e&&!_N(t)}function K5(t,e,r){let n=[],i=new Set,s=(o,l)=>{i.has(l)||(i.add(l),n.push({key:o,value:l}))};for(let o of t){let l=o.key.toLowerCase();if(l==="authorization"){let f=o.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);f&&Py(f[2])?s(`${f[1].toUpperCase()}_TOKEN`,f[2]):Py(o.value)&&s("AUTH_TOKEN",o.value)}else G5.has(l)&&Py(o.value)&&s(wN(o.key),o.value)}for(let o of e)Y5.has(o.key.toLowerCase())&&Py(o.value)&&s(wN(o.key),o.value);try{let o=new URL(r.replace(/\{\{[^}]+\}\}/g,"placeholder"));if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)&&!_N(r)){let f=`${o.protocol}//${o.host}`;s("BASE_URL",f)}}catch{}return n}function Q5(t){let e=W5(t.trim()),r=0;for(;r<e.length&&e[r].toLowerCase()==="curl";)r++;let n=e.slice(r),i="",s="",o=[],l=null,f=!1,c=!1,p=[],h=[],g=0;for(;g<n.length;){let T=n[g];if(T==="-X"||T==="--request")i=n[++g]??"";else if(T==="-H"||T==="--header"){let N=n[++g]??"",$=N.indexOf(":");$>0&&o.push({key:N.slice(0,$).trim(),value:N.slice($+1).trim()})}else if(T==="-d"||T==="--data"||T==="--data-raw"||T==="--data-binary"||T==="--data-ascii")l=n[++g]??"";else if(T==="--json")l=n[++g]??"",f=!0;else if(T==="-u"||T==="--user"){let N=n[++g]??"",$=btoa(N);o.push({key:"Authorization",value:`Basic ${$}`})}else if(T==="-b"||T==="--cookie")o.push({key:"Cookie",value:n[++g]??""});else if(T==="--url")s=n[++g]??"";else if(T==="-G"||T==="--get")c=!0;else if(T==="-F"||T==="--form"){let N=n[++g]??"",$=N.indexOf("=");$>0&&p.push({key:N.slice(0,$),value:N.slice($+1)})}else T==="--data-urlencode"?h.push(n[++g]??""):T==="-A"||T==="--user-agent"?o.push({key:"User-Agent",value:n[++g]??""}):T==="-e"||T==="--referer"||T==="--referrer"?o.push({key:"Referer",value:n[++g]??""}):T==="--compressed"||T==="-L"||T==="--location"||T==="-v"||T==="--verbose"||T==="-s"||T==="--silent"||T==="-i"||T==="--include"||T==="-k"||T==="--insecure"||T==="--http1.1"||T==="--http2"||T==="--http3"||(T==="-o"||T==="--output"||T==="--max-time"||T==="--connect-timeout"||T==="-m"||T==="--limit-rate"||T==="--proxy"||T==="-x"?g++:!T.startsWith("-")&&!s&&(s=T));g++}c?i="GET":i||(i=l!==null||p.length>0||h.length>0?"POST":"GET");let{cleanUrl:v,params:_}=z5(s),w=null;if(p.length>0)w={type:"raw",format:"text",content:p.map(N=>`${encodeURIComponent(N.key)}=${encodeURIComponent(N.value)}`).join("&")},o.some(N=>N.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"multipart/form-data"});else if(h.length>0)w={type:"raw",format:"text",content:h.join("&")},o.some(T=>T.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"application/x-www-form-urlencoded"});else if(l!==null){let T=l.trim(),N=f||T.startsWith("{")||T.startsWith("[");w={type:"raw",format:N?"json":"text",content:l},N&&!o.some($=>$.key.toLowerCase()==="content-type")&&o.push({key:"Content-Type",value:"application/json"})}let E=o.map(T=>({...T,enabled:!0})),k=K5(o,_,v||s);return{name:J5(v||s),method:i.toUpperCase(),url:v||s,headers:E,queryParams:_,body:w,suggestedVars:k}}async function Z5(t,e,r,n){let i=RN(t.items);if(i.length===0)return;let s=Math.ceil(i.length/10);for(let o=0;o<i.length;o+=10){let l=i.slice(o,o+10),f=Math.floor(o/10)+1;n?.(`Enhancing requests (batch ${f}/${s})\u2026`,1/s*100);let c=l.map(p=>({id:p.id,name:p.name,method:p.method??"GET",url:p.url??"",bodyContent:r7(p),responseSchema:p.responseSchema?JSON.stringify(p.responseSchema).slice(0,500):void 0,description:p.description?.slice(0,200)}));try{let p=await r.complete(X5(c)),h=e7(p);t7(l,h)}catch{}}await e.saveCollection(t)}function X5(t){return`You are an API testing expert. For each HTTP request below, return two improvements:
1018
+ [View HTML Report](${p[1]})`:"";return{content:[{type:"text",text:c+h}]}}case"prompts/list":return{prompts:_y};case"prompts/get":{let r=e.params??{},n=r.name,i=r.arguments??{};if(!n)throw new Error("Missing prompt name");let s=Nn(t.workspaceFolder);try{return await VC(n,i,s.collection,t.runStore)}finally{ic(s)}}default:throw new Error(`Method not found: ${e.method}`)}}function $5(t,e,r){let n=!t.container,i=t.container??Nn(t.workspaceFolder),s;try{s=i.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{n&&ic(i)}let o=e.headers.origin??"",l=s.includes(o)?o:s[0]??"http://localhost";r.setHeader("Access-Control-Allow-Origin",l),r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type, Mcp-Session-Id")}function N5(t,e,r){let i=new URL(e.url,`http://${t.host}:${t.port}`).searchParams.get("path");if(!i){r.statusCode=400,r.end("Missing path parameter");return}let s=Ka.resolve(i),o=t.container?.config.getResultsPath(),l=o?Ka.dirname(o):Ka.resolve(t.workspaceFolder,".http-forge-cache");if(!s.startsWith(l+Ka.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}vN.readFile(s,"utf-8",(f,c)=>{if(f){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(c)})}function xx(t,e,r,n){let i=t.create(e,r);return n().then(s=>{i.status!=="cancelled"&&(i.status="completed",i.completedAt=Date.now(),i.summary=s?.summary??i.summary,s?.failedRequests&&(i.failedRequests=s.failedRequests),s?.noAssertionExamples&&(i.noAssertionExamples=s.noAssertionExamples),i.reportPath=s?.report?.uri?.replace("file://","")??null,i.progress.completed=i.progress.total)}).catch(s=>{i.status!=="cancelled"&&(i.status="failed",i.completedAt=Date.now(),i.error=s.message)}),{runId:i.id,status:"running",total:r,message:"Run started. Use get_run_status to poll."}}function M5(t){let e=t.workspaceFolder;return{async runRequest(r,n,i){return gi(()=>ky({workspaceFolder:e,collectionId:r.id,requestId:n,environment:i.environment,variables:i.variables,headers:i.headers,query:i.query,body:i.body,include:i.include}))},async runFolder(r,n,i){let s=Xe(r).filter(({folderPath:o})=>o===n||o.startsWith(`${n}/`)).length;return i.async===!0?xx(t.runStore,`${r.name} / ${bs(n)}`,s,()=>gi(()=>_s({workspaceFolder:e,collectionId:r.id,folderPath:n,recursive:i.recursive,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,include:i.include}))):gi(()=>_s({workspaceFolder:e,collectionId:r.id,folderPath:n,recursive:i.recursive,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,include:i.include}))},async runCollection(r,n){let i=Xe(r).length;return n.async===!0?xx(t.runStore,r.name,i,()=>gi(()=>_s({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))):gi(()=>_s({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))},async runSuite(r,n,i){let s=Nn(e),o=0;try{let l=await s.testSuite.getSuite(r);o=(l?.requests.length??0)*(i.iterations??l?.config?.iterations??1)}finally{ic(s)}return i.async===!0?xx(t.runStore,n,o,()=>gi(()=>sp({workspaceFolder:e,suiteId:r,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,requestFilter:i.requestFilter,include:i.include}))):gi(()=>sp({workspaceFolder:e,suiteId:r,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,requestFilter:i.requestFilter,include:i.include}))}}}async function Ix(t,e,r={}){let n=t.workspaceFolder,i=k5(t.container,e);if(Object.values(J).includes(i)){let l=Nn(n);try{let f=await HC(i,r,{collection:l.collection,testSuite:l.testSuite,environmentConfig:l.environmentConfig,workspaceFolder:n},t.runStore,M5(t));return F5.has(i)&&Ex.delete(n),f}finally{ic(l)}}let s=QC(i),o=Nn(n);try{let l=o.collection.getAllCollections(),f=l.map(v=>v.id),c=v=>{let _=Gu(v,f),w=_?l.find(E=>E.id===_):void 0;if(!w)throw new Error(`Collection not found for tool: ${e}`);return w};if(s.kind==="request"){let[v,_]=s.tokens;if(!v||!_)throw new Error(`Malformed request tool: ${e}`);let w=c(v),E=Xe(w).map(T=>T.request.id),k=Gu(_,E);if(!k)throw new Error(`Request not found in collection "${w.name}" for tool: ${e}`);return gi(()=>ky({workspaceFolder:n,collectionId:w.id,requestId:k,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(s.kind==="collection"){let[v]=s.tokens;if(!v)throw new Error(`Malformed collection tool: ${e}`);let _=c(v);return gi(()=>_s({workspaceFolder:n,collectionId:_.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(s.kind==="folder"){let[v,_]=s.tokens;if(!v||!_)throw new Error(`Malformed folder tool: ${e}`);let w=c(v),E=(o.collection.getAllCollections().find(N=>N.id===w.id),void 0),k=Xe(w).map(N=>N.folderPath).filter((N,$,j)=>N&&j.indexOf(N)===$),T=ZC(_,k);if(!T)throw new Error(`Folder not found in collection "${w.name}" for tool: ${e}`);return gi(()=>_s({workspaceFolder:n,collectionId:w.id,folderPath:T,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}let[p]=s.tokens;if(!p)throw new Error(`Malformed suite tool: ${e}`);let h=await o.testSuite.getAllSuites(),g=Gu(p,h.map(v=>v.id));if(!g)throw new Error(`Test suite not found for tool: ${e}`);return gi(()=>sp({workspaceFolder:n,suiteId:g,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{ic(o)}}function Ya(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function yN(t){return new Promise((e,r)=>{let n="";t.on("data",i=>{n+=i,n.length>1024*1024&&r(new Error("Request body too large (max 1MB)"))}),t.on("end",()=>{if(!n){e({});return}try{e(JSON.parse(n))}catch{r(new Error("Invalid JSON body"))}}),t.on("error",r)})}function D5(t){return E5(async(e,r)=>{try{if($5(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){Ya(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){N5(t,e,r);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await yN(e)}catch{gN(r,null,-32700,"Parse error");return}try{let i=await A5(t,n);Ya(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){gN(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await yN(e);if(!n||typeof n.name!="string"||n.name.trim()===""){Ya(r,400,{error:'Field "name" is required'});return}let i=await Ix(t,n.name,n.args??{});Ya(r,200,{result:i});return}Ya(r,405,{error:"Method not allowed"})}catch(n){Ya(r,500,{error:n.message})}})}async function L5(t){let e=t.port||3100,r=t.host||"127.0.0.1",n=`${r}:${e}`,i={workspaceFolder:t.workspaceFolder,port:e,host:r,isRunning:!1,runStore:new ep};return I5.set(n,i),{async start(){if(i.isRunning)return;i.container||(i.container=Nn(i.workspaceFolder));let s=D5(i);await new Promise((o,l)=>{s.once("error",l),s.listen(i.port,i.host,()=>{s.off("error",l),o()})}),i.server=s,i.isRunning=!0},async stop(){if(i.container&&(ic(i.container),i.container=void 0),!i.server){i.isRunning=!1;return}await new Promise((s,o)=>{i.server.close(l=>{if(l){o(l);return}s()})}),i.server=void 0,i.isRunning=!1},isRunning(){return i.isRunning},getPort(){return i.port},async executeTool(s,o){return Ix(i,s,o??{})}}}var I5,O5,Ex,Cx,F5,SN=se(()=>{"use strict";nc();mi();BC();WC();zC();ax();Cy();Qd();qy();I5=new Map;O5=3e3,Ex=new Map,Cx=new Map;F5=UC});var Hl=class{constructor(e,r){this.fileSystem=e;this.parserRegistry=r}fileSystem;parserRegistry;directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,r={}){let n=await this.fileSystem.readFile(e);if(r.format){let s=this.parserRegistry.get(r.format);if(!s)throw new Error(`No parser registered for format: ${r.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,r=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(r,e);for(let s of i)try{let o=await this.load(s);n.push(o)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let r=await this.fileSystem.readFile(e);return this.parserRegistry.detect(r)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};Eh();na();function eS(t,e){return{id:t.id,name:t.name,description:t.description,variables:t.variables||{},auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(aI),source:{format:"folder",filePath:e,version:t.version}}}function aI(t){if(t.type==="folder")return{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(aI)};let e=t;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},...e.operationId&&{operationId:e.operationId},...e.summary&&{summary:e.summary},...e.tags&&e.tags.length>0&&{tags:e.tags},...e.examples&&e.examples.length>0&&{examples:e.examples},...e.responses&&Object.keys(e.responses).length>0&&{responses:e.responses},...e.security&&e.security.length>0&&{security:e.security}}}function Nj(t){return{id:t.id,name:t.name,description:t.description,version:t.source?.version,variables:t.variables,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(tS)}}function tS(t){return t.type==="folder"?{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(tS)}:{type:"request",id:t.id,name:t.name,description:t.description,method:t.method,url:t.url,headers:t.headers,query:t.query,params:t.params,body:t.body,auth:t.auth,settings:t.settings,scripts:t.scripts,...t.deprecated&&{deprecated:t.deprecated},...t.doc&&{doc:t.doc},...t.responseSchema&&{responseSchema:t.responseSchema},...t.bodySchema&&{bodySchema:t.bodySchema},...t.operationId&&{operationId:t.operationId},...t.summary&&{summary:t.summary},...t.tags&&{tags:t.tags},...t.examples&&{examples:t.examples},...t.responses&&{responses:t.responses},...t.security&&{security:t.security}}}var Vc=class{store;constructor(e){this.store=new zs(e)}loadAll(){return this.store.loadAll().map(r=>eS(r,this.store.getCollectionPath(r.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let r=this.store.load(e);if(r)return eS(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return eS(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(Nj(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,r){return this.store.updateCollectionMetadata(e,r)}async saveItem(e,r,n){return this.store.saveItem(e,tS(r),n)}async updateItem(e,r,n){let i={...n};return this.store.updateItem(e,r,i)}async deleteItem(e,r){return this.store.deleteItem(e,r)}async moveItem(e,r,n){return this.store.moveItem(e,r,n)}async reorderItems(e,r,n){return this.store.reorderItems(e,r,n)}async saveScripts(e,r,n){return this.store.saveScripts(e,r,n)}loadScripts(e,r){return this.store.loadScripts(e,r)}};var Wc=class{parsers=new Map;register(e,r){this.parsers.set(e.toLowerCase(),r)}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[r,n]of this.parsers)if(n.canParse(e))return{parser:n,format:r};return null}clear(){this.parsers.clear()}};ia();var zc=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),o=this.cookies.get(s);if(o&&!this.isExpired(o))return o}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(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}}has(e,r){return this.get(e,r)!==void 0}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return ht.formatCookieHeader(r)}clear(){this.cookies.clear()}clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n)}parseCookieHeaders(e,r){return ht.parseCookieHeaders(e,r)}isExpired(e){return ht.isExpired(e)}domainMatches(e,r){return ht.domainMatches(e,r)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r)}};qh();var rs=class t{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,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}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 r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let o=this.getEnvironmentVariables(n.inherits);i={...i,...o}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}unsetGlobal(e){delete this.sessionGlobals[e]}clearGlobals(){this.sessionGlobals={}}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};Bl();Qc();var Gs=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new ca,this.urlBuilder=new Kn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}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,r){let n=this.envStore;typeof n.setGlobal=="function"&&n.setGlobal(e,r)}unsetGlobal(e){let r=this.envStore;typeof r.unsetGlobal=="function"&&r.unsetGlobal(e)}clearGlobals(){let e=this.envStore;typeof e.clearGlobals=="function"&&e.clearGlobals()}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.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 r=rs.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};Qc();ef();tf();Bl();Mf();$f();var cu=class{constructor(e,r,n,i,s){this.httpClient=e;this.forgeEnv=r;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let o=s?.forgeRoot?[ft("path").join(s.forgeRoot,"modules")]:[],l=new is(new Kn,new ss,e);this.scriptExecutor=new cs(l,o,void 0,s?.scriptScope??"shared",s?.scriptTimeout??5e3)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},o={...this.forgeEnv.getGlobals()},l={...n.additionalVariables||{}},f={...s},c=this.buildHttpRequest(e,n.overrides),p=n.overrides?.body||e.body,h=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,h),v={request:{url:c.url,method:c.method,headers:{...c.headers},body:p?typeof p=="string"?{type:"raw",content:p}:p:void 0},variables:l,collectionVariables:r.variables||{},globals:{...o},environmentVariables:f,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onEnvironmentChange:n.onEnvironmentChange,onGlobalsChange:(k,T,N)=>{k==="set"&&T&&N!==void 0?this.forgeEnv.setGlobal(T,N):k==="unset"&&T?this.forgeEnv.unsetGlobal(T):k==="clear"&&this.forgeEnv.clearGlobals()}},_=this.scriptExecutor.createRequestSession(v),w,E;try{if(!n.skipPreRequest&&g.preRequest.length>0){let $=await _.executePreRequest(g.preRequest);if(w={success:$.success,error:$.error,modifiedVariables:$.modifiedVariables,modifiedEnvironment:$.modifiedEnvironmentVariables,modifiedGlobals:$.modifiedGlobals,modifiedCollectionVariables:$.modifiedCollectionVariables,consoleOutput:$.consoleOutput,modifiedRequest:$.modifiedRequest?{url:$.modifiedRequest.url,method:$.modifiedRequest.method,headers:$.modifiedRequest.headers,body:$.modifiedRequest.body?.content}:void 0},$.modifiedVariables&&(l={...l,...$.localVariables??$.modifiedVariables}),$.modifiedEnvironmentVariables&&(f={...f,...$.modifiedEnvironmentVariables}),$.modifiedRequest){let j=$.modifiedRequest;j.url&&(c.url=j.url),j.method&&(c.method=j.method),j.headers&&(c.headers={...c.headers,...j.headers}),j.body!==void 0&&(c.body=j.body?.content||j.body)}if(!$.success)throw new Error(`Pre-request script failed: ${$.error}`)}let k={...f,...l};c=this.interpolateRequest(c,k);let T=n.overrides?.body||e.body;if(this.preprocessor&&T&&typeof T!="string"&&T.type==="graphql"&&c.body!==void 0){let $=this.preprocessor.encodeBody({type:"graphql",content:c.body});$!=null&&(c.body=typeof $=="string"?$:JSON.stringify($))}if(p&&typeof p=="object"&&p.type==="form-data"&&Array.isArray(c.body)){let $=this.buildMultipartFormData({type:"form-data",content:c.body});$&&(c.body=$)}let N=await this.httpClient.send(c);if(!n.skipPostResponse&&g.postResponse.length>0){let $=await _.executePostResponse(g.postResponse,{status:N.status,statusText:N.statusText,headers:N.headers,body:N.body,cookies:wm(N.headers,N.cookies,c.url),responseTime:N.time,responseSize:N.size,executedRequest:{url:c.url,method:c.method,headers:c.headers||{},body:c.body?typeof c.body=="string"?{type:"raw",content:c.body}:c.body:{type:"none",content:""},params:{},query:{}}});E={success:!0,assertions:$.testResults,consoleOutput:$.consoleOutput,modifiedEnvironment:$.modifiedEnvironmentVariables},$.modifiedEnvironmentVariables&&(f={...f,...$.modifiedEnvironmentVariables})}return{response:N,preRequestResult:w,postResponseResult:E,totalTime:Date.now()-i,finalRequest:c,variables:{environment:f,local:l}}}finally{_.dispose?.()}}async executeSimple(e,r={}){let n=e,i={...this.forgeEnv.getAll(),...r.variables||{}};return n=this.interpolateRequest(e,i),r.timeout&&(n={...n,timeout:r.timeout}),this.httpClient.send(n)}buildHttpRequest(e,r){let n=e.url;if(e.query&&e.query.length>0){let p=new URLSearchParams;for(let h of e.query)h.enabled!==!1&&p.append(h.key,h.value);n+=(n.includes("?")?"&":"?")+p.toString()}let i=r?.url||n,s=r?.method||e.method,o={};if(e.headers&&Array.isArray(e.headers))for(let p of e.headers)p.enabled!==!1&&(o[p.key]=p.value);let l={...o,...r?.headers||{}},f,c=r?.body||e.body;if(c)if(typeof c=="string")f=c;else if(this.preprocessor&&c.type)if(c.type==="graphql")f=typeof c.content=="string"?c.content:JSON.stringify(c.content);else if(c.type==="form-data")f=this.buildMultipartFormData(c);else{let p=this.preprocessor.encodeBody(c);f=p!=null?String(p):void 0}else c.content&&(f=typeof c.content=="string"?c.content:JSON.stringify(c.content));return this.preprocessor&&c&&c.type!=="form-data"&&this.preprocessor.setContentTypeHeader(l,c),{url:i,method:s,headers:l,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Gs.create(r),i=e.body,s=i;return typeof i=="string"?s=n.resolve(i):i instanceof FormData||i instanceof URLSearchParams?s=i:i&&typeof i=="object"&&(s=n.resolve(i)),{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:s}}buildMultipartFormData(e){if(!e||e.type!=="form-data"||!Array.isArray(e.content))return;let r=new FormData;for(let n of e.content)!n?.key||n.enabled===!1||r.append(n.key,n.value==null?"":String(n.value));return r}buildScriptChain(e,r,n=[]){let i=[],s=[];r.scripts?.preRequest&&i.push(r.scripts.preRequest),r.scripts?.postResponse&&s.push(r.scripts.postResponse);for(let o of n)o.scripts?.preRequest&&i.push(o.scripts.preRequest),o.scripts?.postResponse&&s.push(o.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,r){let n=[],i=(s,o)=>{for(let l of s){if(l.type==="request"&&l.id===r)return n.push(...o),!0;if(l.type==="folder"){let f=[...o,l];if(i(l.items,f))return!0}}return!1};return i(e.items,[]),n}};function lz(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var Ff=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,r){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let o=this.entries.get(s);o&&(!r||o.environment===r)&&i.push(o)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,r,n,i,s){let o=lz(),l=Date.now(),f={id:o,timestamp:l,environment:i,method:r.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:r.url,method:r.method,headers:{...r.headers},body:r.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(o,f);let c=this.requestIndex.get(e)||[];for(c.unshift(o);c.length>this.maxEntriesPerRequest;){let p=c.pop();p&&(this.entries.delete(p),this.fullResponses.delete(p))}if(this.requestIndex.set(e,c),this.storeFullResponses){let p={timestamp:l,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(o,p)}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 r=this.requestIndex.get(e);if(r){for(let n of r)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var Df=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let o={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?o.body=e.body:typeof e.body=="object"&&(o.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(o.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(o.redirect="manual");let l=await fetch(e.url,o),f=Date.now(),c;try{c=await l.text()}catch{c=null}let p={};return l.headers.forEach((h,g)=>{let v=p[g];v!==void 0?p[g]=Array.isArray(v)?[...v,h]:[v,h]:p[g]=h}),{status:l.status,statusText:l.statusText,headers:p,cookies:[],body:c,time:f-r}}catch(o){throw o.name==="AbortError"?new Error(`Request timeout after ${i}ms`):o}finally{clearTimeout(s)}}};ef();tf();Xc();_m();Bl();var xa=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){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:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}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 r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[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(r).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}}};Rm();import*as cn from"fs/promises";import*as fu from"path";var Lf=class{async readFile(e){return cn.readFile(e,"utf-8")}async writeFile(e,r){let n=fu.dirname(e);await this.mkdir(n),await cn.writeFile(e,r,"utf-8")}async exists(e){try{return await cn.access(e),!0}catch{return!1}}async mkdir(e){await cn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let o=fu.basename(s);for(let l of e)if(this.matchPattern(o,l)){i.push(s);break}})}catch{}return i}async readDir(e){return cn.readdir(e)}async isDirectory(e){try{return(await cn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await cn.readdir(e,{withFileTypes:!0});for(let i of n){let s=fu.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};Mf();var i0=class t{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 ca,this.fileSystem=e.fileSystem||new Lf,this.preprocessor=e.preprocessor||new Ca,this.dataFileParser=e.dataFileParser||new Ea,this.cookieJar=e.cookieJar||new zc,e.enableHistory?this.requestHistory=e.requestHistory||new Ff({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 fa(s)}else this.httpClient=new Df;let r=e.forgeRoot?[ft("path").join(e.forgeRoot,"modules")]:[],n=new is(new Kn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new cs(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new Wc,this.parserRegistry.register("http-forge",new xa),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=ft("path").join(e.forgeRoot,"collections");this.collectionLoader=new Vc(s)}else this.collectionLoader=new Hl(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new rs(e.environmentConfig):rs.fromVariables({}),this.forgeEnv=Gs.fromResolver(this.environmentStore),this.requestExecutor=new cu(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new ss;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof Hl)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,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new rs(e),this.forgeEnv=Gs.fromResolver(this.environmentStore),this.requestExecutor=new cu(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new t(e)}static fromForgeRoot(e="./http-forge",r={}){let n=ft("path"),i=n.join(e,"environments"),s,o=Jc(i);if(Object.keys(o.environments).length>0||Object.keys(o.globalVariables).length>0){s={globalVariables:{...o.globalVariables,...o.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,c]of Object.entries(o.environments)){let p=o.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...c.variables,...p}}}}else{let f=ft("fs"),c=n.join(i,"environments.json");if(f.existsSync(c))try{let p=f.readFileSync(c,"utf-8"),h=JSON.parse(p);if(s={globalVariables:h.globalVariables||{},environments:{},selectedEnvironment:h.selectedEnvironment},h.environments)for(let[g,v]of Object.entries(h.environments)){let _=v;s.environments[g]={name:_.name||g,variables:_.variables||{}}}}catch(p){console.warn(`[ForgeContainer] Failed to load environments from ${c}:`,p)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};NC();MC();my();mi();BC();WC();zC();ax();Cy();Qd();async function j5(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(SN(),bN));return e(t)}async function U5(t){let{runRequest:e}=await Promise.resolve().then(()=>(nc(),op));return e(t)}async function H5(t){let{runCollection:e}=await Promise.resolve().then(()=>(nc(),op));return e(t)}async function B5(t){let{runFolder:e}=await Promise.resolve().then(()=>(nc(),op));return e(t)}async function V5(t){let{runSuite:e}=await Promise.resolve().then(()=>(nc(),op));return e(t)}qy();p0();ia();lx();h0();ef();tf();sS();Xc();_m();Bl();Kw();t0();Mf();bm();$f();Qf();l0();c0();Eh();na();na();a0();function W5(t){let e=t.replace(/\\\n/g," "),r=[],n="",i=0;for(;i<e.length;){let s=e[i];if(s==="\\"&&i+1<e.length)n+=e[++i],i++;else if(s==="'"){for(i++;i<e.length&&e[i]!=="'";)n+=e[i++];i++}else if(s==='"'){for(i++;i<e.length&&e[i]!=='"';)if(e[i]==="\\"&&i+1<e.length){let o=e[i+1];o==='"'||o==="\\"||o==="$"||o==="`"?(n+=o,i+=2):n+=e[i++]}else n+=e[i++];i++}else/\s/.test(s)?(n.length>0&&(r.push(n),n=""),i++):(n+=s,i++)}return n.length>0&&r.push(n),r}function z5(t){try{let e="__FV__",r=[],n=t.replace(/\{\{[^}]+\}\}/g,p=>(r.push(p),`${e}${r.length-1}`)),i=n.indexOf("?");if(i===-1)return{cleanUrl:t,params:[]};let s=n.slice(0,i),o=n.slice(i+1),l=p=>p.replace(new RegExp(`${e}(\\d+)`,"g"),(h,g)=>r[parseInt(g,10)]),f=l(s),c=o.split("&").filter(Boolean).map(p=>{let h=l(p),g=h.indexOf("=");return g===-1?{key:h,value:"",enabled:!0}:{key:decodeURIComponent(h.slice(0,g)),value:decodeURIComponent(h.slice(g+1)),enabled:!0}});return{cleanUrl:f,params:c}}catch{return{cleanUrl:t,params:[]}}}function J5(t){try{let e=new URL(t.replace(/\{\{[^}]+\}\}/g,"placeholder")),r=e.pathname.split("/").filter(Boolean),n=r[r.length-1];return n&&!/^\d+$/.test(n)&&!n.startsWith("{")?n.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):r.length>1?r[r.length-2].replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):e.hostname.replace(/^www\./,"").split(".")[0]??"Request"}catch{return"Request"}}var G5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),Y5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"]);function wN(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function _N(t){return/\{\{[^}]+\}\}/.test(t)}function Py(t,e=16){return t.length>=e&&!_N(t)}function K5(t,e,r){let n=[],i=new Set,s=(o,l)=>{i.has(l)||(i.add(l),n.push({key:o,value:l}))};for(let o of t){let l=o.key.toLowerCase();if(l==="authorization"){let f=o.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);f&&Py(f[2])?s(`${f[1].toUpperCase()}_TOKEN`,f[2]):Py(o.value)&&s("AUTH_TOKEN",o.value)}else G5.has(l)&&Py(o.value)&&s(wN(o.key),o.value)}for(let o of e)Y5.has(o.key.toLowerCase())&&Py(o.value)&&s(wN(o.key),o.value);try{let o=new URL(r.replace(/\{\{[^}]+\}\}/g,"placeholder"));if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)&&!_N(r)){let f=`${o.protocol}//${o.host}`;s("BASE_URL",f)}}catch{}return n}function Q5(t){let e=W5(t.trim()),r=0;for(;r<e.length&&e[r].toLowerCase()==="curl";)r++;let n=e.slice(r),i="",s="",o=[],l=null,f=!1,c=!1,p=[],h=[],g=0;for(;g<n.length;){let T=n[g];if(T==="-X"||T==="--request")i=n[++g]??"";else if(T==="-H"||T==="--header"){let N=n[++g]??"",$=N.indexOf(":");$>0&&o.push({key:N.slice(0,$).trim(),value:N.slice($+1).trim()})}else if(T==="-d"||T==="--data"||T==="--data-raw"||T==="--data-binary"||T==="--data-ascii")l=n[++g]??"";else if(T==="--json")l=n[++g]??"",f=!0;else if(T==="-u"||T==="--user"){let N=n[++g]??"",$=btoa(N);o.push({key:"Authorization",value:`Basic ${$}`})}else if(T==="-b"||T==="--cookie")o.push({key:"Cookie",value:n[++g]??""});else if(T==="--url")s=n[++g]??"";else if(T==="-G"||T==="--get")c=!0;else if(T==="-F"||T==="--form"){let N=n[++g]??"",$=N.indexOf("=");$>0&&p.push({key:N.slice(0,$),value:N.slice($+1)})}else T==="--data-urlencode"?h.push(n[++g]??""):T==="-A"||T==="--user-agent"?o.push({key:"User-Agent",value:n[++g]??""}):T==="-e"||T==="--referer"||T==="--referrer"?o.push({key:"Referer",value:n[++g]??""}):T==="--compressed"||T==="-L"||T==="--location"||T==="-v"||T==="--verbose"||T==="-s"||T==="--silent"||T==="-i"||T==="--include"||T==="-k"||T==="--insecure"||T==="--http1.1"||T==="--http2"||T==="--http3"||(T==="-o"||T==="--output"||T==="--max-time"||T==="--connect-timeout"||T==="-m"||T==="--limit-rate"||T==="--proxy"||T==="-x"?g++:!T.startsWith("-")&&!s&&(s=T));g++}c?i="GET":i||(i=l!==null||p.length>0||h.length>0?"POST":"GET");let{cleanUrl:v,params:_}=z5(s),w=null;if(p.length>0)w={type:"raw",format:"text",content:p.map(N=>`${encodeURIComponent(N.key)}=${encodeURIComponent(N.value)}`).join("&")},o.some(N=>N.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"multipart/form-data"});else if(h.length>0)w={type:"raw",format:"text",content:h.join("&")},o.some(T=>T.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"application/x-www-form-urlencoded"});else if(l!==null){let T=l.trim(),N=f||T.startsWith("{")||T.startsWith("[");w={type:"raw",format:N?"json":"text",content:l},N&&!o.some($=>$.key.toLowerCase()==="content-type")&&o.push({key:"Content-Type",value:"application/json"})}let E=o.map(T=>({...T,enabled:!0})),k=K5(o,_,v||s);return{name:J5(v||s),method:i.toUpperCase(),url:v||s,headers:E,queryParams:_,body:w,suggestedVars:k}}async function Z5(t,e,r,n){let i=RN(t.items);if(i.length===0)return;let s=Math.ceil(i.length/10);for(let o=0;o<i.length;o+=10){let l=i.slice(o,o+10),f=Math.floor(o/10)+1;n?.(`Enhancing requests (batch ${f}/${s})\u2026`,1/s*100);let c=l.map(p=>({id:p.id,name:p.name,method:p.method??"GET",url:p.url??"",bodyContent:r7(p),responseSchema:p.responseSchema?JSON.stringify(p.responseSchema).slice(0,500):void 0,description:p.description?.slice(0,200)}));try{let p=await r.complete(X5(c)),h=e7(p);t7(l,h)}catch{}}await e.saveCollection(t)}function X5(t){return`You are an API testing expert. For each HTTP request below, return two improvements:
1019
1019
  1. "body" \u2014 a realistic, human-readable JSON request body string (not schema placeholders like "string" or 0). If the request has no body or is a GET/HEAD/DELETE, return null.
1020
1020
  2. "testScript" \u2014 a JavaScript postResponse test using pm.test() syntax. Always include a status code check. Add response body assertions if a responseSchema is provided.
1021
1021
 
@@ -1044,7 +1044,7 @@ Return ONLY a valid JSON array (no markdown fences):
1044
1044
  ${r}
1045
1045
  ${n}${i}`}).join(`
1046
1046
 
1047
- `)}function o7(t,e){let r=[];for(let n of t){let i=n.name??n.url??n.id;n.url?.includes(e)&&r.push({requestId:n.id,requestName:i,field:"URL"});for(let s of n.headers??[])String(s.value??"").includes(e)&&r.push({requestId:n.id,requestName:i,field:`Header: ${s.key}`});for(let s of n.query??[])String(s.value??"").includes(e)&&r.push({requestId:n.id,requestName:i,field:`Query: ${s.key}`});n.body?.type==="raw"&&typeof n.body.content=="string"&&n.body.content.includes(e)&&r.push({requestId:n.id,requestName:i,field:"Body"})}return r}LC();Sx();g0();Oh();Qc();Im();y0();x0();s0();function a7(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",o=g7(n);if(o.trimEnd().endsWith("@")||s&&o.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(y7(o))return{contextType:"variable_def",fieldPath:[],prefix:s};let l=o.match(/\.\.\.\s+on\s+(\w*)$/);if(l)return{contextType:"fragment_type",fieldPath:[],prefix:l[1]||""};let f=o.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&CN(o)){let h=qx(o,r),g=h.length>0?h[h.length-1]:void 0,v=xN(o);return{contextType:"argument_value",fieldPath:h,parentType:g,prefix:f[2]||"",currentArg:f[1],currentField:v||void 0}}if(CN(o)){let h=qx(o,r),g=h.length>0?h[h.length-1]:void 0,v=xN(o);return{contextType:"argument",fieldPath:h,parentType:g,prefix:s,currentField:v||void 0}}if(Ox(o,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let p=qx(o,r);return{contextType:"selection_set",fieldPath:p,parentType:p.length>0?p[p.length-1]:void 0,prefix:s}}function l7(t,e){switch(e.contextType){case"root":return u7(t,e.prefix);case"selection_set":return c7(t,e);case"argument":return f7(t,e);case"argument_value":return d7(t,e);case"directive":return p7(t,e.prefix);case"fragment_type":return h7(t,e.prefix);case"variable_def":return m7(t,e.prefix);default:return[]}}function u7(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
1047
+ `)}function o7(t,e){let r=[];for(let n of t){let i=n.name??n.url??n.id;n.url?.includes(e)&&r.push({requestId:n.id,requestName:i,field:"URL"});for(let s of n.headers??[])String(s.value??"").includes(e)&&r.push({requestId:n.id,requestName:i,field:`Header: ${s.key}`});for(let s of n.query??[])String(s.value??"").includes(e)&&r.push({requestId:n.id,requestName:i,field:`Query: ${s.key}`});n.body?.type==="raw"&&typeof n.body.content=="string"&&n.body.content.includes(e)&&r.push({requestId:n.id,requestName:i,field:"Body"})}return r}LC();Sx();g0();qh();Qc();Im();y0();x0();s0();function a7(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",o=g7(n);if(o.trimEnd().endsWith("@")||s&&o.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(y7(o))return{contextType:"variable_def",fieldPath:[],prefix:s};let l=o.match(/\.\.\.\s+on\s+(\w*)$/);if(l)return{contextType:"fragment_type",fieldPath:[],prefix:l[1]||""};let f=o.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&CN(o)){let h=Ox(o,r),g=h.length>0?h[h.length-1]:void 0,v=xN(o);return{contextType:"argument_value",fieldPath:h,parentType:g,prefix:f[2]||"",currentArg:f[1],currentField:v||void 0}}if(CN(o)){let h=Ox(o,r),g=h.length>0?h[h.length-1]:void 0,v=xN(o);return{contextType:"argument",fieldPath:h,parentType:g,prefix:s,currentField:v||void 0}}if(qx(o,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let p=Ox(o,r);return{contextType:"selection_set",fieldPath:p,parentType:p.length>0?p[p.length-1]:void 0,prefix:s}}function l7(t,e){switch(e.contextType){case"root":return u7(t,e.prefix);case"selection_set":return c7(t,e);case"argument":return f7(t,e);case"argument_value":return d7(t,e);case"directive":return p7(t,e.prefix);case"fragment_type":return h7(t,e.prefix);case"variable_def":return m7(t,e.prefix);default:return[]}}function u7(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
1048
1048
  $0
1049
1049
  }`},{label:"mutation",detail:"Mutation operation",insertText:`mutation \${1:OperationName} {
1050
1050
  $0
@@ -1054,4 +1054,4 @@ ${n}${i}`}).join(`
1054
1054
  $0
1055
1055
  }`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function f7(t,e){if(!e.currentField||!e.parentType)return[];let r=t.types.get(e.parentType);if(!r)return[];let n=r.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 d7(t,e){if(!e.currentArg||!e.currentField||!e.parentType)return[];let r=[],n=t.types.get(e.parentType);if(!n)return r;let i=n.fields.find(f=>f.name===e.currentField);if(!i)return r;let s=i.args.find(f=>f.name===e.currentArg);if(!s)return r;let o=s.type.replace(/[!\[\]]/g,""),l=t.types.get(o);if(l&&l.kind==="ENUM")for(let f of l.enumValues)(!e.prefix||f.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:f.name,kind:"enum",detail:l.name,description:f.description,deprecated:f.isDeprecated,sortOrder:0});else if(o==="Boolean")for(let f of["true","false"])(!e.prefix||f.startsWith(e.prefix.toLowerCase()))&&r.push({label:f,kind:"keyword",detail:"Boolean",sortOrder:0});return r}function p7(t,e){let r=[];for(let n of t.directives)if(!e||n.name.toLowerCase().startsWith(e.toLowerCase())){let i=n.args.length>0?`(${n.args.map(s=>`${s.name}: ${s.type}`).join(", ")})`:"";r.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 r}function h7(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="OBJECT"||i.kind==="INTERFACE"||i.kind==="UNION")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function m7(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="SCALAR"||i.kind==="INPUT_OBJECT"||i.kind==="ENUM")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function EN(t,e,r){let n=t.type.replace(/[!\[\]]/g,""),i=!1;if(r){let o=r.types.get(n);i=!!o&&(o.kind==="OBJECT"||o.kind==="INTERFACE"||o.kind==="UNION")}else i=!new Set(["String","Int","Float","Boolean","ID"]).has(n);let s=t.name;if(t.args.length>0){let o=t.args.filter(l=>l.type.endsWith("!"));if(o.length>0){let l=o.map((f,c)=>`${f.name}: \${${c+1}}`).join(", ");s=`${t.name}(${l})`}}return i&&(s+=` {
1056
1056
  $0
1057
- }`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function g7(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function Ox(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function CN(t){return Ox(t,"(",")")>0}function y7(t){if(Ox(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function xN(t){let e=0;for(let r=t.length-1;r>=0;r--)if(t[r]===")")e++;else if(t[r]==="("){if(e===0){let i=t.slice(0,r).trimEnd().match(/(\w+)$/);return i?i[1]:null}e--}return null}function qx(t,e){if(!e)return[];let r=[],n=e.queryType,i=t.match(/\b(query|mutation|subscription)\b/);i&&(i[1]==="mutation"&&e.mutationType?n=e.mutationType:i[1]==="subscription"&&e.subscriptionType&&(n=e.subscriptionType)),r.push(n);let s=v7(t),o=e.types.get(n);for(let l=0;l<s.length;l++){let f=s[l];if(f!=="{"){if(f==="}"){r.pop(),o=r.length>0?e.types.get(r[r.length-1]):void 0;continue}if(l+1<s.length&&(s[l+1]==="{"||s[l+1]==="(")){let c=l+1;if(s[c]==="("){let p=1;for(c++;c<s.length&&p>0;)s[c]==="("?p++:s[c]===")"&&p--,c++}if(c<s.length&&s[c]==="{"&&o){let p=o.fields.find(h=>h.name===f);if(p){let h=p.type.replace(/[!\[\]]/g,"");r.push(h),o=e.types.get(h)}}}}}return r}function v7(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}v0();lR();E0();_C();Og();CC();RC();aR();sy();f0();d0();hx();AC();fx();tp();mx();function Ty(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function kx(t){return{name:t,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function IN(t){if(t.durations.length===0){t.min=0,t.max=0,t.avg=0,t.p50=0,t.p90=0,t.p95=0,t.p99=0;return}let e=[...t.durations].sort((n,i)=>n-i),r=t.durations.reduce((n,i)=>n+i,0);t.min=e[0],t.max=e[e.length-1],t.avg=Math.round(r/t.durations.length),t.p50=Ty(e,50),t.p90=Ty(e,90),t.p95=Ty(e,95),t.p99=Ty(e,99)}var Px=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=kx("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=kx("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,r,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let o=this.summary.passed+this.summary.failed;if(this.summary.passRate=o>0?Math.round(this.summary.passed/o*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,kx(e));let l=this.byRequest.get(e);if(l.count++,n?l.passed++:l.failed++,l.durations.push(r),IN(l),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),IN(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((r,n)=>{e.push({message:n,count:r})}),e.sort((r,n)=>n.count-r.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}}};$C();na();import*as Rs from"fs";import*as Qa from"path";var Tx=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 r=Qa.join(this.suiteDir,e,"request.json");if(Rs.existsSync(r))try{let n=JSON.parse(Rs.readFileSync(r,"utf-8")),i=Qa.join(this.suiteDir,e,"scripts"),s=Ch(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,r){if(!this.suiteDir)return;let n=Qa.join(this.suiteDir,e);Rs.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,Rs.writeFileSync(Qa.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let o=Qa.join(n,"scripts");xh(o,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:Rs.existsSync(Qa.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let r=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(r){let s,o=[],l=[];if(n){s=n.scripts;let f=this.findRequestInCollection(n,e.requestId);f&&(o=f.folderScriptsChain,l=f.folderAuthChain)}return{request:r,suiteRequest:e,collectionScripts:s,collectionAuth:n?.auth,folderScriptsChain:o,folderAuthChain:l}}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,collectionAuth:n.auth,folderScriptsChain:i.folderScriptsChain,folderAuthChain:i.folderAuthChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n,i=[]){for(let s of e)if(s.type==="folder"){let o=s;if(!o.items)continue;let l=o.scripts?[...n,o.scripts]:n,f=o.auth?[...i,o.auth]:i,c=this.searchItems(o.items||[],r,l,f);if(c)return c}else if(s.id===r)return{request:this.normalizeRequest(s),folderScriptsChain:n,folderAuthChain:i}}normalizeRequest(e){let{type:r,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(r=>({key:r.key||"",value:r.value||"",enabled:r.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([r,n])=>({key:r,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,r){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===r);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let r=this.suite.requests.find(n=>n.slug===e);if(r)return this.resolveRequest(r)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){let n=this.resolveRequest(r);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){if(!r.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);r.slug=xn(r.name||"request",i)}let n=this.resolveRequest(r);if(n){let i=this.collectionService.getCollection(r.collectionId);e.push({id:`${r.collectionId}:${r.requestId}`,collectionId:r.collectionId,requestId:r.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:r.folderPath||"",enabled:r.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(r.slug),slug:r.slug})}}return e}getSelectedRequests(e){let r=[];for(let n of e){let[i,s]=n.split(":"),o=this.suite?.requests.find(l=>l.collectionId===i&&l.requestId===s);if(o){let l=this.resolveRequest(o);l&&r.push(l)}}return r}addRequest(e,r){if(this.suite){if(this.suiteDir&&r){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=xn(e.name||r.name||"request",n)}this.saveSuiteRequest(e.slug,r)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let r=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!r.has(e))return e;let n=2;for(;r.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(r=>r.requestId!==e))}reorderRequests(e){if(!this.suite)return;let r=new Map;for(let i of this.suite.requests)r.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=r.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,r){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,r);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=r.name||n.name,n.method=r.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let r=this.suite.requests.find(s=>s.slug===e);if(!r)return;let n=this.collectionService.getCollection(r.collectionId);if(!n)return;let i=this.findRequestInCollection(n,r.requestId);if(i)return this.saveSuiteRequest(e,i.request),r.name=i.request.name||r.name,r.method=i.request.method||r.method,i.request}};m0();xm();Rm();xC();EC();kC();OC();IC();qC();PC();kh();Th();$h();Cn();export{Ga as AmbiguousRefError,ay as AwsSecretResolver,ly as AzureKeyVaultResolver,eI as BODY_FILE_MAP,UC as CACHE_BUSTING_TOOLS,by as COLLECTION_INPUT_SCHEMA,mu as CONFIG_FILES,Hl as CollectionLoader,Hf as CollectionLoaderFactory,no as CollectionRequestExecutor,Bf as CollectionService,gu as ConfigService,zc as CookieJar,Vf as CookieService,ht as CookieUtils,Yt as DEFAULT_CONFIG,Qn as DEFAULT_REQUEST_SETTINGS,Jd as DEFAULT_SUITE_CONFIG,hI as DYNAMIC_VARIABLES,Ea as DataFileParser,dy as DopplerResolver,Jf as EnvironmentConfigService,rs as EnvironmentResolver,ku as ExampleGenerator,Sy as FOLDER_INPUT_SCHEMA,Df as FetchHttpClient,Vc as FolderCollectionLoader,zs as FolderCollectionStore,i0 as ForgeContainer,Gs as ForgeEnv,J as GENERIC_TOOL_NAMES,fy as GcpSecretResolver,Yf as GraphQLSchemaService,ux as HTTP_METHOD_MAP,xo as HTTP_METHOD_REVERSE,uy as HashiCorpVaultResolver,yu as HistoryAnalyzer,rp as HtmlReportGenerator,xa as HttpForgeParser,is as HttpRequestService,Yu as InMemoryCookieJar,ss as InterceptorChain,Xu as JUnitReportGenerator,hu as JsonCollectionLoader,oS as LoggingRequestInterceptor,_y as MCP_PROMPTS,Or as METADATA_FILES,ep as McpRunStore,gm as ModuleLoader,Lf as NodeFileSystem,fa as NodeHttpClient,jf as OAuth2TokenManager,cy as OnePasswordResolver,Ou as OpenApiExporter,_o as OpenApiImporter,Wc as ParserRegistry,Wf as PersistentCookieJar,vy as REQUEST_INPUT_SCHEMA,qa as ROOT_DIRECTORIES,Wu as RefResolver,cu as RequestExecutor,Zf as RequestHistoryService,Ff as RequestHistoryStore,Gf as RequestPreparer,Ca as RequestPreprocessor,Nf as RequestScriptSession,rc as ResultStorageService,lS as RetryErrorInterceptor,Bc as SCHEMA_FILES,un as SCRIPTS_DIR,Rh as SCRIPT_FILES,wy as SUITE_INPUT_SCHEMA,zu as SchemaInferenceService,go as SchemaInferrer,Ju as ScriptAnalyzer,cs as ScriptExecutor,zd as SecretResolverRegistry,Ba as ServiceContainer,ne as ServiceIdentifiers,Px as StatisticsService,Gd as TestSuiteService,Tx as TestSuiteStore,aS as TimingResponseInterceptor,Kn as UrlBuilder,ca as VariableInterpolator,ua as VariableResolver,DC as applyEnvSuggestionsToItems,Iz as applyExtractionPlan,Kc as applyFilterChain,oa as augmentWithDynamicVars,eN as bootstrapNodeRuntime,ex as buildCollectionToolDescription,GC as buildCollectionToolName,Ez as buildExtractionPlan,tx as buildFolderToolDescription,YC as buildFolderToolName,jC as buildGenericTools,ox as buildMcpToolList,VC as buildPromptResult,XC as buildRequestToolDescription,JC as buildRequestToolName,Ku as buildResultFileName,rx as buildSuiteToolDescription,KC as buildSuiteToolName,nI as cleanupOldBodyFiles,Sm as concatenateScripts,TC as countRequests,Tf as createExpectChain,XO as createLodashShim,j5 as createMcpRuntime,Yw as createModuleLoader,ym as createMomentShim,Nn as createNodeContainer,vm as createResponseObject,nz as createScriptConsole,Zw as createTestFunction,f2 as createVariableResolver,sx as decodeCursor,B$ as decodeFolderName,bs as decodeFolderPath,nx as dedupeToolsByName,Oj as deepClone,Qb as deleteItemFromTree,yy as detectEnvSuggestions,xz as detectSensitiveData,HC as dispatchGenericTool,ix as encodeCursor,br as encodeFolderName,Z5 as enhanceCollection,Qr as enumerateFolders,la as evaluateExpression,m5 as expandSummary,fz as exportCollectionToRestClient,Kb as findItemById,Xe as flattenRequests,Tj as formatBytes,uu as formatConsoleOutput,Aj as formatDuration,St as generateId,xn as generateSlug,Yb as generateUUID,l7 as getCompletions,cz as getRestClientExportFolder,W$ as getServiceContainer,Af as hasChanged,aa as isExpression,kj as isPlainObject,qh as isSystemEnvironmentFile,Jc as loadEnvironmentsFromFolder,Wa as mcpToolSegment,ws as mcpToolToken,Hc as mergeHeadersCaseInsensitive,iS as mergeRequestSettings,hy as normalizeFolderInput,Xw as normalizeHeaders,Q5 as parseCurlCommand,Yc as parseFilterChain,QC as parseMcpToolName,Em as parsePostmanEnvironment,wz as parsePostmanEnvironmentFile,a7 as parseQueryContext,rI as prepareBodyForSave,tI as readBodyFromDir,iI as readSchemaFile,Ch as readScriptsFromDir,w0 as redactBody,R0 as redactFullResponse,C0 as redactFullResultDetails,ki as redactHeaders,_0 as redactHistoryEntry,km as redactUrl,gy as registerCoreServices,yx as resolveCollectionRef,ns as resolveDynamicVariable,r2 as resolveDynamicVariablesInString,vx as resolveFolderRef,ZC as resolveFolderToken,bx as resolveRequestRef,Gu as resolveToken,H5 as runCollection,B5 as runFolder,U5 as runRequest,V5 as runSuite,Pj as safeJsonParse,At as sanitizeName,n7 as scanCollectionForEnvVarsWithAi,Zb as searchForItemPath,Xb as searchForItemPathById,oI as sortItemsByOrder,pu as writeEnvFile,Cm as writeFolderItems,sI as writeSchemaFiles,Uf as writeScriptFile,xh as writeScriptsToDir};
1057
+ }`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function g7(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function qx(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function CN(t){return qx(t,"(",")")>0}function y7(t){if(qx(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function xN(t){let e=0;for(let r=t.length-1;r>=0;r--)if(t[r]===")")e++;else if(t[r]==="("){if(e===0){let i=t.slice(0,r).trimEnd().match(/(\w+)$/);return i?i[1]:null}e--}return null}function Ox(t,e){if(!e)return[];let r=[],n=e.queryType,i=t.match(/\b(query|mutation|subscription)\b/);i&&(i[1]==="mutation"&&e.mutationType?n=e.mutationType:i[1]==="subscription"&&e.subscriptionType&&(n=e.subscriptionType)),r.push(n);let s=v7(t),o=e.types.get(n);for(let l=0;l<s.length;l++){let f=s[l];if(f!=="{"){if(f==="}"){r.pop(),o=r.length>0?e.types.get(r[r.length-1]):void 0;continue}if(l+1<s.length&&(s[l+1]==="{"||s[l+1]==="(")){let c=l+1;if(s[c]==="("){let p=1;for(c++;c<s.length&&p>0;)s[c]==="("?p++:s[c]===")"&&p--,c++}if(c<s.length&&s[c]==="{"&&o){let p=o.fields.find(h=>h.name===f);if(p){let h=p.type.replace(/[!\[\]]/g,"");r.push(h),o=e.types.get(h)}}}}}return r}function v7(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}v0();lR();E0();_C();qg();CC();RC();aR();sy();f0();d0();hx();AC();fx();tp();mx();function Ty(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function kx(t){return{name:t,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function IN(t){if(t.durations.length===0){t.min=0,t.max=0,t.avg=0,t.p50=0,t.p90=0,t.p95=0,t.p99=0;return}let e=[...t.durations].sort((n,i)=>n-i),r=t.durations.reduce((n,i)=>n+i,0);t.min=e[0],t.max=e[e.length-1],t.avg=Math.round(r/t.durations.length),t.p50=Ty(e,50),t.p90=Ty(e,90),t.p95=Ty(e,95),t.p99=Ty(e,99)}var Px=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=kx("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=kx("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,r,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let o=this.summary.passed+this.summary.failed;if(this.summary.passRate=o>0?Math.round(this.summary.passed/o*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,kx(e));let l=this.byRequest.get(e);if(l.count++,n?l.passed++:l.failed++,l.durations.push(r),IN(l),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),IN(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((r,n)=>{e.push({message:n,count:r})}),e.sort((r,n)=>n.count-r.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}}};$C();na();import*as Rs from"fs";import*as Qa from"path";var Tx=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 r=Qa.join(this.suiteDir,e,"request.json");if(Rs.existsSync(r))try{let n=JSON.parse(Rs.readFileSync(r,"utf-8")),i=Qa.join(this.suiteDir,e,"scripts"),s=Ch(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,r){if(!this.suiteDir)return;let n=Qa.join(this.suiteDir,e);Rs.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,Rs.writeFileSync(Qa.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let o=Qa.join(n,"scripts");xh(o,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:Rs.existsSync(Qa.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let r=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(r){let s,o=[],l=[];if(n){s=n.scripts;let f=this.findRequestInCollection(n,e.requestId);f&&(o=f.folderScriptsChain,l=f.folderAuthChain)}return{request:r,suiteRequest:e,collectionScripts:s,collectionAuth:n?.auth,folderScriptsChain:o,folderAuthChain:l}}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,collectionAuth:n.auth,folderScriptsChain:i.folderScriptsChain,folderAuthChain:i.folderAuthChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n,i=[]){for(let s of e)if(s.type==="folder"){let o=s;if(!o.items)continue;let l=o.scripts?[...n,o.scripts]:n,f=o.auth?[...i,o.auth]:i,c=this.searchItems(o.items||[],r,l,f);if(c)return c}else if(s.id===r)return{request:this.normalizeRequest(s),folderScriptsChain:n,folderAuthChain:i}}normalizeRequest(e){let{type:r,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(r=>({key:r.key||"",value:r.value||"",enabled:r.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([r,n])=>({key:r,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,r){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===r);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let r=this.suite.requests.find(n=>n.slug===e);if(r)return this.resolveRequest(r)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){let n=this.resolveRequest(r);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){if(!r.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);r.slug=xn(r.name||"request",i)}let n=this.resolveRequest(r);if(n){let i=this.collectionService.getCollection(r.collectionId);e.push({id:`${r.collectionId}:${r.requestId}`,collectionId:r.collectionId,requestId:r.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:r.folderPath||"",enabled:r.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(r.slug),slug:r.slug})}}return e}getSelectedRequests(e){let r=[];for(let n of e){let[i,s]=n.split(":"),o=this.suite?.requests.find(l=>l.collectionId===i&&l.requestId===s);if(o){let l=this.resolveRequest(o);l&&r.push(l)}}return r}addRequest(e,r){if(this.suite){if(this.suiteDir&&r){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=xn(e.name||r.name||"request",n)}this.saveSuiteRequest(e.slug,r)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let r=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!r.has(e))return e;let n=2;for(;r.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(r=>r.requestId!==e))}reorderRequests(e){if(!this.suite)return;let r=new Map;for(let i of this.suite.requests)r.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=r.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,r){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,r);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=r.name||n.name,n.method=r.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let r=this.suite.requests.find(s=>s.slug===e);if(!r)return;let n=this.collectionService.getCollection(r.collectionId);if(!n)return;let i=this.findRequestInCollection(n,r.requestId);if(i)return this.saveSuiteRequest(e,i.request),r.name=i.request.name||r.name,r.method=i.request.method||r.method,i.request}};m0();xm();Rm();xC();EC();kC();qC();IC();OC();PC();kh();Th();$h();Cn();export{Ga as AmbiguousRefError,ay as AwsSecretResolver,ly as AzureKeyVaultResolver,eI as BODY_FILE_MAP,UC as CACHE_BUSTING_TOOLS,by as COLLECTION_INPUT_SCHEMA,mu as CONFIG_FILES,Hl as CollectionLoader,Hf as CollectionLoaderFactory,no as CollectionRequestExecutor,Bf as CollectionService,gu as ConfigService,zc as CookieJar,Vf as CookieService,ht as CookieUtils,Yt as DEFAULT_CONFIG,Qn as DEFAULT_REQUEST_SETTINGS,Jd as DEFAULT_SUITE_CONFIG,hI as DYNAMIC_VARIABLES,Ea as DataFileParser,dy as DopplerResolver,Jf as EnvironmentConfigService,rs as EnvironmentResolver,ku as ExampleGenerator,Sy as FOLDER_INPUT_SCHEMA,Df as FetchHttpClient,Vc as FolderCollectionLoader,zs as FolderCollectionStore,i0 as ForgeContainer,Gs as ForgeEnv,J as GENERIC_TOOL_NAMES,fy as GcpSecretResolver,Yf as GraphQLSchemaService,ux as HTTP_METHOD_MAP,xo as HTTP_METHOD_REVERSE,uy as HashiCorpVaultResolver,yu as HistoryAnalyzer,rp as HtmlReportGenerator,xa as HttpForgeParser,is as HttpRequestService,Yu as InMemoryCookieJar,ss as InterceptorChain,Xu as JUnitReportGenerator,hu as JsonCollectionLoader,oS as LoggingRequestInterceptor,_y as MCP_PROMPTS,qr as METADATA_FILES,ep as McpRunStore,gm as ModuleLoader,Lf as NodeFileSystem,fa as NodeHttpClient,jf as OAuth2TokenManager,cy as OnePasswordResolver,qu as OpenApiExporter,_o as OpenApiImporter,Wc as ParserRegistry,Wf as PersistentCookieJar,vy as REQUEST_INPUT_SCHEMA,Oa as ROOT_DIRECTORIES,Wu as RefResolver,cu as RequestExecutor,Zf as RequestHistoryService,Ff as RequestHistoryStore,Gf as RequestPreparer,Ca as RequestPreprocessor,Nf as RequestScriptSession,rc as ResultStorageService,lS as RetryErrorInterceptor,Bc as SCHEMA_FILES,un as SCRIPTS_DIR,Rh as SCRIPT_FILES,wy as SUITE_INPUT_SCHEMA,zu as SchemaInferenceService,go as SchemaInferrer,Ju as ScriptAnalyzer,cs as ScriptExecutor,zd as SecretResolverRegistry,Ba as ServiceContainer,ne as ServiceIdentifiers,Px as StatisticsService,Gd as TestSuiteService,Tx as TestSuiteStore,aS as TimingResponseInterceptor,Kn as UrlBuilder,ca as VariableInterpolator,ua as VariableResolver,DC as applyEnvSuggestionsToItems,Iz as applyExtractionPlan,Kc as applyFilterChain,oa as augmentWithDynamicVars,eN as bootstrapNodeRuntime,ex as buildCollectionToolDescription,GC as buildCollectionToolName,Ez as buildExtractionPlan,tx as buildFolderToolDescription,YC as buildFolderToolName,jC as buildGenericTools,ox as buildMcpToolList,VC as buildPromptResult,XC as buildRequestToolDescription,JC as buildRequestToolName,Ku as buildResultFileName,rx as buildSuiteToolDescription,KC as buildSuiteToolName,nI as cleanupOldBodyFiles,Sm as concatenateScripts,TC as countRequests,Tf as createExpectChain,Xq as createLodashShim,j5 as createMcpRuntime,Yw as createModuleLoader,ym as createMomentShim,Nn as createNodeContainer,vm as createResponseObject,nz as createScriptConsole,Zw as createTestFunction,f2 as createVariableResolver,sx as decodeCursor,B$ as decodeFolderName,bs as decodeFolderPath,nx as dedupeToolsByName,qj as deepClone,Qb as deleteItemFromTree,yy as detectEnvSuggestions,xz as detectSensitiveData,HC as dispatchGenericTool,ix as encodeCursor,br as encodeFolderName,Z5 as enhanceCollection,Qr as enumerateFolders,la as evaluateExpression,m5 as expandSummary,fz as exportCollectionToRestClient,Kb as findItemById,Xe as flattenRequests,Tj as formatBytes,uu as formatConsoleOutput,Aj as formatDuration,St as generateId,xn as generateSlug,Yb as generateUUID,l7 as getCompletions,cz as getRestClientExportFolder,W$ as getServiceContainer,Af as hasChanged,aa as isExpression,kj as isPlainObject,Oh as isSystemEnvironmentFile,Jc as loadEnvironmentsFromFolder,Wa as mcpToolSegment,ws as mcpToolToken,Hc as mergeHeadersCaseInsensitive,iS as mergeRequestSettings,hy as normalizeFolderInput,Xw as normalizeHeaders,Q5 as parseCurlCommand,Yc as parseFilterChain,QC as parseMcpToolName,Em as parsePostmanEnvironment,wz as parsePostmanEnvironmentFile,a7 as parseQueryContext,rI as prepareBodyForSave,tI as readBodyFromDir,iI as readSchemaFile,Ch as readScriptsFromDir,w0 as redactBody,R0 as redactFullResponse,C0 as redactFullResultDetails,ki as redactHeaders,_0 as redactHistoryEntry,km as redactUrl,gy as registerCoreServices,yx as resolveCollectionRef,ns as resolveDynamicVariable,r2 as resolveDynamicVariablesInString,vx as resolveFolderRef,ZC as resolveFolderToken,bx as resolveRequestRef,Gu as resolveToken,H5 as runCollection,B5 as runFolder,U5 as runRequest,V5 as runSuite,Pj as safeJsonParse,At as sanitizeName,n7 as scanCollectionForEnvVarsWithAi,Zb as searchForItemPath,Xb as searchForItemPathById,oI as sortItemsByOrder,pu as writeEnvFile,Cm as writeFolderItems,sI as writeSchemaFiles,Uf as writeScriptFile,xh as writeScriptsToDir};